Exemplo n.º 1
0
        public UnassumingTie()
        {
            modelPathName = "@SupplyDrop:Assets/Main/Models/Prefabs/TiePickUp.prefab";

            iconPathName = "@SupplyDrop:Assets/Main/Textures/Icons/TieIcon.png";

            onAttrib += (tokenIdent, namePrefix) =>
            {
                var secondWindBuff = new R2API.CustomBuff(
                    new BuffDef
                {
                    canStack = false,
                    isDebuff = false,
                    name     = namePrefix + "SecondWindBuff",
                    iconPath = "@SupplyDrop:Assets/Main/Textures/Icons/SecondWindBuffIcon.png"
                });
                SecondWindBuff = R2API.BuffAPI.Add(secondWindBuff);

                var windedDebuff = new R2API.CustomBuff(
                    new BuffDef
                {
                    canStack = false,
                    isDebuff = true,
                    name     = namePrefix + "WindedDebuff",
                    iconPath = "@SupplyDrop:Assets/Main/Textures/Icons/WindedDebuffIcon.png"
                });
                WindedDebuff = R2API.BuffAPI.Add(windedDebuff);
            };
        }
Exemplo n.º 2
0
        public override void SetupAttributes()
        {
            if (ItemBodyModelPrefab == null)
            {
                ItemBodyModelPrefab = Resources.Load <GameObject>(modelResourcePath);
                var meshes = ItemBodyModelPrefab.GetComponentsInChildren <MeshRenderer>();
                meshes[2].material.SetFloat("_FillAmount", 0.28f);
                var wobble = meshes[2].gameObject.AddComponent <Wobble>();
                wobble.MaxWobble = 0.02f;
                displayRules     = GenerateItemDisplayRules();
            }

            base.SetupAttributes();
            var sipCooldownDebuff = new R2API.CustomBuff(
                new RoR2.BuffDef
            {
                buffColor = new Color(50, 0, 50),
                canStack  = false,
                isDebuff  = false,
                name      = "ATHRMAccursed Potion Sip Cooldown",
                iconPath  = "@Aetherium:Assets/Textures/Icons/AccursedPotionSipCooldownDebuffIcon.png"
            });

            AccursedPotionSipCooldownDebuff = R2API.BuffAPI.Add(sipCooldownDebuff);
        }
Exemplo n.º 3
0
        public ShellPlating()
        {
            modelPathName = "@SupplyDrop:Assets/Main/Models/Prefabs/Shell.prefab";
            iconPathName  = "@SupplyDrop:Assets/Main/Textures/Icons/ShellIcon.png";

            onAttrib += (tokenIdent, namePrefix) =>
            {
                var shellStackMax = new R2API.CustomBuff(
                    new BuffDef
                {
                    canStack = false,
                    isDebuff = false,
                    name     = namePrefix + "ShellStackMax",
                    iconPath = "@SupplyDrop:Assets/Main/Textures/Icons/ShellBuffIcon.png"
                });
                ShellStackMax = R2API.BuffAPI.Add(shellStackMax);

                var shellStackDef = new CustomItem(new ItemDef
                {
                    hidden    = true,
                    name      = namePrefix + "INTERNALShell",
                    tier      = ItemTier.NoTier,
                    canRemove = false
                }, new ItemDisplayRuleDict(null));
                shellStack = ItemAPI.Add(shellStackDef);
            };
        }
Exemplo n.º 4
0
        public override void SetupAttributes()
        {
            if (ItemBodyModelPrefab == null)
            {
                ItemBodyModelPrefab = Resources.Load <GameObject>(modelResourcePath);
                displayRules        = GenerateItemDisplayRules();
            }

            base.SetupAttributes();
            var secondWindBuff = new R2API.CustomBuff(
                new BuffDef
            {
                canStack = false,
                isDebuff = false,
                name     = "SecondWindBuff",
                iconPath = "@SupplyDrop:Assets/Main/Textures/Icons/SecondWindBuffIcon.png"
            });

            SecondWindBuff = BuffAPI.Add(secondWindBuff);

            var windedDebuff = new R2API.CustomBuff(
                new BuffDef
            {
                canStack = false,
                isDebuff = true,
                name     = "WindedDebuff",
                iconPath = "@SupplyDrop:Assets/Main/Textures/Icons/WindedDebuffIcon.png"
            });

            WindedDebuff = BuffAPI.Add(windedDebuff);
        }
