public void GrantUnlock(Interactor interactor) { if (!NetworkServer.active) { Debug.LogWarning("[Server] function 'System.Void RoR2.RadiotowerTerminal::GrantUnlock(RoR2.Interactor)' called on client"); return; } EffectManager.instance.SpawnEffect(this.unlockEffect, new EffectData { origin = base.transform.position }, true); this.SetHasBeenPurchased(true); if (Run.instance) { Util.PlaySound(this.unlockSoundString, interactor.gameObject); Run.instance.GrantUnlockToAllParticipatingPlayers(this.unlockableName); string pickupToken = "???"; UnlockableDef unlockableDef = UnlockableCatalog.GetUnlockableDef(this.unlockableName); if (unlockableDef != null) { pickupToken = unlockableDef.nameToken; } Chat.SendBroadcastChat(new Chat.PlayerPickupChatMessage { subjectCharacterBodyGameObject = interactor.gameObject, baseToken = "PLAYER_PICKUP", pickupToken = pickupToken, pickupColor = ColorCatalog.GetColor(ColorCatalog.ColorIndex.Unlockable), pickupQuantity = 1u }); } }
public void GrantUnlock(Interactor interactor) { if (!NetworkServer.active) { Debug.LogWarning("[Server] function 'System.Void RoR2.BlueprintTerminal::GrantUnlock(RoR2.Interactor)' called on client"); return; } this.SetHasBeenPurchased(true); string unlockableName = this.unlockableOptions[this.unlockableChoice].unlockableName; EffectManager.SpawnEffect(this.unlockEffect, new EffectData { origin = base.transform.position }, true); if (Run.instance) { Util.PlaySound(this.unlockSoundString, interactor.gameObject); CharacterBody component = interactor.GetComponent <CharacterBody>(); Run.instance.GrantUnlockToSinglePlayer(unlockableName, component); string pickupToken = "???"; UnlockableDef unlockableDef = UnlockableCatalog.GetUnlockableDef(unlockableName); if (unlockableDef != null) { pickupToken = unlockableDef.nameToken; } Chat.SendBroadcastChat(new Chat.PlayerPickupChatMessage { subjectAsCharacterBody = component, baseToken = "PLAYER_PICKUP", pickupToken = pickupToken, pickupColor = ColorCatalog.GetColor(ColorCatalog.ColorIndex.Unlockable), pickupQuantity = 1U }); } }
// Token: 0x06000D3E RID: 3390 RVA: 0x0003B854 File Offset: 0x00039A54 private static void OnPreRenderOutlineHighlight(OutlineHighlight outlineHighlight) { if (!outlineHighlight.sceneCamera) { return; } if (!outlineHighlight.sceneCamera.cameraRigController) { return; } GameObject target = outlineHighlight.sceneCamera.cameraRigController.target; if (!target) { return; } InteractionDriver component = target.GetComponent <InteractionDriver>(); if (!component) { return; } GameObject gameObject = component.FindBestInteractableObject(); if (!gameObject) { return; } IInteractable component2 = gameObject.GetComponent <IInteractable>(); Highlight component3 = gameObject.GetComponent <Highlight>(); if (!component3) { return; } Color a = component3.GetColor(); if (component2 != null && ((MonoBehaviour)component2).isActiveAndEnabled && component2.GetInteractability(component.interactor) == Interactability.ConditionsNotMet) { a = ColorCatalog.GetColor(ColorCatalog.ColorIndex.Unaffordable); } outlineHighlight.highlightQueue.Enqueue(new OutlineHighlight.HighlightInfo { renderer = component3.targetRenderer, color = a * component3.strength }); }
// Token: 0x06001043 RID: 4163 RVA: 0x0005184C File Offset: 0x0004FA4C public Color GetColor() { switch (this.highlightColor) { case Highlight.HighlightColor.interactive: return(ColorCatalog.GetColor(ColorCatalog.ColorIndex.Interactable)); case Highlight.HighlightColor.teleporter: return(ColorCatalog.GetColor(ColorCatalog.ColorIndex.Teleporter)); case Highlight.HighlightColor.pickup: return(this.pickupIndex.GetPickupColor()); default: return(Color.magenta); } }
// Token: 0x0600130C RID: 4876 RVA: 0x0005D55C File Offset: 0x0005B75C public void GrantPortalEntry() { PortalStatueBehavior.PortalType portalType = this.portalType; if (portalType != PortalStatueBehavior.PortalType.Shop) { if (portalType == PortalStatueBehavior.PortalType.Goldshores) { if (TeleporterInteraction.instance) { TeleporterInteraction.instance.shouldAttemptToSpawnGoldshoresPortal = true; } EffectManager.instance.SpawnEffect(Resources.Load <GameObject>("Prefabs/Effects/ShrineUseEffect"), new EffectData { origin = base.transform.position, rotation = Quaternion.identity, scale = 1f, color = ColorCatalog.GetColor(ColorCatalog.ColorIndex.Money) }, true); } } else { if (TeleporterInteraction.instance) { TeleporterInteraction.instance.shouldAttemptToSpawnShopPortal = true; } EffectManager.instance.SpawnEffect(Resources.Load <GameObject>("Prefabs/Effects/ShrineUseEffect"), new EffectData { origin = base.transform.position, rotation = Quaternion.identity, scale = 1f, color = ColorCatalog.GetColor(ColorCatalog.ColorIndex.LunarItem) }, true); } foreach (PortalStatueBehavior portalStatueBehavior in UnityEngine.Object.FindObjectsOfType <PortalStatueBehavior>()) { if (portalStatueBehavior.portalType == this.portalType) { PurchaseInteraction component = portalStatueBehavior.GetComponent <PurchaseInteraction>(); if (component) { component.Networkavailable = false; } } } }
public Color GetPickupColorDark() { if (value >= 0) { if (value < TotalItemCount) { return(ColorCatalog.GetColor(ItemCatalog.GetItemDef((ItemIndex)value).darkColorIndex)); } if (value < TotalItemCount + TotalEquipmentCount) { return(ColorCatalog.GetColor(EquipmentCatalog.GetEquipmentDef((EquipmentIndex)(value - TotalItemCount)).colorIndex)); } if (value < TotalItemCount + TotalEquipmentCount + CoinCount) { return(ColorCatalog.GetColor(ColorCatalog.ColorIndex.LunarItem)); } } return(Color.black); }
// Token: 0x06000E3F RID: 3647 RVA: 0x00046090 File Offset: 0x00044290 private void FixedUpdate() { if (this.targetTextMesh) { switch (this.costType) { case CostType.Money: this.targetTextMesh.text = string.Format("${0}", this.displayValue); this.targetTextMesh.color = ColorCatalog.GetColor(ColorCatalog.ColorIndex.Money); return; case CostType.PercentHealth: this.targetTextMesh.text = string.Format("{0}% HP", this.displayValue); this.targetTextMesh.color = ColorCatalog.GetColor(ColorCatalog.ColorIndex.Teleporter); return; case CostType.Lunar: this.targetTextMesh.text = string.Format("{0} Lunar", this.displayValue); this.targetTextMesh.color = ColorCatalog.GetColor(ColorCatalog.ColorIndex.LunarCoin); return; case CostType.WhiteItem: this.targetTextMesh.text = string.Format("{0} Items", this.displayValue); this.targetTextMesh.color = ColorCatalog.GetColor(PurchaseInteraction.CostTypeToColorIndex(this.costType)); return; case CostType.GreenItem: this.targetTextMesh.text = string.Format("{0} Items", this.displayValue); this.targetTextMesh.color = ColorCatalog.GetColor(PurchaseInteraction.CostTypeToColorIndex(this.costType)); return; case CostType.RedItem: this.targetTextMesh.text = string.Format("{0} Items", this.displayValue); this.targetTextMesh.color = ColorCatalog.GetColor(PurchaseInteraction.CostTypeToColorIndex(this.costType)); return; default: this.targetTextMesh.text = string.Format("${0}", this.displayValue); this.targetTextMesh.color = ColorCatalog.GetColor(ColorCatalog.ColorIndex.Error); break; } } }
// Token: 0x06001927 RID: 6439 RVA: 0x00078D04 File Offset: 0x00076F04 public Color GetPickupColorDark() { if (this.value >= 0) { if (this.value < 78) { return(ColorCatalog.GetColor(ItemCatalog.GetItemDef((ItemIndex)this.value).darkColorIndex)); } if (this.value < 105) { return(ColorCatalog.GetColor(EquipmentCatalog.GetEquipmentDef((EquipmentIndex)(this.value - 78)).colorIndex)); } if (this.value < 106) { return(ColorCatalog.GetColor(ColorCatalog.ColorIndex.LunarItem)); } } return(Color.black); }
// Token: 0x060004A2 RID: 1186 RVA: 0x00012A58 File Offset: 0x00010C58 public static Color32 GetCostColorDefault(CostTypeDef costTypeDef, CostTypeDef.GetCostColorContext context) { Color32 color = ColorCatalog.GetColor(costTypeDef.colorIndex); if (context.forWorldDisplay) { float h; float num; float num2; Color.RGBToHSV(color, out h, out num, out num2); if (costTypeDef.saturateWorldStyledCostString && num > 0f) { num = 1f; } if (costTypeDef.darkenWorldStyledCostString) { num2 *= 0.5f; } color = Color.HSVToRGB(h, num, num2); } return(color); }
// Token: 0x06001730 RID: 5936 RVA: 0x0006E220 File Offset: 0x0006C420 private void GrantPickup(GameObject activator) { if (Run.instance) { Util.PlaySound(UnlockPickup.itemPickupSoundString, activator); Run.instance.GrantUnlockToAllParticipatingPlayers(this.unlockableName); string pickupToken = "???"; UnlockableDef unlockableDef = UnlockableCatalog.GetUnlockableDef(this.unlockableName); if (unlockableDef != null) { pickupToken = unlockableDef.nameToken; } Chat.SendBroadcastChat(new Chat.PlayerPickupChatMessage { subjectCharacterBodyGameObject = activator, baseToken = "PLAYER_PICKUP", pickupToken = pickupToken, pickupColor = ColorCatalog.GetColor(ColorCatalog.ColorIndex.Unlockable), pickupQuantity = 1u }); this.consumed = true; UnityEngine.Object.Destroy(base.transform.root.gameObject); } }
// Token: 0x06000ACB RID: 2763 RVA: 0x00035540 File Offset: 0x00033740 static DifficultyCatalog() { DifficultyCatalog.difficultyDefs[0] = new DifficultyDef(1f, "DIFFICULTY_EASY_NAME", "Textures/DifficultyIcons/texDifficultyEasyIcon", "DIFFICULTY_EASY_DESCRIPTION", ColorCatalog.GetColor(ColorCatalog.ColorIndex.EasyDifficulty)); DifficultyCatalog.difficultyDefs[1] = new DifficultyDef(2f, "DIFFICULTY_NORMAL_NAME", "Textures/DifficultyIcons/texDifficultyNormalIcon", "DIFFICULTY_NORMAL_DESCRIPTION", ColorCatalog.GetColor(ColorCatalog.ColorIndex.NormalDifficulty)); DifficultyCatalog.difficultyDefs[2] = new DifficultyDef(3f, "DIFFICULTY_HARD_NAME", "Textures/DifficultyIcons/texDifficultyHardIcon", "DIFFICULTY_HARD_DESCRIPTION", ColorCatalog.GetColor(ColorCatalog.ColorIndex.HardDifficulty)); }
// Token: 0x06001386 RID: 4998 RVA: 0x0005F488 File Offset: 0x0005D688 private string GetCostString() { switch (this.costType) { case CostType.None: return(""); case CostType.Money: return(string.Format(" (<nobr><style=cShrine>${0}</style></nobr>)", this.cost)); case CostType.PercentHealth: return(string.Format(" (<nobr><style=cDeath>{0}% HP</style></nobr>)", this.cost)); case CostType.Lunar: return(string.Format(" (<nobr><color=#{1}>{0}</color></nobr>)", this.cost, ColorCatalog.GetColorHexString(ColorCatalog.ColorIndex.LunarCoin))); case CostType.WhiteItem: return(string.Format(" <nobr>(<nobr><color=#{1}>{0} Items</color></nobr>)", this.cost, ColorCatalog.GetColorHexString(PurchaseInteraction.CostTypeToColorIndex(this.costType)))); case CostType.GreenItem: return(string.Format(" <nobr>(<nobr><color=#{1}>{0} Items</color></nobr>)", this.cost, ColorCatalog.GetColorHexString(PurchaseInteraction.CostTypeToColorIndex(this.costType)))); case CostType.RedItem: return(string.Format(" <nobr>(<nobr><color=#{1}>{0} Items</color></nobr>)", this.cost, ColorCatalog.GetColorHexString(PurchaseInteraction.CostTypeToColorIndex(this.costType)))); default: return(""); } }
static patch_RuleCatalog() { allRuleDefs = new List <RuleDef>(); allChoicesDefs = new List <RuleChoiceDef>(); allCategoryDefs = new List <RuleCategoryDef>(); ruleDefsByGlobalName = new Dictionary <string, RuleDef>(); ruleChoiceDefsByGlobalName = new Dictionary <string, RuleChoiceDef>(); ruleShowItems = new BoolConVar("rule_show_items", ConVarFlags.None, "1", "Whether or not to allow voting on items in the pregame rules."); RuleCatalog.AddCategory("RULE_HEADER_DIFFICULTY", new Color32(28, 99, 150, byte.MaxValue)); RuleCatalog.AddRule(RuleDef.FromDifficulty()); RuleCatalog.AddCategory("RULE_HEADER_ARTIFACTS", new Color32(74, 50, 149, byte.MaxValue), null, RuleCatalog.HiddenTestFalse); for (ArtifactIndex artifactIndex = 0; artifactIndex < ArtifactIndex.Count; artifactIndex++) { RuleCatalog.AddRule(RuleDef.FromArtifact(artifactIndex)); } RuleCatalog.AddCategory("RULE_HEADER_ITEMS", new Color32(147, 225, 128, byte.MaxValue), null, RuleCatalog.HiddenTestItemsConvar); var list = new List <ItemIndex>(); for (ItemIndex itemIndex = 0; itemIndex < ItemIndex.Count; itemIndex++) { list.Add(itemIndex); } foreach (var itemIndex2 in from i in list where ItemCatalog.GetItemDef(i).inDroppableTier orderby ItemCatalog.GetItemDef(i).tier select i) { RuleCatalog.AddRule(RuleDef.FromItem(itemIndex2)); } RuleCatalog.AddCategory("RULE_HEADER_EQUIPMENT", new Color32(byte.MaxValue, 128, 0, byte.MaxValue), null, RuleCatalog.HiddenTestItemsConvar); var list2 = new List <EquipmentIndex>(); for (EquipmentIndex equipmentIndex = 0; equipmentIndex < EquipmentIndex.Count; equipmentIndex++) { list2.Add(equipmentIndex); } foreach (var equipmentIndex2 in from i in list2 where EquipmentCatalog.GetEquipmentDef(i).canDrop select i) { RuleCatalog.AddRule(RuleDef.FromEquipment(equipmentIndex2)); } RuleCatalog.AddCategory("RULE_HEADER_MISC", new Color32(192, 192, 192, byte.MaxValue), null, RuleCatalog.HiddenTestFalse); var ruleDef = new RuleDef("Misc.StartingMoney", "RULE_MISC_STARTING_MONEY"); var ruleChoiceDef = ruleDef.AddChoice("0", 0, true); ruleChoiceDef.tooltipNameToken = "RULE_STARTINGMONEY_CHOICE_0_NAME"; ruleChoiceDef.tooltipBodyToken = "RULE_STARTINGMONEY_CHOICE_0_DESC"; ruleChoiceDef.tooltipNameColor = ColorCatalog.GetColor(ColorCatalog.ColorIndex.LunarCoin); var ruleChoiceDef2 = ruleDef.AddChoice("15", 15, true); ruleChoiceDef2.tooltipNameToken = "RULE_STARTINGMONEY_CHOICE_15_NAME"; ruleChoiceDef2.tooltipBodyToken = "RULE_STARTINGMONEY_CHOICE_15_DESC"; ruleChoiceDef2.tooltipNameColor = ColorCatalog.GetColor(ColorCatalog.ColorIndex.LunarCoin); ruleDef.MakeNewestChoiceDefault(); var ruleChoiceDef3 = ruleDef.AddChoice("50", 50, true); ruleChoiceDef3.tooltipNameToken = "RULE_STARTINGMONEY_CHOICE_50_NAME"; ruleChoiceDef3.tooltipBodyToken = "RULE_STARTINGMONEY_CHOICE_50_DESC"; ruleChoiceDef3.spritePath = "Textures/MiscIcons/texRuleBonusStartingMoney"; ruleChoiceDef3.tooltipNameColor = ColorCatalog.GetColor(ColorCatalog.ColorIndex.LunarCoin); RuleCatalog.AddRule(ruleDef); var ruleDef2 = new RuleDef("Misc.StageOrder", "RULE_MISC_STAGE_ORDER"); var ruleChoiceDef4 = ruleDef2.AddChoice("Normal", 0, true); ruleChoiceDef4.tooltipNameToken = "RULE_STAGEORDER_CHOICE_NORMAL_NAME"; ruleChoiceDef4.tooltipBodyToken = "RULE_STAGEORDER_CHOICE_NORMAL_DESC"; ruleChoiceDef4.tooltipNameColor = ColorCatalog.GetColor(ColorCatalog.ColorIndex.LunarCoin); ruleDef2.MakeNewestChoiceDefault(); var ruleChoiceDef5 = ruleDef2.AddChoice("Random", 1, true); ruleChoiceDef5.tooltipNameToken = "RULE_STAGEORDER_CHOICE_RANDOM_NAME"; ruleChoiceDef5.tooltipBodyToken = "RULE_STAGEORDER_CHOICE_RANDOM_DESC"; ruleChoiceDef5.spritePath = "Textures/MiscIcons/texRuleMapIsRandom"; ruleChoiceDef5.tooltipNameColor = ColorCatalog.GetColor(ColorCatalog.ColorIndex.LunarCoin); RuleCatalog.AddRule(ruleDef2); var ruleDef3 = new RuleDef("Misc.KeepMoneyBetweenStages", "RULE_MISC_KEEP_MONEY_BETWEEN_STAGES"); ruleDef3.AddChoice("On", 1, true).tooltipBodyToken = "RULE_KEEPMONEYBETWEENSTAGES_CHOICE_ON_DESC"; ruleDef3.AddChoice("Off", 0, true).tooltipBodyToken = "RULE_KEEPMONEYBETWEENSTAGES_CHOICE_OFF_DESC"; ruleDef3.MakeNewestChoiceDefault(); RuleCatalog.AddRule(ruleDef3); for (var k = 0; k < RuleCatalog.allRuleDefs.Count; k++) { var ruleDef4 = RuleCatalog.allRuleDefs[k]; ruleDef4.globalIndex = k; for (var j = 0; j < ruleDef4.choices.Count; j++) { var ruleChoiceDef6 = ruleDef4.choices[j]; ruleChoiceDef6.localIndex = j; ruleChoiceDef6.globalIndex = RuleCatalog.allChoicesDefs.Count; RuleCatalog.allChoicesDefs.Add(ruleChoiceDef6); } } RuleCatalog.availability.MakeAvailable(); }
private static void Init() { RuleCatalog.AddCategory("RULE_HEADER_DIFFICULTY", new Color32(28, 99, 150, byte.MaxValue)); RuleCatalog.AddRule(RuleDef.FromDifficulty()); RuleCatalog.AddCategory("RULE_HEADER_ARTIFACTS", new Color32(74, 50, 149, byte.MaxValue), "RULE_ARTIFACTS_EMPTY_TIP", new Func <bool>(RuleCatalog.HiddenTestFalse)); for (ArtifactIndex artifactIndex = ArtifactIndex.Command; artifactIndex < ArtifactIndex.Count; artifactIndex++) { RuleCatalog.AddRule(RuleDef.FromArtifact(artifactIndex)); } RuleCatalog.AddCategory("RULE_HEADER_ITEMS", new Color32(147, 225, 128, byte.MaxValue), null, new Func <bool>(RuleCatalog.HiddenTestItemsConvar)); List <ItemIndex> list = new List <ItemIndex>(); ItemIndex itemIndex = ItemIndex.Syringe; ItemIndex itemCount = (ItemIndex)ItemCatalog.itemCount; while (itemIndex < itemCount) { list.Add(itemIndex); itemIndex++; } foreach (ItemIndex itemIndex2 in from i in list where ItemCatalog.GetItemDef(i).inDroppableTier orderby ItemCatalog.GetItemDef(i).tier select i) { RuleCatalog.AddRule(RuleDef.FromItem(itemIndex2)); } RuleCatalog.AddCategory("RULE_HEADER_EQUIPMENT", new Color32(byte.MaxValue, 128, 0, byte.MaxValue), null, new Func <bool>(RuleCatalog.HiddenTestItemsConvar)); List <EquipmentIndex> list2 = new List <EquipmentIndex>(); EquipmentIndex equipmentIndex = EquipmentIndex.CommandMissile; EquipmentIndex equipmentCount = (EquipmentIndex)EquipmentCatalog.equipmentCount; while (equipmentIndex < equipmentCount) { list2.Add(equipmentIndex); equipmentIndex++; } foreach (EquipmentIndex equipmentIndex2 in from i in list2 where EquipmentCatalog.GetEquipmentDef(i).canDrop select i) { RuleCatalog.AddRule(RuleDef.FromEquipment(equipmentIndex2)); } RuleCatalog.AddCategory("RULE_HEADER_MISC", new Color32(192, 192, 192, byte.MaxValue), null, new Func <bool>(RuleCatalog.HiddenTestFalse)); RuleDef ruleDef = new RuleDef("Misc.StartingMoney", "RULE_MISC_STARTING_MONEY"); RuleChoiceDef ruleChoiceDef = ruleDef.AddChoice("0", 0U, true); ruleChoiceDef.tooltipNameToken = "RULE_STARTINGMONEY_CHOICE_0_NAME"; ruleChoiceDef.tooltipBodyToken = "RULE_STARTINGMONEY_CHOICE_0_DESC"; ruleChoiceDef.tooltipNameColor = ColorCatalog.GetColor(ColorCatalog.ColorIndex.LunarCoin); RuleChoiceDef ruleChoiceDef2 = ruleDef.AddChoice("15", 15U, true); ruleChoiceDef2.tooltipNameToken = "RULE_STARTINGMONEY_CHOICE_15_NAME"; ruleChoiceDef2.tooltipBodyToken = "RULE_STARTINGMONEY_CHOICE_15_DESC"; ruleChoiceDef2.tooltipNameColor = ColorCatalog.GetColor(ColorCatalog.ColorIndex.LunarCoin); ruleDef.MakeNewestChoiceDefault(); RuleChoiceDef ruleChoiceDef3 = ruleDef.AddChoice("50", 50U, true); ruleChoiceDef3.tooltipNameToken = "RULE_STARTINGMONEY_CHOICE_50_NAME"; ruleChoiceDef3.tooltipBodyToken = "RULE_STARTINGMONEY_CHOICE_50_DESC"; ruleChoiceDef3.spritePath = "Textures/MiscIcons/texRuleBonusStartingMoney"; ruleChoiceDef3.tooltipNameColor = ColorCatalog.GetColor(ColorCatalog.ColorIndex.LunarCoin); RuleCatalog.AddRule(ruleDef); RuleDef ruleDef2 = new RuleDef("Misc.StageOrder", "RULE_MISC_STAGE_ORDER"); RuleChoiceDef ruleChoiceDef4 = ruleDef2.AddChoice("Normal", StageOrder.Normal, true); ruleChoiceDef4.tooltipNameToken = "RULE_STAGEORDER_CHOICE_NORMAL_NAME"; ruleChoiceDef4.tooltipBodyToken = "RULE_STAGEORDER_CHOICE_NORMAL_DESC"; ruleChoiceDef4.tooltipNameColor = ColorCatalog.GetColor(ColorCatalog.ColorIndex.LunarCoin); ruleDef2.MakeNewestChoiceDefault(); RuleChoiceDef ruleChoiceDef5 = ruleDef2.AddChoice("Random", StageOrder.Random, true); ruleChoiceDef5.tooltipNameToken = "RULE_STAGEORDER_CHOICE_RANDOM_NAME"; ruleChoiceDef5.tooltipBodyToken = "RULE_STAGEORDER_CHOICE_RANDOM_DESC"; ruleChoiceDef5.spritePath = "Textures/MiscIcons/texRuleMapIsRandom"; ruleChoiceDef5.tooltipNameColor = ColorCatalog.GetColor(ColorCatalog.ColorIndex.LunarCoin); RuleCatalog.AddRule(ruleDef2); RuleDef ruleDef3 = new RuleDef("Misc.KeepMoneyBetweenStages", "RULE_MISC_KEEP_MONEY_BETWEEN_STAGES"); ruleDef3.AddChoice("On", true, true).tooltipBodyToken = "RULE_KEEPMONEYBETWEENSTAGES_CHOICE_ON_DESC"; ruleDef3.AddChoice("Off", false, true).tooltipBodyToken = "RULE_KEEPMONEYBETWEENSTAGES_CHOICE_OFF_DESC"; ruleDef3.MakeNewestChoiceDefault(); RuleCatalog.AddRule(ruleDef3); for (int k = 0; k < RuleCatalog.allRuleDefs.Count; k++) { RuleDef ruleDef4 = RuleCatalog.allRuleDefs[k]; ruleDef4.globalIndex = k; for (int j = 0; j < ruleDef4.choices.Count; j++) { RuleChoiceDef ruleChoiceDef6 = ruleDef4.choices[j]; ruleChoiceDef6.localIndex = j; ruleChoiceDef6.globalIndex = RuleCatalog.allChoicesDefs.Count; RuleCatalog.allChoicesDefs.Add(ruleChoiceDef6); } } RuleCatalog.availability.MakeAvailable(); }
private static void Init() { List <PickupDef> list = new List <PickupDef>(); for (int i = 0; i < ItemCatalog.itemCount; i++) { ItemIndex itemIndex = (ItemIndex)i; ItemDef itemDef = ItemCatalog.GetItemDef(itemIndex); PickupDef pickupDef = new PickupDef(); PickupDef pickupDef2 = pickupDef; string str = "ItemIndex."; ItemIndex itemIndex2 = (ItemIndex)i; pickupDef2.internalName = str + itemIndex2.ToString(); pickupDef.itemIndex = itemIndex; pickupDef.displayPrefab = itemDef.pickupModelPrefab; pickupDef.dropletDisplayPrefab = PickupCatalog.< Init > g__GetPickupDropletDisplayPrefabForTier | 11_0 (itemDef.tier); pickupDef.nameToken = itemDef.nameToken; pickupDef.baseColor = ColorCatalog.GetColor(itemDef.colorIndex); pickupDef.darkColor = ColorCatalog.GetColor(itemDef.darkColorIndex); pickupDef.unlockableName = itemDef.unlockableName; pickupDef.interactContextToken = "ITEM_PICKUP_CONTEXT"; pickupDef.isLunar = (itemDef.tier == ItemTier.Lunar); pickupDef.isBoss = (itemDef.tier == ItemTier.Boss); pickupDef.iconTexture = itemDef.pickupIconTexture; list.Add(pickupDef); } GameObject dropletDisplayPrefab = Resources.Load <GameObject>("Prefabs/ItemPickups/EquipmentOrb"); for (int j = 0; j < EquipmentCatalog.equipmentCount; j++) { EquipmentIndex equipmentIndex = (EquipmentIndex)j; EquipmentDef equipmentDef = EquipmentCatalog.GetEquipmentDef(equipmentIndex); PickupDef pickupDef3 = new PickupDef(); PickupDef pickupDef4 = pickupDef3; string str2 = "EquipmentIndex."; EquipmentIndex equipmentIndex2 = (EquipmentIndex)j; pickupDef4.internalName = str2 + equipmentIndex2.ToString(); pickupDef3.equipmentIndex = equipmentIndex; pickupDef3.displayPrefab = equipmentDef.pickupModelPrefab; pickupDef3.dropletDisplayPrefab = dropletDisplayPrefab; pickupDef3.nameToken = equipmentDef.nameToken; pickupDef3.baseColor = ColorCatalog.GetColor(equipmentDef.colorIndex); pickupDef3.darkColor = pickupDef3.baseColor; pickupDef3.unlockableName = equipmentDef.unlockableName; pickupDef3.interactContextToken = "EQUIPMENT_PICKUP_CONTEXT"; pickupDef3.isLunar = equipmentDef.isLunar; pickupDef3.isBoss = equipmentDef.isBoss; pickupDef3.iconTexture = equipmentDef.pickupIconTexture; list.Add(pickupDef3); } PickupDef pickupDef5 = new PickupDef(); pickupDef5.internalName = "LunarCoin.Coin0"; pickupDef5.coinValue = 1U; pickupDef5.nameToken = "PICKUP_LUNAR_COIN"; pickupDef5.displayPrefab = Resources.Load <GameObject>("Prefabs/PickupModels/PickupLunarCoin"); pickupDef5.dropletDisplayPrefab = Resources.Load <GameObject>("Prefabs/ItemPickups/LunarOrb"); pickupDef5.baseColor = ColorCatalog.GetColor(ColorCatalog.ColorIndex.LunarItem); pickupDef5.darkColor = pickupDef5.baseColor; pickupDef5.interactContextToken = "LUNAR_COIN_PICKUP_CONTEXT"; list.Add(pickupDef5); Action <List <PickupDef> > action = PickupCatalog.modifyPickups; if (action != null) { action(list); } PickupCatalog.SetEntries(list.ToArray()); }