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

@@ -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)