// Token: 0x0600001A RID: 26 RVA: 0x00002AA0 File Offset: 0x00000CA0 private static bool SafeHasSkillKnowledge(Character character, int skillID) { bool?flag; if (character == null) { flag = null; } else { CharacterInventory inventory = character.Inventory; if (inventory == null) { flag = null; } else { CharacterSkillKnowledge skillKnowledge = inventory.SkillKnowledge; flag = ((skillKnowledge != null) ? new bool?(skillKnowledge.IsItemLearned(skillID)) : null); } } bool?flag2 = flag; return(flag2.GetValueOrDefault()); }
public static void Prefix(Weapon __instance, ref ImbueEffectPreset _effect) { CharacterSkillKnowledge characterSkillKnowledge; if (__instance == null) { characterSkillKnowledge = null; } else { Character ownerCharacter = __instance.OwnerCharacter; if (ownerCharacter == null) { characterSkillKnowledge = null; } else { CharacterInventory inventory = ownerCharacter.Inventory; characterSkillKnowledge = ((inventory != null) ? inventory.SkillKnowledge : null); } } CharacterSkillKnowledge characterSkillKnowledge2 = characterSkillKnowledge; bool flag = _effect.PresetID == 219 && characterSkillKnowledge2 != null && characterSkillKnowledge2.IsItemLearned(2502026); if (flag) { _effect = (ImbueEffectPreset)ResourcesPrefabManager.Instance.GetEffectPreset(269); } }
static private int GetPrice(Character character, SkillSlot slot) { // Cache CharacterSkillKnowledge characterSkills = character.Inventory.SkillKnowledge; Vector4 coeffs = _formulaCoeffsByLevel[GetLevel(slot)]; int allSkillsCount = characterSkills.m_activeSkillUIDs.Count + characterSkills.m_passiveSkillUIDs.Count; int currentSkillsCount = slot.ParentBranch.ParentTree.SkillSlots.Count(t => t.HasSkill(character)); int breakthroughsCount = character.PlayerStats.m_usedBreakthroughCount; float price = _formulaType == FormulaType.Linear ? coeffs.x + coeffs.y * allSkillsCount + coeffs.z * currentSkillsCount + coeffs.w * breakthroughsCount : coeffs.x * coeffs.y.Div(100f).Add(1).Pow(allSkillsCount) * coeffs.z.Div(100f).Add(1).Pow(currentSkillsCount) * coeffs.w.Div(100f).Add(1).Pow(breakthroughsCount); return(price.Round()); }
// PopulateSkillBar populates the default-behaviour Outward skill bar with enties from either // quickSlots1[] or quickSlots2[] based on the value of barMode private void PopulateSkillBar(Character character) { CharacterQuickSlotManager qsManager = character.QuickSlotMngr; if (qsManager.isActiveAndEnabled) { CharacterInventory inventory = qsManager.gameObject.GetComponent <CharacterInventory>(); CharacterSkillKnowledge knownSkills = inventory.SkillKnowledge; ItemManager itemManager = ItemManager.Instance; if (dev) { Debug.Log("Populating Skill Bar"); } // The entries we are going to use to populate Outward's default-behaviour skill bar is dependent on // whether we want the first skill bar or the second skill bar switch (charCurrentBarMode[character.UID]) { // In the case where we want entries from the first skill bar... case BarMode.FIRST: ClearSkillBar(qsManager); for (int i = 0; i < numSlots; i++) { if (charQuickSlotArrays[character.UID][0, i] != 0) { // This line loads a skill into the variable called "entry"... var entry = knownSkills.GetItemFromItemID(charQuickSlotArrays[character.UID][0, i]); // ...But if "entry" isn't a skill, load an item instead if (entry == null) { if (inventory.GetOwnedItems(charQuickSlotArrays[character.UID][0, i]).Count() == 0) { entry = ResourcesPrefabManager.Instance.GetItemPrefab(charQuickSlotArrays[character.UID][0, i]); } else { entry = inventory.GetOwnedItems(charQuickSlotArrays[character.UID][0, i]).First(); } } qsManager.SetQuickSlot(i, entry, false); } else { qsManager.ClearQuickSlot(i); } } // We are done doing stuff in the case of the first skill bar, so BREAK! break; // In the case where we want to add entries from the second skill bar... case BarMode.SECOND: ClearSkillBar(qsManager); for (int i = 0; i < numSlots; i++) { if (charQuickSlotArrays[character.UID][1, i] != 0) { // This line loads a skill into the variable called "entry"... var entry = knownSkills.GetItemFromItemID(charQuickSlotArrays[character.UID][1, i]); // ...But if "entry" isn't a skill, load an item instead if (entry == null) { if (inventory.GetOwnedItems(charQuickSlotArrays[character.UID][1, i]).Count() == 0) { entry = ResourcesPrefabManager.Instance.GetItemPrefab(charQuickSlotArrays[character.UID][1, i]); } else { entry = inventory.GetOwnedItems(charQuickSlotArrays[character.UID][1, i]).First(); } } qsManager.SetQuickSlot(i, entry, false); } else { qsManager.ClearQuickSlot(i); } } // We are done doing stuff in the case of the second skill bar, so BREAK! break; } } }
private void LoadQuickSlotsFromJSON(CharacterQuickSlotManager self) { CharacterInventory charInvent = self.gameObject.GetComponent <CharacterInventory>(); CharacterSkillKnowledge charSkills = charInvent.SkillKnowledge; ItemManager itemMan = ItemManager.Instance; //Load Quickslots for Bar 1 for (int i = 0; i < slotAmount; i++) { if (dev) { Debug.Log("LOADING QUICK SLOT " + i + " FOR BAR 1"); } var itemID = qsm.currentCharacter["DefaultBarIDS"][i]; if (itemID != 0) { if (dev) { Debug.Log("ID of slot " + i + " from JSON is : " + itemID); } var item = charSkills.GetItemFromItemID(itemID.AsInt); //this isnt a skill if (item == null) { item = charInvent.GetOwnedItems(itemID).First(); } defaultSlotItems[i] = item; } else { if (dev) { Debug.Log("QUICK SLOT " + i + " Has No ID"); } } } for (int i = 0; i < slotAmount; i++) { if (dev) { Debug.Log("LOADING QUICK SLOT " + i + " FOR BAR 2"); } var itemID = qsm.currentCharacter["SecondaryBarIDS"][i]; if (itemID != 0) { if (dev) { Debug.Log("ID of slot " + i + " from JSON is : " + itemID); } var item = charSkills.GetItemFromItemID(itemID.AsInt); //this isnt a skill if (item == null) { item = charInvent.GetOwnedItems(itemID).First(); } secondarySlotItems[i] = item; } else { if (dev) { Debug.Log("QUICK SLOT " + i + " Has No ID"); } } } }