Exemplo n.º 5
0
        public override void SetupAttributes()
        {
            if (ItemBodyModelPrefab == null)
            {
                ItemBodyModelPrefab = Resources.Load <GameObject>(modelResourcePath);
                displayRules        = GenerateItemDisplayRules();
            }

            base.SetupAttributes();
            var shellStackMax = new R2API.CustomBuff(
                new BuffDef
            {
                canStack = false,
                isDebuff = false,
                name     = "ShellStackMax",
                iconPath = "@SupplyDrop:Assets/Main/Textures/Icons/ShellBuffIcon.png"
            });

            ShellStackMax = R2API.BuffAPI.Add(shellStackMax);

            var shellStackDef = new CustomItem(new ItemDef
            {
                hidden    = true,
                name      = "INTERNALShell",
                tier      = ItemTier.NoTier,
                canRemove = false
            }, new ItemDisplayRuleDict(null));

            shellStack = ItemAPI.Add(shellStackDef);
        }
Exemplo n.º 6
0
 public CustomElite(string name, EliteDef eliteDef, CustomEquipment equipment, CustomBuff buff, int tier = 1)
 {
     Name      = name;
     EliteDef  = eliteDef;
     Equipment = equipment;
     Buff      = buff;
     Tier      = tier;
 }
Exemplo n.º 7
0
        /// <summary>
        /// Add a custom buff to the list of available buffs.
        /// Value for BuffDef.buffIndex can be ignored.
        /// If this is called after the BuffCatalog inits then this will return false and ignore the custom buff.
        /// </summary>
        /// <param name="buff">The buff to add.</param>
        /// <returns>the BuffIndex of your item if added. -1 otherwise</returns>
        public static int AddCustomBuff(CustomBuff buff)
        {
            if (_buffCatalogInitialized)
            {
                R2API.Logger.LogError($"Too late ! Tried to add buff: {buff.BuffDef.name} after the buff list was created");
                return(-1);
            }

            buff.BuffDef.buffIndex = (BuffIndex)OriginalBuffCount + CustomBuffCount++;
            BuffDefinitions.Add(buff);
            return((int)buff.BuffDef.buffIndex);
        }
Exemplo n.º 8
0
        /*
         * BUFFS
         */
        private static void lightArmourAsBuff()
        {
            var lightArmourBuffDef = new BuffDef
            {
                name      = "LightArmour",
                iconPath  = "Textures/bufficons/texBuffGenericShield",
                buffColor = UnityEngine.Color.yellow,
                isDebuff  = false,
                canStack  = false
            };

            var LightArmour = new R2API.CustomBuff(lightArmourBuffDef);

            lightArmourBuffIndex = BuffAPI.Add(LightArmour);
        }
Exemplo n.º 9
0
 public FrenzyPotion()
 {
     onAttrib += (tokenIdent, namePrefix) =>
     {
         var frenziedBuff = new R2API.CustomBuff(
             new RoR2.BuffDef
         {
             buffColor = Color.red,
             canStack  = true,
             isDebuff  = true,
             name      = namePrefix + ": Frenzied Debuff",
             iconPath  = "@Aetherium:Assets/Textures/Icons/FeatheredPlumeBuffIcon.png"
         });
         FrenziedDebuff = R2API.BuffAPI.Add(frenziedBuff);
     };
 }
