Fixed previous commit always causing recompiling if shadow_pokemon.dat doesn't exist, also rubocopping

This commit is contained in:
Maruno17
2023-01-23 22:27:04 +00:00
parent f6213057d8
commit b0b6e675c3
103 changed files with 1099 additions and 1302 deletions

View File

@@ -164,11 +164,11 @@ class Battle
@runCommand = 0
@nextPickupUse = 0
if GameData::Move.exists?(:STRUGGLE)
@struggle = Move.from_pokemon_move(self, Pokemon::Move.new(:STRUGGLE))
@struggle = Move.from_pokemon_move(self, Pokemon::Move.new(:STRUGGLE))
else
@struggle = Move::Struggle.new(self, nil)
@struggle = Move::Struggle.new(self, nil)
end
@mega_rings = []
@mega_rings = []
GameData::Item.each { |item| @mega_rings.push(item.id) if item.has_flag?("MegaRing") }
@battleAI = AI.new(self)
end

View File

@@ -144,7 +144,7 @@ class Battle::Battler
def pbResetTypes
@types = @pokemon.types
@effects[PBEffects::ExtraType] = nil
@effects[PBEffects::ExtraType] = nil
@effects[PBEffects::BurnUp] = false
@effects[PBEffects::Roost] = false
end

View File

@@ -453,8 +453,6 @@ class Battle::Move::DoublePowerIfTargetPoisoned < Battle::Move
end
end
#===============================================================================
# Power is doubled if the target is paralyzed. Cures the target of paralysis.
# (Smelling Salts)

View File

@@ -91,8 +91,6 @@ class Battle::Scene::MenuBase
end
end
#===============================================================================
# Command menu (Fight/Pokémon/Bag/Run)
#===============================================================================
@@ -194,8 +192,6 @@ class Battle::Scene::CommandMenu < Battle::Scene::MenuBase
end
end
#===============================================================================
# Fight menu (choose a move)
#===============================================================================
@@ -440,8 +436,6 @@ class Battle::Scene::FightMenu < Battle::Scene::MenuBase
end
end
#===============================================================================
# Target menu (choose a move's target)
# NOTE: Unlike the command and fight menus, this one doesn't have a textbox-only

View File

@@ -402,8 +402,6 @@ class Battle::Scene::PokemonDataBox < Sprite
end
end
#===============================================================================
# Splash bar to announce a triggered ability
#===============================================================================
@@ -496,8 +494,6 @@ class Battle::Scene::AbilitySplashBar < Sprite
end
end
#===============================================================================
# Pokémon sprite (used in battle)
#===============================================================================
@@ -624,8 +620,6 @@ class Battle::Scene::BattlerSprite < RPG::Sprite
end
end
#===============================================================================
# Shadow sprite for Pokémon (used in battle)
#===============================================================================

View File

