Difference between revisions of "Calculate MP% damage"
Jump to navigation
Jump to search
m (infos update) |
|||
Line 1: | Line 1: | ||
− | + | No Parameters - Returns Nothing | |
− | 0018668c: 3c028019 lui r2,0x8019 | + | Set Target Current Action (TCA) MP damage = Target Max MP * Ability Y% |
− | 00186690: 8c422d98 lw r2,0x2d98(r2) | + | Set TCA attack Type = MP damage |
− | 00186694: 00000000 nop | + | ---------------------------------------------------------------------------------------------- |
− | 00186698: 9443002e lhu r3,0x002e(r2) | + | 0018668c: 3c028019 lui r2,0x8019 | |
− | 0018669c: 3c028019 lui r2,0x8019 | + | 00186690: 8c422d98 lw r2,0x2d98(r2) |{{f/adr|<nowiki>r2 = Target data pointer</nowiki>}} |
− | 001866a0: 904238fa lbu r2,0x38fa(r2) | + | 00186694: 00000000 nop | |
− | 001866a4: 00000000 nop | + | 00186698: 9443002e lhu r3,0x002e(r2) |{{f/load|<nowiki>r3 = Target max Mp</nowiki>}} |
− | 001866a8: 00620018 mult r3,r2 | + | 0018669c: 3c028019 lui r2,0x8019 | |
− | 001866ac: 3c0351eb lui r3,0x51eb | + | 001866a0: 904238fa lbu r2,0x38fa(r2) |{{f/load|<nowiki>r2 = Current Ability used Ability Y</nowiki>}} {{f/std| 0x801938fa / 801938fa}} |
− | 001866b0: 00001012 mflo r2 | + | 001866a4: 00000000 nop | |
− | 001866b4: 3463851f ori r3,r3,0x851f | + | 001866a8: 00620018 mult r3,r2 |{{f/std|Max MP * Y}} {{f/std|max MP*Y}} |
− | 001866b8: 24420063 addiu r2,r2,0x0063 | + | 001866ac: 3c0351eb lui r3,0x51eb | |
− | 001866bc: 00430018 mult r2,r3 | + | 001866b0: 00001012 mflo r2 |{{f/std|<nowiki>r2 = Target's Max MP * Ability Y</nowiki>}} |
− | 001866c0: 27bdfff8 addiu r29,r29, | + | 001866b4: 3463851f ori r3,r3,0x851f |{{f/std|<nowiki>r3 = 0x51eb851f (0,32 * 2^32)</nowiki>}} |
− | 001866c4: 3c038019 lui r3,0x8019 | + | 001866b8: 24420063 addiu r2,r2,0x0063 |{{f/std|<nowiki>r2 = Target's Max MP * Ability Y + 99 ( to round up the result/100)</nowiki>}} |
− | 001866c8: 8c632d90 lw r3,0x2d90(r3) | + | 001866bc: 00430018 mult r2,r3 |{{f/std|<nowiki>r2 = Max MP * Ability Y * 0,32*2^32</nowiki>}} |
− | 001866cc: 34020020 ori r2,r0,0x0020 | + | 001866c0: 27bdfff8 addiu r29,r29,-0x0008 | |
− | 001866d0: a0620025 sb r2,0x0025(r3) | + | 001866c4: 3c038019 lui r3,0x8019 | |
− | 001866d4: 00001010 mfhi r2 | + | 001866c8: 8c632d90 lw r3,0x2d90(r3) |{{f/adr|<nowiki>r3 = Target Current Action (TCA) data pointer</nowiki>}} |
− | 001866d8: 00021143 sra r2,r2,0x05 | + | 001866cc: 34020020 ori r2,r0,0x0020 |{{f/std|<nowiki>r2 = 0x20 (MP damage attack type)</nowiki>}} |
− | 001866dc: a4620008 sh r2,0x0008(r3) | + | 001866d0: a0620025 sb r2,0x0025(r3) |{{f/store|Set TCA Action type to MP damage (disables other flags)}} |
− | 001866e0: 27bd0008 addiu r29,r29,0x0008 | + | 001866d4: 00001010 mfhi r2 |{{f/std|<nowiki>r2 = Target Max MP * Ability Y * 32 /100</nowiki>}} |
− | 001866e4: 03e00008 jr r31 | + | 001866d8: 00021143 sra r2,r2,0x05 |{{f/std|<nowiki>r2 = Target Max MP * Ability Y /100 (r2/32)</nowiki>}} |
− | 001866e8: 00000000 nop | + | 001866dc: a4620008 sh r2,0x0008(r3) |{{f/store|Set TCA MP damage to Max MP * Y%}} |
− | + | 001866e0: 27bd0008 addiu r29,r29,0x0008 | | |
− | + | 001866e4: 03e00008 jr r31 | | |
− | + | 001866e8: 00000000 nop | | |
− | 001890b4: [[0F_AbsMP_(Y)%25_Hit_F(MA%2BX)%25|Formula | + | === Return locations === |
+ | '''Battle.bin''' | ||
+ | 001890b4: [[0F_AbsMP_(Y)%25_Hit_F(MA%2BX)%25|Formula 0f : AbsMP (Y)% Hit F(MA+X)%]] | ||
+ | 0018936c: [[1B_DmgMP_(MA%2BY)%25_Hit_F(X)%25|Formula 1b : DmgMP (MA+Y)% Hit F(X)%]] | ||
+ | 00189b10: [[2C_DmgMP_(X)%25_Hit_(PA%2BY)%25|Formula 2c : DmgMP (X)% Hit (PA+Y)%]] |
Revision as of 19:20, 16 April 2022
No Parameters - Returns Nothing Set Target Current Action (TCA) MP damage = Target Max MP * Ability Y% Set TCA attack Type = MP damage ---------------------------------------------------------------------------------------------- 0018668c: 3c028019 lui r2,0x8019 | 00186690: 8c422d98 lw r2,0x2d98(r2) |r2 = Target data pointer 00186694: 00000000 nop | 00186698: 9443002e lhu r3,0x002e(r2) |r3 = Target max Mp 0018669c: 3c028019 lui r2,0x8019 | 001866a0: 904238fa lbu r2,0x38fa(r2) |r2 = Current Ability used Ability Y 0x801938fa / 801938fa 001866a4: 00000000 nop | 001866a8: 00620018 mult r3,r2 |Max MP * Y max MP*Y 001866ac: 3c0351eb lui r3,0x51eb | 001866b0: 00001012 mflo r2 |r2 = Target's Max MP * Ability Y 001866b4: 3463851f ori r3,r3,0x851f |r3 = 0x51eb851f (0,32 * 2^32) 001866b8: 24420063 addiu r2,r2,0x0063 |r2 = Target's Max MP * Ability Y + 99 ( to round up the result/100) 001866bc: 00430018 mult r2,r3 |r2 = Max MP * Ability Y * 0,32*2^32 001866c0: 27bdfff8 addiu r29,r29,-0x0008 | 001866c4: 3c038019 lui r3,0x8019 | 001866c8: 8c632d90 lw r3,0x2d90(r3) |r3 = Target Current Action (TCA) data pointer 001866cc: 34020020 ori r2,r0,0x0020 |r2 = 0x20 (MP damage attack type) 001866d0: a0620025 sb r2,0x0025(r3) |Set TCA Action type to MP damage (disables other flags) 001866d4: 00001010 mfhi r2 |r2 = Target Max MP * Ability Y * 32 /100 001866d8: 00021143 sra r2,r2,0x05 |r2 = Target Max MP * Ability Y /100 (r2/32) 001866dc: a4620008 sh r2,0x0008(r3) |Set TCA MP damage to Max MP * Y% 001866e0: 27bd0008 addiu r29,r29,0x0008 | 001866e4: 03e00008 jr r31 | 001866e8: 00000000 nop |
Return locations
Battle.bin 001890b4: Formula 0f : AbsMP (Y)% Hit F(MA+X)% 0018936c: Formula 1b : DmgMP (MA+Y)% Hit F(X)% 00189b10: Formula 2c : DmgMP (X)% Hit (PA+Y)%