Example #1
0
        protected override void IntroPrefix(IntroCutscene._CoBegin_d__11 __instance)
        {
            var arsonistTeam = new Il2CppSystem.Collections.Generic.List <PlayerControl>();

            arsonistTeam.Add(PlayerControl.LocalPlayer);
            __instance.yourTeam = arsonistTeam;
        }
Example #2
0
        protected override void IntroPrefix(IntroCutscene._CoBegin_d__11 __instance)
        {
            var jesterTeam = new List <PlayerControl>();

            jesterTeam.Add(PlayerControl.LocalPlayer);
            __instance.yourTeam = jesterTeam;
        }
Example #3
0
        static void Prefix(IntroCutscene._CoBegin_d__11 __instance)
        {
            // Intro solo teams
            if (PlayerControl.LocalPlayer == Jester.jester || PlayerControl.LocalPlayer == Jackal.jackal || PlayerControl.LocalPlayer == Arsonist.arsonist)
            {
                var soloTeam = new Il2CppSystem.Collections.Generic.List <PlayerControl>();
                soloTeam.Add(PlayerControl.LocalPlayer);
                __instance.yourTeam = soloTeam;
            }

            // Add the Spy to the Impostor team (for the Impostors)
            if (Spy.spy != null && PlayerControl.LocalPlayer.Data.IsImpostor)
            {
                List <PlayerControl> players = PlayerControl.AllPlayerControls.ToArray().ToList().OrderBy(x => Guid.NewGuid()).ToList();
                var fakeImpostorTeam         = new Il2CppSystem.Collections.Generic.List <PlayerControl>();
                foreach (PlayerControl p in players)
                {
                    if (p == Spy.spy || p.Data.IsImpostor)
                    {
                        fakeImpostorTeam.Add(p);
                    }
                }
                __instance.yourTeam = fakeImpostorTeam;
            }
        }
Example #4
0
        // Intro display role
        static void Postfix(IntroCutscene._CoBegin_d__11 __instance)
        {
            List <RoleInfo> infos = RoleInfo.getRoleInfoForPlayer(PlayerControl.LocalPlayer);

            if (infos.Count == 0)
            {
                return;
            }
            RoleInfo roleInfo = infos[0];

            if (PlayerControl.LocalPlayer == Lovers.lover1 || PlayerControl.LocalPlayer == Lovers.lover2)
            {
                PlayerControl otherLover = PlayerControl.LocalPlayer == Lovers.lover1 ? Lovers.lover2 : Lovers.lover1;
                __instance.__4__this.Title.text        = PlayerControl.LocalPlayer.Data.IsImpostor ? "<color=#FF1919FF>Imp</color><color=#FC03BEFF>Lover</color>" : "<color=#FC03BEFF>Lover</color>";
                __instance.__4__this.Title.color       = PlayerControl.LocalPlayer.Data.IsImpostor ? Color.white : Lovers.color;
                __instance.__4__this.ImpostorText.text = "You are in <color=#FC03BEFF>Love</color><color=#FFFFFFFF> with </color><color=#FC03BEFF>" + (otherLover?.Data?.PlayerName ?? "") + "</color>";
                __instance.__4__this.ImpostorText.gameObject.SetActive(true);
                __instance.__4__this.BackgroundBar.material.color = Lovers.color;
            }
            else if (roleInfo.name == "Crewmate" || roleInfo.name == "Impostor")
            {
            }
            else
            {
                __instance.__4__this.Title.text  = roleInfo.name;
                __instance.__4__this.Title.color = roleInfo.color;
                __instance.__4__this.ImpostorText.gameObject.SetActive(true);
                __instance.__4__this.ImpostorText.text            = roleInfo.introDescription;
                __instance.__4__this.BackgroundBar.material.color = roleInfo.color;
            }
        }
Example #5
0
 static bool Prefix(IntroCutscene._CoBegin_d__11 __instance)
 {
     if (PlayerControl.LocalPlayer.Data.IsImpostor && !UnknownImpostor.ImpostorsKnowEachother.GetValue())
     {
         var team = new Il2CppSystem.Collections.Generic.List <PlayerControl>();
         team.Add(PlayerControl.LocalPlayer);
         __instance.yourTeam = team;
     }
     return(true);
 }
