Beispiel #1
0
 public static void checkForEndRound()
 {
     if (botUtil.botsInPlay.Count == 0 && botUtil.botsForWave == botUtil.spawnedBots)
     {
         if (Wave == totalWaves)
         {
             AIZ.zState = "ended";
             StartAsync(hud.endGame(true));
             return;
         }
         //g_AIZ.zState = "intermission";
         AfterDelay(100, () => AIZ.startIntermission());
         foreach (Entity players in Players)
         {
             if (AIZ.isPlayer(players) && players.HasField("isDown") && !players.GetField <bool>("isDown") && (!AIZ.isHellMap || (AIZ.isHellMap && killstreaks.visionRestored)))
             {
                 players.VisionSetNakedForPlayer(AIZ.vision);
             }
             if (AIZ.isPlayer(players))
             {
                 players.PlayLocalSound("mp_bonus_start");
                 players.PlayLocalSound("US_1mc_encourage_win");
             }
             if (isCrawlerWave || isBossWave)
             {
                 AIZ.giveMaxAmmo(players);
             }
         }
     }
     //if (!e_hud.stringsCleared && !isBossWave && Wave > 4 && f_botUtil.botsInPlay.Count < 10 && f_botUtil.botsForWave - f_botUtil.spawnedBots == 0) StartAsync(e_hud.clearAllGameStrings());
     checkForCompass();
 }
Beispiel #2
0
        public static void activateBonusDrop(Entity player, Entity bonus)
        {
            switch (bonus.GetField <string>("type"))
            {
            case "instaKill":
                botUtil.instaKillTime += 30;
                botUtil.startInstakill();
                bonus.PlaySound("mp_level_up");
                break;

            case "doublePoints":
                botUtil.doublePointsTime += 30;
                botUtil.startDoublePoints();
                bonus.PlaySound("mp_level_up");
                break;

            case "ammo":
                foreach (Entity players in Players)
                {
                    if (players.IsAlive)
                    {
                        AIZ.giveMaxAmmo(players);
                    }
                }
                break;

            case "nuke":
                StartAsync(doNuke(bonus));
                break;

            case "cash":
                bonus.PlaySound("mp_level_up");
                foreach (Entity players in Players)
                {
                    if (players.IsAlive && players.HasField("aizHud_created"))
                    {
                        players.SetField("cash", players.GetField <int>("cash") + 1000);
                        hud.scorePopup(players, 1000);
                        hud.scoreMessage(players, AIZ.gameStrings[97]);
                    }
                }
                break;

            case "points":
                bonus.PlaySound("mp_level_up");
                foreach (Entity players in Players)
                {
                    if (players.IsAlive && players.HasField("aizHud_created"))
                    {
                        int points = players.GetField <int>("points");
                        points += 10;
                        players.SetField("points", points);
                        //e_hud.scorePopup(players, 10);
                        hud.scoreMessage(players, AIZ.gameStrings[98]);
                        HudElem pointNumber = players.GetField <HudElem>("hud_pointNumber");
                        pointNumber.SetValue(points);
                    }
                }
                break;

            case "freeze":
                StartAsync(doFreezer(bonus));
                break;

            case "sale":
                mapEdit.startSale();
                mapEdit.sale = true;
                AfterDelay(30000, () => mapEdit.sale = false);
                break;

            case "perk":
                giveRandomPerkToAll();
                break;

            case "gun":
                player.PlayLocalSound("mp_level_up");
                StartAsync(giveDeathMachine(player));
                break;

            default:
                break;
            }
            hud.showPowerUpHud(bonus.GetField <string>("type"), player);
        }