diff --git a/Content.Shared/_CP14/MagicSpell/Spells/CP14SpellSpawnEntity.cs b/Content.Shared/_CP14/MagicSpell/Spells/CP14SpellSpawnEntity.cs deleted file mode 100644 index b19cd48a41..0000000000 --- a/Content.Shared/_CP14/MagicSpell/Spells/CP14SpellSpawnEntity.cs +++ /dev/null @@ -1,68 +0,0 @@ -using Robust.Shared.Map; -using Robust.Shared.Prototypes; - -namespace Content.Shared._CP14.MagicSpell.Spells; - -public sealed partial class CP14SpellSpawnEntity : CP14SpellEffect -{ - [DataField] - public List Spawns = new(); - - [DataField] - public string Key = "target"; - - [DataField] - public bool TryParent = false; - - //Я сделал хуйню - public override void Effect(EntityManager entManager, CP14SpellEffectBaseArgs args) - { - EntityCoordinates? targetPos = null; - EntityUid? targetEntity = null; - TransformComponent? transformComponent = null; - - var transform = entManager.System(); - switch (Key) - { - case "target": - targetPos = args.Position; - - if (args.Target is not null && entManager.TryGetComponent(args.Target, out transformComponent)) - { - targetPos = transformComponent.Coordinates; - targetEntity = args.Target; - } - - break; - case "user": - if (args.User is null || !entManager.TryGetComponent(args.User.Value, out transformComponent)) - return; - targetEntity = args.User; - targetPos = transformComponent.Coordinates; - break; - } - - - if (TryParent) - { - if (transformComponent is not null && targetEntity is not null) - { - foreach (var spawn in Spawns) - { - var s = entManager.SpawnAtPosition(spawn, transformComponent.Coordinates); - transform.SetParent(s, targetEntity.Value); - } - } - } - else - { - if (targetPos is not null) - { - foreach (var spawn in Spawns) - { - var s = entManager.SpawnAtPosition(spawn, targetPos.Value); - } - } - } - } -} diff --git a/Content.Shared/_CP14/MagicSpell/Spells/CP14SpellSpawnEntityOnTarget.cs b/Content.Shared/_CP14/MagicSpell/Spells/CP14SpellSpawnEntityOnTarget.cs new file mode 100644 index 0000000000..6545f85b7e --- /dev/null +++ b/Content.Shared/_CP14/MagicSpell/Spells/CP14SpellSpawnEntityOnTarget.cs @@ -0,0 +1,27 @@ +using Robust.Shared.Map; +using Robust.Shared.Prototypes; + +namespace Content.Shared._CP14.MagicSpell.Spells; + +public sealed partial class CP14SpellSpawnEntityOnTarget : CP14SpellEffect +{ + [DataField] + public List Spawns = new(); + + public override void Effect(EntityManager entManager, CP14SpellEffectBaseArgs args) + { + EntityCoordinates? targetPoint = null; + if (args.Position is not null) + targetPoint = args.Position.Value; + else if (args.Target is not null && entManager.TryGetComponent(args.Target.Value, out var transformComponent)) + targetPoint = transformComponent.Coordinates; + + if (targetPoint is null) + return; + + foreach (var spawn in Spawns) + { + entManager.SpawnAtPosition(spawn, targetPoint.Value); + } + } +} diff --git a/Content.Shared/_CP14/MagicSpell/Spells/CP14SpellSpawnEntityOnUser.cs b/Content.Shared/_CP14/MagicSpell/Spells/CP14SpellSpawnEntityOnUser.cs new file mode 100644 index 0000000000..43b3cc34e5 --- /dev/null +++ b/Content.Shared/_CP14/MagicSpell/Spells/CP14SpellSpawnEntityOnUser.cs @@ -0,0 +1,21 @@ +using Robust.Shared.Map; +using Robust.Shared.Prototypes; + +namespace Content.Shared._CP14.MagicSpell.Spells; + +public sealed partial class CP14SpellSpawnEntityOnUser : CP14SpellEffect +{ + [DataField] + public List Spawns = new(); + + public override void Effect(EntityManager entManager, CP14SpellEffectBaseArgs args) + { + if (args.User is null || !entManager.TryGetComponent(args.User.Value, out var transformComponent)) + return; + + foreach (var spawn in Spawns) + { + entManager.SpawnAtPosition(spawn, transformComponent.Coordinates); + } + } +} diff --git a/Resources/Prototypes/_CP14/Entities/Actions/Spells/cure_wounds.yml b/Resources/Prototypes/_CP14/Entities/Actions/Spells/cure_wounds.yml index a8fe113df5..f48ebeb081 100644 --- a/Resources/Prototypes/_CP14/Entities/Actions/Spells/cure_wounds.yml +++ b/Resources/Prototypes/_CP14/Entities/Actions/Spells/cure_wounds.yml @@ -6,13 +6,11 @@ - type: CP14MagicEffect manaCost: 15 telegraphyEffects: - - !type:CP14SpellSpawnEntity - key: target + - !type:CP14SpellSpawnEntityOnTarget spawns: - CP14ImpactEffectCureWounds effects: - - !type:CP14SpellSpawnEntity - key: target + - !type:CP14SpellSpawnEntityOnTarget spawns: - CP14ImpactEffectCureWounds - !type:CP14SpellApplyEntityEffect diff --git a/Resources/Prototypes/_CP14/Entities/Actions/Spells/earth_wall.yml b/Resources/Prototypes/_CP14/Entities/Actions/Spells/earth_wall.yml index a6699f47b7..69b54713f3 100644 --- a/Resources/Prototypes/_CP14/Entities/Actions/Spells/earth_wall.yml +++ b/Resources/Prototypes/_CP14/Entities/Actions/Spells/earth_wall.yml @@ -6,13 +6,11 @@ - type: CP14MagicEffect manaCost: 15 telegraphyEffects: - - !type:CP14SpellSpawnEntity - key: target + - !type:CP14SpellSpawnEntityOnTarget spawns: - CP14ImpactEffectEarthWall effects: - - !type:CP14SpellSpawnEntity - key: target + - !type:CP14SpellSpawnEntityOnTarget spawns: - CP14WallSpawnEarthWall - type: CP14MagicEffectVerbalAspect diff --git a/Resources/Prototypes/_CP14/Entities/Actions/Spells/fireball.yml b/Resources/Prototypes/_CP14/Entities/Actions/Spells/fireball.yml index 715983bb67..b2606a5e10 100644 --- a/Resources/Prototypes/_CP14/Entities/Actions/Spells/fireball.yml +++ b/Resources/Prototypes/_CP14/Entities/Actions/Spells/fireball.yml @@ -6,8 +6,7 @@ - type: CP14MagicEffect manaCost: 20 effects: - - !type:CP14SpellSpawnEntity - key: user + - !type:CP14SpellSpawnEntityOnUser spawns: - CP14ImpactEffectFireball - !type:CP14SpellProjectile diff --git a/Resources/Prototypes/_CP14/Entities/Actions/Spells/flame_creation.yml b/Resources/Prototypes/_CP14/Entities/Actions/Spells/flame_creation.yml index 9ed2fd5336..7b6a5b9174 100644 --- a/Resources/Prototypes/_CP14/Entities/Actions/Spells/flame_creation.yml +++ b/Resources/Prototypes/_CP14/Entities/Actions/Spells/flame_creation.yml @@ -6,8 +6,7 @@ - type: CP14MagicEffect manaCost: 5 effects: - - !type:CP14SpellSpawnEntity - key: target + - !type:CP14SpellSpawnEntityOnTarget spawns: - CP14ImpactEffectFlameCreation - !type:CP14SpellSpawnInHandEntity diff --git a/Resources/Prototypes/_CP14/Entities/Actions/Spells/ice_dagger.yml b/Resources/Prototypes/_CP14/Entities/Actions/Spells/ice_dagger.yml index fa844850e6..3698e7e657 100644 --- a/Resources/Prototypes/_CP14/Entities/Actions/Spells/ice_dagger.yml +++ b/Resources/Prototypes/_CP14/Entities/Actions/Spells/ice_dagger.yml @@ -6,8 +6,7 @@ - type: CP14MagicEffect manaCost: 15 effects: - - !type:CP14SpellSpawnEntity - key: target + - !type:CP14SpellSpawnEntityOnTarget spawns: - CP14ImpactEffectIceDagger - !type:CP14SpellSpawnInHandEntity diff --git a/Resources/Prototypes/_CP14/Entities/Actions/Spells/ice_floor.yml b/Resources/Prototypes/_CP14/Entities/Actions/Spells/ice_floor.yml index a32d13b044..2bc9e89dfe 100644 --- a/Resources/Prototypes/_CP14/Entities/Actions/Spells/ice_floor.yml +++ b/Resources/Prototypes/_CP14/Entities/Actions/Spells/ice_floor.yml @@ -6,13 +6,11 @@ - type: CP14MagicEffect manaCost: 10 telegraphyEffects: - - !type:CP14SpellSpawnEntity - key: target + - !type:CP14SpellSpawnEntityOnTarget spawns: - CP14ImpactEffectIceFloor effects: - - !type:CP14SpellSpawnEntity - key: target + - !type:CP14SpellSpawnEntityOnTarget spawns: - CP14IceFloor - type: CP14MagicEffectVerbalAspect diff --git a/Resources/Prototypes/_CP14/Entities/Actions/Spells/shadow_grab.yml b/Resources/Prototypes/_CP14/Entities/Actions/Spells/shadow_grab.yml index b066c2d68d..8eec7fa9e9 100644 --- a/Resources/Prototypes/_CP14/Entities/Actions/Spells/shadow_grab.yml +++ b/Resources/Prototypes/_CP14/Entities/Actions/Spells/shadow_grab.yml @@ -6,21 +6,16 @@ - type: CP14MagicEffect manaCost: 10 telegraphyEffects: - - !type:CP14SpellSpawnEntity - key: target - tryParent: true + - !type:CP14SpellSpawnEntityOnTarget spawns: - CP14ImpactEffectShadowStep - - !type:CP14SpellSpawnEntity - key: user - tryParent: true + - !type:CP14SpellSpawnEntityOnUser spawns: - CP14ImpactEffectShadowGrab effects: - !type:CP14SpellThrowToUser throwPower: 10 - - !type:CP14SpellSpawnEntity - key: target + - !type:CP14SpellSpawnEntityOnTarget spawns: - CP14ImpactEffectShadowStep - type: CP14MagicEffectSomaticAspect diff --git a/Resources/Prototypes/_CP14/Entities/Actions/Spells/shadow_step.yml b/Resources/Prototypes/_CP14/Entities/Actions/Spells/shadow_step.yml index c1e808a2b2..36256346e5 100644 --- a/Resources/Prototypes/_CP14/Entities/Actions/Spells/shadow_step.yml +++ b/Resources/Prototypes/_CP14/Entities/Actions/Spells/shadow_step.yml @@ -6,8 +6,7 @@ - type: CP14MagicEffect manaCost: 20 telegraphyEffects: - - !type:CP14SpellSpawnEntity - key: target + - !type:CP14SpellSpawnEntityOnTarget spawns: - CP14ImpactEffectShadowStep effects: diff --git a/Resources/Prototypes/_CP14/Entities/Clothing/Rings/ring.yml b/Resources/Prototypes/_CP14/Entities/Clothing/Rings/ring.yml index a92c4397be..c3a88edd7f 100644 --- a/Resources/Prototypes/_CP14/Entities/Clothing/Rings/ring.yml +++ b/Resources/Prototypes/_CP14/Entities/Clothing/Rings/ring.yml @@ -141,7 +141,7 @@ id: CP14ClothingRingEarthWall parent: CP14ClothingRingBase name: conductive ring - description: A standard mana-conductive ring that allows you to lift a piece of earthen wall. + description: A standard mana-conductive ring that allows the user to heal physical injuries. suffix: Earth wall components: - type: Sprite @@ -159,7 +159,7 @@ id: CP14ClothingRingIceFloor parent: CP14ClothingRingBase name: conductive ring - description: A standard mana-conductive ring that allows you to create slippery ice. + description: A standard mana-conductive ring that allows the user to heal physical injuries. suffix: Ice floor components: - type: Sprite