diff --git a/Content.Server/_CP14/MagicSpell/CP14MagicSystem.cs b/Content.Server/_CP14/MagicSpell/CP14MagicSystem.cs index b0f4182c94..f4142e1e9d 100644 --- a/Content.Server/_CP14/MagicSpell/CP14MagicSystem.cs +++ b/Content.Server/_CP14/MagicSpell/CP14MagicSystem.cs @@ -1,6 +1,7 @@ using Content.Server._CP14.MagicEnergy; using Content.Server.Atmos.Components; using Content.Server.Chat.Systems; +using Content.Server.Instruments; using Content.Shared._CP14.MagicEnergy.Components; using Content.Shared._CP14.MagicSpell; using Content.Shared._CP14.MagicSpell.Components; @@ -39,6 +40,8 @@ public sealed partial class CP14MagicSystem : CP14SharedMagicSystem SubscribeLocalEvent(OnDespawnMagicVisualEffect); SubscribeLocalEvent(OnManaConsume); + + SubscribeLocalEvent(OnMusicCheck); } private void OnProjectileHit(Entity ent, ref ThrowDoHitEvent args) @@ -140,4 +143,29 @@ public sealed partial class CP14MagicSystem : CP14SharedMagicSystem _magicEnergy.TryConsumeEnergy(args.Performer.Value, requiredMana, safe: false); } } + + + + private void OnMusicCheck(Entity ent, ref CP14CastMagicEffectAttemptEvent args) + { + var passed = false; + var query = EntityQueryEnumerator(); + while (query.MoveNext(out var uid, out var active, out var instrument)) + { + if (!instrument.Playing) + continue; + + if (Transform(uid).ParentUid != args.Performer) + continue; + + passed = true; + break; + } + + if (!passed) + { + args.PushReason(Loc.GetString("cp14-magic-music-aspect")); + args.Cancel(); + } + } } diff --git a/Content.Shared/_CP14/MagicSpell/CP14SharedMagicSystem.Checks.cs b/Content.Shared/_CP14/MagicSpell/CP14SharedMagicSystem.Checks.cs index 3b59127edf..9f85896803 100644 --- a/Content.Shared/_CP14/MagicSpell/CP14SharedMagicSystem.Checks.cs +++ b/Content.Shared/_CP14/MagicSpell/CP14SharedMagicSystem.Checks.cs @@ -2,6 +2,7 @@ using Content.Shared._CP14.MagicSpell.Components; using Content.Shared._CP14.MagicSpell.Events; using Content.Shared.Damage.Components; using Content.Shared.Hands.Components; +using Content.Shared.Instruments; using Content.Shared.Popups; using Content.Shared.Speech.Muting; @@ -60,7 +61,6 @@ public abstract partial class CP14SharedMagicSystem { args.PushReason(Loc.GetString("cp14-magic-spell-stamina-not-enough")); args.Cancel(); - return; } } diff --git a/Content.Shared/_CP14/MagicSpell/CP14SharedMagicSystem.cs b/Content.Shared/_CP14/MagicSpell/CP14SharedMagicSystem.cs index b486ef67d5..edddf8918b 100644 --- a/Content.Shared/_CP14/MagicSpell/CP14SharedMagicSystem.cs +++ b/Content.Shared/_CP14/MagicSpell/CP14SharedMagicSystem.cs @@ -116,6 +116,11 @@ public abstract partial class CP14SharedMagicSystem : EntitySystem sb.Append("\n" + Loc.GetString("cp14-magic-somatic-aspect") + " " + somatic.FreeHandRequired); } + if (TryComp(ent, out var music)) + { + sb.Append("\n" + Loc.GetString("cp14-magic-music-aspect")); + } + _meta.SetEntityDescription(ent, sb.ToString()); } diff --git a/Content.Shared/_CP14/MagicSpell/Components/CP14MagicEffectRequiredMusicToolComponent.cs b/Content.Shared/_CP14/MagicSpell/Components/CP14MagicEffectRequiredMusicToolComponent.cs new file mode 100644 index 0000000000..d8a12102d0 --- /dev/null +++ b/Content.Shared/_CP14/MagicSpell/Components/CP14MagicEffectRequiredMusicToolComponent.cs @@ -0,0 +1,9 @@ +namespace Content.Shared._CP14.MagicSpell.Components; + +/// +/// Requires the user to play music to use this spell +/// +[RegisterComponent, Access(typeof(CP14SharedMagicSystem))] +public sealed partial class CP14MagicEffectRequiredMusicToolComponent : Component +{ +} diff --git a/Resources/Locale/en-US/_CP14/magicTypes/magic-clothing.ftl b/Resources/Locale/en-US/_CP14/magicEnergy/magic-clothing.ftl similarity index 100% rename from Resources/Locale/en-US/_CP14/magicTypes/magic-clothing.ftl rename to Resources/Locale/en-US/_CP14/magicEnergy/magic-clothing.ftl diff --git a/Resources/Locale/en-US/_CP14/magicEnergy/magic-spells.ftl b/Resources/Locale/en-US/_CP14/magicEnergy/magic-spells.ftl index 448ad01d34..edf1db07d7 100644 --- a/Resources/Locale/en-US/_CP14/magicEnergy/magic-spells.ftl +++ b/Resources/Locale/en-US/_CP14/magicEnergy/magic-spells.ftl @@ -8,6 +8,10 @@ cp14-magic-spell-not-enough-mana-cast-warning-2 = Your hands are shaking... cp14-magic-spell-not-enough-mana-cast-warning-3 = Your throat starts to lump... cp14-magic-spell-not-enough-mana-cast-warning-4 = Your head becomes heavy... +cp14-magic-verbal-aspect = Requires the ability to speak +cp14-magic-somatic-aspect = Requires a free hand: +cp14-magic-music-aspect = You must play a musical instrument + cp14-magic-spell-need-verbal-component = You can't cast the spell out loud. cp14-magic-spell-need-somatic-component = You don't have your hands free. diff --git a/Resources/Locale/en-US/_CP14/magicTypes/magic.ftl b/Resources/Locale/en-US/_CP14/magicEnergy/magic-types.ftl similarity index 66% rename from Resources/Locale/en-US/_CP14/magicTypes/magic.ftl rename to Resources/Locale/en-US/_CP14/magicEnergy/magic-types.ftl index d10e75a3e5..260e61a4de 100644 --- a/Resources/Locale/en-US/_CP14/magicTypes/magic.ftl +++ b/Resources/Locale/en-US/_CP14/magicEnergy/magic-types.ftl @@ -8,7 +8,4 @@ cp14-magic-type-meta = Metamagic cp14-magic-type-necro = Necromancy cp14-magic-manacost = Manacost -cp14-magic-magic-type = Magic type - -cp14-magic-verbal-aspect = Requires the ability to speak -cp14-magic-somatic-aspect = Requires a free hand: \ No newline at end of file +cp14-magic-magic-type = Magic type \ No newline at end of file diff --git a/Resources/Locale/en-US/_CP14/magicSpells/speech.ftl b/Resources/Locale/en-US/_CP14/magicEnergy/spell-speech.ftl similarity index 100% rename from Resources/Locale/en-US/_CP14/magicSpells/speech.ftl rename to Resources/Locale/en-US/_CP14/magicEnergy/spell-speech.ftl diff --git a/Resources/Locale/ru-RU/_CP14/magicTypes/magic-clothing.ftl b/Resources/Locale/ru-RU/_CP14/magicEnergy/magic-clothing.ftl similarity index 100% rename from Resources/Locale/ru-RU/_CP14/magicTypes/magic-clothing.ftl rename to Resources/Locale/ru-RU/_CP14/magicEnergy/magic-clothing.ftl diff --git a/Resources/Locale/ru-RU/_CP14/magicEnergy/magic-spells.ftl b/Resources/Locale/ru-RU/_CP14/magicEnergy/magic-spells.ftl index 1c26aa2d7a..a4c8b32d09 100644 --- a/Resources/Locale/ru-RU/_CP14/magicEnergy/magic-spells.ftl +++ b/Resources/Locale/ru-RU/_CP14/magicEnergy/magic-spells.ftl @@ -8,6 +8,10 @@ cp14-magic-spell-not-enough-mana-cast-warning-2 = Ваши руки дрожат cp14-magic-spell-not-enough-mana-cast-warning-3 = К горлу подступает ком... cp14-magic-spell-not-enough-mana-cast-warning-4 = Голова наливается свинцом... +cp14-magic-verbal-aspect = Требуется возможность говорить +cp14-magic-somatic-aspect = Требуются свободные руки: +cp14-magic-music-aspect = Вы должны играть на музыкальном инструменте + cp14-magic-spell-need-verbal-component = Вы не можете произнести заклинание вслух. cp14-magic-spell-need-somatic-component = Вам не хватает свободных рук. diff --git a/Resources/Locale/ru-RU/_CP14/magicTypes/magic.ftl b/Resources/Locale/ru-RU/_CP14/magicEnergy/magic-types.ftl similarity index 63% rename from Resources/Locale/ru-RU/_CP14/magicTypes/magic.ftl rename to Resources/Locale/ru-RU/_CP14/magicEnergy/magic-types.ftl index 3766d6d9da..71ea002651 100644 --- a/Resources/Locale/ru-RU/_CP14/magicTypes/magic.ftl +++ b/Resources/Locale/ru-RU/_CP14/magicEnergy/magic-types.ftl @@ -8,7 +8,4 @@ cp14-magic-type-meta = Метамагия cp14-magic-type-necro = Некромантия cp14-magic-manacost = Затраты маны -cp14-magic-magic-type = Тип магии - -cp14-magic-verbal-aspect = Требуется возможность говорить -cp14-magic-somatic-aspect = Требуются свободные руки: \ No newline at end of file +cp14-magic-magic-type = Тип магии \ No newline at end of file diff --git a/Resources/Locale/ru-RU/_CP14/magicSpells/speech.ftl b/Resources/Locale/ru-RU/_CP14/magicEnergy/spell-speech.ftl similarity index 100% rename from Resources/Locale/ru-RU/_CP14/magicSpells/speech.ftl rename to Resources/Locale/ru-RU/_CP14/magicEnergy/spell-speech.ftl diff --git a/Resources/Prototypes/_CP14/Entities/Actions/Spells/Healing/T0_heal_song.yml b/Resources/Prototypes/_CP14/Entities/Actions/Spells/Healing/T0_heal_song.yml new file mode 100644 index 0000000000..8e7fe541c6 --- /dev/null +++ b/Resources/Prototypes/_CP14/Entities/Actions/Spells/Healing/T0_heal_song.yml @@ -0,0 +1,64 @@ +- type: entity + id: CP14ActionSpellHealMusic + name: Healing music + description: Your music is filled with healing magic, slowly healing all the creatures around you. + components: + - type: Sprite + sprite: _CP14/Effects/Magic/spells_icons.rsi + state: heal_music + - type: CP14MagicEffectCastSlowdown + speedMultiplier: 0.8 + - type: CP14MagicEffectManaCost + manaCost: 5 + - type: CP14MagicEffect + magicType: Healing + effects: + - !type:CP14SpellSpawnEntityOnTarget + spawns: + - CP14ImpactEffectCureWounds + - CP14AreaEntityEffectHealMusic + - type: CP14MagicEffectRequiredMusicTool + - type: CP14MagicEffectCastingVisual + proto: CP14RuneCureWounds + - type: InstantAction + itemIconStyle: BigAction + sound: !type:SoundPathSpecifier + path: /Audio/Magic/rumble.ogg + icon: + sprite: _CP14/Effects/Magic/spells_icons.rsi + state: heal_music + event: !type:CP14ToggleableInstantActionEvent + effectFrequency: 1 + cooldown: 15 + castTime: 120 + hidden: true + +- type: entity + id: CP14AreaEntityEffectHealMusic + parent: CP14BaseMagicImpact + categories: [ HideSpawnMenu ] + components: + - type: CP14AreaEntityEffect + range: 3 + maxTargets: 4 + whitelist: + components: + - MobState + effects: + - !type:CP14SpellSpawnEntityOnTarget + spawns: + - CP14ImpactEffectBloodPurification + - !type:CP14SpellApplyEntityEffect + effects: + - !type:HealthChange + damage: + types: + Slash: -2 + Blunt: -2 + Piercing: -2 + Cold: -2 + Heat: -2 + Shock: -2 + Poison: -2 + Bloodloss: -2 + Caustic: -2 \ No newline at end of file diff --git a/Resources/Prototypes/_CP14/Loadouts/spells.yml b/Resources/Prototypes/_CP14/Loadouts/spells.yml index a930a609e2..a634d77a00 100644 --- a/Resources/Prototypes/_CP14/Loadouts/spells.yml +++ b/Resources/Prototypes/_CP14/Loadouts/spells.yml @@ -22,6 +22,7 @@ - CP14ActionSpellBeerCreation - CP14ActionSpellSprint - CP14ActionSpellKick + - CP14ActionSpellHealMusic - type: loadout id: CP14ActionSpellBase @@ -249,4 +250,17 @@ id: CP14ActionSpellKick dummyEntity: CP14ActionSpellKick actions: - - CP14ActionSpellKick \ No newline at end of file + - CP14ActionSpellKick + +- type: loadout + id: CP14ActionSpellHealMusic + dummyEntity: CP14ActionSpellHealMusic + actions: + - CP14ActionSpellHealMusic + effects: + - !type:JobRequirementLoadoutEffect + requirement: + !type:TraitsRequirement + inverted: true + traits: + - CP14ManaWasting \ No newline at end of file diff --git a/Resources/Textures/_CP14/Effects/Magic/spells_icons.rsi/heal_music.png b/Resources/Textures/_CP14/Effects/Magic/spells_icons.rsi/heal_music.png new file mode 100644 index 0000000000..0bd2979a84 Binary files /dev/null and b/Resources/Textures/_CP14/Effects/Magic/spells_icons.rsi/heal_music.png differ diff --git a/Resources/Textures/_CP14/Effects/Magic/spells_icons.rsi/meta.json b/Resources/Textures/_CP14/Effects/Magic/spells_icons.rsi/meta.json index 8a2d6547d4..597414698e 100644 --- a/Resources/Textures/_CP14/Effects/Magic/spells_icons.rsi/meta.json +++ b/Resources/Textures/_CP14/Effects/Magic/spells_icons.rsi/meta.json @@ -5,7 +5,7 @@ "y": 32 }, "license": "All right reserved", - "copyright": "Created by .kreks., cure_poison, cure_burn, mana_gift, water creation, plant_growth, beer creation, sprint, tiefling_revenge, demi_arrow, rift_shield, rift_arrow, signal_light_blue, signal_light_red, freeze, counter_spell, magical_acceleration, kick, signal_light_yellow and resurrection by TheShuEd", + "copyright": "Created by .kreks., cure_poison, cure_burn, mana_gift, water creation, plant_growth, beer creation, sprint, tiefling_revenge, demi_arrow, rift_shield, rift_arrow, signal_light_blue, signal_light_red, freeze, counter_spell, magical_acceleration, kick, heal_music, signal_light_yellow and resurrection by TheShuEd", "states": [ { "name": "beer_creation" @@ -40,6 +40,9 @@ { "name": "freeze" }, + { + "name": "heal_music" + }, { "name": "ice_dagger" },