Skip to content

Commit

Permalink
finally fix ling speed issues (Simple-Station#472)
Browse files Browse the repository at this point in the history
* gaming

* real!

* real 3!

* fuck

* great

* ungreat

* gnomes are here.

* g

* fuck

* raaagh cleanup

* fart

* ghfghdfghfbvd

* boobooboo

* RAAAAAAAAAAAAGH

* zased

* the unholy shitfix

* small chaeng

---------

Co-authored-by: whateverusername0 <whateveremail>
  • Loading branch information
whateverusername0 authored and VMSolidus committed Aug 16, 2024
1 parent 520f848 commit 866d0f6
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -349,18 +349,17 @@ private void ToggleStrainedMuscles(EntityUid uid, ChangelingComponent comp)
{
if (!comp.StrainedMusclesActive)
{
_speed.ChangeBaseSpeed(uid, 125f, 150f, 1f);
_popup.PopupEntity(Loc.GetString("changeling-muscles-start"), uid, uid);
comp.StrainedMusclesActive = true;
}
else
{
_speed.ChangeBaseSpeed(uid, 100f, 100f, 1f);
_popup.PopupEntity(Loc.GetString("changeling-muscles-end"), uid, uid);
comp.StrainedMusclesActive = false;
}

PlayMeatySound(uid, comp);
_speed.RefreshMovementSpeedModifiers(uid);
}

#endregion
Expand Down Expand Up @@ -527,7 +526,7 @@ public void OnEphedrineOverdose(EntityUid uid, ChangelingComponent comp, ref Act

var reagents = new List<(string, FixedPoint2)>()
{
("Synaptizine", 5f)
("Desoxyephedrine", 5f)
};
if (TryInjectReagents(uid, reagents))
_popup.PopupEntity(Loc.GetString("changeling-inject"), uid, uid);
Expand Down
11 changes: 11 additions & 0 deletions Content.Server/Goobstation/Changeling/ChangelingSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -121,9 +121,19 @@ public override void Initialize()
SubscribeLocalEvent<ChangelingComponent, DamageChangedEvent>(OnDamageChange);
SubscribeLocalEvent<ChangelingComponent, ComponentRemove>(OnComponentRemove);

SubscribeLocalEvent<ChangelingComponent, RefreshMovementSpeedModifiersEvent>(OnRefreshSpeed);

SubscribeAbilities();
}

private void OnRefreshSpeed(Entity<ChangelingComponent> ent, ref RefreshMovementSpeedModifiersEvent args)
{
if (ent.Comp.StrainedMusclesActive)
args.ModifySpeed(1.25f, 1.5f);
else
args.ModifySpeed(1f, 1f);
}

public override void Update(float frameTime)
{
base.Update(frameTime);
Expand Down Expand Up @@ -221,6 +231,7 @@ private void UpdateBiomass(EntityUid uid, ChangelingComponent comp, float? amoun
}
private void UpdateAbilities(EntityUid uid, ChangelingComponent comp)
{
_speed.RefreshMovementSpeedModifiers(uid);
if (comp.StrainedMusclesActive)
{
var stamina = EnsureComp<StaminaComponent>(uid);
Expand Down

0 comments on commit 866d0f6

Please sign in to comment.