private static void PopulateFromBody(string bodyName) { ItemDisplayRuleSet itemDisplayRuleSet = Resources.Load <GameObject>("Prefabs/CharacterBodies/" + bodyName + "Body").GetComponent <ModelLocator>().modelTransform.GetComponent <CharacterModel>().itemDisplayRuleSet; ItemDisplayRuleSet.KeyAssetRuleGroup[] item = itemDisplayRuleSet.keyAssetRuleGroups; for (int i = 0; i < item.Length; i++) { ItemDisplayRule[] rules = item[i].displayRuleGroup.rules; for (int j = 0; j < rules.Length; j++) { GameObject followerPrefab = rules[j].followerPrefab; if (followerPrefab) { string name = followerPrefab.name; string key = (name != null) ? name.ToLower() : null; if (!itemDisplayPrefabs.ContainsKey(key)) { itemDisplayPrefabs[key] = followerPrefab; } } } } }
internal static void PopulateDisplays() { ItemDisplayRuleSet itemDisplayRuleSet = LegacyResourcesAPI.Load <GameObject>("Prefabs/CharacterBodies/CommandoBody").GetComponent <ModelLocator>().modelTransform.GetComponent <CharacterModel>().itemDisplayRuleSet; ItemDisplayRuleSet.KeyAssetRuleGroup[] keyAssetRuleGroups = itemDisplayRuleSet.keyAssetRuleGroups; for (int i = 0; i < keyAssetRuleGroups.Length; i++) { ItemDisplayRule[] rules = keyAssetRuleGroups[i].displayRuleGroup.rules; for (int j = 0; j < rules.Length; j++) { GameObject followerPrefab = rules[j].followerPrefab; bool flag = followerPrefab; if (flag) { string name = followerPrefab.name; string key = (name != null) ? name.ToLower() : null; bool flag2 = !TemplarItemDisplays.itemDisplayPrefabs.ContainsKey(key); if (flag2) { TemplarItemDisplays.itemDisplayPrefabs[key] = followerPrefab; } } } } }
private void SetRazorwireDisplay(Vector3 position, Vector3 rotation, Vector3 scale) { ItemDisplayRuleSet ruleset = this.model.itemDisplayRuleSet; ruleset.FindItemDisplayRuleGroup("Thorns").rules[0].localPos = position; ruleset.FindItemDisplayRuleGroup("Thorns").rules[0].localAngles = rotation; ruleset.FindItemDisplayRuleGroup("Thorns").rules[0].localScale = scale; }
private void SetDaggerDisplay(GameObject displayPrefab, Vector3 position, Vector3 rotation, Vector3 scale) { ItemDisplayRuleSet ruleset = this.model.itemDisplayRuleSet; ruleset.FindItemDisplayRuleGroup("BleedOnHit").rules[0].followerPrefab = displayPrefab; ruleset.FindItemDisplayRuleGroup("BleedOnHit").rules[0].localPos = position; ruleset.FindItemDisplayRuleGroup("BleedOnHit").rules[0].localAngles = rotation; ruleset.FindItemDisplayRuleGroup("BleedOnHit").rules[0].localScale = scale; }
private void SetAegisDisplay(GameObject displayPrefab, string childName, Vector3 position, Vector3 rotation, Vector3 scale) { ItemDisplayRuleSet ruleset = this.model.itemDisplayRuleSet; ruleset.FindItemDisplayRuleGroup("BarrierOnOverHeal").rules[0].followerPrefab = displayPrefab; ruleset.FindItemDisplayRuleGroup("BarrierOnOverHeal").rules[0].childName = childName; ruleset.FindItemDisplayRuleGroup("BarrierOnOverHeal").rules[0].localPos = position; ruleset.FindItemDisplayRuleGroup("BarrierOnOverHeal").rules[0].localAngles = rotation; ruleset.FindItemDisplayRuleGroup("BarrierOnOverHeal").rules[0].localScale = scale; }
private void InitItemDisplays() { if (this.model) { ItemDisplayRuleSet newRuleset = Instantiate(this.model.itemDisplayRuleSet); this.model.itemDisplayRuleSet = newRuleset; //aegis /*switch (this.skinName) * { * case "PALADINBODY_SOLAIRE_SKIN_NAME": * this.SetAegisDisplay(Modules.Assets.sunlightShield, "ElbowL", new Vector3(-0.0002f, 0.001f, 0), new Vector3(20, 270, 310), new Vector3(0.0001f, 0.0001f, 0.0001f)); * break; * case "PALADINBODY_ARTORIAS_SKIN_NAME": * this.SetAegisDisplay(Modules.Assets.artoriasShield, "ElbowL", new Vector3(-0.0004f, 0.003f, 0), new Vector3(20, 270, 270), new Vector3(0.0001f, 0.0001f, 0.0001f)); * break; * case "PALADINBODY_FARAAM_SKIN_NAME": * this.SetAegisDisplay(Modules.Assets.goldenShield, "ElbowL", new Vector3(0.0004f, 0, 0), new Vector3(70, 90, 180), new Vector3(1, 1, 1)); * break; * case "PALADINBODY_BLACKKNIGHT_SKIN_NAME": * this.SetAegisDisplay(Modules.Assets.blackKnightShield, "ElbowL", new Vector3(0, 0.003f, 0), new Vector3(350, 270, 90), new Vector3(0.0001f, 0.0001f, 0.0001f)); * break; * case "PALADINBODY_PURSUER_SKIN_NAME": * this.SetAegisDisplay(Modules.Assets.pursuerShield, "ElbowL", new Vector3(0, 0.0025f, 0), new Vector3(0, 0, 90), new Vector3(0.75f, 0.75f, 0.75f)); * break; * case "PALADINBODY_GIANTDAD_SKIN_NAME": * this.SetAegisDisplay(Modules.Assets.giantShield, "ElbowL", new Vector3(-0.0005f, 0.003f, 0), new Vector3(30, 270, 270), new Vector3(0.0001f, 0.0001f, 0.0001f)); * break; * case "PALADINBODY_HAVEL_SKIN_NAME": * this.SetAegisDisplay(Modules.Assets.havelShield, "ElbowL", new Vector3(-0.0005f, 0.003f, 0), new Vector3(30, 270, 270), new Vector3(0.0001f, 0.0001f, 0.0001f)); * break; * } * * //razorwire * if (this.skinName == "PALADINBODY_DRIP_SKIN_NAME") * { * this.SetRazorwireDisplay(new Vector3(-0.0004f, 0.01f, -0.0005f), new Vector3(270, 300, 0), new Vector3(0.004f, 0.004f, 0.008f)); * } * else this.SetRazorwireDisplay(new Vector3(0, 0.006f, -0.001f), new Vector3(270, 300, 0), new Vector3(0.006f, 0.009f, 0.012f)); */ //tri tip // nvm the skin already holds the dagger /*if (this.skinName == "PALADINBODY_ABYSSWATCHER_SKIN_NAME") * { * this.SetDaggerDisplay(Modules.Assets.watcherDagger, new Vector3(-0.0004f, 0.01f, -0.0005f), new Vector3(270, 300, 0), new Vector3(0.004f, 0.004f, 0.008f)); * }*/ } }
public static void PopulateDisplays() { ItemDisplayRuleSet itemDisplayRuleSet = Resources.Load <GameObject>("Prefabs/CharacterBodies/CommandoBody").GetComponent <ModelLocator>().modelTransform.GetComponent <CharacterModel>().itemDisplayRuleSet; BindingFlags bindingAttr = BindingFlags.Instance | BindingFlags.Static | BindingFlags.Public | BindingFlags.NonPublic; ItemDisplayRuleSet.NamedRuleGroup[] array = typeof(ItemDisplayRuleSet).GetField("namedItemRuleGroups", bindingAttr).GetValue(itemDisplayRuleSet) as ItemDisplayRuleSet.NamedRuleGroup[]; ItemDisplayRuleSet.NamedRuleGroup[] array2 = typeof(ItemDisplayRuleSet).GetField("namedEquipmentRuleGroups", bindingAttr).GetValue(itemDisplayRuleSet) as ItemDisplayRuleSet.NamedRuleGroup[]; ItemDisplayRuleSet.NamedRuleGroup[] array3 = array; for (int i = 0; i < array3.Length; i++) { ItemDisplayRule[] rules = array3[i].displayRuleGroup.rules; for (int j = 0; j < rules.Length; j++) { GameObject followerPrefab = rules[j].followerPrefab; if (!(followerPrefab == null)) { string name = followerPrefab.name; string key = (name != null) ? name.ToLower() : null; if (!itemDisplayPrefabs.ContainsKey(key)) { itemDisplayPrefabs[key] = followerPrefab; } } } } array3 = array2; for (int i = 0; i < array3.Length; i++) { ItemDisplayRule[] rules = array3[i].displayRuleGroup.rules; for (int j = 0; j < rules.Length; j++) { GameObject followerPrefab2 = rules[j].followerPrefab; if (!(followerPrefab2 == null)) { string name2 = followerPrefab2.name; string key2 = (name2 != null) ? name2.ToLower() : null; if (!itemDisplayPrefabs.ContainsKey(key2)) { itemDisplayPrefabs[key2] = followerPrefab2; } } } } }
internal static void PopulateDisplays() { ItemDisplayRuleSet itemDisplayRuleSet = Resources.Load <GameObject>("Prefabs/CharacterBodies/CommandoBody").GetComponent <ModelLocator>().modelTransform.GetComponent <CharacterModel>().itemDisplayRuleSet; ItemDisplayRuleSet.NamedRuleGroup[] item = itemDisplayRuleSet.namedItemRuleGroups; ItemDisplayRuleSet.NamedRuleGroup[] equip = itemDisplayRuleSet.namedEquipmentRuleGroups; for (int i = 0; i < item.Length; i++) { ItemDisplayRule[] rules = item[i].displayRuleGroup.rules; for (int j = 0; j < rules.Length; j++) { GameObject followerPrefab = rules[j].followerPrefab; if (followerPrefab) { string name = followerPrefab.name; string key = (name != null) ? name.ToLower() : null; if (!itemDisplayPrefabs.ContainsKey(key)) { itemDisplayPrefabs[key] = followerPrefab; } } } } for (int i = 0; i < equip.Length; i++) { ItemDisplayRule[] rules = equip[i].displayRuleGroup.rules; for (int j = 0; j < rules.Length; j++) { GameObject followerPrefab = rules[j].followerPrefab; if (followerPrefab) { string name2 = followerPrefab.name; string key2 = (name2 != null) ? name2.ToLower() : null; if (!itemDisplayPrefabs.ContainsKey(key2)) { itemDisplayPrefabs[key2] = followerPrefab; } } } } }
private void Awake() { if (!NetworkServer.active) { return; } if (Util.CheckRoll(this.spawnRate)) { this.isVariant = true; } if (this.meshReplacements != null && this.isVariant) { if (this.meshReplacements.Length > 0) { this.storedIDRS = this.GetComponentInChildren <CharacterModel>().itemDisplayRuleSet; this.GetComponentInChildren <CharacterModel>().itemDisplayRuleSet = null; } } }
private void GrabMaterials() { // gather materials and meshes to use for variants ItemDisplayRuleSet itemDisplayRuleSet = Resources.Load <GameObject>("Prefabs/CharacterBodies/CommandoBody").GetComponent <ModelLocator>().modelTransform.GetComponent <CharacterModel>().itemDisplayRuleSet; lunarGolemMat = UnityEngine.Object.Instantiate(Resources.Load <GameObject>("Prefabs/CharacterBodies/LunarGolemBody").GetComponentInChildren <CharacterModel>().baseRendererInfos[0].defaultMaterial); goldTitanMat = UnityEngine.Object.Instantiate(Resources.Load <GameObject>("Prefabs/CharacterBodies/TitanGoldBody").GetComponentInChildren <CharacterModel>().baseRendererInfos[19].defaultMaterial); perforatorMat = UnityEngine.Object.Instantiate(itemDisplayRuleSet.FindDisplayRuleGroup(RoR2Content.Items.FireballsOnHit).rules[0].followerPrefab.GetComponentInChildren <MeshRenderer>().material); glandMat = UnityEngine.Object.Instantiate(itemDisplayRuleSet.FindDisplayRuleGroup(RoR2Content.Items.BeetleGland).rules[0].followerPrefab.GetComponentInChildren <Renderer>().material); visionsMat = UnityEngine.Object.Instantiate(itemDisplayRuleSet.FindDisplayRuleGroup(RoR2Content.Items.LunarPrimaryReplacement).rules[0].followerPrefab.GetComponentInChildren <MeshRenderer>().material); ghostMat = Resources.Load <Material>("Materials/matGhostEffect"); shatterspleenMat = UnityEngine.Object.Instantiate(itemDisplayRuleSet.FindDisplayRuleGroup(RoR2Content.Items.BleedOnHitAndExplode).rules[0].followerPrefab.GetComponentInChildren <MeshRenderer>().material); solusMat = UnityEngine.Object.Instantiate(Resources.Load <GameObject>("Prefabs/CharacterBodies/RoboBallBossBody").GetComponentInChildren <CharacterModel>().baseRendererInfos[0].defaultMaterial); flameTrailMat = UnityEngine.Object.Instantiate(Resources.Load <GameObject>("Prefabs/ProjectileGhosts/FireMeatBallGhost").GetComponentInChildren <TrailRenderer>().material); dunestriderMat = UnityEngine.Object.Instantiate(Resources.Load <GameObject>("Prefabs/CharacterBodies/ClayBossBody").GetComponentInChildren <CharacterModel>().baseRendererInfos[2].defaultMaterial); blueFlameMat = UnityEngine.Object.Instantiate(Resources.Load <GameObject>("Prefabs/Effects/MuzzleFlashes/MuzzleflashLunarGolemTwinShot").transform.Find("FlameCloud_Ps").GetComponent <ParticleSystemRenderer>().material); wispFlameMat = UnityEngine.Object.Instantiate(Resources.Load <GameObject>("Prefabs/CharacterBodies/WispBody").GetComponentInChildren <CharacterModel>().baseRendererInfos[1].defaultMaterial); greaterWispFlameMat = UnityEngine.Object.Instantiate(Resources.Load <GameObject>("Prefabs/CharacterBodies/GreaterWispBody").GetComponentInChildren <CharacterModel>().baseRendererInfos[1].defaultMaterial); greaterWispBodyMat = UnityEngine.Object.Instantiate(Resources.Load <GameObject>("Prefabs/CharacterBodies/GreaterWispBody").GetComponentInChildren <CharacterModel>().baseRendererInfos[0].defaultMaterial); skeltalMat = UnityEngine.Object.Instantiate(Resources.Load <GameObject>("Prefabs/Effects/BrotherDashEffect").transform.Find("Donut").GetComponent <ParticleSystemRenderer>().material); missileLauncherDisplayPrefab = itemDisplayRuleSet.FindDisplayRuleGroup(RoR2Content.Equipment.CommandMissile).rules[0].followerPrefab; }
public static void Init() { GameObject characterPrefab = Resources.Load <GameObject>("Prefabs/CharacterBodies/JellyfishBody"); ItemDisplayRuleSet itemDisplayRuleSet = ScriptableObject.CreateInstance <ItemDisplayRuleSet>(); List <ItemDisplayRuleSet.NamedRuleGroup> list = new List <ItemDisplayRuleSet.NamedRuleGroup>(); List <ItemDisplayRuleSet.NamedRuleGroup> list2 = new List <ItemDisplayRuleSet.NamedRuleGroup>(); ItemDisplayRuleSet original = characterPrefab.GetComponentInChildren <CharacterModel>().itemDisplayRuleSet; list2.Add(new ItemDisplayRuleSet.NamedRuleGroup { name = "AffixRed", displayRuleGroup = original.FindEquipmentDisplayRuleGroup("AffixRed") }); list2.Add(new ItemDisplayRuleSet.NamedRuleGroup { name = "AffixBlue", displayRuleGroup = original.FindEquipmentDisplayRuleGroup("AffixBlue") }); list2.Add(new ItemDisplayRuleSet.NamedRuleGroup { name = "AffixWhite", displayRuleGroup = original.FindEquipmentDisplayRuleGroup("AffixWhite") }); list2.Add(new ItemDisplayRuleSet.NamedRuleGroup { name = "AffixPoison", displayRuleGroup = original.FindEquipmentDisplayRuleGroup("AffixPoison") }); list2.Add(new ItemDisplayRuleSet.NamedRuleGroup { name = "AffixHaunted", displayRuleGroup = original.FindEquipmentDisplayRuleGroup("AffixHaunted") }); list.Add(new ItemDisplayRuleSet.NamedRuleGroup { name = "CritGlasses", displayRuleGroup = new DisplayRuleGroup { rules = new ItemDisplayRule[] { new ItemDisplayRule { ruleType = ItemDisplayRuleType.ParentedPrefab, followerPrefab = ItemDisplays.LoadDisplay("DisplayGlasses"), childName = "Hull2", localPos = new Vector3(0, 1.1f, 0), localAngles = new Vector3(270, 90, 0), localScale = new Vector3(2.8f, 3, 3), limbMask = LimbFlags.None } } } }); list.Add(new ItemDisplayRuleSet.NamedRuleGroup { name = "Crowbar", displayRuleGroup = new DisplayRuleGroup { rules = new ItemDisplayRule[] { new ItemDisplayRule { ruleType = ItemDisplayRuleType.ParentedPrefab, followerPrefab = ItemDisplays.LoadDisplay("DisplayCrowbar"), childName = "Hull2", localPos = new Vector3(1, 0, 0), localAngles = new Vector3(0, 0, 0), localScale = new Vector3(2, 2, 2), limbMask = LimbFlags.None } } } }); list.Add(new ItemDisplayRuleSet.NamedRuleGroup { name = "Behemoth", displayRuleGroup = new DisplayRuleGroup { rules = new ItemDisplayRule[] { new ItemDisplayRule { ruleType = ItemDisplayRuleType.ParentedPrefab, followerPrefab = ItemDisplays.LoadDisplay("DisplayBehemoth"), childName = "Hull2", localPos = new Vector3(0, 0.6f, 1.5f), localAngles = new Vector3(0, 0, 0), localScale = new Vector3(0.3f, 0.3f, 0.3f), limbMask = LimbFlags.None } } } }); list.Add(new ItemDisplayRuleSet.NamedRuleGroup { name = "NearbyDamageBonus", displayRuleGroup = new DisplayRuleGroup { rules = new ItemDisplayRule[] { new ItemDisplayRule { ruleType = ItemDisplayRuleType.ParentedPrefab, followerPrefab = ItemDisplays.LoadDisplay("DisplayDiamond"), childName = "Hull2", localPos = new Vector3(0, 0, 0), localAngles = new Vector3(0, 0, 0), localScale = new Vector3(1.5f, 1.5f, 1.5f), limbMask = LimbFlags.None } } } }); list.Add(new ItemDisplayRuleSet.NamedRuleGroup { name = "FireRing", displayRuleGroup = new DisplayRuleGroup { rules = new ItemDisplayRule[] { new ItemDisplayRule { ruleType = ItemDisplayRuleType.ParentedPrefab, followerPrefab = ItemDisplays.LoadDisplay("DisplayFireRing"), childName = "Hull2", localPos = new Vector3(0, 0, 0), localAngles = new Vector3(90, 0, 0), localScale = new Vector3(11, 11, 11), limbMask = LimbFlags.None } } } }); list.Add(new ItemDisplayRuleSet.NamedRuleGroup { name = "IceRing", displayRuleGroup = new DisplayRuleGroup { rules = new ItemDisplayRule[] { new ItemDisplayRule { ruleType = ItemDisplayRuleType.ParentedPrefab, followerPrefab = ItemDisplays.LoadDisplay("DisplayIceRing"), childName = "Hull2", localPos = new Vector3(0, 0.5f, 0), localAngles = new Vector3(90, 0, 0), localScale = new Vector3(11, 11, 11), limbMask = LimbFlags.None } } } }); list.Add(new ItemDisplayRuleSet.NamedRuleGroup { name = "ArmorPlate", displayRuleGroup = new DisplayRuleGroup { rules = new ItemDisplayRule[] { new ItemDisplayRule { ruleType = ItemDisplayRuleType.ParentedPrefab, followerPrefab = ItemDisplays.LoadDisplay("DisplayRepulsionArmorPlate"), childName = "Hull2", localPos = new Vector3(-0.3f, 0, 0.65f), localAngles = new Vector3(270, 0, 0), localScale = new Vector3(3, 2, 2), limbMask = LimbFlags.None } } } }); list.Add(new ItemDisplayRuleSet.NamedRuleGroup { name = "Bear", displayRuleGroup = new DisplayRuleGroup { rules = new ItemDisplayRule[] { new ItemDisplayRule { ruleType = ItemDisplayRuleType.ParentedPrefab, followerPrefab = ItemDisplays.LoadDisplay("DisplayBear"), childName = "Hull2", localPos = new Vector3(0.7f, 0, -0.7f), localAngles = new Vector3(0, 135, 0), localScale = new Vector3(2, 2, 2), limbMask = LimbFlags.None } } } }); list.Add(new ItemDisplayRuleSet.NamedRuleGroup { name = "Medkit", displayRuleGroup = new DisplayRuleGroup { rules = new ItemDisplayRule[] { new ItemDisplayRule { ruleType = ItemDisplayRuleType.ParentedPrefab, followerPrefab = ItemDisplays.LoadDisplay("DisplayMedkit"), childName = "Hull2", localPos = new Vector3(-1.25f, 0, 0), localAngles = new Vector3(270, 270, 0), localScale = new Vector3(4, 4, 4), limbMask = LimbFlags.None } } } }); list.Add(new ItemDisplayRuleSet.NamedRuleGroup { name = "Dagger", displayRuleGroup = new DisplayRuleGroup { rules = new ItemDisplayRule[] { new ItemDisplayRule { ruleType = ItemDisplayRuleType.ParentedPrefab, followerPrefab = ItemDisplays.LoadDisplay("DisplayDagger"), childName = "Hull2", localPos = new Vector3(0, 0.75f, 0.75f), localAngles = new Vector3(270, 0, 0), localScale = new Vector3(5, 5, 5), limbMask = LimbFlags.None } } } }); /*list.Add(new ItemDisplayRuleSet.NamedRuleGroup * { * name = "ChainLightning", * displayRuleGroup = new DisplayRuleGroup * { * rules = new ItemDisplayRule[] * { * new ItemDisplayRule * { * ruleType = ItemDisplayRuleType.ParentedPrefab, * followerPrefab = ItemDisplays.LoadDisplay("DisplayUkulele"), * childName = "Hull2", * localPos = new Vector3(0.4f, 0, -1.75f), * localAngles = new Vector3(0, 85, 90), * localScale = new Vector3(0.8f, 0.8f, 0.8f), * limbMask = LimbFlags.None * } * } * } * });*/ list.Add(new ItemDisplayRuleSet.NamedRuleGroup { name = "Syringe", displayRuleGroup = new DisplayRuleGroup { rules = new ItemDisplayRule[] { new ItemDisplayRule { ruleType = ItemDisplayRuleType.ParentedPrefab, followerPrefab = ItemDisplays.LoadDisplay("DisplaySyringeCluster"), childName = "Hull2", localPos = new Vector3(0.5f, 0, 0.5f), localAngles = new Vector3(0, 315, 270), localScale = new Vector3(1, 1, 1), limbMask = LimbFlags.None } } } }); list.Add(new ItemDisplayRuleSet.NamedRuleGroup { name = "UtilitySkillMagazine", displayRuleGroup = new DisplayRuleGroup { rules = new ItemDisplayRule[] { new ItemDisplayRule { ruleType = ItemDisplayRuleType.ParentedPrefab, followerPrefab = ItemDisplays.LoadDisplay("DisplayAfterburnerShoulderRing"), childName = "Hull2", localPos = new Vector3(0, 0.6f, 0), localAngles = new Vector3(0, 0, 0), localScale = new Vector3(4, 4, 4), limbMask = LimbFlags.None } } } }); list.Add(new ItemDisplayRuleSet.NamedRuleGroup { name = "Hoof", displayRuleGroup = new DisplayRuleGroup { rules = new ItemDisplayRule[] { new ItemDisplayRule { ruleType = ItemDisplayRuleType.ParentedPrefab, followerPrefab = ItemDisplays.LoadDisplay("DisplayHoof"), childName = "Hull2", localPos = new Vector3(0, -1, 0), localAngles = new Vector3(270, 270, 0), localScale = new Vector3(0.25f, 0.25f, 0.25f), limbMask = LimbFlags.None } } } }); list.Add(new ItemDisplayRuleSet.NamedRuleGroup { name = "SprintOutOfCombat", displayRuleGroup = new DisplayRuleGroup { rules = new ItemDisplayRule[] { new ItemDisplayRule { ruleType = ItemDisplayRuleType.ParentedPrefab, followerPrefab = ItemDisplays.LoadDisplay("DisplayWhip"), childName = "Hull2 ", localPos = new Vector3(0, 0, 0), localAngles = new Vector3(0, 0, 90), localScale = new Vector3(3, 3, 3), limbMask = LimbFlags.None } } } }); //apply displays here BindingFlags bindingAttr = BindingFlags.Instance | BindingFlags.Static | BindingFlags.Public | BindingFlags.NonPublic; ItemDisplayRuleSet.NamedRuleGroup[] value = list.ToArray(); ItemDisplayRuleSet.NamedRuleGroup[] value2 = list2.ToArray(); typeof(ItemDisplayRuleSet).GetField("namedItemRuleGroups", bindingAttr).SetValue(itemDisplayRuleSet, value); typeof(ItemDisplayRuleSet).GetField("namedEquipmentRuleGroups", bindingAttr).SetValue(itemDisplayRuleSet, value2); characterPrefab.GetComponentInChildren <CharacterModel>().itemDisplayRuleSet = itemDisplayRuleSet; }
public static void Init() { GameObject characterPrefab = Resources.Load <GameObject>("Prefabs/CharacterBodies/ClayBruiserBody"); ItemDisplayRuleSet itemDisplayRuleSet = ScriptableObject.CreateInstance <ItemDisplayRuleSet>(); List <ItemDisplayRuleSet.NamedRuleGroup> list = new List <ItemDisplayRuleSet.NamedRuleGroup>(); List <ItemDisplayRuleSet.NamedRuleGroup> list2 = new List <ItemDisplayRuleSet.NamedRuleGroup>(); ItemDisplayRuleSet original = characterPrefab.GetComponentInChildren <CharacterModel>().itemDisplayRuleSet; ItemDisplayRuleSet loader = Resources.Load <GameObject>("Prefabs/CharacterBodies/LoaderBody").GetComponentInChildren <CharacterModel>().itemDisplayRuleSet; list2.Add(new ItemDisplayRuleSet.NamedRuleGroup { name = "AffixRed", displayRuleGroup = original.FindEquipmentDisplayRuleGroup("AffixRed") }); list2.Add(new ItemDisplayRuleSet.NamedRuleGroup { name = "AffixBlue", displayRuleGroup = original.FindEquipmentDisplayRuleGroup("AffixBlue") }); list2.Add(new ItemDisplayRuleSet.NamedRuleGroup { name = "AffixWhite", displayRuleGroup = original.FindEquipmentDisplayRuleGroup("AffixWhite") }); list2.Add(new ItemDisplayRuleSet.NamedRuleGroup { name = "AffixPoison", displayRuleGroup = original.FindEquipmentDisplayRuleGroup("AffixPoison") }); list2.Add(new ItemDisplayRuleSet.NamedRuleGroup { name = "AffixHaunted", displayRuleGroup = original.FindEquipmentDisplayRuleGroup("AffixHaunted") }); list.Add(new ItemDisplayRuleSet.NamedRuleGroup { name = "IncreaseHealing", displayRuleGroup = loader.FindItemDisplayRuleGroup("IncreaseHealing") }); list.Add(new ItemDisplayRuleSet.NamedRuleGroup { name = "NovaOnHeal", displayRuleGroup = loader.FindItemDisplayRuleGroup("NovaOnHeal") }); list.Add(new ItemDisplayRuleSet.NamedRuleGroup { name = "KillEliteFrenzy", displayRuleGroup = loader.FindItemDisplayRuleGroup("KillEliteFrenzy") }); list.Add(new ItemDisplayRuleSet.NamedRuleGroup { name = "Clover", displayRuleGroup = loader.FindItemDisplayRuleGroup("Clover") }); list2.Add(new ItemDisplayRuleSet.NamedRuleGroup { name = "Jetpack", displayRuleGroup = new DisplayRuleGroup { rules = new ItemDisplayRule[] { new ItemDisplayRule { ruleType = ItemDisplayRuleType.ParentedPrefab, followerPrefab = ItemDisplays.LoadDisplay("DisplayBugWings"), childName = "Head", localPos = new Vector3(-0.15f, -0.25f, 0), localAngles = new Vector3(0, 45, 0), localScale = new Vector3(0.25f, 0.25f, 0.25f), limbMask = LimbFlags.None } } } }); list2.Add(new ItemDisplayRuleSet.NamedRuleGroup { name = "GoldGat", displayRuleGroup = new DisplayRuleGroup { rules = new ItemDisplayRule[] { new ItemDisplayRule { ruleType = ItemDisplayRuleType.ParentedPrefab, followerPrefab = ItemDisplays.LoadDisplay("DisplayGoldGat"), childName = "Muzzle", localPos = new Vector3(1, 0.8f, -1), localAngles = new Vector3(45, 90, 0), localScale = new Vector3(0.5f, 0.5f, 0.5f), limbMask = LimbFlags.None } } } }); list.Add(new ItemDisplayRuleSet.NamedRuleGroup { name = "CritGlasses", displayRuleGroup = new DisplayRuleGroup { rules = new ItemDisplayRule[] { new ItemDisplayRule { ruleType = ItemDisplayRuleType.ParentedPrefab, followerPrefab = ItemDisplays.LoadDisplay("DisplayGlasses"), childName = "Head", localPos = new Vector3(0, 0.4f, 0.25f), localAngles = new Vector3(0, 0, 0), localScale = new Vector3(0.5f, 0.5f, 0.5f), limbMask = LimbFlags.None } } } }); list.Add(new ItemDisplayRuleSet.NamedRuleGroup { name = "GhostOnKill", displayRuleGroup = loader.FindItemDisplayRuleGroup("GhostOnKill") }); list.Add(new ItemDisplayRuleSet.NamedRuleGroup { name = "AttackSpeedOnCrit", displayRuleGroup = new DisplayRuleGroup { rules = new ItemDisplayRule[] { new ItemDisplayRule { ruleType = ItemDisplayRuleType.ParentedPrefab, followerPrefab = ItemDisplays.LoadDisplay("DisplayWolfPelt"), childName = "Head", localPos = new Vector3(0, 0.5f, 0.067f), localAngles = new Vector3(0, 0, 0), localScale = new Vector3(1, 1, 1), limbMask = LimbFlags.None } } } }); list.Add(new ItemDisplayRuleSet.NamedRuleGroup { name = "GoldOnHit", displayRuleGroup = loader.FindItemDisplayRuleGroup("GoldOnHit") }); list.Add(new ItemDisplayRuleSet.NamedRuleGroup { name = "ShieldOnly", displayRuleGroup = loader.FindItemDisplayRuleGroup("ShieldOnly") }); list.Add(new ItemDisplayRuleSet.NamedRuleGroup { name = "HeadHunter", displayRuleGroup = loader.FindItemDisplayRuleGroup("HeadHunter") }); list.Add(new ItemDisplayRuleSet.NamedRuleGroup { name = "JumpBoost", displayRuleGroup = new DisplayRuleGroup { rules = new ItemDisplayRule[] { new ItemDisplayRule { ruleType = ItemDisplayRuleType.ParentedPrefab, followerPrefab = ItemDisplays.LoadDisplay("DisplayWaxBird"), childName = "Head", localPos = new Vector3(0, -0.7f, -0.05f), localAngles = new Vector3(0, 0, 0), localScale = new Vector3(2, 2, 2), limbMask = LimbFlags.None } } } }); list.Add(new ItemDisplayRuleSet.NamedRuleGroup { name = "Bandolier", displayRuleGroup = new DisplayRuleGroup { rules = new ItemDisplayRule[] { new ItemDisplayRule { ruleType = ItemDisplayRuleType.ParentedPrefab, followerPrefab = ItemDisplays.LoadDisplay("DisplayBandolier"), childName = "Muzzle", localPos = new Vector3(0.05f, -0.05f, -1.75f), localAngles = new Vector3(0, 0, 0), localScale = new Vector3(0.75f, 1, 1), limbMask = LimbFlags.None }, new ItemDisplayRule { ruleType = ItemDisplayRuleType.ParentedPrefab, followerPrefab = ItemDisplays.LoadDisplay("DisplayBandolier"), childName = "Head", localPos = new Vector3(-0.2f, -0.5f, 0.25f), localAngles = new Vector3(-45, 180, 0), localScale = new Vector3(1, 2, 1), limbMask = LimbFlags.None } } } }); list.Add(new ItemDisplayRuleSet.NamedRuleGroup { name = "DeathMark", displayRuleGroup = new DisplayRuleGroup { rules = new ItemDisplayRule[] { new ItemDisplayRule { ruleType = ItemDisplayRuleType.ParentedPrefab, followerPrefab = ItemDisplays.LoadDisplay("DisplayDeathMark"), childName = "Muzzle", localPos = new Vector3(0, 0, -0.25f), localAngles = new Vector3(0, 0, 0), localScale = new Vector3(0.1f, 0.1f, 0.1f), limbMask = LimbFlags.None } } } }); list.Add(new ItemDisplayRuleSet.NamedRuleGroup { name = "WarCryOnMultiKill", displayRuleGroup = new DisplayRuleGroup { rules = new ItemDisplayRule[] { new ItemDisplayRule { ruleType = ItemDisplayRuleType.ParentedPrefab, followerPrefab = ItemDisplays.LoadDisplay("DisplayPauldron"), childName = "Head", localPos = new Vector3(0, 0.1f, -0.25f), localAngles = new Vector3(-90, 0, 0), localScale = new Vector3(1.5f, 1.5f, 1.5f), limbMask = LimbFlags.None } } } }); list.Add(new ItemDisplayRuleSet.NamedRuleGroup { name = "Mushroom", displayRuleGroup = new DisplayRuleGroup { rules = new ItemDisplayRule[] { new ItemDisplayRule { ruleType = ItemDisplayRuleType.ParentedPrefab, followerPrefab = ItemDisplays.LoadDisplay("DisplayMushroom"), childName = "Head", localPos = new Vector3(-0.25f, 0, 0), localAngles = new Vector3(0, 0, 45), localScale = new Vector3(0.25f, 0.25f, 0.25f), limbMask = LimbFlags.None } } } }); list.Add(new ItemDisplayRuleSet.NamedRuleGroup { name = "BarrierOnOverHeal", displayRuleGroup = new DisplayRuleGroup { rules = new ItemDisplayRule[] { new ItemDisplayRule { ruleType = ItemDisplayRuleType.ParentedPrefab, followerPrefab = ItemDisplays.LoadDisplay("DisplayAegis"), childName = "Muzzle", localPos = new Vector3(0, 0.25f, -1), localAngles = new Vector3(180, 180, 180), localScale = new Vector3(0.75f, 0.75f, 0.75f), limbMask = LimbFlags.None } } } }); list.Add(new ItemDisplayRuleSet.NamedRuleGroup { name = "Behemoth", displayRuleGroup = new DisplayRuleGroup { rules = new ItemDisplayRule[] { new ItemDisplayRule { ruleType = ItemDisplayRuleType.ParentedPrefab, followerPrefab = ItemDisplays.LoadDisplay("DisplayBehemoth"), childName = "Muzzle", localPos = new Vector3(0, 0, -0.9f), localAngles = new Vector3(90, 0, 0), localScale = new Vector3(0.5f, 0.5f, 0.5f), limbMask = LimbFlags.None } } } }); list.Add(new ItemDisplayRuleSet.NamedRuleGroup { name = "NearbyDamageBonus", displayRuleGroup = new DisplayRuleGroup { rules = new ItemDisplayRule[] { new ItemDisplayRule { ruleType = ItemDisplayRuleType.ParentedPrefab, followerPrefab = ItemDisplays.LoadDisplay("DisplayDiamond"), childName = "Muzzle", localPos = new Vector3(0, 0, -2.75f), localAngles = new Vector3(0, 0, 0), localScale = new Vector3(0.7f, 0.7f, 0.7f), limbMask = LimbFlags.None } } } }); list.Add(new ItemDisplayRuleSet.NamedRuleGroup { name = "FireRing", displayRuleGroup = new DisplayRuleGroup { rules = new ItemDisplayRule[] { new ItemDisplayRule { ruleType = ItemDisplayRuleType.ParentedPrefab, followerPrefab = ItemDisplays.LoadDisplay("DisplayFireRing"), childName = "Muzzle", localPos = new Vector3(0, 0, -1), localAngles = new Vector3(0, 0, 0), localScale = new Vector3(3.5f, 3.5f, 3.5f), limbMask = LimbFlags.None } } } }); list.Add(new ItemDisplayRuleSet.NamedRuleGroup { name = "IceRing", displayRuleGroup = new DisplayRuleGroup { rules = new ItemDisplayRule[] { new ItemDisplayRule { ruleType = ItemDisplayRuleType.ParentedPrefab, followerPrefab = ItemDisplays.LoadDisplay("DisplayIceRing"), childName = "Muzzle", localPos = new Vector3(0, 0, -1.2f), localAngles = new Vector3(0, 0, 0), localScale = new Vector3(3.5f, 3.5f, 3.5f), limbMask = LimbFlags.None } } } }); list.Add(new ItemDisplayRuleSet.NamedRuleGroup { name = "ArmorPlate", displayRuleGroup = new DisplayRuleGroup { rules = new ItemDisplayRule[] { new ItemDisplayRule { ruleType = ItemDisplayRuleType.ParentedPrefab, followerPrefab = ItemDisplays.LoadDisplay("DisplayRepulsionArmorPlate"), childName = "Head", localPos = new Vector3(-0.4f, -0.5f, 0.15f), localAngles = new Vector3(-90, 260, 45), localScale = new Vector3(0.8f, 0.6f, 0.6f), limbMask = LimbFlags.None } } } }); list.Add(new ItemDisplayRuleSet.NamedRuleGroup { name = "Bear", displayRuleGroup = new DisplayRuleGroup { rules = new ItemDisplayRule[] { new ItemDisplayRule { ruleType = ItemDisplayRuleType.ParentedPrefab, followerPrefab = ItemDisplays.LoadDisplay("DisplayBear"), childName = "Head", localPos = new Vector3(0, 0, -0.4f), localAngles = new Vector3(0, 180, 0), localScale = new Vector3(0.6f, 0.6f, 0.6f), limbMask = LimbFlags.None } } } }); list.Add(new ItemDisplayRuleSet.NamedRuleGroup { name = "Medkit", displayRuleGroup = new DisplayRuleGroup { rules = new ItemDisplayRule[] { new ItemDisplayRule { ruleType = ItemDisplayRuleType.ParentedPrefab, followerPrefab = ItemDisplays.LoadDisplay("DisplayMedkit"), childName = "Head", localPos = new Vector3(-0.4f, -0.5f, 0.15f), localAngles = new Vector3(-90, -90, 0), localScale = new Vector3(1.5f, 1.5f, 1.5f), limbMask = LimbFlags.None } } } }); list.Add(new ItemDisplayRuleSet.NamedRuleGroup { name = "Dagger", displayRuleGroup = new DisplayRuleGroup { rules = new ItemDisplayRule[] { new ItemDisplayRule { ruleType = ItemDisplayRuleType.ParentedPrefab, followerPrefab = ItemDisplays.LoadDisplay("DisplayDagger"), childName = "Head", localPos = new Vector3(0, 0, 0), localAngles = new Vector3(-90, -90, 0), localScale = new Vector3(2, 2, 2), limbMask = LimbFlags.None } } } }); list.Add(new ItemDisplayRuleSet.NamedRuleGroup { name = "ChainLightning", displayRuleGroup = new DisplayRuleGroup { rules = new ItemDisplayRule[] { new ItemDisplayRule { ruleType = ItemDisplayRuleType.ParentedPrefab, followerPrefab = ItemDisplays.LoadDisplay("DisplayUkulele"), childName = "Muzzle", localPos = new Vector3(0.4f, 0, -1.75f), localAngles = new Vector3(0, 85, 90), localScale = new Vector3(0.8f, 0.8f, 0.8f), limbMask = LimbFlags.None } } } }); list.Add(new ItemDisplayRuleSet.NamedRuleGroup { name = "Syringe", displayRuleGroup = new DisplayRuleGroup { rules = new ItemDisplayRule[] { new ItemDisplayRule { ruleType = ItemDisplayRuleType.ParentedPrefab, followerPrefab = ItemDisplays.LoadDisplay("DisplaySyringeCluster"), childName = "Head", localPos = new Vector3(0, 0, -0.15f), localAngles = new Vector3(-60, 0, 0), localScale = new Vector3(0.5f, 0.5f, 0.5f), limbMask = LimbFlags.None } } } }); list.Add(new ItemDisplayRuleSet.NamedRuleGroup { name = "ArmorReductionOnHit", displayRuleGroup = new DisplayRuleGroup { rules = new ItemDisplayRule[] { new ItemDisplayRule { ruleType = ItemDisplayRuleType.ParentedPrefab, followerPrefab = ItemDisplays.LoadDisplay("DisplayWarhammer"), childName = "Muzzle", localPos = new Vector3(0, 0.25f, 0), localAngles = new Vector3(0, 0, 0), localScale = new Vector3(1, 1, 1), limbMask = LimbFlags.None } } } }); list.Add(new ItemDisplayRuleSet.NamedRuleGroup { name = "FallBoots", displayRuleGroup = new DisplayRuleGroup { rules = new ItemDisplayRule[] { new ItemDisplayRule { ruleType = ItemDisplayRuleType.ParentedPrefab, followerPrefab = ItemDisplays.LoadDisplay("DisplayGravBoots"), childName = "FootL", localPos = new Vector3(0, -0.05f, 0), localAngles = new Vector3(45, 0, 0), localScale = new Vector3(0.25f, 0.25f, 0.25f), limbMask = LimbFlags.None }, new ItemDisplayRule { ruleType = ItemDisplayRuleType.ParentedPrefab, followerPrefab = ItemDisplays.LoadDisplay("DisplayGravBoots"), childName = "FootR", localPos = new Vector3(0, -0.05f, 0), localAngles = new Vector3(70, 0, 0), localScale = new Vector3(0.25f, 0.25f, 0.25f), limbMask = LimbFlags.None } } } }); list.Add(new ItemDisplayRuleSet.NamedRuleGroup { name = "BounceNearby", displayRuleGroup = new DisplayRuleGroup { rules = new ItemDisplayRule[] { new ItemDisplayRule { ruleType = ItemDisplayRuleType.ParentedPrefab, followerPrefab = ItemDisplays.LoadDisplay("DisplayHook"), childName = "Muzzle", localPos = new Vector3(0, 0, -0.25f), localAngles = new Vector3(0, 0, 0), localScale = new Vector3(1, 1, 1), limbMask = LimbFlags.None } } } }); list.Add(new ItemDisplayRuleSet.NamedRuleGroup { name = "UtilitySkillMagazine", displayRuleGroup = new DisplayRuleGroup { rules = new ItemDisplayRule[] { new ItemDisplayRule { ruleType = ItemDisplayRuleType.ParentedPrefab, followerPrefab = ItemDisplays.LoadDisplay("DisplayAfterburnerShoulderRing"), childName = "Muzzle", localPos = new Vector3(0, 0, -0.75f), localAngles = new Vector3(0, -90, 90), localScale = new Vector3(2, 2, 2), limbMask = LimbFlags.None } } } }); list.Add(new ItemDisplayRuleSet.NamedRuleGroup { name = "Hoof", displayRuleGroup = new DisplayRuleGroup { rules = new ItemDisplayRule[] { new ItemDisplayRule { ruleType = ItemDisplayRuleType.ParentedPrefab, followerPrefab = ItemDisplays.LoadDisplay("DisplayHoof"), childName = "FootL", localPos = new Vector3(0, 0.05f, -0.15f), localAngles = new Vector3(50, 180, 180), localScale = new Vector3(0.15f, 0.15f, 0.075f), limbMask = LimbFlags.None } } } }); list.Add(new ItemDisplayRuleSet.NamedRuleGroup { name = "HealWhileSafe", displayRuleGroup = new DisplayRuleGroup { rules = new ItemDisplayRule[] { new ItemDisplayRule { ruleType = ItemDisplayRuleType.ParentedPrefab, followerPrefab = ItemDisplays.LoadDisplay("DisplaySnail"), childName = "FootR", localPos = new Vector3(0, -0.05f, 0), localAngles = new Vector3(0, 0, 180), localScale = new Vector3(0.1f, 0.1f, 0.1f), limbMask = LimbFlags.None } } } }); list.Add(new ItemDisplayRuleSet.NamedRuleGroup { name = "LunarPrimaryReplacement", displayRuleGroup = new DisplayRuleGroup { rules = new ItemDisplayRule[] { new ItemDisplayRule { ruleType = ItemDisplayRuleType.ParentedPrefab, followerPrefab = ItemDisplays.LoadDisplay("DisplayBirdEye"), childName = "Muzzle", localPos = new Vector3(0, -0.1f, -0.25f), localAngles = new Vector3(-90, 0, 0), localScale = new Vector3(1, 1, 1), limbMask = LimbFlags.None } } } }); list.Add(new ItemDisplayRuleSet.NamedRuleGroup { name = "SecondarySkillMagazine", displayRuleGroup = new DisplayRuleGroup { rules = new ItemDisplayRule[] { new ItemDisplayRule { ruleType = ItemDisplayRuleType.ParentedPrefab, followerPrefab = ItemDisplays.LoadDisplay("DisplayDoubleMag"), childName = "Muzzle", localPos = new Vector3(0, -0.8f, -2), localAngles = new Vector3(0, 0, 0), localScale = new Vector3(-0.2f, -0.2f, -0.2f), limbMask = LimbFlags.None } } } }); list.Add(new ItemDisplayRuleSet.NamedRuleGroup { name = "Pearl", displayRuleGroup = new DisplayRuleGroup { rules = new ItemDisplayRule[] { new ItemDisplayRule { ruleType = ItemDisplayRuleType.ParentedPrefab, followerPrefab = ItemDisplays.LoadDisplay("DisplayPearl"), childName = "Head", localPos = new Vector3(-1, 0, 0), localAngles = new Vector3(0, 0, 0), localScale = new Vector3(0.2f, 0.2f, 0.2f), limbMask = LimbFlags.None } } } }); list.Add(new ItemDisplayRuleSet.NamedRuleGroup { name = "ShinyPearl", displayRuleGroup = new DisplayRuleGroup { rules = new ItemDisplayRule[] { new ItemDisplayRule { ruleType = ItemDisplayRuleType.ParentedPrefab, followerPrefab = ItemDisplays.LoadDisplay("DisplayShinyPearl"), childName = "Head", localPos = new Vector3(1, 0, 0), localAngles = new Vector3(0, 0, 0), localScale = new Vector3(0.2f, 0.2f, 0.2f), limbMask = LimbFlags.None } } } }); list.Add(new ItemDisplayRuleSet.NamedRuleGroup { name = "SprintOutOfCombat", displayRuleGroup = new DisplayRuleGroup { rules = new ItemDisplayRule[] { new ItemDisplayRule { ruleType = ItemDisplayRuleType.ParentedPrefab, followerPrefab = ItemDisplays.LoadDisplay("DisplayWhip"), childName = "Head", localPos = new Vector3(-0.5f, -1.2f, 0.25f), localAngles = new Vector3(0, 0, -20), localScale = new Vector3(1, 1, 1), limbMask = LimbFlags.None } } } }); list2.Add(new ItemDisplayRuleSet.NamedRuleGroup { name = "Fruit", displayRuleGroup = new DisplayRuleGroup { rules = new ItemDisplayRule[] { new ItemDisplayRule { ruleType = ItemDisplayRuleType.ParentedPrefab, followerPrefab = ItemDisplays.LoadDisplay("DisplayFruit"), childName = "Head", localPos = new Vector3(0.6f, -1.2f, 0), localAngles = new Vector3(0, -45, 45), localScale = new Vector3(0.75f, 0.75f, 0.75f), limbMask = LimbFlags.None } } } }); list2.Add(new ItemDisplayRuleSet.NamedRuleGroup { name = "BFG", displayRuleGroup = new DisplayRuleGroup { rules = new ItemDisplayRule[] { new ItemDisplayRule { ruleType = ItemDisplayRuleType.ParentedPrefab, followerPrefab = ItemDisplays.LoadDisplay("DisplayBFG"), childName = "Muzzle", localPos = new Vector3(0, 0.2f, -0.25f), localAngles = new Vector3(0, 0, 0), localScale = new Vector3(0.75f, 0.75f, 0.75f), limbMask = LimbFlags.None } } } }); //follower prefabs list2.Add(new ItemDisplayRuleSet.NamedRuleGroup { name = "Meteor", displayRuleGroup = new DisplayRuleGroup { rules = new ItemDisplayRule[] { new ItemDisplayRule { ruleType = ItemDisplayRuleType.ParentedPrefab, followerPrefab = ItemDisplays.LoadDisplay("DisplayMeteor"), childName = "Root", localPos = new Vector3(0, 2, -0.75f), localAngles = new Vector3(0, 0, 0), localScale = new Vector3(2, 2, 2), limbMask = LimbFlags.None } } } }); /*list2.Add(new ItemDisplayRuleSet.NamedRuleGroup * { * name = "Saw", * displayRuleGroup = new DisplayRuleGroup * { * rules = new ItemDisplayRule[] * { * new ItemDisplayRule * { * ruleType = ItemDisplayRuleType.ParentedPrefab, * followerPrefab = ItemDisplays.LoadDisplay("DisplaySawmerang"), * childName = "Root", * localPos = new Vector3(0, 2, -0.75f), * localAngles = new Vector3(-90, 0, 0), * localScale = new Vector3(0.4f, 0.4f, 0.4f), * limbMask = LimbFlags.None * } * } * } * });*/ list2.Add(new ItemDisplayRuleSet.NamedRuleGroup { name = "Blackhole", displayRuleGroup = new DisplayRuleGroup { rules = new ItemDisplayRule[] { new ItemDisplayRule { ruleType = ItemDisplayRuleType.ParentedPrefab, followerPrefab = ItemDisplays.LoadDisplay("DisplayGravCube"), childName = "Root", localPos = new Vector3(0, 2, -0.75f), localAngles = new Vector3(0, 0, 0), localScale = new Vector3(1, 1, 1), limbMask = LimbFlags.None } } } }); list.Add(new ItemDisplayRuleSet.NamedRuleGroup { name = "Icicle", displayRuleGroup = new DisplayRuleGroup { rules = new ItemDisplayRule[] { new ItemDisplayRule { ruleType = ItemDisplayRuleType.ParentedPrefab, followerPrefab = ItemDisplays.LoadDisplay("DisplayFrostRelic"), childName = "Root", localPos = new Vector3(-1, 2, -1), localAngles = new Vector3(90, 0, 0), localScale = new Vector3(2, 2, 2), limbMask = LimbFlags.None } } } }); list.Add(new ItemDisplayRuleSet.NamedRuleGroup { name = "Talisman", displayRuleGroup = new DisplayRuleGroup { rules = new ItemDisplayRule[] { new ItemDisplayRule { ruleType = ItemDisplayRuleType.ParentedPrefab, followerPrefab = ItemDisplays.LoadDisplay("DisplayTalisman"), childName = "Root", localPos = new Vector3(1, 2, -1), localAngles = new Vector3(0, 0, 0), localScale = new Vector3(1, 1, 1), limbMask = LimbFlags.None } } } }); list.Add(new ItemDisplayRuleSet.NamedRuleGroup { name = "FocusConvergence", displayRuleGroup = new DisplayRuleGroup { rules = new ItemDisplayRule[] { new ItemDisplayRule { ruleType = ItemDisplayRuleType.ParentedPrefab, followerPrefab = ItemDisplays.LoadDisplay("DisplayFocusedConvergence"), childName = "Root", localPos = new Vector3(0.5f, 2.5f, -3), localAngles = new Vector3(0, 0, 0), localScale = new Vector3(0.2f, 0.2f, 0.2f), limbMask = LimbFlags.None } } } }); //apply displays here BindingFlags bindingAttr = BindingFlags.Instance | BindingFlags.Static | BindingFlags.Public | BindingFlags.NonPublic; ItemDisplayRuleSet.NamedRuleGroup[] value = list.ToArray(); ItemDisplayRuleSet.NamedRuleGroup[] value2 = list2.ToArray(); typeof(ItemDisplayRuleSet).GetField("namedItemRuleGroups", bindingAttr).SetValue(itemDisplayRuleSet, value); typeof(ItemDisplayRuleSet).GetField("namedEquipmentRuleGroups", bindingAttr).SetValue(itemDisplayRuleSet, value2); characterPrefab.GetComponentInChildren <CharacterModel>().itemDisplayRuleSet = itemDisplayRuleSet; }
public static void RegisterDisplays() { GameObject bodyPrefab = GrovetenderPlugin.myCharacter; GameObject model = bodyPrefab.GetComponentInChildren <ModelLocator>().modelTransform.gameObject; CharacterModel characterModel = model.GetComponent <CharacterModel>(); PopulateDisplays(); //apply displays here ItemDisplayRuleSet itemDisplayRuleSet = ScriptableObject.CreateInstance <ItemDisplayRuleSet>(); List <ItemDisplayRuleSet.NamedRuleGroup> list = new List <ItemDisplayRuleSet.NamedRuleGroup>(); List <ItemDisplayRuleSet.NamedRuleGroup> list2 = new List <ItemDisplayRuleSet.NamedRuleGroup>(); ItemDisplayRuleSet original = Resources.Load <GameObject>("Prefabs/CharacterBodies/GravekeeperBody").GetComponentInChildren <CharacterModel>().itemDisplayRuleSet; ItemDisplayRuleSet loader = Resources.Load <GameObject>("Prefabs/CharacterBodies/LoaderBody").GetComponentInChildren <CharacterModel>().itemDisplayRuleSet; //add item displays here list2.Add(new ItemDisplayRuleSet.NamedRuleGroup { name = "Jetpack", displayRuleGroup = new DisplayRuleGroup { rules = new ItemDisplayRule[] { new ItemDisplayRule { ruleType = ItemDisplayRuleType.ParentedPrefab, followerPrefab = ItemDisplays.LoadDisplay("DisplayBugWings"), childName = "Head", localPos = new Vector3(0, 1, -2), localAngles = new Vector3(45, 0, 0), localScale = new Vector3(1, 1, 1), limbMask = LimbFlags.None } } } }); list2.Add(new ItemDisplayRuleSet.NamedRuleGroup { name = "GoldGat", displayRuleGroup = new DisplayRuleGroup { rules = new ItemDisplayRule[] { new ItemDisplayRule { ruleType = ItemDisplayRuleType.ParentedPrefab, followerPrefab = ItemDisplays.LoadDisplay("DisplayGoldGat"), childName = "MuzzleJar", localPos = new Vector3(0, -9, 0), localAngles = new Vector3(180, 270, 180), localScale = new Vector3(2, 2, 2), limbMask = LimbFlags.None } } } }); list2.Add(new ItemDisplayRuleSet.NamedRuleGroup { name = "AffixRed", displayRuleGroup = original.FindEquipmentDisplayRuleGroup("AffixRed") }); list2.Add(new ItemDisplayRuleSet.NamedRuleGroup { name = "AffixBlue", displayRuleGroup = original.FindEquipmentDisplayRuleGroup("AffixBlue") }); list2.Add(new ItemDisplayRuleSet.NamedRuleGroup { name = "AffixWhite", displayRuleGroup = original.FindEquipmentDisplayRuleGroup("AffixWhite") }); list2.Add(new ItemDisplayRuleSet.NamedRuleGroup { name = "AffixPoison", displayRuleGroup = original.FindEquipmentDisplayRuleGroup("AffixPoison") }); list2.Add(new ItemDisplayRuleSet.NamedRuleGroup { name = "AffixHaunted", displayRuleGroup = original.FindEquipmentDisplayRuleGroup("AffixHaunted") }); list.Add(new ItemDisplayRuleSet.NamedRuleGroup { name = "IncreaseHealing", displayRuleGroup = new DisplayRuleGroup { rules = new ItemDisplayRule[] { new ItemDisplayRule { ruleType = ItemDisplayRuleType.ParentedPrefab, followerPrefab = ItemDisplays.LoadDisplay("DisplayAntler"), childName = "Head", localPos = new Vector3(1.5f, 2, 0.017f), localAngles = new Vector3(358.0388f, 93.19246f, 1.436809f), localScale = new Vector3(3, 3, 3), limbMask = LimbFlags.None }, new ItemDisplayRule { ruleType = ItemDisplayRuleType.ParentedPrefab, followerPrefab = ItemDisplays.LoadDisplay("DisplayAntler"), childName = "Head", localPos = new Vector3(-1.5f, 2, 0.017f), localAngles = new Vector3(358.030f, 266.808f, 1.436998f), localScale = new Vector3(-3, 3, 3), limbMask = LimbFlags.None } } } }); list.Add(new ItemDisplayRuleSet.NamedRuleGroup { name = "NovaOnHeal", displayRuleGroup = new DisplayRuleGroup { rules = new ItemDisplayRule[] { new ItemDisplayRule { ruleType = ItemDisplayRuleType.ParentedPrefab, followerPrefab = ItemDisplays.LoadDisplay("DisplayDevilHorns"), childName = "Head", localPos = new Vector3(1.25f, -1, 0), localAngles = new Vector3(3.536957f, 0.01489126f, 14.99564f), localScale = new Vector3(5, 5, 5), limbMask = LimbFlags.None }, new ItemDisplayRule { ruleType = ItemDisplayRuleType.ParentedPrefab, followerPrefab = ItemDisplays.LoadDisplay("DisplayDevilHorns"), childName = "Head", localPos = new Vector3(-1.25f, -1, 0), localAngles = new Vector3(3.536963f, 0.0149023f, 344.9955f), localScale = new Vector3(-5, 5, 5), limbMask = LimbFlags.None } } } }); list.Add(new ItemDisplayRuleSet.NamedRuleGroup { name = "KillEliteFrenzy", displayRuleGroup = new DisplayRuleGroup { rules = new ItemDisplayRule[] { new ItemDisplayRule { ruleType = ItemDisplayRuleType.ParentedPrefab, followerPrefab = ItemDisplays.LoadDisplay("DisplayBrainstalk"), childName = "Head", localPos = new Vector3(0, 1.5f, 0), localAngles = new Vector3(0, 0, 0), localScale = new Vector3(2, 2, 2), limbMask = LimbFlags.None } } } }); list.Add(new ItemDisplayRuleSet.NamedRuleGroup { name = "Clover", displayRuleGroup = new DisplayRuleGroup { rules = new ItemDisplayRule[] { new ItemDisplayRule { ruleType = ItemDisplayRuleType.ParentedPrefab, followerPrefab = ItemDisplays.LoadDisplay("DisplayClover"), childName = "Head", localPos = new Vector3(-1.5f, 3, 0), localAngles = new Vector3(0, 0, 0), localScale = new Vector3(4, 4, 4), limbMask = LimbFlags.None } } } }); list.Add(new ItemDisplayRuleSet.NamedRuleGroup { name = "CritGlasses", displayRuleGroup = new DisplayRuleGroup { rules = new ItemDisplayRule[] { new ItemDisplayRule { ruleType = ItemDisplayRuleType.ParentedPrefab, followerPrefab = ItemDisplays.LoadDisplay("DisplayGlasses"), childName = "Mask", localPos = new Vector3(0, 0, 0.5f), localAngles = new Vector3(-90, 180, 0), localScale = new Vector3(4, 4, 4), limbMask = LimbFlags.None } } } }); list.Add(new ItemDisplayRuleSet.NamedRuleGroup { name = "GhostOnKill", displayRuleGroup = new DisplayRuleGroup { rules = new ItemDisplayRule[] { new ItemDisplayRule { ruleType = ItemDisplayRuleType.ParentedPrefab, followerPrefab = ItemDisplays.LoadDisplay("DisplayMask"), childName = "Head", localPos = new Vector3(0, 1, 2), localAngles = new Vector3(0, 0, 0), localScale = new Vector3(4, 4, 4), limbMask = LimbFlags.None } } } }); list.Add(new ItemDisplayRuleSet.NamedRuleGroup { name = "AttackSpeedOnCrit", displayRuleGroup = new DisplayRuleGroup { rules = new ItemDisplayRule[] { new ItemDisplayRule { ruleType = ItemDisplayRuleType.ParentedPrefab, followerPrefab = ItemDisplays.LoadDisplay("DisplayWolfPelt"), childName = "Head", localPos = new Vector3(0, 2, 1), localAngles = new Vector3(0, 0, 0), localScale = new Vector3(4, 4, 4), limbMask = LimbFlags.None } } } }); list.Add(new ItemDisplayRuleSet.NamedRuleGroup { name = "GoldOnHit", displayRuleGroup = loader.FindItemDisplayRuleGroup("GoldOnHit") }); list.Add(new ItemDisplayRuleSet.NamedRuleGroup { name = "ShieldOnly", displayRuleGroup = new DisplayRuleGroup { rules = new ItemDisplayRule[] { new ItemDisplayRule { ruleType = ItemDisplayRuleType.ParentedPrefab, followerPrefab = ItemDisplays.LoadDisplay("DisplayShieldBug"), childName = "Head", localPos = new Vector3(0.75f, -0.2f, 0.5f), localAngles = new Vector3(0, 0, 0), localScale = new Vector3(4, 4, 4), limbMask = LimbFlags.None }, new ItemDisplayRule { ruleType = ItemDisplayRuleType.ParentedPrefab, followerPrefab = ItemDisplays.LoadDisplay("DisplayShieldBug"), childName = "Head", localPos = new Vector3(-0.75f, -0.2f, 0.5f), localAngles = new Vector3(0, 0, 0), localScale = new Vector3(-4, 4, 4), limbMask = LimbFlags.None } } } }); list.Add(new ItemDisplayRuleSet.NamedRuleGroup { name = "HeadHunter", displayRuleGroup = loader.FindItemDisplayRuleGroup("HeadHunter") }); list.Add(new ItemDisplayRuleSet.NamedRuleGroup { name = "JumpBoost", displayRuleGroup = new DisplayRuleGroup { rules = new ItemDisplayRule[] { new ItemDisplayRule { ruleType = ItemDisplayRuleType.ParentedPrefab, followerPrefab = ItemDisplays.LoadDisplay("DisplayWaxBird"), childName = "Head", localPos = new Vector3(0, -0.5f, -1), localAngles = new Vector3(0, 0, 0), localScale = new Vector3(5, 5, 5), limbMask = LimbFlags.None } } } }); list.Add(new ItemDisplayRuleSet.NamedRuleGroup { name = "Bandolier", displayRuleGroup = new DisplayRuleGroup { rules = new ItemDisplayRule[] { new ItemDisplayRule { ruleType = ItemDisplayRuleType.ParentedPrefab, followerPrefab = ItemDisplays.LoadDisplay("DisplayBandolier"), childName = "MuzzleJar", localPos = new Vector3(0, 0, 0), localAngles = new Vector3(90, 0, 0), localScale = new Vector3(7, 8, 10), limbMask = LimbFlags.None } } } }); list.Add(new ItemDisplayRuleSet.NamedRuleGroup { name = "DeathMark", displayRuleGroup = new DisplayRuleGroup { rules = new ItemDisplayRule[] { new ItemDisplayRule { ruleType = ItemDisplayRuleType.ParentedPrefab, followerPrefab = ItemDisplays.LoadDisplay("DisplayDeathMark"), childName = "MuzzleJar", localPos = new Vector3(0, 0, 0), localAngles = new Vector3(0, 0, 0), localScale = new Vector3(0.75f, 0.75f, 0.75f), limbMask = LimbFlags.None } } } }); list.Add(new ItemDisplayRuleSet.NamedRuleGroup { name = "WarCryOnMultiKill", displayRuleGroup = new DisplayRuleGroup { rules = new ItemDisplayRule[] { new ItemDisplayRule { ruleType = ItemDisplayRuleType.ParentedPrefab, followerPrefab = ItemDisplays.LoadDisplay("DisplayPauldron"), childName = "Head", localPos = new Vector3(0, 1, 2), localAngles = new Vector3(-90, 180, 0), localScale = new Vector3(5, 5, 5), limbMask = LimbFlags.None } } } }); list.Add(new ItemDisplayRuleSet.NamedRuleGroup { name = "Mushroom", displayRuleGroup = new DisplayRuleGroup { rules = new ItemDisplayRule[] { new ItemDisplayRule { ruleType = ItemDisplayRuleType.ParentedPrefab, followerPrefab = ItemDisplays.LoadDisplay("DisplayMushroom"), childName = "Mask", localPos = new Vector3(0.5f, -0.5f, 2.4f), localAngles = new Vector3(90, 25, 0), localScale = new Vector3(0.5f, 0.5f, 0.5f), limbMask = LimbFlags.None } } } }); list.Add(new ItemDisplayRuleSet.NamedRuleGroup { name = "BarrierOnOverHeal", displayRuleGroup = new DisplayRuleGroup { rules = new ItemDisplayRule[] { new ItemDisplayRule { ruleType = ItemDisplayRuleType.ParentedPrefab, followerPrefab = ItemDisplays.LoadDisplay("DisplayAegis"), childName = "MuzzleJar", localPos = new Vector3(3.5f, -2, 0), localAngles = new Vector3(90, -90, 0), localScale = new Vector3(3, 3, 3), limbMask = LimbFlags.None } } } }); list.Add(new ItemDisplayRuleSet.NamedRuleGroup { name = "Behemoth", displayRuleGroup = new DisplayRuleGroup { rules = new ItemDisplayRule[] { new ItemDisplayRule { ruleType = ItemDisplayRuleType.ParentedPrefab, followerPrefab = ItemDisplays.LoadDisplay("DisplayBehemoth"), childName = "MuzzleJar", localPos = new Vector3(0, -2, -5), localAngles = new Vector3(180, 0, 0), localScale = new Vector3(1, 1, 1), limbMask = LimbFlags.None } } } }); list.Add(new ItemDisplayRuleSet.NamedRuleGroup { name = "NearbyDamageBonus", displayRuleGroup = new DisplayRuleGroup { rules = new ItemDisplayRule[] { new ItemDisplayRule { ruleType = ItemDisplayRuleType.ParentedPrefab, followerPrefab = ItemDisplays.LoadDisplay("DisplayDiamond"), childName = "HandL", localPos = new Vector3(0, 0, -2.75f), localAngles = new Vector3(0, 0, 0), localScale = new Vector3(0.7f, 0.7f, 0.7f), limbMask = LimbFlags.None } } } }); list.Add(new ItemDisplayRuleSet.NamedRuleGroup { name = "FireRing", displayRuleGroup = new DisplayRuleGroup { rules = new ItemDisplayRule[] { new ItemDisplayRule { ruleType = ItemDisplayRuleType.ParentedPrefab, followerPrefab = ItemDisplays.LoadDisplay("DisplayFireRing"), childName = "HandL", localPos = new Vector3(0.25f, 0, 0), localAngles = new Vector3(90, 0, 0), localScale = new Vector3(4, 4, 4), limbMask = LimbFlags.None } } } }); list.Add(new ItemDisplayRuleSet.NamedRuleGroup { name = "IceRing", displayRuleGroup = new DisplayRuleGroup { rules = new ItemDisplayRule[] { new ItemDisplayRule { ruleType = ItemDisplayRuleType.ParentedPrefab, followerPrefab = ItemDisplays.LoadDisplay("DisplayIceRing"), childName = "HandR", localPos = new Vector3(-0.25f, 0, 0), localAngles = new Vector3(90, 0, 0), localScale = new Vector3(4, 4, 4), limbMask = LimbFlags.None } } } }); list.Add(new ItemDisplayRuleSet.NamedRuleGroup { name = "ArmorPlate", displayRuleGroup = new DisplayRuleGroup { rules = new ItemDisplayRule[] { new ItemDisplayRule { ruleType = ItemDisplayRuleType.ParentedPrefab, followerPrefab = ItemDisplays.LoadDisplay("DisplayRepulsionArmorPlate"), childName = "Head", localPos = new Vector3(0, 1.5f, -2), localAngles = new Vector3(-25, 0, 180), localScale = new Vector3(3, 3, 3), limbMask = LimbFlags.None } } } }); list.Add(new ItemDisplayRuleSet.NamedRuleGroup { name = "Bear", displayRuleGroup = new DisplayRuleGroup { rules = new ItemDisplayRule[] { new ItemDisplayRule { ruleType = ItemDisplayRuleType.ParentedPrefab, followerPrefab = ItemDisplays.LoadDisplay("DisplayBear"), childName = "Head", localPos = new Vector3(-1.9f, 0.5f, -1.5f), localAngles = new Vector3(0, -90, 0), localScale = new Vector3(2, 2, 2), limbMask = LimbFlags.None } } } }); list.Add(new ItemDisplayRuleSet.NamedRuleGroup { name = "Medkit", displayRuleGroup = new DisplayRuleGroup { rules = new ItemDisplayRule[] { new ItemDisplayRule { ruleType = ItemDisplayRuleType.ParentedPrefab, followerPrefab = ItemDisplays.LoadDisplay("DisplayMedkit"), childName = "Head", localPos = new Vector3(2, 0, 0), localAngles = new Vector3(-90, 90, 0), localScale = new Vector3(3, 3, 3), limbMask = LimbFlags.None } } } }); list.Add(new ItemDisplayRuleSet.NamedRuleGroup { name = "Dagger", displayRuleGroup = new DisplayRuleGroup { rules = new ItemDisplayRule[] { new ItemDisplayRule { ruleType = ItemDisplayRuleType.ParentedPrefab, followerPrefab = ItemDisplays.LoadDisplay("DisplayDagger"), childName = "Head", localPos = new Vector3(0, 0, 0), localAngles = new Vector3(0, 0, 0), localScale = new Vector3(6, 6, 6), limbMask = LimbFlags.None } } } }); list.Add(new ItemDisplayRuleSet.NamedRuleGroup { name = "ChainLightning", displayRuleGroup = new DisplayRuleGroup { rules = new ItemDisplayRule[] { new ItemDisplayRule { ruleType = ItemDisplayRuleType.ParentedPrefab, followerPrefab = ItemDisplays.LoadDisplay("DisplayUkulele"), childName = "MuzzleJar", localPos = new Vector3(-3.2f, -2.5f, 1), localAngles = new Vector3(0, -90, 180), localScale = new Vector3(2, 2, 2), limbMask = LimbFlags.None } } } }); list.Add(new ItemDisplayRuleSet.NamedRuleGroup { name = "Syringe", displayRuleGroup = new DisplayRuleGroup { rules = new ItemDisplayRule[] { new ItemDisplayRule { ruleType = ItemDisplayRuleType.ParentedPrefab, followerPrefab = ItemDisplays.LoadDisplay("DisplaySyringeCluster"), childName = "Head", localPos = new Vector3(0, 2, 0), localAngles = new Vector3(300, 0, 0), localScale = new Vector3(2, 2, 2), limbMask = LimbFlags.None } } } }); list.Add(new ItemDisplayRuleSet.NamedRuleGroup { name = "ArmorReductionOnHit", displayRuleGroup = new DisplayRuleGroup { rules = new ItemDisplayRule[] { new ItemDisplayRule { ruleType = ItemDisplayRuleType.ParentedPrefab, followerPrefab = ItemDisplays.LoadDisplay("DisplayWarhammer"), childName = "MuzzleJar", localPos = new Vector3(0, -4, -3), localAngles = new Vector3(90, 0, 0), localScale = new Vector3(2, 2, 2), limbMask = LimbFlags.None } } } }); list.Add(new ItemDisplayRuleSet.NamedRuleGroup { name = "FallBoots", displayRuleGroup = new DisplayRuleGroup { rules = new ItemDisplayRule[] { new ItemDisplayRule { ruleType = ItemDisplayRuleType.ParentedPrefab, followerPrefab = ItemDisplays.LoadDisplay("DisplayGravBoots"), childName = "FootL", localPos = new Vector3(0, -0.05f, 0), localAngles = new Vector3(45, 0, 0), localScale = new Vector3(0.25f, 0.25f, 0.25f), limbMask = LimbFlags.None }, new ItemDisplayRule { ruleType = ItemDisplayRuleType.ParentedPrefab, followerPrefab = ItemDisplays.LoadDisplay("DisplayGravBoots"), childName = "FootR", localPos = new Vector3(0, -0.05f, 0), localAngles = new Vector3(70, 0, 0), localScale = new Vector3(0.25f, 0.25f, 0.25f), limbMask = LimbFlags.None } } } }); list.Add(new ItemDisplayRuleSet.NamedRuleGroup { name = "BounceNearby", displayRuleGroup = new DisplayRuleGroup { rules = new ItemDisplayRule[] { new ItemDisplayRule { ruleType = ItemDisplayRuleType.ParentedPrefab, followerPrefab = ItemDisplays.LoadDisplay("DisplayHook"), childName = "HandR", localPos = new Vector3(0, 0, -0.25f), localAngles = new Vector3(0, 0, 0), localScale = new Vector3(1, 1, 1), limbMask = LimbFlags.None } } } }); list.Add(new ItemDisplayRuleSet.NamedRuleGroup { name = "SprintWisp", displayRuleGroup = new DisplayRuleGroup { rules = new ItemDisplayRule[] { new ItemDisplayRule { ruleType = ItemDisplayRuleType.ParentedPrefab, followerPrefab = ItemDisplays.LoadDisplay("DisplayBrokenMask"), childName = "Mask", localPos = new Vector3(0, 0.25f, 1.5f), localAngles = new Vector3(-110, 0, 180), localScale = new Vector3(2, 2, 2), limbMask = LimbFlags.None } } } }); list.Add(new ItemDisplayRuleSet.NamedRuleGroup { name = "Hoof", displayRuleGroup = new DisplayRuleGroup { rules = new ItemDisplayRule[] { new ItemDisplayRule { ruleType = ItemDisplayRuleType.ParentedPrefab, followerPrefab = ItemDisplays.LoadDisplay("DisplayHoof"), childName = "FootL", localPos = new Vector3(0, 0.25f, 0.75f), localAngles = new Vector3(20, 0, 180), localScale = new Vector3(0.75f, 0.5f, 0.25f), limbMask = LimbFlags.None } } } }); list.Add(new ItemDisplayRuleSet.NamedRuleGroup { name = "Incubator", displayRuleGroup = new DisplayRuleGroup { rules = new ItemDisplayRule[] { new ItemDisplayRule { ruleType = ItemDisplayRuleType.ParentedPrefab, followerPrefab = ItemDisplays.LoadDisplay("DisplayAncestralIncubator"), childName = "MuzzleJar", localPos = new Vector3(0, -4.5f, 0), localAngles = new Vector3(0, 0, 0), localScale = new Vector3(1.25f, 1, 1.25f), limbMask = LimbFlags.None } } } }); list.Add(new ItemDisplayRuleSet.NamedRuleGroup { name = "ExplodeOnDeath", displayRuleGroup = new DisplayRuleGroup { rules = new ItemDisplayRule[] { new ItemDisplayRule { ruleType = ItemDisplayRuleType.ParentedPrefab, followerPrefab = ItemDisplays.LoadDisplay("DisplayWilloWisp"), childName = "Head", localPos = new Vector3(-8.5f, 2.75f, 0), localAngles = new Vector3(0, 0, 45), localScale = new Vector3(1, 1, 1), limbMask = LimbFlags.None } } } }); list.Add(new ItemDisplayRuleSet.NamedRuleGroup { name = "ExecuteLowHealthElite", displayRuleGroup = new DisplayRuleGroup { rules = new ItemDisplayRule[] { new ItemDisplayRule { ruleType = ItemDisplayRuleType.ParentedPrefab, followerPrefab = ItemDisplays.LoadDisplay("DisplayGuillotine"), childName = "Head", localPos = new Vector3(8.5f, 2.75f, 0), localAngles = new Vector3(0, 0, -45), localScale = new Vector3(1, 1, 1), limbMask = LimbFlags.None } } } }); //something something list2.Add(new ItemDisplayRuleSet.NamedRuleGroup { name = "Meteor", displayRuleGroup = new DisplayRuleGroup { rules = new ItemDisplayRule[] { new ItemDisplayRule { ruleType = ItemDisplayRuleType.ParentedPrefab, followerPrefab = ItemDisplays.LoadDisplay("DisplayMeteor"), childName = "Root", localPos = new Vector3(0, 10.5f, -12), localAngles = new Vector3(0, 0, 0), localScale = new Vector3(2, 2, 2), limbMask = LimbFlags.None } } } }); list2.Add(new ItemDisplayRuleSet.NamedRuleGroup { name = "Saw", displayRuleGroup = new DisplayRuleGroup { rules = new ItemDisplayRule[] { new ItemDisplayRule { ruleType = ItemDisplayRuleType.ParentedPrefab, followerPrefab = ItemDisplays.LoadDisplay("DisplaySawmerang"), childName = "Root", localPos = new Vector3(0, 10.5f, -12), localAngles = new Vector3(-90, 0, 0), localScale = new Vector3(0.4f, 0.4f, 0.4f), limbMask = LimbFlags.None } } } }); list2.Add(new ItemDisplayRuleSet.NamedRuleGroup { name = "Blackhole", displayRuleGroup = new DisplayRuleGroup { rules = new ItemDisplayRule[] { new ItemDisplayRule { ruleType = ItemDisplayRuleType.ParentedPrefab, followerPrefab = ItemDisplays.LoadDisplay("DisplayGravCube"), childName = "Root", localPos = new Vector3(0, 16, -6), localAngles = new Vector3(0, 0, 0), localScale = new Vector3(1, 1, 1), limbMask = LimbFlags.None } } } }); list.Add(new ItemDisplayRuleSet.NamedRuleGroup { name = "Icicle", displayRuleGroup = new DisplayRuleGroup { rules = new ItemDisplayRule[] { new ItemDisplayRule { ruleType = ItemDisplayRuleType.ParentedPrefab, followerPrefab = ItemDisplays.LoadDisplay("DisplayFrostRelic"), childName = "Root", localPos = new Vector3(-2, 13, -4), localAngles = new Vector3(90, 0, 0), localScale = new Vector3(2, 2, 2), limbMask = LimbFlags.None } } } }); list.Add(new ItemDisplayRuleSet.NamedRuleGroup { name = "Talisman", displayRuleGroup = new DisplayRuleGroup { rules = new ItemDisplayRule[] { new ItemDisplayRule { ruleType = ItemDisplayRuleType.ParentedPrefab, followerPrefab = ItemDisplays.LoadDisplay("DisplayTalisman"), childName = "Root", localPos = new Vector3(4, 12, -6), localAngles = new Vector3(0, 0, 0), localScale = new Vector3(1, 1, 1), limbMask = LimbFlags.None } } } }); /*list.Add(new ItemDisplayRuleSet.NamedRuleGroup * { * name = "LaserTurbine", * displayRuleGroup = new DisplayRuleGroup * { * rules = new ItemDisplayRule[] * { * new ItemDisplayRule * { * ruleType = ItemDisplayRuleType.ParentedPrefab, * followerPrefab = ItemDisplays.LoadDisplay("DisplayLaserTurbine"), * childName = "Root", * localPos = new Vector3(0, 0, 0), * localAngles = new Vector3(0, 0, 0), * localScale = new Vector3(1, 1, 1), * limbMask = LimbFlags.None * } * } * } * });*/ list.Add(new ItemDisplayRuleSet.NamedRuleGroup { name = "FocusConvergence", displayRuleGroup = new DisplayRuleGroup { rules = new ItemDisplayRule[] { new ItemDisplayRule { ruleType = ItemDisplayRuleType.ParentedPrefab, followerPrefab = ItemDisplays.LoadDisplay("DisplayFocusedConvergence"), childName = "Root", localPos = new Vector3(0, 16, -12), localAngles = new Vector3(0, 0, 0), localScale = new Vector3(0.25f, 0.25f, 0.25f), limbMask = LimbFlags.None } } } }); BindingFlags bindingAttr = BindingFlags.Instance | BindingFlags.Static | BindingFlags.Public | BindingFlags.NonPublic; ItemDisplayRuleSet.NamedRuleGroup[] value = list.ToArray(); ItemDisplayRuleSet.NamedRuleGroup[] value2 = list2.ToArray(); typeof(ItemDisplayRuleSet).GetField("namedItemRuleGroups", bindingAttr).SetValue(itemDisplayRuleSet, value); typeof(ItemDisplayRuleSet).GetField("namedEquipmentRuleGroups", bindingAttr).SetValue(itemDisplayRuleSet, value2); characterModel.itemDisplayRuleSet = itemDisplayRuleSet; }
public static void DisplayRules(GameObject clayObject) { ChildLocator cl = clayObject.GetComponentInChildren <ChildLocator>(); Array.Resize(ref cl.transformPairs, cl.transformPairs.Length + 1); cl.transformPairs[cl.transformPairs.Length - 1] = new ChildLocator.NameTransformPair { name = "Head", transform = headTransform }; PopulateDisplays(); ItemDisplayRuleSet idrsClay = ScriptableObject.CreateInstance <ItemDisplayRuleSet>(); equipmentList = new List <ItemDisplayRuleSet.KeyAssetRuleGroup>(); equipmentList.Add(new ItemDisplayRuleSet.KeyAssetRuleGroup { keyAsset = RoR2Content.Equipment.AffixPoison, displayRuleGroup = new DisplayRuleGroup { rules = new ItemDisplayRule[] { new ItemDisplayRule { ruleType = ItemDisplayRuleType.ParentedPrefab, followerPrefab = LoadDisplay("DisplayEliteUrchinCrown"), childName = "Head", localPos = new Vector3(0f, 0.4f, 0f), localAngles = new Vector3(255f, 0f, 0f), localScale = 0.07f * Vector3.one, limbMask = LimbFlags.None } } } }); equipmentList.Add(new ItemDisplayRuleSet.KeyAssetRuleGroup { keyAsset = RoR2Content.Equipment.AffixHaunted, displayRuleGroup = new DisplayRuleGroup { rules = new ItemDisplayRule[] { new ItemDisplayRule { ruleType = ItemDisplayRuleType.ParentedPrefab, followerPrefab = LoadDisplay("DisplayEliteStealthCrown"), childName = "Head", localPos = new Vector3(0f, 0.3f, 0f), localAngles = new Vector3(260f, 0f, 0f), localScale = 0.07f * Vector3.one, limbMask = LimbFlags.None } } } }); equipmentList.Add(new ItemDisplayRuleSet.KeyAssetRuleGroup { keyAsset = RoR2Content.Equipment.AffixWhite, displayRuleGroup = new DisplayRuleGroup { rules = new ItemDisplayRule[] { new ItemDisplayRule { ruleType = ItemDisplayRuleType.ParentedPrefab, followerPrefab = LoadDisplay("DisplayEliteIceCrown"), childName = "Head", localPos = new Vector3(0f, 0.33f, -0.05f), localAngles = new Vector3(260f, 0f, 0f), localScale = 0.035f * Vector3.one, limbMask = LimbFlags.None } } } }); equipmentList.Add(new ItemDisplayRuleSet.KeyAssetRuleGroup { keyAsset = RoR2Content.Equipment.AffixBlue, displayRuleGroup = new DisplayRuleGroup { rules = new ItemDisplayRule[] { new ItemDisplayRule { ruleType = ItemDisplayRuleType.ParentedPrefab, followerPrefab = LoadDisplay("DisplayEliteRhinoHorn"), childName = "Head", localPos = new Vector3(0f, 0.28f, 0.1f), localAngles = new Vector3(-20f, 0f, 0f), localScale = 0.18f * Vector3.one, limbMask = LimbFlags.None }, new ItemDisplayRule { ruleType = ItemDisplayRuleType.ParentedPrefab, followerPrefab = LoadDisplay("DisplayEliteRhinoHorn"), childName = "Head", localPos = new Vector3(0f, 0.21f, 0.1f), localAngles = new Vector3(-10f, 0f, 0f), localScale = 0.25f * Vector3.one, limbMask = LimbFlags.None } } } }); equipmentList.Add(new ItemDisplayRuleSet.KeyAssetRuleGroup { keyAsset = RoR2Content.Equipment.AffixRed, displayRuleGroup = new DisplayRuleGroup { rules = new ItemDisplayRule[] { new ItemDisplayRule { ruleType = ItemDisplayRuleType.ParentedPrefab, followerPrefab = LoadDisplay("DisplayEliteHorn"), childName = "Head", localPos = new Vector3(-0.1f, 0.25f, -0.1f), localAngles = new Vector3(0f, 20f, 0f), localScale = 0.1f * Vector3.one, limbMask = LimbFlags.None }, new ItemDisplayRule { ruleType = ItemDisplayRuleType.ParentedPrefab, followerPrefab = LoadDisplay("DisplayEliteHorn"), childName = "Head", localPos = new Vector3(0.1f, 0.25f, -0.1f), localAngles = new Vector3(0f, -20f, 0f), localScale = 0.1f * Vector3.one, limbMask = LimbFlags.None } } } }); idrsClay.keyAssetRuleGroups = equipmentList.ToArray(); CharacterModel characterModel = clayObject.GetComponent <ModelLocator>().modelTransform.GetComponent <CharacterModel>(); characterModel.itemDisplayRuleSet = idrsClay; characterModel.itemDisplayRuleSet.GenerateRuntimeValues(); itemDisplayPrefabs.Clear(); }
internal static void RegisterVariants() { // gather materials and meshes to use for variants ItemDisplayRuleSet itemDisplayRuleSet = Resources.Load <GameObject>("Prefabs/CharacterBodies/CommandoBody").GetComponent <ModelLocator>().modelTransform.GetComponent <CharacterModel>().itemDisplayRuleSet; Material lunarGolemMat = UnityEngine.Object.Instantiate(Resources.Load <GameObject>("Prefabs/CharacterBodies/LunarGolemBody").GetComponentInChildren <CharacterModel>().baseRendererInfos[0].defaultMaterial); Material perforatorMat = UnityEngine.Object.Instantiate(itemDisplayRuleSet.FindItemDisplayRuleGroup("FireballsOnHit").rules[0].followerPrefab.GetComponentInChildren <MeshRenderer>().material); //Material glandMat = UnityEngine.Object.Instantiate(itemDisplayRuleSet.FindItemDisplayRuleGroup("BeetleGland").rules[0].followerPrefab.GetComponentInChildren<MeshRenderer>().material); Material visionsMat = UnityEngine.Object.Instantiate(itemDisplayRuleSet.FindItemDisplayRuleGroup("LunarPrimaryReplacement").rules[0].followerPrefab.GetComponentInChildren <MeshRenderer>().material); Material ghostMat = Resources.Load <Material>("Materials/matGhostEffect"); Material shatterspleenMat = UnityEngine.Object.Instantiate(itemDisplayRuleSet.FindItemDisplayRuleGroup("BleedOnHitAndExplode").rules[0].followerPrefab.GetComponentInChildren <MeshRenderer>().material); Material solusMat = UnityEngine.Object.Instantiate(Resources.Load <GameObject>("Prefabs/CharacterBodies/RoboBallBossBody").GetComponentInChildren <CharacterModel>().baseRendererInfos[0].defaultMaterial); missileLauncherDisplayPrefab = itemDisplayRuleSet.FindEquipmentDisplayRuleGroup("CommandMissile").rules[0].followerPrefab; //Mesh beedlMesh = Modules.Assets.armoredMesh; //Mesh beedlSpeedMesh = Modules.Assets.speedyBeetleMesh; // add simple variants AddSimpleVariant("Beetle", Modules.Config.armoredBeetleSpawnRate.Value, MonsterVariantTier.Common, GroundSizeModifier(1.5f), 3f, 1f, 1f, 1f, 1f, 0f, 20); // Armored AddSimpleVariant("Golem", Modules.Config.fullAutoGolemSpawnRate.Value, MonsterVariantTier.Rare, null, 1f, 1f, 8f, 0.8f, 1f, -20f, 20, lunarGolemMat); // Full-Auto AddSimpleVariant("Golem", Modules.Config.titanletSpawnRate.Value, MonsterVariantTier.Uncommon, GroundSizeModifier(2.5f), 4f, 0.5f, 1f, 3f, 1f, 0f); // Titanlet AddSimpleVariant("BeetleGuard", Modules.Config.beetleGuardBruteSpawnRate.Value, MonsterVariantTier.Uncommon, GroundSizeModifier(1.1f), 2f, 0.5f, 0.9f, 1.4f, 1f, 10f); // Brute AddSimpleVariant("Bison", Modules.Config.speedyBisonSpawnRate.Value, MonsterVariantTier.Common, null, 1f, 4f, 1f, 1f, 1f, 0f); // Speedy AddSimpleVariant("Bison", Modules.Config.speedyBisonSpawnRate.Value, MonsterVariantTier.Uncommon, GroundSizeModifier(1.25f), 3f, 1f, 1f, 1f, 1f, 20f, 0, lunarGolemMat); // Albino AddSimpleVariant("Titan", Modules.Config.golemletSpawnRate.Value, MonsterVariantTier.Common, GroundSizeModifier(0.3f), 1f, 5f, 1f, 1f, 1f, 0f, 0); // Golemlet AddSimpleVariant("Titan", Modules.Config.colossalTitanSpawnRate.Value, MonsterVariantTier.Rare, GroundSizeModifier(3f), 3f, 0.5f, 1f, 2f, 1f, 50f, 3); // Colossus // flushed AddSimpleVariant("BeetleQueen2", 2, MonsterVariantTier.Common, GroundSizeModifier(0.25f), 0.8f, 5f, 1f, 1f, 1f, 0f); // Stupid // Generic CDR inventory ItemInfo[] rapidFireInventory = SimpleInventory("AlienHead", 20); // Full Shield inventory ItemInfo[] fullShieldInventory = SimpleInventory("ShieldOnly"); // SPEED inventory ItemInfo[] speedInventory = SimpleInventory("Hoof", 5); // Cursed Jellyfish inventory // i sincerely apologize ItemInfo[] hellInventory = new ItemInfo[] { SimpleItem("IceRing", 2), SimpleItem("SprintOutOfCombat", 3), SimpleItem("Crowbar", 1) }; // Infernal Wisp inventory ItemInfo[] wispInventory = new ItemInfo[] { SimpleItem("CritGlasses", 10), SimpleItem("Behemoth", 3) }; // Clotted Imp inventory ItemInfo[] clottedInventory = new ItemInfo[] { SimpleItem("UtilitySkillMagazine", 2), SimpleItem("CritGlasses", 4), SimpleItem("BleedOnHitAndExplode", 1) }; // Artillery Vulture inventory ItemInfo[] artilleryInventory = new ItemInfo[] { SimpleItem("Clover", 3), SimpleItem("Missile", 1), SimpleItem("Behemoth", 3) }; // Speedy Beetle AddVariant(new MonsterVariantInfo { bodyName = "Beetle", spawnRate = Modules.Config.speedyBeetleSpawnRate.Value, variantTier = MonsterVariantTier.Common, sizeModifier = null, healthMultiplier = 1f, moveSpeedMultiplier = 1f, attackSpeedMultiplier = 3f, damageMultiplier = 1f, armorMultiplier = 1f, armorBonus = 0f, customInventory = speedInventory, meshReplacement = null, materialReplacement = null, skillReplacement = null }); // Flamethrower Lemurian AddVariant(new MonsterVariantInfo { bodyName = "Lemurian", spawnRate = Modules.Config.flamethrowerLemurianSpawnRate.Value, variantTier = MonsterVariantTier.Rare, sizeModifier = GroundSizeModifier(1.1f), healthMultiplier = 1f, moveSpeedMultiplier = 1f, attackSpeedMultiplier = 30f, damageMultiplier = 0.4f, armorMultiplier = 1f, armorBonus = 0f, customInventory = rapidFireInventory, meshReplacement = null, materialReplacement = SimpleMaterialReplacement(perforatorMat), skillReplacement = null }); // Badass Lemurian AddVariant(new MonsterVariantInfo { bodyName = "Lemurian", spawnRate = Modules.Config.badassLemurianSpawnRate.Value, variantTier = MonsterVariantTier.Common, sizeModifier = null, healthMultiplier = 1f, moveSpeedMultiplier = 1f, attackSpeedMultiplier = 1f, damageMultiplier = 1f, armorMultiplier = 1f, armorBonus = 0f, customInventory = null, meshReplacement = null, materialReplacement = null, skillReplacement = PrimaryReplacement(Modules.Skills.missileLaunchDef) }); // Nuclear Jellyfish AddVariant(new MonsterVariantInfo { bodyName = "Jellyfish", spawnRate = Modules.Config.nuclearJellyfishSpawnRate.Value, variantTier = MonsterVariantTier.Common, sizeModifier = FlyingSizeModifier(2f), healthMultiplier = 15f, moveSpeedMultiplier = 0.75f, attackSpeedMultiplier = 1f, damageMultiplier = 6f, armorMultiplier = 1f, armorBonus = 20f, customInventory = null, meshReplacement = null, materialReplacement = SimpleMaterialReplacement(visionsMat), skillReplacement = SecondaryReplacement(Modules.Skills.nuclearNovaDef) }); // M.O.A.J AddVariant(new MonsterVariantInfo { bodyName = "Jellyfish", spawnRate = Modules.Config.MOAJSpawnRate.Value, variantTier = MonsterVariantTier.Rare, sizeModifier = FlyingSizeModifier(4f), healthMultiplier = 40f, moveSpeedMultiplier = 0.4f, attackSpeedMultiplier = 1f, damageMultiplier = 1f, armorMultiplier = 1f, armorBonus = 80f, customInventory = null, meshReplacement = null, materialReplacement = SimpleMaterialReplacement(solusMat), skillReplacement = SecondaryReplacement(Modules.Skills.spawnNovaDef) }); // Overcharged Golem AddVariant(new MonsterVariantInfo { bodyName = "Golem", spawnRate = Modules.Config.overchargedGolemSpawnRate.Value, variantTier = MonsterVariantTier.Common, sizeModifier = null, healthMultiplier = 1f, moveSpeedMultiplier = 1f, attackSpeedMultiplier = 1f, damageMultiplier = 1f, armorMultiplier = 1f, armorBonus = 0f, customInventory = fullShieldInventory, meshReplacement = null, materialReplacement = null, skillReplacement = null }); // Cursed Jellyfish AddVariant(new MonsterVariantInfo { bodyName = "Jellyfish", spawnRate = Modules.Config.cursedJellyfishSpawnRate.Value, variantTier = MonsterVariantTier.Rare, sizeModifier = null, healthMultiplier = 0.8f, moveSpeedMultiplier = 1f, attackSpeedMultiplier = 1.5f, damageMultiplier = 1f, armorMultiplier = 1f, armorBonus = 0f, customInventory = hellInventory, meshReplacement = null, materialReplacement = SimpleMaterialReplacement(perforatorMat), skillReplacement = null }); // Spectral Jellyfish AddVariant(new MonsterVariantInfo { bodyName = "Jellyfish", spawnRate = Modules.Config.spectralJellyfishSpawnRate.Value, variantTier = MonsterVariantTier.Rare, sizeModifier = FlyingSizeModifier(0.8f), healthMultiplier = 0.5f, moveSpeedMultiplier = 1.5f, attackSpeedMultiplier = 1f, damageMultiplier = 0.5f, armorMultiplier = 1f, armorBonus = 0f, customInventory = SimpleInventory("ExtraLife"), meshReplacement = null, materialReplacement = SimpleMaterialReplacement(ghostMat), skillReplacement = null }); // Infernal Wisp AddVariant(new MonsterVariantInfo { bodyName = "Wisp", spawnRate = Modules.Config.infernalWispSpawnRate.Value, variantTier = MonsterVariantTier.Rare, sizeModifier = FlyingSizeModifier(1.2f), healthMultiplier = 1f, moveSpeedMultiplier = 0.8f, attackSpeedMultiplier = 0.6f, damageMultiplier = 2f, armorMultiplier = 1f, armorBonus = 0f, customInventory = wispInventory, meshReplacement = null, materialReplacement = null, skillReplacement = null }); // Clotted Imp AddVariant(new MonsterVariantInfo { bodyName = "Imp", spawnRate = Modules.Config.clottedImpSpawnRate.Value, variantTier = MonsterVariantTier.Uncommon, sizeModifier = GroundSizeModifier(0.8f), healthMultiplier = 0.8f, moveSpeedMultiplier = 1f, attackSpeedMultiplier = 1f, damageMultiplier = 1f, armorMultiplier = 1f, armorBonus = 0f, customInventory = clottedInventory, meshReplacement = null, materialReplacement = SimpleMaterialReplacement(shatterspleenMat), skillReplacement = null }); // Artillery Vulture AddVariant(new MonsterVariantInfo { bodyName = "Vulture", spawnRate = Modules.Config.artilleryVultureSpawnRate.Value, variantTier = MonsterVariantTier.Uncommon, sizeModifier = GroundSizeModifier(1.25f), healthMultiplier = 1f, moveSpeedMultiplier = 1f, attackSpeedMultiplier = 4f, damageMultiplier = 0.5f, armorMultiplier = 1f, armorBonus = 100f, customInventory = artilleryInventory, meshReplacement = null, materialReplacement = MultiMaterialReplacement(new Dictionary <int, Material> { { 0, perforatorMat }, { 2, solusMat } }), skillReplacement = null }); }