// no use because its tied to UserProfile and nothing else /*public bool isValid * { * get * { * return value < TotalItemCount + TotalEquipmentCount + CoinCount; * } * }*/ public GameObject GetPickupDisplayPrefab() { // Check if the custom item has a custom prefab. var currentCustomItem = ItemLib.ItemLib.GetCustomItem(value); if (currentCustomItem != null && currentCustomItem.Prefab != null) { return(currentCustomItem.Prefab); } var currentCustomEquipment = ItemLib.ItemLib.GetCustomEquipment(value); if (currentCustomEquipment != null && currentCustomEquipment.Prefab != null) { return(currentCustomEquipment.Prefab); } if (value >= 0) { if (value < TotalItemCount) { return(Resources.Load <GameObject>(ItemCatalog.GetItemDef((ItemIndex)value).pickupModelPath)); } if (value < TotalItemCount + TotalEquipmentCount) { return(Resources.Load <GameObject>(EquipmentCatalog.GetEquipmentDef((EquipmentIndex)(value - TotalItemCount)).pickupModelPath)); } if (value < TotalItemCount + TotalEquipmentCount + CoinCount) { return(Resources.Load <GameObject>("Prefabs/PickupModels/PickupLunarCoin")); } } return(null); }
public void RollItem() { if (!NetworkServer.active) { Debug.LogWarning("[Server] function 'System.Void RoR2.ScavBackpackBehavior::RollItem()' called on client"); return; } WeightedSelection <List <PickupIndex> > weightedSelection = new WeightedSelection <List <PickupIndex> >(8); weightedSelection.AddChoice((from v in Run.instance.availableTier1DropList where ItemCatalog.GetItemDef(v.itemIndex) != null && ItemCatalog.GetItemDef(v.itemIndex).ContainsTag(this.requiredItemTag) select v).ToList <PickupIndex>(), this.tier1Chance); weightedSelection.AddChoice((from v in Run.instance.availableTier2DropList where ItemCatalog.GetItemDef(v.itemIndex) != null && ItemCatalog.GetItemDef(v.itemIndex).ContainsTag(this.requiredItemTag) select v).ToList <PickupIndex>(), this.tier2Chance); weightedSelection.AddChoice((from v in Run.instance.availableTier3DropList where ItemCatalog.GetItemDef(v.itemIndex) != null && ItemCatalog.GetItemDef(v.itemIndex).ContainsTag(this.requiredItemTag) select v).ToList <PickupIndex>(), this.tier3Chance); weightedSelection.AddChoice((from v in Run.instance.availableLunarDropList where ItemCatalog.GetItemDef(v.itemIndex) != null && ItemCatalog.GetItemDef(v.itemIndex).ContainsTag(this.requiredItemTag) select v).ToList <PickupIndex>(), this.lunarChance); List <PickupIndex> dropList = weightedSelection.Evaluate(Run.instance.treasureRng.nextNormalizedFloat); this.PickFromList(dropList); }
private static void Init() { List <ItemIndex> list = new List <ItemIndex>(); List <EquipmentIndex> list2 = new List <EquipmentIndex>(); ItemIndex itemIndex = ItemIndex.Syringe; ItemIndex itemCount = (ItemIndex)ItemCatalog.itemCount; while (itemIndex < itemCount) { ItemDef itemDef = ItemCatalog.GetItemDef(itemIndex); if (itemDef.tier == ItemTier.Lunar || itemDef.ContainsTag(ItemTag.Cleansable)) { list.Add(itemIndex); } itemIndex++; } EquipmentIndex equipmentIndex = EquipmentIndex.CommandMissile; EquipmentIndex equipmentCount = (EquipmentIndex)EquipmentCatalog.equipmentCount; while (equipmentIndex < equipmentCount) { if (EquipmentCatalog.GetEquipmentDef(equipmentIndex).isLunar) { list2.Add(equipmentIndex); } equipmentIndex++; } ShrineCleanseBehavior.cleansableItems = list.ToArray(); ShrineCleanseBehavior.cleansableEquipments = list2.ToArray(); }
// Token: 0x06000B4B RID: 2891 RVA: 0x00031D04 File Offset: 0x0002FF04 private void OnTriggerStay(Collider other) { if (NetworkServer.active && this.waitStartTime.timeSince >= this.waitDuration && !this.consumed) { CharacterBody component = other.GetComponent <CharacterBody>(); if (component) { ItemIndex itemIndex = this.pickupIndex.itemIndex; if (itemIndex != ItemIndex.None && ItemCatalog.GetItemDef(itemIndex).tier == ItemTier.Lunar) { return; } EquipmentIndex equipmentIndex = this.pickupIndex.equipmentIndex; if (equipmentIndex != EquipmentIndex.None) { if (EquipmentCatalog.GetEquipmentDef(equipmentIndex).isLunar) { return; } if (component.inventory && component.inventory.currentEquipmentIndex != EquipmentIndex.None) { return; } } if (this.pickupIndex.coinValue != 0U) { return; } if (GenericPickupController.BodyHasPickupPermission(component)) { this.AttemptGrant(component); } } } }
public void GiveItemString(string itemString) { if (!NetworkServer.active) { Debug.LogWarning("[Server] function 'System.Void RoR2.Inventory::GiveItemString(System.String)' called on client"); return; } this.GiveItem(ItemCatalog.FindItemIndex(itemString), 1); }
private bool <GenerateNewPickupServer> g__PassesFilter | 17_0 (PickupIndex pickupIndex) { if (this.bannedItemTag == ItemTag.Any) { return(true); } PickupDef pickupDef = PickupCatalog.GetPickupDef(pickupIndex); return(pickupDef.itemIndex == ItemIndex.None || !ItemCatalog.GetItemDef(pickupDef.itemIndex).ContainsTag(this.bannedItemTag)); }
// Token: 0x060016C8 RID: 5832 RVA: 0x00061BF7 File Offset: 0x0005FDF7 public bool HasItem(ItemIndex itemIndex) { if (!ItemCatalog.IsIndexValid(itemIndex)) { return(false); } if (itemIndex < ItemIndex.FireRing) { return((this.a & 1UL << (int)itemIndex) > 0UL); } return((this.b & 1UL << itemIndex - ItemIndex.FireRing) > 0UL); }
// Token: 0x060016CA RID: 5834 RVA: 0x00061C6E File Offset: 0x0005FE6E public void RemoveItem(ItemIndex itemIndex) { if (!ItemCatalog.IsIndexValid(itemIndex)) { return; } if (itemIndex < ItemIndex.FireRing) { this.a &= ~(1UL << (int)itemIndex); return; } this.b &= ~(1UL << itemIndex - ItemIndex.FireRing); }
// Token: 0x06001120 RID: 4384 RVA: 0x0005554C File Offset: 0x0005374C public int GetTotalItemCountOfTier(ItemTier itemTier) { int num = 0; for (ItemIndex itemIndex = ItemIndex.Syringe; itemIndex < ItemIndex.Count; itemIndex++) { if (ItemCatalog.GetItemDef(itemIndex).tier == itemTier) { num += this.GetItemCount(itemIndex); } } return(num); }
// Token: 0x060016C9 RID: 5833 RVA: 0x00061C31 File Offset: 0x0005FE31 public void AddItem(ItemIndex itemIndex) { if (!ItemCatalog.IsIndexValid(itemIndex)) { return; } if (itemIndex < ItemIndex.FireRing) { this.a |= 1UL << (int)itemIndex; return; } this.b |= 1UL << itemIndex - ItemIndex.FireRing; }
public bool IsBoss() { if (value >= 0) { if (value < TotalItemCount) { return(ItemCatalog.GetItemDef((ItemIndex)value).tier == ItemTier.Boss); } if (value < TotalItemCount + TotalEquipmentCount) { return(EquipmentCatalog.GetEquipmentDef((EquipmentIndex)(value - TotalItemCount)).isBoss); } } return(false); }
public string GetUnlockableName() { if (value >= 0) { if (value < TotalItemCount) { return(ItemCatalog.GetItemDef((ItemIndex)value).unlockableName); } if (value < TotalItemCount + TotalEquipmentCount) { return(EquipmentCatalog.GetEquipmentDef((EquipmentIndex)(value - TotalItemCount)).unlockableName); } } return(""); }
// Token: 0x06001929 RID: 6441 RVA: 0x00078DE8 File Offset: 0x00076FE8 public string GetUnlockableName() { if (this.value >= 0) { if (this.value < 78) { return(ItemCatalog.GetItemDef((ItemIndex)this.value).unlockableName); } if (this.value < 105) { return(EquipmentCatalog.GetEquipmentDef((EquipmentIndex)(this.value - 78)).unlockableName); } } return(""); }
// Token: 0x0600192B RID: 6443 RVA: 0x00078E90 File Offset: 0x00077090 public bool IsBoss() { if (this.value >= 0) { if (this.value < 78) { return(ItemCatalog.GetItemDef((ItemIndex)this.value).tier == ItemTier.Boss); } if (this.value < 105) { return(EquipmentCatalog.GetEquipmentDef((EquipmentIndex)(this.value - 78)).isBoss); } } return(false); }
// Token: 0x06000D78 RID: 3448 RVA: 0x0003C8D4 File Offset: 0x0003AAD4 public int GetTotalItemCountOfTier(ItemTier itemTier) { int num = 0; ItemIndex itemIndex = ItemIndex.Syringe; ItemIndex itemCount = (ItemIndex)ItemCatalog.itemCount; while (itemIndex < itemCount) { if (ItemCatalog.GetItemDef(itemIndex).tier == itemTier) { num += this.GetItemCount(itemIndex); } itemIndex++; } return(num); }
// Token: 0x06000D2C RID: 3372 RVA: 0x00041B08 File Offset: 0x0003FD08 public void HighlightItemDisplay(ItemIndex itemIndex) { if (!this.enabledItemDisplays[(int)itemIndex]) { return; } string path = "Prefabs/UI/HighlightTier1Item"; ItemDef itemDef = ItemCatalog.GetItemDef(itemIndex); if (itemDef != null) { switch (itemDef.tier) { case ItemTier.Tier1: path = "Prefabs/UI/HighlightTier1Item"; break; case ItemTier.Tier2: path = "Prefabs/UI/HighlightTier2Item"; break; case ItemTier.Tier3: path = "Prefabs/UI/HighlightTier3Item"; break; case ItemTier.Lunar: path = "Prefabs/UI/HighlightLunarItem"; break; } } for (int i = this.parentedPrefabDisplays.Count - 1; i >= 0; i--) { if (this.parentedPrefabDisplays[i].itemIndex == itemIndex) { GameObject instance = this.parentedPrefabDisplays[i].instance; if (instance) { Renderer componentInChildren = instance.GetComponentInChildren <Renderer>(); if (componentInChildren && this.body) { HighlightRect.CreateHighlight(this.body.gameObject, componentInChildren, Resources.Load <GameObject>(path), -1f, false); } } } } }
// Token: 0x0600111F RID: 4383 RVA: 0x00055510 File Offset: 0x00053710 public bool HasAtLeastXTotalItemsOfTier(ItemTier itemTier, int x) { int num = 0; for (ItemIndex itemIndex = ItemIndex.Syringe; itemIndex < ItemIndex.Count; itemIndex++) { if (ItemCatalog.GetItemDef(itemIndex).tier == itemTier) { num += this.GetItemCount(itemIndex); if (num >= x) { return(true); } } } return(false); }
public GameObject GetPickupDropletDisplayPrefab() { if (value >= 0) { if (value < TotalItemCount) { ItemDef itemDef = ItemCatalog.GetItemDef((ItemIndex)value); string path = null; switch (itemDef.tier) { case ItemTier.Tier1: path = "Prefabs/ItemPickups/Tier1Orb"; break; case ItemTier.Tier2: path = "Prefabs/ItemPickups/Tier2Orb"; break; case ItemTier.Tier3: path = "Prefabs/ItemPickups/Tier3Orb"; break; case ItemTier.Lunar: path = "Prefabs/ItemPickups/LunarOrb"; break; } if (!string.IsNullOrEmpty(path)) { return(Resources.Load <GameObject>(path)); } return(null); } else { if (value < TotalItemCount + TotalEquipmentCount) { return(Resources.Load <GameObject>("Prefabs/ItemPickups/EquipmentOrb")); } if (value < TotalItemCount + TotalEquipmentCount + CoinCount) { return(Resources.Load <GameObject>("Prefabs/ItemPickups/LunarOrb")); } } } return(null); }
// Token: 0x060015BF RID: 5567 RVA: 0x0005CB68 File Offset: 0x0005AD68 public override void OverrideRuleChoices(RuleChoiceMask mustInclude, RuleChoiceMask mustExclude) { base.OverrideRuleChoices(mustInclude, mustExclude); base.ForceChoice(mustInclude, mustExclude, "Difficulty.Normal"); base.ForceChoice(mustInclude, mustExclude, "Misc.StartingMoney.50"); base.ForceChoice(mustInclude, mustExclude, "Misc.StageOrder.Random"); base.ForceChoice(mustInclude, mustExclude, "Misc.KeepMoneyBetweenStages.Off"); for (ArtifactIndex artifactIndex = ArtifactIndex.Command; artifactIndex < ArtifactIndex.Count; artifactIndex++) { RuleDef ruleDef = RuleCatalog.FindRuleDef(artifactIndex.ToString()); RuleChoiceDef ruleChoiceDef = (ruleDef != null) ? ruleDef.FindChoice("Off") : null; if (ruleChoiceDef != null) { base.ForceChoice(mustInclude, mustExclude, ruleChoiceDef); } } ItemIndex itemIndex = ItemIndex.Syringe; ItemIndex itemCount = (ItemIndex)ItemCatalog.itemCount; while (itemIndex < itemCount) { ItemDef itemDef = ItemCatalog.GetItemDef(itemIndex); RuleDef ruleDef2 = RuleCatalog.FindRuleDef("Items." + itemDef.name); RuleChoiceDef ruleChoiceDef2 = (ruleDef2 != null) ? ruleDef2.FindChoice("On") : null; if (ruleChoiceDef2 != null) { base.ForceChoice(mustInclude, mustExclude, ruleChoiceDef2); } itemIndex++; } EquipmentIndex equipmentIndex = EquipmentIndex.CommandMissile; EquipmentIndex equipmentCount = (EquipmentIndex)EquipmentCatalog.equipmentCount; while (equipmentIndex < equipmentCount) { EquipmentDef equipmentDef = EquipmentCatalog.GetEquipmentDef(equipmentIndex); RuleDef ruleDef3 = RuleCatalog.FindRuleDef("Equipment." + equipmentDef.name); RuleChoiceDef ruleChoiceDef3 = (ruleDef3 != null) ? ruleDef3.FindChoice("On") : null; if (ruleChoiceDef3 != null) { base.ForceChoice(mustInclude, mustExclude, ruleChoiceDef3); } equipmentIndex++; } }
public void ModifySpawnedMasters(GameObject targetGameObject) { if (!NetworkServer.active) { Debug.LogWarning("[Server] function 'System.Void RoR2.ArenaMissionController::ModifySpawnedMasters(UnityEngine.GameObject)' called on client"); return; } ArenaMissionController.< > c__DisplayClass62_0 CS$ < > 8__locals1 = new ArenaMissionController.< > c__DisplayClass62_0(); CharacterMaster component = targetGameObject.GetComponent <CharacterMaster>(); CS$ < > 8__locals1.ai = component.GetComponent <BaseAI>(); if (CS$ < > 8__locals1.ai) { CS$ < > 8__locals1.ai.onBodyDiscovered += CS$ < > 8__locals1.< ModifySpawnedMasters > g__OnBodyDiscovered | 0; } CharacterBody body = component.GetBody(); if (body) { foreach (EntityStateMachine entityStateMachine in body.GetComponents <EntityStateMachine>()) { entityStateMachine.initialStateType = entityStateMachine.mainStateType; } } for (int j = 0; j < this.syncActivePickups.Count; j++) { int count = 0; ItemIndex itemIndex = PickupCatalog.GetPickupDef(new PickupIndex(this.syncActivePickups[j])).itemIndex; switch (ItemCatalog.GetItemDef(itemIndex).tier) { case ItemTier.Tier1: count = this.stackCountPerTier1; break; case ItemTier.Tier2: count = this.stackCountPerTier2; break; case ItemTier.Tier3: count = this.stackCountPerTier3; break; } component.inventory.GiveItem(itemIndex, count); } }
// Token: 0x060018D7 RID: 6359 RVA: 0x0006AF18 File Offset: 0x00069118 public static RuleDef FromItem(ItemIndex itemIndex) { ItemDef itemDef = ItemCatalog.GetItemDef(itemIndex); RuleDef ruleDef = new RuleDef("Items." + itemIndex.ToString(), itemDef.nameToken); RuleChoiceDef ruleChoiceDef = ruleDef.AddChoice("On", null, false); ruleChoiceDef.spritePath = itemDef.pickupIconPath; ruleChoiceDef.tooltipNameToken = itemDef.nameToken; ruleChoiceDef.unlockableName = itemDef.unlockableName; ruleChoiceDef.itemIndex = itemIndex; ruleDef.MakeNewestChoiceDefault(); RuleChoiceDef ruleChoiceDef2 = ruleDef.AddChoice("Off", null, false); ruleChoiceDef2.spritePath = itemDef.pickupIconPath; ruleChoiceDef2.materialPath = "Materials/UI/matRuleChoiceOff"; ruleChoiceDef2.tooltipNameToken = null; return(ruleDef); }
// 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: 0x06001928 RID: 6440 RVA: 0x00078D84 File Offset: 0x00076F84 public string GetPickupNameToken() { if (this.value >= 0) { if (this.value < 78) { return(ItemCatalog.GetItemDef((ItemIndex)this.value).nameToken); } if (this.value < 105) { return(EquipmentCatalog.GetEquipmentDef((EquipmentIndex)(this.value - 78)).nameToken); } if (this.value < 106) { return("PICKUP_LUNAR_COIN"); } } return("???"); }
public string GetPickupNameToken() { if (value >= 0) { if (value < TotalItemCount) { return(ItemCatalog.GetItemDef((ItemIndex)value).nameToken); } if (value < TotalItemCount + TotalEquipmentCount) { return(EquipmentCatalog.GetEquipmentDef((EquipmentIndex)(value - TotalItemCount)).nameToken); } if (value < TotalItemCount + TotalEquipmentCount + CoinCount) { return("PICKUP_LUNAR_COIN"); } } return("???"); }
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: 0x06001924 RID: 6436 RVA: 0x00078B6C File Offset: 0x00076D6C public GameObject GetPickupDisplayPrefab() { if (this.value >= 0) { if (this.value < 78) { return(Resources.Load <GameObject>(ItemCatalog.GetItemDef((ItemIndex)this.value).pickupModelPath)); } if (this.value < 105) { return(Resources.Load <GameObject>(EquipmentCatalog.GetEquipmentDef((EquipmentIndex)(this.value - 78)).pickupModelPath)); } if (this.value < 106) { return(Resources.Load <GameObject>("Prefabs/PickupModels/PickupLunarCoin")); } } return(null); }
public static List <ItemIndex> GetDefaultDropList(ItemTier itemTier) { var list = new List <ItemIndex>(); for (ItemIndex itemIndex = ItemIndex.Syringe; itemIndex < ItemIndex.Count; itemIndex++) { if (Run.instance.availableItems.HasItem(itemIndex)) { ItemDef itemDef = ItemCatalog.GetItemDef(itemIndex); if (itemDef.tier == itemTier) { list.Add(itemIndex); } } } return(list); }
// Token: 0x06001271 RID: 4721 RVA: 0x0004F6DC File Offset: 0x0004D8DC private void Start() { Inventory component = base.GetComponent <Inventory>(); List <PickupIndex> list = (from v in Run.instance.availableTier1DropList where ItemCatalog.GetItemDef(v.itemIndex) != null && ItemCatalog.GetItemDef(v.itemIndex).DoesNotContainTag(ItemTag.AIBlacklist) select v).ToList <PickupIndex>(); List <PickupIndex> list2 = (from v in Run.instance.availableTier2DropList where ItemCatalog.GetItemDef(v.itemIndex) != null && ItemCatalog.GetItemDef(v.itemIndex).DoesNotContainTag(ItemTag.AIBlacklist) select v).ToList <PickupIndex>(); List <PickupIndex> list3 = (from v in Run.instance.availableTier3DropList where ItemCatalog.GetItemDef(v.itemIndex) != null && ItemCatalog.GetItemDef(v.itemIndex).DoesNotContainTag(ItemTag.AIBlacklist) select v).ToList <PickupIndex>(); List <PickupIndex> availableEquipmentDropList = Run.instance.availableEquipmentDropList; this.GrantItems(component, list, this.tier1Types, this.tier1StackSize); this.GrantItems(component, list2, this.tier2Types, this.tier2StackSize); this.GrantItems(component, list3, this.tier3Types, this.tier3StackSize); component.GiveRandomEquipment(); }
// Token: 0x06000E12 RID: 3602 RVA: 0x0003ED4C File Offset: 0x0003CF4C private MageElement CalcElementToAward() { for (int i = 0; i < MageCalibrationController.elementCounter.Length; i++) { MageCalibrationController.elementCounter[i] = 0; } Inventory inventory = this.characterBody.inventory; if (!inventory) { return(MageElement.None); } List <ItemIndex> itemAcquisitionOrder = inventory.itemAcquisitionOrder; for (int j = 0; j < itemAcquisitionOrder.Count; j++) { ItemCatalog.GetItemDef(itemAcquisitionOrder[j]); } EquipmentDef equipmentDef = EquipmentCatalog.GetEquipmentDef(inventory.currentEquipmentIndex); if (equipmentDef != null && equipmentDef.mageElement != MageElement.None) { MageCalibrationController.elementCounter[(int)equipmentDef.mageElement] += 2; } MageElement result = MageElement.None; int num = 0; for (MageElement mageElement = MageElement.Fire; mageElement < MageElement.Count; mageElement += 1) { int num2 = MageCalibrationController.elementCounter[(int)mageElement]; if (num2 > num) { result = mageElement; num = num2; } } if (num >= 5) { return(result); } return(MageElement.None); }
// Token: 0x06000D77 RID: 3447 RVA: 0x0003C894 File Offset: 0x0003AA94 public bool HasAtLeastXTotalItemsOfTier(ItemTier itemTier, int x) { int num = 0; ItemIndex itemIndex = ItemIndex.Syringe; ItemIndex itemCount = (ItemIndex)ItemCatalog.itemCount; while (itemIndex < itemCount) { if (ItemCatalog.GetItemDef(itemIndex).tier == itemTier) { num += this.GetItemCount(itemIndex); if (num >= x) { return(true); } } itemIndex++; } return(false); }