- 15
- Posts
- 7
- Years
- Seen May 6, 2021
i was wondering if i formatted these right? Corrupt Heart is like Bad Dreams but affects all statuses and Snowbank increases Def and SpDef if hit with Water or Ice Moves. sorry imma noob at scripting i not really sure how to format scripts with multiple "variables" for lack of a better word. XD
# Corrupt Heart
if i.status==PBStatuses::SLEEP || BURN || POISON || FROZEN || PARALYSIS && !i.hasWorkingAbility(:MAGICGUARD)
if i.pbOpposing1.hasWorkingAbility(:CORRUPTHEART) ||
i.pbOpposing2.hasWorkingAbility(:CORRUPTHEART)
PBDebug.log("[Ability triggered] #{i.pbThis}'s opponent's Corrupt Heart")
hploss=i.pbReduceHP((i.totalhp/8).floor,true)
pbDisplay(_INTL("{1} is being affected!",i.pbThis)) if hploss>0
end
end
if i.isFainted?
return if !i.pbFaint
next
end
if opponent.hasWorkingAbility(:SNOWBANK) && isConst?(type,PBTypes,:WATER) || (type,PBTypes,:ICE)
PBDebug.log("[Ability triggered] #{opponent.pbThis}'s Snow Bank (made #{@name} ineffective)")
if opponent.pbCanIncreaseStatStage?(PBStats::DEFENSE,opponent) &&
opponent.pbIncreaseStatWithCause(PBStats::DEFENSE,1,opponent,PBAbilities.getName(opponent.ability))
opponent.pbCanIncreaseStatStage?(PBStats::SPDEF,opponent)
opponent.pbIncreaseStatWithCause(PBStats::SPDEF,1,opponent,PBAbilities.getName(opponent.ability))
else
@battle.pbDisplay(_INTL("{1}'s {2} made {3} ineffective!",
opponent.pbThis,PBAbilities.getName(opponent.ability),self.name))
end
return true
end
# Corrupt Heart
if i.status==PBStatuses::SLEEP || BURN || POISON || FROZEN || PARALYSIS && !i.hasWorkingAbility(:MAGICGUARD)
if i.pbOpposing1.hasWorkingAbility(:CORRUPTHEART) ||
i.pbOpposing2.hasWorkingAbility(:CORRUPTHEART)
PBDebug.log("[Ability triggered] #{i.pbThis}'s opponent's Corrupt Heart")
hploss=i.pbReduceHP((i.totalhp/8).floor,true)
pbDisplay(_INTL("{1} is being affected!",i.pbThis)) if hploss>0
end
end
if i.isFainted?
return if !i.pbFaint
next
end
if opponent.hasWorkingAbility(:SNOWBANK) && isConst?(type,PBTypes,:WATER) || (type,PBTypes,:ICE)
PBDebug.log("[Ability triggered] #{opponent.pbThis}'s Snow Bank (made #{@name} ineffective)")
if opponent.pbCanIncreaseStatStage?(PBStats::DEFENSE,opponent) &&
opponent.pbIncreaseStatWithCause(PBStats::DEFENSE,1,opponent,PBAbilities.getName(opponent.ability))
opponent.pbCanIncreaseStatStage?(PBStats::SPDEF,opponent)
opponent.pbIncreaseStatWithCause(PBStats::SPDEF,1,opponent,PBAbilities.getName(opponent.ability))
else
@battle.pbDisplay(_INTL("{1}'s {2} made {3} ineffective!",
opponent.pbThis,PBAbilities.getName(opponent.ability),self.name))
end
return true
end