Minor script rearranging

This commit is contained in:
Maruno17
2022-04-12 21:21:58 +01:00
parent 90328df274
commit f66e8db906
8 changed files with 48 additions and 60 deletions

View File

@@ -1,3 +1,6 @@
#===============================================================================
# Data saved in $PokemonGlobal.followers.
#===============================================================================
class FollowerData class FollowerData
attr_accessor :original_map_id attr_accessor :original_map_id
attr_accessor :event_id attr_accessor :event_id
@@ -42,6 +45,31 @@ class FollowerData
end end
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
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. # Helper module for adding/removing/getting followers.
#=============================================================================== #===============================================================================

View File

@@ -1,3 +1,6 @@
#===============================================================================
# Base class for all hardcoded battle animations.
#===============================================================================
class Battle::Scene::Animation class Battle::Scene::Animation
def initialize(sprites, viewport) def initialize(sprites, viewport)
@sprites = sprites @sprites = sprites
@@ -59,8 +62,9 @@ class Battle::Scene::Animation
end end
end end
#===============================================================================
# Mixin module for certain hardcoded battle animations that involve Poké Balls.
#===============================================================================
module Battle::Scene::Animation::BallAnimationMixin module Battle::Scene::Animation::BallAnimationMixin
# Returns the color that the Pokémon turns when it goes into or out of its # Returns the color that the Pokémon turns when it goes into or out of its
# Poké Ball. # Poké Ball.
@@ -85,30 +89,6 @@ module Battle::Scene::Animation::BallAnimationMixin
return Color.new(255, 181, 247) # Poké Ball, Sport Ball, Apricorn Balls, others return Color.new(255, 181, 247) # Poké Ball, Sport Ball, Apricorn Balls, others
end 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) def addBallSprite(ballX, ballY, poke_ball)
file_path = sprintf("Graphics/Battle animations/ball_%s", poke_ball) file_path = sprintf("Graphics/Battle animations/ball_%s", poke_ball)
ball = addNewSprite(ballX, ballY, file_path, PictureOrigin::CENTER) 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 "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) def ballBurst(delay, ball, ballX, ballY, poke_ball)
num_particles = 15 num_particles = 15
num_rays = 10 num_rays = 10
@@ -572,11 +553,13 @@ module Battle::Scene::Animation::BallAnimationMixin
ball.setDelta(delay + particle_duration + ring_duration, 0, 0) ball.setDelta(delay + particle_duration + ring_duration, 0, 0)
end end
# The animation shown over a thrown Poké Ball when it has successfully caught
# a Pokémon.
def ballCaptureSuccess(ball, delay, ballX, ballY) def ballCaptureSuccess(ball, delay, ballX, ballY)
ball.setSE(delay, "Battle catch click") 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 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]] y_offsets = [[0, 74, 52], [0, 62, 28], [0, 74, 48]]
3.times do |i| # Left, middle, right 3.times do |i| # Left, middle, right
# Set up particle # Set up particle
@@ -607,7 +590,9 @@ module Battle::Scene::Animation::BallAnimationMixin
end end
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) def ballBurstRecall(delay, ball, ballX, ballY, poke_ball)
color_duration = 10 # Change color of battler to a solid shade - see def battlerAbsorb 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 shrink_duration = 5 # Shrink battler into Poké Ball - see def battlerAbsorb

View File

@@ -14,11 +14,6 @@ Other notes:
"The Weakness Policy sharply raised {1}'s Sp. Atk!" "The Weakness Policy sharply raised {1}'s Sp. Atk!"
"The Weakness Policy was used up..." "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 # 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 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. 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 =end