mirror of
https://github.com/infinitefusion/infinitefusion-e18.git
synced 2025-12-07 21:24:59 +00:00
More revamping and rearranging
This commit is contained in:
@@ -115,12 +115,12 @@ module GameData
|
|||||||
party.push(pkmn)
|
party.push(pkmn)
|
||||||
# Set Pokémon's properties if defined
|
# Set Pokémon's properties if defined
|
||||||
if pkmn_data[:form]
|
if pkmn_data[:form]
|
||||||
pkmn.forcedForm = pkmn_data[:form] if MultipleForms.hasFunction?(species, "getForm")
|
pkmn.forced_form = pkmn_data[:form] if MultipleForms.hasFunction?(species, "getForm")
|
||||||
pkmn.formSimple = pkmn_data[:form]
|
pkmn.form_simple = pkmn_data[:form]
|
||||||
end
|
end
|
||||||
pkmn.item = pkmn_data[:item]
|
pkmn.item = pkmn_data[:item]
|
||||||
if pkmn_data[:moves] && pkmn_data[:moves].length > 0
|
if pkmn_data[:moves] && pkmn_data[:moves].length > 0
|
||||||
pkmn_data[:moves].each { |move| pkmn.pbLearnMove(move) }
|
pkmn_data[:moves].each { |move| pkmn.learn_move(move) }
|
||||||
else
|
else
|
||||||
pkmn.resetMoves
|
pkmn.resetMoves
|
||||||
end
|
end
|
||||||
@@ -149,10 +149,10 @@ module GameData
|
|||||||
pkmn.name = pkmn_data[:name] if pkmn_data[:name] && !pkmn_data[:name].empty?
|
pkmn.name = pkmn_data[:name] if pkmn_data[:name] && !pkmn_data[:name].empty?
|
||||||
if pkmn_data[:shadowness]
|
if pkmn_data[:shadowness]
|
||||||
pkmn.makeShadow
|
pkmn.makeShadow
|
||||||
pkmn.pbUpdateShadowMoves(true)
|
pkmn.update_shadow_moves(true)
|
||||||
pkmn.shiny = false
|
pkmn.shiny = false
|
||||||
end
|
end
|
||||||
pkmn.ballused = pkmn_data[:poke_ball] if pkmn_data[:poke_ball]
|
pkmn.poke_ball = pbBallTypeToItem(pkmn_data[:poke_ball]) if pkmn_data[:poke_ball]
|
||||||
pkmn.calcStats
|
pkmn.calcStats
|
||||||
end
|
end
|
||||||
return [trainer, @items.clone, party, self.lose_text]
|
return [trainer, @items.clone, party, self.lose_text]
|
||||||
|
|||||||
@@ -144,13 +144,13 @@ module PokeBattle_BattleCommon
|
|||||||
pkmn.owner = Pokemon::Owner.new_from_trainer(pbPlayer)
|
pkmn.owner = Pokemon::Owner.new_from_trainer(pbPlayer)
|
||||||
end
|
end
|
||||||
BallHandlers.onCatch(ball,self,pkmn)
|
BallHandlers.onCatch(ball,self,pkmn)
|
||||||
pkmn.ballused = pbGetBallType(ball)
|
pkmn.poke_ball = ball
|
||||||
pkmn.makeUnmega if pkmn.mega?
|
pkmn.makeUnmega if pkmn.mega?
|
||||||
pkmn.makeUnprimal
|
pkmn.makeUnprimal
|
||||||
pkmn.pbUpdateShadowMoves if pkmn.shadowPokemon?
|
pkmn.update_shadow_moves if pkmn.shadowPokemon?
|
||||||
pkmn.pbRecordFirstMoves
|
pkmn.record_first_moves
|
||||||
# Reset form
|
# 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)
|
@peer.pbOnLeavingBattle(self,pkmn,true,true)
|
||||||
# Make the Poké Ball and data box disappear
|
# Make the Poké Ball and data box disappear
|
||||||
@scene.pbHideCaptureBall(idxBattler)
|
@scene.pbHideCaptureBall(idxBattler)
|
||||||
|
|||||||
@@ -71,19 +71,21 @@ class PokeBattle_Battle
|
|||||||
evYield.collect! { |a| a*2 }
|
evYield.collect! { |a| a*2 }
|
||||||
end
|
end
|
||||||
# Gain EVs for each stat in turn
|
# Gain EVs for each stat in turn
|
||||||
PBStats.eachStat do |s|
|
if pkmn.shadowPokemon? && pkmn.saved_ev
|
||||||
evGain = evYield[s]
|
PBStats.eachStat { |s| evTotal += pkmn.saved_ev[s] }
|
||||||
# Can't exceed overall limit
|
PBStats.eachStat do |s|
|
||||||
if evTotal+evGain>Pokemon::EV_LIMIT
|
evGain = evYield[s].clamp(0, Pokemon::EV_STAT_LIMIT - pkmn.ev[s] - pkmn.saved_ev[s])
|
||||||
evGain = Pokemon::EV_LIMIT-evTotal
|
evGain = evGain.clamp(0, Pokemon::EV_LIMIT - evTotal)
|
||||||
|
pkmn.saved_ev[s] += evGain
|
||||||
|
evTotal += evGain
|
||||||
end
|
end
|
||||||
# Can't exceed individual stat limit
|
else
|
||||||
if pkmn.ev[s]+evGain>Pokemon::EV_STAT_LIMIT
|
PBStats.eachStat do |s|
|
||||||
evGain = Pokemon::EV_STAT_LIMIT-pkmn.ev[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
|
end
|
||||||
# Add EV gain
|
|
||||||
pkmn.ev[s] += evGain
|
|
||||||
evTotal += evGain
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
@@ -42,7 +42,7 @@ class PokeBattle_Battle
|
|||||||
pbDisplay(_INTL("{1}!",battler.name))
|
pbDisplay(_INTL("{1}!",battler.name))
|
||||||
if battler.shadowPokemon?
|
if battler.shadowPokemon?
|
||||||
if battler.inHyperMode?
|
if battler.inHyperMode?
|
||||||
battler.pokemon.hypermode = false
|
battler.pokemon.hyper_mode = false
|
||||||
battler.pokemon.adjustHeart(-300)
|
battler.pokemon.adjustHeart(-300)
|
||||||
pbDisplay(_INTL("{1} came to its senses from the Trainer's call!",battler.pbThis))
|
pbDisplay(_INTL("{1} came to its senses from the Trainer's call!",battler.pbThis))
|
||||||
else
|
else
|
||||||
|
|||||||
@@ -561,7 +561,7 @@ class PokeBattle_Battle
|
|||||||
# Hyper Mode (Shadow Pokémon)
|
# Hyper Mode (Shadow Pokémon)
|
||||||
if b.inHyperMode?
|
if b.inHyperMode?
|
||||||
if pbRandom(100)<10
|
if pbRandom(100)<10
|
||||||
b.pokemon.hypermode = false
|
b.pokemon.hyper_mode = false
|
||||||
b.pokemon.adjustHeart(-50)
|
b.pokemon.adjustHeart(-50)
|
||||||
pbDisplay(_INTL("{1} came to its senses!",b.pbThis))
|
pbDisplay(_INTL("{1} came to its senses!",b.pbThis))
|
||||||
else
|
else
|
||||||
|
|||||||
@@ -63,34 +63,37 @@ end
|
|||||||
module PokeBattle_BallAnimationMixin
|
module PokeBattle_BallAnimationMixin
|
||||||
# Returns the color that the Pokémon turns when it goes into or out of its
|
# Returns the color that the Pokémon turns when it goes into or out of its
|
||||||
# Poké Ball.
|
# Poké Ball.
|
||||||
def getBattlerColorFromBallType(ballType)
|
def getBattlerColorFromPokeBall(poke_ball)
|
||||||
case ballType
|
case poke_ball
|
||||||
when 1 then return Color.new(132, 189, 247) # Great Ball
|
when :GREATBALL then return Color.new(132, 189, 247)
|
||||||
when 2 then return Color.new(189, 247, 165) # Safari Ball
|
when :SAFARIBALL then return Color.new(189, 247, 165)
|
||||||
when 3 then return Color.new(255, 255, 123) # Ultra Ball
|
when :ULTRABALL then return Color.new(255, 255, 123)
|
||||||
when 4 then return Color.new(189, 165, 231) # Master Ball
|
when :MASTERBALL then return Color.new(189, 165, 231)
|
||||||
when 5 then return Color.new(173, 255, 206) # Net Ball
|
when :NETBALL then return Color.new(173, 255, 206)
|
||||||
when 6 then return Color.new( 99, 206, 247) # Dive Ball
|
when :DIVEBALL then return Color.new( 99, 206, 247)
|
||||||
when 7 then return Color.new(247, 222, 82) # Nest Ball
|
when :NESTBALL then return Color.new(247, 222, 82)
|
||||||
when 8 then return Color.new(255, 198, 132) # Repeat Ball
|
when :REPEATBALL then return Color.new(255, 198, 132)
|
||||||
when 9 then return Color.new(239, 247, 247) # Timer Ball
|
when :TIMERBALL then return Color.new(239, 247, 247)
|
||||||
when 10 then return Color.new(255, 140, 82) # Luxury Ball
|
when :LUXURYBALL then return Color.new(255, 140, 82)
|
||||||
when 11 then return Color.new(255, 74, 82) # Premier Ball
|
when :PREMIERBALL then return Color.new(255, 74, 82)
|
||||||
when 12 then return Color.new(115, 115, 140) # Dusk Ball
|
when :DUSKBALL then return Color.new(115, 115, 140)
|
||||||
when 13 then return Color.new(255, 198, 231) # Heal Ball
|
when :HEALBALL then return Color.new(255, 198, 231)
|
||||||
when 14 then return Color.new(140, 214, 255) # Quick Ball
|
when :QUICKBALL then return Color.new(140, 214, 255)
|
||||||
when 15 then return Color.new(247, 66, 41) # Cherish Ball
|
when :CHERISHBALL then return Color.new(247, 66, 41)
|
||||||
end
|
end
|
||||||
return Color.new(255, 181, 247) # Poké Ball, Sport Ball, Apricorn Balls, others
|
return Color.new(255, 181, 247) # Poké Ball, Sport Ball, Apricorn Balls, others
|
||||||
end
|
end
|
||||||
|
|
||||||
def addBallSprite(ballX,ballY,ballType)
|
def addBallSprite(ballX, ballY, poke_ball)
|
||||||
ball = addNewSprite(ballX,ballY,
|
file_path = sprintf("Graphics/Battle animations/ball_%s", poke_ball)
|
||||||
sprintf("Graphics/Battle animations/ball_%02d",ballType),PictureOrigin::Center)
|
if !pbResolveBitmap(file_path)
|
||||||
|
file_path = sprintf("Graphics/Battle animations/ball_%02d", pbGetBallType(poke_ball))
|
||||||
|
end
|
||||||
|
ball = addNewSprite(ballX, ballY, file_path, PictureOrigin::Center)
|
||||||
@ballSprite = @pictureSprites.last
|
@ballSprite = @pictureSprites.last
|
||||||
if @ballSprite.bitmap.width>=@ballSprite.bitmap.height
|
if @ballSprite.bitmap.width >= @ballSprite.bitmap.height
|
||||||
@ballSprite.src_rect.width = @ballSprite.bitmap.height/2
|
@ballSprite.src_rect.width = @ballSprite.bitmap.height / 2
|
||||||
ball.setSrcSize(0,@ballSprite.bitmap.height/2,@ballSprite.bitmap.height)
|
ball.setSrcSize(0, @ballSprite.bitmap.height / 2, @ballSprite.bitmap.height)
|
||||||
end
|
end
|
||||||
return ball
|
return ball
|
||||||
end
|
end
|
||||||
@@ -201,28 +204,36 @@ module PokeBattle_BallAnimationMixin
|
|||||||
ball.setAngle(delay+duration,0)
|
ball.setAngle(delay+duration,0)
|
||||||
end
|
end
|
||||||
|
|
||||||
def ballSetOpen(ball,delay,ballType)
|
def ballSetOpen(ball, delay, poke_ball)
|
||||||
ball.setName(delay,sprintf("Graphics/Battle animations/ball_%02d_open",ballType))
|
file_path = sprintf("Graphics/Battle animations/ball_%s_open", poke_ball)
|
||||||
if @ballSprite && @ballSprite.bitmap.width>=@ballSprite.bitmap.height
|
if !pbResolveBitmap(file_path)
|
||||||
ball.setSrcSize(delay,@ballSprite.bitmap.height/2,@ballSprite.bitmap.height)
|
file_path = sprintf("Graphics/Battle animations/ball_%02d_open", pbGetBallType(poke_ball))
|
||||||
|
end
|
||||||
|
ball.setName(delay, file_path)
|
||||||
|
if @ballSprite && @ballSprite.bitmap.width >= @ballSprite.bitmap.height
|
||||||
|
ball.setSrcSize(delay, @ballSprite.bitmap.height / 2, @ballSprite.bitmap.height)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
def ballSetClosed(ball,delay,ballType)
|
def ballSetClosed(ball, delay, poke_ball)
|
||||||
ball.setName(delay,sprintf("Graphics/Battle animations/ball_%02d",ballType))
|
file_path = sprintf("Graphics/Battle animations/ball_%s", poke_ball)
|
||||||
if @ballSprite && @ballSprite.bitmap.width>=@ballSprite.bitmap.height
|
if !pbResolveBitmap(file_path)
|
||||||
ball.setSrcSize(delay,@ballSprite.bitmap.height/2,@ballSprite.bitmap.height)
|
file_path = sprintf("Graphics/Battle animations/ball_%02d", pbGetBallType(poke_ball))
|
||||||
|
end
|
||||||
|
ball.setName(delay, file_path)
|
||||||
|
if @ballSprite && @ballSprite.bitmap.width >= @ballSprite.bitmap.height
|
||||||
|
ball.setSrcSize(delay, @ballSprite.bitmap.height / 2, @ballSprite.bitmap.height)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
def ballOpenUp(ball,delay,ballType,showSquish=true,playSE=true)
|
def ballOpenUp(ball, delay, poke_ball, showSquish = true, playSE = true)
|
||||||
if showSquish
|
if showSquish
|
||||||
ball.moveZoomXY(delay,1,120,80) # Squish
|
ball.moveZoomXY(delay, 1, 120, 80) # Squish
|
||||||
ball.moveZoom(delay+5,1,100) # Unsquish
|
ball.moveZoom(delay + 5, 1, 100) # Unsquish
|
||||||
delay += 6
|
delay += 6
|
||||||
end
|
end
|
||||||
ball.setSE(delay,"Battle recall") if playSE
|
ball.setSE(delay, "Battle recall") if playSE
|
||||||
ballSetOpen(ball,delay,ballType)
|
ballSetOpen(ball, delay, poke_ball)
|
||||||
end
|
end
|
||||||
|
|
||||||
def battlerAppear(battler,delay,battlerX,battlerY,batSprite,color)
|
def battlerAppear(battler,delay,battlerX,battlerY,batSprite,color)
|
||||||
@@ -246,20 +257,20 @@ module PokeBattle_BallAnimationMixin
|
|||||||
end
|
end
|
||||||
|
|
||||||
# The regular Poké Ball burst animation.
|
# The regular Poké Ball burst animation.
|
||||||
def ballBurst(delay,ballX,ballY,ballType)
|
def ballBurst(delay, ballX, ballY, poke_ball)
|
||||||
end
|
end
|
||||||
|
|
||||||
# The Poké Ball burst animation used when absorbing a wild Pokémon during a
|
# The Poké Ball burst animation used when absorbing a wild Pokémon during a
|
||||||
# capture attempt.
|
# capture attempt.
|
||||||
def ballBurstCapture(delay,ballX,ballY,ballType)
|
def ballBurstCapture(delay, ballX, ballY, poke_ball)
|
||||||
end
|
end
|
||||||
|
|
||||||
def ballCaptureSuccess(ball,delay,ballX,ballY)
|
def ballCaptureSuccess(ball, delay, ballX, ballY)
|
||||||
ball.setSE(delay,"Battle catch click")
|
ball.setSE(delay, "Battle catch click")
|
||||||
ball.moveTone(delay,4,Tone.new(-64,-64,-64,128))
|
ball.moveTone(delay, 4, Tone.new(-64, -64, -64, 128))
|
||||||
end
|
end
|
||||||
|
|
||||||
# The Poké Ball burst animation used when recalling a Pokémon.
|
# The Poké Ball burst animation used when recalling a Pokémon.
|
||||||
def ballBurstRecall(delay,ballX,ballY,ballType)
|
def ballBurstRecall(delay, ballX, ballY, poke_ball)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -421,12 +421,9 @@ class PokeballPlayerSendOutAnimation < PokeBattle_Animation
|
|||||||
shaSprite = @sprites["shadow_#{@battler.index}"]
|
shaSprite = @sprites["shadow_#{@battler.index}"]
|
||||||
traSprite = @sprites["player_#{@idxTrainer}"]
|
traSprite = @sprites["player_#{@idxTrainer}"]
|
||||||
# Calculate the Poké Ball graphic to use
|
# Calculate the Poké Ball graphic to use
|
||||||
ballType = 0
|
poke_ball = (batSprite.pkmn) ? batSprite.pkmn.poke_ball : nil
|
||||||
if !batSprite.pkmn.nil?
|
|
||||||
ballType = batSprite.pkmn.ballused || 0
|
|
||||||
end
|
|
||||||
# Calculate the color to turn the battler sprite
|
# Calculate the color to turn the battler sprite
|
||||||
col = getBattlerColorFromBallType(ballType)
|
col = getBattlerColorFromPokeBall(poke_ball)
|
||||||
col.alpha = 255
|
col.alpha = 255
|
||||||
# Calculate start and end coordinates for battler sprite movement
|
# Calculate start and end coordinates for battler sprite movement
|
||||||
ballPos = PokeBattle_SceneConstants.pbBattlerPosition(@battler.index,batSprite.sideSize)
|
ballPos = PokeBattle_SceneConstants.pbBattlerPosition(@battler.index,batSprite.sideSize)
|
||||||
@@ -440,7 +437,7 @@ class PokeballPlayerSendOutAnimation < PokeBattle_Animation
|
|||||||
ballMidX = 0 # Unused in trajectory calculation
|
ballMidX = 0 # Unused in trajectory calculation
|
||||||
ballMidY = battlerStartY-144
|
ballMidY = battlerStartY-144
|
||||||
# Set up Poké Ball sprite
|
# Set up Poké Ball sprite
|
||||||
ball = addBallSprite(ballStartX,ballStartY,ballType)
|
ball = addBallSprite(ballStartX,ballStartY,poke_ball)
|
||||||
ball.setZ(0,25)
|
ball.setZ(0,25)
|
||||||
ball.setVisible(0,false)
|
ball.setVisible(0,false)
|
||||||
# Poké Ball tracking the player's hand animation (if trainer is visible)
|
# Poké Ball tracking the player's hand animation (if trainer is visible)
|
||||||
@@ -455,8 +452,8 @@ class PokeballPlayerSendOutAnimation < PokeBattle_Animation
|
|||||||
ball.setZ(9,batSprite.z-1)
|
ball.setZ(9,batSprite.z-1)
|
||||||
delay = ball.totalDuration+4
|
delay = ball.totalDuration+4
|
||||||
delay += 10*@idxOrder # Stagger appearances if multiple Pokémon are sent out at once
|
delay += 10*@idxOrder # Stagger appearances if multiple Pokémon are sent out at once
|
||||||
ballOpenUp(ball,delay-2,ballType)
|
ballOpenUp(ball,delay-2,poke_ball)
|
||||||
ballBurst(delay,battlerStartX,battlerStartY-18,ballType)
|
ballBurst(delay,battlerStartX,battlerStartY-18,poke_ball)
|
||||||
ball.moveOpacity(delay+2,2,0)
|
ball.moveOpacity(delay+2,2,0)
|
||||||
# Set up battler sprite
|
# Set up battler sprite
|
||||||
battler = addSprite(batSprite,PictureOrigin::Bottom)
|
battler = addSprite(batSprite,PictureOrigin::Bottom)
|
||||||
@@ -501,12 +498,9 @@ class PokeballTrainerSendOutAnimation < PokeBattle_Animation
|
|||||||
batSprite = @sprites["pokemon_#{@battler.index}"]
|
batSprite = @sprites["pokemon_#{@battler.index}"]
|
||||||
shaSprite = @sprites["shadow_#{@battler.index}"]
|
shaSprite = @sprites["shadow_#{@battler.index}"]
|
||||||
# Calculate the Poké Ball graphic to use
|
# Calculate the Poké Ball graphic to use
|
||||||
ballType = 0
|
poke_ball = (batSprite.pkmn) ? batSprite.pkmn.poke_ball : nil
|
||||||
if !batSprite.pkmn.nil?
|
|
||||||
ballType = batSprite.pkmn.ballused || 0
|
|
||||||
end
|
|
||||||
# Calculate the color to turn the battler sprite
|
# Calculate the color to turn the battler sprite
|
||||||
col = getBattlerColorFromBallType(ballType)
|
col = getBattlerColorFromPokeBall(poke_ball)
|
||||||
col.alpha = 255
|
col.alpha = 255
|
||||||
# Calculate start and end coordinates for battler sprite movement
|
# Calculate start and end coordinates for battler sprite movement
|
||||||
ballPos = PokeBattle_SceneConstants.pbBattlerPosition(@battler.index,batSprite.sideSize)
|
ballPos = PokeBattle_SceneConstants.pbBattlerPosition(@battler.index,batSprite.sideSize)
|
||||||
@@ -515,15 +509,15 @@ class PokeballTrainerSendOutAnimation < PokeBattle_Animation
|
|||||||
battlerEndX = batSprite.x
|
battlerEndX = batSprite.x
|
||||||
battlerEndY = batSprite.y
|
battlerEndY = batSprite.y
|
||||||
# Set up Poké Ball sprite
|
# Set up Poké Ball sprite
|
||||||
ball = addBallSprite(0,0,ballType)
|
ball = addBallSprite(0,0,poke_ball)
|
||||||
ball.setZ(0,batSprite.z-1)
|
ball.setZ(0,batSprite.z-1)
|
||||||
# Poké Ball animation
|
# Poké Ball animation
|
||||||
createBallTrajectory(ball,battlerStartX,battlerStartY)
|
createBallTrajectory(ball,battlerStartX,battlerStartY)
|
||||||
delay = ball.totalDuration+6
|
delay = ball.totalDuration+6
|
||||||
delay += 10 if @showingTrainer # Give time for trainer to slide off screen
|
delay += 10 if @showingTrainer # Give time for trainer to slide off screen
|
||||||
delay += 10*@idxOrder # Stagger appearances if multiple Pokémon are sent out at once
|
delay += 10*@idxOrder # Stagger appearances if multiple Pokémon are sent out at once
|
||||||
ballOpenUp(ball,delay-2,ballType)
|
ballOpenUp(ball,delay-2,poke_ball)
|
||||||
ballBurst(delay,battlerStartX,battlerStartY-18,ballType)
|
ballBurst(delay,battlerStartX,battlerStartY-18,poke_ball)
|
||||||
ball.moveOpacity(delay+2,2,0)
|
ball.moveOpacity(delay+2,2,0)
|
||||||
# Set up battler sprite
|
# Set up battler sprite
|
||||||
battler = addSprite(batSprite,PictureOrigin::Bottom)
|
battler = addSprite(batSprite,PictureOrigin::Bottom)
|
||||||
@@ -567,12 +561,9 @@ class BattlerRecallAnimation < PokeBattle_Animation
|
|||||||
batSprite = @sprites["pokemon_#{@idxBattler}"]
|
batSprite = @sprites["pokemon_#{@idxBattler}"]
|
||||||
shaSprite = @sprites["shadow_#{@idxBattler}"]
|
shaSprite = @sprites["shadow_#{@idxBattler}"]
|
||||||
# Calculate the Poké Ball graphic to use
|
# Calculate the Poké Ball graphic to use
|
||||||
ballType = 0
|
poke_ball = (batSprite.pkmn) ? batSprite.pkmn.poke_ball : nil
|
||||||
if !batSprite.pkmn.nil?
|
|
||||||
ballType = batSprite.pkmn.ballused || 0
|
|
||||||
end
|
|
||||||
# Calculate the color to turn the battler sprite
|
# Calculate the color to turn the battler sprite
|
||||||
col = getBattlerColorFromBallType(ballType)
|
col = getBattlerColorFromPokeBall(poke_ball)
|
||||||
col.alpha = 0
|
col.alpha = 0
|
||||||
# Calculate end coordinates for battler sprite movement
|
# Calculate end coordinates for battler sprite movement
|
||||||
ballPos = PokeBattle_SceneConstants.pbBattlerPosition(@idxBattler,batSprite.sideSize)
|
ballPos = PokeBattle_SceneConstants.pbBattlerPosition(@idxBattler,batSprite.sideSize)
|
||||||
@@ -583,12 +574,12 @@ class BattlerRecallAnimation < PokeBattle_Animation
|
|||||||
battler.setVisible(0,true)
|
battler.setVisible(0,true)
|
||||||
battler.setColor(0,col)
|
battler.setColor(0,col)
|
||||||
# Set up Poké Ball sprite
|
# Set up Poké Ball sprite
|
||||||
ball = addBallSprite(battlerEndX,battlerEndY,ballType)
|
ball = addBallSprite(battlerEndX,battlerEndY,poke_ball)
|
||||||
ball.setZ(0,batSprite.z+1)
|
ball.setZ(0,batSprite.z+1)
|
||||||
# Poké Ball animation
|
# Poké Ball animation
|
||||||
ballOpenUp(ball,0,ballType)
|
ballOpenUp(ball,0,poke_ball)
|
||||||
delay = ball.totalDuration
|
delay = ball.totalDuration
|
||||||
ballBurstRecall(delay,battlerEndX,battlerEndY,ballType)
|
ballBurstRecall(delay,battlerEndX,battlerEndY,poke_ball)
|
||||||
ball.moveOpacity(10,2,0)
|
ball.moveOpacity(10,2,0)
|
||||||
# Battler animation
|
# Battler animation
|
||||||
battlerAbsorb(battler,delay,battlerEndX,battlerEndY,col)
|
battlerAbsorb(battler,delay,battlerEndX,battlerEndY,col)
|
||||||
@@ -693,8 +684,8 @@ class PokeballThrowCaptureAnimation < PokeBattle_Animation
|
|||||||
include PokeBattle_BallAnimationMixin
|
include PokeBattle_BallAnimationMixin
|
||||||
|
|
||||||
def initialize(sprites,viewport,
|
def initialize(sprites,viewport,
|
||||||
ballType,numShakes,critCapture,battler,showingTrainer)
|
poke_ball,numShakes,critCapture,battler,showingTrainer)
|
||||||
@ballType = ballType
|
@poke_ball = poke_ball
|
||||||
@numShakes = (critCapture) ? 1 : numShakes
|
@numShakes = (critCapture) ? 1 : numShakes
|
||||||
@critCapture = critCapture
|
@critCapture = critCapture
|
||||||
@battler = battler
|
@battler = battler
|
||||||
@@ -720,7 +711,7 @@ class PokeballThrowCaptureAnimation < PokeBattle_Animation
|
|||||||
ballEndY = 112
|
ballEndY = 112
|
||||||
ballGroundY = ballPos[1]-4
|
ballGroundY = ballPos[1]-4
|
||||||
# Set up Poké Ball sprite
|
# Set up Poké Ball sprite
|
||||||
ball = addBallSprite(ballStartX,ballStartY,@ballType)
|
ball = addBallSprite(ballStartX,ballStartY,@poke_ball)
|
||||||
ball.setZ(0,batSprite.z+1)
|
ball.setZ(0,batSprite.z+1)
|
||||||
@ballSpriteIndex = (@numShakes>=4 || @critCapture) ? @tempSprites.length-1 : -1
|
@ballSpriteIndex = (@numShakes>=4 || @critCapture) ? @tempSprites.length-1 : -1
|
||||||
# Set up trainer sprite (only visible in Safari Zone battles)
|
# Set up trainer sprite (only visible in Safari Zone battles)
|
||||||
@@ -740,12 +731,12 @@ class PokeballThrowCaptureAnimation < PokeBattle_Animation
|
|||||||
ball.setSE(delay+16,"Battle ball hit")
|
ball.setSE(delay+16,"Battle ball hit")
|
||||||
# Poké Ball opens up
|
# Poké Ball opens up
|
||||||
delay = ball.totalDuration+6
|
delay = ball.totalDuration+6
|
||||||
ballOpenUp(ball,delay,@ballType,true,false)
|
ballOpenUp(ball,delay,@poke_ball,true,false)
|
||||||
# Set up battler sprite
|
# Set up battler sprite
|
||||||
battler = addSprite(batSprite,PictureOrigin::Bottom)
|
battler = addSprite(batSprite,PictureOrigin::Bottom)
|
||||||
# Poké Ball absorbs battler
|
# Poké Ball absorbs battler
|
||||||
delay = ball.totalDuration
|
delay = ball.totalDuration
|
||||||
ballBurstCapture(delay,ballEndX,ballEndY,@ballType)
|
ballBurstCapture(delay,ballEndX,ballEndY,@poke_ball)
|
||||||
delay = ball.totalDuration+4
|
delay = ball.totalDuration+4
|
||||||
# NOTE: The Pokémon does not change color while being absorbed into a Poké
|
# NOTE: The Pokémon does not change color while being absorbed into a Poké
|
||||||
# Ball during a capture attempt. This may be an oversight in HGSS.
|
# Ball during a capture attempt. This may be an oversight in HGSS.
|
||||||
@@ -763,7 +754,7 @@ class PokeballThrowCaptureAnimation < PokeBattle_Animation
|
|||||||
end
|
end
|
||||||
# Poké Ball closes
|
# Poké Ball closes
|
||||||
delay = battler.totalDuration
|
delay = battler.totalDuration
|
||||||
ballSetClosed(ball,delay,@ballType)
|
ballSetClosed(ball,delay,@poke_ball)
|
||||||
ball.moveTone(delay,3,Tone.new(96,64,-160,160))
|
ball.moveTone(delay,3,Tone.new(96,64,-160,160))
|
||||||
ball.moveTone(delay+5,3,Tone.new(0,0,0,0))
|
ball.moveTone(delay+5,3,Tone.new(0,0,0,0))
|
||||||
# Poké Ball critical capture animation
|
# Poké Ball critical capture animation
|
||||||
@@ -808,11 +799,11 @@ class PokeballThrowCaptureAnimation < PokeBattle_Animation
|
|||||||
if @numShakes==0 || (@numShakes<4 && !@critCapture)
|
if @numShakes==0 || (@numShakes<4 && !@critCapture)
|
||||||
# Poké Ball opens
|
# Poké Ball opens
|
||||||
ball.setZ(delay,batSprite.z-1)
|
ball.setZ(delay,batSprite.z-1)
|
||||||
ballOpenUp(ball,delay,@ballType,false)
|
ballOpenUp(ball,delay,@poke_ball,false)
|
||||||
ballBurst(delay,ballEndX,ballGroundY,@ballType)
|
ballBurst(delay,ballEndX,ballGroundY,@poke_ball)
|
||||||
ball.moveOpacity(delay+2,2,0)
|
ball.moveOpacity(delay+2,2,0)
|
||||||
# Battler emerges
|
# Battler emerges
|
||||||
col = getBattlerColorFromBallType(@ballType)
|
col = getBattlerColorFromPokeBall(@poke_ball)
|
||||||
col.alpha = 255
|
col.alpha = 255
|
||||||
battler.setColor(delay,col)
|
battler.setColor(delay,col)
|
||||||
battlerAppear(battler,delay,battlerStartX,battlerStartY,batSprite,col)
|
battlerAppear(battler,delay,battlerStartX,battlerStartY,batSprite,col)
|
||||||
@@ -846,9 +837,9 @@ end
|
|||||||
class PokeballThrowDeflectAnimation < PokeBattle_Animation
|
class PokeballThrowDeflectAnimation < PokeBattle_Animation
|
||||||
include PokeBattle_BallAnimationMixin
|
include PokeBattle_BallAnimationMixin
|
||||||
|
|
||||||
def initialize(sprites,viewport,ballType,battler)
|
def initialize(sprites,viewport,poke_ball,battler)
|
||||||
@ballType = ballType
|
@poke_ball = poke_ball
|
||||||
@battler = battler
|
@battler = battler
|
||||||
super(sprites,viewport)
|
super(sprites,viewport)
|
||||||
end
|
end
|
||||||
|
|
||||||
@@ -863,7 +854,7 @@ class PokeballThrowDeflectAnimation < PokeBattle_Animation
|
|||||||
ballEndX = ballPos[0]
|
ballEndX = ballPos[0]
|
||||||
ballEndY = 112
|
ballEndY = 112
|
||||||
# Set up Poké Ball sprite
|
# Set up Poké Ball sprite
|
||||||
ball = addBallSprite(ballStartX,ballStartY,@ballType)
|
ball = addBallSprite(ballStartX,ballStartY,@poke_ball)
|
||||||
ball.setZ(0,90)
|
ball.setZ(0,90)
|
||||||
# Poké Ball arc animation
|
# Poké Ball arc animation
|
||||||
ball.setSE(0,"Battle throw")
|
ball.setSE(0,"Battle throw")
|
||||||
|
|||||||
@@ -161,8 +161,8 @@ class PokemonDataBox < SpriteWrapper
|
|||||||
return (@animatingHP) ? @currentHP : @battler.hp
|
return (@animatingHP) ? @currentHP : @battler.hp
|
||||||
end
|
end
|
||||||
|
|
||||||
def expFraction
|
def exp_fraction
|
||||||
return (@animatingExp) ? @currentExp.to_f/@rangeExp : @battler.pokemon.expFraction
|
return (@animatingExp) ? @currentExp.to_f/@rangeExp : @battler.pokemon.exp_fraction
|
||||||
end
|
end
|
||||||
|
|
||||||
def animateHP(oldHP,newHP,rangeHP)
|
def animateHP(oldHP,newHP,rangeHP)
|
||||||
@@ -283,7 +283,7 @@ class PokemonDataBox < SpriteWrapper
|
|||||||
|
|
||||||
def refreshExp
|
def refreshExp
|
||||||
return if !@showExp
|
return if !@showExp
|
||||||
w = self.expFraction*@expBarBitmap.width
|
w = exp_fraction * @expBarBitmap.width
|
||||||
# NOTE: The line below snaps the bar's width to the nearest 2 pixels, to
|
# NOTE: The line below snaps the bar's width to the nearest 2 pixels, to
|
||||||
# fit in with the rest of the graphics which are doubled in size.
|
# fit in with the rest of the graphics which are doubled in size.
|
||||||
w = ((w/2).round)*2
|
w = ((w/2).round)*2
|
||||||
|
|||||||
@@ -306,7 +306,7 @@ class PokeBattle_Scene
|
|||||||
def pbThrow(ball,shakes,critical,targetBattler,showPlayer=false)
|
def pbThrow(ball,shakes,critical,targetBattler,showPlayer=false)
|
||||||
@briefMessage = false
|
@briefMessage = false
|
||||||
captureAnim = PokeballThrowCaptureAnimation.new(@sprites,@viewport,
|
captureAnim = PokeballThrowCaptureAnimation.new(@sprites,@viewport,
|
||||||
pbGetBallType(ball),shakes,critical,@battle.battlers[targetBattler],showPlayer)
|
ball,shakes,critical,@battle.battlers[targetBattler],showPlayer)
|
||||||
loop do
|
loop do
|
||||||
captureAnim.update
|
captureAnim.update
|
||||||
pbUpdate
|
pbUpdate
|
||||||
@@ -347,7 +347,7 @@ class PokeBattle_Scene
|
|||||||
def pbThrowAndDeflect(ball,idxBattler)
|
def pbThrowAndDeflect(ball,idxBattler)
|
||||||
@briefMessage = false
|
@briefMessage = false
|
||||||
throwAnim = PokeballThrowDeflectAnimation.new(@sprites,@viewport,
|
throwAnim = PokeballThrowDeflectAnimation.new(@sprites,@viewport,
|
||||||
pbGetBallType(ball),@battle.battlers[idxBattler])
|
ball,@battle.battlers[idxBattler])
|
||||||
loop do
|
loop do
|
||||||
throwAnim.update
|
throwAnim.update
|
||||||
pbUpdate
|
pbUpdate
|
||||||
|
|||||||
@@ -232,7 +232,7 @@ def pbDayCareGenerateEgg
|
|||||||
GameData::Item.each do |i|
|
GameData::Item.each do |i|
|
||||||
atk = i.move
|
atk = i.move
|
||||||
next if !atk
|
next if !atk
|
||||||
next if !egg.compatibleWithMove?(atk)
|
next if !egg.compatible_with_move?(atk)
|
||||||
next if !movefather.hasMove?(atk)
|
next if !movefather.hasMove?(atk)
|
||||||
moves.push(atk)
|
moves.push(atk)
|
||||||
end
|
end
|
||||||
@@ -340,17 +340,17 @@ def pbDayCareGenerateEgg
|
|||||||
if !ditto0 || !ditto1
|
if !ditto0 || !ditto1
|
||||||
possible_balls = []
|
possible_balls = []
|
||||||
if mother.species == father.species
|
if mother.species == father.species
|
||||||
possible_balls.push(mother.ballused)
|
possible_balls.push(mother.poke_ball)
|
||||||
possible_balls.push(father.ballused)
|
possible_balls.push(father.poke_ball)
|
||||||
else
|
else
|
||||||
possible_balls.push(pkmn0.ballused) if pkmn0.female? || ditto1
|
possible_balls.push(pkmn0.poke_ball) if pkmn0.female? || ditto1
|
||||||
possible_balls.push(pkmn1.ballused) if pkmn1.female? || ditto0
|
possible_balls.push(pkmn1.poke_ball) if pkmn1.female? || ditto0
|
||||||
end
|
end
|
||||||
possible_balls.delete(pbGetBallType(:MASTERBALL)) # Can't inherit this Ball
|
possible_balls.delete(:MASTERBALL) # Can't inherit this Ball
|
||||||
possible_balls.delete(pbGetBallType(:CHERISHBALL)) # Can't inherit this Ball
|
possible_balls.delete(:CHERISHBALL) # Can't inherit this Ball
|
||||||
if possible_balls.length > 0
|
if possible_balls.length > 0
|
||||||
egg.ballused = possible_balls[0]
|
egg.poke_ball = possible_balls[0]
|
||||||
egg.ballused = possible_balls[rand(possible_balls.length)] if possible_balls.length > 1
|
egg.poke_ball = possible_balls[rand(possible_balls.length)] if possible_balls.length > 1
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
# Set all stats
|
# Set all stats
|
||||||
@@ -358,9 +358,9 @@ def pbDayCareGenerateEgg
|
|||||||
egg.iv = ivs
|
egg.iv = ivs
|
||||||
egg.moves = finalmoves
|
egg.moves = finalmoves
|
||||||
egg.calcStats
|
egg.calcStats
|
||||||
egg.obtainText = _INTL("Day-Care Couple")
|
egg.obtain_text = _INTL("Day-Care Couple")
|
||||||
egg.name = _INTL("Egg")
|
egg.name = _INTL("Egg")
|
||||||
egg.eggsteps = egg.species_data.hatch_steps
|
egg.steps_to_hatch = egg.species_data.hatch_steps
|
||||||
egg.givePokerus if rand(65536)<POKERUS_CHANCE
|
egg.givePokerus if rand(65536)<POKERUS_CHANCE
|
||||||
# Add egg to party
|
# Add egg to party
|
||||||
$Trainer.party[$Trainer.party.length] = egg
|
$Trainer.party[$Trainer.party.length] = egg
|
||||||
@@ -398,7 +398,7 @@ Events.onStepTaken += proc { |_sender,_e|
|
|||||||
pkmn.calcStats
|
pkmn.calcStats
|
||||||
movelist = pkmn.getMoveList
|
movelist = pkmn.getMoveList
|
||||||
for i in movelist
|
for i in movelist
|
||||||
pkmn.pbLearnMove(i[1]) if i[0]==pkmn.level # Learned a new move
|
pkmn.learn_move(i[1]) if i[0]==pkmn.level # Learned a new move
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -420,7 +420,7 @@ def pbLearnMove(pkmn,move,ignoreifknown=false,bymachine=false,&block)
|
|||||||
return false
|
return false
|
||||||
end
|
end
|
||||||
if pkmn.numMoves<Pokemon::MAX_MOVES
|
if pkmn.numMoves<Pokemon::MAX_MOVES
|
||||||
pkmn.pbLearnMove(move)
|
pkmn.learn_move(move)
|
||||||
pbMessage(_INTL("\\se[]{1} learned {2}!\\se[Pkmn move learnt]",pkmnname,movename),&block)
|
pbMessage(_INTL("\\se[]{1} learned {2}!\\se[Pkmn move learnt]",pkmnname,movename),&block)
|
||||||
return true
|
return true
|
||||||
end
|
end
|
||||||
@@ -552,7 +552,7 @@ def pbUseItemOnPokemon(item,pkmn,scene)
|
|||||||
movename = GameData::Move.get(machine).name
|
movename = GameData::Move.get(machine).name
|
||||||
if pkmn.shadowPokemon?
|
if pkmn.shadowPokemon?
|
||||||
pbMessage(_INTL("Shadow Pokémon can't be taught any moves.")) { scene.pbUpdate }
|
pbMessage(_INTL("Shadow Pokémon can't be taught any moves.")) { scene.pbUpdate }
|
||||||
elsif !pkmn.compatibleWithMove?(machine)
|
elsif !pkmn.compatible_with_move?(machine)
|
||||||
pbMessage(_INTL("{1} can't learn {2}.",pkmn.name,movename)) { scene.pbUpdate }
|
pbMessage(_INTL("{1} can't learn {2}.",pkmn.name,movename)) { scene.pbUpdate }
|
||||||
else
|
else
|
||||||
pbMessage(_INTL("\\se[PC access]You booted up {1}.\1",itm.name)) { scene.pbUpdate }
|
pbMessage(_INTL("\\se[PC access]You booted up {1}.\1",itm.name)) { scene.pbUpdate }
|
||||||
|
|||||||
@@ -415,7 +415,7 @@ ItemHandlers::UseOnPokemon.add(:AWAKENING,proc { |item,pkmn,scene|
|
|||||||
scene.pbDisplay(_INTL("It won't have any effect."))
|
scene.pbDisplay(_INTL("It won't have any effect."))
|
||||||
next false
|
next false
|
||||||
end
|
end
|
||||||
pkmn.healStatus
|
pkmn.heal_status
|
||||||
scene.pbRefresh
|
scene.pbRefresh
|
||||||
scene.pbDisplay(_INTL("{1} woke up.",pkmn.name))
|
scene.pbDisplay(_INTL("{1} woke up.",pkmn.name))
|
||||||
next true
|
next true
|
||||||
@@ -428,7 +428,7 @@ ItemHandlers::UseOnPokemon.add(:ANTIDOTE,proc { |item,pkmn,scene|
|
|||||||
scene.pbDisplay(_INTL("It won't have any effect."))
|
scene.pbDisplay(_INTL("It won't have any effect."))
|
||||||
next false
|
next false
|
||||||
end
|
end
|
||||||
pkmn.healStatus
|
pkmn.heal_status
|
||||||
scene.pbRefresh
|
scene.pbRefresh
|
||||||
scene.pbDisplay(_INTL("{1} was cured of its poisoning.",pkmn.name))
|
scene.pbDisplay(_INTL("{1} was cured of its poisoning.",pkmn.name))
|
||||||
next true
|
next true
|
||||||
@@ -441,7 +441,7 @@ ItemHandlers::UseOnPokemon.add(:BURNHEAL,proc { |item,pkmn,scene|
|
|||||||
scene.pbDisplay(_INTL("It won't have any effect."))
|
scene.pbDisplay(_INTL("It won't have any effect."))
|
||||||
next false
|
next false
|
||||||
end
|
end
|
||||||
pkmn.healStatus
|
pkmn.heal_status
|
||||||
scene.pbRefresh
|
scene.pbRefresh
|
||||||
scene.pbDisplay(_INTL("{1}'s burn was healed.",pkmn.name))
|
scene.pbDisplay(_INTL("{1}'s burn was healed.",pkmn.name))
|
||||||
next true
|
next true
|
||||||
@@ -454,7 +454,7 @@ ItemHandlers::UseOnPokemon.add(:PARLYZHEAL,proc { |item,pkmn,scene|
|
|||||||
scene.pbDisplay(_INTL("It won't have any effect."))
|
scene.pbDisplay(_INTL("It won't have any effect."))
|
||||||
next false
|
next false
|
||||||
end
|
end
|
||||||
pkmn.healStatus
|
pkmn.heal_status
|
||||||
scene.pbRefresh
|
scene.pbRefresh
|
||||||
scene.pbDisplay(_INTL("{1} was cured of paralysis.",pkmn.name))
|
scene.pbDisplay(_INTL("{1} was cured of paralysis.",pkmn.name))
|
||||||
next true
|
next true
|
||||||
@@ -467,7 +467,7 @@ ItemHandlers::UseOnPokemon.add(:ICEHEAL,proc { |item,pkmn,scene|
|
|||||||
scene.pbDisplay(_INTL("It won't have any effect."))
|
scene.pbDisplay(_INTL("It won't have any effect."))
|
||||||
next false
|
next false
|
||||||
end
|
end
|
||||||
pkmn.healStatus
|
pkmn.heal_status
|
||||||
scene.pbRefresh
|
scene.pbRefresh
|
||||||
scene.pbDisplay(_INTL("{1} was thawed out.",pkmn.name))
|
scene.pbDisplay(_INTL("{1} was thawed out.",pkmn.name))
|
||||||
next true
|
next true
|
||||||
@@ -480,7 +480,7 @@ ItemHandlers::UseOnPokemon.add(:FULLHEAL,proc { |item,pkmn,scene|
|
|||||||
scene.pbDisplay(_INTL("It won't have any effect."))
|
scene.pbDisplay(_INTL("It won't have any effect."))
|
||||||
next false
|
next false
|
||||||
end
|
end
|
||||||
pkmn.healStatus
|
pkmn.heal_status
|
||||||
scene.pbRefresh
|
scene.pbRefresh
|
||||||
scene.pbDisplay(_INTL("{1} became healthy.",pkmn.name))
|
scene.pbDisplay(_INTL("{1} became healthy.",pkmn.name))
|
||||||
next true
|
next true
|
||||||
@@ -497,7 +497,7 @@ ItemHandlers::UseOnPokemon.add(:FULLRESTORE,proc { |item,pkmn,scene|
|
|||||||
next false
|
next false
|
||||||
end
|
end
|
||||||
hpgain = pbItemRestoreHP(pkmn,pkmn.totalhp-pkmn.hp)
|
hpgain = pbItemRestoreHP(pkmn,pkmn.totalhp-pkmn.hp)
|
||||||
pkmn.healStatus
|
pkmn.heal_status
|
||||||
scene.pbRefresh
|
scene.pbRefresh
|
||||||
if hpgain>0
|
if hpgain>0
|
||||||
scene.pbDisplay(_INTL("{1}'s HP was restored by {2} points.",pkmn.name,hpgain))
|
scene.pbDisplay(_INTL("{1}'s HP was restored by {2} points.",pkmn.name,hpgain))
|
||||||
@@ -514,7 +514,7 @@ ItemHandlers::UseOnPokemon.add(:REVIVE,proc { |item,pkmn,scene|
|
|||||||
end
|
end
|
||||||
pkmn.hp = (pkmn.totalhp/2).floor
|
pkmn.hp = (pkmn.totalhp/2).floor
|
||||||
pkmn.hp = 1 if pkmn.hp<=0
|
pkmn.hp = 1 if pkmn.hp<=0
|
||||||
pkmn.healStatus
|
pkmn.heal_status
|
||||||
scene.pbRefresh
|
scene.pbRefresh
|
||||||
scene.pbDisplay(_INTL("{1}'s HP was restored.",pkmn.name))
|
scene.pbDisplay(_INTL("{1}'s HP was restored.",pkmn.name))
|
||||||
next true
|
next true
|
||||||
@@ -525,8 +525,8 @@ ItemHandlers::UseOnPokemon.add(:MAXREVIVE,proc { |item,pkmn,scene|
|
|||||||
scene.pbDisplay(_INTL("It won't have any effect."))
|
scene.pbDisplay(_INTL("It won't have any effect."))
|
||||||
next false
|
next false
|
||||||
end
|
end
|
||||||
pkmn.healHP
|
pkmn.heal_HP
|
||||||
pkmn.healStatus
|
pkmn.heal_status
|
||||||
scene.pbRefresh
|
scene.pbRefresh
|
||||||
scene.pbDisplay(_INTL("{1}'s HP was restored.",pkmn.name))
|
scene.pbDisplay(_INTL("{1}'s HP was restored.",pkmn.name))
|
||||||
next true
|
next true
|
||||||
@@ -553,7 +553,7 @@ ItemHandlers::UseOnPokemon.add(:HEALPOWDER,proc { |item,pkmn,scene|
|
|||||||
scene.pbDisplay(_INTL("It won't have any effect."))
|
scene.pbDisplay(_INTL("It won't have any effect."))
|
||||||
next false
|
next false
|
||||||
end
|
end
|
||||||
pkmn.healStatus
|
pkmn.heal_status
|
||||||
pkmn.changeHappiness("powder")
|
pkmn.changeHappiness("powder")
|
||||||
scene.pbRefresh
|
scene.pbRefresh
|
||||||
scene.pbDisplay(_INTL("{1} became healthy.",pkmn.name))
|
scene.pbDisplay(_INTL("{1} became healthy.",pkmn.name))
|
||||||
@@ -565,8 +565,8 @@ ItemHandlers::UseOnPokemon.add(:REVIVALHERB,proc { |item,pkmn,scene|
|
|||||||
scene.pbDisplay(_INTL("It won't have any effect."))
|
scene.pbDisplay(_INTL("It won't have any effect."))
|
||||||
next false
|
next false
|
||||||
end
|
end
|
||||||
pkmn.healHP
|
pkmn.heal_HP
|
||||||
pkmn.healStatus
|
pkmn.heal_status
|
||||||
pkmn.changeHappiness("revivalherb")
|
pkmn.changeHappiness("revivalherb")
|
||||||
scene.pbRefresh
|
scene.pbRefresh
|
||||||
scene.pbDisplay(_INTL("{1}'s HP was restored.",pkmn.name))
|
scene.pbDisplay(_INTL("{1}'s HP was restored.",pkmn.name))
|
||||||
|
|||||||
@@ -356,7 +356,7 @@ ItemHandlers::BattleUseOnPokemon.add(:SITRUSBERRY,proc { |item,pokemon,battler,c
|
|||||||
})
|
})
|
||||||
|
|
||||||
ItemHandlers::BattleUseOnPokemon.add(:AWAKENING,proc { |item,pokemon,battler,choices,scene|
|
ItemHandlers::BattleUseOnPokemon.add(:AWAKENING,proc { |item,pokemon,battler,choices,scene|
|
||||||
pokemon.healStatus
|
pokemon.heal_status
|
||||||
battler.pbCureStatus(false) if battler
|
battler.pbCureStatus(false) if battler
|
||||||
name = (battler) ? battler.pbThis : pokemon.name
|
name = (battler) ? battler.pbThis : pokemon.name
|
||||||
scene.pbRefresh
|
scene.pbRefresh
|
||||||
@@ -366,7 +366,7 @@ ItemHandlers::BattleUseOnPokemon.add(:AWAKENING,proc { |item,pokemon,battler,cho
|
|||||||
ItemHandlers::BattleUseOnPokemon.copy(:AWAKENING,:CHESTOBERRY,:BLUEFLUTE)
|
ItemHandlers::BattleUseOnPokemon.copy(:AWAKENING,:CHESTOBERRY,:BLUEFLUTE)
|
||||||
|
|
||||||
ItemHandlers::BattleUseOnPokemon.add(:ANTIDOTE,proc { |item,pokemon,battler,choices,scene|
|
ItemHandlers::BattleUseOnPokemon.add(:ANTIDOTE,proc { |item,pokemon,battler,choices,scene|
|
||||||
pokemon.healStatus
|
pokemon.heal_status
|
||||||
battler.pbCureStatus(false) if battler
|
battler.pbCureStatus(false) if battler
|
||||||
name = (battler) ? battler.pbThis : pokemon.name
|
name = (battler) ? battler.pbThis : pokemon.name
|
||||||
scene.pbRefresh
|
scene.pbRefresh
|
||||||
@@ -376,7 +376,7 @@ ItemHandlers::BattleUseOnPokemon.add(:ANTIDOTE,proc { |item,pokemon,battler,choi
|
|||||||
ItemHandlers::BattleUseOnPokemon.copy(:ANTIDOTE,:PECHABERRY)
|
ItemHandlers::BattleUseOnPokemon.copy(:ANTIDOTE,:PECHABERRY)
|
||||||
|
|
||||||
ItemHandlers::BattleUseOnPokemon.add(:BURNHEAL,proc { |item,pokemon,battler,choices,scene|
|
ItemHandlers::BattleUseOnPokemon.add(:BURNHEAL,proc { |item,pokemon,battler,choices,scene|
|
||||||
pokemon.healStatus
|
pokemon.heal_status
|
||||||
battler.pbCureStatus(false) if battler
|
battler.pbCureStatus(false) if battler
|
||||||
name = (battler) ? battler.pbThis : pokemon.name
|
name = (battler) ? battler.pbThis : pokemon.name
|
||||||
scene.pbRefresh
|
scene.pbRefresh
|
||||||
@@ -386,7 +386,7 @@ ItemHandlers::BattleUseOnPokemon.add(:BURNHEAL,proc { |item,pokemon,battler,choi
|
|||||||
ItemHandlers::BattleUseOnPokemon.copy(:BURNHEAL,:RAWSTBERRY)
|
ItemHandlers::BattleUseOnPokemon.copy(:BURNHEAL,:RAWSTBERRY)
|
||||||
|
|
||||||
ItemHandlers::BattleUseOnPokemon.add(:PARALYZEHEAL,proc { |item,pokemon,battler,choices,scene|
|
ItemHandlers::BattleUseOnPokemon.add(:PARALYZEHEAL,proc { |item,pokemon,battler,choices,scene|
|
||||||
pokemon.healStatus
|
pokemon.heal_status
|
||||||
battler.pbCureStatus(false) if battler
|
battler.pbCureStatus(false) if battler
|
||||||
name = (battler) ? battler.pbThis : pokemon.name
|
name = (battler) ? battler.pbThis : pokemon.name
|
||||||
scene.pbRefresh
|
scene.pbRefresh
|
||||||
@@ -396,7 +396,7 @@ ItemHandlers::BattleUseOnPokemon.add(:PARALYZEHEAL,proc { |item,pokemon,battler,
|
|||||||
ItemHandlers::BattleUseOnPokemon.copy(:PARALYZEHEAL,:PARLYZHEAL,:CHERIBERRY)
|
ItemHandlers::BattleUseOnPokemon.copy(:PARALYZEHEAL,:PARLYZHEAL,:CHERIBERRY)
|
||||||
|
|
||||||
ItemHandlers::BattleUseOnPokemon.add(:ICEHEAL,proc { |item,pokemon,battler,choices,scene|
|
ItemHandlers::BattleUseOnPokemon.add(:ICEHEAL,proc { |item,pokemon,battler,choices,scene|
|
||||||
pokemon.healStatus
|
pokemon.heal_status
|
||||||
battler.pbCureStatus(false) if battler
|
battler.pbCureStatus(false) if battler
|
||||||
name = (battler) ? battler.pbThis : pokemon.name
|
name = (battler) ? battler.pbThis : pokemon.name
|
||||||
scene.pbRefresh
|
scene.pbRefresh
|
||||||
@@ -406,7 +406,7 @@ ItemHandlers::BattleUseOnPokemon.add(:ICEHEAL,proc { |item,pokemon,battler,choic
|
|||||||
ItemHandlers::BattleUseOnPokemon.copy(:ICEHEAL,:ASPEARBERRY)
|
ItemHandlers::BattleUseOnPokemon.copy(:ICEHEAL,:ASPEARBERRY)
|
||||||
|
|
||||||
ItemHandlers::BattleUseOnPokemon.add(:FULLHEAL,proc { |item,pokemon,battler,choices,scene|
|
ItemHandlers::BattleUseOnPokemon.add(:FULLHEAL,proc { |item,pokemon,battler,choices,scene|
|
||||||
pokemon.healStatus
|
pokemon.heal_status
|
||||||
battler.pbCureStatus(false) if battler
|
battler.pbCureStatus(false) if battler
|
||||||
battler.pbCureConfusion if battler
|
battler.pbCureConfusion if battler
|
||||||
name = (battler) ? battler.pbThis : pokemon.name
|
name = (battler) ? battler.pbThis : pokemon.name
|
||||||
@@ -420,7 +420,7 @@ ItemHandlers::BattleUseOnPokemon.copy(:FULLHEAL,
|
|||||||
ItemHandlers::BattleUseOnPokemon.copy(:FULLHEAL,:RAGECANDYBAR) if RAGE_CANDY_BAR_CURES_STATUS_PROBLEMS
|
ItemHandlers::BattleUseOnPokemon.copy(:FULLHEAL,:RAGECANDYBAR) if RAGE_CANDY_BAR_CURES_STATUS_PROBLEMS
|
||||||
|
|
||||||
ItemHandlers::BattleUseOnPokemon.add(:FULLRESTORE,proc { |item,pokemon,battler,choices,scene|
|
ItemHandlers::BattleUseOnPokemon.add(:FULLRESTORE,proc { |item,pokemon,battler,choices,scene|
|
||||||
pokemon.healStatus
|
pokemon.heal_status
|
||||||
battler.pbCureStatus(false) if battler
|
battler.pbCureStatus(false) if battler
|
||||||
battler.pbCureConfusion if battler
|
battler.pbCureConfusion if battler
|
||||||
name = (battler) ? battler.pbThis : pokemon.name
|
name = (battler) ? battler.pbThis : pokemon.name
|
||||||
@@ -435,14 +435,14 @@ ItemHandlers::BattleUseOnPokemon.add(:FULLRESTORE,proc { |item,pokemon,battler,c
|
|||||||
ItemHandlers::BattleUseOnPokemon.add(:REVIVE,proc { |item,pokemon,battler,choices,scene|
|
ItemHandlers::BattleUseOnPokemon.add(:REVIVE,proc { |item,pokemon,battler,choices,scene|
|
||||||
pokemon.hp = pokemon.totalhp/2
|
pokemon.hp = pokemon.totalhp/2
|
||||||
pokemon.hp = 1 if pokemon.hp<=0
|
pokemon.hp = 1 if pokemon.hp<=0
|
||||||
pokemon.healStatus
|
pokemon.heal_status
|
||||||
scene.pbRefresh
|
scene.pbRefresh
|
||||||
scene.pbDisplay(_INTL("{1} recovered from fainting!",pokemon.name))
|
scene.pbDisplay(_INTL("{1} recovered from fainting!",pokemon.name))
|
||||||
})
|
})
|
||||||
|
|
||||||
ItemHandlers::BattleUseOnPokemon.add(:MAXREVIVE,proc { |item,pokemon,battler,choices,scene|
|
ItemHandlers::BattleUseOnPokemon.add(:MAXREVIVE,proc { |item,pokemon,battler,choices,scene|
|
||||||
pokemon.healHP
|
pokemon.heal_HP
|
||||||
pokemon.healStatus
|
pokemon.heal_status
|
||||||
scene.pbRefresh
|
scene.pbRefresh
|
||||||
scene.pbDisplay(_INTL("{1} recovered from fainting!",pokemon.name))
|
scene.pbDisplay(_INTL("{1} recovered from fainting!",pokemon.name))
|
||||||
})
|
})
|
||||||
@@ -460,7 +460,7 @@ ItemHandlers::BattleUseOnPokemon.add(:ENERGYROOT,proc { |item,pokemon,battler,ch
|
|||||||
})
|
})
|
||||||
|
|
||||||
ItemHandlers::BattleUseOnPokemon.add(:HEALPOWDER,proc { |item,pokemon,battler,choices,scene|
|
ItemHandlers::BattleUseOnPokemon.add(:HEALPOWDER,proc { |item,pokemon,battler,choices,scene|
|
||||||
pokemon.healStatus
|
pokemon.heal_status
|
||||||
battler.pbCureStatus(false) if battler
|
battler.pbCureStatus(false) if battler
|
||||||
battler.pbCureConfusion if battler
|
battler.pbCureConfusion if battler
|
||||||
pokemon.changeHappiness("powder")
|
pokemon.changeHappiness("powder")
|
||||||
@@ -470,8 +470,8 @@ ItemHandlers::BattleUseOnPokemon.add(:HEALPOWDER,proc { |item,pokemon,battler,ch
|
|||||||
})
|
})
|
||||||
|
|
||||||
ItemHandlers::BattleUseOnPokemon.add(:REVIVALHERB,proc { |item,pokemon,battler,choices,scene|
|
ItemHandlers::BattleUseOnPokemon.add(:REVIVALHERB,proc { |item,pokemon,battler,choices,scene|
|
||||||
pokemon.healHP
|
pokemon.heal_HP
|
||||||
pokemon.healStatus
|
pokemon.heal_status
|
||||||
pokemon.changeHappiness("revivalherb")
|
pokemon.changeHappiness("revivalherb")
|
||||||
scene.pbRefresh
|
scene.pbRefresh
|
||||||
scene.pbDisplay(_INTL("{1} recovered from fainting!",pokemon.name))
|
scene.pbDisplay(_INTL("{1} recovered from fainting!",pokemon.name))
|
||||||
|
|||||||
@@ -19,6 +19,9 @@ class PokemonMail
|
|||||||
attr_reader :item, :message, :sender, :poke1, :poke2, :poke3
|
attr_reader :item, :message, :sender, :poke1, :poke2, :poke3
|
||||||
|
|
||||||
def self.copy(mail)
|
def self.copy(mail)
|
||||||
|
item.poke1[0] = GameData::Species.get(item.poke1[0]).id if item.poke1
|
||||||
|
item.poke2[0] = GameData::Species.get(item.poke2[0]).id if item.poke2
|
||||||
|
item.poke3[0] = GameData::Species.get(item.poke3[0]).id if item.poke3
|
||||||
return Mail.new(mail.item, item.message, item.sender, item.poke1, item.poke2, item.poke3)
|
return Mail.new(mail.item, item.message, item.sender, item.poke1, item.poke2, item.poke3)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -155,6 +155,20 @@ MultipleForms.register(:CASTFORM,{
|
|||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
|
MultipleForms.register(:GROUDON,{
|
||||||
|
"getPrimalForm" => proc { |pkmn|
|
||||||
|
next 1 if pkmn.hasItem?(:REDORB)
|
||||||
|
next
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
|
MultipleForms.register(:KYOGRE,{
|
||||||
|
"getPrimalForm" => proc { |pkmn|
|
||||||
|
next 1 if pkmn.hasItem?(:BLUEORB)
|
||||||
|
next
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
MultipleForms.register(:BURMY,{
|
MultipleForms.register(:BURMY,{
|
||||||
"getFormOnCreation" => proc { |pkmn|
|
"getFormOnCreation" => proc { |pkmn|
|
||||||
case pbGetEnvironment
|
case pbGetEnvironment
|
||||||
@@ -217,9 +231,9 @@ MultipleForms.register(:ROTOM,{
|
|||||||
# Turned back into the base form; forget form-specific moves
|
# Turned back into the base form; forget form-specific moves
|
||||||
if move_index >= 0
|
if move_index >= 0
|
||||||
move_name = pkmn.moves[move_index].name
|
move_name = pkmn.moves[move_index].name
|
||||||
pkmn.pbDeleteMoveAtIndex(move_index)
|
pkmn.forget_move_at_index(move_index)
|
||||||
pbMessage(_INTL("{1} forgot {2}...", pkmn.name, move_name))
|
pbMessage(_INTL("{1} forgot {2}...", pkmn.name, move_name))
|
||||||
pkmn.pbLearnMove(:THUNDERSHOCK) if pkmn.numMoves == 0
|
pkmn.learn_move(:THUNDERSHOCK) if pkmn.numMoves == 0
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
# Turned into an alternate form; try learning that form's unique move
|
# Turned into an alternate form; try learning that form's unique move
|
||||||
@@ -234,9 +248,9 @@ MultipleForms.register(:ROTOM,{
|
|||||||
pbMessage(_INTL("{1} forgot how to use {2}.\\nAnd...\1", pkmn.name, old_move_name))
|
pbMessage(_INTL("{1} forgot how to use {2}.\\nAnd...\1", pkmn.name, old_move_name))
|
||||||
pbMessage(_INTL("\\se[]{1} learned {2}!\\se[Pkmn move learnt]", pkmn.name, new_move_name))
|
pbMessage(_INTL("\\se[]{1} learned {2}!\\se[Pkmn move learnt]", pkmn.name, new_move_name))
|
||||||
else
|
else
|
||||||
pkmn.pbDeleteMoveAtIndex(move_index)
|
pkmn.forget_move_at_index(move_index)
|
||||||
pbMessage(_INTL("{1} forgot {2}...", pkmn.name, old_move_name))
|
pbMessage(_INTL("{1} forgot {2}...", pkmn.name, old_move_name))
|
||||||
pkmn.pbLearnMove(:THUNDERSHOCK) if pkmn.numMoves == 0
|
pkmn.learn_move(:THUNDERSHOCK) if pkmn.numMoves == 0
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
# Just try to learn this form's unique move
|
# Just try to learn this form's unique move
|
||||||
@@ -397,12 +411,13 @@ MultipleForms.copy(:FLABEBE,:FLOETTE,:FLORGES)
|
|||||||
|
|
||||||
MultipleForms.register(:FURFROU,{
|
MultipleForms.register(:FURFROU,{
|
||||||
"getForm" => proc { |pkmn|
|
"getForm" => proc { |pkmn|
|
||||||
if !pkmn.formTime || pbGetTimeNow.to_i>pkmn.formTime.to_i+60*60*24*5 # 5 days
|
if !pkmn.time_form_set ||
|
||||||
|
pbGetTimeNow.to_i > pkmn.time_form_set.to_i + 60 * 60 * 24 * 5 # 5 days
|
||||||
next 0
|
next 0
|
||||||
end
|
end
|
||||||
},
|
},
|
||||||
"onSetForm" => proc { |pkmn,form,oldForm|
|
"onSetForm" => proc { |pkmn,form,oldForm|
|
||||||
pkmn.formTime = (form>0) ? pbGetTimeNow.to_i : nil
|
pkmn.time_form_set = (form > 0) ? pbGetTimeNow.to_i : nil
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
@@ -450,12 +465,13 @@ MultipleForms.register(:ZYGARDE,{
|
|||||||
|
|
||||||
MultipleForms.register(:HOOPA,{
|
MultipleForms.register(:HOOPA,{
|
||||||
"getForm" => proc { |pkmn|
|
"getForm" => proc { |pkmn|
|
||||||
if !pkmn.formTime || pbGetTimeNow.to_i>pkmn.formTime.to_i+60*60*24*3 # 3 days
|
if !pkmn.time_form_set ||
|
||||||
|
pbGetTimeNow.to_i > pkmn.time_form_set.to_i + 60 * 60 * 24 * 3 # 3 days
|
||||||
next 0
|
next 0
|
||||||
end
|
end
|
||||||
},
|
},
|
||||||
"onSetForm" => proc { |pkmn,form,oldForm|
|
"onSetForm" => proc { |pkmn,form,oldForm|
|
||||||
pkmn.formTime = (form>0) ? pbGetTimeNow.to_i : nil
|
pkmn.time_form_set = (form>0) ? pbGetTimeNow.to_i : nil
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
@@ -467,7 +483,7 @@ MultipleForms.register(:ORICORIO,{
|
|||||||
|
|
||||||
MultipleForms.register(:ROCKRUFF,{
|
MultipleForms.register(:ROCKRUFF,{
|
||||||
"getForm" => proc { |pkmn|
|
"getForm" => proc { |pkmn|
|
||||||
next if pkmn.formSimple>=2 # Own Tempo Rockruff cannot become another form
|
next if pkmn.form_simple >= 2 # Own Tempo Rockruff cannot become another form
|
||||||
next 1 if PBDayNight.isNight?
|
next 1 if PBDayNight.isNight?
|
||||||
next 0
|
next 0
|
||||||
}
|
}
|
||||||
@@ -561,9 +577,9 @@ MultipleForms.register(:NECROZMA,{
|
|||||||
end
|
end
|
||||||
if move_index >= 0
|
if move_index >= 0
|
||||||
move_name = pkmn.moves[move_index].name
|
move_name = pkmn.moves[move_index].name
|
||||||
pkmn.pbDeleteMoveAtIndex(move_index)
|
pkmn.forget_move_at_index(move_index)
|
||||||
pbMessage(_INTL("{1} forgot {2}...", pkmn.name, move_name))
|
pbMessage(_INTL("{1} forgot {2}...", pkmn.name, move_name))
|
||||||
pkmn.pbLearnMove(:CONFUSION) if pkmn.numMoves == 0
|
pkmn.learn_move(:CONFUSION) if pkmn.numMoves == 0
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
# Turned into an alternate form; try learning that form's unique move
|
# Turned into an alternate form; try learning that form's unique move
|
||||||
@@ -581,7 +597,7 @@ MultipleForms.register(:NECROZMA,{
|
|||||||
# evolve into different forms depending on the location where they evolved.
|
# evolve into different forms depending on the location where they evolved.
|
||||||
MultipleForms.register(:PIKACHU, {
|
MultipleForms.register(:PIKACHU, {
|
||||||
"getForm" => proc { |pkmn|
|
"getForm" => proc { |pkmn|
|
||||||
next if pkmn.formSimple >= 2
|
next if pkmn.form_simple >= 2
|
||||||
map_metadata = GameData::MapMetadata.try_get($game_map.map_id)
|
map_metadata = GameData::MapMetadata.try_get($game_map.map_id)
|
||||||
next 1 if map_metadata && map_metadata.town_map_position &&
|
next 1 if map_metadata && map_metadata.town_map_position &&
|
||||||
map_metadata.town_map_position[0] == 1 # Tiall region
|
map_metadata.town_map_position[0] == 1 # Tiall region
|
||||||
@@ -16,80 +16,44 @@ critical hit.
|
|||||||
#===============================================================================
|
#===============================================================================
|
||||||
# Purify a Shadow Pokémon.
|
# Purify a Shadow Pokémon.
|
||||||
#===============================================================================
|
#===============================================================================
|
||||||
def pbPurify(pokemon,scene)
|
def pbPurify(pkmn, scene)
|
||||||
return if pokemon.heartgauge!=0 || !pokemon.shadow
|
return if !pkmn.shadowPokemon? || pkmn.heart_gauge != 0
|
||||||
return if !pokemon.savedev && !pokemon.savedexp
|
pkmn.shadow = false
|
||||||
pokemon.shadow = false
|
pkmn.giveRibbon(PBRibbons::NATIONAL)
|
||||||
pokemon.giveRibbon(PBRibbons::NATIONAL)
|
scene.pbDisplay(_INTL("{1} opened the door to its heart!", pkmn.name))
|
||||||
scene.pbDisplay(_INTL("{1} opened the door to its heart!",pokemon.name))
|
|
||||||
old_moves = []
|
old_moves = []
|
||||||
pokemon.moves.each { |m| old_moves.push(m.id) }
|
pkmn.moves.each { |m| old_moves.push(m.id) }
|
||||||
pokemon.pbUpdateShadowMoves
|
pkmn.update_shadow_moves
|
||||||
pokemon.moves.each_with_index do |m, i|
|
pkmn.moves.each_with_index do |m, i|
|
||||||
next if m == old_moves[i]
|
next if m.id == old_moves[i]
|
||||||
scene.pbDisplay(_INTL("{1} regained the move {2}!", pokemon.name, m.name))
|
scene.pbDisplay(_INTL("{1} regained the move {2}!", pkmn.name, m.name))
|
||||||
end
|
end
|
||||||
pokemon.pbRecordFirstMoves
|
pkmn.record_first_moves
|
||||||
if pokemon.savedev
|
if pkmn.saved_ev
|
||||||
for i in 0...6
|
pkmn.add_evs(pkmn.saved_ev)
|
||||||
pbApplyEVGain(pokemon,i,pokemon.savedev[i])
|
pkmn.saved_ev = nil
|
||||||
|
end
|
||||||
|
if pkmn.saved_exp
|
||||||
|
newexp = PBExperience.pbAddExperience(pkmn.exp, pkmn.saved_exp || 0, pkmn.growth_rate)
|
||||||
|
pkmn.saved_exp = nil
|
||||||
|
newlevel = PBExperience.pbGetLevelFromExperience(newexp, pkmn.growth_rate)
|
||||||
|
curlevel = pkmn.level
|
||||||
|
if newexp != pkmn.exp
|
||||||
|
scene.pbDisplay(_INTL("{1} regained {2} Exp. Points!", pkmn.name, newexp - pkmn.exp))
|
||||||
end
|
end
|
||||||
pokemon.savedev = nil
|
if newlevel == curlevel
|
||||||
end
|
pkmn.exp = newexp
|
||||||
newexp = PBExperience.pbAddExperience(pokemon.exp,pokemon.savedexp||0,pokemon.growth_rate)
|
pkmn.calcStats
|
||||||
pokemon.savedexp = nil
|
else
|
||||||
newlevel = PBExperience.pbGetLevelFromExperience(newexp,pokemon.growth_rate)
|
pbChangeLevel(pkmn, newlevel, scene) # for convenience
|
||||||
curlevel = pokemon.level
|
pkmn.exp = newexp
|
||||||
if newexp!=pokemon.exp
|
|
||||||
scene.pbDisplay(_INTL("{1} regained {2} Exp. Points!",pokemon.name,newexp-pokemon.exp))
|
|
||||||
end
|
|
||||||
if newlevel==curlevel
|
|
||||||
pokemon.exp = newexp
|
|
||||||
pokemon.calcStats
|
|
||||||
else
|
|
||||||
pbChangeLevel(pokemon,newlevel,scene) # for convenience
|
|
||||||
pokemon.exp = newexp
|
|
||||||
end
|
|
||||||
if scene.pbConfirm(_INTL("Would you like to give a nickname to {1}?", pokemon.speciesName))
|
|
||||||
newname = pbEnterPokemonName(_INTL("{1}'s nickname?", pokemon.speciesName),
|
|
||||||
0, Pokemon::MAX_NAME_SIZE, "", pokemon)
|
|
||||||
pokemon.name = newname
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
def pbApplyEVGain(pokemon,ev,evgain)
|
|
||||||
totalev = 0
|
|
||||||
for i in 0...6
|
|
||||||
totalev += pokemon.ev[i]
|
|
||||||
end
|
|
||||||
if totalev+evgain>Pokemon::EV_LIMIT # Can't exceed overall limit
|
|
||||||
evgain -= totalev+evgain-Pokemon::EV_LIMIT
|
|
||||||
end
|
|
||||||
if pokemon.ev[ev]+evgain>Pokemon::EV_STAT_LIMIT
|
|
||||||
evgain -= totalev+evgain-Pokemon::EV_STAT_LIMIT
|
|
||||||
end
|
|
||||||
if evgain>0
|
|
||||||
pokemon.ev[ev] += evgain
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
def pbReplaceMoves(pkmn, new_moves)
|
|
||||||
return if !pkmn
|
|
||||||
new_moves.each do |move|
|
|
||||||
next if !move || pkmn.hasMove?(move)
|
|
||||||
# Find a move slot to put move into
|
|
||||||
for i in 0...Pokemon::MAX_MOVES
|
|
||||||
if i >= pkmn.numMoves
|
|
||||||
# Empty slot; add the new move there
|
|
||||||
pkmn.pbLearnMove(move)
|
|
||||||
break
|
|
||||||
elsif !new_moves.include?(pkmn.moves[i].id)
|
|
||||||
# Known move that isn't a move to be relearned; replace it
|
|
||||||
pkmn.moves[i].id = move
|
|
||||||
break
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
if scene.pbConfirm(_INTL("Would you like to give a nickname to {1}?", pkmn.speciesName))
|
||||||
|
newname = pbEnterPokemonName(_INTL("{1}'s nickname?", pkmn.speciesName),
|
||||||
|
0, Pokemon::MAX_NAME_SIZE, "", pkmn)
|
||||||
|
pkmn.name = newname
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
@@ -182,164 +146,21 @@ end
|
|||||||
#===============================================================================
|
#===============================================================================
|
||||||
#
|
#
|
||||||
#===============================================================================
|
#===============================================================================
|
||||||
def pbIsPurifiable?(pkmn)
|
|
||||||
return false if !pkmn
|
|
||||||
return false if pkmn.isSpecies?(:LUGIA)
|
|
||||||
return false if !pkmn.shadowPokemon? || pkmn.heartgauge>0
|
|
||||||
return true
|
|
||||||
end
|
|
||||||
|
|
||||||
def pbHasPurifiableInParty?
|
|
||||||
return $Trainer.party.any? { |pkmn| pbIsPurifiable?(pkmn) }
|
|
||||||
end
|
|
||||||
|
|
||||||
def pbRelicStone
|
def pbRelicStone
|
||||||
if !pbHasPurifiableInParty?
|
if !$Trainer.party.any? { |pkmn| pkmn.purifiable? }
|
||||||
pbMessage(_INTL("You have no Pokémon that can be purified."))
|
pbMessage(_INTL("You have no Pokémon that can be purified."))
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
pbMessage(_INTL("There's a Pokémon that may open the door to its heart!"))
|
pbMessage(_INTL("There's a Pokémon that may open the door to its heart!"))
|
||||||
# Choose a purifiable Pokemon
|
# Choose a purifiable Pokemon
|
||||||
pbChoosePokemon(1,2,proc { |pkmn|
|
pbChoosePokemon(1, 2,proc { |pkmn|
|
||||||
!pkmn.egg? && pkmn.hp>0 && pkmn.shadowPokemon? && pkmn.heartgauge==0
|
pkmn.able? && pkmn.shadowPokemon? && pkmn.heart_gauge == 0
|
||||||
})
|
})
|
||||||
if $game_variables[1]>=0
|
if $game_variables[1] >= 0
|
||||||
pbRelicStoneScreen($Trainer.party[$game_variables[1]])
|
pbRelicStoneScreen($Trainer.party[$game_variables[1]])
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
def pbReadyToPurify(pkmn)
|
|
||||||
return unless pkmn && pkmn.shadowPokemon?
|
|
||||||
pkmn.pbUpdateShadowMoves
|
|
||||||
if pkmn.heartgauge==0
|
|
||||||
pbMessage(_INTL("{1} can now be purified!",pkmn.name))
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#===============================================================================
|
|
||||||
# Pokémon class.
|
|
||||||
#===============================================================================
|
|
||||||
class Pokemon
|
|
||||||
attr_writer :heartgauge
|
|
||||||
attr_accessor :shadow
|
|
||||||
attr_writer :hypermode
|
|
||||||
attr_accessor :savedev
|
|
||||||
attr_accessor :savedexp
|
|
||||||
attr_accessor :shadowmoves
|
|
||||||
attr_accessor :shadowmovenum
|
|
||||||
HEARTGAUGESIZE = 3840
|
|
||||||
|
|
||||||
alias :__shadow_expeq :exp=
|
|
||||||
def exp=(value)
|
|
||||||
if shadowPokemon?
|
|
||||||
@savedexp += value-self.exp
|
|
||||||
else
|
|
||||||
__shadow_expeq(value)
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
alias :__shadow_hpeq :hp=
|
|
||||||
def hp=(value)
|
|
||||||
__shadow_hpeq(value)
|
|
||||||
@hypermode = false if value<=0
|
|
||||||
end
|
|
||||||
|
|
||||||
def hypermode
|
|
||||||
return (self.heartgauge==0 || self.hp==0) ? false : @hypermode
|
|
||||||
end
|
|
||||||
|
|
||||||
def heartgauge
|
|
||||||
return @heartgauge || 0
|
|
||||||
end
|
|
||||||
|
|
||||||
def heartStage
|
|
||||||
return 0 if !@shadow
|
|
||||||
hg = HEARTGAUGESIZE/5.0
|
|
||||||
return ([self.heartgauge,HEARTGAUGESIZE].min/hg).ceil
|
|
||||||
end
|
|
||||||
|
|
||||||
def adjustHeart(value)
|
|
||||||
return if !@shadow
|
|
||||||
@heartgauge = 0 if !@heartgauge
|
|
||||||
@heartgauge += value
|
|
||||||
@heartgauge = HEARTGAUGESIZE if @heartgauge>HEARTGAUGESIZE
|
|
||||||
@heartgauge = 0 if @heartgauge<0
|
|
||||||
end
|
|
||||||
|
|
||||||
def shadowPokemon?
|
|
||||||
return @shadow && @heartgauge && @heartgauge>=0
|
|
||||||
end
|
|
||||||
alias :isShadow? :shadowPokemon?
|
|
||||||
|
|
||||||
def makeShadow
|
|
||||||
self.shadow = true
|
|
||||||
self.heartgauge = HEARTGAUGESIZE
|
|
||||||
self.savedexp = 0
|
|
||||||
self.savedev = [0,0,0,0,0,0]
|
|
||||||
self.shadowmoves = []
|
|
||||||
# Retrieve Shadow moveset for this Pokémon
|
|
||||||
shadow_moveset = pbLoadShadowMovesets[species_data.id]
|
|
||||||
shadow_moveset = pbLoadShadowMovesets[@species] if !shadow_moveset || shadow_moveset.length == 0
|
|
||||||
# Record this Pokémon's Shadow moves
|
|
||||||
if shadow_moveset && shadow_moveset.length > 0
|
|
||||||
for i in 0...[shadow_moveset.length, MAX_MOVES].min
|
|
||||||
self.shadowmoves[i] = shadow_moveset[i]
|
|
||||||
end
|
|
||||||
self.shadowmovenum = shadow_moveset.length
|
|
||||||
else
|
|
||||||
# No Shadow moveset defined; just use Shadow Rush
|
|
||||||
self.shadowmoves[0] = :SHADOWRUSH if GameData::Move.exists?(:SHADOWRUSH)
|
|
||||||
self.shadowmovenum = 1
|
|
||||||
end
|
|
||||||
# Record this Pokémon's original moves
|
|
||||||
@moves.each_with_index { |m, i| self.shadowmoves[MAX_MOVES + i] = m.id }
|
|
||||||
# Update moves
|
|
||||||
pbUpdateShadowMoves
|
|
||||||
end
|
|
||||||
|
|
||||||
def pbUpdateShadowMoves(relearn_all_moves = false)
|
|
||||||
return if !@shadowmoves
|
|
||||||
# Not a Shadow Pokémon (any more); relearn all its original moves
|
|
||||||
if !@shadow
|
|
||||||
if @shadowmoves.length > MAX_MOVES
|
|
||||||
new_moves = []
|
|
||||||
@shadowmoves.each_with_index { |m, i| new_moves.push(m) if m && i >= MAX_MOVES }
|
|
||||||
pbReplaceMoves(self, new_moves)
|
|
||||||
end
|
|
||||||
@shadowmoves = nil
|
|
||||||
return
|
|
||||||
end
|
|
||||||
# Is a Shadow Pokémon; ensure it knows the appropriate moves depending on its heart stage
|
|
||||||
m = @shadowmoves
|
|
||||||
# Start with all Shadow moves
|
|
||||||
new_moves = []
|
|
||||||
@shadowmoves.each_with_index { |m, i| new_moves.push(m) if m && i < MAX_MOVES }
|
|
||||||
# Add some original moves (skipping ones in the same slot as a Shadow Move)
|
|
||||||
num_original_moves = (relearn_all_moves) ? 3 : [3, 3, 2, 1, 1, 0][self.heartStage]
|
|
||||||
if num_original_moves > 0
|
|
||||||
relearned_count = 0
|
|
||||||
@shadowmoves.each_with_index do |m, i|
|
|
||||||
next if !m || i < MAX_MOVES + @shadowmovenum
|
|
||||||
new_moves.push(m)
|
|
||||||
relearned_count += 1
|
|
||||||
break if relearned_count >= num_original_moves
|
|
||||||
end
|
|
||||||
end
|
|
||||||
# Relearn Shadow moves plus some original moves (may not change anything)
|
|
||||||
pbReplaceMoves(self, new_moves)
|
|
||||||
end
|
|
||||||
|
|
||||||
alias :__shadow_clone :clone
|
|
||||||
def clone
|
|
||||||
ret = __shadow_clone
|
|
||||||
ret.savedev = self.savedev.clone if self.savedev
|
|
||||||
ret.shadowmoves = self.shadowmoves.clone if self.shadowmoves
|
|
||||||
return ret
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#===============================================================================
|
#===============================================================================
|
||||||
@@ -350,7 +171,7 @@ class PokeBattle_Battle
|
|||||||
|
|
||||||
def pbCanUseItemOnPokemon?(item,pkmn,battler,scene,showMessages=true)
|
def pbCanUseItemOnPokemon?(item,pkmn,battler,scene,showMessages=true)
|
||||||
ret = __shadow__pbCanUseItemOnPokemon?(item,pkmn,battler,scene,showMessages)
|
ret = __shadow__pbCanUseItemOnPokemon?(item,pkmn,battler,scene,showMessages)
|
||||||
if ret && pkmn.hypermode && ![:JOYSCENT, :EXCITESCENT, :VIVIDSCENT].include?(item)
|
if ret && pkmn.hyper_mode && ![:JOYSCENT, :EXCITESCENT, :VIVIDSCENT].include?(item)
|
||||||
scene.pbDisplay(_INTL("This item can't be used on that Pokémon."))
|
scene.pbDisplay(_INTL("This item can't be used on that Pokémon."))
|
||||||
return false
|
return false
|
||||||
end
|
end
|
||||||
@@ -366,7 +187,7 @@ class PokeBattle_Battler
|
|||||||
def pbInitPokemon(*arg)
|
def pbInitPokemon(*arg)
|
||||||
if self.pokemonIndex>0 && inHyperMode?
|
if self.pokemonIndex>0 && inHyperMode?
|
||||||
# Called out of Hyper Mode
|
# Called out of Hyper Mode
|
||||||
self.pokemon.hypermode = false
|
self.pokemon.hyper_mode = false
|
||||||
self.pokemon.adjustHeart(-50)
|
self.pokemon.adjustHeart(-50)
|
||||||
end
|
end
|
||||||
__shadow__pbInitPokemon(*arg)
|
__shadow__pbInitPokemon(*arg)
|
||||||
@@ -382,21 +203,21 @@ class PokeBattle_Battler
|
|||||||
|
|
||||||
def shadowPokemon?
|
def shadowPokemon?
|
||||||
p = self.pokemon
|
p = self.pokemon
|
||||||
return p && p.respond_to?("shadowPokemon?") && p.shadowPokemon?
|
return p && p.shadowPokemon?
|
||||||
end
|
end
|
||||||
alias isShadow? shadowPokemon?
|
alias isShadow? shadowPokemon?
|
||||||
|
|
||||||
def inHyperMode?
|
def inHyperMode?
|
||||||
return false if fainted?
|
return false if fainted?
|
||||||
p = self.pokemon
|
p = self.pokemon
|
||||||
return p && p.respond_to?("hypermode") && p.hypermode
|
return p && p.hyper_mode
|
||||||
end
|
end
|
||||||
|
|
||||||
def pbHyperMode
|
def pbHyperMode
|
||||||
return if fainted? || !shadowPokemon? || inHyperMode?
|
return if fainted? || !shadowPokemon? || inHyperMode?
|
||||||
p = self.pokemon
|
p = self.pokemon
|
||||||
if @battle.pbRandom(p.heartgauge)<=Pokemon::HEARTGAUGESIZE/4
|
if @battle.pbRandom(p.heart_gauge) <= Pokemon::HEART_GAUGE_SIZE / 4
|
||||||
p.hypermode = true
|
p.hyper_mode = true
|
||||||
@battle.pbDisplay(_INTL("{1}'s emotions rose to a fever pitch!\nIt entered Hyper Mode!",self.pbThis))
|
@battle.pbDisplay(_INTL("{1}'s emotions rose to a fever pitch!\nIt entered Hyper Mode!",self.pbThis))
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
@@ -413,30 +234,27 @@ end
|
|||||||
#===============================================================================
|
#===============================================================================
|
||||||
# Shadow item effects.
|
# Shadow item effects.
|
||||||
#===============================================================================
|
#===============================================================================
|
||||||
def pbRaiseHappinessAndReduceHeart(pokemon,scene,amount)
|
def pbRaiseHappinessAndReduceHeart(pkmn, scene, heart_amount)
|
||||||
if !pokemon.shadowPokemon?
|
if !pkmn.shadowPokemon? || (pkmn.happiness == 255 && pkmn.heart_gauge == 0)
|
||||||
scene.pbDisplay(_INTL("It won't have any effect."))
|
scene.pbDisplay(_INTL("It won't have any effect."))
|
||||||
return false
|
return false
|
||||||
end
|
end
|
||||||
if pokemon.happiness==255 && pokemon.heartgauge==0
|
if pkmn.happiness == 255
|
||||||
scene.pbDisplay(_INTL("It won't have any effect."))
|
stage = pkmn.heart_gauge
|
||||||
return false
|
pkmn.adjustHeart(-heart_amount)
|
||||||
elsif pokemon.happiness==255
|
scene.pbDisplay(_INTL("{1} adores you!\nThe door to its heart opened a little.", pkmn.name))
|
||||||
pokemon.adjustHeart(-amount)
|
pkmn.check_ready_to_purify if pkmn.heart_gauge != stage
|
||||||
scene.pbDisplay(_INTL("{1} adores you!\nThe door to its heart opened a little.",pokemon.name))
|
elsif pkmn.heart_gauge == 0
|
||||||
pbReadyToPurify(pokemon)
|
pkmn.changeHappiness("vitamin")
|
||||||
return true
|
scene.pbDisplay(_INTL("{1} turned friendly.", pkmn.name))
|
||||||
elsif pokemon.heartgauge==0
|
|
||||||
pokemon.changeHappiness("vitamin")
|
|
||||||
scene.pbDisplay(_INTL("{1} turned friendly.",pokemon.name))
|
|
||||||
return true
|
|
||||||
else
|
else
|
||||||
pokemon.changeHappiness("vitamin")
|
stage = pkmn.heart_gauge
|
||||||
pokemon.adjustHeart(-amount)
|
pkmn.changeHappiness("vitamin")
|
||||||
scene.pbDisplay(_INTL("{1} turned friendly.\nThe door to its heart opened a little.",pokemon.name))
|
pkmn.adjustHeart(-heart_amount)
|
||||||
pbReadyToPurify(pokemon)
|
scene.pbDisplay(_INTL("{1} turned friendly.\nThe door to its heart opened a little.", pkmn.name))
|
||||||
return true
|
pkmn.check_ready_to_purify if pkmn.heart_gauge != stage
|
||||||
end
|
end
|
||||||
|
return true
|
||||||
end
|
end
|
||||||
|
|
||||||
ItemHandlers::UseOnPokemon.add(:JOYSCENT,proc { |item,pokemon,scene|
|
ItemHandlers::UseOnPokemon.add(:JOYSCENT,proc { |item,pokemon,scene|
|
||||||
@@ -452,12 +270,12 @@ ItemHandlers::UseOnPokemon.add(:VIVIDSCENT,proc { |item,pokemon,scene|
|
|||||||
})
|
})
|
||||||
|
|
||||||
ItemHandlers::UseOnPokemon.add(:TIMEFLUTE,proc { |item,pokemon,scene|
|
ItemHandlers::UseOnPokemon.add(:TIMEFLUTE,proc { |item,pokemon,scene|
|
||||||
if !pokemon.shadowPokemon?
|
if !pokemon.shadowPokemon? || pokemon.heart_gauge == 0
|
||||||
scene.pbDisplay(_INTL("It won't have any effect."))
|
scene.pbDisplay(_INTL("It won't have any effect."))
|
||||||
next false
|
next false
|
||||||
end
|
end
|
||||||
pokemon.heartgauge = 0
|
pokemon.heart_gauge = 0
|
||||||
pbReadyToPurify(pokemon)
|
pokemon.check_ready_to_purify
|
||||||
next true
|
next true
|
||||||
})
|
})
|
||||||
|
|
||||||
@@ -472,22 +290,22 @@ ItemHandlers::CanUseInBattle.add(:JOYSCENT,proc { |item,pokemon,battler,move,fir
|
|||||||
ItemHandlers::CanUseInBattle.copy(:JOYSCENT,:EXCITESCENT,:VIVIDSCENT)
|
ItemHandlers::CanUseInBattle.copy(:JOYSCENT,:EXCITESCENT,:VIVIDSCENT)
|
||||||
|
|
||||||
ItemHandlers::BattleUseOnBattler.add(:JOYSCENT,proc { |item,battler,scene|
|
ItemHandlers::BattleUseOnBattler.add(:JOYSCENT,proc { |item,battler,scene|
|
||||||
battler.pokemon.hypermode = false
|
battler.pokemon.hyper_mode = false
|
||||||
battler.pokemon.adjustHeart(-500)
|
battler.pokemon.adjustHeart(-100)
|
||||||
scene.pbDisplay(_INTL("{1} came to its senses from the {2}!",battler.pbThis,GameData::Item.get(item).name))
|
scene.pbDisplay(_INTL("{1} came to its senses from the {2}!",battler.pbThis,GameData::Item.get(item).name))
|
||||||
next true
|
next true
|
||||||
})
|
})
|
||||||
|
|
||||||
ItemHandlers::BattleUseOnBattler.add(:EXCITESCENT,proc { |item,battler,scene|
|
ItemHandlers::BattleUseOnBattler.add(:EXCITESCENT,proc { |item,battler,scene|
|
||||||
battler.pokemon.hypermode = false
|
battler.pokemon.hyper_mode = false
|
||||||
battler.pokemon.adjustHeart(-1000)
|
battler.pokemon.adjustHeart(-200)
|
||||||
scene.pbDisplay(_INTL("{1} came to its senses from the {2}!",battler.pbThis,GameData::Item.get(item).name))
|
scene.pbDisplay(_INTL("{1} came to its senses from the {2}!",battler.pbThis,GameData::Item.get(item).name))
|
||||||
next true
|
next true
|
||||||
})
|
})
|
||||||
|
|
||||||
ItemHandlers::BattleUseOnBattler.add(:VIVIDSCENT,proc { |item,battler,scene|
|
ItemHandlers::BattleUseOnBattler.add(:VIVIDSCENT,proc { |item,battler,scene|
|
||||||
battler.pokemon.hypermode = false
|
battler.pokemon.hyper_mode = false
|
||||||
battler.pokemon.adjustHeart(-2000)
|
battler.pokemon.adjustHeart(-300)
|
||||||
scene.pbDisplay(_INTL("{1} came to its senses from the {2}!",battler.pbThis,GameData::Item.get(item).name))
|
scene.pbDisplay(_INTL("{1} came to its senses from the {2}!",battler.pbThis,GameData::Item.get(item).name))
|
||||||
next true
|
next true
|
||||||
})
|
})
|
||||||
@@ -660,35 +478,39 @@ end
|
|||||||
#
|
#
|
||||||
#===============================================================================
|
#===============================================================================
|
||||||
class PokemonTemp
|
class PokemonTemp
|
||||||
attr_accessor :heartgauges
|
attr_accessor :heart_gauges
|
||||||
end
|
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
|
||||||
Events.onStartBattle += proc { |_sender|
|
Events.onStartBattle += proc { |_sender|
|
||||||
# Record current heart gauges of Pokémon in party, to see if they drop to zero
|
$PokemonTemp.heart_gauges = []
|
||||||
# during battle and need to say they're ready to be purified afterwards
|
$Trainer.party.each_with_index do |pkmn, i|
|
||||||
$PokemonTemp.heartgauges = []
|
$PokemonTemp.heart_gauges[i] = pkmn.heart_gauge
|
||||||
for i in 0...$Trainer.party.length
|
|
||||||
$PokemonTemp.heartgauges[i] = $Trainer.party[i].heartgauge
|
|
||||||
end
|
end
|
||||||
}
|
}
|
||||||
|
|
||||||
Events.onEndBattle += proc { |_sender,_e|
|
Events.onEndBattle += proc { |_sender,_e|
|
||||||
for i in 0...$PokemonTemp.heartgauges.length
|
$PokemonTemp.heart_gauges.each_with_index do |value, i|
|
||||||
pokemon = $Trainer.party[i]
|
pkmn = $Trainer.party[i]
|
||||||
if pokemon && $PokemonTemp.heartgauges[i] &&
|
next if !pkmn || !value || value == 0
|
||||||
$PokemonTemp.heartgauges[i]!=0 && pokemon.heartgauge==0
|
pkmn.check_ready_to_purify if pkmn.heart_gauge == 0
|
||||||
pbReadyToPurify(pokemon)
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
}
|
}
|
||||||
|
|
||||||
Events.onStepTaken += proc {
|
Events.onStepTaken += proc {
|
||||||
for pkmn in $Trainer.ablePokemonParty
|
for pkmn in $Trainer.ablePokemonParty
|
||||||
if pkmn.heartgauge>0
|
next if pkmn.heart_gauge == 0
|
||||||
pkmn.adjustHeart(-1)
|
stage = pkmn.heartStage
|
||||||
pbReadyToPurify(pkmn) if pkmn.heartgauge==0
|
pkmn.adjustHeart(-1)
|
||||||
|
case pkmn.heartStage
|
||||||
|
when 0
|
||||||
|
pkmn.check_ready_to_purify
|
||||||
|
when stage
|
||||||
|
else
|
||||||
|
pkmn.update_shadow_moves
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
if ($PokemonGlobal.purifyChamber rescue nil)
|
if ($PokemonGlobal.purifyChamber rescue nil)
|
||||||
@@ -697,7 +519,8 @@ Events.onStepTaken += proc {
|
|||||||
for i in 0...2
|
for i in 0...2
|
||||||
pkmn = $PokemonGlobal.daycare[i][0]
|
pkmn = $PokemonGlobal.daycare[i][0]
|
||||||
next if !pkmn
|
next if !pkmn
|
||||||
|
stage = pkmn.heartStage
|
||||||
pkmn.adjustHeart(-1)
|
pkmn.adjustHeart(-1)
|
||||||
pkmn.pbUpdateShadowMoves
|
pkmn.update_shadow_moves if pkmn.heartStage != stage
|
||||||
end
|
end
|
||||||
}
|
}
|
||||||
@@ -189,8 +189,8 @@ class PokemonStorage
|
|||||||
else # Copying into box
|
else # Copying into box
|
||||||
pkmn = self[boxSrc,indexSrc]
|
pkmn = self[boxSrc,indexSrc]
|
||||||
raise "Trying to copy nil to storage" if !pkmn
|
raise "Trying to copy nil to storage" if !pkmn
|
||||||
pkmn.formTime = nil if pkmn.respond_to?("formTime")
|
pkmn.time_form_set = nil
|
||||||
pkmn.form = 0 if pkmn.isSpecies?(:SHAYMIN)
|
pkmn.form = 0 if pkmn.isSpecies?(:SHAYMIN)
|
||||||
pkmn.heal
|
pkmn.heal
|
||||||
self[boxDst,indexDst] = pkmn
|
self[boxDst,indexDst] = pkmn
|
||||||
end
|
end
|
||||||
@@ -212,8 +212,8 @@ class PokemonStorage
|
|||||||
for i in 0...maxPokemon(box)
|
for i in 0...maxPokemon(box)
|
||||||
if self[box,i]==nil
|
if self[box,i]==nil
|
||||||
if box>=0
|
if box>=0
|
||||||
pkmn.formTime = nil if pkmn.respond_to?("formTime") && pkmn.formTime
|
pkmn.time_form_set = nil if pkmn.time_form_set
|
||||||
pkmn.form = 0 if pkmn.isSpecies?(:SHAYMIN)
|
pkmn.form = 0 if pkmn.isSpecies?(:SHAYMIN)
|
||||||
pkmn.heal
|
pkmn.heal
|
||||||
end
|
end
|
||||||
self[box,i] = pkmn
|
self[box,i] = pkmn
|
||||||
@@ -225,8 +225,8 @@ class PokemonStorage
|
|||||||
|
|
||||||
def pbStoreCaught(pkmn)
|
def pbStoreCaught(pkmn)
|
||||||
if @currentBox>=0
|
if @currentBox>=0
|
||||||
pkmn.formTime = nil if pkmn.respond_to?("formTime")
|
pkmn.time_form_set = nil
|
||||||
pkmn.form = 0 if pkmn.isSpecies?(:SHAYMIN)
|
pkmn.form = 0 if pkmn.isSpecies?(:SHAYMIN)
|
||||||
pkmn.heal
|
pkmn.heal
|
||||||
end
|
end
|
||||||
for i in 0...maxPokemon(@currentBox)
|
for i in 0...maxPokemon(@currentBox)
|
||||||
@@ -8,14 +8,14 @@ class Pokemon
|
|||||||
# If defined, this Pokémon's form will be this value even if a MultipleForms
|
# If defined, this Pokémon's form will be this value even if a MultipleForms
|
||||||
# handler tries to say otherwise.
|
# handler tries to say otherwise.
|
||||||
# @return [Integer, nil] this Pokémon's form
|
# @return [Integer, nil] this Pokémon's form
|
||||||
attr_accessor :forcedForm
|
attr_accessor :forced_form
|
||||||
# If defined, is the time (in Integer form) when this Pokémon's form was set.
|
# If defined, is the time (in Integer form) when this Pokémon's form was set.
|
||||||
# @return [Integer, nil] the time this Pokémon's form was set
|
# @return [Integer, nil] the time this Pokémon's form was set
|
||||||
attr_accessor :formTime
|
attr_accessor :time_form_set
|
||||||
# @return [Integer] the current experience points
|
# @return [Integer] the current experience points
|
||||||
attr_reader :exp
|
attr_reader :exp
|
||||||
# @return [Integer] the number of steps until this Pokémon hatches, 0 if this Pokémon is not an egg
|
# @return [Integer] the number of steps until this Pokémon hatches, 0 if this Pokémon is not an egg
|
||||||
attr_accessor :eggsteps
|
attr_accessor :steps_to_hatch
|
||||||
# @return [Integer] the current HP
|
# @return [Integer] the current HP
|
||||||
attr_reader :hp
|
attr_reader :hp
|
||||||
# @return [Integer] this Pokémon's current status (from PBStatuses)
|
# @return [Integer] this Pokémon's current status (from PBStatuses)
|
||||||
@@ -37,7 +37,7 @@ class Pokemon
|
|||||||
# @return [Array<Pokemon::Move>] the moves known by this Pokémon
|
# @return [Array<Pokemon::Move>] the moves known by this Pokémon
|
||||||
attr_accessor :moves
|
attr_accessor :moves
|
||||||
# @return [Array<Integer>] the IDs of moves known by this Pokémon when it was obtained
|
# @return [Array<Integer>] the IDs of moves known by this Pokémon when it was obtained
|
||||||
attr_accessor :firstmoves
|
attr_accessor :first_moves
|
||||||
# @return [Array<Integer>] an array of ribbons owned by this Pokémon
|
# @return [Array<Integer>] an array of ribbons owned by this Pokémon
|
||||||
attr_accessor :ribbons
|
attr_accessor :ribbons
|
||||||
# @return [Integer] contest stats
|
# @return [Integer] contest stats
|
||||||
@@ -46,8 +46,8 @@ class Pokemon
|
|||||||
attr_accessor :pokerus
|
attr_accessor :pokerus
|
||||||
# @return [Integer] this Pokémon's current happiness (an integer between 0 and 255)
|
# @return [Integer] this Pokémon's current happiness (an integer between 0 and 255)
|
||||||
attr_accessor :happiness
|
attr_accessor :happiness
|
||||||
# @return [Integer] the type of ball used (refer to {$BallTypes} for valid types)
|
# @return [Symbol] the item ID of the Poké Ball this Pokémon is in
|
||||||
attr_accessor :ballused
|
attr_accessor :poke_ball
|
||||||
# @return [Integer] this Pokémon's markings, one bit per marking
|
# @return [Integer] this Pokémon's markings, one bit per marking
|
||||||
attr_accessor :markings
|
attr_accessor :markings
|
||||||
# @return [Array<Integer>] an array of IV values for HP, Atk, Def, Speed, Sp. Atk and Sp. Def
|
# @return [Array<Integer>] an array of IV values for HP, Atk, Def, Speed, Sp. Atk and Sp. Def
|
||||||
@@ -66,17 +66,17 @@ class Pokemon
|
|||||||
# 0 (met), 1 (as egg), 2 (traded), 4 (fateful encounter)
|
# 0 (met), 1 (as egg), 2 (traded), 4 (fateful encounter)
|
||||||
attr_accessor :obtain_method
|
attr_accessor :obtain_method
|
||||||
# @return [Integer] the ID of the map this Pokémon was obtained in
|
# @return [Integer] the ID of the map this Pokémon was obtained in
|
||||||
attr_accessor :obtainMap
|
attr_accessor :obtain_map
|
||||||
# Describes the manner this Pokémon was obtained. If left undefined,
|
# Describes the manner this Pokémon was obtained. If left undefined,
|
||||||
# the obtain map's name is used.
|
# the obtain map's name is used.
|
||||||
# @return [String] the obtain text
|
# @return [String] the obtain text
|
||||||
attr_accessor :obtainText
|
attr_accessor :obtain_text
|
||||||
# @return [Integer] the level of this Pokémon when it was obtained
|
# @return [Integer] the level of this Pokémon when it was obtained
|
||||||
attr_accessor :obtainLevel
|
attr_accessor :obtain_level
|
||||||
# If this Pokémon hatched from an egg, returns the map ID where the hatching happened.
|
# If this Pokémon hatched from an egg, returns the map ID where the hatching happened.
|
||||||
# Otherwise returns 0.
|
# Otherwise returns 0.
|
||||||
# @return [Integer] the map ID where egg was hatched (0 by default)
|
# @return [Integer] the map ID where egg was hatched (0 by default)
|
||||||
attr_accessor :hatchedMap
|
attr_accessor :hatched_map
|
||||||
# Another Pokémon which has been fused with this Pokémon (or nil if there is none).
|
# Another Pokémon which has been fused with this Pokémon (or nil if there is none).
|
||||||
# Currently only used by Kyurem, to record a fused Reshiram or Zekrom.
|
# Currently only used by Kyurem, to record a fused Reshiram or Zekrom.
|
||||||
# @return [Pokemon, nil] the Pokémon fused into this one (nil if there is none)
|
# @return [Pokemon, nil] the Pokémon fused into this one (nil if there is none)
|
||||||
@@ -96,7 +96,7 @@ class Pokemon
|
|||||||
MAX_MOVES = 4
|
MAX_MOVES = 4
|
||||||
|
|
||||||
def species_data
|
def species_data
|
||||||
return GameData::Species.get_species_form(@species, formSimple)
|
return GameData::Species.get_species_form(@species, form_simple)
|
||||||
end
|
end
|
||||||
|
|
||||||
#=============================================================================
|
#=============================================================================
|
||||||
@@ -108,11 +108,11 @@ class Pokemon
|
|||||||
def species=(species_id)
|
def species=(species_id)
|
||||||
new_species_data = GameData::Species.get(species_id)
|
new_species_data = GameData::Species.get(species_id)
|
||||||
return if @species == new_species_data.species
|
return if @species == new_species_data.species
|
||||||
@species = new_species_data.species
|
@species = new_species_data.species
|
||||||
@form = new_species_data.form if new_species_data.form != 0
|
@form = new_species_data.form if new_species_data.form != 0
|
||||||
@forcedForm = nil
|
@forced_form = nil
|
||||||
@level = nil # In case growth rate is different for the new species
|
@level = nil # In case growth rate is different for the new species
|
||||||
@ability = nil
|
@ability = nil
|
||||||
calcStats
|
calcStats
|
||||||
end
|
end
|
||||||
|
|
||||||
@@ -124,15 +124,15 @@ class Pokemon
|
|||||||
end
|
end
|
||||||
|
|
||||||
def form
|
def form
|
||||||
return @forcedForm if !@forcedForm.nil?
|
return @forced_form if !@forced_form.nil?
|
||||||
return @form if $game_temp.in_battle
|
return @form if $game_temp.in_battle
|
||||||
calc_form = MultipleForms.call("getForm", self)
|
calc_form = MultipleForms.call("getForm", self)
|
||||||
self.form = calc_form if calc_form != nil && calc_form != @form
|
self.form = calc_form if calc_form != nil && calc_form != @form
|
||||||
return @form
|
return @form
|
||||||
end
|
end
|
||||||
|
|
||||||
def formSimple
|
def form_simple
|
||||||
return @forcedForm || @form
|
return @forced_form || @form
|
||||||
end
|
end
|
||||||
|
|
||||||
def form=(value)
|
def form=(value)
|
||||||
@@ -149,7 +149,7 @@ class Pokemon
|
|||||||
self.form = value
|
self.form = value
|
||||||
end
|
end
|
||||||
|
|
||||||
def formSimple=(value)
|
def form_simple=(value)
|
||||||
@form = value
|
@form = value
|
||||||
calcStats
|
calcStats
|
||||||
end
|
end
|
||||||
@@ -184,7 +184,7 @@ class Pokemon
|
|||||||
|
|
||||||
# @return [Boolean] whether this Pokémon is an egg
|
# @return [Boolean] whether this Pokémon is an egg
|
||||||
def egg?
|
def egg?
|
||||||
return @eggsteps > 0
|
return @steps_to_hatch > 0
|
||||||
end
|
end
|
||||||
alias isEgg? egg?
|
alias isEgg? egg?
|
||||||
|
|
||||||
@@ -200,7 +200,7 @@ class Pokemon
|
|||||||
|
|
||||||
# @return [Float] a number between 0 and 1 indicating how much of the current level's
|
# @return [Float] a number between 0 and 1 indicating how much of the current level's
|
||||||
# Exp this Pokémon has
|
# Exp this Pokémon has
|
||||||
def expFraction
|
def exp_fraction
|
||||||
lvl = self.level
|
lvl = self.level
|
||||||
return 0.0 if lvl >= PBExperience.maxLevel
|
return 0.0 if lvl >= PBExperience.maxLevel
|
||||||
g_rate = growth_rate
|
g_rate = growth_rate
|
||||||
@@ -217,7 +217,7 @@ class Pokemon
|
|||||||
# @param value [Integer] new HP value
|
# @param value [Integer] new HP value
|
||||||
def hp=(value)
|
def hp=(value)
|
||||||
@hp = value.clamp(0, @totalhp)
|
@hp = value.clamp(0, @totalhp)
|
||||||
healStatus if @hp == 0
|
heal_status if @hp == 0
|
||||||
end
|
end
|
||||||
|
|
||||||
# Sets this Pokémon's status. See {PBStatuses} for all possible status effects.
|
# Sets this Pokémon's status. See {PBStatuses} for all possible status effects.
|
||||||
@@ -243,13 +243,13 @@ class Pokemon
|
|||||||
alias isFainted? fainted?
|
alias isFainted? fainted?
|
||||||
|
|
||||||
# Heals all HP of this Pokémon.
|
# Heals all HP of this Pokémon.
|
||||||
def healHP
|
def heal_HP
|
||||||
return if egg?
|
return if egg?
|
||||||
@hp = @totalhp
|
@hp = @totalhp
|
||||||
end
|
end
|
||||||
|
|
||||||
# Heals the status problem of this Pokémon.
|
# Heals the status problem of this Pokémon.
|
||||||
def healStatus
|
def heal_status
|
||||||
return if egg?
|
return if egg?
|
||||||
@status = PBStatuses::NONE
|
@status = PBStatuses::NONE
|
||||||
@statusCount = 0
|
@statusCount = 0
|
||||||
@@ -259,7 +259,7 @@ class Pokemon
|
|||||||
# of the move in that index.
|
# of the move in that index.
|
||||||
# @param move_index [Integer] index of the move to heal (-1 if all moves
|
# @param move_index [Integer] index of the move to heal (-1 if all moves
|
||||||
# should be healed)
|
# should be healed)
|
||||||
def healPP(move_index = -1)
|
def heal_PP(move_index = -1)
|
||||||
return if egg?
|
return if egg?
|
||||||
if move_index >= 0
|
if move_index >= 0
|
||||||
@moves[move_index].pp = @moves[move_index].total_pp
|
@moves[move_index].pp = @moves[move_index].total_pp
|
||||||
@@ -271,9 +271,9 @@ class Pokemon
|
|||||||
# Heals all HP, PP, and status problems of this Pokémon.
|
# Heals all HP, PP, and status problems of this Pokémon.
|
||||||
def heal
|
def heal
|
||||||
return if egg?
|
return if egg?
|
||||||
healHP
|
heal_HP
|
||||||
healStatus
|
heal_status
|
||||||
healPP
|
heal_PP
|
||||||
end
|
end
|
||||||
|
|
||||||
#=============================================================================
|
#=============================================================================
|
||||||
@@ -572,7 +572,7 @@ class Pokemon
|
|||||||
|
|
||||||
# Silently learns the given move. Will erase the first known move if it has to.
|
# Silently learns the given move. Will erase the first known move if it has to.
|
||||||
# @param move_id [Integer, Symbol, String] ID of the move to learn
|
# @param move_id [Integer, Symbol, String] ID of the move to learn
|
||||||
def pbLearnMove(move_id)
|
def learn_move(move_id)
|
||||||
move_data = GameData::Move.try_get(move_id)
|
move_data = GameData::Move.try_get(move_id)
|
||||||
return if !move_data
|
return if !move_data
|
||||||
# Check if self already knows the move; if so, move it to the end of the array
|
# Check if self already knows the move; if so, move it to the end of the array
|
||||||
@@ -590,7 +590,7 @@ class Pokemon
|
|||||||
|
|
||||||
# Deletes the given move from the Pokémon.
|
# Deletes the given move from the Pokémon.
|
||||||
# @param move_id [Integer, Symbol, String] ID of the move to delete
|
# @param move_id [Integer, Symbol, String] ID of the move to delete
|
||||||
def pbDeleteMove(move_id)
|
def forget_move(move_id)
|
||||||
move_data = GameData::Move.try_get(move_id)
|
move_data = GameData::Move.try_get(move_id)
|
||||||
return if !move_data
|
return if !move_data
|
||||||
@moves.delete_if { |m| m.id == move_data.id }
|
@moves.delete_if { |m| m.id == move_data.id }
|
||||||
@@ -598,43 +598,43 @@ class Pokemon
|
|||||||
|
|
||||||
# Deletes the move at the given index from the Pokémon.
|
# Deletes the move at the given index from the Pokémon.
|
||||||
# @param index [Integer] index of the move to be deleted
|
# @param index [Integer] index of the move to be deleted
|
||||||
def pbDeleteMoveAtIndex(index)
|
def forget_move_at_index(index)
|
||||||
@moves.delete_at(index)
|
@moves.delete_at(index)
|
||||||
end
|
end
|
||||||
|
|
||||||
# Deletes all moves from the Pokémon.
|
# Deletes all moves from the Pokémon.
|
||||||
def pbDeleteAllMoves
|
def forget_all_moves
|
||||||
@moves.clear
|
@moves.clear
|
||||||
end
|
end
|
||||||
|
|
||||||
# Copies currently known moves into a separate array, for Move Relearner.
|
# Copies currently known moves into a separate array, for Move Relearner.
|
||||||
def pbRecordFirstMoves
|
def record_first_moves
|
||||||
pbClearFirstMoves
|
clear_first_moves
|
||||||
@moves.each { |m| @firstmoves.push(m.id) }
|
@moves.each { |m| @first_moves.push(m.id) }
|
||||||
end
|
end
|
||||||
|
|
||||||
# Adds a move to this Pokémon's first moves.
|
# Adds a move to this Pokémon's first moves.
|
||||||
# @param move_id [Integer, Symbol, String] ID of the move to add
|
# @param move_id [Integer, Symbol, String] ID of the move to add
|
||||||
def pbAddFirstMove(move_id)
|
def add_first_move(move_id)
|
||||||
move_data = GameData::Move.try_get(move_id)
|
move_data = GameData::Move.try_get(move_id)
|
||||||
@firstmoves.push(move_data.id) if move_data && !@firstmoves.include?(move_data.id)
|
@first_moves.push(move_data.id) if move_data && !@first_moves.include?(move_data.id)
|
||||||
end
|
end
|
||||||
|
|
||||||
# Removes a move from this Pokémon's first moves.
|
# Removes a move from this Pokémon's first moves.
|
||||||
# @param move_id [Integer, Symbol, String] ID of the move to remove
|
# @param move_id [Integer, Symbol, String] ID of the move to remove
|
||||||
def pbRemoveFirstMove(move_id)
|
def remove_first_move(move_id)
|
||||||
move_data = GameData::Move.try_get(move_id)
|
move_data = GameData::Move.try_get(move_id)
|
||||||
@firstmoves.delete(move_data.id) if move_data
|
@first_moves.delete(move_data.id) if move_data
|
||||||
end
|
end
|
||||||
|
|
||||||
# Clears this Pokémon's first moves.
|
# Clears this Pokémon's first moves.
|
||||||
def pbClearFirstMoves
|
def clear_first_moves
|
||||||
@firstmoves.clear
|
@first_moves.clear
|
||||||
end
|
end
|
||||||
|
|
||||||
# @param move_id [Integer, Symbol, String] ID of the move to check
|
# @param move_id [Integer, Symbol, String] ID of the move to check
|
||||||
# @return [Boolean] whether the Pokémon is compatible with the given move
|
# @return [Boolean] whether the Pokémon is compatible with the given move
|
||||||
def compatibleWithMove?(move_id)
|
def compatible_with_move?(move_id)
|
||||||
move_data = GameData::Move.try_get(move_id)
|
move_data = GameData::Move.try_get(move_id)
|
||||||
return move_data && species_data.tutor_moves.include?(move_data.id)
|
return move_data && species_data.tutor_moves.include?(move_data.id)
|
||||||
end
|
end
|
||||||
@@ -644,7 +644,7 @@ class Pokemon
|
|||||||
#=============================================================================
|
#=============================================================================
|
||||||
|
|
||||||
# @return [Integer] the number of ribbons this Pokémon has
|
# @return [Integer] the number of ribbons this Pokémon has
|
||||||
def ribbonCount
|
def numRibbons
|
||||||
return @ribbons.length
|
return @ribbons.length
|
||||||
end
|
end
|
||||||
|
|
||||||
@@ -860,8 +860,8 @@ class Pokemon
|
|||||||
raise _INTL("Unknown happiness-changing method: {1}", method.to_s)
|
raise _INTL("Unknown happiness-changing method: {1}", method.to_s)
|
||||||
end
|
end
|
||||||
if gain > 0
|
if gain > 0
|
||||||
gain += 1 if @obtainMap == $game_map.map_id
|
gain += 1 if @obtain_map == $game_map.map_id
|
||||||
gain += 1 if @ballused == pbGetBallType(:LUXURYBALL)
|
gain += 1 if @poke_ball == :LUXURYBALL
|
||||||
gain = (gain * 1.5).floor if hasItem?(:SOOTHEBELL)
|
gain = (gain * 1.5).floor if hasItem?(:SOOTHEBELL)
|
||||||
end
|
end
|
||||||
@happiness = (@happiness + gain).clamp(0, 255)
|
@happiness = (@happiness + gain).clamp(0, 255)
|
||||||
@@ -928,14 +928,14 @@ class Pokemon
|
|||||||
# @return [Pokemon] a copy of this Pokémon
|
# @return [Pokemon] a copy of this Pokémon
|
||||||
def clone
|
def clone
|
||||||
ret = super
|
ret = super
|
||||||
ret.iv = @iv.clone
|
ret.iv = @iv.clone
|
||||||
ret.ivMaxed = @ivMaxed.clone
|
ret.ivMaxed = @ivMaxed.clone
|
||||||
ret.ev = @ev.clone
|
ret.ev = @ev.clone
|
||||||
ret.moves = []
|
ret.moves = []
|
||||||
@moves.each_with_index { |m, i| ret.moves[i] = m.clone }
|
@moves.each_with_index { |m, i| ret.moves[i] = m.clone }
|
||||||
ret.firstmoves = @firstmoves.cline
|
ret.first_moves = @first_moves.clone
|
||||||
ret.owner = @owner.clone
|
ret.owner = @owner.clone
|
||||||
ret.ribbons = @ribbons.clone
|
ret.ribbons = @ribbons.clone
|
||||||
return ret
|
return ret
|
||||||
end
|
end
|
||||||
|
|
||||||
@@ -948,11 +948,11 @@ class Pokemon
|
|||||||
species_data = GameData::Species.get(species)
|
species_data = GameData::Species.get(species)
|
||||||
@species = species_data.species
|
@species = species_data.species
|
||||||
@form = species_data.form
|
@form = species_data.form
|
||||||
@forcedForm = nil
|
@forced_form = nil
|
||||||
@formTime = nil
|
@time_form_set = nil
|
||||||
self.level = level
|
self.level = level
|
||||||
@eggsteps = 0
|
@steps_to_hatch = 0
|
||||||
healStatus
|
heal_status
|
||||||
@gender = nil
|
@gender = nil
|
||||||
@shiny = nil
|
@shiny = nil
|
||||||
@ability_index = nil
|
@ability_index = nil
|
||||||
@@ -963,7 +963,7 @@ class Pokemon
|
|||||||
@mail = nil
|
@mail = nil
|
||||||
@moves = []
|
@moves = []
|
||||||
resetMoves if withMoves
|
resetMoves if withMoves
|
||||||
@firstmoves = []
|
@first_moves = []
|
||||||
@ribbons = []
|
@ribbons = []
|
||||||
@cool = 0
|
@cool = 0
|
||||||
@beauty = 0
|
@beauty = 0
|
||||||
@@ -974,7 +974,7 @@ class Pokemon
|
|||||||
@pokerus = 0
|
@pokerus = 0
|
||||||
@name = nil
|
@name = nil
|
||||||
@happiness = species_data.happiness
|
@happiness = species_data.happiness
|
||||||
@ballused = 0
|
@poke_ball = :POKEBALL
|
||||||
@markings = 0
|
@markings = 0
|
||||||
@iv = []
|
@iv = []
|
||||||
@ivMaxed = []
|
@ivMaxed = []
|
||||||
@@ -992,10 +992,10 @@ class Pokemon
|
|||||||
end
|
end
|
||||||
@obtain_method = 0 # Met
|
@obtain_method = 0 # Met
|
||||||
@obtain_method = 4 if $game_switches && $game_switches[FATEFUL_ENCOUNTER_SWITCH]
|
@obtain_method = 4 if $game_switches && $game_switches[FATEFUL_ENCOUNTER_SWITCH]
|
||||||
@obtainMap = ($game_map) ? $game_map.map_id : 0
|
@obtain_map = ($game_map) ? $game_map.map_id : 0
|
||||||
@obtainText = nil
|
@obtain_text = nil
|
||||||
@obtainLevel = level
|
@obtain_level = level
|
||||||
@hatchedMap = 0
|
@hatched_map = 0
|
||||||
@timeReceived = pbGetTimeNow.to_i
|
@timeReceived = pbGetTimeNow.to_i
|
||||||
@timeEggHatched = nil
|
@timeEggHatched = nil
|
||||||
@fused = nil
|
@fused = nil
|
||||||
|
|||||||
@@ -1,8 +1,8 @@
|
|||||||
#===============================================================================
|
|
||||||
# Mega Evolution
|
|
||||||
# NOTE: These are treated as form changes in Essentials.
|
|
||||||
#===============================================================================
|
|
||||||
class Pokemon
|
class Pokemon
|
||||||
|
#=============================================================================
|
||||||
|
# Mega Evolution
|
||||||
|
# NOTE: These are treated as form changes in Essentials.
|
||||||
|
#=============================================================================
|
||||||
def getMegaForm(checkItemOnly = false)
|
def getMegaForm(checkItemOnly = false)
|
||||||
ret = 0
|
ret = 0
|
||||||
GameData::Species.each do |data|
|
GameData::Species.each do |data|
|
||||||
@@ -24,12 +24,12 @@ class Pokemon
|
|||||||
|
|
||||||
def hasMegaForm?
|
def hasMegaForm?
|
||||||
megaForm = self.getMegaForm
|
megaForm = self.getMegaForm
|
||||||
return megaForm > 0 && megaForm != self.formSimple
|
return megaForm > 0 && megaForm != form_simple
|
||||||
end
|
end
|
||||||
|
|
||||||
def mega?
|
def mega?
|
||||||
megaForm = self.getMegaForm
|
megaForm = self.getMegaForm
|
||||||
return megaForm > 0 && megaForm == self.formSimple
|
return megaForm > 0 && megaForm == form_simple
|
||||||
end
|
end
|
||||||
alias isMega? mega?
|
alias isMega? mega?
|
||||||
|
|
||||||
@@ -51,15 +51,11 @@ class Pokemon
|
|||||||
def megaMessage # 0=default message, 1=Rayquaza message
|
def megaMessage # 0=default message, 1=Rayquaza message
|
||||||
return species_data.mega_message
|
return species_data.mega_message
|
||||||
end
|
end
|
||||||
end
|
|
||||||
|
|
||||||
|
#=============================================================================
|
||||||
|
# Primal Reversion
|
||||||
#===============================================================================
|
# NOTE: These are treated as form changes in Essentials.
|
||||||
# Primal Reversion
|
#=============================================================================
|
||||||
# NOTE: These are treated as form changes in Essentials.
|
|
||||||
#===============================================================================
|
|
||||||
class Pokemon
|
|
||||||
def hasPrimalForm?
|
def hasPrimalForm?
|
||||||
v = MultipleForms.call("getPrimalForm",self)
|
v = MultipleForms.call("getPrimalForm",self)
|
||||||
return v!=nil
|
return v!=nil
|
||||||
@@ -83,19 +79,3 @@ class Pokemon
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
MultipleForms.register(:GROUDON,{
|
|
||||||
"getPrimalForm" => proc { |pkmn|
|
|
||||||
next 1 if pkmn.hasItem?(:REDORB)
|
|
||||||
next
|
|
||||||
}
|
|
||||||
})
|
|
||||||
|
|
||||||
MultipleForms.register(:KYOGRE,{
|
|
||||||
"getPrimalForm" => proc { |pkmn|
|
|
||||||
next 1 if pkmn.hasItem?(:BLUEORB)
|
|
||||||
next
|
|
||||||
}
|
|
||||||
})
|
|
||||||
156
Data/Scripts/016_Pokemon/003_Pokemon_ShadowPokemon.rb
Normal file
156
Data/Scripts/016_Pokemon/003_Pokemon_ShadowPokemon.rb
Normal file
@@ -0,0 +1,156 @@
|
|||||||
|
#===============================================================================
|
||||||
|
# Pokémon class.
|
||||||
|
#===============================================================================
|
||||||
|
class Pokemon
|
||||||
|
attr_accessor :shadow
|
||||||
|
attr_writer :heart_gauge
|
||||||
|
attr_writer :hyper_mode
|
||||||
|
attr_accessor :saved_exp
|
||||||
|
attr_accessor :saved_ev
|
||||||
|
attr_accessor :shadow_moves
|
||||||
|
HEART_GAUGE_SIZE = 3840
|
||||||
|
|
||||||
|
alias :__shadow_expeq :exp=
|
||||||
|
def exp=(value)
|
||||||
|
if shadowPokemon?
|
||||||
|
@saved_exp += value - @exp
|
||||||
|
else
|
||||||
|
__shadow_expeq(value)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
alias :__shadow_hpeq :hp=
|
||||||
|
def hp=(value)
|
||||||
|
__shadow_hpeq(value)
|
||||||
|
@hyper_mode = false if @hp <= 0
|
||||||
|
end
|
||||||
|
|
||||||
|
def heart_gauge
|
||||||
|
return @heart_gauge || 0
|
||||||
|
end
|
||||||
|
|
||||||
|
def adjustHeart(value)
|
||||||
|
return if !shadowPokemon?
|
||||||
|
@heart_gauge = (self.heart_gauge + value).clamp(0, HEART_GAUGE_SIZE)
|
||||||
|
end
|
||||||
|
|
||||||
|
def heartStage
|
||||||
|
return 0 if !shadowPokemon?
|
||||||
|
stage_size = HEART_GAUGE_SIZE / 5.0
|
||||||
|
return ([self.heart_gauge, HEART_GAUGE_SIZE].min / stage_size).ceil
|
||||||
|
end
|
||||||
|
|
||||||
|
def shadowPokemon?
|
||||||
|
return @shadow && @heart_gauge && @heart_gauge >= 0
|
||||||
|
end
|
||||||
|
alias isShadow? shadowPokemon?
|
||||||
|
|
||||||
|
def hyper_mode
|
||||||
|
return (self.heart_gauge == 0 || @hp == 0) ? false : @hyper_mode
|
||||||
|
end
|
||||||
|
|
||||||
|
def makeShadow
|
||||||
|
@shadow = true
|
||||||
|
@heart_gauge = HEART_GAUGE_SIZE
|
||||||
|
@hyper_mode = false
|
||||||
|
@saved_exp = 0
|
||||||
|
@saved_ev = [0, 0, 0, 0, 0, 0]
|
||||||
|
@shadow_moves = []
|
||||||
|
# Retrieve Shadow moveset for this Pokémon
|
||||||
|
shadow_moveset = pbLoadShadowMovesets[species_data.id]
|
||||||
|
shadow_moveset = pbLoadShadowMovesets[@species] if !shadow_moveset || shadow_moveset.length == 0
|
||||||
|
# Record this Pokémon's Shadow moves
|
||||||
|
if shadow_moveset && shadow_moveset.length > 0
|
||||||
|
for i in 0...[shadow_moveset.length, MAX_MOVES].min
|
||||||
|
@shadow_moves[i] = shadow_moveset[i]
|
||||||
|
end
|
||||||
|
elsif GameData::Move.exists?(:SHADOWRUSH)
|
||||||
|
# No Shadow moveset defined; just use Shadow Rush
|
||||||
|
@shadow_moves[0] = :SHADOWRUSH
|
||||||
|
else
|
||||||
|
raise _INTL("Expected Shadow moves or Shadow Rush to be defined, but they weren't.")
|
||||||
|
end
|
||||||
|
# Record this Pokémon's original moves
|
||||||
|
@moves.each_with_index { |m, i| @shadow_moves[MAX_MOVES + i] = m.id }
|
||||||
|
# Update moves
|
||||||
|
update_shadow_moves
|
||||||
|
end
|
||||||
|
|
||||||
|
def update_shadow_moves(relearn_all_moves = false)
|
||||||
|
return if !@shadow_moves
|
||||||
|
# Not a Shadow Pokémon (any more); relearn all its original moves
|
||||||
|
if !shadowPokemon?
|
||||||
|
if @shadow_moves.length > MAX_MOVES
|
||||||
|
new_moves = []
|
||||||
|
@shadow_moves.each_with_index { |m, i| new_moves.push(m) if m && i >= MAX_MOVES }
|
||||||
|
replace_moves(new_moves)
|
||||||
|
end
|
||||||
|
@shadow_moves = nil
|
||||||
|
return
|
||||||
|
end
|
||||||
|
# Is a Shadow Pokémon; ensure it knows the appropriate moves depending on its heart stage
|
||||||
|
# Start with all Shadow moves
|
||||||
|
new_moves = []
|
||||||
|
@shadow_moves.each_with_index { |m, i| new_moves.push(m) if m && i < MAX_MOVES }
|
||||||
|
num_shadow_moves = new_moves.length
|
||||||
|
# Add some original moves (skipping ones in the same slot as a Shadow Move)
|
||||||
|
num_original_moves = (relearn_all_moves) ? 3 : [3, 3, 2, 1, 1, 0][self.heartStage]
|
||||||
|
if num_original_moves > 0
|
||||||
|
relearned_count = 0
|
||||||
|
@shadow_moves.each_with_index do |m, i|
|
||||||
|
next if !m || i < MAX_MOVES + num_shadow_moves
|
||||||
|
new_moves.push(m)
|
||||||
|
relearned_count += 1
|
||||||
|
break if relearned_count >= num_original_moves
|
||||||
|
end
|
||||||
|
end
|
||||||
|
# Relearn Shadow moves plus some original moves (may not change anything)
|
||||||
|
replace_moves(new_moves)
|
||||||
|
end
|
||||||
|
|
||||||
|
def replace_moves(new_moves)
|
||||||
|
new_moves.each do |move|
|
||||||
|
next if !move || !GameData::Move.exists?(move) || hasMove?(move)
|
||||||
|
if numMoves < Pokemon::MAX_MOVES # Has an empty slot; just learn move
|
||||||
|
learn_move(move)
|
||||||
|
next
|
||||||
|
end
|
||||||
|
@moves.each do |m|
|
||||||
|
next if new_moves.include?(m.id)
|
||||||
|
m.id = GameData::Move.get(move).id
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
def purifiable?
|
||||||
|
return false if !shadowPokemon? || self.heart_gauge > 0
|
||||||
|
return false if isSpecies?(:LUGIA)
|
||||||
|
return true
|
||||||
|
end
|
||||||
|
|
||||||
|
def check_ready_to_purify
|
||||||
|
return if !shadowPokemon?
|
||||||
|
update_shadow_moves
|
||||||
|
pbMessage(_INTL("{1} can now be purified!", self.name)) if self.heart_gauge == 0
|
||||||
|
end
|
||||||
|
|
||||||
|
def add_evs(added_evs)
|
||||||
|
total = 0
|
||||||
|
@ev.each { |e| total += e }
|
||||||
|
PBStats.each do |s|
|
||||||
|
addition = added_evs[s].clamp(0, Pokemon::EV_STAT_LIMIT - @ev[s])
|
||||||
|
addition = addition.clamp(0, Pokemon::EV_LIMIT - total)
|
||||||
|
next if addition == 0
|
||||||
|
@ev[s] += addition
|
||||||
|
total += addition
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
alias :__shadow_clone :clone
|
||||||
|
def clone
|
||||||
|
ret = __shadow_clone
|
||||||
|
ret.saved_ev = @saved_ev.clone if @saved_ev
|
||||||
|
ret.shadow_moves = @shadow_moves.clone if @shadow_moves
|
||||||
|
return ret
|
||||||
|
end
|
||||||
|
end
|
||||||
@@ -1,5 +1,7 @@
|
|||||||
|
#===============================================================================
|
||||||
|
# Stores information about a Pokémon's owner.
|
||||||
|
#===============================================================================
|
||||||
class Pokemon
|
class Pokemon
|
||||||
# Stores information about a Pokémon's owner.
|
|
||||||
class Owner
|
class Owner
|
||||||
# @return [Integer] the ID of the owner
|
# @return [Integer] the ID of the owner
|
||||||
attr_reader :id
|
attr_reader :id
|
||||||
|
|||||||
@@ -18,8 +18,7 @@ class PokeBattle_Pokemon
|
|||||||
attr_reader :timeReceived, :timeEggHatched
|
attr_reader :timeReceived, :timeEggHatched
|
||||||
attr_reader :cool, :beauty, :cute, :smart, :tough, :sheen
|
attr_reader :cool, :beauty, :cute, :smart, :tough, :sheen
|
||||||
attr_reader :trainerID, :ot, :otgender, :language
|
attr_reader :trainerID, :ot, :otgender, :language
|
||||||
attr_reader :shadow, :heartgauge, :savedexp, :savedev, :hypermode
|
attr_reader :shadow, :heartgauge, :savedexp, :savedev, :hypermode, :shadowmoves
|
||||||
attr_reader :shadowmoves, :shadowmovenum
|
|
||||||
|
|
||||||
def initialise
|
def initialise
|
||||||
raise "PokeBattle_Pokemon.new is deprecated. Use Pokemon.new instead."
|
raise "PokeBattle_Pokemon.new is deprecated. Use Pokemon.new instead."
|
||||||
@@ -28,10 +27,10 @@ class PokeBattle_Pokemon
|
|||||||
def self.copy(pkmn)
|
def self.copy(pkmn)
|
||||||
owner = Pokemon::Owner.new(pkmn.trainerID, pkmn.ot, pkmn.otgender, pkmn.language)
|
owner = Pokemon::Owner.new(pkmn.trainerID, pkmn.ot, pkmn.otgender, pkmn.language)
|
||||||
ret = Pokemon.new(pkmn.species, pkmn.level, owner, false)
|
ret = Pokemon.new(pkmn.species, pkmn.level, owner, false)
|
||||||
ret.forcedForm = pkmn.forcedForm if pkmn.forcedForm
|
ret.forced_form = pkmn.forcedForm if pkmn.forcedForm
|
||||||
ret.formTime = pkmn.formTime
|
ret.time_form_set = pkmn.formTime
|
||||||
ret.exp = pkmn.exp
|
ret.exp = pkmn.exp
|
||||||
ret.eggsteps = pkmn.eggsteps
|
ret.steps_to_hatch = pkmn.eggsteps
|
||||||
ret.status = pkmn.status
|
ret.status = pkmn.status
|
||||||
ret.statusCount = pkmn.statusCount
|
ret.statusCount = pkmn.statusCount
|
||||||
ret.gender = pkmn.genderflag
|
ret.gender = pkmn.genderflag
|
||||||
@@ -42,7 +41,7 @@ class PokeBattle_Pokemon
|
|||||||
ret.item = pkmn.item
|
ret.item = pkmn.item
|
||||||
ret.mail = PokemonMail.copy(pkmn.mail) if pkmn.mail
|
ret.mail = PokemonMail.copy(pkmn.mail) if pkmn.mail
|
||||||
pkmn.moves.each { |m| ret.moves.push(PBMove.copy(m)) if m && m.id > 0 }
|
pkmn.moves.each { |m| ret.moves.push(PBMove.copy(m)) if m && m.id > 0 }
|
||||||
pkmn.firstmoves.each { |m| ret.pbAddFirstMove(m) }
|
pkmn.firstmoves.each { |m| ret.add_first_move(m) }
|
||||||
ret.ribbons = pkmn.ribbons.clone if pkmn.ribbons
|
ret.ribbons = pkmn.ribbons.clone if pkmn.ribbons
|
||||||
ret.cool = pkmn.cool if pkmn.cool
|
ret.cool = pkmn.cool if pkmn.cool
|
||||||
ret.beauty = pkmn.beauty if pkmn.beauty
|
ret.beauty = pkmn.beauty if pkmn.beauty
|
||||||
@@ -53,16 +52,16 @@ class PokeBattle_Pokemon
|
|||||||
ret.pokerus = pkmn.pokerus if pkmn.pokerus
|
ret.pokerus = pkmn.pokerus if pkmn.pokerus
|
||||||
ret.name = pkmn.name
|
ret.name = pkmn.name
|
||||||
ret.happiness = pkmn.happiness
|
ret.happiness = pkmn.happiness
|
||||||
ret.ballused = pkmn.ballused
|
ret.poke_ball = pbBallTypeToItem(pkmn.ballused)
|
||||||
ret.markings = pkmn.markings if pkmn.markings
|
ret.markings = pkmn.markings if pkmn.markings
|
||||||
ret.iv = pkmn.iv.clone
|
ret.iv = pkmn.iv.clone
|
||||||
ret.ivMaxed = pkmn.ivMaxed.clone if pkmn.ivMaxed
|
ret.ivMaxed = pkmn.ivMaxed.clone if pkmn.ivMaxed
|
||||||
ret.ev = pkmn.ev.clone
|
ret.ev = pkmn.ev.clone
|
||||||
ret.obtain_method = pkmn.obtainMode
|
ret.obtain_method = pkmn.obtainMode
|
||||||
ret.obtainMap = pkmn.obtainMap
|
ret.obtain_map = pkmn.obtainMap
|
||||||
ret.obtainText = pkmn.obtainText
|
ret.obtain_text = pkmn.obtainText
|
||||||
ret.obtainLevel = pkmn.obtainLevel if pkmn.obtainLevel
|
ret.obtain_level = pkmn.obtainLevel if pkmn.obtainLevel
|
||||||
ret.hatchedMap = pkmn.hatchedMap
|
ret.hatched_map = pkmn.hatchedMap
|
||||||
ret.timeReceived = pkmn.timeReceived
|
ret.timeReceived = pkmn.timeReceived
|
||||||
ret.timeEggHatched = pkmn.timeEggHatched
|
ret.timeEggHatched = pkmn.timeEggHatched
|
||||||
if pkmn.fused
|
if pkmn.fused
|
||||||
@@ -71,16 +70,19 @@ class PokeBattle_Pokemon
|
|||||||
end
|
end
|
||||||
ret.personalID = pkmn.personalID
|
ret.personalID = pkmn.personalID
|
||||||
ret.hp = pkmn.hp
|
ret.hp = pkmn.hp
|
||||||
|
if pkmn.shadow
|
||||||
ret.shadow = pkmn.shadow
|
ret.shadow = pkmn.shadow
|
||||||
ret.heartgauge = pkmn.heartgauge
|
ret.heart_gauge = pkmn.heartgauge
|
||||||
ret.savedexp = pkmn.savedexp
|
ret.hyper_mode = pkmn.hypermode
|
||||||
ret.savedev = pkmn.savedev.clone
|
ret.saved_exp = pkmn.savedexp
|
||||||
ret.hypermode = pkmn.hypermode
|
ret.saved_ev = pkmn.savedev.clone
|
||||||
ret.shadowmoves = pkmn.shadowmoves.clone
|
ret.shadow_moves = []
|
||||||
ret.shadowmovenum = pkmn.shadowmovenum
|
pkmn.shadowmoves.each_with_index do |move, i|
|
||||||
|
ret.shadow_moves[i] = GameData::Move.get(move).id if move
|
||||||
|
end
|
||||||
|
end
|
||||||
# NOTE: Intentionally set last, as it recalculates stats.
|
# NOTE: Intentionally set last, as it recalculates stats.
|
||||||
ret.formSimple = pkmn.form || 0
|
ret.form_simple = pkmn.form || 0
|
||||||
return ret
|
return ret
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
@@ -178,6 +180,16 @@ class Pokemon
|
|||||||
Deprecation.warn_method('Pokemon#setItem', 'v20', 'Pokemon#item=')
|
Deprecation.warn_method('Pokemon#setItem', 'v20', 'Pokemon#item=')
|
||||||
self.item = value
|
self.item = value
|
||||||
end
|
end
|
||||||
|
|
||||||
|
alias healStatus heal_status
|
||||||
|
alias pbLearnMove learn_move
|
||||||
|
alias pbDeleteMove forget_move
|
||||||
|
alias pbDeleteMoveAtIndex forget_move_at_index
|
||||||
|
alias pbRecordFirstMoves record_first_moves
|
||||||
|
alias pbAddFirstMove add_first_move
|
||||||
|
alias pbRemoveFirstMove remove_first_move
|
||||||
|
alias pbClearFirstMoves clear_first_moves
|
||||||
|
alias pbUpdateShadowMoves update_shadow_moves
|
||||||
end
|
end
|
||||||
|
|
||||||
# (see Pokemon#initialize)
|
# (see Pokemon#initialize)
|
||||||
|
|||||||
@@ -664,7 +664,7 @@ class PokemonParty_Scene
|
|||||||
next false if !pbCanUseOnPokemon?(itm)
|
next false if !pbCanUseOnPokemon?(itm)
|
||||||
if itm.is_machine?
|
if itm.is_machine?
|
||||||
move = itm.move
|
move = itm.move
|
||||||
next false if pokemon.hasMove?(move) || !pokemon.compatibleWithMove?(move)
|
next false if pokemon.hasMove?(move) || !pokemon.compatible_with_move?(move)
|
||||||
end
|
end
|
||||||
next true
|
next true
|
||||||
})
|
})
|
||||||
|
|||||||
@@ -302,7 +302,10 @@ class PokemonSummary_Scene
|
|||||||
@sprites["background"].setBitmap("Graphics/Pictures/Summary/bg_#{page}")
|
@sprites["background"].setBitmap("Graphics/Pictures/Summary/bg_#{page}")
|
||||||
imagepos=[]
|
imagepos=[]
|
||||||
# Show the Poké Ball containing the Pokémon
|
# Show the Poké Ball containing the Pokémon
|
||||||
ballimage = sprintf("Graphics/Pictures/Summary/icon_ball_%02d",@pokemon.ballused)
|
ballimage = sprintf("Graphics/Pictures/Summary/icon_ball_%s", @pokemon.poke_ball)
|
||||||
|
if !pbResolveBitmap(ballimage)
|
||||||
|
ballimage = sprintf("Graphics/Pictures/Summary/icon_ball_%02d", pbGetBallType(@pokemon.poke_ball))
|
||||||
|
end
|
||||||
imagepos.push([ballimage,14,60])
|
imagepos.push([ballimage,14,60])
|
||||||
# Show status/fainted/Pokérus infected icon
|
# Show status/fainted/Pokérus infected icon
|
||||||
status = -1
|
status = -1
|
||||||
@@ -368,7 +371,7 @@ class PokemonSummary_Scene
|
|||||||
dexNumShadow = (@pokemon.shiny?) ? Color.new(224,152,144) : Color.new(176,176,176)
|
dexNumShadow = (@pokemon.shiny?) ? Color.new(224,152,144) : Color.new(176,176,176)
|
||||||
# If a Shadow Pokémon, draw the heart gauge area and bar
|
# If a Shadow Pokémon, draw the heart gauge area and bar
|
||||||
if @pokemon.shadowPokemon?
|
if @pokemon.shadowPokemon?
|
||||||
shadowfract = @pokemon.heartgauge*1.0/Pokemon::HEARTGAUGESIZE
|
shadowfract = @pokemon.heart_gauge.to_f / Pokemon::HEART_GAUGE_SIZE
|
||||||
imagepos = [
|
imagepos = [
|
||||||
["Graphics/Pictures/Summary/overlay_shadow",224,240],
|
["Graphics/Pictures/Summary/overlay_shadow",224,240],
|
||||||
["Graphics/Pictures/Summary/overlay_shadowbar",242,280,0,0,(shadowfract*248).floor,-1]
|
["Graphics/Pictures/Summary/overlay_shadowbar",242,280,0,0,(shadowfract*248).floor,-1]
|
||||||
@@ -457,7 +460,7 @@ class PokemonSummary_Scene
|
|||||||
end
|
end
|
||||||
# Draw Exp bar
|
# Draw Exp bar
|
||||||
if @pokemon.level<PBExperience.maxLevel
|
if @pokemon.level<PBExperience.maxLevel
|
||||||
w = @pokemon.expFraction*128
|
w = @pokemon.exp_fraction * 128
|
||||||
w = ((w/2).round)*2
|
w = ((w/2).round)*2
|
||||||
pbDrawImagePositions(overlay,[
|
pbDrawImagePositions(overlay,[
|
||||||
["Graphics/Pictures/Summary/overlay_exp",362,372,0,0,w,6]
|
["Graphics/Pictures/Summary/overlay_exp",362,372,0,0,w,6]
|
||||||
@@ -475,7 +478,10 @@ class PokemonSummary_Scene
|
|||||||
@sprites["background"].setBitmap("Graphics/Pictures/Summary/bg_egg")
|
@sprites["background"].setBitmap("Graphics/Pictures/Summary/bg_egg")
|
||||||
imagepos = []
|
imagepos = []
|
||||||
# Show the Poké Ball containing the Pokémon
|
# Show the Poké Ball containing the Pokémon
|
||||||
ballimage = sprintf("Graphics/Pictures/Summary/icon_ball_%02d",@pokemon.ballused)
|
ballimage = sprintf("Graphics/Pictures/Summary/icon_ball_%s", @pokemon.poke_ball)
|
||||||
|
if !pbResolveBitmap(ballimage)
|
||||||
|
ballimage = sprintf("Graphics/Pictures/Summary/icon_ball_%02d", pbGetBallType(@pokemon.poke_ball))
|
||||||
|
end
|
||||||
imagepos.push([ballimage,14,60])
|
imagepos.push([ballimage,14,60])
|
||||||
# Draw all images
|
# Draw all images
|
||||||
pbDrawImagePositions(overlay,imagepos)
|
pbDrawImagePositions(overlay,imagepos)
|
||||||
@@ -502,11 +508,9 @@ class PokemonSummary_Scene
|
|||||||
memo += _INTL("<c3=404040,B0B0B0>{1} {2}, {3}\n",date,month,year)
|
memo += _INTL("<c3=404040,B0B0B0>{1} {2}, {3}\n",date,month,year)
|
||||||
end
|
end
|
||||||
# Write map name egg was received on
|
# Write map name egg was received on
|
||||||
mapname = pbGetMapNameFromId(@pokemon.obtainMap)
|
mapname = pbGetMapNameFromId(@pokemon.obtain_map)
|
||||||
if (@pokemon.obtainText rescue false) && @pokemon.obtainText!=""
|
mapname = @pokemon.obtain_text if @pokemon.obtain_text && !@pokemon.obtain_text.empty?
|
||||||
mapname = @pokemon.obtainText
|
if mapname && mapname != ""
|
||||||
end
|
|
||||||
if mapname && mapname!=""
|
|
||||||
memo += _INTL("<c3=404040,B0B0B0>A mysterious Pokémon Egg received from <c3=F83820,E09890>{1}<c3=404040,B0B0B0>.\n",mapname)
|
memo += _INTL("<c3=404040,B0B0B0>A mysterious Pokémon Egg received from <c3=F83820,E09890>{1}<c3=404040,B0B0B0>.\n",mapname)
|
||||||
else
|
else
|
||||||
memo += _INTL("<c3=404040,B0B0B0>A mysterious Pokémon Egg.\n",mapname)
|
memo += _INTL("<c3=404040,B0B0B0>A mysterious Pokémon Egg.\n",mapname)
|
||||||
@@ -515,9 +519,9 @@ class PokemonSummary_Scene
|
|||||||
# Write Egg Watch blurb
|
# Write Egg Watch blurb
|
||||||
memo += _INTL("<c3=404040,B0B0B0>\"The Egg Watch\"\n")
|
memo += _INTL("<c3=404040,B0B0B0>\"The Egg Watch\"\n")
|
||||||
eggstate = _INTL("It looks like this Egg will take a long time to hatch.")
|
eggstate = _INTL("It looks like this Egg will take a long time to hatch.")
|
||||||
eggstate = _INTL("What will hatch from this? It doesn't seem close to hatching.") if @pokemon.eggsteps<10200
|
eggstate = _INTL("What will hatch from this? It doesn't seem close to hatching.") if @pokemon.steps_to_hatch < 10200
|
||||||
eggstate = _INTL("It appears to move occasionally. It may be close to hatching.") if @pokemon.eggsteps<2550
|
eggstate = _INTL("It appears to move occasionally. It may be close to hatching.") if @pokemon.steps_to_hatch < 2550
|
||||||
eggstate = _INTL("Sounds can be heard coming from inside! It will hatch soon!") if @pokemon.eggsteps<1275
|
eggstate = _INTL("Sounds can be heard coming from inside! It will hatch soon!") if @pokemon.steps_to_hatch < 1275
|
||||||
memo += sprintf("<c3=404040,B0B0B0>%s\n",eggstate)
|
memo += sprintf("<c3=404040,B0B0B0>%s\n",eggstate)
|
||||||
# Draw all text
|
# Draw all text
|
||||||
drawFormattedTextEx(overlay,232,78,268,memo)
|
drawFormattedTextEx(overlay,232,78,268,memo)
|
||||||
@@ -542,18 +546,16 @@ class PokemonSummary_Scene
|
|||||||
memo += _INTL("<c3=404040,B0B0B0>{1} {2}, {3}\n",date,month,year)
|
memo += _INTL("<c3=404040,B0B0B0>{1} {2}, {3}\n",date,month,year)
|
||||||
end
|
end
|
||||||
# Write map name Pokémon was received on
|
# Write map name Pokémon was received on
|
||||||
mapname = pbGetMapNameFromId(@pokemon.obtainMap)
|
mapname = pbGetMapNameFromId(@pokemon.obtain_map)
|
||||||
if (@pokemon.obtainText rescue false) && @pokemon.obtainText!=""
|
mapname = @pokemon.obtain_text if @pokemon.obtain_text && !@pokemon.obtain_text.empty?
|
||||||
mapname = @pokemon.obtainText
|
|
||||||
end
|
|
||||||
mapname = _INTL("Faraway place") if !mapname || mapname==""
|
mapname = _INTL("Faraway place") if !mapname || mapname==""
|
||||||
memo += sprintf("<c3=F83820,E09890>%s\n",mapname)
|
memo += sprintf("<c3=F83820,E09890>%s\n",mapname)
|
||||||
# Write how Pokémon was obtained
|
# Write how Pokémon was obtained
|
||||||
mettext = [_INTL("Met at Lv. {1}.",@pokemon.obtainLevel),
|
mettext = [_INTL("Met at Lv. {1}.",@pokemon.obtain_level),
|
||||||
_INTL("Egg received."),
|
_INTL("Egg received."),
|
||||||
_INTL("Traded at Lv. {1}.",@pokemon.obtainLevel),
|
_INTL("Traded at Lv. {1}.",@pokemon.obtain_level),
|
||||||
"",
|
"",
|
||||||
_INTL("Had a fateful encounter at Lv. {1}.",@pokemon.obtainLevel)
|
_INTL("Had a fateful encounter at Lv. {1}.",@pokemon.obtain_level)
|
||||||
][@pokemon.obtain_method]
|
][@pokemon.obtain_method]
|
||||||
memo += sprintf("<c3=404040,B0B0B0>%s\n",mettext) if mettext && mettext!=""
|
memo += sprintf("<c3=404040,B0B0B0>%s\n",mettext) if mettext && mettext!=""
|
||||||
# If Pokémon was hatched, write when and where it hatched
|
# If Pokémon was hatched, write when and where it hatched
|
||||||
@@ -564,7 +566,7 @@ class PokemonSummary_Scene
|
|||||||
year = @pokemon.timeEggHatched.year
|
year = @pokemon.timeEggHatched.year
|
||||||
memo += _INTL("<c3=404040,B0B0B0>{1} {2}, {3}\n",date,month,year)
|
memo += _INTL("<c3=404040,B0B0B0>{1} {2}, {3}\n",date,month,year)
|
||||||
end
|
end
|
||||||
mapname = pbGetMapNameFromId(@pokemon.hatchedMap)
|
mapname = pbGetMapNameFromId(@pokemon.hatched_map)
|
||||||
mapname = _INTL("Faraway place") if !mapname || mapname==""
|
mapname = _INTL("Faraway place") if !mapname || mapname==""
|
||||||
memo += sprintf("<c3=F83820,E09890>%s\n",mapname)
|
memo += sprintf("<c3=F83820,E09890>%s\n",mapname)
|
||||||
memo += _INTL("<c3=404040,B0B0B0>Egg hatched.\n")
|
memo += _INTL("<c3=404040,B0B0B0>Egg hatched.\n")
|
||||||
@@ -829,7 +831,7 @@ class PokemonSummary_Scene
|
|||||||
# Write various bits of text
|
# Write various bits of text
|
||||||
textpos = [
|
textpos = [
|
||||||
[_INTL("No. of Ribbons:"),234,332,0,Color.new(64,64,64),Color.new(176,176,176)],
|
[_INTL("No. of Ribbons:"),234,332,0,Color.new(64,64,64),Color.new(176,176,176)],
|
||||||
[@pokemon.ribbonCount.to_s,450,332,1,Color.new(64,64,64),Color.new(176,176,176)],
|
[@pokemon.numRibbons.to_s,450,332,1,Color.new(64,64,64),Color.new(176,176,176)],
|
||||||
]
|
]
|
||||||
# Draw all text
|
# Draw all text
|
||||||
pbDrawTextPositions(overlay,textpos)
|
pbDrawTextPositions(overlay,textpos)
|
||||||
|
|||||||
@@ -1720,8 +1720,8 @@ class PokemonStorageScreen
|
|||||||
end
|
end
|
||||||
if heldpoke || selected[0]==-1
|
if heldpoke || selected[0]==-1
|
||||||
p = (heldpoke) ? heldpoke : @storage[-1,index]
|
p = (heldpoke) ? heldpoke : @storage[-1,index]
|
||||||
p.formTime = nil if p.respond_to?("formTime")
|
p.time_form_set = nil
|
||||||
p.form = 0 if p.isSpecies?(:SHAYMIN)
|
p.form = 0 if p.isSpecies?(:SHAYMIN)
|
||||||
p.heal
|
p.heal
|
||||||
end
|
end
|
||||||
@scene.pbStore(selected,heldpoke,destbox,firstfree)
|
@scene.pbStore(selected,heldpoke,destbox,firstfree)
|
||||||
@@ -1767,8 +1767,8 @@ class PokemonStorageScreen
|
|||||||
return
|
return
|
||||||
end
|
end
|
||||||
if box>=0
|
if box>=0
|
||||||
@heldpkmn.formTime = nil if @heldpkmn.respond_to?("formTime")
|
@heldpkmn.time_form_set = nil
|
||||||
@heldpkmn.form = 0 if @heldpkmn.isSpecies?(:SHAYMIN)
|
@heldpkmn.form = 0 if @heldpkmn.isSpecies?(:SHAYMIN)
|
||||||
@heldpkmn.heal
|
@heldpkmn.heal
|
||||||
end
|
end
|
||||||
@scene.pbPlace(selected,@heldpkmn)
|
@scene.pbPlace(selected,@heldpkmn)
|
||||||
@@ -1796,8 +1796,8 @@ class PokemonStorageScreen
|
|||||||
return false
|
return false
|
||||||
end
|
end
|
||||||
if box>=0
|
if box>=0
|
||||||
@heldpkmn.formTime = nil if @heldpkmn.respond_to?("formTime")
|
@heldpkmn.time_form_set = nil
|
||||||
@heldpkmn.form = 0 if @heldpkmn.isSpecies?(:SHAYMIN)
|
@heldpkmn.form = 0 if @heldpkmn.isSpecies?(:SHAYMIN)
|
||||||
@heldpkmn.heal
|
@heldpkmn.heal
|
||||||
end
|
end
|
||||||
@scene.pbSwap(selected,@heldpkmn)
|
@scene.pbSwap(selected,@heldpkmn)
|
||||||
|
|||||||
@@ -198,11 +198,11 @@ def pbHatch(pokemon)
|
|||||||
pokemon.happiness = 120
|
pokemon.happiness = 120
|
||||||
pokemon.timeEggHatched = pbGetTimeNow
|
pokemon.timeEggHatched = pbGetTimeNow
|
||||||
pokemon.obtain_method = 1 # hatched from egg
|
pokemon.obtain_method = 1 # hatched from egg
|
||||||
pokemon.hatchedMap = $game_map.map_id
|
pokemon.hatched_map = $game_map.map_id
|
||||||
$Trainer.seen[pokemon.species] = true
|
$Trainer.seen[pokemon.species] = true
|
||||||
$Trainer.owned[pokemon.species] = true
|
$Trainer.owned[pokemon.species] = true
|
||||||
pbSeenForm(pokemon)
|
pbSeenForm(pokemon)
|
||||||
pokemon.pbRecordFirstMoves
|
pokemon.record_first_moves
|
||||||
if !pbHatchAnimation(pokemon)
|
if !pbHatchAnimation(pokemon)
|
||||||
pbMessage(_INTL("Huh?\1"))
|
pbMessage(_INTL("Huh?\1"))
|
||||||
pbMessage(_INTL("...\1"))
|
pbMessage(_INTL("...\1"))
|
||||||
@@ -218,15 +218,15 @@ end
|
|||||||
|
|
||||||
Events.onStepTaken += proc { |_sender,_e|
|
Events.onStepTaken += proc { |_sender,_e|
|
||||||
for egg in $Trainer.party
|
for egg in $Trainer.party
|
||||||
next if egg.eggsteps<=0
|
next if egg.steps_to_hatch <= 0
|
||||||
egg.eggsteps -= 1
|
egg.steps_to_hatch -= 1
|
||||||
for i in $Trainer.pokemonParty
|
for i in $Trainer.pokemonParty
|
||||||
next if !i.hasAbility?(:FLAMEBODY) && !i.hasAbility?(:MAGMAARMOR)
|
next if !i.hasAbility?(:FLAMEBODY) && !i.hasAbility?(:MAGMAARMOR)
|
||||||
egg.eggsteps -= 1
|
egg.steps_to_hatch -= 1
|
||||||
break
|
break
|
||||||
end
|
end
|
||||||
if egg.eggsteps<=0
|
if egg.steps_to_hatch <= 0
|
||||||
egg.eggsteps = 0
|
egg.steps_to_hatch = 0
|
||||||
pbHatch(egg)
|
pbHatch(egg)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -608,11 +608,11 @@ class PokemonEvolutionScene
|
|||||||
|
|
||||||
def self.pbDuplicatePokemon(pkmn, new_species)
|
def self.pbDuplicatePokemon(pkmn, new_species)
|
||||||
new_pkmn = pkmn.clone
|
new_pkmn = pkmn.clone
|
||||||
new_pkmn.species = new_species
|
new_pkmn.species = new_species
|
||||||
new_pkmn.name = nil
|
new_pkmn.name = nil
|
||||||
new_pkmn.markings = 0
|
new_pkmn.markings = 0
|
||||||
new_pkmn.ballused = 0
|
new_pkmn.poke_ball = :POKEBALL
|
||||||
new_pkmn.item = nil
|
new_pkmn.item = nil
|
||||||
new_pkmn.clearAllRibbons
|
new_pkmn.clearAllRibbons
|
||||||
new_pkmn.calcStats
|
new_pkmn.calcStats
|
||||||
new_pkmn.heal
|
new_pkmn.heal
|
||||||
|
|||||||
@@ -61,9 +61,17 @@ class PokemonTrade_Scene
|
|||||||
spriteBall = IconSprite.new(0,0,@viewport)
|
spriteBall = IconSprite.new(0,0,@viewport)
|
||||||
pictureBall = PictureEx.new(0)
|
pictureBall = PictureEx.new(0)
|
||||||
picturePoke = PictureEx.new(0)
|
picturePoke = PictureEx.new(0)
|
||||||
|
ballimage = sprintf("Graphics/Battle animations/ball_%s", @pokemon.poke_ball)
|
||||||
|
if !pbResolveBitmap(ballimage)
|
||||||
|
ballimage = sprintf("Graphics/Battle animations/ball_%02d", pbGetBallType(@pokemon.poke_ball))
|
||||||
|
end
|
||||||
|
ballopenimage = sprintf("Graphics/Battle animations/ball_%s_open", @pokemon.poke_ball)
|
||||||
|
if !pbResolveBitmap(ballimage)
|
||||||
|
ballopenimage = sprintf("Graphics/Battle animations/ball_%02d_open", pbGetBallType(@pokemon.poke_ball))
|
||||||
|
end
|
||||||
# Starting position of ball
|
# Starting position of ball
|
||||||
pictureBall.setXY(0,Graphics.width/2,48)
|
pictureBall.setXY(0,Graphics.width/2,48)
|
||||||
pictureBall.setName(0,sprintf("Graphics/Battle animations/ball_%02d",@pokemon.ballused))
|
pictureBall.setName(0,ballimage)
|
||||||
pictureBall.setSrcSize(0,32,64)
|
pictureBall.setSrcSize(0,32,64)
|
||||||
pictureBall.setOrigin(0,PictureOrigin::Center)
|
pictureBall.setOrigin(0,PictureOrigin::Center)
|
||||||
pictureBall.setVisible(0,true)
|
pictureBall.setVisible(0,true)
|
||||||
@@ -76,7 +84,7 @@ class PokemonTrade_Scene
|
|||||||
# Recall
|
# Recall
|
||||||
delay = picturePoke.totalDuration
|
delay = picturePoke.totalDuration
|
||||||
picturePoke.setSE(delay,"Battle recall")
|
picturePoke.setSE(delay,"Battle recall")
|
||||||
pictureBall.setName(delay,sprintf("Graphics/Battle animations/ball_%02d_open",@pokemon.ballused))
|
pictureBall.setName(delay,ballopenimage)
|
||||||
pictureBall.setSrcSize(delay,32,64)
|
pictureBall.setSrcSize(delay,32,64)
|
||||||
# Move sprite to ball
|
# Move sprite to ball
|
||||||
picturePoke.moveZoom(delay,8,0)
|
picturePoke.moveZoom(delay,8,0)
|
||||||
@@ -84,7 +92,7 @@ class PokemonTrade_Scene
|
|||||||
picturePoke.setSE(delay+5,"Battle jump to ball")
|
picturePoke.setSE(delay+5,"Battle jump to ball")
|
||||||
picturePoke.setVisible(delay+8,false)
|
picturePoke.setVisible(delay+8,false)
|
||||||
delay = picturePoke.totalDuration+1
|
delay = picturePoke.totalDuration+1
|
||||||
pictureBall.setName(delay,sprintf("Graphics/Battle animations/ball_%02d",@pokemon.ballused))
|
pictureBall.setName(delay,ballimage)
|
||||||
pictureBall.setSrcSize(delay,32,64)
|
pictureBall.setSrcSize(delay,32,64)
|
||||||
# Make Poké Ball go off the top of the screen
|
# Make Poké Ball go off the top of the screen
|
||||||
delay = picturePoke.totalDuration+10
|
delay = picturePoke.totalDuration+10
|
||||||
@@ -101,9 +109,17 @@ class PokemonTrade_Scene
|
|||||||
spriteBall = IconSprite.new(0,0,@viewport)
|
spriteBall = IconSprite.new(0,0,@viewport)
|
||||||
pictureBall = PictureEx.new(0)
|
pictureBall = PictureEx.new(0)
|
||||||
picturePoke = PictureEx.new(0)
|
picturePoke = PictureEx.new(0)
|
||||||
|
ballimage = sprintf("Graphics/Battle animations/ball_%s", @pokemon2.poke_ball)
|
||||||
|
if !pbResolveBitmap(ballimage)
|
||||||
|
ballimage = sprintf("Graphics/Battle animations/ball_%02d", pbGetBallType(@pokemon2.poke_ball))
|
||||||
|
end
|
||||||
|
ballopenimage = sprintf("Graphics/Battle animations/ball_%s_open", @pokemon2.poke_ball)
|
||||||
|
if !pbResolveBitmap(ballimage)
|
||||||
|
ballopenimage = sprintf("Graphics/Battle animations/ball_%02d_open", pbGetBallType(@pokemon2.poke_ball))
|
||||||
|
end
|
||||||
# Starting position of ball
|
# Starting position of ball
|
||||||
pictureBall.setXY(0,Graphics.width/2,-32)
|
pictureBall.setXY(0,Graphics.width/2,-32)
|
||||||
pictureBall.setName(0,sprintf("Graphics/Battle animations/ball_%02d",@pokemon2.ballused))
|
pictureBall.setName(0,ballimage)
|
||||||
pictureBall.setSrcSize(0,32,64)
|
pictureBall.setSrcSize(0,32,64)
|
||||||
pictureBall.setOrigin(0,PictureOrigin::Center)
|
pictureBall.setOrigin(0,PictureOrigin::Center)
|
||||||
pictureBall.setVisible(0,true)
|
pictureBall.setVisible(0,true)
|
||||||
@@ -132,7 +148,7 @@ class PokemonTrade_Scene
|
|||||||
# Open Poké Ball
|
# Open Poké Ball
|
||||||
delay = pictureBall.totalDuration+15
|
delay = pictureBall.totalDuration+15
|
||||||
pictureBall.setSE(delay,"Battle recall")
|
pictureBall.setSE(delay,"Battle recall")
|
||||||
pictureBall.setName(delay,sprintf("Graphics/Battle animations/ball_%02d_open",@pokemon2.ballused))
|
pictureBall.setName(delay,ballopenimage)
|
||||||
pictureBall.setSrcSize(delay,32,64)
|
pictureBall.setSrcSize(delay,32,64)
|
||||||
pictureBall.setVisible(delay+5,false)
|
pictureBall.setVisible(delay+5,false)
|
||||||
# Pokémon appears and enlarges
|
# Pokémon appears and enlarges
|
||||||
@@ -211,7 +227,7 @@ def pbStartTrade(pokemonIndex,newpoke,nickname,trainerName,trainerGender=0)
|
|||||||
yourPokemon.name = nickname
|
yourPokemon.name = nickname
|
||||||
yourPokemon.obtain_method = 2 # traded
|
yourPokemon.obtain_method = 2 # traded
|
||||||
yourPokemon.resetMoves if resetmoves
|
yourPokemon.resetMoves if resetmoves
|
||||||
yourPokemon.pbRecordFirstMoves
|
yourPokemon.record_first_moves
|
||||||
$Trainer.seen[yourPokemon.species] = true
|
$Trainer.seen[yourPokemon.species] = true
|
||||||
$Trainer.owned[yourPokemon.species] = true
|
$Trainer.owned[yourPokemon.species] = true
|
||||||
pbSeenForm(yourPokemon)
|
pbSeenForm(yourPokemon)
|
||||||
|
|||||||
@@ -160,8 +160,8 @@ class MoveRelearnerScreen
|
|||||||
moves.push(m[1]) if !moves.include?(m[1])
|
moves.push(m[1]) if !moves.include?(m[1])
|
||||||
end
|
end
|
||||||
tmoves = []
|
tmoves = []
|
||||||
if pkmn.firstmoves
|
if pkmn.first_moves
|
||||||
for i in pkmn.firstmoves
|
for i in pkmn.first_moves
|
||||||
tmoves.push(i) if !pkmn.hasMove?(i) && !moves.include?(i)
|
tmoves.push(i) if !pkmn.hasMove?(i) && !moves.include?(i)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -218,7 +218,7 @@ class PurifyChamber
|
|||||||
def isPurifiableIgnoreRegular?(set)
|
def isPurifiableIgnoreRegular?(set)
|
||||||
shadow=getShadow(set)
|
shadow=getShadow(set)
|
||||||
return false if !shadow
|
return false if !shadow
|
||||||
return false if shadow.heartgauge!=0
|
return false if shadow.heart_gauge != 0
|
||||||
# Define an exception for Lugia
|
# Define an exception for Lugia
|
||||||
if shadow.isSpecies?(:LUGIA)
|
if shadow.isSpecies?(:LUGIA)
|
||||||
maxtempo=PurifyChamber.maximumTempo()
|
maxtempo=PurifyChamber.maximumTempo()
|
||||||
@@ -237,7 +237,7 @@ class PurifyChamber
|
|||||||
for set in 0...NUMSETS
|
for set in 0...NUMSETS
|
||||||
# If a shadow Pokemon and a regular Pokemon are on the same set
|
# If a shadow Pokemon and a regular Pokemon are on the same set
|
||||||
if @sets[set].shadow
|
if @sets[set].shadow
|
||||||
if @sets[set].shadow.heartgauge>0
|
if @sets[set].shadow.heart_gauge > 0
|
||||||
flow=self.chamberFlow(set)
|
flow=self.chamberFlow(set)
|
||||||
@sets[set].shadow.adjustHeart(-flow)
|
@sets[set].shadow.adjustHeart(-flow)
|
||||||
if isPurifiable?(set)
|
if isPurifiable?(set)
|
||||||
@@ -337,7 +337,7 @@ class PurifyChamberScreen
|
|||||||
@chamber=$PokemonGlobal.purifyChamber
|
@chamber=$PokemonGlobal.purifyChamber
|
||||||
# for j in 0...PurifyChamber::NUMSETS
|
# for j in 0...PurifyChamber::NUMSETS
|
||||||
# @chamber.debugAddShadow(j,rand(100)+1)
|
# @chamber.debugAddShadow(j,rand(100)+1)
|
||||||
# @chamber[j].shadow.heartgauge=0
|
# @chamber[j].shadow.heart_gauge = 0
|
||||||
# for i in 0...PurifyChamber::SETSIZE
|
# for i in 0...PurifyChamber::SETSIZE
|
||||||
# @chamber.debugAddNormal(j,rand(100)+1)
|
# @chamber.debugAddNormal(j,rand(100)+1)
|
||||||
# end
|
# end
|
||||||
@@ -654,8 +654,8 @@ class Window_PurifyChamberSets < Window_DrawableCommand
|
|||||||
end
|
end
|
||||||
if @chamber.getShadow(index)
|
if @chamber.getShadow(index)
|
||||||
pbDrawGauge(self.contents, Rect.new(rect.x+16,rect.y+18,48,8),
|
pbDrawGauge(self.contents, Rect.new(rect.x+16,rect.y+18,48,8),
|
||||||
Color.new(192,0,256), @chamber.getShadow(index).heartgauge,
|
Color.new(192,0,256), @chamber.getShadow(index).heart_gauge,
|
||||||
Pokemon::HEARTGAUGESIZE)
|
Pokemon::HEART_GAUGE_SIZE)
|
||||||
end
|
end
|
||||||
pbDrawTextPositions(self.contents,textpos)
|
pbDrawTextPositions(self.contents,textpos)
|
||||||
end
|
end
|
||||||
@@ -945,8 +945,7 @@ class PurifyChamberSetView < SpriteWrapper
|
|||||||
Color.new(248,248,248),Color.new(128,128,128)])
|
Color.new(248,248,248),Color.new(128,128,128)])
|
||||||
# draw heart gauge
|
# draw heart gauge
|
||||||
pbDrawGauge(@info.bitmap, Rect.new(@info.bitmap.width*3/4,8,@info.bitmap.width*1/4,8),
|
pbDrawGauge(@info.bitmap, Rect.new(@info.bitmap.width*3/4,8,@info.bitmap.width*1/4,8),
|
||||||
Color.new(192,0,256), pkmn.heartgauge,
|
Color.new(192,0,256), pkmn.heart_gauge, Pokemon::HEART_GAUGE_SIZE)
|
||||||
Pokemon::HEARTGAUGESIZE)
|
|
||||||
# draw flow gauge
|
# draw flow gauge
|
||||||
pbDrawGauge(@info.bitmap,Rect.new(@info.bitmap.width*3/4,24+8,@info.bitmap.width*1/4,8),
|
pbDrawGauge(@info.bitmap,Rect.new(@info.bitmap.width*3/4,24+8,@info.bitmap.width*1/4,8),
|
||||||
Color.new(0,0,248),@chamber.chamberFlow(@set),6)
|
Color.new(0,0,248),@chamber.chamberFlow(@set),6)
|
||||||
|
|||||||
@@ -35,7 +35,7 @@ def pbEditMysteryGift(type,item,id=0,giftname="")
|
|||||||
if type==0 # Pokémon
|
if type==0 # Pokémon
|
||||||
commands=[_INTL("Mystery Gift"),
|
commands=[_INTL("Mystery Gift"),
|
||||||
_INTL("Faraway place")]
|
_INTL("Faraway place")]
|
||||||
commands.push(item.obtainText) if item.obtainText && item.obtainText!=""
|
commands.push(item.obtain_text) if item.obtain_text && !item.obtain_text.empty?
|
||||||
commands.push(_INTL("[Custom]"))
|
commands.push(_INTL("[Custom]"))
|
||||||
loop do
|
loop do
|
||||||
command=pbMessage(
|
command=pbMessage(
|
||||||
@@ -43,12 +43,12 @@ def pbEditMysteryGift(type,item,id=0,giftname="")
|
|||||||
if command<0
|
if command<0
|
||||||
return nil if pbConfirmMessage(_INTL("Stop editing this gift?"))
|
return nil if pbConfirmMessage(_INTL("Stop editing this gift?"))
|
||||||
elsif command<commands.length-1
|
elsif command<commands.length-1
|
||||||
item.obtainText=commands[command]
|
item.obtain_text = commands[command]
|
||||||
break
|
break
|
||||||
elsif command==commands.length-1
|
elsif command==commands.length-1
|
||||||
obtainname=pbMessageFreeText(_INTL("Enter a phrase."),"",false,30)
|
obtainname=pbMessageFreeText(_INTL("Enter a phrase."),"",false,30)
|
||||||
if obtainname!=""
|
if obtainname!=""
|
||||||
item.obtainText=obtainname
|
item.obtain_text = obtainname
|
||||||
break
|
break
|
||||||
end
|
end
|
||||||
return nil if pbConfirmMessage(_INTL("Stop editing this gift?"))
|
return nil if pbConfirmMessage(_INTL("Stop editing this gift?"))
|
||||||
@@ -384,13 +384,13 @@ def pbReceiveMysteryGift(id)
|
|||||||
time=pbGetTimeNow
|
time=pbGetTimeNow
|
||||||
gift[2].timeReceived=time.getgm.to_i
|
gift[2].timeReceived=time.getgm.to_i
|
||||||
gift[2].obtain_method = 4 # Fateful encounter
|
gift[2].obtain_method = 4 # Fateful encounter
|
||||||
gift[2].pbRecordFirstMoves
|
gift[2].record_first_moves
|
||||||
if $game_map
|
if $game_map
|
||||||
gift[2].obtainMap=$game_map.map_id
|
gift[2].obtain_map=$game_map.map_id
|
||||||
gift[2].obtainLevel=gift[2].level
|
gift[2].obtain_level=gift[2].level
|
||||||
else
|
else
|
||||||
gift[2].obtainMap=0
|
gift[2].obtain_map=0
|
||||||
gift[2].obtainLevel=gift[2].level
|
gift[2].obtain_level=gift[2].level
|
||||||
end
|
end
|
||||||
if pbAddPokemonSilent(gift[2])
|
if pbAddPokemonSilent(gift[2])
|
||||||
pbMessage(_INTL("\\me[Pkmn get]{1} received {2}!",$Trainer.name,gift[2].name))
|
pbMessage(_INTL("\\me[Pkmn get]{1} received {2}!",$Trainer.name,gift[2].name))
|
||||||
|
|||||||
@@ -19,7 +19,7 @@ def pbStorePokemon(pkmn)
|
|||||||
pbMessage(_INTL("The Pokémon Boxes are full and can't accept any more!"))
|
pbMessage(_INTL("The Pokémon Boxes are full and can't accept any more!"))
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
pkmn.pbRecordFirstMoves
|
pkmn.record_first_moves
|
||||||
if $Trainer.party_full?
|
if $Trainer.party_full?
|
||||||
oldcurbox = $PokemonStorage.currentBox
|
oldcurbox = $PokemonStorage.currentBox
|
||||||
storedbox = $PokemonStorage.pbStoreCaught(pkmn)
|
storedbox = $PokemonStorage.pbStoreCaught(pkmn)
|
||||||
@@ -83,7 +83,7 @@ def pbAddPokemonSilent(pkmn, level = 1, see_form = true)
|
|||||||
$Trainer.seen[pkmn.species] = true
|
$Trainer.seen[pkmn.species] = true
|
||||||
$Trainer.owned[pkmn.species] = true
|
$Trainer.owned[pkmn.species] = true
|
||||||
pbSeenForm(pkmn) if see_form
|
pbSeenForm(pkmn) if see_form
|
||||||
pkmn.pbRecordFirstMoves
|
pkmn.record_first_moves
|
||||||
if $Trainer.party_full?
|
if $Trainer.party_full?
|
||||||
$PokemonStorage.pbStoreCaught(pkmn)
|
$PokemonStorage.pbStoreCaught(pkmn)
|
||||||
else
|
else
|
||||||
@@ -111,7 +111,7 @@ def pbAddToPartySilent(pkmn, level = nil, see_form = true)
|
|||||||
$Trainer.seen[pkmn.species] = true
|
$Trainer.seen[pkmn.species] = true
|
||||||
$Trainer.owned[pkmn.species] = true
|
$Trainer.owned[pkmn.species] = true
|
||||||
pbSeenForm(pkmn) if see_form
|
pbSeenForm(pkmn) if see_form
|
||||||
pkmn.pbRecordFirstMoves
|
pkmn.record_first_moves
|
||||||
$Trainer.party[$Trainer.party.length] = pkmn
|
$Trainer.party[$Trainer.party.length] = pkmn
|
||||||
return true
|
return true
|
||||||
end
|
end
|
||||||
@@ -141,9 +141,9 @@ def pbGenerateEgg(pkmn, text = "")
|
|||||||
return false if !pkmn || $Trainer.party_full?
|
return false if !pkmn || $Trainer.party_full?
|
||||||
pkmn = Pokemon.new(pkmn, EGG_LEVEL) if !pkmn.is_a?(Pokemon)
|
pkmn = Pokemon.new(pkmn, EGG_LEVEL) if !pkmn.is_a?(Pokemon)
|
||||||
# Set egg's details
|
# Set egg's details
|
||||||
pkmn.name = _INTL("Egg")
|
pkmn.name = _INTL("Egg")
|
||||||
pkmn.eggsteps = pkmn.species_data.hatch_steps
|
pkmn.steps_to_hatch = pkmn.species_data.hatch_steps
|
||||||
pkmn.obtainText = text
|
pkmn.obtain_text = text
|
||||||
pkmn.calcStats
|
pkmn.calcStats
|
||||||
# Add egg to party
|
# Add egg to party
|
||||||
$Trainer.party[$Trainer.party.length] = pkmn
|
$Trainer.party[$Trainer.party.length] = pkmn
|
||||||
|
|||||||
@@ -502,7 +502,7 @@ def pbMoveTutorAnnotations(move, movelist = nil)
|
|||||||
if movelist && movelist.any? { |j| j == species }
|
if movelist && movelist.any? { |j| j == species }
|
||||||
# Checked data from movelist given in parameter
|
# Checked data from movelist given in parameter
|
||||||
ret[i] = _INTL("ABLE")
|
ret[i] = _INTL("ABLE")
|
||||||
elsif pkmn.compatibleWithMove?(move)
|
elsif pkmn.compatible_with_move?(move)
|
||||||
# Checked data from Pokémon's tutor moves in pokemon.txt
|
# Checked data from Pokémon's tutor moves in pokemon.txt
|
||||||
ret[i] = _INTL("ABLE")
|
ret[i] = _INTL("ABLE")
|
||||||
else
|
else
|
||||||
@@ -537,7 +537,7 @@ def pbMoveTutorChoose(move,movelist=nil,bymachine=false)
|
|||||||
pbMessage(_INTL("Shadow Pokémon can't be taught any moves.")) { screen.pbUpdate }
|
pbMessage(_INTL("Shadow Pokémon can't be taught any moves.")) { screen.pbUpdate }
|
||||||
elsif movelist && !movelist.any? { |j| j==pokemon.species }
|
elsif movelist && !movelist.any? { |j| j==pokemon.species }
|
||||||
pbMessage(_INTL("{1} can't learn {2}.",pokemon.name,movename)) { screen.pbUpdate }
|
pbMessage(_INTL("{1} can't learn {2}.",pokemon.name,movename)) { screen.pbUpdate }
|
||||||
elsif !pokemon.compatibleWithMove?(move)
|
elsif !pokemon.compatible_with_move?(move)
|
||||||
pbMessage(_INTL("{1} can't learn {2}.",pokemon.name,movename)) { screen.pbUpdate }
|
pbMessage(_INTL("{1} can't learn {2}.",pokemon.name,movename)) { screen.pbUpdate }
|
||||||
else
|
else
|
||||||
if pbLearnMove(pokemon,move,false,bymachine) { screen.pbUpdate }
|
if pbLearnMove(pokemon,move,false,bymachine) { screen.pbUpdate }
|
||||||
|
|||||||
@@ -535,25 +535,25 @@ DebugMenuCommands.register("demoparty", {
|
|||||||
pbSeenForm(pkmn)
|
pbSeenForm(pkmn)
|
||||||
case species
|
case species
|
||||||
when :PIDGEOTTO
|
when :PIDGEOTTO
|
||||||
pkmn.pbLearnMove(:FLY)
|
pkmn.learn_move(:FLY)
|
||||||
when :KADABRA
|
when :KADABRA
|
||||||
pkmn.pbLearnMove(:FLASH)
|
pkmn.learn_move(:FLASH)
|
||||||
pkmn.pbLearnMove(:TELEPORT)
|
pkmn.learn_move(:TELEPORT)
|
||||||
when :GYARADOS
|
when :GYARADOS
|
||||||
pkmn.pbLearnMove(:SURF)
|
pkmn.learn_move(:SURF)
|
||||||
pkmn.pbLearnMove(:DIVE)
|
pkmn.learn_move(:DIVE)
|
||||||
pkmn.pbLearnMove(:WATERFALL)
|
pkmn.learn_move(:WATERFALL)
|
||||||
when :DIGLETT
|
when :DIGLETT
|
||||||
pkmn.pbLearnMove(:DIG)
|
pkmn.learn_move(:DIG)
|
||||||
pkmn.pbLearnMove(:CUT)
|
pkmn.learn_move(:CUT)
|
||||||
pkmn.pbLearnMove(:HEADBUTT)
|
pkmn.learn_move(:HEADBUTT)
|
||||||
pkmn.pbLearnMove(:ROCKSMASH)
|
pkmn.learn_move(:ROCKSMASH)
|
||||||
when :CHANSEY
|
when :CHANSEY
|
||||||
pkmn.pbLearnMove(:SOFTBOILED)
|
pkmn.learn_move(:SOFTBOILED)
|
||||||
pkmn.pbLearnMove(:STRENGTH)
|
pkmn.learn_move(:STRENGTH)
|
||||||
pkmn.pbLearnMove(:SWEETSCENT)
|
pkmn.learn_move(:SWEETSCENT)
|
||||||
end
|
end
|
||||||
pkmn.pbRecordFirstMoves
|
pkmn.record_first_moves
|
||||||
end
|
end
|
||||||
pbMessage(_INTL("Filled party with demo Pokémon."))
|
pbMessage(_INTL("Filled party with demo Pokémon."))
|
||||||
}
|
}
|
||||||
@@ -574,7 +574,7 @@ DebugMenuCommands.register("quickhatch", {
|
|||||||
"name" => _INTL("Quick Hatch"),
|
"name" => _INTL("Quick Hatch"),
|
||||||
"description" => _INTL("Make all eggs in the party require just one more step to hatch."),
|
"description" => _INTL("Make all eggs in the party require just one more step to hatch."),
|
||||||
"effect" => proc {
|
"effect" => proc {
|
||||||
$Trainer.party.each { |pkmn| pkmn.eggsteps = 1 if pkmn.egg? }
|
$Trainer.party.each { |pkmn| pkmn.steps_to_hatch = 1 if pkmn.egg? }
|
||||||
pbMessage(_INTL("All eggs in your party now require one step to hatch."))
|
pbMessage(_INTL("All eggs in your party now require one step to hatch."))
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|||||||
@@ -90,7 +90,7 @@ PokemonDebugMenuCommands.register("setstatus", {
|
|||||||
break if cmd < 0
|
break if cmd < 0
|
||||||
case cmd
|
case cmd
|
||||||
when 0 # Cure
|
when 0 # Cure
|
||||||
pkmn.healStatus
|
pkmn.heal_status
|
||||||
screen.pbDisplay(_INTL("{1}'s status was cured.", pkmn.name))
|
screen.pbDisplay(_INTL("{1}'s status was cured.", pkmn.name))
|
||||||
screen.pbRefreshSingle(pkmnid)
|
screen.pbRefreshSingle(pkmnid)
|
||||||
else # Give status problem
|
else # Give status problem
|
||||||
@@ -510,7 +510,7 @@ PokemonDebugMenuCommands.register("forgetmove", {
|
|||||||
moveindex = screen.pbChooseMove(pkmn, _INTL("Choose move to forget."))
|
moveindex = screen.pbChooseMove(pkmn, _INTL("Choose move to forget."))
|
||||||
if moveindex >= 0
|
if moveindex >= 0
|
||||||
movename = pkmn.moves[moveindex].name
|
movename = pkmn.moves[moveindex].name
|
||||||
pkmn.pbDeleteMoveAtIndex(moveindex)
|
pkmn.forget_move_at_index(moveindex)
|
||||||
screen.pbDisplay(_INTL("{1} forgot {2}.", pkmn.name, movename))
|
screen.pbDisplay(_INTL("{1} forgot {2}.", pkmn.name, movename))
|
||||||
screen.pbRefreshSingle(pkmnid)
|
screen.pbRefreshSingle(pkmnid)
|
||||||
end
|
end
|
||||||
@@ -583,7 +583,7 @@ PokemonDebugMenuCommands.register("setmovepp", {
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
elsif cmd == commands.length - 1 # Restore all PP
|
elsif cmd == commands.length - 1 # Restore all PP
|
||||||
pkmn.healPP
|
pkmn.heal_PP
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
}
|
}
|
||||||
@@ -594,7 +594,7 @@ PokemonDebugMenuCommands.register("setinitialmoves", {
|
|||||||
"name" => _INTL("Reset initial moves"),
|
"name" => _INTL("Reset initial moves"),
|
||||||
"always_show" => true,
|
"always_show" => true,
|
||||||
"effect" => proc { |pkmn, pkmnid, heldpoke, settingUpBattle, screen|
|
"effect" => proc { |pkmn, pkmnid, heldpoke, settingUpBattle, screen|
|
||||||
pkmn.pbRecordFirstMoves
|
pkmn.record_first_moves
|
||||||
screen.pbDisplay(_INTL("{1}'s moves were set as its first-known moves.", pkmn.name))
|
screen.pbDisplay(_INTL("{1}'s moves were set as its first-known moves.", pkmn.name))
|
||||||
screen.pbRefreshSingle(pkmnid)
|
screen.pbRefreshSingle(pkmnid)
|
||||||
}
|
}
|
||||||
@@ -710,7 +710,7 @@ PokemonDebugMenuCommands.register("speciesform", {
|
|||||||
cmd = 0
|
cmd = 0
|
||||||
loop do
|
loop do
|
||||||
msg = [_INTL("Species {1}, form {2}.", pkmn.speciesName, pkmn.form),
|
msg = [_INTL("Species {1}, form {2}.", pkmn.speciesName, pkmn.form),
|
||||||
_INTL("Species {1}, form {2} (forced).", pkmn.speciesName, pkmn.form)][(pkmn.forcedForm != nil) ? 1 : 0]
|
_INTL("Species {1}, form {2} (forced).", pkmn.speciesName, pkmn.form)][(pkmn.forced_form.nil?) ? 0 : 1]
|
||||||
cmd = screen.pbShowCommands(msg, [
|
cmd = screen.pbShowCommands(msg, [
|
||||||
_INTL("Set species"),
|
_INTL("Set species"),
|
||||||
_INTL("Set form"),
|
_INTL("Set form"),
|
||||||
@@ -746,7 +746,7 @@ PokemonDebugMenuCommands.register("speciesform", {
|
|||||||
if f != pkmn.form
|
if f != pkmn.form
|
||||||
if MultipleForms.hasFunction?(pkmn, "getForm")
|
if MultipleForms.hasFunction?(pkmn, "getForm")
|
||||||
next if !screen.pbConfirm(_INTL("This species decides its own form. Override?"))
|
next if !screen.pbConfirm(_INTL("This species decides its own form. Override?"))
|
||||||
pkmn.forcedForm = f
|
pkmn.forced_form = f
|
||||||
end
|
end
|
||||||
pkmn.form = f
|
pkmn.form = f
|
||||||
pbSeenForm(pkmn) if !settingUpBattle
|
pbSeenForm(pkmn) if !settingUpBattle
|
||||||
@@ -754,7 +754,7 @@ PokemonDebugMenuCommands.register("speciesform", {
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
when 2 # Remove form override
|
when 2 # Remove form override
|
||||||
pkmn.forcedForm = nil
|
pkmn.forced_form = nil
|
||||||
screen.pbRefreshSingle(pkmnid)
|
screen.pbRefreshSingle(pkmnid)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
@@ -805,21 +805,21 @@ PokemonDebugMenuCommands.register("setpokeball", {
|
|||||||
balls = []
|
balls = []
|
||||||
for key in $BallTypes.keys
|
for key in $BallTypes.keys
|
||||||
item = GameData::Item.try_get($BallTypes[key])
|
item = GameData::Item.try_get($BallTypes[key])
|
||||||
balls.push([key.to_i, item.name]) if item
|
balls.push([item.id, item.name]) if item
|
||||||
end
|
end
|
||||||
balls.sort! { |a, b| a[1] <=> b[1] }
|
balls.sort! { |a, b| a[1] <=> b[1] }
|
||||||
cmd = 0
|
cmd = 0
|
||||||
for i in 0...balls.length
|
for i in 0...balls.length
|
||||||
next if balls[i][0] != pkmn.ballused
|
next if balls[i][0] != pkmn.poke_ball
|
||||||
cmd = i
|
cmd = i
|
||||||
break
|
break
|
||||||
end
|
end
|
||||||
balls.each { |ball| commands.push(ball[1]) }
|
balls.each { |ball| commands.push(ball[1]) }
|
||||||
loop do
|
loop do
|
||||||
oldball = pbBallTypeToItem(pkmn.ballused).name
|
oldball = GameData::Item.get(pkmn.poke_ball).name
|
||||||
cmd = screen.pbShowCommands(_INTL("{1} used.", oldball), commands, cmd)
|
cmd = screen.pbShowCommands(_INTL("{1} used.", oldball), commands, cmd)
|
||||||
break if cmd < 0
|
break if cmd < 0
|
||||||
pkmn.ballused = balls[cmd][0]
|
pkmn.poke_ball = balls[cmd][0]
|
||||||
end
|
end
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
@@ -838,7 +838,7 @@ PokemonDebugMenuCommands.register("setribbons", {
|
|||||||
end
|
end
|
||||||
commands.push(_INTL("Give all"))
|
commands.push(_INTL("Give all"))
|
||||||
commands.push(_INTL("Clear all"))
|
commands.push(_INTL("Clear all"))
|
||||||
cmd = screen.pbShowCommands(_INTL("{1} ribbons.", pkmn.ribbonCount), commands, cmd)
|
cmd = screen.pbShowCommands(_INTL("{1} ribbons.", pkmn.numRibbons), commands, cmd)
|
||||||
break if cmd < 0
|
break if cmd < 0
|
||||||
if cmd >= 0 && cmd < PBRibbons.maxValue # Toggle ribbon
|
if cmd >= 0 && cmd < PBRibbons.maxValue # Toggle ribbon
|
||||||
if pkmn.hasRibbon?(cmd + 1)
|
if pkmn.hasRibbon?(cmd + 1)
|
||||||
@@ -940,34 +940,34 @@ PokemonDebugMenuCommands.register("setegg", {
|
|||||||
cmd = 0
|
cmd = 0
|
||||||
loop do
|
loop do
|
||||||
msg = [_INTL("Not an egg"),
|
msg = [_INTL("Not an egg"),
|
||||||
_INTL("Egg with eggsteps: {1}.", pkmn.eggsteps)][pkmn.egg? ? 1 : 0]
|
_INTL("Egg (hatches in {1} steps).", pkmn.steps_to_hatch)][pkmn.egg? ? 1 : 0]
|
||||||
cmd = screen.pbShowCommands(msg, [
|
cmd = screen.pbShowCommands(msg, [
|
||||||
_INTL("Make egg"),
|
_INTL("Make egg"),
|
||||||
_INTL("Make Pokémon"),
|
_INTL("Make Pokémon"),
|
||||||
_INTL("Set eggsteps to 1")], cmd)
|
_INTL("Set steps left to 1")], cmd)
|
||||||
break if cmd < 0
|
break if cmd < 0
|
||||||
case cmd
|
case cmd
|
||||||
when 0 # Make egg
|
when 0 # Make egg
|
||||||
if !pkmn.egg? && (pbHasEgg?(pkmn.species) ||
|
if !pkmn.egg? && (pbHasEgg?(pkmn.species) ||
|
||||||
screen.pbConfirm(_INTL("{1} cannot legally be an egg. Make egg anyway?", pkmn.speciesName)))
|
screen.pbConfirm(_INTL("{1} cannot legally be an egg. Make egg anyway?", pkmn.speciesName)))
|
||||||
pkmn.level = EGG_LEVEL
|
pkmn.level = EGG_LEVEL
|
||||||
pkmn.calcStats
|
pkmn.calcStats
|
||||||
pkmn.name = _INTL("Egg")
|
pkmn.name = _INTL("Egg")
|
||||||
pkmn.eggsteps = pkmn.species_data.hatch_steps
|
pkmn.steps_to_hatch = pkmn.species_data.hatch_steps
|
||||||
pkmn.hatchedMap = 0
|
pkmn.hatched_map = 0
|
||||||
pkmn.obtain_method = 1
|
pkmn.obtain_method = 1
|
||||||
screen.pbRefreshSingle(pkmnid)
|
screen.pbRefreshSingle(pkmnid)
|
||||||
end
|
end
|
||||||
when 1 # Make Pokémon
|
when 1 # Make Pokémon
|
||||||
if pkmn.egg?
|
if pkmn.egg?
|
||||||
pkmn.name = nil
|
pkmn.name = nil
|
||||||
pkmn.eggsteps = 0
|
pkmn.steps_to_hatch = 0
|
||||||
pkmn.hatchedMap = 0
|
pkmn.hatched_map = 0
|
||||||
pkmn.obtain_method = 0
|
pkmn.obtain_method = 0
|
||||||
screen.pbRefreshSingle(pkmnid)
|
screen.pbRefreshSingle(pkmnid)
|
||||||
end
|
end
|
||||||
when 2 # Set eggsteps to 1
|
when 2 # Set steps left to 1
|
||||||
pkmn.eggsteps = 1 if pkmn.egg?
|
pkmn.steps_to_hatch = 1 if pkmn.egg?
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
}
|
}
|
||||||
@@ -981,7 +981,7 @@ PokemonDebugMenuCommands.register("shadowpkmn", {
|
|||||||
cmd = 0
|
cmd = 0
|
||||||
loop do
|
loop do
|
||||||
msg = [_INTL("Not a Shadow Pokémon."),
|
msg = [_INTL("Not a Shadow Pokémon."),
|
||||||
_INTL("Heart gauge is {1} (stage {2}).", pkmn.heartgauge, pkmn.heartStage)
|
_INTL("Heart gauge is {1} (stage {2}).", pkmn.heart_gauge, pkmn.heartStage)
|
||||||
][pkmn.shadowPokemon? ? 1 : 0]
|
][pkmn.shadowPokemon? ? 1 : 0]
|
||||||
cmd = screen.pbShowCommands(msg, [
|
cmd = screen.pbShowCommands(msg, [
|
||||||
_INTL("Make Shadow"),
|
_INTL("Make Shadow"),
|
||||||
@@ -997,16 +997,16 @@ PokemonDebugMenuCommands.register("shadowpkmn", {
|
|||||||
end
|
end
|
||||||
when 1 # Set heart gauge
|
when 1 # Set heart gauge
|
||||||
if pkmn.shadowPokemon?
|
if pkmn.shadowPokemon?
|
||||||
oldheart = pkmn.heartgauge
|
oldheart = pkmn.heart_gauge
|
||||||
params = ChooseNumberParams.new
|
params = ChooseNumberParams.new
|
||||||
params.setRange(0, Pokemon::HEARTGAUGESIZE)
|
params.setRange(0, Pokemon::HEART_GAUGE_SIZE)
|
||||||
params.setDefaultValue(pkmn.heartgauge)
|
params.setDefaultValue(pkmn.heart_gauge)
|
||||||
val = pbMessageChooseNumber(
|
val = pbMessageChooseNumber(
|
||||||
_INTL("Set the heart gauge (max. {1}).", Pokemon::HEARTGAUGESIZE),
|
_INTL("Set the heart gauge (max. {1}).", Pokemon::HEART_GAUGE_SIZE),
|
||||||
params) { screen.pbUpdate }
|
params) { screen.pbUpdate }
|
||||||
if val != oldheart
|
if val != oldheart
|
||||||
pkmn.adjustHeart(val - oldheart)
|
pkmn.adjustHeart(val - oldheart)
|
||||||
pbReadyToPurify(pkmn)
|
pkmn.check_ready_to_purify
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
screen.pbDisplay(_INTL("{1} is not a Shadow Pokémon.", pkmn.name))
|
screen.pbDisplay(_INTL("{1} is not a Shadow Pokémon.", pkmn.name))
|
||||||
|
|||||||
Reference in New Issue
Block a user