Browse Source

Contextual variable name updates

combat-2
MagicBot 9 months ago
parent
commit
f076b38044
  1. 12
      src/engine/gameManager/ForgeManager.java
  2. 8
      src/engine/loot/WorkOrder.java
  3. 4
      src/engine/net/client/handlers/ItemProductionMsgHandler.java

12
src/engine/gameManager/ForgeManager.java

@ -47,7 +47,7 @@ public enum ForgeManager implements Runnable {
// Create negative ID items to add to collections // Create negative ID items to add to collections
for (int i = 0; i < workOrder.slotCount; ++i) { for (int i = 0; i < workOrder.slots_used; ++i) {
// Create workOrder items; one for each slot // Create workOrder items; one for each slot
// assigned to this workOrder. // assigned to this workOrder.
@ -100,7 +100,7 @@ public enum ForgeManager implements Runnable {
workOrder.workOrderID = wordOrderCounter.incrementAndGet(); workOrder.workOrderID = wordOrderCounter.incrementAndGet();
workOrder.rollingDuration = ForgeManager.calcRollingDuration(workOrder); workOrder.rollingDuration = ForgeManager.calcRollingDuration(workOrder);
workOrder.completionTime = System.currentTimeMillis() + workOrder.rollingDuration; workOrder.completionTime = System.currentTimeMillis() + workOrder.rollingDuration;
workOrder.slotCount = calcAvailableSlots(workOrder); workOrder.slots_used = calcAvailableSlots(workOrder);
// Cost to execute this workOrder // Cost to execute this workOrder
@ -113,12 +113,12 @@ public enum ForgeManager implements Runnable {
// Single item rolls are total_to_produce of 0; // Single item rolls are total_to_produce of 0;
if (workOrder.slotCount > 0 && workOrder.total_to_produce == 0) if (workOrder.slots_used > 0 && workOrder.total_to_produce == 0)
workOrder.slotCount = 1; workOrder.slots_used = 1;
// Create negative ID items to add to collections // Create negative ID items to add to collections
for (int i = 0; i < workOrder.slotCount; ++i) { for (int i = 0; i < workOrder.slots_used; ++i) {
// Create workOrder items; one for each slot // Create workOrder items; one for each slot
// assigned to this workOrder. // assigned to this workOrder.
@ -194,7 +194,7 @@ public enum ForgeManager implements Runnable {
// Slots currently used up by the npc workOrders // Slots currently used up by the npc workOrders
for (WorkOrder npcWorkOrder : workOrder.vendor.workOrders) for (WorkOrder npcWorkOrder : workOrder.vendor.workOrders)
availableSlots = availableSlots - npcWorkOrder.slotCount; availableSlots = availableSlots - npcWorkOrder.slots_used;
// Slot count override for single item production // Slot count override for single item production

8
src/engine/loot/WorkOrder.java

@ -25,13 +25,13 @@ public class WorkOrder implements Delayed {
public int workOrderID; public int workOrderID;
public NPC vendor; public NPC vendor;
public int slotCount; public int slots_used;
public int total_to_produce; public int total_to_produce;
public int total_produced; public int total_produced;
public HashMap<mbEnums.ResourceType, Integer> production_cost = new HashMap<>(); public HashMap<mbEnums.ResourceType, Integer> production_cost = new HashMap<>();
public HashMap<mbEnums.ResourceType, Integer> production_cost_total = new HashMap<>(); public HashMap<mbEnums.ResourceType, Integer> production_cost_total = new HashMap<>();
public int templateID; public int templateID;
public String itemName; public String item_name_override;
public int prefixToken; public int prefixToken;
public int suffixToken; public int suffixToken;
public long rollingDuration; public long rollingDuration;
@ -66,11 +66,11 @@ public class WorkOrder implements Delayed {
String outSTring = "\r\nwordOrderID: " + this.workOrderID + "\r\n" + String outSTring = "\r\nwordOrderID: " + this.workOrderID + "\r\n" +
"vendor: " + this.vendor.getObjectUUID() + "\r\n" + "vendor: " + this.vendor.getObjectUUID() + "\r\n" +
"slotCount: " + this.slotCount + "\r\n" + "slots_used: " + this.slots_used + "\r\n" +
"total_to_produce: " + this.total_to_produce + "\r\n" + "total_to_produce: " + this.total_to_produce + "\r\n" +
"total_produced: " + this.total_produced + "\r\n" + "total_produced: " + this.total_produced + "\r\n" +
"templateID: " + this.templateID + "\r\n" + "templateID: " + this.templateID + "\r\n" +
"itemName: " + this.itemName + "\r\n" + "item_name_override: " + this.item_name_override + "\r\n" +
"prefixToken: " + this.prefixToken + "\r\n" + "prefixToken: " + this.prefixToken + "\r\n" +
"suffixToken: " + this.suffixToken + "\r\n" + "suffixToken: " + this.suffixToken + "\r\n" +
"rollingDuration: " + duration + "\r\n" + "rollingDuration: " + duration + "\r\n" +

4
src/engine/net/client/handlers/ItemProductionMsgHandler.java

@ -85,8 +85,8 @@ public class ItemProductionMsgHandler extends AbstractClientMsgHandler {
workOrder.templateID = msg.templateID; workOrder.templateID = msg.templateID;
workOrder.prefixToken = msg.pToken; workOrder.prefixToken = msg.pToken;
workOrder.suffixToken = msg.sToken; workOrder.suffixToken = msg.sToken;
workOrder.itemName = msg.name; workOrder.item_name_override = msg.name;
workOrder.slotCount = 0; workOrder.slots_used = 0;
// Validate vendor can roll this item // Validate vendor can roll this item

Loading…
Cancel
Save