Inheritance: MonoBehaviour
 void MakeInstance()
 {
     if (instance == null)
     {
         instance = this;
     }
 }
 public static void Postfix(EndGameManager __instance)
 {
     CustomGameObjectManager.deleteAll();
     HudManagerPatch.LoadSprites();
     if (LoveCoupleWins)
     {
         PoolablePlayer[] players = GameObject.FindObjectsOfType <PoolablePlayer>();
         if (players[0] != null)
         {
             players[0].gameObject.transform.position -= new Vector3(1.5f, 0, 0);
             players[0].SetFlipX(true);
             players[0].NameText.text = "<color=#FF80D5FF>" + players[0].NameText.text + "</color>";
         }
         if (players[1] != null)
         {
             players[1].SetFlipX(false);
             players[1].gameObject.transform.position    = players[0].gameObject.transform.position + new Vector3(1.2f, 0, 0);
             players[1].gameObject.transform.localScale *= 0.92f;
             players[1].HatSlot.transform.position      += new Vector3(0.1f, 0, 0);
             players[1].NameText.text = "<color=#FF80D5FF>" + players[1].NameText.text + "</color>";
         }
         __instance.BackgroundBar.material.color = Love.color;
         var wintext = GameObject.Instantiate(players[0].NameText);
         wintext.text = "<color=#FF80D5FF>Love couple wins</color > ";
         wintext.transform.position  += new Vector3(0, 1.4f, 0);
         wintext.transform.localScale = new Vector3(1.5f, 1.5f, 1);
         wintext.color = new Color(1, 1, 1, 1);
         Heart heart = new Heart();
         heart.go.transform.position   = players[0].transform.position + new Vector3(0.35f, 0.55f, 0);
         heart.go.transform.localScale = new Vector3(0.2f, 0.2f, 1);
         CustomGameObjectManager.AddObject(heart);
     }
 }
Example #3
0
    // Start is called before the first frame update
    void Start()
    {
        isColumnBomb   = false;
        isRowBomb      = false;
        isColourBomb   = false;
        isAdjacentBomb = false;

        //board = FindObjectOfType<Board>();

        board = GameObject.FindWithTag("Board").GetComponent <Board>();

        findMatches    = FindObjectOfType <FindMatches>();
        hintManager    = FindObjectOfType <HintManager>();
        shake          = FindObjectOfType <ScreenShake>();
        endGameManager = FindObjectOfType <EndGameManager>();

        explodable = GetComponent <Explodable>();

        audioSource = gameObject.GetComponent <AudioSource>();

        childObj = transform.Find("FollowMouse");

        if (board.AllJuice == true)
        {
            childObj.gameObject.SetActive(true);
        }
    }
Example #4
0
        public static void Postfix(EndGameManager __instance)
        {
            if (DidCultistsWin)
            {
                __instance.WinText.Color = CultistColor;
                __instance.BackgroundBar.material.color = CultistColor;

                //TODO make text color purple!


                if (IsCultist(PlayerControl.LocalPlayer.PlayerId))
                {
                    __instance.WinText.Text = "Victory: The Cult";
                }
                else
                {
                    __instance.WinText.Text = "Defeat: The Cult recruited to many members.";
                }
            }
            else if (TempData.DidHumansWin(TempData.EndReason))
            {
                if (IsCultist(PlayerControl.LocalPlayer.PlayerId))
                {
                    __instance.WinText.Color = Palette.ImpostorRed;
                    __instance.BackgroundBar.material.color = CultistColor;
                    __instance.WinText.Text = "Defeat: You did not convert enough members.";
                }
            }

            InitialCultist = null;
        }
Example #5
0
 // Start is called before the first frame update
 void Start()
 {
     endGame = FindObjectOfType <EndGameManager>();
     board   = FindObjectOfType <Board>();
     GetGoals();
     SetupGoals();
 }
Example #6
0
 void Start()
 {
     endGameManager = FindObjectOfType <EndGameManager>();
     hintManager    = FindObjectOfType <HintManager>();
     board          = FindObjectOfType <Board>();
     findMatches    = FindObjectOfType <FindMatches>();
 }
