예제 #1
0
    private static void doNuke(Entity player, bool allowCancel, bool instant)
    {
        nukeInfo.SetField("player", player);
        nukeInfo.SetField("team", player.SessionTeam);
        nukeIncoming = true;
        GSCFunctions.SetDvar("ui_bomb_timer", 4);

        if (isTeamBased)
        {
            teamPlayerCardSplash("used_nuke", player);
        }
        else
        {
            player.IPrintLnBold("Friendly M.O.A.B. inbound!");
        }
        delaythread_nuke((nukeTimer * 1000) - 3300, new Action(nukeSoundIncoming));
        delaythread_nuke((nukeTimer * 1000), new Action(nukeSoundExplosion));
        if (nukeSloMotion)
        {
            delaythread_nuke((nukeTimer * 1000), new Action(nukeSloMo));
        }
        delaythread_nuke((nukeTimer * 1000), new Action(nukeEffects));
        delaythread_nuke((nukeTimer * 1000) + 250, new Action(nukeVision));
        delaythread_nuke((nukeTimer * 1000) + 1500, new Action(nukeDeath));
        if (destroyExplosives && !explosivesDestroyed)
        {
            delaythread_nuke((nukeTimer * 1000) + 1600, destroyDestructables);
        }
        //delaythread_nuke((nukeTimer * 1000) + 1500, new Action(nukeEarthquake));
        nukeAftermathEffect();
        update_ui_timers();

        if (cancelMode != 0 && allowCancel)
        {
            cancelNukeOnDeath(player);
        }

        //Entity clockObject = GSCFunctions.Spawn("script_origin", Vector3.Zero);
        //clockObject.Hide();

        int nukeTimer_loc = nukeTimer;

        OnInterval(1000, () =>
        {
            if (nukeTimer_loc > 0)
            {
                //clockObject.PlaySound("ui_mp_nukebomb_timer");
                GSCFunctions.PlaySoundAtPos(Vector3.Zero, "ui_mp_nukebomb_timer");
                nukeTimer_loc--;
                return(true);
            }
            return(false);
        });
    }