public override void Update(Wire wire)
 {
     if (TimeoutKey != null && !IsPowered(wire.Owner))
     {
         WiresSystem.TryCancelWireAction(wire.Owner, TimeoutKey);
     }
 }
 public override void Update(Wire wire)
 {
     if (!IsPowered(wire.Owner))
     {
         WiresSystem.TryCancelWireAction(wire.Owner, PulseTimeoutKey.Key);
     }
 }
    public override bool Cut(EntityUid user, Wire wire)
    {
        if (EntityManager.TryGetComponent <AirlockComponent>(wire.Owner, out var door))
        {
            WiresSystem.TryCancelWireAction(wire.Owner, PulseTimeoutKey.Key);
            door.AutoCloseDelayModifier = 0.01f;
        }

        return(true);
    }
    public override bool Cut(EntityUid user, Wire wire)
    {
        if (EntityManager.TryGetComponent <AirlockComponent>(wire.Owner, out var door))
        {
            WiresSystem.TryCancelWireAction(wire.Owner, PulseTimeoutKey.Key);
            door.Safety = false;
        }

        return(true);
    }
    public override bool Cut(EntityUid user, Wire wire)
    {
        if (EntityManager.TryGetComponent <AccessReaderComponent>(wire.Owner, out var access))
        {
            WiresSystem.TryCancelWireAction(wire.Owner, PulseTimeoutKey.Key);
            access.Enabled = false;
        }

        return(true);
    }
    public override bool Cut(EntityUid user, Wire wire)
    {
        ToggleValue(wire.Owner, false);

        if (TimeoutKey != null)
        {
            WiresSystem.TryCancelWireAction(wire.Owner, TimeoutKey);
        }

        return(true);
    }
Пример #7
0
 public override void Update(Wire wire)
 {
     if (!IsPowered(wire.Owner))
     {
         if (!WiresSystem.TryGetData(wire.Owner, PowerWireActionKey.Pulsed, out bool pulsed) ||
             !pulsed)
         {
             WiresSystem.TryCancelWireAction(wire.Owner, PowerWireActionKey.ElectrifiedCancel);
             WiresSystem.TryCancelWireAction(wire.Owner, PowerWireActionKey.PulseCancel);
         }
     }
 }
Пример #8
0
    public override bool Mend(EntityUid user, Wire wire)
    {
        if (!TrySetElectrocution(user, wire))
        {
            return(false);
        }

        // Mending any power wire restores shorts.
        WiresSystem.TryCancelWireAction(wire.Owner, PowerWireActionKey.PulseCancel);
        WiresSystem.TryCancelWireAction(wire.Owner, PowerWireActionKey.ElectrifiedCancel);

        SetWireCuts(wire.Owner, false);

        SetPower(wire.Owner, false);

        return(true);
    }
Пример #9
0
    public override bool Pulse(EntityUid user, Wire wire)
    {
        WiresSystem.TryCancelWireAction(wire.Owner, PowerWireActionKey.ElectrifiedCancel);

        var electrocuted = !TrySetElectrocution(user, wire, true);

        if (WiresSystem.TryGetData(wire.Owner, PowerWireActionKey.Pulsed, out bool pulsedKey) &&
            pulsedKey)
        {
            return(false);
        }

        WiresSystem.SetData(wire.Owner, PowerWireActionKey.Pulsed, true);
        WiresSystem.StartWireAction(wire.Owner, _pulseTimeout, PowerWireActionKey.PulseCancel, new TimedWireEvent(AwaitPulseCancel, wire));

        if (electrocuted)
        {
            return(false);
        }

        SetPower(wire.Owner, true);
        return(true);
    }