示例#1
0
文件: Hooks.cs 项目: tung362/RoR2PVP
 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();
         }
     }
 }
示例#2
0
文件: Hooks.cs 项目: tung362/RoR2PVP
 static void PVPTick(On.RoR2.Stage.orig_FixedUpdate orig, Stage self)
 {
     if (NetworkServer.active)
     {
         PVPMode.Tick();
     }
     orig(self);
 }
示例#3
0
文件: Hooks.cs 项目: tung362/RoR2PVP
 static void PVPReset(On.RoR2.Stage.orig_Start orig, Stage self)
 {
     if (NetworkServer.active)
     {
         PVPMode.Reset();
     }
     orig(self);
 }
示例#4
0
文件: Hooks.cs 项目: tung362/RoR2PVP
 static void InstantTeleport(On.RoR2.TeleporterInteraction.orig_OnInteractionBegin orig, TeleporterInteraction self, Interactor activator)
 {
     if (NetworkServer.active)
     {
         PVPMode.Teleport(self);
     }
     else
     {
         orig(self, activator);
     }
 }