Moved all settings into module Settings

This commit is contained in:
Maruno17
2021-02-01 21:03:58 +00:00
parent 923844fdc7
commit 1209b804e9
88 changed files with 848 additions and 839 deletions

View File

@@ -255,11 +255,11 @@ class PokeBattle_Battler
speedMult /= 2 if pbOwnSide.effects[PBEffects::Swamp]>0
# Paralysis
if status==PBStatuses::PARALYSIS && !hasActiveAbility?(:QUICKFEET)
speedMult /= (MECHANICS_GENERATION >= 7) ? 2 : 4
speedMult /= (Settings::MECHANICS_GENERATION >= 7) ? 2 : 4
end
# Badge multiplier
if @battle.internalBattle && pbOwnedByPlayer? &&
@battle.pbPlayer.badge_count >= NUM_BADGES_BOOST_SPEED
@battle.pbPlayer.badge_count >= Settings::NUM_BADGES_BOOST_SPEED
speedMult *= 1.1
end
# Calculation
@@ -524,11 +524,11 @@ class PokeBattle_Battler
def affectedByPowder?(showMsg=false)
return false if fainted?
if pbHasType?(:GRASS) && MORE_TYPE_EFFECTS
if pbHasType?(:GRASS) && Settings::MORE_TYPE_EFFECTS
@battle.pbDisplay(_INTL("{1} is unaffected!",pbThis)) if showMsg
return false
end
if MECHANICS_GENERATION >= 6
if Settings::MECHANICS_GENERATION >= 6
if hasActiveAbility?(:OVERCOAT) && !@battle.moldBreaker
if showMsg
@battle.pbShowAbilitySplash(self)

View File

@@ -137,7 +137,7 @@ class PokeBattle_Battler
self.form = newForm
pbUpdate(true)
@hp = @totalhp-oldDmg
@effects[PBEffects::WeightChange] = 0 if MECHANICS_GENERATION >= 6
@effects[PBEffects::WeightChange] = 0 if Settings::MECHANICS_GENERATION >= 6
@battle.scene.pbChangePokemon(self,@pokemon)
@battle.scene.pbRefreshOne(@index)
@battle.pbDisplay(msg) if msg && msg!=""
@@ -275,7 +275,7 @@ class PokeBattle_Battler
@spdef = target.spdef
@speed = target.speed
PBStats.eachBattleStat { |s| @stages[s] = target.stages[s] }
if NEW_CRITICAL_HIT_RATE_MECHANICS
if Settings::NEW_CRITICAL_HIT_RATE_MECHANICS
@effects[PBEffects::FocusEnergy] = target.effects[PBEffects::FocusEnergy]
@effects[PBEffects::LaserFocus] = target.effects[PBEffects::LaserFocus]
end

View File

@@ -93,7 +93,7 @@ class PokeBattle_Battler
when PBStatuses::BURN
hasImmuneType |= pbHasType?(:FIRE)
when PBStatuses::PARALYSIS
hasImmuneType |= pbHasType?(:ELECTRIC) && MORE_TYPE_EFFECTS
hasImmuneType |= pbHasType?(:ELECTRIC) && Settings::MORE_TYPE_EFFECTS
when PBStatuses::FROZEN
hasImmuneType |= pbHasType?(:ICE)
end
@@ -189,7 +189,7 @@ class PokeBattle_Battler
when PBStatuses::BURN
hasImmuneType |= pbHasType?(:FIRE)
when PBStatuses::PARALYSIS
hasImmuneType |= pbHasType?(:ELECTRIC) && MORE_TYPE_EFFECTS
hasImmuneType |= pbHasType?(:ELECTRIC) && Settings::MORE_TYPE_EFFECTS
end
return false if hasImmuneType
# Ability immunity

View File

@@ -61,7 +61,7 @@ class PokeBattle_Battler
}
@battle.pbJudge
# Update priority order
@battle.pbCalculatePriority if RECALCULATE_TURN_ORDER_AFTER_SPEED_CHANGES
@battle.pbCalculatePriority if Settings::RECALCULATE_TURN_ORDER_AFTER_SPEED_CHANGES
return true
end

View File

@@ -253,7 +253,7 @@ class PokeBattle_Battler
else
@battle.pbCommonAnimation("Confusion",self)
@battle.pbDisplay(_INTL("{1} is confused!",pbThis))
threshold = (MECHANICS_GENERATION >= 7) ? 33 : 50 # % chance
threshold = (Settings::MECHANICS_GENERATION >= 7) ? 33 : 50 # % chance
if @battle.pbRandom(100)<threshold
pbConfusionDamage(_INTL("It hurt itself in its confusion!"))
@lastMoveFailed = true
@@ -313,7 +313,7 @@ class PokeBattle_Battler
# Wide Guard
if target.pbOwnSide.effects[PBEffects::WideGuard] && user.index!=target.index &&
PBTargets.multipleTargets?(move.pbTarget(user)) &&
(MECHANICS_GENERATION >= 7 || move.damagingMove?)
(Settings::MECHANICS_GENERATION >= 7 || move.damagingMove?)
@battle.pbCommonAnimation("WideGuard",target)
@battle.pbDisplay(_INTL("Wide Guard protected {1}!",target.pbThis(true)))
target.damageState.protected = true
@@ -408,7 +408,7 @@ class PokeBattle_Battler
return false
end
# Dark-type immunity to moves made faster by Prankster
if MECHANICS_GENERATION >= 7 && user.effects[PBEffects::Prankster] &&
if Settings::MECHANICS_GENERATION >= 7 && user.effects[PBEffects::Prankster] &&
target.pbHasType?(:DARK) && target.opposes?(user)
PBDebug.log("[Target immune] #{target.pbThis} is Dark-type and immune to Prankster-boosted moves")
@battle.pbDisplay(_INTL("It doesn't affect {1}...",target.pbThis(true)))
@@ -442,12 +442,12 @@ class PokeBattle_Battler
end
# Immunity to powder-based moves
if move.powderMove?
if target.pbHasType?(:GRASS) && MORE_TYPE_EFFECTS
if target.pbHasType?(:GRASS) && Settings::MORE_TYPE_EFFECTS
PBDebug.log("[Target immune] #{target.pbThis} is Grass-type and immune to powder-based moves")
@battle.pbDisplay(_INTL("It doesn't affect {1}...",target.pbThis(true)))
return false
end
if MECHANICS_GENERATION >= 6
if Settings::MECHANICS_GENERATION >= 6
if target.hasActiveAbility?(:OVERCOAT) && !@battle.moldBreaker
@battle.pbShowAbilitySplash(target)
if PokeBattle_SceneConstants::USE_ABILITY_SPLASH

View File

@@ -72,7 +72,7 @@ class PokeBattle_Battler
next if b.status!=PBStatuses::FROZEN
# NOTE: Non-Fire-type moves that thaw the user will also thaw the
# target (in Gen 6+).
if move.calcType == :FIRE || (MECHANICS_GENERATION >= 6 && move.thawsUser?)
if move.calcType == :FIRE || (Settings::MECHANICS_GENERATION >= 6 && move.thawsUser?)
b.pbCureStatus
end
end

View File

@@ -71,7 +71,7 @@ class PokeBattle_Move
# NOTE: This method is only ever called while using a move (and also by the
# AI), so using @calcType here is acceptable.
def physicalMove?(thisType=nil)
return (@category==0) if MOVE_CATEGORY_PER_MOVE
return (@category==0) if Settings::MOVE_CATEGORY_PER_MOVE
thisType ||= @calcType
thisType ||= @type
return true if !thisType
@@ -81,7 +81,7 @@ class PokeBattle_Move
# NOTE: This method is only ever called while using a move (and also by the
# AI), so using @calcType here is acceptable.
def specialMove?(thisType=nil)
return (@category==1) if MOVE_CATEGORY_PER_MOVE
return (@category==1) if Settings::MOVE_CATEGORY_PER_MOVE
thisType ||= @calcType
thisType ||= @type
return false if !thisType
@@ -132,7 +132,7 @@ class PokeBattle_Move
def nonLethal?(_user,_target); return false; end # For False Swipe
def ignoresSubstitute?(user) # user is the Pokémon using this move
if MECHANICS_GENERATION >= 6
if Settings::MECHANICS_GENERATION >= 6
return true if soundMove?
return true if user && user.hasActiveAbility?(:INFILTRATOR)
end

