forked from space-wizards/space-station-14
-
Notifications
You must be signed in to change notification settings - Fork 156
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' into internal-affairs
- Loading branch information
Showing
110 changed files
with
2,610 additions
and
93 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
38 changes: 38 additions & 0 deletions
38
Content.Shared/SS220/Movement/Components/TemporaryWaddleComponent.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
// © SS220, An EULA/CLA with a hosting restriction, full text: https://raw.githubusercontent.com/SerbiaStrong-220/space-station-14/master/CLA.txt | ||
using Robust.Shared.GameStates; | ||
using System.Numerics; | ||
|
||
namespace Content.Shared.SS220.Movement.Components; | ||
|
||
/// <summary> | ||
/// Exists for use as a status effect. | ||
/// Entity with this component will be funny to waddle. | ||
/// </summary> | ||
[RegisterComponent, NetworkedComponent, AutoGenerateComponentState] | ||
public sealed partial class TemporaryWaddleComponent : Component | ||
{ | ||
///<summary> | ||
/// How high should they hop during the waddle? Higher hop = more energy. | ||
/// </summary> | ||
[DataField, AutoNetworkedField] | ||
public Vector2 HopIntensity = new(0, 0.125f); | ||
|
||
/// <summary> | ||
/// How far should they rock backward and forward during the waddle? | ||
/// Each step will alternate between this being a positive and negative rotation. More rock = more scary. | ||
/// </summary> | ||
[DataField, AutoNetworkedField] | ||
public float TumbleIntensity = 10.0f; | ||
|
||
/// <summary> | ||
/// How long should a complete step take? Less time = more chaos. | ||
/// </summary> | ||
[DataField, AutoNetworkedField] | ||
public float AnimationLength = 0.66f; | ||
|
||
/// <summary> | ||
/// How much shorter should the animation be when running? | ||
/// </summary> | ||
[DataField, AutoNetworkedField] | ||
public float RunAnimationLengthMultiplier = 0.568f; | ||
} |
58 changes: 58 additions & 0 deletions
58
Content.Shared/SS220/Movement/Systems/TemporaryWaddleSystem.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
// © SS220, An EULA/CLA with a hosting restriction, full text: https://raw.githubusercontent.com/SerbiaStrong-220/space-station-14/master/CLA.txt | ||
using Content.Shared.Clothing.Components; | ||
using Content.Shared.Inventory; | ||
using Content.Shared.Movement.Components; | ||
using Content.Shared.SS220.Movement.Components; | ||
using Content.Shared.StatusEffect; | ||
|
||
namespace Content.Shared.SS220.Movement.Systems; | ||
|
||
public sealed class TemporaryWaddleSystem : EntitySystem | ||
{ | ||
[ValidatePrototypeId<StatusEffectPrototype>] | ||
public const string WaddlingStatusEffect = "TemporaryWaddle"; | ||
|
||
[Dependency] private readonly InventorySystem _inventorySystem = default!; | ||
|
||
public override void Initialize() | ||
{ | ||
base.Initialize(); | ||
|
||
SubscribeLocalEvent<TemporaryWaddleComponent, ComponentInit>(OnInit); | ||
SubscribeLocalEvent<TemporaryWaddleComponent, ComponentRemove>(OnRemoved); | ||
} | ||
|
||
private void OnInit(EntityUid uid, TemporaryWaddleComponent component, ComponentInit args) | ||
{ | ||
EnsureComp<WaddleAnimationComponent>(uid, out var waddleAnimComp); | ||
|
||
//Set values from TemporaryWaddleComponent if entity hasn`t clown shoes or hasn`t shoes in that slot | ||
if (!_inventorySystem.TryGetSlotEntity(uid, "shoes", out var shoesUid) || !HasComp<WaddleWhenWornComponent>(shoesUid)) | ||
{ | ||
SetAnimationValues(uid); | ||
} | ||
} | ||
|
||
private void OnRemoved(EntityUid uid, TemporaryWaddleComponent component, ComponentRemove args) | ||
{ | ||
// If uid has clown shoes, then the WaddleAnimation doesn`t removed | ||
if (_inventorySystem.TryGetSlotEntity(uid, "shoes", out var shoesUid) && HasComp<WaddleWhenWornComponent>(shoesUid)) | ||
return; | ||
|
||
RemComp<WaddleAnimationComponent>(uid); | ||
} | ||
|
||
public void SetAnimationValues(EntityUid uid, TemporaryWaddleComponent? component = null) | ||
{ | ||
if (!Resolve(uid, ref component)) | ||
return; | ||
|
||
if (!TryComp<WaddleAnimationComponent>(uid, out var waddleAnimComp)) | ||
return; | ||
|
||
waddleAnimComp.AnimationLength = component.AnimationLength; | ||
waddleAnimComp.HopIntensity = component.HopIntensity; | ||
waddleAnimComp.RunAnimationLengthMultiplier = component.RunAnimationLengthMultiplier; | ||
waddleAnimComp.TumbleIntensity = component.TumbleIntensity; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.