Added class GameStats, added Pokédex records for eggs seen and expanded seen_forms to include shinies

This commit is contained in:
Maruno17
2021-11-13 23:13:28 +00:00
parent 12fd500dbc
commit c6ecf60172
39 changed files with 443 additions and 42 deletions

View File

@@ -189,6 +189,7 @@ def pbHatchAnimation(pokemon)
end
def pbHatch(pokemon)
$stats.eggs_hatched += 1
speciesname = pokemon.speciesName
pokemon.name = nil
pokemon.owner = Pokemon::Owner.new_from_trainer($player)
@@ -198,6 +199,7 @@ def pbHatch(pokemon)
pokemon.hatched_map = $game_map.map_id
$player.pokedex.register(pokemon)
$player.pokedex.set_owned(pokemon.species)
$player.pokedex.set_seen_egg(pokemon.species)
pokemon.record_first_moves
if !pbHatchAnimation(pokemon)
pbMessage(_INTL("Huh?\1"))

View File

@@ -566,6 +566,7 @@ class PokemonEvolutionScene
end
def pbEvolutionSuccess
$stats.evolution_count += 1
# Play cry of evolved species
frames = GameData::Species.cry_length(@newspecies, @pokemon.form)
pbBGMStop

View File

@@ -198,6 +198,7 @@ end
#
#===============================================================================
def pbStartTrade(pokemonIndex,newpoke,nickname,trainerName,trainerGender=0)
$stats.trade_count += 1
myPokemon = $player.party[pokemonIndex]
opponent = NPCTrainer.new(trainerName,trainerGender)
opponent.id = $player.make_foreign_ID

View File

@@ -39,7 +39,7 @@ class PokemonTrainerCard_Scene
overlay.clear
baseColor = Color.new(72,72,72)
shadowColor = Color.new(160,160,160)
totalsec = Graphics.frame_count / Graphics.frame_rate
totalsec = $stats.play_time.to_i
hour = totalsec / 60 / 60
min = totalsec / 60 % 60
time = (hour>0) ? _INTL("{1}h {2}m",hour,min) : _INTL("{1}m",min)

View File

@@ -11,13 +11,13 @@ class PokemonLoadPanel < SpriteWrapper
FEMALETEXTCOLOR = Color.new(240,72,88)
FEMALETEXTSHADOWCOLOR = Color.new(160,64,64)
def initialize(index,title,isContinue,trainer,framecount,mapid,viewport=nil)
def initialize(index, title, isContinue, trainer, framecount, stats, mapid, viewport = nil)
super(viewport)
@index = index
@title = title
@isContinue = isContinue
@trainer = trainer
@totalsec = (framecount || 0) / Graphics.frame_rate
@totalsec = (stats) ? stats.play_time.to_i : ((framecount || 0) / Graphics.frame_rate)
@mapid = mapid
@selected = (index==0)
@bgbitmap = AnimatedBitmap.new("Graphics/Pictures/loadPanels")
@@ -98,7 +98,7 @@ end
#
#===============================================================================
class PokemonLoad_Scene
def pbStartScene(commands, show_continue, trainer, frame_count, map_id)
def pbStartScene(commands, show_continue, trainer, frame_count, stats, map_id)
@commands = commands
@sprites = {}
@viewport = Viewport.new(0, 0, Graphics.width, Graphics.height)
@@ -106,8 +106,8 @@ class PokemonLoad_Scene
addBackgroundOrColoredPlane(@sprites,"background","loadbg",Color.new(248,248,248),@viewport)
y = 16*2
for i in 0...commands.length
@sprites["panel#{i}"] = PokemonLoadPanel.new(i,commands[i],
(show_continue) ? (i==0) : false,trainer,frame_count,map_id,@viewport)
@sprites["panel#{i}"] = PokemonLoadPanel.new(i, commands[i],
(show_continue) ? (i == 0) : false, trainer, frame_count, stats, map_id, @viewport)
@sprites["panel#{i}"].x = 24*2
@sprites["panel#{i}"].y = y
@sprites["panel#{i}"].pbRefresh
@@ -297,7 +297,7 @@ class PokemonLoadScreen
commands[cmd_quit = commands.length] = _INTL('Quit Game')
map_id = show_continue ? @save_data[:map_factory].map.map_id : 0
@scene.pbStartScene(commands, show_continue, @save_data[:player],
@save_data[:frame_count] || 0, map_id)
@save_data[:frame_count] || 0, @save_data[:stats], map_id)
@scene.pbSetParty(@save_data[:player]) if show_continue
@scene.pbStartScene2
loop do

View File

@@ -28,7 +28,7 @@ class PokemonSave_Scene
@viewport=Viewport.new(0,0,Graphics.width,Graphics.height)
@viewport.z=99999
@sprites={}
totalsec = Graphics.frame_count / Graphics.frame_rate
totalsec = $stats.play_time.to_i
hour = totalsec / 60 / 60
min = totalsec / 60 % 60
mapname=$game_map.name

View File

@@ -587,6 +587,8 @@ class PokemonMartScreen
end
pbDisplayPaused(_INTL("You have no more room in the Bag."))
else
$stats.money_spent_at_marts += price
$stats.mart_items_bought += quantity
@adapter.setMoney(@adapter.getMoney-price)
@stock.delete_if { |item| GameData::Item.get(item).is_important? && $bag.has?(item) }
pbDisplayPaused(_INTL("Here you are! Thank you!")) { pbSEPlay("Mart buy item") }
@@ -597,6 +599,7 @@ class PokemonMartScreen
break if !@adapter.addItem(:PREMIERBALL)
premier_balls_added += 1
end
$stats.premier_balls_earned += premier_balls_added
if premier_balls_added > 1
pbDisplayPaused(_INTL("I'll throw in some {1}, too.", GameData::Item.get(:PREMIERBALL).name_plural))
elsif premier_balls_added > 0
@@ -604,6 +607,7 @@ class PokemonMartScreen
end
elsif !Settings::MORE_BONUS_PREMIER_BALLS && GameData::Item.get(item) == :POKEBALL
if @adapter.addItem(GameData::Item.get(:PREMIERBALL))
$stats.premier_balls_earned += 1
pbDisplayPaused(_INTL("I'll throw in a Premier Ball, too."))
end
end
@@ -638,7 +642,9 @@ class PokemonMartScreen
price/=2
price*=qty
if pbConfirm(_INTL("I can pay ${1}. Would that be OK?",price.to_s_formatted))
old_money = @adapter.getMoney
@adapter.setMoney(@adapter.getMoney+price)
$stats.money_earned_at_marts += @adapter.getMoney - old_money
qty.times do
@adapter.removeItem(item)
end

View File

@@ -177,6 +177,7 @@ class MoveRelearnerScreen
if move
if @scene.pbConfirm(_INTL("Teach {1}?", GameData::Move.get(move).name))
if pbLearnMove(pkmn, move)
$stats.moves_taught_by_reminder += 1
@scene.pbEndScene
return true
end