Exemplo n.º 1
0
        private static void AddExtraShrineRollItem()
        {
            var ExtraShrineRollItemDef = new ItemDef
            {
                name             = "ExtraShrineRoll",
                tier             = ItemTier.Tier2,
                pickupModelPath  = LuckyItems.ModPrefix + "Assets/Items/ShrineItem/shrine_item.prefab",
                pickupIconPath   = LuckyItems.ModPrefix + "Assets/Items/ShrineItem/shrine_item_pic.png",
                nameToken        = "EXTRASHRINEROLL_NAME",
                pickupToken      = "EXTRASHRINEROLL_PICKUP",
                descriptionToken = "EXTRASHRINEROLL_DESC",
                loreToken        = "EXTRASHRINEROLL_LORE",
                tags             = new[]
                {
                    ItemTag.Utility,
                    ItemTag.AIBlacklist
                }
            };

            ItemDisplayRule[] itemDisplayRules = new ItemDisplayRule[0];

            var extraShrineRoll = new R2API.CustomItem(ExtraShrineRollItemDef, itemDisplayRules);

            ExtraShrineRollItemIndex = ItemAPI.Add(extraShrineRoll); // ItemAPI sends back the ItemIndex of your item
        }
Exemplo n.º 2
0
            private static void VialAsItem()
            {
                LanguageAPI.Add("VIAL_NAME_TOKEN", "Mysterious Vial");
                LanguageAPI.Add("VIAL_PICKUP_TOKEN", "Increased health regeneration.");
                LanguageAPI.Add("VIAL_DESCRIPTION_TOKEN", "Gain <style=cIsHealing>1.2</style> <style=cStack>(+1.2 per stack)</style>HP regen/s.");
                LanguageAPI.Add("VIAL_LORE_TOKEN", "Apply to skin for a rapidly acting gel that contains both antiseptics and an agent to encourage protein synthesis!");
                LanguageAPI.Add("VIAL_NAME_TOKEN", "神秘药剂", "zh-CN");
                LanguageAPI.Add("VIAL_PICKUP_TOKEN", "增加生命值再生速度", "zh-CN");
                LanguageAPI.Add("VIAL_DESCRIPTION_TOKEN", "使<style=cIsHealing>基础生命值再生速度</style>提高<style=cIsHealing>1.2hp/s</style><style=cStack>(每层增加1.2hp/s)</style>。", "zh-CN");
                LanguageAPI.Add("VIAL_LORE_TOKEN", "涂在皮肤上,可快速作用,同时含有防腐剂和促进蛋白质合成的物质!", "zh-CN");

                ItemDef VialDef = new ItemDef
                {
                    name             = "VIAL_NAME_TOKEN",
                    pickupIconPath   = IconPath,
                    pickupModelPath  = PrefabPath,
                    nameToken        = "VIAL_NAME_TOKEN",
                    pickupToken      = "VIAL_PICKUP_TOKEN",
                    descriptionToken = "VIAL_DESCRIPTION_TOKEN",
                    loreToken        = "VIAL_LORE_TOKEN",
                    tier             = ItemTier.Tier1,
                    tags             = new ItemTag[]
                    {
                        ItemTag.Healing
                    }
                };

                ItemDisplayRule[] DisplayRules = null;
                CustomItem        VialItem     = new CustomItem(VialDef, DisplayRules);

                VialItemIndex = ItemAPI.Add(VialItem);
            }
Exemplo n.º 3
0
        public BulletTimer()
        {
            var equipDef = new EquipmentDef
            {
                cooldown         = 40f,
                pickupModelPath  = UmbrellaAssets.PrefabBulletTimer,
                pickupIconPath   = UmbrellaAssets.IconBulletTimer,
                nameToken        = EquipNames.BulletTimer,
                descriptionToken = "Bullet Timer",
                pickupToken      = "Bullet Timer",
                canDrop          = true,
                enigmaCompatible = true
            };

            var rule = new ItemDisplayRule
            {
                ruleType       = ItemDisplayRuleType.ParentedPrefab,
                followerPrefab = UmbrellaAssets.BulletTimerPrefab,
                childName      = "Chest",
                localScale     = new Vector3(0.15f, 0.15f, 0.15f),
                localAngles    = new Vector3(0f, 180f, 0f),
                localPos       = new Vector3(-0.35f, -0.1f, 0f)
            };

            var equip = new CustomEquipment(equipDef, new[] { rule });

            EquipIndex = (EquipmentIndex)ItemAPI.AddCustomEquipment(equip);

            IL.RoR2.Projectile.ProjectileManager.FireProjectileServer += ProjectileManagerOnFireProjectileServer;
            _startTime = float.NaN;
        }
Exemplo n.º 4
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.º 5
0
        private static void LoadExtMag()
        {
            ExtendedMagItemDef = new ItemDef
            {
                name = "ExtMag",
                tier = ItemTier.Tier2,
                pickupModelPrefab = ExtendedMagPrefab,
                pickupIconSprite  = ExtendedMagIcon,
                nameToken         = "EXTMAG_NAME",
                pickupToken       = "EXTMAG_PICKUP",
                descriptionToken  = "EXTMAG_DESC",
                loreToken         = "EXTMAG_LORE",
                tags = new[]
                {
                    ItemTag.AIBlacklist,
                    ItemTag.Utility
                }
            };

            var itemDisplayRules = new ItemDisplayRule[1];

            itemDisplayRules[0].followerPrefab = ExtendedMagPrefab;
            itemDisplayRules[0].childName      = "Waist";
            itemDisplayRules[0].localScale     = new Vector3(0.15f, 0.15f, 0.15f);
            itemDisplayRules[0].localAngles    = new Vector3(0f, 180f, 0f);
            itemDisplayRules[0].localPos       = new Vector3(-0.35f, -0.1f, 0f);

            var bagoMoney = new R2API.CustomItem(ExtendedMagItemDef, itemDisplayRules);

            ItemAPI.Add(bagoMoney);
        }
