added cleanup callback to room scrips (remove code patching, etc)
[awish.git] / asm / mapscripts / level01.awa
blobb3f2401e4af177bdf4abe98217dd1437415c1c92
1 include: ../imports.awa
3 public: entry_local_room_script:
4   ; move first item to player
5   rst FRST_GET_RAND
6   rst FRST_DEBUG_PRINT_NUM, [rst_result]
7   rst FRST_DEBUG_PRINT_STR, -10
9   bsr first_to_me
11   set [room_script_tid], -1
12   end
15 eproc: entry_local_room_script_unload
16   rst FRST_DEBUG_PRINT_STR, .msg_unloading
17   ret
18 .msg_unloading: dz: "MESSAGE: unloading map script.\n"
19 endp: entry_local_room_script_unload
22 proc: first_to_me
23 locals: .px, .py
24   get 0, pos_x, [.px]
25   get 0, pos_y, [.py]
26   rst FRST_GET_RAND, 1, 5
27   ;rst FRST_DEBUG_PRINT_NUM, [rst_result]
28   ;rst FRST_DEBUG_PRINT_STR, -10
29   add [.px], [rst_result]
30   rst FRST_GET_RAND, 0, 12
31   ;rst FRST_DEBUG_PRINT_NUM, [rst_result]
32   ;rst FRST_DEBUG_PRINT_STR, -10
33   sub [.py], [rst_result]
34   set pos_x, [.px], 1
35   set pos_y, [.py], 1
36   ret
37 endp: first_to_me