• 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.

Creating a Battle Item that heals Freezing

155
Posts
9
Years
    • Seen Jun 11, 2021
    Basically, my item works like an X Attack and X Special, but I'm trying to have it to where it can heal freezing if used. However, I don't think I set up the code for it correctly.

    Code:
    ItemHandlers::BattleUseOnBattler.add(:LANSATCHILI,proc{|item,battler,scene|
       playername=battler.battle.pbPlayer.name
       pokemon=battler
       scene.pbDisplay(_INTL("{1} used the {2}.",playername,PBItems.getName(item)))
       if battler.pbCanIncreaseStatStage?(PBStats::SPATK,battler,false) && battler.pbCanIncreaseStatStage?(PBStats::ATTACK,battler,false)
         battler.pbIncreaseStat(PBStats::ATTACK,1,battler,true)
         battler.pbIncreaseStat(PBStats::SPATK,1,battler,true)
         if battler.pbCanBurn?(battler,false,self)
          battler.pbBurn(battler)
          scene.pbDisplay(_INTL("The {1} was so spicy, it burned {2}!",PBItems.getName(item),battler.pbThis))
         elsif battler.status=PBStatuses::FROZEN
          pokemon.healStatus
          scene.pbRefresh
          scene.pbDisplay(_INTL("{1} was thawed out.",battler.pbThis))
         end
         return true
       else
         scene.pbDisplay(_INTL("But it had no effect!"))
         if battler.pbCanBurn?(battler,false,self)
          battler.pbBurn(battler)
          scene.pbDisplay(_INTL("The {1} was so spicy, it burned {2}!",PBItems.getName(item),battler.pbThis))
         elsif battler.status=PBStatuses::FROZEN
          battler.healStatus
          scene.pbRefresh
          scene.pbDisplay(_INTL("{1} was thawed out.",battler.pbThis))
         end
         return false  
       end
    })
     
    Last edited:
    81
    Posts
    8
    Years
    • Seen Sep 7, 2019
    That's way to long just to heal freeze hold on I'll hook you up.

    Code:
    ItemHandlers::BattleUseOnBattler.add(:FREEZEAWAY,proc{|item,battler,scene|
       playername=battler.battle.pbPlayer.name
       itemname=PBItems.getName(item)
       scene.pbDisplay(_INTL("{1} used the {2}.",playername,PBItems.getName(item)))
       if battler.hp<=0 || battler.status!=PBStatuses::FROZEN
         scene.pbDisplay(_INTL("It won't have any effect."))
         next false
       else
         battler.status=0
         scene.pbRefresh
         scene.pbDisplay(_INTL("{1} was thawed out.",battler.name))
         next true
       end
    })
    That should work perfetly find either rename your item to FreezeAway or change Freezeaway to your items name. :)
     
    Last edited by a moderator:
    Back
    Top