Difference between revisions of "Set EXP Stolen"
Jump to navigation
Jump to search
m |
|||
(One intermediate revision by the same user not shown) | |||
Line 1: | Line 1: | ||
− | + | No Parameters - Returns Nothing | |
− | 00186814: 3c028019 lui r2,0x8019 | + | Calculate Stolen Xp = Attacker's Speed + Ability Y |
− | 00186818: 8c422d94 lw r2,0x2d94(r2) | + | - Stolen Xp is Capped at 100 |
− | 0018681c: 3c038019 lui r3,0x8019 | + | - Stolen Xp is Capped at Target Current Xp (no loss of Lv - This make the first cap useless no ?) |
− | 00186820: 906338fa lbu r3,0x38fa(r3) | + | |
− | 00186824: 27bdffe8 addiu r29,r29, | + | If Stolen Xp > 0 |
− | 00186828: afbf0010 sw r31,0x0010(r29) | + | - Set Both Action type as pseudo status (disable other flags) |
− | 0018682c: 90420038 lbu r2,0x0038(r2) | + | - Set Attacker Action 0x28 = Stolen Xp and Hit flag to HIT |
− | 00186830: 00000000 nop | + | - Set Target Action 0x28 = Stolen Xp + 0x80 flag ON (Malus probably) |
− | 00186834: 00431021 addu r2,r2,r3 | + | -------------------------------------------------------------------------------------------- |
− | 00186838: 00402821 addu r5,r2,r0 | + | 00186814: 3c028019 lui r2,0x8019 | |
− | 0018683c: 30a200ff andi r2,r5,0x00ff | + | 00186818: 8c422d94 lw r2,0x2d94(r2) |{{f/adr|<nowiki>r2 = Attacker data pointer</nowiki>}} |
− | 00186840: 2c420065 sltiu r2,r2,0x0065 | + | 0018681c: 3c038019 lui r3,0x8019 | |
− | 00186844: 14400002 bne r2,r0,0x00186850 | + | 00186820: 906338fa lbu r3,0x38fa(r3) |{{f/load|<nowiki>r3 = Current Ability used Ability Y</nowiki>}} |
− | 00186848: 00000000 nop | + | 00186824: 27bdffe8 addiu r29,r29,-0x0018 | |
− | 0018684c: 34050064 ori r5,r0,0x0064 | + | 00186828: afbf0010 sw r31,0x0010(r29) | |
− | 00186850: 3c028019 lui r2,0x8019 | + | 0018682c: 90420038 lbu r2,0x0038(r2) |{{f/load|<nowiki>r2 = Attacker's Speed</nowiki>}} |
− | 00186854: 8c422d98 lw r2,0x2d98(r2) | + | 00186830: 00000000 nop | |
− | 00186858: 00000000 nop | + | 00186834: 00431021 addu r2,r2,r3 |{{f/std|<nowiki>r2 = Speed + Ability Y</nowiki>}} |
− | 0018685c: 90430021 lbu r3,0x0021(r2) | + | 00186838: 00402821 addu r5,r2,r0 |{{f/std|<nowiki>r5 = Speed + Ability Y</nowiki>}} |
− | 00186860: 30a200ff andi r2,r5,0x00ff | + | 0018683c: 30a200ff andi r2,r5,0x00ff |{{f/std|<nowiki>r2 = Stolen Xp (Speed + Ability Y (byte only))</nowiki>}} |
− | 00186864: 0062102b sltu r2,r3,r2 | + | 00186840: 2c420065 sltiu r2,r2,0x0065 |{{f/std|<nowiki>r2 = 0x01 If Stolen Xp <= 100</nowiki>}} |
− | 00186868: 10400003 beq r2,r0,0x00186878 | + | 00186844: 14400002 bne r2,r0,0x00186850 {{f/Cond|If Stolen Xp > 100}} |
− | 0018686c: 30a200ff andi r2,r5,0x00ff | + | 00186848: 00000000 nop | |
− | 00186870: 00602821 addu r5,r3,r0 | + | 0018684c: 34050064 ori r5,r0,0x0064 |{{f/std|<nowiki>r5 = 0x64 (Stolen Xp capped to 100)</nowiki>}} |
− | 00186874: 30a200ff andi r2,r5,0x00ff | + | 00186850: 3c028019 lui r2,0x8019 | |
− | 00186878: 14400005 bne r2,r0,0x00186890 | + | 00186854: 8c422d98 lw r2,0x2d98(r2) |{{f/adr|<nowiki>r2 = Target data pointer</nowiki>}} |
− | 0018687c: 34030001 ori r3,r0,0x0001 | + | 00186858: 00000000 nop | |
− | 00186880: 0c0610c3 jal 0x0018430c | + | 0018685c: 90430021 lbu r3,0x0021(r2) |{{f/load|<nowiki>r3 = Target's Xp</nowiki>}} |
− | 00186884: 00000000 nop | + | 00186860: 30a200ff andi r2,r5,0x00ff |{{f/std|<nowiki>r2 = Stolen Xp (Capped)</nowiki>}} |
− | 00186888: 08061a38 j 0x001868e0 | + | 00186864: 0062102b sltu r2,r3,r2 |{{f/std|<nowiki>r2 = 0x01 If Stolen Xp > Target Xp</nowiki>}} |
− | 0018688c: 00000000 nop | + | 00186868: 10400003 beq r2,r0,0x00186878 {{f/Cond|If Stolen Xp > Target Xp}} |
− | 00186890: 3c028019 lui r2,0x8019 | + | 0018686c: 30a200ff andi r2,r5,0x00ff |{{f/std|<nowiki>r2 = Stolen Xp (Capped)</nowiki>}} |
− | 00186894: 8c422d8c lw r2,0x2d8c(r2) | + | 00186870: 00602821 addu r5,r3,r0 |{{f/std|<nowiki>r5 = Target Xp</nowiki>}} |
− | 00186898: 00000000 nop | + | 00186874: 30a200ff andi r2,r5,0x00ff |{{f/std|<nowiki>r2 = Stolen Xp (byte capped at Target Xp)</nowiki>}} |
− | 0018689c: a0450028 sb r5,0x0028(r2) | + | 00186878: 14400005 bne r2,r0,0x00186890 {{f/Cond|<nowiki>If Stolen Xp = 0x00</nowiki>}} |
− | 001868a0: 3c028019 lui r2,0x8019 | + | 0018687c: 34030001 ori r3,r0,0x0001 |{{f/std|<nowiki>r3 = 0x01</nowiki>}} |
− | 001868a4: 8c422d8c lw r2,0x2d8c(r2) | + | 00186880: 0c0610c3 jal 0x0018430c |{{f/jal|Force_Attack_Miss|Force_Attack_Miss}} {{f/std|<nowiki>Hit Flag = Miss Hit% = 0 - Evade type = 0x07</nowiki>}} |
− | 001868a8: 00000000 nop | + | 00186884: 00000000 nop | |
− | 001868ac: a0430000 sb r3,0x0000(r2) | + | 00186888: 08061a38 j 0x001868e0 {{f/jump|jump to }} {{f/loc|END}} |
− | 001868b0: 3c028019 lui r2,0x8019 | + | 0018688c: 00000000 nop | |
− | 001868b4: 8c422d8c lw r2,0x2d8c(r2) | + | 00186890: 3c028019 lui r2,0x8019 {{f/Cond|Else : Stolen Xp > 0x00}} |
− | 001868b8: 00000000 nop | + | 00186894: 8c422d8c lw r2,0x2d8c(r2) |{{f/adr|<nowiki>r2 = Attacker Current Action (ACA) Data Pointer</nowiki>}} |
− | 001868bc: a0430025 sb r3,0x0025(r2) | + | 00186898: 00000000 nop | |
− | 001868c0: 3c048019 lui r4,0x8019 | + | 0018689c: a0450028 sb r5,0x0028(r2) |{{f/store|<nowiki>Set ACA Xp Gain = Stolen Xp</nowiki>}} |
− | 001868c4: 8c842d90 lw r4,0x2d90(r4) | + | 001868a0: 3c028019 lui r2,0x8019 | |
− | 001868c8: 24a20080 addiu r2,r5,0x0080 | + | 001868a4: 8c422d8c lw r2,0x2d8c(r2) |{{f/adr|<nowiki>r2 = ACA Data Pointer</nowiki>}} |
− | 001868cc: a0820028 sb r2,0x0028(r4) | + | 001868a8: 00000000 nop | |
− | 001868d0: 3c028019 lui r2,0x8019 | + | 001868ac: a0430000 sb r3,0x0000(r2) |{{f/store|Set ACA hit flag to HIT}} |
− | 001868d4: 8c422d90 lw r2,0x2d90(r2) | + | 001868b0: 3c028019 lui r2,0x8019 | |
− | 001868d8: 00000000 nop | + | 001868b4: 8c422d8c lw r2,0x2d8c(r2) |{{f/adr|<nowiki>r2 = ACA Data Pointer</nowiki>}} |
− | 001868dc: a0430025 sb r3,0x0025(r2) | + | 001868b8: 00000000 nop | |
− | 001868e0: 8fbf0010 lw r31,0x0010(r29) | + | 001868bc: a0430025 sb r3,0x0025(r2) |{{f/store|Set ACA attack type to pseudo status change}} {{f/std|disables other flags}} |
− | 001868e4: 27bd0018 addiu r29,r29,0x0018 | + | 001868c0: 3c048019 lui r4,0x8019 | |
+ | 001868c4: 8c842d90 lw r4,0x2d90(r4) |{{f/adr|<nowiki>r4 = Target Current Action (TCA) data pointer</nowiki>}} | ||
+ | 001868c8: 24a20080 addiu r2,r5,0x0080 |{{f/std|<nowiki>r2 = Capped Stolen Xp (<0x64) + 0x80 (Malus flag probably)</nowiki>}} | ||
+ | 001868cc: a0820028 sb r2,0x0028(r4) |{{f/store|<nowiki>Set TCA Xp loss = Stolen Xp</nowiki>}} | ||
+ | 001868d0: 3c028019 lui r2,0x8019 | | ||
+ | 001868d4: 8c422d90 lw r2,0x2d90(r2) |{{f/adr|<nowiki>r4 = Target Current Action (TCA) data pointer</nowiki>}} | ||
+ | 001868d8: 00000000 nop | | ||
+ | 001868dc: a0430025 sb r3,0x0025(r2) |{{f/store|Set TCA attack type to pseudo status change}} {{f/std|disables other flags}} | ||
+ | 001868e0: 8fbf0010 lw r31,0x0010(r29) | ||
+ | 001868e4: 27bd0018 addiu r29,r29,0x0018 | ||
001868e8: 03e00008 jr r31 | 001868e8: 03e00008 jr r31 | ||
001868ec: 00000000 nop | 001868ec: 00000000 nop | ||
− | + | === Return locations === | |
+ | '''Battle.bin''' | ||
+ | 00189900: [[28_StealExp_(Lowest_of_TarCurExp_%26_SP%2BY)_Hit_(SP%2BX)%25]] |
Latest revision as of 20:11, 22 April 2022
No Parameters - Returns Nothing Calculate Stolen Xp = Attacker's Speed + Ability Y - Stolen Xp is Capped at 100 - Stolen Xp is Capped at Target Current Xp (no loss of Lv - This make the first cap useless no ?) If Stolen Xp > 0 - Set Both Action type as pseudo status (disable other flags) - Set Attacker Action 0x28 = Stolen Xp and Hit flag to HIT - Set Target Action 0x28 = Stolen Xp + 0x80 flag ON (Malus probably) -------------------------------------------------------------------------------------------- 00186814: 3c028019 lui r2,0x8019 | 00186818: 8c422d94 lw r2,0x2d94(r2) |r2 = Attacker data pointer 0018681c: 3c038019 lui r3,0x8019 | 00186820: 906338fa lbu r3,0x38fa(r3) |r3 = Current Ability used Ability Y 00186824: 27bdffe8 addiu r29,r29,-0x0018 | 00186828: afbf0010 sw r31,0x0010(r29) | 0018682c: 90420038 lbu r2,0x0038(r2) |r2 = Attacker's Speed 00186830: 00000000 nop | 00186834: 00431021 addu r2,r2,r3 |r2 = Speed + Ability Y 00186838: 00402821 addu r5,r2,r0 |r5 = Speed + Ability Y 0018683c: 30a200ff andi r2,r5,0x00ff |r2 = Stolen Xp (Speed + Ability Y (byte only)) 00186840: 2c420065 sltiu r2,r2,0x0065 |r2 = 0x01 If Stolen Xp <= 100 00186844: 14400002 bne r2,r0,0x00186850 #If Stolen Xp > 100 00186848: 00000000 nop | 0018684c: 34050064 ori r5,r0,0x0064 |r5 = 0x64 (Stolen Xp capped to 100) 00186850: 3c028019 lui r2,0x8019 | 00186854: 8c422d98 lw r2,0x2d98(r2) |r2 = Target data pointer 00186858: 00000000 nop | 0018685c: 90430021 lbu r3,0x0021(r2) |r3 = Target's Xp 00186860: 30a200ff andi r2,r5,0x00ff |r2 = Stolen Xp (Capped) 00186864: 0062102b sltu r2,r3,r2 |r2 = 0x01 If Stolen Xp > Target Xp 00186868: 10400003 beq r2,r0,0x00186878 #If Stolen Xp > Target Xp 0018686c: 30a200ff andi r2,r5,0x00ff |r2 = Stolen Xp (Capped) 00186870: 00602821 addu r5,r3,r0 |r5 = Target Xp 00186874: 30a200ff andi r2,r5,0x00ff |r2 = Stolen Xp (byte capped at Target Xp) 00186878: 14400005 bne r2,r0,0x00186890 #If Stolen Xp = 0x00 0018687c: 34030001 ori r3,r0,0x0001 |r3 = 0x01 00186880: 0c0610c3 jal 0x0018430c |-->Force_Attack_Miss Hit Flag = Miss Hit% = 0 - Evade type = 0x07 00186884: 00000000 nop | 00186888: 08061a38 j 0x001868e0 >>jump to END 0018688c: 00000000 nop | 00186890: 3c028019 lui r2,0x8019 #Else : Stolen Xp > 0x00 00186894: 8c422d8c lw r2,0x2d8c(r2) |r2 = Attacker Current Action (ACA) Data Pointer 00186898: 00000000 nop | 0018689c: a0450028 sb r5,0x0028(r2) |Set ACA Xp Gain = Stolen Xp 001868a0: 3c028019 lui r2,0x8019 | 001868a4: 8c422d8c lw r2,0x2d8c(r2) |r2 = ACA Data Pointer 001868a8: 00000000 nop | 001868ac: a0430000 sb r3,0x0000(r2) |Set ACA hit flag to HIT 001868b0: 3c028019 lui r2,0x8019 | 001868b4: 8c422d8c lw r2,0x2d8c(r2) |r2 = ACA Data Pointer 001868b8: 00000000 nop | 001868bc: a0430025 sb r3,0x0025(r2) |Set ACA attack type to pseudo status change disables other flags 001868c0: 3c048019 lui r4,0x8019 | 001868c4: 8c842d90 lw r4,0x2d90(r4) |r4 = Target Current Action (TCA) data pointer 001868c8: 24a20080 addiu r2,r5,0x0080 |r2 = Capped Stolen Xp (<0x64) + 0x80 (Malus flag probably) 001868cc: a0820028 sb r2,0x0028(r4) |Set TCA Xp loss = Stolen Xp 001868d0: 3c028019 lui r2,0x8019 | 001868d4: 8c422d90 lw r2,0x2d90(r2) |r4 = Target Current Action (TCA) data pointer 001868d8: 00000000 nop | 001868dc: a0430025 sb r3,0x0025(r2) |Set TCA attack type to pseudo status change disables other flags 001868e0: 8fbf0010 lw r31,0x0010(r29) 001868e4: 27bd0018 addiu r29,r29,0x0018 001868e8: 03e00008 jr r31 001868ec: 00000000 nop
Return locations
Battle.bin 00189900: 28_StealExp_(Lowest_of_TarCurExp_&_SP+Y)_Hit_(SP+X)%