Update 6.8

This commit is contained in:
chardub
2026-07-10 15:42:06 -04:00
parent 5b85e72cb2
commit 6a6f126a18
7871 changed files with 493194 additions and 224826 deletions
File diff suppressed because it is too large Load Diff
@@ -1,6 +1,10 @@
#===============================================================================
# Battle intro animation
#===============================================================================
TRANSITION_TIME = 0.5
TRANSITION_PAUSE_TIME = 20
def pbSceneStandby
$scene.disposeSpritesets if $scene.is_a?(Scene_Map)
if RPG::Cache.need_clearing
@@ -78,7 +82,7 @@ def pbBattleAnimation(bgm=nil,battletype=0,foe=nil)
end
halfFlashTime = Graphics.frame_rate*2/10 # 0.2 seconds, 8 frames
alphaDiff = (255.0/halfFlashTime).ceil
2.times do
1.times do
viewport.color.alpha = 0
for i in 0...halfFlashTime*2
if i<halfFlashTime; viewport.color.alpha += alphaDiff
@@ -90,14 +94,15 @@ def pbBattleAnimation(bgm=nil,battletype=0,foe=nil)
end
# Play main animation
Graphics.freeze
Graphics.transition(Graphics.frame_rate*1.25,sprintf("Graphics/Transitions/%s",anim))
Graphics.transition(Graphics.frame_rate*TRANSITION_TIME,sprintf("Graphics/Transitions/%s",anim))
viewport.color = Color.new(0,0,0,255) # Ensure screen is black
# Slight pause after animation before starting up the battle scene
(Graphics.frame_rate/10).times do
Graphics.update
Input.update
pbUpdateSceneMap
end
# (Graphics.frame_rate/TRANSITION_PAUSE_TIME).times do
# Graphics.update
# Input.update
# pbUpdateSceneMap
# end
pbUpdateSceneMap
end
pbPushFade
# Yield to the battle scene
@@ -142,10 +147,11 @@ def pbBattleAnimationOverride(viewport,battletype=0,foe=nil)
if tr_type
tbargraphic = sprintf("vsBar_%s", tr_type.to_s) rescue nil
#tgraphic = sprintf("vsTrainer_%s", tr_type.to_s) rescue nil
tgraphic = sprintf("trainer%03d", tr_number) rescue nil
#tgraphic = sprintf("trainer%03d", tr_number) rescue nil
tgraphic = tr_type.to_s rescue nil
echoln tgraphic
if pbResolveBitmap("Graphics/Transitions/" + tbargraphic) && pbResolveBitmap("Graphics/Characters/" + tgraphic)
echoln tbargraphic
if pbResolveBitmap("Graphics/Transitions/" + tbargraphic)# && pbResolveBitmap("Graphics/Characters/" + tgraphic)
player_tr_type = $Trainer.trainer_type
outfit = $Trainer.outfit
# Set up
@@ -164,6 +170,8 @@ def pbBattleAnimationOverride(viewport,battletype=0,foe=nil)
pbSetSystemFont(overlay.bitmap)
#pbargraphic = sprintf("vsBar_%s_%d", player_tr_type.to_s, outfit) rescue nil
pbargraphic = sprintf("vsBar_%s", player_tr_type.to_s) rescue nil
echoln pbargraphic
if !pbResolveBitmap("Graphics/Transitions/" + pbargraphic)
pbargraphic = sprintf("vsBar_%s", player_tr_type.to_s) rescue nil
end
@@ -230,7 +238,7 @@ def pbBattleAnimationOverride(viewport,battletype=0,foe=nil)
trainer = Sprite.new(viewopp)
#trainer.bitmap = RPG::Cache.transition(tgraphic)
trainer.bitmap =RPG::Cache.load_bitmap("Graphics/Characters/", tgraphic) #RPG::Cache.transition(pgraphic)
trainer.bitmap =RPG::Cache.load_bitmap("Graphics/Trainers/", tgraphic) #RPG::Cache.transition(pgraphic)
trainer.x = xoffset+150
trainer.tone = Tone.new(-255,-255,-255)
trainer.zoom_x = 2
@@ -123,7 +123,7 @@ class PokemonEncounters
return false if !@step_chances[enc_type] || @step_chances[enc_type] == 0
return false if !has_encounter_type?(enc_type)
#Always check encounter if pokeradar is active
return true if $PokemonTemp.pokeradar != nil
return true if $PokemonTemp.pokeradar != nil && !$PokemonSystem.overworld_encounters
# Get base encounter chance and minimum steps grace period
encounter_chance = @step_chances[enc_type].to_f
@@ -192,6 +192,10 @@ class PokemonEncounters
# taking into account Repels and ability effects.
def allow_encounter?(enc_data, repel_active = false)
return false if !enc_data
if $PokemonTemp.pokeradar
return pbPokeRadarOnShakingGrass
end
# Repel
if repel_active && !pbPokeRadarOnShakingGrass
first_pkmn = (Settings::REPEL_COUNTS_FAINTED_POKEMON) ? $Trainer.first_pokemon : $Trainer.first_able_pokemon
@@ -265,6 +269,7 @@ class PokemonEncounters
baseType = :Land1 if terrain_tag == :Grass_alt1
baseType = :Land2 if terrain_tag == :Grass_alt2
baseType = :Land3 if terrain_tag == :Grass_alt3
baseType = :TallGrass if terrain_tag == :TallGrass
ret = find_valid_encounter_type_for_time(baseType, time) if !ret
end
if !ret && has_cave_encounters?
@@ -283,6 +288,9 @@ class PokemonEncounters
if !enc_type || !GameData::EncounterType.exists?(enc_type)
raise ArgumentError.new(_INTL("Encounter type {1} does not exist", enc_type))
end
if map_is_altering_cave?
return select_altering_cave_encounter
end
enc_list = @encounter_tables[enc_type]
return nil if !enc_list || enc_list.length == 0
# Static/Magnet Pull prefer wild encounters of certain types, if possible.
@@ -325,6 +333,7 @@ class PokemonEncounters
encounter = enc
break
end
# Get the chosen species and level
level = rand(encounter[2]..encounter[3])
# Some abilities alter the level of the wild Pokémon
@@ -382,13 +391,35 @@ class PokemonEncounters
def listPossibleEncounters(enctype)
def listPossibleEncounters(enctype,include_weather=false)
if !enctype
raise ArgumentError.new(_INTL("Encounter type out of range"))
end
return @encounter_tables[enctype]
list= @encounter_tables[enctype]
if include_weather && $game_weather
list += $PokemonEncounters.list_weather_encounters(enctype)
end
return list
end
def list_weather_encounters(enctype)
list = []
return [] unless $game_weather.current_weather[$game_map.map_id]
current_weather = $game_weather.current_weather[$game_map.map_id][0]
weather_encounter_type = get_weather_encounter_type(enctype, current_weather)
weather_encounters = @encounter_tables[weather_encounter_type]
list += weather_encounters if weather_encounters
return list
end
def list_weather_encounters_species(enctype)
species_list = []
weather_encounters= list_weather_encounters(enctype)
weather_encounters.each do |encounter|
species_list.push(encounter[1])
end
return species_list
end
end
@@ -415,13 +446,8 @@ def pbGenerateWildPokemon(species,level,isRoamer=false)
elsif itemrnd<(chances[0]+chances[1]+chances[2])
genwildpoke.item = items[2]
end
# Shiny Charm makes shiny Pokémon more likely to generate
if GameData::Item.exists?(:SHINYCHARM) && $PokemonBag.pbHasItem?(:SHINYCHARM)
2.times do # 3 times as likely
break if genwildpoke.shiny?
genwildpoke.personalID = rand(2**16) | rand(2**16) << 16
end
end
apply_shiny_rerolls(genwildpoke)
# Give Pokérus
genwildpoke.givePokerus if rand(65536) < Settings::POKERUS_CHANCE
# Change wild Pokémon's gender/nature depending on the lead party Pokémon's
@@ -442,6 +468,31 @@ def pbGenerateWildPokemon(species,level,isRoamer=false)
return genwildpoke
end
def apply_shiny_rerolls(pokemon)
# Shiny Charm: 2 extra rerolls (3× as likely)
if GameData::Item.exists?(:SHINYCHARM) && $PokemonBag.pbHasItem?(:SHINYCHARM)
2.times do
break if pokemon.shiny?
pokemon.personalID = rand(2**16) | rand(2**16) << 16
end
end
# NPC friends: 02 extra rerolls scaling with friend count (3× at 100 friends)
if $Trainer.nb_npc_friends && $Trainer.nb_npc_friends > 0
extra_rerolls = ([[$Trainer.nb_npc_friends, 0].max, 100].min / 100.0) * 2.0
full_rerolls = extra_rerolls.floor
partial_chance = extra_rerolls - full_rerolls
full_rerolls.times do
break if pokemon.shiny?
pokemon.personalID = rand(2**16) | rand(2**16) << 16
end
if !pokemon.shiny? && rand < partial_chance
pokemon.personalID = rand(2**16) | rand(2**16) << 16
end
end
end
# Used by fishing rods and Headbutt/Rock Smash/Sweet Scent to generate a wild
# Pokémon (or two) for a triggered wild encounter.
def pbEncounter(enc_type)
@@ -173,7 +173,7 @@ EncounterModifier.register(proc { |encounter|
# Give the regular encounter if encountering a roaming Pokémon isn't possible
next encounter if $PokemonGlobal.roamedAlready
next encounter if $PokemonGlobal.partner
next encounter if $PokemonTemp.pokeradar
next encounter if $PokemonTemp.pokeradar && !$PokemonSystem.overworld_encounters
#next encounter if rand(100) < 75 # 25% chance of encountering a roaming Pokémon
# Look at each roaming Pokémon in turn and decide whether it's possible to
# encounter it