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

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@@ -6,7 +6,7 @@
module Settings
# The version of your game. It has to adhere to the MAJOR.MINOR.PATCH format.
GAME_VERSION = '5.0.0'
GAME_VERSION_NUMBER = "5.0.13 - beta"
GAME_VERSION_NUMBER = "5.0.16 - beta"
POKERADAR_LIGHT_ANIMATION_RED_ID = 17
POKERADAR_LIGHT_ANIMATION_GREEN_ID = 18

View File

@@ -130,7 +130,7 @@ module GameData
trainer.items = @items.clone
trainer.lose_text = self.lose_text
isRematch = $game_switches[200]
isRematch = $game_switches[IS_REMATCH_SWITCH]
rematchId = getRematchId(trainer.name, trainer.trainer_type)
# Create each Pokémon owned by the trainer

View File

@@ -337,7 +337,7 @@ class PokeBattle_Battle
# End of battle
#=============================================================================
def pbGainMoney
return if $game_switches[200] #is rematch
return if $game_switches[IS_REMATCH_SWITCH] #is rematch
return if !@internalBattle || !@moneyGain
# Money rewarded from opposing trainers
if trainerBattle?

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

Binary file not shown.

View File

@@ -16,7 +16,6 @@ Removed Pokedex key item
##New Stuff
Added Quick Surf option
Added Kin Island Club
Added support for multiple savefiles
Replaced Delibird's hidden ability with Snow Warning
Added overworld sprites for a few important trainers
Added animations for using Rock Smash and Cut in the overworld