Exemplo n.º 10
0
        public NumbingBerries()
        {
            modelPathName = "@SupplyDrop:Assets/Main/Models/Prefabs/Berry.prefab";
            iconPathName  = "@SupplyDrop:Assets/Main/Textures/Icons/BerryIcon.png";

            onAttrib += (tokenIdent, namePrefix) =>
            {
                var numbBerryBuff = new R2API.CustomBuff(
                    new BuffDef
                {
                    canStack = false,
                    isDebuff = false,
                    name     = namePrefix + "NumbBerryBuff",
                    iconPath = "@SupplyDrop:Assets/Main/Textures/Icons/BerryBuffIcon.png"
                });
                NumbBerryBuff = R2API.BuffAPI.Add(numbBerryBuff);
            };
        }
        public HardenedBoneFragments()
        {
            modelPathName = "@SupplyDrop:Assets/Main/Models/Prefabs/Bone.prefab";
            iconPathName  = "@SupplyDrop:Assets/Main/Textures/Icons/BoneIcon.png";

            onAttrib += (tokenIdent, namePrefix) =>
            {
                var bFBuff = new R2API.CustomBuff(
                    new BuffDef
                {
                    buffColor = Color.white,
                    canStack  = true,
                    isDebuff  = false,
                    name      = namePrefix + "BoneFragArmor",
                    iconPath  = "@SupplyDrop:Assets/Main/Textures/Icons/BoneBuffIcon.png"
                });
                BFBuff = R2API.BuffAPI.Add(bFBuff);
            };
        }
Exemplo n.º 12
0
        public override void SetupAttributes()
        {
            if (ItemBodyModelPrefab == null)
            {
                ItemBodyModelPrefab = Resources.Load <GameObject>(modelResourcePath);
                displayRules        = GenerateItemDisplayRules();
            }

            base.SetupAttributes();
            var voidInstability = new R2API.CustomBuff(
                new RoR2.BuffDef
            {
                buffColor = Color.magenta,
                canStack  = false,
                isDebuff  = true,
                name      = "ATHRMVoidInstabilityDebuff",
                iconPath  = "@Aetherium:Assets/Textures/Icons/VoidInstabilityDebuffIcon.png"
            });

            VoidInstabilityDebuff = R2API.BuffAPI.Add(voidInstability);
        }
        public override void SetupAttributes()
        {
            if (ItemBodyModelPrefab == null)
            {
                ItemBodyModelPrefab = Resources.Load <GameObject>(modelResourcePath);
                displayRules        = GenerateItemDisplayRules();
            }

            base.SetupAttributes();
            var bFBuff = new R2API.CustomBuff(
                new BuffDef
            {
                buffColor = Color.white,
                canStack  = true,
                isDebuff  = false,
                name      = "BoneFragArmor",
                iconPath  = "@SupplyDrop:Assets/Main/Textures/Icons/BoneBuffIcon.png"
            });

            BFBuff = R2API.BuffAPI.Add(bFBuff);
        }
Exemplo n.º 14
0
        public override void SetupAttributes()
        {
            if (ItemBodyModelPrefab == null)
            {
                ItemBodyModelPrefab = Resources.Load <GameObject>(modelResourcePath);
                displayRules        = GenerateItemDisplayRules();
            }

            base.SetupAttributes();
            var speedBuff = new R2API.CustomBuff(
                new BuffDef
            {
                buffColor = Color.green,
                canStack  = true,
                isDebuff  = false,
                name      = "ATHRMFeatheredPlumeSpeed",
                iconPath  = "@Aetherium:Assets/Textures/Icons/FeatheredPlumeBuffIcon.png"
            });

            SpeedBuff = R2API.BuffAPI.Add(speedBuff);
        }
Exemplo n.º 15
0
        public override void SetupAttributes()
        {
            if (ItemBodyModelPrefab == null)
            {
                ItemBodyModelPrefab   = Resources.Load <GameObject>(modelResourcePath);
                CircleBodyModelPrefab = Resources.Load <GameObject>("@Aetherium:Assets/Models/Prefabs/WitchesRingCircle.prefab");
                displayRules          = GenerateItemDisplayRules();
            }
            base.SetupAttributes();

            var witchesRingImmunityBuff = new R2API.CustomBuff(
                new RoR2.BuffDef
            {
                buffColor = new Color(0, 80, 0),
                canStack  = false,
                isDebuff  = false,
                name      = "ATHRM Witches Ring Immunity",
                iconPath  = "@Aetherium:Assets/Textures/Icons/WitchesRingBuffIcon.png"
            });

            WitchesRingImmunityBuff = R2API.BuffAPI.Add(witchesRingImmunityBuff);
        }
