public void DoDetonation()
 {
     wantDetonation = false;
     if (!GetComp <CompPowerTrader>().PowerOn)
     {
         PlayNeedPowerEffect();
         return;
     }
     SoundDefOf.FlickSwitch.PlayOneShot(this);
     RemoteExplosivesUtility.LightArmedExplosivesInRange(Position, Map, SignalRange, currentChannel);
 }
コード例 #2
0
        private void OnGizmoActivation()
        {
            if (lastActivationTick + ActivationCooldownTicks >= Find.TickManager.TicksGame)
            {
                return;
            }
            lastActivationTick = Find.TickManager.TicksGame;
            SoundDefOf.FlickSwitch.PlayOneShot(Wearer);

            RemoteExplosivesUtility.LightArmedExplosivesInRange(Wearer.Position, Wearer.Map, SignalRange, RemoteExplosivesUtility.RemoteChannel.White);

            numUsesLeft--;
            if (numUsesLeft <= 0)
            {
                Destroy(DestroyMode.KillFinalize);
                Messages.Message(DetonatorBrokeMessage, new TargetInfo(Wearer), MessageSound.Negative);
            }
        }