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/>.
16 ;defetvar: afirst_frame, alast_frame, aframe
18 ;defetvar: spr_bank, spr_num, spr_dir
20 ;defetvar: pos_x, pos_y
21 ;defetvar: pos_tx, pos_ty
28 const: ITEM_ANIM_DELAY = 5
36 proc: item_at_me_typed
45 ; only running threads
47 jne .next, THREAD_STATE_RUNNING
49 get [.cnt], item_id, [.t]
50 jne .next, [.t], [.item_type]
54 ; only standing on tile
68 rst FRST_GET_MAX_THREAD_ID
69 jle .loop, [.cnt], [rst_result]
72 endp: item_at_me_typed
76 jlt .raising, [pos_ty], 0
77 jne .liftdown1, [liftdown], 0
78 jeq .liftdown, [pos_ty], 1
79 jgt .falling, [pos_ty], 0 ; already falling
82 jne .quit, FTILE_EMPTY
93 jeq .raise_one, [pos_ty], -1
95 jne .quit, [pos_ty], -10
107 jeq .one_wait, [pos_ty], 0
109 jne .quit, [pos_ty], 10
117 endp: item_check_fall
120 proc: item_do_fall_step
124 jlt .quit, [pos_ty], 9
128 set [falling], -1 ; falling done (can be changed later)
130 set [.sy], [map_height]
132 jge item_fall_dead, [pos_y], [.sy]
134 jne .quit, FTILE_EMPTY
138 endp: item_do_fall_step
149 include: i_gloves.awa
150 include: i_umbrella.awa
153 include: i_dynamite.awa
155 include: i_rocket.awa
167 dw: entry_item_dynamite
173 dw: entry_item_umbrella
176 dw: entry_item_monster
179 dw: entry_item_rocket
188 dw: entry_item_gloves
198 set [apause], ITEM_ANIM_DELAY
202 jlt item_fall_dead, [item_id], 0
203 jeq item_fall_dead, [item_id], 255
211 jeq .found, [item_id]
231 proc: set_item_name_vars
234 set [.addr], item_names
238 jeq .not_found, [.type], 255
239 jne .bad_type, [.type], [.item_id]
241 set [item_name_ofs], [.addr]
242 set [item_name_len], -1 ; asciiz
247 jeq .loop, [.type], 0
250 set [item_name_ofs], 0
251 set [item_name_len], 0
253 endp: set_item_name_vars