Wondertrade now uses the sprite's author as the original trainer when it can

This commit is contained in:
infinitefusion
2023-11-20 17:53:18 -05:00
parent 1d2ccb781b
commit 0713ed0bb5
14 changed files with 37 additions and 2 deletions

View File

@@ -220,3 +220,37 @@ def format_names_for_game_credits()
end
return formatted
end
def get_spritename_from_path(file_path,includeExtension=false)
filename_with_extension = File.basename(file_path)
filename_without_extension = File.basename(filename_with_extension, ".*")
return filename_with_extension if includeExtension
return filename_without_extension
end
def getSpriterCreditForDexNumber(species_sym)
#download sprite to make sure it's in the substitutions map
body_id = getBodyID(species_sym)
head_id = getHeadID(species_sym,body_id)
spritePath = get_fusion_sprite_path(head_id,body_id)
spritename = get_spritename_from_path(spritePath)
return getSpriteCredits(spritename)
end
#
# def getSpriterCreditForPokemon(species_sym)
# p species_sym
# #download sprite to make sure it's in the substitutions map
# head_id = get_head_id_from_symbol(species_sym)
# body_id = get_body_id_from_symbol(species_sym)
#
# echoln head_id
# echoln body_id
# spritename = get_fusion_sprite_path(head_id,body_id)
# p spritename
# p getSpriteCredits(spritename)
# return getSpriteCredits(spritename)
# end

View File

@@ -116,7 +116,7 @@ def pbWonderTrade(lvl, except = [], except2 = [], premiumWonderTrade = true)
end
end
randTrainerNames = RandTrainerNames_male + RandTrainerNames_female + RandTrainerNames_others
tname = randTrainerNames[rand(randTrainerNames.size)] # Randomizes Trainer Names
#tname = randTrainerNames[rand(randTrainerNames.size)] # Randomizes Trainer Names
pname = RandPokeNick[rand(RandPokeNick.size)] # Randomizes Pokemon Nicknames
#num of Wondertrade - 1
@@ -125,7 +125,8 @@ def pbWonderTrade(lvl, except = [], except2 = [], premiumWonderTrade = true)
else
$game_variables[VAR_STANDARD_WONDERTRADE_LEFT] -= 1
end
tname = getSpriterCreditForDexNumber(species)
tname = randTrainerNames[rand(randTrainerNames.size)] if ! tname
newpoke = pbStartTrade(pbGet(1), species, pname, tname, 0, true) # Starts the trade
#lower level by 1 to prevent abuse
if poke.level > 25