Beispiel #1
0
        public int GetLevels(StatsAtributte stat, CharacterTypes charTypes)
        {
            BuildLookup();

            int[] levels = lookupTable[charTypes][stat];
            return(levels.Length);
        }
Beispiel #2
0
        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);
        }
Beispiel #3
0
 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);
     }
 }
Beispiel #4
0
        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]);
        }
Beispiel #5
0
 public int GetStat(StatsAtributte stat)
 {
     if (statCollection.ContainsKey(stat))
     {
         return(statCollection[stat].value);
     }
     else
     {
         return(1);
     }
 }
Beispiel #6
0
 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");
     }
 }
Beispiel #7
0
 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");
     }
 }
Beispiel #8
0
 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");
     }
 }
Beispiel #9
0
 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");
     }
 }
Beispiel #10
0
 private float GetBaseStat(StatsAtributte stat)
 {
     return(progression.GetStat(stat, charType, GetLevel()));
 }