Spells content (#897)
* modifiers * counter spell, and 2 new spell scrolls * Update magical_acceleration.yml * Update T0_counter_spell.yml
This commit is contained in:
22
Content.Server/_CP14/ModularCraft/Modifiers/EditArmor.cs
Normal file
22
Content.Server/_CP14/ModularCraft/Modifiers/EditArmor.cs
Normal file
@@ -0,0 +1,22 @@
|
||||
using Content.Shared._CP14.ModularCraft;
|
||||
using Content.Shared._CP14.ModularCraft.Components;
|
||||
using Content.Shared.Armor;
|
||||
using Content.Shared.Damage;
|
||||
|
||||
namespace Content.Server._CP14.ModularCraft.Modifiers;
|
||||
|
||||
public sealed partial class EditArmor : CP14ModularCraftModifier
|
||||
{
|
||||
[DataField(required: true)]
|
||||
public DamageModifierSet Modifiers = new();
|
||||
|
||||
public override void Effect(EntityManager entManager, Entity<CP14ModularCraftStartPointComponent> start, Entity<CP14ModularCraftPartComponent>? part)
|
||||
{
|
||||
if (!entManager.TryGetComponent<ArmorComponent>(start, out var armor))
|
||||
return;
|
||||
|
||||
var armorSystem = entManager.System<SharedArmorSystem>();
|
||||
|
||||
armorSystem.EditArmorCoefficients(start, Modifiers, armor);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,26 @@
|
||||
using Content.Shared._CP14.ModularCraft;
|
||||
using Content.Shared._CP14.ModularCraft.Components;
|
||||
using Content.Shared.Armor;
|
||||
using Content.Shared.Clothing;
|
||||
using Content.Shared.Damage;
|
||||
|
||||
namespace Content.Server._CP14.ModularCraft.Modifiers;
|
||||
|
||||
public sealed partial class EditClothingSpeed : CP14ModularCraftModifier
|
||||
{
|
||||
[DataField]
|
||||
public float WalkModifier = 1f;
|
||||
|
||||
[DataField]
|
||||
public float SprintModifier = 1f;
|
||||
|
||||
public override void Effect(EntityManager entManager, Entity<CP14ModularCraftStartPointComponent> start, Entity<CP14ModularCraftPartComponent>? part)
|
||||
{
|
||||
if (!entManager.TryGetComponent<ClothingSpeedModifierComponent>(start, out var speed))
|
||||
return;
|
||||
|
||||
var speedModifierSystem = entManager.System<ClothingSpeedModifierSystem>();
|
||||
|
||||
speedModifierSystem.EditSpeedModifiers(start, WalkModifier, SprintModifier, speed);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,40 @@
|
||||
using Content.Shared._CP14.ModularCraft;
|
||||
using Content.Shared._CP14.ModularCraft.Components;
|
||||
using Content.Shared._CP14.MagicManacostModify;
|
||||
using Content.Shared._CP14.MagicRitual.Prototypes;
|
||||
using Content.Shared.FixedPoint;
|
||||
using Robust.Shared.Prototypes;
|
||||
|
||||
namespace Content.Server._CP14.ModularCraft.Modifiers;
|
||||
|
||||
public sealed partial class EditManacostModify : CP14ModularCraftModifier
|
||||
{
|
||||
[DataField]
|
||||
public Dictionary<ProtoId<CP14MagicTypePrototype>, FixedPoint2> Modifiers = new();
|
||||
|
||||
[DataField]
|
||||
public FixedPoint2 GlobalModifier = 1f;
|
||||
|
||||
public override void Effect(EntityManager entManager, Entity<CP14ModularCraftStartPointComponent> start, Entity<CP14ModularCraftPartComponent>? part)
|
||||
{
|
||||
if (!entManager.TryGetComponent<CP14MagicManacostModifyComponent>(start, out var manacostModifyComp))
|
||||
return;
|
||||
|
||||
foreach (var (magicType, modifier) in Modifiers)
|
||||
{
|
||||
if (manacostModifyComp.Modifiers.ContainsKey(magicType))
|
||||
{
|
||||
if (modifier >= 1f)
|
||||
manacostModifyComp.Modifiers[magicType] += modifier - 1f;
|
||||
else
|
||||
manacostModifyComp.Modifiers[magicType] -= 1f - modifier;
|
||||
}
|
||||
else
|
||||
{
|
||||
manacostModifyComp.Modifiers[magicType] = modifier;
|
||||
}
|
||||
}
|
||||
|
||||
manacostModifyComp.GlobalModifier += GlobalModifier;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user