Exemplo n.º 16
0
        internal new static ManualLogSource Logger; // allow access to the logger across the plugin classes

        public void Awake()
        {
            Logger = base.Logger;
            var noHeal = new R2API.CustomBuff("noHeal", new BuffDef {
                buffColor = Color.red,
                canStack  = true,
                isDebuff  = true,
                name      = "NoHeal",
            });

            ConfigFile cfgFile = new ConfigFile(Path.Combine(Paths.ConfigPath, ModGuid + ".cfg"), true);

            EnemyChanceToStealItem = cfgFile.Bind(new ConfigDefinition("Global.VanillaTweaks", "EnemyChanceToStealItems"), 0.5, new ConfigDescription(
                                                      "Base chance in percent that enemys steal items from you (basechance*(itemcount/EnemyItemDivisor)"));
            EnemyItemDivisor = cfgFile.Bind(new ConfigDefinition("Global.VanillaTweaks", "EnemyItemDivisor"), 20, new ConfigDescription(
                                                "Enemy item devisior for stealing items from you (basechance*(itemcount/EnemyItemDivisor)"));
            PlayerChanceToStealItem = cfgFile.Bind(new ConfigDefinition("Global.VanillaTweaks", "PlayerChanceToStealItem"), 8.0, new ConfigDescription(
                                                       "Chance in percent that you steal items from the enemy"));

            indexNoHealBuff = BuffAPI.Add(noHeal);
            Assets.Init();
            Hooks.Init();
        }
Exemplo n.º 17
0
        public override void SetupAttributes()
        {
            if (ItemBodyModelPrefab == null)
            {
                ItemBodyModelPrefab = Resources.Load <GameObject>(modelResourcePath);
                displayRules        = GenerateItemDisplayRules();
            }
            base.SetupAttributes();
            var blasterSwordActiveBuff = new R2API.CustomBuff(
                new RoR2.BuffDef
            {
                buffColor = Color.white,
                canStack  = false,
                isDebuff  = false,
                name      = "ATHRMBlaster Sword Active",
                iconPath  = "@Aetherium:Assets/Textures/Icons/BlasterSwordBuffIcon.png"
            });

            BlasterSwordActiveBuff = R2API.BuffAPI.Add(blasterSwordActiveBuff);

            //The base of this was provided by Rolo to us.
            SwordProjectile = useImpaleProjectile ? PrefabAPI.InstantiateClone(Resources.Load <GameObject>("Prefabs/Projectiles/Thermite"), "SwordProjectile", true) : PrefabAPI.InstantiateClone(Resources.Load <GameObject>("Prefabs/Projectiles/MageIceBolt"), "SwordProjectile", true);

            var model = Resources.Load <GameObject>("@Aetherium:Assets/Models/Prefabs/BlasterSwordProjectile.prefab");

            model.AddComponent <NetworkIdentity>();
            model.AddComponent <RoR2.Projectile.ProjectileGhostController>();

            var controller = SwordProjectile.GetComponent <RoR2.Projectile.ProjectileController>();

            controller.procCoefficient = 0.5f;
            controller.ghostPrefab     = model;

            SwordProjectile.GetComponent <RoR2.TeamFilter>().teamIndex = TeamIndex.Player;

            var damage = SwordProjectile.GetComponent <RoR2.Projectile.ProjectileDamage>();

            damage.damageType = DamageType.CrippleOnHit;
            damage.damage     = 0;

            var impactExplosion = SwordProjectile.GetComponent <RoR2.Projectile.ProjectileImpactExplosion>();

            impactExplosion.impactEffect         = Resources.Load <GameObject>("Prefabs/Effects/ImpactEffects/VagrantCannonExplosion");
            impactExplosion.blastRadius          = 2;
            impactExplosion.blastProcCoefficient = 0.2f;

            if (useImpaleProjectile)
            {
                var stickOnImpact = SwordProjectile.GetComponent <RoR2.Projectile.ProjectileStickOnImpact>();
                stickOnImpact.alignNormals          = false;
                impactExplosion.lifetimeAfterImpact = 1.5f;
                impactExplosion.timerAfterImpact    = true;
            }

            // register it for networking
            if (SwordProjectile)
            {
                PrefabAPI.RegisterNetworkPrefab(SwordProjectile);
            }

            // add it to the projectile catalog or it won't work in multiplayer
            RoR2.ProjectileCatalog.getAdditionalEntries += list =>
            {
                list.Add(SwordProjectile);
            };
        }
