kearnseyboy6

Aussie's Toughest Mudder

Seen June 22nd, 2019
Posted November 19th, 2016
300 posts
10.8 Years
Payback (FireRed):
Spoiler:

Insert this ASM somewhere:
.text
.align 2
.thumb
.thumb_func
.global test

main:
push {lr}
ldr r0, .TargetBank
ldrb r0, [r0, #0x0]
ldr r1, .BattleStruct
mov r2, #0x58
mul r0, r2
add r5, r0, r1

OrderCheck:
ldr r0, .TargetBank
ldr r1, .UserBank
ldrb r4, [r0, #0x0] /*put target bank into R4*/
ldrb r5, [r1, #0x0] /*put user bank into R5*/
ldr r1, .TurnOrder /*put turn order offset into R1*/

Loop:
ldrb r2, [r1, #0x0] 	/*put attacking PKMN into r2*/
cmp r2, r4 		/*is the attacking PKMN the target?*/
beq SuperAttack 	/*if so, prepare double damage*/
cmp r2, r5 		/*is the attacking PKMN the user?*/
beq Attack		/*if so, attack*/
add r1, #0x1		/*move on to next attacking PKMN*/
b Loop

SuperAttack:
mov r1, #0x2
ldr r0, .DamageMultiplier
strb r1, [r0, #0x0]

Attack:
End:
pop {r0}
bx r0

.align 2

.UserBank: .word 0x02023D6B
.TargetBank: .word 0x02023D6C
.BattleStruct: .word 0x02023BE4
.BasePower: .word 0x02023F50
.TurnOrder: .word 0x02023bde
.DamageMultiplier: .word 0x02023FD2
Use this battle script:
#org @main
callasm 0x8(offset that you inserted the ASM + 1)
goto 0x81D6900
Payback animation (it's just Counter with the Dark BG):
14 00 17 00 97 27 00 9F 27 0A 03 0C 0C 08 03 7D 90 09 08 02 05 00 00 12 00 06 00 01 00 04 00 19 73 00 C0 05 02 9C 4E 3D 08 02 05 00 00 14 00 00 00 00 00 04 00 04 04 02 08 7C 3E 08 02 04 F1 FF 12 00 01 00 00 00 19 74 00 3F 04 01 03 F9 89 09 08 02 05 01 00 05 00 00 00 19 00 01 00 02 10 67 3E 08 03 05 F1 FF 12 00 08 00 01 00 00 00 04 03 02 08 7C 3E 08 02 04 00 00 FC FF 01 00 00 00 19 74 00 3F 04 01 02 10 67 3E 08 03 05 00 00 FC FF 08 00 01 00 00 00 04 03 02 08 7C 3E 08 02 04 0F 00 09 00 01 00 00 00 19 74 00 3F 04 01 02 10 67 3E 08 03 05 0F 00 09 00 08 00 01 00 00 00 04 05 02 84 4E 3D 08 02 03 00 00 00 00 05 00 05 0B 03 0D 0E C7 59 1D 08 08
Credit to DoesntKnowHowToPlay because I modified his Sucker Punch ASM for this.


Trump Card (FireRed):
Spoiler:
First, insert this ASM somewhere:
.text
.align 2
.thumb
.thumb_func
.global test

main:
push {lr}
ldr r0, .UserBank 	/*get user slot*/
ldrb r0, [r0, #0x0]
ldr r1, .BattleData	/*load battle struct*/
mov r2, #0x58		/*separate into 4*/
mul r0, r2		/*get beginning of user stats*/
add r5, r0, r1		/*R5 should now have user's offset*/

GetWhichSlot:
mov r0, #0xBC		/*make sure this is your Trump Card move ID divided by 2*/
lsl r0, r0, #0x1	/*r0 should now have Trump Card ID*/
add r5, #0xC		/*check slot 1 move ID*/
ldrh r1, [r5]
cmp r0, r1
beq ver1
add r5, #0x2		/*check slot 2 move ID*/
ldrh r1, [r5]
cmp r0, r1
beq ver2
add r5, #0x2		/*check slot 3 move ID*/
ldrh r1, [r5]
cmp r0, r1
beq ver3
add r5, #0x2		/*check slot 4 move ID*/
ldrh r1, [r5]
cmp r0, r1
beq ver4

ver1:
add r5, #0x18
ldrb r0, [r5]		/*r0 should now have how much PP is left*/
b getPP

ver2:
add r5, #0x17
ldrb r0, [r5]		/*r0 should now have how much PP is left*/
b getPP

ver3:
add r5, #0x16
ldrb r0, [r5]		/*r0 should now have how much PP is left*/
b getPP

ver4:
add r5, #0x15
ldrb r0, [r5]		/*r0 should now have how much PP is left*/
b getPP

getPP:
cmp r0, #0x4
bgt FourOrMore
cmp r0, #0x4
beq FourOrMore
cmp r0, #0x3
beq Three
cmp r0, #0x2
beq Two
cmp r0, #0x1
beq One
cmp r0, #0x0
beq Zero

FourOrMore:
mov r0, #0x28
b StorePower

Three:
mov r0, #0x32
b StorePower

Two:
mov r0, #0x3C
b StorePower

One:
mov r0, #0x50
b StorePower

Zero:
mov r0, #0xC8
b StorePower

StorePower:
ldr r1, .BasePower
strb r0, [r1]

End:
pop {r0}
bx r0

.align 2
.BattleData:		.word 0x02023BE4
.UserBank:		.word 0x02023D6B
.BasePower:		.word 0x02023F50
If your Trump Card move ID isn't 0x178, then change the bolded line to your Trump Card move ID divided by 2.

The Battle Script ID has to be 17 (Swift/Feint Attack/attacks that never miss), otherwise it won't work properly. Replace the script with this:
#org @main
jumpifhalfword 0x0 0x2023D4A 0x178 @new
jumpifhalfword 0x1 0x2023D4A 0x39 0x81D6926
jumpifspecialstatusflag 0x0 0x40000 0x1 0x81D6926
orword 0x2023DD0 0x40000
setbyte 0x2023FD2 0x2

#org @new
attackcanceler
accuracycheck 0x81D695E 0x0
attackstring
ppreduce
callasm 0x8(offset of Trump Card ASM routine +1)
calculatedamage
attackanimation
waitanimation
missmessage
cmd5c 0x0
waitstate
graphicalhpupdate 0x0
datahpupdate 0x0
critmessage
waitmessage 0x40
resultmessage
waitmessage 0x40
seteffectwithchancetarget
faintpokemon 0x0 0x0 0x0
setbyte 0x2023FD8 0x0
cmd49 0x0 0x0
end


EDIT: Also here's my really lame Trump Card particle, for Trump Card I just used Swift's animation but with this particle instead:
My compiler doesn't recognise callasm. Which cmd do I need to update?

Actually my whole command.bsh is empty and everytime I redownload it is empty as well. Can someone please share it?
HOLIDAYING CURRENTLY!!