… | |
… | |
59 | |
59 | |
60 | name name_pl custom_name title race |
60 | name name_pl custom_name title race |
61 | slaying skill msg lore other_arch face |
61 | slaying skill msg lore other_arch face |
62 | #todo-events |
62 | #todo-events |
63 | animation is_animated |
63 | animation is_animated |
64 | Str Dex Con Wis Pow Cha Int |
64 | str dex con wis pow cha int |
65 | hp maxhp sp maxsp grace maxgrace |
65 | hp maxhp sp maxsp grace maxgrace |
66 | exp perm_exp expmul |
66 | exp perm_exp expmul |
67 | 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 |
68 | nrof level direction type subtype |
68 | nrof level direction type subtype attacktype |
69 | |
69 | |
70 | resist_physical resist_magic resist_fire resist_electricity |
70 | resist_physical resist_magic resist_fire resist_electricity |
71 | resist_cold resist_confusion resist_acid resist_drain |
71 | resist_cold resist_confusion resist_acid resist_drain |
72 | resist_weaponmagic resist_ghosthit resist_poison resist_slow |
72 | resist_weaponmagic resist_ghosthit resist_poison resist_slow |
73 | resist_paralyze resist_turn_undead resist_fear resist_cancellation |
73 | resist_paralyze resist_turn_undead resist_fear resist_cancellation |
… | |
… | |
431 | my $type = $obj->{type} || $arch->{type}; |
431 | my $type = $obj->{type} || $arch->{type}; |
432 | |
432 | |
433 | if ($type > 0) { |
433 | if ($type > 0) { |
434 | $root = $Crossfire::Data::ATTR{$type}; |
434 | $root = $Crossfire::Data::ATTR{$type}; |
435 | } else { |
435 | } else { |
|
|
436 | my %a = (%$arch, %$obj); |
|
|
437 | |
|
|
438 | if ($a{is_floor} && !$a{alive}) { |
|
|
439 | $root = $Crossfire::Data::TYPE{Floor}; |
|
|
440 | } elsif (!$a{is_floor} && $a{alive} && !$a{tear_down}) { |
|
|
441 | $root = $Crossfire::Data::TYPE{"Monster & NPC"}; |
|
|
442 | } elsif (!$a{is_floor} && !$a{alive} && $a{move_block}) { |
|
|
443 | $root = $Crossfire::Data::TYPE{Wall}; |
|
|
444 | } elsif (!$a{is_floor} && $a{alive} && $a{tear_down}) { |
|
|
445 | $root = $Crossfire::Data::TYPE{"Weak Wall"}; |
|
|
446 | } else { |
436 | $root = $Crossfire::Data::TYPE{Misc}; |
447 | $root = $Crossfire::Data::TYPE{Misc}; |
437 | |
|
|
438 | type: |
|
|
439 | for (@Crossfire::Data::ATTR0) { |
|
|
440 | my $req = $_->{required} |
|
|
441 | or die "internal error: ATTR0 without 'required'"; |
|
|
442 | |
|
|
443 | keys %$req; |
|
|
444 | while (my ($k, $v) = each %$req) { |
|
|
445 | next type |
|
|
446 | unless $obj->{$k} == $v || $arch->{$k} == $v; |
|
|
447 | } |
|
|
448 | |
|
|
449 | $root = $_; |
|
|
450 | } |
448 | } |
451 | } |
449 | } |
452 | |
450 | |
453 | my @import = ($root); |
451 | my @import = ($root); |
454 | |
452 | |
… | |
… | |
628 | cache_file "$LIB/crossfire.0", "$VARDIR/tilecache.pst", sub { |
626 | cache_file "$LIB/crossfire.0", "$VARDIR/tilecache.pst", sub { |
629 | $TILE = new_from_file Gtk2::Gdk::Pixbuf "$VARDIR/tilecache.png" |
627 | $TILE = new_from_file Gtk2::Gdk::Pixbuf "$VARDIR/tilecache.png" |
630 | or die "$VARDIR/tilecache.png: $!"; |
628 | or die "$VARDIR/tilecache.png: $!"; |
631 | *FACE = $_[0]; |
629 | *FACE = $_[0]; |
632 | }, sub { |
630 | }, sub { |
633 | require File::Temp; |
|
|
634 | |
|
|
635 | my $tile = read_pak "$LIB/crossfire.0"; |
631 | my $tile = read_pak "$LIB/crossfire.0"; |
636 | |
632 | |
637 | my %cache; |
633 | my %cache; |
638 | |
634 | |
639 | my $idx = 0; |
635 | my $idx = 0; |
640 | |
636 | |
641 | for my $name (sort keys %$tile) { |
637 | for my $name (sort keys %$tile) { |
642 | my ($fh, $filename) = File::Temp::tempfile (); |
638 | my $pb = new Gtk2::Gdk::PixbufLoader; |
643 | print $fh $tile->{$name}; |
639 | $pb->write ($tile->{$name}); |
644 | close $fh; |
640 | $pb->close; |
645 | my $pb = new_from_file Gtk2::Gdk::Pixbuf $filename; |
641 | my $pb = $pb->get_pixbuf; |
646 | unlink $filename; |
|
|
647 | |
642 | |
648 | my $tile = $cache{$name} = { |
643 | my $tile = $cache{$name} = { |
649 | pb => $pb, |
644 | pb => $pb, |
650 | idx => $idx, |
645 | idx => $idx, |
651 | w => int $pb->get_width / TILESIZE, |
646 | w => int $pb->get_width / TILESIZE, |
… | |
… | |
669 | $pb, ($idx % 64) * TILESIZE, TILESIZE * int $idx / 64); |
664 | $pb, ($idx % 64) * TILESIZE, TILESIZE * int $idx / 64); |
670 | } |
665 | } |
671 | } |
666 | } |
672 | } |
667 | } |
673 | |
668 | |
674 | $pb->save ("$VARDIR/tilecache.png", "png"); |
669 | $pb->save ("$VARDIR/tilecache.png", "png", compression => 1); |
675 | |
670 | |
676 | \%cache |
671 | \%cache |
677 | }; |
672 | }; |
678 | } |
673 | } |
679 | |
674 | |