Advertisement
Doesnt

type chart thingy

Sep 16th, 2015
136
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.77 KB | None | 0 0
  1. #32 vals per type, 32 attacking types
  2. #0x9 = ???/Fairy
  3. #0x12 = Foresight-boosted Normal
  4. #0x13 = Foresight-boosted Fighting
  5. #0x14 = Freeze-Dry
  6. #0x15 = Flying Press
  7.  
  8. #r8 = attacking type
  9.  
  10. .org 0x1e938
  11. ldr r2, .MethodAddr
  12. bx r2
  13.  
  14. .MethodAddr: .word 0x081d6701
  15.  
  16. .org 0x1D6700
  17.  
  18. ldr r2, .BattleStruct
  19. ldr r3, .TargetBank
  20. ldrb r3, [r3, #0x0]
  21. mov r0, #0x58
  22. mul r0, r3
  23. add r6, r2, r0
  24.  
  25. ldr r3, .AttackerBank
  26. ldrb r3, [r3, #0x0]
  27. mov r0, #0x58
  28. mul r0, r3
  29. add r7, r2, r0
  30.  
  31. mov r0, r8
  32. cmp r0, #0x0
  33. bne CheckForesight
  34. mov r1, #0x20
  35. add r1, r7
  36. ldrb r1, [r1, #0x0]
  37. cmp r1, #0x91
  38. beq Refrigerate
  39. cmp r1, #0x95
  40. beq Pixilate
  41. cmp r1, #0x97
  42. beq Aerilate
  43. b CheckForesight
  44.  
  45. Refrigerate:
  46. mov r0, #0xf
  47. mov r8, r0
  48. b CheckForesight
  49.  
  50. Pixilate:
  51. mov r0, #0x9
  52. mov r8, r0
  53. b CheckForesight
  54.  
  55. Aerilate:
  56. mov r0, #0x2
  57. mov r8, r0
  58.  
  59.  
  60. CheckForesight:
  61. mov r0, r8
  62. cmp r0, #0x0
  63. beq Foresight
  64. cmp r0, #0x1
  65. bne SkipForesight
  66.  
  67. Foresight:
  68. mov r1, r6
  69. add r1, r1, #0x50
  70. ldr r0, [r1, #0x0]
  71. mov r1, #0x80
  72. lsl r1, r1, #0x16
  73. and r0, r1
  74. cmp r0, #0x0
  75. bne ApplyForesight
  76.  
  77. Scrappy:
  78. mov r0, #0x20
  79. add r0, r7
  80. ldrb r0, [r0, #0x0]
  81. cmp r0, #0x66
  82. bne SkipForesight
  83.  
  84.  
  85. ApplyForesight:
  86. mov r0, r8
  87. add r0, #0x12
  88. mov r8, r0
  89.  
  90. SkipForesight:
  91. SpecialMoves:
  92. ldr r0, .AttackUsed
  93. ldrh r1, [r0, #0x0]
  94. ldr r0, .FreezeDryID
  95. cmp r0, r1
  96. beq FreezeDry
  97. ldr r0, .FlyingPressID
  98. cmp r0, r1
  99. beq FlyingPress
  100. b TypeChartProper
  101.  
  102. FreezeDry:
  103. mov r0, #0x14
  104. mov r8, r0
  105. b TypeChartProper
  106.  
  107. FlyingPress:
  108. mov r0, #0x15
  109. mov r8, r0
  110. b TypeChartProper
  111.  
  112.  
  113. TypeChartProper:
  114. ldr r4, .TypeChart
  115. mov r1, r8
  116. lsl r1, r1, #0x5
  117. add r4, r1, r4
  118. add r6, #0x21
  119.  
  120. ldrb r0, [r6, #0x0]
  121. add r0, r4, r0
  122. ldrb r0, [r0, #0x0]
  123. bl 0x1e770
  124.  
  125. ldrb r0, [r6, #0x0]
  126. ldrb r1, [r6, #0x1]
  127. cmp r0, r1
  128. beq SkipSecondType
  129.  
  130. add r0, r4, r1
  131. ldrb r0, [r0, #0x0]
  132. bl 0x1e770
  133.  
  134. SkipSecondType:
  135.  
  136. TintedLens:
  137. mov r0, #0x20
  138. add r0, r7
  139. ldrb r0, [r0, #0x0]
  140. cmp r0, #0x64
  141. bne EndTintedLens
  142. ldr r2, .Outcome
  143. mov r1, #0x4
  144. and r1, r2
  145. cmp r1, #0x0
  146. beq EndTintedLens
  147. ldr r0, .Damage
  148. ldr r1, [r0, #0x0]
  149. lsl r1, #0x2
  150. str r1, [r0, #0x0]
  151.  
  152. EndTintedLens:
  153. Filter:
  154. mov r0, #0x20
  155. add r0, r6
  156. ldrb r0, [r0, #0x0]
  157. cmp r0, #0x65
  158. beq DoFilter
  159. cmp r0, #0x69
  160. bne SkipFilter
  161.  
  162. DoFilter:
  163. ldr r2, .Outcome
  164. mov r1, #0x2
  165. and r1, r2
  166. cmp r1, #0x0
  167. beq EndFilter
  168. ldr r0, .Damage
  169. ldr r1, [r0, #0x0]
  170. lsr r2, r1, #0x2
  171. sub r1, r2
  172. str r1, [r0, #0x0]
  173.  
  174. SkipFilter:
  175.  
  176. Exit:
  177. ldr r0, .ReturnAddr
  178. bx r0
  179.  
  180.  
  181.  
  182. .align 2
  183. .TypeChart: .word 0x08C8F110
  184. .BattleStruct: .word 0x02023be4
  185. .AttackerBank: .word 0x02023d6b
  186. .DefenderBank: .word 0x02023d6c
  187. .TargetBank: .word 0x02023d6c
  188. .Outcome: .word 0x02023dcc
  189. .Damage: .word 0x02023d50
  190. .ReturnAddr: .word 0x0801e9d5
  191. .AttackUsed: .word 0x02023d4c
  192. .FreezeDryID: .word 0x000001F6
  193. .FlyingPressID: .word 0x000001F1
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement