public int GetLevels(StatsAtributte stat, CharacterTypes charTypes) { BuildLookup(); int[] levels = lookupTable[charTypes][stat]; return(levels.Length); }
public void Unnequip(int equippedOn) { ItemConfig itemToUnnequip = partyMember.equippedItemSlot[equippedOn].item; StatsAtributte stat = itemToUnnequip.GetAttributeToModify(); Inventory inventory = GameObject.FindGameObjectWithTag("Player").GetComponent <Inventory>(); switch (equippedOn) { case 0: characterSelected.GetStats().ReturnAfterUnnequip(stat, itemToUnnequip, CharEquipmentSlot.LeftHand); break; case 1: characterSelected.GetStats().ReturnAfterUnnequip(stat, itemToUnnequip, CharEquipmentSlot.Book); break; case 2: characterSelected.GetStats().ReturnAfterUnnequip(stat, itemToUnnequip, CharEquipmentSlot.RightHand); break; default: return; } inventory.AddItem(itemToUnnequip, 1); LoadSpecificMemberInfo(selectedindex); }
public void ReturnAfterUnnequip(StatsAtributte stat, ItemConfig item, CharEquipmentSlot equippedOn) { if (statCollection.ContainsKey(stat) && statCollection[stat].isModifiedByItem && GetEquippedItem(equippedOn) != null) { statCollection[stat].value -= statCollection[stat].GetSpecificValueModifiedByItem(equippedOn); statCollection[stat].isModifiedByItem = false; SetEquippedItem(equippedOn, null); } }
public float GetStat(StatsAtributte stat, CharacterTypes charType, int level) { BuildLookup(); int[] levels = lookupTable[charType][stat]; if (levels.Length < level) { return(0); } return(levels[level - 1]); }
public int GetStat(StatsAtributte stat) { if (statCollection.ContainsKey(stat)) { return(statCollection[stat].value); } else { return(1); } }
public void ModifyStatPermanent(StatsAtributte stat, int value) { if (statCollection.ContainsKey(stat)) { statCollection[stat].value += value; if (statCollection[stat].value < 0) { statCollection[stat].value = 0; } } else { Debug.LogError("Stat " + stat + " not found"); } }
public void ModifyStatOnBattle(StatsAtributte stat, int value) { if (statCollection.ContainsKey(stat)) { statCollection[stat].value += value; statCollection[stat].isModifiedOnBattle = true; if (statCollection[stat].value < 0) { statCollection[stat].value = 0; } } else { Debug.LogError("Stat " + stat + " not found"); } }
public void ModifyStatByEquip(StatsAtributte stat, int value, ItemConfig item, CharEquipmentSlot equipOn) { if (statCollection.ContainsKey(stat)) { statCollection[stat].value += value; statCollection[stat].isModifiedByItem = true; statCollection[stat].SetSpecificValueModifiedByItem(equipOn, value); SetEquippedItem(equipOn, item); if (statCollection[stat].value < 0) { statCollection[stat].value = 0; } } else { Debug.LogError("Stat " + stat + " not found"); } }
public void HealStat(StatsAtributte stat, int value) { if (statCollection.ContainsKey(stat)) { if (stat == StatsAtributte.Health || stat == StatsAtributte.SkillPoints) { statCollection[stat].value += value; if (stat == StatsAtributte.Health && statCollection[stat].value > statCollection[StatsAtributte.MaxHealth].value) { statCollection[stat].value = statCollection[StatsAtributte.MaxHealth].value; } else if (stat == StatsAtributte.SkillPoints && statCollection[stat].value > statCollection[StatsAtributte.MaxSkillPoints].value) { statCollection[stat].value = statCollection[StatsAtributte.MaxSkillPoints].value; } } } else { Debug.LogError("Stat " + stat + " not found"); } }
private float GetBaseStat(StatsAtributte stat) { return(progression.GetStat(stat, charType, GetLevel())); }