Skip to content

Commit

Permalink
actually i did need it and i forgot to make this change
Browse files Browse the repository at this point in the history
  • Loading branch information
Darkmajia committed Dec 9, 2024
1 parent d9b0c62 commit b02e9b7
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
using Content.Shared.Eye.Blinding.Components;
using Content.Server.Flash.Components;
using Content.Shared.Movement.Pulling.Components;
using Content.Shared.Stealth;
using Content.Shared.Stealth.Components;
using Content.Shared.Damage.Components;
using Content.Server.Radio.Components;
Expand All @@ -26,6 +27,7 @@ namespace Content.Server.Changeling;
public sealed partial class ChangelingSystem : EntitySystem
{
[Dependency] private readonly SharedRottingSystem _rotting = default!;
[Dependency] private readonly SharedStealthSystem _stealth = default!;

public void SubscribeAbilities()
{
Expand Down Expand Up @@ -575,15 +577,14 @@ public void OnChameleonSkin(EntityUid uid, ChangelingComponent comp, ref ActionC
_popup.PopupEntity(Loc.GetString("changeling-chameleon-end"), uid, uid);
return;
}
else
{
AddComp<StealthComponent>(uid);

var stealthOnMove = AddComp<StealthOnMoveComponent>(uid);
stealthOnMove.MovementVisibilityRate = 1;
EnsureComp<StealthComponent>(uid);
_stealth.SetMinVisibility(uid, 0);

_popup.PopupEntity(Loc.GetString("changeling-chameleon-start"), uid, uid);
}
var stealthOnMove = EnsureComp<StealthOnMoveComponent>(uid);
stealthOnMove.MovementVisibilityRate = 1;

_popup.PopupEntity(Loc.GetString("changeling-chameleon-start"), uid, uid);
}
public void OnEphedrineOverdose(EntityUid uid, ChangelingComponent comp, ref ActionEphedrineOverdoseEvent args)
{
Expand Down
14 changes: 14 additions & 0 deletions Content.Shared/Stealth/SharedStealthSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -208,4 +208,18 @@ public GetVisibilityModifiersEvent(EntityUid uid, StealthComponent stealth, floa
FlatModifier = flatModifier;
}
}

/// <summary>
/// Sets the minimum visibility
/// </summary>
/// <param name="value">The value to set the minimum visibility to.</param>
public void SetMinVisibility(EntityUid uid, float value, StealthComponent? component = null)
{
if (!Resolve(uid, ref component))
return;

component.MinVisibility = value;

Dirty(uid, component);
}
}

0 comments on commit b02e9b7

Please sign in to comment.