healing bard spell (#938)
This commit is contained in:
@@ -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<CP14MagicEffectCastingVisualComponent, CP14EndCastMagicEffectEvent>(OnDespawnMagicVisualEffect);
|
||||
|
||||
SubscribeLocalEvent<CP14MagicEffectManaCostComponent, CP14MagicEffectConsumeResourceEvent>(OnManaConsume);
|
||||
|
||||
SubscribeLocalEvent<CP14MagicEffectRequiredMusicToolComponent, CP14CastMagicEffectAttemptEvent>(OnMusicCheck);
|
||||
}
|
||||
|
||||
private void OnProjectileHit(Entity<CP14SpellEffectOnHitComponent> 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<CP14MagicEffectRequiredMusicToolComponent> ent, ref CP14CastMagicEffectAttemptEvent args)
|
||||
{
|
||||
var passed = false;
|
||||
var query = EntityQueryEnumerator<ActiveInstrumentComponent, InstrumentComponent>();
|
||||
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();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -116,6 +116,11 @@ public abstract partial class CP14SharedMagicSystem : EntitySystem
|
||||
sb.Append("\n" + Loc.GetString("cp14-magic-somatic-aspect") + " " + somatic.FreeHandRequired);
|
||||
}
|
||||
|
||||
if (TryComp<CP14MagicEffectRequiredMusicToolComponent>(ent, out var music))
|
||||
{
|
||||
sb.Append("\n" + Loc.GetString("cp14-magic-music-aspect"));
|
||||
}
|
||||
|
||||
_meta.SetEntityDescription(ent, sb.ToString());
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,9 @@
|
||||
namespace Content.Shared._CP14.MagicSpell.Components;
|
||||
|
||||
/// <summary>
|
||||
/// Requires the user to play music to use this spell
|
||||
/// </summary>
|
||||
[RegisterComponent, Access(typeof(CP14SharedMagicSystem))]
|
||||
public sealed partial class CP14MagicEffectRequiredMusicToolComponent : Component
|
||||
{
|
||||
}
|
||||
@@ -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.
|
||||
|
||||
|
||||
@@ -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:
|
||||
cp14-magic-magic-type = Magic type
|
||||
@@ -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 = Вам не хватает свободных рук.
|
||||
|
||||
|
||||
@@ -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 = Требуются свободные руки:
|
||||
cp14-magic-magic-type = Тип магии
|
||||
@@ -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
|
||||
@@ -22,6 +22,7 @@
|
||||
- CP14ActionSpellBeerCreation
|
||||
- CP14ActionSpellSprint
|
||||
- CP14ActionSpellKick
|
||||
- CP14ActionSpellHealMusic
|
||||
|
||||
- type: loadout
|
||||
id: CP14ActionSpellBase
|
||||
@@ -249,4 +250,17 @@
|
||||
id: CP14ActionSpellKick
|
||||
dummyEntity: CP14ActionSpellKick
|
||||
actions:
|
||||
- CP14ActionSpellKick
|
||||
- CP14ActionSpellKick
|
||||
|
||||
- type: loadout
|
||||
id: CP14ActionSpellHealMusic
|
||||
dummyEntity: CP14ActionSpellHealMusic
|
||||
actions:
|
||||
- CP14ActionSpellHealMusic
|
||||
effects:
|
||||
- !type:JobRequirementLoadoutEffect
|
||||
requirement:
|
||||
!type:TraitsRequirement
|
||||
inverted: true
|
||||
traits:
|
||||
- CP14ManaWasting
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 323 B |
@@ -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"
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user