From 2226c557f7741e763771d768e140bb6acf89c2e3 Mon Sep 17 00:00:00 2001 From: Kendrick <133131761+Kendrick15@users.noreply.github.com> Date: Sun, 6 Apr 2025 03:18:22 +0300 Subject: [PATCH] =?UTF-8?q?=D0=9D=D0=BE=D0=B2=D0=B0=D1=8F=20=D1=81=D0=BF?= =?UTF-8?q?=D0=BE=D1=81=D0=BE=D0=B1=D0=BD=D0=BE=D1=81=D1=82=D1=8C=20=D0=B2?= =?UTF-8?q?=D0=B0=D0=BC=D0=BF=D0=B8=D1=80=D0=B0=20-=20=D0=9A=D1=80=D0=BE?= =?UTF-8?q?=D0=B2=D1=8F=D0=BD=D0=B0=D1=8F=20=D1=87=D0=B5=D1=88=D1=83=D1=8F?= =?UTF-8?q?.=20(#1660)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Vampire/VampireSystem.Abilities.cs | 39 +++++++++++++++++- Content.Server/Vampire/VampireSystem.cs | 38 ++++++++++++----- Content.Shared/Vampire/VampireComponent.cs | 21 +++++++++- Content.Shared/Vampire/VampireEvents.cs | 1 + Resources/Prototypes/Actions/vampire.yml | 19 ++++++++- .../Prototypes/Vampire/vampire-powers.yml | 8 +++- .../actions_vampire.rsi/bloodscale.png | Bin 0 -> 1393 bytes .../Actions/actions_vampire.rsi/meta.json | 3 ++ 8 files changed, 114 insertions(+), 15 deletions(-) create mode 100644 Resources/Textures/Interface/Actions/actions_vampire.rsi/bloodscale.png diff --git a/Content.Server/Vampire/VampireSystem.Abilities.cs b/Content.Server/Vampire/VampireSystem.Abilities.cs index 564ac06acf..3ad627747d 100644 --- a/Content.Server/Vampire/VampireSystem.Abilities.cs +++ b/Content.Server/Vampire/VampireSystem.Abilities.cs @@ -56,6 +56,7 @@ public sealed partial class VampireSystem SubscribeLocalEvent(OnVampireUnholyStrength); SubscribeLocalEvent(OnVampireSupernaturalStrength); SubscribeLocalEvent(OnVampireCloakOfDarkness); + SubscribeLocalEvent(OnVampireBloodScale); SubscribeLocalEvent(OnVampireThermalVision); //Hypnotise @@ -214,7 +215,43 @@ public sealed partial class VampireSystem ev.Handled = true; } - private void OnVampireThermalVision(EntityUid entity, VampireComponent component, VampireThermalVisionEvent ev) + private void OnVampireBloodScale(EntityUid entity, VampireComponent component, VampireBloodScaleEvent ev) + { + if (!TryGetPowerDefinition(ev.DefinitionName, out var def)) + return; + + var vampire = new Entity(entity, component); + + if (!IsAbilityUsable(vampire, def)) + return; + + ToggleBloodScale(entity, vampire); + var scale = EnsureComp(vampire); + scale.Upkeep = 4f; + + ev.Handled = true; + } + + private void ToggleBloodScale(EntityUid uid, VampireComponent comp) + { + var scale = EnsureComp(uid); + if (!comp.BloodScaleActive) + { + _speed.ChangeBaseSpeed(uid, 4.5f, 6f, 20f); + _popup.PopupEntity(Loc.GetString("blood-scale-start"), uid, uid); + comp.BloodScaleActive = true; + scale.IsActive = true; + } + else + { + _speed.ChangeBaseSpeed(uid, 2.5f, 4.5f, 20f); + _popup.PopupEntity(Loc.GetString("blood-scale-end"), uid, uid); + comp.BloodScaleActive = false; + scale.IsActive = false; + } + } + + private void OnVampireThermalVision(EntityUid entity, VampireComponent component, VampireThermalVisionEvent ev) { if (!TryGetPowerDefinition(ev.DefinitionName, out var def)) return; diff --git a/Content.Server/Vampire/VampireSystem.cs b/Content.Server/Vampire/VampireSystem.cs index 39b7e2945b..ec2b1069ec 100644 --- a/Content.Server/Vampire/VampireSystem.cs +++ b/Content.Server/Vampire/VampireSystem.cs @@ -3,28 +3,20 @@ using Content.Server.Atmos.Rotting; using Content.Server.Beam; using Content.Server.Body.Systems; using Content.Server.Chat.Systems; -using Content.Server.Interaction; using Content.Server.Nutrition.EntitySystems; using Content.Server.Polymorph.Systems; using Content.Server.Storage.EntitySystems; using Content.Server.Mind; using Content.Shared.Actions; using Content.Shared.Body.Systems; -using Content.Shared.Buckle; -using Content.Shared.Bed.Sleep; using Content.Shared.Chemistry.EntitySystems; -using Content.Shared.Construction.Components; using Content.Shared.Damage; using Content.Shared.Damage.Prototypes; using Content.Shared.DoAfter; using Content.Shared.Examine; using Content.Shared.FixedPoint; -using Content.Shared.Hands.EntitySystems; -using Content.Shared.Humanoid; using Content.Shared.Interaction; -using Content.Shared.Interaction.Events; using Content.Shared.Maps; -using Content.Shared.Mobs; using Content.Shared.Mobs.Systems; using Content.Shared.Popups; using Content.Shared.Prayer; @@ -32,14 +24,14 @@ using Content.Shared.StatusEffect; using Content.Shared.Stunnable; using Content.Shared.Vampire; using Content.Shared.Vampire.Components; +using Content.Shared.Movement.Components; using Robust.Server.GameObjects; -using Robust.Shared.Player; -using Robust.Shared.GameStates; using Robust.Shared.Audio.Systems; using Robust.Shared.Containers; using Robust.Shared.Map; +using Robust.Shared.Player; using Robust.Shared.Prototypes; -using System.Linq; +using Content.Shared.Movement.Systems; namespace Content.Server.Vampire; @@ -77,6 +69,7 @@ public sealed partial class VampireSystem : EntitySystem [Dependency] private readonly MetabolizerSystem _metabolism = default!; [Dependency] private readonly UserInterfaceSystem _uiSystem = default!; [Dependency] private readonly SharedVampireSystem _vampire = default!; + [Dependency] private readonly MovementSpeedModifierSystem _speed = default!; public override void Initialize() { @@ -166,6 +159,29 @@ public sealed partial class VampireSystem : EntitySystem } strength.NextTick -= frameTime; } + + var scaleQuery = EntityQueryEnumerator(); + while (scaleQuery.MoveNext(out var uid, out var vampire, out var scale)) + { + if (vampire == null || scale == null) + continue; + if (scale.IsActive) + { + if (scale.NextTick <= 0) + { + scale.NextTick = 1; + if (!SubtractBloodEssence((uid, vampire), scale.Upkeep)) + { + ToggleBloodScale(uid, vampire); + scale.IsActive = false; + } + } + else + { + scale.NextTick -= frameTime; + } + } + } } private void OnComponentStartup(EntityUid uid, VampireComponent component, ComponentStartup args) diff --git a/Content.Shared/Vampire/VampireComponent.cs b/Content.Shared/Vampire/VampireComponent.cs index 6328d83f2e..95ac9cce5f 100644 --- a/Content.Shared/Vampire/VampireComponent.cs +++ b/Content.Shared/Vampire/VampireComponent.cs @@ -67,11 +67,15 @@ public sealed partial class VampireComponent : Component [ViewVariables(VVAccess.ReadWrite)] public EntityUid? MutationsAction; + + [ViewVariables(VVAccess.ReadWrite)] + public bool BloodScaleActive { get; set; } public readonly List> BaseVampireActions = new() { "ActionVampireToggleFangs", - "ActionVampireHypnotise" + "ActionVampireHypnotise", + "ActionVampireBloodScale" }; [ValidatePrototypeId] @@ -247,6 +251,21 @@ public sealed partial class VampireStrengthComponent : Component [ViewVariables(VVAccess.ReadWrite)] public float Upkeep = 0; } +[RegisterComponent] +public sealed partial class VampireBloodScaleComponent : Component +{ + [ViewVariables(VVAccess.ReadWrite)] + public float NextTick = 0; + + [ViewVariables(VVAccess.ReadWrite)] + public bool BloodScaleActive { get; set; } + + [ViewVariables(VVAccess.ReadWrite)] + public float Upkeep = 0; + + [ViewVariables(VVAccess.ReadWrite)] + public bool IsActive { get; set; } +} [Serializable, NetSerializable] public enum VampireMutationsType : byte diff --git a/Content.Shared/Vampire/VampireEvents.cs b/Content.Shared/Vampire/VampireEvents.cs index c36c1d5012..427135f174 100644 --- a/Content.Shared/Vampire/VampireEvents.cs +++ b/Content.Shared/Vampire/VampireEvents.cs @@ -15,6 +15,7 @@ public sealed partial class VampireBloodStealEvent : VampireSelfPowerEvent { } public sealed partial class VampireUnholyStrengthEvent : VampireSelfPowerEvent { } public sealed partial class VampireSupernaturalStrengthEvent : VampireSelfPowerEvent { } public sealed partial class VampireCloakOfDarknessEvent : VampireSelfPowerEvent { } +public sealed partial class VampireBloodScaleEvent : VampireSelfPowerEvent { } public sealed partial class VampireThermalVisionEvent : VampireSelfPowerEvent { } public sealed partial class VampireGlareEvent : VampireTargetedPowerEvent { } diff --git a/Resources/Prototypes/Actions/vampire.yml b/Resources/Prototypes/Actions/vampire.yml index 8dc47c43ee..ab6f722e0b 100644 --- a/Resources/Prototypes/Actions/vampire.yml +++ b/Resources/Prototypes/Actions/vampire.yml @@ -230,4 +230,21 @@ event: !type:VampireThermalVisionEvent definitionName: ThermalVision - useDelay: 5 \ No newline at end of file + useDelay: 5 + +- type: entity + id: ActionVampireBloodScale + name: blood scale + description: "Strengthen your muscles by compressing blood in order to develop maximum speed. Activation Cost: 10 Essence. Upkeep: 4 Essence/Second Cooldown: 5 Seconds" + categories: [ HideSpawnMenu ] + components: + - type: InstantAction + checkCanInteract: false + priority: 2 + itemIconStyle: NoItem + icon: + sprite: Interface/Actions/actions_vampire.rsi + state: bloodscale + event: + !type:VampireBloodScaleEvent + definitionName: BloodScale \ No newline at end of file diff --git a/Resources/Prototypes/Vampire/vampire-powers.yml b/Resources/Prototypes/Vampire/vampire-powers.yml index 89bc95dcd3..5b14830b2d 100644 --- a/Resources/Prototypes/Vampire/vampire-powers.yml +++ b/Resources/Prototypes/Vampire/vampire-powers.yml @@ -92,4 +92,10 @@ usableWhileStunned: true usableWhileCuffed: true usableWhileMuffled: true - activationCost: 0 \ No newline at end of file + activationCost: 0 + +- type: vampirePower + id: BloodScale + usableWhileStunned: false + usableWhileCuffed: false + activationCost: 10 \ No newline at end of file diff --git a/Resources/Textures/Interface/Actions/actions_vampire.rsi/bloodscale.png b/Resources/Textures/Interface/Actions/actions_vampire.rsi/bloodscale.png new file mode 100644 index 0000000000000000000000000000000000000000..6301df5e4838522bfaff750e427193ab50413e6e GIT binary patch literal 1393 zcmV-%1&;cOP)Px#1ZP1_K>z@;j|==^1poj532;bRa{vGi!~g&e!~vBn4jTXf01jnXNoGw=04e|g z00;m8000000Mb*F000E+Nkl`hiv%~d6bb1fMXKON@o%kIaAOx$QnaCqM{vb(HZD}JZP0={xbef+@ z<|i}ByyrP*?whrv*d zLo^yyEg+Fdi2mw)2lhSr9lE=_3j|KTvlC4r9dn5WoWIa2opfDCHj|U~|3NHv2mXLp z+DxYBu_Rs`Y{o|;F8X)`nAWE#ZTaPU-mj4-?3*=txav;6YGqwIGKibmS4( z)q?KCb%5E;>p zMZF~2if?fP-{UW7he?9k8`6GcXjZZ?Jw0vDKq>rq906hUqSA#m!FUO0it-vhL6Szz1uf=qU`FG`Sq|GGY#weC$8Op}^;pIiw1jS8 zq8K8nbT#mNb3oo+hG9rMlPN4xuCGsMUrW1X=$qmqv=QhUuEYDpK24o;k|iHiFkf60mvX;6_6OvJ^N?!fx1s>Cn{cfr(mWE!dvEij&ZYtwyW2 z6dMh0#ij`)X?HV;qq(QCD@A2e1vM5IMXcG_3|v$bs-X%!11?7nKDBZUnhp^nk*70# zqa?WBBE551`%qcRQAR)~lbblVP_@&@fn>oHPNzyKuky9P&slcku(DK!jlf+hsxwr> zTCg7n^*+43bQEu9j-ZLx1xcQYith2q{^pS_EG$&ah8dh!{{ii!vQ~zT0Pp@hoLHfg zTq6lkRS43$aH{7{a+pr1;UN+%UT@*1Qwk={3uobIJNHJAFAz#MDC;KOoDd< zXTlVQ8Jr1uv~M1l|I2^Pc&5Oo4T(nI^Da>pi ztgvMuaH31}JQ0ZEHk}Dm)QX7hIAy?`3O{9mg|oq82DS$0J7J}ud?&O*4x@pA0r_a) z1L@M)G0K3K_JCV;*&1XpC%Sj2aKSA*jE)@oNv452EYsNe1@om^k)^R){g}aD8C<=X z+NQu<3*52i*nY8@4r&pq2I7PLl?LYzA%;xBr)PG^AI8OBpDljF#p7`)C|e0mJqPFS z(Bg%}{5a*{R+xKyt1vb;CYlM@K2F7YPXPP}axsZ|X0-8i00000NkvXXu0mjfNtk-O literal 0 HcmV?d00001 diff --git a/Resources/Textures/Interface/Actions/actions_vampire.rsi/meta.json b/Resources/Textures/Interface/Actions/actions_vampire.rsi/meta.json index a9a4bb6bc3..bd23148a14 100644 --- a/Resources/Textures/Interface/Actions/actions_vampire.rsi/meta.json +++ b/Resources/Textures/Interface/Actions/actions_vampire.rsi/meta.json @@ -63,6 +63,9 @@ }, { "name": "thermalvision" + }, + { + "name": "bloodscale" } ] } \ No newline at end of file