Example #1
0
        // Creates new TP-zone to save HALE from falling into death (with penalty of losing life)
        public void SetSafeZone(SFDGameScriptInterface.Vector2 pos, SFDGameScriptInterface.Point sizeFactor)
        {
            // Create a new trigger with the
            IObjectAreaTrigger saveHaleZone = (IObjectAreaTrigger)Game.CreateObject("AreaTrigger", pos);

            saveHaleZone.SetOnEnterMethod("KillZoneTrigger");
            saveHaleZone.SetSizeFactor(sizeFactor);
            if (MODE)
            {
                Game.RunCommand("/MSG " + "SIZE : " + saveHaleZone.GetSize().ToString());
                Game.RunCommand("/MSG " + "SIZEFACTOR : " + saveHaleZone.GetSizeFactor().ToString());
                Game.RunCommand("/MSG " + "BASESIZE : " + saveHaleZone.GetBaseSize().ToString());
            }
        }
Example #2
0
        // Run code before triggers marked with "Activate on startup" but after players spawn from SpawnMarkers.
        public void OnStartup()
        {
            // Bool variable to set  mode (1 player in game is HALE)
            MODE = false;

            m_rnd = new Random((int)DateTime.Now.Millisecond * (int)DateTime.Now.Minute * 1000);

            // By default HALE cannot tp or ZA WARUDO and no one zombifyes on death
            tpEnabled            = false;
            warudoEnabled        = false;
            zombifyHumansOnDeath = false;


            // Initate all HALE types
            HALENAMES    = new string[5];
            HALENAMES[0] = "Saxton Fale";
            HALENAMES[1] = "Sin Feaster";
            HALENAMES[2] = "Speedy Fale";
            HALENAMES[3] = "DIO";
            HALENAMES[4] = "Dom Toretto";

            // Every 200ms, delete all items from HALE
            RemoveHaleItemsTimer = (IObjectTimerTrigger)Game.CreateObject("TimerTrigger");
            RemoveHaleItemsTimer.SetRepeatCount(0);
            RemoveHaleItemsTimer.SetIntervalTime(200);
            RemoveHaleItemsTimer.SetScriptMethod("RemoveHaleItems");

            // Trigger for displaying HALE status for players
            DisplayHaleStatusTimer = (IObjectTimerTrigger)Game.CreateObject("TimerTrigger");
            DisplayHaleStatusTimer.SetRepeatCount(0);
            DisplayHaleStatusTimer.SetIntervalTime(1000);
            DisplayHaleStatusTimer.SetScriptMethod("DisplayHaleStatus");

            // Player key input ( for hale teleport)
            Events.PlayerKeyInputCallback.Start(OnPlayerKeyInput);

            // Set lastTeleported to game start
            lastTeleported = Game.TotalElapsedGameTime;
            lastWarudod    = Game.TotalElapsedGameTime;

            // Trigger for HALE action cooldown.
            HaleMovementStopper = (IObjectTimerTrigger)Game.CreateObject("TimerTrigger");
            HaleMovementStopper.SetRepeatCount(1);
            HaleMovementStopper.SetIntervalTime(500);
            HaleMovementStopper.SetScriptMethod("ToggleHaleMovement");

            // Trigger for HALE beginning cooldown. In the beginning set to stop HALE for 5s
            HaleStartCooldown = (IObjectTimerTrigger)Game.CreateObject("TimerTrigger");
            HaleStartCooldown.SetRepeatCount(1);
            HaleStartCooldown.SetIntervalTime(5000);
            HaleStartCooldown.SetScriptMethod("ToggleHaleMovement");

            // Trigger for disabling player input for 2-3 seconds (ZA WARUDO).
            PlayerMovementStopper = (IObjectTimerTrigger)Game.CreateObject("TimerTrigger");
            PlayerMovementStopper.SetRepeatCount(1);
            PlayerMovementStopper.SetIntervalTime(750);
            PlayerMovementStopper.SetScriptMethod("TogglePlayerMovement");

            // Time trigger for reanimating players
            ReanimateTrigger = (IObjectTimerTrigger)Game.CreateObject("TimerTrigger");
            ReanimateTrigger.SetRepeatCount(0);
            ReanimateTrigger.SetIntervalTime(200);
            ReanimateTrigger.SetScriptMethod("ReanimatePlayers");

            // On death trigger for ondeath event for zombie hale
            IObjectTrigger deathTrigger = (IObjectTrigger)Game.CreateObject("OnPlayerDeathTrigger");

            deathTrigger.SetScriptMethod("ondeath");

            // At the beginning of the game set next HALE
            SetHale();
            HelloHale();
            zombies.Clear();
        }