mirror of
https://github.com/infinitefusion/infinitefusion-e18.git
synced 2025-12-06 06:01:46 +00:00
Hard mode
This commit is contained in:
@@ -6,29 +6,29 @@ class PokeBattle_Battle
|
||||
# battle.
|
||||
# NOTE: Messages are only shown while in the party screen when choosing a
|
||||
# command for the next round.
|
||||
def pbCanSwitchLax?(idxBattler,idxParty,partyScene=nil)
|
||||
return true if idxParty<0
|
||||
def pbCanSwitchLax?(idxBattler, idxParty, partyScene = nil)
|
||||
return true if idxParty < 0
|
||||
party = pbParty(idxBattler)
|
||||
return false if idxParty>=party.length
|
||||
return false if idxParty >= party.length
|
||||
return false if !party[idxParty]
|
||||
if party[idxParty].egg?
|
||||
partyScene.pbDisplay(_INTL("An Egg can't battle!")) if partyScene
|
||||
return false
|
||||
end
|
||||
if !pbIsOwner?(idxBattler,idxParty)
|
||||
owner = pbGetOwnerFromPartyIndex(idxBattler,idxParty)
|
||||
if !pbIsOwner?(idxBattler, idxParty)
|
||||
owner = pbGetOwnerFromPartyIndex(idxBattler, idxParty)
|
||||
partyScene.pbDisplay(_INTL("You can't switch {1}'s Pokémon with one of yours!",
|
||||
owner.name)) if partyScene
|
||||
owner.name)) if partyScene
|
||||
return false
|
||||
end
|
||||
if party[idxParty].fainted?
|
||||
partyScene.pbDisplay(_INTL("{1} has no energy left to battle!",
|
||||
party[idxParty].name)) if partyScene
|
||||
party[idxParty].name)) if partyScene
|
||||
return false
|
||||
end
|
||||
if pbFindBattler(idxParty,idxBattler)
|
||||
if pbFindBattler(idxParty, idxBattler)
|
||||
partyScene.pbDisplay(_INTL("{1} is already in battle!",
|
||||
party[idxParty].name)) if partyScene
|
||||
party[idxParty].name)) if partyScene
|
||||
return false
|
||||
end
|
||||
return true
|
||||
@@ -38,15 +38,15 @@ class PokeBattle_Battle
|
||||
# switch out (and that its replacement at party index idxParty can switch in).
|
||||
# NOTE: Messages are only shown while in the party screen when choosing a
|
||||
# command for the next round.
|
||||
def pbCanSwitch?(idxBattler,idxParty=-1,partyScene=nil)
|
||||
def pbCanSwitch?(idxBattler, idxParty = -1, partyScene = nil)
|
||||
# Check whether party Pokémon can switch in
|
||||
return false if !pbCanSwitchLax?(idxBattler,idxParty,partyScene)
|
||||
return false if !pbCanSwitchLax?(idxBattler, idxParty, partyScene)
|
||||
# Make sure another battler isn't already choosing to switch to the party
|
||||
# Pokémon
|
||||
eachSameSideBattler(idxBattler) do |b|
|
||||
next if choices[b.index][0]!=:SwitchOut || choices[b.index][1]!=idxParty
|
||||
next if choices[b.index][0] != :SwitchOut || choices[b.index][1] != idxParty
|
||||
partyScene.pbDisplay(_INTL("{1} has already been selected.",
|
||||
pbParty(idxBattler)[idxParty].name)) if partyScene
|
||||
pbParty(idxBattler)[idxParty].name)) if partyScene
|
||||
return false
|
||||
end
|
||||
# Check whether battler can switch out
|
||||
@@ -54,39 +54,39 @@ class PokeBattle_Battle
|
||||
return true if battler.fainted?
|
||||
# Ability/item effects that allow switching no matter what
|
||||
if battler.abilityActive?
|
||||
if BattleHandlers.triggerCertainSwitchingUserAbility(battler.ability,battler,self)
|
||||
if BattleHandlers.triggerCertainSwitchingUserAbility(battler.ability, battler, self)
|
||||
return true
|
||||
end
|
||||
end
|
||||
if battler.itemActive?
|
||||
if BattleHandlers.triggerCertainSwitchingUserItem(battler.item,battler,self)
|
||||
if BattleHandlers.triggerCertainSwitchingUserItem(battler.item, battler, self)
|
||||
return true
|
||||
end
|
||||
end
|
||||
# Other certain switching effects
|
||||
return true if Settings::MORE_TYPE_EFFECTS && battler.pbHasType?(:GHOST)
|
||||
# Other certain trapping effects
|
||||
if battler.effects[PBEffects::Trapping]>0 ||
|
||||
battler.effects[PBEffects::MeanLook]>=0 ||
|
||||
battler.effects[PBEffects::Ingrain] ||
|
||||
@field.effects[PBEffects::FairyLock]>0
|
||||
partyScene.pbDisplay(_INTL("{1} can't be switched out!",battler.pbThis)) if partyScene
|
||||
if battler.effects[PBEffects::Trapping] > 0 ||
|
||||
battler.effects[PBEffects::MeanLook] >= 0 ||
|
||||
battler.effects[PBEffects::Ingrain] ||
|
||||
@field.effects[PBEffects::FairyLock] > 0
|
||||
partyScene.pbDisplay(_INTL("{1} can't be switched out!", battler.pbThis)) if partyScene
|
||||
return false
|
||||
end
|
||||
# Trapping abilities/items
|
||||
eachOtherSideBattler(idxBattler) do |b|
|
||||
next if !b.abilityActive?
|
||||
if BattleHandlers.triggerTrappingTargetAbility(b.ability,battler,b,self)
|
||||
if BattleHandlers.triggerTrappingTargetAbility(b.ability, battler, b, self)
|
||||
partyScene.pbDisplay(_INTL("{1}'s {2} prevents switching!",
|
||||
b.pbThis,b.abilityName)) if partyScene
|
||||
b.pbThis, b.abilityName)) if partyScene
|
||||
return false
|
||||
end
|
||||
end
|
||||
eachOtherSideBattler(idxBattler) do |b|
|
||||
next if !b.itemActive?
|
||||
if BattleHandlers.triggerTrappingTargetItem(b.item,battler,b,self)
|
||||
if BattleHandlers.triggerTrappingTargetItem(b.item, battler, b, self)
|
||||
partyScene.pbDisplay(_INTL("{1}'s {2} prevents switching!",
|
||||
b.pbThis,b.itemName)) if partyScene
|
||||
b.pbThis, b.itemName)) if partyScene
|
||||
return false
|
||||
end
|
||||
end
|
||||
@@ -94,16 +94,16 @@ class PokeBattle_Battle
|
||||
end
|
||||
|
||||
def pbCanChooseNonActive?(idxBattler)
|
||||
pbParty(idxBattler).each_with_index do |_pkmn,i|
|
||||
return true if pbCanSwitchLax?(idxBattler,i)
|
||||
pbParty(idxBattler).each_with_index do |_pkmn, i|
|
||||
return true if pbCanSwitchLax?(idxBattler, i)
|
||||
end
|
||||
return false
|
||||
end
|
||||
|
||||
def pbRegisterSwitch(idxBattler,idxParty)
|
||||
return false if !pbCanSwitch?(idxBattler,idxParty)
|
||||
def pbRegisterSwitch(idxBattler, idxParty)
|
||||
return false if !pbCanSwitch?(idxBattler, idxParty)
|
||||
@choices[idxBattler][0] = :SwitchOut
|
||||
@choices[idxBattler][1] = idxParty # Party index of Pokémon to switch in
|
||||
@choices[idxBattler][1] = idxParty # Party index of Pokémon to switch in
|
||||
@choices[idxBattler][2] = nil
|
||||
return true
|
||||
end
|
||||
@@ -114,16 +114,16 @@ class PokeBattle_Battle
|
||||
#=============================================================================
|
||||
# Open party screen and potentially choose a Pokémon to switch with. Used in
|
||||
# all instances where the party screen is opened.
|
||||
def pbPartyScreen(idxBattler,checkLaxOnly=false,canCancel=false,shouldRegister=false)
|
||||
def pbPartyScreen(idxBattler, checkLaxOnly = false, canCancel = false, shouldRegister = false)
|
||||
ret = -1
|
||||
@scene.pbPartyScreen(idxBattler,canCancel) { |idxParty,partyScene|
|
||||
@scene.pbPartyScreen(idxBattler, canCancel) { |idxParty, partyScene|
|
||||
if checkLaxOnly
|
||||
next false if !pbCanSwitchLax?(idxBattler,idxParty,partyScene)
|
||||
next false if !pbCanSwitchLax?(idxBattler, idxParty, partyScene)
|
||||
else
|
||||
next false if !pbCanSwitch?(idxBattler,idxParty,partyScene)
|
||||
next false if !pbCanSwitch?(idxBattler, idxParty, partyScene)
|
||||
end
|
||||
if shouldRegister
|
||||
next false if idxParty<0 || !pbRegisterSwitch(idxBattler,idxParty)
|
||||
next false if idxParty < 0 || !pbRegisterSwitch(idxBattler, idxParty)
|
||||
end
|
||||
ret = idxParty
|
||||
next true
|
||||
@@ -133,9 +133,9 @@ class PokeBattle_Battle
|
||||
|
||||
# For choosing a replacement Pokémon when prompted in the middle of other
|
||||
# things happening (U-turn, Baton Pass, in def pbSwitch).
|
||||
def pbSwitchInBetween(idxBattler,checkLaxOnly=false,canCancel=false)
|
||||
return pbPartyScreen(idxBattler,checkLaxOnly,canCancel) if pbOwnedByPlayer?(idxBattler)
|
||||
return @battleAI.pbDefaultChooseNewEnemy(idxBattler,pbParty(idxBattler))
|
||||
def pbSwitchInBetween(idxBattler, checkLaxOnly = false, canCancel = false)
|
||||
return pbPartyScreen(idxBattler, checkLaxOnly, canCancel) if pbOwnedByPlayer?(idxBattler)
|
||||
return @battleAI.pbDefaultChooseNewEnemy(idxBattler, pbParty(idxBattler))
|
||||
end
|
||||
|
||||
#=============================================================================
|
||||
@@ -143,11 +143,11 @@ class PokeBattle_Battle
|
||||
#=============================================================================
|
||||
# General switching method that checks if any Pokémon need to be sent out and,
|
||||
# if so, does. Called at the end of each round.
|
||||
def pbEORSwitch(favorDraws=false)
|
||||
return if @decision>0 && !favorDraws
|
||||
return if @decision==5 && favorDraws
|
||||
def pbEORSwitch(favorDraws = false)
|
||||
return if @decision > 0 && !favorDraws
|
||||
return if @decision == 5 && favorDraws
|
||||
pbJudge
|
||||
return if @decision>0
|
||||
return if @decision > 0
|
||||
# Check through each fainted battler to see if that spot can be filled.
|
||||
switched = []
|
||||
loop do
|
||||
@@ -156,103 +156,106 @@ class PokeBattle_Battle
|
||||
next if !b || !b.fainted?
|
||||
idxBattler = b.index
|
||||
next if !pbCanChooseNonActive?(idxBattler)
|
||||
if !pbOwnedByPlayer?(idxBattler) # Opponent/ally is switching in
|
||||
next if wildBattle? && opposes?(idxBattler) # Wild Pokémon can't switch
|
||||
if !pbOwnedByPlayer?(idxBattler) # Opponent/ally is switching in
|
||||
next if wildBattle? && opposes?(idxBattler) # Wild Pokémon can't switch
|
||||
idxPartyNew = pbSwitchInBetween(idxBattler)
|
||||
opponent = pbGetOwnerFromBattlerIndex(idxBattler)
|
||||
# NOTE: The player is only offered the chance to switch their own
|
||||
# Pokémon when an opponent replaces a fainted Pokémon in single
|
||||
# battles. In double battles, etc. there is no such offer.
|
||||
if @internalBattle && @switchStyle && trainerBattle? && pbSideSize(0)==1 &&
|
||||
opposes?(idxBattler) && !@battlers[0].fainted? && !switched.include?(0) &&
|
||||
pbCanChooseNonActive?(0) && @battlers[0].effects[PBEffects::Outrage]==0
|
||||
if @internalBattle && @switchStyle && trainerBattle? && pbSideSize(0) == 1 &&
|
||||
opposes?(idxBattler) && !@battlers[0].fainted? && !switched.include?(0) &&
|
||||
pbCanChooseNonActive?(0) && @battlers[0].effects[PBEffects::Outrage] == 0
|
||||
idxPartyForName = idxPartyNew
|
||||
enemyParty = pbParty(idxBattler)
|
||||
if enemyParty[idxPartyNew].ability == :ILLUSION
|
||||
new_index = pbLastInTeam(idxBattler)
|
||||
idxPartyForName = new_index if new_index >= 0 && new_index != idxPartyNew
|
||||
end
|
||||
if pbDisplayConfirm(_INTL("{1} is about to send in {2}. Will you switch your Pokémon?",
|
||||
opponent.full_name, enemyParty[idxPartyForName].name))
|
||||
idxPlayerPartyNew = pbSwitchInBetween(0,false,true)
|
||||
if idxPlayerPartyNew>=0
|
||||
switchMessageHard = _INTL("{1} is about to send in a new Pokémon. Will you switch your Pokémon?", opponent.fullname)
|
||||
switchMessageNormal = _INTL("{1} is about to send in {2}. Will you switch your Pokémon?", opponent.full_name, enemyParty[idxPartyForName].name)
|
||||
switchMessage = $game_switches[GAME_DIFFICULTY_HARD] ? switchMessageHard : switchMessageNormal
|
||||
if pbDisplayConfirm(switchMessage)
|
||||
idxPlayerPartyNew = pbSwitchInBetween(0, false, true)
|
||||
if idxPlayerPartyNew >= 0
|
||||
pbMessageOnRecall(@battlers[0])
|
||||
pbRecallAndReplace(0,idxPlayerPartyNew)
|
||||
pbRecallAndReplace(0, idxPlayerPartyNew)
|
||||
switched.push(0)
|
||||
end
|
||||
end
|
||||
end
|
||||
pbRecallAndReplace(idxBattler,idxPartyNew)
|
||||
pbRecallAndReplace(idxBattler, idxPartyNew)
|
||||
switched.push(idxBattler)
|
||||
elsif trainerBattle? # Player switches in in a trainer battle
|
||||
idxPlayerPartyNew = pbGetReplacementPokemonIndex(idxBattler) # Owner chooses
|
||||
pbRecallAndReplace(idxBattler,idxPlayerPartyNew)
|
||||
elsif trainerBattle? # Player switches in in a trainer battle
|
||||
idxPlayerPartyNew = pbGetReplacementPokemonIndex(idxBattler) # Owner chooses
|
||||
pbRecallAndReplace(idxBattler, idxPlayerPartyNew)
|
||||
switched.push(idxBattler)
|
||||
else # Player's Pokémon has fainted in a wild battle
|
||||
else
|
||||
# Player's Pokémon has fainted in a wild battle
|
||||
switch = false
|
||||
if !pbDisplayConfirm(_INTL("Use next Pokémon?"))
|
||||
switch = (pbRun(idxBattler,true)<=0)
|
||||
switch = (pbRun(idxBattler, true) <= 0)
|
||||
else
|
||||
switch = true
|
||||
end
|
||||
if switch
|
||||
idxPlayerPartyNew = pbGetReplacementPokemonIndex(idxBattler) # Owner chooses
|
||||
pbRecallAndReplace(idxBattler,idxPlayerPartyNew)
|
||||
idxPlayerPartyNew = pbGetReplacementPokemonIndex(idxBattler) # Owner chooses
|
||||
pbRecallAndReplace(idxBattler, idxPlayerPartyNew)
|
||||
switched.push(idxBattler)
|
||||
end
|
||||
end
|
||||
end
|
||||
break if switched.length==0
|
||||
break if switched.length == 0
|
||||
pbPriority(true).each do |b|
|
||||
b.pbEffectsOnSwitchIn(true) if switched.include?(b.index)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
def pbGetReplacementPokemonIndex(idxBattler,random=false)
|
||||
def pbGetReplacementPokemonIndex(idxBattler, random = false)
|
||||
if random
|
||||
return -1 if !pbCanSwitch?(idxBattler) # Can battler switch out?
|
||||
choices = [] # Find all Pokémon that can switch in
|
||||
eachInTeamFromBattlerIndex(idxBattler) do |_pkmn,i|
|
||||
choices.push(i) if pbCanSwitchLax?(idxBattler,i)
|
||||
return -1 if !pbCanSwitch?(idxBattler) # Can battler switch out?
|
||||
choices = [] # Find all Pokémon that can switch in
|
||||
eachInTeamFromBattlerIndex(idxBattler) do |_pkmn, i|
|
||||
choices.push(i) if pbCanSwitchLax?(idxBattler, i)
|
||||
end
|
||||
return -1 if choices.length==0
|
||||
return -1 if choices.length == 0
|
||||
return choices[pbRandom(choices.length)]
|
||||
else
|
||||
return pbSwitchInBetween(idxBattler,true)
|
||||
return pbSwitchInBetween(idxBattler, true)
|
||||
end
|
||||
end
|
||||
|
||||
# Actually performs the recalling and sending out in all situations.
|
||||
def pbRecallAndReplace(idxBattler,idxParty,randomReplacement=false,batonPass=false)
|
||||
def pbRecallAndReplace(idxBattler, idxParty, randomReplacement = false, batonPass = false)
|
||||
@scene.pbRecall(idxBattler) if !@battlers[idxBattler].fainted?
|
||||
@battlers[idxBattler].pbAbilitiesOnSwitchOut # Inc. primordial weather check
|
||||
@scene.pbShowPartyLineup(idxBattler&1) if pbSideSize(idxBattler)==1
|
||||
pbMessagesOnReplace(idxBattler,idxParty) if !randomReplacement
|
||||
pbReplace(idxBattler,idxParty,batonPass)
|
||||
@battlers[idxBattler].pbAbilitiesOnSwitchOut # Inc. primordial weather check
|
||||
@scene.pbShowPartyLineup(idxBattler & 1) if pbSideSize(idxBattler) == 1
|
||||
pbMessagesOnReplace(idxBattler, idxParty) if !randomReplacement
|
||||
pbReplace(idxBattler, idxParty, batonPass)
|
||||
end
|
||||
|
||||
def pbMessageOnRecall(battler)
|
||||
if battler.pbOwnedByPlayer?
|
||||
if battler.hp<=battler.totalhp/4
|
||||
pbDisplayBrief(_INTL("Good job, {1}! Come back!",battler.name))
|
||||
elsif battler.hp<=battler.totalhp/2
|
||||
pbDisplayBrief(_INTL("OK, {1}! Come back!",battler.name))
|
||||
elsif battler.turnCount>=5
|
||||
pbDisplayBrief(_INTL("{1}, that's enough! Come back!",battler.name))
|
||||
elsif battler.turnCount>=2
|
||||
pbDisplayBrief(_INTL("{1}, come back!",battler.name))
|
||||
if battler.hp <= battler.totalhp / 4
|
||||
pbDisplayBrief(_INTL("Good job, {1}! Come back!", battler.name))
|
||||
elsif battler.hp <= battler.totalhp / 2
|
||||
pbDisplayBrief(_INTL("OK, {1}! Come back!", battler.name))
|
||||
elsif battler.turnCount >= 5
|
||||
pbDisplayBrief(_INTL("{1}, that's enough! Come back!", battler.name))
|
||||
elsif battler.turnCount >= 2
|
||||
pbDisplayBrief(_INTL("{1}, come back!", battler.name))
|
||||
else
|
||||
pbDisplayBrief(_INTL("{1}, switch out! Come back!",battler.name))
|
||||
pbDisplayBrief(_INTL("{1}, switch out! Come back!", battler.name))
|
||||
end
|
||||
else
|
||||
owner = pbGetOwnerName(battler.index)
|
||||
pbDisplayBrief(_INTL("{1} withdrew {2}!",owner,battler.name))
|
||||
pbDisplayBrief(_INTL("{1} withdrew {2}!", owner, battler.name))
|
||||
end
|
||||
end
|
||||
|
||||
# Only called from def pbRecallAndReplace and Battle Arena's def pbSwitch.
|
||||
def pbMessagesOnReplace(idxBattler,idxParty)
|
||||
def pbMessagesOnReplace(idxBattler, idxParty)
|
||||
party = pbParty(idxBattler)
|
||||
newPkmnName = party[idxParty].name
|
||||
if party[idxParty].ability == :ILLUSION
|
||||
@@ -261,45 +264,45 @@ class PokeBattle_Battle
|
||||
end
|
||||
if pbOwnedByPlayer?(idxBattler)
|
||||
opposing = @battlers[idxBattler].pbDirectOpposing
|
||||
if opposing.fainted? || opposing.hp==opposing.totalhp
|
||||
pbDisplayBrief(_INTL("You're in charge, {1}!",newPkmnName))
|
||||
elsif opposing.hp>=opposing.totalhp/2
|
||||
pbDisplayBrief(_INTL("Go for it, {1}!",newPkmnName))
|
||||
elsif opposing.hp>=opposing.totalhp/4
|
||||
pbDisplayBrief(_INTL("Just a little more! Hang in there, {1}!",newPkmnName))
|
||||
if opposing.fainted? || opposing.hp == opposing.totalhp
|
||||
pbDisplayBrief(_INTL("You're in charge, {1}!", newPkmnName))
|
||||
elsif opposing.hp >= opposing.totalhp / 2
|
||||
pbDisplayBrief(_INTL("Go for it, {1}!", newPkmnName))
|
||||
elsif opposing.hp >= opposing.totalhp / 4
|
||||
pbDisplayBrief(_INTL("Just a little more! Hang in there, {1}!", newPkmnName))
|
||||
else
|
||||
pbDisplayBrief(_INTL("Your opponent's weak! Get 'em, {1}!",newPkmnName))
|
||||
pbDisplayBrief(_INTL("Your opponent's weak! Get 'em, {1}!", newPkmnName))
|
||||
end
|
||||
else
|
||||
owner = pbGetOwnerFromBattlerIndex(idxBattler)
|
||||
pbDisplayBrief(_INTL("{1} sent out {2}!",owner.full_name,newPkmnName))
|
||||
pbDisplayBrief(_INTL("{1} sent out {2}!", owner.full_name, newPkmnName))
|
||||
end
|
||||
end
|
||||
|
||||
# Only called from def pbRecallAndReplace above and Battle Arena's def
|
||||
# pbSwitch.
|
||||
def pbReplace(idxBattler,idxParty,batonPass=false)
|
||||
def pbReplace(idxBattler, idxParty, batonPass = false)
|
||||
party = pbParty(idxBattler)
|
||||
idxPartyOld = @battlers[idxBattler].pokemonIndex
|
||||
# Initialise the new Pokémon
|
||||
@battlers[idxBattler].pbInitialize(party[idxParty],idxParty,batonPass)
|
||||
@battlers[idxBattler].pbInitialize(party[idxParty], idxParty, batonPass)
|
||||
# Reorder the party for this battle
|
||||
partyOrder = pbPartyOrder(idxBattler)
|
||||
partyOrder[idxParty],partyOrder[idxPartyOld] = partyOrder[idxPartyOld],partyOrder[idxParty]
|
||||
partyOrder[idxParty], partyOrder[idxPartyOld] = partyOrder[idxPartyOld], partyOrder[idxParty]
|
||||
# Send out the new Pokémon
|
||||
pbSendOut([[idxBattler,party[idxParty]]])
|
||||
pbCalculatePriority(false,[idxBattler]) if Settings::RECALCULATE_TURN_ORDER_AFTER_SPEED_CHANGES
|
||||
pbSendOut([[idxBattler, party[idxParty]]])
|
||||
pbCalculatePriority(false, [idxBattler]) if Settings::RECALCULATE_TURN_ORDER_AFTER_SPEED_CHANGES
|
||||
end
|
||||
|
||||
# Called from def pbReplace above and at the start of battle.
|
||||
# sendOuts is an array; each element is itself an array: [idxBattler,pkmn]
|
||||
def pbSendOut(sendOuts,startBattle=false)
|
||||
sendOuts.each { |b| @peer.pbOnEnteringBattle(self,b[1]) }
|
||||
@scene.pbSendOutBattlers(sendOuts,startBattle)
|
||||
def pbSendOut(sendOuts, startBattle = false)
|
||||
sendOuts.each { |b| @peer.pbOnEnteringBattle(self, b[1]) }
|
||||
@scene.pbSendOutBattlers(sendOuts, startBattle)
|
||||
sendOuts.each do |b|
|
||||
@scene.pbResetMoveIndex(b[0])
|
||||
#pbSetSeen(@battlers[b[0]])
|
||||
@usedInBattle[b[0]&1][b[0]/2] = true
|
||||
@usedInBattle[b[0] & 1][b[0] / 2] = true
|
||||
end
|
||||
end
|
||||
|
||||
@@ -321,7 +324,7 @@ class PokeBattle_Battle
|
||||
return false if battler.fainted?
|
||||
# Introduce Shadow Pokémon
|
||||
if battler.opposes? && battler.shadowPokemon?
|
||||
pbCommonAnimation("Shadow",battler)
|
||||
pbCommonAnimation("Shadow", battler)
|
||||
pbDisplay(_INTL("Oh!\nA Shadow Pokémon!"))
|
||||
end
|
||||
# Record money-doubling effect of Amulet Coin/Luck Incense
|
||||
@@ -332,16 +335,16 @@ class PokeBattle_Battle
|
||||
eachBattler { |b| b.pbUpdateParticipants }
|
||||
# Healing Wish
|
||||
if @positions[battler.index].effects[PBEffects::HealingWish]
|
||||
pbCommonAnimation("HealingWish",battler)
|
||||
pbDisplay(_INTL("The healing wish came true for {1}!",battler.pbThis(true)))
|
||||
pbCommonAnimation("HealingWish", battler)
|
||||
pbDisplay(_INTL("The healing wish came true for {1}!", battler.pbThis(true)))
|
||||
battler.pbRecoverHP(battler.totalhp)
|
||||
battler.pbCureStatus(false)
|
||||
@positions[battler.index].effects[PBEffects::HealingWish] = false
|
||||
end
|
||||
# Lunar Dance
|
||||
if @positions[battler.index].effects[PBEffects::LunarDance]
|
||||
pbCommonAnimation("LunarDance",battler)
|
||||
pbDisplay(_INTL("{1} became cloaked in mystical moonlight!",battler.pbThis))
|
||||
pbCommonAnimation("LunarDance", battler)
|
||||
pbDisplay(_INTL("{1} became cloaked in mystical moonlight!", battler.pbThis))
|
||||
battler.pbRecoverHP(battler.totalhp)
|
||||
battler.pbCureStatus(false)
|
||||
battler.eachMove { |m| m.pp = m.total_pp }
|
||||
@@ -350,52 +353,52 @@ class PokeBattle_Battle
|
||||
# Entry hazards
|
||||
# Stealth Rock
|
||||
if battler.pbOwnSide.effects[PBEffects::StealthRock] && battler.takesIndirectDamage? &&
|
||||
GameData::Type.exists?(:ROCK)
|
||||
GameData::Type.exists?(:ROCK)
|
||||
bTypes = battler.pbTypes(true)
|
||||
eff = Effectiveness.calculate(:ROCK, bTypes[0], bTypes[1], bTypes[2])
|
||||
if !Effectiveness.ineffective?(eff)
|
||||
eff = eff.to_f / Effectiveness::NORMAL_EFFECTIVE
|
||||
oldHP = battler.hp
|
||||
battler.pbReduceHP(battler.totalhp*eff/8,false)
|
||||
pbDisplay(_INTL("Pointed stones dug into {1}!",battler.pbThis))
|
||||
battler.pbReduceHP(battler.totalhp * eff / 8, false)
|
||||
pbDisplay(_INTL("Pointed stones dug into {1}!", battler.pbThis))
|
||||
battler.pbItemHPHealCheck
|
||||
if battler.pbAbilitiesOnDamageTaken(oldHP) # Switched out
|
||||
return pbOnActiveOne(battler) # For replacement battler
|
||||
if battler.pbAbilitiesOnDamageTaken(oldHP) # Switched out
|
||||
return pbOnActiveOne(battler) # For replacement battler
|
||||
end
|
||||
end
|
||||
end
|
||||
# Spikes
|
||||
if battler.pbOwnSide.effects[PBEffects::Spikes]>0 && battler.takesIndirectDamage? &&
|
||||
!battler.airborne?
|
||||
spikesDiv = [8,6,4][battler.pbOwnSide.effects[PBEffects::Spikes]-1]
|
||||
if battler.pbOwnSide.effects[PBEffects::Spikes] > 0 && battler.takesIndirectDamage? &&
|
||||
!battler.airborne?
|
||||
spikesDiv = [8, 6, 4][battler.pbOwnSide.effects[PBEffects::Spikes] - 1]
|
||||
oldHP = battler.hp
|
||||
battler.pbReduceHP(battler.totalhp/spikesDiv,false)
|
||||
pbDisplay(_INTL("{1} is hurt by the spikes!",battler.pbThis))
|
||||
battler.pbReduceHP(battler.totalhp / spikesDiv, false)
|
||||
pbDisplay(_INTL("{1} is hurt by the spikes!", battler.pbThis))
|
||||
battler.pbItemHPHealCheck
|
||||
if battler.pbAbilitiesOnDamageTaken(oldHP) # Switched out
|
||||
return pbOnActiveOne(battler) # For replacement battler
|
||||
if battler.pbAbilitiesOnDamageTaken(oldHP) # Switched out
|
||||
return pbOnActiveOne(battler) # For replacement battler
|
||||
end
|
||||
end
|
||||
# Toxic Spikes
|
||||
if battler.pbOwnSide.effects[PBEffects::ToxicSpikes]>0 && !battler.fainted? &&
|
||||
!battler.airborne?
|
||||
if battler.pbOwnSide.effects[PBEffects::ToxicSpikes] > 0 && !battler.fainted? &&
|
||||
!battler.airborne?
|
||||
if battler.pbHasType?(:POISON)
|
||||
battler.pbOwnSide.effects[PBEffects::ToxicSpikes] = 0
|
||||
pbDisplay(_INTL("{1} absorbed the poison spikes!",battler.pbThis))
|
||||
elsif battler.pbCanPoison?(nil,false)
|
||||
if battler.pbOwnSide.effects[PBEffects::ToxicSpikes]==2
|
||||
battler.pbPoison(nil,_INTL("{1} was badly poisoned by the poison spikes!",battler.pbThis),true)
|
||||
pbDisplay(_INTL("{1} absorbed the poison spikes!", battler.pbThis))
|
||||
elsif battler.pbCanPoison?(nil, false)
|
||||
if battler.pbOwnSide.effects[PBEffects::ToxicSpikes] == 2
|
||||
battler.pbPoison(nil, _INTL("{1} was badly poisoned by the poison spikes!", battler.pbThis), true)
|
||||
else
|
||||
battler.pbPoison(nil,_INTL("{1} was poisoned by the poison spikes!",battler.pbThis))
|
||||
battler.pbPoison(nil, _INTL("{1} was poisoned by the poison spikes!", battler.pbThis))
|
||||
end
|
||||
end
|
||||
end
|
||||
# Sticky Web
|
||||
if battler.pbOwnSide.effects[PBEffects::StickyWeb] && !battler.fainted? &&
|
||||
!battler.airborne?
|
||||
pbDisplay(_INTL("{1} was caught in a sticky web!",battler.pbThis))
|
||||
!battler.airborne?
|
||||
pbDisplay(_INTL("{1} was caught in a sticky web!", battler.pbThis))
|
||||
if battler.pbCanLowerStatStage?(:SPEED)
|
||||
battler.pbLowerStatStage(:SPEED,1,nil)
|
||||
battler.pbLowerStatStage(:SPEED, 1, nil)
|
||||
battler.pbItemStatRestoreCheck
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user