示例#1
0
文件: City.java 项目: algorys/agshmne
 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);
 }
示例#2
0
文件: City.java 项目: algorys/agshmne
 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);
 }