From f66e8db906bce47d255168d375dd2f777c065bb1 Mon Sep 17 00:00:00 2001 From: Maruno17 Date: Tue, 12 Apr 2022 21:21:58 +0100 Subject: [PATCH] Minor script rearranging --- .../012_Game_FollowerFactory.rb | 53 ++++++++++--------- .../007_Battle_Scene_BaseAnimation.rb | 45 ++++++---------- ...ommands.rb => 004_Debug_BattleCommands.rb} | 0 ...nds.rb => 005_Debug_BattlePkmnCommands.rb} | 0 ...raCode.rb => 006_Debug_BattleExtraCode.rb} | 0 ...mmands.rb => 007_Debug_PokemonCommands.rb} | 0 ...pdater.rb => 008_Debug_FilenameUpdater.rb} | 0 Data/Scripts/Gen 8 notes.txt | 10 ++-- 8 files changed, 48 insertions(+), 60 deletions(-) rename Data/Scripts/020_Debug/003_Debug menus/{007_Debug_BattleCommands.rb => 004_Debug_BattleCommands.rb} (100%) rename Data/Scripts/020_Debug/003_Debug menus/{008_Debug_BattlePkmnCommands.rb => 005_Debug_BattlePkmnCommands.rb} (100%) rename Data/Scripts/020_Debug/003_Debug menus/{009_Debug_BattleExtraCode.rb => 006_Debug_BattleExtraCode.rb} (100%) rename Data/Scripts/020_Debug/003_Debug menus/{005_Debug_PokemonCommands.rb => 007_Debug_PokemonCommands.rb} (100%) rename Data/Scripts/020_Debug/003_Debug menus/{006_Debug_FilenameUpdater.rb => 008_Debug_FilenameUpdater.rb} (100%) diff --git a/Data/Scripts/004_Game classes/012_Game_FollowerFactory.rb b/Data/Scripts/004_Game classes/012_Game_FollowerFactory.rb index 24d8e7ffa..6c5bea3df 100644 --- a/Data/Scripts/004_Game classes/012_Game_FollowerFactory.rb +++ b/Data/Scripts/004_Game classes/012_Game_FollowerFactory.rb @@ -1,3 +1,6 @@ +#=============================================================================== +# Data saved in $PokemonGlobal.followers. +#=============================================================================== class FollowerData attr_accessor :original_map_id attr_accessor :event_id @@ -42,6 +45,31 @@ class FollowerData end end +#=============================================================================== +# Permanently stores data of follower events (i.e. in save files). +#=============================================================================== +class PokemonGlobalMetadata + attr_accessor :dependentEvents # Deprecated + attr_writer :followers + + def followers + @followers = [] if !@followers + return @followers + end +end + +#=============================================================================== +# Stores Game_Follower instances just for the current play session. +#=============================================================================== +class Game_Temp + attr_writer :followers + + def followers + @followers = Game_FollowerFactory.new if !@followers + return @followers + end +end + #=============================================================================== # #=============================================================================== @@ -312,31 +340,6 @@ class FollowerSprites end end -#=============================================================================== -# Stores Game_Follower instances just for the current play session. -#=============================================================================== -class Game_Temp - attr_writer :followers - - def followers - @followers = Game_FollowerFactory.new if !@followers - return @followers - end -end - -#=============================================================================== -# Permanently stores data of follower events (i.e. in save files). -#=============================================================================== -class PokemonGlobalMetadata - attr_accessor :dependentEvents # Deprecated - attr_writer :followers - - def followers - @followers = [] if !@followers - return @followers - end -end - #=============================================================================== # Helper module for adding/removing/getting followers. #=============================================================================== diff --git a/Data/Scripts/011_Battle/004_Scene/007_Battle_Scene_BaseAnimation.rb b/Data/Scripts/011_Battle/004_Scene/007_Battle_Scene_BaseAnimation.rb index 7c3e1e1d3..86d998459 100644 --- a/Data/Scripts/011_Battle/004_Scene/007_Battle_Scene_BaseAnimation.rb +++ b/Data/Scripts/011_Battle/004_Scene/007_Battle_Scene_BaseAnimation.rb @@ -1,3 +1,6 @@ +#=============================================================================== +# Base class for all hardcoded battle animations. +#=============================================================================== class Battle::Scene::Animation def initialize(sprites, viewport) @sprites = sprites @@ -59,8 +62,9 @@ class Battle::Scene::Animation end end - - +#=============================================================================== +# Mixin module for certain hardcoded battle animations that involve Poké Balls. +#=============================================================================== module Battle::Scene::Animation::BallAnimationMixin # Returns the color that the Pokémon turns when it goes into or out of its # Poké Ball. @@ -85,30 +89,6 @@ module Battle::Scene::Animation::BallAnimationMixin return Color.new(255, 181, 247) # Poké Ball, Sport Ball, Apricorn Balls, others end - # There are three kinds of animations shown when a Poké Ball opens up: one for - # when attempting to capture a Pokémon, one when recalling a Pokémon, and one - # for all other cases (e.g. sending out). This is anim_type (one of :capture, - # :recall and :main). The recall animation is the same for all Poké Balls, and - # the other two animations are different for each Poké Ball. - def getBallBurstAnimationName(poke_ball, anim_type = :main) - animations = pbLoadBattleAnimations - if anim_type == :recall - anim_name = "BallBurstRecall" - return anim_name if animations&.get_from_name("Common:" + anim_name) - else - name = poke_ball.to_s - if anim_type == :capture - anim = animations&.get_from_name("Common:BallBurstCapture" + name) - return "BallBurstCapture" + name if anim - anim = animations&.get_from_name("Common:BallBurstCapture") - return "BallBurstCapture" if anim - end - anim = animations&.get_from_name("Common:BallBurst" + name) - return "BallBurst" + name if anim - end - return "BallBurst" - end - def addBallSprite(ballX, ballY, poke_ball) file_path = sprintf("Graphics/Battle animations/ball_%s", poke_ball) ball = addNewSprite(ballX, ballY, file_path, PictureOrigin::CENTER) @@ -364,7 +344,8 @@ module Battle::Scene::Animation::BallAnimationMixin "particle", Tone.new(0, 0, -96, -32), Tone.new(0, 0, -192, -64)] # Light yellow, yellow } - # The regular Poké Ball burst animation. + # The regular Poké Ball burst animation, for when a Pokémon appears from a + # Poké Ball. def ballBurst(delay, ball, ballX, ballY, poke_ball) num_particles = 15 num_rays = 10 @@ -572,11 +553,13 @@ module Battle::Scene::Animation::BallAnimationMixin ball.setDelta(delay + particle_duration + ring_duration, 0, 0) end + # The animation shown over a thrown Poké Ball when it has successfully caught + # a Pokémon. def ballCaptureSuccess(ball, delay, ballX, ballY) ball.setSE(delay, "Battle catch click") - ball.moveTone(delay, 4, Tone.new(-128, -128, -128, 0)) + ball.moveTone(delay, 4, Tone.new(-128, -128, -128, 0)) # Ball goes darker delay = ball.totalDuration - star_duration = 12 # 20ths of a second + star_duration = 12 # In 20ths of a second y_offsets = [[0, 74, 52], [0, 62, 28], [0, 74, 48]] 3.times do |i| # Left, middle, right # Set up particle @@ -607,7 +590,9 @@ module Battle::Scene::Animation::BallAnimationMixin end end - # The Poké Ball burst animation used when recalling a Pokémon. + # The Poké Ball burst animation used when recalling a Pokémon. In HGSS, this + # is the same for all types of Poké Ball except for the color that the battler + # turns - see def getBattlerColorFromPokeBall. def ballBurstRecall(delay, ball, ballX, ballY, poke_ball) color_duration = 10 # Change color of battler to a solid shade - see def battlerAbsorb shrink_duration = 5 # Shrink battler into Poké Ball - see def battlerAbsorb diff --git a/Data/Scripts/020_Debug/003_Debug menus/007_Debug_BattleCommands.rb b/Data/Scripts/020_Debug/003_Debug menus/004_Debug_BattleCommands.rb similarity index 100% rename from Data/Scripts/020_Debug/003_Debug menus/007_Debug_BattleCommands.rb rename to Data/Scripts/020_Debug/003_Debug menus/004_Debug_BattleCommands.rb diff --git a/Data/Scripts/020_Debug/003_Debug menus/008_Debug_BattlePkmnCommands.rb b/Data/Scripts/020_Debug/003_Debug menus/005_Debug_BattlePkmnCommands.rb similarity index 100% rename from Data/Scripts/020_Debug/003_Debug menus/008_Debug_BattlePkmnCommands.rb rename to Data/Scripts/020_Debug/003_Debug menus/005_Debug_BattlePkmnCommands.rb diff --git a/Data/Scripts/020_Debug/003_Debug menus/009_Debug_BattleExtraCode.rb b/Data/Scripts/020_Debug/003_Debug menus/006_Debug_BattleExtraCode.rb similarity index 100% rename from Data/Scripts/020_Debug/003_Debug menus/009_Debug_BattleExtraCode.rb rename to Data/Scripts/020_Debug/003_Debug menus/006_Debug_BattleExtraCode.rb diff --git a/Data/Scripts/020_Debug/003_Debug menus/005_Debug_PokemonCommands.rb b/Data/Scripts/020_Debug/003_Debug menus/007_Debug_PokemonCommands.rb similarity index 100% rename from Data/Scripts/020_Debug/003_Debug menus/005_Debug_PokemonCommands.rb rename to Data/Scripts/020_Debug/003_Debug menus/007_Debug_PokemonCommands.rb diff --git a/Data/Scripts/020_Debug/003_Debug menus/006_Debug_FilenameUpdater.rb b/Data/Scripts/020_Debug/003_Debug menus/008_Debug_FilenameUpdater.rb similarity index 100% rename from Data/Scripts/020_Debug/003_Debug menus/006_Debug_FilenameUpdater.rb rename to Data/Scripts/020_Debug/003_Debug menus/008_Debug_FilenameUpdater.rb diff --git a/Data/Scripts/Gen 8 notes.txt b/Data/Scripts/Gen 8 notes.txt index c9e384eaa..bf707463b 100644 --- a/Data/Scripts/Gen 8 notes.txt +++ b/Data/Scripts/Gen 8 notes.txt @@ -14,11 +14,6 @@ Other notes: "The Weakness Policy sharply raised {1}'s Sp. Atk!" "The Weakness Policy was used up..." -- Ask whether a captured Pokémon, or an added Pokémon, should be put in storage - or added to the party if the party is full. Also provide the option to look at - its Pokédex entry. Have a way to force adding it to the party for plot - purposes (battle rule?). - #=============================================================================== # Low priority or ignorable #=============================================================================== @@ -202,4 +197,9 @@ gain Exp (the fee is $500 per Pokémon up-front). The time it takes to do this is apparently the same as egg generation (e.g. a chance every 255 steps), but the parents don't need to be able to breed in order to learn egg moves. +Ask whether a captured Pokémon, or an added Pokémon, should be put in storage +or added to the party if the party is full. Also provide the option to look at +its Pokédex entry. Have a way to force adding it to the party for plot +purposes (battle rule?). + =end