… | |
… | |
305 | if (defined (my $v = delete $ob->{slow_move})) { |
305 | if (defined (my $v = delete $ob->{slow_move})) { |
306 | $ob->{move_slow} |= MOVE_WALK; |
306 | $ob->{move_slow} |= MOVE_WALK; |
307 | $ob->{move_slow_penalty} = $v; |
307 | $ob->{move_slow_penalty} = $v; |
308 | } |
308 | } |
309 | if (defined (my $v = delete $ob->{walk_on})) { |
309 | if (defined (my $v = delete $ob->{walk_on})) { |
310 | $ob->{move_on} = MOVE_ALL unless exists $ob->{move_on}; |
310 | $ob->{move_on} = MOVE_NONE unless exists $ob->{move_on}; |
311 | $ob->{move_on} = $v ? $ob->{move_on} | MOVE_WALK |
311 | $ob->{move_on} = $v ? $ob->{move_on} | MOVE_WALK |
312 | : $ob->{move_on} & ~MOVE_WALK; |
312 | : $ob->{move_on} & ~MOVE_WALK; |
313 | } |
313 | } |
314 | if (defined (my $v = delete $ob->{walk_off})) { |
314 | if (defined (my $v = delete $ob->{walk_off})) { |
315 | $ob->{move_off} = MOVE_ALL unless exists $ob->{move_off}; |
315 | $ob->{move_off} = MOVE_NONE unless exists $ob->{move_off}; |
316 | $ob->{move_off} = $v ? $ob->{move_off} | MOVE_WALK |
316 | $ob->{move_off} = $v ? $ob->{move_off} | MOVE_WALK |
317 | : $ob->{move_off} & ~MOVE_WALK; |
317 | : $ob->{move_off} & ~MOVE_WALK; |
318 | } |
318 | } |
319 | if (defined (my $v = delete $ob->{fly_on})) { |
319 | if (defined (my $v = delete $ob->{fly_on})) { |
320 | $ob->{move_on} = MOVE_ALL unless exists $ob->{move_on}; |
320 | $ob->{move_on} = MOVE_NONE unless exists $ob->{move_on}; |
321 | $ob->{move_on} = $v ? $ob->{move_on} | MOVE_FLY_LOW |
321 | $ob->{move_on} = $v ? $ob->{move_on} | MOVE_FLY_LOW |
322 | : $ob->{move_on} & ~MOVE_FLY_LOW; |
322 | : $ob->{move_on} & ~MOVE_FLY_LOW; |
323 | } |
323 | } |
324 | if (defined (my $v = delete $ob->{fly_off})) { |
324 | if (defined (my $v = delete $ob->{fly_off})) { |
325 | $ob->{move_off} = MOVE_ALL unless exists $ob->{move_off}; |
325 | $ob->{move_off} = MOVE_NONE unless exists $ob->{move_off}; |
326 | $ob->{move_off} = $v ? $ob->{move_off} | MOVE_FLY_LOW |
326 | $ob->{move_off} = $v ? $ob->{move_off} | MOVE_FLY_LOW |
327 | : $ob->{move_off} & ~MOVE_FLY_LOW; |
327 | : $ob->{move_off} & ~MOVE_FLY_LOW; |
328 | } |
328 | } |
329 | if (defined (my $v = delete $ob->{flying})) { |
329 | if (defined (my $v = delete $ob->{flying})) { |
330 | $ob->{move_type} = MOVE_ALL unless exists $ob->{move_type}; |
330 | $ob->{move_type} = MOVE_NONE unless exists $ob->{move_type}; |
331 | $ob->{move_type} = $v ? $ob->{move_type} | MOVE_FLY_LOW |
331 | $ob->{move_type} = $v ? $ob->{move_type} | MOVE_FLY_LOW |
332 | : $ob->{move_type} & ~MOVE_FLY_LOW; |
332 | : $ob->{move_type} & ~MOVE_FLY_LOW; |
333 | } |
333 | } |
334 | |
334 | |
335 | # convert idiotic event_xxx things into objects |
335 | # convert idiotic event_xxx things into objects |
… | |
… | |
796 | ]; |
796 | ]; |
797 | |
797 | |
798 | $attr |
798 | $attr |
799 | } |
799 | } |
800 | |
800 | |
801 | sub arch_edit_sections { |
|
|
802 | # if (edit_type == IGUIConstants.TILE_EDIT_NONE) |
|
|
803 | # edit_type = 0; |
|
|
804 | # else if (edit_type != 0) { |
|
|
805 | # // all flags from 'check_type' must be unset in this arch because they get recalculated now |
|
|
806 | # edit_type &= ~check_type; |
|
|
807 | # } |
|
|
808 | # |
|
|
809 | # } |
|
|
810 | # if ((check_type & IGUIConstants.TILE_EDIT_MONSTER) != 0 && |
|
|
811 | # getAttributeValue("alive", defarch) == 1 && |
|
|
812 | # (getAttributeValue("monster", defarch) == 1 || |
|
|
813 | # getAttributeValue("generator", defarch) == 1)) { |
|
|
814 | # // Monster: monsters/npcs/generators |
|
|
815 | # edit_type |= IGUIConstants.TILE_EDIT_MONSTER; |
|
|
816 | # } |
|
|
817 | # if ((check_type & IGUIConstants.TILE_EDIT_WALL) != 0 && |
|
|
818 | # arch_type == 0 && getAttributeValue("no_pass", defarch) == 1) { |
|
|
819 | # // Walls |
|
|
820 | # edit_type |= IGUIConstants.TILE_EDIT_WALL; |
|
|
821 | # } |
|
|
822 | # if ((check_type & IGUIConstants.TILE_EDIT_CONNECTED) != 0 && |
|
|
823 | # getAttributeValue("connected", defarch) != 0) { |
|
|
824 | # // Connected Objects |
|
|
825 | # edit_type |= IGUIConstants.TILE_EDIT_CONNECTED; |
|
|
826 | # } |
|
|
827 | # if ((check_type & IGUIConstants.TILE_EDIT_EXIT) != 0 && |
|
|
828 | # arch_type == 66 || arch_type == 41 || arch_type == 95) { |
|
|
829 | # // Exit: teleporter/exit/trapdoors |
|
|
830 | # edit_type |= IGUIConstants.TILE_EDIT_EXIT; |
|
|
831 | # } |
|
|
832 | # if ((check_type & IGUIConstants.TILE_EDIT_TREASURE) != 0 && |
|
|
833 | # getAttributeValue("no_pick", defarch) == 0 && (arch_type == 4 || |
|
|
834 | # arch_type == 5 || arch_type == 36 || arch_type == 60 || |
|
|
835 | # arch_type == 85 || arch_type == 111 || arch_type == 123 || |
|
|
836 | # arch_type == 124 || arch_type == 130)) { |
|
|
837 | # // Treasure: randomtreasure/money/gems/potions/spellbooks/scrolls |
|
|
838 | # edit_type |= IGUIConstants.TILE_EDIT_TREASURE; |
|
|
839 | # } |
|
|
840 | # if ((check_type & IGUIConstants.TILE_EDIT_DOOR) != 0 && |
|
|
841 | # arch_type == 20 || arch_type == 23 || arch_type == 26 || |
|
|
842 | # arch_type == 91 || arch_type == 21 || arch_type == 24) { |
|
|
843 | # // Door: door/special door/gates + keys |
|
|
844 | # edit_type |= IGUIConstants.TILE_EDIT_DOOR; |
|
|
845 | # } |
|
|
846 | # if ((check_type & IGUIConstants.TILE_EDIT_EQUIP) != 0 && |
|
|
847 | # getAttributeValue("no_pick", defarch) == 0 && ((arch_type >= 13 && |
|
|
848 | # arch_type <= 16) || arch_type == 33 || arch_type == 34 || |
|
|
849 | # arch_type == 35 || arch_type == 39 || arch_type == 70 || |
|
|
850 | # arch_type == 87 || arch_type == 99 || arch_type == 100 || |
|
|
851 | # arch_type == 104 || arch_type == 109 || arch_type == 113 || |
|
|
852 | # arch_type == 122 || arch_type == 3)) { |
|
|
853 | # // Equipment: weapons/armour/wands/rods |
|
|
854 | # edit_type |= IGUIConstants.TILE_EDIT_EQUIP; |
|
|
855 | # } |
|
|
856 | # |
|
|
857 | # return(edit_type); |
|
|
858 | # |
|
|
859 | # |
|
|
860 | } |
|
|
861 | |
|
|
862 | sub cache_file($$&&) { |
801 | sub cache_file($$&&) { |
863 | my ($src, $cache, $load, $create) = @_; |
802 | my ($src, $cache, $load, $create) = @_; |
864 | |
803 | |
865 | my ($size, $mtime) = (stat $src)[7,9] |
804 | my ($size, $mtime) = (stat $src)[7,9] |
866 | or Carp::croak "$src: $!"; |
805 | or Carp::croak "$src: $!"; |