The PokéCommunity Forums Fan Games Game Development Scripts & Tutorials
Essentials Tutorial Sun and Moon Purify Move

Scripts & Tutorials This forum is for scripts and code, as well as all kinds of tutorials, software, tools and so forth. Remember to give credit!
The thread revival limit does not apply here.


Reply
 
Thread Tools
  #1    
Old December 22nd, 2016 (7:33 AM). Edited December 22nd, 2016 by mej71.
Marin's Avatar
Marin Marin is offline
Not Bored
 
Join Date: Nov 2016
Age: 16
Gender: Other
Posts: 672
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!
Reply With Quote

Relevant Advertising!

  #2    
Old December 27th, 2016 (8:15 AM).
Lord_Chespin Lord_Chespin is offline
     
    Join Date: Sep 2016
    Gender: Male
    Posts: 8
    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!
    Reply With Quote
    Reply

    Quick Reply

    Join the conversation!

    Create an account to post a reply in this thread, participate in other discussions, and more!

    Create a PokéCommunity Account

    Sponsored Links
    Thread Tools

    Posting Rules
    You may not post new threads
    You may not post replies
    You may not post attachments
    You may not edit your posts

    BB code is On
    Smilies are On
    [IMG] code is On
    HTML code is Off

    Forum Jump


    All times are GMT -8. The time now is 6:09 AM.