forked from MagicBane/Server
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
121 lines
4.6 KiB
121 lines
4.6 KiB
// • ▌ ▄ ·. ▄▄▄· ▄▄ • ▪ ▄▄· ▄▄▄▄· ▄▄▄· ▐▄▄▄ ▄▄▄ . |
|
// ·██ ▐███▪▐█ ▀█ ▐█ ▀ ▪██ ▐█ ▌▪▐█ ▀█▪▐█ ▀█ •█▌ ▐█▐▌· |
|
// ▐█ ▌▐▌▐█·▄█▀▀█ ▄█ ▀█▄▐█·██ ▄▄▐█▀▀█▄▄█▀▀█ ▐█▐ ▐▌▐▀▀▀ |
|
// ██ ██▌▐█▌▐█ ▪▐▌▐█▄▪▐█▐█▌▐███▌██▄▪▐█▐█ ▪▐▌██▐ █▌▐█▄▄▌ |
|
// ▀▀ █▪▀▀▀ ▀ ▀ ·▀▀▀▀ ▀▀▀·▀▀▀ ·▀▀▀▀ ▀ ▀ ▀▀ █▪ ▀▀▀ |
|
// Magicbane Emulator Project © 2013 - 2024 |
|
// www.magicbane.com |
|
|
|
package engine.wpak.data; |
|
|
|
import engine.mbEnums; |
|
import engine.objects.AbstractWorldObject; |
|
|
|
import java.util.ArrayList; |
|
import java.util.EnumSet; |
|
import java.util.HashMap; |
|
|
|
public class Power { |
|
public String power_id; |
|
public String power; |
|
public ArrayList<PowerEntry> powers = new ArrayList<>(); |
|
public mbEnums.PowerTargetType target_type; |
|
public int range; |
|
public mbEnums.AreaType areaType; |
|
public int areaRange; |
|
public mbEnums.ExcludeType excludeType; |
|
public mbEnums.CostType costType; |
|
public float cost; |
|
public float difficulty; |
|
public float precision; |
|
public float init_time; |
|
public float release_time; |
|
public float recycle_time; |
|
public int hitRollYN; |
|
public mbEnums.CastingModeType castingMode; |
|
public int initAmin; |
|
public int releaseAnim; |
|
public mbEnums.TargetSelectType targetSelect; |
|
|
|
// Additional key/value type power entries |
|
|
|
public ArrayList<ActionEntry> actionEntries = new ArrayList<>(); |
|
public int maxLevel; |
|
public int hateValue; |
|
public mbEnums.CompoundCurveType hateCurve = mbEnums.CompoundCurveType.DefaultFlat; |
|
public int loopAnimID; |
|
public String grantOverrideVar; |
|
public ArrayList<String> description = new ArrayList<>(); |
|
public HashMap<String, mbEnums.CompoundCurveType> curves = new HashMap<>(); |
|
public String category; |
|
public boolean canCastWhileMoving = false; |
|
public boolean bladeTrails = false; |
|
public ArrayList<Effect> effectPreReqs = new ArrayList<>(); |
|
public ArrayList<EquipmentPreReq> equipmentPreReq = new ArrayList<>(); |
|
public EnumSet<mbEnums.MonsterType> monsterRestricts = EnumSet.noneOf(mbEnums.MonsterType.class); |
|
public EnumSet<mbEnums.MonsterType> monsterPrereqs = EnumSet.noneOf(mbEnums.MonsterType.class); |
|
public boolean shouldCheckPath = false; |
|
public boolean sticky = false; |
|
public int pulseCycle; |
|
public int pulseDuration; |
|
public int maxMobTargets; |
|
public int maxPlayerTargets; |
|
public boolean isAdminPower = false; |
|
public int casterPulseParticle; |
|
public ArrayList<Effect> targetEffectPrereqs = new ArrayList<>(); |
|
public boolean canCastWhileFlying = false; |
|
public boolean isProjectile = false; |
|
public HashMap<String, Float> conditions = new HashMap<>(); |
|
|
|
public int getRecycleTime(int trains) { // returns cast time in ms |
|
if (this.curves.get("RECYCLETIME") != null) |
|
return (int) (((this.recycle_time + (this.curves.get("RECYCLETIME").getValue() * trains)) * 1000) + getCastTime(trains)); |
|
else |
|
return (int) (((this.recycle_time * (1 + (this.curves.get("RECYCLETIME").getValue() * trains))) * 1000) + getCastTime(trains)); |
|
} |
|
public int getCastTime(int trains) { // returns cast time in ms |
|
if (this.curves.get("INITTIME") != null) |
|
return (int) ((this.init_time + (this.curves.get("INITTIME").getValue() * trains)) * 1000); |
|
else |
|
return (int) ((this.init_time * (1 + (this.curves.get("INITTIME").getValue() * trains))) * 1000); |
|
} |
|
|
|
public boolean allowedInCombat() { |
|
switch(castingMode.name()){ |
|
case "NONE": |
|
case "BOTH": |
|
case "COMBAT": |
|
return true; |
|
} |
|
return false; |
|
} |
|
|
|
public boolean allowedOutOfCombat() { |
|
switch(castingMode.name()){ |
|
case "NONE": |
|
case "BOTH": |
|
case "NONCOMBAT": |
|
return true; |
|
} |
|
return false; |
|
} |
|
|
|
public float getCost(int trains) { |
|
if (this.curves.get("COSTAMT") != null) |
|
return this.cost + (float)(this.curves.get("COSTAMT").getValue() * trains); |
|
else |
|
return this.cost * (1 + (float)(this.curves.get("COSTAMT").getValue() * trains)); |
|
|
|
} |
|
|
|
public boolean isSpell(){ |
|
return true; |
|
} |
|
public boolean isSkill(){ |
|
return true; |
|
} |
|
|
|
public boolean isChant(){ |
|
return true; |
|
} |
|
}
|
|
|