• Our software update is now concluded. You will need to reset your password to log in. In order to do this, you will have to click "Log in" in the top right corner and then "Forgot your password?".
  • Welcome to PokéCommunity! Register now and join one of the best fan communities on the 'net to talk Pokémon and more! We are not affiliated with The Pokémon Company or Nintendo.

[Discussion] Sorting out held items

Maruno

Lead Dev of Pokémon Essentials
5,285
Posts
16
Years
I want to get to the bottom of how held items work, namely the possession/usage aspects. To that end, I've made a list of all the moves and abilities I can find that affect the possession of a held item and/or being able to use/consume them. Please have a look through it and point out any thing I missed.

When I refer to "special items", I mean a Griseous Orb being held by a Giratina, or a Drive held by a Genesect, or a Plate held by a Pokémon with Multitype. These items can never be removed from the holder.


Moves

Thief/Covet

  • User takes the target's held item.
  • Fails if user is holding an item, or if the target isn't. Fails if the item is mail or a special item. Fails if the item would be a special item when taken.
  • Wild Pokémon using this move never take an item. A player's Pokémon using this move against a wild Pokémon will keep the taken item after the battle.
  • Items taken from/by the player in trainer battles are returned to their original owners after the battle.
Trick/Switcheroo

  • User and target swap their held items.
  • Fails if nether has an item, but works if just one does. Fails if either item is mail or a special item. Fails if either item would be a special item when swapped. Fails if target has a Substitute.
  • Items switched in wild battles remain switched after the battle.
  • Items switched in trainer battles are returned to their original owners after the battle.
Knock Off

  • Target loses its held item for the rest of the battle (even if switched out later).
  • Fails if the target isn't holding an item. Fails if the item is mail or a special item. Fails if target has a Substitute.
  • Target gets its item back before the final Exp gain/money calculation.
Bestow

  • User gives its held item to the target.
  • Fails if the user isn't holding an item, or if the target is. Fails if the item is mail or a special item. Fails if the item would be a special item when given. Fails if target has a Substitute.
  • Items given in wild battles remain given after the battle.
  • Items given in trainer battles are returned to their original owners after the battle.
Pluck/Bug Bite

  • User consumes target's Berry and gains its effect (regardless of activation conditions).
  • Fails if the target isn't holding a Berry. Fails if target has a Substitute.
  • The Berry is lost forever, and cannot be regained by any method.
Fling

  • Power and effect depend on the user's held item.
  • The user's held item is consumed (but doesn't gain its effect). The consumed item can be Recycled.
  • Some items can't be Flung.
Natural Gift

  • Power and type depend on the user's held Berry.
  • The user's held Berry is consumed (but doesn't gain its effect). The consumed item can be Recycled.
Embargo

  • For 5 turns, target's held item cannot be consumed, and its effects are negated.
  • Exp Share/Power Weight/Amulet Coin and similar are unaffected. Iron Ball still lowers Speed.
  • Target cannot use Fling. If target uses Bug Bite/Pluck, it destroys the item but doesn't gain the effect.
  • For 5 turns, target's owner cannot use any items on the target.
  • Effect wears off if target switches out. Effect can be Baton Passed.
Recycle

  • User regains the last held item it consumed (i.e. by its own effect or used by Fling/Natural Gift only).
  • Works even if the consumed item was not originally the user's.
  • Fails if the user is holding an item. Fails if the consumed item was Pickup'd first.
  • The consumed item is remembered even while the consumer is switched out. Only the one most recently-consumed item of each Pokémon is remembered.

Abilities

Sticky Hold

  • Bearer's held item cannot be taken by Covet, Thief, Trick, Switcheroo or Knock Off.
Pickpocket

  • Same as Thief/Covet, but occurs when bearer is hit by a move that makes contact.
Pickup

  • Bearer gains another battler's item (but not the bearer's item) when that battler consumes it, immediately after the consuming event.
  • If there are several Pickup-ers, the fastest one gets the item.
  • All items that can be Recycled can be Pickup'd (they are then denied from being Recycled).
Harvest

  • Same as Recycle, but only for Berries.
  • Occurs once per turn at the end of each turn (before the end-of-turn Berry consuming). 50% chance of Harvesting the Berry each time (or 100% in sunny weather).
Klutz

  • Same as Embargo, but affects the bearer forever.
  • Bearer's trainer can still use items on it.
 
Last edited:

