FF6 Hacking
Making two different Jump commands - Printable Version

+- FF6 Hacking (https://www.ff6hacking.com/forums)
+-- Forum: Discussion Forums (https://www.ff6hacking.com/forums/forum-5.html)
+--- Forum: Magitek Research Facility (https://www.ff6hacking.com/forums/forum-9.html)
+--- Thread: Making two different Jump commands (/thread-2974.html)



Making two different Jump commands - Cyprus - 10-25-2015

In RotDS I noticed when using the Morph command with Aurora, it negates 99 MP. So would it be possible to create a another Jump command (of course replacing some other command) that would negate 1/8 of your maximum health. Just wondering if it could be possible. I have a small hack in the works that could utilize those commands.


RE: Making two different Jump commands - Tenkarider - 10-25-2015

Shock works in a very similar way in BNW, you should ask to Synchysi


RE: Making two different Jump commands - Catone - 10-25-2015

That should be really simple to do, or am I completely nuts? Only thing that might make it difficult would be if you want to check and see beforehand if it will kill the player using it.

*Edit* Okay, I'm fairly sure that would be very easy to do. I am not sure where to find a good example of how it would be done though.


RE: Making two different Jump commands - Cyprus - 10-25-2015

Alright, I'll ask Synchysi.


RE: Making two different Jump commands - Synchysi - 10-26-2015

It is pretty easy. This is how I did it for Shock in BNW (place this after whatever code you want for the skill):

Code:
[Insert skill code here]

LDA $3C1C,Y            ; Attacker's max HP
LDX #$08
JSR $4792            ; Max HP / 8
PHA
LDA $3BF4,Y            ; Attacker's current HP
SEC
SBC $01,S            ; Current HP - (Max HP / 8)
STA $3BF4,Y            ; Store in current HP
BCS Exit            ; If carry is clear, self-inflicted damage exceeded current HP
JSR $1390            ; Needed to run if someone takes lethal damage

Exit:
PLA
RTS

If you'd rather the skill not fire at all if it would kill the user, use this:

Code:
LDA $3C1C,Y            ; Attacker's max HP
LDX #$08
JSR $4792            ; Max HP / 8
PHA
LDA $3BF4,Y            ; Attacker's current HP
SEC
SBC $01,S            ; Current HP - (Max HP / 8)
BCC Exit            ; If carry is clear, self-inflicted damage exceeded current HP, so branch
STA $3BF4,Y            ; Else, store in current HP

[Insert skill code here]

Exit:
PLA
RTS