Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- .thumb
- .equ offset, 0x08800000
- .equ battle_script, 0x08810000
- .align 2
- .org 0x0801D8D0
- hook:
- ldr r1, place
- bx r1
- .align 2
- place: .word offset + 1
- .align 2
- .org 0x081D6814
- .word battle_script
- .align 2
- .org offset
- main:
- push {r0, lr}
- check_move_id:
- ldr r0, exec_attack
- ldrh r0, [r0]
- mov r1, #0x1 @you might have to add here as well
- cmp r0, r1
- beq bypass_protect
- mov r1, #0x2 @again, you'll probably have to throw in an add as well
- beq stomp_effect
- b return
- stomp_effect:
- ldr r0, attack_effect
- mov r1, #0x8
- strb r1, [r0]
- bypass_protect:
- ldr r0, defending_bank
- ldrb r0, [r0] @which pokemon takes the hit
- mov r1, #0x10 @length of protect structures
- mul r1, r0, r1
- ldr r0, protect_struct
- add r0, r0, r1 @correct position in r0
- ldrb r1, [r0] @takes the protect flag in r1
- lsr r1, r1, #0x1
- lsl r1, r1, #0x1 @clears the flag
- strb r1, [r0] @stores the cleared flag in the correct spot
- return:
- pop {r0}
- ldr r2, protect_struct
- ldr r1, defending_bank
- ldrb r2, [r1]
- lsl r0, r3, #0x4
- pop {pc}
- .align 2
- defending_bank: .word 0x02023D6C
- protect_struct: .word 0x02023E8C
- attack_effect: .word 0x02023E85
- exec_attack: .word 0x02023D4A
- .org battle_script
- .byte 0x1D, 0x1
- .word 0x00001000, 0x081D7D4F
- .byte 0x2B, 0x4
- .word 0x02023DD0, 0x00000200, 0x081D7D4F
- .byte 0x2A, 0x0
- .word 0x02023D4A
- .short 0x0013
- .word 0x081D7D3E
- .byte 0x2A, 0x0
- .word 0x02023D4A
- .short 0x0123
- .word 0x081D7D33
- .byte 0x2A, 0x0
- .word 0x02023D4A
- .short 0x0154
- .word 0x081D7D28
- .byte 0x2A, 0x0
- .word 0x02023D4A
- .short 0x0001
- .word force
- .byte 0x2A, 0x0
- .word 0x02023D4A
- .short 0x0002
- .word force
- .byte 0x2E @setbyte 0x02023FD3 0x5
- .word 0x02023FD3
- .byte 0x5
- .byte 0x28 @goto 0x081D7D44
- .word 0x081D7D44
- force:
- .byte 0x2E @setbyte 0x02023FD3 0x6
- .word 0x02023FD3
- .byte 0x6
- .byte 0x41 @call 0x081D6F58
- .word 0x081D6F58
- .byte 0xC5 @hidepreattack
- .byte 0x28 @goto 0x081D694E
- .word 0x081D694E
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement