From 9909216e276ba7829537e87c513ef1cd91101f4a Mon Sep 17 00:00:00 2001 From: FatBoy-DOTC Date: Thu, 22 Feb 2024 20:51:20 -0600 Subject: [PATCH] Mine Changes --- src/engine/objects/Mine.java | 71 +++++++++--------------------------- 1 file changed, 18 insertions(+), 53 deletions(-) diff --git a/src/engine/objects/Mine.java b/src/engine/objects/Mine.java index 0f6e388d..e698a73d 100644 --- a/src/engine/objects/Mine.java +++ b/src/engine/objects/Mine.java @@ -342,26 +342,8 @@ public class Mine extends AbstractGameObject { this.production = resource; this.hasProduced = true; ItemBase resourceIB = ItemBase.getItemBase(this.production.UUID); - int value = Warehouse.getCostForResource(this.production.UUID); - int amount = 0; - switch(this.capSize){ - case 5: - amount = 3000000; - break; - case 10: - amount = 6000000; - break; - case 20: - amount = 9000000; - break; - } - if(this.production.UUID == 7) - amount *= 0.5f; - else - amount = amount / value; - - return this.owningGuild.getOwnedCity().getWarehouse().depositFromMine(this, resourceIB, amount); + return this.owningGuild.getOwnedCity().getWarehouse().depositFromMine(this, resourceIB, this.getModifiedProductionAmount()); } public MineProduction getMineType() { @@ -581,41 +563,24 @@ public class Mine extends AbstractGameObject { } public int getModifiedProductionAmount() { - //TODO Calculate Distance modifications. - - //calculate base values. - int baseProduction = this.production.baseProduction; - float baseModValue = this.production.baseProduction * .1f; - float rankModValue = this.production.baseProduction * .0143f; - float totalModded = 0; - - //get Mine Building. - Building mineBuilding = BuildingManager.getBuilding(this.buildingID); - if (mineBuilding == null) - return this.production.baseProduction; - for (AbstractCharacter harvester : mineBuilding.getHirelings().keySet()) { - totalModded += baseModValue; - totalModded += rankModValue * harvester.getRank(); - } - //add base production on top; - totalModded += baseProduction; - //skip distance check for expansion. - if (this.isExpansion()) - return (int) totalModded; - - 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; - } + int value = Warehouse.getCostForResource(this.production.UUID); + int amount = 0; + switch(this.capSize){ + case 5: + amount = 3000000; + break; + case 10: + amount = 6000000; + break; + case 20: + amount = 9000000; + break; } - return (int) totalModded; + if(this.production.UUID == 7) + amount *= 0.5f; + else + amount = amount / value; + return (int) amount; } public void onEnter() {