Advertisement
Guest User

Untitled

a guest
Jan 18th, 2023
60
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 16.73 KB | None | 0 0
  1.  
  2. Action1(
  3.     feature=TRAIN,
  4.     set_count=6,
  5.     sprite_count=8,
  6. )
  7.  
  8. g.add(sets.get_sprites('set_343'))
  9. g.add(sets.get_sprites('set_344'))
  10. g.add(sets.get_sprites('set_345'))
  11. g.add(sets.get_sprites('set_346'))
  12. g.add(sets.get_sprites('set_347'))
  13. g.add(sets.get_sprites('set_348'))
  14.  
  15.  
  16. layout_128_4 = GenericSpriteLayout(
  17.     feature=TRAIN,
  18.     ent1=(0,),
  19.     ent2=(0,),
  20. )
  21.  
  22. layout_131_11 = GenericSpriteLayout(
  23.     feature=TRAIN,
  24.     ent1=(1,),
  25.     ent2=(1,),
  26. )
  27.  
  28. switch_127_4 = Switch(  # switch_127_4
  29.     related_scope=True,
  30.     code='build_year',
  31.     ranges={
  32.         (0, 1999): Switch(  # switch_127_3
  33.             related_scope=True,
  34.             code='date_of_last_service',
  35.             ranges={(0, 730484): layout_128_4},
  36.             default=layout_131_11,
  37.         ),
  38.     },
  39.     default=layout_131_11,
  40. )
  41.  
  42. layout_35_17 = GenericSpriteLayout(
  43.     feature=TRAIN,
  44.     ent1=(2,),
  45.     ent2=(2,),
  46. )
  47.  
  48. layout_34_10 = GenericSpriteLayout(
  49.     feature=TRAIN,
  50.     ent1=(3,),
  51.     ent2=(3,),
  52. )
  53.  
  54. switch_129_8 = Switch(  # switch_129_8
  55.     related_scope=True,
  56.     code='var(0x42, shift=24, and=0xff, add=0, div=2) & 1',
  57.     ranges={
  58.         0: Switch(  # switch_129_7
  59.             related_scope=True,
  60.             code='build_year',
  61.             ranges={(0, 1999): layout_35_17},
  62.             default=Switch(  # switch_129_6
  63.                 related_scope=True,
  64.                 code='date_of_last_service',
  65.                 ranges={(0, 730484): layout_35_17},
  66.                 default=RandomSwitch(
  67.                     feature=TRAIN,
  68.                     ref_id=129,
  69.                     scope='self',
  70.                     count=None,
  71.                     triggers=0,
  72.                     cmp_all=False,
  73.                     lowest_bit=0,
  74.                     groups=[layout_35_17, layout_35_17, layout_35_17, layout_34_10],
  75.                 ),
  76.             ),
  77.         ),
  78.     },
  79.     default=switch_127_4,
  80. )
  81.  
  82. layout_35_18 = GenericSpriteLayout(
  83.     feature=TRAIN,
  84.     ent1=(4,),
  85.     ent2=(4,),
  86. )
  87.  
  88. layout_136_16 = GenericSpriteLayout(
  89.     feature=TRAIN,
  90.     ent1=(5,),
  91.     ent2=(5,),
  92. )
  93.  
  94. switch_133_14 = Switch(  # switch_133_14
  95.     related_scope=True,
  96.     code='var(0x42, shift=24, and=0xff, add=0, div=2) & 1',
  97.     ranges={
  98.         0: Switch(  # switch_133_13
  99.             related_scope=True,
  100.             code='build_year',
  101.             ranges={(0, 1999): layout_35_18},
  102.             default=Switch(  # switch_133_12
  103.                 related_scope=True,
  104.                 code='date_of_last_service',
  105.                 ranges={(0, 730484): layout_35_18},
  106.                 default=RandomSwitch(
  107.                     feature=TRAIN,
  108.                     ref_id=133,
  109.                     scope='self',
  110.                     count=None,
  111.                     triggers=0,
  112.                     cmp_all=False,
  113.                     lowest_bit=0,
  114.                     groups=[layout_35_18, layout_35_18, layout_35_18, layout_136_16],
  115.                 ),
  116.             ),
  117.         ),
  118.     },
  119.     default=switch_127_4,
  120. )
  121.  
  122. switch_136_17 = Switch(  # switch_136_17
  123.     related_scope=False,
  124.     code='cargo_subtype',
  125.     ranges={
  126.         0: Switch(  # switch_129_11
  127.             related_scope=False,
  128.             code='var(0x41, shift=16, and=0xff, add=1, div=2)',
  129.             ranges={
  130.                 (0, 6): switch_127_4,
  131.                 (7, 8): Switch(  # switch_133_15
  132.                     related_scope=False,
  133.                     code='var(0x41, shift=0, and=0xff, add=0, div=2)',
  134.                     ranges={3: switch_133_14},
  135.                     default=switch_127_4,
  136.                 ),
  137.                 (9, 10): Switch(  # switch_134_10
  138.                     related_scope=False,
  139.                     code='var(0x41, shift=0, and=0xff, add=0, div=2)',
  140.                     ranges={4: switch_133_14},
  141.                     default=switch_127_4,
  142.                 ),
  143.             },
  144.             default=Switch(  # switch_129_10
  145.                 related_scope=False,
  146.                 code='var(0x41, shift=0, and=0xff, add=0, div=2) % 16',
  147.                 ranges={5: switch_133_14},
  148.                 default=switch_127_4,
  149.             ),
  150.         ),
  151.         1: layout_128_4,
  152.         2: layout_35_18,
  153.         3: layout_131_11,
  154.     },
  155.     default=layout_136_16,
  156. )
  157.  
  158. switch_136_19 = Switch(  # switch_136_19
  159.     related_scope=False,
  160.     code='var(0x41, shift=0, and=0xff, add=0, mod=2)',
  161.     ranges={
  162.         0: Switch(  # switch_136_18
  163.             related_scope=False,
  164.             code='var(0x42, shift=24, and=0x1)',
  165.             ranges={
  166.                 1: Switch(  # switch_34_13
  167.                     related_scope=False,
  168.                     code='var(0x10, shift=0, and=0x11)',
  169.                     ranges={17: switch_136_17},
  170.                     default=Switch(  # switch_34_12
  171.                         related_scope=True,
  172.                         code='vehicle_is_reversed',
  173.                         ranges={
  174.                             1: Switch(  # switch_34_11
  175.                                 related_scope=False,
  176.                                 code='''
  177.  
  178.                                            TEMP[0x80] = position_in_vehid_chain * 2
  179.                                            TEMP[0x10f] = var(0x41, shift=16, and=0xff, add=1, div=1) - TEMP[128] - 2
  180.                                            var(0x61, param=(242), shift=0, and=0xff)''',
  181.                                 ranges={
  182.                                     0: Switch(  # switch_136_15
  183.                                         related_scope=False,
  184.                                         code='var(0x41, shift=16, and=0xff, add=1, div=2)',
  185.                                         ranges={
  186.                                             (0, 6): switch_127_4,
  187.                                             (7, 8): Switch(  # switch_129_9
  188.                                                 related_scope=False,
  189.                                                 code='var(0x41, shift=8, and=0xff, add=0, div=2)',
  190.                                                 ranges={3: switch_129_8},
  191.                                                 default=switch_127_4,
  192.                                             ),
  193.                                             (9, 10): Switch(  # switch_133_10
  194.                                                 related_scope=False,
  195.                                                 code='var(0x41, shift=8, and=0xff, add=0, div=2)',
  196.                                                 ranges={4: switch_129_8},
  197.                                                 default=switch_127_4,
  198.                                             ),
  199.                                         },
  200.                                         default=Switch(  # switch_136_14
  201.                                             related_scope=False,
  202.                                             code='var(0x41, shift=8, and=0xff, add=0, div=2) % 16',
  203.                                             ranges={5: switch_129_8},
  204.                                             default=switch_127_4,
  205.                                         ),
  206.                                     ),
  207.                                     1: layout_128_4,
  208.                                     2: layout_35_17,
  209.                                     3: layout_131_11,
  210.                                 },
  211.                                 default=layout_34_10,
  212.                             ),
  213.                         },
  214.                         default=switch_136_17,
  215.                     ),
  216.                 ),
  217.             },
  218.             default=switch_136_17,
  219.         ),
  220.     },
  221.     default=layout_235_1,
  222. )
  223.  
  224. Action1(
  225.     feature=TRAIN,
  226.     set_count=4,
  227.     sprite_count=1,
  228. )
  229.  
  230. g.add(sets.get_sprites('set_349'))
  231. g.add(sets.get_sprites('set_350'))
  232. g.add(sets.get_sprites('set_351'))
  233. g.add(sets.get_sprites('set_352'))
  234.  
  235.  
  236. layout_34_14 = GenericSpriteLayout(
  237.     feature=TRAIN,
  238.     ent1=(0,),
  239.     ent2=(0,),
  240. )
  241.  
  242. layout_131_12 = GenericSpriteLayout(
  243.     feature=TRAIN,
  244.     ent1=(1,),
  245.     ent2=(1,),
  246. )
  247.  
  248. switch_34_15 = Switch(  # switch_34_15
  249.     related_scope=False,
  250.     code='extra_callback_info1',
  251.     ranges={1: CB(510)},
  252.     default=CB(32767),
  253. )
  254.  
  255. switch_35_22 = Switch(  # switch_35_22
  256.     related_scope=False,
  257.     code='cargo_subtype',
  258.     ranges={
  259.         0: Switch(  # switch_35_21
  260.             related_scope=True,
  261.             code='var(0x42, shift=24, and=0xff, add=0, div=2) & 1',
  262.             ranges={
  263.                 0: Switch(  # switch_35_20
  264.                     related_scope=False,
  265.                     code='var(0x41, shift=16, and=0xff, add=1, div=2)',
  266.                     ranges={
  267.                         (0, 6): switch_30_2,
  268.                         (7, 8): Switch(  # switch_129_12
  269.                             related_scope=False,
  270.                             code='var(0x41, shift=0, and=0xff, add=0, div=2)',
  271.                             ranges={3: CB(10)},
  272.                             default=switch_30_2,
  273.                         ),
  274.                         (9, 10): Switch(  # switch_128_5
  275.                             related_scope=False,
  276.                             code='var(0x41, shift=0, and=0xff, add=0, div=2)',
  277.                             ranges={4: CB(10)},
  278.                             default=switch_30_2,
  279.                         ),
  280.                     },
  281.                     default=Switch(  # switch_35_19
  282.                         related_scope=False,
  283.                         code='var(0x41, shift=0, and=0xff, add=0, div=2) % 16',
  284.                         ranges={5: CB(10)},
  285.                         default=switch_30_2,
  286.                     ),
  287.                 ),
  288.             },
  289.             default=switch_30_2,
  290.         ),
  291.         2: CB(10),
  292.         4: CB(10),
  293.     },
  294.     default=switch_30_2,
  295. )
  296.  
  297. ModifySprites(
  298.     [{'num': 126, 'size': 4, 'offset': 6}]
  299. )
  300.  
  301. switch_129_14 = Switch(  # switch_129_14
  302.     related_scope=False,
  303.     code='var(0x41, shift=0, and=0xff, add=0, mod=2)',
  304.     ranges={1: CB(2)},
  305.     default=CB(8),
  306. )
  307.  
  308. switch_126_5 = Switch(  # switch_126_5
  309.     related_scope=False,
  310.     code='current_callback',
  311.     ranges={
  312.         21: switch_35_22,
  313.         22: switch_34_15,
  314.         25: Switch(  # switch_128_8
  315.             related_scope=False,
  316.             code='0',
  317.             ranges={0: CB(1024)},
  318.             default=Switch(  # switch_128_7
  319.                 related_scope=False,
  320.                 code='current_year',
  321.                 ranges={
  322.                     (0, 1999): Switch(  # switch_129_13
  323.                         related_scope=False,
  324.                         code='cargo_subtype',
  325.                         ranges={
  326.                             0: CB(0),
  327.                             1: CB(9),
  328.                             2: CB(79),
  329.                         },
  330.                         default=CB(1024),
  331.                     ),
  332.                 },
  333.                 default=Switch(  # switch_128_6
  334.                     related_scope=False,
  335.                     code='cargo_subtype',
  336.                     ranges={
  337.                         0: CB(0),
  338.                         1: CB(9),
  339.                         2: CB(79),
  340.                         3: CB(87),
  341.                         4: CB(88),
  342.                     },
  343.                     default=CB(1024),
  344.                 ),
  345.             ),
  346.         ),
  347.         45: switch_244_3,
  348.         54: Switch(  # switch_126_4
  349.             related_scope=False,
  350.             code='extra_callback_info1_byte',
  351.             ranges={
  352.                 7: switch_241_1,
  353.                 13: Switch(  # switch_125_2
  354.                     related_scope=False,
  355.                     code='cargo_subtype',
  356.                     ranges={
  357.                         0: Switch(  # switch_134_13
  358.                             related_scope=True,
  359.                             code='var(0x42, shift=24, and=0xff, add=0, div=2) & 1',
  360.                             ranges={
  361.                                 0: Switch(  # switch_134_12
  362.                                     related_scope=False,
  363.                                     code='var(0x41, shift=16, and=0xff, add=1, div=2)',
  364.                                     ranges={
  365.                                         (0, 6): switch_125_1,
  366.                                         (7, 8): Switch(  # switch_127_5
  367.                                             related_scope=False,
  368.                                             code='var(0x41, shift=0, and=0xff, add=0, div=2)',
  369.                                             ranges={3: switch_126_1},
  370.                                             default=switch_125_1,
  371.                                         ),
  372.                                         (9, 10): Switch(  # switch_133_16
  373.                                             related_scope=False,
  374.                                             code='var(0x41, shift=0, and=0xff, add=0, div=2)',
  375.                                             ranges={4: switch_126_1},
  376.                                             default=switch_125_1,
  377.                                         ),
  378.                                     },
  379.                                     default=Switch(  # switch_134_11
  380.                                         related_scope=False,
  381.                                         code='var(0x41, shift=0, and=0xff, add=0, div=2) % 16',
  382.                                         ranges={5: switch_126_1},
  383.                                         default=switch_125_1,
  384.                                     ),
  385.                                 ),
  386.                             },
  387.                             default=switch_125_1,
  388.                         ),
  389.                         2: switch_126_1,
  390.                         4: switch_126_1,
  391.                     },
  392.                     default=switch_125_1,
  393.                 ),
  394.                 20: switch_35_22,
  395.                 33: Switch(  # switch_0_34
  396.                     related_scope=False,
  397.                     code='call(129)',
  398.                     ranges={65535: switch_30_2},
  399.                     default=Switch(  # switch_134_14
  400.                         related_scope=False,
  401.                         code='8 - last_computed_result',
  402.                         ranges={},
  403.                         default=CB(0),
  404.                     ),
  405.                 ),
  406.                 37: Switch(  # switch_126_3
  407.                     related_scope=False,
  408.                     code='cargo_subtype',
  409.                     ranges={
  410.                         0: Switch(  # switch_126_2
  411.                             related_scope=False,
  412.                             code='var(0x41, shift=16, and=0xff, add=1, div=2)',
  413.                             ranges={(0, 6): CB(0)},
  414.                             default=CB(4),
  415.                         ),
  416.                         2: CB(2),
  417.                         4: CB(2),
  418.                     },
  419.                     default=CB(0),
  420.                 ),
  421.                 43: switch_247_4,
  422.             },
  423.             default=switch_136_19,
  424.         ),
  425.     },
  426.     default=switch_136_19,
  427. )
  428.  
  429. switch_136_20 = Switch(  # switch_136_20
  430.     related_scope=False,
  431.     code='current_callback',
  432.     ranges={
  433.         0: Switch(  # switch_131_13
  434.             related_scope=False,
  435.             code='current_year',
  436.             ranges={(0, 1999): layout_34_14},
  437.             default=layout_131_12,
  438.         ),
  439.         22: switch_34_15,
  440.         35: CB(89),
  441.         45: switch_244_3,
  442.         54: Switch(  # switch_124_2
  443.             related_scope=False,
  444.             code='extra_callback_info1_byte',
  445.             ranges={
  446.                 13: Switch(  # switch_124_1
  447.                     related_scope=False,
  448.                     code='TEMP[0x00] = 219',
  449.                     ranges={(1, 0): CB(0)},
  450.                     default=switch_232_12,
  451.                 ),
  452.                 20: switch_35_22,
  453.             },
  454.             default=switch_136_19,
  455.         ),
  456.     },
  457.     default=switch_136_19,
  458. )
  459.  
  460. # Modern standard passenger coach (EW IV) (#510)
  461. Train(
  462.     id=510,
  463.     name=g.strings['NAME_510'],
  464.     liveries=FIXME,
  465.     length=8,
  466.     track_type=4,
  467.     cost_factor=80,
  468.     running_cost_base=19516,
  469.     introduction_date=datetime.date(1980, 4, 21),
  470.     model_life=255,
  471.     retire_early=1,
  472.     vehicle_life=50,
  473.     reliability_decay=20,
  474.     climates_available=grf.NO_CLIMATE,
  475.     engine_class=0,
  476.     visual_effect_and_powered=197,
  477.     is_dual_headed=0,
  478.     max_speed=200,
  479.     power=0,
  480.     extra_power_per_wagon=0,
  481.     weight=42,
  482.     extra_weight_per_wagon_high=0,
  483.     extra_weight_per_wagon_low=0,
  484.     tractive_effort_coefficient=51,
  485.     air_drag_coefficient=15,
  486.     refittable_cargo_classes=1,
  487.     refittable_cargo_types=0,
  488.     default_cargo_type=0,
  489.     cargo_capacity=30,
  490.     refit_cost=0,
  491.     loading_speed=3,
  492.     ai_special_flag=1,
  493.     misc_flags=80,
  494.     sprite_id=253,
  495.     bitmask_vehicle_info=0,
  496.     sort_purchase_list=553,
  497. )
  498. # Default chain: switch_126_5
  499. # Purchase chain: switch_136_20
  500.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement