예제 #1
0
        public override void SetupAttributes()
        {
            base.SetupAttributes();

            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 = DamageBuffer.instance.itemDef,
                                                   itemDef2 = itemDef
                                               } };
                orig(providers.Concat(new[] { isp }).ToArray());
            };

            damageType = DamageAPI.ReserveDamageType();
        }
예제 #2
0
 private static void SetupModdedDamageTypes()
 {
     OriginalPoisonOnHit = DamageAPI.ReserveDamageType();
 }
예제 #3
0
        public override void OnLoad()
        {
            base.OnLoad();
            itemDef.name = "MysticsItems_MarwanAsh1";
            SetItemTierWhenAvailable(ItemTier.Tier1);
            itemDef.tags = new ItemTag[]
            {
                ItemTag.Damage
            };
            itemDef.pickupModelPrefab = PrepareModel(Main.AssetBundle.LoadAsset <GameObject>("Assets/Items/Marwan's Ash/Level 1/Model.prefab"));
            itemDef.pickupIconSprite  = Main.AssetBundle.LoadAsset <Sprite>("Assets/Items/Marwan's Ash/Level 1/Icon.png");

            HopooShaderToMaterial.Standard.Gloss(itemDef.pickupModelPrefab.GetComponentInChildren <Renderer>().sharedMaterial, 0f, 0f);
            itemDisplayPrefab = PrepareItemDisplayModel(PrefabAPI.InstantiateClone(itemDef.pickupModelPrefab, itemDef.pickupModelPrefab.name + "Display", false));
            onSetupIDRS      += () =>
            {
                AddDisplayRule("CommandoBody", "Chest", new Vector3(-0.14107F, 0.41961F, -0.09729F), new Vector3(344.2867F, 352.4422F, 26.10075F), new Vector3(0.08115F, 0.08115F, 0.08115F));
                AddDisplayRule("HuntressBody", "Chest", new Vector3(0.1801F, 0.27333F, 0.03185F), new Vector3(59.40007F, 154.4985F, 40.1367F), new Vector3(0.06552F, 0.06552F, 0.06552F));
                AddDisplayRule("Bandit2Body", "Chest", new Vector3(-0.1721F, 0.35699F, -0.10153F), new Vector3(313.5005F, 16.6744F, 2.4313F), new Vector3(0.06943F, 0.06943F, 0.06943F));
                AddDisplayRule("ToolbotBody", "Chest", new Vector3(1.75971F, 2.50135F, -0.23376F), new Vector3(0.68769F, 167.9512F, 0.30914F), new Vector3(0.70768F, 0.70768F, 0.70768F));
                AddDisplayRule("EngiBody", "Chest", new Vector3(0.32528F, 0.37407F, 0.02454F), new Vector3(12.57164F, 341.853F, 318.3862F), new Vector3(0.08925F, 0.08925F, 0.08925F));
                AddDisplayRule("EngiTurretBody", "Head", new Vector3(-0.47253F, 0.72168F, 0.45966F), new Vector3(0F, 0F, 0F), new Vector3(0.29536F, 0.29536F, 0.29536F));
                AddDisplayRule("EngiWalkerTurretBody", "Head", new Vector3(-0.40498F, 1.38227F, -0.21354F), new Vector3(344.6207F, 123.1186F, 356.0743F), new Vector3(0.33715F, 0.33715F, 0.33715F));
                AddDisplayRule("MageBody", "Chest", new Vector3(0.11005F, 0.334F, -0.06138F), new Vector3(0.00199F, 164.9891F, 11.62114F), new Vector3(0.086F, 0.086F, 0.086F));
                AddDisplayRule("MercBody", "Chest", new Vector3(0.18738F, 0.27546F, -0.05652F), new Vector3(342.8367F, 235.8891F, 41.57959F), new Vector3(0.093F, 0.093F, 0.093F));
                AddDisplayRule("TreebotBody", "FlowerBase", new Vector3(0F, 0.42869F, 0F), new Vector3(0F, 0F, 0F), new Vector3(0.46827F, 0.46827F, 0.46827F));
                AddDisplayRule("LoaderBody", "MechBase", new Vector3(0.09611F, 0.46037F, -0.07509F), new Vector3(358.2845F, 247.987F, 3.11198F), new Vector3(0.09269F, 0.09269F, 0.09269F));
                AddDisplayRule("CrocoBody", "SpineChest1", new Vector3(1.41028F, -0.26767F, -0.19958F), new Vector3(308.9953F, 7.03499F, 320.0229F), new Vector3(1.0009F, 1.0009F, 1.0009F));
                AddDisplayRule("CaptainBody", "Chest", new Vector3(-0.38388F, 0.39949F, -0.01551F), new Vector3(15.849F, 346.474F, 26.10147F), new Vector3(0.10616F, 0.10616F, 0.10616F));
                AddDisplayRule("BrotherBody", "chest", BrotherInfection.white, new Vector3(-0.22101F, 0.42643F, -0.064F), new Vector3(0F, 0F, 281.5435F), new Vector3(0.04683F, 0.09274F, 0.10516F));
                AddDisplayRule("ScavBody", "Chest", new Vector3(9.15645F, 0.11521F, -0.43519F), new Vector3(305.6901F, 285.3795F, 356.474F), new Vector3(2.5856F, 2.65682F, 2.5856F));
                if (SoftDependencies.SoftDependenciesCore.itemDisplaysSniper)
                {
                    AddDisplayRule("SniperClassicBody", "Chest", new Vector3(0.11749F, 0.41517F, -0.24199F), new Vector3(0.37534F, 284.0059F, 0.99266F), new Vector3(0.07834F, 0.07834F, 0.07834F));
                }
                AddDisplayRule("RailgunnerBody", "Chest", new Vector3(0.17061F, 0.14475F, -0.02294F), new Vector3(356.5987F, 19.29597F, 326.4724F), new Vector3(0.06946F, 0.06946F, 0.06946F));
                AddDisplayRule("VoidSurvivorBody", "UpperArmL", new Vector3(0.07068F, 0.07111F, -0.00293F), new Vector3(356.8744F, 349.4176F, 253.7303F), new Vector3(0.10579F, 0.10579F, 0.10579F));
            };

            GenericGameEvents.OnHitEnemy             += GenericGameEvents_OnHitEnemy;
            CharacterBody.onBodyStartGlobal          += CharacterBody_onBodyStartGlobal;
            On.RoR2.CharacterBody.OnInventoryChanged += CharacterBody_OnInventoryChanged;
            GlobalEventManager.onCharacterLevelUp    += GlobalEventManager_onCharacterLevelUp;

            ashDamageType = DamageAPI.ReserveDamageType();

            ashHitVFX = Main.AssetBundle.LoadAsset <GameObject>("Assets/Items/Marwan's Ash/Level 1/AshHitVFX.prefab");
            ashHitVFX.AddComponent <EffectComponent>();
            VFXAttributes vfxAttributes = ashHitVFX.AddComponent <VFXAttributes>();

            vfxAttributes.vfxIntensity = VFXAttributes.VFXIntensity.Low;
            vfxAttributes.vfxPriority  = VFXAttributes.VFXPriority.Low;
            ashHitVFX.AddComponent <DestroyOnTimer>().duration = 2f;
            ashHitVFX.transform.localScale *= 2f;
            MysticsItemsContent.Resources.effectPrefabs.Add(ashHitVFX);

            RoR2Application.onLoad += () =>
            {
                MysticsItemsMarwanAshHelper.level2PickupIndex = PickupCatalog.FindPickupIndex(MysticsItemsContent.Items.MysticsItems_MarwanAsh2.itemIndex);
                MysticsItemsMarwanAshHelper.level3PickupIndex = PickupCatalog.FindPickupIndex(MysticsItemsContent.Items.MysticsItems_MarwanAsh3.itemIndex);
            };
        }