More or less standardised separator comments in the code

This commit is contained in:
Maruno17
2024-06-27 21:21:26 +01:00
parent 225549bfce
commit 509a414f37
198 changed files with 1907 additions and 1263 deletions

View File

@@ -140,7 +140,7 @@ def pbSpindaSpots(pkmn, bitmap)
end
#===============================================================================
# Regular form differences
# Regular form differences.
#===============================================================================
MultipleForms.register(:UNOWN, {
@@ -803,7 +803,7 @@ MultipleForms.register(:OGERPON, {
})
#===============================================================================
# Regional forms
# Regional forms.
# This code is for determining the form of a Pokémon in an egg created at the
# Day Care, where that Pokémon's species has regional forms. The regional form
# chosen depends on the region in which the egg was produced (not where it
@@ -845,12 +845,12 @@ MultipleForms.copy(
)
#===============================================================================
# Regional forms
# Regional forms.
# These species don't have visually different regional forms, but they need to
# evolve into different forms depending on the location where they evolve.
#===============================================================================
# Alolan forms
# Alolan forms.
MultipleForms.register(:PIKACHU, {
"getForm" => proc { |pkmn|
next if pkmn.form_simple >= 2
@@ -864,7 +864,7 @@ MultipleForms.register(:PIKACHU, {
MultipleForms.copy(:PIKACHU, :EXEGGCUTE, :CUBONE)
# Galarian forms
# Galarian forms.
MultipleForms.register(:KOFFING, {
"getForm" => proc { |pkmn|
next if pkmn.form_simple >= 2
@@ -878,7 +878,7 @@ MultipleForms.register(:KOFFING, {
MultipleForms.copy(:KOFFING, :MIMEJR)
# Hisuian forms
# Hisuian forms.
MultipleForms.register(:QUILAVA, {
"getForm" => proc { |pkmn|
next if pkmn.form_simple >= 2

View File

@@ -420,8 +420,9 @@ end
#===============================================================================
#
#===============================================================================
# Record current heart gauges of Pokémon in party, to see if they drop to zero
# during battle and need to say they're ready to be purified afterwards
# during battle and need to say they're ready to be purified afterwards.
EventHandlers.add(:on_start_battle, :record_party_heart_gauges,
proc {
$game_temp.party_heart_gauges_before_battle = []

View File

@@ -264,7 +264,7 @@ class PokemonStorage
end
#===============================================================================
# Regional Storage scripts
# Regional Storage scripts.
#===============================================================================
class RegionalStorage
def initialize
@@ -382,7 +382,7 @@ def pbLockWallpaper(index)
end
#===============================================================================
# Look through Pokémon in storage
# Look through Pokémon in storage.
#===============================================================================
# Yields every Pokémon/egg in storage in turn.
def pbEachPokemon

View File

@@ -121,9 +121,9 @@ class Pokemon
return @evolution_counter
end
#=============================================================================
# Species and form
#=============================================================================
#-----------------------------------------------------------------------------
# Species and form.
#-----------------------------------------------------------------------------
# Changes the Pokémon's species and re-calculates its statistics.
# @param species_id [Symbol, String, GameData::Species] ID of the species to change this Pokémon to
@@ -190,9 +190,9 @@ class Pokemon
calc_stats
end
#=============================================================================
# Level
#=============================================================================
#-----------------------------------------------------------------------------
# Level.
#-----------------------------------------------------------------------------
# @return [Integer] this Pokémon's level
def level
@@ -244,9 +244,9 @@ class Pokemon
return (@exp - start_exp).to_f / (end_exp - start_exp)
end
#=============================================================================
# Status
#=============================================================================
#-----------------------------------------------------------------------------
# Status.
#-----------------------------------------------------------------------------
# Sets the Pokémon's health.
# @param value [Integer] new HP value
@@ -314,9 +314,9 @@ class Pokemon
@ready_to_evolve = false
end
#=============================================================================
# Types
#=============================================================================
#-----------------------------------------------------------------------------
# Types.
#-----------------------------------------------------------------------------
# @return [Array<Symbol>] an array of this Pokémon's types
def types
@@ -342,9 +342,9 @@ class Pokemon
return self.types.include?(type)
end
#=============================================================================
# Gender
#=============================================================================
#-----------------------------------------------------------------------------
# Gender.
#-----------------------------------------------------------------------------
# @return [0, 1, 2] this Pokémon's gender (0 = male, 1 = female, 2 = genderless)
def gender
@@ -391,9 +391,9 @@ class Pokemon
return species_data.single_gendered?
end
#=============================================================================
# Shininess
#=============================================================================
#-----------------------------------------------------------------------------
# Shininess.
#-----------------------------------------------------------------------------
# @return [Boolean] whether this Pokémon is shiny (differently colored)
def shiny?
@@ -426,9 +426,9 @@ class Pokemon
@shiny = true if @super_shiny
end
#=============================================================================
# Ability
#=============================================================================
#-----------------------------------------------------------------------------
# Ability.
#-----------------------------------------------------------------------------
# The index of this Pokémon's ability (0, 1 are natural abilities, 2+ are
# hidden abilities) as defined for its species/form. An ability may not be
@@ -498,9 +498,9 @@ class Pokemon
return ret
end
#=============================================================================
# Nature
#=============================================================================
#-----------------------------------------------------------------------------
# Nature.
#-----------------------------------------------------------------------------
# @return [GameData::Nature, nil] a Nature object corresponding to this Pokémon's nature
def nature
@@ -553,9 +553,9 @@ class Pokemon
return self.nature == check_nature
end
#=============================================================================
# Items
#=============================================================================
#-----------------------------------------------------------------------------
# Items.
#-----------------------------------------------------------------------------
# @return [GameData::Item, nil] an Item object corresponding to this Pokémon's item
def item
@@ -607,9 +607,9 @@ class Pokemon
@mail = mail
end
#=============================================================================
# Moves
#=============================================================================
#-----------------------------------------------------------------------------
# Moves.
#-----------------------------------------------------------------------------
# @return [Integer] the number of moves known by the Pokémon
def numMoves
@@ -731,9 +731,9 @@ class Pokemon
return false
end
#=============================================================================
# Ribbons
#=============================================================================
#-----------------------------------------------------------------------------
# Ribbons.
#-----------------------------------------------------------------------------
# @return [Integer] the number of ribbons this Pokémon has
def numRibbons
@@ -792,9 +792,9 @@ class Pokemon
@ribbons.clear
end
#=============================================================================
# Pokérus
#=============================================================================
#-----------------------------------------------------------------------------
# Pokérus.
#-----------------------------------------------------------------------------
# @return [Integer] the Pokérus infection stage for this Pokémon
def pokerusStrain
@@ -840,9 +840,9 @@ class Pokemon
@pokerus -= @pokerus % 16
end
#=============================================================================
# Ownership, obtained information
#=============================================================================
#-----------------------------------------------------------------------------
# Ownership, obtained information.
#-----------------------------------------------------------------------------
# Changes this Pokémon's owner.
# @param new_owner [Owner] the owner to change to
@@ -879,9 +879,9 @@ class Pokemon
@timeEggHatched = value.to_i
end
#=============================================================================
# Other
#=============================================================================
#-----------------------------------------------------------------------------
# Other.
#-----------------------------------------------------------------------------
# @return [String] the name of this Pokémon
def name
@@ -977,9 +977,9 @@ class Pokemon
@happiness = (@happiness + gain).clamp(0, 255)
end
#=============================================================================
# Evolution checks
#=============================================================================
#-----------------------------------------------------------------------------
# Evolution checks.
#-----------------------------------------------------------------------------
# Checks whether this Pokemon can evolve because of levelling up.
# @return [Symbol, nil] the ID of the species to evolve into
@@ -1078,9 +1078,9 @@ class Pokemon
return false
end
#=============================================================================
# Stat calculations
#=============================================================================
#-----------------------------------------------------------------------------
# Stat calculations.
#-----------------------------------------------------------------------------
# @return [Hash<Integer>] this Pokémon's base stats, a hash with six key/value pairs
def baseStats
@@ -1146,9 +1146,9 @@ class Pokemon
@speed = stats[:SPEED]
end
#=============================================================================
# Pokémon creation
#=============================================================================
#-----------------------------------------------------------------------------
# Pokémon creation.
#-----------------------------------------------------------------------------
# Creates a copy of this Pokémon and returns it.
# @return [Pokemon] a copy of this Pokémon

View File

@@ -1,8 +1,11 @@
#===============================================================================
#
#===============================================================================
class Pokemon
#=============================================================================
# Mega Evolution
#-----------------------------------------------------------------------------
# Mega Evolution.
# NOTE: These are treated as form changes in Essentials.
#=============================================================================
#-----------------------------------------------------------------------------
def getMegaForm
ret = 0
GameData::Species.each do |data|
@@ -53,10 +56,10 @@ class Pokemon
return message_number || 0
end
#=============================================================================
# Primal Reversion
#-----------------------------------------------------------------------------
# Primal Reversion.
# NOTE: These are treated as form changes in Essentials.
#=============================================================================
#-----------------------------------------------------------------------------
def hasPrimalForm?
v = MultipleForms.call("getPrimalForm", self)
return !v.nil?