- 971
- Posts
- 8
- Years
- Age 22
- 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:
This is what you should have in your moves.txt file (you can change the MoveID)
If you want to use this overcomplicated piece of code, feel free to!
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
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."
Last edited by a moderator: