Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ;Mgamerz Enhanced Enemies Mod v0.001
- ;12/17/2016
- ;Apply to MMBN3 ENGLISH WHITE version only! Apply with ARMIPS:
- ;armips filename.asm
- input equ whitevanilla.gba ; Put the name of your ROM here
- fspace equ 0x800000; Put the ROM free space offset here
- .gba
- .open input,output.gba,8000000h
- rngaddress EQU 0x080016a2|1b
- timestopchipcall EQU 08008E54h
- ;Flashman Chips
- flashmanchipcount EQU 4h
- flashmanChipHookAddress EQU 0x080B6726
- gutsmanChipHookAddress EQU 0x080B8592
- gutsmanZPunchHookAddress EQU 0x080B84C6
- gutsmanChipCount EQU 4h
- gutsmanZPunchChipCount EQU 3h
- gutsmanMovesBeforeZPunch EQU 6h
- teamfamily EQU 3Fh
- areafamily EQU 0h
- stagefamily EQU 4h
- trumpyfamily EQU 26h
- sensorfamily EQU 3Eh
- grabbackfamily EQU 15h
- mpchipfamily EQU 18h
- .org 08235156h ;Free Space
- .align 2
- rngRoutine:
- ldr r0, =rngaddress
- bx r0
- pop r15
- ;===========================FLASH MAN==========================
- loadFlashmanRandomChip:
- push r14
- bl rngRoutine ;GET RNG result AND PUT INTO r0
- mov r1, flashmanchipcount ;number of chips in selection list
- swi 6; Divide
- ldr r0,=@@flashmanChipLookupTable ;Load address of chip lookup table (defined below)
- mov r2,0x03 ; Load r2 with 3
- 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
- add r0,r0,r1 ;calculate the address using the offset, store in r0
- ldrb r3, [r0,0x02] ;load byte from *r0 (offset 2 forward) into r3 (dmg)
- ldrb r1, [r0,0x01] ;load byte from *r0 (offset 1 forward) into r1 (sublevel)
- ldrb r0, [r0,0x00] ;load byte from *r0 (direct addr) into r0 (family)
- ldrb r2,[r5,16h] ; ...this is actually the object's alliance enemy/allied
- pop r15
- ;Call Chip
- ;ldr r6, =timestopchipcall
- ;push r14
- ;bx r6
- ;ldrb r2,[r5,#0x16]
- ;pop r15
- .pool
- @@flashmanChipLookupTable:
- .byte teamfamily, 0h, 0h
- .byte areafamily, 1h, 10h
- .byte stagefamily, 4h, 0h
- .byte trumpyfamily, 1h, 0h
- ;-----------------------------GUTS MAN----------------------
- ;This block is unused right now due to spam issues
- ;loadGutsmanRandomChip:
- ;push r14
- ;bl rngRoutine
- ;mov r1, gutsmanchipcount
- ;swi 6; Divide
- ;ldr r0,=@@gutsmanChipLookupTable ;Load address of chip lookup table (defined below)
- ;mov r2,0x03 ; Load r2 with 3
- ;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
- ;add r0,r0,r1 ;calculate the address using the offset, store in r0
- ;ldrb r3, [r0,0x02] ;load byte from *r0 (offset 2 forward) into r3 (dmg)
- ;ldrb r1, [r0,0x01] ;load byte from *r0 (offset 1 forward) into r1 (sublevel)
- ;ldrb r0, [r0,0x00] ;load byte from *r0 (direct addr) into r0 (family)
- ;ldrb r2,[r5,16h] ; ...this is actually the object's alliance enemy/allied
- ;pop r15
- ;.pool
- ;@@gutsmanChipLookupTable:
- ;.byte teamfamily, 0h, 0h
- ;.byte areafamily, 1h, 10h
- ;.byte stagefamily, 4h, 0h
- ;.byte trumpyfamily, 1h, 0h
- loadZPunchRandomChip:
- push r14
- bl rngRoutine
- mov r1, gutsmanZPunchChipCount
- swi 6; Divide
- ldr r0,=@@gutsmanZPunchLookupTable ;Load address of chip lookup table (defined below)
- mov r2,0x03 ; Load r2 with 3
- 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
- add r0,r0,r1 ;calculate the address using the offset, store in r0
- ldrb r3, [r0,0x02] ;load byte from *r0 (offset 2 forward) into r3 (dmg)
- ldrb r1, [r0,0x01] ;load byte from *r0 (offset 1 forward) into r1 (sublevel)
- ldrb r0, [r0,0x00] ;load byte from *r0 (direct addr) into r0 (family)
- ldrb r2,[r5,16h] ; ...this is actually the object's alliance enemy/allied
- pop r15
- .pool
- @@gutsmanZPunchLookupTable:
- ;.byte teamfamily, 0h, 0h
- ;.byte areafamily, 1h, 10h
- ;.byte stagefamily, 4h, 0h
- .byte trumpyfamily, 2h, 0h
- .byte sensorfamily, 2h, 100h
- .byte mpchipfamily, 2h, 0h
- ;==================HOOKS================
- .org flashmanChipHookAddress
- flashmanChipHook:
- ;push r14
- bl loadFlashmanRandomChip
- nop
- ;.org gutsmanChipHookAddress
- ;gutsmanAreaGrabChipHook:
- ;bl loadGutsmanRandomChip
- ;nop
- .org gutsmanZPunchHookAddress
- bl loadZPunchRandomChip ;Hook z-punch chip and use my routine instead
- ;nop
- ;=================PATCHES===============
- ;--------------GUTSMAN PATCHES----------
- .org 0x080B7DF0 ;gutsman set move counter here to 0xFF so this attack no longer comes up
- mov r0, #0x0 ;reset to 0 instead of past
- .org 0x080b7de8 ;gutsmans checks if his move count is same as this in order to activate Z-Punch
- cmp r0, gutsmanMovesBeforeZPunch
- .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.
- add r1, r1, 1 ;add 1 HP so its one over the max. Can use zpunch anytime now
- .org 0x080b8590 ;gutsmans areagrab response chip
- mov r0, grabbackfamily
- mov r1, 0x1 ;grabrevenge sublevel
- ldrb r2,[r5,#0x16]
- mov r3,#0x32 ;50 damage per hit
- ;.org 0x080ae6a4 ;gutsman beta AI - delay after shockwave
- ;.byte 0x64 ;contact damage
- .close
- ; eof
Advertisement
Add Comment
Please, Sign In to add comment