Exemplo n.º 6
0
        private static void BiscoLeashAsRedTierItem()
        {
            BiscoLeashItemDef = new ItemDef
            {
                name = "BiscosLeash", // its the internal name, no spaces, apostrophes and stuff like that
                tier = ItemTier.Tier3,
                pickupModelPrefab = BiscoLeashPrefab,
                pickupIconSprite  = BiscoLeashIcon,
                nameToken         = "BISCOLEASH_NAME", // stylised name
                pickupToken       = "BISCOLEASH_PICKUP",
                descriptionToken  = "BISCOLEASH_DESC",
                loreToken         = "BISCOLEASH_LORE",
                tags = new[]
                {
                    ItemTag.Utility,
                    ItemTag.Damage
                }
            };

            var itemDisplayRules = new ItemDisplayRule[1];                         // keep this null if you don't want the item to show up on the survivor 3d model. You can also have multiple rules !

            itemDisplayRules[0].followerPrefab = BiscoLeashPrefab;                 // the prefab that will show up on the survivor
            itemDisplayRules[0].childName      = "Chest";                          // this will define the starting point for the position of the 3d model, you can see what are the differents name available in the prefab model of the survivors
            itemDisplayRules[0].localScale     = new Vector3(0.15f, 0.15f, 0.15f); // scale the model
            itemDisplayRules[0].localAngles    = new Vector3(0f, 180f, 0f);        // rotate the model
            itemDisplayRules[0].localPos       = new Vector3(-0.35f, -0.1f, 0f);   // position offset relative to the childName, here the survivor Chest

            var biscoLeash = new R2API.CustomItem(BiscoLeashItemDef, itemDisplayRules);

            ItemAPI.Add(biscoLeash); // ItemAPI sends back the ItemIndex of your item
        }
