- 57
- Posts
- 5
- Years
- Seen Apr 17, 2022
Hello everyone.
I need to create a move One-Hit K.O, which always hits, and also heals the pokemon from the state effects. I have created this code, from the K.O moves. But equal to failed, I think I have removed the part where I calculated the probability of failure. Have I done it or not? If anyone could tell me, thank you.
(This is my first script, surely this is very bad)
I need to create a move One-Hit K.O, which always hits, and also heals the pokemon from the state effects. I have created this code, from the K.O moves. But equal to failed, I think I have removed the part where I calculated the probability of failure. Have I done it or not? If anyone could tell me, thank you.
(This is my first script, surely this is very bad)
Spoiler:
Code:
class PokeBattle_Move_159 < PokeBattle_Move
def pbAccuracyCheck(attacker,opponent)
if !attacker.hasMoldBreaker && opponent.hasWorkingAbility(:STURDY)
@battle.pbDisplay(_INTL("{1} was protected by {2}!",opponent.pbThis,PBAbilities.getName(opponent.ability)))
return false
end
end
def pbEffect(attacker,opponent,hitnum=0,alltargets=nil,showanimation=true)
damage=pbEffectFixedDamage(opponent.totalhp,attacker,opponent,hitnum,alltargets,showanimation)
if opponent.fainted?
@battle.pbDisplay(_INTL("It's a one-hit KO!"))
end
return damage
end
def pbEffect(attacker,opponent,hitnum=0,alltargets=nil,showanimation=true)
if attacker.status!=PBStatuses::BURN &&
attacker.status!=PBStatuses::POISON &&
attacker.status!=PBStatuses::PARALYSIS
@battle.pbDisplay(_INTL("But it failed!"))
return -1
else
t=attacker.status
attacker.pbCureStatus(false)
pbShowAnimation(@id,attacker,nil,hitnum,alltargets,showanimation)
if t==PBStatuses::BURN
@battle.pbDisplay(_INTL("{1} healed its burn!",attacker.pbThis))
elsif t==PBStatuses::POISON
@battle.pbDisplay(_INTL("{1} cured its poisoning!",attacker.pbThis))
elsif t==PBStatuses::PARALYSIS
@battle.pbDisplay(_INTL("{1} cured its paralysis!",attacker.pbThis))
end
return 0
end
end
end