Пример #1
0
        internal static void Init()
        {
            state = ZetArtifactsPlugin.DropifactEnable.Value;
            if (state < 1)
            {
                return;
            }

            ZetArtifactsPlugin.RegisterLanguageToken("ARTIFACT_ZETDROPIFACT_NAME", "Artifact of Tossing");
            ZetArtifactsPlugin.RegisterLanguageToken("ARTIFACT_ZETDROPIFACT_DESC", "Allows players to drop and scrap items.\n\n<style=cStack>LeftAlt + RMB to scrap</style>");

            NetworkingAPI.RegisterMessageType <ZetDropReply>();
            NetworkingAPI.RegisterMessageType <ZetDropRequest>();

            ItemCatalog.availability.CallWhenAvailable(FindIndexes);

            ItemIconHook();
            EquipmentIconHook();

            MarkedDropletBypassHook();

            PreventVoidBearBuffBug();
            appliedVoidBearFix = true;

            SceneDirector.onGenerateInteractableCardSelection += RemoveScrapperCard;
        }
Пример #2
0
        internal static void Init()
        {
            state = ZetArtifactsPlugin.EclifactEnable.Value;
            if (ZetArtifactsPlugin.PluginLoaded("com.TPDespair.DiluvianArtifact"))
            {
                state = 0;
            }
            if (state < 1)
            {
                return;
            }

            ZetArtifactsPlugin.RegisterLanguageToken("ARTIFACT_ZETECLIFACT_NAME", "Artifact of the Eclipse");
            ZetArtifactsPlugin.RegisterLanguageToken("ARTIFACT_ZETECLIFACT_DESC", "Enables all Eclipse modifiers.\n\n<style=cStack>>Ally Starting Health: <style=cDeath>-50%</style>\n>Teleporter Radius: <style=cDeath>-50%</style>\n>Ally Fall Damage: <style=cDeath>+100% and lethal</style>\n>Enemy Speed: <style=cDeath>+40%</style>\n>Ally Healing: <style=cDeath>-50%</style>\n>Enemy Gold Drops: <style=cDeath>-20%</style>\n>Enemy Cooldowns: <style=cDeath>-50%</style>\n>Allies receive <style=cDeath>permanent damage</style></style>");

            if (state == 1)
            {
                RunArtifactManager.onArtifactEnabledGlobal  += OnArtifactEnabled;
                RunArtifactManager.onArtifactDisabledGlobal += OnArtifactDisabled;
            }
            else
            {
                EnableEffects();
            }
        }
Пример #3
0
        internal static void Init()
        {
            state = ZetArtifactsPlugin.RivivifactEnable.Value;
            if (state < 1)
            {
                return;
            }

            ZetArtifactsPlugin.RegisterLanguageToken("ARTIFACT_ZETREVIVIFACT_NAME", "Artifact of Revival");
            ZetArtifactsPlugin.RegisterLanguageToken("ARTIFACT_ZETREVIVIFACT_DESC", "Dead players respawn after the boss is defeated.");

            SaveDeathPositionHook();
            RevivalHook();
        }
