public WarriorBaseInfo(Warrior w) { name = w.Name; surname = w.Surname; mastery = w.Mastery; strength = w.Strength; agility = w.Agility; }
public void hit(Warrior attacker, HitArgs args) { weaponsDmgTypes dmgType = args.DamageType; double power = args.Power; if (!resistances.ContainsKey((byte)dmgType)) dmgType = (byte)weaponsDmgTypes.UNKNOWN; double damage = power / resistances[(byte)dmgType]; if(durability == 0) { Console.WriteLine("\n" + attacker.Name + " with ' " + attacker.GetWeapon.Name + " ' ---> ' " + name + " ': target is already destroyed, it would take " + damage + " damage if it was unbroken \n"); attacker.unreadyOne(new HitDelegate(hit)); return; } Console.WriteLine(attacker.Name + " with ' " + attacker.GetWeapon.Name + " ' ---> ' " + name + " ' : target has been damaged for " + damage + " durability points"); if(damage >= durability) { durability = 0; Console.WriteLine("\n|---Target ' " + name + " ' has been destroyed by " + attacker.Name + " with ' " + attacker.GetWeapon.Name + " ' ---|\n"); attacker.unreadyOne(new HitDelegate(hit)); } else { durability -= damage; } return; }
protected Weapon(weaponsDmgTypes dmgType, string name, int cost) { damageType = dmgType; this.name = name; this.cost = cost; holder = null; }
public void removeSubordinate(Warrior subordinate) { subordinatesList.Remove(subordinate); }
public void addSubordinate(Warrior subordinate) { subordinatesList.Add(subordinate); }