|
| 1 | +grf { |
| 2 | + grfid: "NML\13"; |
| 3 | + name: string(STR_REGRESSION_NAME); |
| 4 | + desc: string(STR_REGRESSION_DESC); |
| 5 | + version: 0; |
| 6 | +} |
| 7 | + |
| 8 | +/* |
| 9 | + * ******************************************** |
| 10 | + * Define cargo and railtype translation tables |
| 11 | + * ******************************************** |
| 12 | + */ |
| 13 | + |
| 14 | +cargotable { // cargos needed for special refit orders |
| 15 | + WDPR, SCRP, CMNT, WOOD, // bulk, bulk+piece+flat, tank, piece |
| 16 | + LVST, STEL, VEHI, BRCK, // piece+flat, piece, piece, piece |
| 17 | + WOOL, BUBL, TOYS, FZDR, // flat, flat, flat, tank |
| 18 | + FRUT, FRVG, FOOD, // bulk, bulk, piece |
| 19 | + |
| 20 | + // cargos only referenced |
| 21 | + OIL_, GOOD, WATR, MILK, |
| 22 | + COAL, IORE, AORE, CLAY, |
| 23 | + GRVL, SAND, GRAI, RSGR, |
| 24 | + MAIZ, CORE, FERT, CTCD, |
| 25 | + SULP, WHEA, RFPR, COLA, |
| 26 | + PETR, PAPR, TOFF, SUGR, |
| 27 | + PASS, MAIL, BATT, SWET, |
| 28 | + RUBR, FMSP, ENSP, MNSP, |
| 29 | + FICR, PLAS, PLST |
| 30 | +} |
| 31 | + |
| 32 | +railtypetable { |
| 33 | + RAIL, ELRL, MONO, MGLV, |
| 34 | + TRPD |
| 35 | +} |
| 36 | + |
| 37 | +template tmpl_railwagon(x,y) { |
| 38 | + [ 0+x, y, 8,24, -3,-12] |
| 39 | + [ 16+x, y, 22,17, -14, -9] |
| 40 | + [ 48+x, y, 32,12, -16, -8] |
| 41 | + [ 96+x, y, 22,17, -6, -9] |
| 42 | +} |
| 43 | + |
| 44 | +spriteblock(FEAT_TRAINS) { |
| 45 | + spriteset(bulk_wagon_empty_set, "temperate_railwagons.png") { tmpl_railwagon(0,25) } |
| 46 | + spriteset(bulk_wagon_coal_default_set, "temperate_railwagons.png") { tmpl_railwagon(0,250) } |
| 47 | + spritegroup bulk_wagon_coal_default_group { |
| 48 | + loaded: [bulk_wagon_empty_set, bulk_wagon_coal_default_set]; |
| 49 | + loading: [bulk_wagon_empty_set, bulk_wagon_coal_default_set]; |
| 50 | + } |
| 51 | + spriteset(bulk_wagon_coal_arctic_empty_set, "arctic_railwagons.pcx") { tmpl_railwagon(0,25) } |
| 52 | + spriteset(bulk_wagon_coal_arctic_full_set, "arctic_railwagons.pcx") { tmpl_railwagon(0,250) } |
| 53 | + spritegroup bulk_wagon_coal_arctic_group { |
| 54 | + loaded: [bulk_wagon_coal_arctic_empty_set, bulk_wagon_coal_arctic_full_set]; |
| 55 | + loading: [bulk_wagon_coal_arctic_empty_set, bulk_wagon_coal_arctic_full_set]; |
| 56 | + } |
| 57 | + spriteset(bulk_wagon_coal2_empty_set, "temperate_railwagons.png") { tmpl_railwagon(0,225) } |
| 58 | + spriteset(bulk_wagon_coal2_full_set, "temperate_railwagons.png") { tmpl_railwagon(0,350) } |
| 59 | + spritegroup bulk_wagon_coal2_group { |
| 60 | + loaded: [bulk_wagon_coal2_empty_set, bulk_wagon_coal2_full_set]; |
| 61 | + loading: [bulk_wagon_coal2_empty_set, bulk_wagon_coal2_full_set]; |
| 62 | + } |
| 63 | + |
| 64 | + spriteset(bulk_wagon_empty_grain_set, "temperate_railwagons.png") { tmpl_railwagon(0,150) } |
| 65 | + spriteset(bulk_wagon_grain_set, "temperate_railwagons.png") { tmpl_railwagon(0,275) } |
| 66 | + spritegroup bulk_wagon_grain_group { |
| 67 | + loaded: [bulk_wagon_empty_grain_set, bulk_wagon_grain_set]; |
| 68 | + loading: [bulk_wagon_empty_grain_set, bulk_wagon_grain_set]; |
| 69 | + } |
| 70 | + |
| 71 | +} |
| 72 | + |
| 73 | +random_switch (FEAT_TRAINS, SELF, bulk_wagon_coal_default_switch, TRIGGER_VEHICLE_SERVICE) { |
| 74 | + 2: bulk_wagon_coal_default_group; |
| 75 | + 1: bulk_wagon_coal2_group; |
| 76 | +} |
| 77 | + |
| 78 | +switch (FEAT_TRAINS, SELF, bulk_wagon_coal_climate_switch, climate) { |
| 79 | + CLIMATE_ARCTIC: bulk_wagon_coal_arctic_group; |
| 80 | + bulk_wagon_coal_default_switch; |
| 81 | +} |
| 82 | + |
| 83 | +switch(FEAT_TRAINS, SELF, bulk_wagon_graphics_switch, cargo_type_in_veh) { |
| 84 | + COAL: bulk_wagon_coal_climate_switch; |
| 85 | + bulk_wagon_grain_group; // default to grain |
| 86 | +} |
| 87 | + |
| 88 | +switch (FEAT_TRAINS, SELF, bulk_wagon_cb_capacity_switch, cargo_type_in_veh) { |
| 89 | + FICR: return 25; |
| 90 | + FRUT: return 20; |
| 91 | + FRVG: return 20; |
| 92 | + GRAI: return 25; |
| 93 | + MAIZ: return 25; |
| 94 | + RSGR: return 20; |
| 95 | + WHEA: return 25; |
| 96 | + CB_FAILED; // return capacity set in properties (30) |
| 97 | +} |
| 98 | + |
| 99 | +switch (FEAT_TRAINS, SELF, bulk_wagon_cb_property_weight_switch, cargo_type_in_veh) { |
| 100 | + COAL: return 18; |
| 101 | + FRUT: return 18; |
| 102 | + FRVG: return 18; |
| 103 | + RSGR: return 18; |
| 104 | + CB_FAILED; // return weight set in properties (25t) |
| 105 | +} |
| 106 | + |
| 107 | +switch (FEAT_TRAINS, SELF, bulk_wagon_cb_property_switch, extra_callback_info1) { |
| 108 | + 0x16: bulk_wagon_cb_property_weight_switch; |
| 109 | + CB_FAILED; |
| 110 | +} |
| 111 | + |
| 112 | +switch (FEAT_TRAINS, SELF, bulk_wagon_cb_switch, current_callback) { |
| 113 | + VEH_CB_REFITTED_CAPACITY: bulk_wagon_cb_capacity_switch; |
| 114 | + VEH_CB_VEHICLE_PROPERTIES: bulk_wagon_cb_property_switch; |
| 115 | + bulk_wagon_graphics_switch; |
| 116 | +} |
| 117 | + |
| 118 | + |
| 119 | +item(FEAT_TRAINS, bulk_wagon) { |
| 120 | + property { |
| 121 | + // We try to simulate the stats of the temperate grain wagon |
| 122 | + name: string(STR_NAME_BULK_WAGON); |
| 123 | + climates_available: CLIMATE_ALL; |
| 124 | + refittable_cargo_classes: CC_BULK; |
| 125 | + non_refittable_cargo_classes: CC_PASSENGERS | CC_MAIL | CC_ARMOURED | CC_LIQUID | CC_REFRIGERATED | CC_HAZARDOUS; |
| 126 | + refittable_cargo_types: bitmask(WDPR, SCRP, FRUT, FRVG); |
| 127 | + sprite_id: SPRITE_ID_NEW_TRAIN; |
| 128 | + introduction_date: date(1880,1,1); |
| 129 | + model_life: VEHICLE_NEVER_EXPIRES; |
| 130 | + retire_early: 0; |
| 131 | + vehicle_life: 30; |
| 132 | + reliability_decay: 0; |
| 133 | + loading_speed: 10; |
| 134 | + cost_factor: 182; |
| 135 | + running_cost_factor: 5; |
| 136 | + speed: 0; |
| 137 | + refit_cost: 40; |
| 138 | + callback_flags: VEH_CBF_REFITTED_CAPACITY; |
| 139 | + track_type: RAIL; |
| 140 | + power: 0; |
| 141 | + running_cost_base: RUNNING_COST_STEAM; |
| 142 | + cargo_capacity: 30; |
| 143 | + weight: 25 ton; |
| 144 | + bitmask_vehicle_info: 0; |
| 145 | + } |
| 146 | + graphics { |
| 147 | + bulk_wagon_cb_switch; |
| 148 | + } |
| 149 | +} |
0 commit comments