Пример #4
0
        internal static void Init()
        {
            state = ZetArtifactsPlugin.MultifactEnable.Value;
            if (state < 1)
            {
                return;
            }

            int countMult = Math.Max(2, ZetArtifactsPlugin.MultifactMultiplier.Value);

            ZetArtifactsPlugin.RegisterLanguageToken("ARTIFACT_ZETMULTIFACT_NAME", "Artifact of Multitudes");
            string str;

            if (countMult == 2)
            {
                str = "Double";
            }
            else if (countMult == 3)
            {
                str = "Triple";
            }
            else if (countMult == 4)
            {
                str = "Quadruple";
            }
            else
            {
                str = "x" + countMult;
            }
            ZetArtifactsPlugin.RegisterLanguageToken("ARTIFACT_ZETMULTIFACT_DESC", str + " player count scaling.");

            get_LPC_Method = typeof(Run).GetMethod("get_livingPlayerCount", flags);
            get_PPC_Method = typeof(Run).GetMethod("get_participatingPlayerCount", flags);

            GLPCH_Method = typeof(ZetMultifact).GetMethod(nameof(GetLivingPlayerCountHook), flags);
            GPPCH_Method = typeof(ZetMultifact).GetMethod(nameof(GetParticipatingPlayerCountHook), flags);

            // sometimes interactable cost would not reflect increased count
            SceneDirector.onPrePopulateSceneServer += UpdateDifficultyCoeff_Scene;
            appliedSceneCostFix = true;
            // combat shrines seem to have trouble selecting a spawn card if they are given too many credits ???
            On.RoR2.ShrineCombatBehavior.Start += ShrineCombatBehavior_Start;
            appliedCombatShrineFix              = true;

            GoldFromKillHook();

            PlayerCountHook();
            PlayerTriggerHook();
        }
            public static void Create()
            {
                if (ZetArtifactsPlugin.LoopifactEnable.Value != 0)
                {
                    PoisonEarly = ScriptableObject.CreateInstance <EliteDef>();
                    eliteDefs.Add(PoisonEarly);

                    HauntedEarly = ScriptableObject.CreateInstance <EliteDef>();
                    eliteDefs.Add(HauntedEarly);

                    if (ZetArtifactsPlugin.PluginLoaded("com.arimah.PerfectedLoop"))
                    {
                        LunarEarly = ScriptableObject.CreateInstance <EliteDef>();
                        eliteDefs.Add(LunarEarly);
                    }
                }
            }
Пример #6
0
        /*
         * public static EliteDef GetEquipmentEliteDef(EquipmentDef equipDef)
         * {
         *      if (equipDef == null) return null;
         *      if (equipDef.passiveBuffDef == null) return null;
         *      return equipDef.passiveBuffDef.eliteDef;
         * }
         */


        internal static void ApplyEarlyEliteProperties()
        {
            EliteDef t2Elite = RoR2Content.Elites.Poison;

            CopyBasicAttributes(ZetArtifactsContent.Elites.PoisonEarly, RoR2Content.Elites.Poison);
            ApplyStatBoosts(ZetArtifactsContent.Elites.PoisonEarly, t2Elite);

            CopyBasicAttributes(ZetArtifactsContent.Elites.HauntedEarly, RoR2Content.Elites.Haunted);
            ApplyStatBoosts(ZetArtifactsContent.Elites.HauntedEarly, t2Elite);

            if (ZetArtifactsPlugin.PluginLoaded("com.arimah.PerfectedLoop"))
            {
                CopyBasicAttributes(ZetArtifactsContent.Elites.LunarEarly, RoR2Content.Elites.Lunar);
                ApplyStatBoosts(ZetArtifactsContent.Elites.LunarEarly, t2Elite);
            }

            Debug.LogWarning("ZetArtifact [ZetLoopifact] - ApplyEarlyEliteProperties");
        }
