In PokeBattle_Battler, where is Trace:
Code:
# Trace
if self.hasWorkingAbility(:TRACE)
choices=[]
for i in 0...4
[email protected][i]
if pbIsOpposing?(i) && !foe.fainted?
abil=foe.ability
if abil>0 &&
!isConst?(abil,PBAbilities,:TRACE) &&
!isConst?(abil,PBAbilities,:MULTITYPE) &&
!isConst?(abil,PBAbilities,:ILLUSION) &&
!isConst?(abil,PBAbilities,:FLOWERGIFT) &&
!isConst?(abil,PBAbilities,:IMPOSTER) &&
!isConst?(abil,PBAbilities,:STANCECHANGE) &&
[COLOR="Red"]!isConst?(abil,PBAbilities,:COMATOSE) &&[/COLOR]
!isConst?(abil,PBAbilities,:BATTLEBOND) &&
!isConst?(abil,PBAbilities,:POWERCONSTRUCT) &&
!isConst?(abil,PBAbilities,:DISGUISE) &&
!isConst?(abil,PBAbilities,:POWEROFALCHEMY) &&
!isConst?(abil,PBAbilities,:RECEIVER) &&
!isConst?(abil,PBAbilities,:RKSSYSTEM) &&
!isConst?(abil,PBAbilities,:SCHOOLING) &&
!isConst?(abil,PBAbilities,:SHIELDSDOWN)
choices.push(i)
end
end
end
below, in def pbEffectsOnDealingDamage:
Code:
if target.hasWorkingAbility(:MUMMY,true) && !user.fainted?
if !isConst?(user.ability,PBAbilities,:MULTITYPE) &&
!isConst?(user.ability,PBAbilities,:STANCECHANGE) &&
!isConst?(user.ability,PBAbilities,:MUMMY) &&
!isConst?(user.ability,PBAbilities,:DISGUISE) &&
[COLOR="red"]!isConst?(user.ability,PBAbilities,:COMATOSE) &&[/COLOR]
!isConst?(user.ability,PBAbilities,:BATTLEBOND) &&
!isConst?(user.ability,PBAbilities,:RKSSYSTEM) &&
!isConst?(user.ability,PBAbilities,:SCHOOLING) &&
!isConst?(user.ability,PBAbilities,:SHIELDSDOWN)
PBDebug.log("[Ability triggered] #{target.pbThis}'s Mummy copied onto #{user.pbThis(true)}")
user.ability=getConst(PBAbilities,:MUMMY) || 0
@battle.pbDisplay(_INTL("{1} was mummified by {2}!",
user.pbThis,target.pbThis(true)))
end
end
below, where is Power of Alchemy, Receiver (if you don´t have this, skip):
Code:
# Power of Alchemy, Receiver
if (user.hasWorkingAbility(:POWEROFALCHEMY) ||
user.hasWorkingAbility(:RECEIVER)) && @battle.doublebattle &&
user.pbPartner.fainted?
usable=false
abil=user.pbPartner.ability
if abil>0 &&
!isConst?(abil,PBAbilities,:POWEROFALCHEMY) &&
!isConst?(abil,PBAbilities,:TRACE) &&
!isConst?(abil,PBAbilities,:MULTITYPE) &&
!isConst?(abil,PBAbilities,:ILLUSION) &&
!isConst?(abil,PBAbilities,:FLOWERGIFT) &&
!isConst?(abil,PBAbilities,:IMPOSTER) &&
!isConst?(abil,PBAbilities,:STANCECHANGE) &&
[COLOR="red"]!isConst?(abil,PBAbilities,:COMATOSE) &&[/COLOR]
!isConst?(abil,PBAbilities,:BATTLEBOND) &&
!isConst?(abil,PBAbilities,:POWERCONSTRUCT) &&
!isConst?(abil,PBAbilities,:RECEIVER) &&
!isConst?(abil,PBAbilities,:FORECAST) &&
!isConst?(abil,PBAbilities,:WONDERGUARD) &&
!isConst?(abil,PBAbilities,:DISGUISE) &&
!isConst?(abil,PBAbilities,:ZENMODE) &&
!isConst?(abil,PBAbilities,:SCHOOLING) &&
!isConst?(abil,PBAbilities,:SHIELDSDOWN) &&
!isConst?(abil,PBAbilities,:RKSSYSTEM)
usable=true
end
if usable
abilityname=PBAbilities.getName(abil)
PBDebug.log("[Ability triggered] #{user.pbThis}'s #{PBAbilities.getName(user.ability)} turned into #{abilityname} from #{user.pbPartner}")
user.ability=abil
@battle.pbDisplay(_INTL("{1} copied {2}'s {3}!",user.pbThis,user.pbPartner,abilityname))
end
end
below, in def pbSuccessCheck replace this
Code:
# TODO: "Before Protect" applies to Counter/Mirror Coat
if thismove.function==0xDE && target.status!=PBStatuses::SLEEP # Dream Eater
@battle.pbDisplay(_INTL("{1} wasn't affected!",target.pbThis))
PBDebug.log("[Move failed] #{user.pbThis}'s Dream Eater's target isn't asleep")
return false
end
with this:
Code:
[COLOR="Red"]# TODO: "Before Protect" applies to Counter/Mirror Coat
if thismove.function==0xDE && # Dream Eater
target.status!=PBStatuses::SLEEP && (!target.hasWorkingAbility(:COMATOSE) || !isConst?(target.species,PBSpecies,:KOMALA))
@battle.pbDisplay(_INTL("{1} wasn't affected!",target.pbThis))
PBDebug.log("[Move failed] #{user.pbThis}'s Dream Eater's target isn't asleep")
return false
end[/COLOR]
In PokeBattle_BattlerEffects, where is Sleep:
Code:
def pbCanSleep?(attacker,showMessages,move=nil,ignorestatus=false)
return false if fainted?
[COLOR="red"]return false if self.hasWorkingAbility(:COMATOSE) && isConst?(self.species,PBSpecies,:KOMALA)[/COLOR]
return false if self.hasWorkingAbility(:SHIELDSDOWN) &&
isConst?(self.species,PBSpecies,:MINIOR) &&
self.form==0
selfsleep=(attacker && attacker.index==self.index)
more below:
Code:
def pbCanSleepYawn?
return false if status!=0
[COLOR="red"]return false if self.hasWorkingAbility(:COMATOSE) && isConst?(self.species,PBSpecies,:KOMALA)[/COLOR]
return false if self.hasWorkingAbility(:SHIELDSDOWN) &&
isConst?(self.species,PBSpecies,:MINIOR) &&
self.form==0
more below:
Code:
def pbSleepSelf(duration=-1)
[COLOR="red"]return false if self.hasWorkingAbility(:COMATOSE)[/COLOR]
return false if self.hasWorkingAbility(:SHIELDSDOWN) &&
isConst?(self.species,PBSpecies,:MINIOR) &&
self.form==0
self.status=PBStatuses::SLEEP
more below, where is Poison:
Code:
def pbCanPoison?(attacker,showMessages,move=nil)
return false if fainted?
[COLOR="red"]return false if self.hasWorkingAbility(:COMATOSE) && isConst?(self.species,PBSpecies,:KOMALA)[/COLOR]
return false if self.hasWorkingAbility(:SHIELDSDOWN) &&
isConst?(self.species,PBSpecies,:MINIOR) &&
self.form==0
more below:
Code:
def pbCanPoisonSynchronize?(opponent)
return false if fainted?
[COLOR="red"]return false if self.hasWorkingAbility(:COMATOSE) && isConst?(self.species,PBSpecies,:KOMALA)[/COLOR]
return false if self.hasWorkingAbility(:SHIELDSDOWN) &&
isConst?(self.species,PBSpecies,:MINIOR) &&
self.form==0
more below:
Code:
def pbCanPoisonSpikes?(moldbreaker=false)
return false if fainted?
return false if self.status!=0
return false if pbHasType?(:POISON) || pbHasType?(:STEEL)
[COLOR="red"]return false if self.hasWorkingAbility(:COMATOSE) && isConst?(self.species,PBSpecies,:KOMALA)[/COLOR]
return false if self.hasWorkingAbility(:SHIELDSDOWN) &&
isConst?(self.species,PBSpecies,:MINIOR) &&
self.form==0
more below, where is Burn:
Code:
def pbCanBurn?(attacker,showMessages,move=nil)
return false if fainted?
[COLOR="red"]return false if self.hasWorkingAbility(:COMATOSE) && isConst?(self.species,PBSpecies,:KOMALA)[/COLOR]
return false if self.hasWorkingAbility(:SHIELDSDOWN) &&
isConst?(self.species,PBSpecies,:MINIOR) &&
self.form==0
return false if self.hasWorkingAbility(:WATERBUBBLE)
more below:
Code:
def pbCanBurnSynchronize?(opponent)
return false if fainted?
return false if self.status!=0
[COLOR="red"]return false if self.hasWorkingAbility(:COMATOSE) && isConst?(self.species,PBSpecies,:KOMALA)[/COLOR]
return false if self.hasWorkingAbility(:SHIELDSDOWN) &&
isConst?(self.species,PBSpecies,:MINIOR) &&
self.form==0
return false if self.hasWorkingAbility(:WATERBUBBLE)
more below, where is Paralyze:
Code:
def pbCanParalyze?(attacker,showMessages,move=nil)
return false if fainted?
[COLOR="red"]return false if self.hasWorkingAbility(:COMATOSE) && isConst?(self.species,PBSpecies,:KOMALA)[/COLOR]
return false if self.hasWorkingAbility(:SHIELDSDOWN) &&
isConst?(self.species,PBSpecies,:MINIOR) &&
self.form==0
more below:
Code:
def pbCanParalyzeSynchronize?(opponent)
return false if self.status!=0
[COLOR="red"]return false if self.hasWorkingAbility(:COMATOSE) && isConst?(self.species,PBSpecies,:KOMALA)[/COLOR]
return false if self.hasWorkingAbility(:SHIELDSDOWN) &&
isConst?(self.species,PBSpecies,:MINIOR) &&
self.form==0
return false if @battle.field.effects[PBEffects::MistyTerrain]>0 && !self.isAirborne?
more below, where is Freeze:
Code:
def pbCanFreeze?(attacker,showMessages,move=nil)
return false if fainted?
[COLOR="red"]return false if self.hasWorkingAbility(:COMATOSE) && isConst?(self.species,PBSpecies,:KOMALA)[/COLOR]
return false if self.hasWorkingAbility(:SHIELDSDOWN) &&
isConst?(self.species,PBSpecies,:MINIOR) &&
self.form==0
In PokeBattle_MoveEffects, where is Snore, replace this
Code:
def pbMoveFailed(attacker,opponent)
return (attacker.status!=PBStatuses::SLEEP)
end
with this
Code:
[COLOR="red"]def pbMoveFailed(attacker,opponent)
return attacker.status!=PBStatuses::SLEEP &&
(!attacker.hasWorkingAbility(:COMATOSE) ||
!isConst?(attacker.species,PBSpecies,:KOMALA))
end[/COLOR]
below, where is Simple Beam:
Code:
if isConst?(opponent.ability,PBAbilities,:MULTITYPE) ||
isConst?(opponent.ability,PBAbilities,:SIMPLE) ||
isConst?(opponent.ability,PBAbilities,:STANCECHANGE) ||
isConst?(opponent.ability,PBAbilities,:TRUANT) ||
isConst?(opponent.ability,PBAbilities,:DISGUISE) ||
[COLOR="red"]isConst?(opponent.ability,PBAbilities,:COMATOSE) ||[/COLOR]
isConst?(opponent.ability,PBAbilities,:BATTLEBOND) ||
isConst?(opponent.ability,PBAbilities,:RKSSYSTEM) ||
isConst?(opponent.ability,PBAbilities,:SCHOOLING) ||
isConst?(opponent.ability,PBAbilities,:SHIELDSDOWN)
@battle.pbDisplay(_INTL("But it failed!"))
return -1
end
below, where is Worry Seed:
Code:
if isConst?(opponent.ability,PBAbilities,:MULTITYPE) ||
isConst?(opponent.ability,PBAbilities,:INSOMNIA) ||
isConst?(opponent.ability,PBAbilities,:STANCECHANGE) ||
isConst?(opponent.ability,PBAbilities,:TRUANT) ||
isConst?(opponent.ability,PBAbilities,:DISGUISE) ||
[COLOR="red"]isConst?(opponent.ability,PBAbilities,:COMATOSE) ||[/COLOR]
isConst?(opponent.ability,PBAbilities,:BATTLEBOND) ||
isConst?(opponent.ability,PBAbilities,:RKSSYSTEM) ||
isConst?(opponent.ability,PBAbilities,:SCHOOLING) ||
isConst?(opponent.ability,PBAbilities,:SHIELDSDOWN)
@battle.pbDisplay(_INTL("But it failed!"))
return -1
end
below, where is Role Play:
Code:
if opponent.ability==0 ||
attacker.ability==opponent.ability ||
isConst?(attacker.ability,PBAbilities,:MULTITYPE) ||
isConst?(attacker.ability,PBAbilities,:STANCECHANGE) ||
isConst?(opponent.ability,PBAbilities,:FLOWERGIFT) ||
isConst?(opponent.ability,PBAbilities,:FORECAST) ||
isConst?(opponent.ability,PBAbilities,:ILLUSION) ||
isConst?(opponent.ability,PBAbilities,:IMPOSTER) ||
isConst?(opponent.ability,PBAbilities,:MULTITYPE) ||
isConst?(opponent.ability,PBAbilities,:STANCECHANGE) ||
isConst?(opponent.ability,PBAbilities,:TRACE) ||
isConst?(opponent.ability,PBAbilities,:WONDERGUARD) ||
isConst?(opponent.ability,PBAbilities,:ZENMODE) ||
isConst?(opponent.ability,PBAbilities,:DISGUISE) ||
[COLOR="red"]isConst?(opponent.ability,PBAbilities,:COMATOSE) ||[/COLOR]
isConst?(opponent.ability,PBAbilities,:BATTLEBOND) ||
isConst?(opponent.ability,PBAbilities,:POWEROFALCHEMY) ||
isConst?(opponent.ability,PBAbilities,:RECEIVER) ||
isConst?(opponent.ability,PBAbilities,:RKSSYSTEM) ||
isConst?(opponent.ability,PBAbilities,:SCHOOLING) ||
isConst?(opponent.ability,PBAbilities,:SHIELDSDOWN)
@battle.pbDisplay(_INTL("But it failed!"))
return -1
end
below, where is Entrainment:
Code:
if attacker.ability==0 ||
attacker.ability==opponent.ability ||
isConst?(opponent.ability,PBAbilities,:FLOWERGIFT) ||
isConst?(opponent.ability,PBAbilities,:IMPOSTER) ||
isConst?(opponent.ability,PBAbilities,:MULTITYPE) ||
isConst?(opponent.ability,PBAbilities,:STANCECHANGE) ||
isConst?(opponent.ability,PBAbilities,:TRACE) ||
isConst?(opponent.ability,PBAbilities,:TRUANT) ||
isConst?(opponent.ability,PBAbilities,:ZENMODE) ||
isConst?(attacker.ability,PBAbilities,:FLOWERGIFT) ||
isConst?(attacker.ability,PBAbilities,:FORECAST) ||
isConst?(attacker.ability,PBAbilities,:ILLUSION) ||
isConst?(attacker.ability,PBAbilities,:IMPOSTER) ||
isConst?(attacker.ability,PBAbilities,:STANCECHANGE) ||
isConst?(attacker.ability,PBAbilities,:TRACE) ||
isConst?(attacker.ability,PBAbilities,:ZENMODE) ||
[COLOR="red"]isConst?(opponent.ability,PBAbilities,:COMATOSE) ||
isConst?(attacker.ability,PBAbilities,:COMATOSE) ||[/COLOR]
isConst?(opponent.ability,PBAbilities,:BATTLEBOND) ||
isConst?(attacker.ability,PBAbilities,:BATTLEBOND) ||
isConst?(opponent.ability,PBAbilities,:POWERCONSTRUCT) ||
isConst?(attacker.ability,PBAbilities,:POWERCONSTRUCT) ||
isConst?(attacker.ability,PBAbilities,:POWEROFALCHEMY) ||
isConst?(attacker.ability,PBAbilities,:RECEIVER) ||
isConst?(opponent.ability,PBAbilities,:RKSSYSTEM) ||
isConst?(opponent.ability,PBAbilities,:SCHOOLING) ||
isConst?(opponent.ability,PBAbilities,:SHIELDSDOWN)
@battle.pbDisplay(_INTL("But it failed!"))
return -1
end
below, where is Skill Swap:
Code:
if (attacker.ability==0 && opponent.ability==0) ||
(attacker.ability==opponent.ability && !USENEWBATTLEMECHANICS) ||
isConst?(attacker.ability,PBAbilities,:ILLUSION) ||
isConst?(opponent.ability,PBAbilities,:ILLUSION) ||
isConst?(attacker.ability,PBAbilities,:MULTITYPE) ||
isConst?(opponent.ability,PBAbilities,:MULTITYPE) ||
isConst?(attacker.ability,PBAbilities,:STANCECHANGE) ||
isConst?(opponent.ability,PBAbilities,:STANCECHANGE) ||
isConst?(attacker.ability,PBAbilities,:WONDERGUARD) ||
isConst?(opponent.ability,PBAbilities,:WONDERGUARD) ||
[COLOR="red"]isConst?(attacker.ability,PBAbilities,:COMATOSE) ||
isConst?(opponent.ability,PBAbilities,:COMATOSE) ||[/COLOR]
isConst?(attacker.ability,PBAbilities,:BATTLEBOND) ||
isConst?(opponent.ability,PBAbilities,:BATTLEBOND) ||
isConst?(opponent.ability,PBAbilities,:POWERCONSTRUCT) ||
isConst?(attacker.ability,PBAbilities,:POWERCONSTRUCT) ||
isConst?(opponent.ability,PBAbilities,:RKSSYSTEM) ||
isConst?(attacker.ability,PBAbilities,:RKSSYSTEM) ||
isConst?(opponent.ability,PBAbilities,:SCHOOLING) ||
isConst?(attacker.ability,PBAbilities,:SCHOOLING) ||
isConst?(opponent.ability,PBAbilities,:SHIELDSDOWN) ||
isConst?(attacker.ability,PBAbilities,:SHIELDSDOWN)
@battle.pbDisplay(_INTL("But it failed!"))
return -1
end
below, where is Gastro Acid:
Code:
if isConst?(opponent.ability,PBAbilities,:MULTITYPE) ||
isConst?(opponent.ability,PBAbilities,:STANCECHANGE) ||
isConst?(opponent.ability,PBAbilities,:DISGUISE) ||
[COLOR="red"] isConst?(opponent.ability,PBAbilities,:COMATOSE) ||[/COLOR]
isConst?(opponent.ability,PBAbilities,:BATTLEBOND) ||
isConst?(opponent.ability,PBAbilities,:POWERCONSTRUCT) ||
isConst?(opponent.ability,PBAbilities,:RKSSYSTEM) ||
isConst?(opponent.ability,PBAbilities,:SCHOOLING) ||
isConst?(opponent.ability,PBAbilities,:SHIELDSDOWN)
@battle.pbDisplay(_INTL("But it failed!"))
return -1
end
below, where is Wake-Up Slap, replace
Code:
def pbBaseDamage(basedmg,attacker,opponent)
if opponent.status==PBStatuses::SLEEP &&
(opponent.effects[PBEffects::Substitute]==0 || ignoresSubstitute?(attacker))
return basedmg*2
end
return basedmg
end
with
Code:
[COLOR="red"]def pbBaseDamage(basedmg,attacker,opponent)
if (opponent.status==PBStatuses::SLEEP &&
(opponent.effects[PBEffects::Substitute]==0 ||
ignoresSubstitute?(attacker))) || (opponent.hasWorkingAbility(:COMATOSE) &&
isConst(opponent.species,PBSpecies,:KOMALA) &&
(opponent.effects[PBEffects::Substitute]==0 || ignoresSubstitute?(attacker)))
return basedmg*2
end
return basedmg
end[/COLOR]
below, where is Hex, replace
Code:
class PokeBattle_Move_07F < PokeBattle_Move
def pbBaseDamage(basedmg,attacker,opponent)
if opponent.status>0 &&
(opponent.effects[PBEffects::Substitute]==0 || ignoresSubstitute?(attacker))
return basedmg*2
end
return basedmg
end
end
with
Code:
[COLOR="red"]class PokeBattle_Move_07F < PokeBattle_Move
def pbBaseDamage(basedmg,attacker,opponent)
if (opponent.status>0 &&
(opponent.effects[PBEffects::Substitute]==0 ||
ignoresSubstitute?(attacker))) || (opponent.hasWorkingAbility(:COMATOSE) &&
isConst?(opponent.species,PBSpecies,:KOMALA) &&
(opponent.effects[PBEffects::Substitute]==0 || ignoresSubstitute?(attacker)))
return basedmg*2
end
return basedmg
end
end[/COLOR]
below, where is Sleep Talk:
Code:
def pbEffect(attacker,opponent,hitnum=0,alltargets=nil,showanimation=true)
if attacker.status!=PBStatuses::SLEEP [COLOR="red"]&&
(!attacker.hasWorkingAbility(:COMATOSE) ||
!isConst?(attacker.species,PBSpecies,:KOMALA))[/COLOR]
@battle.pbDisplay(_INTL("But it failed!"))
return -1
end
below, where is Nightmare, replace
Code:
if opponent.status!=PBStatuses::SLEEP || opponent.effects[PBEffects::Nightmare] ||
(opponent.effects[PBEffects::Substitute]>0 && !ignoresSubstitute?(attacker))
@battle.pbDisplay(_INTL("But it failed!"))
return -1
end
with
Code:
[COLOR="red"]if (opponent.status!=PBStatuses::SLEEP || opponent.effects[PBEffects::Nightmare] ||
(opponent.effects[PBEffects::Substitute]>0 && !ignoresSubstitute?(attacker))) &&
(!opponent.hasWorkingAbility(:COMATOSE) ||
isConst?(opponent.species,PBSpecies,:KOMALA) || opponent.effects[PBEffects::Nightmare] ||
(opponent.effects[PBEffects::Substitute]>0 && !ignoresSubstitute?(attacker)))
@battle.pbDisplay(_INTL("But it failed!"))
return -1
end[/COLOR]
where is Core Enforcer (if you don´t have this, skip):
Code:
if isConst?(opponent.ability,PBAbilities,:MULTITYPE) ||
isConst?(opponent.ability,PBAbilities,:STANCECHANGE) ||
isConst?(opponent.ability,PBAbilities,:DISGUISE) ||
[COLOR="red"]isConst?(opponent.ability,PBAbilities,:COMATOSE) ||[/COLOR]
isConst?(opponent.ability,PBAbilities,:BATTLEBOND) ||
isConst?(opponent.ability,PBAbilities,:POWERCONSTRUCT) ||
isConst?(opponent.ability,PBAbilities,:RKSSYSTEM) ||
isConst?(opponent.ability,PBAbilities,:SCHOOLING) ||
isConst?(opponent.ability,PBAbilities,:SHIELDSDOWN)
return
end
In PokeBattle_Battle, where is Nightmare:
Code:
# Nightmare
if i.effects[PBEffects::Nightmare]
if i.status==PBStatuses::SLEEP [COLOR="red"]|| (i.hasWorkingAbility(:COMATOSE) &&
isConst?(i.species,PBSpecies,:KOMALA))[/COLOR]
if !i.hasWorkingAbility(:MAGICGUARD)
PBDebug.log("[Lingering effect triggered] #{i.pbThis}'s nightmare")
i.pbReduceHP((i.totalhp/4).floor,true)
pbDisplay(_INTL("{1} is locked in a nightmare!",i.pbThis))
end
else
i.effects[PBEffects::Nightmare]=false
end
end
if i.fainted?
return if !i.pbFaint
next
end
end
below, where is Bad Dreams, replace
Code:
# Bad Dreams
if i.status==PBStatuses::SLEEP && !i.hasWorkingAbility(:MAGICGUARD)
if i.pbOpposing1.hasWorkingAbility(:BADDREAMS) ||
i.pbOpposing2.hasWorkingAbility(:BADDREAMS)
PBDebug.log("[Ability triggered] #{i.pbThis}'s opponent's Bad Dreams")
hploss=i.pbReduceHP((i.totalhp/8).floor,true)
pbDisplay(_INTL("{1} is having a bad dream!",i.pbThis)) if hploss>0
end
end
if i.fainted?
return if !i.pbFaint
next
end
with
Code:
[COLOR="red"]# Bad Dreams
if (i.status==PBStatuses::SLEEP && !i.hasWorkingAbility(:MAGICGUARD)) ||
(i.hasWorkingAbility(:COMATOSE) && isConst?(i.species,PBSpecies,:KOMALA))
if i.pbOpposing1.hasWorkingAbility(:BADDREAMS) ||
i.pbOpposing2.hasWorkingAbility(:BADDREAMS)
PBDebug.log("[Ability triggered] #{i.pbThis}'s opponent's Bad Dreams")
hploss=i.pbReduceHP((i.totalhp/8).floor,true)
pbDisplay(_INTL("{1} is having a bad dream!",i.pbThis)) if hploss>0
end
end
if i.fainted?
return if !i.pbFaint
next
end[/COLOR]