示例#1
0
 @Override
 public int damage(Hunter hunter, Enemy enemy) {
   // TODO 自动生成的方法存根
   if (weapon.damage(hunter, enemy) > 0) {
     decreaseAglie(enemy);
   }
   return 0;
 }
示例#2
0
 public int hit(Character annan) {
   Random randomGenerator = new Random();
   int bonk = randomGenerator.nextInt(100);
   if (bonk < skill) {
     int tjoff = weapon.damage() - annan.getShield().absorbDamage();
     if (tjoff > 0) {
       System.out.println(name + " träffade och gav " + tjoff + " i skada");
       return tjoff;
     }
   }
   System.out.println(name + " missade. Klang");
   return 0;
 }