- 60
- Posts
- 6
- Years
- The Ozone Layer
- Seen Feb 9, 2023
In the past week and a half I have been trying to get Mega evolution working in my fan game. The scripts available are not in my version (17.2) of Pokemon essentials and as such, trying to get my mega script working without sufficient knowledge nor the finding of up to date guides has left me a little stumped.
Could someone help me identify what to change in the Mega evolutions script so i can add my megas.
def pbCanMegaEvolve?(index)
return false if $game_switches[NO_MEGA_EVOLUTION]
return false if !@battlers[index].hasMega?
return false if pbIsOpposing?(index) && !@opponent
return true if $DEBUG && Input.press?(Input::CTRL)
return false if !pbHasMegaRing?(index)
side=(pbIsOpposing?(index)) ? 1 : 0
owner=pbGetOwnerIndex(index)
return false if @megaEvolution[side]!=-1
return false if @battlers[index].effects[PBEffects::SkyDrop]
return true
end
def pbRegisterMegaEvolution(index)
side=(pbIsOpposing?(index)) ? 1 : 0
owner=pbGetOwnerIndex(index)
@megaEvolution[side]=index
end
def pbMegaEvolve(index)
return if !@battlers[index] || !@battlers[index].pokemon
return if !(@battlers[index].hasMega? rescue false)
return if (@battlers[index].isMega? rescue true)
ownername=pbGetOwner(index).fullname
ownername=pbGetOwner(index).name if pbBelongsToPlayer?(index)
case (@battlers[index].pokemon.megaMessage rescue 0)
when 1 # Rayquaza
pbDisplay(_INTL("{1}'s fervent wish has reached {2}!",ownername,@battlers[index].pbThis))
else
pbDisplay(_INTL("{1}'s {2} is reacting to {3}'s {4}!",
@battlers[index].pbThis,PBItems.getName(@battlers[index].item),
ownername,pbGetMegaRingName(index)))
end
pbCommonAnimation("MegaEvolution",@battlers[index],nil)
@battlers[index].pokemon.makeMega
@battlers[index].form=@battlers[index].pokemon.form
@battlers[index].pbUpdate(true)
@scene.pbChangePokemon(@battlers[index],@battlers[index].pokemon)
pbCommonAnimation("MegaEvolution2",@battlers[index],nil)
meganame=(@battlers[index].pokemon.megaName rescue nil)
if !meganame || meganame==""
meganame=_INTL("Mega {1}",PBSpecies.getName(@battlers[index].pokemon.species))
end
pbDisplay(_INTL("{1} has Mega Evolved into {2}!",@battlers[index].pbThis,meganame))
PBDebug.log("[Mega Evolution] #{@battlers[index].pbThis} became #{meganame}")
side=(pbIsOpposing?(index)) ? 1 : 0
owner=pbGetOwnerIndex(index)
@megaEvolution[side]=-2
end
Thanks
Could someone help me identify what to change in the Mega evolutions script so i can add my megas.
def pbCanMegaEvolve?(index)
return false if $game_switches[NO_MEGA_EVOLUTION]
return false if !@battlers[index].hasMega?
return false if pbIsOpposing?(index) && !@opponent
return true if $DEBUG && Input.press?(Input::CTRL)
return false if !pbHasMegaRing?(index)
side=(pbIsOpposing?(index)) ? 1 : 0
owner=pbGetOwnerIndex(index)
return false if @megaEvolution[side]!=-1
return false if @battlers[index].effects[PBEffects::SkyDrop]
return true
end
def pbRegisterMegaEvolution(index)
side=(pbIsOpposing?(index)) ? 1 : 0
owner=pbGetOwnerIndex(index)
@megaEvolution[side]=index
end
def pbMegaEvolve(index)
return if !@battlers[index] || !@battlers[index].pokemon
return if !(@battlers[index].hasMega? rescue false)
return if (@battlers[index].isMega? rescue true)
ownername=pbGetOwner(index).fullname
ownername=pbGetOwner(index).name if pbBelongsToPlayer?(index)
case (@battlers[index].pokemon.megaMessage rescue 0)
when 1 # Rayquaza
pbDisplay(_INTL("{1}'s fervent wish has reached {2}!",ownername,@battlers[index].pbThis))
else
pbDisplay(_INTL("{1}'s {2} is reacting to {3}'s {4}!",
@battlers[index].pbThis,PBItems.getName(@battlers[index].item),
ownername,pbGetMegaRingName(index)))
end
pbCommonAnimation("MegaEvolution",@battlers[index],nil)
@battlers[index].pokemon.makeMega
@battlers[index].form=@battlers[index].pokemon.form
@battlers[index].pbUpdate(true)
@scene.pbChangePokemon(@battlers[index],@battlers[index].pokemon)
pbCommonAnimation("MegaEvolution2",@battlers[index],nil)
meganame=(@battlers[index].pokemon.megaName rescue nil)
if !meganame || meganame==""
meganame=_INTL("Mega {1}",PBSpecies.getName(@battlers[index].pokemon.species))
end
pbDisplay(_INTL("{1} has Mega Evolved into {2}!",@battlers[index].pbThis,meganame))
PBDebug.log("[Mega Evolution] #{@battlers[index].pbThis} became #{meganame}")
side=(pbIsOpposing?(index)) ? 1 : 0
owner=pbGetOwnerIndex(index)
@megaEvolution[side]=-2
end
Thanks