Moved Poké Radar encounters into encounters.txt, added Setting/map metadata for reflection rippling, fixed def minimum_level, fixed ice/waterfalls forcing movement even when holding Ctrl in Debug mode, Pokédex no longer shows genders for species without gender differences

This commit is contained in:
Maruno17
2023-06-04 20:40:42 +01:00
parent 3470f9769c
commit 679e9d42dc
19 changed files with 137 additions and 98 deletions

View File

@@ -45,6 +45,8 @@ module Settings
# Whether outdoor maps should be shaded according to the time of day.
TIME_SHADING = true
# Whether the reflections of the player/events will ripple horizontally.
ANIMATE_REFLECTIONS = true
# Whether poisoned Pokémon will lose HP while walking around in the field.
POISON_IN_FIELD = (MECHANICS_GENERATION <= 4)
# Whether poisoned Pokémon will faint while walking around in the field
@@ -306,23 +308,6 @@ module Settings
#=============================================================================
# A set of arrays, each containing the details of a wild encounter that can
# only occur via using the Poké Radar. The information within each array is as
# follows:
# * Map ID on which this encounter can occur.
# * Probability that this encounter will occur (as a percentage).
# * Species.
# * Minimum possible level.
# * Maximum possible level (optional).
POKE_RADAR_ENCOUNTERS = [
[5, 20, :STARLY, 12, 15],
[21, 10, :STANTLER, 14],
[28, 20, :BUTTERFREE, 15, 18],
[28, 20, :BEEDRILL, 15, 18]
]
#=============================================================================
# The Game Switch that is set to ON when the player blacks out.
STARTING_OVER_SWITCH = 1
# The Game Switch that is set to ON when the player has seen Pokérus in the

View File

@@ -27,6 +27,10 @@ class Game_Follower < Game_Event
end
end
def map_id
return @map.map_id
end
#-----------------------------------------------------------------------------
def move_through(direction)

View File

@@ -66,7 +66,9 @@ class Sprite_Reflection
@sprite.z = -50 # Still water is -100, map is 0 and above
@sprite.z += 1 if event == $game_player
@sprite.zoom_x = @parent_sprite.zoom_x
@sprite.zoom_x += 0.05 * @sprite.zoom_x * Math.sin(2 * Math::PI * System.uptime)
if Settings::ANIMATE_REFLECTIONS && !GameData::MapMetadata.get(event.map_id).still_reflections
@sprite.zoom_x += 0.05 * @sprite.zoom_x * Math.sin(2 * Math::PI * System.uptime)
end
@sprite.zoom_y = @parent_sprite.zoom_y
@sprite.angle = 180.0
@sprite.mirror = true

View File

@@ -118,21 +118,19 @@ class AnimatedSprite < Sprite
def start
@playing = true
@start_time = System.uptime
end
alias play start
def stop
@playing = false
@start_time = nil
end
def update
super
if @playing && System.uptime - @start_time >= @time_per_frame
self.frame = (@frame + 1) % self.framecount
@start_time += @time_per_frame
if @playing
new_frame = (System.uptime / @time_per_frame).to_i % self.framecount
self.frame = new_frame if self.frame != new_frame
end
end
end

View File

