… | |
… | |
39 | maplore => "endmaplore", |
39 | maplore => "endmaplore", |
40 | ); |
40 | ); |
41 | |
41 | |
42 | # same as in server save routine, to (hopefully) be compatible |
42 | # same as in server save routine, to (hopefully) be compatible |
43 | # to the other editors. |
43 | # to the other editors. |
|
|
44 | our @FIELD_ORDER_MAP = (qw( |
|
|
45 | name swap_time reset_timeout fixed_resettime difficulty region |
|
|
46 | shopitems shopgreed shopmin shopmax shoprace |
|
|
47 | darkness width height enter_x enter_y msg maplore |
|
|
48 | unique template |
|
|
49 | outdoor temp pressure humid windspeed winddir sky nosmooth |
|
|
50 | tile_path_1 tile_path_2 tile_path_3 tile_path_4 |
|
|
51 | )); |
|
|
52 | |
44 | our @FIELD_ORDER = (qw( |
53 | our @FIELD_ORDER = (qw( |
45 | name name_pl custom_name title race |
54 | name name_pl custom_name title race |
46 | slaying skill msg lore other_arch face |
55 | slaying skill msg lore other_arch face |
47 | #events |
56 | #todo-events |
48 | animation is_animated |
57 | animation is_animated |
49 | Str Dex Con Wis Pow Cha Int |
58 | Str Dex Con Wis Pow Cha Int |
50 | hp maxhp sp maxsp grace maxgrace |
59 | hp maxhp sp maxsp grace maxgrace |
51 | exp perm_exp expmul |
60 | exp perm_exp expmul |
52 | food dam luck wc ac x y speed speed_left move_state attack_movement |
61 | food dam luck wc ac x y speed speed_left move_state attack_movement |
… | |
… | |
259 | |
268 | |
260 | while (<$fh>) { |
269 | while (<$fh>) { |
261 | s/\s+$//; |
270 | s/\s+$//; |
262 | if (/^end$/i) { |
271 | if (/^end$/i) { |
263 | last; |
272 | last; |
264 | } elsif (/^arch (\S+)$/) { |
273 | } elsif (/^arch (\S+)$/i) { |
265 | push @{ $arc{inventory} }, normalize_arch $parse_block->(_name => $1); |
274 | push @{ $arc{inventory} }, normalize_arch $parse_block->(_name => $1); |
266 | } elsif (/^lore$/) { |
275 | } elsif (/^lore$/i) { |
267 | while (<$fh>) { |
276 | while (<$fh>) { |
268 | last if /^endlore\s*$/i; |
277 | last if /^endlore\s*$/i; |
269 | $arc{lore} .= $_; |
278 | $arc{lore} .= $_; |
270 | } |
279 | } |
271 | } elsif (/^msg$/) { |
280 | } elsif (/^msg$/i) { |
272 | while (<$fh>) { |
281 | while (<$fh>) { |
273 | last if /^endmsg\s*$/i; |
282 | last if /^endmsg\s*$/i; |
274 | $arc{msg} .= $_; |
283 | $arc{msg} .= $_; |
275 | } |
284 | } |
276 | } elsif (/^(\S+)\s*(.*)$/) { |
285 | } elsif (/^(\S+)\s*(.*)$/) { |
… | |
… | |
299 | $arc{$name} = $arc; |
308 | $arc{$name} = $arc; |
300 | } |
309 | } |
301 | $prev = $arc; |
310 | $prev = $arc; |
302 | $more = undef; |
311 | $more = undef; |
303 | } elsif (/^arch (\S+)$/i) { |
312 | } elsif (/^arch (\S+)$/i) { |
|
|
313 | my $name = $1; |
304 | push @{ $arc{arch} }, normalize_arch $parse_block->(_name => $1); |
314 | my $arc = normalize_object $parse_block->(_name => $name); |
|
|
315 | |
|
|
316 | if ($more) { |
|
|
317 | $more->{more} = $arc; |
|
|
318 | } else { |
|
|
319 | push @{ $arc{arch} }, $arc; |
|
|
320 | } |
|
|
321 | $prev = $arc; |
|
|
322 | $more = undef; |
305 | } elsif (/^\s*($|#)/) { |
323 | } elsif (/^\s*($|#)/) { |
306 | # |
324 | # |
307 | } else { |
325 | } else { |
308 | warn "$path: unparseable top-level line '$_'"; |
326 | warn "$path: unparseable top-level line '$_'"; |
309 | } |
327 | } |