Browse Source

display correct maintenance costs

lakebane-new
FatBoy-DOTC 5 months ago
parent
commit
b1de3755fd
  1. 4
      src/engine/net/client/msg/ManageCityAssetsMsg.java
  2. 22
      src/engine/objects/Blueprint.java

4
src/engine/net/client/msg/ManageCityAssetsMsg.java

@ -275,7 +275,7 @@ public class ManageCityAssetsMsg extends ClientNetMsg { @@ -275,7 +275,7 @@ public class ManageCityAssetsMsg extends ClientNetMsg {
writer.putString(npcHire.getName());
writer.putInt(1);
writer.putInt(Blueprint.getNpcMaintCost(npcHire.getRank()));
writer.putInt(0);
if (npcHire.getObjectType() == GameObjectType.NPC)
writer.putInt(((NPC) npcHire).getContract().getIconID()); // Was 60
else if (npcHire.getObjectType() == GameObjectType.Mob) {
@ -497,7 +497,7 @@ public class ManageCityAssetsMsg extends ClientNetMsg { @@ -497,7 +497,7 @@ public class ManageCityAssetsMsg extends ClientNetMsg {
if (building.getBlueprint() == null)
writer.putInt(0);
else
writer.putInt(building.getBlueprint().getMaintCost(building.getRank())); // maint cost
writer.putInt(building.getBlueprint().getMaintCost()); // maint cost
if (building.getRank() == 8) {
writer.putInt(74856115); // Stone

22
src/engine/objects/Blueprint.java

@ -605,26 +605,14 @@ public class Blueprint { @@ -605,26 +605,14 @@ public class Blueprint {
return this.blueprintUUID;
}
public int getMaintCost(int rank) {
public int getMaintCost() {
int maintCost = Integer.MAX_VALUE;
switch (this.buildingGroup) {
case TOL:
case BARRACK:
maintCost = (61500 * rank) + 19500;
break;
case SPIRE:
maintCost = (4800 * rank) + 1200;
break;
default:
if (maxRank == 1)
maintCost = 22500;
else
maintCost = (15900 * rank) + 3300;
break;
if(this.buildingGroup.equals(BuildingGroup.TOL)){
return 3000000;
}else{
return 0;
}
return maintCost;
}
}

Loading…
Cancel
Save