@@ -57,8 +57,6 @@ class Battle::Scene::Animation::Intro < Battle::Scene::Animation
end
end
#===============================================================================
# Shows wild Pokémon fading back to their normal color, and triggers their intro
# animations
@@ -80,8 +78,6 @@ class Battle::Scene::Animation::Intro2 < Battle::Scene::Animation
end
end
#===============================================================================
# Makes a side's party bar and balls appear
#===============================================================================
@@ -181,8 +177,6 @@ class Battle::Scene::Animation::LineupAppear < Battle::Scene::Animation
end
end
#===============================================================================
# Makes a Pokémon's data box appear
#===============================================================================
@@ -202,8 +196,6 @@ class Battle::Scene::Animation::DataBoxAppear < Battle::Scene::Animation
end
end
#===============================================================================
# Makes a Pokémon's data box disappear
#===============================================================================
@@ -222,8 +214,6 @@ class Battle::Scene::Animation::DataBoxDisappear < Battle::Scene::Animation
end
end
#===============================================================================
# Makes a Pokémon's ability bar appear
#===============================================================================
@@ -242,8 +232,6 @@ class Battle::Scene::Animation::AbilitySplashAppear < Battle::Scene::Animation
end
end
#===============================================================================
# Makes a Pokémon's ability bar disappear
#===============================================================================
@@ -262,8 +250,6 @@ class Battle::Scene::Animation::AbilitySplashDisappear < Battle::Scene::Animatio
end
end
#===============================================================================
# Make an enemy trainer slide on-screen from the right. Makes the previous
# trainer slide off to the right first if it is on-screen.
@@ -296,8 +282,6 @@ class Battle::Scene::Animation::TrainerAppear < Battle::Scene::Animation
end
end
#===============================================================================
# Shows the player (and partner) and the player party lineup sliding off screen.
# Shows the player's/partner's throwing animation (if they have one).
@@ -350,8 +334,6 @@ class Battle::Scene::Animation::PlayerFade < Battle::Scene::Animation
end
end
#===============================================================================
# Shows the enemy trainer(s) and the enemy party lineup sliding off screen.
# Doesn't show the ball thrown or the Pokémon.
@@ -395,8 +377,6 @@ class Battle::Scene::Animation::TrainerFade < Battle::Scene::Animation
end
end
#===============================================================================
# Shows a Pokémon being sent out on the player's side (including by a partner).
# Includes the Poké Ball being thrown.
@@ -473,8 +453,6 @@ class Battle::Scene::Animation::PokeballPlayerSendOut < Battle::Scene::Animation
end
end
#===============================================================================
# Shows a Pokémon being sent out on the opposing side.
# Includes the Poké Ball being "thrown" (although here the Poké Ball just
@@ -544,8 +522,6 @@ class Battle::Scene::Animation::PokeballTrainerSendOut < Battle::Scene::Animatio
end
end
#===============================================================================
# Shows a Pokémon being recalled into its Poké Ball
#===============================================================================
@@ -594,8 +570,6 @@ class Battle::Scene::Animation::BattlerRecall < Battle::Scene::Animation
end
end
#===============================================================================
# Shows a Pokémon flashing after taking damage
#===============================================================================
@@ -632,8 +606,6 @@ class Battle::Scene::Animation::BattlerDamage < Battle::Scene::Animation
end
end
#===============================================================================
# Shows a Pokémon fainting
#===============================================================================
@@ -682,8 +654,6 @@ class Battle::Scene::Animation::BattlerFaint < Battle::Scene::Animation
end
end
#===============================================================================
# Shows the player's Poké Ball being thrown to capture a Pokémon
#===============================================================================
@@ -836,8 +806,6 @@ class Battle::Scene::Animation::PokeballThrowCapture < Battle::Scene::Animation
end
end
#===============================================================================
# Shows the player throwing a Poké Ball and it being deflected
#===============================================================================

View File

@@ -57,8 +57,7 @@ class Battle::DebugSceneNoLogging
def pbChangePokemon(idxBattler, pkmn); end
def pbFaintBattler(battler); end
def pbEXPBar(battler, startExp, endExp, tempExp1, tempExp2); end
def pbLevelUp(pkmn, battler, oldTotalHP, oldAttack, oldDefense,
oldSpAtk, oldSpDef, oldSpeed); end
def pbLevelUp(pkmn, battler, oldTotalHP, oldAttack, oldDefense, oldSpAtk, oldSpDef, oldSpeed); end
def pbForgetMove(pkmn, moveToLearn); return 0; end # Always forget first move
def pbCommandMenu(idxBattler, firstAction)

View File

