Added checks that prevent aliasing a method if the alias method already exists, fixed Symbiosis not working properly for opponents

This commit is contained in:
Maruno17
2021-12-28 19:22:31 +00:00
parent 139f2a74f2
commit 3e9d3b0a68
13 changed files with 63 additions and 34 deletions

View File

@@ -169,7 +169,9 @@ end
# Shadow Pokémon in battle.
#===============================================================================
class Battle
alias __shadow__pbCanUseItemOnPokemon? pbCanUseItemOnPokemon?
unless method_defined?(:__shadow__pbCanUseItemOnPokemon?)
alias __shadow__pbCanUseItemOnPokemon? pbCanUseItemOnPokemon?
end
def pbCanUseItemOnPokemon?(item, pkmn, battler, scene, showMessages = true)
ret = __shadow__pbCanUseItemOnPokemon?(item, pkmn, battler, scene, showMessages)
@@ -184,7 +186,7 @@ end
class Battle::Battler
alias __shadow__pbInitPokemon pbInitPokemon
alias __shadow__pbInitPokemon pbInitPokemon unless method_defined?(:__shadow__pbInitPokemon)
def pbInitPokemon(*arg)
if self.pokemonIndex > 0 && inHyperMode?