- 37
- Posts
- 8
- Years
- Seen Jan 21, 2021
I'm trying to update my old working scripts from v16 to v18 and ran into a syntax error in v18 with several variations on the following attempt:
I have a feeling it has something to do with the !b use, which I got from Bad Dreams, replacing the previous "target" language I copied from Static, as well as replacing "user" from Static with "Battler". Basically I tried combining the scripts for Intimidate and Static (using the battlehandler of the former in v18), which seemed to work in v16 here:
I then thought to base it off the battlerhandler for Synchronize, but that requires a status in the proc. Would I need to make a new battlerhandler (how?) or am I just messing up something in the syntax? Any help is much appreciated.
Code:
BattleHandlers::AbilityOnSwitchIn.add(:VOLTAICGAZE,
proc { |ability,battler,battle|
battle.eachOtherSideBattler(battler.index) do |b|
next if !b.near?(battler)
next if !b.paralyzed? || battle.pbRandom(100)>=30
battle.pbShowAbilitySplash(battler)
if user.pbCanParalyze?(!b,PokeBattle_SceneConstants::USE_ABILITY_SPLASH)
msg = nil
if !PokeBattle_SceneConstants::USE_ABILITY_SPLASH
msg = _INTL("{1}'s {2} paralyzed {3}! It may be unable to move!",
battler.pbThis,!b.abilityName,battler.pbThis(true))
end
!b.pbParalyze(battler,msg)
end
battle.pbHideAbilitySplash(battler)
}
)
I have a feeling it has something to do with the !b use, which I got from Bad Dreams, replacing the previous "target" language I copied from Static, as well as replacing "user" from Static with "Battler". Basically I tried combining the scripts for Intimidate and Static (using the battlehandler of the former in v18), which seemed to work in v16 here:
Code:
# Voltaic Gaze
if self.hasWorkingAbility(:VOLTAICGAZE) && onactive && @battle.pbRandom(10)<3
PBDebug.log("[Ability triggered] #{pbThis}'s Voltaic Gaze")
for i in 0...4
if pbIsOpposing?(i) && [email protected][i].isFainted?
@battle.battlers[i].pbParalyze(self)
end
end
end