Exemplo n.º 7
0
        private static void LeechAsEquip()
        {
            LanguageAPI.Add("MASSIVELEECH_NAME_TOKEN", "Massive Leech");
            LanguageAPI.Add("MASSIVELEECH_PICKUP_TOKEN", "Grant massive life on hit for 10 seconds.Heal will increase with your level up.");
            LanguageAPI.Add("MASSIVELEECH_DESCRIPTION_TOKEN", "For 10 seconds, every hit <style=cIsHealing>heals</style> you for <style=cIsHealing>10 health</style>. Each level will gain <style=cIsHealing>1 extra health</style>.");
            LanguageAPI.Add("MASSIVELEECH_LORE_TOKEN", @"- Shipping Method:  Volatile
- Order Details:  Giant leeches found in the pools of HYPERION-5. Very similar to its counterpart on Earth, but it seems to have developed teeth as well, allowing it to eat meat as well as siphon blood. A few have been spotted to ballon to enormous proportions,up to the size of a small dog. Like the common leech, this has obvious medical implications. You will just have to be extra careful, or you may come back to no patient and a giant bloody leech.
");
            LanguageAPI.Add("MASSIVELEECH_NAME_TOKEN", "庞大水蛭", "zh-CN");
            LanguageAPI.Add("MASSIVELEECH_PICKUP_TOKEN", "在10秒内,攻击汲取巨额生命。吸血值随等级上涨。", "zh-CN");
            LanguageAPI.Add("MASSIVELEECH_DESCRIPTION_TOKEN", "10秒内,每次攻击<style=cIsHealing>回复10点生命值</style>。人物每提升一级,就额外获得<style=cIsHealing>1点生命值</style>。", "zh-CN");
            LanguageAPI.Add("MASSIVELEECH_LORE_TOKEN", @"- 邮寄方式:易挥发
- 订单详细信息:在HYPERION-5的水池中发现了巨型水蛭。 它与地球上的对应物非常相似,但它似乎也有牙齿,可以吃肉和虹吸血。已经发现他们可以按比例放大,甚至可以达到狗的大小。 像普通的水蛭一样,这也具有明显的医学含义。 您只需要格外小心。
", "zh-CN");

            EquipmentDef LeechEquipmentDef = new EquipmentDef
            {
                name             = "MASSIVELEECH_NAME_TOKEN",
                cooldown         = 45f,
                pickupModelPath  = PrefabPath,
                pickupIconPath   = IconPath,
                nameToken        = "MASSIVELEECH_NAME_TOKEN",
                pickupToken      = "MASSIVELEECH_PICKUP_TOKEN",
                descriptionToken = "MASSIVELEECH_DESCRIPTION_TOKEN",
                loreToken        = "MASSIVELEECH_LORE_TOKEN",
                canDrop          = true,
                enigmaCompatible = true
            };

            ItemDisplayRule[] LeechDisplayRules = null;
            CustomEquipment   LeechEquipment    = new CustomEquipment(LeechEquipmentDef, LeechDisplayRules);

            MassiveLeechIndex = ItemAPI.Add(LeechEquipment);
        }
Exemplo n.º 8
0
        private static void AddExtraItemPickupItem()
        {
            var ExtraItemPickupItemDef = new ItemDef
            {
                name             = "ExtraItemPickup",
                tier             = ItemTier.Tier3,
                pickupModelPath  = LuckyItems.ModPrefix + "Assets/Items/OnPickupItem/pickup_item.prefab",
                pickupIconPath   = LuckyItems.ModPrefix + "Assets/Items/OnPickupItem/pickup_item_pic.png",
                nameToken        = "EXTRAITEMPICKUP_NAME",
                pickupToken      = "EXTRAITEMPICKUP_PICKUP",
                descriptionToken = "EXTRAITEMPICKUP_DESC",
                loreToken        = "EXTRAITEMPICKUP_LORE",
                tags             = new[]
                {
                    ItemTag.Utility,
                    ItemTag.AIBlacklist
                }
            };

            ItemDisplayRule[] itemDisplayRules = new ItemDisplayRule[0];

            var ExtraItemPickup = new R2API.CustomItem(ExtraItemPickupItemDef, itemDisplayRules);

            ExtraItemPickupItemIndex = ItemAPI.Add(ExtraItemPickup);
        }
Exemplo n.º 9
0
            private static void ArmsRaceAsItem()
            {
                LanguageAPI.Add("ARMSRACE_NAME_TOKEN", "Arms Race");
                LanguageAPI.Add("ARMSRACE_PICKUP_TOKEN", "Drones are equipped with explosive weaponry.");
                LanguageAPI.Add("ARMSRACE_DESCRIPTION_TOKEN", "On drone action: <style=cIsDamage>15%</style> chance for drones and turrets to fire <style=cIsDamage>missiles</style>, deals <style=cIsDamage>300%</style> <style=cStack>(300% per stack)</style>damage.");
                LanguageAPI.Add("ARMSRACE_LORE_TOKEN", "Drones are equipped with explosive weaponry.");
                LanguageAPI.Add("ARMSRACE_NAME_TOKEN", "军备竞赛", "zh-CN");
                LanguageAPI.Add("ARMSRACE_PICKUP_TOKEN", "无人机装备了爆炸性武器", "zh-CN");
                LanguageAPI.Add("ARMSRACE_DESCRIPTION_TOKEN", "无人机和炮塔有15%概率发射导弹,造成<style=cIsDamage>300%</style><style=cStack>(每层增加300%)</style>的伤害。", "zh-CN");
                LanguageAPI.Add("ARMSRACE_LORE_TOKEN", "无人机被爆炸性武器武装了起来。", "zh-CN");

                ItemDef ArmsRaceDef = new ItemDef
                {
                    name             = "ARMSRACE_NAME_TOKEN",
                    pickupIconPath   = IconPath,
                    pickupModelPath  = PrefabPath,
                    nameToken        = "ARMSRACE_NAME_TOKEN",
                    pickupToken      = "ARMSRACE_PICKUP_TOKEN",
                    descriptionToken = "ARMSRACE_DESCRIPTION_TOKEN",
                    loreToken        = "ARMSRACE_LORE_TOKEN",
                    tier             = ItemTier.Tier2,
                    tags             = new ItemTag[]
                    {
                        ItemTag.Damage,
                        ItemTag.Utility
                    }
                };

                ItemDisplayRule[] DisplayRules = null;
                CustomItem        ArmsRaceItem = new CustomItem(ArmsRaceDef, DisplayRules);

                ArmsRaceItemIndex = ItemAPI.Add(ArmsRaceItem);
            }
Exemplo n.º 10
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.º 11
0
        protected void Init(ItemTemplate itemTemplate)
        {
            PrefabPath = $"{MoreItems.ModPrefix}Assets/{itemTemplate.internalName}.prefab";
            IconPath   = $"{MoreItems.ModPrefix}Assets/{itemTemplate.internalName}.png";



            Prefab = MoreItems.bundle.LoadAsset <GameObject>($"Assets/{itemTemplate.internalName}.prefab");

            var itemDef = new ItemDef
            {
                name             = itemTemplate.internalName,
                tier             = itemTemplate.tier,
                pickupModelPath  = PrefabPath,
                pickupIconPath   = IconPath,
                nameToken        = $"{itemTemplate.internalName}_NAME",
                pickupToken      = $"{itemTemplate.internalName}_PICKUP",
                descriptionToken = $"{itemTemplate.internalName}_DESC",
                loreToken        = $"{itemTemplate.internalName}_LORE",
                tags             = itemTemplate.tags ?? new ItemTag[] { }
            };


            ItemIndex = ItemAPI.Add(new R2API.CustomItem(itemDef, itemTemplate.itemDisplayRules));

            R2API.LanguageAPI.Add(itemDef.nameToken, itemTemplate.name);
            R2API.LanguageAPI.Add(itemDef.pickupToken, itemTemplate.pickupText);
            R2API.LanguageAPI.Add(itemDef.descriptionToken, itemTemplate.descriptionText);
            R2API.LanguageAPI.Add(itemDef.loreToken, itemTemplate.loreText);
        }
Exemplo n.º 12
0
        public override void SetupAttributes()
        {
            base.SetupAttributes();

            markDebuff            = ScriptableObject.CreateInstance <BuffDef>();
            markDebuff.buffColor  = Color.yellow;
            markDebuff.canStack   = false;
            markDebuff.isDebuff   = true;
            markDebuff.name       = modInfo.shortIdentifier + "HitListDebuff";
            markDebuff.iconSprite = ClassicItemsPlugin.resources.LoadAsset <Sprite>("Assets/ClassicItems/Textures/ClassicIcons/hitlist_debuff_icon.png");
            ContentAddition.AddBuffDef(markDebuff);

            tallyBuff            = ScriptableObject.CreateInstance <BuffDef>();
            tallyBuff.buffColor  = Color.yellow;
            tallyBuff.canStack   = true;
            tallyBuff.isDebuff   = false;
            tallyBuff.name       = modInfo.shortIdentifier + "HitListBuff";
            tallyBuff.iconSprite = ClassicItemsPlugin.resources.LoadAsset <Sprite>("Assets/ClassicItems/Textures/ClassicIcons/hitlist_buff_icon.png");
            ContentAddition.AddBuffDef(tallyBuff);

            hitListTally                  = ScriptableObject.CreateInstance <ItemDef>();
            hitListTally.hidden           = true;
            hitListTally.name             = modInfo.shortIdentifier + "INTERNALTally";
            hitListTally.deprecatedTier   = ItemTier.NoTier;
            hitListTally.canRemove        = false;
            hitListTally.nameToken        = "";
            hitListTally.pickupToken      = "";
            hitListTally.loreToken        = "";
            hitListTally.descriptionToken = "";
            ItemAPI.Add(new CustomItem(hitListTally, new ItemDisplayRuleDict()));
        }
Exemplo n.º 13
0
        public JestersDice()
        {
            _rng = new Xoroshiro128Plus((ulong)DateTime.Now.Ticks);

            var equipDef = new EquipmentDef
            {
                cooldown         = 30f,
                pickupModelPath  = UmbrellaAssets.PrefabJestersDice,
                pickupIconPath   = UmbrellaAssets.IconJestersDice,
                pickupToken      = "Jester's Dice",
                nameToken        = EquipNames.JestersDice,
                descriptionToken = "Jester's Dice",
                canDrop          = true,
                enigmaCompatible = true,
                isLunar          = true
            };

            var prefab = UmbrellaAssets.JestersDicePrefab;
            var rule   = new ItemDisplayRule
            {
                ruleType       = ItemDisplayRuleType.ParentedPrefab,
                followerPrefab = prefab,
                childName      = "Chest",
                localScale     = new Vector3(0.15f, 0.15f, 0.15f),
                localAngles    = new Vector3(0f, 180f, 0f),
                localPos       = new Vector3(-0.35f, -0.1f, 0f)
            };

            var equip = new CustomEquipment(equipDef, new[] { rule });

            EquipIndex = (EquipmentIndex)ItemAPI.AddCustomEquipment(equip);
        }
Exemplo n.º 14
0
        private static void RegisterEquipment()
        {
            EquipmentDef equipmentDef = new EquipmentDef
            {
                name             = "TempestuousRage",
                nameToken        = "LUNAR_AFFIX_NAME",
                pickupToken      = "LUNAR_AFFIX_PICK",
                descriptionToken = "LUNAR_AFFIX_DESC",
                loreToken        = "LUNAR_AFFIX_LORE",
                isBoss           = false,
                isLunar          = true,
                enigmaCompatible = false,
                canDrop          = true,
                colorIndex       = ColorCatalog.ColorIndex.LunarItem,
                cooldown         = 120f,
                pickupIconPath   = "@AffixGen:Assets/AffixGen/AffixLunar.png",
                pickupModelPath  = "@AffixGen:Assets/AffixGen/LunarAffix.prefab"
            };

            ItemDisplayRuleDict ruleDict = new ItemDisplayRuleDict();

            CustomEquipment equipment = new CustomEquipment(equipmentDef, ruleDict);

            index = ItemAPI.Add(equipment);
        }
Exemplo n.º 15
0
        public async Task <Embed> GetItem(ulong itemId)
        {
            Item item = await ItemAPI.Get(itemId);

            EmbedBuilder embed = item.ToEmbed();

            if (item.IsUntradable != 1)
            {
                (MarketAPI.History? hq, MarketAPI.History? nm) = await MarketAPI.GetBestPriceHistory("Elemental", itemId);

                if (hq != null | nm != null)
                {
                    StringBuilder builder = new StringBuilder();
                    if (hq != null)
                    {
                        builder.Append(hq.ToStringEx());
                    }

                    if (nm != null)
                    {
                        builder.Append(nm.ToStringEx());
                    }

                    embed.AddField("Best Market Board Prices", builder.ToString());
                }
            }

            return(embed.Build());
        }
Exemplo n.º 16
0
    public SCP()
    {
        {
            LanguageAPI.Add("SCP_ITEM_LORE_TOKEN", "Order: \u201C[REDACTED]\u201D\r\nTracking Number: [REDACTED]\r\nEstimated Delivery: [REDACTED]\r\nShipping Method: [REDACTED]\r\nShipping Address: [REDACTED], [REDACTED]\r\nShipping Details:\r\n\r\nSecure, contain, protect.\r\n");
            LanguageAPI.Add("SCP_ITEM_TOKEN", "[REDACTED]");
            LanguageAPI.Add("SCP_ITEM_DESCRIPTION_TOKEN", "[REDACTED]");
            LanguageAPI.Add("SCP_ITEM_PICKUP_TOKEN", "[REDACTED]");
            var itemDef = new ItemDef
            {
                pickupModelPath  = "Prefabs/PickupModels/PickupMystery",
                pickupIconPath   = "Textures/MiscIcons/texMysteryIcon",
                pickupToken      = "SCP_ITEM_PICKUP_TOKEN",
                nameToken        = "SCP_ITEM_TOKEN",
                descriptionToken = "SCP_ITEM_DESCRIPTION_TOKEN",
                name             = "SCP",
                loreToken        = "SCP_ITEM_LORE_TOKEN",
                tier             = ItemTier.Tier3
            };

            var prefab = Resources.Load <GameObject>("Prefabs/PickupModels/PickupMystery");

            var rule = new ItemDisplayRule
            {
                ruleType       = ItemDisplayRuleType.ParentedPrefab,
                followerPrefab = prefab,
                childName      = "Chest",
                localScale     = new Vector3(0f, 0, 0f),
                localAngles    = new Vector3(0f, 0f, 0f),
                localPos       = new Vector3(0, 0f, 0f)
            };

            var item = new CustomItem(itemDef, new[] { rule });
            itemIndex = ItemAPI.Add(item);
        };
    }
Exemplo n.º 17
0
            private static void ThalliumAsItem()
            {
                LanguageAPI.Add("THALLIUM_NAME_TOKEN", "Thallium");
                LanguageAPI.Add("THALLIUM_PICKUP_TOKEN", "Chance to slow and damage enemies over time.");
                LanguageAPI.Add("THALLIUM_DESCRIPTION_TOKEN", "<style=cIsDamage>10%</style> chance on hit to slow an enemy with a <style=cIsDamage>metal poisoning</style>, <style=cIsUtility>slowing</style> them by <style=cIsUtility>100%</style> and dealing <style=cIsDamage>600%</style> <style=cStack>(+600% per stack)</style> TOTAL damage.");
                LanguageAPI.Add("THALLIUM_LORE_TOKEN", "Shipping Method: High Priority / Fragile\r\nOrder Details: She shouldn't notice.");
                LanguageAPI.Add("THALLIUM_NAME_TOKEN", "铊", "zh-CN");
                LanguageAPI.Add("THALLIUM_PICKUP_TOKEN", "几率减速敌人,并且使敌人中毒。", "zh-CN");
                LanguageAPI.Add("THALLIUM_DESCRIPTION_TOKEN", "有<style=cIsDamage>10%</style> 几率使得敌人<style=cIsDamage>金属中毒</style>,并<style=cIsUtility>减速</style>其<style=cIsUtility>100%</style>,造成<style=cIsDamage>600%</style> <style=cStack>(每层增加600%)</style> 总伤害。", "zh-CN");
                LanguageAPI.Add("THALLIUM_LORE_TOKEN", "运输方式:高优先级 / 脆弱\r\n商品细节:她不会注意到的。", "zh-CN");

                ItemDef ThalliumDef = new ItemDef
                {
                    name             = "THALLIUM_NAME_TOKEN",
                    pickupIconPath   = IconPath,
                    pickupModelPath  = PrefabPath,
                    nameToken        = "THALLIUM_NAME_TOKEN",
                    pickupToken      = "THALLIUM_PICKUP_TOKEN",
                    descriptionToken = "THALLIUM_DESCRIPTION_TOKEN",
                    loreToken        = "THALLIUM_LORE_TOKEN",
                    tier             = ItemTier.Tier3,
                    tags             = new ItemTag[]
                    {
                        ItemTag.Damage
                    }
                };

                ItemDisplayRule[] DisplayRules = null;
                CustomItem        ThalliumItem = new CustomItem(ThalliumDef, DisplayRules);

                ThalliumItemIndex = ItemAPI.Add(ThalliumItem);
            }
Exemplo n.º 18
0
    public BrokenScepter()
    {
        {
            LanguageAPI.Add("BROKENSCEPTER_ITEM_TOKEN", "Broken scepter");
            LanguageAPI.Add("BROKENSCEPTER_ITEM_DESCRIPTION_TOKEN", "Gain unique benefits on level up.");
            LanguageAPI.Add("BROKENSCEPTER_ITEM_LORE_TOKEN", "Boy, her march is on the horizon. I ask of you, before my time is due, to unite the broken pieces, and return to me. Let the wrongs of the past be right.");
            LanguageAPI.Add("BROKENSCEPTER_ITEM_PICKUP_TOKEN", "Unite the broken pieces.");
            var itemDef = new ItemDef
            {
                pickupModelPath  = "Prefabs/PickupModels/PickupSoda",
                pickupIconPath   = "Textures/ItemIcons/texbirdeyeicon",
                pickupToken      = "BROKENSCEPTER_ITEM_PICKUP_TOKEN",
                nameToken        = "BROKENSCEPTER_ITEM_TOKEN",
                descriptionToken = "BROKENSCEPTER_ITEM_DESCRIPTION_TOKEN",
                loreToken        = "BROKENSCEPTER_ITEM_LORE_TOKEN",
                name             = "BrokenScepter",
                tier             = ItemTier.Tier3
            };

            var prefab = Resources.Load <GameObject>("Prefabs/PickupModels/PickupSoda");

            var rule = new ItemDisplayRule
            {
                ruleType       = ItemDisplayRuleType.ParentedPrefab,
                followerPrefab = prefab,
                childName      = "Chest",
                localScale     = new Vector3(0.15f, 0.15f, 0.15f),
                localAngles    = new Vector3(0f, 180f, 0f),
                localPos       = new Vector3(-0.35f, -0.1f, 0f)
            };

            var item = new CustomItem(itemDef, new[] { rule });
            itemIndex = ItemAPI.Add(item);
        };
    }
Exemplo n.º 19
0
        private static void BiscoLeashAsEquipment()
        {
            BiscoLeashEquipmentDef = new EquipmentDef
            {
                name              = "BiscosLeashEquipment", // its the internal name, no spaces, apostrophes and stuff like that
                cooldown          = 5f,
                pickupModelPrefab = BiscoLeashPrefab,
                pickupIconSprite  = BiscoLeashIcon,
                nameToken         = "BISCOLEASH_NAME", // stylised name
                pickupToken       = "BISCOLEASH_PICKUP",
                descriptionToken  = "BISCOLEASH_DESC",
                loreToken         = "BISCOLEASH_LORE",
                canDrop           = true,
                enigmaCompatible  = false
            };

            var itemDisplayRules = new ItemDisplayRule[1];                         // keep this null if you don't want the item to show up on the survivor 3d model. You can also have multiple rules !

            itemDisplayRules[0].followerPrefab = BiscoLeashPrefab;                 // the prefab that will show up on the survivor
            itemDisplayRules[0].childName      = "Chest";                          // this will define the starting point for the position of the 3d model, you can see what are the differents name available in the prefab model of the survivors
            itemDisplayRules[0].localScale     = new Vector3(0.15f, 0.15f, 0.15f); // scale the model
            itemDisplayRules[0].localAngles    = new Vector3(0f, 180f, 0f);        // rotate the model
            itemDisplayRules[0].localPos       = new Vector3(-0.35f, -0.1f, 0f);   // position offset relative to the childName, here the survivor Chest

            var biscoLeash = new CustomEquipment(BiscoLeashEquipmentDef, itemDisplayRules);

            ItemAPI.Add(biscoLeash);
        }
Exemplo n.º 20
0
        private async Task PopulateRecipe()
        {
            var _recipeIDs = await ItemAPI.SearchRecipesByOutput(ItemID);

            if (_recipeIDs?.Count > 0)                                                                  //Check for normal recipe
            {
                _recipes = await ItemAPI.Recipes(_recipeIDs);
            }

            /*else if (!ItemAPI.IsPromotionItem(ItemID)) {                                              //Check for Mystic Forge recipe
             *  var mysticForgeRecipes = await ItemAPI.SearchMysticForgeRecipesByOutput(ItemID);
             *
             *  if (mysticForgeRecipes?.Count > 0) {
             *      _recipe = mysticForgeRecipes[0];
             *      foreach (var recipe in mysticForgeRecipes) {
             *          _recipeIDs.Add(recipe.ID);
             *      }
             *  }
             * }*/
            /*else {                                                                                    //This should onlu occur when the item is a consumable recipe
             *  if (_item == null)
             *      _item = await ItemAPI.Items(ItemID);
             *
             *  if (_item?.Details != null && _item?.Details.RecipeID != 0) {
             *      _recipeIDs.Add(_item.Details.RecipeID);
             *      _recipe = await ItemAPI.Recipes(_item.Details.RecipeID);
             *  }
             * }*/
        }
Exemplo n.º 21
0
        protected void SetupItemDefinition()
        {
            if (AIBlacklisted)
            {
                ItemTags = new List <ItemTag>(ItemTags)
                {
                    ItemTag.AIBlacklist
                }.ToArray();
            }

            ItemDef                   = ScriptableObject.CreateInstance <ItemDef>();
            ItemDef.name              = "ITEM_" + ItemLangTokenName;
            ItemDef.nameToken         = "ITEM_" + ItemLangTokenName + "_NAME";
            ItemDef.pickupToken       = "ITEM_" + ItemLangTokenName + "_PICKUP";
            ItemDef.descriptionToken  = "ITEM_" + ItemLangTokenName + "_DESCRIPTION";
            ItemDef.loreToken         = "ITEM_" + ItemLangTokenName + "_LORE";
            ItemDef.pickupModelPrefab = ItemModel;
            ItemDef.pickupIconSprite  = ItemIcon;
            ItemDef.hidden            = false;
            ItemDef.canRemove         = CanRemove;
            ItemDef.tier              = Tier;

            if (ItemTags.Length > 0)
            {
                ItemDef.tags = ItemTags;
            }

            ItemAPI.Add(new CustomItem(ItemDef, CreateItemDisplayRules()));
        }
Exemplo n.º 22
0
        private static void AddRitualDagger()
        {
            var RitualDaggerItemDef = new ItemDef
            {
                name             = "RitualDagger", // its the internal name, no spaces, apostrophes and stuff like that
                tier             = ItemTier.Tier1,
                pickupModelPath  = PrefabPath + "dagger.prefab",
                pickupIconPath   = IconPath,
                nameToken        = "RitualDagger_NAME", // stylised name
                pickupToken      = "RitualDagger_PICKUP",
                descriptionToken = "RitualDagger_DESC",
                loreToken        = "RitualDagger_LORE",
                tags             = new[]
                {
                    ItemTag.Utility,
                    ItemTag.Damage
                }
            };

            ItemDisplayRule[] itemDisplayRules = null; // keep this null if you don't want the item to show up on the survivor 3d model. You can also have multiple rules !

            var RitualDagger = new R2API.CustomItem(RitualDaggerItemDef, itemDisplayRules);

            RitualDaggerItemIndex = ItemAPI.Add(RitualDagger); // ItemAPI sends back the ItemIndex of your item
        }
Exemplo n.º 23
0
        private static void LoadMagnifingGlass()
        {
            MagnifingGlassItemDef = new ItemDef
            {
                name = "MagnifyingGlass",
                tier = ItemTier.Tier3,
                pickupModelPrefab = MagnifingGlassPrefab,
                pickupIconSprite  = MagnifingGlassIcon,
                nameToken         = "MAGGLASS_NAME",
                pickupToken       = "MAGGLASS_PICKUP",
                descriptionToken  = "MAGGLASS_DESC",
                loreToken         = "MAGGLASS_LORE",
                tags = new[]
                {
                    ItemTag.AIBlacklist,
                    ItemTag.Utility
                }
            };

            var itemDisplayRules = new ItemDisplayRule[1];

            itemDisplayRules[0].followerPrefab = MagnifingGlassPrefab;
            itemDisplayRules[0].childName      = "Chest";
            itemDisplayRules[0].localScale     = new Vector3(0.15f, 0.15f, 0.15f);
            itemDisplayRules[0].localAngles    = new Vector3(0f, 180f, 0f);
            itemDisplayRules[0].localPos       = new Vector3(-0.35f, -0.1f, 0f);

            var biscoLeash = new R2API.CustomItem(MagnifingGlassItemDef, itemDisplayRules);

            ItemAPI.Add(biscoLeash);
        }
Exemplo n.º 24
0
        private static void ToughTimesAsItem()
        {
            LanguageAPI.Add("TOUGHTIMES_NAME_TOKEN", "Tough Times");
            LanguageAPI.Add("TOUGHTIMES_PICKUP_TOKEN", "Add Armor to reduce incoming damage.");
            LanguageAPI.Add("TOUGHTIMES_DESCRIPTION_TOKEN", "<style=cIsHealing>Increase armor</style> by <style=cIsHealing>14</style> <style=cStack>(+14 per stack)</style>.");
            LanguageAPI.Add("TOUGHTIMES_LORE_TOKEN", "- Order Details:\"Bears are just about the only toy that can lose just about everything and still maintain their dignity and worth.\" \r\n- Samantha Armstrong.Don't forget, hon. I'm coming home soon.Stay strong.");
            LanguageAPI.Add("TOUGHTIMES_NAME_TOKEN", "艰难时光", "zh-CN");
            LanguageAPI.Add("TOUGHTIMES_PICKUP_TOKEN", "提高自身护甲", "zh-CN");
            LanguageAPI.Add("TOUGHTIMES_DESCRIPTION_TOKEN", "<style=cIsHealing>提高护甲14点</style><style=cStack>(每层增加14点)</style>。", "zh-CN");
            LanguageAPI.Add("TOUGHTIMES_LORE_TOKEN", "-商品细节:“熊是唯一可以失去几乎所有东西并仍然保持其尊严和价值的玩具”。\r\n-萨曼莎·阿姆斯特朗:别忘了,亲爱的。我很快就要回家了。", "zh-CN");

            ItemDef ToughTimesDef = new ItemDef
            {
                name             = "TOUGHTIMES_NAME_TOKEN",
                pickupIconPath   = IconPath,
                pickupModelPath  = PrefabPath,
                nameToken        = "TOUGHTIMES_NAME_TOKEN",
                pickupToken      = "TOUGHTIMES_PICKUP_TOKEN",
                descriptionToken = "TOUGHTIMES_DESCRIPTION_TOKEN",
                loreToken        = "TOUGHTIMES_LORE_TOKEN",
                tier             = ItemTier.Tier2,
                tags             = new ItemTag[]
                {
                    ItemTag.Utility
                }
            };

            ItemDisplayRule[] DisplayRules   = null;
            CustomItem        ToughTimesItem = new CustomItem(ToughTimesDef, DisplayRules);

            ToughTimesItemIndex = ItemAPI.Add(ToughTimesItem);
        }
        private static void AmethystAsEquip()
        {
            R2API.AssetPlus.Languages.AddToken("AMETHYST_NAME_TOKEN", "Gigantic Amethyst");
            R2API.AssetPlus.Languages.AddToken("AMETHYST_PICKUP_TOKEN", "<style=cIsUtility>Reset</style> all your cooldowns.");
            R2API.AssetPlus.Languages.AddToken("AMETHYST_DESCRIPTION_TOKEN", "<style=cIsUtility>Reset</style> all your cooldowns on activation.");
            R2API.AssetPlus.Languages.AddToken("AMETHYST_LORE_TOKEN", "I highly suggest handling this thing with some form of protective gear; we're not sure if it has any effects on the human body.");
            EquipmentDef AmethystEquipmentDef = new EquipmentDef
            {
                name             = "AMETHYST_NAME_TOKEN",
                cooldown         = GiganticAmethyst.Cooldown.Value,
                pickupModelPath  = PrefabPath,
                pickupIconPath   = IconPath,
                nameToken        = "AMETHYST_NAME_TOKEN",
                pickupToken      = "AMETHYST_PICKUP_TOKEN",
                descriptionToken = "AMETHYST_DESCRIPTION_TOKEN",
                loreToken        = "AMETHYST_LORE_TOKEN",
                canDrop          = true,
                enigmaCompatible = true
            };

            ItemDisplayRule[] AmethystDisplayRules = null;

            CustomEquipment AmethystEquipment = new CustomEquipment(AmethystEquipmentDef, AmethystDisplayRules);

            AmethystEquipmentIndex = ItemAPI.Add(AmethystEquipment);
        }
Exemplo n.º 26
0
        public override void SetupAttributes()
        {
            base.SetupAttributes();

            var markDebuffDef = new CustomBuff(new BuffDef {
                buffColor = Color.yellow,
                canStack  = false,
                isDebuff  = true,
                name      = modInfo.shortIdentifier + "HitListDebuff",
                iconPath  = "@ClassicItems:Assets/ClassicItems/icons/hitlist_debuff_icon.png"
            });

            markDebuff = BuffAPI.Add(markDebuffDef);

            var tallyBuffDef = new CustomBuff(new BuffDef {
                buffColor = Color.yellow,
                canStack  = true,
                isDebuff  = false,
                name      = modInfo.shortIdentifier + "HitListBuff",
                iconPath  = "@ClassicItems:Assets/ClassicItems/icons/hitlist_buff_icon.png"
            });

            tallyBuff = BuffAPI.Add(tallyBuffDef);

            var hitListTallyDef = new CustomItem(new ItemDef {
                hidden    = true,
                name      = modInfo.shortIdentifier + "INTERNALTally",
                tier      = ItemTier.NoTier,
                canRemove = false
            }, new ItemDisplayRuleDict(null));

            hitListTally = ItemAPI.Add(hitListTallyDef);
        }
Exemplo n.º 27
0
 public void OnReward(int id)//帶入MissionID
 {
     SoundControll.Instance.PlayEffecSound(SoundControll.Instance.questComplete);
     ItemAPI.RewardItem(id);
     questRewardActive[id].SetActive(false);
     questClearActive[id].SetActive(true);
 }
Exemplo n.º 28
0
        public HitList()
        {
            onAttrib += (tokenIdent, namePrefix) => {
                var markDebuffDef = new CustomBuff(new BuffDef {
                    buffColor = Color.yellow,
                    canStack  = false,
                    isDebuff  = true,
                    name      = namePrefix + "HitListDebuff",
                    iconPath  = "@ClassicItems:Assets/ClassicItems/icons/hitlist_debuff_icon.png"
                });
                markDebuff = BuffAPI.Add(markDebuffDef);

                var tallyBuffDef = new CustomBuff(new BuffDef {
                    buffColor = Color.yellow,
                    canStack  = true,
                    isDebuff  = false,
                    name      = namePrefix + "HitListBuff",
                    iconPath  = "@ClassicItems:Assets/ClassicItems/icons/hitlist_buff_icon.png"
                });
                tallyBuff = BuffAPI.Add(tallyBuffDef);

                var hitListTallyDef = new CustomItem(new ItemDef {
                    hidden    = true,
                    name      = namePrefix + "INTERNALTally",
                    tier      = ItemTier.NoTier,
                    canRemove = false
                }, new ItemDisplayRuleDict(null));
                hitListTally = ItemAPI.Add(hitListTallyDef);
            };
        }
Exemplo n.º 29
0
        //The Awake() method is run at the very start when the game is initialized.
        public void Awake()
        {
            //First let's define our item
            myItemDef = new ItemDef
            {
                //More on these later
                nameToken        = "EXAMPLE_CLOAKONKILL_NAME",
                pickupToken      = "EXAMPLE_CLOAKONKILL_PICKUP",
                descriptionToken = "EXAMPLE_CLOAKONKILL_DESC",
                loreToken        = "EXAMPLE_CLOAKONKILL_LORE",
                //The tier determines what rarity the item is: Tier1=white, Tier2=green, Tier3=red, Lunar=Lunar, Boss=yellow, and finally NoTier is generally used for helper items, like the tonic affliction
                tier = ItemTier.Tier2,
                //You can create your own icons and prefabs through assetbundles, but to keep this boilerplate brief, we'll be using question marks.
                pickupIconPath  = "Textures/MiscIcons/texMysteryIcon",
                pickupModelPath = "Prefabs/PickupModels/PickupMystery",
                //Can remove determines if a shrine of order, or a printer can take this item, generally true, except for NoTier items.
                canRemove = true,
                //Hidden means that there will be no pickup notification, and it won't appear in the inventory at the top of the screen. This is useful for certain noTier helper items, such as the DrizzlePlayerHelper.
                hidden = false
            };
            //Now let's turn the tokens we made into actual strings for the game:
            AddTokens();

            //You can add your own display rules here, where the first argument passed are the default display rules: the ones used when no specific display rules for a character are found.
            //For this example, we are omitting them, as they are quite a pain to set up.
            var displayRules = new ItemDisplayRuleDict(null);

            //Then finally add it to R2API
            ItemAPI.Add(new CustomItem(myItemDef, displayRules));

            //But now we have defined an item, but it doesn't do anything yet. So we'll need to define that ourselves.
            GlobalEventManager.onCharacterDeathGlobal += GlobalEventManager_onCharacterDeathGlobal;
        }
Exemplo n.º 30
0
        private static void garbAsGreenTierItem(ItemDisplayRuleDict nullDisplay)
        {
            var garbItemDef = new ItemDef
            {
                name             = "Garb",
                nameToken        = "CLOAKONKILL_NAME",
                pickupToken      = "CLOAKONKILL_PICKUP",
                descriptionToken = "CLOAKONKILL_DESC",
                loreToken        = "CLOAKONKILL_LORE",
                tier             = ItemTier.Tier2,
                pickupIconPath   = ModPrefix + "Assets/Import/garb/garb.PNG",
                pickupModelPath  = ModPrefix + "Assets/Import/garb/garb.fbx",
                canRemove        = true,
                hidden           = false,
                tags             = new[]
                {
                    ItemTag.Utility,
                    ItemTag.OnKillEffect,
                    ItemTag.AIBlacklist
                }
            };

            var garb = new R2API.CustomItem(garbItemDef, nullDisplay);

            garbItemIndex = ItemAPI.Add(garb);
        }