Professional Documents
Culture Documents
package com.ryerbs.main;
import com.ryerbs.model.Human;
import com.ryerbs.model.Monster;
if (turnToAttack % 2 == 0) {
// System.out.println()
// result is even - human will attack
Long health = monster1.getHealth();
monster1.setHealth(health - human1.getDamage());
}
OOP HUMAN:
package com.ryerbs.model;
/**
*
* @author KaiZeR
*/
public class Human {
// this part here is to set the damage of the human base on weapon used
Long damage;
if (this.getWeapon().equals("sword")) {
damage = (long) 10;
this.setDamage(damage);
} else if (this.getWeapon().equals("woodstick")) {
damage = (long) 5;
this.setDamage(damage);
}
}
OOP.Monster:
package com.ryerbs.model;
/**
*
* @author KaiZeR
*/
public class Monster {
// this part here is to set the damage of the monster base on weapon used
Long damage;
if (this.getWeapon().equals("axe")) {
damage = (long) 10.5;
this.setDamage(damage);
} else if (this.getWeapon().equals("woodstick")) {
damage = (long) 5.5;
this.setDamage(damage);
}
}
OUTPUT: