trainer rematch improvements

This commit is contained in:
infinitefusion
2022-03-30 20:08:09 -04:00
parent f8c8be07b7
commit 62a5ff7872
11 changed files with 65 additions and 22 deletions

View File

@@ -1,14 +1,17 @@
def Kernel.pbDisplayText(message,xposition,yposition,z=nil)
@hud = []
def Kernel.pbDisplayText(message,xposition,yposition,z=nil, baseColor=nil, shadowColor=nil)
if @hud==nil
@hud = []
end
# Draw the text
baseColor=Color.new(72,72,72)
shadowColor=Color.new(160,160,160)
baseColor= baseColor != nil ? baseColor : Color.new(72,72,72)
shadowColor= shadowColor !=nil ? shadowColor : Color.new(160,160,160)
sprite = BitmapSprite.new(Graphics.width,Graphics.height,@viewport1)
if z != nil
sprite.z=z
end
@hud.push(sprite)
text1=_INTL(message)
text1=_INTL(message)
textPosition=[
[text1,xposition,yposition,2,baseColor,shadowColor],
]

View File

@@ -115,7 +115,9 @@ end
class GenOneStyle
def initialize
Kernel.pbDisplayText("Controls: F1", 80, 0, 99999)
Kernel.pbDisplayText("Version " + Settings::GAME_VERSION_NUMBER, 254, 308, 99999)
@maxPoke = 140 #1st gen, pas de legend la premiere fois, graduellement plus de poke
@customPokeList = getCustomSpeciesList()
#Get random Pokemon (1st gen orandPokenly, pas de legend la prmeiere fois)

View File

@@ -119,22 +119,45 @@ def decreaseRematchNumber(trainerId)
end
end
# def evolveRematchPokemon(nbRematch, speciesSymbol)
# species = getDexNumberForSpecies(speciesSymbol)
# if (nbRematch >= 10 && $Trainer.numbadges >= 3)
# evospecies = getEvolution(species)
# return species if evospecies == -1
# if (nbRematch >= 20 && $Trainer.numbadges >= 8)
# secondEvoSpecies = getEvolution(evospecies)
# return secondEvoSpecies == -1 ? evospecies : secondEvoSpecies
# end
# return evospecies
# end
# return species
# end
def evolveRematchPokemon(nbRematch, speciesSymbol)
species = getDexNumberForSpecies(speciesSymbol)
if (nbRematch >= 10 && $Trainer.numbadges >= 3)
evospecies = getEvolution(species)
return species if evospecies == -1
if (nbRematch >= 20 && $Trainer.numbadges >= 8)
secondEvoSpecies = getEvolution(evospecies)
return secondEvoSpecies == -1 ? evospecies : secondEvoSpecies
end
return evospecies
if (nbRematch >= 30 && $Trainer.numbadges >= 6)
species = getEvolution(species,:HEAD)
species = getEvolution(species,:BODY)
species = getEvolution(species,:HEAD)
species = getEvolution(species,:BODY)
elsif (nbRematch >= 20 && $Trainer.numbadges >= 3)
species = getEvolution(species,:HEAD)
species = getEvolution(species,:BODY)
species = getEvolution(species,:HEAD)
elsif (nbRematch >= 10 && $Trainer.numbadges >= 3)
species = getEvolution(species,:HEAD)
species = getEvolution(species,:BODY)
elsif (nbRematch >= 5)
species = getEvolution(species,:HEAD)
end
return species
end
def getEvolution(species)
def getEvolution(species, halfToEvolve=nil)
begin
prioritizeHead = halfToEvolve == :HEAD
prioritizeBody = halfToEvolve == :BODY
if species >= Settings::NB_POKEMON
body = getBasePokemonID(species)
head = getBasePokemonID(species, false)
@@ -154,17 +177,33 @@ def getEvolution(species)
evoHead = getDexNumberForSpecies(evoHeadSpecies)
end
return -1 if evoBody == nil && evoHead == nil
return species if evoBody == nil && evoHead == nil
if prioritizeBody
if evoBody == nil
return body * Settings::NB_POKEMON + evoHead #only head evolves
else
return evoBody * Settings::NB_POKEMON + head #only body evolves
end
end
if prioritizeHead
if evoHead == nil
return evoBody * Settings::NB_POKEMON + head #only body evolves
else
return body * Settings::NB_POKEMON + evoHead #only head evolves
end
end
return body * Settings::NB_POKEMON + evoHead if evoBody == nil #only head evolves
return evoBody * Settings::NB_POKEMON + head if evoHead == nil #only body evolves
return evoBody * Settings::NB_POKEMON + evoHead #both evolve
return evoBody * Settings::NB_POKEMON + evoHead #both evolve
else
evo = pbGetEvolvedFormData(species)
newSpecies = evo[rand(evo.length - 1)][0]
return evo.any? ? getDexNumberForSpecies(newSpecies) : -1
return evo.any? ? getDexNumberForSpecies(newSpecies) : species
end
rescue
return -1
return species
end
end