• Just a reminder that providing specifics on, sharing links to, or naming websites where ROMs can be accessed is against the rules. If your post has any of this information it will be removed.
  • Ever thought it'd be cool to have your art, writing, or challenge runs featured on PokéCommunity? Click here for info - we'd love to spotlight your work!
  • Which Pokémon Masters protagonist do you like most? Let us know by casting a vote in our Masters favorite protagonist poll here!
  • Red, Hilda, Paxton, or Kellyn - which Pokémon protagonist is your favorite? Let us know by voting in our poll!
  • 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.

[Scripting Question] [v18] Resume Focus Sash after battle

  • 125
    Posts
    5
    Years
    • Seen Nov 20, 2023
    I am seek for a way for pokemon to resume items like Focus Sash or Berries after a battle.Can anyone help me?
     
    I am seek for a way for pokemon to resume items like Focus Sash or Berries after a battle.Can anyone help me?

    A first lead is to look for this code:
    Code:
      def pbConsumeItem(recoverable=true,symbiosis=true,belch=true)
        PBDebug.log("[Item consumed] #{pbThis} consumed its held #{PBItems.getName(@item)}")
        if recoverable
          setRecycleItem(@item)
          @effects[PBEffects::PickupItem] = @item
          @effects[PBEffects::PickupUse]  = @battle.nextPickupUse
        end
        setBelched if belch && pbIsBerry?(@item)
        pbRemoveItem(false) # <===== HERE, set the parameter to "false" so that pbRemoveItem remembers the item set at the start of the battle.
        pbSymbiosis if symbiosis
      end
     
    Back
    Top