Methods made static and moved to manager

This commit is contained in:
2025-02-19 12:43:58 -05:00
parent c0b75564c2
commit 1481cc7ac0
2 changed files with 47 additions and 46 deletions
-41
View File
@@ -67,47 +67,6 @@ public class Power {
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;
}