Пример #7
0
        /*
         * private static void FindImpaleDotIndex()
         * {
         *      if (!ZetArtifactsPlugin.PluginLoaded("com.themysticsword.elitevariety")) return;
         *
         *      if (impaleDotIndex == DotController.DotIndex.None && !attemptedFindImpaleDotIndex)
         *      {
         *              BaseUnityPlugin Plugin = BepInEx.Bootstrap.Chainloader.PluginInfos["com.themysticsword.elitevariety"].Instance;
         *              Assembly PluginAssembly = Assembly.GetAssembly(Plugin.GetType());
         *
         *              if (PluginAssembly != null)
         *              {
         *                      BindingFlags Flags = BindingFlags.Instance | BindingFlags.Static | BindingFlags.Public | BindingFlags.NonPublic;
         *
         *                      Type type = Type.GetType("EliteVariety.Buffs.ImpPlaneImpaled, " + PluginAssembly.FullName, false);
         *                      if (type != null)
         *                      {
         *                              FieldInfo indexField = type.GetField("dotIndex", Flags);
         *                              if (indexField != null)
         *                              {
         *                                      impaleDotIndex = (DotController.DotIndex)indexField.GetValue(type);
         *
         *                                      Debug.LogWarning("ZetArtifact [ZetLoopifact] - Impale DotIndex : " + impaleDotIndex);
         *                              }
         *                              else
         *                              {
         *                                      Debug.LogWarning("ZetArtifact [ZetLoopifact] - Could Not Find Field : ImpPlaneImpaled.dotIndex");
         *                              }
         *                      }
         *                      else
         *                      {
         *                              Debug.LogWarning("ZetArtifact [ZetLoopifact] - Could Not Find Type : EliteVariety.Buffs.ImpPlaneImpaled");
         *                      }
         *              }
         *              else
         *              {
         *                      Debug.LogWarning("ZetArtifact [ZetLoopifact] - Could Not Find EliteVariety Assembly");
         *              }
         *      }
         *
         *      attemptedFindImpaleDotIndex = true;
         * }
         */
        private static void RebuildEliteTypeArray()
        {
            if (earlyEliteDef != null)
            {
                SceneDef sceneDefForCurrentScene = SceneCatalog.GetSceneDefForCurrentScene();
                string   sceneName = sceneDefForCurrentScene ? sceneDefForCurrentScene.baseSceneName : "";

                List <EliteDef> eliteDefs = new List <EliteDef>
                {
                    ZetArtifactsContent.Elites.HauntedEarly,
                    ZetArtifactsContent.Elites.PoisonEarly
                };

                if (sceneName != "moon2" && ZetArtifactsPlugin.PluginLoaded("com.arimah.PerfectedLoop"))
                {
                    eliteDefs.Add(ZetArtifactsContent.Elites.LunarEarly);
                }

                /*
                 * EquipmentIndex equipIndex;
                 * EliteDef eliteDef;
                 *
                 * if (ZetArtifactsPlugin.PluginLoaded("com.themysticsword.elitevariety"))
                 * {
                 *      if (impaleElite == null)
                 *      {
                 *              equipIndex = EquipmentCatalog.FindEquipmentIndex("EliteVariety_AffixImpPlane");
                 *              if (equipIndex != EquipmentIndex.None)
                 *              {
                 *                      eliteDef = GetEquipmentEliteDef(EquipmentCatalog.GetEquipmentDef(equipIndex));
                 *                      if (eliteDef != null) impaleElite = eliteDef;
                 *              }
                 *      }
                 *
                 *      if (impaleElite != null) eliteDefs.Add(impaleElite);
                 * }
                 */
                if (Enabled)
                {
                    Debug.LogWarning("ZetArtifact [ZetLoopifact] - Rebuild EarlyEliteTypeArray : " + eliteDefs.Count);
                }
                earlyEliteDef.eliteTypes = eliteDefs.ToArray();
            }
        }