View File

@@ -161,7 +161,7 @@ class PokeBattle_Move
def pbIsCritical?(user,target)
return false if target.pbOwnSide.effects[PBEffects::LuckyChant]>0
# Set up the critical hit ratios
ratios = (NEW_CRITICAL_HIT_RATE_MECHANICS) ? [24,8,2,1] : [16,8,4,3,2]
ratios = (Settings::NEW_CRITICAL_HIT_RATE_MECHANICS) ? [24,8,2,1] : [16,8,4,3,2]
c = 0
# Ability effects that alter critical hit rate
if c>=0 && user.abilityActive?
@@ -357,16 +357,16 @@ class PokeBattle_Move
# Badge multipliers
if @battle.internalBattle
if user.pbOwnedByPlayer?
if physicalMove? && @battle.pbPlayer.badge_count >= NUM_BADGES_BOOST_ATTACK
if physicalMove? && @battle.pbPlayer.badge_count >= Settings::NUM_BADGES_BOOST_ATTACK
multipliers[:attack_multiplier] *= 1.1
elsif specialMove? && @battle.pbPlayer.badge_count >= NUM_BADGES_BOOST_SPATK
elsif specialMove? && @battle.pbPlayer.badge_count >= Settings::NUM_BADGES_BOOST_SPATK
multipliers[:attack_multiplier] *= 1.1
end
end
if target.pbOwnedByPlayer?
if physicalMove? && @battle.pbPlayer.badge_count >= NUM_BADGES_BOOST_DEFENSE
if physicalMove? && @battle.pbPlayer.badge_count >= Settings::NUM_BADGES_BOOST_DEFENSE
multipliers[:defense_multiplier] *= 1.1
elsif specialMove? && @battle.pbPlayer.badge_count >= NUM_BADGES_BOOST_SPDEF
elsif specialMove? && @battle.pbPlayer.badge_count >= Settings::NUM_BADGES_BOOST_SPDEF
multipliers[:defense_multiplier] *= 1.1
end
end
@@ -396,7 +396,7 @@ class PokeBattle_Move
end
# Critical hits
if target.damageState.critical
if NEW_CRITICAL_HIT_RATE_MECHANICS
if Settings::NEW_CRITICAL_HIT_RATE_MECHANICS
multipliers[:final_damage_multiplier] *= 1.5
else
multipliers[:final_damage_multiplier] *= 2
@@ -461,7 +461,7 @@ class PokeBattle_Move
def pbAdditionalEffectChance(user,target,effectChance=0)
return 0 if target.hasActiveAbility?(:SHIELDDUST) && !@battle.moldBreaker
ret = (effectChance>0) ? effectChance : @addlEffect
if MECHANICS_GENERATION >= 6 || @function != "0A4" # Secret Power
if Settings::MECHANICS_GENERATION >= 6 || @function != "0A4" # Secret Power
ret *= 2 if user.hasActiveAbility?(:SERENEGRACE) ||
user.pbOwnSide.effects[PBEffects::Rainbow]>0
end

View File

@@ -555,7 +555,7 @@ class PokeBattle_ProtectMove < PokeBattle_Move
@battle.pbDisplay(_INTL("But it failed!"))
return true
end
if (!@sidedEffect || MECHANICS_GENERATION <= 5) &&
if (!@sidedEffect || Settings::MECHANICS_GENERATION <= 5) &&
user.effects[PBEffects::ProtectRate]>1 &&
@battle.pbRandom(user.effects[PBEffects::ProtectRate])!=0
user.effects[PBEffects::ProtectRate] = 1
@@ -575,7 +575,7 @@ class PokeBattle_ProtectMove < PokeBattle_Move
else
user.effects[@effect] = true
end
user.effects[PBEffects::ProtectRate] *= (MECHANICS_GENERATION >= 6) ? 3 : 2
user.effects[PBEffects::ProtectRate] *= (Settings::MECHANICS_GENERATION >= 6) ? 3 : 2
pbProtectMessage(user)
end

View File

