Loading

Revision differences

Old revision #pwjxexar9New revision #pemwqxdcm
6 min_compatible_version: 1;  6 min_compatible_version: 1;  
7}  7}  
8  8  
  9/* Behaviour:  
  10 *   Industry is constructed with 'storage 0' set to 512, which means 100%.  
  11 *   GS sets 'storage 0' via command.  
  12 *   Actual production modifier is: (1 + storage0/256) / 3  
  13 *     storage0 = 0   ->  33%  
  14 *     storage0 = 256 ->  66%  
  15 *     storage0 = 512 -> 100%  
  16 *     storage0 = 1024 -> 166%  
  17 *   Special value:  
  18 *     Adding 0x10000 to storage0 announces closure and closes the industry next month.  
  19 */  
  20  
  21produce (primary_produce,  
  22  0, 0, 0,  
  23  production_rate_1 * (LOAD_PERM(0) & 0xFFFF) / 256,  
  24  production_rate_2 * (LOAD_PERM(0) & 0xFFFF) / 256,  
  25);  
  26  
  27switch (FEAT_INDUSTRIES, SELF, monthly_check), [  
  28  LOAD_PERM(0) >> 16  
  29]) {  
  30  1: return CB_RESULT_IND_PROD_CLOSE;  
  31  0: return CB_RESULT_IND_PROD_NO_CHANGE;  
  32}  
  33  
9switch (FEAT_INDUSTRIES, SELF, switch_prod_change, [  34switch (FEAT_INDUSTRIES, SELF, switch_prod_change, [  
10  STORE_PERM(extra_callback_info1, 0),  35  STORE_PERM(extra_callback_info1, 0),  
11  extra_callback_info1  36  extra_callback_info1  
12] {  37]) {
13  return 0;  38  return CB_RESULT_IND_PROD_CLOSE;
   39}
   40
   41switch (FEAT_INDUSTRIES, SELF, init_industry, [
   42  STORE_PERM(512, 0),
   43  extra_callback_info1
   44]) {
   45  return 16;
14}  46}  
15  47  
16item (FEAT_INDUSTRIES, item_industry_coal_mine) {  48item (FEAT_INDUSTRIES, item_industry_coal_mine) {  
17 property {  49 property {  
18  substitute: 00; // coal mine  50  substitute: 00; // coal mine  
19  override: 00;  51  override: 00;  
  52  prod_multiplier: [5, 0]  
20 }  53 }  
21 graphics {  54 graphics {  
  55  build_prod_change: init_industry;  
22  random_prod_change: switch_prod_change;  56  random_prod_change: switch_prod_change;  
  57  monthly_prod_change: monthly_check;  
  58  produce_256_ticks: primary_produce;  
23 }  59 }  
24} 60}