예제 #1
0
        public void UseSkill(Skill skill, int target, int caster = 0)
        {
            // ako je target = 0, skill pogadja player-a
            // a ako je 1, 2, 3 pogadja odgovarajuceg neprijatelja
            // caster = 0 player koristi skill
            // caster = 1, 2, 3 odgovarajuci neprijatelj koristi skill
            damageDealt = skill.GetPower();
            EquipmentSlots equipment = playerParty[0].GetEquipment();

            if (target == 0)
            {
                monsterParty[caster - 1].LoseMana(skill.GetManaCost());
                damageDealt -= damageDealt * equipment.GetArmor().GetPower() / 100;
                playerParty[0].LoseHealth(damageDealt);
                if (playerParty[0].GetHealth() <= 0)
                {
                    playerParty[0].SetID(0);
                }
            }
            else
            {
                playerParty[0].LoseMana(skill.GetManaCost());
                damageDealt = damageDealt * equipment.GetPrimary().GetPower() / 100;
                if (damageDealt == 0)
                {
                    damageDealt = (int)skill.GetPower() / 5;
                }
                monsterParty[target - 1].LoseHealth(damageDealt);
                if (monsterParty[target - 1].GetHealth() <= 0)
                {
                    monsterParty[target - 1].SetID(0);
                }
            }
        }
예제 #2
0
 public Character()
 {
     ID            = 1; name = "";  LVL = 1;
     sprite        = new Image();
     maxHealth     = 100; health = maxHealth;
     maxMana       = 50; mana = maxMana;
     skills        = new List <Skill>();
     statusEffects = new List <StatusEffect>();
     atributes     = new Atributes();
     inventory     = new Inventory();
     equipment     = new EquipmentSlots();
 }
예제 #3
0
 public void SetEquipment(EquipmentSlots equipment)
 {
     this.equipment = equipment;
 }