Exemplo n.º 1
0
 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();
         }
     }
 }
Exemplo n.º 2
0
 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);
 }
Exemplo n.º 3
0
 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>();
     }
 }
Exemplo n.º 4
0
 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;
     }
 }
Exemplo n.º 6
0
        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);
        }
Exemplo n.º 7
0
 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);
 }
Exemplo n.º 8
0
        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);
            }
        }
Exemplo n.º 9
0
 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);
     }
 }
Exemplo n.º 10
0
        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);
        }
Exemplo n.º 11
0
 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());
             }
         }
     }
 }
Exemplo n.º 12
0
 public static void OnRunStart(On.RoR2.Run.orig_Start orig, Run run)
 {
     OriginalListsSaved = false;
     orig(run);
 }