Example #7
0
            private static void ApplyOverrides(EndGameManager __instance, bool removeState)
            {
                __instance.DisconnectStinger = StingerReplacement switch
                {
                    "crew" => __instance.CrewStinger,
                    "impostor" => __instance.ImpostorStinger,
                    _ => __instance.DisconnectStinger
                };

                if (WinTextReplacement != null)
                {
                    __instance.WinText.Text = WinTextReplacement;
                }

                if (WinTextColorReplacement != null)
                {
                    __instance.WinText.Color = (Color)WinTextColorReplacement;
                }

                if (BGColor != null)
                {
                    __instance.BackgroundBar.material.color = (Color)BGColor;
                }

                if (removeState)
                {
                    WinTextReplacement      = null;
                    WinTextColorReplacement = null;
                    BGColor = null;
                }
            }
        }
Example #8
0
 void Awake()
 {
     if (Instance == null)
         Instance = this;
     else
         Destroy(this);
 }
Example #9
0
        public static bool Prefix(EndGameManager __instance)
        {
            TempData.winners.Clear();
            AddWinners(EndGameCentral.WinnerTeam.Players);

            return(true);
        }
Example #10
0
 private void Awake()
 {
     if (manager == null)
     {
         manager = this.gameObject.GetComponent <EndGameManager>();
     }
 }
Example #11
0
 // Start is called before the first frame update
 void Start()
 {
     SetupIntroGoals();
     endGame      = FindObjectOfType <EndGameManager>();
     scoreManager = FindObjectOfType <ScoreManager>();
     board        = FindObjectOfType <Board>();
 }
Example #12
0
    // Start is called before the first frame update
    void Start()
    {
        MaskStartPiece                      = LayerMask.GetMask("StartNewGame");
        MaskWhitePiece                      = LayerMask.GetMask("WhitePiece");
        MaskBlackPiece                      = LayerMask.GetMask("BlackPiece");
        MaskTilePiece                       = LayerMask.GetMask("Tile");
        oldPref                             = GetComponent <GameObject>();// rbPref = Rigidbody; is it different?
        newPref                             = GetComponent <GameObject>();
        initialPawnStringPosition           = new List <string>();
        pawnPositionArray                   = new string[MAX, MAX];
        pawnObjArray                        = new GameObject[MAX, MAX];
        pawnPositionsIntoLongString         = "";
        mirrorAllPawnPositionIntoLongString = "";
        boardObjArray                       = new GameObject[MAX, MAX];
        boardHolder                         = new GameObject("Board").transform;
        pieceHolder                         = new GameObject("Piece").transform;
        findBMGameObject                    = GameObject.FindGameObjectWithTag("BM");
        BM = findBMGameObject.GetComponent <BotManager>();
        findEGMGameObject = GameObject.FindGameObjectWithTag("EGM");
        EGM = findEGMGameObject.GetComponent <EndGameManager>();
        WP  = new WhitePawn[MAX];



        CreateEverything();
    }
Example #13
0
 // Start is called before the first frame update
 void Start()
 {
     if (!Instance)
     {
         Instance = this;
     }
 }
Example #14
0
 private void Awake()
 {
     if (instance == null)
     {
         instance = this;
     }
 }
Example #15
0
 public static void Postfix(EndGameManager __instance)
 {
     foreach (var Role in Role.ROLES)
     {
         Role.EndGame(__instance);
     }
 }
Example #16
0
        public static bool Prefix(EndGameManager __instance)
        {
            EndGameCentral.RecalculateWinnerSide();
            TempData.winners.Clear();
            IsLocalWin = false;

            switch (EndGameCentral.WinnerSide)
            {
            case WinnerSide.Role: {
                AddWinner(EndGameCentral.RoleVictory.Player);
                break;
            }

            case WinnerSide.Crewmate: {
                AddWinners(GetStandardTeam(false));
                break;
            }

            case WinnerSide.Impostor: {
                AddWinners(GetStandardTeam(true));
                break;
            }
            }

            return(true);
        }
