Exemplo n.º 1
0
        public void Awake()
        {
            // Initialize config
            CommonItemCount    = Config.Bind("Quantities", "CommonItemCount", 1, "Quantity of the common (white) item to start with.");
            UncommonItemCount  = Config.Bind("Quantities", "UncommonItemCount", 1, "Quantity of the uncommon (green) item to start with.");
            LegendaryItemCount = Config.Bind("Quantities", "LegendaryItemCount", 1, "Quantity of the legendary (red) item to start with.");
            BossItemCount      = Config.Bind("Quantities", "BossItemCount", 1, "Quantity of the boss (yellow) item to start with.");
            LunarItemCount     = Config.Bind("Quantities", "LunarItemCount", 1, "Quantity of the lunar (blue) item to start with.");

            // Initialize the artifact
            Artifact = ScriptableObject.CreateInstance <ArtifactDef>();

            // Artifact info
            Artifact.nameToken                 = "Artifact of Sequencing";
            Artifact.descriptionToken          = "Spawn with a starting item of every tier. Any picked up items will be converted to the starting item of the same tier.";
            Artifact.smallIconSelectedSprite   = LoadIcon(ArtifactOfSequencing.Properties.Resources.texArtifactSequencingEnabled);
            Artifact.smallIconDeselectedSprite = LoadIcon(ArtifactOfSequencing.Properties.Resources.texArtifactSequencingDisabled);

            // Add our custom artifact to the artifact list
            // This uses the ArtifactAPI submodule in R2API
            ArtifactAPI.Add(Artifact);

            // On run start event
            // This is when we add our items
            Run.onRunStartGlobal += AddBeginningItems;
        }
 public static void InitializeArtifact()
 {
     Aggression.nameToken        = "Artifact of Aggression";
     Aggression.descriptionToken = "Increases range of monster targeting " + (RangeMultiplier.Value < 0 ? "infinitely." : ("by " + RangeMultiplier.Value * 100f + "%."));
     //Aggression.smallIconDeselectedSprite = AssetLoaderAndChecker.MainAssets.LoadAsset<Sprite>("Assets/Textures/Artifact/VarianceDisabled.png");
     //Aggression.smallIconSelectedSprite = AssetLoaderAndChecker.MainAssets.LoadAsset<Sprite>("Assets/Textures/Artifact/VarianceEnabled.png");
     ArtifactAPI.Add(Aggression);
 }
Exemplo n.º 3
0
 public static void SetupArtifact()
 {
     uniqueArtifactDef.nameToken                 = "Artifact of Uniquety";
     uniqueArtifactDef.descriptionToken          = "Items are unique.";
     uniqueArtifactDef.smallIconDeselectedSprite = EvolRef.smallIconDeselectedSprite;
     uniqueArtifactDef.smallIconSelectedSprite   = EvolRef.smallIconSelectedSprite;
     ArtifactAPI.Add(uniqueArtifactDef);
 }
Exemplo n.º 4
0
 public static void InitializeArtifact()
 {
     Firmness.nameToken                 = "Artifact of Firmness";
     Firmness.descriptionToken          = "Prevents monsters from flinching.";
     Firmness.smallIconDeselectedSprite = EvolRef.smallIconDeselectedSprite;
     Firmness.smallIconSelectedSprite   = EvolRef.smallIconSelectedSprite;
     ArtifactAPI.Add(Firmness);
 }
Exemplo n.º 5
0
 protected void CreateArtifact()
 {
     ArtifactDef                           = ScriptableObject.CreateInstance <ArtifactDef>();
     ArtifactDef.cachedName                = "ARTIFACT_" + ArtifactLangTokenName;
     ArtifactDef.nameToken                 = "ARTIFACT_" + ArtifactLangTokenName + "_NAME";
     ArtifactDef.descriptionToken          = "ARTIFACT_" + ArtifactLangTokenName + "_DESCRIPTION";
     ArtifactDef.smallIconSelectedSprite   = ArtifactEnabledIcon;
     ArtifactDef.smallIconDeselectedSprite = ArtifactDisabledIcon;
     ArtifactAPI.Add(ArtifactDef);
 }
