Lessen magic numbers around mob skills with new "type" enum

This commit is contained in:
P0nk
2022-09-02 07:39:26 +02:00
parent 91c58eee04
commit 3c9be7d70b
5 changed files with 127 additions and 106 deletions

View File

@@ -63,8 +63,7 @@ public class MobSkillFactory {
}
writeLock.lock();
try {
MobSkill ret;
ret = mobSkills.get(key);
MobSkill ret = mobSkills.get(key);
if (ret == null) {
Data skillData = skillRoot.getChildByPath(skillId + "/level/" + level);
if (skillData != null) {
@@ -93,7 +92,7 @@ public class MobSkillFactory {
lt = (Point) ltd.getData();
rb = (Point) skillData.getChildByPath("rb").getData();
}
ret = new MobSkill(skillId, level);
ret = new MobSkill(MobSkillType.from(skillId), level);
ret.addSummons(toSummon);
ret.setCoolTime(cooltime);
ret.setDuration(duration);