Пример #1
0
  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);
    }
  }
Пример #2
0
  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);
  }
Пример #3
0
 public SkillMod getSkillMod(String name) {
   return skillMods.get(name);
 }
Пример #4
0
 public void removeSkillMod(SkillMod mod) {
   if (mod != null) {
     skillMods.remove(mod.getName());
   }
 }