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. # Whether outdoor maps should be shaded according to the time of day.
TIME_SHADING = true 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. # Whether poisoned Pokémon will lose HP while walking around in the field.
POISON_IN_FIELD = (MECHANICS_GENERATION <= 4) POISON_IN_FIELD = (MECHANICS_GENERATION <= 4)
# Whether poisoned Pokémon will faint while walking around in the field # 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. # The Game Switch that is set to ON when the player blacks out.
STARTING_OVER_SWITCH = 1 STARTING_OVER_SWITCH = 1
# The Game Switch that is set to ON when the player has seen Pokérus in the # 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
end end
def map_id
return @map.map_id
end
#----------------------------------------------------------------------------- #-----------------------------------------------------------------------------
def move_through(direction) 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 = -50 # Still water is -100, map is 0 and above
@sprite.z += 1 if event == $game_player @sprite.z += 1 if event == $game_player
@sprite.zoom_x = @parent_sprite.zoom_x @sprite.zoom_x = @parent_sprite.zoom_x
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) @sprite.zoom_x += 0.05 * @sprite.zoom_x * Math.sin(2 * Math::PI * System.uptime)
end
@sprite.zoom_y = @parent_sprite.zoom_y @sprite.zoom_y = @parent_sprite.zoom_y
@sprite.angle = 180.0 @sprite.angle = 180.0
@sprite.mirror = true @sprite.mirror = true

View File

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

View File

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

View File

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

View File

@@ -13,6 +13,7 @@ module GameData
attr_reader :dark_map attr_reader :dark_map
attr_reader :safari_map attr_reader :safari_map
attr_reader :snap_edges attr_reader :snap_edges
attr_reader :still_reflections
attr_reader :random_dungeon attr_reader :random_dungeon
attr_reader :battle_background attr_reader :battle_background
attr_reader :wild_battle_BGM attr_reader :wild_battle_BGM
@@ -43,6 +44,7 @@ module GameData
"DarkMap" => [:dark_map, "b"], "DarkMap" => [:dark_map, "b"],
"SafariMap" => [:safari_map, "b"], "SafariMap" => [:safari_map, "b"],
"SnapEdges" => [:snap_edges, "b"], "SnapEdges" => [:snap_edges, "b"],
"StillReflections" => [:still_reflections, "b"],
"Dungeon" => [:random_dungeon, "b"], "Dungeon" => [:random_dungeon, "b"],
"BattleBack" => [:battle_background, "s"], "BattleBack" => [:battle_background, "s"],
"WildBattleBGM" => [:wild_battle_BGM, "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.")], ["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.")], ["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.")], ["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.")], ["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.")], ["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.")], ["WildBattleBGM", BGMProperty, _INTL("Default BGM for wild Pokémon battles on this map.")],
@@ -100,6 +103,7 @@ module GameData
@dark_map = hash[:dark_map] @dark_map = hash[:dark_map]
@safari_map = hash[:safari_map] @safari_map = hash[:safari_map]
@snap_edges = hash[:snap_edges] @snap_edges = hash[:snap_edges]
@still_reflections = hash[:still_reflections]
@random_dungeon = hash[:random_dungeon] @random_dungeon = hash[:random_dungeon]
@battle_background = hash[:battle_background] @battle_background = hash[:battle_background]
@wild_battle_BGM = hash[:wild_battle_BGM] @wild_battle_BGM = hash[:wild_battle_BGM]

View File

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

View File

@@ -900,7 +900,8 @@ end
def pbTraverseWaterfall def pbTraverseWaterfall
if $game_player.direction == 2 # Facing down; descending if $game_player.direction == 2 # Facing down; descending
terrain = $game_player.pbTerrainTag 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 $PokemonGlobal.descending_waterfall = false
$game_player.through = false $game_player.through = false
return return
@@ -910,7 +911,8 @@ def pbTraverseWaterfall
$game_player.through = true $game_player.through = true
elsif $PokemonGlobal.ascending_waterfall elsif $PokemonGlobal.ascending_waterfall
terrain = $game_player.pbTerrainTag 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 $PokemonGlobal.ascending_waterfall = false
$game_player.through = false $game_player.through = false
return return

View File

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

View File

@@ -153,6 +153,7 @@ class PokemonPokedexInfo_Scene
def pbGetAvailableForms def pbGetAvailableForms
ret = [] ret = []
multiple_forms = false 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 # Find all genders/forms of @species that have been seen
GameData::Species.each do |sp| GameData::Species.each do |sp|
next if sp.species != @species 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 next if !$player.pokedex.seen_form?(@species, real_gender, sp.form) && !Settings::DEX_SHOWS_ALL_FORMS
real_gender = 2 if sp.gender_ratio == :Genderless real_gender = 2 if sp.gender_ratio == :Genderless
ret.push([sp.form_name, real_gender, sp.form]) 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 else # Both male and female
2.times do |real_gndr| 2.times do |real_gndr|
next if !$player.pokedex.seen_form?(@species, real_gndr, sp.form) && !Settings::DEX_SHOWS_ALL_FORMS 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] } 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 # Create form names for entries if they don't already exist
ret.each do |entry| 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] case entry[1]
when 0 then entry[0] = _INTL("Male") when 0 then entry[0] = _INTL("Male")
when 1 then entry[0] = _INTL("Female") when 1 then entry[0] = _INTL("Female")

