mirror of
https://github.com/infinitefusion/infinitefusion-e18.git
synced 2025-12-06 06:01:46 +00:00
Added class GameStats, added Pokédex records for eggs seen and expanded seen_forms to include shinies
This commit is contained in:
@@ -99,6 +99,7 @@ def pbRepel(item,steps)
|
||||
pbMessage(_INTL("But a repellent's effect still lingers from earlier."))
|
||||
return false
|
||||
end
|
||||
$stats.repel_count += 1
|
||||
pbUseItemMessage(item)
|
||||
$PokemonGlobal.repel = steps
|
||||
return true
|
||||
@@ -243,6 +244,7 @@ ItemHandlers::UseInField.add(:OLDROD,proc { |item|
|
||||
end
|
||||
encounter = $PokemonEncounters.has_encounter_type?(:OldRod)
|
||||
if pbFishing(encounter,1)
|
||||
$stats.fishing_battles += 1
|
||||
pbEncounter(:OldRod)
|
||||
end
|
||||
next true
|
||||
@@ -256,6 +258,7 @@ ItemHandlers::UseInField.add(:GOODROD,proc { |item|
|
||||
end
|
||||
encounter = $PokemonEncounters.has_encounter_type?(:GoodRod)
|
||||
if pbFishing(encounter,2)
|
||||
$stats.fishing_battles += 1
|
||||
pbEncounter(:GoodRod)
|
||||
end
|
||||
next true
|
||||
@@ -269,12 +272,14 @@ ItemHandlers::UseInField.add(:SUPERROD,proc { |item|
|
||||
end
|
||||
encounter = $PokemonEncounters.has_encounter_type?(:SuperRod)
|
||||
if pbFishing(encounter,3)
|
||||
$stats.fishing_battles += 1
|
||||
pbEncounter(:SuperRod)
|
||||
end
|
||||
next true
|
||||
})
|
||||
|
||||
ItemHandlers::UseInField.add(:ITEMFINDER,proc { |item|
|
||||
$stats.itemfinder_count += 1
|
||||
event = pbClosestHiddenItem
|
||||
if !event
|
||||
pbMessage(_INTL("... \\wt[10]... \\wt[10]... \\wt[10]...\\wt[10]Nope! There's no response."))
|
||||
|
||||
@@ -43,6 +43,7 @@ end
|
||||
|
||||
def pbUsePokeRadar
|
||||
return false if !pbCanUsePokeRadar?
|
||||
$stats.poke_radar_count += 1
|
||||
$game_temp.poke_radar_data = [0, 0, 0, [], false] if !$game_temp.poke_radar_data
|
||||
$game_temp.poke_radar_data[4] = false
|
||||
$PokemonGlobal.pokeradarBattery = 50
|
||||
@@ -80,7 +81,7 @@ def pbPokeRadarHighlightGrass(showmessage=true)
|
||||
# Choose a rarity for the grass (0=normal, 1=rare, 2=shiny)
|
||||
s = (rand(100) < 25) ? 1 : 0
|
||||
if $game_temp.poke_radar_data && $game_temp.poke_radar_data[2] > 0
|
||||
v = [(65536 / Settings::SHINY_POKEMON_CHANCE) - $game_temp.poke_radar_data[2] * 200, 200].max
|
||||
v = [(65536 / Settings::SHINY_POKEMON_CHANCE) - [$game_temp.poke_radar_data[2], 40].min * 200, 200].max
|
||||
v = (65536 / v.to_f).ceil
|
||||
s = 2 if rand(65536) < v
|
||||
end
|
||||
@@ -163,7 +164,7 @@ EncounterModifier.register(proc { |encounter|
|
||||
$game_temp.poke_radar_data[3].each { |g| rarity = g[3] if g[2] == ring }
|
||||
if $game_temp.poke_radar_data[2] > 0 # Chain count, i.e. is chaining
|
||||
if rarity == 2 ||
|
||||
rand(100) < 58 + ring * 10 + ($game_temp.poke_radar_data[2] / 4) + ($game_temp.poke_radar_data[4] ? 10 : 0)
|
||||
rand(100) < 58 + ring * 10 + ([$game_temp.poke_radar_data[2], 40].min / 4) + ($game_temp.poke_radar_data[4] ? 10 : 0)
|
||||
# Continue the chain
|
||||
encounter = [$game_temp.poke_radar_data[0], $game_temp.poke_radar_data[1]]
|
||||
$game_temp.force_single_battle = true
|
||||
@@ -210,7 +211,8 @@ Events.onWildBattleEnd += proc { |_sender,e|
|
||||
if $game_temp.poke_radar_data && (decision==1 || decision==4) # Defeated/caught
|
||||
$game_temp.poke_radar_data[0] = species
|
||||
$game_temp.poke_radar_data[1] = level
|
||||
$game_temp.poke_radar_data[2] = [$game_temp.poke_radar_data[2] + 1, 40].min
|
||||
$game_temp.poke_radar_data[2] += 1
|
||||
$stats.poke_radar_longest_chain = [$game_temp.poke_radar_data[2], $stats.poke_radar_longest_chain].max
|
||||
# Catching makes the next Radar encounter more likely to continue the chain
|
||||
$game_temp.poke_radar_data[4] = (decision == 4)
|
||||
pbPokeRadarHighlightGrass(false)
|
||||
|
||||
Reference in New Issue
Block a user