Sin descripción

battle_m_flee_hook.s 1.2KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  1. #include <battle_script.h>
  2. #include <config.h>
  3. .text
  4. .align 2
  5. .thumb
  6. .global battle_m_flee_hook
  7. battle_m_flee_hook:
  8. ldr r0, =battle_type_flags
  9. ldr r0, [r0]
  10. mov r1, #0xA
  11. and r0, r1
  12. cmp r0, #8
  13. bne no_trainer
  14. ldr r0, =battle_buffer_b
  15. ldr r4, =battle_active_bank
  16. ldrb r1, [r4]
  17. lsl r1, #9
  18. add r0, #1
  19. add r1, r1, r0
  20. ldrb r0, [r1]
  21. cmp r0, #3
  22. bne no_flee
  23. ldr r0, =0x080146CB
  24. bx r0
  25. no_trainer:
  26. /* here we have a wild battle (hopefully) and want to intercept on flag */
  27. @for testing: intercept everything!
  28. @only intercept the flee command though...
  29. ldr r0, =battle_buffer_b
  30. ldr r4, =battle_active_bank
  31. ldrb r1, [r4]
  32. lsl r1, #9
  33. add r0, #1
  34. add r1, r1, r0
  35. ldrb r0, [r1]
  36. cmp r0, #3
  37. bne no_flee
  38. ldr r0, =FLAG_DEOXYS_AURA
  39. bl call_flag_get
  40. cmp r0, #0
  41. bne intercept_aura
  42. b no_flee
  43. intercept_aura:
  44. ldr r0, =bsc_deoxys_aura @some move script change later
  45. bl call_battle_call_move_something
  46. ldr r1, =battle_preparation_phase
  47. ldrb r0, [r4]
  48. add r0, r0, r1
  49. ldr r1, =0x08014927
  50. bx r1
  51. no_flee:
  52. ldr r0, =0x080146ED
  53. bx r0
  54. .align 2
  55. call_battle_call_move_something:
  56. ldr r1, =battle_call_bc_move_exec
  57. bx r1
  58. call_flag_get:
  59. ldr r1, =flag_check
  60. bx r1
  61. bsc_deoxys_aura:
  62. setword STRING_LOADER str_deoxys_aura
  63. printstring 0x184
  64. end2