grf { grfid : "ZUU0"; name : string(STR_GRF_NAME); desc : string(STR_GRF_DESCRIPTION); version: 1; min_compatible_version: 1; } /* Behaviour: * Industry is constructed with 'storage 0' set to 512, which means 100%. * GS sets 'storage 0' via command. * Actual production modifier is: (1 + storage0/256) / 3 * storage0 = 0 -> 33% * storage0 = 256 -> 66% * storage0 = 512 -> 100% * storage0 = 1024 -> 166% * Special value: * Adding 0x10000 to storage0 announces closure and closes the industry next month. */ produce (primary_produce, 0, 0, 0, production_rate_1 * (LOAD_PERM(0) & 0xFFFF) / 256, production_rate_2 * (LOAD_PERM(0) & 0xFFFF) / 256, ); switch (FEAT_INDUSTRIES, SELF, monthly_check), [ LOAD_PERM(0) >> 16 ]) { 1: return CB_RESULT_IND_PROD_CLOSE; 0: return CB_RESULT_IND_PROD_NO_CHANGE; } switch (FEAT_INDUSTRIES, SELF, switch_prod_change, [ STORE_PERM(extra_callback_info1, 0), extra_callback_info1 ]) { return CB_RESULT_IND_PROD_CLOSE; } switch (FEAT_INDUSTRIES, SELF, init_industry, [ STORE_PERM(512, 0), extra_callback_info1 ]) { return 16; } item (FEAT_INDUSTRIES, item_industry_coal_mine) { property { substitute: 00; // coal mine override: 00; prod_multiplier: [5, 0] } graphics { build_prod_change: init_industry; random_prod_change: switch_prod_change; monthly_prod_change: monthly_check; produce_256_ticks: primary_produce; } }