mirror of
https://github.com/infinitefusion/infinitefusion-e18.git
synced 2025-12-07 13:15:01 +00:00
Fixed not being able to detect a Pokémon being a Mega Evolution, fixed inadequate checking if a Mega Stone is unlosable
This commit is contained in:
@@ -421,7 +421,15 @@ class PokeBattle_Battler
|
|||||||
return true if GameData::Item.get(check_item).is_mail?
|
return true if GameData::Item.get(check_item).is_mail?
|
||||||
return false if @effects[PBEffects::Transform]
|
return false if @effects[PBEffects::Transform]
|
||||||
# Items that change a Pokémon's form
|
# Items that change a Pokémon's form
|
||||||
return true if @pokemon && @pokemon.getMegaForm(true) > 0 # Mega Stone
|
if mega? # Check if item was needed for this Mega Evolution
|
||||||
|
return true if @pokemon.species_data.mega_stone == check_item
|
||||||
|
else # Check if item could cause a Mega Evolution
|
||||||
|
GameData::Species.each do |data|
|
||||||
|
next if data.species != @species || data.unmega_form != @form
|
||||||
|
return true if data.mega_stone == check_item
|
||||||
|
end
|
||||||
|
end
|
||||||
|
# Other unlosable items
|
||||||
return GameData::Item.get(check_item).unlosable?(@species, self.ability)
|
return GameData::Item.get(check_item).unlosable?(@species, self.ability)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
@@ -147,7 +147,7 @@ class PokeBattle_Battle
|
|||||||
@scene.pbRefreshOne(idxBattler)
|
@scene.pbRefreshOne(idxBattler)
|
||||||
pbCommonAnimation("MegaEvolution2",battler)
|
pbCommonAnimation("MegaEvolution2",battler)
|
||||||
megaName = battler.pokemon.megaName
|
megaName = battler.pokemon.megaName
|
||||||
megaName = _INTL("Mega {1}", battler.pokemon.speciesName) nil_or_empty?(megaName)
|
megaName = _INTL("Mega {1}", battler.pokemon.speciesName) if nil_or_empty?(megaName)
|
||||||
pbDisplay(_INTL("{1} has Mega Evolved into {2}!",battler.pbThis,megaName))
|
pbDisplay(_INTL("{1} has Mega Evolved into {2}!",battler.pbThis,megaName))
|
||||||
side = battler.idxOwnSide
|
side = battler.idxOwnSide
|
||||||
owner = pbGetOwnerIndexFromBattlerIndex(idxBattler)
|
owner = pbGetOwnerIndexFromBattlerIndex(idxBattler)
|
||||||
|
|||||||
@@ -3,14 +3,14 @@ class Pokemon
|
|||||||
# Mega Evolution
|
# Mega Evolution
|
||||||
# NOTE: These are treated as form changes in Essentials.
|
# NOTE: These are treated as form changes in Essentials.
|
||||||
#=============================================================================
|
#=============================================================================
|
||||||
def getMegaForm(checkItemOnly = false)
|
def getMegaForm
|
||||||
ret = 0
|
ret = 0
|
||||||
GameData::Species.each do |data|
|
GameData::Species.each do |data|
|
||||||
next if data.species != @species || data.unmega_form != form_simple
|
next if data.species != @species || data.unmega_form != form_simple
|
||||||
if data.mega_stone && hasItem?(data.mega_stone)
|
if data.mega_stone && hasItem?(data.mega_stone)
|
||||||
ret = data.form
|
ret = data.form
|
||||||
break
|
break
|
||||||
elsif !checkItemOnly && data.mega_move && hasMove?(data.mega_move)
|
elsif data.mega_move && hasMove?(data.mega_move)
|
||||||
ret = data.form
|
ret = data.form
|
||||||
break
|
break
|
||||||
end
|
end
|
||||||
@@ -28,8 +28,7 @@ class Pokemon
|
|||||||
end
|
end
|
||||||
|
|
||||||
def mega?
|
def mega?
|
||||||
megaForm = self.getMegaForm
|
return (species_data.mega_stone || species_data.mega_move) ? true : false
|
||||||
return megaForm > 0 && megaForm == form_simple
|
|
||||||
end
|
end
|
||||||
|
|
||||||
def makeMega
|
def makeMega
|
||||||
|
|||||||
Reference in New Issue
Block a user