Mgamerz

MMBN3 White Enhanced Bosses ASM v0.001

Dec 18th, 2016
108
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. ;Mgamerz Enhanced Enemies Mod v0.001
  2. ;12/17/2016
  3. ;Apply to MMBN3 ENGLISH WHITE version only! Apply with ARMIPS:
  4. ;armips filename.asm
  5.  
  6. input   equ whitevanilla.gba    ; Put the name of your ROM here
  7.  
  8. fspace equ 0x800000; Put the ROM free space offset here
  9.  
  10. .gba
  11. .open input,output.gba,8000000h
  12.  
  13. rngaddress EQU 0x080016a2|1b
  14. timestopchipcall EQU 08008E54h
  15.  
  16. ;Flashman Chips
  17. flashmanchipcount EQU 4h
  18. flashmanChipHookAddress EQU 0x080B6726
  19.  
  20. gutsmanChipHookAddress EQU 0x080B8592
  21. gutsmanZPunchHookAddress EQU 0x080B84C6
  22. gutsmanChipCount EQU 4h
  23. gutsmanZPunchChipCount EQU 3h
  24. gutsmanMovesBeforeZPunch EQU 6h
  25.  
  26. teamfamily EQU 3Fh
  27. areafamily EQU 0h
  28. stagefamily EQU 4h
  29. trumpyfamily EQU 26h
  30. sensorfamily EQU 3Eh
  31. grabbackfamily EQU 15h
  32. mpchipfamily EQU 18h
  33.  
  34. .org 08235156h ;Free Space
  35. .align 2
  36.  
  37. rngRoutine:
  38. ldr r0, =rngaddress
  39. bx r0
  40. pop r15
  41.  
  42. ;===========================FLASH MAN==========================
  43. loadFlashmanRandomChip:
  44. push r14
  45. bl rngRoutine ;GET RNG result AND PUT INTO r0
  46. mov r1, flashmanchipcount ;number of chips in selection list
  47. swi 6; Divide
  48. ldr r0,=@@flashmanChipLookupTable ;Load address of chip lookup table (defined below)
  49. mov r2,0x03 ; Load r2 with 3
  50. mul r1,r2 ;Multiple the remainder result by the size of the structs (3 bytes) - this will provide an offset into the chip lookup table
  51. add r0,r0,r1 ;calculate the address using the offset, store in r0
  52. ldrb r3, [r0,0x02] ;load byte from *r0 (offset 2 forward) into r3 (dmg)
  53. ldrb r1, [r0,0x01] ;load byte from *r0 (offset 1 forward) into r1 (sublevel)
  54. ldrb r0, [r0,0x00] ;load byte from *r0 (direct addr) into r0 (family)
  55. ldrb r2,[r5,16h] ; ...this is actually the object's alliance enemy/allied
  56. pop r15
  57.  
  58. ;Call Chip
  59. ;ldr r6, =timestopchipcall
  60. ;push r14
  61. ;bx r6
  62. ;ldrb r2,[r5,#0x16]
  63. ;pop r15
  64.  
  65. .pool
  66. @@flashmanChipLookupTable:
  67. .byte teamfamily, 0h, 0h
  68. .byte areafamily, 1h, 10h
  69. .byte stagefamily, 4h, 0h
  70. .byte trumpyfamily, 1h, 0h
  71.  
  72. ;-----------------------------GUTS MAN----------------------
  73.  
  74. ;This block is unused right now due to spam issues
  75. ;loadGutsmanRandomChip:
  76. ;push r14
  77. ;bl rngRoutine
  78. ;mov r1, gutsmanchipcount
  79. ;swi 6; Divide
  80. ;ldr r0,=@@gutsmanChipLookupTable ;Load address of chip lookup table (defined below)
  81. ;mov r2,0x03 ; Load r2 with 3
  82. ;mul r1,r2 ;Multiple the remainder result by the size of the structs (3 bytes) - this will provide ;an offset into the chip lookup table
  83. ;add r0,r0,r1 ;calculate the address using the offset, store in r0
  84. ;ldrb r3, [r0,0x02] ;load byte from *r0 (offset 2 forward) into r3 (dmg)
  85. ;ldrb r1, [r0,0x01] ;load byte from *r0 (offset 1 forward) into r1 (sublevel)
  86. ;ldrb r0, [r0,0x00] ;load byte from *r0 (direct addr) into r0 (family)
  87. ;ldrb r2,[r5,16h] ; ...this is actually the object's alliance enemy/allied
  88. ;pop r15
  89.  
  90.  
  91. ;.pool
  92. ;@@gutsmanChipLookupTable:
  93. ;.byte teamfamily, 0h, 0h
  94. ;.byte areafamily, 1h, 10h
  95. ;.byte stagefamily, 4h, 0h
  96. ;.byte trumpyfamily, 1h, 0h
  97.  
  98. loadZPunchRandomChip:
  99. push r14
  100. bl rngRoutine
  101. mov r1, gutsmanZPunchChipCount
  102. swi 6; Divide
  103. ldr r0,=@@gutsmanZPunchLookupTable ;Load address of chip lookup table (defined below)
  104. mov r2,0x03 ; Load r2 with 3
  105. mul r1,r2 ;Multiple the remainder result by the size of the structs (3 bytes) - this will provide an offset into the chip lookup table
  106. add r0,r0,r1 ;calculate the address using the offset, store in r0
  107. ldrb r3, [r0,0x02] ;load byte from *r0 (offset 2 forward) into r3 (dmg)
  108. ldrb r1, [r0,0x01] ;load byte from *r0 (offset 1 forward) into r1 (sublevel)
  109. ldrb r0, [r0,0x00] ;load byte from *r0 (direct addr) into r0 (family)
  110. ldrb r2,[r5,16h] ; ...this is actually the object's alliance enemy/allied
  111. pop r15
  112.  
  113. .pool
  114. @@gutsmanZPunchLookupTable:
  115. ;.byte teamfamily, 0h, 0h
  116. ;.byte areafamily, 1h, 10h
  117. ;.byte stagefamily, 4h, 0h
  118. .byte trumpyfamily, 2h, 0h
  119. .byte sensorfamily, 2h, 100h
  120. .byte mpchipfamily, 2h, 0h
  121.  
  122.  
  123. ;==================HOOKS================
  124. .org flashmanChipHookAddress
  125.  
  126. flashmanChipHook:
  127. ;push r14
  128. bl loadFlashmanRandomChip
  129. nop
  130.  
  131. ;.org gutsmanChipHookAddress
  132. ;gutsmanAreaGrabChipHook:
  133. ;bl loadGutsmanRandomChip
  134. ;nop
  135.  
  136. .org gutsmanZPunchHookAddress
  137. bl loadZPunchRandomChip ;Hook z-punch chip and use my routine instead
  138. ;nop
  139.  
  140. ;=================PATCHES===============
  141.  
  142.  
  143. ;--------------GUTSMAN PATCHES----------
  144. .org 0x080B7DF0 ;gutsman set move counter here to 0xFF so this attack no longer comes up
  145. mov r0, #0x0 ;reset to 0 instead of past
  146.  
  147. .org 0x080b7de8 ;gutsmans checks if his move count is same as this in order to activate Z-Punch
  148. cmp r0, gutsmanMovesBeforeZPunch
  149.  
  150. .org 0x080b7dcc ;gutsman checks this value and if his hp is less he can use zpunch. by default it is division by 2 by shifting to the right by 1.
  151. add r1, r1, 1 ;add 1 HP so its one over the max. Can use zpunch anytime now
  152.  
  153. .org 0x080b8590 ;gutsmans areagrab response chip
  154. mov r0, grabbackfamily
  155. mov r1, 0x1 ;grabrevenge sublevel
  156. ldrb r2,[r5,#0x16]
  157. mov r3,#0x32 ;50 damage per hit
  158.  
  159. ;.org 0x080ae6a4 ;gutsman beta AI - delay after shockwave
  160. ;.byte 0x64 ;contact damage
  161.  
  162.  
  163. .close
  164.  ; eof
Advertisement
Add Comment
Please, Sign In to add comment