Browse Source

More workorder work.

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

8
src/engine/gameManager/ForgeManager.java

@ -42,11 +42,11 @@ public enum ForgeManager implements Runnable {
// if Prefix and suffix are null random roll item // if Prefix and suffix are null random roll item
// otherwise roll what was asked for // otherwise roll what was asked for
workOrder.itemCount = workOrder.itemCount - 1; workOrder.total_to_produce = workOrder.total_to_produce - 1;
Logger.info("Workorder popped: " + workOrder.workOrderID); Logger.info("Workorder popped: " + workOrder.workOrderID);
} }
if (workOrder.itemCount == 0) { if (workOrder.total_to_produce == 0) {
workOrder.runCompleted = true; workOrder.runCompleted = true;
@ -68,6 +68,10 @@ public enum ForgeManager implements Runnable {
public static void submit(WorkOrder workOrder) { public static void submit(WorkOrder workOrder) {
workOrder.workOrderID = wordOrderCounter.incrementAndGet(); workOrder.workOrderID = wordOrderCounter.incrementAndGet();
workOrder.completionTime = System.currentTimeMillis() + 10000; workOrder.completionTime = System.currentTimeMillis() + 10000;
// 0 signifies single item roll. > 0 signifies multiple item roll.
workOrder.total_to_produce = Math.max(1, workOrder.total_to_produce);
workOrders.add(workOrder); workOrders.add(workOrder);
} }

2
src/engine/loot/WorkOrder.java

@ -21,7 +21,7 @@ public class WorkOrder implements Delayed {
public int workOrderID; public int workOrderID;
public NPC vendor; public NPC vendor;
public int slotCount; public int slotCount;
public int itemCount; public int total_to_produce;
public int templateID; public int templateID;
public String itemName; public String itemName;
public int prefixToken; public int prefixToken;

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

@ -80,7 +80,7 @@ public class ItemProductionMsgHandler extends AbstractClientMsgHandler {
// Create new work order // Create new work order
WorkOrder workOrder = new WorkOrder(); WorkOrder workOrder = new WorkOrder();
workOrder.itemCount = msg.total_to_produce; workOrder.total_to_produce = msg.total_to_produce;
workOrder.vendor = vendorNPC; workOrder.vendor = vendorNPC;
workOrder.templateID = msg.templateID; workOrder.templateID = msg.templateID;
workOrder.prefixToken = msg.pToken; workOrder.prefixToken = msg.pToken;

Loading…
Cancel
Save