static void GameStart(On.RoR2.Run.orig_Start orig, Run self) { //Pre-start if (NetworkServer.active) { //Run mod if mod was enabled in the lobby menu if (VoteAPI.VoteResults.HasVote(Settings.FreeForAllPVPToggle.Item2) || VoteAPI.VoteResults.HasVote(Settings.TeamPVPToggle.Item2)) { PVPMode.LoadDestinations(); Tools.Shuffle <SceneDef>(PVPMode.Destinations); SetCoreHooks(); SetExtraHooks(); } } orig(self); //Post-start if (NetworkServer.active) { //Run mod if mod was enabled in the lobby menu if (VoteAPI.VoteResults.HasVote(Settings.FreeForAllPVPToggle.Item2) || VoteAPI.VoteResults.HasVote(Settings.TeamPVPToggle.Item2)) { PVPMode.LoadFixedTeams(); } } }
static void PVPTick(On.RoR2.Stage.orig_FixedUpdate orig, Stage self) { if (NetworkServer.active) { PVPMode.Tick(); } orig(self); }
static void PVPReset(On.RoR2.Stage.orig_Start orig, Stage self) { if (NetworkServer.active) { PVPMode.Reset(); } orig(self); }
static void InstantTeleport(On.RoR2.TeleporterInteraction.orig_OnInteractionBegin orig, TeleporterInteraction self, Interactor activator) { if (NetworkServer.active) { PVPMode.Teleport(self); } else { orig(self, activator); } }