Exemplo n.º 18
0
        public BloodBook()
        {
            modelPathName = "@SupplyDrop:Assets/Main/Models/Prefabs/BloodBook.prefab";
            iconPathName  = "@SupplyDrop:Assets/Main/Textures/Icons/BloodBookIcon.png";

            onAttrib += (tokenIdent, namePrefix) =>
            {
                var patheticBloodBuff = new CustomBuff(
                    new BuffDef
                {
                    canStack = false,
                    isDebuff = false,
                    name     = namePrefix + "PatheticBloodBuff",
                    iconPath = "@SupplyDrop:Assets/Main/Textures/Icons/PBloodBuffIcon.png"
                });
                PatheticBloodBuff = BuffAPI.Add(patheticBloodBuff);

                var weakBloodBuff = new CustomBuff(
                    new BuffDef
                {
                    canStack = false,
                    isDebuff = false,
                    name     = namePrefix + "WeakBloodBuff",
                    iconPath = "@SupplyDrop:Assets/Main/Textures/Icons/WBloodBuffIcon.png"
                });
                WeakBloodBuff = BuffAPI.Add(weakBloodBuff);

                var averageBloodBuff = new R2API.CustomBuff(
                    new BuffDef
                {
                    canStack = false,
                    isDebuff = false,
                    name     = namePrefix + "AverageBloodBuff",
                    iconPath = "@SupplyDrop:Assets/Main/Textures/Icons/ABloodBuffIcon.png"
                });
                AverageBloodBuff = BuffAPI.Add(averageBloodBuff);

                var strongBloodBuff = new CustomBuff(
                    new BuffDef
                {
                    canStack = false,
                    isDebuff = false,
                    name     = namePrefix + "StrongBloodBuff",
                    iconPath = "@SupplyDrop:Assets/Main/Textures/Icons/SBloodBuffIcon.png"
                });
                StrongBloodBuff = BuffAPI.Add(strongBloodBuff);

                var insaneBloodBuff = new CustomBuff(
                    new BuffDef
                {
                    canStack = false,
                    isDebuff = false,
                    name     = namePrefix + "InsaneBloodBuff",
                    iconPath = "@SupplyDrop:Assets/Main/Textures/Icons/IBloodBuffIcon.png"
                });
                InsaneBloodBuff = BuffAPI.Add(insaneBloodBuff);

                var devotedBloodBuff = new CustomBuff(
                    new BuffDef
                {
                    canStack = false,
                    isDebuff = false,
                    name     = namePrefix + "DevotedBloodBuff",
                    iconPath = "@SupplyDrop:Assets/Main/Textures/Icons/DBloodBuffIcon.png"
                });
                DevotedBloodBuff = BuffAPI.Add(devotedBloodBuff);
            };
        }
Exemplo n.º 19
0
        private void Awake()
        {
            _logger = Logger;
            using (var stream = Assembly.GetExecutingAssembly().GetManifestResourceStream("ArtifactOfDoom.artifactofdoom"))
            {
                var bundle   = AssetBundle.LoadFromStream(stream);
                var provider = new AssetBundleResourcesProvider("@ArtifactOfDoom", bundle);
                ResourcesAPI.AddProvider(provider);
            }

            cfgFile = new ConfigFile(Path.Combine(Paths.ConfigPath, ModGuid + ".cfg"), true);

            masterItemList = ItemBoilerplate.InitAll("ArtifactOfDoom");
            foreach (ItemBoilerplate x in masterItemList)
            {
                x.SetupConfig(cfgFile);
            }

            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"));

            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", "CaptainMultiplierForTimedBuff"), 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"));



            int longestName = 0;

            foreach (ItemBoilerplate x in masterItemList)
            {
                x.SetupAttributes("ARTDOOM", "ADOOM");
                if (x.itemCodeName.Length > longestName)
                {
                    longestName = x.itemCodeName.Length;
                }
            }

            Logger.LogMessage("Index dump follows (pairs of name / index):");
            foreach (ItemBoilerplate x in masterItemList)
            {
                if (x is Artifact afct)
                {
                    Logger.LogMessage(" Artifact ADOOM" + x.itemCodeName.PadRight(longestName) + " / " + ((int)afct.regIndex).ToString());
                }
                else
                {
                    Logger.LogMessage("Other ADOOM" + x.itemCodeName.PadRight(longestName) + " / N/A");
                }
            }

            var didLoseItem = new R2API.CustomBuff("didLoseItem", "", Color.black, false, false);

            buffIndexDidLoseItem = BuffAPI.Add(didLoseItem);
            foreach (ItemBoilerplate x in masterItemList)
            {
                x.SetupBehavior();
            }
            //On.RoR2.UI.HUD.Awake +=myFunc
            // ArtifactOfDoomUI test = new ArtifactOfDoomUI();
        }
