Exemplo n.º 1
0
 public WarriorBaseInfo(Warrior w)
 {
     name = w.Name;
     surname = w.Surname;
     mastery = w.Mastery;
     strength = w.Strength;
     agility = w.Agility;
 }
Exemplo n.º 2
0
        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;
        }
Exemplo n.º 3
0
 protected Weapon(weaponsDmgTypes dmgType, string name, int cost)
 {
     damageType = dmgType;
     this.name = name;
     this.cost = cost;
     holder = null;
 }
Exemplo n.º 4
0
 public void removeSubordinate(Warrior subordinate)
 {
     subordinatesList.Remove(subordinate);
 }
Exemplo n.º 5
0
 public void addSubordinate(Warrior subordinate)
 {
     subordinatesList.Add(subordinate);
 }