… | |
… | |
36 | our %FIELD_MULTILINE = ( |
36 | our %FIELD_MULTILINE = ( |
37 | msg => "endmsg", |
37 | msg => "endmsg", |
38 | lore => "endlore", |
38 | lore => "endlore", |
39 | maplore => "endmaplore", |
39 | maplore => "endmaplore", |
40 | ); |
40 | ); |
|
|
41 | |
|
|
42 | # movement bit type, PITA |
|
|
43 | our %FIELD_MOVEMENT = map +($_ => undef), |
|
|
44 | qw(move_type move_block move_allow move_on move_off move_slow); |
41 | |
45 | |
42 | # same as in server save routine, to (hopefully) be compatible |
46 | # same as in server save routine, to (hopefully) be compatible |
43 | # to the other editors. |
47 | # to the other editors. |
44 | our @FIELD_ORDER_MAP = (qw( |
48 | our @FIELD_ORDER_MAP = (qw( |
45 | name swap_time reset_timeout fixed_resettime difficulty region |
49 | name swap_time reset_timeout fixed_resettime difficulty region |
… | |
… | |
104 | sub MOVE_FLY_LOW (){ 0x02 } |
108 | sub MOVE_FLY_LOW (){ 0x02 } |
105 | sub MOVE_FLY_HIGH (){ 0x04 } |
109 | sub MOVE_FLY_HIGH (){ 0x04 } |
106 | sub MOVE_FLYING (){ 0x06 } |
110 | sub MOVE_FLYING (){ 0x06 } |
107 | sub MOVE_SWIM (){ 0x08 } |
111 | sub MOVE_SWIM (){ 0x08 } |
108 | sub MOVE_BOAT (){ 0x10 } |
112 | sub MOVE_BOAT (){ 0x10 } |
|
|
113 | sub MOVE_KNOWN (){ 0x1f } # all of above |
109 | sub MOVE_ALL (){ 0xff } |
114 | sub MOVE_ALLBIT (){ 0x10000 } |
|
|
115 | sub MOVE_ALL (){ 0x1001f } # very special value, more PITA |
110 | |
116 | |
111 | sub load_ref($) { |
117 | sub load_ref($) { |
112 | my ($path) = @_; |
118 | my ($path) = @_; |
113 | |
119 | |
114 | open my $fh, "<", $path |
120 | open my $fh, "<", $path |
… | |
… | |
137 | delete $ob->{$_} for qw( |
143 | delete $ob->{$_} for qw( |
138 | can_knockback can_parry can_impale can_cut can_dam_armour |
144 | can_knockback can_parry can_impale can_cut can_dam_armour |
139 | can_apply pass_thru can_pass_thru |
145 | can_apply pass_thru can_pass_thru |
140 | ); |
146 | ); |
141 | |
147 | |
142 | for my $attr (qw(move_type move_block move_allow move_on move_off move_slow)) { |
148 | for my $attr (keys %FIELD_MOVEMENT) { |
143 | next unless exists $ob->{$attr}; |
149 | next unless exists $ob->{$attr}; |
|
|
150 | |
|
|
151 | $ob->{$attr} = MOVE_ALL if $ob->{$attr} == 255; #d# compatibility |
|
|
152 | |
144 | next if $ob->{$attr} =~ /^\d+$/; |
153 | next if $ob->{$attr} =~ /^\d+$/; |
145 | |
154 | |
146 | my $flags = 0; |
155 | my $flags = 0; |
147 | |
156 | |
148 | # assume list |
157 | # assume list |