Exemplo n.º 1
0
 public void sleep(Player pj) {
   int newFatigue = pj.getVital().getFatigue() - (this.level * 4);
   pj.getVital().setFatigue(newFatigue);
   pj.getVital().setLife(pj.getVital().getLife() + (this.level * 2));
   int newGold = pj.getInventory().getGold() - this.priceToSleep;
   pj.getInventory().setGold(newGold);
 }
Exemplo n.º 2
0
 public void eat(Player pj) {
   int newHunger = pj.getVital().getHunger() - this.level;
   pj.getVital().setHunger(newHunger);
   pj.getVital().setLife(pj.getVital().getLife() + this.level);
   int newGold = pj.getInventory().getGold() - this.priceToEat;
   pj.getInventory().setGold(newGold);
 }