Rename and clean up MapleMonsterStats

This commit is contained in:
P0nk
2021-09-09 22:08:48 +02:00
parent 2acf2ed83d
commit 3aa455a757
8 changed files with 52 additions and 52 deletions

View File

@@ -19,7 +19,7 @@
*/
package tools.mapletools;
import server.life.MapleMonsterStats;
import server.life.MonsterStats;
import tools.Pair;
import java.io.PrintWriter;
@@ -52,7 +52,7 @@ public class ArrowFetcher {
private static final Map<Integer, Pair<Integer, Integer>> mobRange = new HashMap<>();
private static PrintWriter printWriter;
private static Map<Integer, MapleMonsterStats> mobStats;
private static Map<Integer, MonsterStats> mobStats;
private static Pair<Integer, Integer> calcArrowRange(int level, boolean boss) {
int minRange, maxRange;
@@ -69,8 +69,8 @@ public class ArrowFetcher {
private static void calcAllMobsArrowRange() {
System.out.print("Calculating range... ");
for (Entry<Integer, MapleMonsterStats> mobStat : mobStats.entrySet()) {
MapleMonsterStats mms = mobStat.getValue();
for (Entry<Integer, MonsterStats> mobStat : mobStats.entrySet()) {
MonsterStats mms = mobStat.getValue();
Pair<Integer, Integer> arrowRange;
arrowRange = calcArrowRange(mms.getLevel(), mms.isBoss());

View File

@@ -1,6 +1,6 @@
package tools.mapletools;
import server.life.MapleMonsterStats;
import server.life.MonsterStats;
import tools.Pair;
import java.io.File;
@@ -35,7 +35,7 @@ public class MesoFetcher {
private static final Map<Integer, Pair<Integer, Integer>> mobRange = new HashMap<>();
private static PrintWriter printWriter;
private static Map<Integer, MapleMonsterStats> mobStats;
private static Map<Integer, MonsterStats> mobStats;
private static Pair<Integer, Integer> calcMesoRange90(int level, boolean boss) {
int minRange, maxRange;
@@ -76,8 +76,8 @@ public class MesoFetcher {
private static void calcAllMobsMesoRange() {
System.out.print("Calculating range... ");
for (Map.Entry<Integer, MapleMonsterStats> mobStat : mobStats.entrySet()) {
MapleMonsterStats mms = mobStat.getValue();
for (Map.Entry<Integer, MonsterStats> mobStat : mobStats.entrySet()) {
MonsterStats mms = mobStat.getValue();
Pair<Integer, Integer> mesoRange;
if (mms.getLevel() < 90) {

View File

@@ -8,7 +8,7 @@ import server.life.ElementalEffectiveness;
import server.life.LifeFactory.BanishInfo;
import server.life.LifeFactory.loseItem;
import server.life.LifeFactory.selfDestruction;
import server.life.MapleMonsterStats;
import server.life.MonsterStats;
import tools.Pair;
import java.util.*;
@@ -17,9 +17,9 @@ public class MonsterStatFetcher {
private static final DataProvider data = DataProviderFactory.getDataProvider(WZFiles.MOB);
private static final DataProvider stringDataWZ = DataProviderFactory.getDataProvider(WZFiles.STRING);
private static final Data mobStringData = stringDataWZ.getData("Mob.img");
private static final Map<Integer, MapleMonsterStats> monsterStats = new HashMap<>();
private static final Map<Integer, MonsterStats> monsterStats = new HashMap<>();
static Map<Integer, MapleMonsterStats> getAllMonsterStats() {
static Map<Integer, MonsterStats> getAllMonsterStats() {
DataDirectoryEntry root = data.getRoot();
System.out.print("Parsing mob stats... ");
@@ -36,7 +36,7 @@ public class MonsterStatFetcher {
Integer mid = getMonsterId(fileName);
Data monsterInfoData = monsterData.getChildByPath("info");
MapleMonsterStats stats = new MapleMonsterStats();
MonsterStats stats = new MonsterStats();
stats.setHp(DataTool.getIntConvert("maxHP", monsterInfoData));
stats.setFriendly(DataTool.getIntConvert("damagedByMob", monsterInfoData, 0) == 1);
stats.setPADamage(DataTool.getIntConvert("PADamage", monsterInfoData));
@@ -134,7 +134,7 @@ public class MonsterStatFetcher {
return Integer.parseInt(fileName.substring(0, 7));
}
private static void decodeElementalString(MapleMonsterStats stats, String elemAttr) {
private static void decodeElementalString(MonsterStats stats, String elemAttr) {
for (int i = 0; i < elemAttr.length(); i += 2) {
stats.setEffectiveness(Element.getFromChar(elemAttr.charAt(i)), ElementalEffectiveness.getByNumber(Integer.valueOf(String.valueOf(elemAttr.charAt(i + 1)))));
}

View File

@@ -1,6 +1,6 @@
package tools.mapletools;
import server.life.MapleMonsterStats;
import server.life.MonsterStats;
import tools.Pair;
import java.io.File;
@@ -31,7 +31,7 @@ public class SkillbookChanceFetcher {
private static final Map<Pair<Integer, Integer>, Integer> skillbookChances = new HashMap<>();
private static PrintWriter printWriter;
private static Map<Integer, MapleMonsterStats> mobStats;
private static Map<Integer, MonsterStats> mobStats;
private static List<Map.Entry<Pair<Integer, Integer>, Integer>> sortedSkillbookChances() {
List<Map.Entry<Pair<Integer, Integer>, Integer>> skillbookChancesList = new ArrayList<>(skillbookChances.entrySet());