Exemplo n.º 1
0
        private void RunArtifactManager_onArtifactDisabledGlobal([JetBrains.Annotations.NotNull] RunArtifactManager runArtifactManager, [JetBrains.Annotations.NotNull] ArtifactDef artifactDef)
        {
            if (artifactDef != uniqueArtifactDef)
            {
                return;
            }
            On.RoR2.MultiShopController.Awake                -= Track_MultiShopCrontroller_Add;
            On.RoR2.MultiShopController.OnDestroy            -= Track_MultiShopCrontroller_Remove;
            On.RoR2.ShopTerminalBehavior.SetHasBeenPurchased -= DisableTerminalOnPurchase;
            On.RoR2.ChestBehavior.Awake -= Track_ChestBehavior;

            On.RoR2.Inventory.GiveItem_ItemIndex_int   -= Inventory_GiveItem_ItemIndex_int;
            On.RoR2.Inventory.RemoveItem_ItemIndex_int -= Inventory_RemoveItem_ItemIndex_int;
            On.RoR2.PurchaseInteraction.Awake          -= PurchaseInteraction_Awake;
            On.RoR2.CostTypeDef.PayCost -= CostTypeDef_PayCost;

            On.RoR2.BossGroup.DropRewards -= BossGroup_DropRewards; //doesnt work

            On.RoR2.MultiShopController.CreateTerminals -= PreventTerminalsIfNoItems;

            SceneDirector.onGenerateInteractableCardSelection -= RemoveInteractableCardsIfNoPickupAvailable;

            On.RoR2.ShopTerminalBehavior.GenerateNewPickupServer -= ShopTerminalBehavior_GenerateNewPickupServer;

            On.RoR2.ArenaMissionController.EndRound -= ArenaMissionController_EndRound;
            On.RoR2.ScavengerItemGranter.Start      -= ScavengerItemGranter_Start;

            Run.onRunStartGlobal -= Run_onRunStartGlobal;
        }
Exemplo n.º 2
0
 private static void OnArtifactDisabled(RunArtifactManager runArtifactManager, ArtifactDef artifactDef)
 {
     if (artifactDef == ZetArtifactsContent.Artifacts.ZetEclifact)
     {
         DisableEffects();
     }
 }
Exemplo n.º 3
0
        private void RunArtifactManager_onArtifactDisabledGlobal([JetBrains.Annotations.NotNull] RunArtifactManager runArtifactManager, [JetBrains.Annotations.NotNull] ArtifactDef artifactDef)
        {
            if (artifactDef.artifactIndex == Conversion.artifactIndex)
            {
                On.RoR2.GenericPickupController.AttemptGrant -= GenericPickupController_AttemptGrant;

                On.RoR2.GenericPickupController.OnTriggerStay -= GenericPickupController_OnTriggerStay;

                On.RoR2.Run.Start -= Run_Start;

                On.RoR2.PlayerCharacterMasterController.OnBodyStart += PlayerCharacterMasterController_OnBodyStart;

                On.RoR2.CharacterBody.OnLevelUp -= CharacterBody_OnLevelUp;

                On.RoR2.CharacterMaster.OnInventoryChanged -= CharacterMaster_OnInventoryChanged;

                On.RoR2.Run.OnUserAdded -= Run_OnUserAdded;

                On.RoR2.Run.OnUserRemoved -= Run_OnUserRemoved;

                players.Clear();

                if (NetworkServer.active)
                {
                    NetworkServer.UnregisterHandler(msgItemDropType);
                    NetworkServer.UnregisterHandler(msgEquipmentDropType);
                }
            }
        }
Exemplo n.º 4
0
 private void OnEvolutionEnable([JetBrains.Annotations.NotNull] RunArtifactManager runArtifactManager,
                                [JetBrains.Annotations.NotNull] ArtifactDef artifactDef)
 {
     if (NetworkServer.active && artifactDef == RoR2Content.Artifacts.monsterTeamGainsItemsArtifactDef)
     {
         Run.onRunStartGlobal += EvolutionListItems;
     }
 }
Exemplo n.º 5
0
        private static void OnArtifactDisabled(RunArtifactManager man, ArtifactDef artifactDef)
        {
            if (artifactDef != myArtifact)
            {
                return;
            }

            // unhook things
            Run.onRunStartGlobal -= Something;
        }
Exemplo n.º 6
0
        private static void OnArtifactEnabled(RunArtifactManager man, ArtifactDef artifactDef)
        {
            if (!NetworkServer.active || artifactDef != myArtifact)
            {
                return;
            }

            // hook things
            Run.onRunStartGlobal += Something;
        }
Exemplo n.º 7
0
        private static void OnArtifactDisabled(RunArtifactManager man, ArtifactDef artifactDef)
        {
            if (artifactDef != myArtifact)
            {
                return;
            }

            // undo things
            CharacterBody.onBodyStartGlobal -= OnBodyStartGlobal;
        }
