1F Dmg ((100-CasF)*(100-TarF)*(MA+Y)*MA/2)

From Final Fantasy Hacktics Wiki
Jump to navigation Jump to search
[1f]
00189464: 27bdffe8 addiu r29,r29,0xffe8		
00189468: afbf0010 sw r31,0x0010(r29)		
0018946c: 0c06216e jal 0x 001885b8   		Magic Evade
00189470: 00000000 nop				
00189474: 1440004f bne r2,r0,0x 001895b4		Branch if spell fails
00189478: 00000000 nop				
0018947c: 0c061730 jal 0x 00185cc0               Set (MA + Y) / 2 as Y
00189480: 00000000 nop				
00189484: 0c0617ff jal 0x 00185ffc               Elemental Boost
00189488: 00000000 nop				
0018948c: 0c0621d1 jal 0x 00188744      		Magic XA Modifications
00189490: 00000000 nop				
00189494: 0c0621df jal 0x 0018877c      		Magic Damage Calculation
00189498: 00000000 nop				
0018949c: 14400045 bne r2,r0,0x 001895b4		branch if magic damage is 0
001894a0: 00000000 nop				
001894a4: 3c028019 lui r2,0x8019		
001894a8: 8c422d94 lw r2,0x2d94(r2)		load attacker data pointer
001894ac: 00000000 nop				
001894b0: 9042005c lbu r2,0x005c(r2)		Load 5th set of current statuses
001894b4: 00000000 nop				
001894b8: 30420080 andi r2,r2,0x0080		Should be 40 (checks for faith)
001894bc: 10400003 beq r2,r0,0x 001894cc		branches if attacker does not have faith
001894c0: 00000000 nop				
001894c4: 3c018019 lui r1,0x8019			
001894c8: a02038d3 sb r0,0x38d3(r1)          	Faith sets your faith to 0. (Bug)
001894cc: 3c028019 lui r2,0x8019		
001894d0: 8c422d94 lw r2,0x2d94(r2)            	load attacker data pointer
001894d4: 00000000 nop				
001894d8: 9042005c lbu r2,0x005c(r2)		load 5th set of current statuses
001894dc: 00000000 nop				
001894e0: 30420040 andi r2,r2,0x0040		Should be 80 (checks for innocent)
001894e4: 10400003 beq r2,r0,0x 001894f4		branches if attacker doesn't have innocent
001894e8: 34020064 ori r2,r0,0x0064		r2 = 100
001894ec: 3c018019 lui r1,0x8019		
001894f0: a02238d3 sb r2,0x38d3(r1)         	Innocent sets attacker's faith to 100. (Bug)
001894f4: 3c028019 lui r2,0x8019		
001894f8: 8c422d98 lw r2,0x2d98(r2)		load target data pointer
001894fc: 00000000 nop				
00189500: 9042005c lbu r2,0x005c(r2)		load 5th set of current statuses
00189504: 00000000 nop				
00189508: 30420080 andi r2,r2,0x0080		Should be 40 (checks for faith)
0018950c: 10400003 beq r2,r0,0x 0018951c		branches if target doesn't have faith
00189510: 00000000 nop				
00189514: 3c018019 lui r1,0x8019		
00189518: a02038d2 sb r0,0x38d2(r1)         	Faith sets enemy faith to 0. (Bug)
0018951c: 3c028019 lui r2,0x8019		
00189520: 8c422d98 lw r2,0x2d98(r2)		target data
00189524: 00000000 nop				
00189528: 9042005c lbu r2,0x005c(r2)		5th statuses
0018952c: 00000000 nop				
00189530: 30420040 andi r2,r2,0x0040		Should be 80 (innocent)
00189534: 10400004 beq r2,r0,0x 00189548		branch if not innocent
00189538: 34030064 ori r3,r0,0x0064		r3 = 100
0018953c: 34020064 ori r2,r0,0x0064		r2 = 100
00189540: 3c018019 lui r1,0x8019		
00189544: a02238d2 sb r2,0x38d2(r1)          	Innocent sets enemy faith to 100.  (Bug)
00189548: 3c058019 lui r5,0x8019               	If no one has status...begin here.
0018954c: 8ca52d90 lw r5,0x2d90(r5)		loads Target current action
00189550: 3c028019 lui r2,0x8019		
00189554: 904238d2 lbu r2,0x38d2(r2)		loads effective target faith
00189558: 84a40004 lh r4,0x0004(r5)		loads Y
0018955c: 00621023 subu r2,r3,r2		r2 = 100 - TarF
00189560: 0082 0018 mult r4,r2			Y = (100-TarF)*(MA+Y)*MA/2
00189564: 3c028019 lui r2,0x8019		
00189568: 904238d3 lbu r2,0x38d3(r2)		loads effective attacker faith
0018956c: 00002012 mflo r4			r4 = Y
00189570: 00621823 subu r3,r3,r2		r3 = 100 - CasF
00189574: 00000000 nop				
00189578: 0083 0018 mult r4,r3          		Y = ((100-CasF)*(100-TarF)*(MA+Y)*MA/2)
0018957c: 00 001812 mflo r3            		r3 = Y
00189580: 3c0268db lui r2,0x68db		
00189584: 34428bad ori r2,r2,0x8bad		r2 = 4096/10000
00189588: 0062 0018 mult r3,r2			
0018958c: 00031fc3 sra r3,r3,0x1f		-
00189590: 00001010 mfhi r2			r2 = Y = 4096Y/10000
00189594: 00021303 sra r2,r2,0x0c		Y = (4096Y/10000)/4096 = Y/10000 (100^2 = 10000, so this makes sure the damage isn't too high from the faith multiplier)
00189598: 00431023 subu r2,r2,r3		-
0018959c: 0c0621c7 jal 0x 0018871c          	Elemental Absorb and status roll
001895a0: a4a20004 sh r2,0x0004(r5)        	Final Damage
001895a4: 14400003 bne r2,r0,0x 001895b4		Branches if Conditional Status Proc Roll (19%) succeeds
001895a8: 00000000 nop				
001895ac: 0c061fad jal 0x 00187eb4            	Status Calculation
001895b0: 00000000 nop				
001895b4: 8fbf0010 lw r31,0x0010(r29)		
001895b8: 27bd 0018 addiu r29,r29,0x 0018		
001895bc: 03e00008 jr r31			
001895c0: 00000000 nop