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

[Essentials Tutorial] Sun and Moon Purify Move

971
Posts
7
Years
    • Age 21
    • Seen Nov 28, 2022
    Alright. I've been trying to put all the moves of Sun and Moon in the PBS and have them work properly. I've made about 3 others so far, but those weren't very hard and didn't require skill. Then when I did Purify, I was so lost. I don't have ANY experience with coding (although I have edited quite a few scripts, but I wouldn't count that), and tried to make Purify. I'm going to share it here with you guys, even though it is probably way overcomplicated. Anyways, this is my first "real" piece of code and I'm very, very excited (even though this is probably easy as hell!{XD})

    Note: I'm not sure if this code will break through Pokecommunity, but make sure not to break any brackets or what-so-ever.
    Copy this into PokeBattle_MoveEffects:
    Code:
    class PokeBattle_Move_CF3 < PokeBattle_Move
      def pbEffect(attacker,opponent,hitnum=0,alltargets=nil,showanimation=false)
        if opponent.status!=PBStatuses::BURN &&
           opponent.status!=PBStatuses::POISON &&
           opponent.status!=PBStatuses::PARALYSIS &&
           opponent.status!=PBStatuses::SLEEP &&
           opponent.status!=PBStatuses::FROZEN
          @battle.pbDisplay(_INTL("But it failed!"))
          return -1
        else
          t=opponent.status
          opponent.pbCureStatus(false)
          if t==PBStatuses::BURN
            @battle.pbDisplay(_INTL("{1}'s Purify cured {2}'s burn!",attacker.pbThis,opponent.pbThis))  
          elsif t==PBStatuses::POISON
            @battle.pbDisplay(_INTL("{1}'s Purify cured {2}'s poison!",attacker.pbThis,opponent.pbThis))  
          elsif t==PBStatuses::PARALYSIS
            @battle.pbDisplay(_INTL("{1}'s Purify cured {2}'s paralysis",attacker.pbThis,opponent.pbThis))
          elsif t==PBStatuses::SLEEP
            @battle.pbDisplay(_INTL("{1}'s Purify woke {2} up!",attacker.pbThis,opponent.pbThis))
          elsif t==PBStatuses::FROZEN
            @battle.pbDisplay(_INTL("{1}'s Purify thawed {2} out!",attacker.pbThis,opponent.pbThis))
          end
          pbShowAnimation(@id,attacker,nil,hitnum,alltargets,showanimation)
          attacker.pbRecoverHP(((attacker.totalhp+1)/2).floor,true)
          @battle.pbDisplay(_INTL("{1}'s HP was restored.",attacker.pbThis))
          return 0
        end
      end
    end
    This is what you should have in your moves.txt file (you can change the MoveID)
    Code:
    650,PURIFY,Purify,CF3,0,POISON,Status,0,20,0,00,0,bc,"The user heals the target's status condition. If it succeeds, it also restores it's own HP."
    If you want to use this overcomplicated piece of code, feel free to!
     
    Last edited by a moderator:
    14
    Posts
    7
    Years
    • Seen today
    Thank you for making this! I've been trying to implement the Seventh-Gen moves myself, and this will help out a lot. Don't worry about this being over-complicated; from what I've seen, this looks fine. Keep up the good work!
     
    Back
    Top