grf { grfid : "IFFS"; name : string(STR_GRF_NAME); desc : string(STR_GRF_DESCRIPTION); url : string(STR_GRF_WEBSITE); version: 1; min_compatible_version: 1; param { param_capacities { name: string(STR_CAPACITY_PARAM_NAME); desc: string(STR_CAPACITY_PARAM_DESC); min_value: 0; max_value: 1; def_value: 1; names: { 0: string(STR_CAPACITY_PARAM_SEATED); 1: string(STR_CAPACITY_PARAM_STANDING); }; } } } template template_tram_28(x, y) { //[left_x, upper_y, width, height, offset_x, offset_y] [x, y, 10, 28, -4, -11+2] [x+ 20, y, 26, 28, -17, -14+2] [x+ 50, y, 36, 28, -20, -20+2] [x+ 90, y, 26, 28, -9, -15+2] [x+120, y, 10, 28, -4, -13+2] [x+140, y, 26, 28, -16, -16+2] [x+170, y, 36, 28, -16, -20+2] [x+210, y, 26, 28, -12, -16+2] } basecost { PR_RUNNING_ROADVEH : 2; PR_BUILD_VEHICLE_ROAD : 2; } // --- Sprite sets // Underground sprites spriteset(underground_vehicle, "Shadows.png") { template_tram_28(0, 60) } alternative_sprites (underground_vehicle, ZOOM_LEVEL_NORMAL, BIT_DEPTH_32BPP, "Shadows32.png") { template_tram_28(0, 60) } spriteset(invisible, "empty.png") { [0, 0] } // --- BEGIN VEHICLE-AGNOSTIC SWITCHES --- // Switch to disable sound effects switch (FEAT_ROADVEHS, SELF, SFX_switch, extra_callback_info1) { SOUND_EVENT_START: return sound("none.wav"); return sound("none.wav"); } switch(FEAT_ROADVEHS, SELF, tube_cargo_subtype_text, cargo_subtype) { 0: return string(STR_SUBTYPE_LENGTH_2); 1: return string(STR_SUBTYPE_LENGTH_3); 2: return string(STR_SUBTYPE_LENGTH_4); 3: return string(STR_SUBTYPE_LENGTH_5); 4: return string(STR_SUBTYPE_LENGTH_6); 5: return string(STR_SUBTYPE_LENGTH_7); 6: return string(STR_SUBTYPE_LENGTH_8); return CB_RESULT_NO_TEXT; } // Length switches switch(FEAT_ROADVEHS, SELF, shorten_2_carriage_vehicle, position_in_consist) { /* Make carriages 3-8 invisible, extend carriage 2 */ 0: return 7; 1: return 8; 2..7: return 1; return CB_FAILED; } switch(FEAT_ROADVEHS, SELF, shorten_3_carriage_vehicle, position_in_consist) { /* Make carriages 4-8 invisible, extend carriage 3 */ 0..1: return 7; 2: return 8; 3..7: return 1; return CB_FAILED; } switch(FEAT_ROADVEHS, SELF, shorten_4_carriage_vehicle, position_in_consist) { /* Make carriages 5-8 invisible, extend carriage 4 */ 0..2: return 7; 3: return 8; 4..7: return 1; return CB_FAILED; } switch(FEAT_ROADVEHS, SELF, shorten_5_carriage_vehicle, position_in_consist) { /* Make carriages 6-8 invisible, extend carriage 5 */ 0..3: return 7; 4: return 8; 5..7: return 1; return CB_FAILED; } switch(FEAT_ROADVEHS, SELF, shorten_6_carriage_vehicle, position_in_consist) { /* Make carriages 7-8 invisible, extend carriage 6 */ 0..4: return 7; 5: return 8; 6..7: return 1; return CB_FAILED; } switch(FEAT_ROADVEHS, SELF, shorten_7_carriage_vehicle, position_in_consist) { /* Make carriage 8 invisible, extend carriage 7 */ 0..5: return 7; 6: return 8; 7: return 1; return CB_FAILED; } switch(FEAT_ROADVEHS, SELF, tube_shorten_vehicles, cargo_subtype) { 0: shorten_2_carriage_vehicle; 1: shorten_3_carriage_vehicle; 2: shorten_4_carriage_vehicle; 3: shorten_5_carriage_vehicle; 4: shorten_6_carriage_vehicle; 5: shorten_7_carriage_vehicle; // 8-carriage vehicle needs no shortening return 7; } // Capacity switches switch(FEAT_ROADVEHS, SELF, tube_2_carriage_capacity_switch, position_in_consist) { 0..1: return 40+(param_capacities*60); 2..7: return 0; return CB_FAILED; } switch(FEAT_ROADVEHS, SELF, tube_3_carriage_capacity_switch, position_in_consist) { 0..2: return 40+(param_capacities*60); 3..7: return 0; return CB_FAILED; } switch(FEAT_ROADVEHS, SELF, tube_4_carriage_capacity_switch, position_in_consist) { 0..3: return 40+(param_capacities*60); 4..7: return 0; return CB_FAILED; } switch(FEAT_ROADVEHS, SELF, tube_5_carriage_capacity_switch, position_in_consist) { 0..4: return 40+(param_capacities*60); 5..7: return 0; return CB_FAILED; } switch(FEAT_ROADVEHS, SELF, tube_6_carriage_capacity_switch, position_in_consist) { 0..5: return 40+(param_capacities*60); 6..7: return 0; return CB_FAILED; } switch(FEAT_ROADVEHS, SELF, tube_7_carriage_capacity_switch, position_in_consist) { 0..6: return 40+(param_capacities*60); 7: return 0; return CB_FAILED; } switch(FEAT_ROADVEHS, SELF, tube_cargo_capacities_switch, cargo_subtype) { /* Pass cargo subtype to next switch */ 0: tube_2_carriage_capacity_switch; 1: tube_3_carriage_capacity_switch; 2: tube_4_carriage_capacity_switch; 3: tube_5_carriage_capacity_switch; 4: tube_6_carriage_capacity_switch; 5: tube_7_carriage_capacity_switch; // 8-carriage vehicles need no reduction in capacity return 40+(param_capacities*60); } // Underground Invisibility switches switch(FEAT_ROADVEHS, SELF, tube_2_carriage_graphics_switch, position_in_consist) { 0..1: underground_vehicle; 2..7: invisible; return CB_FAILED; } switch(FEAT_ROADVEHS, SELF, tube_3_carriage_graphics_switch, position_in_consist) { 0..2: underground_vehicle; 3..7: invisible; return CB_FAILED; } switch(FEAT_ROADVEHS, SELF, tube_4_carriage_graphics_switch, position_in_consist) { 0..3: underground_vehicle; 4..7: invisible; return CB_FAILED; } switch(FEAT_ROADVEHS, SELF, tube_5_carriage_graphics_switch, position_in_consist) { 0..4: underground_vehicle; 5..7: invisible; return CB_FAILED; } switch(FEAT_ROADVEHS, SELF, tube_6_carriage_graphics_switch, position_in_consist) { 0..5: underground_vehicle; 6..7: invisible; return CB_FAILED; } switch(FEAT_ROADVEHS, SELF, tube_7_carriage_graphics_switch, position_in_consist) { 0..6: underground_vehicle; 7: invisible; return CB_FAILED; } switch(FEAT_ROADVEHS, SELF, tube_8_carriage_graphics_switch, position_in_consist) { 0..7: underground_vehicle; return CB_FAILED; } switch(FEAT_ROADVEHS, SELF, underground_tube_GFX_switch, cargo_subtype) { /* Pass cargo subtype to next switch */ 0: tube_2_carriage_graphics_switch; 1: tube_3_carriage_graphics_switch; 2: tube_4_carriage_graphics_switch; 3: tube_5_carriage_graphics_switch; 4: tube_6_carriage_graphics_switch; 5: tube_7_carriage_graphics_switch; 6: tube_8_carriage_graphics_switch; return CB_FAILED; } // --- END VEHICLE AGNOSTIC SWITCHES --- // Individual vehicle #includes, entails spritesets, vehicle-specific switches, and their item blocks. // ======= BEGIN GATE TUBE ======= // Gate Tube Sprites spriteset(gate_purchase_set, "Gate\GTubePurchase.png") { [-18, -5] } spriteset(gate_head_visible_set, "Gate\GTubeHead.png") { [-18, -5] } spriteset(gate_middle_visible_set, "Gate\GTubeMiddle.png") { [-18, -5] } spriteset(gate_tail_visible_set, "Gate\GTubeTail.png") { [-18, -5] } // Switches // Articulated consist generation switch (FEAT_ROADVEHS, SELF, gate_switch_articulated, extra_callback_info1) { 1..7: return gate_tube; return CB_RESULT_NO_MORE_ARTICULATED_PARTS; } // Gate tube visible, positional graphics switches switch(FEAT_ROADVEHS, SELF, gate_tube_2_carriage_graphics_switch, position_in_consist) { 0: gate_head_visible_set; 1: gate_tail_visible_set; 2..7: invisible; return CB_FAILED; } switch(FEAT_ROADVEHS, SELF, gate_tube_3_carriage_graphics_switch, position_in_consist) { 0: gate_head_visible_set; 1: gate_middle_visible_set; 2: gate_tail_visible_set; 3..7: invisible; return CB_FAILED; } switch(FEAT_ROADVEHS, SELF, gate_tube_4_carriage_graphics_switch, position_in_consist) { 0: gate_head_visible_set; 1..2: gate_middle_visible_set; 3: gate_tail_visible_set; 4..7: invisible; return CB_FAILED; } switch(FEAT_ROADVEHS, SELF, gate_tube_5_carriage_graphics_switch, position_in_consist) { 0: gate_head_visible_set; 1..3: gate_middle_visible_set; 4: gate_tail_visible_set; 5..7: invisible; return CB_FAILED; } switch(FEAT_ROADVEHS, SELF, gate_tube_6_carriage_graphics_switch, position_in_consist) { 0: gate_head_visible_set; 1..4: gate_middle_visible_set; 5: gate_tail_visible_set; 6..7: invisible; return CB_FAILED; } switch(FEAT_ROADVEHS, SELF, gate_tube_7_carriage_graphics_switch, position_in_consist) { 0: gate_head_visible_set; 1..5: gate_middle_visible_set; 6: gate_tail_visible_set; 7: invisible; return CB_FAILED; } switch(FEAT_ROADVEHS, SELF, gate_tube_8_carriage_graphics_switch, position_in_consist) { 0: gate_head_visible_set; 1..6: gate_middle_visible_set; 7: gate_tail_visible_set; return CB_FAILED; } switch(FEAT_ROADVEHS, SELF, gate_tube_consist_GFX_switch, cargo_subtype) { /* Pass cargo subtype to next switch */ 0: gate_tube_2_carriage_graphics_switch; 1: gate_tube_3_carriage_graphics_switch; 2: gate_tube_4_carriage_graphics_switch; 3: gate_tube_5_carriage_graphics_switch; 4: gate_tube_6_carriage_graphics_switch; 5: gate_tube_7_carriage_graphics_switch; 6: gate_tube_8_carriage_graphics_switch; return CB_FAILED; } // Underground vs. window switch switch(FEAT_ROADVEHS, SELF, gate_tube_GFX_switch, extra_callback_info1) { /* Decide whether vehicle is drawn on map or in a special window */ 0x00: underground_tube_GFX_switch; 0x10..0x12: gate_tube_consist_GFX_switch; return gate_purchase_set; } // Refit cost switch switch(FEAT_ROADVEHS, SELF, gate_refit_cost_switch, var[0x10,8,0xFF] - cargo_subtype) { /* Refit cost based on difference between target cargo sybtype and current cargo subtype. Refitting to fewer carriages refunds money, while adding carriages costs money. */ -6: (-6*10)/2; -5: (-5*10)/2; -4: (-4*10)/2; -3: (-3*10)/2; -2: (-2*10)/2; -1: (-1*10)/2; 0: 0; 1: (1*10)/2; 2: (2*10)/2; 3: (3*10)/2; 4: (4*10)/2; 5: (5*10)/2; 6: (6*10)/2; return CB_FAILED; } // Running cost switch switch(FEAT_ROADVEHS, SELF, gate_running_cost_switch, current_speed) { /* Running cost reduced to 1/4 if vehicle is not moving. */ 0: ((cargo_subtype+2)*33)/4; return (cargo_subtype+2)*33; } // Vehicle definition item (FEAT_ROADVEHS, gate_tube) { property { name: string(STR_NAME_GATE_TUBE); climates_available: ALL_CLIMATES; introduction_date: date(1903,1,1); model_life: 52; // misc_flags: bitmask(ROADVEH_FLAG_AUTOREFIT); retire_early: 10; vehicle_life: 30; sprite_id: SPRITE_ID_NEW_ROADVEH; speed: 40 mph; power: 300 hp; tractive_effort_coefficient: 0.123; weight: 46 ton; cargo_capacity: 40; loading_speed: 100; refittable_cargo_classes: bitmask(CC_PASSENGERS); refit_cost: 0; cost_factor: 65; running_cost_base: RUNNING_COST_ROADVEH; running_cost_factor: 132; length: 7; cargo_age_period: 90; } graphics { articulated_part: gate_switch_articulated; default: gate_tube_GFX_switch; purchase: gate_purchase_set; cargo_capacity: tube_cargo_capacities_switch; running_cost_factor: gate_running_cost_switch; purchase_running_cost_factor: return (cargo_subtype+2)*33; power: return (cargo_subtype+2)*15; weight: return (cargo_subtype+2)*93; length: tube_shorten_vehicles; sound_effect: SFX_switch; cargo_subtype_text: tube_cargo_subtype_text; additional_text: return string(STR_TUBE_PURCHASE_TEXT); refit_cost: gate_refit_cost_switch; } } // ======= END GATE TUBE ======= // ======= BEGIN NEW WORKS TUBE ======= // New Works Tube Sprites spriteset(new_works_purchase_set, "New Works\NWTubePurchase.png") { [-18, -5] } spriteset(new_works_head_visible_set, "New Works\NWTubeHead.png") { [-18, -5] } spriteset(new_works_middle_visible_set, "New Works\NWTubeMiddle.png") { [-18, -5] } spriteset(new_works_tail_visible_set, "New Works\NWTubeTail.png") { [-18, -5] } // Switches // Articulated consist generation switch (FEAT_ROADVEHS, SELF, new_works_switch_articulated, extra_callback_info1) { 1..7: return new_works_tube; return CB_RESULT_NO_MORE_ARTICULATED_PARTS; } // New works tube visible, positional graphics switches switch(FEAT_ROADVEHS, SELF, new_works_tube_2_carriage_graphics_switch, position_in_consist) { 0: new_works_head_visible_set; 1: new_works_tail_visible_set; 2..7: invisible; return CB_FAILED; } switch(FEAT_ROADVEHS, SELF, new_works_tube_3_carriage_graphics_switch, position_in_consist) { 0: new_works_head_visible_set; 1: new_works_middle_visible_set; 2: new_works_tail_visible_set; 3..7: invisible; return CB_FAILED; } switch(FEAT_ROADVEHS, SELF, new_works_tube_4_carriage_graphics_switch, position_in_consist) { 0: new_works_head_visible_set; 1..2: new_works_middle_visible_set; 3: new_works_tail_visible_set; 4..7: invisible; return CB_FAILED; } switch(FEAT_ROADVEHS, SELF, new_works_tube_5_carriage_graphics_switch, position_in_consist) { 0: new_works_head_visible_set; 1..3: new_works_middle_visible_set; 4: new_works_tail_visible_set; 5..7: invisible; return CB_FAILED; } switch(FEAT_ROADVEHS, SELF, new_works_tube_6_carriage_graphics_switch, position_in_consist) { 0: new_works_head_visible_set; 1..4: new_works_middle_visible_set; 5: new_works_tail_visible_set; 6..7: invisible; return CB_FAILED; } switch(FEAT_ROADVEHS, SELF, new_works_tube_7_carriage_graphics_switch, position_in_consist) { 0: new_works_head_visible_set; 1..5: new_works_middle_visible_set; 6: new_works_tail_visible_set; 7: invisible; return CB_FAILED; } switch(FEAT_ROADVEHS, SELF, new_works_tube_8_carriage_graphics_switch, position_in_consist) { 0: new_works_head_visible_set; 1..6: new_works_middle_visible_set; 7: new_works_tail_visible_set; return CB_FAILED; } switch(FEAT_ROADVEHS, SELF, new_works_tube_consist_GFX_switch, cargo_subtype) { /* Pass cargo subtype to next switch */ 0: new_works_tube_2_carriage_graphics_switch; 1: new_works_tube_3_carriage_graphics_switch; 2: new_works_tube_4_carriage_graphics_switch; 3: new_works_tube_5_carriage_graphics_switch; 4: new_works_tube_6_carriage_graphics_switch; 5: new_works_tube_7_carriage_graphics_switch; 6: new_works_tube_8_carriage_graphics_switch; return CB_FAILED; } // Underground vs. window switch switch(FEAT_ROADVEHS, SELF, new_works_tube_GFX_switch, extra_callback_info1) { /* Decide whether vehicle is drawn on map or in a special window */ 0x00: underground_tube_GFX_switch; 0x10..0x12: new_works_tube_consist_GFX_switch; return new_works_purchase_set; } // Refit cost switch switch(FEAT_ROADVEHS, SELF, new_works_refit_cost_switch, var[0x10,8,0xFF] - cargo_subtype) { /* Refit cost based on difference between target cargo sybtype and current cargo subtype. Refitting to fewer carriages refunds money, while adding carriages costs money. */ -6: (-6*14)/2; -5: (-5*14)/2; -4: (-4*14)/2; -3: (-3*14)/2; -2: (-2*14)/2; -1: (-1*14)/2; 0: 0; 1: (1*14)/2; 2: (2*14)/2; 3: (3*14)/2; 4: (4*14)/2; 5: (5*14)/2; 6: (6*14)/2; return CB_FAILED; } // Running cost switch switch(FEAT_ROADVEHS, SELF, new_works_running_cost_switch, current_speed) { /* Running cost reduced to 1/4 if vehicle is not moving. */ 0: ((cargo_subtype+2)*40)/4; return (cargo_subtype+2)*40; } // Vehicle definition item (FEAT_ROADVEHS, new_works_tube) { property { name: string(STR_NAME_NEW_WORKS_TUBE); climates_available: ALL_CLIMATES; introduction_date: date(1938,1,1); model_life: 57; // misc_flags: bitmask(ROADVEH_FLAG_AUTOREFIT); retire_early: 10; vehicle_life: 30; sprite_id: SPRITE_ID_NEW_ROADVEH; speed: 45 mph; power: 400 hp; tractive_effort_coefficient: 0.138; weight: 48 ton; cargo_capacity: 40; loading_speed: 100; refittable_cargo_classes: bitmask(CC_PASSENGERS); refit_cost: 0; cost_factor: 86; running_cost_base: RUNNING_COST_ROADVEH; running_cost_factor: 158; length: 7; cargo_age_period: 92; } graphics { articulated_part: new_works_switch_articulated; default: new_works_tube_GFX_switch; purchase: new_works_purchase_set; cargo_capacity: tube_cargo_capacities_switch; running_cost_factor: new_works_running_cost_switch; purchase_running_cost_factor: return (cargo_subtype+2)*40; power: return (cargo_subtype+2)*20; weight: return (cargo_subtype+2)*96; length: tube_shorten_vehicles; sound_effect: SFX_switch; cargo_subtype_text: tube_cargo_subtype_text; additional_text: return string(STR_TUBE_PURCHASE_TEXT); refit_cost: new_works_refit_cost_switch; } } // ======= END NEW WORKS TUBE ======= // ======= BEGIN VICTORIA TUBE ======= //Victoria Tube Sprites spriteset(victoria_purchase_set, "Victoria\VTubePurchase.png") { [-18, -5] } spriteset(victoria_head_visible_set, "Victoria\VTubeHead.png") { [-18, -5] } spriteset(victoria_middle_visible_set, "Victoria\VTubeMiddle.png") { [-18, -5] } spriteset(victoria_tail_visible_set, "Victoria\VTubeTail.png") { [-18, -5] } // Switches // Articulated consist generation switch (FEAT_ROADVEHS, SELF, victoria_switch_articulated, extra_callback_info1) { 1..7: return victoria_tube; return CB_RESULT_NO_MORE_ARTICULATED_PARTS; } // Victoria tube visible, positional graphics switches switch(FEAT_ROADVEHS, SELF, victoria_tube_2_carriage_graphics_switch, position_in_consist) { 0: victoria_head_visible_set; 1: victoria_tail_visible_set; 2..7: invisible; return CB_FAILED; } switch(FEAT_ROADVEHS, SELF, victoria_tube_3_carriage_graphics_switch, position_in_consist) { 0: victoria_head_visible_set; 1: victoria_middle_visible_set; 2: victoria_tail_visible_set; 3..7: invisible; return CB_FAILED; } switch(FEAT_ROADVEHS, SELF, victoria_tube_4_carriage_graphics_switch, position_in_consist) { 0: victoria_head_visible_set; 1..2: victoria_middle_visible_set; 3: victoria_tail_visible_set; 4..7: invisible; return CB_FAILED; } switch(FEAT_ROADVEHS, SELF, victoria_tube_5_carriage_graphics_switch, position_in_consist) { 0: victoria_head_visible_set; 1..3: victoria_middle_visible_set; 4: victoria_tail_visible_set; 5..7: invisible; return CB_FAILED; } switch(FEAT_ROADVEHS, SELF, victoria_tube_6_carriage_graphics_switch, position_in_consist) { 0: victoria_head_visible_set; 1..4: victoria_middle_visible_set; 5: victoria_tail_visible_set; 6..7: invisible; return CB_FAILED; } switch(FEAT_ROADVEHS, SELF, victoria_tube_7_carriage_graphics_switch, position_in_consist) { 0: victoria_head_visible_set; 1..5: victoria_middle_visible_set; 6: victoria_tail_visible_set; 7: invisible; return CB_FAILED; } switch(FEAT_ROADVEHS, SELF, victoria_tube_8_carriage_graphics_switch, position_in_consist) { 0: victoria_head_visible_set; 1..6: victoria_middle_visible_set; 7: victoria_tail_visible_set; return CB_FAILED; } switch(FEAT_ROADVEHS, SELF, victoria_tube_consist_GFX_switch, cargo_subtype) { /* Pass cargo subtype to next switch */ 0: victoria_tube_2_carriage_graphics_switch; 1: victoria_tube_3_carriage_graphics_switch; 2: victoria_tube_4_carriage_graphics_switch; 3: victoria_tube_5_carriage_graphics_switch; 4: victoria_tube_6_carriage_graphics_switch; 5: victoria_tube_7_carriage_graphics_switch; 6: victoria_tube_8_carriage_graphics_switch; return CB_FAILED; } // Underground vs. window switch switch(FEAT_ROADVEHS, SELF, victoria_tube_GFX_switch, extra_callback_info1) { /* Decide whether vehicle is drawn on map or in a special window */ 0x00: underground_tube_GFX_switch; 0x10..0x12: victoria_tube_consist_GFX_switch; return victoria_purchase_set; } // Refit cost switch switch(FEAT_ROADVEHS, SELF, victoria_refit_cost_switch, var[0x10,8,0xFF] - cargo_subtype) { /* Refit cost based on difference between target cargo sybtype and current cargo subtype. Refitting to fewer carriages refunds money, while adding carriages costs money. */ -6: (-6*15)/2; -5: (-5*15)/2; -4: (-4*15)/2; -3: (-3*15)/2; -2: (-2*15)/2; -1: (-1*15)/2; 0: 0; 1: (1*15)/2; 2: (2*15)/2; 3: (3*15)/2; 4: (4*15)/2; 5: (5*15)/2; 6: (6*15)/2; return CB_FAILED; } // Running cost switch switch(FEAT_ROADVEHS, SELF, victoria_running_cost_switch, current_speed) { /* Running cost reduced to 1/4 if vehicle is not moving. */ 0: ((cargo_subtype+2)*46)/4; return (cargo_subtype+2)*46; } // Vehicle definition item (FEAT_ROADVEHS, victoria_tube) { property { name: string(STR_NAME_VICTORIA_TUBE); climates_available: ALL_CLIMATES; introduction_date: date(1967,1,1); model_life: 53; misc_flags: bitmask(ROADVEH_FLAG_2CC); retire_early: 10; vehicle_life: 30; sprite_id: SPRITE_ID_NEW_ROADVEH; speed: 50 mph; power: 500 hp; tractive_effort_coefficient: 0.186; weight: 44 ton; cargo_capacity: 40; loading_speed: 100; refittable_cargo_classes: bitmask(CC_PASSENGERS); refit_cost: 0; cost_factor: 95; running_cost_base: RUNNING_COST_ROADVEH; running_cost_factor: 184; length: 7; cargo_age_period: 108; } graphics { articulated_part: victoria_switch_articulated; default: victoria_tube_GFX_switch; purchase: victoria_purchase_set; cargo_capacity: tube_cargo_capacities_switch; running_cost_factor: victoria_running_cost_switch; purchase_running_cost_factor: return (cargo_subtype+2)*46; power: return (cargo_subtype+2)*25; weight: return (cargo_subtype+2)*88; length: tube_shorten_vehicles; sound_effect: SFX_switch; cargo_subtype_text: tube_cargo_subtype_text; additional_text: return string(STR_TUBE_PURCHASE_TEXT); refit_cost: victoria_refit_cost_switch; } } // ======= END VICTORIA TUBE ======= // ======= BEGIN ADTRANZ TUBE ======= //Adtranz Tube Sprites spriteset(adtranz_purchase_set, "Adtranz\ATubePurchase.png") { [-18, -5] } spriteset(adtranz_head_visible_set, "Adtranz\ATubeHead.png") { [-18, -5] } spriteset(adtranz_middle_visible_set, "Adtranz\ATubeMiddle.png") { [-18, -5] } spriteset(adtranz_tail_visible_set, "Adtranz\ATubeTail.png") { [-18, -5] } // Switches // Articulated consist generation switch (FEAT_ROADVEHS, SELF, adtranz_switch_articulated, extra_callback_info1) { 1..7: return adtranz_tube; return CB_RESULT_NO_MORE_ARTICULATED_PARTS; } // Adtranz tube visible, positional graphics switches switch(FEAT_ROADVEHS, SELF, adtranz_tube_2_carriage_graphics_switch, position_in_consist) { 0: adtranz_head_visible_set; 1: adtranz_tail_visible_set; 2..7: invisible; return CB_FAILED; } switch(FEAT_ROADVEHS, SELF, adtranz_tube_3_carriage_graphics_switch, position_in_consist) { 0: adtranz_head_visible_set; 1: adtranz_middle_visible_set; 2: adtranz_tail_visible_set; 3..7: invisible; return CB_FAILED; } switch(FEAT_ROADVEHS, SELF, adtranz_tube_4_carriage_graphics_switch, position_in_consist) { 0: adtranz_head_visible_set; 1..2: adtranz_middle_visible_set; 3: adtranz_tail_visible_set; 4..7: invisible; return CB_FAILED; } switch(FEAT_ROADVEHS, SELF, adtranz_tube_5_carriage_graphics_switch, position_in_consist) { 0: adtranz_head_visible_set; 1..3: adtranz_middle_visible_set; 4: adtranz_tail_visible_set; 5..7: invisible; return CB_FAILED; } switch(FEAT_ROADVEHS, SELF, adtranz_tube_6_carriage_graphics_switch, position_in_consist) { 0: adtranz_head_visible_set; 1..4: adtranz_middle_visible_set; 5: adtranz_tail_visible_set; 6..7: invisible; return CB_FAILED; } switch(FEAT_ROADVEHS, SELF, adtranz_tube_7_carriage_graphics_switch, position_in_consist) { 0: adtranz_head_visible_set; 1..5: adtranz_middle_visible_set; 6: adtranz_tail_visible_set; 7: invisible; return CB_FAILED; } switch(FEAT_ROADVEHS, SELF, adtranz_tube_8_carriage_graphics_switch, position_in_consist) { 0: adtranz_head_visible_set; 1..6: adtranz_middle_visible_set; 7: adtranz_tail_visible_set; return CB_FAILED; } switch(FEAT_ROADVEHS, SELF, adtranz_tube_consist_GFX_switch, cargo_subtype) { /* Pass cargo subtype to next switch */ 0: adtranz_tube_2_carriage_graphics_switch; 1: adtranz_tube_3_carriage_graphics_switch; 2: adtranz_tube_4_carriage_graphics_switch; 3: adtranz_tube_5_carriage_graphics_switch; 4: adtranz_tube_6_carriage_graphics_switch; 5: adtranz_tube_7_carriage_graphics_switch; 6: adtranz_tube_8_carriage_graphics_switch; return CB_FAILED; } // Underground vs. window switch switch(FEAT_ROADVEHS, SELF, adtranz_tube_GFX_switch, extra_callback_info1) { /* Decide whether vehicle is drawn on map or in a special window */ 0x00: underground_tube_GFX_switch; 0x10..0x12: adtranz_tube_consist_GFX_switch; return adtranz_purchase_set; } // Refit cost switch switch(FEAT_ROADVEHS, SELF, adtranz_refit_cost_switch, var[0x10,8,0xFF] - cargo_subtype) { /* Refit cost based on difference between target cargo sybtype and current cargo subtype. Refitting to fewer carriages refunds money, while adding carriages costs money. */ -6: (-6*19)/2; -5: (-5*19)/2; -4: (-4*19)/2; -3: (-3*19)/2; -2: (-2*19)/2; -1: (-1*19)/2; 0: 0; 1: (1*19)/2; 2: (2*19)/2; 3: (3*19)/2; 4: (4*19)/2; 5: (5*19)/2; 6: (6*19)/2; return CB_FAILED; } // Running cost switch switch(FEAT_ROADVEHS, SELF, adtranz_running_cost_switch, current_speed) { /* Running cost reduced to 1/4 if vehicle is not moving. */ 0: ((cargo_subtype+2)*53)/4; return (cargo_subtype+2)*53; } // Vehicle definition item (FEAT_ROADVEHS, adtranz_tube) { property { name: string(STR_NAME_ADTRANZ_TUBE); climates_available: ALL_CLIMATES; introduction_date: date(1992,1,1); model_life: VEHICLE_NEVER_EXPIRES; misc_flags: bitmask(ROADVEH_FLAG_2CC); vehicle_life: 30; sprite_id: SPRITE_ID_NEW_ROADVEH; speed: 60 mph; power: 600 hp; tractive_effort_coefficient: 0.178; weight: 46 ton; cargo_capacity: 40; loading_speed: 100; refittable_cargo_classes: bitmask(CC_PASSENGERS); refit_cost: 0; cost_factor: 119; running_cost_base: RUNNING_COST_ROADVEH; running_cost_factor: 212; length: 7; cargo_age_period: 120; } graphics { articulated_part: adtranz_switch_articulated; default: adtranz_tube_GFX_switch; purchase: adtranz_purchase_set; cargo_capacity: tube_cargo_capacities_switch; running_cost_factor: adtranz_running_cost_switch; purchase_running_cost_factor: return (cargo_subtype+2)*53; power: return (cargo_subtype+2)*30; weight: return (cargo_subtype+2)*93; length: tube_shorten_vehicles; sound_effect: SFX_switch; cargo_subtype_text: tube_cargo_subtype_text; additional_text: return string(STR_TUBE_PURCHASE_TEXT); refit_cost: adtranz_refit_cost_switch; } } // ======= END ADTRANZ TUBE =======