Browse Source

added missing source types

feature-config-usage
FatBoy-DOTC 2 weeks ago
parent
commit
ef234beeb7
  1. 4
      src/engine/mbEnums.java
  2. 285
      src/engine/wpak/PowersParser.java

4
src/engine/mbEnums.java

@ -1016,7 +1016,9 @@ public class mbEnums {
Wizardry, Wizardry,
HealthRecoverRate, HealthRecoverRate,
ManaRecoverRate, ManaRecoverRate,
StaminaRecoverRate; StaminaRecoverRate,
MeleeDamageModifier,
PowerDamageModifier;
public static SourceType GetSourceType(String modName) { public static SourceType GetSourceType(String modName) {
SourceType returnMod; SourceType returnMod;

285
src/engine/wpak/PowersParser.java

@ -156,147 +156,150 @@ public class PowersParser {
if(power.powerBase.equalsIgnoreCase("none")) if(power.powerBase.equalsIgnoreCase("none"))
continue; continue;
String loggerString = "PARSING: " + power.powerBase + " KEY: " + key; String loggerString = "PARSING: " + power.powerBase + " KEY: " + key;
Logger.info(loggerString); try {
switch (key) { switch (key) {
case "ACTION": case "ACTION":
actionEntry = new ActionEntry(); actionEntry = new ActionEntry();
arguments = Arrays.asList(lineValues.get(1).trim().split("\\s+")); arguments = Arrays.asList(lineValues.get(1).trim().split("\\s+"));
actionEntry.effect_id = arguments.get(0); actionEntry.effect_id = arguments.get(0);
actionEntry.minTrains = Integer.parseInt(arguments.get(1)); actionEntry.minTrains = Integer.parseInt(arguments.get(1));
actionEntry.maxTrains = Integer.parseInt(arguments.get(2)); actionEntry.maxTrains = Integer.parseInt(arguments.get(2));
actionEntry.duration = Float.parseFloat(arguments.get(3)); actionEntry.duration = Float.parseFloat(arguments.get(3));
actionEntry.curve = mbEnums.CompoundCurveType.valueOf(arguments.get(4)); actionEntry.curve = mbEnums.CompoundCurveType.valueOf(arguments.get(4));
actionEntry.stackingCategory = arguments.get(5); actionEntry.stackingCategory = arguments.get(5);
actionEntry.stackingPriority = Integer.parseInt(arguments.get(6)); actionEntry.stackingPriority = Integer.parseInt(arguments.get(6));
actionEntry.categoryToPower = mbEnums.CategoryToPowerType.valueOf(arguments.get(7)); actionEntry.categoryToPower = mbEnums.CategoryToPowerType.valueOf(arguments.get(7));
powerEntry.actionEntries.add(actionEntry); powerEntry.actionEntries.add(actionEntry);
break; break;
case "MaxLevel": case "MaxLevel":
powerEntry.maxLevel = Integer.parseInt(lineValues.get(1).trim()); powerEntry.maxLevel = Integer.parseInt(lineValues.get(1).trim());
break; break;
case "HateValue": case "HateValue":
arguments = Arrays.asList(lineValues.get(1).trim().split("\\s+")); arguments = Arrays.asList(lineValues.get(1).trim().split("\\s+"));
powerEntry.hateValue = Integer.parseInt(arguments.get(0)); powerEntry.hateValue = Integer.parseInt(arguments.get(0));
// Not all entries have a curve. Defaults to DefaultFlat; // Not all entries have a curve. Defaults to DefaultFlat;
if (arguments.size() > 1) if (arguments.size() > 1)
powerEntry.hateCurve = mbEnums.CompoundCurveType.valueOf(arguments.get(1)); powerEntry.hateCurve = mbEnums.CompoundCurveType.valueOf(arguments.get(1));
break; break;
case "LOOPANIMID": case "LOOPANIMID":
powerEntry.loopAnimID = Integer.parseInt(lineValues.get(1).trim()); powerEntry.loopAnimID = Integer.parseInt(lineValues.get(1).trim());
break; break;
case "GRANTOVERRIDEVAR": case "GRANTOVERRIDEVAR":
powerEntry.grantOverrideVar = lineValues.get(1).trim(); powerEntry.grantOverrideVar = lineValues.get(1).trim();
break; break;
case "DESCRIPTION": case "DESCRIPTION":
powerEntry.description.add(lineValues.get(1).trim()); powerEntry.description.add(lineValues.get(1).trim());
break; break;
case "CATEGORY": case "CATEGORY":
powerEntry.category = lineValues.get(1).trim(); powerEntry.category = lineValues.get(1).trim();
break; break;
case "CURVE": case "CURVE":
arguments = Arrays.asList(lineValues.get(1).trim().split("\\s+")); arguments = Arrays.asList(lineValues.get(1).trim().split("\\s+"));
powerEntry.curves.put(arguments.get(0), mbEnums.CompoundCurveType.valueOf(arguments.get(1))); powerEntry.curves.put(arguments.get(0), mbEnums.CompoundCurveType.valueOf(arguments.get(1)));
break; break;
case "EQPREREQ": case "EQPREREQ":
argumentMatcher = STRSPLIT_REGEX.matcher(lineValues.get(1).trim()); argumentMatcher = STRSPLIT_REGEX.matcher(lineValues.get(1).trim());
arguments = new ArrayList<>(); arguments = new ArrayList<>();
while (argumentMatcher.find()) while (argumentMatcher.find())
arguments.add(argumentMatcher.group().trim()); arguments.add(argumentMatcher.group().trim());
argumentIterator = arguments.iterator(); argumentIterator = arguments.iterator();
while (argumentIterator.hasNext()) { while (argumentIterator.hasNext()) {
EquipmentPreReq equipmentPreReq = new EquipmentPreReq(); EquipmentPreReq equipmentPreReq = new EquipmentPreReq();
equipmentPreReq.slot = mbEnums.EquipSlotType.valueOf(argumentIterator.next()); equipmentPreReq.slot = mbEnums.EquipSlotType.valueOf(argumentIterator.next());
equipmentPreReq.skill = argumentIterator.next().replaceAll("\"", ""); equipmentPreReq.skill = argumentIterator.next().replaceAll("\"", "");
equipmentPreReq.required = Integer.parseInt(argumentIterator.next()); equipmentPreReq.required = Integer.parseInt(argumentIterator.next());
powerEntry.equipmentPreReq.add(equipmentPreReq); powerEntry.equipmentPreReq.add(equipmentPreReq);
} }
break; break;
case "CANCASTWHILEMOVING": case "CANCASTWHILEMOVING":
powerEntry.canCastWhileMoving = Boolean.parseBoolean(lineValues.get(1).trim()); powerEntry.canCastWhileMoving = Boolean.parseBoolean(lineValues.get(1).trim());
break; break;
case "CANCASTWHILEFLYING": case "CANCASTWHILEFLYING":
powerEntry.canCastWhileFlying = Boolean.parseBoolean(lineValues.get(1).trim()); powerEntry.canCastWhileFlying = Boolean.parseBoolean(lineValues.get(1).trim());
break; break;
case "BLADETRAILS": case "BLADETRAILS":
powerEntry.bladeTrails = Boolean.parseBoolean(lineValues.get(1).trim()); powerEntry.bladeTrails = Boolean.parseBoolean(lineValues.get(1).trim());
break; break;
case "EFFECTPREREQ": case "EFFECTPREREQ":
Effect effectPreReq = new Effect(); Effect effectPreReq = new Effect();
arguments = Arrays.asList(lineValues.get(1).trim().split("\\s+")); arguments = Arrays.asList(lineValues.get(1).trim().split("\\s+"));
effectPreReq.effect_id = arguments.get(9); effectPreReq.effect_id = arguments.get(9);
effectPreReq.level = Integer.parseInt(arguments.get(1)); effectPreReq.level = Integer.parseInt(arguments.get(1));
effectPreReq.message = arguments.get(2); effectPreReq.message = arguments.get(2);
powerEntry.effectPreReqs.add(effectPreReq); powerEntry.effectPreReqs.add(effectPreReq);
break; break;
case "MONSTERTYPERESTRICTS": case "MONSTERTYPERESTRICTS":
arguments = Arrays.asList(lineValues.get(1).trim().split("\\s+")); arguments = Arrays.asList(lineValues.get(1).trim().split("\\s+"));
for (String restriction : arguments) for (String restriction : arguments)
powerEntry.monsterRestricts.add(mbEnums.MonsterType.valueOf(restriction.trim())); powerEntry.monsterRestricts.add(mbEnums.MonsterType.valueOf(restriction.trim()));
break; break;
case "MONSTERTYPEPREREQS": case "MONSTERTYPEPREREQS":
arguments = Arrays.asList(lineValues.get(1).trim().split("\\s+")); arguments = Arrays.asList(lineValues.get(1).trim().split("\\s+"));
for (String restriction : arguments) for (String restriction : arguments)
powerEntry.monsterPrereqs.add(mbEnums.MonsterType.valueOf(restriction.trim())); powerEntry.monsterPrereqs.add(mbEnums.MonsterType.valueOf(restriction.trim()));
break; break;
case "SHOULDCHECKPATH": case "SHOULDCHECKPATH":
powerEntry.shouldCheckPath = Boolean.parseBoolean(lineValues.get(1).trim()); powerEntry.shouldCheckPath = Boolean.parseBoolean(lineValues.get(1).trim());
break; break;
case "STICKY": case "STICKY":
powerEntry.sticky = Boolean.parseBoolean(lineValues.get(1).trim()); powerEntry.sticky = Boolean.parseBoolean(lineValues.get(1).trim());
break; break;
case "PULSEINFO": case "PULSEINFO":
arguments = Arrays.asList(lineValues.get(1).trim().split("\\s+")); arguments = Arrays.asList(lineValues.get(1).trim().split("\\s+"));
powerEntry.pulseCycle = Integer.parseInt(arguments.get(0)); powerEntry.pulseCycle = Integer.parseInt(arguments.get(0));
powerEntry.pulseDuration = Integer.parseInt(arguments.get(1)); powerEntry.pulseDuration = Integer.parseInt(arguments.get(1));
break; break;
case "MAXNUMMOBTARGETS": case "MAXNUMMOBTARGETS":
powerEntry.maxMobTargets = Integer.parseInt(lineValues.get(1).trim()); powerEntry.maxMobTargets = Integer.parseInt(lineValues.get(1).trim());
break; break;
case "MAXNUMPLAYERTARGETS": case "MAXNUMPLAYERTARGETS":
powerEntry.maxPlayerTargets = Integer.parseInt(lineValues.get(1).trim()); powerEntry.maxPlayerTargets = Integer.parseInt(lineValues.get(1).trim());
break; break;
case "ISADMINPOWER": case "ISADMINPOWER":
powerEntry.isAdminPower = Boolean.parseBoolean(lineValues.get(1).trim()); powerEntry.isAdminPower = Boolean.parseBoolean(lineValues.get(1).trim());
break; break;
case "ISPROJECTILE": case "ISPROJECTILE":
powerEntry.isProjectile = Boolean.parseBoolean(lineValues.get(1).trim()); powerEntry.isProjectile = Boolean.parseBoolean(lineValues.get(1).trim());
break; break;
case "CASTERSPULSEPARTICLE": case "CASTERSPULSEPARTICLE":
powerEntry.casterPulseParticle = Integer.parseInt(lineValues.get(1).trim()); powerEntry.casterPulseParticle = Integer.parseInt(lineValues.get(1).trim());
break; break;
case "TARGETEFFECTPREREQS_ORED": case "TARGETEFFECTPREREQS_ORED":
Effect preReq = new Effect(); Effect preReq = new Effect();
arguments = Arrays.asList(lineValues.get(1).trim().split("\\s+")); arguments = Arrays.asList(lineValues.get(1).trim().split("\\s+"));
preReq.effect_id = arguments.get(0); preReq.effect_id = arguments.get(0);
preReq.level = Integer.parseInt(arguments.get(1)); preReq.level = Integer.parseInt(arguments.get(1));
powerEntry.targetEffectPrereqs.add(preReq); powerEntry.targetEffectPrereqs.add(preReq);
break; break;
case "SOUNDS": // Values not parsed case "SOUNDS": // Values not parsed
case "APPLYDAMAGESELF": case "APPLYDAMAGESELF":
case "APPLYDAMAGECASTER": case "APPLYDAMAGECASTER":
case "APPLYDAMAGEOTHER": case "APPLYDAMAGEOTHER":
case "APPLYDAMAGETARGET": case "APPLYDAMAGETARGET":
case "APPLYEFFECTSELF": case "APPLYEFFECTSELF":
case "APPLYEFFECTOTHER": case "APPLYEFFECTOTHER":
case "APPLYEFFECTCASTER": case "APPLYEFFECTCASTER":
case "APPLYEFFECTTARGET": case "APPLYEFFECTTARGET":
case "FIZZLEOTHER": case "FIZZLEOTHER":
case "FIZZLESELF": case "FIZZLESELF":
case "INITSTRING": case "INITSTRING":
case "SUCCESSOTHER": case "SUCCESSOTHER":
case "SUCCESSSELF": case "SUCCESSSELF":
case "WEAROFFEFFECTOTHER": case "WEAROFFEFFECTOTHER":
case "WEAROFFEFFECTSELF": case "WEAROFFEFFECTSELF":
break; break;
default: default:
Logger.error("Unhandled variable type:" + key + " for power: " + powerEntry.power_id); Logger.error("Unhandled variable type:" + key + " for power: " + powerEntry.power_id);
}
}catch(Exception e){
Logger.info(loggerString + " ERROR: " + e);
} }
} }

Loading…
Cancel
Save