예제 #1
0
        static bool Prefix(PlayerPhysics __instance)
        {
            ModdedPlayerClass moddedController = Main.Instance.ModdedPlayerById(__instance.myPlayer.PlayerId);

            if (__instance.myPlayer != PlayerControl.LocalPlayer || moddedController?.Role?.RoleName != "Bellatrix" || ((Bellatrix)moddedController.Role).MindControlledPlayer == null)
            {
                return(true);
            }

            PlayerPhysics controlledPlayer = ((Bellatrix)moddedController.Role).MindControlledPlayer._Object.MyPhysics;

            GameData.PlayerInfo data = moddedController._Object.Data;
            bool flag = data != null && data.IsDead;

            Vector2 vel = HudManager.Instance.joystick.Delta * __instance.TrueSpeed;

            controlledPlayer.body.velocity = vel;

            MessageWriter writer = AmongUsClient.Instance.StartRpc(PlayerControl.LocalPlayer.NetId, (byte)Packets.MoveControlledPlayer, Hazel.SendOption.Reliable);

            writer.Write(controlledPlayer.myPlayer.PlayerId);
            writer.Write(vel.x);
            writer.Write(vel.y);
            writer.EndMessage();
            return(false);
        }
예제 #2
0
 public Deluminator(ModdedPlayerClass owner)
 {
     this.Owner           = owner;
     this.ParentInventory = owner.Inventory;
     this.Id   = 0;
     this.Icon = Main.Instance.Assets.ItemIcons[Id];
     this.Name = "Deluminator";
 }
예제 #3
0
 public MaraudersMap(ModdedPlayerClass owner)
 {
     this.Owner           = owner;
     this.ParentInventory = owner.Inventory;
     this.Id   = 1;
     this.Icon = Main.Instance.Assets.ItemIcons[Id];
     this.Name = "Marauder's Map";
 }
예제 #4
0
 public PortKey(ModdedPlayerClass owner)
 {
     this.Owner           = owner;
     this.ParentInventory = owner.Inventory;
     this.Id   = 2;
     this.Icon = Main.Instance.Assets.ItemIcons[Id];
     this.Name = "Port Key";
 }
예제 #5
0
 public TheGoldenSnitch(ModdedPlayerClass owner)
 {
     this.Owner           = owner;
     this.ParentInventory = owner.Inventory;
     this.Id        = 3;
     this.Icon      = Main.Instance.Assets.ItemIcons[Id];
     this.Name      = "The Golden Snitch";
     this.IsSpecial = true;
 }
예제 #6
0
        public Hermione(ModdedPlayerClass owner)
        {
            RoleName    = "Hermione";
            RoleColor   = Palette.Orange;
            RoleColor2  = Palette.Orange;
            IntroString = "We could all have been\nkilled - or worse, expelled.";
            Owner       = owner;

            if (!Owner._Object.AmOwner)
            {
                return;
            }

            HourglassButton = KillButtonManager.Instantiate(HudManager.Instance.KillButton);
            HourglassButton.renderer.enabled = true;
        }
예제 #7
0
        public Voldemort(ModdedPlayerClass owner)
        {
            RoleName    = "Voldemort";
            RoleColor   = Palette.ImpostorRed;
            RoleColor2  = Palette.ImpostorRed;
            IntroString = "There is no good and evil. There is only\npower, and those too weak to seek it.";
            Owner       = owner;

            if (!Owner._Object.AmOwner)
            {
                return;
            }

            CurseButton = Object.Instantiate(HudManager.Instance.KillButton);
            CurseButton.renderer.enabled = true;
        }
예제 #8
0
        public Harry(ModdedPlayerClass owner)
        {
            RoleName    = "Harry";
            RoleColor   = Palette.Orange;
            RoleColor2  = Palette.Orange;
            IntroString = "I solemnly swear I am up to no good.";
            Owner       = owner;

            if (!Owner._Object.AmOwner)
            {
                return;
            }

            InvisCloakButton = KillButtonManager.Instantiate(HudManager.Instance.KillButton);
            InvisCloakButton.renderer.enabled = true;
        }
예제 #9
0
        static void Postfix(IntroCutscene.Nested_0 __instance)
        {
            ModdedPlayerClass localPlayer = Main.Instance.GetLocalModdedPlayer();

            if (localPlayer.Role == null)
            {
                return;
            }
            localPlayer.Role.ResetCooldowns();
            __instance.__this.ImpostorText.gameObject.SetActive(true);
            __instance.__this.ImpostorText.transform.localScale = new Vector3(0.7f, 0.7f);
            __instance.__this.Title.text                   = localPlayer.Role.RoleName;
            __instance.__this.Title.color                  = localPlayer.Role.RoleColor;
            __instance.__this.ImpostorText.text            = localPlayer.Role.IntroString;
            __instance.__this.BackgroundBar.material.color = localPlayer.Role.RoleColor2;
        }
