@@ -34,12 +34,15 @@ def apply_rules_on_sections(parsed_subset):
34
34
if contains_property_shallowly (children , "MaxMass" ):
35
35
max_mass_to_max_inventory_mass (children )
36
36
37
- iconfile_path = iconfile_path_to_thumbnail_generator (children )
37
+ iconfile_path_to_thumbnail_generator (children )
38
38
39
39
for line_tokens in children :
40
40
replace_property_and_value (line_tokens , "MinThrottleRange" , "NegativeThrottleMultiplier" , min_throttle_range_to_negative_throttle_multiplier )
41
41
replace_property_and_value (line_tokens , "MaxThrottleRange" , "PositiveThrottleMultiplier" , max_throttle_range_to_positive_throttle_multiplier )
42
42
43
+ shovel_flash_fix (children )
44
+
45
+
43
46
# TODO: Remove contains_property_and_value_shallowly() and write out what it does in this function
44
47
# TODO: I don't remember whether this one works
45
48
if contains_property_and_value_shallowly (section , "AddActor" , "Leg" ):
@@ -95,6 +98,7 @@ def max_mass_to_max_inventory_mass(children):
95
98
if token ["type" ] == "property" :
96
99
if token ["content" ] == "MaxMass" :
97
100
token ["content" ] = "MaxInventoryMass"
101
+
98
102
for token_2 in line_tokens :
99
103
if token_2 ["type" ] == "value" :
100
104
token_2 ["content" ] = max_inventory_mass
@@ -221,4 +225,40 @@ def iconfile_path_to_thumbnail_generator(children):
221
225
222
226
223
227
def duplicate_script_path (parsed_subset ):
224
- pass
228
+ pass
229
+
230
+
231
+ def shovel_flash_fix (children ):
232
+ """
233
+ SpriteFile = ContentFile
234
+ FilePath = Ronin.rte/Effects/Pyro/Flashes/ShovelFlash.png
235
+ FrameCount = 2
236
+ ->
237
+ SpriteFile = ContentFile
238
+ FilePath = Ronin.rte/Devices/Tools/Shovel/Effects/ShovelFlash.png
239
+ FrameCount = 1
240
+ """
241
+
242
+ # TODO: Make this recursive somehow.
243
+ for line_tokens in children :
244
+ for token in line_tokens :
245
+ if token ["type" ] == "property" :
246
+ if token ["content" ] == "SpriteFile" :
247
+
248
+ for token_2 in line_tokens :
249
+ if token_2 ["type" ] == "children" :
250
+ for subline_tokens in token_2 ["content" ]:
251
+ for subtoken in subline_tokens :
252
+ if subtoken ["type" ] == "property" and subtoken ["content" ] == "FilePath" :
253
+ for subtoken in subline_tokens :
254
+ if subtoken ["type" ] == "value" and subtoken ["content" ] in ("Ronin.rte/Devices/Sprites/ShovelFlash.bmp" , "Ronin.rte/Effects/Pyro/Flashes/ShovelFlash.png" ):
255
+ subtoken ["content" ] = "Ronin.rte/Devices/Tools/Shovel/Effects/ShovelFlash.png"
256
+
257
+ for line_tokens2 in children :
258
+ for token2 in line_tokens2 :
259
+ if token2 ["type" ] == "property" :
260
+ if token2 ["content" ] == "FrameCount" :
261
+ for token3 in line_tokens2 :
262
+ if token3 ["type" ] == "value" :
263
+ if token3 ["content" ] == "2" :
264
+ token3 ["content" ] = "1"
0 commit comments