Magic Gun Ability Decision
Jump to navigation
Jump to search
Magic Gun Ability Decision: 00187730: 27bdffe8 addiu r29,r29,0xffe8 00187734: afb00010 sw r16,0x0010(r29) 00187738: 3c108019 lui r16,0x8019 0018773c: 92103904 lbu r16,0x3904(r16) Load Weapon's Element 00187740: afbf0014 sw r31,0x0014(r29) 00187744: 0c063ba8 jal 0x0018eea0 Random Process 00187748: 00000000 nop 0018774c: 00021840 sll r3,r2,0x01 Random * 2 00187750: 00621821 addu r3,r3,r2 Random * 3 00187754: 000318c0 sll r3,r3,0x03 Random * 24 00187758: 00621821 addu r3,r3,r2 Random * 25 0018775c: 00031880 sll r3,r3,0x02 Random * 100 (or mult r2, r3 with r3 = 64) 00187760: 04610002 bgez r3,0x0018776c Branch if Random is Positive 00187764: 32020080 andi r2,r16,0x0080 00187768: 24637fff addiu r3,r3,0x7fff Random + 7fff 0018776c: 1040000b beq r2,r0,0x0018779c Branch if Weapon doesn't have Fire 00187770: 00031bc2 srl r3,r3,0x0f Random / 8000 (rand 0..99) 00187774: 306400ff andi r4,r3,0x00ff 00187778: 2c82000a sltiu r2,r4,0x000a 0018777c: 10400003 beq r2,r0,0x0018778c Branch if Random > a (90% chance to branch) 00187780: 2c820028 sltiu r2,r4,0x0028 00187784: 08061dfb j 0x001877ec 00187788: 34030012 ori r3,r0,0x0012 r3 = 12 (Firaga, 10% chance ) 0018778c: 10400017 beq r2,r0,0x001877ec Branch if Random > 28 (60% chance to branch) 00187790: 34030010 ori r3,r0,0x0010 r3 = 10 (Fire, 60% chance) 00187794: 08061dfb j 0x001877ec 00187798: 34030011 ori r3,r0,0x0011 r3 = 11 (Fira, 30% chance) 0018779c: 32020040 andi r2,r16,0x0040 001877a0: 1040000a beq r2,r0,0x001877cc Branch if Weapon doesn't have Lightning 001877a4: 306400ff andi r4,r3,0x00ff 001877a8: 2c82000a sltiu r2,r4,0x000a 001877ac: 10400003 beq r2,r0,0x001877bc Branch if Ranfom > a 001877b0: 2c820028 sltiu r2,r4,0x0028 001877b4: 08061dfb j 0x001877ec 001877b8: 34030016 ori r3,r0,0x0016 r3 = 16 (Thundaga) 001877bc: 1040000b beq r2,r0,0x001877ec Branch if Random > 28 001877c0: 34030014 ori r3,r0,0x0014 r3 = 14 (Thunder) 001877c4: 08061dfb j 0x001877ec 001877c8: 34030015 ori r3,r0,0x0015 r3 = 15 (Thundara) 001877cc: 2c82000a sltiu r2,r4,0x000a 001877d0: 10400003 beq r2,r0,0x001877e0 Branch if Random > a 001877d4: 2c820028 sltiu r2,r4,0x0028 001877d8: 08061dfb j 0x001877ec 001877dc: 3403001a ori r3,r0,0x001a r3 = 1a (Blizzaga) 001877e0: 10400002 beq r2,r0,0x001877ec Branch if Random > 28 001877e4: 34030018 ori r3,r0,0x0018 r3 = 18 (Blizzard) 001877e8: 34030019 ori r3,r0,0x0019 r3 = 19 (Blizzara) 001877ec: 3c058019 lui r5,0x8019 001877f0: 24a538d6 addiu r5,r5,0x38d6 001877f4: 000320c0 sll r4,r3,0x03 Ability ID * 8 001877f8: 00832023 subu r4,r4,r3 Ability ID * 7 001877fc: 00042040 sll r4,r4,0x01 Ability ID * 14 00187800: a4a30000 sh r3,0x0000(r5) Store Used Ability ID 00187804: 24a5001a addiu r5,r5,0x001a r5 = 801938f0 (Current Action Ability Data start) 00187808: 3c028019 lui r2,0x8019 0018780c: 8c422d94 lw r2,0x2d94(r2) Load Attacker's Data Pointer 00187810: 3406000e ori r6,r0,0x000e r6 = e (Loop Limit) 00187814: a4430170 sh r3,0x0170(r2) Store Last Attack? = Ability ID 00187818: 3c028006 lui r2,0x8006 0018781c: 2442fbf0 addiu r2,r2,-0x0410 r2 = 5fbf0 (Ability Data) 00187820: 0c017895 jal 0x0005e254 Load X into Y (Ability Data -> Current Action Data) 00187824: 00822021 addu r4,r4,r2 r4 = Ability Data Pointer 00187828: 8fbf0014 lw r31,0x0014(r29) 0018782c: 8fb00010 lw r16,0x0010(r29) 00187830: 27bd0018 addiu r29,r29,0x0018 00187834: 03e00008 jr r31 00187838: 00000000 nop
Return Locations
- Battle.bin
00188c2c: 04 Magic Gun