Esempio n. 1
0
        private void applyItem(Character actingCharacter, Character target)
        {
            /* This is an absolute horrible way to do inventory. There will be an if statement for each type of consumable.
             * Actually design a good inventory system if there's time. R.F. 3/14/2014 */
            if (usedItem.WhichItem == ItemEnum.HEALTHPOTION)
            {/* start if */

                target.restoreHealth((int)((usedItem.BaseDamage/ 100.0) * target.MaximumHealth));

            }/* end if */

            if (usedItem.WhichItem == ItemEnum.MANAPOTION)
            {/* start if */

                target.restoreMana((int)((usedItem.BaseDamage/100.0) * target.MaximumMana));

            }/* end if */

            if(usedItem.WhichItem == ItemEnum.BOMB )
            {/* start if */

                target.takeDamage(usedItem.BaseDamage);

            }/* end if */

            battleEvents.Add(new BattleEvent(actingCharacter, this, target));
        }
Esempio n. 2
0
 private void applyAbility(Character actingCharacter, Character target, int base_stat)
 {
     if (usedAbility.HEALING)
     {
         target.restoreHealth(usedAbility.BaseDamage * base_stat);
     }
     else
     {
         target.takeDamage(usedAbility.BaseDamage * base_stat);
     }
     battleEvents.Add(new BattleEvent(actingCharacter, this, target));
 }
Esempio n. 3
0
        private void applyAbility(Character actingCharacter, Character target, int base_stat)
        {
            damage = usedAbility.BaseDamage * base_stat;

            if (!usedAbility.AffectEnemy)
            {
                target.restoreHealth(damage);
            }
            else
            {
                target.takeDamage(damage);
            }
            battleEvents.Add(new BattleEvent(actingCharacter, this, target));
        }
Esempio n. 4
0
 private void applyItem(Character actingCharacter, Character target)
 {
     if (usedItem.IsMana)
     {
         target.restoreHealth((100 / usedItem.BaseDamage) * target.MaximumHealth);
     }
     else if (usedItem.IsHealthPotion)
     {
         target.restoreMana((100 / usedItem.BaseDamage) * target.MaximumHealth);
     }
     else /*This assumes that the default/only other consumable item is a bomb. v___v*/
     {
         target.takeDamage((100 / usedItem.BaseDamage) * target.MaximumHealth);
     }
     battleEvents.Add(new BattleEvent(actingCharacter, this, target));
 }