- 3
- Posts
- 12
- Years
- Seen Feb 2, 2021
Hello, this is my first time posting in this forum in years, but hopefully someone can help me!
Basically, I'm trying to make EBS and Z-moves compatible. I'm using Marcello's Z-moves script posted by Amethyst and kindly ported over to 17.2 by Tea-Rex.
Currently, I have it so when a Pokemon has a Z-Crystal and uses a Z-move, the script can tell if the Z-Move is valid or not correctly, so that functionality is down. Same with one Z-move per battle. The problem is that Pokemon without Z-Crystals or Mega Stones have Z-moves available to them. It isn't just that the button is drawn up, it's that they have full access to them.
Z-Moves are done in the UI similarly as Mega Evolution is, below is an example:
And below is how the inputs are dealt with:
I tried messing around with the code above, but that didn't really fix the issue. On the bright side, using a Z-move with a Pokemon not holding a Z-Crystal does disable Z-moves for the rest of the fight, even for Pokemon holding a Z-Crystal, so I know that much is working fine.
If anyone could point me in the right direction, I'd really appreciate it!
Basically, I'm trying to make EBS and Z-moves compatible. I'm using Marcello's Z-moves script posted by Amethyst and kindly ported over to 17.2 by Tea-Rex.
Currently, I have it so when a Pokemon has a Z-Crystal and uses a Z-move, the script can tell if the Z-Move is valid or not correctly, so that functionality is down. Same with one Z-move per battle. The problem is that Pokemon without Z-Crystals or Mega Stones have Z-moves available to them. It isn't just that the button is drawn up, it's that they have full access to them.
Z-Moves are done in the UI similarly as Mega Evolution is, below is an example:
Spoiler:
Code:
mega = false
zmove = false
[email protected][index]
cw.megaButton if (@battle.pbCanMegaEvolve?(index) && [email protected]?(index))
cw.zButton if @battle.pbCanZMove?(index)
cw.battler=battler
And below is how the inputs are dealt with:
Spoiler:
Code:
if Input.trigger?(Input::C) || (defined?($mouse) && cw.mouseOver? && $mouse.leftClick?) # UPDATED C TRIGGER
if (cw.index < 4 && [email protected]?(index))
@ret=cw.index
@battle.pbRegisterMegaEvolution(index) if mega
pbSEPlay("SE_Select2")
@lastmove[index]=@ret
@idleTimer=-1
@inCMx=false
break
elsif (@battle.pbCanZMove?(index))
if cw.index < 4
@ret=cw.index
@battler = battler
@battle.pbRegisterZMove(index) if zmove
if @battler.pbCompatibleZMoveFromIndex?(@ret)
pbSEPlay("SE_Select2")
@lastmove[index]=@ret
@idleTimer=-1
@inCMx=false
break
else
Kernel.pbMessage(_INTL("{1} is not compatible with {2}!",PBMoves.getName(battler.moves[@ret]),PBItems.getName(battler.item)))
cw.zButtonTrigger
@lastmove[index]=cw.index
pbPlayCancelSE()
@ret=-1
break
end
end
else
@lastmove[index]=cw.index
pbPlayCancelSE()
@ret=-1
break
end
elsif Input.trigger?(Input::A) || (defined?($mouse) && cw.overMega? && $mouse.leftClick?) # Use Mega Evolution
if (@battle.pbCanMegaEvolve?(index) && !pbIsZCrystal?(battler.item)) #If Z Move does not exist
if mega
mega = false
else
mega = true
end
cw.megaButtonTrigger
pbSEPlay("SE_Select3")
end
if @battle.pbCanZMove?(index) # Use Z Move instead
if zmove
zmove = false
else
zmove = true
end
cw.zButtonTrigger
pbSEPlay("SE_Select3")
end
elsif Input.trigger?(Input::B) || (defined?($mouse) && (cw.goBack? || $mouse.rightClick?)) # Cancel fight menu
@lastmove[index]=cw.index
pbPlayCancelSE()
@ret=-1
break
end
end
I tried messing around with the code above, but that didn't really fix the issue. On the bright side, using a Z-move with a Pokemon not holding a Z-Crystal does disable Z-moves for the rest of the fight, even for Pokemon holding a Z-Crystal, so I know that much is working fine.
If anyone could point me in the right direction, I'd really appreciate it!