Beispiel #1
0
 public static bool Prefix(MapRoom __instance)
 {
     return(SabotageCentralPatch.HandleSabotage(__instance, SabotageType.Seismic));
 }
Beispiel #2
0
        public void Handle(byte PacketId, MessageReader Reader)
        {
            switch (PacketId)
            {
            case (byte)CustomRPC.ShieldBreak: {
                MedicRole.INSTANCE.BreakShield();
                break;
            }

            case (byte)CustomRPC.FixLights: {
                SabotageCentralPatch.FixLights();
                break;
            }

            case (byte)CustomRPC.ResetStartingRoles: {
                // EndGameCentral.SetPeaceful(Reader.ReadBytesAndSize());
                EndGameCentral.ResetStartingRoles();
                break;
            }

            case (byte)CustomRPC.SetProtected: {
                if (XenoCore.Utils.Extensions.TryGetPlayerById(Reader.ReadByte(), out var Player))
                {
                    MedicRole.INSTANCE.Protected = Player;
                }
                break;
            }

            case (byte)CustomRPC.SetRole: {
                var Role = Roles.Role.ROLES[Reader.ReadByte()];
                Role.SetPlayerById(Reader.ReadByte());
                Role.PlayerAssigned();
                break;
            }

            case (byte)CustomRPC.OfficerKill: {
                var Killer = PlayerTools.GetPlayerById(Reader.ReadByte());
                var Target = PlayerTools.GetPlayerById(Reader.ReadByte());
                Killer.MurderPlayer(Target);
                break;
            }

            case (byte)CustomRPC.SingleWin: {
                EndGameCentral.RoleVictory = Role.ROLES[Reader.ReadByte()];

                foreach (var player in PlayerControl.AllPlayerControls)
                {
                    player.RemoveInfected();
                }

                PlayerControl.LocalPlayer.SetInfected(new[] {
                        Reader.ReadByte()
                    });
                break;
            }

            case (byte)CustomRPC.ProtectedMurderAttempt: {
                var PlayerId = Reader.ReadByte();

                if (PlayerId == PlayerControl.LocalPlayer.PlayerId)
                {
                    ExtraResources.BREAK_SHIELD.PlayGlobally(
                        AudioManager.EffectsScale(3f));
                }

                break;
            }

            case (byte)CustomRPC.PsychicEffect: {
                var Psychic = PsychicRole.INSTANCE;
                Psychic.EnableAura();
                break;
            }

            case (byte)CustomRPC.ScientistEffect: {
                var Scientist = ScientistRole.INSTANCE;
                Scientist.EnableTimeWarp();
                break;
            }

            case (byte)CustomRPC.SpyEffect: {
                var Spy = SpyRole.INSTANCE;
                Spy.EnableInvisibility();
                break;
            }

            case (byte)CustomRPC.ZombieInfect: {
                var Zombie = ZombieRole.INSTANCE;
                var Target = PlayerTools.GetPlayerById(Reader.ReadByte());

                if (Target != null)
                {
                    Zombie.Infect(Target);
                }

                break;
            }

            case (byte)CustomRPC.ZombieChainKill: {
                ZombieRole.INSTANCE.KillTargets(Reader.ReadBytesAndSize());
                break;
            }

            case (byte)CustomRPC.DebugVictory: {
                DebugTools.DebugWin(PlayerTools.GetPlayerById(Reader.ReadByte()));
                break;
            }

            case (byte)CustomRPC.MageStonefication: {
                MageRole.INSTANCE.EnableStonefication(Reader.ReadBytesAndSize());
                break;
            }

            case (byte)CustomRPC.MageTransposition: {
                var Partner = PlayerTools.GetPlayerById(Reader.ReadByte());
                if (Partner != null)
                {
                    MageRole.INSTANCE.Transposition(Partner);
                }

                break;
            }

            case (byte)CustomRPC.CleanerClean: {
                CleanerRole.INSTANCE.Clean(Reader.ReadByte());
                break;
            }
            }
        }