Loading

Paste #p9jlxwpw1

  1. #define BASE_WORKER_PROD_RATE 15
  2. #define CARGO1_CALCULATION min (waiting_cargo_1/16, LOAD_TEMP(0x01)/16)
  3. #define CARGO2_CALCULATION min (waiting_cargo_2/16, LOAD_TEMP(0x01)/16)
  4.  
  5. produce(produce_worker_yard2,
  6.     (waiting_cargo_2 == 0) ? 0 : CARGO1_CALCULATION,    // input cargo 1, building materials
  7.     CARGO2_CALCULATION, // input cargo 2, food
  8.     0,  // input cargo 3 - not available for worker yard
  9.     // the real logic follows
  10.     (LOAD_TEMP(0x01) < BASE_WORKER_PROD_RATE * 8) ?
  11.         BASE_WORKER_PROD_RATE :
  12.         max (
  13.             CARGO1_CALCULATION +
  14.             CARGO2_CALCULATION, BASE_WORKER_PROD_RATE),
  15.     0  // do not repeat this process until next 256 ticks
  16. );
  17.  
  18. switch(FEAT_INDUSTRIES, PARENT, produce_worker_yard, STORE_TEMP(population,0x01)) {
  19.     produce_worker_yard2;
  20. }

Comments