@@ -3,7 +3,7 @@ module GameData
attr_reader :id
attr_reader :real_name
attr_reader :parameter
attr_reader :minimum_level # 0 means parameter is the minimum level
attr_reader :any_level_up # false means parameter is the minimum level
attr_reader :level_up_proc
attr_reader :use_item_proc
attr_reader :on_trade_proc
@@ -21,9 +21,9 @@ module GameData
def initialize(hash)
@id = hash[:id]
@real_name = hash[:id].to_s || "Unnamed"
@real_name = hash[:id].to_s || "Unnamed"
@parameter = hash[:parameter]
@minimum_level = hash[:minimum_level] || 0
@any_level_up = hash[:any_level_up] || false
@level_up_proc = hash[:level_up_proc]
@use_item_proc = hash[:use_item_proc]
@on_trade_proc = hash[:on_trade_proc]
@@ -276,7 +276,7 @@ GameData::Evolution.register({
GameData::Evolution.register({
:id => :Happiness,
:minimum_level => 1, # Needs any level up
:any_level_up => true, # Needs any level up
:level_up_proc => proc { |pkmn, parameter|
next pkmn.happiness >= (Settings::APPLY_HAPPINESS_SOFT_CAP ? 160 : 220)
}
@@ -284,7 +284,7 @@ GameData::Evolution.register({
GameData::Evolution.register({
:id => :HappinessMale,
:minimum_level => 1, # Needs any level up
:any_level_up => true, # Needs any level up
:level_up_proc => proc { |pkmn, parameter|
next pkmn.happiness >= (Settings::APPLY_HAPPINESS_SOFT_CAP ? 160 : 220) && pkmn.male?
}
@@ -292,7 +292,7 @@ GameData::Evolution.register({
GameData::Evolution.register({
:id => :HappinessFemale,
:minimum_level => 1, # Needs any level up
:any_level_up => true, # Needs any level up
:level_up_proc => proc { |pkmn, parameter|
next pkmn.happiness >= (Settings::APPLY_HAPPINESS_SOFT_CAP ? 160 : 220) && pkmn.female?
}
@@ -300,7 +300,7 @@ GameData::Evolution.register({
GameData::Evolution.register({
:id => :HappinessDay,
:minimum_level => 1, # Needs any level up
:any_level_up => true, # Needs any level up
:level_up_proc => proc { |pkmn, parameter|
next pkmn.happiness >= (Settings::APPLY_HAPPINESS_SOFT_CAP ? 160 : 220) && PBDayNight.isDay?
}
@@ -308,7 +308,7 @@ GameData::Evolution.register({
GameData::Evolution.register({
:id => :HappinessNight,
:minimum_level => 1, # Needs any level up
:any_level_up => true, # Needs any level up
:level_up_proc => proc { |pkmn, parameter|
next pkmn.happiness >= (Settings::APPLY_HAPPINESS_SOFT_CAP ? 160 : 220) && PBDayNight.isNight?
}
@@ -317,7 +317,7 @@ GameData::Evolution.register({
GameData::Evolution.register({
:id => :HappinessMove,
:parameter => :Move,
:minimum_level => 1, # Needs any level up
:any_level_up => true, # Needs any level up
:level_up_proc => proc { |pkmn, parameter|
if pkmn.happiness >= (Settings::APPLY_HAPPINESS_SOFT_CAP ? 160 : 220)
next pkmn.moves.any? { |m| m && m.id == parameter }
@@ -328,7 +328,7 @@ GameData::Evolution.register({
GameData::Evolution.register({
:id => :HappinessMoveType,
:parameter => :Type,
:minimum_level => 1, # Needs any level up
:any_level_up => true, # Needs any level up
:level_up_proc => proc { |pkmn, parameter|
if pkmn.happiness >= (Settings::APPLY_HAPPINESS_SOFT_CAP ? 160 : 220)
next pkmn.moves.any? { |m| m && m.type == parameter }
@@ -339,7 +339,7 @@ GameData::Evolution.register({
GameData::Evolution.register({
:id => :HappinessHoldItem,
:parameter => :Item,
:minimum_level => 1, # Needs any level up
:any_level_up => true, # Needs any level up
:level_up_proc => proc { |pkmn, parameter|
next pkmn.item == parameter && pkmn.happiness >= (Settings::APPLY_HAPPINESS_SOFT_CAP ? 160 : 220)
},
@@ -352,7 +352,7 @@ GameData::Evolution.register({
GameData::Evolution.register({
:id => :MaxHappiness,
:minimum_level => 1, # Needs any level up
:any_level_up => true, # Needs any level up
:level_up_proc => proc { |pkmn, parameter|
next pkmn.happiness == 255
}
@@ -361,7 +361,7 @@ GameData::Evolution.register({
GameData::Evolution.register({
:id => :Beauty, # Feebas
:parameter => Integer,
:minimum_level => 1, # Needs any level up
:any_level_up => true, # Needs any level up
:level_up_proc => proc { |pkmn, parameter|
next pkmn.beauty >= parameter
}
@@ -370,7 +370,7 @@ GameData::Evolution.register({
GameData::Evolution.register({
:id => :HoldItem,
:parameter => :Item,
:minimum_level => 1, # Needs any level up
:any_level_up => true, # Needs any level up
:level_up_proc => proc { |pkmn, parameter|
next pkmn.item == parameter
},
@@ -384,7 +384,7 @@ GameData::Evolution.register({
GameData::Evolution.register({
:id => :HoldItemMale,
:parameter => :Item,
:minimum_level => 1, # Needs any level up
:any_level_up => true, # Needs any level up
:level_up_proc => proc { |pkmn, parameter|
next pkmn.item == parameter && pkmn.male?
},
@@ -398,7 +398,7 @@ GameData::Evolution.register({
GameData::Evolution.register({
:id => :HoldItemFemale,
:parameter => :Item,
:minimum_level => 1, # Needs any level up
:any_level_up => true, # Needs any level up
:level_up_proc => proc { |pkmn, parameter|
next pkmn.item == parameter && pkmn.female?
},
@@ -412,7 +412,7 @@ GameData::Evolution.register({
GameData::Evolution.register({
:id => :DayHoldItem,
:parameter => :Item,
:minimum_level => 1, # Needs any level up
:any_level_up => true, # Needs any level up
:level_up_proc => proc { |pkmn, parameter|
next pkmn.item == parameter && PBDayNight.isDay?
},
@@ -426,7 +426,7 @@ GameData::Evolution.register({
GameData::Evolution.register({
:id => :NightHoldItem,
:parameter => :Item,
:minimum_level => 1, # Needs any level up
:any_level_up => true, # Needs any level up
:level_up_proc => proc { |pkmn, parameter|
next pkmn.item == parameter && PBDayNight.isNight?
},
@@ -440,7 +440,7 @@ GameData::Evolution.register({
GameData::Evolution.register({
:id => :HoldItemHappiness,
:parameter => :Item,
:minimum_level => 1, # Needs any level up
:any_level_up => true, # Needs any level up
:level_up_proc => proc { |pkmn, parameter|
next pkmn.item == parameter && pkmn.happiness >= (Settings::APPLY_HAPPINESS_SOFT_CAP ? 160 : 220)
},
@@ -454,7 +454,7 @@ GameData::Evolution.register({
GameData::Evolution.register({
:id => :HasMove,
:parameter => :Move,
:minimum_level => 1, # Needs any level up
:any_level_up => true, # Needs any level up
:level_up_proc => proc { |pkmn, parameter|
next pkmn.moves.any? { |m| m && m.id == parameter }
}
@@ -463,7 +463,7 @@ GameData::Evolution.register({
GameData::Evolution.register({
:id => :HasMoveType,
:parameter => :Type,
:minimum_level => 1, # Needs any level up
:any_level_up => true, # Needs any level up
:level_up_proc => proc { |pkmn, parameter|
next pkmn.moves.any? { |m| m && m.type == parameter }
}
@@ -472,7 +472,7 @@ GameData::Evolution.register({
GameData::Evolution.register({
:id => :HasInParty,
:parameter => :Species,
:minimum_level => 1, # Needs any level up
:any_level_up => true, # Needs any level up
:level_up_proc => proc { |pkmn, parameter|
next $player.has_species?(parameter)
}
@@ -481,7 +481,7 @@ GameData::Evolution.register({
GameData::Evolution.register({
:id => :Location,
:parameter => Integer,
:minimum_level => 1, # Needs any level up
:any_level_up => true, # Needs any level up
:level_up_proc => proc { |pkmn, parameter|
next $game_map.map_id == parameter
}
@@ -490,7 +490,7 @@ GameData::Evolution.register({
GameData::Evolution.register({
:id => :LocationFlag,
:parameter => String,
:minimum_level => 1, # Needs any level up
:any_level_up => true, # Needs any level up
:level_up_proc => proc { |pkmn, parameter|
next $game_map.metadata&.has_flag?(parameter)
}
@@ -499,7 +499,7 @@ GameData::Evolution.register({
GameData::Evolution.register({
:id => :Region,
:parameter => Integer,
:minimum_level => 1, # Needs any level up
:any_level_up => true, # Needs any level up
:level_up_proc => proc { |pkmn, parameter|
map_metadata = $game_map.metadata
next map_metadata&.town_map_position && map_metadata.town_map_position[0] == parameter

View File

@@ -62,6 +62,12 @@ GameData::EncounterType.register({
:trigger_chance => 21
})
GameData::EncounterType.register({
:id => :PokeRadar,
:type => :land,
:trigger_chance => 20
})
GameData::EncounterType.register({
:id => :Cave,
:type => :cave,

View File

@@ -304,7 +304,7 @@ module GameData
ret = @species
return ret if @evolutions.length == 0
@evolutions.each do |evo|
next if !evo[3] # Not the prevolution
next if !evo[3] # Check only the prevolution
if check_items
incense = GameData::Species.get(evo[0]).incense
ret = evo[0] if !incense || item1 == incense || item2 == incense
@@ -374,11 +374,14 @@ module GameData
def minimum_level
return 1 if @evolutions.length == 0
@evolutions.each do |evo|
next if !evo[3] # Not the prevolution
next if !evo[3] # Check only the prevolution
prevo_data = GameData::Species.get_species_form(evo[0], base_form)
return 1 if !prevo_data.incense.nil?
prevo_min_level = prevo_data.minimum_level
evo_method_data = GameData::Evolution.get(evo[1])
next if evo_method_data.level_up_proc.nil?
min_level = evo_method_data.minimum_level
return (min_level == 0) ? evo[2] : min_level + 1
return prevo_min_level if evo_method_data.level_up_proc.nil? && evo_method_data.id != :Shedinja
any_level_up = evo_method_data.any_level_up
return (any_level_up) ? prevo_min_level + 1 : evo[2]
end
return 1
end

View File

@@ -13,6 +13,7 @@ module GameData
attr_reader :dark_map
attr_reader :safari_map
attr_reader :snap_edges
attr_reader :still_reflections
attr_reader :random_dungeon
attr_reader :battle_background
attr_reader :wild_battle_BGM
@@ -43,6 +44,7 @@ module GameData
"DarkMap" => [:dark_map, "b"],
"SafariMap" => [:safari_map, "b"],
"SnapEdges" => [:snap_edges, "b"],
"StillReflections" => [:still_reflections, "b"],
"Dungeon" => [:random_dungeon, "b"],
"BattleBack" => [:battle_background, "s"],
"WildBattleBGM" => [:wild_battle_BGM, "s"],
@@ -73,6 +75,7 @@ module GameData
["DarkMap", BooleanProperty, _INTL("If true, this map is dark and a circle of light appears around the player. Flash can be used to expand the circle.")],
["SafariMap", BooleanProperty, _INTL("If true, this map is part of the Safari Zone (both indoor and outdoor). Not to be used in the reception desk.")],
["SnapEdges", BooleanProperty, _INTL("If true, when the player goes near this map's edge, the game doesn't center the player as usual.")],
["StillReflections", BooleanProperty, _INTL("If true, reflections of events and the player will not ripple horizontally.")],
["Dungeon", BooleanProperty, _INTL("If true, this map has a randomly generated layout. See the wiki for more information.")],
["BattleBack", StringProperty, _INTL("PNG files named 'XXX_bg', 'XXX_base0', 'XXX_base1', 'XXX_message' in Battlebacks folder, where XXX is this property's value.")],
["WildBattleBGM", BGMProperty, _INTL("Default BGM for wild Pokémon battles on this map.")],
@@ -100,6 +103,7 @@ module GameData
@dark_map = hash[:dark_map]
@safari_map = hash[:safari_map]
@snap_edges = hash[:snap_edges]
@still_reflections = hash[:still_reflections]
@random_dungeon = hash[:random_dungeon]
@battle_background = hash[:battle_background]
@wild_battle_BGM = hash[:wild_battle_BGM]

View File

@@ -549,11 +549,13 @@ end
# Player/event movement in the field
#===============================================================================
def pbSlideOnIce
if $game_player.pbTerrainTag.ice && $game_player.can_move_in_direction?($game_player.direction)
$PokemonGlobal.ice_sliding = true
$game_player.straighten
$game_player.walk_anime = false
return
if !$DEBUG || !Input.press?(Input::CTRL)
if $game_player.pbTerrainTag.ice && $game_player.can_move_in_direction?($game_player.direction)
$PokemonGlobal.ice_sliding = true
$game_player.straighten
$game_player.walk_anime = false
return
end
end
$PokemonGlobal.ice_sliding = false
$game_player.walk_anime = true

View File

@@ -900,7 +900,8 @@ end
def pbTraverseWaterfall
if $game_player.direction == 2 # Facing down; descending
terrain = $game_player.pbTerrainTag
if !terrain.waterfall && !terrain.waterfall_crest
if ($DEBUG && Input.press?(Input::CTRL)) ||
(!terrain.waterfall && !terrain.waterfall_crest)
$PokemonGlobal.descending_waterfall = false
$game_player.through = false
return
@@ -910,7 +911,8 @@ def pbTraverseWaterfall
$game_player.through = true
elsif $PokemonGlobal.ascending_waterfall
terrain = $game_player.pbTerrainTag
if !terrain.waterfall && !terrain.waterfall_crest
if ($DEBUG && Input.press?(Input::CTRL)) ||
(!terrain.waterfall && !terrain.waterfall_crest)
$PokemonGlobal.ascending_waterfall = false
$game_player.through = false
return

View File

@@ -128,20 +128,27 @@ def pbPokeRadarGetEncounter(rarity = 0)
# Poké Radar-exclusive encounters can only be found in vigorously-shaking grass
if rarity > 0
# Get all Poké Radar-exclusive encounters for this map
map = $game_map.map_id
array = []
Settings::POKE_RADAR_ENCOUNTERS.each do |enc|
array.push(enc) if enc[0] == map && GameData::Species.exists?(enc[2])
map_id = $game_map.map_id
enc_list = nil
encounter_data = GameData::Encounter.get(map_id, $PokemonGlobal.encounter_version)
if encounter_data && encounter_data.types[:PokeRadar] &&
rand(100) < encounter_data.step_chances[:PokeRadar]
enc_list = encounter_data.types[:PokeRadar]
end
# If there are any exclusives, first have a chance of encountering those
if array.length > 0
rnd = rand(100)
array.each do |enc|
rnd -= enc[1]
if enc_list && enc_list.length > 0
chance_total = 0
enc_list.each { |a| chance_total += a[0] }
rnd = rand(chance_total)
encounter = nil
enc_list.each do |enc|
rnd -= enc[0]
next if rnd >= 0
level = (enc[4] && enc[4] > enc[3]) ? rand(enc[3]..enc[4]) : enc[3]
return [enc[2], level]
encounter = enc
break
end
level = rand(encounter[2]..encounter[3])
return [encounter[1], level]
end
end
# Didn't choose a Poké Radar-exclusive species, choose a regular encounter instead

View File

@@ -153,6 +153,7 @@ class PokemonPokedexInfo_Scene
def pbGetAvailableForms
ret = []
multiple_forms = false
gender_differences = (GameData::Species.front_sprite_filename(@species, 0) == GameData::Species.front_sprite_filename(@species, 0, 1))
# Find all genders/forms of @species that have been seen
GameData::Species.each do |sp|
next if sp.species != @species
@@ -164,6 +165,12 @@ class PokemonPokedexInfo_Scene
next if !$player.pokedex.seen_form?(@species, real_gender, sp.form) && !Settings::DEX_SHOWS_ALL_FORMS
real_gender = 2 if sp.gender_ratio == :Genderless
ret.push([sp.form_name, real_gender, sp.form])
elsif sp.form == 0 && # Form 0 and no gender differences
2.times do |real_gndr|
next if !$player.pokedex.seen_form?(@species, real_gndr, sp.form) && !Settings::DEX_SHOWS_ALL_FORMS
ret.push([sp.form_name || _INTL("One Form"), 0, sp.form])
break
end
else # Both male and female
2.times do |real_gndr|
next if !$player.pokedex.seen_form?(@species, real_gndr, sp.form) && !Settings::DEX_SHOWS_ALL_FORMS
@@ -176,7 +183,9 @@ class PokemonPokedexInfo_Scene
ret.sort! { |a, b| (a[2] == b[2]) ? a[1] <=> b[1] : a[2] <=> b[2] }
# Create form names for entries if they don't already exist
ret.each do |entry|
if !entry[0] || entry[0].empty? # Necessarily applies only to form 0
if entry[0] # Alternate forms, and form 0 if no gender differences
entry[0] = "" if !multiple_forms && !gender_differences
else # Necessarily applies only to form 0
case entry[1]
when 0 then entry[0] = _INTL("Male")
when 1 then entry[0] = _INTL("Female")

View File

@@ -7,9 +7,10 @@
class MiningGameCounter < BitmapSprite
attr_accessor :hits
def initialize(x, y)
@viewport = Viewport.new(x, y, 416, 60)
@viewport.z = 99999
def initialize(x, y, viewport)
@viewport = viewport
@x = x
@y = y
super(416, 60, @viewport)
@hits = 0
@image = AnimatedBitmap.new("Graphics/UI/Mining/cracks")
@@ -38,9 +39,8 @@ end
class MiningGameTile < BitmapSprite
attr_reader :layer
def initialize(x, y)
@viewport = Viewport.new(x, y, 32, 32)
@viewport.z = 99999
def initialize(viewport)
@viewport = viewport
super(32, 32, @viewport)
r = rand(100)
if r < 10
@@ -82,9 +82,8 @@ class MiningGameCursor < BitmapSprite
TOOL_POSITIONS = [[1, 0], [1, 1], [1, 1], [0, 0], [0, 0],
[0, 2], [0, 2], [0, 0], [0, 0], [0, 2], [0, 2]] # Graphic, position
def initialize(position = 0, mode = 0) # mode: 0=pick, 1=hammer
@viewport = Viewport.new(0, 0, Graphics.width, Graphics.height)
@viewport.z = 99999
def initialize(position, mode, viewport) # mode: 0=pick, 1=hammer
@viewport = viewport
super(Graphics.width, Graphics.height, @viewport)
@position = position
@mode = mode
@@ -236,6 +235,7 @@ class MiningGameScene
@viewport.z = 99999
addBackgroundPlane(@sprites, "bg", "Mining/bg", @viewport)
@sprites["itemlayer"] = BitmapSprite.new(Graphics.width, Graphics.height, @viewport)
@sprites["itemlayer"].z = 10
@itembitmap = AnimatedBitmap.new("Graphics/UI/Mining/items")
@ironbitmap = AnimatedBitmap.new("Graphics/UI/Mining/irons")
@items = []
@@ -245,14 +245,19 @@ class MiningGameScene
pbDistributeIron
BOARD_HEIGHT.times do |i|
BOARD_WIDTH.times do |j|
@sprites["tile#{j + (i * BOARD_WIDTH)}"] = MiningGameTile.new(32 * j, 64 + (32 * i))
@sprites["tile#{j + (i * BOARD_WIDTH)}"] = MiningGameTile.new(@viewport)
@sprites["tile#{j + (i * BOARD_WIDTH)}"].x = 32 * j
@sprites["tile#{j + (i * BOARD_WIDTH)}"].y = 64 + (32 * i)
@sprites["tile#{j + (i * BOARD_WIDTH)}"].z = 20
end
end
@sprites["crack"] = MiningGameCounter.new(0, 4)
@sprites["cursor"] = MiningGameCursor.new(58, 0) # central position, pick
@sprites["crack"] = MiningGameCounter.new(0, 4, @viewport)
@sprites["cursor"] = MiningGameCursor.new(58, 0, @viewport) # central position, pick
@sprites["cursor"].z = 50
@sprites["tool"] = IconSprite.new(434, 254, @viewport)
@sprites["tool"].setBitmap("Graphics/UI/Mining/toolicons")
@sprites["tool"].src_rect.set(0, 0, 68, 100)
@sprites["tool"].z = 100
update
pbFadeInAndShow(@sprites)
end
@@ -490,6 +495,7 @@ class MiningGameScene
def pbFlashItems(revealed)
return if revealed.length <= 0
revealeditems = BitmapSprite.new(Graphics.width, Graphics.height, @viewport)
revealeditems.z = 15
revealeditems.color = Color.new(255, 255, 255, 0)
flash_duration = 0.25
2.times do |i|
@@ -531,9 +537,8 @@ class MiningGameScene
if @sprites["crack"].hits >= 49
@sprites["cursor"].visible = false
pbSEPlay("Mining collapse")
collapseviewport = Viewport.new(0, 0, Graphics.width, Graphics.height)
collapseviewport.z = 99999
@sprites["collapse"] = BitmapSprite.new(Graphics.width, Graphics.height, collapseviewport)
@sprites["collapse"] = BitmapSprite.new(Graphics.width, Graphics.height, @viewport)
@sprites["collapse"].z = 999
timer_start = System.uptime
loop do
collapse_height = lerp(0, Graphics.height, 0.8, timer_start, System.uptime)

View File

@@ -495,16 +495,21 @@ module Compiler
all_evos = {}
GameData::Species.each do |species| # Build a hash of prevolutions for each species
species.evolutions.each do |evo|
all_evos[evo[0]] = [species.species, evo[1], evo[2], true] if !evo[3] && !all_evos[evo[0]]
next if evo[3]
all_evos[evo[0]] = [species.species, evo[1], evo[2], true] if !all_evos[evo[0]]
if species.form > 0
all_evos[[evo[0], species.form]] = [species.species, evo[1], evo[2], true] if !all_evos[[evo[0], species.form]]
end
end
end
GameData::Species.each do |species| # Distribute prevolutions
next if species.evolutions.any? { |evo| evo[3] } # Already has prevo listed
next if !all_evos[species.species]
prevo_data = all_evos[[species.species, species.base_form]] || all_evos[species.species]
next if !prevo_data
# Record what species evolves from
species.evolutions.push(all_evos[species.species].clone)
species.evolutions.delete_if { |evo| evo[3] }
species.evolutions.push(prevo_data.clone)
# Record that the prevolution can evolve into species
prevo = GameData::Species.get(all_evos[species.species][0])
prevo = GameData::Species.get(prevo_data[0])
if prevo.evolutions.none? { |evo| !evo[3] && evo[0] == species.species }
prevo.evolutions.push([species.species, :None, nil])
end

View File

@@ -9222,7 +9222,7 @@ Habitat = WatersEdge
Category = Fish
Pokedex = Feebas live in ponds that are heavily infested with weeds. Because of its hopelessly shabby appearance, it seems as if few trainers raise it.
Generation = 3
Evolutions = MILOTIC,Beauty,170,MILOTIC,TradeItem,PRISMSCALE
Evolutions = MILOTIC,TradeItem,PRISMSCALE,MILOTIC,Beauty,170
#-------------------------------
[MILOTIC]
Name = Milotic

View File

@@ -9212,7 +9212,7 @@ Habitat = WatersEdge
Category = Fish
Pokedex = Feebas live in ponds that are heavily infested with weeds. Because of its hopelessly shabby appearance, it seems as if few trainers raise it.
Generation = 3
Evolutions = MILOTIC,Beauty,170,MILOTIC,TradeItem,PRISMSCALE
Evolutions = MILOTIC,TradeItem,PRISMSCALE,MILOTIC,Beauty,170
#-------------------------------
[MILOTIC]
Name = Milotic

View File

@@ -9214,7 +9214,7 @@ Habitat = WatersEdge
Category = Fish
Pokedex = Feebas live in ponds that are heavily infested with weeds. Because of its hopelessly shabby appearance, it seems as if few trainers raise it.
Generation = 3
Evolutions = MILOTIC,Beauty,170,MILOTIC,TradeItem,PRISMSCALE
Evolutions = MILOTIC,TradeItem,PRISMSCALE,MILOTIC,Beauty,170
#-------------------------------
[MILOTIC]
Name = Milotic

View File

@@ -32,6 +32,8 @@ LandNight,21
9,HOOTHOOT,10,14
1,HOOTHOOT,14
1,RATTATA,15
PokeRadar,20
100,STARLY,12,15
#-------------------------------
[005,1] # Route 1
Land,21
@@ -77,6 +79,8 @@ HeadbuttHigh
50,PINECO,11,13
30,WURMPLE,6,8
20,SPINARAK,9,12
PokeRadar,10
100,STANTLER,14
#-------------------------------
[028] # Natural Park
Land,21
@@ -110,6 +114,9 @@ BugContest,21
5,BUTTERFREE,12,15
5,PINSIR,13,14
5,SCYTHER,13,14
PokeRadar,40
50,BUTTERFREE,15,18
50,BEEDRILL,15,18
#-------------------------------
[031] # Route 3
Land,21

View File

@@ -2170,7 +2170,7 @@ Category = Magnet
Pokedex = It is actually three Magnemite linked by magnetism. It generates powerful radio waves that raise temperatures by 3.6 degrees F within a 3,300-foot radius.
Generation = 1
WildItemUncommon = METALCOAT
Evolutions = MAGNEZONE,LocationFlag,Magnetic,MAGNEZONE,Item,THUNDERSTONE
Evolutions = MAGNEZONE,Item,THUNDERSTONE,MAGNEZONE,LocationFlag,Magnetic
#-------------------------------
[FARFETCHD]
Name = Farfetch'd
@@ -3525,7 +3525,7 @@ Habitat = Urban
Category = Evolution
Pokedex = An Eevee has an unstable genetic makeup that suddenly mutates due to its environment. Radiation from various stones causes this Pokémon to evolve.
Generation = 1
Evolutions = VAPOREON,Item,WATERSTONE,JOLTEON,Item,THUNDERSTONE,FLAREON,Item,FIRESTONE,LEAFEON,LocationFlag,MossRock,LEAFEON,Item,LEAFSTONE,GLACEON,LocationFlag,IceRock,GLACEON,Item,ICESTONE,SYLVEON,HappinessMoveType,FAIRY,ESPEON,HappinessDay,,UMBREON,HappinessNight,
Evolutions = VAPOREON,Item,WATERSTONE,JOLTEON,Item,THUNDERSTONE,FLAREON,Item,FIRESTONE,LEAFEON,Item,LEAFSTONE,LEAFEON,LocationFlag,MossRock,GLACEON,Item,ICESTONE,GLACEON,LocationFlag,IceRock,SYLVEON,HappinessMoveType,FAIRY,ESPEON,HappinessDay,,UMBREON,HappinessNight,
#-------------------------------
[VAPOREON]
Name = Vaporeon
@@ -9220,7 +9220,7 @@ Habitat = WatersEdge
Category = Fish
Pokedex = Feebas live in ponds that are heavily infested with weeds. Because of its hopelessly shabby appearance, it seems as if few trainers raise it.
Generation = 3
Evolutions = MILOTIC,Beauty,170,MILOTIC,TradeItem,PRISMSCALE
Evolutions = MILOTIC,TradeItem,PRISMSCALE,MILOTIC,Beauty,170
#-------------------------------
[MILOTIC]
Name = Milotic
@@ -19038,7 +19038,7 @@ Category = Battery
Pokedex = It buries itself in fallen leaves and barely moves, munching away on humus. If you accidentally step on one, you'll get a shock!
Generation = 7
WildItemUncommon = CELLBATTERY
Evolutions = VIKAVOLT,LocationFlag,Magnetic,VIKAVOLT,Item,THUNDERSTONE
Evolutions = VIKAVOLT,Item,THUNDERSTONE,VIKAVOLT,LocationFlag,Magnetic
#-------------------------------
[VIKAVOLT]
Name = Vikavolt