public ActionManager(){ _take = new AttackAble(); _expTable = new ExpTable(); _heal = new PlayerHeal(); _def = new PlayerDefense(); _enemy = new Bug(); _player = new Player(); }
public void NewGame(Size size, TimeSpan timeSpan) { // Si le nouveau jeu a des dimensions différentes on redéfinit offense, defense et gameSize if (size != gameSize) { offense = new OffenseBasic(size, options); defense = new DefenseBasic(size, options); gameSize = size; } }
public static void FacilitateAttack(IOffense offense, IDefense defense) { if (offense.Melee >= defense.ArmorClass) { var i = new { Id = 0, Name = "Bob" }; } }
public void Hit(int maxDamage, Random random) { int reducedMaxDamage = 0; foreach (Weapon weapon in inventory) { if (weapon is IDefense) { IDefense defensiveWeapon = weapon as IDefense; reducedMaxDamage += defensiveWeapon.Defense; } } HitPoints -= random.Next(1, Math.Max(1, maxDamage - reducedMaxDamage)); }