Sigh, this chunk of code is really annoying lol. Every time I look at it, I notice something that makes it not work. This is the kind of thing that would take me 10 seconds to figure out if I was doing it myself, but with a hands-off approach I keep missing things.@Lucidious89 I removed the extra end and the game loaded so that is resolved. However I have the code placed aboveif damage>=target.hp
and now the pokemon faints when one hit KO or when there is multiple hits that KO it. The berry is consumed both ways. Any advice would be great. Also let me know if the script below is indeed correct or not.
The correct placement?:# Disguise takes the damage return if target.damageState.disguise if damage>=target.hp || damage==target.totalhp if target.hasActiveItem?(:MEGABERRY) && target.primal? target.damageState.megaBerry = true damage -= 1 end end # Target takes the damage if damage>=target.hp damage = target.hp # Survive a lethal hit with 1 HP effects if nonLethal?(user,target) damage -= 1 elsif target.effects[PBEffects::Endure] target.damageState.endured = true damage -= 1 elsif damage==target.totalhp if target.hasActiveAbility?(:STURDY) && !@battle.moldBreaker target.damageState.sturdy = true damage -= 1 elsif target.hasActiveItem?(:FOCUSSASH) && target.hp==target.totalhp target.damageState.focussash = true damage -= 1 elsif target.hasActiveItem?(:FOCUSBAND) && @battle.pbRandom(100)<10 target.damageState.focusBand = true damage -= 1 end end end damage = 0 if damage<0 target.damageState.hpLost = damage target.damageState.totalHPLost += damage end
Im just gonna write the whole code myself when i get home. Itll take twice the amount of work going back and forth describing what to move where.