def pbCanMegaEvolve?(index)
return false if $game_switches[NO_MEGA_EVOLUTION]
return false if @battlers[index].isMega?
return false if @battlers[index].isShadow?
return false if pbBelongsToPlayer?(index) && !$PokemonGlobal.megaRing
return false if !@battlers[index].hasMega?
side=(pbIsOpposing?(index)) ? 1 : 0
owner=pbGetOwnerIndex(index)
return false if @megaEvolution[side][owner]!=-1 [COLOR="Red"]&& !pbIsOpposing?(index)[/COLOR]
return true
end