… | |
… | |
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 |
… | |
… | |
55 | |
59 | |
56 | name name_pl custom_name title race |
60 | name name_pl custom_name title race |
57 | slaying skill msg lore other_arch face |
61 | slaying skill msg lore other_arch face |
58 | #todo-events |
62 | #todo-events |
59 | animation is_animated |
63 | animation is_animated |
60 | Str Dex Con Wis Pow Cha Int |
64 | str dex con wis pow cha int |
61 | hp maxhp sp maxsp grace maxgrace |
65 | hp maxhp sp maxsp grace maxgrace |
62 | exp perm_exp expmul |
66 | exp perm_exp expmul |
63 | food dam luck wc ac x y speed speed_left move_state attack_movement |
67 | food dam luck wc ac x y speed speed_left move_state attack_movement |
64 | nrof level direction type subtype |
68 | nrof level direction type subtype attacktype |
65 | |
69 | |
66 | resist_physical resist_magic resist_fire resist_electricity |
70 | resist_physical resist_magic resist_fire resist_electricity |
67 | resist_cold resist_confusion resist_acid resist_drain |
71 | resist_cold resist_confusion resist_acid resist_drain |
68 | resist_weaponmagic resist_ghosthit resist_poison resist_slow |
72 | resist_weaponmagic resist_ghosthit resist_poison resist_slow |
69 | resist_paralyze resist_turn_undead resist_fear resist_cancellation |
73 | resist_paralyze resist_turn_undead resist_fear resist_cancellation |
… | |
… | |
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 |