示例#1
0
文件: Shop.java 项目: wngsam/MIST
 public void buyArmor(MyCharacter myChar) {
   if (myChar.getArmorCounter() < 3) {
     Armor armor = GearGenerator.getNoviceArmors()[myChar.getArmorCounter()];
     if (myChar.getLevel() >= armor.getLevelReq() && myChar.getGold() >= armor.getCost()) {
       myChar.subtractGold(armor.getCost());
       myChar.setArmor(armor);
       myChar.setArmorCounter(myChar.getArmorCounter() + 1);
     }
   }
 }
示例#2
0
文件: Shop.java 项目: wngsam/MIST
 public void buyWeapon(MyCharacter myChar) {
   if (myChar.getWeaponCounter() < 5) {
     Weapon weapon = GearGenerator.getNoviceWeapons()[myChar.getWeaponCounter()];
     if (myChar.getLevel() >= weapon.getLevelReq() && myChar.getGold() >= weapon.getCost()) {
       myChar.subtractGold(weapon.getCost());
       myChar.setWeapon(weapon);
       myChar.setWeaponCounter(myChar.getWeaponCounter() + 1);
     }
   }
 }