@@ -51,8 +51,9 @@ class Battle
end
end
#===============================================================================
#
#===============================================================================
class Battle::Battler
unless @__clauses__aliased
alias __clauses__pbCanSleep? pbCanSleep?
@@ -100,9 +101,10 @@ class Battle::Battler
end
end
class Battle::Move::RaiseUserEvasion1 # Double Team
#===============================================================================
# Double Team
#===============================================================================
class Battle::Move::RaiseUserEvasion1
unless method_defined?(:__clauses__pbMoveFailed?)
alias __clauses__pbMoveFailed? pbMoveFailed?
end
@@ -116,9 +118,10 @@ class Battle::Move::RaiseUserEvasion1 # Double Team
end
end
class Battle::Move::RaiseUserEvasion2MinimizeUser # Minimize
#===============================================================================
# Minimize
#===============================================================================
class Battle::Move::RaiseUserEvasion2MinimizeUser
unless method_defined?(:__clauses__pbMoveFailed?)
alias __clauses__pbMoveFailed? pbMoveFailed?
end
@@ -132,9 +135,10 @@ class Battle::Move::RaiseUserEvasion2MinimizeUser # Minimize
end
end
class Battle::Move::UserTargetSwapAbilities # Skill Swap
#===============================================================================
# Skill Swap
#===============================================================================
class Battle::Move::UserTargetSwapAbilities
unless method_defined?(:__clauses__pbFailsAgainstTarget?)
alias __clauses__pbFailsAgainstTarget? pbFailsAgainstTarget?
end
@@ -148,9 +152,10 @@ class Battle::Move::UserTargetSwapAbilities # Skill Swap
end
end
class Battle::Move::FixedDamage20 # Sonic Boom
#===============================================================================
# Sonic Boom
#===============================================================================
class Battle::Move::FixedDamage20
unless method_defined?(:__clauses__pbFailsAgainstTarget?)
alias __clauses__pbFailsAgainstTarget? pbFailsAgainstTarget?
end
@@ -164,9 +169,10 @@ class Battle::Move::FixedDamage20 # Sonic Boom
end
end
class Battle::Move::FixedDamage40 # Dragon Rage
#===============================================================================
# Dragon Rage
#===============================================================================
class Battle::Move::FixedDamage40
unless method_defined?(:__clauses__pbFailsAgainstTarget?)
alias __clauses__pbFailsAgainstTarget? pbFailsAgainstTarget?
end
@@ -180,8 +186,9 @@ class Battle::Move::FixedDamage40 # Dragon Rage
end
end
#===============================================================================
#
#===============================================================================
class Battle::Move::OHKO
unless method_defined?(:__clauses__pbFailsAgainstTarget?)
alias __clauses__pbFailsAgainstTarget? pbFailsAgainstTarget?
@@ -196,8 +203,9 @@ class Battle::Move::OHKO
end
end
#===============================================================================
#
#===============================================================================
class Battle::Move::OHKOIce
unless method_defined?(:__clauses__pbFailsAgainstTarget?)
alias __clauses__pbFailsAgainstTarget? pbFailsAgainstTarget?
@@ -212,8 +220,9 @@ class Battle::Move::OHKOIce
end
end
#===============================================================================
#
#===============================================================================
class Battle::Move::OHKOHitsUndergroundTarget
unless method_defined?(:__clauses__pbFailsAgainstTarget?)
alias __clauses__pbFailsAgainstTarget? pbFailsAgainstTarget?
@@ -228,9 +237,10 @@ class Battle::Move::OHKOHitsUndergroundTarget
end
end
class Battle::Move::UserFaintsExplosive # Self-Destruct
#===============================================================================
# Self-Destruct
#===============================================================================
class Battle::Move::UserFaintsExplosive
unless method_defined?(:__clauses__pbMoveFailed?)
alias __clauses__pbMoveFailed? pbMoveFailed?
end
@@ -259,9 +269,10 @@ class Battle::Move::UserFaintsExplosive # Self-Destruct
end
end
class Battle::Move::StartPerishCountsForAllBattlers # Perish Song
#===============================================================================
# Perish Song
#===============================================================================
class Battle::Move::StartPerishCountsForAllBattlers
unless method_defined?(:__clauses__pbFailsAgainstTarget?)
alias __clauses__pbFailsAgainstTarget? pbFailsAgainstTarget?
end
@@ -276,9 +287,10 @@ class Battle::Move::StartPerishCountsForAllBattlers # Perish Song
end
end
class Battle::Move::AttackerFaintsIfUserFaints # Destiny Bond
#===============================================================================
# Destiny Bond
#===============================================================================
class Battle::Move::AttackerFaintsIfUserFaints
unless method_defined?(:__clauses__pbFailsAgainstTarget?)
alias __clauses__pbFailsAgainstTarget? pbFailsAgainstTarget?
end

View File

@@ -29,8 +29,6 @@ class AnimFrame
FOCUS = 26
end
#===============================================================================
#
#===============================================================================
@@ -166,8 +164,6 @@ def pbConvertRPGAnimation(animation)
return pbAnim
end
#===============================================================================
#
#===============================================================================
@@ -230,8 +226,6 @@ class RPG::Animation
end
end
#===============================================================================
#
#===============================================================================
@@ -333,8 +327,6 @@ class PBAnimTiming
end
end
#===============================================================================
#
#===============================================================================
@@ -397,8 +389,6 @@ class PBAnimations < Array
end
end
#===============================================================================
#
#===============================================================================
@@ -598,8 +588,6 @@ class PBAnimation < Array
end
end
#===============================================================================
#
#===============================================================================
@@ -678,8 +666,6 @@ def pbSpriteSetAnimFrame(sprite, frame, user = nil, target = nil, inEditor = fal
end
end
#===============================================================================
# Animation player
#===============================================================================

View File

@@ -888,10 +888,7 @@ Battle::AbilityEffects::MoveBlocking.add(:DAZZLING,
next false if battle.choices[user.index][4] <= 0
next false if !bearer.opposes?(user)
ret = false
targets.each do |b|
next if !b.opposes?(user)
ret = true
end
targets.each { |b| ret = true if b.opposes?(user) }
next ret
}
)

