Old revision #psons6rk3 | New 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 | |||
9 | produce (primary_produce, | 21 | produce (primary_produce, |
10 | 0, 0, 0, | 22 | 0, 0, 0, |
11 | production_rate_1 * ( | 11 | production_rate_1 * (LOAD_PERM(0) & 0xFFFF) / 256, |
12 | production_rate_2 * ( | 12 | production_rate_2 * (LOAD_PERM(0) & 0xFFFF) / 256, |
13 | ); | 25 | ); |
26 | |||
27 | switch (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 | } | ||
14 | 33 | ||
15 | switch (FEAT_INDUSTRIES, SELF, switch_prod_change, [ | 34 | switch (FEAT_INDUSTRIES, SELF, switch_prod_change, [ |
16 | STORE_PERM(extra_callback_info1, 0), | 35 | STORE_PERM(extra_callback_info1, 0), |
17 | extra_callback_info1 | 36 | extra_callback_info1 |
18 | ]) { | 37 | ]) { |
19 | return 0; | 38 | return CB_RESULT_IND_PROD_CLOSE; |
39 | } | ||
40 | |||
41 | switch (FEAT_INDUSTRIES, SELF, init_industry, [ | ||
42 | STORE_PERM(512, 0), | ||
43 | extra_callback_info1 | ||
44 | ]) { | ||
45 | return 16; | ||
20 | } | 46 | } |
21 | 47 | ||
22 | item (FEAT_INDUSTRIES, item_industry_coal_mine) { | 48 | item (FEAT_INDUSTRIES, item_industry_coal_mine) { |
23 | property { | 49 | property { |
24 | substitute: 00; // coal mine | 50 | substitute: 00; // coal mine |
25 | override: 00; | 51 | override: 00; |
52 | prod_multiplier: [5, 0] | ||
26 | } | 53 | } |
27 | graphics { | 54 | graphics { |
55 | build_prod_change: init_industry; | ||
28 | random_prod_change: switch_prod_change; | 56 | random_prod_change: switch_prod_change; |
57 | monthly_prod_change: monthly_check; | ||
29 | produce_256_ticks: primary_produce; | 58 | produce_256_ticks: primary_produce; |
30 | } | 59 | } |
31 | } | 60 | } |