FL

Pokémon Island Creator
2,444
Posts
13
Years
  • Seen today
Well done! I can't find a single error!
You probably don't have problem with this, but remember the scenarios when you stole a partner item in double battles.
 

Maruno

Lead Dev of Pokémon Essentials
5,285
Posts
16
Years
Then tell me what happens in those scenarios. I don't have any experience using any of these moves/abilities.
 

FL

Pokémon Island Creator
2,444
Posts
13
Years
  • Seen today
Then tell me what happens in those scenarios. I don't have any experience using any of these moves/abilities.
Nothing different that you describe in topic. You probably won't have trouble with this, but with the way that you coded may create situations when the item is duplicated, so I warning you. Example: Using Thief into a Wild Pokémon in Wild Double battle, and after using Thief from the partner that uses Thief.
 

Maruno

Lead Dev of Pokémon Essentials
5,285
Posts
16
Years
Nothing different that you describe in topic. You probably won't have trouble with this, but with the way that you coded may create situations when the item is duplicated, so I warning you. Example: Using Thief into a Wild Pokémon in Wild Double battle, and after using Thief from the partner that uses Thief.
In that example (where player's Pokémon A stole player Pokémon B's item, then B stole a wild Pokémon's item), I would say that the items being held originally take priority over new items stolen and obtained. A would get its original item back from B, B would have no item, and the wild Pokémon's item is lost.

I intend to have an array created at the start of battle which records the held items of all player's Pokémon. During battle items may be shifted around/lost/consumed/whatever. At those times, the array is updated accordingly if it needs to be (i.e. remove a consumed/Plucked/Pickup'd item). At the end of the battle, this array is used to reset the held items. I think that's sufficient for everything above (Recycle works differently, but already exists).
 

FL

Pokémon Island Creator
2,444
Posts
13
Years
  • Seen today
In that example (where player's Pokémon A stole player Pokémon B's item, then B stole a wild Pokémon's item), I would say that the items being held originally take priority over new items stolen and obtained. A would get its original item back from B, B would have no item, and the wild Pokémon's item is lost.

I intend to have an array created at the start of battle which records the held items of all player's Pokémon. During battle items may be shifted around/lost/consumed/whatever. At those times, the array is updated accordingly if it needs to be (i.e. remove a consumed/Plucked/Pickup'd item). At the end of the battle, this array is used to reset the held items. I think that's sufficient for everything above (Recycle works differently, but already exists).
You reverse the order in my example (Although I don't make clear enough). What I mean is that, depending the way that you coded this can duplicate the items at battle end.

In my game, like you point before, I use a new variable in PokeBattle_Battler class rather that an array.
 

Maruno

Lead Dev of Pokémon Essentials
5,285
Posts
16
Years
As yes, I see what you meant now. I'd say the first Thief would get the wild Pokémon's item.

An extra variable in the battler's class wouldn't work, because battlers are only the Pokémon currently in battle. If you switched Pokémon around a bit during battle, there'd be no way of tracking which items were which. I'm under the impression that you could Thief an item, withdraw the Pokémon then send it out later, and it would still have the Thief'd item (and that items are sorted out at the very end).
 

FL

Pokémon Island Creator
2,444
Posts
13
Years
  • Seen today
As yes, I see what you meant now. I'd say the first Thief would get the wild Pokémon's item.

An extra variable in the battler's class wouldn't work, because battlers are only the Pokémon currently in battle. If you switched Pokémon around a bit during battle, there'd be no way of tracking which items were which. I'm under the impression that you could Thief an item, withdraw the Pokémon then send it out later, and it would still have the Thief'd item (and that items are sorted out at the very end).
And in PokeBattle_Pokemon class?
 

Maruno

Lead Dev of Pokémon Essentials
5,285
Posts
16
Years
I'd say it belongs in the PokeBattle_Battle class, since that's the only time it's needed.
 

FL

Pokémon Island Creator
2,444
Posts
13
Years
  • Seen today
Have you thought about a setting that allow to steal (and others similar effects) the trainer item like Gen II/III/IV games? Or this not worth to be implemented and may mess with the player item restoration when they are stolen?
 

Maruno

Lead Dev of Pokémon Essentials
5,285
Posts
16
Years
I doubt such a setting would mess anything up, but it's not worth it because it's such an obscure feature. It's probably straightforward enough to implement it yourself if you must.
 
Back
Top