View File

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

View File

@@ -495,16 +495,21 @@ module Compiler
all_evos = {} all_evos = {}
GameData::Species.each do |species| # Build a hash of prevolutions for each species GameData::Species.each do |species| # Build a hash of prevolutions for each species
species.evolutions.each do |evo| 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
end end
GameData::Species.each do |species| # Distribute prevolutions GameData::Species.each do |species| # Distribute prevolutions
next if species.evolutions.any? { |evo| evo[3] } # Already has prevo listed prevo_data = all_evos[[species.species, species.base_form]] || all_evos[species.species]
next if !all_evos[species.species] next if !prevo_data
# Record what species evolves from # 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 # 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 } if prevo.evolutions.none? { |evo| !evo[3] && evo[0] == species.species }
prevo.evolutions.push([species.species, :None, nil]) prevo.evolutions.push([species.species, :None, nil])
end end

View File

@@ -9222,7 +9222,7 @@ Habitat = WatersEdge
Category = Fish 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. 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 Generation = 3
Evolutions = MILOTIC,Beauty,170,MILOTIC,TradeItem,PRISMSCALE Evolutions = MILOTIC,TradeItem,PRISMSCALE,MILOTIC,Beauty,170
#------------------------------- #-------------------------------
[MILOTIC] [MILOTIC]
Name = Milotic Name = Milotic

View File

@@ -9212,7 +9212,7 @@ Habitat = WatersEdge
Category = Fish 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. 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 Generation = 3
Evolutions = MILOTIC,Beauty,170,MILOTIC,TradeItem,PRISMSCALE Evolutions = MILOTIC,TradeItem,PRISMSCALE,MILOTIC,Beauty,170
#------------------------------- #-------------------------------
[MILOTIC] [MILOTIC]
Name = Milotic Name = Milotic

View File

@@ -9214,7 +9214,7 @@ Habitat = WatersEdge
Category = Fish 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. 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 Generation = 3
Evolutions = MILOTIC,Beauty,170,MILOTIC,TradeItem,PRISMSCALE Evolutions = MILOTIC,TradeItem,PRISMSCALE,MILOTIC,Beauty,170
#------------------------------- #-------------------------------
[MILOTIC] [MILOTIC]
Name = Milotic Name = Milotic

View File

@@ -32,6 +32,8 @@ LandNight,21
9,HOOTHOOT,10,14 9,HOOTHOOT,10,14
1,HOOTHOOT,14 1,HOOTHOOT,14
1,RATTATA,15 1,RATTATA,15
PokeRadar,20
100,STARLY,12,15
#------------------------------- #-------------------------------
[005,1] # Route 1 [005,1] # Route 1
Land,21 Land,21
@@ -77,6 +79,8 @@ HeadbuttHigh
50,PINECO,11,13 50,PINECO,11,13
30,WURMPLE,6,8 30,WURMPLE,6,8
20,SPINARAK,9,12 20,SPINARAK,9,12
PokeRadar,10
100,STANTLER,14
#------------------------------- #-------------------------------
[028] # Natural Park [028] # Natural Park
Land,21 Land,21
@@ -110,6 +114,9 @@ BugContest,21
5,BUTTERFREE,12,15 5,BUTTERFREE,12,15
5,PINSIR,13,14 5,PINSIR,13,14
5,SCYTHER,13,14 5,SCYTHER,13,14
PokeRadar,40
50,BUTTERFREE,15,18
50,BEEDRILL,15,18
#------------------------------- #-------------------------------
[031] # Route 3 [031] # Route 3
Land,21 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. 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 Generation = 1
WildItemUncommon = METALCOAT WildItemUncommon = METALCOAT
Evolutions = MAGNEZONE,LocationFlag,Magnetic,MAGNEZONE,Item,THUNDERSTONE Evolutions = MAGNEZONE,Item,THUNDERSTONE,MAGNEZONE,LocationFlag,Magnetic
#------------------------------- #-------------------------------
[FARFETCHD] [FARFETCHD]
Name = Farfetch'd Name = Farfetch'd
@@ -3525,7 +3525,7 @@ Habitat = Urban
Category = Evolution 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. 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 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] [VAPOREON]
Name = Vaporeon Name = Vaporeon
@@ -9220,7 +9220,7 @@ Habitat = WatersEdge
Category = Fish 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. 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 Generation = 3
Evolutions = MILOTIC,Beauty,170,MILOTIC,TradeItem,PRISMSCALE Evolutions = MILOTIC,TradeItem,PRISMSCALE,MILOTIC,Beauty,170
#------------------------------- #-------------------------------
[MILOTIC] [MILOTIC]
Name = 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! 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 Generation = 7
WildItemUncommon = CELLBATTERY WildItemUncommon = CELLBATTERY
Evolutions = VIKAVOLT,LocationFlag,Magnetic,VIKAVOLT,Item,THUNDERSTONE Evolutions = VIKAVOLT,Item,THUNDERSTONE,VIKAVOLT,LocationFlag,Magnetic
#------------------------------- #-------------------------------
[VIKAVOLT] [VIKAVOLT]
Name = Vikavolt Name = Vikavolt