No Description

grass_animation.c 1.3KB

1234567891011121314151617181920212223242526272829303132333435
  1. #include <oe_animation.h>
  2. #include <npc.h>
  3. #include <save_one.h>
  4. #include <agb_debug.h>
  5. extern u16 current_map_block_role_get(u16 x, u16 y);
  6. void grass_step_general(struct npc_state *npc)
  7. {
  8. current_oe_state.to_x___local_id = npc->to.x;
  9. current_oe_state.to_y___local_mapnumber = npc->to.y;
  10. current_oe_state.height_lsr_4___local_mapbank = (npc->height) >> 4;
  11. current_oe_state.field_C = 2;
  12. current_oe_state.local_id_and_mapnumber = (npc->local_id << 8) | (npc->local_mapnumber);
  13. current_oe_state.local_mapbank = npc->local_mapbank;
  14. current_oe_state.sav1_location = (((sav_one->location.map) << 8) | sav_one->location.bank);
  15. current_oe_state.field_1C = 1;
  16. (void)oe_exec(4);
  17. }
  18. void grass_step_elastic(struct npc_state *npc)
  19. {
  20. current_oe_state.to_x___local_id = npc->to.x;
  21. current_oe_state.to_y___local_mapnumber = npc->to.y;
  22. current_oe_state.height_lsr_4___local_mapbank = (npc->height) >> 4;
  23. current_oe_state.field_C = 2;
  24. current_oe_state.local_id_and_mapnumber = (npc->local_id << 8) | (npc->local_mapnumber);
  25. current_oe_state.local_mapbank = npc->local_mapbank;
  26. current_oe_state.sav1_location = (((sav_one->location.map) << 8) | sav_one->location.bank);
  27. current_oe_state.field_1C = 0;
  28. /* use variable to determine the oe animation to play */
  29. (void)oe_exec(4);
  30. }