Exemplo n.º 1
0
        static void Prefix(UnityEngine.Object obj)
        {
            if (ExileController.Instance != null && obj == ExileController.Instance.gameObject)
            {
                ModPlayerControl Officer = Main.Logic.getRolePlayer("Officer");
                if (Officer != null)
                {
                    Officer.LastAbilityTime = DateTime.UtcNow;
                }
                if (ExileController.Instance.Field_10 != null && ExileController.Instance.Field_10._object.isPlayerRole("Joker"))
                {
                    MessageWriter writer = AmongUsClient.Instance.StartRpcImmediately(PlayerControl.LocalPlayer.NetId, (byte)CustomRPC.JokerWin, Hazel.SendOption.None, -1);
                    AmongUsClient.Instance.FinishRpcImmediately(writer);

                    foreach (PlayerControl player in PlayerControl.AllPlayerControls)
                    {
                        if (!player.isPlayerRole("Joker"))
                        {
                            player.RemoveInfected();
                            player.Die(DeathReason.Exile);
                            player.Data.IsDead     = true;
                            player.Data.IsImpostor = false;
                        }
                    }
                    PlayerControl joker = Main.Logic.getRolePlayer("Joker").PlayerControl;
                    joker.Revive();
                    joker.Data.IsDead     = false;
                    joker.Data.IsImpostor = true;
                }
            }
        }
Exemplo n.º 2
0
        static void Postfix(IntroCutscene.CoBegin__d __instance)
        {
            ModPlayerControl Pheonix = Main.Logic.getRolePlayer("Pheonix");

            if (Pheonix != null)
            {
                Pheonix.LastAbilityTime = DateTime.UtcNow;
            }
            if (PlayerControl.LocalPlayer.isPlayerRole("Pheonix"))
            {
                __instance.__this.Title.Text                   = "Phoenix";
                __instance.__this.Title.Color                  = Main.Palette.pheonixColor;
                __instance.__this.ImpostorText.Text            = "Bring balance to The [FF0000FF]Impostors[] force.";
                __instance.__this.BackgroundBar.material.color = Main.Palette.pheonixColor;
            }
        }
Exemplo n.º 3
0
 public static void BreakShield(bool flag)
 {
     if (PlayerControl.LocalPlayer.isPlayerImmortal())
     {
         SoundManager.Instance.PlaySound(Main.Assets.breakClip, false, 100f);
     }
     if (flag)
     {
         if (Main.Logic.anyPlayerImmortal())
         {
             ModPlayerControl immortal = Main.Logic.getImmortalPlayer();
             immortal.PlayerControl.myRend.material.SetColor("_VisorColor", Palette.VisorColor);
             immortal.PlayerControl.myRend.material.SetFloat("_Outline", 0f);
             immortal.Immortal = false;
         }
     }
 }
Exemplo n.º 4
0
        static void Postfix(IntroCutscene.CoBegin__d __instance)
        {
            ModPlayerControl Officer = Main.Logic.getRolePlayer("Officer");

            if (Officer != null)
            {
                Officer.LastAbilityTime = DateTime.UtcNow;
            }
            if (PlayerControl.LocalPlayer.isPlayerRole("Medic"))
            {
                __instance.__this.Title.Text                   = "Medic";
                __instance.__this.Title.Color                  = Main.Palette.medicColor;
                __instance.__this.ImpostorText.Text            = "Create a shield to protect a [8DFFFF]Crewmate";
                __instance.__this.BackgroundBar.material.color = Main.Palette.medicColor;
            }
            if (PlayerControl.LocalPlayer.isPlayerRole("Officer"))
            {
                __instance.__this.Title.Text                   = "Officer";
                __instance.__this.Title.Color                  = Main.Palette.officerColor;
                __instance.__this.ImpostorText.Text            = "Shoot the [FF0000FF]Impostor";
                __instance.__this.BackgroundBar.material.color = Main.Palette.officerColor;
            }
            if (PlayerControl.LocalPlayer.isPlayerRole("Engineer"))
            {
                __instance.__this.Title.Text                   = "Engineer";
                __instance.__this.Title.Color                  = Main.Palette.engineerColor;
                __instance.__this.ImpostorText.Text            = "Maintain important systems on the ship";
                __instance.__this.BackgroundBar.material.color = Main.Palette.engineerColor;
            }
            if (PlayerControl.LocalPlayer.isPlayerRole("Joker"))
            {
                __instance.__this.Title.Text                   = "Joker";
                __instance.__this.Title.Color                  = Main.Palette.jokerColor;
                __instance.__this.ImpostorText.Text            = "Get voted off of the ship to win";
                __instance.__this.BackgroundBar.material.color = Main.Palette.jokerColor;
            }
        }