Example #17
0
        public static void Postfix(EndGameManager __instance)
        {
            var role = Role.AllRoles.FirstOrDefault(x => x.RoleType == RoleEnum.Glitch && ((Glitch)x).GlitchWins);

            if (role == null)
            {
                return;
            }
            if (Roles.Role.GetRoles(RoleEnum.Jester).Any(x => ((Jester)x).VotedOut))
            {
                return;
            }
            PoolablePlayer[] array = Object.FindObjectsOfType <PoolablePlayer>();
            array[0].NameText.Text = role.ColorString + array[0].NameText.Text;
            __instance.BackgroundBar.material.color = role.Color;
            var text = Object.Instantiate(__instance.WinText);

            text.Text  = "The Glitch wins";
            text.Color = role.Color;
            var pos = __instance.WinText.transform.localPosition;

            pos.y = 1.5f;
            text.transform.position = pos;
            text.scale = 1f;
        }
Example #18
0
    void Start()
    {
        isColumnBomb   = false;
        isRowBomb      = false;
        isColourBomb   = false;
        isAdjacentBomb = false;

        // Set the board component equal to the GameObject in the scene with the Board script attached
        board = GameObject.FindWithTag("Board").GetComponent <Board>();
        //board = FindObjectOfType<Board>();
        endGameManager = FindObjectOfType <EndGameManager>();
        findMatches    = FindObjectOfType <FindMatches>();
        hintManager    = FindObjectOfType <HintManager>();

        #region OLD CODE
        // Set the targetX and targetY values as this GameObjects X and Y positions (cast into a int)
        //targetX = (int)transform.position.x;
        //targetY = (int)transform.position.y;
        // Set the row and column
        //column = targetX;
        //row = targetY;
        //previousRow = row;
        //previousColumn = column;
        #endregion
    }
        private static void OverrideScreen(EndGameManager __instance, bool closeAtEnd)
        {
            if (IsSpecialCase)
            {
                switch (StingerType)
                {
                case StingerTypes.Crew:
                    __instance.DisconnectStinger = __instance.CrewStinger;
                    break;

                case StingerTypes.Impostor:
                    __instance.DisconnectStinger = __instance.ImpostorStinger;
                    break;
                }

                __instance.WinText.Text  = WinnerText;
                __instance.WinText.Color = WinnerColor;
                __instance.BackgroundBar.material.color = BgColor;

                if (closeAtEnd)
                {
                    IsSpecialCase = false;
                }
            }
        }
Example #20
0
 public static bool Prefix(EndGameManager __instance)
 {
     if (TempData.winners.Count > 1 && TempData.DidHumansWin(TempData.EndReason))
     {
         TempData.winners.Clear();
         List <PlayerControl> orderLocalPlayers = new List <PlayerControl>();
         foreach (PlayerControl player in localPlayers)
         {
             if (player.PlayerId == localPlayer.PlayerId)
             {
                 orderLocalPlayers.Add(player);
             }
         }
         foreach (PlayerControl player in localPlayers)
         {
             if (player.PlayerId != localPlayer.PlayerId)
             {
                 orderLocalPlayers.Add(player);
             }
         }
         foreach (PlayerControl winner in orderLocalPlayers)
         {
             TempData.winners.Add(new WinningPlayerData(winner.Data));
         }
     }
     return(true);
 }
Example #21
0
        public static void Postfix(EndGameManager __instance)
        {
            if (TempData.DidHumansWin(TempData.EndReason))
            {
                bool flag = true;
                foreach (PlayerControl player in localPlayers)
                {
                    if (player.PlayerId == localPlayer.PlayerId)
                    {
                        flag = false;
                    }
                }
                if (flag)
                {
                    __instance.WinText.Text  = "Defeat";
                    __instance.WinText.Color = Palette.ImpostorRed;
                    __instance.BackgroundBar.material.color = new Color(1, 0, 0);
                }
            }

            if (Main.Logic.WinReason == WinReasons.Jester)
            {
                foreach (PoolablePlayer player in Object.FindObjectsOfType <PoolablePlayer>())
                {
                    player.NameText.Color = Main.Palette.jesterColor;
                }
            }
        }
