Made more use of nil_or_empty?, fixed incorrect default species body shape, fixed Illusion, fixed potential foreign Pokémon with blank names

This commit is contained in:
Maruno17
2021-05-03 17:34:19 +01:00
parent 8e6ee21c20
commit 474281712b
30 changed files with 71 additions and 73 deletions

View File

@@ -554,7 +554,7 @@ class PokemonSummary_Scene
# Write map name Pokémon was received on
mapname = pbGetMapNameFromId(@pokemon.obtain_map)
mapname = @pokemon.obtain_text if @pokemon.obtain_text && !@pokemon.obtain_text.empty?
mapname = _INTL("Faraway place") if !mapname || mapname==""
mapname = _INTL("Faraway place") if nil_or_empty?(mapname)
memo += sprintf("<c3=F83820,E09890>%s\n",mapname)
# Write how Pokémon was obtained
mettext = [_INTL("Met at Lv. {1}.",@pokemon.obtain_level),
@@ -573,7 +573,7 @@ class PokemonSummary_Scene
memo += _INTL("<c3=404040,B0B0B0>{1} {2}, {3}\n",date,month,year)
end
mapname = pbGetMapNameFromId(@pokemon.hatched_map)
mapname = _INTL("Faraway place") if !mapname || mapname==""
mapname = _INTL("Faraway place") if nil_or_empty?(mapname)
memo += sprintf("<c3=F83820,E09890>%s\n",mapname)
memo += _INTL("<c3=404040,B0B0B0>Egg hatched.\n")
else

View File

@@ -248,7 +248,7 @@ end
def pbGetStorageCreator
creator = Settings.storage_creator_name
creator = _INTL("Bill") if !creator || creator==""
creator = _INTL("Bill") if nil_or_empty?(creator)
return creator
end

View File

@@ -138,7 +138,7 @@ def pbManageMysteryGifts
pbMessageDisplay(msgwindow,_INTL("Searching for online gifts...\\wtnp[0]"))
online = pbDownloadToString(MysteryGift::URL)
pbDisposeMessageWindow(msgwindow)
if online==""
if nil_or_empty?(online)
pbMessage(_INTL("No online Mystery Gifts found.\\wtnp[20]"))
online=[]
else
@@ -245,7 +245,7 @@ def pbDownloadMysteryGift(trainer)
sprites["msgwindow"]=pbCreateMessageWindow
pbMessageDisplay(sprites["msgwindow"],_INTL("Searching for a gift.\nPlease wait...\\wtnp[0]"))
string = pbDownloadToString(MysteryGift::URL)
if string==""
if nil_or_empty?(string)
pbMessageDisplay(sprites["msgwindow"],_INTL("No new gifts are available."))
else
online=pbMysteryGiftDecrypt(string)
@@ -334,7 +334,7 @@ def pbMysteryGiftEncrypt(gift)
end
def pbMysteryGiftDecrypt(gift)
return [] if gift==""
return [] if nil_or_empty?(gift)
ret = Marshal.restore(Zlib::Inflate.inflate(gift.unpack("m")[0]))
if ret
ret.each do |gift|