Пример #8
0
        internal static void Init()
        {
            state = ZetArtifactsPlugin.LoopifactEnable.Value;
            if (state < 1)
            {
                return;
            }

            ZetArtifactsPlugin.RegisterLanguageToken("ARTIFACT_ZETLOOPIFACT_NAME", "Artifact of Escalation");
            ZetArtifactsPlugin.RegisterLanguageToken("ARTIFACT_ZETLOOPIFACT_DESC", "Monster and interactable types can appear earlier than usual. Post-loop Elites begin to appear at monster level " + ZetArtifactsPlugin.LoopifactEliteLevel.Value + ".");
            //ZetArtifactsPlugin.RegisterLanguageToken("ARTIFACT_ZETLOOPIFACT_DESC", "Monster and interactable types can appear earlier than usual.");

            SceneDirector.onPostPopulateSceneServer += OnScenePopulated;
            SceneExitController.onBeginExit         += OnSceneExit;

            MinimumStageHook();
            DirectorMoneyHook();
            AddEarlyEliteDef();
        }
            public static void Create()
            {
                if (ZetArtifactsPlugin.RivivifactEnable.Value == 1)
                {
                    ZetRevivifact                           = ScriptableObject.CreateInstance <ArtifactDef>();
                    ZetRevivifact.cachedName                = "ARTIFACT_ZETREVIVIFACT";
                    ZetRevivifact.nameToken                 = "ARTIFACT_ZETREVIVIFACT_NAME";
                    ZetRevivifact.descriptionToken          = "ARTIFACT_ZETREVIVIFACT_DESC";
                    ZetRevivifact.smallIconSelectedSprite   = ZetArtifactsPlugin.CreateSprite(Properties.Resources.zetrevive_selected, Color.magenta);
                    ZetRevivifact.smallIconDeselectedSprite = ZetArtifactsPlugin.CreateSprite(Properties.Resources.zetrevive_deselected, Color.gray);

                    artifactDefs.Add(ZetRevivifact);
                }

                if (ZetArtifactsPlugin.MultifactEnable.Value == 1)
                {
                    ZetMultifact                           = ScriptableObject.CreateInstance <ArtifactDef>();
                    ZetMultifact.cachedName                = "ARTIFACT_ZETMULTIFACT";
                    ZetMultifact.nameToken                 = "ARTIFACT_ZETMULTIFACT_NAME";
                    ZetMultifact.descriptionToken          = "ARTIFACT_ZETMULTIFACT_DESC";
                    ZetMultifact.smallIconSelectedSprite   = ZetArtifactsPlugin.CreateSprite(Properties.Resources.zetmultitude_selected, Color.magenta);
                    ZetMultifact.smallIconDeselectedSprite = ZetArtifactsPlugin.CreateSprite(Properties.Resources.zetmultitude_deselected, Color.gray);

                    artifactDefs.Add(ZetMultifact);
                }

                if (ZetArtifactsPlugin.DropifactEnable.Value == 1)
                {
                    ZetDropifact                           = ScriptableObject.CreateInstance <ArtifactDef>();
                    ZetDropifact.cachedName                = "ARTIFACT_ZETDROPIFACT";
                    ZetDropifact.nameToken                 = "ARTIFACT_ZETDROPIFACT_NAME";
                    ZetDropifact.descriptionToken          = "ARTIFACT_ZETDROPIFACT_DESC";
                    ZetDropifact.smallIconSelectedSprite   = ZetArtifactsPlugin.CreateSprite(Properties.Resources.zetdrop_selected, Color.magenta);
                    ZetDropifact.smallIconDeselectedSprite = ZetArtifactsPlugin.CreateSprite(Properties.Resources.zetdrop_deselected, Color.gray);

                    artifactDefs.Add(ZetDropifact);
                }

                if (ZetArtifactsPlugin.LoopifactEnable.Value == 1)
                {
                    ZetLoopifact                           = ScriptableObject.CreateInstance <ArtifactDef>();
                    ZetLoopifact.cachedName                = "ARTIFACT_ZETLOOPIFACT";
                    ZetLoopifact.nameToken                 = "ARTIFACT_ZETLOOPIFACT_NAME";
                    ZetLoopifact.descriptionToken          = "ARTIFACT_ZETLOOPIFACT_DESC";
                    ZetLoopifact.smallIconSelectedSprite   = ZetArtifactsPlugin.CreateSprite(Properties.Resources.zetloop_selected, Color.magenta);
                    ZetLoopifact.smallIconDeselectedSprite = ZetArtifactsPlugin.CreateSprite(Properties.Resources.zetloop_deselected, Color.gray);

                    artifactDefs.Add(ZetLoopifact);
                }

                if (ZetArtifactsPlugin.EclifactEnable.Value == 1 && !ZetArtifactsPlugin.PluginLoaded("com.TPDespair.DiluvianArtifact"))
                {
                    ZetEclifact                           = ScriptableObject.CreateInstance <ArtifactDef>();
                    ZetEclifact.cachedName                = "ARTIFACT_ZETECLIFACT";
                    ZetEclifact.nameToken                 = "ARTIFACT_ZETECLIFACT_NAME";
                    ZetEclifact.descriptionToken          = "ARTIFACT_ZETECLIFACT_DESC";
                    ZetEclifact.smallIconSelectedSprite   = ZetArtifactsPlugin.CreateSprite(Properties.Resources.zeteclipse_selected, Color.magenta);
                    ZetEclifact.smallIconDeselectedSprite = ZetArtifactsPlugin.CreateSprite(Properties.Resources.zeteclipse_deselected, Color.gray);

                    artifactDefs.Add(ZetEclifact);
                }
            }