diff --git a/Content.Shared/_CP14/MagicSpell/Spells/CP14SpellPointer.cs b/Content.Shared/_CP14/MagicSpell/Spells/CP14SpellPointer.cs new file mode 100644 index 0000000000..ec1af34875 --- /dev/null +++ b/Content.Shared/_CP14/MagicSpell/Spells/CP14SpellPointer.cs @@ -0,0 +1,52 @@ +using Content.Shared.Whitelist; +using Robust.Shared.Map; +using Robust.Shared.Prototypes; + +namespace Content.Shared._CP14.MagicSpell.Spells; + +public sealed partial class CP14SpellPointer : CP14SpellEffect +{ + [DataField(required: true)] + public EntProtoId PointerEntity; + + [DataField(required: true)] + public EntityWhitelist? Whitelist; + + [DataField] + public EntityWhitelist? Blacklist = null; + + [DataField(required: true)] + public float SearchRange = 30f; + + public override void Effect(EntityManager entManager, CP14SpellEffectBaseArgs args) + { + if (args.User is null) + return; + + var lookup = entManager.System(); + var whitelistSys = entManager.System(); + var transform = entManager.System(); + + var originPosition = transform.GetWorldPosition(args.User.Value); + var originEntPosition = transform.GetMoverCoordinates(args.User.Value); + + var entitiesInRange = lookup.GetEntitiesInRange(originEntPosition, SearchRange); + foreach (var ent in entitiesInRange) + { + if (ent.Owner == args.User.Value) + continue; + + if (!whitelistSys.CheckBoth(ent, Blacklist, Whitelist)) + continue; + + var targetPosition = transform.GetWorldPosition(ent.Comp); + + //Calculate the rotation + Angle angle = new(targetPosition - originPosition); + + var pointer = entManager.Spawn(PointerEntity, new MapCoordinates(originPosition, transform.GetMapId(originEntPosition))); + + transform.SetWorldRotation(pointer, angle + Angle.FromDegrees(90)); + } + } +} diff --git a/Content.Shared/_CP14/MagicSpell/Spells/CP14SpellPointerToAlive.cs b/Content.Shared/_CP14/MagicSpell/Spells/CP14SpellPointerToAlive.cs new file mode 100644 index 0000000000..e8aec42e2f --- /dev/null +++ b/Content.Shared/_CP14/MagicSpell/Spells/CP14SpellPointerToAlive.cs @@ -0,0 +1,47 @@ +using Content.Shared.Mobs.Components; +using Content.Shared.Mobs.Systems; +using Robust.Shared.Map; +using Robust.Shared.Prototypes; + +namespace Content.Shared._CP14.MagicSpell.Spells; + +public sealed partial class CP14SpellPointerToAlive : CP14SpellEffect +{ + [DataField(required: true)] + public EntProtoId PointerEntity; + + [DataField(required: true)] + public float SearchRange = 30f; + + public override void Effect(EntityManager entManager, CP14SpellEffectBaseArgs args) + { + if (args.User is null) + return; + + var lookup = entManager.System(); + var mobStateSys = entManager.System(); + var transform = entManager.System(); + + var originPosition = transform.GetWorldPosition(args.User.Value); + var originEntPosition = transform.GetMoverCoordinates(args.User.Value); + + var entitiesInRange = lookup.GetEntitiesInRange(originEntPosition, SearchRange); + foreach (var ent in entitiesInRange) + { + if (ent.Owner == args.User.Value) + continue; + + if (mobStateSys.IsDead(ent)) + continue; + + var targetPosition = transform.GetWorldPosition(ent); + + //Calculate the rotation + Angle angle = new(targetPosition - originPosition); + + var pointer = entManager.Spawn(PointerEntity, new MapCoordinates(originPosition, transform.GetMapId(originEntPosition))); + + transform.SetWorldRotation(pointer, angle + Angle.FromDegrees(90)); + } + } +} diff --git a/Resources/Locale/en-US/_CP14/gameTicking/gameRules/blood-moon.ftl b/Resources/Locale/en-US/_CP14/gameTicking/gameRules/blood-moon.ftl index f98a393016..66d8ff3e89 100644 --- a/Resources/Locale/en-US/_CP14/gameTicking/gameRules/blood-moon.ftl +++ b/Resources/Locale/en-US/_CP14/gameTicking/gameRules/blood-moon.ftl @@ -3,4 +3,4 @@ cp14-bloodmoon-start = The blood moon shines in full force, enslaving minds. cp14-bloodmoon-end = The blood moon sets over the horizon, losing its power. cp14-bloodmoon-curse-removed = The curse of the blood moon is dispelled. -cp14-bloodmoon-curse-examined = The aura of the blood moon hovers around this creature. Be careful, for his mind is unstable. \ No newline at end of file +cp14-bloodmoon-curse-examined = [color=red]The aura of the blood moon hovers around this creature. Be careful, for his mind is unstable.[/color] \ No newline at end of file diff --git a/Resources/Prototypes/_CP14/Entities/Actions/Spells/Light/search_of_life.yml b/Resources/Prototypes/_CP14/Entities/Actions/Spells/Light/search_of_life.yml new file mode 100644 index 0000000000..ad991ea859 --- /dev/null +++ b/Resources/Prototypes/_CP14/Entities/Actions/Spells/Light/search_of_life.yml @@ -0,0 +1,90 @@ +- type: entity + id: CP14ActionSpellSearchOfLife + name: Search of life + description: Detects all living things in a large radius around you. + components: + - type: Sprite + sprite: _CP14/Actions/Spells/light.rsi + state: search_of_life + - type: CP14MagicEffectManaCost + manaCost: 30 + - type: CP14MagicEffect + magicType: Light + effects: + - !type:CP14SpellSpawnEntityOnTarget + spawns: + - CP14ImpactEffectSearchOfLife + - !type:CP14SpellPointerToAlive + pointerEntity: CP14SearchOfLifePointer + searchRange: 30 + - type: CP14MagicEffectVerbalAspect + startSpeech: "Ego vultus..." + endSpeech: "parumper vita" + - type: CP14MagicEffectSomaticAspect + - type: CP14MagicEffectCastingVisual + proto: CP14RuneSearchOfLife + - type: InstantAction + itemIconStyle: BigAction + sound: !type:SoundPathSpecifier + path: /Audio/Magic/rumble.ogg + icon: + sprite: _CP14/Actions/Spells/light.rsi + state: search_of_life + event: !type:CP14DelayedInstantActionEvent + cooldown: 30 + castDelay: 1.5 + +- type: entity + id: CP14ImpactEffectSearchOfLife + parent: CP14BaseMagicImpact + categories: [ HideSpawnMenu ] + save: false + components: + - type: Sprite + layers: + - state: particles_up + color: "#efedff" + shader: unshaded + - state: circle_increase + color: "#79b330" + shader: unshaded + +- type: entity + id: CP14RuneSearchOfLife + parent: CP14BaseMagicRune + categories: [ HideSpawnMenu ] + save: false + components: + - type: PointLight + color: "#328643" + - type: Sprite + layers: + - state: sun + color: "#efedff" + shader: unshaded + - state: double_outer + color: "#79b330" + shader: unshaded + +- type: entity + id: CP14SearchOfLifePointer + name: pointer + categories: [ HideSpawnMenu ] + components: + - type: Sprite + sprite: /Textures/_CP14/Effects/Magic/pointer.rsi + offset: 0, -1 + layers: + - state: pointer + shader: unshaded + drawdepth: LowFloors + - type: PointLight + netSync: false + radius: 3 + color: "#ffffff" + energy: 0.2 + - type: TimedDespawn + lifetime: 8 + - type: Tag + tags: + - HideContextMenu \ No newline at end of file diff --git a/Resources/Prototypes/_CP14/Skill/illusion.yml b/Resources/Prototypes/_CP14/Skill/illusion.yml index 4f050c32c9..c8448993d7 100644 --- a/Resources/Prototypes/_CP14/Skill/illusion.yml +++ b/Resources/Prototypes/_CP14/Skill/illusion.yml @@ -25,46 +25,16 @@ prerequisite: IllusionT1 - type: cp14Skill - id: CP14ActionSpellSignalLightRed - skillUiPosition: 2, 6 - learnCost: 0.5 - tree: Illusion - icon: - sprite: _CP14/Actions/Spells/light.rsi - state: signal_light_red - effects: - - !type:AddAction - action: CP14ActionSpellSignalLightRed - restrictions: - - !type:NeedPrerequisite - prerequisite: IllusionT1 - -- type: cp14Skill - id: CP14ActionSpellSignalLightYellow - skillUiPosition: 0, 6 - learnCost: 0.5 - tree: Illusion - icon: - sprite: _CP14/Actions/Spells/light.rsi - state: signal_light_yellow - effects: - - !type:AddAction - action: CP14ActionSpellSignalLightYellow - restrictions: - - !type:NeedPrerequisite - prerequisite: IllusionT1 - -- type: cp14Skill - id: CP14ActionSpellSignalLightBlue + id: CP14ActionSpellSearchOfLife skillUiPosition: 2, 4 - learnCost: 0.5 + learnCost: 1 tree: Illusion icon: sprite: _CP14/Actions/Spells/light.rsi - state: signal_light_blue + state: search_of_life effects: - !type:AddAction - action: CP14ActionSpellSignalLightBlue + action: CP14ActionSpellSearchOfLife restrictions: - !type:NeedPrerequisite prerequisite: IllusionT1 diff --git a/Resources/Textures/_CP14/Actions/Spells/light.rsi/meta.json b/Resources/Textures/_CP14/Actions/Spells/light.rsi/meta.json index 4aa5d154b7..889b53cf41 100644 --- a/Resources/Textures/_CP14/Actions/Spells/light.rsi/meta.json +++ b/Resources/Textures/_CP14/Actions/Spells/light.rsi/meta.json @@ -13,6 +13,9 @@ { "name": "signal_light_blue" }, + { + "name": "search_of_life" + }, { "name": "signal_light_red" }, diff --git a/Resources/Textures/_CP14/Actions/Spells/light.rsi/search_of_life.png b/Resources/Textures/_CP14/Actions/Spells/light.rsi/search_of_life.png new file mode 100644 index 0000000000..2b5979bad1 Binary files /dev/null and b/Resources/Textures/_CP14/Actions/Spells/light.rsi/search_of_life.png differ diff --git a/Resources/Textures/_CP14/Effects/Magic/pointer.rsi/meta.json b/Resources/Textures/_CP14/Effects/Magic/pointer.rsi/meta.json new file mode 100644 index 0000000000..84ba7b94b5 --- /dev/null +++ b/Resources/Textures/_CP14/Effects/Magic/pointer.rsi/meta.json @@ -0,0 +1,14 @@ +{ + "version": 1, + "size": { + "x": 19, + "y": 48 + }, + "license": "CC-BY-SA-4.0", + "copyright": "Created by TheShuEd", + "states": [ + { + "name": "pointer" + } + ] +} diff --git a/Resources/Textures/_CP14/Effects/Magic/pointer.rsi/pointer.png b/Resources/Textures/_CP14/Effects/Magic/pointer.rsi/pointer.png new file mode 100644 index 0000000000..b62461f387 Binary files /dev/null and b/Resources/Textures/_CP14/Effects/Magic/pointer.rsi/pointer.png differ