Example #1
0
        //private Item mItem;
        public BattleAction(ActionEnum action, Ability ability)
        {
            /* start BattleAction */

            mAction = action;
            mAbility = ability;
        }
Example #2
0
        /* start ItemFactory */
        public static Item getItem(ItemEnum item)
        {
            /* start getItem */

            Item items = null;

            if (item == ItemEnum.HEALTHPOTION)
                items = new Ability("Heals a character's health by 25%", "Health Potion", Ability.MAGIC, Ability.SINGLETARGET, Ability.HEALING, 25, 0, ItemType.ABILITY);

            if (item == ItemEnum.MANAPOTION)
            {/* start if */

                items = new Ability("Restores a character's mana by 25%", "Mana Potion", Ability.MAGIC, Ability.HEALING, false, 25, 0, ItemType.ABILITY);
                items.IsMana = true;

            }/* end if */

            if (item == ItemEnum.GANDALFSSTAFF)
                items = new Weapon("Gandalf's Staff", "YOU SHALL NOT PASS!", 100, new int[Character.MAXSTATS] { 5, 100, 5, 20 }, ItemType.WEAPON);

            if (item == ItemEnum.UBERSWORD)
                items = new Weapon("Uber Sword", "Used to PWN noobs.", 100, new int[Character.MAXSTATS] { 100, 15, 30, 30 }, ItemType.WEAPON);

            if (item == ItemEnum.BOMB)
                items = new Ability("Blow up the enemy.", "Bomb", Ability.PHYSICAL, Ability.PARTYTARGET, Ability.DAMAGING, 25, 0, ItemType.ABILITY);

            return items;
        }
Example #3
0
 public ArrayList getAbilityTargets(Ability selectedAbility)
 {
     ArrayList targetlist = new ArrayList();
     for (int i = 0; i < turnOrder.Length; i++)
     {
         if (turnOrder[i].isPlayer && !selectedAbility.AffectEnemy || !turnOrder[i].isPlayer && selectedAbility.AffectEnemy)
         {
             targetlist.Add(turnOrder[i]);
         }
     }
     return targetlist;
 }
Example #4
0
 public ItemAction(Ability itemToUse, Character targetedCharacter)
 {
     usedItem = itemToUse;
     specificTarget = targetedCharacter;
 }
Example #5
0
 public ItemAction(Ability itemToUse)
 {
     usedItem = itemToUse;
 }
 public AbilityAction(Ability abilityToUse, Character targetedCharacter)
 {
     usedAbility = abilityToUse;
     specificTarget = targetedCharacter;
 }
 public AbilityAction(Ability abilityToUse)
 {
     usedAbility = abilityToUse;
 }
Example #8
0
        public void addAbility(Ability ability)
        {
            /* start addAbility */

            mAbilities.Add(ability);
        }
Example #9
0
        public void usePotion(Ability potion, PlayerCharacter target)
        {
            /* start usePotion */

            mInventory.Remove(potion);

            if (potion.IsMana)
                target.restoreMana((int)(potion.BaseDamage / 100.0) * target.MaximumMana);
            else
                target.restoreHealth((int)(potion.BaseDamage / 100.0) * target.MaximumHealth);
        }