Exemplo n.º 8
0
        private static void OnArtifactEnabled(RunArtifactManager man, ArtifactDef artifactDef)
        {
            if (!NetworkServer.active || artifactDef != myArtifact)
            {
                return;
            }

            // do things
            CharacterBody.onBodyStartGlobal += OnBodyStartGlobal;
        }
Exemplo n.º 9
0
        private static void OnArtifactDisabled(RunArtifactManager man, ArtifactDef artifactDef)
        {
            if (artifactDef != myArtifact)
            {
                return;
            }

            // undo things
            Run.onRunStartGlobal -= SetRandom;
            On.RoR2.HealthComponent.TakeDamage -= RandomizeDamage;
        }
Exemplo n.º 10
0
        private static void OnArtifactEnabled(RunArtifactManager man, ArtifactDef artifactDef)
        {
            if (!NetworkServer.active || artifactDef != myArtifact)
            {
                return;
            }

            // do things
            Run.onRunStartGlobal += SetRandom;
            On.RoR2.HealthComponent.TakeDamage += RandomizeDamage;
        }
Exemplo n.º 11
0
        private static void OnArtifactDisabled(RunArtifactManager man, ArtifactDef artifactDef)
        {
            if (artifactDef != myArtifact)
            {
                return;
            }

            // undo things
            Run.onRunStartGlobal     -= SetRandom;
            Stage.onServerStageBegin -= EmptyList;

            On.RoR2.HealthComponent.TakeDamage -= JumbleDamage;
        }
Exemplo n.º 12
0
        private static void OnArtifactEnabled(RunArtifactManager man, ArtifactDef artifactDef)
        {
            if (!NetworkServer.active || artifactDef != myArtifact)
            {
                return;
            }

            // do things
            Run.onRunStartGlobal     += SetRandom;
            Stage.onServerStageBegin += EmptyList;

            // MMHook :)
            On.RoR2.HealthComponent.TakeDamage += JumbleDamage;
        }
Exemplo n.º 13
0
        private void RunArtifactManager_onArtifactEnabledGlobal([JetBrains.Annotations.NotNull] RunArtifactManager runArtifactManager, [JetBrains.Annotations.NotNull] ArtifactDef artifactDef)
        {
            if (artifactDef.artifactIndex == Conversion.artifactIndex)
            {
                On.RoR2.GenericPickupController.AttemptGrant += GenericPickupController_AttemptGrant;

                On.RoR2.GenericPickupController.OnTriggerStay += GenericPickupController_OnTriggerStay;

                On.RoR2.Run.Start += Run_Start;

                On.RoR2.PlayerCharacterMasterController.OnBodyStart += PlayerCharacterMasterController_OnBodyStart;

                On.RoR2.CharacterBody.OnLevelUp += CharacterBody_OnLevelUp;

                On.RoR2.CharacterMaster.OnInventoryChanged += CharacterMaster_OnInventoryChanged;

                On.RoR2.Run.OnUserAdded += Run_OnUserAdded;

                On.RoR2.Run.OnUserRemoved += Run_OnUserRemoved;

                if (players == null)
                {
                    players = new Dictionary <NetworkConnection, CharacterMaster>();
                }

                if (NetworkServer.active)
                {
                    NetworkServer.RegisterHandler(msgItemDropType, msgItemDropHandler);
                    NetworkServer.RegisterHandler(msgEquipmentDropType, msgEquipmentDropHandler);
                }

                FieldInfo chatMessageTypeToIndexField          = typeof(ChatMessageBase).GetField("chatMessageTypeToIndex", BindingFlags.NonPublic | BindingFlags.Static);
                Dictionary <Type, byte> chatMessageTypeToIndex = (Dictionary <Type, byte>)chatMessageTypeToIndexField.GetValue(null);
                FieldInfo   chatMessageIndexToTypeField        = typeof(ChatMessageBase).GetField("chatMessageIndexToType", BindingFlags.NonPublic | BindingFlags.Static);
                List <Type> chatMessageIndexToType             = (List <Type>)chatMessageIndexToTypeField.GetValue(null);

                foreach (Type type in Assembly.GetExecutingAssembly().GetTypes())
                {
                    if (type.IsSubclassOf(typeof(ChatMessageBase)) && !chatMessageTypeToIndex.ContainsKey(type) && !chatMessageIndexToType.Contains(type))
                    {
                        chatMessageTypeToIndex.Add(type, (byte)chatMessageIndexToType.Count);
                        chatMessageIndexToType.Add(type);
                    }
                }
                chatMessageTypeToIndexField.SetValue(null, chatMessageTypeToIndex);
                chatMessageIndexToTypeField.SetValue(null, chatMessageIndexToType);
            }
        }