A suit of enchanted armor, that can be activated/deactivated. When active, it reduces damage by a huge factor. But his protection is fuel-powered. And fuel can be very scarse.
1. Set up 2 items, 1 for activator/deactivator(to be accessed from subscreen) and 1 for actual armor(Ring class, I_MAGIC_ARMOR_ACTIVE).
2. Global script combining, put
int OldLinkHP = Link->HP;
before main loop of active global script.
then put
OldLinkHP=UpdateMagicArmor(OldLinkHP);
before Waitdraw command inside the main loop of Active global script.
3. For 1st item from step 1, assign Magic Armor item script into onAction script slot.
4. For 2nd item, the armor ring, set D0 to fuel cost multiplier. By default, Magic Armor uses 1 unit of fuel for each 1 HP absorbed.
For instance, Magic Armor with Divisor of 8 and default fuel usage modifier against a Fire Gleeok`s breath attack (2 hearts in damage, if no protection, 32 HP). 4 HP damage slips through, 32-4=28 HP is absorbed, and 28 units of fuel are used.