|  |  | @ -377,24 +377,33 @@ public class WpakPowerManager { | 
			
		
	
		
		
			
				
					
					|  |  |  |     } |  |  |  |     } | 
			
		
	
		
		
			
				
					
					|  |  |  | 
 |  |  |  | 
 | 
			
		
	
		
		
			
				
					
					|  |  |  |     public static int getRecycleTime(Power power, int trains) { // returns cast time in ms
 |  |  |  |     public static int getRecycleTime(Power power, int trains) { // returns cast time in ms
 | 
			
		
	
		
		
			
				
					
					|  |  |  |         if (power.curves.get("RECYCLETIME") != null) |  |  |  |         if (power.curves.get("RECYCLETIME") != null) { | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  |             return (int) (((power.recycle_time + (power.curves.get("RECYCLETIME").getValue() * trains)) * 1000) + getCastTime(power, trains)); |  |  |  |             mbEnums.CompoundCurveType compoundCurveType = power.curves.get("RECYCLETIME"); | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  |         else |  |  |  |             return (int) (((power.recycle_time + (compoundCurveType.value * trains)) * 1000) + getCastTime(power, trains)); | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  |             return (int) (((power.recycle_time * (1 + (power.curves.get("RECYCLETIME").getValue() * trains))) * 1000) + getCastTime(power, trains)); |  |  |  |         } else { | 
			
				
				
			
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |             mbEnums.CompoundCurveType compoundCurveType = power.curves.get("RECYCLETIME"); | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |             return (int) (((power.recycle_time * (1 + (compoundCurveType.value * trains))) * 1000) + getCastTime(power, trains)); | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |         } | 
			
		
	
		
		
			
				
					
					|  |  |  |     } |  |  |  |     } | 
			
		
	
		
		
			
				
					
					|  |  |  | 
 |  |  |  | 
 | 
			
		
	
		
		
			
				
					
					|  |  |  |     public static int getCastTime(Power power, int trains) { // returns cast time in ms
 |  |  |  |     public static int getCastTime(Power power, int trains) { // returns cast time in ms
 | 
			
		
	
		
		
			
				
					
					|  |  |  |         if (power.curves.get("INITTIME") != null) |  |  |  |         if (power.curves.get("INITTIME") != null) { | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  |             return (int) ((power.init_time + (power.curves.get("INITTIME").getValue() * trains)) * 1000); |  |  |  |             mbEnums.CompoundCurveType compoundCurveType = power.curves.get("INITTIME"); | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  |         else |  |  |  |             return (int) ((power.init_time + (compoundCurveType.value * trains)) * 1000); | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  |             return (int) ((power.init_time * (1 + (power.curves.get("INITTIME").getValue() * trains))) * 1000); |  |  |  |         } else { | 
			
				
				
			
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |             mbEnums.CompoundCurveType compoundCurveType = power.curves.get("INITTIME"); | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |             return (int) ((power.init_time * (1 + (compoundCurveType.value * trains))) * 1000); | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |         } | 
			
		
	
		
		
			
				
					
					|  |  |  |     } |  |  |  |     } | 
			
		
	
		
		
			
				
					
					|  |  |  | 
 |  |  |  | 
 | 
			
		
	
		
		
			
				
					
					|  |  |  |     public static float getCost(Power power, int trains) { |  |  |  |     public static float getCost(Power power, int trains) { | 
			
		
	
		
		
			
				
					
					|  |  |  |         if (power.curves.get("COSTAMT") != null) |  |  |  |         if (power.curves.get("COSTAMT") != null) { | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  |             return power.cost + (power.curves.get("COSTAMT").getValue() * trains); |  |  |  |             mbEnums.CompoundCurveType compoundCurveType = power.curves.get("COSTAMT"); | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  |         else |  |  |  |             return power.cost + (compoundCurveType.value * trains); | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  |             return power.cost * (1 + (power.curves.get("COSTAMT").getValue() * trains)); |  |  |  |         } else { | 
			
				
				
			
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |             mbEnums.CompoundCurveType compoundCurveType = power.curves.get("COSTAMT"); | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |             return power.cost * (1 + (compoundCurveType.value * trains)); | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |         } | 
			
		
	
		
		
			
				
					
					|  |  |  | 
 |  |  |  | 
 | 
			
		
	
		
		
			
				
					
					|  |  |  |     } |  |  |  |     } | 
			
		
	
		
		
			
				
					
					|  |  |  | 
 |  |  |  | 
 | 
			
		
	
	
		
		
			
				
					|  |  | @ -413,7 +422,7 @@ public class WpakPowerManager { | 
			
		
	
		
		
			
				
					
					|  |  |  |         Pair<Float, Float> outData = new Pair<>(0f, 0f); |  |  |  |         Pair<Float, Float> outData = new Pair<>(0f, 0f); | 
			
		
	
		
		
			
				
					
					|  |  |  | 
 |  |  |  | 
 | 
			
		
	
		
		
			
				
					
					|  |  |  |         if (modifierEntry.percentage != 0f) { |  |  |  |         if (modifierEntry.percentage != 0f) { | 
			
		
	
		
		
			
				
					
					|  |  |  |             outData.first = modifierEntry.percentage + (modifierEntry.compoundCurveType.getValue() * rank); |  |  |  |             outData.first = modifierEntry.percentage + (modifierEntry.compoundCurveType.value * rank); | 
			
				
				
			
		
	
		
		
	
		
		
			
				
					
					|  |  |  |             outData.first = outData.first * 0.01f; |  |  |  |             outData.first = outData.first * 0.01f; | 
			
		
	
		
		
			
				
					
					|  |  |  |             return outData; |  |  |  |             return outData; | 
			
		
	
		
		
			
				
					
					|  |  |  |         } |  |  |  |         } | 
			
		
	
	
		
		
			
				
					|  |  | @ -426,14 +435,19 @@ public class WpakPowerManager { | 
			
		
	
		
		
			
				
					
					|  |  |  |         // These all have "SIVL" in the curve name suggesting
 |  |  |  |         // These all have "SIVL" in the curve name suggesting
 | 
			
		
	
		
		
			
				
					
					|  |  |  |         // interpolation between min max.  Not something currently done.
 |  |  |  |         // interpolation between min max.  Not something currently done.
 | 
			
		
	
		
		
			
				
					
					|  |  |  | 
 |  |  |  | 
 | 
			
		
	
		
		
			
				
					
					|  |  |  |         outData.first = modifierEntry.compoundCurveType.type.equals(mbEnums.ModificationType.MULTIPLY) ? |  |  |  |         if (modifierEntry.compoundCurveType.type.equals(mbEnums.ModificationType.MULTIPLY)) { | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  |                 modifierEntry.min * (1 + (modifierEntry.compoundCurveType.getValue() * rank)) : |  |  |  |             outData.first = modifierEntry.min * (1 + (modifierEntry.compoundCurveType.value * rank)); | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  |                 modifierEntry.min + (modifierEntry.compoundCurveType.getValue() * rank); |  |  |  |         } else { | 
			
				
				
			
		
	
		
		
	
		
		
	
		
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |             outData.first = modifierEntry.min + (modifierEntry.compoundCurveType.value * rank); | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |         } | 
			
		
	
		
		
			
				
					
					|  |  |  | 
 |  |  |  | 
 | 
			
		
	
		
		
			
				
					
					|  |  |  |         if (modifierEntry.max != 0) |  |  |  |         if (modifierEntry.max != 0) { | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  |             outData.second = modifierEntry.compoundCurveType.type.equals(mbEnums.ModificationType.MULTIPLY) ? |  |  |  |             if (modifierEntry.compoundCurveType.type.equals(mbEnums.ModificationType.MULTIPLY)) { | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  |                     modifierEntry.max * (1 + (modifierEntry.compoundCurveType.getValue() * rank)) : |  |  |  |                 outData.second = modifierEntry.max * (1 + (modifierEntry.compoundCurveType.value * rank)); | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  |                     modifierEntry.max + (modifierEntry.compoundCurveType.getValue() * rank); |  |  |  |             } else { | 
			
				
				
			
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |                 outData.second = modifierEntry.max + (modifierEntry.compoundCurveType.value * rank); | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |             } | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |         } | 
			
		
	
		
		
			
				
					
					|  |  |  |         return outData; |  |  |  |         return outData; | 
			
		
	
		
		
			
				
					
					|  |  |  |     } |  |  |  |     } | 
			
		
	
		
		
			
				
					
					|  |  |  | 
 |  |  |  | 
 | 
			
		
	
	
		
		
			
				
					|  |  | 
 |