private void singleTargetAbility(Character actingCharacter, Character target) { int base_stat = 1; if (usedAbility.isMagic) { base_stat = actingCharacter.getStat(StatEnum.MAGIC); } else { base_stat = actingCharacter.getStat(StatEnum.STRENGTH); } applyAbility(actingCharacter, target, base_stat); }
public void specificAction(Character actingCharacter, Character[] combatants) { int attack = actingCharacter.getStat(StatEnum.STRENGTH) + actingCharacter.WeaponDamage; int damage = attack - target.getStat(StatEnum.ARMOR); if (damage > 0) { target.takeDamage(damage); attackResult = " attacked and did " + damage + " to "; } else { attackResult = " was unable to damage "; } battleEvents.Add(new BattleEvent(actingCharacter, this, target)); }
private void spreadAbility(Character actingCharacter, Character[] combatants) { int base_stat = 1; if (usedAbility.isMagic) { base_stat = actingCharacter.getStat(StatEnum.MAGIC); } else { base_stat = actingCharacter.getStat(StatEnum.STRENGTH); } for (int i = 0; i < combatants.Length; i++) { if (combatants[i].isPlayer && !usedAbility.AffectEnemy || !combatants[i].isPlayer && usedAbility.AffectEnemy) { applyAbility(actingCharacter, combatants[i], base_stat); } } }
public bool CompareTo(Character character) { /* start CompareTo */ return this.getStat(StatEnum.AGILITY) < character.getStat(StatEnum.AGILITY); }
private void spreadAbility(Character actingCharacter, Character[] combatants) { int base_stat = 1; if (usedAbility.isMagic) { base_stat = actingCharacter.getStat(StatEnum.MAGIC); } else { base_stat = actingCharacter.getStat(StatEnum.STRENGTH); } /* This loop does not take into account that enemies can have abilities as well. Maybe I didn't communicate that */ for (int i = 0; i < combatants.Length; i++) { if (actingCharacter.isPlayer) { if ((combatants[i].isPlayer && !usedAbility.AffectEnemy) || (!combatants[i].isPlayer && usedAbility.AffectEnemy)) applyAbility(actingCharacter, combatants[i], base_stat); } else { if ((!combatants[i].isPlayer && !usedAbility.AffectEnemy) || (combatants[i].isPlayer && usedAbility.AffectEnemy)) applyAbility(actingCharacter, combatants[i], base_stat); } } }