Esempio n. 1
0
        public static void Nuke(Entity player)
        {
            player.WinCash(400);
            Hud.BonusDropTakeHud(player, "Nuke", "dpad_killstreak_nuke");

            foreach (var item in Utility.GetPlayers())
            {
                if (item.GetTeam() == "axis" && item.IsAlive)
                {
                    item.AfterDelay(600, e => item.SelfExploed());
                }
            }
        }
Esempio n. 2
0
        public Gambler(Vector3 origin, Vector3 angle) : base(BoxType.Gambler, origin, angle, 50)
        {
            IsUsing     = false;
            Laptop      = MapEdit.CreateLaptop(Origin);
            Icon        = "cardicon_8ball";
            Shader      = Hud.CreateShader(Origin, Icon);
            ObjectiveId = Hud.CreateObjective(Origin, Icon);
            Cost        = 500;

            OnTriggerString += player =>
            {
                if (!IsUsing && player.GetField <int>("isgambling") == 0)
                {
                    if ((player.GetTeam() == "allies" && Utility.GetDvar <int>("allies_fire_sale") == 1) || (player.GetTeam() == "axis" && Utility.GetDvar <int>("axis_fire_sale") == 1))
                    {
                        return("Press ^3[{+activate}] ^7to gamble. [Cost: ^2$^610^7]");
                    }
                    return("Press ^3[{+activate}] ^7to gamble. [Cost: ^2$^3" + Cost + "^7]");
                }
                return("");
            };

            OnTriggerUse += player =>
            {
                if (IsUsing)
                {
                    return;
                }
                if (!player.IsAlive)
                {
                    return;
                }
                if ((!player.HasField("isgambling") || player.GetField <int>("isgambling") == 0))
                {
                    if ((player.GetTeam() == "allies" && Utility.GetDvar <int>("allies_fire_sale") == 1) || (player.GetTeam() == "axis" && Utility.GetDvar <int>("axis_fire_sale") == 1) && player.GetCash() >= 10)
                    {
                        player.PayCash(10);
                        Gamble(player);
                    }
                    else if (player.GetCash() >= Cost)
                    {
                        player.PayCash(Cost);
                        Gamble(player);
                    }
                    else
                    {
                        player.Println("^1Not enough cash for Gambler. Need ^2$^3" + Cost);
                    }
                }
            };
        }
Esempio n. 3
0
        public Teleporter(Vector3 origin, Vector3 exit, Vector3 angle) : base(BoxType.Teleporter, origin, angle, 50)
        {
            Exit        = exit;
            Laptop      = MapEdit.CreateLaptop(Origin);
            Icon        = "hudicon_neutral";
            Shader      = Hud.CreateShader(Origin, Icon);
            ObjectiveId = Hud.CreateObjective(Origin, Icon);
            Cost        = 500;

            OnTriggerString += player =>
            {
                if (player.GetTeam() == "allies")
                {
                    if (player.GetField <int>("usingteleport") == 0)
                    {
                        if ((player.GetTeam() == "allies" && Utility.GetDvar <int>("allies_fire_sale") == 1) || (player.GetTeam() == "axis" && Utility.GetDvar <int>("axis_fire_sale") == 1))
                        {
                            return("Press ^3[{+activate}] ^7to use teleporter. [Cost: ^2$^610^7]");
                        }
                        return("Press ^3[{+activate}] ^7to use teleporter. [Cost: ^2$^3" + Cost + "^7]");
                    }
                }
                return("");
            };

            OnTriggerUse += player =>
            {
                if (!player.IsAlive)
                {
                    return;
                }
                if (player.GetField <int>("usingteleport") == 0)
                {
                    if ((player.GetTeam() == "allies" && Utility.GetDvar <int>("allies_fire_sale") == 1) || (player.GetTeam() == "axis" && Utility.GetDvar <int>("axis_fire_sale") == 1) && player.GetCash() >= 10)
                    {
                        player.PayCash(10);
                        Teleport(player);
                    }
                    else if (player.GetCash() >= Cost)
                    {
                        player.PayCash(Cost);
                        Teleport(player);
                    }
                    else
                    {
                        player.Println("^1Not enough cash for Teleporter. Need ^2$^3" + Cost);
                    }
                }
            };
        }
