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(); } } }
private void UtilityItemListCreator(On.RoR2.Run.orig_Start orig, Run self) //This creates a list of all utility items. May need to be moved to a separate class if multiple items need to access this list { orig(self); indiciiToCheck = ItemCatalog.allItems.Where(x => ItemCatalog.GetItemDef(x).ContainsTag(ItemTag.Utility)).ToArray(); Debug.Log("Item List Method has been run and a Utility Item List has been created"); Debug.Log(indiciiToCheck.Length); }
private static void Run_Start(On.RoR2.Run.orig_Start orig, Run self) { orig(self); if (NetworkServer.active && RunArtifactManager.instance.IsArtifactEnabled(ArtifactOfGenetics.artifactDef)) { self.gameObject.AddComponent <GeneEngineDriver>(); } }
private void DamageItemListCreator(On.RoR2.Run.orig_Start orig, Run self) //May need to be moved to a separate class if multiple items need to access this list { orig(self); indiciiToCheck = ItemCatalog.allItems.Where(x => ItemCatalog.GetItemDef(x).ContainsTag(ItemTag.Damage)).ToArray(); DamageItemCounts = new Dictionary <NetworkInstanceId, int>(); Debug.Log("Item List Method has been run and a Damage Item List has been created"); Debug.Log(indiciiToCheck.Length); }
private void Run_Start(On.RoR2.Run.orig_Start orig, Run self) { orig(self); if (!Converted) { ConvertSpecItemsToArray(); Converted = true; } }
private static void On_RunStart(On.RoR2.Run.orig_Start orig, Run self) { orig(self); if (!NetworkServer.active) { return; } var itemRngGenerator = new Xoroshiro128Plus(self.seed); AncientScepterItem.instance.rng = new Xoroshiro128Plus(itemRngGenerator.nextUlong); }
private void Run_Start(On.RoR2.Run.orig_Start orig, Run self) { if (players == null) { players = new Dictionary <NetworkConnection, CharacterMaster>(); } if (NetworkServer.active) { NetworkServer.RegisterHandler(msgItemDropType, msgItemDropHandler); NetworkServer.RegisterHandler(msgEquipmentDropType, msgEquipmentDropHandler); } orig(self); }
private static void On_RunStart(On.RoR2.Run.orig_Start orig, Run self) { orig(self); if (!NetworkServer.active) { return; } var itemRngGenerator = new Xoroshiro128Plus(self.seed); foreach (var bpl in masterItemList) { bpl.itemRng = new Xoroshiro128Plus(itemRngGenerator.nextUlong); } }
private static void RunStart(On.RoR2.Run.orig_Start orig, Run self) { orig(self); try { if (IsProperSaveLoaded && CheckProperSaveLoading()) { return; } RandomizeRunArtifacts(); } catch (Exception e) { InstanceLogger.LogWarning("Failed to randomize artifacts"); InstanceLogger.LogError(e); } }
private void OnRunStart(On.RoR2.Run.orig_Start orig, RoR2.Run self) { orig(self); // Must reset all values since class is not re-awoken/instantiated DamageDealt = RoR2.Stats.StatDef.Find("totalDamageDealt"); currentAvgDPS = 0; lastTotalDamage = 0; LastNCombatDPS = new LinkedList <ulong>(); Player = LocalUserManager.GetFirstLocalUser(); InvokeRepeating("RollingStats", 1f, 1f); }
private void Run_Start(On.RoR2.Run.orig_Start orig, Run self) { orig(self); if (AlwaysRemoveCoinsInMultiplayer.Value && !RoR2Application.isInSinglePlayer) { StartCoroutine(DelayedAutomaticCoinRemovalLocal()); } if (NetworkServer.active) { if (Run.instance.stageClearCount == 0) // ProperSave already added a fix for this. { if (RoR2Application.isInSinglePlayer && SkipOnSinglePlayer.Value) { StartCoroutine(DelayedAutomaticCoinRemoval()); } else { AllAgree = false; StartCoroutine(StartCoinRemovalAgreement()); } } } }
public static void OnRunStart(On.RoR2.Run.orig_Start orig, Run run) { OriginalListsSaved = false; orig(run); }