View File

@@ -54,8 +54,6 @@ class Battle::FakeBattler
def pbReset; end
end
#===============================================================================
# Data box for safari battles
#===============================================================================
@@ -93,8 +91,6 @@ class Battle::Scene::SafariDataBox < Sprite
end
end
#===============================================================================
# Shows the player throwing bait at a wild Pokémon in a Safari battle.
#===============================================================================
@@ -159,8 +155,6 @@ class Battle::Scene::Animation::ThrowBait < Battle::Scene::Animation
end
end
#===============================================================================
# Shows the player throwing a rock at a wild Pokémon in a Safari battle.
#===============================================================================
@@ -222,8 +216,6 @@ class Battle::Scene::Animation::ThrowRock < Battle::Scene::Animation
end
end
#===============================================================================
# Safari Zone battle scene (the visuals of the battle)
#===============================================================================
@@ -280,8 +272,6 @@ class Battle::Scene
end
end
#===============================================================================
# Safari Zone battle class
#===============================================================================
@@ -308,9 +298,9 @@ class SafariBattle
def pbRandom(x); return rand(x); end
#=============================================================================
#-----------------------------------------------------------------------------
# Initialize the battle class
#=============================================================================
#-----------------------------------------------------------------------------
def initialize(scene, player, party2)
@scene = scene
@peer = Battle::Peer.new
@@ -335,9 +325,9 @@ class SafariBattle
def defaultWeather=(value); @weather = value; end
def defaultTerrain=(value); end
#=============================================================================
#-----------------------------------------------------------------------------
# Information about the type and size of the battle
#=============================================================================
#-----------------------------------------------------------------------------
def wildBattle?; return true; end
def trainerBattle?; return false; end
@@ -347,9 +337,9 @@ class SafariBattle
return @sideSizes[index % 2]
end
#=============================================================================
#-----------------------------------------------------------------------------
# Trainers and owner-related
#=============================================================================
#-----------------------------------------------------------------------------
def pbPlayer; return @player[0]; end
def opponent; return nil; end
@@ -374,18 +364,18 @@ class SafariBattle
end
end
#=============================================================================
#-----------------------------------------------------------------------------
# Get party info (counts all teams on the same side)
#=============================================================================
#-----------------------------------------------------------------------------
def pbParty(idxBattler)
return (opposes?(idxBattler)) ? @party2 : nil
end
def pbAllFainted?(idxBattler = 0); return false; end
#=============================================================================
#-----------------------------------------------------------------------------
# Battler-related
#=============================================================================
#-----------------------------------------------------------------------------
def opposes?(idxBattler1, idxBattler2 = 0)
idxBattler1 = idxBattler1.index if idxBattler1.respond_to?("index")
idxBattler2 = idxBattler2.index if idxBattler2.respond_to?("index")
@@ -395,9 +385,9 @@ class SafariBattle
def pbRemoveFromParty(idxBattler, idxParty); end
def pbGainExp; end
#=============================================================================
#-----------------------------------------------------------------------------
# Messages and animations
#=============================================================================
#-----------------------------------------------------------------------------
def pbDisplay(msg, &block)
@scene.pbDisplayMessage(msg, &block)
end
@@ -414,17 +404,15 @@ class SafariBattle
return @scene.pbDisplayConfirmMessage(msg)
end
class BattleAbortedException < Exception; end
def pbAbort
raise BattleAbortedException.new("Battle aborted")
end
#=============================================================================
#-----------------------------------------------------------------------------
# Safari battle-specific methods
#=============================================================================
#-----------------------------------------------------------------------------
def pbEscapeRate(catch_rate)
return 125 if catch_rate <= 45 # Escape factor 9 (45%)
return 100 if catch_rate <= 60 # Escape factor 7 (35%)

View File

@@ -26,8 +26,6 @@ class Battle::Scene
end
end
#===============================================================================
# Bug Catching Contest battle class
#===============================================================================

View File

@@ -164,8 +164,6 @@ class BattlePalaceBattle < Battle
end
end
#===============================================================================
#
#===============================================================================

View File

@@ -35,8 +35,6 @@ class Battle::SuccessState
end
end
#===============================================================================
#
#===============================================================================
@@ -203,8 +201,6 @@ class BattleArenaBattle < Battle
end
end
#===============================================================================
#
#===============================================================================
@@ -221,8 +217,6 @@ class Battle::AI
end
end
#===============================================================================
#
#===============================================================================