private void OnApplyMetabolicMultiplier(EntityUid uid, MetabolizerComponent component, ApplyMetabolicMultiplierEvent args)
 {
     if (args.Apply)
     {
         component.UpdateFrequency *= args.Multiplier;
         return;
     }
     component.UpdateFrequency /= args.Multiplier;
     // Reset the accumulator properly
     if (component.AccumulatedFrametime >= component.UpdateFrequency)
     {
         component.AccumulatedFrametime = component.UpdateFrequency;
     }
 }
 private void OnApplyMetabolicMultiplier(EntityUid uid, BodyComponent component, ApplyMetabolicMultiplierEvent args)
 {
     foreach (var(part, _) in component.Parts)
     {
         foreach (var mechanism in part.Mechanisms)
         {
             RaiseLocalEvent(mechanism.Owner, args, false);
         }
     }
 }
Esempio n. 3
0
 private void OnApplyMetabolicMultiplier(EntityUid uid, RespiratorComponent component, ApplyMetabolicMultiplierEvent args)
 {
     if (args.Apply)
     {
         component.CycleDelay    *= args.Multiplier;
         component.Saturation    *= args.Multiplier;
         component.MaxSaturation *= args.Multiplier;
         component.MinSaturation *= args.Multiplier;
         return;
     }
     // This way we don't have to worry about it breaking if the stasis bed component is destroyed
     component.CycleDelay    /= args.Multiplier;
     component.Saturation    /= args.Multiplier;
     component.MaxSaturation /= args.Multiplier;
     component.MinSaturation /= args.Multiplier;
     // Reset the accumulator properly
     if (component.AccumulatedFrametime >= component.CycleDelay)
     {
         component.AccumulatedFrametime = component.CycleDelay;
     }
 }
Esempio n. 4
0
 private void OnApplyMetabolicMultiplier(EntityUid uid, StomachComponent component, ApplyMetabolicMultiplierEvent args)
 {
     if (args.Apply)
     {
         component.UpdateInterval *= args.Multiplier;
         return;
     }
     // This way we don't have to worry about it breaking if the stasis bed component is destroyed
     component.UpdateInterval /= args.Multiplier;
     // Reset the accumulator properly
     if (component.AccumulatedFrameTime >= component.UpdateInterval)
     {
         component.AccumulatedFrameTime = component.UpdateInterval;
     }
 }