altered mine production values

This commit is contained in:
2024-06-13 18:44:35 -05:00
parent 9671cbdc1a
commit f7ab10ff07
+22 -31
View File
@@ -519,41 +519,32 @@ public class Mine extends AbstractGameObject {
} }
public int getModifiedProductionAmount() { public int getModifiedProductionAmount() {
//TODO Calculate Distance modifications. ItemBase resourceBase = ItemBase.getItemBase(this.production.UUID);
if(resourceBase == null)
return 0;
int value = resourceBase.getBaseValue();
//calculate base values. int amount = 0;
int baseProduction = this.production.baseProduction; switch(this.capSize){
float baseModValue = this.production.baseProduction * .1f; case 3:
float rankModValue = this.production.baseProduction * .0143f; amount = 1800000;
float totalModded = 0; break;
case 5:
//get Mine Building. amount = 3000000;
Building mineBuilding = BuildingManager.getBuilding(this.buildingID); break;
if (mineBuilding == null) case 10:
return this.production.baseProduction; amount = 6000000;
for (AbstractCharacter harvester : mineBuilding.getHirelings().keySet()) { break;
totalModded += baseModValue; case 20:
totalModded += rankModValue * harvester.getRank(); amount = 12000000;
break;
} }
//add base production on top; if(this.production.UUID == 7)
totalModded += baseProduction; value = 1;
//skip distance check for expansion.
if (this.isExpansion())
return (int) totalModded;
if (this.owningGuild.isEmptyGuild() == false) { amount = amount / value;
if (this.owningGuild.getOwnedCity() != null) {
float distanceSquared = this.owningGuild.getOwnedCity().getLoc().distanceSquared2D(mineBuilding.getLoc());
if (distanceSquared > sqr(10000 * 3)) return amount;
totalModded *= .25f;
else if (distanceSquared > sqr(10000 * 2))
totalModded *= .50f;
else if (distanceSquared > sqr(10000))
totalModded *= .75f;
}
}
return (int) totalModded;
} }
public void onEnter() { public void onEnter() {