Mimic ability setting
Jump to navigation
Jump to search
0018f038: 27bdffa0 addiu r29,r29,0xffa0 0018f03c: afb1004c sw r17,0x004c(r29) 0018f040: 00808821 addu r17,r4,r0 0018f044: afb00048 sw r16,0x0048(r29) 0018f048: 3c108019 lui r16,0x8019 0018f04c: 261038a6 addiu r16,r16,0x38a6 attacker/self ID 0018f050: afbf0058 sw r31,0x0058(r29) 0018f054: afb30054 sw r19,0x0054(r29) 0018f058: 0c06325a jal 0x0018c968 check if unit can react 0018f05c: afb20050 sw r18,0x0050(r29) 0018f060: 1440008b bne r2,r0,0x0018f290 0018f064: 00001021 addu r2,r0,r0 0018f068: 92220005 lbu r2,0x0005(r17) load unit ENTD flags 0018f06c: 3c038019 lui r3,0x8019 0018f070: 906338a0 lbu r3,0x38a0(r3) load attackers team 0018f074: 30420030 andi r2,r2,0x0030 0018f078: 14430085 bne r2,r3,0x0018f290 branch if unit or attacker not on enemy team? 0018f07c: 00001021 addu r2,r0,r0 0018f080: 9223018a lbu r3,0x018a(r17) unit ID 0018f084: 92020000 lbu r2,0x0000(r16) load attacker/self ID 0018f088: 00000000 nop 0018f08c: 10620080 beq r3,r2,0x0018f290 branch if unit is attacker 0018f090: 00001021 addu r2,r0,r0 0018f094: 3c028019 lui r2,0x8019 0018f098: 904238a7 lbu r2,0x38a7(r2) load skillset ID 0018f09c: 3c018006 lui r1,0x8006 0018f0a0: 00220821 addu r1,r1,r2 0018f0a4: 90255cb4 lbu r5,0x5cb4(r1) load action menu byte 0018f0a8: 3c048019 lui r4,0x8019 0018f0ac: 848438a8 lh r4,0x38a8(r4) load used ability 0018f0b0: 30a300ff andi r3,r5,0x00ff 0018f0b4: 10600005 beq r3,r0,0x0018f0cc branch if action menu = default 0018f0b8: 34020003 ori r2,r0,0x0003 0018f0bc: 10620003 beq r3,r2,0x0018f0cc branch if action menu = math skill 0018f0c0: 34020006 ori r2,r0,0x0006 0018f0c4: 1462000b bne r3,r2,0x0018f0f4 branch if not monster skillset 0018f0c8: 00000000 nop 0018f0cc: 000410c0 sll r2,r4,0x03 0018f0d0: 00441023 subu r2,r2,r4 0018f0d4: 00021040 sll r2,r2,0x01 0018f0d8: 3c018006 lui r1,0x8006 0018f0dc: 00220821 addu r1,r1,r2 0018f0e0: 9022fbf5 lbu r2,-0x040b(r1) load flags 3 0018f0e4: 00000000 nop 0018f0e8: 30420010 andi r2,r2,0x0010 0018f0ec: 14400068 bne r2,r0,0x0018f290 branch to end if can't mimic flagged 0018f0f0: 00001021 addu r2,r0,r0 return r2 = 0 (can't mimic?) 0018f0f4: 96230048 lhu r3,0x0048(r17) load Y coordinate 0018f0f8: 3c028019 lui r2,0x8019 0018f0fc: 9042389c lbu r2,0x389c(r2) load calculator multiplier byte 0018f100: 00031a02 srl r3,r3,0x08 0018f104: 3063000f andi r3,r3,0x000f 0018f108: 2442fffc addiu r2,r2,0xfffc 0018f10c: 00623823 subu r7,r3,r2 0018f110: 30a300ff andi r3,r5,0x00ff 0018f114: 34020009 ori r2,r0,0x0009 0018f118: 14620002 bne r3,r2,0x0018f124 0018f11c: 02202021 addu r4,r17,r0 0018f120: 34e70100 ori r7,r7,0x0100 0018f124: 3c058019 lui r5,0x8019 0018f128: 84a538a2 lh r5,0x38a2(r5) load X distance to target 0018f12c: 3c068019 lui r6,0x8019 0018f130: 84c638a4 lh r6,0x38a4(r6) load Y distance to target 0018f134: 27a20038 addiu r2,r29,0x0038 0018f138: afa20010 sw r2,0x0010(r29) 0018f13c: 27a2003c addiu r2,r29,0x003c 0018f140: afa20014 sw r2,0x0014(r29) 0018f144: 27a20040 addiu r2,r29,0x0040 0018f148: 0c063cac jal 0x0018f2b0 some map calculation 0018f14c: afa20018 sw r2,0x0018(r29) 0018f150: 1440004f bne r2,r0,0x0018f290 0018f154: 2402ffff addiu r2,r0,0xffff 0018f158: 02002021 addu r4,r16,r0 0018f15c: 0c01788b jal 0x0005e22c transfer target data 0018f160: 27a50020 addiu r5,r29,0x0020 0018f164: 34020005 ori r2,r0,0x0005 0018f168: a3a2002a sb r2,0x002a(r29) 0018f16c: 9222018a lbu r2,0x018a(r17) load unit ID 0018f170: 97a40038 lhu r4,0x0038(r29) 0018f174: 97a30040 lhu r3,0x0040(r29) 0018f178: 3c058019 lui r5,0x8019 0018f17c: 90a5389e lbu r5,0x389e(r5) load attackers right hand weapon 0018f180: a3a20020 sb r2,0x0020(r29) 0018f184: 9226018a lbu r6,0x018a(r17) load unit ID again 0018f188: 97a2003c lhu r2,0x003c(r29) 0018f18c: a7a4002c sh r4,0x002c(r29) 0018f190: a7a3002e sh r3,0x002e(r29) 0018f194: a7a20030 sh r2,0x0030(r29) 0018f198: a3a6002b sb r6,0x002b(r29) 0018f19c: a225001d sb r5,0x001d(r17) store right hand weapon 0018f1a0: 3c028019 lui r2,0x8019 0018f1a4: 9042389f lbu r2,0x389f(r2) load attackers left hand weapon 0018f1a8: 27a40020 addiu r4,r29,0x0020 0018f1ac: 0c05ea30 jal 0x0017a8c0 calculate ability range for menu types 0018f1b0: a222001f sb r2,0x001f(r17) store left hand weapon 0018f1b4: 00408021 addu r16,r2,r0 0018f1b8: 2402ffff addiu r2,r0,0xffff 0018f1bc: 12020018 beq r16,r2,0x0018f220 branch if result = 0xff 0018f1c0: 34020003 ori r2,r0,0x0003 0018f1c4: 12020016 beq r16,r2,0x0018f220 branch if result = 0x03 0018f1c8: 2a020002 slti r2,r16,0x0002 0018f1cc: 10400019 beq r2,r0,0x0018f234 branch if result isn't < 02 0018f1d0: 27a40020 addiu r4,r29,0x0020 0018f1d4: 3c03800e lui r3,0x800e 0018f1d8: 90634e9c lbu r3,0x4e9c(r3) load map max X 0018f1dc: 8fa2003c lw r2,0x003c(r29) 0018f1e0: 00000000 nop 0018f1e4: 00620018 mult r3,r2 0018f1e8: 8fa20040 lw r2,0x0040(r29) 0018f1ec: 8fa40038 lw r4,0x0038(r29) 0018f1f0: 00021200 sll r2,r2,0x08 0018f1f4: 00001812 mflo r3 0018f1f8: 00431021 addu r2,r2,r3 0018f1fc: 00449021 addu r18,r2,r4 0018f200: 001210c0 sll r2,r18,0x03 0018f204: 3c018019 lui r1,0x8019 0018f208: 00220821 addu r1,r1,r2 0018f20c: 9022f8d1 lbu r2,-0x072f(r1) load panel green byte 0018f210: 00000000 nop 0018f214: 30420040 andi r2,r2,0x0040 0018f218: 14400006 bne r2,r0,0x0018f234 branch if panel is green 0018f21c: 27a40020 addiu r4,r29,0x0020 0018f220: 2402ffff addiu r2,r0,0xffff 0018f224: 340300ff ori r3,r0,0x00ff 0018f228: a223001d sb r3,0x001d(r17) store right hand weapon = 0xff 0018f22c: 08063ca4 j 0x0018f290 jump to end 0018f230: a223001f sb r3,0x001f(r17) store left hand weapon = 0xff 0018f234: 2625016e addiu r5,r17,0x016e 0018f238: 3c128019 lui r18,0x8019 0018f23c: 8e52f5fc lw r18,-0x0a04(r18) load attack phase 0018f240: 34020002 ori r2,r0,0x0002 0018f244: 3c018019 lui r1,0x8019 0018f248: ac22f5fc sw r2,-0x0a04(r1) store = 02 (mimic 0018f24c: 0c05f117 jal 0x0017c45c attack prep 0018f250: 34060001 ori r6,r0,0x0001 0018f254: 00408021 addu r16,r2,r0 0018f258: 02202021 addu r4,r17,r0 0018f25c: 00002821 addu r5,r0,r0 0018f260: 3406000d ori r6,r0,0x000d 0018f264: 34070001 ori r7,r0,0x0001 0018f268: 341300ff ori r19,r0,0x00ff 0018f26c: 0c0179b3 jal 0x0005e6cc inflict status changes 0018f270: a233015d sb r19,0x015d(r17) store current ability CT = 0xff 0018f274: 3c018019 lui r1,0x8019 0018f278: ac32f5fc sw r18,-0x0a04(r1) store control variable = 0 0018f27c: 06010004 bgez r16,0x0018f290 0018f280: 34020001 ori r2,r0,0x0001 return r2 = 1 if successful 0018f284: 2402ffff addiu r2,r0,0xffff 0018f288: a233001d sb r19,0x001d(r17) clear weapons if fail 0018f28c: a233001f sb r19,0x001f(r17) 0018f290: 8fbf0058 lw r31,0x0058(r29) 0018f294: 8fb30054 lw r19,0x0054(r29) 0018f298: 8fb20050 lw r18,0x0050(r29) 0018f29c: 8fb1004c lw r17,0x004c(r29) 0018f2a0: 8fb00048 lw r16,0x0048(r29) 0018f2a4: 27bd0060 addiu r29,r29,0x0060 0018f2a8: 03e00008 jr r31 0018f2ac: 00000000 nop