Users browsing this thread: 1 Guest(s)
Piranha battle
08-23-2015, 01:26 PM
I don't really know much about the special event data. It looks like it's at $D0FD00 and they're 18 bytes each. Does anyone know how this works?
For the FB 0D 00 command, I looked up the code that gets called. All it does is set "hide" status for that monster.
There's one other unique thing about the piranha battle. There's a bit in their monster data that sets bit 7 at $3E4C ($3E54 for monsters). In FF3ME, it's called "Removable Float", but I think that's incorrect. I call it "piranha" status.
Here's what that bit really does: At the end of each turn in battle, the game checks which monsters just died. Any monsters with "hide" status become dead. Monsters with pending counterattacks don't become dead, *unless* they have "piranha" status. That way, the piranha will always die before the new piranhas spawn. There's definitely some redundancy there, but I did a test to see what would happen if I disabled this code *and* got rid of the FB 0D 00 commands in the AI script. Here's a video of what happened https://youtu.be/nVBEQ0grayc. And here's the code:
For the FB 0D 00 command, I looked up the code that gets called. All it does is set "hide" status for that monster.
Code:
C2/1F00: B9 F9 3E LDA $3EF9,Y
C2/1F03: 09 20 ORA #$20
C2/1F05: 99 F9 3E STA $3EF9,Y ; set hide status
C2/1F08: 60 RTS
There's one other unique thing about the piranha battle. There's a bit in their monster data that sets bit 7 at $3E4C ($3E54 for monsters). In FF3ME, it's called "Removable Float", but I think that's incorrect. I call it "piranha" status.
Here's what that bit really does: At the end of each turn in battle, the game checks which monsters just died. Any monsters with "hide" status become dead. Monsters with pending counterattacks don't become dead, *unless* they have "piranha" status. That way, the piranha will always die before the new piranhas spawn. There's definitely some redundancy there, but I did a test to see what would happen if I disabled this code *and* got rid of the FB 0D 00 commands in the AI script. Here's a video of what happened https://youtu.be/nVBEQ0grayc. And here's the code:
Code:
C2/1429: A2 0A LDX #$0A
C2/142B: BD 21 30 LDA $3021,X ; monster mask
C2/142E: 2C 3A 3A BIT $3A3A
C2/1431: F0 17 BEQ $144A ; skip if monster is still alive
C2/1433: EB XBA
C2/1434: BD 01 3F LDA $3F01,X ; status 4
C2/1437: 89 20 BIT #$20
C2/1439: D0 0B BNE $1446 ; mark monster as dead if it has hide status
C2/143B: BD 54 3E LDA $3E54,X
C2/143E: 30 06 BMI $1446 ; skip if piranha status
C2/1440: BD D5 32 LDA $32D5,X ; pointer to next pending counterattack
C2/1443: 1A INC
C2/1444: D0 04 BNE $144A ; branch if there is a counterattack pending
C2/1446: EB XBA
C2/1447: 1C 2F 2F TRB $2F2F ; mark monster as dead
C2/144A: CA DEX
C2/144B: CA DEX
C2/144C: 10 DD BPL $142B
C2/144E: 60 RTS
« Next Oldest | Next Newest »
|
||||
Users browsing this thread: 1 Guest(s)