- 37
- Posts
- 8
- Years
- Seen Jan 21, 2021
I'm trying to script a move that raises the user's Atk, lowers Spe, and lowers the foe's Atk (based on a pufferfish inflating). The following script works with the move set to "AllFoes" in the PBS, but causes the animation to occur on the opponent's side, which I'd like to change to the user's side. I'm able to do this by changing the PBS to "AllBattlers" but this also lowers the user's Atk (I could make the Atk increase 2 to offset this but that's starting to get rather ugly / excessive). Unless there's a way to shift the location of the animation (maybe something to do with ShowAnim?) I'm thinking I need to make the move class into one targeting the user primarily (i.e. PokeBattle_StatUpMove) and then add the second def effect for lowering the opponent's Atk afterward, but attempts at this have been causing errors. How would I go about scripting this? Here's what I'm working with so far:
Code:
class PokeBattle_Move_303 < PokeBattle_TargetStatDownMove
def initialize(battle,move)
super
@statDown = [PBStats::ATTACK,1]
end
def pbEffectGeneral(user)
if user.pbCanRaiseStatStage?(PBStats::ATTACK,user,self)
user.pbRaiseStatStage(PBStats::ATTACK,1,user)
end
showAnim = true
if user.pbCanLowerStatStage?(PBStats::SPEED,user,self)
if user.pbLowerStatStage(PBStats::SPEED,1,user,showAnim)
showAnim = true
end
end
end
end