@@ -32,7 +32,7 @@ end
#===============================================================================
class PokeBattle_Move_003 < PokeBattle_SleepMove
def pbMoveFailed?(user,targets)
if MECHANICS_GENERATION >= 7 && @id == :DARKVOID
if Settings::MECHANICS_GENERATION >= 7 && @id == :DARKVOID
if !user.isSpecies?(:DARKRAI) && user.effects[PBEffects::TransformSpecies] != :DARKRAI
@battle.pbDisplay(_INTL("But {1} can't use the move!",user.pbThis))
return true
@@ -93,7 +93,7 @@ class PokeBattle_Move_006 < PokeBattle_PoisonMove
end
def pbOverrideSuccessCheckPerHit(user,target)
return (MORE_TYPE_EFFECTS && statusMove? && user.pbHasType?(:POISON))
return (Settings::MORE_TYPE_EFFECTS && statusMove? && user.pbHasType?(:POISON))
end
end
@@ -107,7 +107,7 @@ end
class PokeBattle_Move_007 < PokeBattle_ParalysisMove
def tramplesMinimize?(param=1)
# Perfect accuracy and double damage (for Body Slam only)
return MECHANICS_GENERATION >= 6 if @id == :BODYSLAM
return Settings::MECHANICS_GENERATION >= 6 if @id == :BODYSLAM
return super
end
@@ -241,8 +241,8 @@ end
#===============================================================================
class PokeBattle_Move_010 < PokeBattle_FlinchMove
def tramplesMinimize?(param=1)
return super if @id == :DRAGONRUSH && MECHANICS_GENERATION <= 5
return true if param==1 && MECHANICS_GENERATION >= 6 # Perfect accuracy
return super if @id == :DRAGONRUSH && Settings::MECHANICS_GENERATION <= 5
return true if param==1 && Settings::MECHANICS_GENERATION >= 6 # Perfect accuracy
return true if param==2 # Double damage
return super
end
@@ -1254,7 +1254,7 @@ end
class PokeBattle_Move_048 < PokeBattle_TargetStatDownMove
def initialize(battle,move)
super
@statDown = [PBStats::EVASION,(MECHANICS_GENERATION >= 6) ? 2 : 1]
@statDown = [PBStats::EVASION, (Settings::MECHANICS_GENERATION >= 6) ? 2 : 1]
end
end
@@ -1284,12 +1284,12 @@ class PokeBattle_Move_049 < PokeBattle_TargetStatDownMove
targetSide.effects[PBEffects::Spikes]>0 ||
targetSide.effects[PBEffects::ToxicSpikes]>0 ||
targetSide.effects[PBEffects::StickyWeb]
return false if MECHANICS_GENERATION >= 6 &&
return false if Settings::MECHANICS_GENERATION >= 6 &&
(targetOpposingSide.effects[PBEffects::StealthRock] ||
targetOpposingSide.effects[PBEffects::Spikes]>0 ||
targetOpposingSide.effects[PBEffects::ToxicSpikes]>0 ||
targetOpposingSide.effects[PBEffects::StickyWeb])
return false if MECHANICS_GENERATION >= 8 &&
return false if Settings::MECHANICS_GENERATION >= 8 &&
@battle.field.terrain != PBBattleTerrains::None
return super
end
@@ -1319,34 +1319,34 @@ class PokeBattle_Move_049 < PokeBattle_TargetStatDownMove
@battle.pbDisplay(_INTL("{1} is no longer protected by Safeguard!!",target.pbTeam))
end
if target.pbOwnSide.effects[PBEffects::StealthRock] ||
(MECHANICS_GENERATION >= 6 &&
(Settings::MECHANICS_GENERATION >= 6 &&
target.pbOpposingSide.effects[PBEffects::StealthRock])
target.pbOwnSide.effects[PBEffects::StealthRock] = false
target.pbOpposingSide.effects[PBEffects::StealthRock] = false if MECHANICS_GENERATION >= 6
target.pbOpposingSide.effects[PBEffects::StealthRock] = false if Settings::MECHANICS_GENERATION >= 6
@battle.pbDisplay(_INTL("{1} blew away stealth rocks!",user.pbThis))
end
if target.pbOwnSide.effects[PBEffects::Spikes]>0 ||
(MECHANICS_GENERATION >= 6 &&
(Settings::MECHANICS_GENERATION >= 6 &&
target.pbOpposingSide.effects[PBEffects::Spikes]>0)
target.pbOwnSide.effects[PBEffects::Spikes] = 0
target.pbOpposingSide.effects[PBEffects::Spikes] = 0 if MECHANICS_GENERATION >= 6
target.pbOpposingSide.effects[PBEffects::Spikes] = 0 if Settings::MECHANICS_GENERATION >= 6
@battle.pbDisplay(_INTL("{1} blew away spikes!",user.pbThis))
end
if target.pbOwnSide.effects[PBEffects::ToxicSpikes]>0 ||
(MECHANICS_GENERATION >= 6 &&
(Settings::MECHANICS_GENERATION >= 6 &&
target.pbOpposingSide.effects[PBEffects::ToxicSpikes]>0)
target.pbOwnSide.effects[PBEffects::ToxicSpikes] = 0
target.pbOpposingSide.effects[PBEffects::ToxicSpikes] = 0 if MECHANICS_GENERATION >= 6
target.pbOpposingSide.effects[PBEffects::ToxicSpikes] = 0 if Settings::MECHANICS_GENERATION >= 6
@battle.pbDisplay(_INTL("{1} blew away poison spikes!",user.pbThis))
end
if target.pbOwnSide.effects[PBEffects::StickyWeb] ||
(MECHANICS_GENERATION >= 6 &&
(Settings::MECHANICS_GENERATION >= 6 &&
target.pbOpposingSide.effects[PBEffects::StickyWeb])
target.pbOwnSide.effects[PBEffects::StickyWeb] = false
target.pbOpposingSide.effects[PBEffects::StickyWeb] = false if MECHANICS_GENERATION >= 6
target.pbOpposingSide.effects[PBEffects::StickyWeb] = false if Settings::MECHANICS_GENERATION >= 6
@battle.pbDisplay(_INTL("{1} blew away sticky webs!",user.pbThis))
end
if MECHANICS_GENERATION >= 8 && @battle.field.terrain != PBBattleTerrains::None
if Settings::MECHANICS_GENERATION >= 8 && @battle.field.terrain != PBBattleTerrains::None
case @battle.field.terrain
when PBBattleTerrains::Electric
@battle.pbDisplay(_INTL("The electricity disappeared from the battlefield."))
@@ -1407,7 +1407,7 @@ class PokeBattle_Move_04D < PokeBattle_TargetStatDownMove
def initialize(battle,move)
super
inc = 2
inc = 1 if @id == :STRINGSHOT && MECHANICS_GENERATION <= 5
inc = 1 if @id == :STRINGSHOT && Settings::MECHANICS_GENERATION <= 5
@statDown = [PBStats::SPEED,inc]
end
end
@@ -1561,7 +1561,7 @@ class PokeBattle_Move_055 < PokeBattle_Move
def pbEffectAgainstTarget(user,target)
PBStats.eachBattleStat { |s| user.stages[s] = target.stages[s] }
if NEW_CRITICAL_HIT_RATE_MECHANICS
if Settings::NEW_CRITICAL_HIT_RATE_MECHANICS
user.effects[PBEffects::FocusEnergy] = target.effects[PBEffects::FocusEnergy]
user.effects[PBEffects::LaserFocus] = target.effects[PBEffects::LaserFocus]
end
@@ -1796,7 +1796,7 @@ class PokeBattle_Move_05E < PokeBattle_Move
userTypes = user.pbTypes(true)
@newTypes = []
user.eachMoveWithIndex do |m,i|
break if MECHANICS_GENERATION >= 6 && i>0
break if Settings::MECHANICS_GENERATION >= 6 && i>0
next if PBTypes.isPseudoType?(m.type)
next if userTypes.include?(m.type)
@newTypes.push(m.type) if !@newTypes.include?(m.type)
@@ -2169,7 +2169,7 @@ class PokeBattle_Move_067 < PokeBattle_Move
def pbFailsAgainstTarget?(user,target)
if !target.ability ||
(user.ability == target.ability && MECHANICS_GENERATION <= 5)
(user.ability == target.ability && Settings::MECHANICS_GENERATION <= 5)
@battle.pbDisplay(_INTL("But it failed!"))
return true
end
@@ -2371,7 +2371,7 @@ class PokeBattle_Move_070 < PokeBattle_FixedDamageMove
@battle.pbHideAbilitySplash(target)
return true
end
if MECHANICS_GENERATION >= 7 && @id == :SHEERCOLD && target.pbHasType?(:ICE)
if Settings::MECHANICS_GENERATION >= 7 && @id == :SHEERCOLD && target.pbHasType?(:ICE)
@battle.pbDisplay(_INTL("But it failed!"))
return true
end
@@ -2380,7 +2380,7 @@ class PokeBattle_Move_070 < PokeBattle_FixedDamageMove
def pbAccuracyCheck(user,target)
acc = @accuracy+user.level-target.level
acc -= 10 if MECHANICS_GENERATION >= 7 && @id == :SHEERCOLD && !user.pbHasType?(:ICE)
acc -= 10 if Settings::MECHANICS_GENERATION >= 7 && @id == :SHEERCOLD && !user.pbHasType?(:ICE)
return @battle.pbRandom(100)<acc
end
@@ -2699,7 +2699,7 @@ end
# Burn's halving of Attack is negated (new mechanics).
#===============================================================================
class PokeBattle_Move_07E < PokeBattle_Move
def damageReducedByBurn?; return MECHANICS_GENERATION <= 5; end
def damageReducedByBurn?; return Settings::MECHANICS_GENERATION <= 5; end
def pbBaseDamage(baseDmg,user,target)
baseDmg *= 2 if user.poisoned? || user.burned? || user.paralyzed?

View File

@@ -248,7 +248,7 @@ class PokeBattle_Move_090 < PokeBattle_Move
end
def pbBaseDamage(baseDmg,user,target)
return super if MECHANICS_GENERATION >= 6
return super if Settings::MECHANICS_GENERATION >= 6
hp = pbHiddenPower(user)
return hp[1]
end
@@ -272,7 +272,7 @@ def pbHiddenPower(pkmn)
idxType |= (iv[PBStats::SPDEF]&1)<<5
idxType = (types.length-1)*idxType/63
type = types[idxType]
if MECHANICS_GENERATION <= 5
if Settings::MECHANICS_GENERATION <= 5
powerMin = 30
powerMax = 70
power |= (iv[PBStats::HP]&2)>>1
@@ -503,7 +503,7 @@ class PokeBattle_Move_096 < PokeBattle_Move
@damageArray.each do |dmg, items|
next if !items.include?(heldItem)
ret = dmg
ret += 20 if MECHANICS_GENERATION >= 6
ret += 20 if Settings::MECHANICS_GENERATION >= 6
break
end
return ret
@@ -600,7 +600,7 @@ end
#===============================================================================
class PokeBattle_Move_09B < PokeBattle_Move
def tramplesMinimize?(param=1)
return true if MECHANICS_GENERATION >= 7 # Perfect accuracy and double damage
return true if Settings::MECHANICS_GENERATION >= 7 # Perfect accuracy and double damage
return super
end
@@ -646,7 +646,7 @@ end
#===============================================================================
class PokeBattle_Move_09D < PokeBattle_Move
def pbMoveFailed?(user,targets)
if MECHANICS_GENERATION >= 6
if Settings::MECHANICS_GENERATION >= 6
if @battle.field.effects[PBEffects::MudSportField]>0
@battle.pbDisplay(_INTL("But it failed!"))
return true
@@ -662,7 +662,7 @@ class PokeBattle_Move_09D < PokeBattle_Move
end
def pbEffectGeneral(user)
if MECHANICS_GENERATION >= 6
if Settings::MECHANICS_GENERATION >= 6
@battle.field.effects[PBEffects::MudSportField] = 5
else
user.effects[PBEffects::MudSport] = true
@@ -678,7 +678,7 @@ end
#===============================================================================
class PokeBattle_Move_09E < PokeBattle_Move
def pbMoveFailed?(user,targets)
if MECHANICS_GENERATION >= 6
if Settings::MECHANICS_GENERATION >= 6
if @battle.field.effects[PBEffects::WaterSportField]>0
@battle.pbDisplay(_INTL("But it failed!"))
return true
@@ -694,7 +694,7 @@ class PokeBattle_Move_09E < PokeBattle_Move
end
def pbEffectGeneral(user)
if MECHANICS_GENERATION >= 6
if Settings::MECHANICS_GENERATION >= 6
@battle.field.effects[PBEffects::WaterSportField] = 5
else
user.effects[PBEffects::WaterSport] = true
@@ -1193,7 +1193,7 @@ class PokeBattle_Move_0AF < PokeBattle_Move
"133", # Hold Hands
"134" # Celebrate
]
if MECHANICS_GENERATION >= 6
if Settings::MECHANICS_GENERATION >= 6
@moveBlacklist += [
# Target-switching moves
"0EB", # Roar, Whirlwind
@@ -1325,7 +1325,7 @@ class PokeBattle_Move_0B3 < PokeBattle_Move
case @battle.environment
when PBEnvironment::Grass, PBEnvironment::TallGrass,
PBEnvironment::Forest, PBEnvironment::ForestGrass
if MECHANICS_GENERATION >= 6
if Settings::MECHANICS_GENERATION >= 6
@npMove = :ENERGYBALL if GameData::Move.exists?(:ENERGYBALL)
else
@npMove = :SEEDBOMB if GameData::Move.exists?(:SEEDBOMB)
@@ -1335,25 +1335,25 @@ class PokeBattle_Move_0B3 < PokeBattle_Move
when PBEnvironment::Puddle
@npMove = :MUDBOMB if GameData::Move.exists?(:MUDBOMB)
when PBEnvironment::Cave
if MECHANICS_GENERATION >= 6
if Settings::MECHANICS_GENERATION >= 6
@npMove = :POWERGEM if GameData::Move.exists?(:POWERGEM)
else
@npMove = :ROCKSLIDE if GameData::Move.exists?(:ROCKSLIDE)
end
when PBEnvironment::Rock
if MECHANICS_GENERATION >= 6
if Settings::MECHANICS_GENERATION >= 6
@npMove = :EARTHPOWER if GameData::Move.exists?(:EARTHPOWER)
else
@npMove = :ROCKSLIDE if GameData::Move.exists?(:ROCKSLIDE)
end
when PBEnvironment::Sand
if MECHANICS_GENERATION >= 6
if Settings::MECHANICS_GENERATION >= 6
@npMove = :EARTHPOWER if GameData::Move.exists?(:EARTHPOWER)
else
@npMove = :EARTHQUAKE if GameData::Move.exists?(:EARTHQUAKE)
end
when PBEnvironment::Snow
if MECHANICS_GENERATION >= 6
if Settings::MECHANICS_GENERATION >= 6
@npMove = :FROSTBREATH if GameData::Move.exists?(:FROSTBREATH)
else
@npMove = :BLIZZARD if GameData::Move.exists?(:BLIZZARD)
@@ -1519,7 +1519,7 @@ class PokeBattle_Move_0B5 < PokeBattle_Move
"133", # Hold Hands
"134" # Celebrate
]
if MECHANICS_GENERATION >= 6
if Settings::MECHANICS_GENERATION >= 6
@moveBlacklist += [
# Moves that call other moves
"0B3", # Nature Power
@@ -1550,7 +1550,7 @@ class PokeBattle_Move_0B5 < PokeBattle_Move
# NOTE: This includes the Pokémon of ally trainers in multi battles.
@battle.pbParty(user.index).each_with_index do |pkmn,i|
next if !pkmn || i==user.pokemonIndex
next if MECHANICS_GENERATION >= 6 && pkmn.egg?
next if Settings::MECHANICS_GENERATION >= 6 && pkmn.egg?
pkmn.moves.each do |move|
next if @moveBlacklist.include?(move.function_code)
next if move.type == :SHADOW
@@ -1783,7 +1783,7 @@ class PokeBattle_Move_0BA < PokeBattle_Move
return true
end
return true if pbMoveFailedAromaVeil?(user,target)
if MECHANICS_GENERATION >= 6 && target.hasActiveAbility?(:OBLIVIOUS) &&
if Settings::MECHANICS_GENERATION >= 6 && target.hasActiveAbility?(:OBLIVIOUS) &&
!@battle.moldBreaker
@battle.pbShowAbilitySplash(target)
if PokeBattle_SceneConstants::USE_ABILITY_SPLASH
@@ -1848,7 +1848,7 @@ class PokeBattle_Move_0BC < PokeBattle_Move
# Moves that call other moves (see also below)
"0AE" # Mirror Move
]
if MECHANICS_GENERATION >= 7
if Settings::MECHANICS_GENERATION >= 7
@moveBlacklist += [
# Moves that call other moves
# "0AE", # Mirror Move # See above
@@ -2241,7 +2241,7 @@ class PokeBattle_Move_0CE < PokeBattle_TwoTurnMove
@battle.pbDisplay(_INTL("But it failed!"))
return true
end
if MECHANICS_GENERATION >= 6 && target.pbWeight>=2000 # 200.0kg
if Settings::MECHANICS_GENERATION >= 6 && target.pbWeight>=2000 # 200.0kg
@battle.pbDisplay(_INTL("But it failed!"))
return true
end
@@ -2291,7 +2291,7 @@ class PokeBattle_Move_0CF < PokeBattle_Move
return if target.effects[PBEffects::Trapping]>0
# Set trapping effect duration and info
if user.hasActiveItem?(:GRIPCLAW)
target.effects[PBEffects::Trapping] = (MECHANICS_GENERATION >= 5) ? 8 : 6
target.effects[PBEffects::Trapping] = (Settings::MECHANICS_GENERATION >= 5) ? 8 : 6
else
target.effects[PBEffects::Trapping] = 5+@battle.pbRandom(2)
end
@@ -2654,7 +2654,7 @@ end
# User gains half the HP it inflicts as damage.
#===============================================================================
class PokeBattle_Move_0DD < PokeBattle_Move
def healingMove?; return MECHANICS_GENERATION >= 6; end
def healingMove?; return Settings::MECHANICS_GENERATION >= 6; end
def pbEffectAgainstTarget(user,target)
return if target.damageState.hpLost<=0
@@ -2670,7 +2670,7 @@ end
# (Dream Eater)
#===============================================================================
class PokeBattle_Move_0DE < PokeBattle_Move
def healingMove?; return MECHANICS_GENERATION >= 6; end
def healingMove?; return Settings::MECHANICS_GENERATION >= 6; end
def pbFailsAgainstTarget?(user,target)
if !target.asleep?
@@ -2905,7 +2905,7 @@ end
#===============================================================================
class PokeBattle_Move_0E7 < PokeBattle_Move
def pbMoveFailed?(user,targets)
if MECHANICS_GENERATION >= 7 && user.effects[PBEffects::DestinyBondPrevious]
if Settings::MECHANICS_GENERATION >= 7 && user.effects[PBEffects::DestinyBondPrevious]
@battle.pbDisplay(_INTL("But it failed!"))
return true
end
@@ -3150,7 +3150,7 @@ class PokeBattle_Move_0EF < PokeBattle_Move
@battle.pbDisplay(_INTL("But it failed!"))
return true
end
if MORE_TYPE_EFFECTS && target.pbHasType?(:GHOST)
if Settings::MORE_TYPE_EFFECTS && target.pbHasType?(:GHOST)
@battle.pbDisplay(_INTL("It doesn't affect {1}...",target.pbThis(true)))
return true
end
@@ -3166,7 +3166,7 @@ class PokeBattle_Move_0EF < PokeBattle_Move
def pbAdditionalEffect(user,target)
return if target.fainted? || target.damageState.substitute
return if target.effects[PBEffects::MeanLook]>=0
return if MORE_TYPE_EFFECTS && target.pbHasType?(:GHOST)
return if Settings::MORE_TYPE_EFFECTS && target.pbHasType?(:GHOST)
target.effects[PBEffects::MeanLook] = user.index
@battle.pbDisplay(_INTL("{1} can no longer escape!",target.pbThis))
end
@@ -3180,7 +3180,7 @@ end
#===============================================================================
class PokeBattle_Move_0F0 < PokeBattle_Move
def pbBaseDamage(baseDmg,user,target)
if MECHANICS_GENERATION >= 6 &&
if Settings::MECHANICS_GENERATION >= 6 &&
target.item && !target.unlosableItem?(target.item)
# NOTE: Damage is still boosted even if target has Sticky Hold or a
# substitute.
@@ -3306,7 +3306,7 @@ end
#===============================================================================
class PokeBattle_Move_0F3 < PokeBattle_Move
def ignoresSubstitute?(user)
return true if MECHANICS_GENERATION >= 6
return true if Settings::MECHANICS_GENERATION >= 6
return super
end
@@ -3370,7 +3370,7 @@ class PokeBattle_Move_0F5 < PokeBattle_Move
def pbEffectWhenDealingDamage(user,target)
return if target.damageState.substitute || target.damageState.berryWeakened
return if !target.item || (!target.item.is_berry? &&
!(MECHANICS_GENERATION >= 6 && target.item.is_gem?))
!(Settings::MECHANICS_GENERATION >= 6 && target.item.is_gem?))
target.pbRemoveItem
@battle.pbDisplay(_INTL("{1}'s {2} was incinerated!",target.pbThis,target.itemName))
end

View File

@@ -1445,7 +1445,7 @@ end
#===============================================================================
class PokeBattle_Move_144 < PokeBattle_Move
def tramplesMinimize?(param=1)
return true if param==1 && MECHANICS_GENERATION >= 6 # Perfect accuracy
return true if param==1 && Settings::MECHANICS_GENERATION >= 6 # Perfect accuracy
return true if param==2 # Double damage
return super
end
@@ -1666,7 +1666,7 @@ end
# User gains 3/4 the HP it inflicts as damage. (Draining Kiss, Oblivion Wing)
#===============================================================================
class PokeBattle_Move_14F < PokeBattle_Move
def healingMove?; return MECHANICS_GENERATION >= 6; end
def healingMove?; return Settings::MECHANICS_GENERATION >= 6; end
def pbEffectAgainstTarget(user,target)
return if target.damageState.hpLost<=0

View File

@@ -128,7 +128,7 @@ module PokeBattle_BattleCommon
@scene.pbThrowSuccess # Play capture success jingle
pbRemoveFromParty(battler.index,battler.pokemonIndex)
# Gain Exp
if GAIN_EXP_FOR_CAPTURE
if Settings::GAIN_EXP_FOR_CAPTURE
battler.captured = true
pbGainExp
battler.captured = false
@@ -192,7 +192,7 @@ module PokeBattle_BattleCommon
# Second half of the shakes calculation
y = ( 65536 / ((255.0/x)**0.1875) ).floor
# Critical capture check
if ENABLE_CRITICAL_CAPTURES
if Settings::ENABLE_CRITICAL_CAPTURES
c = 0
numOwned = $Trainer.owned_count
if numOwned>600; c = x*5/12

View File

@@ -365,7 +365,7 @@ class PokeBattle_Battle
def pbLoseMoney
return if !@internalBattle || !@moneyGain
return if $game_switches[NO_MONEY_LOSS]
return if $game_switches[Settings::NO_MONEY_LOSS]
maxLevel = pbMaxLevelInTeam(0,0) # Player's Pokémon only, not partner's
multiplier = [8,16,24,36,48,64,80,100,120]
idxMultiplier = [pbPlayer.badge_count, multiplier.length - 1].min
@@ -446,7 +446,7 @@ class PokeBattle_Battle
end
##### CAUGHT WILD POKÉMON #####
when 4
@scene.pbWildBattleSuccess if !GAIN_EXP_FOR_CAPTURE
@scene.pbWildBattleSuccess if !Settings::GAIN_EXP_FOR_CAPTURE
end
# Register captured Pokémon in the Pokédex, and store them
pbRecordAndStoreCaughtPokemon

View File

@@ -105,15 +105,15 @@ class PokeBattle_Battle
a = level*defeatedBattler.pokemon.base_exp
if expShare.length>0 && (isPartic || hasExpShare)
if numPartic==0 # No participants, all Exp goes to Exp Share holders
exp = a/(SPLIT_EXP_BETWEEN_GAINERS ? expShare.length : 1)
elsif SPLIT_EXP_BETWEEN_GAINERS # Gain from participating and/or Exp Share
exp = a / (Settings::SPLIT_EXP_BETWEEN_GAINERS ? expShare.length : 1)
elsif Settings::SPLIT_EXP_BETWEEN_GAINERS # Gain from participating and/or Exp Share
exp = a/(2*numPartic) if isPartic
exp += a/(2*expShare.length) if hasExpShare
else # Gain from participating and/or Exp Share (Exp not split)
exp = (isPartic) ? a : a/2
end
elsif isPartic # Participated in battle, no Exp Shares held by anyone
exp = a/(SPLIT_EXP_BETWEEN_GAINERS ? numPartic : 1)
exp = a / (Settings::SPLIT_EXP_BETWEEN_GAINERS ? numPartic : 1)
elsif expAll # Didn't participate in battle, gaining Exp due to Exp All
# NOTE: Exp All works like the Exp Share from Gen 6+, not like the Exp All
# from Gen 1, i.e. Exp isn't split between all Pokémon gaining it.
@@ -123,7 +123,7 @@ class PokeBattle_Battle
# Pokémon gain more Exp from trainer battles
exp = (exp*1.5).floor if trainerBattle?
# Scale the gained Exp based on the gainer's level (or not)
if SCALED_EXP_FORMULA
if Settings::SCALED_EXP_FORMULA
exp /= 5
levelAdjust = (2*level+10.0)/(pkmn.level+level+10.0)
levelAdjust = levelAdjust**5

View File

@@ -64,7 +64,7 @@ class PokeBattle_Battle
end
end
# Other certain switching effects
return true if MORE_TYPE_EFFECTS && battler.pbHasType?(:GHOST)
return true if Settings::MORE_TYPE_EFFECTS && battler.pbHasType?(:GHOST)
# Other certain trapping effects
if battler.effects[PBEffects::Trapping]>0 ||
battler.effects[PBEffects::MeanLook]>=0 ||
@@ -286,7 +286,7 @@ class PokeBattle_Battle
partyOrder[idxParty],partyOrder[idxPartyOld] = partyOrder[idxPartyOld],partyOrder[idxParty]
# Send out the new Pokémon
pbSendOut([[idxBattler,party[idxParty]]])
pbCalculatePriority(false,[idxBattler]) if RECALCULATE_TURN_ORDER_AFTER_SPEED_CHANGES
pbCalculatePriority(false,[idxBattler]) if Settings::RECALCULATE_TURN_ORDER_AFTER_SPEED_CHANGES
end
# Called from def pbReplace above and at the start of battle.

View File

@@ -6,7 +6,7 @@ class PokeBattle_Battle
return false if trainerBattle?
battler = @battlers[idxBattler]
return false if !@canRun && !battler.opposes?
return true if battler.pbHasType?(:GHOST) && MORE_TYPE_EFFECTS
return true if battler.pbHasType?(:GHOST) && Settings::MORE_TYPE_EFFECTS
return true if battler.abilityActive? &&
BattleHandlers.triggerRunFromBattleAbility(battler.ability,battler)
return true if battler.itemActive? &&
@@ -71,7 +71,7 @@ class PokeBattle_Battle
return 0
end
if !duringBattle
if battler.pbHasType?(:GHOST) && MORE_TYPE_EFFECTS
if battler.pbHasType?(:GHOST) && Settings::MORE_TYPE_EFFECTS
pbSEPlay("Battle flee")
pbDisplayPaused(_INTL("You got away safely!"))
@decision = 3

View File

@@ -62,13 +62,13 @@ class PokeBattle_Battle
#=============================================================================
def pbHasMegaRing?(idxBattler)
return true if !pbOwnedByPlayer?(idxBattler) # Assume AI trainer have a ring
MEGA_RINGS.each { |item| return true if $PokemonBag.pbHasItem?(item) }
Settings::MEGA_RINGS.each { |item| return true if $PokemonBag.pbHasItem?(item) }
return false
end
def pbGetMegaRingName(idxBattler)
if pbOwnedByPlayer?(idxBattler)
MEGA_RINGS.each do |item|
Settings::MEGA_RINGS.each do |item|
return GameData::Item.get(item).name if $PokemonBag.pbHasItem?(item)
end
end
@@ -80,7 +80,7 @@ class PokeBattle_Battle
end
def pbCanMegaEvolve?(idxBattler)
return false if $game_switches[NO_MEGA_EVOLUTION]
return false if $game_switches[Settings::NO_MEGA_EVOLUTION]
return false if !@battlers[idxBattler].hasMega?
return false if wildBattle? && opposes?(idxBattler)
return true if $DEBUG && Input.press?(Input::CTRL)
@@ -157,7 +157,7 @@ class PokeBattle_Battle
if battler.isSpecies?(:GENGAR) && battler.mega?
battler.effects[PBEffects::Telekinesis] = 0
end
pbCalculatePriority(false,[idxBattler]) if RECALCULATE_TURN_ORDER_AFTER_MEGA_EVOLUTION
pbCalculatePriority(false,[idxBattler]) if Settings::RECALCULATE_TURN_ORDER_AFTER_MEGA_EVOLUTION
# Trigger ability
battler.pbEffectsOnSwitchIn
end

View File

@@ -84,7 +84,7 @@ class PokeBattle_Battle
end
return if @decision > 0
end
pbCalculatePriority if RECALCULATE_TURN_ORDER_AFTER_SPEED_CHANGES
pbCalculatePriority if Settings::RECALCULATE_TURN_ORDER_AFTER_SPEED_CHANGES
end
def pbAttackPhaseMegaEvolution

View File

@@ -370,7 +370,7 @@ class PokeBattle_Battle
priority.each do |b|
next if b.status!=PBStatuses::BURN || !b.takesIndirectDamage?
oldHP = b.hp
dmg = (MECHANICS_GENERATION >= 7) ? b.totalhp/16 : b.totalhp/8
dmg = (Settings::MECHANICS_GENERATION >= 7) ? b.totalhp/16 : b.totalhp/8
dmg = (dmg/2.0).round if b.hasActiveAbility?(:HEATPROOF)
b.pbContinueStatus { b.pbReduceHP(dmg,false) }
b.pbItemHPHealCheck
@@ -417,9 +417,9 @@ class PokeBattle_Battle
else pbCommonAnimation("Wrap", b)
end
if b.takesIndirectDamage?
hpLoss = (MECHANICS_GENERATION >= 6) ? b.totalhp/8 : b.totalhp/16
hpLoss = (Settings::MECHANICS_GENERATION >= 6) ? b.totalhp/8 : b.totalhp/16
if @battlers[b.effects[PBEffects::TrappingUser]].hasActiveItem?(:BINDINGBAND)
hpLoss = (MECHANICS_GENERATION >= 6) ? b.totalhp/6 : b.totalhp/8
hpLoss = (Settings::MECHANICS_GENERATION >= 6) ? b.totalhp/6 : b.totalhp/8
end
@scene.pbDamageAnimation(b)
b.pbReduceHP(hpLoss,false)

View File

@@ -44,7 +44,7 @@ class PokeBattle_AI
:ENERGYPOWDER => 50,
:ENERGYROOT => 200
}
hpItems[:RAGECANDYBAR] = 20 if !RAGE_CANDY_BAR_CURES_STATUS_PROBLEMS
hpItems[:RAGECANDYBAR] = 20 if !Settings::RAGE_CANDY_BAR_CURES_STATUS_PROBLEMS
fullRestoreItems = [
:FULLRESTORE
]
@@ -59,37 +59,37 @@ class PokeBattle_AI
:FULLHEAL, :LAVACOOKIE, :OLDGATEAU, :CASTELIACONE, :LUMIOSEGALETTE,
:SHALOURSABLE, :BIGMALASADA, :LUMBERRY, :HEALPOWDER
]
allStatusItems.push(:RAGECANDYBAR) if RAGE_CANDY_BAR_CURES_STATUS_PROBLEMS
allStatusItems.push(:RAGECANDYBAR) if Settings::RAGE_CANDY_BAR_CURES_STATUS_PROBLEMS
xItems = {
:XATTACK => [PBStats::ATTACK, (X_STAT_ITEMS_RAISE_BY_TWO_STAGES) ? 2 : 1],
:XATTACK => [PBStats::ATTACK, (Settings::X_STAT_ITEMS_RAISE_BY_TWO_STAGES) ? 2 : 1],
:XATTACK2 => [PBStats::ATTACK, 2],
:XATTACK3 => [PBStats::ATTACK, 3],
:XATTACK6 => [PBStats::ATTACK, 6],
:XDEFENSE => [PBStats::DEFENSE, (X_STAT_ITEMS_RAISE_BY_TWO_STAGES) ? 2 : 1],
:XDEFENSE => [PBStats::DEFENSE, (Settings::X_STAT_ITEMS_RAISE_BY_TWO_STAGES) ? 2 : 1],
:XDEFENSE2 => [PBStats::DEFENSE, 2],
:XDEFENSE3 => [PBStats::DEFENSE, 3],
:XDEFENSE6 => [PBStats::DEFENSE, 6],
:XDEFEND => [PBStats::DEFENSE, (X_STAT_ITEMS_RAISE_BY_TWO_STAGES) ? 2 : 1],
:XDEFEND => [PBStats::DEFENSE, (Settings::X_STAT_ITEMS_RAISE_BY_TWO_STAGES) ? 2 : 1],
:XDEFEND2 => [PBStats::DEFENSE, 2],
:XDEFEND3 => [PBStats::DEFENSE, 3],
:XDEFEND6 => [PBStats::DEFENSE, 6],
:XSPATK => [PBStats::SPATK, (X_STAT_ITEMS_RAISE_BY_TWO_STAGES) ? 2 : 1],
:XSPATK => [PBStats::SPATK, (Settings::X_STAT_ITEMS_RAISE_BY_TWO_STAGES) ? 2 : 1],
:XSPATK2 => [PBStats::SPATK, 2],
:XSPATK3 => [PBStats::SPATK, 3],
:XSPATK6 => [PBStats::SPATK, 6],
:XSPECIAL => [PBStats::SPATK, (X_STAT_ITEMS_RAISE_BY_TWO_STAGES) ? 2 : 1],
:XSPECIAL => [PBStats::SPATK, (Settings::X_STAT_ITEMS_RAISE_BY_TWO_STAGES) ? 2 : 1],
:XSPECIAL2 => [PBStats::SPATK, 2],
:XSPECIAL3 => [PBStats::SPATK, 3],
:XSPECIAL6 => [PBStats::SPATK, 6],
:XSPDEF => [PBStats::SPDEF, (X_STAT_ITEMS_RAISE_BY_TWO_STAGES) ? 2 : 1],
:XSPDEF => [PBStats::SPDEF, (Settings::X_STAT_ITEMS_RAISE_BY_TWO_STAGES) ? 2 : 1],
:XSPDEF2 => [PBStats::SPDEF, 2],
:XSPDEF3 => [PBStats::SPDEF, 3],
:XSPDEF6 => [PBStats::SPDEF, 6],
:XSPEED => [PBStats::SPEED, (X_STAT_ITEMS_RAISE_BY_TWO_STAGES) ? 2 : 1],
:XSPEED => [PBStats::SPEED, (Settings::X_STAT_ITEMS_RAISE_BY_TWO_STAGES) ? 2 : 1],
:XSPEED2 => [PBStats::SPEED, 2],
:XSPEED3 => [PBStats::SPEED, 3],
:XSPEED6 => [PBStats::SPEED, 6],
:XACCURACY => [PBStats::ACCURACY, (X_STAT_ITEMS_RAISE_BY_TWO_STAGES) ? 2 : 1],
:XACCURACY => [PBStats::ACCURACY, (Settings::X_STAT_ITEMS_RAISE_BY_TWO_STAGES) ? 2 : 1],
:XACCURACY2 => [PBStats::ACCURACY, 2],
:XACCURACY3 => [PBStats::ACCURACY, 3],
:XACCURACY6 => [PBStats::ACCURACY, 6]

View File

@@ -1514,8 +1514,8 @@ class PokeBattle_AI
elsif skill>=PBTrainerAI.mediumSkill && target.lastMoveUsed
moveData = GameData::Move.get(target.lastMoveUsed)
if moveData.base_damage > 0 &&
(MOVE_CATEGORY_PER_MOVE && moveData.category == 0) ||
(!MOVE_CATEGORY_PER_MOVE && PBTypes.isPhysicalType?(moveData.type))
(Settings::MOVE_CATEGORY_PER_MOVE && moveData.category == 0) ||
(!Settings::MOVE_CATEGORY_PER_MOVE && PBTypes.isPhysicalType?(moveData.type))
score -= 60
end
end
@@ -1532,8 +1532,8 @@ class PokeBattle_AI
elsif skill>=PBTrainerAI.mediumSkill && target.lastMoveUsed
moveData = GameData::Move.get(target.lastMoveUsed)
if moveData.base_damage > 0 &&
(MOVE_CATEGORY_PER_MOVE && moveData.category == 1) ||
(!MOVE_CATEGORY_PER_MOVE && !PBTypes.isSpecialType?(moveData.type))
(Settings::MOVE_CATEGORY_PER_MOVE && moveData.category == 1) ||
(!Settings::MOVE_CATEGORY_PER_MOVE && !PBTypes.isSpecialType?(moveData.type))
score -= 60
end
end

View File

@@ -120,7 +120,7 @@ class PokeBattle_AI
end
return true if target.effects[PBEffects::Substitute]>0 && move.statusMove? &&
!move.ignoresSubstitute?(user) && user.index!=target.index
return true if MECHANICS_GENERATION >= 7 && user.hasActiveAbility?(:PRANKSTER) &&
return true if Settings::MECHANICS_GENERATION >= 7 && user.hasActiveAbility?(:PRANKSTER) &&
target.pbHasType?(:DARK) && target.opposes?(user)
return true if move.priority>0 && @battle.field.terrain==PBBattleTerrains::Psychic &&
target.affectedByTerrain? && target.opposes?(user)
@@ -200,7 +200,7 @@ class PokeBattle_AI
baseDmg = move.pbNaturalGiftBaseDamage(user.item_id)
when "09B" # Heavy Slam
baseDmg = move.pbBaseDamage(baseDmg,user,target)
baseDmg *= 2 if MECHANICS_GENERATION >= 7 && skill>=PBTrainerAI.mediumSkill &&
baseDmg *= 2 if Settings::MECHANICS_GENERATION >= 7 && skill>=PBTrainerAI.mediumSkill &&
target.effects[PBEffects::Minimize]
when "0A0", "0BD", "0BE" # Frost Breath, Double Kick, Twineedle
baseDmg *= 2
@@ -418,9 +418,9 @@ class PokeBattle_AI
# Don't need to check the Atk/Sp Atk-boosting badges because the AI
# won't control the player's Pokémon.
if target.pbOwnedByPlayer?
if move.physicalMove?(type) && @battle.pbPlayer.badge_count >= NUM_BADGES_BOOST_DEFENSE
if move.physicalMove?(type) && @battle.pbPlayer.badge_count >= Settings::NUM_BADGES_BOOST_DEFENSE
multipliers[:defense_multiplier] *= 1.1
elsif move.specialMove?(type) && @battle.pbPlayer.badge_count >= NUM_BADGES_BOOST_SPDEF
elsif move.specialMove?(type) && @battle.pbPlayer.badge_count >= Settings::NUM_BADGES_BOOST_SPDEF
multipliers[:defense_multiplier] *= 1.1
end
end
@@ -474,7 +474,7 @@ class PokeBattle_AI
if skill>=PBTrainerAI.highSkill
if user.status==PBStatuses::BURN && move.physicalMove?(type) &&
!user.hasActiveAbility?(:GUTS) &&
!(MECHANICS_GENERATION >= 6 && move.function == "07E") # Facade
!(Settings::MECHANICS_GENERATION >= 6 && move.function == "07E") # Facade
multipliers[:final_damage_multiplier] /= 2
end
end
@@ -651,7 +651,7 @@ class PokeBattle_AI
end
if skill>=PBTrainerAI.highSkill
if move.function=="006" # Toxic
modifiers[:base_accuracy] = 0 if MORE_TYPE_EFFECTS && move.statusMove? &&
modifiers[:base_accuracy] = 0 if Settings::MORE_TYPE_EFFECTS && move.statusMove? &&
user.pbHasType?(:POISON)
end
if move.function=="070" # OHKO moves

View File

@@ -5,15 +5,15 @@ module PokeBattle_SceneConstants
MESSAGE_SHADOW_COLOR = Color.new(160, 160, 168)
# The number of party balls to show in each side's lineup.
NUM_BALLS = MAX_PARTY_SIZE
NUM_BALLS = Settings::MAX_PARTY_SIZE
# Centre bottom of the player's side base graphic
PLAYER_BASE_X = 128
PLAYER_BASE_Y = SCREEN_HEIGHT - 80
PLAYER_BASE_Y = Settings::SCREEN_HEIGHT - 80
# Centre middle of the foe's side base graphic
FOE_BASE_X = SCREEN_WIDTH - 128
FOE_BASE_Y = (SCREEN_HEIGHT * 3 / 4) - 112
FOE_BASE_X = Settings::SCREEN_WIDTH - 128
FOE_BASE_Y = (Settings::SCREEN_HEIGHT * 3 / 4) - 112
# Returns where the centre bottom of a battler's sprite should be, given its
# index and the number of battlers on its side, assuming the battler has

View File

@@ -480,12 +480,12 @@ end
def pbBattleConfusionBerry(battler,battle,item,forced,flavor,confuseMsg)
return false if !forced && !battler.canHeal?
return false if !forced && !battler.canConsumePinchBerry?(MECHANICS_GENERATION >= 7)
return false if !forced && !battler.canConsumePinchBerry?(Settings::MECHANICS_GENERATION >= 7)
itemName = GameData::Item.get(item).name
battle.pbCommonAnimation("EatBerry",battler) if !forced
fraction_to_heal = 8 # Gens 6 and lower
if MECHANICS_GENERATION == 7; fraction_to_heal = 2
elsif MECHANICS_GENERATION >= 8; fraction_to_heal = 3
if Settings::MECHANICS_GENERATION == 7; fraction_to_heal = 2
elsif Settings::MECHANICS_GENERATION >= 8; fraction_to_heal = 3
end
amt = battler.pbRecoverHP(battler.totalhp / fraction_to_heal)
if amt>0
@@ -572,7 +572,7 @@ def pbBattleGem(user,type,move,mults,moveType)
return if move.is_a?(PokeBattle_PledgeMove)
return if moveType != type
user.effects[PBEffects::GemConsumed] = user.item_id
if MECHANICS_GENERATION >= 6
if Settings::MECHANICS_GENERATION >= 6
mults[:base_damage_multiplier] *= 1.3
else
mults[:base_damage_multiplier] *= 1.5
@@ -598,7 +598,7 @@ def pbBattleWeatherAbility(weather,battler,battle,ignorePrimal=false)
battle.pbDisplay(_INTL("{1}'s {2} activated!",battler.pbThis,battler.abilityName))
end
fixedDuration = false
fixedDuration = true if FIXED_DURATION_WEATHER_FROM_ABILITY &&
fixedDuration = true if Settings::FIXED_DURATION_WEATHER_FROM_ABILITY &&
weather != PBWeather::HarshSun &&
weather != PBWeather::HeavyRain &&
weather != PBWeather::StrongWinds

View File

@@ -308,7 +308,7 @@ BattleHandlers::StatusCureAbility.add(:MAGMAARMOR,
BattleHandlers::StatusCureAbility.add(:OBLIVIOUS,
proc { |ability,battler|
next if battler.effects[PBEffects::Attract]<0 &&
(battler.effects[PBEffects::Taunt]==0 || MECHANICS_GENERATION <= 5)
(battler.effects[PBEffects::Taunt]==0 || Settings::MECHANICS_GENERATION <= 5)
battler.battle.pbShowAbilitySplash(battler)
if battler.effects[PBEffects::Attract]>=0
battler.pbCureAttract
@@ -319,7 +319,7 @@ BattleHandlers::StatusCureAbility.add(:OBLIVIOUS,
battler.pbThis,battler.abilityName))
end
end
if battler.effects[PBEffects::Taunt]>0 && MECHANICS_GENERATION >= 6
if battler.effects[PBEffects::Taunt]>0 && Settings::MECHANICS_GENERATION >= 6
battler.effects[PBEffects::Taunt] = 0
if PokeBattle_SceneConstants::USE_ABILITY_SPLASH
battler.battle.pbDisplay(_INTL("{1}'s Taunt wore off!",battler.pbThis))
@@ -741,7 +741,7 @@ BattleHandlers::MoveBaseTypeModifierAbility.add(:LIQUIDVOICE,
BattleHandlers::MoveBaseTypeModifierAbility.add(:NORMALIZE,
proc { |ability,user,move,type|
next if !GameData::Type.exists?(:NORMAL)
move.powerBoost = true if MECHANICS_GENERATION >= 7
move.powerBoost = true if Settings::MECHANICS_GENERATION >= 7
next :NORMAL
}
)
@@ -780,7 +780,7 @@ BattleHandlers::AccuracyCalcUserAbility.add(:HUSTLE,
BattleHandlers::AccuracyCalcUserAbility.add(:KEENEYE,
proc { |ability,mods,user,target,move,type|
mods[:evasion_stage] = 0 if mods[:evasion_stage] > 0 && MECHANICS_GENERATION >= 6
mods[:evasion_stage] = 0 if mods[:evasion_stage] > 0 && Settings::MECHANICS_GENERATION >= 6
}
)
@@ -1606,7 +1606,7 @@ BattleHandlers::TargetAbilityOnHit.add(:WEAKARMOR,
battle.pbShowAbilitySplash(target)
target.pbLowerStatStageByAbility(PBStats::DEFENSE, 1, target, false)
target.pbRaiseStatStageByAbility(PBStats::SPEED,
(MECHANICS_GENERATION >= 7) ? 2 : 1, target, false)
(Settings::MECHANICS_GENERATION >= 7) ? 2 : 1, target, false)
battle.pbHideAbilitySplash(target)
}
)
@@ -2089,7 +2089,7 @@ BattleHandlers::AbilityOnSwitchIn.add(:ANTICIPATION,
next if m.statusMove?
if type1
moveType = m.type
if MECHANICS_GENERATION >= 6 && m.function == "090" # Hidden Power
if Settings::MECHANICS_GENERATION >= 6 && m.function == "090" # Hidden Power
moveType = pbHiddenPower(b.pokemon)[0]
end
eff = PBTypes.getCombinedEffectiveness(moveType,type1,type2,type3)
@@ -2236,7 +2236,7 @@ BattleHandlers::AbilityOnSwitchIn.add(:FRISK,
end
if foes.length>0
battle.pbShowAbilitySplash(battler)
if MECHANICS_GENERATION >= 6
if Settings::MECHANICS_GENERATION >= 6
foes.each do |b|
battle.pbDisplay(_INTL("{1} frisked {2} and found its {3}!",
battler.pbThis,b.pbThis(true),b.itemName))

View File

@@ -746,7 +746,7 @@ BattleHandlers::DamageCalcUserItem.copy(:SOFTSAND,:EARTHPLATE)
BattleHandlers::DamageCalcUserItem.add(:SOULDEW,
proc { |item,user,target,move,mults,baseDmg,type|
next if !user.isSpecies?(:LATIAS) && !user.isSpecies?(:LATIOS)
if SOUL_DEW_POWERS_UP_TYPES
if Settings::SOUL_DEW_POWERS_UP_TYPES
mults[:final_damage_multiplier] *= 1.2 if type == :PSYCHIC || type == :DRAGON
else
if move.specialMove? && !user.battle.rules["souldewclause"]
@@ -932,7 +932,7 @@ BattleHandlers::DamageCalcTargetItem.add(:SHUCABERRY,
BattleHandlers::DamageCalcTargetItem.add(:SOULDEW,
proc { |item,user,target,move,mults,baseDmg,type|
next if SOUL_DEW_POWERS_UP_TYPES
next if Settings::SOUL_DEW_POWERS_UP_TYPES
next if !target.isSpecies?(:LATIAS) && !target.isSpecies?(:LATIOS)
if move.specialMove? && !user.battle.rules["souldewclause"]
mults[:defense_multiplier] *= 1.5

View File

@@ -101,7 +101,7 @@ BallHandlers::ModifyCatchRate.add(:SAFARIBALL,proc { |ball,catchRate,battle,batt
})
BallHandlers::ModifyCatchRate.add(:NETBALL,proc { |ball,catchRate,battle,battler,ultraBeast|
multiplier = (NEW_POKE_BALL_CATCH_RATES) ? 3.5 : 3
multiplier = (Settings::NEW_POKE_BALL_CATCH_RATES) ? 3.5 : 3
catchRate *= multiplier if battler.pbHasType?(:BUG) || battler.pbHasType?(:WATER)
next catchRate
})
@@ -119,7 +119,7 @@ BallHandlers::ModifyCatchRate.add(:NESTBALL,proc { |ball,catchRate,battle,battle
})
BallHandlers::ModifyCatchRate.add(:REPEATBALL,proc { |ball,catchRate,battle,battler,ultraBeast|
multiplier = (NEW_POKE_BALL_CATCH_RATES) ? 3.5 : 3
multiplier = (Settings::NEW_POKE_BALL_CATCH_RATES) ? 3.5 : 3
catchRate *= multiplier if battle.pbPlayer.owned?(battler.species)
next catchRate
})
@@ -131,7 +131,7 @@ BallHandlers::ModifyCatchRate.add(:TIMERBALL,proc { |ball,catchRate,battle,battl
})
BallHandlers::ModifyCatchRate.add(:DUSKBALL,proc { |ball,catchRate,battle,battler,ultraBeast|
multiplier = (NEW_POKE_BALL_CATCH_RATES) ? 3 : 3.5
multiplier = (Settings::NEW_POKE_BALL_CATCH_RATES) ? 3 : 3.5
catchRate *= multiplier if battle.time==2
next catchRate
})
@@ -161,7 +161,7 @@ BallHandlers::ModifyCatchRate.add(:LEVELBALL,proc { |ball,catchRate,battle,battl
})
BallHandlers::ModifyCatchRate.add(:LUREBALL,proc { |ball,catchRate,battle,battler,ultraBeast|
multiplier = (NEW_POKE_BALL_CATCH_RATES) ? 5 : 3
multiplier = (Settings::NEW_POKE_BALL_CATCH_RATES) ? 5 : 3
catchRate *= multiplier if $PokemonTemp.encounterType==EncounterTypes::OldRod ||
$PokemonTemp.encounterType==EncounterTypes::GoodRod ||
$PokemonTemp.encounterType==EncounterTypes::SuperRod
@@ -171,7 +171,7 @@ BallHandlers::ModifyCatchRate.add(:LUREBALL,proc { |ball,catchRate,battle,battle
BallHandlers::ModifyCatchRate.add(:HEAVYBALL,proc { |ball,catchRate,battle,battler,ultraBeast|
next 0 if catchRate==0
weight = battler.pbWeight
if NEW_POKE_BALL_CATCH_RATES
if Settings::NEW_POKE_BALL_CATCH_RATES
if weight>=3000; catchRate += 30
elsif weight>=2000; catchRate += 20
elsif weight<1000; catchRate -= 20