Advertisement
NewDenverCity

custom_attract_ability.asm

Mar 18th, 2018
90
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.08 KB | None | 0 0
  1. .text
  2. .thumb
  3.  
  4. .align 2
  5. custom_attract_ability:
  6. ldr r0, =(0x0202420B) @attacker
  7. ldrb r0, [r0]
  8. mov r1, #0x58 @size of battle_struct
  9. mul r0, r1
  10. ldr r1, =(0x02024084) @battle_struct
  11. add r1, r0
  12. add r1, #0x20 @ability
  13. ldrb r0, [r1]
  14. cmp r0, #0xE9 @custom ability
  15. bne custom_attract_ability_exit_normal
  16. ldr r0, =(0x0202420C) @defender
  17. ldrb r0, [r0]
  18. mov r1, #0x58
  19. mul r0, r1
  20. ldr r2, =(0x02024084)
  21. add r2, r0
  22. ldr r1, [r2, #0x50]
  23. ldr r0, =(0x0202420B) @attacker
  24. ldrb r0, [r0]
  25. cmp r0, #3
  26. bne custom_attract_ability_infatuated_partner
  27. mov r0, #8
  28. b custom_attract_ability_infatuated_check
  29. custom_attract_ability_infatuated_partner:
  30. cmp r0, #2
  31. bne custom_attract_ability_infatuated_enemy
  32. mov r0, #4
  33. b custom_attract_ability_infatuated_check
  34. custom_attract_ability_infatuated_enemy:
  35. cmp r0, #1
  36. bne custom_attract_ability_infatuated_player
  37. mov r0, #2
  38. b custom_attract_ability_infatuated_check
  39. custom_attract_ability_infatuated_player:
  40. mov r0, #1
  41. custom_attract_ability_infatuated_check:
  42. lsl r0, #16
  43. and r0, r1
  44. cmp r0, #0
  45. bne custom_attract_ability_exit_fail
  46. ldr r0, =(0x0202420B) @attacker
  47. ldrb r0, [r0]
  48. cmp r0, #3
  49. beq custom_attract_ability_2nd_enemy
  50. cmp r0, #2
  51. beq custom_attract_ability_partner
  52. cmp r0, #1
  53. beq custom_attract_ability_enemy
  54. mov r0, #1
  55. b custom_attract_ability_continue
  56.  
  57. custom_attract_ability_enemy:
  58. mov r0, #2
  59. b custom_attract_ability_continue
  60.  
  61. custom_attract_ability_partner:
  62. mov r0, #4
  63. b custom_attract_ability_continue
  64.  
  65. custom_attract_ability_2nd_enemy:
  66. mov r0, #8
  67.  
  68. custom_attract_ability_continue:
  69. lsl r0, #16
  70. orr r0, r1
  71. str r0, [r2, #0x50]
  72. ldr r0, =(0x08051E25)
  73. bx r0
  74.  
  75. custom_attract_ability_exit_normal:
  76. mov r0, r10
  77. mov r1, r9
  78. ldr r2, =(0x0806A021)
  79. bl custom_attract_ability_jump
  80. ldr r2, =(0x08051D9D)
  81. custom_attract_ability_jump:
  82. bx r2
  83. custom_attract_ability_exit_fail:
  84. ldr r0, =(0x08051DE5)
  85. bx r0
  86.  
  87. .align 2
  88. .pool
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement