I recently updated skillsystems on febuilder to the most recent version and am seeing what ideas I can come up with due to the new features.
I had an idea to make certain powerful statboosters only usable by a certain character. The Item Effect Revamp table has a place to insert ASM for statboosters (I believe for a usability check). Is there an easy way to use this feature to check a character ID and allow use only for a certain character ID?
It should be pretty easy to check for a specific character ID, will still require some asm
Write a function that calls the normal statbooster usability function (to check that you haven’t capped the stat, etc.) and if that check succeeds you just need to get the character ID. Unit pointer is passed to your function in r4, so you can load character data pointer → character ID from that and compare it to some constant value of the character ID you want to be allowed to use it, return true if they’re the same, and return false otherwise.
Item usability functions are laid out a bit differently from standard functions due to how they’re called, so I’d recommend looking at existing ones for the layout if you’re unfamiliar with it
If you use the unit ptr in r4 instead of the active unit ptr it should also work as prep screen usability, active unit won’t be unit using item at the prep screen
Generally speaking I always prefer grabbing unit struct that’s passed as a parameter over using whatever’s in CurrentUnit ram as this is safer, so it’s good practice either way