diff options
author | Astatin <[email protected]> | 2025-02-14 17:16:05 +0900 |
---|---|---|
committer | Astatin <[email protected]> | 2025-02-14 17:16:05 +0900 |
commit | cce14a83a5ef7b8bd3e8affa1cf5d52b00329b0a (patch) | |
tree | 3bbea23771b4cf981796eb9fb50c781b1886e93b /map | |
parent | ecd565bc8625f7b80ebe197554ab01e1ef9a604b (diff) |
Fix laser animation + make EP work + add leaf to restore EP
Diffstat (limited to 'map')
-rw-r--r-- | map/objects.gbasm | 38 |
1 files changed, 36 insertions, 2 deletions
diff --git a/map/objects.gbasm b/map/objects.gbasm index 9f0af1f..db49487 100644 --- a/map/objects.gbasm +++ b/map/objects.gbasm @@ -8,6 +8,7 @@ Initialize_Objects: LD HL, $mem_object_list CALL =Spawn_stairs CALL =Spawn_carrot + CALL =Spawn_leaf RET Spawn_object_in_random_room: ; Object tile in A, Object jump table id in E @@ -108,6 +109,11 @@ Spawn_carrot: LD E, $02 JP =Spawn_object_in_random_room +Spawn_leaf: + LD A, $68 + LD E, $03 + JP =Spawn_object_in_random_room + Object_Interaction_Jump_table: ; 00 RET @@ -116,14 +122,17 @@ Object_Interaction_Jump_table: NOP ; 01 - JP =Stairs_action + JP =Stairs_Action NOP ; 02 JP =Heal_Action NOP -Stairs_action: + ; 03 + JP =Restore_EP_Action + +Stairs_Action: DI LD A, $00 LD $reg_interrupt_flags, A @@ -164,6 +173,29 @@ Heal_Action: RET +Restore_EP_Action: + LD A, $mem_bunny_mana + ADD $15 + DAA + JR NC, =.Set_mana + LD A, $99 + .Set_mana: + LD $mem_bunny_mana, A + + PUSH BC + LD A, $mem_bunny_x + LD B, A + LD A, $mem_bunny_y + LD C, A + LD A, $01 + LD E, $20 + CALL =Try_Launch_Animation + POP BC + + ; LD (HL), $00 + + RET + Display_Object: LD HL, $mem_object_list LD A, $mem_object_load_counter @@ -273,6 +305,8 @@ Object_Interactions_Check: LD A, $mem_map_loading_flags BIT 1, A JR Z, =.End + RES 1, A + LD $mem_map_loading_flags, A LD HL, $mem_object_list LD A, $mem_bunny_x LD C, A |