From e5a32c83c556611365add362f2306f579f2d3875 Mon Sep 17 00:00:00 2001 From: FatBoy-DOTC Date: Sat, 7 Sep 2024 17:45:32 -0500 Subject: [PATCH] Revert "mine production values adjusted" This reverts commit 177f9a1ff634b5b462aea2da6e547870fa77b802. --- src/engine/net/client/ClientMessagePump.java | 2 +- src/engine/objects/Mine.java | 5 +- src/engine/objects/Warehouse.java | 79 ++++++++++++++++++-- 3 files changed, 76 insertions(+), 10 deletions(-) diff --git a/src/engine/net/client/ClientMessagePump.java b/src/engine/net/client/ClientMessagePump.java index 3b07a126..4a0b96a4 100644 --- a/src/engine/net/client/ClientMessagePump.java +++ b/src/engine/net/client/ClientMessagePump.java @@ -1428,7 +1428,7 @@ public class ClientMessagePump implements NetMsgHandler { bargain = 0; break; case 900: - cost = ib.getBaseValue() * Warehouse.getSellStackSize(ib.getUUID()); + cost = Warehouse.getCostForResource(ib.getUUID()) * Warehouse.getSellStackSize(ib.getUUID()); bargain = 0; break; } diff --git a/src/engine/objects/Mine.java b/src/engine/objects/Mine.java index 34f6a81c..b6f9bca5 100644 --- a/src/engine/objects/Mine.java +++ b/src/engine/objects/Mine.java @@ -562,7 +562,6 @@ public class Mine extends AbstractGameObject { ItemBase resourceBase = ItemBase.getItemBase(this.production.UUID); if(resourceBase == null) return 0; - int value = resourceBase.getBaseValue(); int amount = 0; @@ -583,9 +582,9 @@ public class Mine extends AbstractGameObject { if(this.production.UUID == 7) value = 1; - int productionAmount = amount / value; + amount = amount / value; - return productionAmount; + return amount; } public void onEnter() { diff --git a/src/engine/objects/Warehouse.java b/src/engine/objects/Warehouse.java index 0b127a3a..b42ff1e4 100644 --- a/src/engine/objects/Warehouse.java +++ b/src/engine/objects/Warehouse.java @@ -281,15 +281,82 @@ public class Warehouse extends AbstractWorldObject { } + public static int getCostForResource(int id){ + int newCost = 1; + switch(id){ + case 1580000://stone + newCost = 3000; + break; + case 1580001://truesteel + newCost = 50000; + break; + case 1580002://iron + newCost = 50000; + break; + case 1580003://adamant + newCost = 100000; + break; + case 1580004://lumber + newCost = 3000; + break; + case 1580005://oak + newCost = 30000; + break; + case 1580006://bronzewood + newCost = 30000; + break; + case 1580007://mandrake + newCost = 100000; + break; + case 1580008://coal + newCost = 30000; + break; + case 1580009://agate + newCost = 50000; + break; + case 1580010://diamond + newCost = 50000; + break; + case 1580011://onyx + newCost = 100000; + break; + case 1580012://azoth + newCost = 50000; + break; + case 1580013://orichalk + newCost = 30000; + break; + case 1580014://antimony + newCost = 100000; + break; + case 1580015://sulfur + newCost = 100000; + break; + case 1580016://quicksilver + newCost = 100000; + break; + case 1580017://galvor + newCost = 300000; + break; + case 1580018://wormwood + newCost = 300000; + break; + case 1580019://obsidian + newCost = 200000; + break; + case 1580020://bloodstone + newCost = 200000; + break; + case 1705032: + newCost = 100000; + break; + } + return newCost; + } public static int getSellStackSize(int id){ if(id == 1705032) return 10; - else{ - ItemBase ib = ItemBase.getItemBase(id); - if(ib != null) - return 3000000 / ib.getBaseValue(); - } - return 0; // something went wrong + return 3000000 / getCostForResource(id); } public ConcurrentHashMap getResources() {