Exemplo n.º 6
0
        public static void InitializeArtifact()
        {
            GoombaArtifactDef.nameToken                 = "Artifact of Goombastomping";
            GoombaArtifactDef.descriptionToken          = "Deal substantial damage upon landing on an enemy's head.";
            GoombaArtifactDef.smallIconDeselectedSprite = LoadoutAPI.CreateSkinIcon(Color.black, Color.white, Color.white, Color.white);
            GoombaArtifactDef.smallIconSelectedSprite   = LoadoutAPI.CreateSkinIcon(Color.gray, Color.white, Color.white, Color.white);
            ArtifactAPI.Add(GoombaArtifactDef);

            goombaGameObject.name = "GoombaStomp";

            if (deathMessages.Value)
            {
                LanguageAPI.Add("PLAYER_DEATH_QUOTE_GOOMBADEATH", goombaDeathToken);
                LanguageAPI.Add("PLAYER_DEATH_QUOTE_GOOMBADEATH_2P", goombaDeathMultiplayerToken);
            }
        }
Exemplo n.º 7
0
        public static void InitializeArtifact()
        {
            Variance.nameToken = "Artifact of Variance";
            if (ConfigLoader.ArtifactIncreasesRewards)
            {
                Variance.descriptionToken = "All Variant's Spawn Rates & Rewards are Multiplied by " + ConfigLoader.SpawnRateMultiplier;
            }
            else
            {
                Variance.descriptionToken = "All Variant's Spawn Rates are Multiplied by " + ConfigLoader.SpawnRateMultiplier;
            }
            Variance.smallIconDeselectedSprite = AssetLoaderAndChecker.MainAssets.LoadAsset <Sprite>("Assets/Textures/Artifact/VarianceDisabled.png");
            Variance.smallIconSelectedSprite   = AssetLoaderAndChecker.MainAssets.LoadAsset <Sprite>("Assets/Textures/Artifact/VarianceEnabled.png");

            ArtifactAPI.Add(Variance);
        }
Exemplo n.º 8
0
 public void Awake()
 {
     //Create settings for quantity in the config file for each item tier
     NumWhites  = base.Config.Bind <int>("Quantity", "NumWhites", 1, "The number of white items to begin a run with.");
     NumGreens  = base.Config.Bind <int>("Quantity", "NumGreens", 1, "The number of green items to begin a run with.");
     NumReds    = base.Config.Bind <int>("Quantity", "NumReds", 1, "The number of red items to begin a run with.");
     NumYellows = base.Config.Bind <int>("Quantity", "NumYellows", 1, "The number of yellow/boss items to begin a run with.");
     NumLunar   = base.Config.Bind <int>("Quantity", "NumLunar", 1, "The number of lunar items to begin a run with.");
     //TODO: Add deselect & select icons to artifact
     Artifact.nameToken                 = "Artifact of Resequencing";
     Artifact.descriptionToken          = "Spawn with one item from every tier. Any additional items picked up will be converted into the item of their respective tier.";
     Artifact.smallIconSelectedSprite   = this.Icon(Properties.Resources.testicon);
     Artifact.smallIconDeselectedSprite = this.Icon(Properties.Resources.testicon);
     ArtifactAPI.Add(Artifact);
     //Adds the items on the start of a run
     Run.onRunStartGlobal += AddBeginningItems;
 }
