Esempio n. 1
0
        public override void SetupAttributes()
        {
            base.SetupAttributes();

            gupDebuff = ScriptableObject.CreateInstance <ItemDef>();
            gupDebuff.deprecatedTier   = ItemTier.NoTier;
            gupDebuff.canRemove        = false;
            gupDebuff.hidden           = true;
            gupDebuff.nameToken        = "TKSAT_INTERNAL_GUPRAY_COUNTER";
            gupDebuff.loreToken        = "";
            gupDebuff.descriptionToken = "";
            gupDebuff.pickupToken      = "";
            gupDebuff.name             = "TkSatInternalGupRayCounter";
            gupDebuff.tags             = new ItemTag[] { };
            ContentAddition.AddItemDef(gupDebuff);

            itemDef.requiredExpansion = Addressables.LoadAssetAsync <ExpansionDef>("RoR2/DLC1/Common/DLC1.asset")
                                        .WaitForCompletion();

            On.RoR2.ItemCatalog.SetItemRelationships += (orig, providers) => {
                var isp = ScriptableObject.CreateInstance <ItemRelationshipProvider>();
                isp.relationshipType = DLC1Content.ItemRelationshipTypes.ContagiousItem;
                isp.relationships    = new[] { new ItemDef.Pair {
                                                   itemDef1 = ShrinkRay.instance.itemDef,
                                                   itemDef2 = itemDef
                                               } };
                orig(providers.Concat(new[] { isp }).ToArray());
            };
        }