public void setTargetParam(gameChar target, int field, int effectVal) { switch (field) { case 0: target.setCurrentHP(target.getCurrentHP() + effectVal); break; case 1: target.setCurrentMP(target.getCurrentMP() + effectVal); break; case 2: target.setAttMod(target.getAttMod() + effectVal); break; case 3: target.setDefMod(target.getDefMod() + effectVal); break; case 4: target.setIntMod(target.getIntMod() + effectVal); break; } }
public bool unEquipChar(gameChar equiped) { for (int i = 0; i < rank; i++) //for each rank, unset owner's attribute { float effectingVal = attributePair[i].second; switch ((int)(attributePair[i].first)) { case 0: { equiped.setMaxHP(equiped.getMaxHP() - effectingVal); equiped.setCurrentHP(equiped.getCurrentHP() - effectingVal); break; } case 1: { equiped.setMaxMP(equiped.getMaxMP() - effectingVal); equiped.setCurrentMP(equiped.getCurrentMP() - effectingVal); break; } case 2: { equiped.setAttack(equiped.getAttack() - effectingVal); break; } case 3: { equiped.setDefense(equiped.getDefense() - effectingVal); break; } case 4: { equiped.setIntelligence(equiped.getIntelligence() - effectingVal); break; } default: { return(false); break; } } } return(true); }