Example #6
0
        static void Postfix(IntroCutscene._CoBegin_d__11 __instance)
        {
            var glitch = Role.AllRoles.FirstOrDefault(x => x.RoleType == RoleEnum.Glitch);

            if (glitch != null)
            {
                ((Glitch)glitch).LastMimic = DateTime.UtcNow;
                ((Glitch)glitch).LastHack  = DateTime.UtcNow;
                ((Glitch)glitch).LastKill  = DateTime.UtcNow.AddSeconds(CustomGameOptions.InitialGlitchKillCooldown + (CustomGameOptions.GlitchKillCooldown * -1));
            }
        }
Example #7
0
        static void Prefix(IntroCutscene._CoBegin_d__11 __instance)
        {
            if (!PlayerControl.LocalPlayer.HasPlayerRole(Role.Jester))
            {
                return;
            }

            var jokerTeam = new Il2CppSystem.Collections.Generic.List <PlayerControl>();

            jokerTeam.Add(PlayerControl.LocalPlayer);
            __instance.yourTeam = jokerTeam;
        }
Example #8
0
            public static bool Prefix(ref bool __result, IntroCutscene._CoBegin_d__11 __instance)
            {
                // wait until we set our roles to prevent bugs
                if (!RoleManager.RolesSet)
                {
                    return(false);
                }

                if (!PlayerControl.LocalPlayer.HasCustomRole() && PlayerControl.LocalPlayer.Data.IsImpostor)
                {
                    foreach (var player in PlayerControl.AllPlayerControls.ToArray().Where(p => PlayerControl.LocalPlayer.CanSeeSpecial(p)).ToArray())
                    {
                        __instance.yourTeam.Add(player);
                    }
                }
                return(__result = true);
            }
Example #9
0
 static void Postfix(IntroCutscene._CoBegin_d__11 __instance)
 {
     if (PlayerControl.LocalPlayer.HasPlayerRole(Role.ShapeShifter))
     {
         __instance.__this.Title.Text  = Properties.Resources.ShapeShifterRoleName;
         __instance.__this.Title.scale = 2;
         return;
     }
     if (PlayerControl.LocalPlayer.HasPlayerRole(Role.Detective))
     {
         __instance.__this.Title.Text                   = Properties.Resources.DetectiveRoleName;
         __instance.__this.Title.Color                  = Colors.DetectiveColor;
         __instance.__this.ImpostorText.Text            = Properties.Resources.DetectiveImpostorText;
         __instance.__this.BackgroundBar.material.color = Colors.DetectiveColor;
         return;
     }
     if (PlayerControl.LocalPlayer.HasPlayerRole(Role.Hunter))
     {
         __instance.__this.Title.Text                   = Properties.Resources.HunterRoleName;
         __instance.__this.Title.Color                  = Colors.HunterColor;
         __instance.__this.ImpostorText.Text            = Properties.Resources.HunterImpostorText;
         __instance.__this.BackgroundBar.material.color = Colors.HunterColor;
         return;
     }
     if (PlayerControl.LocalPlayer.HasPlayerRole(Role.Engineer))
     {
         __instance.__this.Title.Text                   = Properties.Resources.EngineerRoleName;
         __instance.__this.Title.Color                  = Colors.EngineerColor;
         __instance.__this.ImpostorText.Text            = Properties.Resources.EngineerImpostorText;
         __instance.__this.BackgroundBar.material.color = Colors.EngineerColor;
         return;
     }
     if (PlayerControl.LocalPlayer.HasPlayerRole(Role.Jester))
     {
         __instance.__this.Title.Text                   = Properties.Resources.JesterRoleName;
         __instance.__this.Title.Color                  = Colors.JesterColor;
         __instance.__this.ImpostorText.Text            = Properties.Resources.JesterImpostorText;
         __instance.__this.BackgroundBar.material.color = Colors.JesterColor;
         return;
     }
 }