Kick stamina spell (#844)

* kick spell

* kick fix
This commit is contained in:
Ed
2025-02-06 12:38:20 +03:00
committed by GitHub
parent 60737dc36e
commit b5eb3a3dc1
11 changed files with 100 additions and 8 deletions

View File

@@ -57,7 +57,7 @@ public sealed partial class CP14MagicSystem : CP14SharedMagicSystem
private void OnSpellSpoken(Entity<CP14MagicEffectVerbalAspectComponent> ent, ref CP14VerbalAspectSpeechEvent args)
{
if (args.Performer is not null && args.Speech is not null)
_chat.TrySendInGameICMessage(args.Performer.Value, args.Speech, InGameICChatType.Speak, true);
_chat.TrySendInGameICMessage(args.Performer.Value, args.Speech, args.Emote ? InGameICChatType.Emote : InGameICChatType.Speak, true);
}
private void OnSpawnMagicVisualEffect(Entity<CP14MagicEffectCastingVisualComponent> ent, ref CP14StartCastMagicEffectEvent args)

View File

@@ -95,7 +95,8 @@ public abstract partial class CP14SharedMagicSystem
var ev = new CP14VerbalAspectSpeechEvent
{
Performer = args.Performer,
Speech = ent.Comp.StartSpeech,
Speech = Loc.GetString(ent.Comp.StartSpeech),
Emote = ent.Comp.Emote
};
RaiseLocalEvent(ent, ref ev);
}
@@ -108,7 +109,8 @@ public abstract partial class CP14SharedMagicSystem
var ev = new CP14VerbalAspectSpeechEvent
{
Performer = args.Performer,
Speech = ent.Comp.EndSpeech,
Speech = Loc.GetString(ent.Comp.EndSpeech),
Emote = ent.Comp.Emote
};
RaiseLocalEvent(ent, ref ev);
}

View File

@@ -7,10 +7,13 @@ namespace Content.Shared._CP14.MagicSpell.Components;
public sealed partial class CP14MagicEffectVerbalAspectComponent : Component
{
[DataField]
public string StartSpeech = string.Empty;
public string StartSpeech = string.Empty; //Not LocId!
[DataField]
public string EndSpeech = string.Empty;
public string EndSpeech = string.Empty; //Not LocId!
[DataField]
public bool Emote = false;
}
/// <summary>
@@ -22,4 +25,6 @@ public sealed class CP14VerbalAspectSpeechEvent : EntityEventArgs
public EntityUid? Performer { get; init; }
public string? Speech { get; init; }
public bool Emote { get; init; }
}

View File

@@ -0,0 +1,31 @@
using Content.Shared.Throwing;
namespace Content.Shared._CP14.MagicSpell.Spells;
public sealed partial class CP14SpellThrowFromUser : CP14SpellEffect
{
[DataField]
public float ThrowPower = 10f;
public override void Effect(EntityManager entManager, CP14SpellEffectBaseArgs args)
{
if (args.Target is null)
return;
var targetEntity = args.Target.Value;
var throwing = entManager.System<ThrowingSystem>();
var xfom = entManager.System<SharedTransformSystem>();
if (!entManager.TryGetComponent<TransformComponent>(args.User, out var userTransform))
return;
if (!entManager.TryGetComponent<TransformComponent>(targetEntity, out var targetTransform))
return;
var worldPos = xfom.GetWorldPosition(args.User.Value);
var foo = xfom.GetWorldPosition(args.Target.Value) - worldPos;
throwing.TryThrow(targetEntity, foo * 2.5f, ThrowPower, args.User, doSpin: true);
}
}

View File

@@ -0,0 +1 @@
cp14-kick-emote = makes a strong kick

View File

@@ -0,0 +1 @@
cp14-kick-emote = совершает сильный пинок

View File

@@ -29,7 +29,6 @@
components:
- Item
canTargetSelf: false
checkCanAccess: false
range: 10
itemIconStyle: BigAction
sound: !type:SoundPathSpecifier

View File

@@ -0,0 +1,42 @@
- type: entity
id: CP14ActionSpellKick
name: Kick
description: You perform an epic leg kick at your chosen object, pushing it away from you.
components:
- type: Sprite
sprite: _CP14/Effects/Magic/spells_icons.rsi
state: kick
- type: CP14MagicEffectCastSlowdown
speedMultiplier: 0.4
- type: CP14MagicEffectStaminaCost
stamina: 40
- type: CP14MagicEffect
effects:
- !type:CP14SpellApplyEntityEffect
effects:
- !type:Paralyze
paralyzeTime: 1
- !type:CP14SpellThrowFromUser
throwPower: 9
- !type:CP14SpellSpawnEntityOnTarget
spawns:
- CP14DustEffect
- type: CP14MagicEffectVerbalAspect
endSpeech: cp14-kick-emote
emote: true
- type: EntityTargetAction
canTargetSelf: false
range: 1
itemIconStyle: BigAction
sound: !type:SoundPathSpecifier
path: /Audio/Effects/hit_kick.ogg
params:
pitch: 2
icon:
sprite: _CP14/Effects/Magic/spells_icons.rsi
state: kick
event: !type:CP14DelayedEntityTargetActionEvent
cooldown: 5
castDelay: 1
entityDistance: 1
breakOnMove: false

View File

@@ -427,6 +427,7 @@
- CP14ModularIronPickaxe
- CP14Lighter
- CP14Torch
- CP14SmokingPipeFilledTobacco
- CP14FluteInstrument
- CP14LyraInstrument
- CP14ClothingBeltQuiver
@@ -498,7 +499,7 @@
- CP14Torch
- type: loadout
id: CP14Pipe
id: CP14SmokingPipeFilledTobacco
storage:
back:
- CP14SmokingPipeFilledTobacco
@@ -559,6 +560,7 @@
- CP14ActionSpellFreeze
- CP14ActionSpellBeerCreation
- CP14ActionSpellSprint
- CP14ActionSpellKick
- type: loadout
id: CP14ActionSpellBase
@@ -755,3 +757,9 @@
species:
- CP14Goblin
inverted: true # Goblins cannot take this spell, they have buffed version by default
- type: loadout
id: CP14ActionSpellKick
dummyEntity: CP14ActionSpellKick
actions:
- CP14ActionSpellKick

Binary file not shown.

After

Width:  |  Height:  |  Size: 301 B

View File

@@ -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, 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, kick, signal_light_yellow and resurrection by TheShuEd",
"states": [
{
"name": "beer_creation"
@@ -43,6 +43,9 @@
{
"name": "ice_shards"
},
{
"name": "kick"
},
{
"name": "mana_consume"
},