|
|
@ -124,9 +124,8 @@ public class ItemFactory { |
|
|
|
ConcurrentHashMap<ItemBase, Integer> resources = cityWarehouse.resources; |
|
|
|
ConcurrentHashMap<ItemBase, Integer> resources = cityWarehouse.resources; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
int buildingWithdraw = BuildingManager.GetWithdrawAmountForRolling(forge, ib.getBaseValue()); |
|
|
|
int buildingWithdraw = BuildingManager.GetWithdrawAmountForRolling(forge, template.item_value); |
|
|
|
int overdraft = BuildingManager.GetOverdraft(forge, ib.getBaseValue()); |
|
|
|
int overdraft = BuildingManager.GetOverdraft(forge, template.item_value); |
|
|
|
|
|
|
|
|
|
|
|
if (overdraft > 0 && !useWarehouse) { |
|
|
|
if (overdraft > 0 && !useWarehouse) { |
|
|
|
if (pc != null) |
|
|
|
if (pc != null) |
|
|
|
ErrorPopupMsg.sendErrorMsg(pc, "Not enough gold in building strongbox." + " " + template.item_base_name); |
|
|
|
ErrorPopupMsg.sendErrorMsg(pc, "Not enough gold in building strongbox." + " " + template.item_base_name); |
|
|
@ -308,7 +307,7 @@ public class ItemFactory { |
|
|
|
if (prefixValue == null) |
|
|
|
if (prefixValue == null) |
|
|
|
return null; |
|
|
|
return null; |
|
|
|
|
|
|
|
|
|
|
|
int baseCost = ib.getBaseValue(); |
|
|
|
int baseCost = template.item_value; |
|
|
|
int effectCost = (int) prefixValue.getValue(); |
|
|
|
int effectCost = (int) prefixValue.getValue(); |
|
|
|
int total = baseCost * 10 + effectCost; |
|
|
|
int total = baseCost * 10 + effectCost; |
|
|
|
|
|
|
|
|
|
|
@ -361,7 +360,7 @@ public class ItemFactory { |
|
|
|
if (suffixValue == null) |
|
|
|
if (suffixValue == null) |
|
|
|
return null; |
|
|
|
return null; |
|
|
|
suffixResourceCosts = suffix.getResourcesForEffect(); |
|
|
|
suffixResourceCosts = suffix.getResourcesForEffect(); |
|
|
|
int baseCost = ib.getBaseValue(); |
|
|
|
int baseCost = template.item_value; |
|
|
|
int effectCost = (int) suffixValue.getValue(); |
|
|
|
int effectCost = (int) suffixValue.getValue(); |
|
|
|
suffixCost = effectCost; |
|
|
|
suffixCost = effectCost; |
|
|
|
int total = baseCost * 10 + effectCost; |
|
|
|
int total = baseCost * 10 + effectCost; |
|
|
@ -405,7 +404,7 @@ public class ItemFactory { |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//Check if Total suffix and prefix costs + itemCost can be withdrawn.
|
|
|
|
//Check if Total suffix and prefix costs + itemCost can be withdrawn.
|
|
|
|
int costToCreate = suffixCost + prefixCost + (ib.getBaseValue()); |
|
|
|
int costToCreate = suffixCost + prefixCost + template.item_value; |
|
|
|
int buildingWithdraw = BuildingManager.GetWithdrawAmountForRolling(forge, costToCreate); |
|
|
|
int buildingWithdraw = BuildingManager.GetWithdrawAmountForRolling(forge, costToCreate); |
|
|
|
|
|
|
|
|
|
|
|
int overdraft = BuildingManager.GetOverdraft(forge, costToCreate); |
|
|
|
int overdraft = BuildingManager.GetOverdraft(forge, costToCreate); |
|
|
@ -510,7 +509,7 @@ public class ItemFactory { |
|
|
|
|
|
|
|
|
|
|
|
if (prefix == null && suffix == null) { |
|
|
|
if (prefix == null && suffix == null) { |
|
|
|
|
|
|
|
|
|
|
|
int baseCost = ib.getBaseValue(); |
|
|
|
int baseCost = template.item_value; |
|
|
|
int total = (int) (baseCost + baseCost * (float) .10); |
|
|
|
int total = (int) (baseCost + baseCost * (float) .10); |
|
|
|
|
|
|
|
|
|
|
|
buildingWithdraw = BuildingManager.GetWithdrawAmountForRolling(forge, total); |
|
|
|
buildingWithdraw = BuildingManager.GetWithdrawAmountForRolling(forge, total); |
|
|
@ -889,7 +888,7 @@ public class ItemFactory { |
|
|
|
|
|
|
|
|
|
|
|
ItemBase goldIB = ItemBase.getGoldItemBase(); |
|
|
|
ItemBase goldIB = ItemBase.getGoldItemBase(); |
|
|
|
|
|
|
|
|
|
|
|
int baseCost = ib.getBaseValue(); |
|
|
|
int baseCost = template.item_value; |
|
|
|
int total = (int) (baseCost + baseCost * .10); |
|
|
|
int total = (int) (baseCost + baseCost * .10); |
|
|
|
|
|
|
|
|
|
|
|
EffectsBase suffix = null; |
|
|
|
EffectsBase suffix = null; |
|
|
@ -903,7 +902,7 @@ public class ItemFactory { |
|
|
|
|
|
|
|
|
|
|
|
//calculate gold costs and remove from the warehouse
|
|
|
|
//calculate gold costs and remove from the warehouse
|
|
|
|
if (prefix != null || suffix != null) { |
|
|
|
if (prefix != null || suffix != null) { |
|
|
|
int costToCreate = (int) (ib.getBaseValue() + ib.getBaseValue() * .10f); |
|
|
|
int costToCreate = (int) (template.item_value + template.item_value * .10f); |
|
|
|
int buildingWithdraw = BuildingManager.GetWithdrawAmountForRolling(forge, costToCreate); |
|
|
|
int buildingWithdraw = BuildingManager.GetWithdrawAmountForRolling(forge, costToCreate); |
|
|
|
int overdraft = BuildingManager.GetOverdraft(forge, costToCreate); |
|
|
|
int overdraft = BuildingManager.GetOverdraft(forge, costToCreate); |
|
|
|
|
|
|
|
|
|
|
|