resort gorgeous / debug options

This commit is contained in:
infinitefusion
2021-07-20 10:45:45 -04:00
parent 0190b3c365
commit 77878847b5
9 changed files with 72 additions and 36 deletions

View File

@@ -81,7 +81,7 @@ module Game
rescue Errno::ENOENT
if $DEBUG
pbMessage(_INTL('Map {1} was not found.', $game_map.map_id))
map = pbWarpToMap
map = pbWarpToMapList
exit unless map
$MapFactory.setup(map[0])
$game_player.moveto(map[1], map[2])

View File

@@ -154,7 +154,7 @@ class PokemonIconSprite < SpriteWrapper
end
def useRegularIcon(species)
dexNum = getDexNumberFromSpecies(species)
dexNum = convertSpeciesSymbolToDexNumber(species)
return true if dexNum <= Settings::NB_POKEMON
return false if $game_variables == nil
return true if $game_variables[220] != 0

View File

@@ -15,7 +15,7 @@ class PokemonBoxIcon < IconSprite
end
def useRegularIcon(species)
dexNum = getDexNumberFromSpecies(species)
dexNum = convertSpeciesSymbolToDexNumber(species)
return true if dexNum <= Settings::NB_POKEMON
return false if $game_variables == nil
return true if $game_variables[220] != 0

View File

@@ -116,9 +116,13 @@ end
# the ID of the species to initially select. Pressing Input::ACTION will toggle
# the list sorting between numerical and alphabetical.
def pbChooseSpeciesList(default = nil)
commands = []
GameData::Species.each { |s| commands.push([s.id_number, s.real_name, s.id]) if s.form == 0 }
return pbChooseList(commands, default, nil, -1)
# commands = []
# GameData::Species.each { |s| commands.push([s.id_number, s.real_name, s.id]) if s.form == 0 }
# return pbChooseList(commands, default, nil, -1)
params = ChooseNumberParams.new
params.setRange(1,PBSpecies.maxValue)
dexNum = pbMessageChooseNumber("dex number?",params)
return GameData::Species.get(dexNum)
end
def pbChooseSpeciesFormList(default = nil)

View File

@@ -7,7 +7,27 @@ def pbDefaultMap
return 0
end
def pbWarpToMapId
params = ChooseNumberParams.new
params.setRange(1,pbMapTree().length)
map_id = pbMessageChooseNumber("map id?",params)
return [map_id,0,0]
end
def pbWarpToMap
choice = pbMessage("type", [_INTL("List"),_INTL("Map id"), _INTL("Town map")], 0)
if choice == 0
map = pbWarpToMapList
elsif choice == 1
map = pbWarpToMapId
elsif choice == 2
Kernel.pbMessage("Not currently supported")
map = pbWarpToMapList
end
return map
end
def pbWarpToMapList
mapid = pbListScreen(_INTL("WARP TO MAP"),MapLister.new(pbDefaultMap))
if mapid>0
map = Game_Map.new

View File

@@ -3,5 +3,9 @@ module PBSpecies
def PBSpecies.maxValue
return 176832
end
def PBSpecies.getName(species)
return GameData::Species.get(species).real_name
end
end

View File

@@ -161,6 +161,8 @@ end
#in: pokemon number
def Kernel.isPartPokemon(src, target)
src = convertSpeciesSymbolToDexNumber(src)
target = convertSpeciesSymbolToDexNumber(target)
return true if src == target
return false if src <= NB_POKEMON
bod = getBasePokemonID(src, true)

View File

@@ -116,7 +116,8 @@ def pbCheckPokemonIconFiles(speciesNum,egg=false, dna=false)
end
def getDexNumberFromSpecies(species)
def convertSpeciesSymbolToDexNumber(species)
return species if species.is_a?(Integer)
if species.is_a?(Symbol)
dexNum = GameData::Species.get(species).id_number
elsif species.is_a?(Pokemon)
@@ -127,14 +128,43 @@ def getDexNumberFromSpecies(species)
return dexNum
end
def getRandomCustomFusion(returnRandomPokemonIfNoneFound=true,customPokeList=[],maxPoke=-1,recursionLimit=3)
if customPokeList.length==0
customPokeList = getCustomSpeciesList()
end
randPoke = []
if customPokeList.length >= 5000
chosen=false
i=0 #loop pas plus que 3 fois pour pas lag
while chosen == false
fusedPoke = customPokeList[rand(customPokeList.length)]
poke1 = getBasePokemonID(fusedPoke,false)
poke2 = getBasePokemonID(fusedPoke,true)
if ((poke1 <= maxPoke && poke2 <= maxPoke) || i >= recursionLimit) || maxPoke == -1
randPoke << getBasePokemonID(fusedPoke,false)
randPoke << getBasePokemonID(fusedPoke,true)
chosen = true
end
end
else
if returnRandomPokemonIfNoneFound
randPoke << rand(maxPoke)+1
randPoke << rand(maxPoke)+1
end
end
return randPoke
end
def getBodyID(species)
dexNum = getDexNumberFromSpecies(species)
dexNum = convertSpeciesSymbolToDexNumber(species)
return (dexNum / NB_POKEMON).round
end
def getHeadID(species, bodyId)
head_dexNum = getDexNumberFromSpecies(species)
body_dexNum = getDexNumberFromSpecies(bodyId)
head_dexNum = convertSpeciesSymbolToDexNumber(species)
body_dexNum = convertSpeciesSymbolToDexNumber(bodyId)
return (head_dexNum - (body_dexNum * NB_POKEMON)).round
end

View File

@@ -113,30 +113,6 @@ end
#===============================================================================
class GenOneStyle
#currently unused
def getRandomCustomFusion()
randPoke = []
if @customPokeList.length >= 5000
chosen=false
i=0 #loop pas plus que 3 fois pour pas lag
while chosen == false
fusedPoke = @customPokeList[rand(@customPokeList.length)]
poke1 = getBasePokemonID(fusedPoke,false)
poke2 = getBasePokemonID(fusedPoke,true)
if ((poke1 <= @maxPoke && poke2 <= @maxPoke) || i >= 3)
randPoke << getBasePokemonID(fusedPoke,false)
randPoke << getBasePokemonID(fusedPoke,true)
chosen = true
end
end
else
randPoke << rand(@maxPoke)+1
randPoke << rand(@maxPoke)+1
end
return randPoke
end
@@ -146,7 +122,7 @@ class GenOneStyle
@customPokeList = getCustomSpeciesList()
#Get random Pokemon (1st gen orandPokenly, pas de legend la prmeiere fois)
randPoke = getRandomCustomFusion()
randPoke = getRandomCustomFusion(true,@customPokeList,@maxPoke)
randpoke1 = randPoke[0] #rand(@maxPoke)+1
randpoke2 = randPoke[1] #rand(@maxPoke)+1
@@ -364,7 +340,7 @@ class GenOneStyle
if @maxPoke < NB_POKEMON-1
@maxPoke += 5 #-1 pour que ca arrive pile. tant pis pour kyurem
end
randPoke = getRandomCustomFusion()
randPoke = getRandomCustomFusion(true,@customPokeList,@maxPoke)
randpoke1 = randPoke[0] #rand(@maxPoke)+1
randpoke2 = randPoke[1] #rand(@maxPoke)+1