ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/deliantra/Deliantra/Deliantra.pm
(Generate patch)

Comparing deliantra/Deliantra/Deliantra.pm (file contents):
Revision 1.55 by root, Thu Mar 23 07:06:17 2006 UTC vs.
Revision 1.58 by root, Thu Mar 23 20:15:08 2006 UTC

37 msg => "endmsg", 37 msg => "endmsg",
38 lore => "endlore", 38 lore => "endlore",
39 maplore => "endmaplore", 39 maplore => "endmaplore",
40); 40);
41 41
42# movement bit type, PITA
43our %FIELD_MOVEMENT = map +($_ => undef),
44 qw(move_type move_block move_allow move_on move_off move_slow);
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.
48our @FIELD_ORDER_MAP = (qw(
49 name swap_time reset_timeout fixed_resettime difficulty region
50 shopitems shopgreed shopmin shopmax shoprace
51 darkness width height enter_x enter_y msg maplore
52 unique template
53 outdoor temp pressure humid windspeed winddir sky nosmooth
54 tile_path_1 tile_path_2 tile_path_3 tile_path_4
55));
56
44our @FIELD_ORDER = (qw( 57our @FIELD_ORDER = (qw(
58 elevation
59
45 name name_pl custom_name title race 60 name name_pl custom_name title race
46 slaying skill msg lore other_arch face 61 slaying skill msg lore other_arch face
47 #events 62 #todo-events
48 animation is_animated 63 animation is_animated
49 Str Dex Con Wis Pow Cha Int 64 Str Dex Con Wis Pow Cha Int
50 hp maxhp sp maxsp grace maxgrace 65 hp maxhp sp maxsp grace maxgrace
51 exp perm_exp expmul 66 exp perm_exp expmul
52 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
93sub MOVE_FLY_LOW (){ 0x02 } 108sub MOVE_FLY_LOW (){ 0x02 }
94sub MOVE_FLY_HIGH (){ 0x04 } 109sub MOVE_FLY_HIGH (){ 0x04 }
95sub MOVE_FLYING (){ 0x06 } 110sub MOVE_FLYING (){ 0x06 }
96sub MOVE_SWIM (){ 0x08 } 111sub MOVE_SWIM (){ 0x08 }
97sub MOVE_BOAT (){ 0x10 } 112sub MOVE_BOAT (){ 0x10 }
113sub MOVE_KNOWN (){ 0x1f } # all of above
98sub MOVE_ALL (){ 0xff } 114sub MOVE_ALLBIT (){ 0x10000 }
115sub MOVE_ALL (){ 0x1001f } # very special value, more PITA
99 116
100sub load_ref($) { 117sub load_ref($) {
101 my ($path) = @_; 118 my ($path) = @_;
102 119
103 open my $fh, "<", $path 120 open my $fh, "<", $path
126 delete $ob->{$_} for qw( 143 delete $ob->{$_} for qw(
127 can_knockback can_parry can_impale can_cut can_dam_armour 144 can_knockback can_parry can_impale can_cut can_dam_armour
128 can_apply pass_thru can_pass_thru 145 can_apply pass_thru can_pass_thru
129 ); 146 );
130 147
131 for my $attr (qw(move_type move_block move_allow move_on move_off move_slow)) { 148 for my $attr (keys %FIELD_MOVEMENT) {
132 next unless exists $ob->{$attr}; 149 next unless exists $ob->{$attr};
150
151 $ob->{$attr} = MOVE_ALL if $ob->{$attr} == 255; #d# compatibility
152
133 next if $ob->{$attr} =~ /^\d+$/; 153 next if $ob->{$attr} =~ /^\d+$/;
134 154
135 my $flags = 0; 155 my $flags = 0;
136 156
137 # assume list 157 # assume list
219 if (exists $arch->{$k} and $arch->{$k} eq $v) { 239 if (exists $arch->{$k} and $arch->{$k} eq $v) {
220 next if $k eq "_name"; 240 next if $k eq "_name";
221 delete $ob->{$k}; 241 delete $ob->{$k};
222 } 242 }
223 } 243 }
244 }
245
246 # a speciality for the editor
247 if (exists $ob->{attack_movement}) {
248 my $am = delete $ob->{attack_movement};
249 $ob->{attack_movement_bits_0_3} = $am & 15;
250 $ob->{attack_movement_bits_4_7} = $am & 240;
224 } 251 }
225 252
226 $ob 253 $ob
227} 254}
228 255
300 } 327 }
301 $prev = $arc; 328 $prev = $arc;
302 $more = undef; 329 $more = undef;
303 } elsif (/^arch (\S+)$/i) { 330 } elsif (/^arch (\S+)$/i) {
304 my $name = $1; 331 my $name = $1;
305 my $arc = normalize_object $parse_block->(_name => $name); 332 my $arc = normalize_arch $parse_block->(_name => $name);
306 333
307 if ($more) { 334 if ($more) {
308 $more->{more} = $arc; 335 $more->{more} = $arc;
309 } else { 336 } else {
310 push @{ $arc{arch} }, $arc; 337 push @{ $arc{arch} }, $arc;

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines