static public Perk GetPerkByPerkValue(EPerkValue value)
 {
     for (int i = 0; i < perks.Count; ++i)
     {
         if (perks[i].value == value)
         {
             return(perks[i]);
         }
     }
     return(perks[0]);
 }
Exemple #2
0
        public void SetActiveWeapon(Weapon weapon, EPerkValue perk = EPerkValue.EMPTY_PERK)
        {
            Game.player.accuracy       = weapon.accuracy;
            Game.player.criticalChance = weapon.criticalChance;
            if (perk != EPerkValue.DAGGER_PERK)
            {
                if ((activeWeapon.type == EWeaponType.DAGGER) && Game.player.perksSystem.CheckPerk(PerksList.daggerPerk))
                {
                    --Game.player.attack;
                }
            }
            if (perk != EPerkValue.MACE_PERK)
            {
                if ((activeWeapon.type == EWeaponType.MACE) && Game.player.perksSystem.CheckPerk(PerksList.macePerk))
                {
                    --Game.player.attack;
                }
            }
            if (perk != EPerkValue.AXE_PERK)
            {
                if ((activeWeapon.type == EWeaponType.AXE) && Game.player.perksSystem.CheckPerk(PerksList.axePerk))
                {
                    --Game.player.attack;
                }
            }
            if (perk != EPerkValue.SWORD_PERK)
            {
                if ((activeWeapon.type == EWeaponType.SWORD) && Game.player.perksSystem.CheckPerk(PerksList.swordPerk))
                {
                    --Game.player.attack;
                }
            }
            if (perk != EPerkValue.STAFF_PERK)
            {
                if ((activeWeapon.type == EWeaponType.STAFF) && Game.player.perksSystem.CheckPerk(PerksList.staffPerk))
                {
                    --Game.player.attack;
                }
            }
            if (perk != EPerkValue.SPEAR_PERK)
            {
                if ((activeWeapon.type == EWeaponType.SPEAR) && Game.player.perksSystem.CheckPerk(PerksList.spearPerk))
                {
                    --Game.player.attack;
                }
            }

            Game.player.attack -= activeWeapon.attack;
            activeWeapon        = weapon;
            Game.player.attack += activeWeapon.attack;

            if ((activeWeapon.type == EWeaponType.DAGGER) && Game.player.perksSystem.CheckPerk(PerksList.daggerPerk))
            {
                ++Game.player.attack;
            }
            if ((activeWeapon.type == EWeaponType.MACE) && Game.player.perksSystem.CheckPerk(PerksList.macePerk))
            {
                ++Game.player.attack;
            }
            if ((activeWeapon.type == EWeaponType.AXE) && Game.player.perksSystem.CheckPerk(PerksList.axePerk))
            {
                ++Game.player.attack;
            }
            if ((activeWeapon.type == EWeaponType.SWORD) && Game.player.perksSystem.CheckPerk(PerksList.swordPerk))
            {
                ++Game.player.attack;
            }
            if ((activeWeapon.type == EWeaponType.STAFF) && Game.player.perksSystem.CheckPerk(PerksList.staffPerk))
            {
                ++Game.player.attack;
            }
            if ((activeWeapon.type == EWeaponType.SPEAR) && Game.player.perksSystem.CheckPerk(PerksList.spearPerk))
            {
                ++Game.player.attack;
            }
        }
Exemple #3
0
 public Perk(EPerkValue _value, string _info, int _level)
 {
     value = _value;
     info  = _info;
     level = _level;
 }