Puddle Code Slipping Cleanup (#35845)
* Init Commit * windows yelling at me to update commit * working commit, need prediciton and more dehardcoding * Project 0 warnings * Working Commit (Near Final) * ryder got confused commit * I love Merge Conflicts :) * Working commit, no prediction * Forgot the yaml changes * Comments and typos * Apparently while the reduced launch mult of lube was initialized it was never used so I revered back to default * Fixed an incorrect divisor * bit of cleanup * Prediciton fixed, and puddles now affect all entities * FORGOT TO RENAME A VERY IMPORTANT VARIABLE OOPS * Really big I forgor moment * Even bigger I forgor moment * four more merge conflicts to fix four more oopsies * fixed actual divide by zero moment and also im very dumb * Even bigger I forgor moment * four more merge conflicts to fix four more oopsies * fixed actual divide by zero moment and also im very dumb * Fix all test fails * code cleanup * Webedit whitespace * Code cleaup * whitespace webedit * whitespace webedit * whitespace webedit * whitespace removal * Comments and cleanup * Re-Added 20 warnings as per Ork's request * Cleanups * Spacing fix * bugfixes and cleanup * Small bugfix * Actually dirty the slipComp for real * Added Friction field to Reagent Prototype per design discussion * Sliding system is kill
This commit is contained in:
committed by
GitHub
parent
c2857c5247
commit
251cfbd8be
@@ -11,20 +11,11 @@ public sealed class SlidingSystem : EntitySystem
|
||||
{
|
||||
base.Initialize();
|
||||
|
||||
SubscribeLocalEvent<SlidingComponent, TileFrictionEvent>(OnSlideAttempt);
|
||||
SubscribeLocalEvent<SlidingComponent, StoodEvent>(OnStand);
|
||||
SubscribeLocalEvent<SlidingComponent, StartCollideEvent>(OnStartCollide);
|
||||
SubscribeLocalEvent<SlidingComponent, EndCollideEvent>(OnEndCollide);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Modify the friction by the frictionModifier stored on the component.
|
||||
/// </summary>
|
||||
private void OnSlideAttempt(EntityUid uid, SlidingComponent component, ref TileFrictionEvent args)
|
||||
{
|
||||
args.Modifier = component.FrictionModifier;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Remove the component when the entity stands up again.
|
||||
/// </summary>
|
||||
@@ -38,11 +29,10 @@ public sealed class SlidingSystem : EntitySystem
|
||||
/// </summary>
|
||||
private void OnStartCollide(EntityUid uid, SlidingComponent component, ref StartCollideEvent args)
|
||||
{
|
||||
if (!TryComp<SlipperyComponent>(args.OtherEntity, out var slippery) || !slippery.SuperSlippery)
|
||||
if (!TryComp<SlipperyComponent>(args.OtherEntity, out var slippery) || !slippery.SlipData.SuperSlippery)
|
||||
return;
|
||||
|
||||
component.CollidingEntities.Add(args.OtherEntity);
|
||||
component.FrictionModifier = 0;
|
||||
Dirty(uid, component);
|
||||
}
|
||||
|
||||
@@ -55,7 +45,7 @@ public sealed class SlidingSystem : EntitySystem
|
||||
return;
|
||||
|
||||
if (component.CollidingEntities.Count == 0)
|
||||
component.FrictionModifier = SharedStunSystem.KnockDownModifier;
|
||||
RemComp<SlidingComponent>(uid);
|
||||
|
||||
Dirty(uid, component);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user