Exemplo n.º 9
0
        //Asset Stuff
        public void SetupArtifact()
        {
            Grief.nameToken = "Artifact of Grief";
            string desc = "Drop items when hit.";

            if (EnemyCanPickup.Value)
            {
                desc += " Enemies can pick up items.";
            }
            Grief.descriptionToken = desc;

            Grief.smallIconDeselectedSprite = LoadAsSprite(Properties.Resources.texArtifactGriefDisabled, 128);
            Grief.smallIconSelectedSprite   = LoadAsSprite(Properties.Resources.texArtifactGriefEnabled, 128);
            ArtifactAPI.Add(Grief);

            Thief = new CustomBuff("Thief", LoadAsSprite(Properties.Resources.texBuffThiefIcon, 128), new Color(27f / 255f, 122f / 255f, 6f / 255f), false, true);
            BuffAPI.Add(Thief);
        }
        public static void InitializeArtifact()
        {
            RandomLoadoutAll.nameToken                 = "Artifact of Tyfortosi (All)";
            RandomLoadoutAll.descriptionToken          = "Randomizes loadouts for survivors and monsters alike.";
            RandomLoadoutAll.smallIconDeselectedSprite = EvolRef.smallIconDeselectedSprite;
            RandomLoadoutAll.smallIconSelectedSprite   = EvolRef.smallIconSelectedSprite;
            ArtifactAPI.Add(RandomLoadoutAll);


            RandomLoadoutMonster.nameToken                 = "Artifact of Tyfortosi (Monster)";
            RandomLoadoutMonster.descriptionToken          = "Randomizes loadouts for all monsters. Has minimal effect.";
            RandomLoadoutMonster.smallIconDeselectedSprite = EvolRef.smallIconDeselectedSprite;
            RandomLoadoutMonster.smallIconSelectedSprite   = EvolRef.smallIconSelectedSprite;
            ArtifactAPI.Add(RandomLoadoutMonster);

            RandomLoadoutMonsterSurvivors.nameToken                 = "Artifact of Tyfortosi (Enemy Survivor)";
            RandomLoadoutMonsterSurvivors.descriptionToken          = "Randomizes loadouts for survivors that spawn as monsters.";
            RandomLoadoutMonsterSurvivors.smallIconDeselectedSprite = EvolRef.smallIconDeselectedSprite;
            RandomLoadoutMonsterSurvivors.smallIconSelectedSprite   = EvolRef.smallIconSelectedSprite;
            ArtifactAPI.Add(RandomLoadoutMonsterSurvivors);
        }
Exemplo n.º 11
0
        public void Awake()
        {
            config = new ForesightConfig(this.Config);
            InitArtifact();
            CreateChestSynchronizer();

            Run.onRunStartGlobal += (obj) =>
            {
                if (RunArtifactManager.instance.IsArtifactEnabled(foresightArtifactDef.artifactIndex))
                {
                    On.RoR2.ChestBehavior.PickFromList += SaveAndSyncChestPickup;
                    On.RoR2.Hologram.HologramProjector.BuildHologram += AddPickupNameToHologram;
                    if (config.showInPings.Value)
                    {
                        On.RoR2.PurchaseInteraction.GetDisplayName += AddPickupNameToDisplay;
                    }
                    On.RoR2.PurchaseInteraction.Awake += RaiseChestPrices;
                    On.RoR2.MultiShopController.Start += RaiseMultishopPrices;
                }
            };
            Run.onRunDestroyGlobal += (obj) =>
            {
                On.RoR2.ChestBehavior.PickFromList -= SaveAndSyncChestPickup;
                On.RoR2.Hologram.HologramProjector.BuildHologram -= AddPickupNameToHologram;
                On.RoR2.PurchaseInteraction.GetDisplayName       -= AddPickupNameToDisplay;
                On.RoR2.PurchaseInteraction.Awake -= RaiseChestPrices;
                On.RoR2.MultiShopController.Start -= RaiseMultishopPrices;
            };
            if (!ArtifactAPI.Add(foresightArtifactDef))
            {
                Logger.LogError("Failed to add foresight artifact!");
            }
#if DEBUG
            On.RoR2.Networking.GameNetworkManager.OnClientConnect += (self, user, t) => { };
#endif
        }
