Looking for a Poach Command - 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: Looking for a Poach Command (/thread-4041.html) |
Looking for a Poach Command - Morendo - 09-02-2020 Hi everyone! Long time no see! My thief character for my hack is looking to add a Poach command to his arsenal. My plan is to use Metamorph (Ragnarok's esper spell) as the command. I'd like to make it so the command checks how many remaining HP the target has, and fail if it is not below a certain threshold. The threshold can be a set value (seems a lot easier than using a percentage). How/where can I add that check? Here's what the vanilla C2 disassembly has for us: Code: Metamorph Any suggestions would be greatly appreciated. Thanks! RE: Looking for a Poach Command - C-Dude - 09-02-2020 Poach? Like, poaching an egg? Huh, doesn't matter. The success/fail check in the code you shared is between C2/3A67 and C2/3A74... it checks certain bits in the A that's restored from earlier and then decides to skip the actual transformation code if the roll fails. This'd be where you want to start; you'll want to change it to check something else instead of rolling. A good place to start might be checking if the monster has the "Near Fatal" status, and using that as the success condition. The game already has code in place to set/remove Near Fatal when a target is at 1/8th HP. That has the advantage of being relatively simple to implement. You load Status Byte 2 relative to the target "Y" (that's RAM address $3EE5 I think), run a bit test for bit 2 (that's the Near Fatal status), and then branch accordingly. A BEQ command will skip code if the bit is clear, which is what you'd want. My best guess (untested)... Code: B9 E5 3E LDA $3EE5,Y Using Near Fatal as the failure condition does have the disadvantage of being tied to the status, though... which means if you want to tweak the proportion of HP that makes the move work, you're also tweaking when Desperation Attacks become available and when character animate as 'hurt'. RE: Looking for a Poach Command - Morendo - 09-03-2020 Poach, as in killing an animal for its tusks, etc. FFXII renamed "Morph" to "Poach", and I like it. Thanks for the help! I'll check it out over the next couple days and let you know how it works out! Update: Your code appears to have worked! |