More revamping and rearranging

This commit is contained in:
Maruno17
2021-01-23 20:44:07 +00:00
parent 8a89ef1220
commit 7de034957b
38 changed files with 674 additions and 661 deletions

View File

@@ -144,13 +144,13 @@ module PokeBattle_BattleCommon
pkmn.owner = Pokemon::Owner.new_from_trainer(pbPlayer)
end
BallHandlers.onCatch(ball,self,pkmn)
pkmn.ballused = pbGetBallType(ball)
pkmn.poke_ball = ball
pkmn.makeUnmega if pkmn.mega?
pkmn.makeUnprimal
pkmn.pbUpdateShadowMoves if pkmn.shadowPokemon?
pkmn.pbRecordFirstMoves
pkmn.update_shadow_moves if pkmn.shadowPokemon?
pkmn.record_first_moves
# Reset form
pkmn.forcedForm = nil if MultipleForms.hasFunction?(pkmn.species,"getForm")
pkmn.forced_form = nil if MultipleForms.hasFunction?(pkmn.species,"getForm")
@peer.pbOnLeavingBattle(self,pkmn,true,true)
# Make the Poké Ball and data box disappear
@scene.pbHideCaptureBall(idxBattler)

View File

@@ -71,19 +71,21 @@ class PokeBattle_Battle
evYield.collect! { |a| a*2 }
end
# Gain EVs for each stat in turn
PBStats.eachStat do |s|
evGain = evYield[s]
# Can't exceed overall limit
if evTotal+evGain>Pokemon::EV_LIMIT
evGain = Pokemon::EV_LIMIT-evTotal
if pkmn.shadowPokemon? && pkmn.saved_ev
PBStats.eachStat { |s| evTotal += pkmn.saved_ev[s] }
PBStats.eachStat do |s|
evGain = evYield[s].clamp(0, Pokemon::EV_STAT_LIMIT - pkmn.ev[s] - pkmn.saved_ev[s])
evGain = evGain.clamp(0, Pokemon::EV_LIMIT - evTotal)
pkmn.saved_ev[s] += evGain
evTotal += evGain
end
# Can't exceed individual stat limit
if pkmn.ev[s]+evGain>Pokemon::EV_STAT_LIMIT
evGain = Pokemon::EV_STAT_LIMIT-pkmn.ev[s]
else
PBStats.eachStat do |s|
evGain = evYield[s].clamp(0, Pokemon::EV_STAT_LIMIT - pkmn.ev[s])
evGain = evGain.clamp(0, Pokemon::EV_LIMIT - evTotal)
pkmn.ev[s] += evGain
evTotal += evGain
end
# Add EV gain
pkmn.ev[s] += evGain
evTotal += evGain
end
end

View File

@@ -42,7 +42,7 @@ class PokeBattle_Battle
pbDisplay(_INTL("{1}!",battler.name))
if battler.shadowPokemon?
if battler.inHyperMode?
battler.pokemon.hypermode = false
battler.pokemon.hyper_mode = false
battler.pokemon.adjustHeart(-300)
pbDisplay(_INTL("{1} came to its senses from the Trainer's call!",battler.pbThis))
else

View File

@@ -561,7 +561,7 @@ class PokeBattle_Battle
# Hyper Mode (Shadow Pokémon)
if b.inHyperMode?
if pbRandom(100)<10
b.pokemon.hypermode = false
b.pokemon.hyper_mode = false
b.pokemon.adjustHeart(-50)
pbDisplay(_INTL("{1} came to its senses!",b.pbThis))
else