Exemplo n.º 20
0
        public override void SetupAttributes()
        {
            if (ItemBodyModelPrefab == null)
            {
                ItemBodyModelPrefab = Resources.Load <GameObject>("@SupplyDrop:Assets/Main/Models/Prefabs/BloodBookTracker.prefab");
                ItemFollowerPrefab  = Resources.Load <GameObject>(modelResourcePath);
                displayRules        = GenerateItemDisplayRules();
            }
            base.SetupAttributes();

            var patheticBloodBuff = new CustomBuff(
                new BuffDef
            {
                canStack = false,
                isDebuff = false,
                name     = "PatheticBloodBuff",
                iconPath = "@SupplyDrop:Assets/Main/Textures/Icons/BloodBookBuffIcon1.png"
            });

            PatheticBloodBuff = BuffAPI.Add(patheticBloodBuff);

            var weakBloodBuff = new CustomBuff(
                new BuffDef
            {
                canStack = false,
                isDebuff = false,
                name     = "WeakBloodBuff",
                iconPath = "@SupplyDrop:Assets/Main/Textures/Icons/BloodBookBuffIcon2.png"
            });

            WeakBloodBuff = BuffAPI.Add(weakBloodBuff);

            var averageBloodBuff = new R2API.CustomBuff(
                new BuffDef
            {
                canStack = false,
                isDebuff = false,
                name     = "AverageBloodBuff",
                iconPath = "@SupplyDrop:Assets/Main/Textures/Icons/BloodBookBuffIcon3.png"
            });

            AverageBloodBuff = BuffAPI.Add(averageBloodBuff);

            var strongBloodBuff = new CustomBuff(
                new BuffDef
            {
                canStack = false,
                isDebuff = false,
                name     = "StrongBloodBuff",
                iconPath = "@SupplyDrop:Assets/Main/Textures/Icons/BloodBookBuffIcon4.png"
            });

            StrongBloodBuff = BuffAPI.Add(strongBloodBuff);

            var insaneBloodBuff = new CustomBuff(
                new BuffDef
            {
                canStack = false,
                isDebuff = false,
                name     = "InsaneBloodBuff",
                iconPath = "@SupplyDrop:Assets/Main/Textures/Icons/BloodBookBuffIcon5.png"
            });

            InsaneBloodBuff = BuffAPI.Add(insaneBloodBuff);

            var devotedBloodBuff = new CustomBuff(
                new BuffDef
            {
                canStack = false,
                isDebuff = false,
                name     = "DevotedBloodBuff",
                iconPath = "@SupplyDrop:Assets/Main/Textures/Icons/BloodBookBuffIcon6.png"
            });

            DevotedBloodBuff = BuffAPI.Add(devotedBloodBuff);
            ranges           = new Range[]
            {
                new Range(0, 10, PatheticBloodBuff, 4),
                new Range(10, 20, WeakBloodBuff, 6),
                new Range(20, 30, AverageBloodBuff, 8),
                new Range(30, 40, StrongBloodBuff, 10),
                new Range(40, 50, InsaneBloodBuff, 12),
                new Range(50, double.PositiveInfinity, DevotedBloodBuff, 14)
            };
        }