예제 #10
0
        public Ron(ModdedPlayerClass owner)
        {
            RoleName    = "Ron";
            RoleColor   = Palette.Orange;
            RoleColor2  = Palette.Orange;
            IntroString = "Why Spiders!? Why couldn't it\nhave been follow the butterflies!?";
            Owner       = owner;

            if (!Owner._Object.AmOwner)
            {
                return;
            }

            DDButton = KillButtonManager.Instantiate(HudManager.Instance.KillButton);
            DDButton.renderer.enabled = true;
        }
예제 #11
0
        static void Postfix(GameData.PlayerInfo __0, ref bool __1, ref bool __2)
        {
            ModdedPlayerClass moddedPlayer = Main.Instance.ModdedPlayerById(__0.PlayerId);

            if (moddedPlayer == null)
            {
                return;
            }

            if (moddedPlayer.CanUseConsoles)
            {
                return;
            }

            __1 = false;
            __2 = false;
        }
예제 #12
0
        static void Prefix(OverlayKillAnimation __instance, ref GameData.PlayerInfo __0, GameData.PlayerInfo __1)
        {
            if (__0 == null || __1 == null || __instance == null)
            {
                return;
            }
            if (__0.PlayerId != __1.PlayerId)
            {
                return;
            }
            ModdedPlayerClass harry = Main.Instance.FindPlayerOfRole("Harry");

            if (harry == null)
            {
                return;
            }

            __0 = harry._Object.Data;
            __instance.killerParts.Body.transform.localScale = new Vector3(0.4f, 0.4f);
            __instance.killerParts.Body.transform.position  -= new Vector3(0.3f, 0f, 0f);
        }
예제 #13
0
        public Bellatrix(ModdedPlayerClass owner)
        {
            RoleName    = "Bellatrix";
            RoleColor   = Palette.ImpostorRed;
            RoleColor2  = Palette.ImpostorRed;
            IntroString = "Oh, he knows how to play,\nlittle bitty baby Potter.";
            Owner       = owner;

            if (!Owner._Object.AmOwner)
            {
                return;
            }

            CrucioButton = KillButtonManager.Instantiate(HudManager.Instance.KillButton);
            CrucioButton.renderer.enabled = true;

            MindControlButton = KillButtonManager.Instantiate(HudManager.Instance.KillButton);
            MindControlButton.renderer.enabled = true;

            ControlMenu = new MindControlMenu();
        }
예제 #14
0
        static void Postfix()
        {
            List <ModdedPlayerClass> allImp =
                Main.Instance.AllPlayers.Where(x => x._Object.Data.IsImpostor).ToList();

            List <ModdedPlayerClass> allCrew =
                Main.Instance.AllPlayers.Where(x => !x._Object.Data.IsImpostor).ToList();

            List <string> impRolesToAssign = new List <string> {
                "Voldemort", "Bellatrix"
            };
            List <string> crewRolesToAssign = new List <string> {
                "Harry", "Hermione", "Ron"
            };

            while (allImp.Count > 0 && impRolesToAssign.Count > 0)
            {
                ModdedPlayerClass rolePlayer = allImp.Random();
                allImp.Remove(rolePlayer);

                if (impRolesToAssign.Contains("Voldemort"))
                {
                    impRolesToAssign.Remove("Voldemort");
                    Main.Instance.RpcAssignRole(rolePlayer, new Voldemort(rolePlayer));
                    continue;
                }

                if (impRolesToAssign.Contains("Bellatrix"))
                {
                    impRolesToAssign.Remove("Bellatrix");
                    Main.Instance.RpcAssignRole(rolePlayer, new Bellatrix(rolePlayer));
                    continue;
                }
            }

            while (allCrew.Count > 0 && crewRolesToAssign.Count > 0)
            {
                ModdedPlayerClass rolePlayer = allCrew.Random();
                allCrew.Remove(rolePlayer);

                if (crewRolesToAssign.Contains("Harry"))
                {
                    crewRolesToAssign.Remove("Harry");
                    Main.Instance.RpcAssignRole(rolePlayer, new Harry(rolePlayer));
                    continue;
                }

                if (crewRolesToAssign.Contains("Ron"))
                {
                    crewRolesToAssign.Remove("Ron");
                    Main.Instance.RpcAssignRole(rolePlayer, new Ron(rolePlayer));
                    continue;
                }

                if (crewRolesToAssign.Contains("Hermione"))
                {
                    crewRolesToAssign.Remove("Hermione");
                    Main.Instance.RpcAssignRole(rolePlayer, new Hermione(rolePlayer));
                    continue;
                }
            }
        }