public void deductSkillMod(String name, int base) { if (getSkillMod(name) == null) { return; } SkillMod mod = getSkillMod(name); mod.setBase(mod.getBase() - base); if (mod.getBase() <= 0) { removeSkillMod(mod); } else { skillMods.put(name, mod); } }
public void addSkillMod(String name, int base) { SkillMod mod; if (getSkillMod(name) == null) { mod = new SkillMod(); mod.setBase(base); mod.setName(name); mod.setModifier(0); } else { mod = getSkillMod(name); mod.setBase(mod.getBase() + base); } skillMods.put(name, mod); }
public SkillMod getSkillMod(String name) { return skillMods.get(name); }
public void removeSkillMod(SkillMod mod) { if (mod != null) { skillMods.remove(mod.getName()); } }