Browse Source

altered mine production values

lakebane-new
FatBoy-DOTC 5 months ago
parent
commit
f7ab10ff07
  1. 59
      src/engine/objects/Mine.java

59
src/engine/objects/Mine.java

@ -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)
//calculate base values. return 0;
int baseProduction = this.production.baseProduction; int value = resourceBase.getBaseValue();
float baseModValue = this.production.baseProduction * .1f;
float rankModValue = this.production.baseProduction * .0143f; int amount = 0;
float totalModded = 0; switch(this.capSize){
case 3:
//get Mine Building. amount = 1800000;
Building mineBuilding = BuildingManager.getBuilding(this.buildingID); break;
if (mineBuilding == null) case 5:
return this.production.baseProduction; amount = 3000000;
for (AbstractCharacter harvester : mineBuilding.getHirelings().keySet()) { break;
totalModded += baseModValue; case 10:
totalModded += rankModValue * harvester.getRank(); amount = 6000000;
break;
case 20:
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()) amount = amount / value;
return (int) totalModded;
return amount;
if (this.owningGuild.isEmptyGuild() == false) {
if (this.owningGuild.getOwnedCity() != null) {
float distanceSquared = this.owningGuild.getOwnedCity().getLoc().distanceSquared2D(mineBuilding.getLoc());
if (distanceSquared > sqr(10000 * 3))
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() {

Loading…
Cancel
Save