Jump to content

Leftovers


Recommended Posts

I was looking around the item fields in XY/ORAS - I noticed something odd about Leftovers.

All the other held items that restore a X% of HP (or take it away, like Sticky Barb) have a HeldArguement that is clearly either X (e.g. Sitrus berry has a value of 25), or is clearly the denominator of the corresponding fraction (e.g. Black Sludge has a value of 16, Sticky Barb has a value of 8).

Leftovers has a value of 10 (Hex 0A, I even double-checked in a hex editor, because it was so surprising). I can only imagine that the script for Leftovers is different from every other percent-of-HP script, and divides by 160 (Hex A0) when calculating the HP healed.

As Leftovers was the only such item in the generation it was introduced, I have a feeling that its script was written like that for some obscure reason that made sense in context, and it was just ported along and never updated to match the later items (IIRC from the last time I played around with gen III, even the Shell Bell value is 8 as it is in gen VI)

Link to comment
Share on other sites

Playing with modifying Shell Bell and Leftovers now, and also applying their effect-codes to other hold items

 

On 5/2/2020 at 1:47 AM, Pokefan 263 said:

So this means we can modify how much HP a Pokemon can get back with the leftovers.

 

 

  1. Edited Mystic Water to have same data as Leftovers - fail, does not activate.
  2. Edited Sharp Beak to have same data as Shell Bell - fail, does not activate.
  3. Edited Shell Bell to have a '4' where it normally has an '8', test by using Dragon Rage - Success - healed 1/4 (10 HP) instead of 1/8 (5 HP).
  4. Edited Leftovers to have a '20' where it normally has a '10' - fail, no change.

 

I conclude that Leftovers is running its own script that has the recovery value hardcoded, and the script-calls for at least these hold items are referencing the actual item indices, not the effect codes in the item data, either by hardcoding or by a lookup table somewhere.

 

 

Tried editing Sticky Barb to have Leftover's data - fail, Sticky Barb works as usual..

I suspect that like moves, a number of items are tied to scripts somewhere else.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...