Rename and clean up MapleData
This commit is contained in:
@@ -43,9 +43,9 @@ public class SkillFactory {
|
||||
final MapleDataDirectoryEntry root = datasource.getRoot();
|
||||
for (MapleDataFileEntry topDir : root.getFiles()) { // Loop thru jobs
|
||||
if (topDir.getName().length() <= 8) {
|
||||
for (MapleData data : datasource.getData(topDir.getName())) { // Loop thru each jobs
|
||||
for (Data data : datasource.getData(topDir.getName())) { // Loop thru each jobs
|
||||
if (data.getName().equals("skill")) {
|
||||
for (MapleData data2 : data) { // Loop thru each jobs
|
||||
for (Data data2 : data) { // Loop thru each jobs
|
||||
if (data2 != null) {
|
||||
int skillId = Integer.parseInt(data2.getName());
|
||||
loadedSkills.put(skillId, loadFromData(skillId, data2));
|
||||
@@ -59,7 +59,7 @@ public class SkillFactory {
|
||||
skills = loadedSkills;
|
||||
}
|
||||
|
||||
private static Skill loadFromData(int id, MapleData data) {
|
||||
private static Skill loadFromData(int id, Data data) {
|
||||
Skill ret = new Skill(id);
|
||||
boolean isBuff = false;
|
||||
int skillType = MapleDataTool.getInt("skillType", data, -1);
|
||||
@@ -69,13 +69,13 @@ public class SkillFactory {
|
||||
} else {
|
||||
ret.setElement(Element.NEUTRAL);
|
||||
}
|
||||
MapleData effect = data.getChildByPath("effect");
|
||||
Data effect = data.getChildByPath("effect");
|
||||
if (skillType != -1) {
|
||||
if (skillType == 2) {
|
||||
isBuff = true;
|
||||
}
|
||||
} else {
|
||||
MapleData action_ = data.getChildByPath("action");
|
||||
Data action_ = data.getChildByPath("action");
|
||||
boolean action = false;
|
||||
if (action_ == null) {
|
||||
if (data.getChildByPath("prepare/action") != null) {
|
||||
@@ -92,8 +92,8 @@ public class SkillFactory {
|
||||
action = true;
|
||||
}
|
||||
ret.setAction(action);
|
||||
MapleData hit = data.getChildByPath("hit");
|
||||
MapleData ball = data.getChildByPath("ball");
|
||||
Data hit = data.getChildByPath("hit");
|
||||
Data ball = data.getChildByPath("ball");
|
||||
isBuff = effect != null && hit == null && ball == null;
|
||||
isBuff |= action_ != null && MapleDataTool.getString("0", action_, "").equals("alert2");
|
||||
switch (id) {
|
||||
@@ -317,12 +317,12 @@ public class SkillFactory {
|
||||
}
|
||||
}
|
||||
|
||||
for (MapleData level : data.getChildByPath("level")) {
|
||||
for (Data level : data.getChildByPath("level")) {
|
||||
ret.addLevelEffect(MapleStatEffect.loadSkillEffectFromData(level, id, isBuff));
|
||||
}
|
||||
ret.setAnimationTime(0);
|
||||
if (effect != null) {
|
||||
for (MapleData effectEntry : effect) {
|
||||
for (Data effectEntry : effect) {
|
||||
ret.incAnimationTime(MapleDataTool.getIntConvert("delay", effectEntry, 0));
|
||||
}
|
||||
}
|
||||
@@ -330,7 +330,7 @@ public class SkillFactory {
|
||||
}
|
||||
|
||||
public static String getSkillName(int skillid) {
|
||||
MapleData data = MapleDataProviderFactory.getDataProvider(WZFiles.STRING).getData("Skill.img");
|
||||
Data data = MapleDataProviderFactory.getDataProvider(WZFiles.STRING).getData("Skill.img");
|
||||
StringBuilder skill = new StringBuilder();
|
||||
skill.append(skillid);
|
||||
if (skill.length() == 4) {
|
||||
@@ -338,7 +338,7 @@ public class SkillFactory {
|
||||
skill.append("000").append(skillid);
|
||||
}
|
||||
if (data.getChildByPath(skill.toString()) != null) {
|
||||
for (MapleData skilldata : data.getChildByPath(skill.toString()).getChildren()) {
|
||||
for (Data skilldata : data.getChildByPath(skill.toString()).getChildren()) {
|
||||
if (skilldata.getName().equals("name"))
|
||||
return MapleDataTool.getString(skilldata, null);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user