public int Protection(Mage mage) { return(_protection + Convert.ToInt32(1.25f * (mage.Level - this._levelRequirement ))); //improves the spell strength by the level of the mage }
static void Main(string[] args) { //goblins Creature goblin1 = new Goblin("prok", 15, 6, 100); Creature goblin2 = new Goblin("krold", 10, 10, 125); //warriors Creature warrior1 = new Warrior("Goblin slayer", 25, 20, 1000, 1, new Sword(), new PlateArmor()); Creature warrior2 = new Warrior("Josuke", 30, 20, 750, 1, new Sword(), new PlateArmor()); //mages Creature mage1 = new Mage("Saruman", 2, 8, 700, 100, 10, new MagicShield(3, 50, 15), new FireBall(2, 50, 10), new MageVest()); Creature mage2 = new Mage("Gandalf", 1, 4, 450, 200, 10, new MagicShield(2, 70, 10), new FireBall(4, 50, 15), new MageVest()); //match between two creatures Fight(new Mage(), new Mage()); //match between 2 armies -> Ith member of the army fight against Ith member of the other army. Wins who has the most survivors. int armyCapacity = 25; var army1 = new List <Creature>(); var army2 = new List <Creature>(); ArmyFight(army1, army2, armyCapacity); }
public abstract void Throw(Mage mage, Creature enemy); //abstract class
public bool IsUsable(Mage mage) { return((mage.Level >= _levelRequirement) ? true : false); }
public override void Throw(Mage mage, Creature enemy) { enemy.ReduceHealthBy(this.Damage(mage)); //directly attacks the enemy ignoring any type of physical armor (only magic armors like magicShields can block magic). }
public int Damage(Mage mage) { return(_rnd.Next(0, _damage) + Convert.ToInt32(1.25f * (mage.Level - this._levelRequirement))); //improves the spell strength by the level of the mage }