Esempio n. 4
0
        public static void FireSale(Entity player)
        {
            if (Function.Call <int>("getdvarint", "bonus_fire_sale") == 1)
            {
                return;
            }

            PowerUpHudTimer(Hud.BonusDropHud("cardicon_joystick", 70));
            Function.Call("setdvar", "bonus_fire_sale", 1);
            player.AfterDelay(30000, e =>
            {
                Function.Call("setdvar", "bonus_fire_sale", 0);
            });
        }
Esempio n. 5
0
        public static void InstaKill(Entity player)
        {
            if (Function.Call <int>("getdvarint", "bonus_insta_kill") == 1)
            {
                return;
            }

            PowerUpHudTimer(Hud.BonusDropHud("cardicon_skull_black", -35));
            Function.Call("setdvar", "bonus_insta_kill", 1);
            player.AfterDelay(30000, e =>
            {
                Function.Call("setdvar", "bonus_insta_kill", 0);
            });
        }
Esempio n. 6
0
        public static void DoublePoints(Entity player)
        {
            if (Function.Call <int>("getdvarint", "bonus_double_points") == 1)
            {
                return;
            }

            PowerUpHudTimer(Hud.BonusDropHud("cardicon_spetsnaz", 0));
            Function.Call("setdvar", "bonus_double_points", 1);
            player.AfterDelay(30000, e =>
            {
                Function.Call("setdvar", "bonus_double_points", 0);
            });
        }
Esempio n. 7
0
        public void CreateElevator(Vector3 enter, Vector3 exit)
        {
            Entity flag = Utility.Spawn("script_model", enter);

            flag.Call("setmodel", Utility.GetFlagModel());
            Utility.Spawn("script_model", exit).Call("setmodel", "prop_flag_neutral");
            Hud.CreateFlagShader(enter);
            Hud.CreateObjective(enter, "compass_waypoint_target");
            OnInterval(100, () =>
            {
                foreach (Entity entity in Utility.Players)
                {
                    if (entity.Origin.DistanceTo(enter) <= 50f)
                    {
                        entity.Call("setorigin", exit);
                    }
                }
                return(true);
            });
        }
Esempio n. 8
0
        public PerkColaMachine(Vector3 origin, Vector3 angle, PerkColaType perk) : base(BoxType.PerkColaMachine, origin, angle, 50)
        {
            if (MapEdit.spawnedPerkColas.Contains(perk))
            {
                Dispose();
                return;
            }
            MapEdit.spawnedPerkColas.Add(perk);

            PerkCola    = new PerkCola(perk);
            Icon        = PerkCola.GetIcon();
            ObjectiveId = Hud.CreateObjective(Origin, Icon);
            Cost        = PerkCola.GetCost();

            string fullname = PerkCola.GetFullName();

            OnTriggerString += player =>
            {
                if ((player.GetTeam() == "allies" && Utility.GetDvar <int>("allies_fire_sale") == 1) || (player.GetTeam() == "axis" && Utility.GetDvar <int>("axis_fire_sale") == 1))
                {
                    return("Press ^3[{+activate}] ^7to buy " + fullname + ". [Cost: ^2$^610^7]");
                }
                return("Press ^3[{+activate}] ^7to buy " + fullname + ". [Cost: ^2$^3" + Cost + "^7]");
            };

            OnTriggerUse += player =>
            {
                if (!player.IsAlive)
                {
                    return;
                }
                if ((player.GetTeam() == "allies" && Utility.GetDvar <int>("allies_fire_sale") == 1) || (player.GetTeam() == "axis" && Utility.GetDvar <int>("axis_fire_sale") == 1) && player.GetCash() >= 10)
                {
                    if (player.PerkColasCount() >= 4)
                    {
                        player.PrintlnBold("^1You already have 4 Perk-a-Cola.");
                        return;
                    }
                    if (player.HasPerkCola(PerkCola))
                    {
                        player.PrintlnBold("^1You already have " + fullname + ".");
                        return;
                    }
                    player.PayCash(10);
                    player.GivePerkCola(PerkCola);
                }
                else if (player.GetCash() >= Cost)
                {
                    if (player.PerkColasCount() >= 4)
                    {
                        player.PrintlnBold("^1You already have 4 Perk-a-Cola.");
                        return;
                    }
                    if (player.HasPerkCola(PerkCola))
                    {
                        player.PrintlnBold("^1You already have " + fullname + ".");
                        return;
                    }
                    player.PayCash(Cost);
                    player.GivePerkCola(PerkCola);
                }
                else
                {
                    player.Println("^1Not enough cash for " + fullname + ". Need ^2$^3" + Cost);
                }
            };
        }