Refactoring, documenting deprecated methods

This commit is contained in:
Maruno17
2021-02-01 22:53:03 +00:00
parent 1209b804e9
commit 66494b0044
27 changed files with 188 additions and 109 deletions

View File

@@ -26,7 +26,7 @@ def pbSave(safesave=false)
Marshal.dump($PokemonMap,f)
Marshal.dump($PokemonBag,f)
Marshal.dump($PokemonStorage,f)
Marshal.dump(ESSENTIALS_VERSION,f)
Marshal.dump(Essentials::VERSION, f)
}
Graphics.frame_reset
rescue

View File

@@ -600,10 +600,7 @@ class PokemonEvolutionScene
end
def pbEvolutionMethodAfterEvolution
pbCheckEvolutionEx(@pokemon) { |pkmn, method, parameter, new_species|
success = PBEvolution.call("afterEvolution", method, pkmn, new_species, parameter, @newspecies)
next (success) ? 1 : -1
}
EvolutionCheck.check_after_evolution(@pokemon, @newspecies)
end
def self.pbDuplicatePokemon(pkmn, new_species)

View File

@@ -173,7 +173,7 @@ class PokemonTrade_Scene
pbFadeOutAndHide(@sprites)
pbDisposeSpriteHash(@sprites)
@viewport.dispose
newspecies = pbTradeCheckEvolution(@pokemon2,@pokemon)
newspecies = EvolutionCheck.check_trade_methods(@pokemon2,@pokemon)
if newspecies
evo = PokemonEvolutionScene.new
evo.pbStartScreen(@pokemon2,newspecies)
@@ -239,10 +239,3 @@ def pbStartTrade(pokemonIndex,newpoke,nickname,trainerName,trainerGender=0)
}
$Trainer.party[pokemonIndex] = yourPokemon
end
def pbTradeCheckEvolution(pkmn, other_pkmn)
return pbCheckEvolutionEx(pkmn) { |pkmn, method, parameter, new_species|
success = PBEvolution.call("tradeCheck", method, pkmn, parameter, other_pkmn)
next (success) ? new_species : -1
}
end

View File

@@ -6,8 +6,10 @@
# You should change it to your file's url once you upload it.
# NOTE: Essentials cannot handle https addresses. You must use a http address.
#===============================================================================
MYSTERY_GIFT_URL = "http://images1.wikia.nocookie.net/pokemonessentials/images/e/e7/MysteryGift.txt"
# MYSTERY_GIFT_URL = "http://pastebin.com/raw/w6BqqUsm"
module MysteryGift
URL = "http://images1.wikia.nocookie.net/pokemonessentials/images/e/e7/MysteryGift.txt"
# URL = "http://pastebin.com/raw/w6BqqUsm"
end
#===============================================================================
# Creating a new Mystery Gift for the Master file, and editing an existing one.
@@ -135,7 +137,7 @@ def pbManageMysteryGifts
# Download all gifts from online
msgwindow=pbCreateMessageWindow
pbMessageDisplay(msgwindow,_INTL("Searching for online gifts...\\wtnp[0]"))
online=pbDownloadToString(MYSTERY_GIFT_URL)
online = pbDownloadToString(MysteryGift::URL)
pbDisposeMessageWindow(msgwindow)
if online==""
pbMessage(_INTL("No online Mystery Gifts found.\\wtnp[20]"))
@@ -243,7 +245,7 @@ def pbDownloadMysteryGift(trainer)
pbFadeInAndShow(sprites)
sprites["msgwindow"]=pbCreateMessageWindow
pbMessageDisplay(sprites["msgwindow"],_INTL("Searching for a gift.\nPlease wait...\\wtnp[0]"))
string=pbDownloadToString(MYSTERY_GIFT_URL)
string = pbDownloadToString(MysteryGift::URL)
if string==""
pbMessageDisplay(sprites["msgwindow"],_INTL("No new gifts are available."))
else