2 * This program is free software: you can redistribute it and/or modify
3 * it under the terms of the GNU General Public License as published by
4 * the Free Software Foundation, either version 3 of the License, or
5 * (at your option) any later version.
7 * This program is distributed in the hope that it will be useful,
8 * but WITHOUT ANY WARRANTY; without even the implied warranty of
9 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
10 * GNU General Public License for more details.
12 * You should have received a copy of the GNU General Public License
13 * along with this program. If not, see <http://www.gnu.org/licenses/>.
40 /* stand facing, wait 2 frames before any action */
42 set [spr_num], PSPR_FACING
43 set [spr_dir], DIR_LEFT
44 set [prof_dir], PDIR_FACING
52 set [spr_num], PSPR_FACING
53 set [spr_dir], DIR_LEFT
54 set [prof_dir], PDIR_FACING
62 jeq .nofan, [game_fan_dx_v], 0
63 set [prof_dir], [game_fan_dx_v]
65 jmp game_check_do_slide_move
72 jne game_do_door_exit, 0
73 bsr game_check_monster_eating
74 set [game_want_key], 1
76 ; if we are still here, there was no falling
77 jne .pick_facing, [key_take], 0
79 jeq .nouse, [prof_item], 0
80 jne .use_facing, [key_use], 0
83 jeq .nowc, [key_walk_cheat], 0
85 jne game_cheat_up, [key_up], 0
86 jne game_cheat_down, [key_down], 0
91 jne .no_lift, FTILE_LIFT
92 jne .lift_up, [key_up], 0
93 jne .lift_down, [key_down], 0
96 jne game_turning_right, [key_right], 0
97 jne game_turning_left, [key_left], 0
101 jle .no_lift, [pos_y], 4
103 bsr get_tile_at_dy, -5
113 bsr game_lift_all_items, -1 ; kick up all items on lift
115 new entry_lift, [.tid]
116 set pos_x, [pos_x], [.tid]
117 set pos_y, [pos_y], [.tid]
118 set pos_ty, -2, [.tid]
130 msf [pos_x], [pos_y], FTILE_LIFT
134 set [.tid], [map_height]
136 jge .no_lift, [pos_y], [.tid]
137 ; have space at bottom?
145 bsr game_lift_all_items, 1
147 new entry_lift, [.tid]
148 set pos_x, [pos_x], [.tid]
149 set pos_y, [pos_y], [.tid]
150 set pos_ty, 2, [.tid]
162 msf [pos_x], [pos_y], FTILE_LIFT
166 get [prof_item], item_id
167 jne .nouse, ITEM_DRILL
170 ;FIXME: can we drill lift?
172 jeq game_no_no, FTILE_LIFT
174 jge game_no_no, FTILE_STEEL
176 new entry_drill, [.tid]
177 set pos_x, [pos_x], [.tid]
178 set pos_y, [pos_y], [.tid]
179 rst FRST_PLAY_SOUND, SND_DRILL
182 set [spr_num], PSPR_DRILLING0
184 set [spr_num], PSPR_DRILLING1
188 set [spr_num], PSPR_FACING
192 bsr game_do_pick, PDIR_FACING
196 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
199 bsr prof_turn_to_player
200 dup ; arg to game_do_pick
208 set [prof_dir], PDIR_LEFT
211 set [prof_dir], PDIR_RIGHT
222 jne game_do_door_exit, 0
223 bsr game_check_monster_eating
224 set [game_want_key], 1
226 ; if we are still here, there was no falling
227 jeq .nopickup, [key_take], 0
229 jmp game_lr_stand_loop
232 jeq .nouse, [prof_item], 0
233 jne .use_item, [key_use], 0
236 jeq .nowc, [key_walk_cheat], 0
237 psh game_lr_stand_loop
238 jne game_cheat_up, [key_up], 0
239 jne game_cheat_down, [key_down], 0
243 jeq .nojump, [key_up], 0
245 jne game_lr_stand_loop, 0 ; do it all again if there were no jump
246 ; returns? can't jump
248 jeq .noturnface, [key_down], 0
249 set [prof_dir], PDIR_FACING
253 jne .walk_right, [key_right], 0
254 jne .walk_left, [key_left], 0
257 jmp game_lr_stand_loop
260 jeq .walk, [prof_dir], PDIR_RIGHT
261 set [prof_dir], PDIR_RIGHT
263 jmp game_lr_stand_loop
266 jeq .walk, [prof_dir], PDIR_LEFT
267 set [prof_dir], PDIR_LEFT
269 jmp game_lr_stand_loop
274 jmp game_do_side_move