Ejemplo n.º 1
0
 private void OnSlowHandleState(EntityUid uid, SlowedDownComponent component, ref ComponentHandleState args)
 {
     if (args.Current is SlowedDownComponentState state)
     {
         component.SprintSpeedModifier = state.SprintSpeedModifier;
         component.WalkSpeedModifier   = state.WalkSpeedModifier;
     }
 }
Ejemplo n.º 2
0
 private void OnSlowInit(EntityUid uid, SlowedDownComponent component, ComponentInit args)
 {
     // needs to be done so the client can also refresh when the addition is replicated,
     // if the initial status effect addition wasn't predicted
     if (EntityManager.TryGetComponent <MovementSpeedModifierComponent>(uid, out var move))
     {
         move.RefreshMovementSpeedModifiers();
     }
 }
Ejemplo n.º 3
0
 private void OnSlowRemove(EntityUid uid, SlowedDownComponent component, ComponentRemove args)
 {
     if (EntityManager.TryGetComponent <MovementSpeedModifierComponent>(uid, out var move))
     {
         component.SprintSpeedModifier = 1.0f;
         component.WalkSpeedModifier   = 1.0f;
         move.RefreshMovementSpeedModifiers();
     }
 }
Ejemplo n.º 4
0
 private void OnSlowGetState(EntityUid uid, SlowedDownComponent component, ref ComponentGetState args)
 {
     args.State = new SlowedDownComponentState(component.SprintSpeedModifier, component.WalkSpeedModifier);
 }
Ejemplo n.º 5
0
 private void OnRefreshMovespeed(EntityUid uid, SlowedDownComponent component, RefreshMovementSpeedModifiersEvent args)
 {
     args.ModifySpeed(component.WalkSpeedModifier, component.SprintSpeedModifier);
 }
Ejemplo n.º 6
0
 private void OnSlowRemove(EntityUid uid, SlowedDownComponent component, ComponentRemove args)
 {
     _movementSpeedModifierSystem.RefreshMovementSpeedModifiers(uid);
 }
 private void OnSlowRemove(EntityUid uid, SlowedDownComponent component, ComponentShutdown args)
 {
     component.SprintSpeedModifier = 1f;
     component.WalkSpeedModifier   = 1f;
     _movementSpeedModifierSystem.RefreshMovementSpeedModifiers(uid);
 }