Traps Routine

From Final Fantasy Hacktics Wiki
Revision as of 15:40, 24 February 2012 by Choto (talk | contribs) (Created page with " 0018dbb0: 27bdffe0 addiu r29,r29,0xffe0 0018dbb4: afb00010 sw r16,0x0010(r29) 0018dbb8: 00808021 addu r16,r4,r0 0018dbbc: afbf 0018 sw r31,0x 0018(r29) ...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search
0018dbb0: 27bdffe0 addiu r29,r29,0xffe0      
0018dbb4: afb00010 sw r16,0x0010(r29)      
0018dbb8: 00808021 addu r16,r4,r0      
0018dbbc: afbf 0018 sw r31,0x 0018(r29)      
0018dbc0: afb10014 sw r17,0x0014(r29)      
0018dbc4: 92040047 lbu r4,0x0047(r16)      Load X Coordinate
0018dbc8: 96060048 lhu r6,0x0048(r16)      Load Y Coordinate
0018dbcc: 92050048 lbu r5,0x0048(r16)      Load Y Coordinate
0018dbd0: 0c0600b2 jal 0x 001802c8      Big routine, I can only assume that it finds out if the unit triggered a trap.
0018dbd4: 000633c2 srl r6,r6,0x0f      
0018dbd8: 92030182 lbu r3,0x0182(r16)      Mount Info
0018dbdc: 90510004 lbu r17,0x0004(r2)      
0018dbe0: 30620040 andi r2,r3,0x0040      
0018dbe4: 10400007 beq r2,r0,0x 0018dc04      
0018dbe8: 3062001f andi r2,r3,0x001f      
0018dbec: 000218c0 sll r3,r2,0x03      
0018dbf0: 00621823 subu r3,r3,r2      
0018dbf4: 00031980 sll r3,r3,0x06      
0018dbf8: 3c028019 lui r2,0x8019      
0018dbfc: 244208cc addiu r2,r2,0x08cc      Load Unit Data
0018dc00: 00628021 addu r16,r3,r2      
0018dc04: 9202018a lbu r2,0x018a(r16)      Load Unit ID   
0018dc08: 2604018c addiu r4,r16,0x018c      
0018dc0c: 3c018019 lui r1,0x8019      
0018dc10: ac302d98 sw r16,0x2d98(r1)      Store Defender's Stats
0018dc14: 3c018019 lui r1,0x8019      
0018dc18: ac242d90 sw r4,0x2d90(r1)      Store Defender's Current Action Data
0018dc1c: 3c018019 lui r1,0x8019      
0018dc20: a02238c1 sb r2,0x38c1(r1)      Store Target ID
0018dc24: 0c062f5d jal 0x 0018bd74      
0018dc28: 00000000 nop            
0018dc2c: 322300ff andi r3,r17,0x00ff      
0018dc30: 34020001 ori r2,r0,0x0001      
0018dc34: 10620017 beq r3,r2,0x 0018dc94      
0018dc38: 28620002 slti r2,r3,0x0002      
0018dc3c: 10400005 beq r2,r0,0x 0018dc54      
0018dc40: 00000000 nop            
0018dc44: 1060000a beq r3,r0,0x 0018dc70      
0018dc48: 34020001 ori r2,r0,0x0001      
0018dc4c: 0806374a j 0x 0018dd28         
0018dc50: 341100ff ori r17,r0,0x00ff      
0018dc54: 34020002 ori r2,r0,0x0002      
0018dc58: 1062 0018 beq r3,r2,0x 0018dcbc      
0018dc5c: 34020003 ori r2,r0,0x0003      
0018dc60: 10620027 beq r3,r2,0x 0018dd00      
0018dc64: 3c03cccc lui r3,0xcccc      
0018dc68: 0806374a j 0x 0018dd28         
0018dc6c: 341100ff ori r17,r0,0x00ff      
0018dc70: 3c038019 lui r3,0x8019      
0018dc74: 8c632d90 lw r3,0x2d90(r3)      Load Defender Current Action Data
0018dc78: 00000000 nop            
0018dc7c: a0620025 sb r2,0x0025(r3)      Store Attack-type
0018dc80: 3c038019 lui r3,0x8019      
0018dc84: 8c632d90 lw r3,0x2d90(r3)      Load Defender Current Action Data
0018dc88: 34020100 ori r2,r0,0x0100      
0018dc8c: 0806374a j 0x 0018dd28         
0018dc90: a4620010 sh r2,0x0010(r3)      Store flag as Level Reduction
0018dc94: 00002021 addu r4,r0,r0      r4 = 0x00
0018dc98: 3c038019 lui r3,0x8019      
0018dc9c: 8c632d90 lw r3,0x2d90(r3)      Load Defender Current Action Data
0018dca0: 34020001 ori r2,r0,0x0001      
0018dca4: 0c0612c9 jal 0x 00184b24      Check if Unit is immune to status
0018dca8: a062001f sb r2,0x001f(r3)      Store Status as Death Sentence
0018dcac: 10400010 beq r2,r0,0x 0018dcf0      Branch if no status is inflicted
0018dcb0: 00000000 nop            
0018dcb4: 08063737 j 0x 0018dcdc         
0018dcb8: 00000000 nop            
0018dcbc: 00002021 addu r4,r0,r0      r4 = 0x00
0018dcc0: 3c038019 lui r3,0x8019      
0018dcc4: 8c632d90 lw r3,0x2d90(r3)      Load Defender Current Action Data
0018dcc8: 34020010 ori r2,r0,0x0010      
0018dccc: 0c0612c9 jal 0x 00184b24      Check if Unit is immune to status
0018dcd0: a062001f sb r2,0x001f(r3)      Store Unit as Sleeping
0018dcd4: 10400006 beq r2,r0,0x 0018dcf0      
0018dcd8: 00000000 nop            
0018dcdc: 3c038019 lui r3,0x8019      
0018dce0: 8c632d90 lw r3,0x2d90(r3)      Load Defender Current Action Data
0018dce4: 34020008 ori r2,r0,0x0008      
0018dce8: 0806374a j 0x 0018dd28         
0018dcec: a0620025 sb r2,0x0025(r3)      Store Attack-type as Status change
0018dcf0: 0c0610c3 jal 0x 0018430c      
0018dcf4: 00000000 nop            
0018dcf8: 0806374b j 0x 0018dd2c         
0018dcfc: 02201021 addu r2,r17,r0      
0018dd00: 9602002a lhu r2,0x002a(r16)      Load Max HP
0018dd04: 3463cccd ori r3,r3,0xcccd            
0018dd08: 00430019 multu r2,r3         
0018dd0c: 3c038019 lui r3,0x8019      
0018dd10: 8c632d90 lw r3,0x2d90(r3)      Load Current Action Data Pointer
0018dd14: 34020080 ori r2,r0,0x0080      
0018dd18: a0620025 sb r2,0x0025(r3)      Store attack type has HP Damage
0018dd1c: 00001010 mfhi r2         
0018dd20: 00021082 srl r2,r2,0x02      
0018dd24: a4620004 sh r2,0x0004(r3)      Store HP Damage
0018dd28: 02201021 addu r2,r17,r0      
0018dd2c: 8fbf 0018 lw r31,0x 0018(r29)      
0018dd30: 8fb10014 lw r17,0x0014(r29)      
0018dd34: 8fb00010 lw r16,0x0010(r29)      
0018dd38: 27bd0020 addiu r29,r29,0x0020      
0018dd3c: 03e00008 jr r31         
0018dd40: 00000000 nop