Example #22
0
 void Start()
 {
     sm            = SoundManager.Instance;
     EGManager     = EndGameManager.Instance;
     startPosition = transform.position;
     sprRend       = GetComponent <SpriteRenderer>();
 }
Example #23
0
        public static bool Prefix(EndGameManager __instance)
        {
            PluginSingleton <FloofUsPlugin> .Instance.Log.LogInfo("Cleaning Up Game");

            RolesManager.CleanUp();
            return(true);
        }
Example #24
0
 public virtual void EndGame(EndGameManager Manager)
 {
     if (EndGameCentral.RoleVictory == this)
     {
         RoleVictory(Manager);
     }
 }
Example #25
0
        public static void Postfix(EndGameManager __instance)
        {
            if (!Jester.jesterEnabled)
            {
                return;
            }

            if (Jester.jesterWon)
            {
                Player player = PlayerController.getPlayerById(PlayerControl.LocalPlayer.PlayerId);

                if (player.hasComponent("Jester"))
                {
                    __instance.WinText.Text  = "Victory";
                    __instance.WinText.Color = Palette.Blue;
                    __instance.BackgroundBar.material.color = Palette.CrewmateBlue;
                }
                else
                {
                    __instance.WinText.Text  = "Defeat";
                    __instance.WinText.Color = Jester.jesterColor;
                    __instance.BackgroundBar.material.color = Jester.jesterColor;
                }
            }
        }
Example #26
0
        public static void Postfix(EndGameManager __instance)
        {
            var role = Role.AllRoles.FirstOrDefault(x =>
                                                    x.RoleType == RoleEnum.Arsonist && ((Arsonist)x).ArsonistWins);

            if (role == null)
            {
                return;
            }
            if (Role.GetRoles(RoleEnum.Jester).Any(x => ((Jester)x).VotedOut))
            {
                return;
            }
            PoolablePlayer[] array = Object.FindObjectsOfType <PoolablePlayer>();
            array[0].NameText.text = role.ColorString + array[0].NameText.text + "</color>";
            __instance.BackgroundBar.material.color = role.Color;
            var text = Object.Instantiate(__instance.WinText);

            text.text  = "Arsonist wins";
            text.color = role.Color;
            var pos = __instance.WinText.transform.localPosition;

            pos.y = 1.5f;
            text.transform.position = pos;
            text.text = $"<size=4>{text.text}</size>";
        }
Example #27
0
 // Use this for initialization
 void Start()
 {
     sm        = SoundManager.Instance;
     EGManager = EndGameManager.Instance;
     anim      = GetComponent <Animator>();
     Health    = 50;
     alive     = true;
 }
Example #28
0
 public static void Postfix(EndGameManager __instance)
 {
     MinatoPlayer   = null;
     MinatoTarget   = null;
     SealButton     = null;
     TeleportButton = null;
     DeadBodyLocations.Clear();
 }
        public static void Postfix(EndGameManager __instance)
        {
            OverrideScreen(__instance, true);

            RoleInfo.JesterId      = RoleInfo.WitnessId = RoleInfo.SnitchId = RoleInfo.MechanicId =
                RoleInfo.SheriffId = 255;
            VisualArrow.ClearArrows();
        }
Example #30
0
 // Start is called before the first frame update
 void Start()
 {
     findEGMGameObject = GameObject.FindGameObjectWithTag("EGM");
     EGM = findEGMGameObject.GetComponent <EndGameManager>();
     findGMGameObject = GameObject.FindGameObjectWithTag("GM");
     GM = findGMGameObject.GetComponent <GameManager>();
     //gameOverResetGame = GetComponent<Button>();
 }
 // Use this for initialization
 void Start()
 {
     instance = this;
 }