public void Resist(EntityUid uid, FlammableComponent?flammable = null, ServerAlertsComponent?alerts = null) { if (!Resolve(uid, ref flammable, ref alerts)) { return; } if (!flammable.OnFire || !_actionBlockerSystem.CanInteract(flammable.Owner) || flammable.Resisting) { return; } flammable.Resisting = true; flammable.Owner.PopupMessage(Loc.GetString("flammable-component-resist-message")); _stunSystem.TryParalyze(uid, TimeSpan.FromSeconds(2f), alerts: alerts); // TODO FLAMMABLE: Make this not use TimerComponent... flammable.Owner.SpawnTimer(2000, () => { flammable.Resisting = false; flammable.FireStacks -= 3f; UpdateAppearance(uid, flammable); }); }
public override void Update(float frameTime) { base.Update(frameTime); foreach (var instrument in EntityManager.EntityQuery <InstrumentComponent>(true)) { if ((instrument.BatchesDropped >= MaxMidiBatchesDropped || instrument.LaggedBatches >= MaxMidiLaggedBatches) && instrument.InstrumentPlayer != null && instrument.RespectMidiLimits) { // Just in case Clean((instrument).Owner); instrument.UserInterface?.CloseAll(); if (instrument.InstrumentPlayer.AttachedEntity is { Valid: true } mob) { _stunSystem.TryParalyze(mob, TimeSpan.FromSeconds(1), true); instrument.Owner.PopupMessage(mob, "instrument-component-finger-cramps-max-message"); } } instrument.Timer += frameTime; if (instrument.Timer < 1) { continue; } instrument.Timer = 0f; instrument.MidiEventCount = 0; instrument.LaggedBatches = 0; instrument.BatchesDropped = 0; } }
private void OnLinkAttempt(EntityUid uid, ConveyorComponent component, LinkAttemptEvent args) { if (args.TransmitterComponent.Outputs.GetPort(args.TransmitterPort).Signal is TwoWayLeverSignal signal && signal != TwoWayLeverSignal.Middle) { args.Cancel(); _stunSystem.TryParalyze(uid, TimeSpan.FromSeconds(2f), true); component.Owner.PopupMessage(args.Attemptee, Loc.GetString("conveyor-component-failed-link")); } }
/// <summary> /// Puts everyone unbuckled on the floor, paralyzed. /// </summary> private void DoTheDinosaur(TransformComponent xform) { var buckleQuery = GetEntityQuery <BuckleComponent>(); var statusQuery = GetEntityQuery <StatusEffectsComponent>(); // Get enumeration exceptions from people dropping things if we just paralyze as we go var toKnock = new ValueList <EntityUid>(); KnockOverKids(xform, buckleQuery, statusQuery, ref toKnock); foreach (var child in toKnock) { if (!statusQuery.TryGetComponent(child, out var status)) { continue; } _stuns.TryParalyze(child, _hyperspaceKnockdownTime, true, status); } }