Exemplo n.º 12
0
        private void Awake()
        {
            _logger = Logger;


            cfgFile = new ConfigFile(Path.Combine(Paths.ConfigPath, ModGuid + ".cfg"), true);
            ArtifactOfDoomUI artifactOfDoomUI = new ArtifactOfDoomUI();
            ArtifactOfDoom   artifactOfDoom   = new ArtifactOfDoom();
            NetworkClass     network          = new NetworkClass();

            averageItemsPerStage = cfgFile.Bind(new ConfigDefinition("Gameplay Settings", "averageItemsPerStage"), 3, new ConfigDescription(
                                                    "Base chance in percent that enemys steal items from you ((totalItems - currentStage * averageItemsPerStage) ^ exponentTriggerItems; \nIf that value is lower you'll need to kill more enemies to get an item"));
            exponentTriggerItems = cfgFile.Bind(new ConfigDefinition("Gameplay Settings", "exponentTriggerItems"), 2.0, new ConfigDescription(
                                                    "The exponent for calculation when you'll get an item. If it's 1 you have a linear increase. Default is 2"));

            minItemsPerStage = cfgFile.Bind(new ConfigDefinition("Gameplay Settings", "minItemsPerStage"), 2, new ConfigDescription(
                                                "The expected minimum item count per stage. If you have less Items than that you'll have a decreased chance that you lose items"));
            maxItemsPerStage = cfgFile.Bind(new ConfigDefinition("Gameplay Settings", "maxItemsPerStage"), 7, new ConfigDescription(
                                                "The expected maximum item count per stage. If you have more Items than that you'll have a chance to lose more than one item per hit"));
            exponentailFactorToCalculateSumOfLostItems = cfgFile.Bind(new ConfigDefinition("Gameplay Settings", "exponentailFactorToCalculateSumOfLostItems"), 1.5, new ConfigDescription(
                                                                          "The exponent to Calculate how many items you'll lose if you're over maxItemsPerStage"));
            exponentailFactorIfYouAreUnderAverageItemsPerStage = cfgFile.Bind(new ConfigDefinition("Gameplay Settings", "exponentailFactorIfYouAreUnderAverageItemsPerStage"), 0.0, new ConfigDescription(
                                                                                  "The exponent to Calculate how many kills you'll need if you're under averageItemsPerStage. The formula is totalitems^exponentailFactorIfYouAreUnderAverageItemsPerStage. Default is 0 so you'll need always two kills."));

            artifactOfSwarmNerf = cfgFile.Bind(new ConfigDefinition("Gameplay Settings", "artifactOfSwarmNerf"), false, new ConfigDescription(
                                                   "Enable the nerf for Artifact of Swarm where you've to kill double as many enemies"));

            useArtifactOfSacrificeCalculation = cfgFile.Bind(new ConfigDefinition("Gameplay Settings", "useArtifactOfSacreficeCalculation"), false, new ConfigDescription(
                                                                 "Chance the item gain to a specific drop rate of enemys"));
            multiplayerForArtifactOfSacrificeDropRate = cfgFile.Bind(new ConfigDefinition("Gameplay Settings", "multiplayerForArtifactOfSacrificeDropRate"), 2.0, new ConfigDescription(
                                                                         "Multiplier for the drop rate (base Chance is 5)"));

            disableItemProgressBar = cfgFile.Bind(new ConfigDefinition("UI Settings", "disableItemProgressBar"), false, new ConfigDescription(
                                                      "If true it disables the Progress bar in the bottom of the UI"));
            disableSideBars = cfgFile.Bind(new ConfigDefinition("UI Settings", "disableSideBars"), false, new ConfigDescription(
                                               "Disables the item Sidebars"));
            enableChatItemOutput = cfgFile.Bind(new ConfigDefinition("UI Settings", "enableChatItemOutput"), false, new ConfigDescription(
                                                    "Enables the chat output for gained/lost Items. This setting is not synced."));
            sizeOfSideBars = cfgFile.Bind(new ConfigDefinition("UI Settings", "sizeOfSideBars"), 0.02, new ConfigDescription(
                                              "Spezifies the size of the sidebars. 1 is whole window 0 is invisible (but for that plase use the disable setting)."));
            timeAfterHitToNotLoseItemDrizzly = cfgFile.Bind(new ConfigDefinition("Gameplay Settings", "timeAfterHitToNotLooseItemDrizzly"), 0.8, new ConfigDescription(
                                                                "The time in seconds where you will not lose items after you lost one on drizzly"));
            timeAfterHitToNotLoseItemRainstorm = cfgFile.Bind(new ConfigDefinition("Gameplay Settings", "timeAfterHitToNotLooseItemRainstorm"), 0.2, new ConfigDescription(
                                                                  "The time in seconds where you will not lose items after you lost one on rainstorm"));
            timeAfterHitToNotLoseItemMonsoon = cfgFile.Bind(new ConfigDefinition("Gameplay Settings", "timeAfterHitToNotLooseItemMonsoon"), 0.05, new ConfigDescription(
                                                                "The time in seconds where you will not lose items after you lost one on monsoon"));
            timeAfterHitToNotLoseItemOtherDifficulty = cfgFile.Bind(new ConfigDefinition("Gameplay Settings", "timeAfterHitToNotLooseOtherDifficulty"), "[{\"DifficultyIndex\": \"DIFFICULTYINDEX\", \"time\": 1.0}]", new ConfigDescription(
                                                                        "The time in seconds where you will not lose items after you lost one on monsoon"));


            CommandoBonusItems = cfgFile.Bind(new ConfigDefinition("Character specific settings", "CommandoBonusItems"), 1.0, new ConfigDescription(
                                                  "The count of items which you get if you kill enough enemies"));
            CommandoMultiplierForTimedBuff = cfgFile.Bind(new ConfigDefinition("Character specific settings", "commandoMultiplyerForTimedBuff"), 1.0, new ConfigDescription(
                                                              "The Multiplier for that specific character for the length of timeAfterHitToNotLooseItems"));
            HuntressBonusItems = cfgFile.Bind(new ConfigDefinition("Character specific settings", "HuntressBonusItems"), 1.0, new ConfigDescription(
                                                  "The count of items which you get if you kill enough enemies"));
            HuntressMultiplierForTimedBuff = cfgFile.Bind(new ConfigDefinition("Character specific settings", "HuntressMultiplierForTimedBuff"), 1.0, new ConfigDescription(
                                                              "The Multiplier for that specific character for the length of timeAfterHitToNotLooseItems"));
            MULTBonusItems = cfgFile.Bind(new ConfigDefinition("Character specific settings", "MULTBonusItems"), 1.0, new ConfigDescription(
                                              "The count of items which you get if you kill enough enemies"));
            MULTMultiplierForTimedBuff = cfgFile.Bind(new ConfigDefinition("Character specific settings", "MULTMultiplierForTimedBuff"), 1.0, new ConfigDescription(
                                                          "The Multiplier for that specific character for the length of timeAfterHitToNotLooseItems"));
            EngineerBonusItems = cfgFile.Bind(new ConfigDefinition("Character specific settings", "EngineerBonusItems"), 1.0, new ConfigDescription(
                                                  "The count of items which you get if you kill enough enemies"));
            EngineerMultiplierForTimedBuff = cfgFile.Bind(new ConfigDefinition("Character specific settings", "EngineerMultiplierForTimedBuff"), 1.0, new ConfigDescription(
                                                              "The Multiplier for that specific character for the length of timeAfterHitToNotLooseItems"));
            ArtificerBonusItems = cfgFile.Bind(new ConfigDefinition("Character specific settings", "ArtificerBonusItems"), 2.0, new ConfigDescription(
                                                   "The count of items which you get if you kill enough enemies"));
            ArtificerMultiplierForTimedBuff = cfgFile.Bind(new ConfigDefinition("Character specific settings", "ArtificerMultiplierForTimedBuff"), 1.0, new ConfigDescription(
                                                               "The Multiplier for that specific character for the length of timeAfterHitToNotLooseItems"));
            MercenaryBonusItems = cfgFile.Bind(new ConfigDefinition("Character specific settings", "MercenaryBonusItems"), 1.0, new ConfigDescription(
                                                   "The count of items which you get if you kill enough enemies"));
            MercenaryMultiplierForTimedBuff = cfgFile.Bind(new ConfigDefinition("Character specific settings", "MercenaryMultiplierForTimedBuff"), 4.0, new ConfigDescription(
                                                               "The Multiplier for that specific character for the length of timeAfterHitToNotLooseItems"));
            RexBonusItems = cfgFile.Bind(new ConfigDefinition("Character specific settings", "RexBonusItems"), 1.0, new ConfigDescription(
                                             "The count of items which you get if you kill enough enemies"));
            RexMultiplierForTimedBuff = cfgFile.Bind(new ConfigDefinition("Character specific settings", "RexMultiplierForTimedBuff"), 1.0, new ConfigDescription(
                                                         "The Multiplier for that specific character for the length of timeAfterHitToNotLooseItems"));
            LoaderBonusItems = cfgFile.Bind(new ConfigDefinition("Character specific settings", "LoaderBonusItems"), 1.0, new ConfigDescription(
                                                "The count of items which you get if you kill enough enemies"));
            LoaderMultiplierForTimedBuff = cfgFile.Bind(new ConfigDefinition("Character specific settings", "LoaderMultiplierForTimedBuff"), 4.0, new ConfigDescription(
                                                            "The Multiplier for that specific character for the length of timeAfterHitToNotLooseItems"));
            AcridBonusItems = cfgFile.Bind(new ConfigDefinition("Character specific settings", "AcridBonusItems"), 1.0, new ConfigDescription(
                                               "The count of items which you get if you kill enough enemies"));
            AcridMultiplierForTimedBuff = cfgFile.Bind(new ConfigDefinition("Character specific settings", "AcridMultiplierForTimedBuff"), 4.0, new ConfigDescription(
                                                           "The Multiplier for that specific character for the length of timeAfterHitToNotLooseItems"));
            CaptainBonusItems = cfgFile.Bind(new ConfigDefinition("Character specific settings", "CaptainBonusItems"), 1.0, new ConfigDescription(
                                                 "The count of items which you get if you kill enough enemies"));
            CaptainMultiplierForTimedBuff = cfgFile.Bind(new ConfigDefinition("Character specific settings", "BanditMultiplierForTimedBuff"), 1.0, new ConfigDescription(
                                                             "The Multiplier for that specific character for the length of timeAfterHitToNotLooseItems"));
            BanditBonusItems = cfgFile.Bind(new ConfigDefinition("Character specific settings", "BanditBonusItems"), 1.0, new ConfigDescription(
                                                "The count of items which you get if you kill enough enemies"));
            BanditMultiplierForTimedBuff = cfgFile.Bind(new ConfigDefinition("Character specific settings", "BanditMultiplierForTimedBuff"), 1.0, new ConfigDescription(
                                                            "The Multiplier for that specific character for the length of timeAfterHitToNotLooseItems"));
            CustomSurvivorBonusItems = cfgFile.Bind(new ConfigDefinition("Character specific settings", "CustomSurvivorBonusItems"), 1.0, new ConfigDescription(
                                                        "The count of items which you get if you kill enough enemies"));
            CustomSurvivorMultiplierForTimedBuff = cfgFile.Bind(new ConfigDefinition("Character specific settings", "CustomSurvivorMultiplierForTimedBuff"), 1.0, new ConfigDescription(
                                                                    "The Multiplier for that specific character for the length of timeAfterHitToNotLoseItems"));
            CustomChars = cfgFile.Bind(new ConfigDefinition("Character specific settings", "CustomCharacters"), "[{\"Name\": \"CUSTOM_CHAR_BODY_NAME1\", \"MultiplierForTimedBuff\": 1.0, \"BonusItems\": 1.0},{\"Name\": \"CUSTOM_CHAR_BODY_NAME2\", \"MultiplierForTimedBuff\": 2.0, \"BonusItems\": 2.0}]", new ConfigDescription(
                                           "The Multiplier for that specific character for the length of timeAfterHitToNotLoseItems"));



            ArtifactOfDoomBuff.name      = "ArtifactOfDoomDidLoseItem";
            ArtifactOfDoomBuff.buffColor = Color.black;
            ArtifactOfDoomBuff.canStack  = false;
            ArtifactOfDoomBuff.isDebuff  = false;
            ArtifactAPI.Add(ArtifactOfDoom.Transmutation);

            BuffAPI.Add(new CustomBuff(ArtifactOfDoomBuff));



            On.RoR2.ContentManagement.ContentManager.SetContentPacks += ContentManager_SetContentPacks;
            //On.RoR2.ContentManager.SetContentPacks += ContentManager_SetContentPacks;
        }