mirror of
https://github.com/infinitefusion/infinitefusion-e18.git
synced 2025-12-09 22:24:58 +00:00
More tweaks from the Rubocop overlord
This commit is contained in:
@@ -141,12 +141,12 @@ class Battle
|
||||
@priorityTrickRoom = false
|
||||
@choices = []
|
||||
@megaEvolution = [
|
||||
[-1] * (@player ? @player.length : 1),
|
||||
[-1] * (@opponent ? @opponent.length : 1)
|
||||
[-1] * (@player ? @player.length : 1),
|
||||
[-1] * (@opponent ? @opponent.length : 1)
|
||||
]
|
||||
@initialItems = [
|
||||
Array.new(@party1.length) { |i| (@party1[i]) ? @party1[i].item_id : nil },
|
||||
Array.new(@party2.length) { |i| (@party2[i]) ? @party2[i].item_id : nil }
|
||||
Array.new(@party1.length) { |i| (@party1[i]) ? @party1[i].item_id : nil },
|
||||
Array.new(@party2.length) { |i| (@party2[i]) ? @party2[i].item_id : nil }
|
||||
]
|
||||
@recycleItems = [Array.new(@party1.length, nil), Array.new(@party2.length, nil)]
|
||||
@belch = [Array.new(@party1.length, false), Array.new(@party2.length, false)]
|
||||
@@ -202,7 +202,7 @@ class Battle
|
||||
end
|
||||
|
||||
def maxBattlerIndex
|
||||
return (pbSideSize(0) > pbSideSize(1)) ? (pbSideSize(0) - 1) * 2 : pbSideSize(1) * 2 - 1
|
||||
return (pbSideSize(0) > pbSideSize(1)) ? (pbSideSize(0) - 1) * 2 : (pbSideSize(1) * 2) - 1
|
||||
end
|
||||
|
||||
#=============================================================================
|
||||
@@ -282,7 +282,7 @@ class Battle
|
||||
def pbNumPositions(side, idxTrainer)
|
||||
ret = 0
|
||||
for i in 0...pbSideSize(side)
|
||||
t = pbGetOwnerIndexFromBattlerIndex(i * 2 + side)
|
||||
t = pbGetOwnerIndexFromBattlerIndex((i * 2) + side)
|
||||
next if t != idxTrainer
|
||||
ret += 1
|
||||
end
|
||||
|
||||
@@ -49,7 +49,7 @@ class Battle
|
||||
requireds = []
|
||||
# Find out how many Pokémon each trainer on side needs to have
|
||||
for i in 0...@sideSizes[side]
|
||||
idxTrainer = pbGetOwnerIndexFromBattlerIndex(i * 2 + side)
|
||||
idxTrainer = pbGetOwnerIndexFromBattlerIndex((i * 2) + side)
|
||||
requireds[idxTrainer] = 0 if requireds[idxTrainer].nil?
|
||||
requireds[idxTrainer] += 1
|
||||
end
|
||||
@@ -119,10 +119,10 @@ class Battle
|
||||
# Set up wild Pokémon
|
||||
if side == 1 && wildBattle?
|
||||
pbParty(1).each_with_index do |pkmn, idxPkmn|
|
||||
pbCreateBattler(2 * idxPkmn + side, pkmn, idxPkmn)
|
||||
pbCreateBattler((2 * idxPkmn) + side, pkmn, idxPkmn)
|
||||
# Changes the Pokémon's form upon entering battle (if it should)
|
||||
@peer.pbOnEnteringBattle(self, @battlers[2 * idxPkmn + side], pkmn, true)
|
||||
pbSetSeen(@battlers[2 * idxPkmn + side])
|
||||
@peer.pbOnEnteringBattle(self, @battlers[(2 * idxPkmn) + side], pkmn, true)
|
||||
pbSetSeen(@battlers[(2 * idxPkmn) + side])
|
||||
@usedInBattle[side][idxPkmn] = true
|
||||
end
|
||||
next
|
||||
@@ -132,7 +132,7 @@ class Battle
|
||||
requireds = []
|
||||
# Find out how many Pokémon each trainer on side needs to have
|
||||
for i in 0...@sideSizes[side]
|
||||
idxTrainer = pbGetOwnerIndexFromBattlerIndex(i * 2 + side)
|
||||
idxTrainer = pbGetOwnerIndexFromBattlerIndex((i * 2) + side)
|
||||
requireds[idxTrainer] = 0 if requireds[idxTrainer].nil?
|
||||
requireds[idxTrainer] += 1
|
||||
end
|
||||
@@ -143,7 +143,7 @@ class Battle
|
||||
ret[side][idxTrainer] = []
|
||||
eachInTeam(side, idxTrainer) do |pkmn, idxPkmn|
|
||||
next if !pkmn.able?
|
||||
idxBattler = 2 * battlerNumber + side
|
||||
idxBattler = (2 * battlerNumber) + side
|
||||
pbCreateBattler(idxBattler, pkmn, idxPkmn)
|
||||
ret[side][idxTrainer].push(idxBattler)
|
||||
battlerNumber += 1
|
||||
|
||||
@@ -125,7 +125,7 @@ class Battle
|
||||
# Scale the gained Exp based on the gainer's level (or not)
|
||||
if Settings::SCALED_EXP_FORMULA
|
||||
exp /= 5
|
||||
levelAdjust = (2 * level + 10.0) / (pkmn.level + level + 10.0)
|
||||
levelAdjust = ((2 * level) + 10.0) / (pkmn.level + level + 10.0)
|
||||
levelAdjust = levelAdjust**5
|
||||
levelAdjust = Math.sqrt(levelAdjust)
|
||||
exp *= levelAdjust
|
||||
|
||||
@@ -116,8 +116,8 @@ class Battle
|
||||
@scene.pbPartyScreen(idxBattler, canCancel) { |idxParty, partyScene|
|
||||
if checkLaxOnly
|
||||
next false if !pbCanSwitchLax?(idxBattler, idxParty, partyScene)
|
||||
else
|
||||
next false if !pbCanSwitch?(idxBattler, idxParty, partyScene)
|
||||
elsif !pbCanSwitch?(idxBattler, idxParty, partyScene)
|
||||
next false
|
||||
end
|
||||
if shouldRegister
|
||||
next false if idxParty < 0 || !pbRegisterSwitch(idxBattler, idxParty)
|
||||
|
||||
@@ -53,9 +53,9 @@ class Battle::Battler
|
||||
# Stat up animation and message
|
||||
@battle.pbCommonAnimation("StatUp", self) if showAnim
|
||||
arrStatTexts = [
|
||||
_INTL("{1}'s {2} rose!", pbThis, GameData::Stat.get(stat).name),
|
||||
_INTL("{1}'s {2} rose sharply!", pbThis, GameData::Stat.get(stat).name),
|
||||
_INTL("{1}'s {2} rose drastically!", pbThis, GameData::Stat.get(stat).name)
|
||||
_INTL("{1}'s {2} rose!", pbThis, GameData::Stat.get(stat).name),
|
||||
_INTL("{1}'s {2} rose sharply!", pbThis, GameData::Stat.get(stat).name),
|
||||
_INTL("{1}'s {2} rose drastically!", pbThis, GameData::Stat.get(stat).name)
|
||||
]
|
||||
@battle.pbDisplay(arrStatTexts[[increment - 1, 2].min])
|
||||
# Trigger abilities upon stat gain
|
||||
@@ -77,15 +77,15 @@ class Battle::Battler
|
||||
@battle.pbCommonAnimation("StatUp", self) if showAnim
|
||||
if user.index == @index
|
||||
arrStatTexts = [
|
||||
_INTL("{1}'s {2} raised its {3}!", pbThis, cause, GameData::Stat.get(stat).name),
|
||||
_INTL("{1}'s {2} sharply raised its {3}!", pbThis, cause, GameData::Stat.get(stat).name),
|
||||
_INTL("{1}'s {2} drastically raised its {3}!", pbThis, cause, GameData::Stat.get(stat).name)
|
||||
_INTL("{1}'s {2} raised its {3}!", pbThis, cause, GameData::Stat.get(stat).name),
|
||||
_INTL("{1}'s {2} sharply raised its {3}!", pbThis, cause, GameData::Stat.get(stat).name),
|
||||
_INTL("{1}'s {2} drastically raised its {3}!", pbThis, cause, GameData::Stat.get(stat).name)
|
||||
]
|
||||
else
|
||||
arrStatTexts = [
|
||||
_INTL("{1}'s {2} raised {3}'s {4}!", user.pbThis, cause, pbThis(true), GameData::Stat.get(stat).name),
|
||||
_INTL("{1}'s {2} sharply raised {3}'s {4}!", user.pbThis, cause, pbThis(true), GameData::Stat.get(stat).name),
|
||||
_INTL("{1}'s {2} drastically raised {3}'s {4}!", user.pbThis, cause, pbThis(true), GameData::Stat.get(stat).name)
|
||||
_INTL("{1}'s {2} raised {3}'s {4}!", user.pbThis, cause, pbThis(true), GameData::Stat.get(stat).name),
|
||||
_INTL("{1}'s {2} sharply raised {3}'s {4}!", user.pbThis, cause, pbThis(true), GameData::Stat.get(stat).name),
|
||||
_INTL("{1}'s {2} drastically raised {3}'s {4}!", user.pbThis, cause, pbThis(true), GameData::Stat.get(stat).name)
|
||||
]
|
||||
end
|
||||
@battle.pbDisplay(arrStatTexts[[increment - 1, 2].min])
|
||||
@@ -218,9 +218,9 @@ class Battle::Battler
|
||||
# Stat down animation and message
|
||||
@battle.pbCommonAnimation("StatDown", self) if showAnim
|
||||
arrStatTexts = [
|
||||
_INTL("{1}'s {2} fell!", pbThis, GameData::Stat.get(stat).name),
|
||||
_INTL("{1}'s {2} harshly fell!", pbThis, GameData::Stat.get(stat).name),
|
||||
_INTL("{1}'s {2} severely fell!", pbThis, GameData::Stat.get(stat).name)
|
||||
_INTL("{1}'s {2} fell!", pbThis, GameData::Stat.get(stat).name),
|
||||
_INTL("{1}'s {2} harshly fell!", pbThis, GameData::Stat.get(stat).name),
|
||||
_INTL("{1}'s {2} severely fell!", pbThis, GameData::Stat.get(stat).name)
|
||||
]
|
||||
@battle.pbDisplay(arrStatTexts[[increment - 1, 2].min])
|
||||
# Trigger abilities upon stat loss
|
||||
@@ -259,15 +259,15 @@ class Battle::Battler
|
||||
@battle.pbCommonAnimation("StatDown", self) if showAnim
|
||||
if user.index == @index
|
||||
arrStatTexts = [
|
||||
_INTL("{1}'s {2} lowered its {3}!", pbThis, cause, GameData::Stat.get(stat).name),
|
||||
_INTL("{1}'s {2} harshly lowered its {3}!", pbThis, cause, GameData::Stat.get(stat).name),
|
||||
_INTL("{1}'s {2} severely lowered its {3}!", pbThis, cause, GameData::Stat.get(stat).name)
|
||||
_INTL("{1}'s {2} lowered its {3}!", pbThis, cause, GameData::Stat.get(stat).name),
|
||||
_INTL("{1}'s {2} harshly lowered its {3}!", pbThis, cause, GameData::Stat.get(stat).name),
|
||||
_INTL("{1}'s {2} severely lowered its {3}!", pbThis, cause, GameData::Stat.get(stat).name)
|
||||
]
|
||||
else
|
||||
arrStatTexts = [
|
||||
_INTL("{1}'s {2} lowered {3}'s {4}!", user.pbThis, cause, pbThis(true), GameData::Stat.get(stat).name),
|
||||
_INTL("{1}'s {2} harshly lowered {3}'s {4}!", user.pbThis, cause, pbThis(true), GameData::Stat.get(stat).name),
|
||||
_INTL("{1}'s {2} severely lowered {3}'s {4}!", user.pbThis, cause, pbThis(true), GameData::Stat.get(stat).name)
|
||||
_INTL("{1}'s {2} lowered {3}'s {4}!", user.pbThis, cause, pbThis(true), GameData::Stat.get(stat).name),
|
||||
_INTL("{1}'s {2} harshly lowered {3}'s {4}!", user.pbThis, cause, pbThis(true), GameData::Stat.get(stat).name),
|
||||
_INTL("{1}'s {2} severely lowered {3}'s {4}!", user.pbThis, cause, pbThis(true), GameData::Stat.get(stat).name)
|
||||
]
|
||||
end
|
||||
@battle.pbDisplay(arrStatTexts[[increment - 1, 2].min])
|
||||
|
||||
@@ -119,13 +119,10 @@ class Battle::Battler
|
||||
else
|
||||
pbRaiseStatStageByCause(stat, increment, self, abilityName)
|
||||
end
|
||||
elsif Battle::Scene::USE_ABILITY_SPLASH
|
||||
@battle.pbDisplay(_INTL("It doesn't affect {1}...", pbThis(true)))
|
||||
else
|
||||
if Battle::Scene::USE_ABILITY_SPLASH
|
||||
@battle.pbDisplay(_INTL("It doesn't affect {1}...", pbThis(true)))
|
||||
else
|
||||
@battle.pbDisplay(_INTL("{1}'s {2} made {3} ineffective!",
|
||||
pbThis, abilityName, move.name))
|
||||
end
|
||||
@battle.pbDisplay(_INTL("{1}'s {2} made {3} ineffective!", pbThis, abilityName, move.name))
|
||||
end
|
||||
@battle.pbHideAbilitySplash(self)
|
||||
end
|
||||
@@ -149,13 +146,10 @@ class Battle::Battler
|
||||
else
|
||||
@battle.pbDisplay(_INTL("{1}'s {2} restored its HP.", pbThis, abilityName))
|
||||
end
|
||||
elsif Battle::Scene::USE_ABILITY_SPLASH
|
||||
@battle.pbDisplay(_INTL("It doesn't affect {1}...", pbThis(true)))
|
||||
else
|
||||
if Battle::Scene::USE_ABILITY_SPLASH
|
||||
@battle.pbDisplay(_INTL("It doesn't affect {1}...", pbThis(true)))
|
||||
else
|
||||
@battle.pbDisplay(_INTL("{1}'s {2} made {3} ineffective!",
|
||||
pbThis, abilityName, move.name))
|
||||
end
|
||||
@battle.pbDisplay(_INTL("{1}'s {2} made {3} ineffective!", pbThis, abilityName, move.name))
|
||||
end
|
||||
@battle.pbHideAbilitySplash(self)
|
||||
end
|
||||
|
||||
@@ -298,12 +298,10 @@ class Battle::Move
|
||||
else
|
||||
@battle.pbDisplay(_INTL("{1} landed a critical hit, wishing to be praised!", user.pbThis))
|
||||
end
|
||||
elsif numTargets > 1
|
||||
@battle.pbDisplay(_INTL("A critical hit on {1}!", target.pbThis(true)))
|
||||
else
|
||||
if numTargets > 1
|
||||
@battle.pbDisplay(_INTL("A critical hit on {1}!", target.pbThis(true)))
|
||||
else
|
||||
@battle.pbDisplay(_INTL("A critical hit!"))
|
||||
end
|
||||
@battle.pbDisplay(_INTL("A critical hit!"))
|
||||
end
|
||||
end
|
||||
# Effectiveness message, for moves with 1 hit
|
||||
|
||||
@@ -283,7 +283,7 @@ class Battle::Move
|
||||
baseDmg = [(baseDmg * multipliers[:base_damage_multiplier]).round, 1].max
|
||||
atk = [(atk * multipliers[:attack_multiplier]).round, 1].max
|
||||
defense = [(defense * multipliers[:defense_multiplier]).round, 1].max
|
||||
damage = (((2.0 * user.level / 5 + 2).floor * baseDmg * atk / defense).floor / 50).floor + 2
|
||||
damage = ((((2.0 * user.level / 5) + 2).floor * baseDmg * atk / defense).floor / 50).floor + 2
|
||||
damage = [(damage * multipliers[:final_damage_multiplier]).round, 1].max
|
||||
target.damageState.calcDamage = damage
|
||||
end
|
||||
|
||||
@@ -130,7 +130,7 @@ class Battle::Move::MultiStatUpMove < Battle::Move
|
||||
showAnim = true
|
||||
for i in 0...@statUp.length / 2
|
||||
next if !user.pbCanRaiseStatStage?(@statUp[i * 2], user, self)
|
||||
if user.pbRaiseStatStage(@statUp[i * 2], @statUp[i * 2 + 1], user, showAnim)
|
||||
if user.pbRaiseStatStage(@statUp[i * 2], @statUp[(i * 2) + 1], user, showAnim)
|
||||
showAnim = false
|
||||
end
|
||||
end
|
||||
@@ -140,7 +140,7 @@ class Battle::Move::MultiStatUpMove < Battle::Move
|
||||
showAnim = true
|
||||
for i in 0...@statUp.length / 2
|
||||
next if !user.pbCanRaiseStatStage?(@statUp[i * 2], user, self)
|
||||
if user.pbRaiseStatStage(@statUp[i * 2], @statUp[i * 2 + 1], user, showAnim)
|
||||
if user.pbRaiseStatStage(@statUp[i * 2], @statUp[(i * 2) + 1], user, showAnim)
|
||||
showAnim = false
|
||||
end
|
||||
end
|
||||
@@ -156,7 +156,7 @@ class Battle::Move::StatDownMove < Battle::Move
|
||||
showAnim = true
|
||||
for i in 0...@statDown.length / 2
|
||||
next if !user.pbCanLowerStatStage?(@statDown[i * 2], user, self)
|
||||
if user.pbLowerStatStage(@statDown[i * 2], @statDown[i * 2 + 1], user, showAnim)
|
||||
if user.pbLowerStatStage(@statDown[i * 2], @statDown[(i * 2) + 1], user, showAnim)
|
||||
showAnim = false
|
||||
end
|
||||
end
|
||||
@@ -255,7 +255,7 @@ class Battle::Move::TargetMultiStatDownMove < Battle::Move
|
||||
showMirrorArmorSplash = true
|
||||
for i in 0...@statDown.length / 2
|
||||
next if !target.pbCanLowerStatStage?(@statDown[i * 2], user, self)
|
||||
if target.pbLowerStatStage(@statDown[i * 2], @statDown[i * 2 + 1], user,
|
||||
if target.pbLowerStatStage(@statDown[i * 2], @statDown[(i * 2) + 1], user,
|
||||
showAnim, false, (showMirrorArmorSplash) ? 1 : 3)
|
||||
showAnim = false
|
||||
end
|
||||
|
||||
@@ -440,14 +440,14 @@ class Battle::Move::LowerUserDefSpDef1RaiseUserAtkSpAtkSpd2 < Battle::Move
|
||||
showAnim = true
|
||||
for i in 0...@statDown.length / 2
|
||||
next if !user.pbCanLowerStatStage?(@statDown[i * 2], user, self)
|
||||
if user.pbLowerStatStage(@statDown[i * 2], @statDown[i * 2 + 1], user, showAnim)
|
||||
if user.pbLowerStatStage(@statDown[i * 2], @statDown[(i * 2) + 1], user, showAnim)
|
||||
showAnim = false
|
||||
end
|
||||
end
|
||||
showAnim = true
|
||||
for i in 0...@statUp.length / 2
|
||||
next if !user.pbCanRaiseStatStage?(@statUp[i * 2], user, self)
|
||||
if user.pbRaiseStatStage(@statUp[i * 2], @statUp[i * 2 + 1], user, showAnim)
|
||||
if user.pbRaiseStatStage(@statUp[i * 2], @statUp[(i * 2) + 1], user, showAnim)
|
||||
showAnim = false
|
||||
end
|
||||
end
|
||||
@@ -1385,7 +1385,7 @@ class Battle::Move::LowerPoisonedTargetAtkSpAtkSpd1 < Battle::Move
|
||||
showMirrorArmorSplash = true
|
||||
for i in 0...@statDown.length / 2
|
||||
next if !target.pbCanLowerStatStage?(@statDown[i * 2], user, self)
|
||||
if target.pbLowerStatStage(@statDown[i * 2], @statDown[i * 2 + 1], user,
|
||||
if target.pbLowerStatStage(@statDown[i * 2], @statDown[(i * 2) + 1], user,
|
||||
showAnim, false, (showMirrorArmorSplash) ? 1 : 3)
|
||||
showAnim = false
|
||||
end
|
||||
|
||||
@@ -379,13 +379,13 @@ class Battle::Move::RandomPowerDoublePowerIfTargetUnderground < Battle::Move
|
||||
def pbOnStartUse(user, targets)
|
||||
baseDmg = [10, 30, 50, 70, 90, 110, 150]
|
||||
magnitudes = [
|
||||
4,
|
||||
5, 5,
|
||||
6, 6, 6, 6,
|
||||
7, 7, 7, 7, 7, 7,
|
||||
8, 8, 8, 8,
|
||||
9, 9,
|
||||
10
|
||||
4,
|
||||
5, 5,
|
||||
6, 6, 6, 6,
|
||||
7, 7, 7, 7, 7, 7,
|
||||
8, 8, 8, 8,
|
||||
9, 9,
|
||||
10
|
||||
]
|
||||
magni = magnitudes[@battle.pbRandom(magnitudes.length)]
|
||||
@magnitudeDmg = baseDmg[magni - 4]
|
||||
@@ -710,11 +710,9 @@ class Battle::Move::StartWeakenElectricMoves < Battle::Move
|
||||
@battle.pbDisplay(_INTL("But it failed!"))
|
||||
return true
|
||||
end
|
||||
else
|
||||
if @battle.allBattlers.any? { |b| b.effects[PBEffects::MudSport] }
|
||||
@battle.pbDisplay(_INTL("But it failed!"))
|
||||
return true
|
||||
end
|
||||
elsif @battle.allBattlers.any? { |b| b.effects[PBEffects::MudSport] }
|
||||
@battle.pbDisplay(_INTL("But it failed!"))
|
||||
return true
|
||||
end
|
||||
return false
|
||||
end
|
||||
@@ -739,11 +737,9 @@ class Battle::Move::StartWeakenFireMoves < Battle::Move
|
||||
@battle.pbDisplay(_INTL("But it failed!"))
|
||||
return true
|
||||
end
|
||||
else
|
||||
if @battle.allBattlers.any? { |b| b.effects[PBEffects::WaterSport] }
|
||||
@battle.pbDisplay(_INTL("But it failed!"))
|
||||
return true
|
||||
end
|
||||
elsif @battle.allBattlers.any? { |b| b.effects[PBEffects::WaterSport] }
|
||||
@battle.pbDisplay(_INTL("But it failed!"))
|
||||
return true
|
||||
end
|
||||
return false
|
||||
end
|
||||
@@ -1359,7 +1355,7 @@ def pbHiddenPower(pkmn)
|
||||
power |= (iv[:SPEED] & 2) << 2
|
||||
power |= (iv[:SPECIAL_ATTACK] & 2) << 3
|
||||
power |= (iv[:SPECIAL_DEFENSE] & 2) << 4
|
||||
power = powerMin + (powerMax - powerMin) * power / 63
|
||||
power = powerMin + ((powerMax - powerMin) * power / 63)
|
||||
end
|
||||
return [type, power]
|
||||
end
|
||||
@@ -1372,41 +1368,41 @@ class Battle::Move::TypeAndPowerDependOnUserBerry < Battle::Move
|
||||
def initialize(battle, move)
|
||||
super
|
||||
@typeArray = {
|
||||
:NORMAL => [:CHILANBERRY],
|
||||
:FIRE => [:CHERIBERRY, :BLUKBERRY, :WATMELBERRY, :OCCABERRY],
|
||||
:WATER => [:CHESTOBERRY, :NANABBERRY, :DURINBERRY, :PASSHOBERRY],
|
||||
:ELECTRIC => [:PECHABERRY, :WEPEARBERRY, :BELUEBERRY, :WACANBERRY],
|
||||
:GRASS => [:RAWSTBERRY, :PINAPBERRY, :RINDOBERRY, :LIECHIBERRY],
|
||||
:ICE => [:ASPEARBERRY, :POMEGBERRY, :YACHEBERRY, :GANLONBERRY],
|
||||
:FIGHTING => [:LEPPABERRY, :KELPSYBERRY, :CHOPLEBERRY, :SALACBERRY],
|
||||
:POISON => [:ORANBERRY, :QUALOTBERRY, :KEBIABERRY, :PETAYABERRY],
|
||||
:GROUND => [:PERSIMBERRY, :HONDEWBERRY, :SHUCABERRY, :APICOTBERRY],
|
||||
:FLYING => [:LUMBERRY, :GREPABERRY, :COBABERRY, :LANSATBERRY],
|
||||
:PSYCHIC => [:SITRUSBERRY, :TAMATOBERRY, :PAYAPABERRY, :STARFBERRY],
|
||||
:BUG => [:FIGYBERRY, :CORNNBERRY, :TANGABERRY, :ENIGMABERRY],
|
||||
:ROCK => [:WIKIBERRY, :MAGOSTBERRY, :CHARTIBERRY, :MICLEBERRY],
|
||||
:GHOST => [:MAGOBERRY, :RABUTABERRY, :KASIBBERRY, :CUSTAPBERRY],
|
||||
:DRAGON => [:AGUAVBERRY, :NOMELBERRY, :HABANBERRY, :JABOCABERRY],
|
||||
:DARK => [:IAPAPABERRY, :SPELONBERRY, :COLBURBERRY, :ROWAPBERRY, :MARANGABERRY],
|
||||
:STEEL => [:RAZZBERRY, :PAMTREBERRY, :BABIRIBERRY],
|
||||
:FAIRY => [:ROSELIBERRY, :KEEBERRY]
|
||||
:NORMAL => [:CHILANBERRY],
|
||||
:FIRE => [:CHERIBERRY, :BLUKBERRY, :WATMELBERRY, :OCCABERRY],
|
||||
:WATER => [:CHESTOBERRY, :NANABBERRY, :DURINBERRY, :PASSHOBERRY],
|
||||
:ELECTRIC => [:PECHABERRY, :WEPEARBERRY, :BELUEBERRY, :WACANBERRY],
|
||||
:GRASS => [:RAWSTBERRY, :PINAPBERRY, :RINDOBERRY, :LIECHIBERRY],
|
||||
:ICE => [:ASPEARBERRY, :POMEGBERRY, :YACHEBERRY, :GANLONBERRY],
|
||||
:FIGHTING => [:LEPPABERRY, :KELPSYBERRY, :CHOPLEBERRY, :SALACBERRY],
|
||||
:POISON => [:ORANBERRY, :QUALOTBERRY, :KEBIABERRY, :PETAYABERRY],
|
||||
:GROUND => [:PERSIMBERRY, :HONDEWBERRY, :SHUCABERRY, :APICOTBERRY],
|
||||
:FLYING => [:LUMBERRY, :GREPABERRY, :COBABERRY, :LANSATBERRY],
|
||||
:PSYCHIC => [:SITRUSBERRY, :TAMATOBERRY, :PAYAPABERRY, :STARFBERRY],
|
||||
:BUG => [:FIGYBERRY, :CORNNBERRY, :TANGABERRY, :ENIGMABERRY],
|
||||
:ROCK => [:WIKIBERRY, :MAGOSTBERRY, :CHARTIBERRY, :MICLEBERRY],
|
||||
:GHOST => [:MAGOBERRY, :RABUTABERRY, :KASIBBERRY, :CUSTAPBERRY],
|
||||
:DRAGON => [:AGUAVBERRY, :NOMELBERRY, :HABANBERRY, :JABOCABERRY],
|
||||
:DARK => [:IAPAPABERRY, :SPELONBERRY, :COLBURBERRY, :ROWAPBERRY, :MARANGABERRY],
|
||||
:STEEL => [:RAZZBERRY, :PAMTREBERRY, :BABIRIBERRY],
|
||||
:FAIRY => [:ROSELIBERRY, :KEEBERRY]
|
||||
}
|
||||
@damageArray = {
|
||||
60 => [:CHERIBERRY, :CHESTOBERRY, :PECHABERRY, :RAWSTBERRY, :ASPEARBERRY,
|
||||
:LEPPABERRY, :ORANBERRY, :PERSIMBERRY, :LUMBERRY, :SITRUSBERRY,
|
||||
:FIGYBERRY, :WIKIBERRY, :MAGOBERRY, :AGUAVBERRY, :IAPAPABERRY,
|
||||
:RAZZBERRY, :OCCABERRY, :PASSHOBERRY, :WACANBERRY, :RINDOBERRY,
|
||||
:YACHEBERRY, :CHOPLEBERRY, :KEBIABERRY, :SHUCABERRY, :COBABERRY,
|
||||
:PAYAPABERRY, :TANGABERRY, :CHARTIBERRY, :KASIBBERRY, :HABANBERRY,
|
||||
:COLBURBERRY, :BABIRIBERRY, :CHILANBERRY, :ROSELIBERRY],
|
||||
70 => [:BLUKBERRY, :NANABBERRY, :WEPEARBERRY, :PINAPBERRY, :POMEGBERRY,
|
||||
:KELPSYBERRY, :QUALOTBERRY, :HONDEWBERRY, :GREPABERRY, :TAMATOBERRY,
|
||||
:CORNNBERRY, :MAGOSTBERRY, :RABUTABERRY, :NOMELBERRY, :SPELONBERRY,
|
||||
:PAMTREBERRY],
|
||||
80 => [:WATMELBERRY, :DURINBERRY, :BELUEBERRY, :LIECHIBERRY, :GANLONBERRY,
|
||||
:SALACBERRY, :PETAYABERRY, :APICOTBERRY, :LANSATBERRY, :STARFBERRY,
|
||||
:ENIGMABERRY, :MICLEBERRY, :CUSTAPBERRY, :JABOCABERRY, :ROWAPBERRY,
|
||||
:KEEBERRY, :MARANGABERRY]
|
||||
60 => [:CHERIBERRY, :CHESTOBERRY, :PECHABERRY, :RAWSTBERRY, :ASPEARBERRY,
|
||||
:LEPPABERRY, :ORANBERRY, :PERSIMBERRY, :LUMBERRY, :SITRUSBERRY,
|
||||
:FIGYBERRY, :WIKIBERRY, :MAGOBERRY, :AGUAVBERRY, :IAPAPABERRY,
|
||||
:RAZZBERRY, :OCCABERRY, :PASSHOBERRY, :WACANBERRY, :RINDOBERRY,
|
||||
:YACHEBERRY, :CHOPLEBERRY, :KEBIABERRY, :SHUCABERRY, :COBABERRY,
|
||||
:PAYAPABERRY, :TANGABERRY, :CHARTIBERRY, :KASIBBERRY, :HABANBERRY,
|
||||
:COLBURBERRY, :BABIRIBERRY, :CHILANBERRY, :ROSELIBERRY],
|
||||
70 => [:BLUKBERRY, :NANABBERRY, :WEPEARBERRY, :PINAPBERRY, :POMEGBERRY,
|
||||
:KELPSYBERRY, :QUALOTBERRY, :HONDEWBERRY, :GREPABERRY, :TAMATOBERRY,
|
||||
:CORNNBERRY, :MAGOSTBERRY, :RABUTABERRY, :NOMELBERRY, :SPELONBERRY,
|
||||
:PAMTREBERRY],
|
||||
80 => [:WATMELBERRY, :DURINBERRY, :BELUEBERRY, :LIECHIBERRY, :GANLONBERRY,
|
||||
:SALACBERRY, :PETAYABERRY, :APICOTBERRY, :LANSATBERRY, :STARFBERRY,
|
||||
:ENIGMABERRY, :MICLEBERRY, :CUSTAPBERRY, :JABOCABERRY, :ROWAPBERRY,
|
||||
:KEEBERRY, :MARANGABERRY]
|
||||
}
|
||||
end
|
||||
|
||||
@@ -1469,23 +1465,23 @@ class Battle::Move::TypeDependsOnUserPlate < Battle::Move
|
||||
def initialize(battle, move)
|
||||
super
|
||||
@itemTypes = {
|
||||
:FISTPLATE => :FIGHTING,
|
||||
:SKYPLATE => :FLYING,
|
||||
:TOXICPLATE => :POISON,
|
||||
:EARTHPLATE => :GROUND,
|
||||
:STONEPLATE => :ROCK,
|
||||
:INSECTPLATE => :BUG,
|
||||
:SPOOKYPLATE => :GHOST,
|
||||
:IRONPLATE => :STEEL,
|
||||
:FLAMEPLATE => :FIRE,
|
||||
:SPLASHPLATE => :WATER,
|
||||
:MEADOWPLATE => :GRASS,
|
||||
:ZAPPLATE => :ELECTRIC,
|
||||
:MINDPLATE => :PSYCHIC,
|
||||
:ICICLEPLATE => :ICE,
|
||||
:DRACOPLATE => :DRAGON,
|
||||
:DREADPLATE => :DARK,
|
||||
:PIXIEPLATE => :FAIRY
|
||||
:FISTPLATE => :FIGHTING,
|
||||
:SKYPLATE => :FLYING,
|
||||
:TOXICPLATE => :POISON,
|
||||
:EARTHPLATE => :GROUND,
|
||||
:STONEPLATE => :ROCK,
|
||||
:INSECTPLATE => :BUG,
|
||||
:SPOOKYPLATE => :GHOST,
|
||||
:IRONPLATE => :STEEL,
|
||||
:FLAMEPLATE => :FIRE,
|
||||
:SPLASHPLATE => :WATER,
|
||||
:MEADOWPLATE => :GRASS,
|
||||
:ZAPPLATE => :ELECTRIC,
|
||||
:MINDPLATE => :PSYCHIC,
|
||||
:ICICLEPLATE => :ICE,
|
||||
:DRACOPLATE => :DRAGON,
|
||||
:DREADPLATE => :DARK,
|
||||
:PIXIEPLATE => :FAIRY
|
||||
}
|
||||
end
|
||||
|
||||
@@ -1509,23 +1505,23 @@ class Battle::Move::TypeDependsOnUserMemory < Battle::Move
|
||||
def initialize(battle, move)
|
||||
super
|
||||
@itemTypes = {
|
||||
:FIGHTINGMEMORY => :FIGHTING,
|
||||
:FLYINGMEMORY => :FLYING,
|
||||
:POISONMEMORY => :POISON,
|
||||
:GROUNDMEMORY => :GROUND,
|
||||
:ROCKMEMORY => :ROCK,
|
||||
:BUGMEMORY => :BUG,
|
||||
:GHOSTMEMORY => :GHOST,
|
||||
:STEELMEMORY => :STEEL,
|
||||
:FIREMEMORY => :FIRE,
|
||||
:WATERMEMORY => :WATER,
|
||||
:GRASSMEMORY => :GRASS,
|
||||
:ELECTRICMEMORY => :ELECTRIC,
|
||||
:PSYCHICMEMORY => :PSYCHIC,
|
||||
:ICEMEMORY => :ICE,
|
||||
:DRAGONMEMORY => :DRAGON,
|
||||
:DARKMEMORY => :DARK,
|
||||
:FAIRYMEMORY => :FAIRY
|
||||
:FIGHTINGMEMORY => :FIGHTING,
|
||||
:FLYINGMEMORY => :FLYING,
|
||||
:POISONMEMORY => :POISON,
|
||||
:GROUNDMEMORY => :GROUND,
|
||||
:ROCKMEMORY => :ROCK,
|
||||
:BUGMEMORY => :BUG,
|
||||
:GHOSTMEMORY => :GHOST,
|
||||
:STEELMEMORY => :STEEL,
|
||||
:FIREMEMORY => :FIRE,
|
||||
:WATERMEMORY => :WATER,
|
||||
:GRASSMEMORY => :GRASS,
|
||||
:ELECTRICMEMORY => :ELECTRIC,
|
||||
:PSYCHICMEMORY => :PSYCHIC,
|
||||
:ICEMEMORY => :ICE,
|
||||
:DRAGONMEMORY => :DRAGON,
|
||||
:DARKMEMORY => :DARK,
|
||||
:FAIRYMEMORY => :FAIRY
|
||||
}
|
||||
end
|
||||
|
||||
@@ -1549,10 +1545,10 @@ class Battle::Move::TypeDependsOnUserDrive < Battle::Move
|
||||
def initialize(battle, move)
|
||||
super
|
||||
@itemTypes = {
|
||||
:SHOCKDRIVE => :ELECTRIC,
|
||||
:BURNDRIVE => :FIRE,
|
||||
:CHILLDRIVE => :ICE,
|
||||
:DOUSEDRIVE => :WATER
|
||||
:SHOCKDRIVE => :ELECTRIC,
|
||||
:BURNDRIVE => :FIRE,
|
||||
:CHILLDRIVE => :ICE,
|
||||
:DOUSEDRIVE => :WATER
|
||||
}
|
||||
end
|
||||
|
||||
|
||||
@@ -677,63 +677,63 @@ class Battle::Move::UseLastMoveUsed < Battle::Move
|
||||
def initialize(battle, move)
|
||||
super
|
||||
@moveBlacklist = [
|
||||
# Struggle, Belch
|
||||
"Struggle",
|
||||
"FailsIfUserNotConsumedBerry", # Belch # Not listed on Bulbapedia
|
||||
# Moves that affect the moveset
|
||||
"ReplaceMoveThisBattleWithTargetLastMoveUsed", # Mimic
|
||||
"ReplaceMoveWithTargetLastMoveUsed", # Sketch
|
||||
"TransformUserIntoTarget", # Transform
|
||||
# Counter moves
|
||||
"CounterPhysicalDamage", # Counter
|
||||
"CounterSpecialDamage", # Mirror Coat
|
||||
"CounterDamagePlusHalf", # Metal Burst # Not listed on Bulbapedia
|
||||
# Helping Hand, Feint (always blacklisted together, don't know why)
|
||||
"PowerUpAllyMove", # Helping Hand
|
||||
"RemoveProtections", # Feint
|
||||
# Protection moves
|
||||
"ProtectUser", # Detect, Protect
|
||||
"ProtectUserSideFromPriorityMoves", # Quick Guard # Not listed on Bulbapedia
|
||||
"ProtectUserSideFromMultiTargetDamagingMoves", # Wide Guard # Not listed on Bulbapedia
|
||||
"UserEnduresFaintingThisTurn", # Endure
|
||||
"ProtectUserSideFromDamagingMovesIfUserFirstTurn", # Mat Block
|
||||
"ProtectUserSideFromStatusMoves", # Crafty Shield # Not listed on Bulbapedia
|
||||
"ProtectUserFromDamagingMovesKingsShield", # King's Shield
|
||||
"ProtectUserFromTargetingMovesSpikyShield", # Spiky Shield
|
||||
"ProtectUserBanefulBunker", # Baneful Bunker
|
||||
# Moves that call other moves
|
||||
"UseLastMoveUsedByTarget", # Mirror Move
|
||||
"UseLastMoveUsed", # Copycat (this move)
|
||||
"UseMoveTargetIsAboutToUse", # Me First
|
||||
"UseMoveDependingOnEnvironment", # Nature Power # Not listed on Bulbapedia
|
||||
"UseRandomUserMoveIfAsleep", # Sleep Talk
|
||||
"UseRandomMoveFromUserParty", # Assist
|
||||
"UseRandomMove", # Metronome
|
||||
# Move-redirecting and stealing moves
|
||||
"BounceBackProblemCausingStatusMoves", # Magic Coat # Not listed on Bulbapedia
|
||||
"StealAndUseBeneficialStatusMove", # Snatch
|
||||
"RedirectAllMovesToUser", # Follow Me, Rage Powder
|
||||
"RedirectAllMovesToTarget", # Spotlight
|
||||
# Set up effects that trigger upon KO
|
||||
"ReduceAttackerMovePPTo0IfUserFaints", # Grudge # Not listed on Bulbapedia
|
||||
"AttackerFaintsIfUserFaints", # Destiny Bond
|
||||
# Held item-moving moves
|
||||
"UserTakesTargetItem", # Covet, Thief
|
||||
"UserTargetSwapItems", # Switcheroo, Trick
|
||||
"TargetTakesUserItem", # Bestow
|
||||
# Moves that start focussing at the start of the round
|
||||
"FailsIfUserDamagedThisTurn", # Focus Punch
|
||||
"UsedAfterUserTakesPhysicalDamage", # Shell Trap
|
||||
"BurnAttackerBeforeUserActs", # Beak Blast
|
||||
# Event moves that do nothing
|
||||
"DoesNothingFailsIfNoAlly", # Hold Hands
|
||||
"DoesNothingCongratulations" # Celebrate
|
||||
# Struggle, Belch
|
||||
"Struggle",
|
||||
"FailsIfUserNotConsumedBerry", # Belch # Not listed on Bulbapedia
|
||||
# Moves that affect the moveset
|
||||
"ReplaceMoveThisBattleWithTargetLastMoveUsed", # Mimic
|
||||
"ReplaceMoveWithTargetLastMoveUsed", # Sketch
|
||||
"TransformUserIntoTarget", # Transform
|
||||
# Counter moves
|
||||
"CounterPhysicalDamage", # Counter
|
||||
"CounterSpecialDamage", # Mirror Coat
|
||||
"CounterDamagePlusHalf", # Metal Burst # Not listed on Bulbapedia
|
||||
# Helping Hand, Feint (always blacklisted together, don't know why)
|
||||
"PowerUpAllyMove", # Helping Hand
|
||||
"RemoveProtections", # Feint
|
||||
# Protection moves
|
||||
"ProtectUser", # Detect, Protect
|
||||
"ProtectUserSideFromPriorityMoves", # Quick Guard # Not listed on Bulbapedia
|
||||
"ProtectUserSideFromMultiTargetDamagingMoves", # Wide Guard # Not listed on Bulbapedia
|
||||
"UserEnduresFaintingThisTurn", # Endure
|
||||
"ProtectUserSideFromDamagingMovesIfUserFirstTurn", # Mat Block
|
||||
"ProtectUserSideFromStatusMoves", # Crafty Shield # Not listed on Bulbapedia
|
||||
"ProtectUserFromDamagingMovesKingsShield", # King's Shield
|
||||
"ProtectUserFromTargetingMovesSpikyShield", # Spiky Shield
|
||||
"ProtectUserBanefulBunker", # Baneful Bunker
|
||||
# Moves that call other moves
|
||||
"UseLastMoveUsedByTarget", # Mirror Move
|
||||
"UseLastMoveUsed", # Copycat (this move)
|
||||
"UseMoveTargetIsAboutToUse", # Me First
|
||||
"UseMoveDependingOnEnvironment", # Nature Power # Not listed on Bulbapedia
|
||||
"UseRandomUserMoveIfAsleep", # Sleep Talk
|
||||
"UseRandomMoveFromUserParty", # Assist
|
||||
"UseRandomMove", # Metronome
|
||||
# Move-redirecting and stealing moves
|
||||
"BounceBackProblemCausingStatusMoves", # Magic Coat # Not listed on Bulbapedia
|
||||
"StealAndUseBeneficialStatusMove", # Snatch
|
||||
"RedirectAllMovesToUser", # Follow Me, Rage Powder
|
||||
"RedirectAllMovesToTarget", # Spotlight
|
||||
# Set up effects that trigger upon KO
|
||||
"ReduceAttackerMovePPTo0IfUserFaints", # Grudge # Not listed on Bulbapedia
|
||||
"AttackerFaintsIfUserFaints", # Destiny Bond
|
||||
# Held item-moving moves
|
||||
"UserTakesTargetItem", # Covet, Thief
|
||||
"UserTargetSwapItems", # Switcheroo, Trick
|
||||
"TargetTakesUserItem", # Bestow
|
||||
# Moves that start focussing at the start of the round
|
||||
"FailsIfUserDamagedThisTurn", # Focus Punch
|
||||
"UsedAfterUserTakesPhysicalDamage", # Shell Trap
|
||||
"BurnAttackerBeforeUserActs", # Beak Blast
|
||||
# Event moves that do nothing
|
||||
"DoesNothingFailsIfNoAlly", # Hold Hands
|
||||
"DoesNothingCongratulations" # Celebrate
|
||||
]
|
||||
if Settings::MECHANICS_GENERATION >= 6
|
||||
@moveBlacklist += [
|
||||
# Target-switching moves
|
||||
"SwitchOutTargetStatusMove", # Roar, Whirlwind
|
||||
"SwitchOutTargetDamagingMove" # Circle Throw, Dragon Tail
|
||||
# Target-switching moves
|
||||
"SwitchOutTargetStatusMove", # Roar, Whirlwind
|
||||
"SwitchOutTargetDamagingMove" # Circle Throw, Dragon Tail
|
||||
]
|
||||
end
|
||||
end
|
||||
@@ -793,18 +793,18 @@ class Battle::Move::UseMoveTargetIsAboutToUse < Battle::Move
|
||||
def initialize(battle, move)
|
||||
super
|
||||
@moveBlacklist = [
|
||||
"UserTakesTargetItem", # Covet, Thief
|
||||
# Struggle, Belch
|
||||
"Struggle", # Struggle
|
||||
"FailsIfUserNotConsumedBerry", # Belch
|
||||
# Counter moves
|
||||
"CounterPhysicalDamage", # Counter
|
||||
"CounterSpecialDamage", # Mirror Coat
|
||||
"CounterDamagePlusHalf", # Metal Burst
|
||||
# Moves that start focussing at the start of the round
|
||||
"FailsIfUserDamagedThisTurn", # Focus Punch
|
||||
"UsedAfterUserTakesPhysicalDamage", # Shell Trap
|
||||
"BurnAttackerBeforeUserActs" # Beak Blast
|
||||
"UserTakesTargetItem", # Covet, Thief
|
||||
# Struggle, Belch
|
||||
"Struggle", # Struggle
|
||||
"FailsIfUserNotConsumedBerry", # Belch
|
||||
# Counter moves
|
||||
"CounterPhysicalDamage", # Counter
|
||||
"CounterSpecialDamage", # Mirror Coat
|
||||
"CounterDamagePlusHalf", # Metal Burst
|
||||
# Moves that start focussing at the start of the round
|
||||
"FailsIfUserDamagedThisTurn", # Focus Punch
|
||||
"UsedAfterUserTakesPhysicalDamage", # Shell Trap
|
||||
"BurnAttackerBeforeUserActs" # Beak Blast
|
||||
]
|
||||
end
|
||||
|
||||
@@ -897,83 +897,83 @@ class Battle::Move::UseRandomMove < Battle::Move
|
||||
def initialize(battle, move)
|
||||
super
|
||||
@moveBlacklist = [
|
||||
"FlinchTargetFailsIfUserNotAsleep", # Snore
|
||||
"TargetActsNext", # After You
|
||||
"TargetActsLast", # Quash
|
||||
"TargetUsesItsLastUsedMoveAgain", # Instruct
|
||||
# Struggle, Belch
|
||||
"Struggle", # Struggle
|
||||
"FailsIfUserNotConsumedBerry", # Belch
|
||||
# Moves that affect the moveset
|
||||
"ReplaceMoveThisBattleWithTargetLastMoveUsed", # Mimic
|
||||
"ReplaceMoveWithTargetLastMoveUsed", # Sketch
|
||||
"TransformUserIntoTarget", # Transform
|
||||
# Counter moves
|
||||
"CounterPhysicalDamage", # Counter
|
||||
"CounterSpecialDamage", # Mirror Coat
|
||||
"CounterDamagePlusHalf", # Metal Burst # Not listed on Bulbapedia
|
||||
# Helping Hand, Feint (always blacklisted together, don't know why)
|
||||
"PowerUpAllyMove", # Helping Hand
|
||||
"RemoveProtections", # Feint
|
||||
# Protection moves
|
||||
"ProtectUser", # Detect, Protect
|
||||
"ProtectUserSideFromPriorityMoves", # Quick Guard
|
||||
"ProtectUserSideFromMultiTargetDamagingMoves", # Wide Guard
|
||||
"UserEnduresFaintingThisTurn", # Endure
|
||||
"ProtectUserSideFromDamagingMovesIfUserFirstTurn", # Mat Block
|
||||
"ProtectUserSideFromStatusMoves", # Crafty Shield
|
||||
"ProtectUserFromDamagingMovesKingsShield", # King's Shield
|
||||
"ProtectUserFromTargetingMovesSpikyShield", # Spiky Shield
|
||||
"ProtectUserBanefulBunker", # Baneful Bunker
|
||||
# Moves that call other moves
|
||||
"UseLastMoveUsedByTarget", # Mirror Move
|
||||
"UseLastMoveUsed", # Copycat
|
||||
"UseMoveTargetIsAboutToUse", # Me First
|
||||
"UseMoveDependingOnEnvironment", # Nature Power
|
||||
"UseRandomUserMoveIfAsleep", # Sleep Talk
|
||||
"UseRandomMoveFromUserParty", # Assist
|
||||
"UseRandomMove", # Metronome
|
||||
# Move-redirecting and stealing moves
|
||||
"BounceBackProblemCausingStatusMoves", # Magic Coat # Not listed on Bulbapedia
|
||||
"StealAndUseBeneficialStatusMove", # Snatch
|
||||
"RedirectAllMovesToUser", # Follow Me, Rage Powder
|
||||
"RedirectAllMovesToTarget", # Spotlight
|
||||
# Set up effects that trigger upon KO
|
||||
"ReduceAttackerMovePPTo0IfUserFaints", # Grudge # Not listed on Bulbapedia
|
||||
"AttackerFaintsIfUserFaints", # Destiny Bond
|
||||
# Held item-moving moves
|
||||
"UserTakesTargetItem", # Covet, Thief
|
||||
"UserTargetSwapItems", # Switcheroo, Trick
|
||||
"TargetTakesUserItem", # Bestow
|
||||
# Moves that start focussing at the start of the round
|
||||
"FailsIfUserDamagedThisTurn", # Focus Punch
|
||||
"UsedAfterUserTakesPhysicalDamage", # Shell Trap
|
||||
"BurnAttackerBeforeUserActs", # Beak Blast
|
||||
# Event moves that do nothing
|
||||
"DoesNothingFailsIfNoAlly", # Hold Hands
|
||||
"DoesNothingCongratulations" # Celebrate
|
||||
"FlinchTargetFailsIfUserNotAsleep", # Snore
|
||||
"TargetActsNext", # After You
|
||||
"TargetActsLast", # Quash
|
||||
"TargetUsesItsLastUsedMoveAgain", # Instruct
|
||||
# Struggle, Belch
|
||||
"Struggle", # Struggle
|
||||
"FailsIfUserNotConsumedBerry", # Belch
|
||||
# Moves that affect the moveset
|
||||
"ReplaceMoveThisBattleWithTargetLastMoveUsed", # Mimic
|
||||
"ReplaceMoveWithTargetLastMoveUsed", # Sketch
|
||||
"TransformUserIntoTarget", # Transform
|
||||
# Counter moves
|
||||
"CounterPhysicalDamage", # Counter
|
||||
"CounterSpecialDamage", # Mirror Coat
|
||||
"CounterDamagePlusHalf", # Metal Burst # Not listed on Bulbapedia
|
||||
# Helping Hand, Feint (always blacklisted together, don't know why)
|
||||
"PowerUpAllyMove", # Helping Hand
|
||||
"RemoveProtections", # Feint
|
||||
# Protection moves
|
||||
"ProtectUser", # Detect, Protect
|
||||
"ProtectUserSideFromPriorityMoves", # Quick Guard
|
||||
"ProtectUserSideFromMultiTargetDamagingMoves", # Wide Guard
|
||||
"UserEnduresFaintingThisTurn", # Endure
|
||||
"ProtectUserSideFromDamagingMovesIfUserFirstTurn", # Mat Block
|
||||
"ProtectUserSideFromStatusMoves", # Crafty Shield
|
||||
"ProtectUserFromDamagingMovesKingsShield", # King's Shield
|
||||
"ProtectUserFromTargetingMovesSpikyShield", # Spiky Shield
|
||||
"ProtectUserBanefulBunker", # Baneful Bunker
|
||||
# Moves that call other moves
|
||||
"UseLastMoveUsedByTarget", # Mirror Move
|
||||
"UseLastMoveUsed", # Copycat
|
||||
"UseMoveTargetIsAboutToUse", # Me First
|
||||
"UseMoveDependingOnEnvironment", # Nature Power
|
||||
"UseRandomUserMoveIfAsleep", # Sleep Talk
|
||||
"UseRandomMoveFromUserParty", # Assist
|
||||
"UseRandomMove", # Metronome
|
||||
# Move-redirecting and stealing moves
|
||||
"BounceBackProblemCausingStatusMoves", # Magic Coat # Not listed on Bulbapedia
|
||||
"StealAndUseBeneficialStatusMove", # Snatch
|
||||
"RedirectAllMovesToUser", # Follow Me, Rage Powder
|
||||
"RedirectAllMovesToTarget", # Spotlight
|
||||
# Set up effects that trigger upon KO
|
||||
"ReduceAttackerMovePPTo0IfUserFaints", # Grudge # Not listed on Bulbapedia
|
||||
"AttackerFaintsIfUserFaints", # Destiny Bond
|
||||
# Held item-moving moves
|
||||
"UserTakesTargetItem", # Covet, Thief
|
||||
"UserTargetSwapItems", # Switcheroo, Trick
|
||||
"TargetTakesUserItem", # Bestow
|
||||
# Moves that start focussing at the start of the round
|
||||
"FailsIfUserDamagedThisTurn", # Focus Punch
|
||||
"UsedAfterUserTakesPhysicalDamage", # Shell Trap
|
||||
"BurnAttackerBeforeUserActs", # Beak Blast
|
||||
# Event moves that do nothing
|
||||
"DoesNothingFailsIfNoAlly", # Hold Hands
|
||||
"DoesNothingCongratulations" # Celebrate
|
||||
]
|
||||
@moveBlacklistSignatures = [
|
||||
:SNARL,
|
||||
# Signature moves
|
||||
:DIAMONDSTORM, # Diancie (Gen 6)
|
||||
:FLEURCANNON, # Magearna (Gen 7)
|
||||
:FREEZESHOCK, # Black Kyurem (Gen 5)
|
||||
:HYPERSPACEFURY, # Hoopa Unbound (Gen 6)
|
||||
:HYPERSPACEHOLE, # Hoopa Confined (Gen 6)
|
||||
:ICEBURN, # White Kyurem (Gen 5)
|
||||
:LIGHTOFRUIN, # Eternal Flower Floette (Gen 6)
|
||||
:MINDBLOWN, # Blacephalon (Gen 7)
|
||||
:PHOTONGEYSER, # Necrozma (Gen 7)
|
||||
:PLASMAFISTS, # Zeraora (Gen 7)
|
||||
:RELICSONG, # Meloetta (Gen 5)
|
||||
:SECRETSWORD, # Keldeo (Gen 5)
|
||||
:SPECTRALTHIEF, # Marshadow (Gen 7)
|
||||
:STEAMERUPTION, # Volcanion (Gen 6)
|
||||
:TECHNOBLAST, # Genesect (Gen 5)
|
||||
:THOUSANDARROWS, # Zygarde (Gen 6)
|
||||
:THOUSANDWAVES, # Zygarde (Gen 6)
|
||||
:VCREATE # Victini (Gen 5)
|
||||
:SNARL,
|
||||
# Signature moves
|
||||
:DIAMONDSTORM, # Diancie (Gen 6)
|
||||
:FLEURCANNON, # Magearna (Gen 7)
|
||||
:FREEZESHOCK, # Black Kyurem (Gen 5)
|
||||
:HYPERSPACEFURY, # Hoopa Unbound (Gen 6)
|
||||
:HYPERSPACEHOLE, # Hoopa Confined (Gen 6)
|
||||
:ICEBURN, # White Kyurem (Gen 5)
|
||||
:LIGHTOFRUIN, # Eternal Flower Floette (Gen 6)
|
||||
:MINDBLOWN, # Blacephalon (Gen 7)
|
||||
:PHOTONGEYSER, # Necrozma (Gen 7)
|
||||
:PLASMAFISTS, # Zeraora (Gen 7)
|
||||
:RELICSONG, # Meloetta (Gen 5)
|
||||
:SECRETSWORD, # Keldeo (Gen 5)
|
||||
:SPECTRALTHIEF, # Marshadow (Gen 7)
|
||||
:STEAMERUPTION, # Volcanion (Gen 6)
|
||||
:TECHNOBLAST, # Genesect (Gen 5)
|
||||
:THOUSANDARROWS, # Zygarde (Gen 6)
|
||||
:THOUSANDWAVES, # Zygarde (Gen 6)
|
||||
:VCREATE # Victini (Gen 5)
|
||||
]
|
||||
end
|
||||
|
||||
@@ -1012,82 +1012,82 @@ class Battle::Move::UseRandomMoveFromUserParty < Battle::Move
|
||||
def initialize(battle, move)
|
||||
super
|
||||
@moveBlacklist = [
|
||||
# Struggle, Belch
|
||||
"Struggle", # Struggle
|
||||
"FailsIfUserNotConsumedBerry", # Belch
|
||||
# Moves that affect the moveset
|
||||
"ReplaceMoveThisBattleWithTargetLastMoveUsed", # Mimic
|
||||
"ReplaceMoveWithTargetLastMoveUsed", # Sketch
|
||||
"TransformUserIntoTarget", # Transform
|
||||
# Counter moves
|
||||
"CounterPhysicalDamage", # Counter
|
||||
"CounterSpecialDamage", # Mirror Coat
|
||||
"CounterDamagePlusHalf", # Metal Burst # Not listed on Bulbapedia
|
||||
# Helping Hand, Feint (always blacklisted together, don't know why)
|
||||
"PowerUpAllyMove", # Helping Hand
|
||||
"RemoveProtections", # Feint
|
||||
# Protection moves
|
||||
"ProtectUser", # Detect, Protect
|
||||
"ProtectUserSideFromPriorityMoves", # Quick Guard # Not listed on Bulbapedia
|
||||
"ProtectUserSideFromMultiTargetDamagingMoves", # Wide Guard # Not listed on Bulbapedia
|
||||
"UserEnduresFaintingThisTurn", # Endure
|
||||
"ProtectUserSideFromDamagingMovesIfUserFirstTurn", # Mat Block
|
||||
"ProtectUserSideFromStatusMoves", # Crafty Shield # Not listed on Bulbapedia
|
||||
"ProtectUserFromDamagingMovesKingsShield", # King's Shield
|
||||
"ProtectUserFromTargetingMovesSpikyShield", # Spiky Shield
|
||||
"ProtectUserBanefulBunker", # Baneful Bunker
|
||||
# Moves that call other moves
|
||||
"UseLastMoveUsedByTarget", # Mirror Move
|
||||
"UseLastMoveUsed", # Copycat
|
||||
"UseMoveTargetIsAboutToUse", # Me First
|
||||
# "UseMoveDependingOnEnvironment", # Nature Power # See below
|
||||
"UseRandomUserMoveIfAsleep", # Sleep Talk
|
||||
"UseRandomMoveFromUserParty", # Assist
|
||||
"UseRandomMove", # Metronome
|
||||
# Move-redirecting and stealing moves
|
||||
"BounceBackProblemCausingStatusMoves", # Magic Coat # Not listed on Bulbapedia
|
||||
"StealAndUseBeneficialStatusMove", # Snatch
|
||||
"RedirectAllMovesToUser", # Follow Me, Rage Powder
|
||||
"RedirectAllMovesToTarget", # Spotlight
|
||||
# Set up effects that trigger upon KO
|
||||
"ReduceAttackerMovePPTo0IfUserFaints", # Grudge # Not listed on Bulbapedia
|
||||
"AttackerFaintsIfUserFaints", # Destiny Bond
|
||||
# Target-switching moves
|
||||
# "SwitchOutTargetStatusMove", # Roar, Whirlwind # See below
|
||||
"SwitchOutTargetDamagingMove", # Circle Throw, Dragon Tail
|
||||
# Held item-moving moves
|
||||
"UserTakesTargetItem", # Covet, Thief
|
||||
"UserTargetSwapItems", # Switcheroo, Trick
|
||||
"TargetTakesUserItem", # Bestow
|
||||
# Moves that start focussing at the start of the round
|
||||
"FailsIfUserDamagedThisTurn", # Focus Punch
|
||||
"UsedAfterUserTakesPhysicalDamage", # Shell Trap
|
||||
"BurnAttackerBeforeUserActs", # Beak Blast
|
||||
# Event moves that do nothing
|
||||
"DoesNothingFailsIfNoAlly", # Hold Hands
|
||||
"DoesNothingCongratulations" # Celebrate
|
||||
# Struggle, Belch
|
||||
"Struggle", # Struggle
|
||||
"FailsIfUserNotConsumedBerry", # Belch
|
||||
# Moves that affect the moveset
|
||||
"ReplaceMoveThisBattleWithTargetLastMoveUsed", # Mimic
|
||||
"ReplaceMoveWithTargetLastMoveUsed", # Sketch
|
||||
"TransformUserIntoTarget", # Transform
|
||||
# Counter moves
|
||||
"CounterPhysicalDamage", # Counter
|
||||
"CounterSpecialDamage", # Mirror Coat
|
||||
"CounterDamagePlusHalf", # Metal Burst # Not listed on Bulbapedia
|
||||
# Helping Hand, Feint (always blacklisted together, don't know why)
|
||||
"PowerUpAllyMove", # Helping Hand
|
||||
"RemoveProtections", # Feint
|
||||
# Protection moves
|
||||
"ProtectUser", # Detect, Protect
|
||||
"ProtectUserSideFromPriorityMoves", # Quick Guard # Not listed on Bulbapedia
|
||||
"ProtectUserSideFromMultiTargetDamagingMoves", # Wide Guard # Not listed on Bulbapedia
|
||||
"UserEnduresFaintingThisTurn", # Endure
|
||||
"ProtectUserSideFromDamagingMovesIfUserFirstTurn", # Mat Block
|
||||
"ProtectUserSideFromStatusMoves", # Crafty Shield # Not listed on Bulbapedia
|
||||
"ProtectUserFromDamagingMovesKingsShield", # King's Shield
|
||||
"ProtectUserFromTargetingMovesSpikyShield", # Spiky Shield
|
||||
"ProtectUserBanefulBunker", # Baneful Bunker
|
||||
# Moves that call other moves
|
||||
"UseLastMoveUsedByTarget", # Mirror Move
|
||||
"UseLastMoveUsed", # Copycat
|
||||
"UseMoveTargetIsAboutToUse", # Me First
|
||||
# "UseMoveDependingOnEnvironment", # Nature Power # See below
|
||||
"UseRandomUserMoveIfAsleep", # Sleep Talk
|
||||
"UseRandomMoveFromUserParty", # Assist
|
||||
"UseRandomMove", # Metronome
|
||||
# Move-redirecting and stealing moves
|
||||
"BounceBackProblemCausingStatusMoves", # Magic Coat # Not listed on Bulbapedia
|
||||
"StealAndUseBeneficialStatusMove", # Snatch
|
||||
"RedirectAllMovesToUser", # Follow Me, Rage Powder
|
||||
"RedirectAllMovesToTarget", # Spotlight
|
||||
# Set up effects that trigger upon KO
|
||||
"ReduceAttackerMovePPTo0IfUserFaints", # Grudge # Not listed on Bulbapedia
|
||||
"AttackerFaintsIfUserFaints", # Destiny Bond
|
||||
# Target-switching moves
|
||||
# "SwitchOutTargetStatusMove", # Roar, Whirlwind # See below
|
||||
"SwitchOutTargetDamagingMove", # Circle Throw, Dragon Tail
|
||||
# Held item-moving moves
|
||||
"UserTakesTargetItem", # Covet, Thief
|
||||
"UserTargetSwapItems", # Switcheroo, Trick
|
||||
"TargetTakesUserItem", # Bestow
|
||||
# Moves that start focussing at the start of the round
|
||||
"FailsIfUserDamagedThisTurn", # Focus Punch
|
||||
"UsedAfterUserTakesPhysicalDamage", # Shell Trap
|
||||
"BurnAttackerBeforeUserActs", # Beak Blast
|
||||
# Event moves that do nothing
|
||||
"DoesNothingFailsIfNoAlly", # Hold Hands
|
||||
"DoesNothingCongratulations" # Celebrate
|
||||
]
|
||||
if Settings::MECHANICS_GENERATION >= 6
|
||||
@moveBlacklist += [
|
||||
# Moves that call other moves
|
||||
"UseMoveDependingOnEnvironment", # Nature Power
|
||||
# Two-turn attacks
|
||||
"TwoTurnAttack", # Razor Wind # Not listed on Bulbapedia
|
||||
"TwoTurnAttackOneTurnInSun", # Solar Beam, Solar Blade # Not listed on Bulbapedia
|
||||
"TwoTurnAttackParalyzeTarget", # Freeze Shock # Not listed on Bulbapedia
|
||||
"TwoTurnAttackBurnTarget", # Ice Burn # Not listed on Bulbapedia
|
||||
"TwoTurnAttackFlinchTarget", # Sky Attack # Not listed on Bulbapedia
|
||||
"TwoTurnAttackChargeRaiseUserDefense1", # Skull Bash # Not listed on Bulbapedia
|
||||
"TwoTurnAttackInvulnerableInSky", # Fly
|
||||
"TwoTurnAttackInvulnerableUnderground", # Dig
|
||||
"TwoTurnAttackInvulnerableUnderwater", # Dive
|
||||
"TwoTurnAttackInvulnerableInSkyParalyzeTarget", # Bounce
|
||||
"TwoTurnAttackInvulnerableRemoveProtections", # Shadow Force/Phantom Force
|
||||
"TwoTurnAttackInvulnerableInSkyTargetCannotAct", # Sky Drop
|
||||
"AllBattlersLoseHalfHPUserSkipsNextTurn", # Shadow Half
|
||||
"TwoTurnAttackRaiseUserSpAtkSpDefSpd2", # Geomancy # Not listed on Bulbapedia
|
||||
# Target-switching moves
|
||||
"SwitchOutTargetStatusMove" # Roar, Whirlwind
|
||||
# Moves that call other moves
|
||||
"UseMoveDependingOnEnvironment", # Nature Power
|
||||
# Two-turn attacks
|
||||
"TwoTurnAttack", # Razor Wind # Not listed on Bulbapedia
|
||||
"TwoTurnAttackOneTurnInSun", # Solar Beam, Solar Blade # Not listed on Bulbapedia
|
||||
"TwoTurnAttackParalyzeTarget", # Freeze Shock # Not listed on Bulbapedia
|
||||
"TwoTurnAttackBurnTarget", # Ice Burn # Not listed on Bulbapedia
|
||||
"TwoTurnAttackFlinchTarget", # Sky Attack # Not listed on Bulbapedia
|
||||
"TwoTurnAttackChargeRaiseUserDefense1", # Skull Bash # Not listed on Bulbapedia
|
||||
"TwoTurnAttackInvulnerableInSky", # Fly
|
||||
"TwoTurnAttackInvulnerableUnderground", # Dig
|
||||
"TwoTurnAttackInvulnerableUnderwater", # Dive
|
||||
"TwoTurnAttackInvulnerableInSkyParalyzeTarget", # Bounce
|
||||
"TwoTurnAttackInvulnerableRemoveProtections", # Shadow Force/Phantom Force
|
||||
"TwoTurnAttackInvulnerableInSkyTargetCannotAct", # Sky Drop
|
||||
"AllBattlersLoseHalfHPUserSkipsNextTurn", # Shadow Half
|
||||
"TwoTurnAttackRaiseUserSpAtkSpDefSpd2", # Geomancy # Not listed on Bulbapedia
|
||||
# Target-switching moves
|
||||
"SwitchOutTargetStatusMove" # Roar, Whirlwind
|
||||
]
|
||||
end
|
||||
end
|
||||
@@ -1127,41 +1127,41 @@ class Battle::Move::UseRandomUserMoveIfAsleep < Battle::Move
|
||||
def initialize(battle, move)
|
||||
super
|
||||
@moveBlacklist = [
|
||||
"MultiTurnAttackPreventSleeping", # Uproar
|
||||
"MultiTurnAttackBideThenReturnDoubleDamage", # Bide
|
||||
# Struggle, Belch
|
||||
"Struggle", # Struggle # Not listed on Bulbapedia
|
||||
"FailsIfUserNotConsumedBerry", # Belch
|
||||
# Moves that affect the moveset (except Transform)
|
||||
"ReplaceMoveThisBattleWithTargetLastMoveUsed", # Mimic
|
||||
"ReplaceMoveWithTargetLastMoveUsed", # Sketch
|
||||
# Moves that call other moves
|
||||
"UseLastMoveUsedByTarget", # Mirror Move
|
||||
"UseLastMoveUsed", # Copycat
|
||||
"UseMoveTargetIsAboutToUse", # Me First
|
||||
"UseMoveDependingOnEnvironment", # Nature Power # Not listed on Bulbapedia
|
||||
"UseRandomUserMoveIfAsleep", # Sleep Talk
|
||||
"UseRandomMoveFromUserParty", # Assist
|
||||
"UseRandomMove", # Metronome
|
||||
# Two-turn attacks
|
||||
"TwoTurnAttack", # Razor Wind
|
||||
"TwoTurnAttackOneTurnInSun", # Solar Beam, Solar Blade
|
||||
"TwoTurnAttackParalyzeTarget", # Freeze Shock
|
||||
"TwoTurnAttackBurnTarget", # Ice Burn
|
||||
"TwoTurnAttackFlinchTarget", # Sky Attack
|
||||
"TwoTurnAttackChargeRaiseUserDefense1", # Skull Bash
|
||||
"TwoTurnAttackInvulnerableInSky", # Fly
|
||||
"TwoTurnAttackInvulnerableUnderground", # Dig
|
||||
"TwoTurnAttackInvulnerableUnderwater", # Dive
|
||||
"TwoTurnAttackInvulnerableInSkyParalyzeTarget", # Bounce
|
||||
"TwoTurnAttackInvulnerableRemoveProtections", # Shadow Force/Phantom Force
|
||||
"TwoTurnAttackInvulnerableInSkyTargetCannotAct", # Sky Drop
|
||||
"AllBattlersLoseHalfHPUserSkipsNextTurn", # Shadow Half
|
||||
"TwoTurnAttackRaiseUserSpAtkSpDefSpd2", # Geomancy
|
||||
# Moves that start focussing at the start of the round
|
||||
"FailsIfUserDamagedThisTurn", # Focus Punch
|
||||
"UsedAfterUserTakesPhysicalDamage", # Shell Trap
|
||||
"BurnAttackerBeforeUserActs" # Beak Blast
|
||||
"MultiTurnAttackPreventSleeping", # Uproar
|
||||
"MultiTurnAttackBideThenReturnDoubleDamage", # Bide
|
||||
# Struggle, Belch
|
||||
"Struggle", # Struggle # Not listed on Bulbapedia
|
||||
"FailsIfUserNotConsumedBerry", # Belch
|
||||
# Moves that affect the moveset (except Transform)
|
||||
"ReplaceMoveThisBattleWithTargetLastMoveUsed", # Mimic
|
||||
"ReplaceMoveWithTargetLastMoveUsed", # Sketch
|
||||
# Moves that call other moves
|
||||
"UseLastMoveUsedByTarget", # Mirror Move
|
||||
"UseLastMoveUsed", # Copycat
|
||||
"UseMoveTargetIsAboutToUse", # Me First
|
||||
"UseMoveDependingOnEnvironment", # Nature Power # Not listed on Bulbapedia
|
||||
"UseRandomUserMoveIfAsleep", # Sleep Talk
|
||||
"UseRandomMoveFromUserParty", # Assist
|
||||
"UseRandomMove", # Metronome
|
||||
# Two-turn attacks
|
||||
"TwoTurnAttack", # Razor Wind
|
||||
"TwoTurnAttackOneTurnInSun", # Solar Beam, Solar Blade
|
||||
"TwoTurnAttackParalyzeTarget", # Freeze Shock
|
||||
"TwoTurnAttackBurnTarget", # Ice Burn
|
||||
"TwoTurnAttackFlinchTarget", # Sky Attack
|
||||
"TwoTurnAttackChargeRaiseUserDefense1", # Skull Bash
|
||||
"TwoTurnAttackInvulnerableInSky", # Fly
|
||||
"TwoTurnAttackInvulnerableUnderground", # Dig
|
||||
"TwoTurnAttackInvulnerableUnderwater", # Dive
|
||||
"TwoTurnAttackInvulnerableInSkyParalyzeTarget", # Bounce
|
||||
"TwoTurnAttackInvulnerableRemoveProtections", # Shadow Force/Phantom Force
|
||||
"TwoTurnAttackInvulnerableInSkyTargetCannotAct", # Sky Drop
|
||||
"AllBattlersLoseHalfHPUserSkipsNextTurn", # Shadow Half
|
||||
"TwoTurnAttackRaiseUserSpAtkSpDefSpd2", # Geomancy
|
||||
# Moves that start focussing at the start of the round
|
||||
"FailsIfUserDamagedThisTurn", # Focus Punch
|
||||
"UsedAfterUserTakesPhysicalDamage", # Shell Trap
|
||||
"BurnAttackerBeforeUserActs" # Beak Blast
|
||||
]
|
||||
end
|
||||
|
||||
@@ -1220,13 +1220,13 @@ class Battle::Move::ReplaceMoveThisBattleWithTargetLastMoveUsed < Battle::Move
|
||||
def initialize(battle, move)
|
||||
super
|
||||
@moveBlacklist = [
|
||||
"UseRandomMove", # Metronome
|
||||
# Struggle
|
||||
"Struggle", # Struggle
|
||||
# Moves that affect the moveset
|
||||
"ReplaceMoveThisBattleWithTargetLastMoveUsed", # Mimic
|
||||
"ReplaceMoveWithTargetLastMoveUsed", # Sketch
|
||||
"TransformUserIntoTarget" # Transform
|
||||
"UseRandomMove", # Metronome
|
||||
# Struggle
|
||||
"Struggle", # Struggle
|
||||
# Moves that affect the moveset
|
||||
"ReplaceMoveThisBattleWithTargetLastMoveUsed", # Mimic
|
||||
"ReplaceMoveWithTargetLastMoveUsed", # Sketch
|
||||
"TransformUserIntoTarget" # Transform
|
||||
]
|
||||
end
|
||||
|
||||
@@ -1271,9 +1271,9 @@ class Battle::Move::ReplaceMoveWithTargetLastMoveUsed < Battle::Move
|
||||
def initialize(battle, move)
|
||||
super
|
||||
@moveBlacklist = [
|
||||
"ReplaceMoveWithTargetLastMoveUsed", # Sketch (this move)
|
||||
# Struggle
|
||||
"Struggle" # Struggle
|
||||
"ReplaceMoveWithTargetLastMoveUsed", # Sketch (this move)
|
||||
# Struggle
|
||||
"Struggle" # Struggle
|
||||
]
|
||||
end
|
||||
|
||||
|
||||
@@ -545,44 +545,44 @@ class Battle::Move::TargetUsesItsLastUsedMoveAgain < Battle::Move
|
||||
def initialize(battle, move)
|
||||
super
|
||||
@moveBlacklist = [
|
||||
"MultiTurnAttackBideThenReturnDoubleDamage", # Bide
|
||||
"ProtectUserFromDamagingMovesKingsShield", # King's Shield
|
||||
"TargetUsesItsLastUsedMoveAgain", # Instruct (this move)
|
||||
# Struggle
|
||||
"Struggle", # Struggle
|
||||
# Moves that affect the moveset
|
||||
"ReplaceMoveThisBattleWithTargetLastMoveUsed", # Mimic
|
||||
"ReplaceMoveWithTargetLastMoveUsed", # Sketch
|
||||
"TransformUserIntoTarget", # Transform
|
||||
# Moves that call other moves
|
||||
"UseLastMoveUsedByTarget", # Mirror Move
|
||||
"UseLastMoveUsed", # Copycat
|
||||
"UseMoveTargetIsAboutToUse", # Me First
|
||||
"UseMoveDependingOnEnvironment", # Nature Power
|
||||
"UseRandomUserMoveIfAsleep", # Sleep Talk
|
||||
"UseRandomMoveFromUserParty", # Assist
|
||||
"UseRandomMove", # Metronome
|
||||
# Moves that require a recharge turn
|
||||
"AttackAndSkipNextTurn", # Hyper Beam
|
||||
# Two-turn attacks
|
||||
"TwoTurnAttack", # Razor Wind
|
||||
"TwoTurnAttackOneTurnInSun", # Solar Beam, Solar Blade
|
||||
"TwoTurnAttackParalyzeTarget", # Freeze Shock
|
||||
"TwoTurnAttackBurnTarget", # Ice Burn
|
||||
"TwoTurnAttackFlinchTarget", # Sky Attack
|
||||
"TwoTurnAttackChargeRaiseUserDefense1", # Skull Bash
|
||||
"TwoTurnAttackInvulnerableInSky", # Fly
|
||||
"TwoTurnAttackInvulnerableUnderground", # Dig
|
||||
"TwoTurnAttackInvulnerableUnderwater", # Dive
|
||||
"TwoTurnAttackInvulnerableInSkyParalyzeTarget", # Bounce
|
||||
"TwoTurnAttackInvulnerableRemoveProtections", # Shadow Force, Phantom Force
|
||||
"TwoTurnAttackInvulnerableInSkyTargetCannotAct", # Sky Drop
|
||||
"AllBattlersLoseHalfHPUserSkipsNextTurn", # Shadow Half
|
||||
"TwoTurnAttackRaiseUserSpAtkSpDefSpd2", # Geomancy
|
||||
# Moves that start focussing at the start of the round
|
||||
"FailsIfUserDamagedThisTurn", # Focus Punch
|
||||
"UsedAfterUserTakesPhysicalDamage", # Shell Trap
|
||||
"BurnAttackerBeforeUserActs" # Beak Blast
|
||||
"MultiTurnAttackBideThenReturnDoubleDamage", # Bide
|
||||
"ProtectUserFromDamagingMovesKingsShield", # King's Shield
|
||||
"TargetUsesItsLastUsedMoveAgain", # Instruct (this move)
|
||||
# Struggle
|
||||
"Struggle", # Struggle
|
||||
# Moves that affect the moveset
|
||||
"ReplaceMoveThisBattleWithTargetLastMoveUsed", # Mimic
|
||||
"ReplaceMoveWithTargetLastMoveUsed", # Sketch
|
||||
"TransformUserIntoTarget", # Transform
|
||||
# Moves that call other moves
|
||||
"UseLastMoveUsedByTarget", # Mirror Move
|
||||
"UseLastMoveUsed", # Copycat
|
||||
"UseMoveTargetIsAboutToUse", # Me First
|
||||
"UseMoveDependingOnEnvironment", # Nature Power
|
||||
"UseRandomUserMoveIfAsleep", # Sleep Talk
|
||||
"UseRandomMoveFromUserParty", # Assist
|
||||
"UseRandomMove", # Metronome
|
||||
# Moves that require a recharge turn
|
||||
"AttackAndSkipNextTurn", # Hyper Beam
|
||||
# Two-turn attacks
|
||||
"TwoTurnAttack", # Razor Wind
|
||||
"TwoTurnAttackOneTurnInSun", # Solar Beam, Solar Blade
|
||||
"TwoTurnAttackParalyzeTarget", # Freeze Shock
|
||||
"TwoTurnAttackBurnTarget", # Ice Burn
|
||||
"TwoTurnAttackFlinchTarget", # Sky Attack
|
||||
"TwoTurnAttackChargeRaiseUserDefense1", # Skull Bash
|
||||
"TwoTurnAttackInvulnerableInSky", # Fly
|
||||
"TwoTurnAttackInvulnerableUnderground", # Dig
|
||||
"TwoTurnAttackInvulnerableUnderwater", # Dive
|
||||
"TwoTurnAttackInvulnerableInSkyParalyzeTarget", # Bounce
|
||||
"TwoTurnAttackInvulnerableRemoveProtections", # Shadow Force, Phantom Force
|
||||
"TwoTurnAttackInvulnerableInSkyTargetCannotAct", # Sky Drop
|
||||
"AllBattlersLoseHalfHPUserSkipsNextTurn", # Shadow Half
|
||||
"TwoTurnAttackRaiseUserSpAtkSpDefSpd2", # Geomancy
|
||||
# Moves that start focussing at the start of the round
|
||||
"FailsIfUserDamagedThisTurn", # Focus Punch
|
||||
"UsedAfterUserTakesPhysicalDamage", # Shell Trap
|
||||
"BurnAttackerBeforeUserActs" # Beak Blast
|
||||
]
|
||||
end
|
||||
|
||||
@@ -771,26 +771,26 @@ class Battle::Move::DisableTargetUsingDifferentMove < Battle::Move
|
||||
def initialize(battle, move)
|
||||
super
|
||||
@moveBlacklist = [
|
||||
"DisableTargetUsingDifferentMove", # Encore
|
||||
# Struggle
|
||||
"Struggle", # Struggle
|
||||
# Moves that affect the moveset
|
||||
"ReplaceMoveThisBattleWithTargetLastMoveUsed", # Mimic
|
||||
"ReplaceMoveWithTargetLastMoveUsed", # Sketch
|
||||
"TransformUserIntoTarget", # Transform
|
||||
# Moves that call other moves (see also below)
|
||||
"UseLastMoveUsedByTarget" # Mirror Move
|
||||
"DisableTargetUsingDifferentMove", # Encore
|
||||
# Struggle
|
||||
"Struggle", # Struggle
|
||||
# Moves that affect the moveset
|
||||
"ReplaceMoveThisBattleWithTargetLastMoveUsed", # Mimic
|
||||
"ReplaceMoveWithTargetLastMoveUsed", # Sketch
|
||||
"TransformUserIntoTarget", # Transform
|
||||
# Moves that call other moves (see also below)
|
||||
"UseLastMoveUsedByTarget" # Mirror Move
|
||||
]
|
||||
if Settings::MECHANICS_GENERATION >= 7
|
||||
@moveBlacklist += [
|
||||
# Moves that call other moves
|
||||
# "UseLastMoveUsedByTarget", # Mirror Move # See above
|
||||
"UseLastMoveUsed", # Copycat
|
||||
"UseMoveTargetIsAboutToUse", # Me First
|
||||
"UseMoveDependingOnEnvironment", # Nature Power
|
||||
"UseRandomUserMoveIfAsleep", # Sleep Talk
|
||||
"UseRandomMoveFromUserParty", # Assist
|
||||
"UseRandomMove" # Metronome
|
||||
# Moves that call other moves
|
||||
# "UseLastMoveUsedByTarget", # Mirror Move # See above
|
||||
"UseLastMoveUsed", # Copycat
|
||||
"UseMoveTargetIsAboutToUse", # Me First
|
||||
"UseMoveDependingOnEnvironment", # Nature Power
|
||||
"UseRandomUserMoveIfAsleep", # Sleep Talk
|
||||
"UseRandomMoveFromUserParty", # Assist
|
||||
"UseRandomMove" # Metronome
|
||||
]
|
||||
end
|
||||
end
|
||||
|
||||
@@ -64,11 +64,11 @@ class Battle::Scene
|
||||
# Shift depending on index (no shifting needed for sideSize of 1)
|
||||
case sideSize
|
||||
when 2
|
||||
ret[0] += [-48, 48, 32, -32][2 * index + side]
|
||||
ret[1] += [ 0, 0, 0, -16][2 * index + side]
|
||||
ret[0] += [-48, 48, 32, -32][(2 * index) + side]
|
||||
ret[1] += [ 0, 0, 0, -16][(2 * index) + side]
|
||||
when 3
|
||||
ret[0] += [-80, 80, 0, 0, 80, -80][2 * index + side]
|
||||
ret[1] += [ 0, 0, 0, -8, 0, -16][2 * index + side]
|
||||
ret[0] += [-80, 80, 0, 0, 80, -80][(2 * index) + side]
|
||||
ret[1] += [ 0, 0, 0, -8, 0, -16][(2 * index) + side]
|
||||
end
|
||||
return ret
|
||||
end
|
||||
|
||||
@@ -83,7 +83,7 @@ class Battle::Scene
|
||||
# Wild battle, so set up the Pokémon sprite(s) accordingly
|
||||
if @battle.wildBattle?
|
||||
@battle.pbParty(1).each_with_index do |pkmn, i|
|
||||
index = i * 2 + 1
|
||||
index = (i * 2) + 1
|
||||
pbChangePokemon(index, pkmn)
|
||||
pkmnSprite = @sprites["pokemon_#{index}"]
|
||||
pkmnSprite.tone = Tone.new(-80, -80, -80)
|
||||
|
||||
@@ -6,11 +6,11 @@ class Battle::Scene
|
||||
def pbCommandMenu(idxBattler, firstAction)
|
||||
shadowTrainer = (GameData::Type.exists?(:SHADOW) && @battle.trainerBattle?)
|
||||
cmds = [
|
||||
_INTL("What will\n{1} do?", @battle.battlers[idxBattler].name),
|
||||
_INTL("Fight"),
|
||||
_INTL("Bag"),
|
||||
_INTL("Pokémon"),
|
||||
(shadowTrainer) ? _INTL("Call") : (firstAction) ? _INTL("Run") : _INTL("Cancel")
|
||||
_INTL("What will\n{1} do?", @battle.battlers[idxBattler].name),
|
||||
_INTL("Fight"),
|
||||
_INTL("Bag"),
|
||||
_INTL("Pokémon"),
|
||||
(shadowTrainer) ? _INTL("Call") : (firstAction) ? _INTL("Run") : _INTL("Cancel")
|
||||
]
|
||||
ret = pbCommandMenuEx(idxBattler, cmds, (shadowTrainer) ? 2 : (firstAction) ? 0 : 1)
|
||||
ret = 4 if ret == 3 && shadowTrainer # Convert "Run" to "Call"
|
||||
|
||||
@@ -28,7 +28,7 @@ class Battle::Scene
|
||||
# shiny animation(s)
|
||||
# Set up data box animation
|
||||
for i in 0...@battle.sideSizes[1]
|
||||
idxBattler = 2 * i + 1
|
||||
idxBattler = (2 * i) + 1
|
||||
next if !@battle.battlers[idxBattler]
|
||||
dataBoxAnim = Animation::DataBoxAppear.new(@sprites, @viewport, idxBattler)
|
||||
@animations.push(dataBoxAnim)
|
||||
@@ -43,7 +43,7 @@ class Battle::Scene
|
||||
# Show shiny animation for wild Pokémon
|
||||
if @battle.showAnims
|
||||
for i in 0...@battle.sideSizes[1]
|
||||
idxBattler = 2 * i + 1
|
||||
idxBattler = (2 * i) + 1
|
||||
next if !@battle.battlers[idxBattler] || !@battle.battlers[idxBattler].shiny?
|
||||
if Settings::SUPER_SHINY && @battle.battlers[idxBattler].super_shiny?
|
||||
pbCommonAnimation("SuperShiny", @battle.battlers[idxBattler])
|
||||
@@ -58,13 +58,14 @@ class Battle::Scene
|
||||
# Animates a party lineup appearing for the given side
|
||||
#=============================================================================
|
||||
def pbShowPartyLineup(side, fullAnim = false)
|
||||
@animations.push(Animation::LineupAppear.new(
|
||||
@sprites, @viewport, side, @battle.pbParty(side), @battle.pbPartyStarts(side), fullAnim
|
||||
))
|
||||
if !fullAnim
|
||||
while inPartyAnimation?
|
||||
pbUpdate
|
||||
end
|
||||
@animations.push(
|
||||
Animation::LineupAppear.new(@sprites, @viewport, side,
|
||||
@battle.pbParty(side), @battle.pbPartyStarts(side),
|
||||
fullAnim)
|
||||
)
|
||||
return if fullAnim
|
||||
while inPartyAnimation?
|
||||
pbUpdate
|
||||
end
|
||||
end
|
||||
|
||||
@@ -298,13 +299,13 @@ class Battle::Scene
|
||||
#=============================================================================
|
||||
def pbLevelUp(pkmn, _battler, oldTotalHP, oldAttack, oldDefense, oldSpAtk, oldSpDef, oldSpeed)
|
||||
pbTopRightWindow(
|
||||
_INTL("Max. HP<r>+{1}\r\nAttack<r>+{2}\r\nDefense<r>+{3}\r\nSp. Atk<r>+{4}\r\nSp. Def<r>+{5}\r\nSpeed<r>+{6}",
|
||||
pkmn.totalhp - oldTotalHP, pkmn.attack - oldAttack, pkmn.defense - oldDefense,
|
||||
pkmn.spatk - oldSpAtk, pkmn.spdef - oldSpDef, pkmn.speed - oldSpeed)
|
||||
_INTL("Max. HP<r>+{1}\r\nAttack<r>+{2}\r\nDefense<r>+{3}\r\nSp. Atk<r>+{4}\r\nSp. Def<r>+{5}\r\nSpeed<r>+{6}",
|
||||
pkmn.totalhp - oldTotalHP, pkmn.attack - oldAttack, pkmn.defense - oldDefense,
|
||||
pkmn.spatk - oldSpAtk, pkmn.spdef - oldSpDef, pkmn.speed - oldSpeed)
|
||||
)
|
||||
pbTopRightWindow(
|
||||
_INTL("Max. HP<r>{1}\r\nAttack<r>{2}\r\nDefense<r>{3}\r\nSp. Atk<r>{4}\r\nSp. Def<r>{5}\r\nSpeed<r>{6}",
|
||||
pkmn.totalhp, pkmn.attack, pkmn.defense, pkmn.spatk, pkmn.spdef, pkmn.speed)
|
||||
_INTL("Max. HP<r>{1}\r\nAttack<r>{2}\r\nDefense<r>{3}\r\nSp. Atk<r>{4}\r\nSp. Def<r>{5}\r\nSpeed<r>{6}",
|
||||
pkmn.totalhp, pkmn.attack, pkmn.defense, pkmn.spatk, pkmn.spdef, pkmn.speed)
|
||||
)
|
||||
end
|
||||
|
||||
@@ -541,7 +542,7 @@ class Battle::Scene
|
||||
end
|
||||
animPlayer.setLineTransform(
|
||||
FOCUSUSER_X, FOCUSUSER_Y, FOCUSTARGET_X, FOCUSTARGET_Y,
|
||||
oldUserX, oldUserY - userHeight / 2, oldTargetX, oldTargetY - targetHeight / 2
|
||||
oldUserX, oldUserY - (userHeight / 2), oldTargetX, oldTargetY - (targetHeight / 2)
|
||||
)
|
||||
# Play the animation
|
||||
animPlayer.start
|
||||
|
||||
@@ -106,11 +106,11 @@ class Battle::Scene::CommandMenu < Battle::Scene::MenuBase
|
||||
USE_GRAPHICS = true
|
||||
# Lists of which button graphics to use in different situations/types of battle.
|
||||
MODES = [
|
||||
[0, 2, 1, 3], # 0 = Regular battle
|
||||
[0, 2, 1, 9], # 1 = Regular battle with "Cancel" instead of "Run"
|
||||
[0, 2, 1, 4], # 2 = Regular battle with "Call" instead of "Run"
|
||||
[5, 7, 6, 3], # 3 = Safari Zone
|
||||
[0, 8, 1, 3] # 4 = Bug Catching Contest
|
||||
[0, 2, 1, 3], # 0 = Regular battle
|
||||
[0, 2, 1, 9], # 1 = Regular battle with "Cancel" instead of "Run"
|
||||
[0, 2, 1, 4], # 2 = Regular battle with "Call" instead of "Run"
|
||||
[5, 7, 6, 3], # 3 = Safari Zone
|
||||
[0, 8, 1, 3] # 4 = Bug Catching Contest
|
||||
]
|
||||
|
||||
def initialize(viewport, z)
|
||||
@@ -137,7 +137,7 @@ class Battle::Scene::CommandMenu < Battle::Scene::MenuBase
|
||||
button = SpriteWrapper.new(viewport)
|
||||
button.bitmap = @buttonBitmap.bitmap
|
||||
button.x = self.x + Graphics.width - 260
|
||||
button.x += (i.even? ? 0 : @buttonBitmap.width / 2 - 4)
|
||||
button.x += (i.even? ? 0 : (@buttonBitmap.width / 2) - 4)
|
||||
button.y = self.y + 6
|
||||
button.y += (((i / 2) == 0) ? 0 : BUTTON_HEIGHT - 4)
|
||||
button.src_rect.width = @buttonBitmap.width / 2
|
||||
@@ -218,10 +218,10 @@ class Battle::Scene::FightMenu < Battle::Scene::MenuBase
|
||||
TYPE_ICON_HEIGHT = 28
|
||||
# Text colours of PP of selected move
|
||||
PP_COLORS = [
|
||||
Color.new(248, 72, 72), Color.new(136, 48, 48), # Red, zero PP
|
||||
Color.new(248, 136, 32), Color.new(144, 72, 24), # Orange, 1/4 of total PP or less
|
||||
Color.new(248, 192, 0), Color.new(144, 104, 0), # Yellow, 1/2 of total PP or less
|
||||
TEXT_BASE_COLOR, TEXT_SHADOW_COLOR # Black, more than 1/2 of total PP
|
||||
Color.new(248, 72, 72), Color.new(136, 48, 48), # Red, zero PP
|
||||
Color.new(248, 136, 32), Color.new(144, 72, 24), # Orange, 1/4 of total PP or less
|
||||
Color.new(248, 192, 0), Color.new(144, 104, 0), # Yellow, 1/2 of total PP or less
|
||||
TEXT_BASE_COLOR, TEXT_SHADOW_COLOR # Black, more than 1/2 of total PP
|
||||
]
|
||||
|
||||
def initialize(viewport, z)
|
||||
@@ -247,7 +247,7 @@ class Battle::Scene::FightMenu < Battle::Scene::MenuBase
|
||||
button = SpriteWrapper.new(viewport)
|
||||
button.bitmap = @buttonBitmap.bitmap
|
||||
button.x = self.x + 4
|
||||
button.x += (i.even? ? 0 : @buttonBitmap.width / 2 - 4)
|
||||
button.x += (i.even? ? 0 : (@buttonBitmap.width / 2) - 4)
|
||||
button.y = self.y + 6
|
||||
button.y += (((i / 2) == 0) ? 0 : BUTTON_HEIGHT - 4)
|
||||
button.src_rect.width = @buttonBitmap.width / 2
|
||||
@@ -278,7 +278,7 @@ class Battle::Scene::FightMenu < Battle::Scene::MenuBase
|
||||
@megaButton = SpriteWrapper.new(viewport)
|
||||
@megaButton.bitmap = @megaEvoBitmap.bitmap
|
||||
@megaButton.x = self.x + 120
|
||||
@megaButton.y = self.y - @megaEvoBitmap.height / 2
|
||||
@megaButton.y = self.y - (@megaEvoBitmap.height / 2)
|
||||
@megaButton.src_rect.height = @megaEvoBitmap.height / 2
|
||||
addSprite("megaButton", @megaButton)
|
||||
# Create Shift button
|
||||
@@ -354,7 +354,7 @@ class Battle::Scene::FightMenu < Battle::Scene::MenuBase
|
||||
textPos = []
|
||||
@buttons.each_with_index do |button, i|
|
||||
next if !@visibility["button_#{i}"]
|
||||
x = button.x - self.x + button.src_rect.width / 2
|
||||
x = button.x - self.x + (button.src_rect.width / 2)
|
||||
y = button.y - self.y + 2
|
||||
moveNameBase = TEXT_BASE_COLOR
|
||||
if GET_MOVE_TEXT_COLOR_FROM_MOVE_BUTTON && moves[i].display_type(@battler)
|
||||
@@ -414,7 +414,7 @@ class Battle::Scene::FightMenu < Battle::Scene::MenuBase
|
||||
ppFraction = [(4.0 * move.pp / move.total_pp).ceil, 3].min
|
||||
textPos = []
|
||||
textPos.push([_INTL("PP: {1}/{2}", move.pp, move.total_pp),
|
||||
448, 44, 2, PP_COLORS[ppFraction * 2], PP_COLORS[ppFraction * 2 + 1]])
|
||||
448, 44, 2, PP_COLORS[ppFraction * 2], PP_COLORS[(ppFraction * 2) + 1]])
|
||||
pbDrawTextPositions(@infoOverlay.bitmap, textPos)
|
||||
end
|
||||
end
|
||||
@@ -454,11 +454,11 @@ class Battle::Scene::TargetMenu < Battle::Scene::MenuBase
|
||||
|
||||
# Lists of which button graphics to use in different situations/types of battle.
|
||||
MODES = [
|
||||
[0, 2, 1, 3], # 0 = Regular battle
|
||||
[0, 2, 1, 9], # 1 = Regular battle with "Cancel" instead of "Run"
|
||||
[0, 2, 1, 4], # 2 = Regular battle with "Call" instead of "Run"
|
||||
[5, 7, 6, 3], # 3 = Safari Zone
|
||||
[0, 8, 1, 3] # 4 = Bug Catching Contest
|
||||
[0, 2, 1, 3], # 0 = Regular battle
|
||||
[0, 2, 1, 9], # 1 = Regular battle with "Cancel" instead of "Run"
|
||||
[0, 2, 1, 4], # 2 = Regular battle with "Call" instead of "Run"
|
||||
[5, 7, 6, 3], # 3 = Safari Zone
|
||||
[0, 8, 1, 3] # 4 = Bug Catching Contest
|
||||
]
|
||||
CMD_BUTTON_WIDTH_SMALL = 170
|
||||
TEXT_BASE_COLOR = Color.new(240, 248, 224)
|
||||
@@ -467,7 +467,7 @@ class Battle::Scene::TargetMenu < Battle::Scene::MenuBase
|
||||
def initialize(viewport, z, sideSizes)
|
||||
super(viewport)
|
||||
@sideSizes = sideSizes
|
||||
maxIndex = (@sideSizes[0] > @sideSizes[1]) ? (@sideSizes[0] - 1) * 2 : @sideSizes[1] * 2 - 1
|
||||
maxIndex = (@sideSizes[0] > @sideSizes[1]) ? (@sideSizes[0] - 1) * 2 : (@sideSizes[1] * 2) - 1
|
||||
@smallButtons = (@sideSizes.max > 2)
|
||||
self.x = 0
|
||||
self.y = Graphics.height - 96
|
||||
@@ -483,7 +483,7 @@ class Battle::Scene::TargetMenu < Battle::Scene::MenuBase
|
||||
# NOTE: Battler indexes go from left to right from the perspective of
|
||||
# that side's trainer, so inc is different for each side for the
|
||||
# same value of i/2.
|
||||
inc = (i.even?) ? i / 2 : numButtons - 1 - i / 2
|
||||
inc = (i.even?) ? i / 2 : numButtons - 1 - (i / 2)
|
||||
button = SpriteWrapper.new(viewport)
|
||||
button.bitmap = @buttonBitmap.bitmap
|
||||
button.src_rect.width = (@smallButtons) ? CMD_BUTTON_WIDTH_SMALL : @buttonBitmap.width / 2
|
||||
@@ -536,7 +536,7 @@ class Battle::Scene::TargetMenu < Battle::Scene::MenuBase
|
||||
sel ||= (@mode == 1)
|
||||
buttonType = (i.even?) ? 1 : 2
|
||||
end
|
||||
buttonType = 2 * buttonType + ((@smallButtons) ? 1 : 0)
|
||||
buttonType = (2 * buttonType) + ((@smallButtons) ? 1 : 0)
|
||||
button.src_rect.x = (sel) ? @buttonBitmap.width / 2 : 0
|
||||
button.src_rect.y = buttonType * BUTTON_HEIGHT
|
||||
button.z = self.z + ((sel) ? 3 : 2)
|
||||
@@ -546,7 +546,7 @@ class Battle::Scene::TargetMenu < Battle::Scene::MenuBase
|
||||
textpos = []
|
||||
@buttons.each_with_index do |button, i|
|
||||
next if !button || nil_or_empty?(@texts[i])
|
||||
x = button.x - self.x + button.src_rect.width / 2
|
||||
x = button.x - self.x + (button.src_rect.width / 2)
|
||||
y = button.y - self.y + 2
|
||||
textpos.push([@texts[i], x, y, 2, TEXT_BASE_COLOR, TEXT_SHADOW_COLOR])
|
||||
end
|
||||
|
||||
@@ -96,7 +96,7 @@ class Battle::Scene::PokemonDataBox < SpriteWrapper
|
||||
@contents = BitmapWrapper.new(@databoxBitmap.width, @databoxBitmap.height)
|
||||
self.bitmap = @contents
|
||||
self.visible = false
|
||||
self.z = 150 + ((@battler.index) / 2) * 5
|
||||
self.z = 150 + ((@battler.index / 2) * 5)
|
||||
pbSetSystemFont(self.bitmap)
|
||||
end
|
||||
|
||||
@@ -538,9 +538,9 @@ class Battle::Scene::BattlerSprite < RPG::Sprite
|
||||
return if !@_iconBitmap
|
||||
pbSetOrigin
|
||||
if @index.even?
|
||||
self.z = 50 + 5 * @index / 2
|
||||
self.z = 50 + (5 * @index / 2)
|
||||
else
|
||||
self.z = 50 - 5 * (@index + 1) / 2
|
||||
self.z = 50 - (5 * (@index + 1) / 2)
|
||||
end
|
||||
# Set original position
|
||||
p = Battle::Scene.pbBattlerPosition(@index, @sideSize)
|
||||
|
||||
@@ -102,7 +102,7 @@ module Battle::Scene::Animation::BallAnimationMixin
|
||||
ball.setVisible(7, true)
|
||||
ballStartX = traSprite.x
|
||||
ballStartX -= ball.totalDuration * (Graphics.width / (2 * 16)) if !safariThrow
|
||||
ballStartY = traSprite.y - traSprite.bitmap.height / 2
|
||||
ballStartY = traSprite.y - (traSprite.bitmap.height / 2)
|
||||
return ballStartX, ballStartY
|
||||
end
|
||||
# Back sprite is animated, make the Poké Ball track the trainer's hand
|
||||
@@ -166,13 +166,13 @@ module Battle::Scene::Animation::BallAnimationMixin
|
||||
# throw). Instead, that throw animation and initialDelay are designed
|
||||
# to make sure the Ball's trajectory starts at the same position.
|
||||
ball.setVisible(delay, true)
|
||||
a = 2 * startY - 4 * midY + 2 * endY
|
||||
b = 4 * midY - 3 * startY - endY
|
||||
a = (2 * startY) - (4 * midY) + (2 * endY)
|
||||
b = (4 * midY) - (3 * startY) - endY
|
||||
c = startY
|
||||
for i in 1..duration
|
||||
t = i.to_f / duration # t ranges from 0 to 1
|
||||
x = startX + (endX - startX) * t # Linear in t
|
||||
y = a * t**2 + b * t + c # Quadratic in t
|
||||
t = i.to_f / duration # t ranges from 0 to 1
|
||||
x = startX + ((endX - startX) * t) # Linear in t
|
||||
y = (a * (t**2)) + (b * t) + c # Quadratic in t
|
||||
ball.moveXY(delay + i - 1, 1, x, y)
|
||||
end
|
||||
createBallTumbling(ball, delay, duration)
|
||||
|
||||
@@ -28,7 +28,7 @@ class Battle::Scene::Animation::Intro < Battle::Scene::Animation
|
||||
end
|
||||
else # Wild battle
|
||||
@battle.pbParty(1).each_with_index do |_pkmn, i|
|
||||
idxBattler = 2 * i + 1
|
||||
idxBattler = (2 * i) + 1
|
||||
makeSlideSprite("pokemon_#{idxBattler}", -1, appearTime, PictureOrigin::Bottom)
|
||||
end
|
||||
end
|
||||
@@ -71,7 +71,7 @@ class Battle::Scene::Animation::Intro2 < Battle::Scene::Animation
|
||||
|
||||
def createProcesses
|
||||
for i in 0...@sideSize
|
||||
idxBattler = 2 * i + 1
|
||||
idxBattler = (2 * i) + 1
|
||||
next if !@sprites["pokemon_#{idxBattler}"]
|
||||
battler = addSprite(@sprites["pokemon_#{idxBattler}"], PictureOrigin::Bottom)
|
||||
battler.moveTone(0, 4, Tone.new(0, 0, 0, 0))
|
||||
@@ -112,7 +112,7 @@ class Battle::Scene::Animation::LineupAppear < Battle::Scene::Animation
|
||||
ballY = barY - 30
|
||||
barX -= bar.bitmap.width
|
||||
end
|
||||
ballXdiff = 32 * (1 - 2 * @side)
|
||||
ballXdiff = 32 * (1 - (2 * @side))
|
||||
bar.x = barX
|
||||
bar.y = barY
|
||||
bar.opacity = 255
|
||||
@@ -155,7 +155,7 @@ class Battle::Scene::Animation::LineupAppear < Battle::Scene::Animation
|
||||
bar.moveDelta(0, 8, -dir * Graphics.width / 2, 0)
|
||||
delay = bar.totalDuration
|
||||
for i in 0...Battle::Scene::NUM_BALLS
|
||||
createBall(i, (@fullAnim) ? delay + i * 2 : 0, dir)
|
||||
createBall(i, (@fullAnim) ? delay + (i * 2) : 0, dir)
|
||||
end
|
||||
end
|
||||
|
||||
@@ -287,7 +287,7 @@ class Battle::Scene::Animation::TrainerAppear < Battle::Scene::Animation
|
||||
# Make new trainer sprite move on-screen
|
||||
if @sprites["trainer_#{@idxTrainer + 1}"]
|
||||
trainerX, trainerY = Battle::Scene.pbTrainerPosition(1)
|
||||
trainerX += 64 + Graphics.width / 4
|
||||
trainerX += 64 + (Graphics.width / 4)
|
||||
newTrainer = addSprite(@sprites["trainer_#{@idxTrainer + 1}"], PictureOrigin::Bottom)
|
||||
newTrainer.setVisible(delay, true)
|
||||
newTrainer.setXY(delay, trainerX, trainerY)
|
||||
@@ -342,7 +342,7 @@ class Battle::Scene::Animation::PlayerFade < Battle::Scene::Animation
|
||||
for i in 0...Battle::Scene::NUM_BALLS
|
||||
next if !@sprites["partyBall_0_#{i}"] || !@sprites["partyBall_0_#{i}"].visible
|
||||
partyBall = addSprite(@sprites["partyBall_0_#{i}"])
|
||||
partyBall.moveDelta(delay + 2 * i, 16, -Graphics.width, 0) if @fullAnim
|
||||
partyBall.moveDelta(delay + (2 * i), 16, -Graphics.width, 0) if @fullAnim
|
||||
partyBall.moveOpacity(delay, 12, 0)
|
||||
partyBall.setVisible(delay + 12, false)
|
||||
partyBall.setOpacity(delay + 12, 255)
|
||||
@@ -387,7 +387,7 @@ class Battle::Scene::Animation::TrainerFade < Battle::Scene::Animation
|
||||
for i in 0...Battle::Scene::NUM_BALLS
|
||||
next if !@sprites["partyBall_1_#{i}"] || !@sprites["partyBall_1_#{i}"].visible
|
||||
partyBall = addSprite(@sprites["partyBall_1_#{i}"])
|
||||
partyBall.moveDelta(delay + 2 * i, 16, Graphics.width, 0) if @fullAnim
|
||||
partyBall.moveDelta(delay + (2 * i), 16, Graphics.width, 0) if @fullAnim
|
||||
partyBall.moveOpacity(delay, 12, 0)
|
||||
partyBall.setVisible(delay + 12, false)
|
||||
partyBall.setOpacity(delay + 12, 255)
|
||||
@@ -782,12 +782,12 @@ class Battle::Scene::Animation::PokeballThrowCapture < Battle::Scene::Animation
|
||||
d = [1, 2, 4, 8][i] # Fraction of the starting height each bounce rises to
|
||||
delay -= t if i == 0
|
||||
if i > 0
|
||||
ball.setZoomXY(delay, 100 + 5 * (5 - i), 100 - 5 * (5 - i)) # Squish
|
||||
ball.setZoomXY(delay, 100 + (5 * (5 - i)), 100 - (5 * (5 - i))) # Squish
|
||||
ball.moveZoom(delay, 2, 100) # Unsquish
|
||||
ball.moveXY(delay, t, ballEndX, ballGroundY - (ballGroundY - ballEndY) / d)
|
||||
ball.moveXY(delay, t, ballEndX, ballGroundY - ((ballGroundY - ballEndY) / d))
|
||||
end
|
||||
ball.moveXY(delay + t, t, ballEndX, ballGroundY)
|
||||
ball.setSE(delay + 2 * t, "Battle ball drop", 100 - i * 7)
|
||||
ball.setSE(delay + (2 * t), "Battle ball drop", 100 - (i * 7))
|
||||
delay = ball.totalDuration
|
||||
end
|
||||
battler.setXY(ball.totalDuration, ballEndX, ballGroundY)
|
||||
@@ -795,9 +795,9 @@ class Battle::Scene::Animation::PokeballThrowCapture < Battle::Scene::Animation
|
||||
delay = ball.totalDuration + 12
|
||||
for i in 0...[@numShakes, 3].min
|
||||
ball.setSE(delay, "Battle ball shake")
|
||||
ball.moveXY(delay, 2, ballEndX - 2 * (4 - i), ballGroundY)
|
||||
ball.moveXY(delay, 2, ballEndX - (2 * (4 - i)), ballGroundY)
|
||||
ball.moveAngle(delay, 2, 5 * (4 - i)) # positive means counterclockwise
|
||||
ball.moveXY(delay + 2, 4, ballEndX + 2 * (4 - i), ballGroundY)
|
||||
ball.moveXY(delay + 2, 4, ballEndX + (2 * (4 - i)), ballGroundY)
|
||||
ball.moveAngle(delay + 2, 4, -5 * (4 - i)) # negative means clockwise
|
||||
ball.moveXY(delay + 6, 2, ballEndX, ballGroundY)
|
||||
ball.moveAngle(delay + 6, 2, 0)
|
||||
|
||||
@@ -29,24 +29,24 @@ class Battle::AI
|
||||
pkmn = battler.pokemon
|
||||
# Item categories
|
||||
hpItems = {
|
||||
:POTION => 20,
|
||||
:SUPERPOTION => (Settings::REBALANCED_HEALING_ITEM_AMOUNTS) ? 60 : 50,
|
||||
:HYPERPOTION => (Settings::REBALANCED_HEALING_ITEM_AMOUNTS) ? 120 : 200,
|
||||
:MAXPOTION => 999,
|
||||
:BERRYJUICE => 20,
|
||||
:SWEETHEART => 20,
|
||||
:FRESHWATER => (Settings::REBALANCED_HEALING_ITEM_AMOUNTS) ? 30 : 50,
|
||||
:SODAPOP => (Settings::REBALANCED_HEALING_ITEM_AMOUNTS) ? 50 : 60,
|
||||
:LEMONADE => (Settings::REBALANCED_HEALING_ITEM_AMOUNTS) ? 70 : 80,
|
||||
:MOOMOOMILK => 100,
|
||||
:ORANBERRY => 10,
|
||||
:SITRUSBERRY => battler.totalhp / 4,
|
||||
:ENERGYPOWDER => (Settings::REBALANCED_HEALING_ITEM_AMOUNTS) ? 60 : 50,
|
||||
:ENERGYROOT => (Settings::REBALANCED_HEALING_ITEM_AMOUNTS) ? 120 : 200
|
||||
:POTION => 20,
|
||||
:SUPERPOTION => (Settings::REBALANCED_HEALING_ITEM_AMOUNTS) ? 60 : 50,
|
||||
:HYPERPOTION => (Settings::REBALANCED_HEALING_ITEM_AMOUNTS) ? 120 : 200,
|
||||
:MAXPOTION => 999,
|
||||
:BERRYJUICE => 20,
|
||||
:SWEETHEART => 20,
|
||||
:FRESHWATER => (Settings::REBALANCED_HEALING_ITEM_AMOUNTS) ? 30 : 50,
|
||||
:SODAPOP => (Settings::REBALANCED_HEALING_ITEM_AMOUNTS) ? 50 : 60,
|
||||
:LEMONADE => (Settings::REBALANCED_HEALING_ITEM_AMOUNTS) ? 70 : 80,
|
||||
:MOOMOOMILK => 100,
|
||||
:ORANBERRY => 10,
|
||||
:SITRUSBERRY => battler.totalhp / 4,
|
||||
:ENERGYPOWDER => (Settings::REBALANCED_HEALING_ITEM_AMOUNTS) ? 60 : 50,
|
||||
:ENERGYROOT => (Settings::REBALANCED_HEALING_ITEM_AMOUNTS) ? 120 : 200
|
||||
}
|
||||
hpItems[:RAGECANDYBAR] = 20 if !Settings::RAGE_CANDY_BAR_CURES_STATUS_PROBLEMS
|
||||
fullRestoreItems = [
|
||||
:FULLRESTORE
|
||||
:FULLRESTORE
|
||||
]
|
||||
oneStatusItems = [ # Preferred over items that heal all status problems
|
||||
:AWAKENING, :CHESTOBERRY, :BLUEFLUTE,
|
||||
@@ -56,43 +56,43 @@ class Battle::AI
|
||||
:ICEHEAL, :ASPEARBERRY
|
||||
]
|
||||
allStatusItems = [
|
||||
:FULLHEAL, :LAVACOOKIE, :OLDGATEAU, :CASTELIACONE, :LUMIOSEGALETTE,
|
||||
:SHALOURSABLE, :BIGMALASADA, :PEWTERCRUNCHIES, :LUMBERRY, :HEALPOWDER
|
||||
:FULLHEAL, :LAVACOOKIE, :OLDGATEAU, :CASTELIACONE, :LUMIOSEGALETTE,
|
||||
:SHALOURSABLE, :BIGMALASADA, :PEWTERCRUNCHIES, :LUMBERRY, :HEALPOWDER
|
||||
]
|
||||
allStatusItems.push(:RAGECANDYBAR) if Settings::RAGE_CANDY_BAR_CURES_STATUS_PROBLEMS
|
||||
xItems = {
|
||||
:XATTACK => [:ATTACK, (Settings::X_STAT_ITEMS_RAISE_BY_TWO_STAGES) ? 2 : 1],
|
||||
:XATTACK2 => [:ATTACK, 2],
|
||||
:XATTACK3 => [:ATTACK, 3],
|
||||
:XATTACK6 => [:ATTACK, 6],
|
||||
:XDEFENSE => [:DEFENSE, (Settings::X_STAT_ITEMS_RAISE_BY_TWO_STAGES) ? 2 : 1],
|
||||
:XDEFENSE2 => [:DEFENSE, 2],
|
||||
:XDEFENSE3 => [:DEFENSE, 3],
|
||||
:XDEFENSE6 => [:DEFENSE, 6],
|
||||
:XDEFEND => [:DEFENSE, (Settings::X_STAT_ITEMS_RAISE_BY_TWO_STAGES) ? 2 : 1],
|
||||
:XDEFEND2 => [:DEFENSE, 2],
|
||||
:XDEFEND3 => [:DEFENSE, 3],
|
||||
:XDEFEND6 => [:DEFENSE, 6],
|
||||
:XSPATK => [:SPECIAL_ATTACK, (Settings::X_STAT_ITEMS_RAISE_BY_TWO_STAGES) ? 2 : 1],
|
||||
:XSPATK2 => [:SPECIAL_ATTACK, 2],
|
||||
:XSPATK3 => [:SPECIAL_ATTACK, 3],
|
||||
:XSPATK6 => [:SPECIAL_ATTACK, 6],
|
||||
:XSPECIAL => [:SPECIAL_ATTACK, (Settings::X_STAT_ITEMS_RAISE_BY_TWO_STAGES) ? 2 : 1],
|
||||
:XSPECIAL2 => [:SPECIAL_ATTACK, 2],
|
||||
:XSPECIAL3 => [:SPECIAL_ATTACK, 3],
|
||||
:XSPECIAL6 => [:SPECIAL_ATTACK, 6],
|
||||
:XSPDEF => [:SPECIAL_DEFENSE, (Settings::X_STAT_ITEMS_RAISE_BY_TWO_STAGES) ? 2 : 1],
|
||||
:XSPDEF2 => [:SPECIAL_DEFENSE, 2],
|
||||
:XSPDEF3 => [:SPECIAL_DEFENSE, 3],
|
||||
:XSPDEF6 => [:SPECIAL_DEFENSE, 6],
|
||||
:XSPEED => [:SPEED, (Settings::X_STAT_ITEMS_RAISE_BY_TWO_STAGES) ? 2 : 1],
|
||||
:XSPEED2 => [:SPEED, 2],
|
||||
:XSPEED3 => [:SPEED, 3],
|
||||
:XSPEED6 => [:SPEED, 6],
|
||||
:XACCURACY => [:ACCURACY, (Settings::X_STAT_ITEMS_RAISE_BY_TWO_STAGES) ? 2 : 1],
|
||||
:XACCURACY2 => [:ACCURACY, 2],
|
||||
:XACCURACY3 => [:ACCURACY, 3],
|
||||
:XACCURACY6 => [:ACCURACY, 6]
|
||||
:XATTACK => [:ATTACK, (Settings::X_STAT_ITEMS_RAISE_BY_TWO_STAGES) ? 2 : 1],
|
||||
:XATTACK2 => [:ATTACK, 2],
|
||||
:XATTACK3 => [:ATTACK, 3],
|
||||
:XATTACK6 => [:ATTACK, 6],
|
||||
:XDEFENSE => [:DEFENSE, (Settings::X_STAT_ITEMS_RAISE_BY_TWO_STAGES) ? 2 : 1],
|
||||
:XDEFENSE2 => [:DEFENSE, 2],
|
||||
:XDEFENSE3 => [:DEFENSE, 3],
|
||||
:XDEFENSE6 => [:DEFENSE, 6],
|
||||
:XDEFEND => [:DEFENSE, (Settings::X_STAT_ITEMS_RAISE_BY_TWO_STAGES) ? 2 : 1],
|
||||
:XDEFEND2 => [:DEFENSE, 2],
|
||||
:XDEFEND3 => [:DEFENSE, 3],
|
||||
:XDEFEND6 => [:DEFENSE, 6],
|
||||
:XSPATK => [:SPECIAL_ATTACK, (Settings::X_STAT_ITEMS_RAISE_BY_TWO_STAGES) ? 2 : 1],
|
||||
:XSPATK2 => [:SPECIAL_ATTACK, 2],
|
||||
:XSPATK3 => [:SPECIAL_ATTACK, 3],
|
||||
:XSPATK6 => [:SPECIAL_ATTACK, 6],
|
||||
:XSPECIAL => [:SPECIAL_ATTACK, (Settings::X_STAT_ITEMS_RAISE_BY_TWO_STAGES) ? 2 : 1],
|
||||
:XSPECIAL2 => [:SPECIAL_ATTACK, 2],
|
||||
:XSPECIAL3 => [:SPECIAL_ATTACK, 3],
|
||||
:XSPECIAL6 => [:SPECIAL_ATTACK, 6],
|
||||
:XSPDEF => [:SPECIAL_DEFENSE, (Settings::X_STAT_ITEMS_RAISE_BY_TWO_STAGES) ? 2 : 1],
|
||||
:XSPDEF2 => [:SPECIAL_DEFENSE, 2],
|
||||
:XSPDEF3 => [:SPECIAL_DEFENSE, 3],
|
||||
:XSPDEF6 => [:SPECIAL_DEFENSE, 6],
|
||||
:XSPEED => [:SPEED, (Settings::X_STAT_ITEMS_RAISE_BY_TWO_STAGES) ? 2 : 1],
|
||||
:XSPEED2 => [:SPEED, 2],
|
||||
:XSPEED3 => [:SPEED, 3],
|
||||
:XSPEED6 => [:SPEED, 6],
|
||||
:XACCURACY => [:ACCURACY, (Settings::X_STAT_ITEMS_RAISE_BY_TWO_STAGES) ? 2 : 1],
|
||||
:XACCURACY2 => [:ACCURACY, 2],
|
||||
:XACCURACY3 => [:ACCURACY, 3],
|
||||
:XACCURACY6 => [:ACCURACY, 6]
|
||||
}
|
||||
losthp = battler.totalhp - battler.hp
|
||||
preferFullRestore = (battler.hp <= battler.totalhp * 2 / 3 &&
|
||||
|
||||
@@ -176,18 +176,15 @@ class Battle::AI
|
||||
miss = false if user.hasActiveAbility?(:NOGUARD) || target.hasActiveAbility?(:NOGUARD)
|
||||
if miss && pbRoughStat(user, :SPEED, skill) > pbRoughStat(target, :SPEED, skill)
|
||||
# Knows what can get past semi-invulnerability
|
||||
if target.effects[PBEffects::SkyDrop] >= 0
|
||||
if target.effects[PBEffects::SkyDrop] >= 0 ||
|
||||
target.inTwoTurnAttack?("TwoTurnAttackInvulnerableInSky",
|
||||
"TwoTurnAttackInvulnerableInSkyParalyzeTarget",
|
||||
"TwoTurnAttackInvulnerableInSkyTargetCannotAct")
|
||||
miss = false if move.hitsFlyingTargets?
|
||||
else
|
||||
if target.inTwoTurnAttack?("TwoTurnAttackInvulnerableInSky",
|
||||
"TwoTurnAttackInvulnerableInSkyParalyzeTarget",
|
||||
"TwoTurnAttackInvulnerableInSkyTargetCannotAct")
|
||||
miss = false if move.hitsFlyingTargets?
|
||||
elsif target.inTwoTurnAttack?("TwoTurnAttackInvulnerableUnderground")
|
||||
miss = false if move.hitsDiggingTargets?
|
||||
elsif target.inTwoTurnAttack?("TwoTurnAttackInvulnerableUnderwater")
|
||||
miss = false if move.hitsDivingTargets?
|
||||
end
|
||||
elsif target.inTwoTurnAttack?("TwoTurnAttackInvulnerableUnderground")
|
||||
miss = false if move.hitsDiggingTargets?
|
||||
elsif target.inTwoTurnAttack?("TwoTurnAttackInvulnerableUnderwater")
|
||||
miss = false if move.hitsDivingTargets?
|
||||
end
|
||||
end
|
||||
score -= 80 if miss
|
||||
|
||||
@@ -28,10 +28,8 @@ class Battle::AI
|
||||
score -= 50
|
||||
end
|
||||
end
|
||||
else
|
||||
if skill >= PBTrainerAI.mediumSkill
|
||||
score -= 90 if move.statusMove?
|
||||
end
|
||||
elsif skill >= PBTrainerAI.mediumSkill
|
||||
score -= 90 if move.statusMove?
|
||||
end
|
||||
#---------------------------------------------------------------------------
|
||||
when "SleepTargetNextTurn"
|
||||
@@ -63,10 +61,8 @@ class Battle::AI
|
||||
score += 10 if pbRoughStat(target, :SPECIAL_DEFENSE, skill) > 100
|
||||
score -= 40 if target.hasActiveAbility?([:GUTS, :MARVELSCALE, :TOXICBOOST])
|
||||
end
|
||||
else
|
||||
if skill >= PBTrainerAI.mediumSkill
|
||||
score -= 90 if move.statusMove?
|
||||
end
|
||||
elsif skill >= PBTrainerAI.mediumSkill
|
||||
score -= 90 if move.statusMove?
|
||||
end
|
||||
#---------------------------------------------------------------------------
|
||||
when "ParalyzeTarget", "ParalyzeTargetIfNotTypeImmune",
|
||||
@@ -89,10 +85,8 @@ class Battle::AI
|
||||
if skill >= PBTrainerAI.highSkill
|
||||
score -= 40 if target.hasActiveAbility?([:GUTS, :MARVELSCALE, :QUICKFEET])
|
||||
end
|
||||
else
|
||||
if skill >= PBTrainerAI.mediumSkill
|
||||
score -= 90 if move.statusMove?
|
||||
end
|
||||
elsif skill >= PBTrainerAI.mediumSkill
|
||||
score -= 90 if move.statusMove?
|
||||
end
|
||||
#---------------------------------------------------------------------------
|
||||
when "BurnTarget", "BurnFlinchTarget", "TwoTurnAttackBurnTarget"
|
||||
@@ -101,10 +95,8 @@ class Battle::AI
|
||||
if skill >= PBTrainerAI.highSkill
|
||||
score -= 40 if target.hasActiveAbility?([:GUTS, :MARVELSCALE, :QUICKFEET, :FLAREBOOST])
|
||||
end
|
||||
else
|
||||
if skill >= PBTrainerAI.mediumSkill
|
||||
score -= 90 if move.statusMove?
|
||||
end
|
||||
elsif skill >= PBTrainerAI.mediumSkill
|
||||
score -= 90 if move.statusMove?
|
||||
end
|
||||
#---------------------------------------------------------------------------
|
||||
when "FreezeTarget", "FreezeTargetAlwaysHitsInHail", "FreezeFlinchTarget"
|
||||
@@ -113,10 +105,8 @@ class Battle::AI
|
||||
if skill >= PBTrainerAI.highSkill
|
||||
score -= 20 if target.hasActiveAbility?(:MARVELSCALE)
|
||||
end
|
||||
else
|
||||
if skill >= PBTrainerAI.mediumSkill
|
||||
score -= 90 if move.statusMove?
|
||||
end
|
||||
elsif skill >= PBTrainerAI.mediumSkill
|
||||
score -= 90 if move.statusMove?
|
||||
end
|
||||
#---------------------------------------------------------------------------
|
||||
when "FlinchTarget"
|
||||
@@ -159,10 +149,8 @@ class Battle::AI
|
||||
when "ConfuseTarget", "ConfuseTargetAlwaysHitsInRainHitsTargetInSky"
|
||||
if target.pbCanConfuse?(user, false)
|
||||
score += 30
|
||||
else
|
||||
if skill >= PBTrainerAI.mediumSkill
|
||||
score -= 90 if move.statusMove?
|
||||
end
|
||||
elsif skill >= PBTrainerAI.mediumSkill
|
||||
score -= 90 if move.statusMove?
|
||||
end
|
||||
#---------------------------------------------------------------------------
|
||||
when "AttractTarget"
|
||||
@@ -274,8 +262,8 @@ class Battle::AI
|
||||
else
|
||||
score -= user.stages[:DEFENSE] * 20
|
||||
end
|
||||
else
|
||||
score += 20 if user.stages[:DEFENSE] < 0
|
||||
elsif user.stages[:DEFENSE] < 0
|
||||
score += 20
|
||||
end
|
||||
#---------------------------------------------------------------------------
|
||||
when "RaiseUserSpeed1"
|
||||
@@ -290,8 +278,8 @@ class Battle::AI
|
||||
score += 30 if aspeed < ospeed && aspeed * 2 > ospeed
|
||||
end
|
||||
end
|
||||
else
|
||||
score += 20 if user.stages[:SPEED] < 0
|
||||
elsif user.stages[:SPEED] < 0
|
||||
score += 20
|
||||
end
|
||||
#---------------------------------------------------------------------------
|
||||
when "RaiseUserSpAtk1"
|
||||
@@ -341,8 +329,8 @@ class Battle::AI
|
||||
else
|
||||
score -= user.stages[:SPECIAL_DEFENSE] * 20
|
||||
end
|
||||
else
|
||||
score += 20 if user.stages[:SPECIAL_DEFENSE] < 0
|
||||
elsif user.stages[:SPECIAL_DEFENSE] < 0
|
||||
score += 20
|
||||
end
|
||||
#---------------------------------------------------------------------------
|
||||
when "RaiseUserEvasion1"
|
||||
@@ -352,8 +340,8 @@ class Battle::AI
|
||||
else
|
||||
score -= user.stages[:EVASION] * 10
|
||||
end
|
||||
else
|
||||
score += 20 if user.stages[:EVASION] < 0
|
||||
elsif user.stages[:EVASION] < 0
|
||||
score += 20
|
||||
end
|
||||
#---------------------------------------------------------------------------
|
||||
when "RaiseUserCriticalHitRate2"
|
||||
@@ -363,8 +351,8 @@ class Battle::AI
|
||||
else
|
||||
score += 30
|
||||
end
|
||||
else
|
||||
score += 30 if user.effects[PBEffects::FocusEnergy] < 2
|
||||
elsif user.effects[PBEffects::FocusEnergy] < 2
|
||||
score += 30
|
||||
end
|
||||
#---------------------------------------------------------------------------
|
||||
when "RaiseUserAtkDef1"
|
||||
@@ -858,15 +846,15 @@ class Battle::AI
|
||||
when "RaiseTargetSpAtk1ConfuseTarget"
|
||||
if !target.pbCanConfuse?(user, false)
|
||||
score -= 90
|
||||
else
|
||||
score += 30 if target.stages[:SPECIAL_ATTACK] < 0
|
||||
elsif target.stages[:SPECIAL_ATTACK] < 0
|
||||
score += 30
|
||||
end
|
||||
#---------------------------------------------------------------------------
|
||||
when "RaiseTargetAttack2ConfuseTarget"
|
||||
if !target.pbCanConfuse?(user, false)
|
||||
score -= 90
|
||||
else
|
||||
score += 30 if target.stages[:ATTACK] < 0
|
||||
elsif target.stages[:ATTACK] < 0
|
||||
score += 30
|
||||
end
|
||||
#---------------------------------------------------------------------------
|
||||
when "LowerTargetAttack1"
|
||||
@@ -909,8 +897,8 @@ class Battle::AI
|
||||
else
|
||||
score += target.stages[:DEFENSE] * 20
|
||||
end
|
||||
else
|
||||
score += 20 if target.stages[:DEFENSE] > 0
|
||||
elsif target.stages[:DEFENSE] > 0
|
||||
score += 20
|
||||
end
|
||||
#---------------------------------------------------------------------------
|
||||
when "LowerTargetSpeed1", "LowerTargetSpeed1WeakerInGrassyTerrain"
|
||||
@@ -925,8 +913,8 @@ class Battle::AI
|
||||
score += 30 if aspeed < ospeed && aspeed * 2 > ospeed
|
||||
end
|
||||
end
|
||||
else
|
||||
score += 20 if user.stages[:SPEED] > 0
|
||||
elsif user.stages[:SPEED] > 0
|
||||
score += 20
|
||||
end
|
||||
#---------------------------------------------------------------------------
|
||||
when "LowerTargetSpAtk1"
|
||||
@@ -969,8 +957,8 @@ class Battle::AI
|
||||
else
|
||||
score += target.stages[:SPECIAL_DEFENSE] * 20
|
||||
end
|
||||
else
|
||||
score += 20 if target.stages[:SPECIAL_DEFENSE] > 0
|
||||
elsif target.stages[:SPECIAL_DEFENSE] > 0
|
||||
score += 20
|
||||
end
|
||||
#---------------------------------------------------------------------------
|
||||
when "LowerTargetAccuracy1", "LowerTargetAccuracy2", "LowerTargetAccuracy3"
|
||||
@@ -980,8 +968,8 @@ class Battle::AI
|
||||
else
|
||||
score += target.stages[:ACCURACY] * 10
|
||||
end
|
||||
else
|
||||
score += 20 if target.stages[:ACCURACY] > 0
|
||||
elsif target.stages[:ACCURACY] > 0
|
||||
score += 20
|
||||
end
|
||||
#---------------------------------------------------------------------------
|
||||
when "LowerTargetEvasion1", "LowerTargetEvasion2", "LowerTargetEvasion3"
|
||||
@@ -991,8 +979,8 @@ class Battle::AI
|
||||
else
|
||||
score += target.stages[:EVASION] * 10
|
||||
end
|
||||
else
|
||||
score += 20 if target.stages[:EVASION] > 0
|
||||
elsif target.stages[:EVASION] > 0
|
||||
score += 20
|
||||
end
|
||||
#---------------------------------------------------------------------------
|
||||
when "LowerTargetEvasion1RemoveSideEffects"
|
||||
@@ -1002,8 +990,8 @@ class Battle::AI
|
||||
else
|
||||
score += target.stages[:EVASION] * 10
|
||||
end
|
||||
else
|
||||
score += 20 if target.stages[:EVASION] > 0
|
||||
elsif target.stages[:EVASION] > 0
|
||||
score += 20
|
||||
end
|
||||
score += 30 if target.pbOwnSide.effects[PBEffects::AuroraVeil] > 0 ||
|
||||
target.pbOwnSide.effects[PBEffects::Reflect] > 0 ||
|
||||
@@ -1294,10 +1282,10 @@ class Battle::AI
|
||||
#---------------------------------------------------------------------------
|
||||
when "ReplaceMoveThisBattleWithTargetLastMoveUsed"
|
||||
moveBlacklist = [
|
||||
"Struggle", # Struggle
|
||||
"ReplaceMoveThisBattleWithTargetLastMoveUsed", # Mimic
|
||||
"ReplaceMoveWithTargetLastMoveUsed", # Sketch
|
||||
"UseRandomMove" # Metronome
|
||||
"Struggle", # Struggle
|
||||
"ReplaceMoveThisBattleWithTargetLastMoveUsed", # Mimic
|
||||
"ReplaceMoveWithTargetLastMoveUsed", # Sketch
|
||||
"UseRandomMove" # Metronome
|
||||
]
|
||||
if user.effects[PBEffects::Transform] || !target.lastRegularMoveUsed
|
||||
score -= 90
|
||||
@@ -1316,8 +1304,8 @@ class Battle::AI
|
||||
#---------------------------------------------------------------------------
|
||||
when "ReplaceMoveWithTargetLastMoveUsed"
|
||||
moveBlacklist = [
|
||||
"Struggle", # Struggle
|
||||
"ReplaceMoveWithTargetLastMoveUsed" # Sketch
|
||||
"Struggle", # Struggle
|
||||
"ReplaceMoveWithTargetLastMoveUsed" # Sketch
|
||||
]
|
||||
if user.effects[PBEffects::Transform] || !target.lastRegularMoveUsed
|
||||
score -= 90
|
||||
@@ -1393,25 +1381,25 @@ class Battle::AI
|
||||
end
|
||||
if !new_type
|
||||
envtypes = {
|
||||
:None => :NORMAL,
|
||||
:Grass => :GRASS,
|
||||
:TallGrass => :GRASS,
|
||||
:MovingWater => :WATER,
|
||||
:StillWater => :WATER,
|
||||
:Puddle => :WATER,
|
||||
:Underwater => :WATER,
|
||||
:Cave => :ROCK,
|
||||
:Rock => :GROUND,
|
||||
:Sand => :GROUND,
|
||||
:Forest => :BUG,
|
||||
:ForestGrass => :BUG,
|
||||
:Snow => :ICE,
|
||||
:Ice => :ICE,
|
||||
:Volcano => :FIRE,
|
||||
:Graveyard => :GHOST,
|
||||
:Sky => :FLYING,
|
||||
:Space => :DRAGON,
|
||||
:UltraSpace => :PSYCHIC
|
||||
:None => :NORMAL,
|
||||
:Grass => :GRASS,
|
||||
:TallGrass => :GRASS,
|
||||
:MovingWater => :WATER,
|
||||
:StillWater => :WATER,
|
||||
:Puddle => :WATER,
|
||||
:Underwater => :WATER,
|
||||
:Cave => :ROCK,
|
||||
:Rock => :GROUND,
|
||||
:Sand => :GROUND,
|
||||
:Forest => :BUG,
|
||||
:ForestGrass => :BUG,
|
||||
:Snow => :ICE,
|
||||
:Ice => :ICE,
|
||||
:Volcano => :FIRE,
|
||||
:Graveyard => :GHOST,
|
||||
:Sky => :FLYING,
|
||||
:Space => :DRAGON,
|
||||
:UltraSpace => :PSYCHIC
|
||||
}
|
||||
new_type = envtypes[@battle.environment]
|
||||
new_type = nil if !GameData::Type.exists?(new_type)
|
||||
@@ -1918,15 +1906,15 @@ class Battle::AI
|
||||
score -= 90
|
||||
elsif skill >= PBTrainerAI.mediumSkill && target.pbHasType?(:GRASS)
|
||||
score -= 90
|
||||
else
|
||||
score += 60 if user.turnCount == 0
|
||||
elsif user.turnCount == 0
|
||||
score += 60
|
||||
end
|
||||
#---------------------------------------------------------------------------
|
||||
when "HealUserByHalfOfDamageDone"
|
||||
if skill >= PBTrainerAI.highSkill && target.hasActiveAbility?(:LIQUIDOOZE)
|
||||
score -= 70
|
||||
else
|
||||
score += 20 if user.hp <= user.totalhp / 2
|
||||
elsif user.hp <= user.totalhp / 2
|
||||
score += 20
|
||||
end
|
||||
#---------------------------------------------------------------------------
|
||||
when "HealUserByHalfOfDamageDoneIfTargetAsleep"
|
||||
@@ -1934,16 +1922,15 @@ class Battle::AI
|
||||
score -= 100
|
||||
elsif skill >= PBTrainerAI.highSkill && target.hasActiveAbility?(:LIQUIDOOZE)
|
||||
score -= 70
|
||||
else
|
||||
score += 20 if user.hp <= user.totalhp / 2
|
||||
elsif user.hp <= user.totalhp / 2
|
||||
score += 20
|
||||
end
|
||||
#---------------------------------------------------------------------------
|
||||
when "HealTargetHalfOfTotalHP"
|
||||
if user.opposes?(target)
|
||||
score -= 100
|
||||
else
|
||||
score += 20 if target.hp < target.totalhp / 2 &&
|
||||
target.effects[PBEffects::Substitute] == 0
|
||||
elsif target.hp < target.totalhp / 2 && target.effects[PBEffects::Substitute] == 0
|
||||
score += 20
|
||||
end
|
||||
#---------------------------------------------------------------------------
|
||||
when "UserFaintsExplosive"
|
||||
@@ -1979,8 +1966,8 @@ class Battle::AI
|
||||
when "StartPerishCountsForAllBattlers"
|
||||
if @battle.pbAbleNonActiveCount(user.idxOwnSide) == 0
|
||||
score -= 90
|
||||
else
|
||||
score -= 90 if target.effects[PBEffects::PerishSong] > 0
|
||||
elsif target.effects[PBEffects::PerishSong] > 0
|
||||
score -= 90
|
||||
end
|
||||
#---------------------------------------------------------------------------
|
||||
when "ReduceAttackerMovePPTo0IfUserFaints"
|
||||
@@ -2125,13 +2112,11 @@ class Battle::AI
|
||||
when "TargetTakesUserItem"
|
||||
if !user.item || target.item
|
||||
score -= 90
|
||||
elsif user.hasActiveItem?([:FLAMEORB, :TOXICORB, :STICKYBARB, :IRONBALL,
|
||||
:CHOICEBAND, :CHOICESCARF, :CHOICESPECS])
|
||||
score += 50
|
||||
else
|
||||
if user.hasActiveItem?([:FLAMEORB, :TOXICORB, :STICKYBARB, :IRONBALL,
|
||||
:CHOICEBAND, :CHOICESCARF, :CHOICESPECS])
|
||||
score += 50
|
||||
else
|
||||
score -= 80
|
||||
end
|
||||
score -= 80
|
||||
end
|
||||
#---------------------------------------------------------------------------
|
||||
when "UserConsumeTargetBerry", "DestroyTargetBerryOrGem"
|
||||
@@ -2160,8 +2145,8 @@ class Battle::AI
|
||||
when "StartNegateHeldItems"
|
||||
if @battle.field.effects[PBEffects::MagicRoom] > 0
|
||||
score -= 90
|
||||
else
|
||||
score += 30 if !user.item && target.item
|
||||
elsif !user.item && target.item
|
||||
score += 30
|
||||
end
|
||||
#---------------------------------------------------------------------------
|
||||
when "RecoilQuarterOfDamageDealt"
|
||||
@@ -2245,39 +2230,30 @@ class Battle::AI
|
||||
when "AddSpikesToFoeSide"
|
||||
if user.pbOpposingSide.effects[PBEffects::Spikes] >= 3
|
||||
score -= 90
|
||||
elsif user.allOpposing.none? { |b| @battle.pbCanChooseNonActive?(b.index) }
|
||||
score -= 90 # Opponent can't switch in any Pokemon
|
||||
else
|
||||
if user.allOpposing.none? { |b| @battle.pbCanChooseNonActive?(b.index) }
|
||||
# Opponent can't switch in any Pokemon
|
||||
score -= 90
|
||||
else
|
||||
score += 10 * @battle.pbAbleNonActiveCount(user.idxOpposingSide)
|
||||
score += [40, 26, 13][user.pbOpposingSide.effects[PBEffects::Spikes]]
|
||||
end
|
||||
score += 10 * @battle.pbAbleNonActiveCount(user.idxOpposingSide)
|
||||
score += [40, 26, 13][user.pbOpposingSide.effects[PBEffects::Spikes]]
|
||||
end
|
||||
#---------------------------------------------------------------------------
|
||||
when "AddToxicSpikesToFoeSide"
|
||||
if user.pbOpposingSide.effects[PBEffects::ToxicSpikes] >= 2
|
||||
score -= 90
|
||||
elsif user.allOpposing.none? { |b| @battle.pbCanChooseNonActive?(b.index) }
|
||||
score -= 90 # Opponent can't switch in any Pokemon
|
||||
else
|
||||
if user.allOpposing.none? { |b| @battle.pbCanChooseNonActive?(b.index) }
|
||||
# Opponent can't switch in any Pokemon
|
||||
score -= 90
|
||||
else
|
||||
score += 8 * @battle.pbAbleNonActiveCount(user.idxOpposingSide)
|
||||
score += [26, 13][user.pbOpposingSide.effects[PBEffects::ToxicSpikes]]
|
||||
end
|
||||
score += 8 * @battle.pbAbleNonActiveCount(user.idxOpposingSide)
|
||||
score += [26, 13][user.pbOpposingSide.effects[PBEffects::ToxicSpikes]]
|
||||
end
|
||||
#---------------------------------------------------------------------------
|
||||
when "AddStealthRocksToFoeSide"
|
||||
if user.pbOpposingSide.effects[PBEffects::StealthRock]
|
||||
score -= 90
|
||||
elsif user.allOpposing.none? { |b| @battle.pbCanChooseNonActive?(b.index) }
|
||||
score -= 90 # Opponent can't switch in any Pokemon
|
||||
else
|
||||
if user.allOpposing.none? { |b| @battle.pbCanChooseNonActive?(b.index) }
|
||||
# Opponent can't switch in any Pokemon
|
||||
score -= 90
|
||||
else
|
||||
score += 10 * @battle.pbAbleNonActiveCount(user.idxOpposingSide)
|
||||
end
|
||||
score += 10 * @battle.pbAbleNonActiveCount(user.idxOpposingSide)
|
||||
end
|
||||
#---------------------------------------------------------------------------
|
||||
when "GrassPledge"
|
||||
@@ -2360,10 +2336,9 @@ class Battle::AI
|
||||
score += avg / 2
|
||||
if user.effects[PBEffects::Stockpile] >= 3
|
||||
score -= 80
|
||||
else
|
||||
# More preferable if user also has Spit Up/Swallow
|
||||
score += 20 if user.pbHasMoveFunction?("PowerDependsOnUserStockpile",
|
||||
"HealUserDependingOnUserStockpile") # Spit Up, Swallow
|
||||
elsif user.pbHasMoveFunction?("PowerDependsOnUserStockpile",
|
||||
"HealUserDependingOnUserStockpile") # Spit Up, Swallow
|
||||
score += 20 # More preferable if user also has Spit Up/Swallow
|
||||
end
|
||||
#---------------------------------------------------------------------------
|
||||
when "PowerDependsOnUserStockpile"
|
||||
@@ -2557,8 +2532,8 @@ class Battle::AI
|
||||
when "HoopaRemoveProtectionsBypassSubstituteLowerUserDef1"
|
||||
if !user.isSpecies?(:HOOPA) || user.form != 1
|
||||
score -= 100
|
||||
else
|
||||
score += 20 if target.stages[:DEFENSE] > 0
|
||||
elsif target.stages[:DEFENSE] > 0
|
||||
score += 20
|
||||
end
|
||||
#---------------------------------------------------------------------------
|
||||
when "LowerTargetSpAtk2", "LowerTargetSpAtk3"
|
||||
@@ -2657,8 +2632,8 @@ class Battle::AI
|
||||
ospeed = pbRoughStat(target, :SPEED, skill)
|
||||
if aspeed > ospeed
|
||||
score -= 90
|
||||
else
|
||||
score += 30 if target.pbHasMoveType?(:FIRE)
|
||||
elsif target.pbHasMoveType?(:FIRE)
|
||||
score += 30
|
||||
end
|
||||
#---------------------------------------------------------------------------
|
||||
when "ProtectUserSideFromDamagingMovesIfUserFirstTurn"
|
||||
@@ -2715,8 +2690,8 @@ class Battle::AI
|
||||
when "HealUserByThreeQuartersOfDamageDone"
|
||||
if skill >= PBTrainerAI.highSkill && target.hasActiveAbility?(:LIQUIDOOZE)
|
||||
score -= 80
|
||||
else
|
||||
score += 40 if user.hp <= user.totalhp / 2
|
||||
elsif user.hp <= user.totalhp / 2
|
||||
score += 40
|
||||
end
|
||||
#---------------------------------------------------------------------------
|
||||
when "RaiseTargetAttack1"
|
||||
@@ -2776,8 +2751,8 @@ class Battle::AI
|
||||
when "CureTargetBurn"
|
||||
if target.opposes?(user)
|
||||
score -= 40 if target.status == :BURN
|
||||
else
|
||||
score += 40 if target.status == :BURN
|
||||
elsif target.status == :BURN
|
||||
score += 40
|
||||
end
|
||||
#---------------------------------------------------------------------------
|
||||
when "CureTargetStatusHealUserHalfOfTotalHP"
|
||||
|
||||
@@ -562,7 +562,7 @@ class Battle::AI
|
||||
baseDmg = [(baseDmg * multipliers[:base_damage_multiplier]).round, 1].max
|
||||
atk = [(atk * multipliers[:attack_multiplier]).round, 1].max
|
||||
defense = [(defense * multipliers[:defense_multiplier]).round, 1].max
|
||||
damage = (((2.0 * user.level / 5 + 2).floor * baseDmg * atk / defense).floor / 50).floor + 2
|
||||
damage = ((((2.0 * user.level / 5) + 2).floor * baseDmg * atk / defense).floor / 50).floor + 2
|
||||
damage = [(damage * multipliers[:final_damage_multiplier]).round, 1].max
|
||||
# "AI-specific calculations below"
|
||||
# Increased critical hit rates
|
||||
|
||||
@@ -154,7 +154,7 @@ module Battle::CatchAndStoreMixin
|
||||
# First half of the shakes calculation
|
||||
a = battler.totalhp
|
||||
b = battler.hp
|
||||
x = ((3 * a - 2 * b) * catch_rate.to_f) / (3 * a)
|
||||
x = (((3 * a) - (2 * b)) * catch_rate.to_f) / (3 * a)
|
||||
# Calculation modifiers
|
||||
if battler.status == :SLEEP || battler.status == :FROZEN
|
||||
x *= 2.5
|
||||
|
||||
@@ -45,8 +45,8 @@ end
|
||||
def repositionY(x1, y1, x2, y2, tx, ty)
|
||||
dx = x2 - x1
|
||||
dy = y2 - y1
|
||||
x = x1 + tx * dx.to_f
|
||||
y = y1 + ty * dy.to_f
|
||||
x = x1 + (tx * dx.to_f)
|
||||
y = y1 + (ty * dy.to_f)
|
||||
return [x, y]
|
||||
end
|
||||
|
||||
@@ -134,10 +134,10 @@ def pbConvertRPGAnimation(animation)
|
||||
end
|
||||
if animation.position == 3 # Screen
|
||||
point = transformPoint(
|
||||
-160, 80, 160, -80,
|
||||
Battle::Scene::FOCUSUSER_X, Battle::Scene::FOCUSUSER_Y,
|
||||
Battle::Scene::FOCUSTARGET_X, Battle::Scene::FOCUSTARGET_Y,
|
||||
data[j, 1], data[j, 2]
|
||||
-160, 80, 160, -80,
|
||||
Battle::Scene::FOCUSUSER_X, Battle::Scene::FOCUSUSER_Y,
|
||||
Battle::Scene::FOCUSTARGET_X, Battle::Scene::FOCUSTARGET_Y,
|
||||
data[j, 1], data[j, 2]
|
||||
)
|
||||
cel = pbCreateCel(point[0], point[1], data[j, 0])
|
||||
else
|
||||
@@ -219,11 +219,9 @@ class RPG::Animation
|
||||
timing = RPG::Animation::Timing.new
|
||||
othertiming = otherAnim.timings[i]
|
||||
timing.frame = frame + othertiming.frame
|
||||
timing.se = RPG::AudioFile.new(
|
||||
othertiming.se.name.clone,
|
||||
othertiming.se.volume,
|
||||
othertiming.se.pitch
|
||||
)
|
||||
timing.se = RPG::AudioFile.new(othertiming.se.name.clone,
|
||||
othertiming.se.volume,
|
||||
othertiming.se.pitch)
|
||||
timing.flash_scope = othertiming.flash_scope
|
||||
timing.flash_color = othertiming.flash_color.clone
|
||||
timing.flash_duration = othertiming.flash_duration
|
||||
@@ -571,20 +569,20 @@ class PBAnimation < Array
|
||||
next if frame < i.frame || frame > i.frame + i.duration
|
||||
fraction = (frame - i.frame).to_f / i.duration
|
||||
if bgGraphic.bitmap != nil
|
||||
bgGraphic.ox = oldbg[0] - (i.bgX - oldbg[0]) * fraction if i.bgX != nil
|
||||
bgGraphic.oy = oldbg[1] - (i.bgY - oldbg[1]) * fraction if i.bgY != nil
|
||||
bgGraphic.opacity = oldbg[2] + (i.opacity - oldbg[2]) * fraction if i.opacity != nil
|
||||
cr = (i.colorRed != nil) ? oldbg[3].red + (i.colorRed - oldbg[3].red) * fraction : oldbg[3].red
|
||||
cg = (i.colorGreen != nil) ? oldbg[3].green + (i.colorGreen - oldbg[3].green) * fraction : oldbg[3].green
|
||||
cb = (i.colorBlue != nil) ? oldbg[3].blue + (i.colorBlue - oldbg[3].blue) * fraction : oldbg[3].blue
|
||||
ca = (i.colorAlpha != nil) ? oldbg[3].alpha + (i.colorAlpha - oldbg[3].alpha) * fraction : oldbg[3].alpha
|
||||
bgGraphic.ox = oldbg[0] - ((i.bgX - oldbg[0]) * fraction) if i.bgX != nil
|
||||
bgGraphic.oy = oldbg[1] - ((i.bgY - oldbg[1]) * fraction) if i.bgY != nil
|
||||
bgGraphic.opacity = oldbg[2] + ((i.opacity - oldbg[2]) * fraction) if i.opacity != nil
|
||||
cr = (i.colorRed != nil) ? oldbg[3].red + ((i.colorRed - oldbg[3].red) * fraction) : oldbg[3].red
|
||||
cg = (i.colorGreen != nil) ? oldbg[3].green + ((i.colorGreen - oldbg[3].green) * fraction) : oldbg[3].green
|
||||
cb = (i.colorBlue != nil) ? oldbg[3].blue + ((i.colorBlue - oldbg[3].blue) * fraction) : oldbg[3].blue
|
||||
ca = (i.colorAlpha != nil) ? oldbg[3].alpha + ((i.colorAlpha - oldbg[3].alpha) * fraction) : oldbg[3].alpha
|
||||
bgGraphic.color = Color.new(cr, cg, cb, ca)
|
||||
else
|
||||
bgColor.opacity = oldbg[2] + (i.opacity - oldbg[2]) * fraction if i.opacity != nil
|
||||
cr = (i.colorRed != nil) ? oldbg[3].red + (i.colorRed - oldbg[3].red) * fraction : oldbg[3].red
|
||||
cg = (i.colorGreen != nil) ? oldbg[3].green + (i.colorGreen - oldbg[3].green) * fraction : oldbg[3].green
|
||||
cb = (i.colorBlue != nil) ? oldbg[3].blue + (i.colorBlue - oldbg[3].blue) * fraction : oldbg[3].blue
|
||||
ca = (i.colorAlpha != nil) ? oldbg[3].alpha + (i.colorAlpha - oldbg[3].alpha) * fraction : oldbg[3].alpha
|
||||
bgColor.opacity = oldbg[2] + ((i.opacity - oldbg[2]) * fraction) if i.opacity != nil
|
||||
cr = (i.colorRed != nil) ? oldbg[3].red + ((i.colorRed - oldbg[3].red) * fraction) : oldbg[3].red
|
||||
cg = (i.colorGreen != nil) ? oldbg[3].green + ((i.colorGreen - oldbg[3].green) * fraction) : oldbg[3].green
|
||||
cb = (i.colorBlue != nil) ? oldbg[3].blue + ((i.colorBlue - oldbg[3].blue) * fraction) : oldbg[3].blue
|
||||
ca = (i.colorAlpha != nil) ? oldbg[3].alpha + ((i.colorAlpha - oldbg[3].alpha) * fraction) : oldbg[3].alpha
|
||||
bgColor.color = Color.new(cr, cg, cb, ca)
|
||||
end
|
||||
when 4
|
||||
@@ -592,20 +590,20 @@ class PBAnimation < Array
|
||||
next if frame < i.frame || frame > i.frame + i.duration
|
||||
fraction = (frame - i.frame).to_f / i.duration
|
||||
if foGraphic.bitmap != nil
|
||||
foGraphic.ox = oldfo[0] - (i.bgX - oldfo[0]) * fraction if i.bgX != nil
|
||||
foGraphic.oy = oldfo[1] - (i.bgY - oldfo[1]) * fraction if i.bgY != nil
|
||||
foGraphic.opacity = oldfo[2] + (i.opacity - oldfo[2]) * fraction if i.opacity != nil
|
||||
cr = (i.colorRed != nil) ? oldfo[3].red + (i.colorRed - oldfo[3].red) * fraction : oldfo[3].red
|
||||
cg = (i.colorGreen != nil) ? oldfo[3].green + (i.colorGreen - oldfo[3].green) * fraction : oldfo[3].green
|
||||
cb = (i.colorBlue != nil) ? oldfo[3].blue + (i.colorBlue - oldfo[3].blue) * fraction : oldfo[3].blue
|
||||
ca = (i.colorAlpha != nil) ? oldfo[3].alpha + (i.colorAlpha - oldfo[3].alpha) * fraction : oldfo[3].alpha
|
||||
foGraphic.ox = oldfo[0] - ((i.bgX - oldfo[0]) * fraction) if i.bgX != nil
|
||||
foGraphic.oy = oldfo[1] - ((i.bgY - oldfo[1]) * fraction) if i.bgY != nil
|
||||
foGraphic.opacity = oldfo[2] + ((i.opacity - oldfo[2]) * fraction) if i.opacity != nil
|
||||
cr = (i.colorRed != nil) ? oldfo[3].red + ((i.colorRed - oldfo[3].red) * fraction) : oldfo[3].red
|
||||
cg = (i.colorGreen != nil) ? oldfo[3].green + ((i.colorGreen - oldfo[3].green) * fraction) : oldfo[3].green
|
||||
cb = (i.colorBlue != nil) ? oldfo[3].blue + ((i.colorBlue - oldfo[3].blue) * fraction) : oldfo[3].blue
|
||||
ca = (i.colorAlpha != nil) ? oldfo[3].alpha + ((i.colorAlpha - oldfo[3].alpha) * fraction) : oldfo[3].alpha
|
||||
foGraphic.color = Color.new(cr, cg, cb, ca)
|
||||
else
|
||||
foColor.opacity = oldfo[2] + (i.opacity - oldfo[2]) * fraction if i.opacity != nil
|
||||
cr = (i.colorRed != nil) ? oldfo[3].red + (i.colorRed - oldfo[3].red) * fraction : oldfo[3].red
|
||||
cg = (i.colorGreen != nil) ? oldfo[3].green + (i.colorGreen - oldfo[3].green) * fraction : oldfo[3].green
|
||||
cb = (i.colorBlue != nil) ? oldfo[3].blue + (i.colorBlue - oldfo[3].blue) * fraction : oldfo[3].blue
|
||||
ca = (i.colorAlpha != nil) ? oldfo[3].alpha + (i.colorAlpha - oldfo[3].alpha) * fraction : oldfo[3].alpha
|
||||
foColor.opacity = oldfo[2] + ((i.opacity - oldfo[2]) * fraction) if i.opacity != nil
|
||||
cr = (i.colorRed != nil) ? oldfo[3].red + ((i.colorRed - oldfo[3].red) * fraction) : oldfo[3].red
|
||||
cg = (i.colorGreen != nil) ? oldfo[3].green + ((i.colorGreen - oldfo[3].green) * fraction) : oldfo[3].green
|
||||
cb = (i.colorBlue != nil) ? oldfo[3].blue + ((i.colorBlue - oldfo[3].blue) * fraction) : oldfo[3].blue
|
||||
ca = (i.colorAlpha != nil) ? oldfo[3].alpha + ((i.colorAlpha - oldfo[3].alpha) * fraction) : oldfo[3].alpha
|
||||
foColor.color = Color.new(cr, cg, cb, ca)
|
||||
end
|
||||
end
|
||||
@@ -648,16 +646,16 @@ def pbSpriteSetAnimFrame(sprite, frame, user = nil, target = nil, inEditor = fal
|
||||
sprite.zoom_x = frame[AnimFrame::ZOOMX] / 100.0
|
||||
sprite.zoom_y = frame[AnimFrame::ZOOMY] / 100.0
|
||||
sprite.color.set(
|
||||
frame[AnimFrame::COLORRED],
|
||||
frame[AnimFrame::COLORGREEN],
|
||||
frame[AnimFrame::COLORBLUE],
|
||||
frame[AnimFrame::COLORALPHA]
|
||||
frame[AnimFrame::COLORRED],
|
||||
frame[AnimFrame::COLORGREEN],
|
||||
frame[AnimFrame::COLORBLUE],
|
||||
frame[AnimFrame::COLORALPHA]
|
||||
)
|
||||
sprite.tone.set(
|
||||
frame[AnimFrame::TONERED],
|
||||
frame[AnimFrame::TONEGREEN],
|
||||
frame[AnimFrame::TONEBLUE],
|
||||
frame[AnimFrame::TONEGRAY]
|
||||
frame[AnimFrame::TONERED],
|
||||
frame[AnimFrame::TONEGREEN],
|
||||
frame[AnimFrame::TONEBLUE],
|
||||
frame[AnimFrame::TONEGRAY]
|
||||
)
|
||||
sprite.ox = sprite.src_rect.width / 2
|
||||
sprite.oy = sprite.src_rect.height / 2
|
||||
|
||||
@@ -925,13 +925,11 @@ Battle::AbilityEffects::MoveImmunity.add(:FLASHFIRE,
|
||||
battle.pbDisplay(_INTL("The power of {1}'s Fire-type moves rose because of its {2}!",
|
||||
target.pbThis(true), target.abilityName))
|
||||
end
|
||||
elsif Battle::Scene::USE_ABILITY_SPLASH
|
||||
battle.pbDisplay(_INTL("It doesn't affect {1}...", target.pbThis(true)))
|
||||
else
|
||||
if Battle::Scene::USE_ABILITY_SPLASH
|
||||
battle.pbDisplay(_INTL("It doesn't affect {1}...", target.pbThis(true)))
|
||||
else
|
||||
battle.pbDisplay(_INTL("{1}'s {2} made {3} ineffective!",
|
||||
target.pbThis, target.abilityName, move.name))
|
||||
end
|
||||
battle.pbDisplay(_INTL("{1}'s {2} made {3} ineffective!",
|
||||
target.pbThis, target.abilityName, move.name))
|
||||
end
|
||||
battle.pbHideAbilitySplash(target)
|
||||
end
|
||||
@@ -2604,8 +2602,8 @@ Battle::AbilityEffects::OnSwitchIn.add(:ANTICIPATION,
|
||||
next if Effectiveness.ineffective?(eff)
|
||||
next if !Effectiveness.super_effective?(eff) &&
|
||||
!["OHKO", "OHKOIce", "OHKOHitsUndergroundTarget"].include?(m.function)
|
||||
else
|
||||
next if !["OHKO", "OHKOIce", "OHKOHitsUndergroundTarget"].include?(m.function)
|
||||
elsif !["OHKO", "OHKOIce", "OHKOHitsUndergroundTarget"].include?(m.function)
|
||||
next
|
||||
end
|
||||
found = true
|
||||
break
|
||||
@@ -2857,8 +2855,8 @@ Battle::AbilityEffects::OnSwitchIn.add(:INTIMIDATE,
|
||||
check_item = true
|
||||
if b.hasActiveAbility?(:CONTRARY)
|
||||
check_item = false if b.statStageAtMax?(:ATTACK)
|
||||
else
|
||||
check_item = false if b.statStageAtMin?(:ATTACK)
|
||||
elsif b.statStageAtMin?(:ATTACK)
|
||||
check_item = false
|
||||
end
|
||||
check_ability = b.pbLowerAttackStatStageIntimidate(battler)
|
||||
b.pbAbilitiesOnIntimidated if check_ability
|
||||
|
||||
@@ -922,7 +922,7 @@ Battle::ItemEffects::DamageCalcFromUser.copy(:METALCOAT, :IRONPLATE)
|
||||
|
||||
Battle::ItemEffects::DamageCalcFromUser.add(:METRONOME,
|
||||
proc { |item, user, target, move, mults, baseDmg, type|
|
||||
met = 1 + 0.2 * [user.effects[PBEffects::Metronome], 5].min
|
||||
met = 1 + (0.2 * [user.effects[PBEffects::Metronome], 5].min)
|
||||
mults[:final_damage_multiplier] *= met
|
||||
}
|
||||
)
|
||||
@@ -1030,10 +1030,8 @@ Battle::ItemEffects::DamageCalcFromUser.add(:SOULDEW,
|
||||
next if !user.isSpecies?(:LATIAS) && !user.isSpecies?(:LATIOS)
|
||||
if Settings::SOUL_DEW_POWERS_UP_TYPES
|
||||
mults[:final_damage_multiplier] *= 1.2 if [:DRAGON, :PSYCHIC].include?(type)
|
||||
else
|
||||
if move.specialMove? && !user.battle.rules["souldewclause"]
|
||||
mults[:attack_multiplier] *= 1.5
|
||||
end
|
||||
elsif move.specialMove? && !user.battle.rules["souldewclause"]
|
||||
mults[:attack_multiplier] *= 1.5
|
||||
end
|
||||
}
|
||||
)
|
||||
|
||||
@@ -113,7 +113,7 @@ class Battle::Scene::Animation::ThrowBait < Battle::Scene::Animation
|
||||
traSprite = @sprites["player_1"]
|
||||
ballPos = Battle::Scene.pbBattlerPosition(@battler.index, batSprite.sideSize)
|
||||
ballStartX = traSprite.x
|
||||
ballStartY = traSprite.y - traSprite.bitmap.height / 2
|
||||
ballStartY = traSprite.y - (traSprite.bitmap.height / 2)
|
||||
ballMidX = 0 # Unused in arc calculation
|
||||
ballMidY = 122
|
||||
ballEndX = ballPos[0] - 40
|
||||
@@ -178,11 +178,11 @@ class Battle::Scene::Animation::ThrowRock < Battle::Scene::Animation
|
||||
batSprite = @sprites["pokemon_#{@battler.index}"]
|
||||
traSprite = @sprites["player_1"]
|
||||
ballStartX = traSprite.x
|
||||
ballStartY = traSprite.y - traSprite.bitmap.height / 2
|
||||
ballStartY = traSprite.y - (traSprite.bitmap.height / 2)
|
||||
ballMidX = 0 # Unused in arc calculation
|
||||
ballMidY = 122
|
||||
ballEndX = batSprite.x
|
||||
ballEndY = batSprite.y - batSprite.bitmap.height / 2
|
||||
ballEndY = batSprite.y - (batSprite.bitmap.height / 2)
|
||||
# Set up trainer sprite
|
||||
trainer = addSprite(traSprite, PictureOrigin::Bottom)
|
||||
# Set up bait sprite
|
||||
@@ -242,13 +242,12 @@ class Battle::Scene
|
||||
end
|
||||
|
||||
def pbSafariCommandMenu(index)
|
||||
pbCommandMenuEx(index, [
|
||||
_INTL("What will\n{1} throw?", @battle.pbPlayer.name),
|
||||
_INTL("Ball"),
|
||||
_INTL("Bait"),
|
||||
_INTL("Rock"),
|
||||
_INTL("Run")
|
||||
], 3)
|
||||
pbCommandMenuEx(index,
|
||||
[_INTL("What will\n{1} throw?", @battle.pbPlayer.name),
|
||||
_INTL("Ball"),
|
||||
_INTL("Bait"),
|
||||
_INTL("Rock"),
|
||||
_INTL("Run")], 3)
|
||||
end
|
||||
|
||||
def pbThrowBait
|
||||
@@ -324,10 +323,8 @@ class SafariBattle
|
||||
@player = [player]
|
||||
@party2 = party2
|
||||
@sideSizes = [1, 1]
|
||||
@battlers = [
|
||||
Battle::FakeBattler.new(self, 0),
|
||||
Battle::FakeBattler.new(self, 1)
|
||||
]
|
||||
@battlers = [Battle::FakeBattler.new(self, 0),
|
||||
Battle::FakeBattler.new(self, 1)]
|
||||
@rules = {}
|
||||
@ballCount = 0
|
||||
end
|
||||
|
||||
@@ -45,13 +45,12 @@ class BugContestBattle < Battle
|
||||
end
|
||||
|
||||
def pbCommandMenu(idxBattler, _firstAction)
|
||||
return @scene.pbCommandMenuEx(idxBattler, [
|
||||
_INTL("Sport Balls: {1}", @ballCount),
|
||||
_INTL("Fight"),
|
||||
_INTL("Ball"),
|
||||
_INTL("Pokémon"),
|
||||
_INTL("Run")
|
||||
], 4)
|
||||
return @scene.pbCommandMenuEx(idxBattler,
|
||||
[_INTL("Sport Balls: {1}", @ballCount),
|
||||
_INTL("Fight"),
|
||||
_INTL("Ball"),
|
||||
_INTL("Pokémon"),
|
||||
_INTL("Run")], 4)
|
||||
end
|
||||
|
||||
def pbConsumeItemInBag(_item, _idxBattler)
|
||||
|
||||
@@ -241,15 +241,15 @@ class Battle::Scene
|
||||
window.contents.clear
|
||||
pbSetSystemFont(window.contents)
|
||||
textpos = [
|
||||
[battler1.name, 64, -6, 2, Color.new(248, 0, 0), Color.new(208, 208, 200)],
|
||||
[_INTL("VS"), 144, -6, 2, Color.new(72, 72, 72), Color.new(208, 208, 200)],
|
||||
[battler2.name, 224, -6, 2, Color.new(72, 72, 72), Color.new(208, 208, 200)],
|
||||
[_INTL("Mind"), 144, 42, 2, Color.new(72, 72, 72), Color.new(208, 208, 200)],
|
||||
[_INTL("Skill"), 144, 74, 2, Color.new(72, 72, 72), Color.new(208, 208, 200)],
|
||||
[_INTL("Body"), 144, 106, 2, Color.new(72, 72, 72), Color.new(208, 208, 200)],
|
||||
[sprintf("%d", total1), 64, 154, 2, Color.new(72, 72, 72), Color.new(208, 208, 200)],
|
||||
[_INTL("Judgment"), 144, 154, 2, Color.new(72, 72, 72), Color.new(208, 208, 200)],
|
||||
[sprintf("%d", total2), 224, 154, 2, Color.new(72, 72, 72), Color.new(208, 208, 200)]
|
||||
[battler1.name, 64, -6, 2, Color.new(248, 0, 0), Color.new(208, 208, 200)],
|
||||
[_INTL("VS"), 144, -6, 2, Color.new(72, 72, 72), Color.new(208, 208, 200)],
|
||||
[battler2.name, 224, -6, 2, Color.new(72, 72, 72), Color.new(208, 208, 200)],
|
||||
[_INTL("Mind"), 144, 42, 2, Color.new(72, 72, 72), Color.new(208, 208, 200)],
|
||||
[_INTL("Skill"), 144, 74, 2, Color.new(72, 72, 72), Color.new(208, 208, 200)],
|
||||
[_INTL("Body"), 144, 106, 2, Color.new(72, 72, 72), Color.new(208, 208, 200)],
|
||||
[sprintf("%d", total1), 64, 154, 2, Color.new(72, 72, 72), Color.new(208, 208, 200)],
|
||||
[_INTL("Judgment"), 144, 154, 2, Color.new(72, 72, 72), Color.new(208, 208, 200)],
|
||||
[sprintf("%d", total2), 224, 154, 2, Color.new(72, 72, 72), Color.new(208, 208, 200)]
|
||||
]
|
||||
pbDrawTextPositions(window.contents, textpos)
|
||||
images = []
|
||||
|
||||
Reference in New Issue
Block a user