mirror of
https://github.com/infinitefusion/infinitefusion-e18.git
synced 2026-03-19 14:40:24 +00:00
Added class GameData::Stat
This commit is contained in:
@@ -138,8 +138,12 @@ module GameData
|
|||||||
@pokedex_form = hash[:pokedex_form] || @form
|
@pokedex_form = hash[:pokedex_form] || @form
|
||||||
@type1 = hash[:type1] || :NORMAL
|
@type1 = hash[:type1] || :NORMAL
|
||||||
@type2 = hash[:type2] || @type1
|
@type2 = hash[:type2] || @type1
|
||||||
@base_stats = hash[:base_stats] || [1, 1, 1, 1, 1, 1]
|
@base_stats = hash[:base_stats] || {}
|
||||||
@evs = hash[:evs] || [0, 0, 0, 0, 0, 0]
|
@evs = hash[:evs] || {}
|
||||||
|
GameData::Stat.each_main do |s|
|
||||||
|
@base_stats[s.id] = 1 if !@base_stats[s.id] || @base_stats[s.id] <= 0
|
||||||
|
@evs[s.id] = 0 if !@evs[s.id] || @evs[s.id] < 0
|
||||||
|
end
|
||||||
@base_exp = hash[:base_exp] || 100
|
@base_exp = hash[:base_exp] || 100
|
||||||
@growth_rate = hash[:growth_rate] || :Medium
|
@growth_rate = hash[:growth_rate] || :Medium
|
||||||
@gender_ratio = hash[:gender_ratio] || :Female50Percent
|
@gender_ratio = hash[:gender_ratio] || :Female50Percent
|
||||||
|
|||||||
@@ -79,11 +79,9 @@ module GameData
|
|||||||
@real_lose_text = hash[:lose_text] || "..."
|
@real_lose_text = hash[:lose_text] || "..."
|
||||||
@pokemon = hash[:pokemon] || []
|
@pokemon = hash[:pokemon] || []
|
||||||
@pokemon.each do |pkmn|
|
@pokemon.each do |pkmn|
|
||||||
if pkmn[:iv]
|
GameData::Stat.each_main do |s|
|
||||||
6.times { |i| pkmn[:iv][i] = pkmn[:iv][0] if !pkmn[:iv][i] }
|
pkmn[:iv][s.id] ||= 0 if pkmn[:iv]
|
||||||
end
|
pkmn[:ev][s.id] ||= 0 if pkmn[:ev]
|
||||||
if pkmn[:ev]
|
|
||||||
6.times { |i| pkmn[:ev][i] = pkmn[:ev][0] if !pkmn[:ev][i] }
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
@@ -138,16 +136,16 @@ module GameData
|
|||||||
nature = pkmn.species_data.id_number + GameData::TrainerType.get(trainer.trainer_type).id_number
|
nature = pkmn.species_data.id_number + GameData::TrainerType.get(trainer.trainer_type).id_number
|
||||||
pkmn.nature = nature % (GameData::Nature::DATA.length / 2)
|
pkmn.nature = nature % (GameData::Nature::DATA.length / 2)
|
||||||
end
|
end
|
||||||
PBStats.eachStat do |s|
|
GameData::Stat.each_main do |s|
|
||||||
if pkmn_data[:iv] && pkmn_data[:iv].length > 0
|
if pkmn_data[:iv]
|
||||||
pkmn.iv[s] = pkmn_data[:iv][s] || pkmn_data[:iv][0]
|
pkmn.iv[s.id] = pkmn_data[:iv][s.id]
|
||||||
else
|
else
|
||||||
pkmn.iv[s] = [pkmn_data[:level] / 2, Pokemon::IV_STAT_LIMIT].min
|
pkmn.iv[s.id] = [pkmn_data[:level] / 2, Pokemon::IV_STAT_LIMIT].min
|
||||||
end
|
end
|
||||||
if pkmn_data[:ev] && pkmn_data[:ev].length > 0
|
if pkmn_data[:ev]
|
||||||
pkmn.ev[s] = pkmn_data[:ev][s] || pkmn_data[:ev][0]
|
pkmn.ev[s.id] = pkmn_data[:ev][s.id]
|
||||||
else
|
else
|
||||||
pkmn.ev[s] = [pkmn_data[:level] * 3 / 2, Pokemon::EV_LIMIT / 6].min
|
pkmn.ev[s.id] = [pkmn_data[:level] * 3 / 2, Pokemon::EV_LIMIT / 6].min
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
pkmn.happiness = pkmn_data[:happiness] if pkmn_data[:happiness]
|
pkmn.happiness = pkmn_data[:happiness] if pkmn_data[:happiness]
|
||||||
|
|||||||
@@ -1,5 +1,3 @@
|
|||||||
# $PokemonGlobal.encounter_version
|
|
||||||
|
|
||||||
module GameData
|
module GameData
|
||||||
class Encounter
|
class Encounter
|
||||||
attr_accessor :id
|
attr_accessor :id
|
||||||
|
|||||||
@@ -1,68 +1,129 @@
|
|||||||
begin
|
# The id_number value determines which order the stats are iterated through by
|
||||||
module PBStats
|
# the "each" methods.
|
||||||
# NOTE: You can change the order that the compiler expects Pokémon base
|
# The pbs_order value determines the order in which the stats are written in
|
||||||
# stats/EV yields (effort points) to be in, by simply renumbering the
|
# several PBS files, where base stats/IVs/EVs/EV yields are defined. Only stats
|
||||||
# stats here. The "main" stats (i.e. not accuracy/evasion) must still
|
# which are yielded by the "each_main" method can have stat numbers defined in
|
||||||
# use up numbers 0 to 5 inclusive, though. It's up to you to write the
|
# those places. The values of pbs_order defined below should start with 0 and
|
||||||
# base stats/EV yields in pokemon.txt and pokemonforms.txt in the
|
# increase without skipping any numbers.
|
||||||
# order expected.
|
module GameData
|
||||||
HP = 0
|
class Stat
|
||||||
ATTACK = 1
|
attr_reader :id
|
||||||
DEFENSE = 2
|
attr_reader :id_number
|
||||||
SPEED = 3
|
attr_reader :real_name
|
||||||
SPATK = 4
|
attr_reader :real_name_brief
|
||||||
SPDEF = 5
|
attr_reader :type
|
||||||
ACCURACY = 6
|
attr_reader :pbs_order
|
||||||
EVASION = 7
|
|
||||||
|
|
||||||
def self.getName(id)
|
DATA = {}
|
||||||
id = getID(PBStats,id)
|
|
||||||
names = []
|
extend ClassMethods
|
||||||
names[HP] = _INTL("HP")
|
include InstanceMethods
|
||||||
names[ATTACK] = _INTL("Attack")
|
|
||||||
names[DEFENSE] = _INTL("Defense")
|
def self.load; end
|
||||||
names[SPEED] = _INTL("Speed")
|
def self.save; end
|
||||||
names[SPATK] = _INTL("Special Attack")
|
|
||||||
names[SPDEF] = _INTL("Special Defense")
|
# These stats are defined in PBS files, and should have the :pbs_order
|
||||||
names[ACCURACY] = _INTL("accuracy")
|
# property.
|
||||||
names[EVASION] = _INTL("evasiveness")
|
def self.each_main
|
||||||
return names[id]
|
self.each { |s| yield s if [:main, :main_battle].include?(s.type) }
|
||||||
end
|
end
|
||||||
|
|
||||||
def self.getNameBrief(id)
|
def self.each_main_battle
|
||||||
id = getID(PBStats,id)
|
self.each { |s| yield s if [:main_battle].include?(s.type) }
|
||||||
names = []
|
|
||||||
names[HP] = _INTL("HP")
|
|
||||||
names[ATTACK] = _INTL("Atk")
|
|
||||||
names[DEFENSE] = _INTL("Def")
|
|
||||||
names[SPEED] = _INTL("Spd")
|
|
||||||
names[SPATK] = _INTL("SpAtk")
|
|
||||||
names[SPDEF] = _INTL("SpDef")
|
|
||||||
names[ACCURACY] = _INTL("acc")
|
|
||||||
names[EVASION] = _INTL("eva")
|
|
||||||
return names[id]
|
|
||||||
end
|
end
|
||||||
|
|
||||||
def self.eachStat
|
# These stats have associated stat stages in battle.
|
||||||
[HP,ATTACK,DEFENSE,SPATK,SPDEF,SPEED].each { |s| yield s }
|
def self.each_battle
|
||||||
|
self.each { |s| yield s if [:main_battle, :battle].include?(s.type) }
|
||||||
end
|
end
|
||||||
|
|
||||||
def self.eachMainBattleStat
|
def initialize(hash)
|
||||||
[ATTACK,DEFENSE,SPATK,SPDEF,SPEED].each { |s| yield s }
|
@id = hash[:id]
|
||||||
|
@id_number = hash[:id_number] || -1
|
||||||
|
@real_name = hash[:name] || "Unnamed"
|
||||||
|
@real_name_brief = hash[:name_brief] || "None"
|
||||||
|
@type = hash[:type] || :none
|
||||||
|
@pbs_order = hash[:pbs_order] || -1
|
||||||
end
|
end
|
||||||
|
|
||||||
def self.eachBattleStat
|
# @return [String] the translated name of this stat
|
||||||
[ATTACK,DEFENSE,SPATK,SPDEF,SPEED,ACCURACY,EVASION].each { |s| yield s }
|
def name
|
||||||
|
return _INTL(@real_name)
|
||||||
end
|
end
|
||||||
|
|
||||||
def self.validBattleStat?(stat)
|
# @return [String] the translated brief name of this stat
|
||||||
self.eachBattleStat { |s| return true if s==stat }
|
def name_brief
|
||||||
return false
|
return _INTL(@real_name_brief)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
rescue Exception
|
|
||||||
if $!.is_a?(SystemExit) || "#{$!.class}"=="Reset"
|
|
||||||
raise $!
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
|
|
||||||
|
GameData::Stat.register({
|
||||||
|
:id => :HP,
|
||||||
|
:id_number => 0,
|
||||||
|
:name => _INTL("HP"),
|
||||||
|
:name_brief => _INTL("HP"),
|
||||||
|
:type => :main,
|
||||||
|
:pbs_order => 0
|
||||||
|
})
|
||||||
|
|
||||||
|
GameData::Stat.register({
|
||||||
|
:id => :ATTACK,
|
||||||
|
:id_number => 1,
|
||||||
|
:name => _INTL("Attack"),
|
||||||
|
:name_brief => _INTL("Atk"),
|
||||||
|
:type => :main_battle,
|
||||||
|
:pbs_order => 1
|
||||||
|
})
|
||||||
|
|
||||||
|
GameData::Stat.register({
|
||||||
|
:id => :DEFENSE,
|
||||||
|
:id_number => 2,
|
||||||
|
:name => _INTL("Defense"),
|
||||||
|
:name_brief => _INTL("Def"),
|
||||||
|
:type => :main_battle,
|
||||||
|
:pbs_order => 2
|
||||||
|
})
|
||||||
|
|
||||||
|
GameData::Stat.register({
|
||||||
|
:id => :SPECIAL_ATTACK,
|
||||||
|
:id_number => 3,
|
||||||
|
:name => _INTL("Special Attack"),
|
||||||
|
:name_brief => _INTL("SpAtk"),
|
||||||
|
:type => :main_battle,
|
||||||
|
:pbs_order => 4
|
||||||
|
})
|
||||||
|
|
||||||
|
GameData::Stat.register({
|
||||||
|
:id => :SPECIAL_DEFENSE,
|
||||||
|
:id_number => 4,
|
||||||
|
:name => _INTL("Special Defense"),
|
||||||
|
:name_brief => _INTL("SpDef"),
|
||||||
|
:type => :main_battle,
|
||||||
|
:pbs_order => 5
|
||||||
|
})
|
||||||
|
|
||||||
|
GameData::Stat.register({
|
||||||
|
:id => :SPEED,
|
||||||
|
:id_number => 5,
|
||||||
|
:name => _INTL("Speed"),
|
||||||
|
:name_brief => _INTL("Spd"),
|
||||||
|
:type => :main_battle,
|
||||||
|
:pbs_order => 3
|
||||||
|
})
|
||||||
|
|
||||||
|
GameData::Stat.register({
|
||||||
|
:id => :ACCURACY,
|
||||||
|
:id_number => 6,
|
||||||
|
:name => _INTL("accuracy"),
|
||||||
|
:name_brief => _INTL("Acc"),
|
||||||
|
:type => :battle
|
||||||
|
})
|
||||||
|
|
||||||
|
GameData::Stat.register({
|
||||||
|
:id => :EVASION,
|
||||||
|
:id_number => 7,
|
||||||
|
:name => _INTL("evasiveness"),
|
||||||
|
:name_brief => _INTL("Eva"),
|
||||||
|
:type => :battle
|
||||||
|
})
|
||||||
|
|||||||
@@ -37,35 +37,35 @@ GameData::Nature.register({
|
|||||||
:id => :LONELY,
|
:id => :LONELY,
|
||||||
:id_number => 1,
|
:id_number => 1,
|
||||||
:name => _INTL("Lonely"),
|
:name => _INTL("Lonely"),
|
||||||
:stat_changes => [[PBStats::ATTACK, 10], [PBStats::DEFENSE, -10]]
|
:stat_changes => [[:ATTACK, 10], [:DEFENSE, -10]]
|
||||||
})
|
})
|
||||||
|
|
||||||
GameData::Nature.register({
|
GameData::Nature.register({
|
||||||
:id => :BRAVE,
|
:id => :BRAVE,
|
||||||
:id_number => 2,
|
:id_number => 2,
|
||||||
:name => _INTL("Brave"),
|
:name => _INTL("Brave"),
|
||||||
:stat_changes => [[PBStats::ATTACK, 10], [PBStats::SPEED, -10]]
|
:stat_changes => [[:ATTACK, 10], [:SPEED, -10]]
|
||||||
})
|
})
|
||||||
|
|
||||||
GameData::Nature.register({
|
GameData::Nature.register({
|
||||||
:id => :ADAMANT,
|
:id => :ADAMANT,
|
||||||
:id_number => 3,
|
:id_number => 3,
|
||||||
:name => _INTL("Adamant"),
|
:name => _INTL("Adamant"),
|
||||||
:stat_changes => [[PBStats::ATTACK, 10], [PBStats::SPATK, -10]]
|
:stat_changes => [[:ATTACK, 10], [:SPECIAL_ATTACK, -10]]
|
||||||
})
|
})
|
||||||
|
|
||||||
GameData::Nature.register({
|
GameData::Nature.register({
|
||||||
:id => :NAUGHTY,
|
:id => :NAUGHTY,
|
||||||
:id_number => 4,
|
:id_number => 4,
|
||||||
:name => _INTL("Naughty"),
|
:name => _INTL("Naughty"),
|
||||||
:stat_changes => [[PBStats::ATTACK, 10], [PBStats::SPDEF, -10]]
|
:stat_changes => [[:ATTACK, 10], [:SPECIAL_DEFENSE, -10]]
|
||||||
})
|
})
|
||||||
|
|
||||||
GameData::Nature.register({
|
GameData::Nature.register({
|
||||||
:id => :BOLD,
|
:id => :BOLD,
|
||||||
:id_number => 5,
|
:id_number => 5,
|
||||||
:name => _INTL("Bold"),
|
:name => _INTL("Bold"),
|
||||||
:stat_changes => [[PBStats::DEFENSE, 10], [PBStats::ATTACK, -10]]
|
:stat_changes => [[:DEFENSE, 10], [:ATTACK, -10]]
|
||||||
})
|
})
|
||||||
|
|
||||||
GameData::Nature.register({
|
GameData::Nature.register({
|
||||||
@@ -78,35 +78,35 @@ GameData::Nature.register({
|
|||||||
:id => :RELAXED,
|
:id => :RELAXED,
|
||||||
:id_number => 7,
|
:id_number => 7,
|
||||||
:name => _INTL("Relaxed"),
|
:name => _INTL("Relaxed"),
|
||||||
:stat_changes => [[PBStats::DEFENSE, 10], [PBStats::SPEED, -10]]
|
:stat_changes => [[:DEFENSE, 10], [:SPEED, -10]]
|
||||||
})
|
})
|
||||||
|
|
||||||
GameData::Nature.register({
|
GameData::Nature.register({
|
||||||
:id => :IMPISH,
|
:id => :IMPISH,
|
||||||
:id_number => 8,
|
:id_number => 8,
|
||||||
:name => _INTL("Impish"),
|
:name => _INTL("Impish"),
|
||||||
:stat_changes => [[PBStats::DEFENSE, 10], [PBStats::SPATK, -10]]
|
:stat_changes => [[:DEFENSE, 10], [:SPECIAL_ATTACK, -10]]
|
||||||
})
|
})
|
||||||
|
|
||||||
GameData::Nature.register({
|
GameData::Nature.register({
|
||||||
:id => :LAX,
|
:id => :LAX,
|
||||||
:id_number => 9,
|
:id_number => 9,
|
||||||
:name => _INTL("Lax"),
|
:name => _INTL("Lax"),
|
||||||
:stat_changes => [[PBStats::DEFENSE, 10], [PBStats::SPDEF, -10]]
|
:stat_changes => [[:DEFENSE, 10], [:SPECIAL_DEFENSE, -10]]
|
||||||
})
|
})
|
||||||
|
|
||||||
GameData::Nature.register({
|
GameData::Nature.register({
|
||||||
:id => :TIMID,
|
:id => :TIMID,
|
||||||
:id_number => 10,
|
:id_number => 10,
|
||||||
:name => _INTL("Timid"),
|
:name => _INTL("Timid"),
|
||||||
:stat_changes => [[PBStats::SPEED, 10], [PBStats::ATTACK, -10]]
|
:stat_changes => [[:SPEED, 10], [:ATTACK, -10]]
|
||||||
})
|
})
|
||||||
|
|
||||||
GameData::Nature.register({
|
GameData::Nature.register({
|
||||||
:id => :HASTY,
|
:id => :HASTY,
|
||||||
:id_number => 11,
|
:id_number => 11,
|
||||||
:name => _INTL("Hasty"),
|
:name => _INTL("Hasty"),
|
||||||
:stat_changes => [[PBStats::SPEED, 10], [PBStats::DEFENSE, -10]]
|
:stat_changes => [[:SPEED, 10], [:DEFENSE, -10]]
|
||||||
})
|
})
|
||||||
|
|
||||||
GameData::Nature.register({
|
GameData::Nature.register({
|
||||||
@@ -119,35 +119,35 @@ GameData::Nature.register({
|
|||||||
:id => :JOLLY,
|
:id => :JOLLY,
|
||||||
:id_number => 13,
|
:id_number => 13,
|
||||||
:name => _INTL("Jolly"),
|
:name => _INTL("Jolly"),
|
||||||
:stat_changes => [[PBStats::SPEED, 10], [PBStats::SPATK, -10]]
|
:stat_changes => [[:SPEED, 10], [:SPECIAL_ATTACK, -10]]
|
||||||
})
|
})
|
||||||
|
|
||||||
GameData::Nature.register({
|
GameData::Nature.register({
|
||||||
:id => :NAIVE,
|
:id => :NAIVE,
|
||||||
:id_number => 14,
|
:id_number => 14,
|
||||||
:name => _INTL("Naive"),
|
:name => _INTL("Naive"),
|
||||||
:stat_changes => [[PBStats::SPEED, 10], [PBStats::SPDEF, -10]]
|
:stat_changes => [[:SPEED, 10], [:SPECIAL_DEFENSE, -10]]
|
||||||
})
|
})
|
||||||
|
|
||||||
GameData::Nature.register({
|
GameData::Nature.register({
|
||||||
:id => :MODEST,
|
:id => :MODEST,
|
||||||
:id_number => 15,
|
:id_number => 15,
|
||||||
:name => _INTL("Modest"),
|
:name => _INTL("Modest"),
|
||||||
:stat_changes => [[PBStats::SPATK, 10], [PBStats::ATTACK, -10]]
|
:stat_changes => [[:SPECIAL_ATTACK, 10], [:ATTACK, -10]]
|
||||||
})
|
})
|
||||||
|
|
||||||
GameData::Nature.register({
|
GameData::Nature.register({
|
||||||
:id => :MILD,
|
:id => :MILD,
|
||||||
:id_number => 16,
|
:id_number => 16,
|
||||||
:name => _INTL("Mild"),
|
:name => _INTL("Mild"),
|
||||||
:stat_changes => [[PBStats::SPATK, 10], [PBStats::DEFENSE, -10]]
|
:stat_changes => [[:SPECIAL_ATTACK, 10], [:DEFENSE, -10]]
|
||||||
})
|
})
|
||||||
|
|
||||||
GameData::Nature.register({
|
GameData::Nature.register({
|
||||||
:id => :QUIET,
|
:id => :QUIET,
|
||||||
:id_number => 17,
|
:id_number => 17,
|
||||||
:name => _INTL("Quiet"),
|
:name => _INTL("Quiet"),
|
||||||
:stat_changes => [[PBStats::SPATK, 10], [PBStats::SPEED, -10]]
|
:stat_changes => [[:SPECIAL_ATTACK, 10], [:SPEED, -10]]
|
||||||
})
|
})
|
||||||
|
|
||||||
GameData::Nature.register({
|
GameData::Nature.register({
|
||||||
@@ -160,35 +160,35 @@ GameData::Nature.register({
|
|||||||
:id => :RASH,
|
:id => :RASH,
|
||||||
:id_number => 19,
|
:id_number => 19,
|
||||||
:name => _INTL("Rash"),
|
:name => _INTL("Rash"),
|
||||||
:stat_changes => [[PBStats::SPATK, 10], [PBStats::SPDEF, -10]]
|
:stat_changes => [[:SPECIAL_ATTACK, 10], [:SPECIAL_DEFENSE, -10]]
|
||||||
})
|
})
|
||||||
|
|
||||||
GameData::Nature.register({
|
GameData::Nature.register({
|
||||||
:id => :CALM,
|
:id => :CALM,
|
||||||
:id_number => 20,
|
:id_number => 20,
|
||||||
:name => _INTL("Calm"),
|
:name => _INTL("Calm"),
|
||||||
:stat_changes => [[PBStats::SPDEF, 10], [PBStats::ATTACK, -10]]
|
:stat_changes => [[:SPECIAL_DEFENSE, 10], [:ATTACK, -10]]
|
||||||
})
|
})
|
||||||
|
|
||||||
GameData::Nature.register({
|
GameData::Nature.register({
|
||||||
:id => :GENTLE,
|
:id => :GENTLE,
|
||||||
:id_number => 21,
|
:id_number => 21,
|
||||||
:name => _INTL("Gentle"),
|
:name => _INTL("Gentle"),
|
||||||
:stat_changes => [[PBStats::SPDEF, 10], [PBStats::DEFENSE, -10]]
|
:stat_changes => [[:SPECIAL_DEFENSE, 10], [:DEFENSE, -10]]
|
||||||
})
|
})
|
||||||
|
|
||||||
GameData::Nature.register({
|
GameData::Nature.register({
|
||||||
:id => :SASSY,
|
:id => :SASSY,
|
||||||
:id_number => 22,
|
:id_number => 22,
|
||||||
:name => _INTL("Sassy"),
|
:name => _INTL("Sassy"),
|
||||||
:stat_changes => [[PBStats::SPDEF, 10], [PBStats::SPEED, -10]]
|
:stat_changes => [[:SPECIAL_DEFENSE, 10], [:SPEED, -10]]
|
||||||
})
|
})
|
||||||
|
|
||||||
GameData::Nature.register({
|
GameData::Nature.register({
|
||||||
:id => :CAREFUL,
|
:id => :CAREFUL,
|
||||||
:id_number => 23,
|
:id_number => 23,
|
||||||
:name => _INTL("Careful"),
|
:name => _INTL("Careful"),
|
||||||
:stat_changes => [[PBStats::SPDEF, 10], [PBStats::SPATK, -10]]
|
:stat_changes => [[:SPECIAL_DEFENSE, 10], [:SPECIAL_ATTACK, -10]]
|
||||||
})
|
})
|
||||||
|
|
||||||
GameData::Nature.register({
|
GameData::Nature.register({
|
||||||
|
|||||||
@@ -239,7 +239,7 @@ class PokeBattle_Battler
|
|||||||
return 1 if fainted?
|
return 1 if fainted?
|
||||||
stageMul = [2,2,2,2,2,2, 2, 3,4,5,6,7,8]
|
stageMul = [2,2,2,2,2,2, 2, 3,4,5,6,7,8]
|
||||||
stageDiv = [8,7,6,5,4,3, 2, 2,2,2,2,2,2]
|
stageDiv = [8,7,6,5,4,3, 2, 2,2,2,2,2,2]
|
||||||
stage = @stages[PBStats::SPEED] + 6
|
stage = @stages[:SPEED] + 6
|
||||||
speed = @speed*stageMul[stage]/stageDiv[stage]
|
speed = @speed*stageMul[stage]/stageDiv[stage]
|
||||||
speedMult = 1.0
|
speedMult = 1.0
|
||||||
# Ability effects that alter calculated Speed
|
# Ability effects that alter calculated Speed
|
||||||
@@ -283,12 +283,12 @@ class PokeBattle_Battler
|
|||||||
# Queries about what the battler has
|
# Queries about what the battler has
|
||||||
#=============================================================================
|
#=============================================================================
|
||||||
def plainStats
|
def plainStats
|
||||||
ret = []
|
ret = {}
|
||||||
ret[PBStats::ATTACK] = self.attack
|
ret[:ATTACK] = self.attack
|
||||||
ret[PBStats::DEFENSE] = self.defense
|
ret[:DEFENSE] = self.defense
|
||||||
ret[PBStats::SPATK] = self.spatk
|
ret[:SPECIAL_ATTACK] = self.spatk
|
||||||
ret[PBStats::SPDEF] = self.spdef
|
ret[:SPECIAL_DEFENSE] = self.spdef
|
||||||
ret[PBStats::SPEED] = self.speed
|
ret[:SPEED] = self.speed
|
||||||
return ret
|
return ret
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
@@ -7,7 +7,7 @@ class PokeBattle_Battler
|
|||||||
@index = idxBattler
|
@index = idxBattler
|
||||||
@captured = false
|
@captured = false
|
||||||
@dummy = false
|
@dummy = false
|
||||||
@stages = []
|
@stages = {}
|
||||||
@effects = []
|
@effects = []
|
||||||
@damageState = PokeBattle_DamageState.new
|
@damageState = PokeBattle_DamageState.new
|
||||||
pbInitBlank
|
pbInitBlank
|
||||||
@@ -31,7 +31,8 @@ class PokeBattle_Battler
|
|||||||
@pokemonIndex = -1
|
@pokemonIndex = -1
|
||||||
@participants = []
|
@participants = []
|
||||||
@moves = []
|
@moves = []
|
||||||
@iv = [0,0,0,0,0,0]
|
@iv = {}
|
||||||
|
GameData::Stat.each_main { |s| @iv[s.id] = 0 }
|
||||||
end
|
end
|
||||||
|
|
||||||
# Used by Future Sight only, when Future Sight's user is no longer in battle.
|
# Used by Future Sight only, when Future Sight's user is no longer in battle.
|
||||||
@@ -58,7 +59,8 @@ class PokeBattle_Battler
|
|||||||
@pokemonIndex = idxParty
|
@pokemonIndex = idxParty
|
||||||
@participants = []
|
@participants = []
|
||||||
# moves intentionally not copied across here
|
# moves intentionally not copied across here
|
||||||
@iv = pkmn.iv.clone
|
@iv = {}
|
||||||
|
GameData::Stat.each_main { |s| @iv[s.id] = pkmn.iv[s.id] }
|
||||||
@dummy = true
|
@dummy = true
|
||||||
end
|
end
|
||||||
|
|
||||||
@@ -95,7 +97,8 @@ class PokeBattle_Battler
|
|||||||
pkmn.moves.each_with_index do |m,i|
|
pkmn.moves.each_with_index do |m,i|
|
||||||
@moves[i] = PokeBattle_Move.from_pokemon_move(@battle,m)
|
@moves[i] = PokeBattle_Move.from_pokemon_move(@battle,m)
|
||||||
end
|
end
|
||||||
@iv = pkmn.iv.clone
|
@iv = {}
|
||||||
|
GameData::Stat.each_main { |s| @iv[s.id] = pkmn.iv[s.id] }
|
||||||
end
|
end
|
||||||
|
|
||||||
def pbInitEffects(batonPass)
|
def pbInitEffects(batonPass)
|
||||||
@@ -113,13 +116,13 @@ class PokeBattle_Battler
|
|||||||
@effects[PBEffects::GastroAcid] = false if unstoppableAbility?
|
@effects[PBEffects::GastroAcid] = false if unstoppableAbility?
|
||||||
else
|
else
|
||||||
# These effects are passed on if Baton Pass is used
|
# These effects are passed on if Baton Pass is used
|
||||||
@stages[PBStats::ATTACK] = 0
|
@stages[:ATTACK] = 0
|
||||||
@stages[PBStats::DEFENSE] = 0
|
@stages[:DEFENSE] = 0
|
||||||
@stages[PBStats::SPEED] = 0
|
@stages[:SPEED] = 0
|
||||||
@stages[PBStats::SPATK] = 0
|
@stages[:SPECIAL_ATTACK] = 0
|
||||||
@stages[PBStats::SPDEF] = 0
|
@stages[:SPECIAL_DEFENSE] = 0
|
||||||
@stages[PBStats::EVASION] = 0
|
@stages[:ACCURACY] = 0
|
||||||
@stages[PBStats::ACCURACY] = 0
|
@stages[:EVASION] = 0
|
||||||
@effects[PBEffects::AquaRing] = false
|
@effects[PBEffects::AquaRing] = false
|
||||||
@effects[PBEffects::Confusion] = 0
|
@effects[PBEffects::Confusion] = 0
|
||||||
@effects[PBEffects::Curse] = false
|
@effects[PBEffects::Curse] = false
|
||||||
|
|||||||
@@ -274,7 +274,7 @@ class PokeBattle_Battler
|
|||||||
@spatk = target.spatk
|
@spatk = target.spatk
|
||||||
@spdef = target.spdef
|
@spdef = target.spdef
|
||||||
@speed = target.speed
|
@speed = target.speed
|
||||||
PBStats.eachBattleStat { |s| @stages[s] = target.stages[s] }
|
GameData::Stat.each_battle { |s| @stages[s.id] = target.stages[s.id] }
|
||||||
if Settings::NEW_CRITICAL_HIT_RATE_MECHANICS
|
if Settings::NEW_CRITICAL_HIT_RATE_MECHANICS
|
||||||
@effects[PBEffects::FocusEnergy] = target.effects[PBEffects::FocusEnergy]
|
@effects[PBEffects::FocusEnergy] = target.effects[PBEffects::FocusEnergy]
|
||||||
@effects[PBEffects::LaserFocus] = target.effects[PBEffects::LaserFocus]
|
@effects[PBEffects::LaserFocus] = target.effects[PBEffects::LaserFocus]
|
||||||
|
|||||||
@@ -15,7 +15,7 @@ class PokeBattle_Battler
|
|||||||
# Check the stat stage
|
# Check the stat stage
|
||||||
if statStageAtMax?(stat)
|
if statStageAtMax?(stat)
|
||||||
@battle.pbDisplay(_INTL("{1}'s {2} won't go any higher!",
|
@battle.pbDisplay(_INTL("{1}'s {2} won't go any higher!",
|
||||||
pbThis,PBStats.getName(stat))) if showFailMsg
|
pbThis, GameData::Stat.get(stat).name)) if showFailMsg
|
||||||
return false
|
return false
|
||||||
end
|
end
|
||||||
return true
|
return true
|
||||||
@@ -33,15 +33,15 @@ class PokeBattle_Battler
|
|||||||
# Change the stat stage
|
# Change the stat stage
|
||||||
increment = [increment,6-@stages[stat]].min
|
increment = [increment,6-@stages[stat]].min
|
||||||
if increment>0
|
if increment>0
|
||||||
s = PBStats.getName(stat); new = @stages[stat]+increment
|
stat_name = GameData::Stat.get(stat).name
|
||||||
PBDebug.log("[Stat change] #{pbThis}'s #{s}: #{@stages[stat]} -> #{new} (+#{increment})")
|
new = @stages[stat]+increment
|
||||||
|
PBDebug.log("[Stat change] #{pbThis}'s #{stat_name}: #{@stages[stat]} -> #{new} (+#{increment})")
|
||||||
@stages[stat] += increment
|
@stages[stat] += increment
|
||||||
end
|
end
|
||||||
return increment
|
return increment
|
||||||
end
|
end
|
||||||
|
|
||||||
def pbRaiseStatStage(stat,increment,user,showAnim=true,ignoreContrary=false)
|
def pbRaiseStatStage(stat,increment,user,showAnim=true,ignoreContrary=false)
|
||||||
return false if !PBStats.validBattleStat?(stat)
|
|
||||||
# Contrary
|
# Contrary
|
||||||
if hasActiveAbility?(:CONTRARY) && !ignoreContrary && !@battle.moldBreaker
|
if hasActiveAbility?(:CONTRARY) && !ignoreContrary && !@battle.moldBreaker
|
||||||
return pbLowerStatStage(stat,increment,user,showAnim,true)
|
return pbLowerStatStage(stat,increment,user,showAnim,true)
|
||||||
@@ -52,9 +52,9 @@ class PokeBattle_Battler
|
|||||||
# Stat up animation and message
|
# Stat up animation and message
|
||||||
@battle.pbCommonAnimation("StatUp",self) if showAnim
|
@battle.pbCommonAnimation("StatUp",self) if showAnim
|
||||||
arrStatTexts = [
|
arrStatTexts = [
|
||||||
_INTL("{1}'s {2} rose!",pbThis,PBStats.getName(stat)),
|
_INTL("{1}'s {2} rose!",pbThis,GameData::Stat.get(stat).name),
|
||||||
_INTL("{1}'s {2} rose sharply!",pbThis,PBStats.getName(stat)),
|
_INTL("{1}'s {2} rose sharply!",pbThis,GameData::Stat.get(stat).name),
|
||||||
_INTL("{1}'s {2} rose drastically!",pbThis,PBStats.getName(stat))]
|
_INTL("{1}'s {2} rose drastically!",pbThis,GameData::Stat.get(stat).name)]
|
||||||
@battle.pbDisplay(arrStatTexts[[increment-1,2].min])
|
@battle.pbDisplay(arrStatTexts[[increment-1,2].min])
|
||||||
# Trigger abilities upon stat gain
|
# Trigger abilities upon stat gain
|
||||||
if abilityActive?
|
if abilityActive?
|
||||||
@@ -64,7 +64,6 @@ class PokeBattle_Battler
|
|||||||
end
|
end
|
||||||
|
|
||||||
def pbRaiseStatStageByCause(stat,increment,user,cause,showAnim=true,ignoreContrary=false)
|
def pbRaiseStatStageByCause(stat,increment,user,cause,showAnim=true,ignoreContrary=false)
|
||||||
return false if !PBStats.validBattleStat?(stat)
|
|
||||||
# Contrary
|
# Contrary
|
||||||
if hasActiveAbility?(:CONTRARY) && !ignoreContrary && !@battle.moldBreaker
|
if hasActiveAbility?(:CONTRARY) && !ignoreContrary && !@battle.moldBreaker
|
||||||
return pbLowerStatStageByCause(stat,increment,user,cause,showAnim,true)
|
return pbLowerStatStageByCause(stat,increment,user,cause,showAnim,true)
|
||||||
@@ -76,14 +75,14 @@ class PokeBattle_Battler
|
|||||||
@battle.pbCommonAnimation("StatUp",self) if showAnim
|
@battle.pbCommonAnimation("StatUp",self) if showAnim
|
||||||
if user.index==@index
|
if user.index==@index
|
||||||
arrStatTexts = [
|
arrStatTexts = [
|
||||||
_INTL("{1}'s {2} raised its {3}!",pbThis,cause,PBStats.getName(stat)),
|
_INTL("{1}'s {2} raised its {3}!",pbThis,cause,GameData::Stat.get(stat).name),
|
||||||
_INTL("{1}'s {2} sharply raised its {3}!",pbThis,cause,PBStats.getName(stat)),
|
_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,PBStats.getName(stat))]
|
_INTL("{1}'s {2} drastically raised its {3}!",pbThis,cause,GameData::Stat.get(stat).name)]
|
||||||
else
|
else
|
||||||
arrStatTexts = [
|
arrStatTexts = [
|
||||||
_INTL("{1}'s {2} raised {3}'s {4}!",user.pbThis,cause,pbThis(true),PBStats.getName(stat)),
|
_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),PBStats.getName(stat)),
|
_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),PBStats.getName(stat))]
|
_INTL("{1}'s {2} drastically raised {3}'s {4}!",user.pbThis,cause,pbThis(true),GameData::Stat.get(stat).name)]
|
||||||
end
|
end
|
||||||
@battle.pbDisplay(arrStatTexts[[increment-1,2].min])
|
@battle.pbDisplay(arrStatTexts[[increment-1,2].min])
|
||||||
# Trigger abilities upon stat gain
|
# Trigger abilities upon stat gain
|
||||||
@@ -148,7 +147,7 @@ class PokeBattle_Battler
|
|||||||
# Check the stat stage
|
# Check the stat stage
|
||||||
if statStageAtMin?(stat)
|
if statStageAtMin?(stat)
|
||||||
@battle.pbDisplay(_INTL("{1}'s {2} won't go any lower!",
|
@battle.pbDisplay(_INTL("{1}'s {2} won't go any lower!",
|
||||||
pbThis,PBStats.getName(stat))) if showFailMsg
|
pbThis, GameData::Stat.get(stat).name)) if showFailMsg
|
||||||
return false
|
return false
|
||||||
end
|
end
|
||||||
return true
|
return true
|
||||||
@@ -166,15 +165,15 @@ class PokeBattle_Battler
|
|||||||
# Change the stat stage
|
# Change the stat stage
|
||||||
increment = [increment,6+@stages[stat]].min
|
increment = [increment,6+@stages[stat]].min
|
||||||
if increment>0
|
if increment>0
|
||||||
s = PBStats.getName(stat); new = @stages[stat]-increment
|
stat_name = GameData::Stat.get(stat).name
|
||||||
PBDebug.log("[Stat change] #{pbThis}'s #{s}: #{@stages[stat]} -> #{new} (-#{increment})")
|
new = @stages[stat]-increment
|
||||||
|
PBDebug.log("[Stat change] #{pbThis}'s #{stat_name}: #{@stages[stat]} -> #{new} (-#{increment})")
|
||||||
@stages[stat] -= increment
|
@stages[stat] -= increment
|
||||||
end
|
end
|
||||||
return increment
|
return increment
|
||||||
end
|
end
|
||||||
|
|
||||||
def pbLowerStatStage(stat,increment,user,showAnim=true,ignoreContrary=false)
|
def pbLowerStatStage(stat,increment,user,showAnim=true,ignoreContrary=false)
|
||||||
return false if !PBStats.validBattleStat?(stat)
|
|
||||||
# Contrary
|
# Contrary
|
||||||
if hasActiveAbility?(:CONTRARY) && !ignoreContrary && !@battle.moldBreaker
|
if hasActiveAbility?(:CONTRARY) && !ignoreContrary && !@battle.moldBreaker
|
||||||
return pbRaiseStatStage(stat,increment,user,showAnim,true)
|
return pbRaiseStatStage(stat,increment,user,showAnim,true)
|
||||||
@@ -185,9 +184,9 @@ class PokeBattle_Battler
|
|||||||
# Stat down animation and message
|
# Stat down animation and message
|
||||||
@battle.pbCommonAnimation("StatDown",self) if showAnim
|
@battle.pbCommonAnimation("StatDown",self) if showAnim
|
||||||
arrStatTexts = [
|
arrStatTexts = [
|
||||||
_INTL("{1}'s {2} fell!",pbThis,PBStats.getName(stat)),
|
_INTL("{1}'s {2} fell!",pbThis,GameData::Stat.get(stat).name),
|
||||||
_INTL("{1}'s {2} harshly fell!",pbThis,PBStats.getName(stat)),
|
_INTL("{1}'s {2} harshly fell!",pbThis,GameData::Stat.get(stat).name),
|
||||||
_INTL("{1}'s {2} severely fell!",pbThis,PBStats.getName(stat))]
|
_INTL("{1}'s {2} severely fell!",pbThis,GameData::Stat.get(stat).name)]
|
||||||
@battle.pbDisplay(arrStatTexts[[increment-1,2].min])
|
@battle.pbDisplay(arrStatTexts[[increment-1,2].min])
|
||||||
# Trigger abilities upon stat loss
|
# Trigger abilities upon stat loss
|
||||||
if abilityActive?
|
if abilityActive?
|
||||||
@@ -197,7 +196,6 @@ class PokeBattle_Battler
|
|||||||
end
|
end
|
||||||
|
|
||||||
def pbLowerStatStageByCause(stat,increment,user,cause,showAnim=true,ignoreContrary=false)
|
def pbLowerStatStageByCause(stat,increment,user,cause,showAnim=true,ignoreContrary=false)
|
||||||
return false if !PBStats.validBattleStat?(stat)
|
|
||||||
# Contrary
|
# Contrary
|
||||||
if hasActiveAbility?(:CONTRARY) && !ignoreContrary && !@battle.moldBreaker
|
if hasActiveAbility?(:CONTRARY) && !ignoreContrary && !@battle.moldBreaker
|
||||||
return pbRaiseStatStageByCause(stat,increment,user,cause,showAnim,true)
|
return pbRaiseStatStageByCause(stat,increment,user,cause,showAnim,true)
|
||||||
@@ -209,14 +207,14 @@ class PokeBattle_Battler
|
|||||||
@battle.pbCommonAnimation("StatDown",self) if showAnim
|
@battle.pbCommonAnimation("StatDown",self) if showAnim
|
||||||
if user.index==@index
|
if user.index==@index
|
||||||
arrStatTexts = [
|
arrStatTexts = [
|
||||||
_INTL("{1}'s {2} lowered its {3}!",pbThis,cause,PBStats.getName(stat)),
|
_INTL("{1}'s {2} lowered its {3}!",pbThis,cause,GameData::Stat.get(stat).name),
|
||||||
_INTL("{1}'s {2} harshly lowered its {3}!",pbThis,cause,PBStats.getName(stat)),
|
_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,PBStats.getName(stat))]
|
_INTL("{1}'s {2} severely lowered its {3}!",pbThis,cause,GameData::Stat.get(stat).name)]
|
||||||
else
|
else
|
||||||
arrStatTexts = [
|
arrStatTexts = [
|
||||||
_INTL("{1}'s {2} lowered {3}'s {4}!",user.pbThis,cause,pbThis(true),PBStats.getName(stat)),
|
_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),PBStats.getName(stat)),
|
_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),PBStats.getName(stat))]
|
_INTL("{1}'s {2} severely lowered {3}'s {4}!",user.pbThis,cause,pbThis(true),GameData::Stat.get(stat).name)]
|
||||||
end
|
end
|
||||||
@battle.pbDisplay(arrStatTexts[[increment-1,2].min])
|
@battle.pbDisplay(arrStatTexts[[increment-1,2].min])
|
||||||
# Trigger abilities upon stat loss
|
# Trigger abilities upon stat loss
|
||||||
@@ -254,7 +252,7 @@ class PokeBattle_Battler
|
|||||||
return false
|
return false
|
||||||
end
|
end
|
||||||
if PokeBattle_SceneConstants::USE_ABILITY_SPLASH
|
if PokeBattle_SceneConstants::USE_ABILITY_SPLASH
|
||||||
return pbLowerStatStageByAbility(PBStats::ATTACK,1,user,false)
|
return pbLowerStatStageByAbility(:ATTACK,1,user,false)
|
||||||
end
|
end
|
||||||
# NOTE: These checks exist to ensure appropriate messages are shown if
|
# NOTE: These checks exist to ensure appropriate messages are shown if
|
||||||
# Intimidate is blocked somehow (i.e. the messages should mention the
|
# Intimidate is blocked somehow (i.e. the messages should mention the
|
||||||
@@ -266,8 +264,8 @@ class PokeBattle_Battler
|
|||||||
return false
|
return false
|
||||||
end
|
end
|
||||||
if abilityActive?
|
if abilityActive?
|
||||||
if BattleHandlers.triggerStatLossImmunityAbility(self.ability,self,PBStats::ATTACK,@battle,false) ||
|
if BattleHandlers.triggerStatLossImmunityAbility(self.ability,self,:ATTACK,@battle,false) ||
|
||||||
BattleHandlers.triggerStatLossImmunityAbilityNonIgnorable(self.ability,self,PBStats::ATTACK,@battle,false)
|
BattleHandlers.triggerStatLossImmunityAbilityNonIgnorable(self.ability,self,:ATTACK,@battle,false)
|
||||||
@battle.pbDisplay(_INTL("{1}'s {2} prevented {3}'s {4} from working!",
|
@battle.pbDisplay(_INTL("{1}'s {2} prevented {3}'s {4} from working!",
|
||||||
pbThis,abilityName,user.pbThis(true),user.abilityName))
|
pbThis,abilityName,user.pbThis(true),user.abilityName))
|
||||||
return false
|
return false
|
||||||
@@ -275,36 +273,36 @@ class PokeBattle_Battler
|
|||||||
end
|
end
|
||||||
eachAlly do |b|
|
eachAlly do |b|
|
||||||
next if !b.abilityActive?
|
next if !b.abilityActive?
|
||||||
if BattleHandlers.triggerStatLossImmunityAllyAbility(b.ability,b,self,PBStats::ATTACK,@battle,false)
|
if BattleHandlers.triggerStatLossImmunityAllyAbility(b.ability,b,self,:ATTACK,@battle,false)
|
||||||
@battle.pbDisplay(_INTL("{1} is protected from {2}'s {3} by {4}'s {5}!",
|
@battle.pbDisplay(_INTL("{1} is protected from {2}'s {3} by {4}'s {5}!",
|
||||||
pbThis,user.pbThis(true),user.abilityName,b.pbThis(true),b.abilityName))
|
pbThis,user.pbThis(true),user.abilityName,b.pbThis(true),b.abilityName))
|
||||||
return false
|
return false
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
return false if !pbCanLowerStatStage?(PBStats::ATTACK,user)
|
return false if !pbCanLowerStatStage?(:ATTACK,user)
|
||||||
return pbLowerStatStageByCause(PBStats::ATTACK,1,user,user.abilityName)
|
return pbLowerStatStageByCause(:ATTACK,1,user,user.abilityName)
|
||||||
end
|
end
|
||||||
|
|
||||||
#=============================================================================
|
#=============================================================================
|
||||||
# Reset stat stages
|
# Reset stat stages
|
||||||
#=============================================================================
|
#=============================================================================
|
||||||
def hasAlteredStatStages?
|
def hasAlteredStatStages?
|
||||||
PBStats.eachBattleStat { |s| return true if @stages[s]!=0 }
|
GameData::Stat.each_battle { |s| return true if @stages[s.id] != 0 }
|
||||||
return false
|
return false
|
||||||
end
|
end
|
||||||
|
|
||||||
def hasRaisedStatStages?
|
def hasRaisedStatStages?
|
||||||
PBStats.eachBattleStat { |s| return true if @stages[s]>0 }
|
GameData::Stat.each_battle { |s| return true if @stages[s.id] > 0 }
|
||||||
return false
|
return false
|
||||||
end
|
end
|
||||||
|
|
||||||
def hasLoweredStatStages?
|
def hasLoweredStatStages?
|
||||||
PBStats.eachBattleStat { |s| return true if @stages[s]<0 }
|
GameData::Stat.each_battle { |s| return true if @stages[s.id] < 0 }
|
||||||
return false
|
return false
|
||||||
end
|
end
|
||||||
|
|
||||||
def pbResetStatStages
|
def pbResetStatStages
|
||||||
PBStats.eachBattleStat { |s| @stages[s] = 0 }
|
GameData::Stat.each_battle { |s| @stages[s.id] = 0 }
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -344,8 +344,8 @@ class PokeBattle_Battler
|
|||||||
target.damageState.protected = true
|
target.damageState.protected = true
|
||||||
@battle.successStates[user.index].protected = true
|
@battle.successStates[user.index].protected = true
|
||||||
if move.pbContactMove?(user) && user.affectedByContactEffect?
|
if move.pbContactMove?(user) && user.affectedByContactEffect?
|
||||||
if user.pbCanLowerStatStage?(PBStats::ATTACK)
|
if user.pbCanLowerStatStage?(:ATTACK)
|
||||||
user.pbLowerStatStage(PBStats::ATTACK,2,nil)
|
user.pbLowerStatStage(:ATTACK,2,nil)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
return false
|
return false
|
||||||
|
|||||||
@@ -25,9 +25,9 @@ class PokeBattle_Battler
|
|||||||
if target.opposes?(user)
|
if target.opposes?(user)
|
||||||
# Rage
|
# Rage
|
||||||
if target.effects[PBEffects::Rage] && !target.fainted?
|
if target.effects[PBEffects::Rage] && !target.fainted?
|
||||||
if target.pbCanRaiseStatStage?(PBStats::ATTACK,target)
|
if target.pbCanRaiseStatStage?(:ATTACK,target)
|
||||||
@battle.pbDisplay(_INTL("{1}'s rage is building!",target.pbThis))
|
@battle.pbDisplay(_INTL("{1}'s rage is building!",target.pbThis))
|
||||||
target.pbRaiseStatStage(PBStats::ATTACK,1,target)
|
target.pbRaiseStatStage(:ATTACK,1,target)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
# Beak Blast
|
# Beak Blast
|
||||||
|
|||||||
@@ -90,8 +90,8 @@ class PokeBattle_Move
|
|||||||
# Calculate all multiplier effects
|
# Calculate all multiplier effects
|
||||||
modifiers = {}
|
modifiers = {}
|
||||||
modifiers[:base_accuracy] = baseAcc
|
modifiers[:base_accuracy] = baseAcc
|
||||||
modifiers[:accuracy_stage] = user.stages[PBStats::ACCURACY]
|
modifiers[:accuracy_stage] = user.stages[:ACCURACY]
|
||||||
modifiers[:evasion_stage] = target.stages[PBStats::EVASION]
|
modifiers[:evasion_stage] = target.stages[:EVASION]
|
||||||
modifiers[:accuracy_multiplier] = 1.0
|
modifiers[:accuracy_multiplier] = 1.0
|
||||||
modifiers[:evasion_multiplier] = 1.0
|
modifiers[:evasion_multiplier] = 1.0
|
||||||
pbCalcAccuracyModifiers(user,target,modifiers)
|
pbCalcAccuracyModifiers(user,target,modifiers)
|
||||||
@@ -203,16 +203,16 @@ class PokeBattle_Move
|
|||||||
|
|
||||||
def pbGetAttackStats(user,target)
|
def pbGetAttackStats(user,target)
|
||||||
if specialMove?
|
if specialMove?
|
||||||
return user.spatk, user.stages[PBStats::SPATK]+6
|
return user.spatk, user.stages[:SPECIAL_ATTACK]+6
|
||||||
end
|
end
|
||||||
return user.attack, user.stages[PBStats::ATTACK]+6
|
return user.attack, user.stages[:ATTACK]+6
|
||||||
end
|
end
|
||||||
|
|
||||||
def pbGetDefenseStats(user,target)
|
def pbGetDefenseStats(user,target)
|
||||||
if specialMove?
|
if specialMove?
|
||||||
return target.spdef, target.stages[PBStats::SPDEF]+6
|
return target.spdef, target.stages[:SPECIAL_DEFENSE]+6
|
||||||
end
|
end
|
||||||
return target.defense, target.stages[PBStats::DEFENSE]+6
|
return target.defense, target.stages[:DEFENSE]+6
|
||||||
end
|
end
|
||||||
|
|
||||||
def pbCalcDamage(user,target,numTargets=1)
|
def pbCalcDamage(user,target,numTargets=1)
|
||||||
|
|||||||
@@ -561,7 +561,7 @@ end
|
|||||||
class PokeBattle_Move_01C < PokeBattle_StatUpMove
|
class PokeBattle_Move_01C < PokeBattle_StatUpMove
|
||||||
def initialize(battle,move)
|
def initialize(battle,move)
|
||||||
super
|
super
|
||||||
@statUp = [PBStats::ATTACK,1]
|
@statUp = [:ATTACK,1]
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
@@ -573,7 +573,7 @@ end
|
|||||||
class PokeBattle_Move_01D < PokeBattle_StatUpMove
|
class PokeBattle_Move_01D < PokeBattle_StatUpMove
|
||||||
def initialize(battle,move)
|
def initialize(battle,move)
|
||||||
super
|
super
|
||||||
@statUp = [PBStats::DEFENSE,1]
|
@statUp = [:DEFENSE,1]
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
@@ -585,7 +585,7 @@ end
|
|||||||
class PokeBattle_Move_01E < PokeBattle_StatUpMove
|
class PokeBattle_Move_01E < PokeBattle_StatUpMove
|
||||||
def initialize(battle,move)
|
def initialize(battle,move)
|
||||||
super
|
super
|
||||||
@statUp = [PBStats::DEFENSE,1]
|
@statUp = [:DEFENSE,1]
|
||||||
end
|
end
|
||||||
|
|
||||||
def pbEffectGeneral(user)
|
def pbEffectGeneral(user)
|
||||||
@@ -602,7 +602,7 @@ end
|
|||||||
class PokeBattle_Move_01F < PokeBattle_StatUpMove
|
class PokeBattle_Move_01F < PokeBattle_StatUpMove
|
||||||
def initialize(battle,move)
|
def initialize(battle,move)
|
||||||
super
|
super
|
||||||
@statUp = [PBStats::SPEED,1]
|
@statUp = [:SPEED,1]
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
@@ -614,7 +614,7 @@ end
|
|||||||
class PokeBattle_Move_020 < PokeBattle_StatUpMove
|
class PokeBattle_Move_020 < PokeBattle_StatUpMove
|
||||||
def initialize(battle,move)
|
def initialize(battle,move)
|
||||||
super
|
super
|
||||||
@statUp = [PBStats::SPATK,1]
|
@statUp = [:SPECIAL_ATTACK,1]
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
@@ -627,7 +627,7 @@ end
|
|||||||
class PokeBattle_Move_021 < PokeBattle_StatUpMove
|
class PokeBattle_Move_021 < PokeBattle_StatUpMove
|
||||||
def initialize(battle,move)
|
def initialize(battle,move)
|
||||||
super
|
super
|
||||||
@statUp = [PBStats::SPDEF,1]
|
@statUp = [:SPECIAL_DEFENSE,1]
|
||||||
end
|
end
|
||||||
|
|
||||||
def pbEffectGeneral(user)
|
def pbEffectGeneral(user)
|
||||||
@@ -645,7 +645,7 @@ end
|
|||||||
class PokeBattle_Move_022 < PokeBattle_StatUpMove
|
class PokeBattle_Move_022 < PokeBattle_StatUpMove
|
||||||
def initialize(battle,move)
|
def initialize(battle,move)
|
||||||
super
|
super
|
||||||
@statUp = [PBStats::EVASION,1]
|
@statUp = [:EVASION,1]
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
@@ -677,7 +677,7 @@ end
|
|||||||
class PokeBattle_Move_024 < PokeBattle_MultiStatUpMove
|
class PokeBattle_Move_024 < PokeBattle_MultiStatUpMove
|
||||||
def initialize(battle,move)
|
def initialize(battle,move)
|
||||||
super
|
super
|
||||||
@statUp = [PBStats::ATTACK,1,PBStats::DEFENSE,1]
|
@statUp = [:ATTACK,1,:DEFENSE,1]
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
@@ -689,7 +689,7 @@ end
|
|||||||
class PokeBattle_Move_025 < PokeBattle_MultiStatUpMove
|
class PokeBattle_Move_025 < PokeBattle_MultiStatUpMove
|
||||||
def initialize(battle,move)
|
def initialize(battle,move)
|
||||||
super
|
super
|
||||||
@statUp = [PBStats::ATTACK,1,PBStats::DEFENSE,1,PBStats::ACCURACY,1]
|
@statUp = [:ATTACK,1,:DEFENSE,1,:ACCURACY,1]
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
@@ -701,7 +701,7 @@ end
|
|||||||
class PokeBattle_Move_026 < PokeBattle_MultiStatUpMove
|
class PokeBattle_Move_026 < PokeBattle_MultiStatUpMove
|
||||||
def initialize(battle,move)
|
def initialize(battle,move)
|
||||||
super
|
super
|
||||||
@statUp = [PBStats::ATTACK,1,PBStats::SPEED,1]
|
@statUp = [:ATTACK,1,:SPEED,1]
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
@@ -713,7 +713,7 @@ end
|
|||||||
class PokeBattle_Move_027 < PokeBattle_MultiStatUpMove
|
class PokeBattle_Move_027 < PokeBattle_MultiStatUpMove
|
||||||
def initialize(battle,move)
|
def initialize(battle,move)
|
||||||
super
|
super
|
||||||
@statUp = [PBStats::ATTACK,1,PBStats::SPATK,1]
|
@statUp = [:ATTACK,1,:SPECIAL_ATTACK,1]
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
@@ -726,7 +726,7 @@ end
|
|||||||
class PokeBattle_Move_028 < PokeBattle_MultiStatUpMove
|
class PokeBattle_Move_028 < PokeBattle_MultiStatUpMove
|
||||||
def initialize(battle,move)
|
def initialize(battle,move)
|
||||||
super
|
super
|
||||||
@statUp = [PBStats::ATTACK,1,PBStats::SPATK,1]
|
@statUp = [:ATTACK,1,:SPECIAL_ATTACK,1]
|
||||||
end
|
end
|
||||||
|
|
||||||
def pbOnStartUse(user,targets)
|
def pbOnStartUse(user,targets)
|
||||||
@@ -744,7 +744,7 @@ end
|
|||||||
class PokeBattle_Move_029 < PokeBattle_MultiStatUpMove
|
class PokeBattle_Move_029 < PokeBattle_MultiStatUpMove
|
||||||
def initialize(battle,move)
|
def initialize(battle,move)
|
||||||
super
|
super
|
||||||
@statUp = [PBStats::ATTACK,1,PBStats::ACCURACY,1]
|
@statUp = [:ATTACK,1,:ACCURACY,1]
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
@@ -757,7 +757,7 @@ end
|
|||||||
class PokeBattle_Move_02A < PokeBattle_MultiStatUpMove
|
class PokeBattle_Move_02A < PokeBattle_MultiStatUpMove
|
||||||
def initialize(battle,move)
|
def initialize(battle,move)
|
||||||
super
|
super
|
||||||
@statUp = [PBStats::DEFENSE,1,PBStats::SPDEF,1]
|
@statUp = [:DEFENSE,1,:SPECIAL_DEFENSE,1]
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
@@ -770,7 +770,7 @@ end
|
|||||||
class PokeBattle_Move_02B < PokeBattle_MultiStatUpMove
|
class PokeBattle_Move_02B < PokeBattle_MultiStatUpMove
|
||||||
def initialize(battle,move)
|
def initialize(battle,move)
|
||||||
super
|
super
|
||||||
@statUp = [PBStats::SPATK,1,PBStats::SPDEF,1,PBStats::SPEED,1]
|
@statUp = [:SPECIAL_ATTACK,1,:SPECIAL_DEFENSE,1,:SPEED,1]
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
@@ -782,7 +782,7 @@ end
|
|||||||
class PokeBattle_Move_02C < PokeBattle_MultiStatUpMove
|
class PokeBattle_Move_02C < PokeBattle_MultiStatUpMove
|
||||||
def initialize(battle,move)
|
def initialize(battle,move)
|
||||||
super
|
super
|
||||||
@statUp = [PBStats::SPATK,1,PBStats::SPDEF,1]
|
@statUp = [:SPECIAL_ATTACK,1,:SPECIAL_DEFENSE,1]
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
@@ -795,9 +795,7 @@ end
|
|||||||
class PokeBattle_Move_02D < PokeBattle_MultiStatUpMove
|
class PokeBattle_Move_02D < PokeBattle_MultiStatUpMove
|
||||||
def initialize(battle,move)
|
def initialize(battle,move)
|
||||||
super
|
super
|
||||||
@statUp = [PBStats::ATTACK,1,PBStats::DEFENSE,1,
|
@statUp = [:ATTACK,1,:DEFENSE,1,:SPECIAL_ATTACK,1,:SPECIAL_DEFENSE,1,:SPEED,1]
|
||||||
PBStats::SPATK,1,PBStats::SPDEF,1,
|
|
||||||
PBStats::SPEED,1]
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
@@ -809,7 +807,7 @@ end
|
|||||||
class PokeBattle_Move_02E < PokeBattle_StatUpMove
|
class PokeBattle_Move_02E < PokeBattle_StatUpMove
|
||||||
def initialize(battle,move)
|
def initialize(battle,move)
|
||||||
super
|
super
|
||||||
@statUp = [PBStats::ATTACK,2]
|
@statUp = [:ATTACK,2]
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
@@ -821,7 +819,7 @@ end
|
|||||||
class PokeBattle_Move_02F < PokeBattle_StatUpMove
|
class PokeBattle_Move_02F < PokeBattle_StatUpMove
|
||||||
def initialize(battle,move)
|
def initialize(battle,move)
|
||||||
super
|
super
|
||||||
@statUp = [PBStats::DEFENSE,2]
|
@statUp = [:DEFENSE,2]
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
@@ -833,7 +831,7 @@ end
|
|||||||
class PokeBattle_Move_030 < PokeBattle_StatUpMove
|
class PokeBattle_Move_030 < PokeBattle_StatUpMove
|
||||||
def initialize(battle,move)
|
def initialize(battle,move)
|
||||||
super
|
super
|
||||||
@statUp = [PBStats::SPEED,2]
|
@statUp = [:SPEED,2]
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
@@ -846,7 +844,7 @@ end
|
|||||||
class PokeBattle_Move_031 < PokeBattle_StatUpMove
|
class PokeBattle_Move_031 < PokeBattle_StatUpMove
|
||||||
def initialize(battle,move)
|
def initialize(battle,move)
|
||||||
super
|
super
|
||||||
@statUp = [PBStats::SPEED,2]
|
@statUp = [:SPEED,2]
|
||||||
end
|
end
|
||||||
|
|
||||||
def pbEffectGeneral(user)
|
def pbEffectGeneral(user)
|
||||||
@@ -866,7 +864,7 @@ end
|
|||||||
class PokeBattle_Move_032 < PokeBattle_StatUpMove
|
class PokeBattle_Move_032 < PokeBattle_StatUpMove
|
||||||
def initialize(battle,move)
|
def initialize(battle,move)
|
||||||
super
|
super
|
||||||
@statUp = [PBStats::SPATK,2]
|
@statUp = [:SPECIAL_ATTACK,2]
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
@@ -878,7 +876,7 @@ end
|
|||||||
class PokeBattle_Move_033 < PokeBattle_StatUpMove
|
class PokeBattle_Move_033 < PokeBattle_StatUpMove
|
||||||
def initialize(battle,move)
|
def initialize(battle,move)
|
||||||
super
|
super
|
||||||
@statUp = [PBStats::SPDEF,2]
|
@statUp = [:SPECIAL_DEFENSE,2]
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
@@ -890,7 +888,7 @@ end
|
|||||||
class PokeBattle_Move_034 < PokeBattle_StatUpMove
|
class PokeBattle_Move_034 < PokeBattle_StatUpMove
|
||||||
def initialize(battle,move)
|
def initialize(battle,move)
|
||||||
super
|
super
|
||||||
@statUp = [PBStats::EVASION,2]
|
@statUp = [:EVASION,2]
|
||||||
end
|
end
|
||||||
|
|
||||||
def pbEffectGeneral(user)
|
def pbEffectGeneral(user)
|
||||||
@@ -909,8 +907,8 @@ end
|
|||||||
class PokeBattle_Move_035 < PokeBattle_Move
|
class PokeBattle_Move_035 < PokeBattle_Move
|
||||||
def initialize(battle,move)
|
def initialize(battle,move)
|
||||||
super
|
super
|
||||||
@statUp = [PBStats::ATTACK,2,PBStats::SPATK,2,PBStats::SPEED,2]
|
@statUp = [:ATTACK,2,:SPECIAL_ATTACK,2,:SPEED,2]
|
||||||
@statDown = [PBStats::DEFENSE,1,PBStats::SPDEF,1]
|
@statDown = [:DEFENSE,1,:SPECIAL_DEFENSE,1]
|
||||||
end
|
end
|
||||||
|
|
||||||
def pbMoveFailed?(user,targets)
|
def pbMoveFailed?(user,targets)
|
||||||
@@ -958,7 +956,7 @@ end
|
|||||||
class PokeBattle_Move_036 < PokeBattle_MultiStatUpMove
|
class PokeBattle_Move_036 < PokeBattle_MultiStatUpMove
|
||||||
def initialize(battle,move)
|
def initialize(battle,move)
|
||||||
super
|
super
|
||||||
@statUp = [PBStats::SPEED,2,PBStats::ATTACK,1]
|
@statUp = [:SPEED,2,:ATTACK,1]
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
@@ -970,8 +968,8 @@ end
|
|||||||
class PokeBattle_Move_037 < PokeBattle_Move
|
class PokeBattle_Move_037 < PokeBattle_Move
|
||||||
def pbFailsAgainstTarget?(user,target)
|
def pbFailsAgainstTarget?(user,target)
|
||||||
@statArray = []
|
@statArray = []
|
||||||
PBStats.eachBattleStat do |s|
|
GameData::Stat.each_battle do |s|
|
||||||
@statArray.push(s) if target.pbCanRaiseStatStage?(s,user,self)
|
@statArray.push(s.id) if target.pbCanRaiseStatStage?(s.id,user,self)
|
||||||
end
|
end
|
||||||
if @statArray.length==0
|
if @statArray.length==0
|
||||||
@battle.pbDisplay(_INTL("{1}'s stats won't go any higher!",target.pbThis))
|
@battle.pbDisplay(_INTL("{1}'s stats won't go any higher!",target.pbThis))
|
||||||
@@ -994,7 +992,7 @@ end
|
|||||||
class PokeBattle_Move_038 < PokeBattle_StatUpMove
|
class PokeBattle_Move_038 < PokeBattle_StatUpMove
|
||||||
def initialize(battle,move)
|
def initialize(battle,move)
|
||||||
super
|
super
|
||||||
@statUp = [PBStats::DEFENSE,3]
|
@statUp = [:DEFENSE,3]
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
@@ -1006,7 +1004,7 @@ end
|
|||||||
class PokeBattle_Move_039 < PokeBattle_StatUpMove
|
class PokeBattle_Move_039 < PokeBattle_StatUpMove
|
||||||
def initialize(battle,move)
|
def initialize(battle,move)
|
||||||
super
|
super
|
||||||
@statUp = [PBStats::SPATK,3]
|
@statUp = [:SPECIAL_ATTACK,3]
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
@@ -1023,7 +1021,7 @@ class PokeBattle_Move_03A < PokeBattle_Move
|
|||||||
@battle.pbDisplay(_INTL("But it failed!"))
|
@battle.pbDisplay(_INTL("But it failed!"))
|
||||||
return true
|
return true
|
||||||
end
|
end
|
||||||
return true if !user.pbCanRaiseStatStage?(PBStats::ATTACK,user,self,true)
|
return true if !user.pbCanRaiseStatStage?(:ATTACK,user,self,true)
|
||||||
return false
|
return false
|
||||||
end
|
end
|
||||||
|
|
||||||
@@ -1031,11 +1029,11 @@ class PokeBattle_Move_03A < PokeBattle_Move
|
|||||||
hpLoss = [user.totalhp/2,1].max
|
hpLoss = [user.totalhp/2,1].max
|
||||||
user.pbReduceHP(hpLoss,false)
|
user.pbReduceHP(hpLoss,false)
|
||||||
if user.hasActiveAbility?(:CONTRARY)
|
if user.hasActiveAbility?(:CONTRARY)
|
||||||
user.stages[PBStats::ATTACK] = -6
|
user.stages[:ATTACK] = -6
|
||||||
@battle.pbCommonAnimation("StatDown",user)
|
@battle.pbCommonAnimation("StatDown",user)
|
||||||
@battle.pbDisplay(_INTL("{1} cut its own HP and minimized its Attack!",user.pbThis))
|
@battle.pbDisplay(_INTL("{1} cut its own HP and minimized its Attack!",user.pbThis))
|
||||||
else
|
else
|
||||||
user.stages[PBStats::ATTACK] = 6
|
user.stages[:ATTACK] = 6
|
||||||
@battle.pbCommonAnimation("StatUp",user)
|
@battle.pbCommonAnimation("StatUp",user)
|
||||||
@battle.pbDisplay(_INTL("{1} cut its own HP and maximized its Attack!",user.pbThis))
|
@battle.pbDisplay(_INTL("{1} cut its own HP and maximized its Attack!",user.pbThis))
|
||||||
end
|
end
|
||||||
@@ -1051,7 +1049,7 @@ end
|
|||||||
class PokeBattle_Move_03B < PokeBattle_StatDownMove
|
class PokeBattle_Move_03B < PokeBattle_StatDownMove
|
||||||
def initialize(battle,move)
|
def initialize(battle,move)
|
||||||
super
|
super
|
||||||
@statDown = [PBStats::ATTACK,1,PBStats::DEFENSE,1]
|
@statDown = [:ATTACK,1,:DEFENSE,1]
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
@@ -1064,7 +1062,7 @@ end
|
|||||||
class PokeBattle_Move_03C < PokeBattle_StatDownMove
|
class PokeBattle_Move_03C < PokeBattle_StatDownMove
|
||||||
def initialize(battle,move)
|
def initialize(battle,move)
|
||||||
super
|
super
|
||||||
@statDown = [PBStats::DEFENSE,1,PBStats::SPDEF,1]
|
@statDown = [:DEFENSE,1,:SPECIAL_DEFENSE,1]
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
@@ -1077,7 +1075,7 @@ end
|
|||||||
class PokeBattle_Move_03D < PokeBattle_StatDownMove
|
class PokeBattle_Move_03D < PokeBattle_StatDownMove
|
||||||
def initialize(battle,move)
|
def initialize(battle,move)
|
||||||
super
|
super
|
||||||
@statDown = [PBStats::SPEED,1,PBStats::DEFENSE,1,PBStats::SPDEF,1]
|
@statDown = [:SPEED,1,:DEFENSE,1,:SPECIAL_DEFENSE,1]
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
@@ -1089,7 +1087,7 @@ end
|
|||||||
class PokeBattle_Move_03E < PokeBattle_StatDownMove
|
class PokeBattle_Move_03E < PokeBattle_StatDownMove
|
||||||
def initialize(battle,move)
|
def initialize(battle,move)
|
||||||
super
|
super
|
||||||
@statDown = [PBStats::SPEED,1]
|
@statDown = [:SPEED,1]
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
@@ -1101,7 +1099,7 @@ end
|
|||||||
class PokeBattle_Move_03F < PokeBattle_StatDownMove
|
class PokeBattle_Move_03F < PokeBattle_StatDownMove
|
||||||
def initialize(battle,move)
|
def initialize(battle,move)
|
||||||
super
|
super
|
||||||
@statDown = [PBStats::SPATK,2]
|
@statDown = [:SPECIAL_ATTACK,2]
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
@@ -1114,7 +1112,7 @@ class PokeBattle_Move_040 < PokeBattle_Move
|
|||||||
def pbMoveFailed?(user,targets)
|
def pbMoveFailed?(user,targets)
|
||||||
failed = true
|
failed = true
|
||||||
targets.each do |b|
|
targets.each do |b|
|
||||||
next if !b.pbCanRaiseStatStage?(PBStats::SPATK,user,self) &&
|
next if !b.pbCanRaiseStatStage?(:SPECIAL_ATTACK,user,self) &&
|
||||||
!b.pbCanConfuse?(user,false,self)
|
!b.pbCanConfuse?(user,false,self)
|
||||||
failed = false
|
failed = false
|
||||||
break
|
break
|
||||||
@@ -1127,8 +1125,8 @@ class PokeBattle_Move_040 < PokeBattle_Move
|
|||||||
end
|
end
|
||||||
|
|
||||||
def pbEffectAgainstTarget(user,target)
|
def pbEffectAgainstTarget(user,target)
|
||||||
if target.pbCanRaiseStatStage?(PBStats::SPATK,user,self)
|
if target.pbCanRaiseStatStage?(:SPECIAL_ATTACK,user,self)
|
||||||
target.pbRaiseStatStage(PBStats::SPATK,1,user)
|
target.pbRaiseStatStage(:SPECIAL_ATTACK,1,user)
|
||||||
end
|
end
|
||||||
target.pbConfuse if target.pbCanConfuse?(user,false,self)
|
target.pbConfuse if target.pbCanConfuse?(user,false,self)
|
||||||
end
|
end
|
||||||
@@ -1143,7 +1141,7 @@ class PokeBattle_Move_041 < PokeBattle_Move
|
|||||||
def pbMoveFailed?(user,targets)
|
def pbMoveFailed?(user,targets)
|
||||||
failed = true
|
failed = true
|
||||||
targets.each do |b|
|
targets.each do |b|
|
||||||
next if !b.pbCanRaiseStatStage?(PBStats::ATTACK,user,self) &&
|
next if !b.pbCanRaiseStatStage?(:ATTACK,user,self) &&
|
||||||
!b.pbCanConfuse?(user,false,self)
|
!b.pbCanConfuse?(user,false,self)
|
||||||
failed = false
|
failed = false
|
||||||
break
|
break
|
||||||
@@ -1156,8 +1154,8 @@ class PokeBattle_Move_041 < PokeBattle_Move
|
|||||||
end
|
end
|
||||||
|
|
||||||
def pbEffectAgainstTarget(user,target)
|
def pbEffectAgainstTarget(user,target)
|
||||||
if target.pbCanRaiseStatStage?(PBStats::ATTACK,user,self)
|
if target.pbCanRaiseStatStage?(:ATTACK,user,self)
|
||||||
target.pbRaiseStatStage(PBStats::ATTACK,2,user)
|
target.pbRaiseStatStage(:ATTACK,2,user)
|
||||||
end
|
end
|
||||||
target.pbConfuse if target.pbCanConfuse?(user,false,self)
|
target.pbConfuse if target.pbCanConfuse?(user,false,self)
|
||||||
end
|
end
|
||||||
@@ -1171,7 +1169,7 @@ end
|
|||||||
class PokeBattle_Move_042 < PokeBattle_TargetStatDownMove
|
class PokeBattle_Move_042 < PokeBattle_TargetStatDownMove
|
||||||
def initialize(battle,move)
|
def initialize(battle,move)
|
||||||
super
|
super
|
||||||
@statDown = [PBStats::ATTACK,1]
|
@statDown = [:ATTACK,1]
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
@@ -1182,7 +1180,7 @@ end
|
|||||||
class PokeBattle_Move_043 < PokeBattle_TargetStatDownMove
|
class PokeBattle_Move_043 < PokeBattle_TargetStatDownMove
|
||||||
def initialize(battle,move)
|
def initialize(battle,move)
|
||||||
super
|
super
|
||||||
@statDown = [PBStats::DEFENSE,1]
|
@statDown = [:DEFENSE,1]
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
@@ -1194,7 +1192,7 @@ end
|
|||||||
class PokeBattle_Move_044 < PokeBattle_TargetStatDownMove
|
class PokeBattle_Move_044 < PokeBattle_TargetStatDownMove
|
||||||
def initialize(battle,move)
|
def initialize(battle,move)
|
||||||
super
|
super
|
||||||
@statDown = [PBStats::SPEED,1]
|
@statDown = [:SPEED,1]
|
||||||
end
|
end
|
||||||
|
|
||||||
def pbBaseDamage(baseDmg,user,target)
|
def pbBaseDamage(baseDmg,user,target)
|
||||||
@@ -1213,7 +1211,7 @@ end
|
|||||||
class PokeBattle_Move_045 < PokeBattle_TargetStatDownMove
|
class PokeBattle_Move_045 < PokeBattle_TargetStatDownMove
|
||||||
def initialize(battle,move)
|
def initialize(battle,move)
|
||||||
super
|
super
|
||||||
@statDown = [PBStats::SPATK,1]
|
@statDown = [:SPECIAL_ATTACK,1]
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
@@ -1225,7 +1223,7 @@ end
|
|||||||
class PokeBattle_Move_046 < PokeBattle_TargetStatDownMove
|
class PokeBattle_Move_046 < PokeBattle_TargetStatDownMove
|
||||||
def initialize(battle,move)
|
def initialize(battle,move)
|
||||||
super
|
super
|
||||||
@statDown = [PBStats::SPDEF,1]
|
@statDown = [:SPECIAL_DEFENSE,1]
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
@@ -1237,7 +1235,7 @@ end
|
|||||||
class PokeBattle_Move_047 < PokeBattle_TargetStatDownMove
|
class PokeBattle_Move_047 < PokeBattle_TargetStatDownMove
|
||||||
def initialize(battle,move)
|
def initialize(battle,move)
|
||||||
super
|
super
|
||||||
@statDown = [PBStats::ACCURACY,1]
|
@statDown = [:ACCURACY,1]
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
@@ -1249,7 +1247,7 @@ end
|
|||||||
class PokeBattle_Move_048 < PokeBattle_TargetStatDownMove
|
class PokeBattle_Move_048 < PokeBattle_TargetStatDownMove
|
||||||
def initialize(battle,move)
|
def initialize(battle,move)
|
||||||
super
|
super
|
||||||
@statDown = [PBStats::EVASION, (Settings::MECHANICS_GENERATION >= 6) ? 2 : 1]
|
@statDown = [:EVASION, (Settings::MECHANICS_GENERATION >= 6) ? 2 : 1]
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
@@ -1264,7 +1262,7 @@ class PokeBattle_Move_049 < PokeBattle_TargetStatDownMove
|
|||||||
|
|
||||||
def initialize(battle,move)
|
def initialize(battle,move)
|
||||||
super
|
super
|
||||||
@statDown = [PBStats::EVASION,1]
|
@statDown = [:EVASION,1]
|
||||||
end
|
end
|
||||||
|
|
||||||
def pbFailsAgainstTarget?(user,target)
|
def pbFailsAgainstTarget?(user,target)
|
||||||
@@ -1364,7 +1362,7 @@ end
|
|||||||
class PokeBattle_Move_04A < PokeBattle_TargetMultiStatDownMove
|
class PokeBattle_Move_04A < PokeBattle_TargetMultiStatDownMove
|
||||||
def initialize(battle,move)
|
def initialize(battle,move)
|
||||||
super
|
super
|
||||||
@statDown = [PBStats::ATTACK,1,PBStats::DEFENSE,1]
|
@statDown = [:ATTACK,1,:DEFENSE,1]
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
@@ -1376,7 +1374,7 @@ end
|
|||||||
class PokeBattle_Move_04B < PokeBattle_TargetStatDownMove
|
class PokeBattle_Move_04B < PokeBattle_TargetStatDownMove
|
||||||
def initialize(battle,move)
|
def initialize(battle,move)
|
||||||
super
|
super
|
||||||
@statDown = [PBStats::ATTACK,2]
|
@statDown = [:ATTACK,2]
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
@@ -1388,7 +1386,7 @@ end
|
|||||||
class PokeBattle_Move_04C < PokeBattle_TargetStatDownMove
|
class PokeBattle_Move_04C < PokeBattle_TargetStatDownMove
|
||||||
def initialize(battle,move)
|
def initialize(battle,move)
|
||||||
super
|
super
|
||||||
@statDown = [PBStats::DEFENSE,2]
|
@statDown = [:DEFENSE,2]
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
@@ -1402,7 +1400,7 @@ class PokeBattle_Move_04D < PokeBattle_TargetStatDownMove
|
|||||||
super
|
super
|
||||||
inc = 2
|
inc = 2
|
||||||
inc = 1 if @id == :STRINGSHOT && Settings::MECHANICS_GENERATION <= 5
|
inc = 1 if @id == :STRINGSHOT && Settings::MECHANICS_GENERATION <= 5
|
||||||
@statDown = [PBStats::SPEED,inc]
|
@statDown = [:SPEED,inc]
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
@@ -1415,7 +1413,7 @@ end
|
|||||||
class PokeBattle_Move_04E < PokeBattle_TargetStatDownMove
|
class PokeBattle_Move_04E < PokeBattle_TargetStatDownMove
|
||||||
def initialize(battle,move)
|
def initialize(battle,move)
|
||||||
super
|
super
|
||||||
@statDown = [PBStats::SPATK,2]
|
@statDown = [:SPECIAL_ATTACK,2]
|
||||||
end
|
end
|
||||||
|
|
||||||
def pbFailsAgainstTarget?(user,target)
|
def pbFailsAgainstTarget?(user,target)
|
||||||
@@ -1453,7 +1451,7 @@ end
|
|||||||
class PokeBattle_Move_04F < PokeBattle_TargetStatDownMove
|
class PokeBattle_Move_04F < PokeBattle_TargetStatDownMove
|
||||||
def initialize(battle,move)
|
def initialize(battle,move)
|
||||||
super
|
super
|
||||||
@statDown = [PBStats::SPDEF,2]
|
@statDown = [:SPECIAL_DEFENSE,2]
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
@@ -1506,7 +1504,7 @@ class PokeBattle_Move_052 < PokeBattle_Move
|
|||||||
def ignoresSubstitute?(user); return true; end
|
def ignoresSubstitute?(user); return true; end
|
||||||
|
|
||||||
def pbEffectAgainstTarget(user,target)
|
def pbEffectAgainstTarget(user,target)
|
||||||
[PBStats::ATTACK,PBStats::SPATK].each do |s|
|
[:ATTACK,:SPECIAL_ATTACK].each do |s|
|
||||||
user.stages[s],target.stages[s] = target.stages[s],user.stages[s]
|
user.stages[s],target.stages[s] = target.stages[s],user.stages[s]
|
||||||
end
|
end
|
||||||
@battle.pbDisplay(_INTL("{1} switched all changes to its Attack and Sp. Atk with the target!",user.pbThis))
|
@battle.pbDisplay(_INTL("{1} switched all changes to its Attack and Sp. Atk with the target!",user.pbThis))
|
||||||
@@ -1522,7 +1520,7 @@ class PokeBattle_Move_053 < PokeBattle_Move
|
|||||||
def ignoresSubstitute?(user); return true; end
|
def ignoresSubstitute?(user); return true; end
|
||||||
|
|
||||||
def pbEffectAgainstTarget(user,target)
|
def pbEffectAgainstTarget(user,target)
|
||||||
[PBStats::DEFENSE,PBStats::SPDEF].each do |s|
|
[:DEFENSE,:SPECIAL_DEFENSE].each do |s|
|
||||||
user.stages[s],target.stages[s] = target.stages[s],user.stages[s]
|
user.stages[s],target.stages[s] = target.stages[s],user.stages[s]
|
||||||
end
|
end
|
||||||
@battle.pbDisplay(_INTL("{1} switched all changes to its Defense and Sp. Def with the target!",user.pbThis))
|
@battle.pbDisplay(_INTL("{1} switched all changes to its Defense and Sp. Def with the target!",user.pbThis))
|
||||||
@@ -1538,8 +1536,8 @@ class PokeBattle_Move_054 < PokeBattle_Move
|
|||||||
def ignoresSubstitute?(user); return true; end
|
def ignoresSubstitute?(user); return true; end
|
||||||
|
|
||||||
def pbEffectAgainstTarget(user,target)
|
def pbEffectAgainstTarget(user,target)
|
||||||
PBStats.eachBattleStat do |s|
|
GameData::Stat.each_battle do |s|
|
||||||
user.stages[s],target.stages[s] = target.stages[s],user.stages[s]
|
user.stages[s.id],target.stages[s.id] = target.stages[s.id],user.stages[s.id]
|
||||||
end
|
end
|
||||||
@battle.pbDisplay(_INTL("{1} switched stat changes with the target!",user.pbThis))
|
@battle.pbDisplay(_INTL("{1} switched stat changes with the target!",user.pbThis))
|
||||||
end
|
end
|
||||||
@@ -1554,7 +1552,7 @@ class PokeBattle_Move_055 < PokeBattle_Move
|
|||||||
def ignoresSubstitute?(user); return true; end
|
def ignoresSubstitute?(user); return true; end
|
||||||
|
|
||||||
def pbEffectAgainstTarget(user,target)
|
def pbEffectAgainstTarget(user,target)
|
||||||
PBStats.eachBattleStat { |s| user.stages[s] = target.stages[s] }
|
GameData::Stat.each_battle { |s| user.stages[s.id] = target.stages[s.id] }
|
||||||
if Settings::NEW_CRITICAL_HIT_RATE_MECHANICS
|
if Settings::NEW_CRITICAL_HIT_RATE_MECHANICS
|
||||||
user.effects[PBEffects::FocusEnergy] = target.effects[PBEffects::FocusEnergy]
|
user.effects[PBEffects::FocusEnergy] = target.effects[PBEffects::FocusEnergy]
|
||||||
user.effects[PBEffects::LaserFocus] = target.effects[PBEffects::LaserFocus]
|
user.effects[PBEffects::LaserFocus] = target.effects[PBEffects::LaserFocus]
|
||||||
|
|||||||
@@ -217,8 +217,8 @@ end
|
|||||||
class PokeBattle_Move_08E < PokeBattle_Move
|
class PokeBattle_Move_08E < PokeBattle_Move
|
||||||
def pbBaseDamage(baseDmg,user,target)
|
def pbBaseDamage(baseDmg,user,target)
|
||||||
mult = 1
|
mult = 1
|
||||||
PBStats.eachBattleStat { |s| mult += user.stages[s] if user.stages[s]>0 }
|
GameData::Stat.each_battle { |s| mult += user.stages[s.id] if user.stages[s.id] > 0 }
|
||||||
return 20*mult
|
return 20 * mult
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
@@ -231,8 +231,8 @@ end
|
|||||||
class PokeBattle_Move_08F < PokeBattle_Move
|
class PokeBattle_Move_08F < PokeBattle_Move
|
||||||
def pbBaseDamage(baseDmg,user,target)
|
def pbBaseDamage(baseDmg,user,target)
|
||||||
mult = 3
|
mult = 3
|
||||||
PBStats.eachBattleStat { |s| mult += target.stages[s] if target.stages[s]>0 }
|
GameData::Stat.each_battle { |s| mult += target.stages[s.id] if target.stages[s.id] > 0 }
|
||||||
return [20*mult,200].min
|
return [20 * mult, 200].min
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
@@ -264,23 +264,23 @@ def pbHiddenPower(pkmn)
|
|||||||
types = []
|
types = []
|
||||||
GameData::Type.each { |t| types.push(t.id) if !t.pseudo_type && ![:NORMAL, :SHADOW].include?(t.id)}
|
GameData::Type.each { |t| types.push(t.id) if !t.pseudo_type && ![:NORMAL, :SHADOW].include?(t.id)}
|
||||||
types.sort! { |a, b| GameData::Type.get(a).id_number <=> GameData::Type.get(b).id_number }
|
types.sort! { |a, b| GameData::Type.get(a).id_number <=> GameData::Type.get(b).id_number }
|
||||||
idxType |= (iv[PBStats::HP]&1)
|
idxType |= (iv[:HP]&1)
|
||||||
idxType |= (iv[PBStats::ATTACK]&1)<<1
|
idxType |= (iv[:ATTACK]&1)<<1
|
||||||
idxType |= (iv[PBStats::DEFENSE]&1)<<2
|
idxType |= (iv[:DEFENSE]&1)<<2
|
||||||
idxType |= (iv[PBStats::SPEED]&1)<<3
|
idxType |= (iv[:SPEED]&1)<<3
|
||||||
idxType |= (iv[PBStats::SPATK]&1)<<4
|
idxType |= (iv[:SPECIAL_ATTACK]&1)<<4
|
||||||
idxType |= (iv[PBStats::SPDEF]&1)<<5
|
idxType |= (iv[:SPECIAL_DEFENSE]&1)<<5
|
||||||
idxType = (types.length-1)*idxType/63
|
idxType = (types.length-1)*idxType/63
|
||||||
type = types[idxType]
|
type = types[idxType]
|
||||||
if Settings::MECHANICS_GENERATION <= 5
|
if Settings::MECHANICS_GENERATION <= 5
|
||||||
powerMin = 30
|
powerMin = 30
|
||||||
powerMax = 70
|
powerMax = 70
|
||||||
power |= (iv[PBStats::HP]&2)>>1
|
power |= (iv[:HP]&2)>>1
|
||||||
power |= (iv[PBStats::ATTACK]&2)
|
power |= (iv[:ATTACK]&2)
|
||||||
power |= (iv[PBStats::DEFENSE]&2)<<1
|
power |= (iv[:DEFENSE]&2)<<1
|
||||||
power |= (iv[PBStats::SPEED]&2)<<2
|
power |= (iv[:SPEED]&2)<<2
|
||||||
power |= (iv[PBStats::SPATK]&2)<<3
|
power |= (iv[:SPECIAL_ATTACK]&2)<<3
|
||||||
power |= (iv[PBStats::SPDEF]&2)<<4
|
power |= (iv[:SPECIAL_DEFENSE]&2)<<4
|
||||||
power = powerMin+(powerMax-powerMin)*power/63
|
power = powerMin+(powerMax-powerMin)*power/63
|
||||||
end
|
end
|
||||||
return [type,power]
|
return [type,power]
|
||||||
@@ -925,24 +925,24 @@ class PokeBattle_Move_0A4 < PokeBattle_Move
|
|||||||
when 9
|
when 9
|
||||||
target.pbFreeze if target.pbCanFreeze?(user,false,self)
|
target.pbFreeze if target.pbCanFreeze?(user,false,self)
|
||||||
when 5
|
when 5
|
||||||
if target.pbCanLowerStatStage?(PBStats::ATTACK,user,self)
|
if target.pbCanLowerStatStage?(:ATTACK,user,self)
|
||||||
target.pbLowerStatStage(PBStats::ATTACK,1,user)
|
target.pbLowerStatStage(:ATTACK,1,user)
|
||||||
end
|
end
|
||||||
when 14
|
when 14
|
||||||
if target.pbCanLowerStatStage?(PBStats::DEFENSE,user,self)
|
if target.pbCanLowerStatStage?(:DEFENSE,user,self)
|
||||||
target.pbLowerStatStage(PBStats::DEFENSE,1,user)
|
target.pbLowerStatStage(:DEFENSE,1,user)
|
||||||
end
|
end
|
||||||
when 3
|
when 3
|
||||||
if target.pbCanLowerStatStage?(PBStats::SPATK,user,self)
|
if target.pbCanLowerStatStage?(:SPECIAL_ATTACK,user,self)
|
||||||
target.pbLowerStatStage(PBStats::SPATK,1,user)
|
target.pbLowerStatStage(:SPECIAL_ATTACK,1,user)
|
||||||
end
|
end
|
||||||
when 4, 6, 12
|
when 4, 6, 12
|
||||||
if target.pbCanLowerStatStage?(PBStats::SPEED,user,self)
|
if target.pbCanLowerStatStage?(:SPEED,user,self)
|
||||||
target.pbLowerStatStage(PBStats::SPEED,1,user)
|
target.pbLowerStatStage(:SPEED,1,user)
|
||||||
end
|
end
|
||||||
when 8
|
when 8
|
||||||
if target.pbCanLowerStatStage?(PBStats::ACCURACY,user,self)
|
if target.pbCanLowerStatStage?(:ACCURACY,user,self)
|
||||||
target.pbLowerStatStage(PBStats::ACCURACY,1,user)
|
target.pbLowerStatStage(:ACCURACY,1,user)
|
||||||
end
|
end
|
||||||
when 7, 11, 13
|
when 7, 11, 13
|
||||||
target.pbFlinch(user)
|
target.pbFlinch(user)
|
||||||
@@ -1997,7 +1997,7 @@ class PokeBattle_Move_0C1 < PokeBattle_Move
|
|||||||
|
|
||||||
def pbBaseDamage(baseDmg,user,target)
|
def pbBaseDamage(baseDmg,user,target)
|
||||||
i = @beatUpList.shift # First element in array, and removes it from array
|
i = @beatUpList.shift # First element in array, and removes it from array
|
||||||
atk = @battle.pbParty(user.index)[i].baseStats[PBStats::ATTACK]
|
atk = @battle.pbParty(user.index)[i].baseStats[:ATTACK]
|
||||||
return 5+(atk/10)
|
return 5+(atk/10)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
@@ -2120,8 +2120,8 @@ class PokeBattle_Move_0C8 < PokeBattle_TwoTurnMove
|
|||||||
end
|
end
|
||||||
|
|
||||||
def pbChargingTurnEffect(user,target)
|
def pbChargingTurnEffect(user,target)
|
||||||
if user.pbCanRaiseStatStage?(PBStats::DEFENSE,user,self)
|
if user.pbCanRaiseStatStage?(:DEFENSE,user,self)
|
||||||
user.pbRaiseStatStage(PBStats::DEFENSE,1,user)
|
user.pbRaiseStatStage(:DEFENSE,1,user)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
@@ -2778,7 +2778,7 @@ end
|
|||||||
class PokeBattle_Move_0E2 < PokeBattle_TargetMultiStatDownMove
|
class PokeBattle_Move_0E2 < PokeBattle_TargetMultiStatDownMove
|
||||||
def initialize(battle,move)
|
def initialize(battle,move)
|
||||||
super
|
super
|
||||||
@statDown = [PBStats::ATTACK,2,PBStats::SPATK,2]
|
@statDown = [:ATTACK,2,:SPECIAL_ATTACK,2]
|
||||||
end
|
end
|
||||||
|
|
||||||
# NOTE: The user faints even if the target's stats cannot be changed, so this
|
# NOTE: The user faints even if the target's stats cannot be changed, so this
|
||||||
|
|||||||
@@ -267,9 +267,9 @@ class PokeBattle_Move_10D < PokeBattle_Move
|
|||||||
|
|
||||||
def pbMoveFailed?(user,targets)
|
def pbMoveFailed?(user,targets)
|
||||||
return false if user.pbHasType?(:GHOST)
|
return false if user.pbHasType?(:GHOST)
|
||||||
if !user.pbCanLowerStatStage?(PBStats::SPEED,user,self) &&
|
if !user.pbCanLowerStatStage?(:SPEED,user,self) &&
|
||||||
!user.pbCanRaiseStatStage?(PBStats::ATTACK,user,self) &&
|
!user.pbCanRaiseStatStage?(:ATTACK,user,self) &&
|
||||||
!user.pbCanRaiseStatStage?(PBStats::DEFENSE,user,self)
|
!user.pbCanRaiseStatStage?(:DEFENSE,user,self)
|
||||||
@battle.pbDisplay(_INTL("But it failed!"))
|
@battle.pbDisplay(_INTL("But it failed!"))
|
||||||
return true
|
return true
|
||||||
end
|
end
|
||||||
@@ -287,17 +287,17 @@ class PokeBattle_Move_10D < PokeBattle_Move
|
|||||||
def pbEffectGeneral(user)
|
def pbEffectGeneral(user)
|
||||||
return if user.pbHasType?(:GHOST)
|
return if user.pbHasType?(:GHOST)
|
||||||
# Non-Ghost effect
|
# Non-Ghost effect
|
||||||
if user.pbCanLowerStatStage?(PBStats::SPEED,user,self)
|
if user.pbCanLowerStatStage?(:SPEED,user,self)
|
||||||
user.pbLowerStatStage(PBStats::SPEED,1,user)
|
user.pbLowerStatStage(:SPEED,1,user)
|
||||||
end
|
end
|
||||||
showAnim = true
|
showAnim = true
|
||||||
if user.pbCanRaiseStatStage?(PBStats::ATTACK,user,self)
|
if user.pbCanRaiseStatStage?(:ATTACK,user,self)
|
||||||
if user.pbRaiseStatStage(PBStats::ATTACK,1,user,showAnim)
|
if user.pbRaiseStatStage(:ATTACK,1,user,showAnim)
|
||||||
showAnim = false
|
showAnim = false
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
if user.pbCanRaiseStatStage?(PBStats::DEFENSE,user,self)
|
if user.pbCanRaiseStatStage?(:DEFENSE,user,self)
|
||||||
user.pbRaiseStatStage(PBStats::DEFENSE,1,user,showAnim)
|
user.pbRaiseStatStage(:DEFENSE,1,user,showAnim)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
@@ -482,14 +482,14 @@ class PokeBattle_Move_112 < PokeBattle_Move
|
|||||||
@battle.pbDisplay(_INTL("{1} stockpiled {2}!",
|
@battle.pbDisplay(_INTL("{1} stockpiled {2}!",
|
||||||
user.pbThis,user.effects[PBEffects::Stockpile]))
|
user.pbThis,user.effects[PBEffects::Stockpile]))
|
||||||
showAnim = true
|
showAnim = true
|
||||||
if user.pbCanRaiseStatStage?(PBStats::DEFENSE,user,self)
|
if user.pbCanRaiseStatStage?(:DEFENSE,user,self)
|
||||||
if user.pbRaiseStatStage(PBStats::DEFENSE,1,user,showAnim)
|
if user.pbRaiseStatStage(:DEFENSE,1,user,showAnim)
|
||||||
user.effects[PBEffects::StockpileDef] += 1
|
user.effects[PBEffects::StockpileDef] += 1
|
||||||
showAnim = false
|
showAnim = false
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
if user.pbCanRaiseStatStage?(PBStats::SPDEF,user,self)
|
if user.pbCanRaiseStatStage?(:SPECIAL_DEFENSE,user,self)
|
||||||
if user.pbRaiseStatStage(PBStats::SPDEF,1,user,showAnim)
|
if user.pbRaiseStatStage(:SPECIAL_DEFENSE,1,user,showAnim)
|
||||||
user.effects[PBEffects::StockpileSpDef] += 1
|
user.effects[PBEffects::StockpileSpDef] += 1
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
@@ -522,14 +522,14 @@ class PokeBattle_Move_113 < PokeBattle_Move
|
|||||||
return if @battle.pbAllFainted?(target.idxOwnSide)
|
return if @battle.pbAllFainted?(target.idxOwnSide)
|
||||||
showAnim = true
|
showAnim = true
|
||||||
if user.effects[PBEffects::StockpileDef]>0 &&
|
if user.effects[PBEffects::StockpileDef]>0 &&
|
||||||
user.pbCanLowerStatStage?(PBStats::DEFENSE,user,self)
|
user.pbCanLowerStatStage?(:DEFENSE,user,self)
|
||||||
if user.pbLowerStatStage(PBStats::DEFENSE,user.effects[PBEffects::StockpileDef],user,showAnim)
|
if user.pbLowerStatStage(:DEFENSE,user.effects[PBEffects::StockpileDef],user,showAnim)
|
||||||
showAnim = false
|
showAnim = false
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
if user.effects[PBEffects::StockpileSpDef]>0 &&
|
if user.effects[PBEffects::StockpileSpDef]>0 &&
|
||||||
user.pbCanLowerStatStage?(PBStats::SPDEF,user,self)
|
user.pbCanLowerStatStage?(:SPECIAL_DEFENSE,user,self)
|
||||||
user.pbLowerStatStage(PBStats::SPDEF,user.effects[PBEffects::StockpileSpDef],user,showAnim)
|
user.pbLowerStatStage(:SPECIAL_DEFENSE,user.effects[PBEffects::StockpileSpDef],user,showAnim)
|
||||||
end
|
end
|
||||||
user.effects[PBEffects::Stockpile] = 0
|
user.effects[PBEffects::Stockpile] = 0
|
||||||
user.effects[PBEffects::StockpileDef] = 0
|
user.effects[PBEffects::StockpileDef] = 0
|
||||||
@@ -573,14 +573,14 @@ class PokeBattle_Move_114 < PokeBattle_Move
|
|||||||
@battle.pbDisplay(_INTL("{1}'s stockpiled effect wore off!",user.pbThis))
|
@battle.pbDisplay(_INTL("{1}'s stockpiled effect wore off!",user.pbThis))
|
||||||
showAnim = true
|
showAnim = true
|
||||||
if user.effects[PBEffects::StockpileDef]>0 &&
|
if user.effects[PBEffects::StockpileDef]>0 &&
|
||||||
user.pbCanLowerStatStage?(PBStats::DEFENSE,user,self)
|
user.pbCanLowerStatStage?(:DEFENSE,user,self)
|
||||||
if user.pbLowerStatStage(PBStats::DEFENSE,user.effects[PBEffects::StockpileDef],user,showAnim)
|
if user.pbLowerStatStage(:DEFENSE,user.effects[PBEffects::StockpileDef],user,showAnim)
|
||||||
showAnim = false
|
showAnim = false
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
if user.effects[PBEffects::StockpileSpDef]>0 &&
|
if user.effects[PBEffects::StockpileSpDef]>0 &&
|
||||||
user.pbCanLowerStatStage?(PBStats::SPDEF,user,self)
|
user.pbCanLowerStatStage?(:SPECIAL_DEFENSE,user,self)
|
||||||
user.pbLowerStatStage(PBStats::SPDEF,user.effects[PBEffects::StockpileSpDef],user,showAnim)
|
user.pbLowerStatStage(:SPECIAL_DEFENSE,user.effects[PBEffects::StockpileSpDef],user,showAnim)
|
||||||
end
|
end
|
||||||
user.effects[PBEffects::Stockpile] = 0
|
user.effects[PBEffects::Stockpile] = 0
|
||||||
user.effects[PBEffects::StockpileDef] = 0
|
user.effects[PBEffects::StockpileDef] = 0
|
||||||
@@ -929,9 +929,9 @@ end
|
|||||||
class PokeBattle_Move_121 < PokeBattle_Move
|
class PokeBattle_Move_121 < PokeBattle_Move
|
||||||
def pbGetAttackStats(user,target)
|
def pbGetAttackStats(user,target)
|
||||||
if specialMove?
|
if specialMove?
|
||||||
return target.spatk, target.stages[PBStats::SPATK]+6
|
return target.spatk, target.stages[:SPECIAL_ATTACK]+6
|
||||||
end
|
end
|
||||||
return target.attack, target.stages[PBStats::ATTACK]+6
|
return target.attack, target.stages[:ATTACK]+6
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
@@ -943,7 +943,7 @@ end
|
|||||||
#===============================================================================
|
#===============================================================================
|
||||||
class PokeBattle_Move_122 < PokeBattle_Move
|
class PokeBattle_Move_122 < PokeBattle_Move
|
||||||
def pbGetDefenseStats(user,target)
|
def pbGetDefenseStats(user,target)
|
||||||
return target.defense, target.stages[PBStats::DEFENSE]+6
|
return target.defense, target.stages[:DEFENSE]+6
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
@@ -1100,8 +1100,8 @@ class PokeBattle_Move_137 < PokeBattle_Move
|
|||||||
@validTargets = []
|
@validTargets = []
|
||||||
@battle.eachSameSideBattler(user) do |b|
|
@battle.eachSameSideBattler(user) do |b|
|
||||||
next if !b.hasActiveAbility?([:MINUS,:PLUS])
|
next if !b.hasActiveAbility?([:MINUS,:PLUS])
|
||||||
next if !b.pbCanRaiseStatStage?(PBStats::DEFENSE,user,self) &&
|
next if !b.pbCanRaiseStatStage?(:DEFENSE,user,self) &&
|
||||||
!b.pbCanRaiseStatStage?(PBStats::SPDEF,user,self)
|
!b.pbCanRaiseStatStage?(:SPECIAL_DEFENSE,user,self)
|
||||||
@validTargets.push(b)
|
@validTargets.push(b)
|
||||||
end
|
end
|
||||||
if @validTargets.length==0
|
if @validTargets.length==0
|
||||||
@@ -1121,13 +1121,13 @@ class PokeBattle_Move_137 < PokeBattle_Move
|
|||||||
|
|
||||||
def pbEffectAgainstTarget(user,target)
|
def pbEffectAgainstTarget(user,target)
|
||||||
showAnim = true
|
showAnim = true
|
||||||
if target.pbCanRaiseStatStage?(PBStats::DEFENSE,user,self)
|
if target.pbCanRaiseStatStage?(:DEFENSE,user,self)
|
||||||
if target.pbRaiseStatStage(PBStats::DEFENSE,1,user,showAnim)
|
if target.pbRaiseStatStage(:DEFENSE,1,user,showAnim)
|
||||||
showAnim = false
|
showAnim = false
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
if target.pbCanRaiseStatStage?(PBStats::SPDEF,user,self)
|
if target.pbCanRaiseStatStage?(:SPECIAL_DEFENSE,user,self)
|
||||||
target.pbRaiseStatStage(PBStats::SPDEF,1,user,showAnim)
|
target.pbRaiseStatStage(:SPECIAL_DEFENSE,1,user,showAnim)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
@@ -1146,12 +1146,12 @@ class PokeBattle_Move_138 < PokeBattle_Move
|
|||||||
def ignoresSubstitute?(user); return true; end
|
def ignoresSubstitute?(user); return true; end
|
||||||
|
|
||||||
def pbFailsAgainstTarget?(user,target)
|
def pbFailsAgainstTarget?(user,target)
|
||||||
return true if !target.pbCanRaiseStatStage?(PBStats::SPDEF,user,self,true)
|
return true if !target.pbCanRaiseStatStage?(:SPECIAL_DEFENSE,user,self,true)
|
||||||
return false
|
return false
|
||||||
end
|
end
|
||||||
|
|
||||||
def pbEffectAgainstTarget(user,target)
|
def pbEffectAgainstTarget(user,target)
|
||||||
target.pbRaiseStatStage(PBStats::SPDEF,1,user)
|
target.pbRaiseStatStage(:SPECIAL_DEFENSE,1,user)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
@@ -1165,7 +1165,7 @@ class PokeBattle_Move_139 < PokeBattle_TargetStatDownMove
|
|||||||
|
|
||||||
def initialize(battle,move)
|
def initialize(battle,move)
|
||||||
super
|
super
|
||||||
@statDown = [PBStats::ATTACK,1]
|
@statDown = [:ATTACK,1]
|
||||||
end
|
end
|
||||||
|
|
||||||
def pbAccuracyCheck(user,target); return true; end
|
def pbAccuracyCheck(user,target); return true; end
|
||||||
@@ -1182,7 +1182,7 @@ class PokeBattle_Move_13A < PokeBattle_TargetMultiStatDownMove
|
|||||||
|
|
||||||
def initialize(battle,move)
|
def initialize(battle,move)
|
||||||
super
|
super
|
||||||
@statDown = [PBStats::ATTACK,1,PBStats::SPATK,1]
|
@statDown = [:ATTACK,1,:SPECIAL_ATTACK,1]
|
||||||
end
|
end
|
||||||
|
|
||||||
def pbAccuracyCheck(user,target); return true; end
|
def pbAccuracyCheck(user,target); return true; end
|
||||||
@@ -1199,7 +1199,7 @@ class PokeBattle_Move_13B < PokeBattle_StatDownMove
|
|||||||
|
|
||||||
def initialize(battle,move)
|
def initialize(battle,move)
|
||||||
super
|
super
|
||||||
@statDown = [PBStats::DEFENSE,1]
|
@statDown = [:DEFENSE,1]
|
||||||
end
|
end
|
||||||
|
|
||||||
def pbMoveFailed?(user,targets)
|
def pbMoveFailed?(user,targets)
|
||||||
@@ -1237,7 +1237,7 @@ class PokeBattle_Move_13C < PokeBattle_TargetStatDownMove
|
|||||||
|
|
||||||
def initialize(battle,move)
|
def initialize(battle,move)
|
||||||
super
|
super
|
||||||
@statDown = [PBStats::SPATK,1]
|
@statDown = [:SPECIAL_ATTACK,1]
|
||||||
end
|
end
|
||||||
|
|
||||||
def pbAccuracyCheck(user,target); return true; end
|
def pbAccuracyCheck(user,target); return true; end
|
||||||
@@ -1251,7 +1251,7 @@ end
|
|||||||
class PokeBattle_Move_13D < PokeBattle_TargetStatDownMove
|
class PokeBattle_Move_13D < PokeBattle_TargetStatDownMove
|
||||||
def initialize(battle,move)
|
def initialize(battle,move)
|
||||||
super
|
super
|
||||||
@statDown = [PBStats::SPATK,2]
|
@statDown = [:SPECIAL_ATTACK,2]
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
@@ -1267,8 +1267,8 @@ class PokeBattle_Move_13E < PokeBattle_Move
|
|||||||
@battle.eachBattler do |b|
|
@battle.eachBattler do |b|
|
||||||
next if !b.pbHasType?(:GRASS)
|
next if !b.pbHasType?(:GRASS)
|
||||||
next if b.airborne? || b.semiInvulnerable?
|
next if b.airborne? || b.semiInvulnerable?
|
||||||
next if !b.pbCanRaiseStatStage?(PBStats::ATTACK,user,self) &&
|
next if !b.pbCanRaiseStatStage?(:ATTACK,user,self) &&
|
||||||
!b.pbCanRaiseStatStage?(PBStats::SPATK,user,self)
|
!b.pbCanRaiseStatStage?(:SPECIAL_ATTACK,user,self)
|
||||||
@validTargets.push(b.index)
|
@validTargets.push(b.index)
|
||||||
end
|
end
|
||||||
if @validTargets.length==0
|
if @validTargets.length==0
|
||||||
@@ -1288,13 +1288,13 @@ class PokeBattle_Move_13E < PokeBattle_Move
|
|||||||
|
|
||||||
def pbEffectAgainstTarget(user,target)
|
def pbEffectAgainstTarget(user,target)
|
||||||
showAnim = true
|
showAnim = true
|
||||||
if target.pbCanRaiseStatStage?(PBStats::ATTACK,user,self)
|
if target.pbCanRaiseStatStage?(:ATTACK,user,self)
|
||||||
if target.pbRaiseStatStage(PBStats::ATTACK,1,user,showAnim)
|
if target.pbRaiseStatStage(:ATTACK,1,user,showAnim)
|
||||||
showAnim = false
|
showAnim = false
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
if target.pbCanRaiseStatStage?(PBStats::SPATK,user,self)
|
if target.pbCanRaiseStatStage?(:SPECIAL_ATTACK,user,self)
|
||||||
target.pbRaiseStatStage(PBStats::SPATK,1,user,showAnim)
|
target.pbRaiseStatStage(:SPECIAL_ATTACK,1,user,showAnim)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
@@ -1311,7 +1311,7 @@ class PokeBattle_Move_13F < PokeBattle_Move
|
|||||||
@battle.eachBattler do |b|
|
@battle.eachBattler do |b|
|
||||||
next if !b.pbHasType?(:GRASS)
|
next if !b.pbHasType?(:GRASS)
|
||||||
next if b.semiInvulnerable?
|
next if b.semiInvulnerable?
|
||||||
next if !b.pbCanRaiseStatStage?(PBStats::DEFENSE,user,self)
|
next if !b.pbCanRaiseStatStage?(:DEFENSE,user,self)
|
||||||
@validTargets.push(b.index)
|
@validTargets.push(b.index)
|
||||||
end
|
end
|
||||||
if @validTargets.length==0
|
if @validTargets.length==0
|
||||||
@@ -1324,11 +1324,11 @@ class PokeBattle_Move_13F < PokeBattle_Move
|
|||||||
def pbFailsAgainstTarget?(user,target)
|
def pbFailsAgainstTarget?(user,target)
|
||||||
return false if @validTargets.include?(target.index)
|
return false if @validTargets.include?(target.index)
|
||||||
return true if !target.pbHasType?(:GRASS) || target.semiInvulnerable?
|
return true if !target.pbHasType?(:GRASS) || target.semiInvulnerable?
|
||||||
return !target.pbCanRaiseStatStage?(PBStats::DEFENSE,user,self,true)
|
return !target.pbCanRaiseStatStage?(:DEFENSE,user,self,true)
|
||||||
end
|
end
|
||||||
|
|
||||||
def pbEffectAgainstTarget(user,target)
|
def pbEffectAgainstTarget(user,target)
|
||||||
target.pbRaiseStatStage(PBStats::DEFENSE,1,user)
|
target.pbRaiseStatStage(:DEFENSE,1,user)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
@@ -1344,9 +1344,9 @@ class PokeBattle_Move_140 < PokeBattle_Move
|
|||||||
targets.each do |b|
|
targets.each do |b|
|
||||||
next if !b || b.fainted?
|
next if !b || b.fainted?
|
||||||
next if !b.poisoned?
|
next if !b.poisoned?
|
||||||
next if !b.pbCanLowerStatStage?(PBStats::ATTACK,user,self) &&
|
next if !b.pbCanLowerStatStage?(:ATTACK,user,self) &&
|
||||||
!b.pbCanLowerStatStage?(PBStats::SPATK,user,self) &&
|
!b.pbCanLowerStatStage?(:SPECIAL_ATTACK,user,self) &&
|
||||||
!b.pbCanLowerStatStage?(PBStats::SPEED,user,self)
|
!b.pbCanLowerStatStage?(:SPEED,user,self)
|
||||||
@validTargets.push(b.index)
|
@validTargets.push(b.index)
|
||||||
end
|
end
|
||||||
if @validTargets.length==0
|
if @validTargets.length==0
|
||||||
@@ -1359,7 +1359,7 @@ class PokeBattle_Move_140 < PokeBattle_Move
|
|||||||
def pbEffectAgainstTarget(user,target)
|
def pbEffectAgainstTarget(user,target)
|
||||||
return if !@validTargets.include?(target.index)
|
return if !@validTargets.include?(target.index)
|
||||||
showAnim = true
|
showAnim = true
|
||||||
[PBStats::ATTACK,PBStats::SPATK,PBStats::SPEED].each do |s|
|
[:ATTACK,:SPECIAL_ATTACK,:SPEED].each do |s|
|
||||||
next if !target.pbCanLowerStatStage?(s,user,self)
|
next if !target.pbCanLowerStatStage?(s,user,self)
|
||||||
if target.pbLowerStatStage(s,1,user,showAnim)
|
if target.pbLowerStatStage(s,1,user,showAnim)
|
||||||
showAnim = false
|
showAnim = false
|
||||||
@@ -1376,8 +1376,8 @@ end
|
|||||||
class PokeBattle_Move_141 < PokeBattle_Move
|
class PokeBattle_Move_141 < PokeBattle_Move
|
||||||
def pbFailsAgainstTarget?(user,target)
|
def pbFailsAgainstTarget?(user,target)
|
||||||
failed = true
|
failed = true
|
||||||
PBStats.eachBattleStat do |s|
|
GameData::Stat.each_battle do |s|
|
||||||
next if target.stages[s]==0
|
next if target.stages[s.id] == 0
|
||||||
failed = false
|
failed = false
|
||||||
break
|
break
|
||||||
end
|
end
|
||||||
@@ -1389,7 +1389,7 @@ class PokeBattle_Move_141 < PokeBattle_Move
|
|||||||
end
|
end
|
||||||
|
|
||||||
def pbEffectAgainstTarget(user,target)
|
def pbEffectAgainstTarget(user,target)
|
||||||
PBStats.eachBattleStat { |s| target.stages[s] *= -1 }
|
GameData::Stat.each_battle { |s| target.stages[s.id] *= -1 }
|
||||||
@battle.pbDisplay(_INTL("{1}'s stats were reversed!",target.pbThis))
|
@battle.pbDisplay(_INTL("{1}'s stats were reversed!",target.pbThis))
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
@@ -1636,9 +1636,9 @@ end
|
|||||||
class PokeBattle_Move_14E < PokeBattle_TwoTurnMove
|
class PokeBattle_Move_14E < PokeBattle_TwoTurnMove
|
||||||
def pbMoveFailed?(user,targets)
|
def pbMoveFailed?(user,targets)
|
||||||
return false if user.effects[PBEffects::TwoTurnAttack] # Charging turn
|
return false if user.effects[PBEffects::TwoTurnAttack] # Charging turn
|
||||||
if !user.pbCanRaiseStatStage?(PBStats::SPATK,user,self) &&
|
if !user.pbCanRaiseStatStage?(:SPECIAL_ATTACK,user,self) &&
|
||||||
!user.pbCanRaiseStatStage?(PBStats::SPDEF,user,self) &&
|
!user.pbCanRaiseStatStage?(:SPECIAL_DEFENSE,user,self) &&
|
||||||
!user.pbCanRaiseStatStage?(PBStats::SPEED,user,self)
|
!user.pbCanRaiseStatStage?(:SPEED,user,self)
|
||||||
@battle.pbDisplay(_INTL("{1}'s stats won't go any higher!",user.pbThis))
|
@battle.pbDisplay(_INTL("{1}'s stats won't go any higher!",user.pbThis))
|
||||||
return true
|
return true
|
||||||
end
|
end
|
||||||
@@ -1651,7 +1651,7 @@ class PokeBattle_Move_14E < PokeBattle_TwoTurnMove
|
|||||||
|
|
||||||
def pbAttackingTurnEffect(user,target)
|
def pbAttackingTurnEffect(user,target)
|
||||||
showAnim = true
|
showAnim = true
|
||||||
[PBStats::SPATK,PBStats::SPDEF,PBStats::SPEED].each do |s|
|
[:SPECIAL_ATTACK,:SPECIAL_DEFENSE,:SPEED].each do |s|
|
||||||
next if !user.pbCanRaiseStatStage?(s,user,self)
|
next if !user.pbCanRaiseStatStage?(s,user,self)
|
||||||
if user.pbRaiseStatStage(s,2,user,showAnim)
|
if user.pbRaiseStatStage(s,2,user,showAnim)
|
||||||
showAnim = false
|
showAnim = false
|
||||||
@@ -1684,8 +1684,8 @@ end
|
|||||||
class PokeBattle_Move_150 < PokeBattle_Move
|
class PokeBattle_Move_150 < PokeBattle_Move
|
||||||
def pbEffectAfterAllHits(user,target)
|
def pbEffectAfterAllHits(user,target)
|
||||||
return if !target.damageState.fainted
|
return if !target.damageState.fainted
|
||||||
return if !user.pbCanRaiseStatStage?(PBStats::ATTACK,user,self)
|
return if !user.pbCanRaiseStatStage?(:ATTACK,user,self)
|
||||||
user.pbRaiseStatStage(PBStats::ATTACK,3,user)
|
user.pbRaiseStatStage(:ATTACK,3,user)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
@@ -1698,7 +1698,7 @@ end
|
|||||||
class PokeBattle_Move_151 < PokeBattle_TargetMultiStatDownMove
|
class PokeBattle_Move_151 < PokeBattle_TargetMultiStatDownMove
|
||||||
def initialize(battle,move)
|
def initialize(battle,move)
|
||||||
super
|
super
|
||||||
@statDown = [PBStats::ATTACK,1,PBStats::SPATK,1]
|
@statDown = [:ATTACK,1,:SPECIAL_ATTACK,1]
|
||||||
end
|
end
|
||||||
|
|
||||||
def pbEndOfMoveUsageEffect(user,targets,numHits,switchedBattlers)
|
def pbEndOfMoveUsageEffect(user,targets,numHits,switchedBattlers)
|
||||||
@@ -1874,7 +1874,7 @@ end
|
|||||||
class PokeBattle_Move_159 < PokeBattle_Move
|
class PokeBattle_Move_159 < PokeBattle_Move
|
||||||
def pbFailsAgainstTarget?(user,target)
|
def pbFailsAgainstTarget?(user,target)
|
||||||
if !target.pbCanPoison?(user,false,self) &&
|
if !target.pbCanPoison?(user,false,self) &&
|
||||||
!target.pbCanLowerStatStage?(PBStats::SPEED,user,self)
|
!target.pbCanLowerStatStage?(:SPEED,user,self)
|
||||||
@battle.pbDisplay(_INTL("But it failed!"))
|
@battle.pbDisplay(_INTL("But it failed!"))
|
||||||
return true
|
return true
|
||||||
end
|
end
|
||||||
@@ -1883,8 +1883,8 @@ class PokeBattle_Move_159 < PokeBattle_Move
|
|||||||
|
|
||||||
def pbEffectAgainstTarget(user,target)
|
def pbEffectAgainstTarget(user,target)
|
||||||
target.pbPoison(user) if target.pbCanPoison?(user,false,self)
|
target.pbPoison(user) if target.pbCanPoison?(user,false,self)
|
||||||
if target.pbCanLowerStatStage?(PBStats::SPEED,user,self)
|
if target.pbCanLowerStatStage?(:SPEED,user,self)
|
||||||
target.pbLowerStatStage(PBStats::SPEED,1,user)
|
target.pbLowerStatStage(:SPEED,1,user)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
@@ -1947,8 +1947,8 @@ class PokeBattle_Move_15C < PokeBattle_Move
|
|||||||
@validTargets = []
|
@validTargets = []
|
||||||
@battle.eachSameSideBattler(user) do |b|
|
@battle.eachSameSideBattler(user) do |b|
|
||||||
next if !b.hasActiveAbility?([:MINUS,:PLUS])
|
next if !b.hasActiveAbility?([:MINUS,:PLUS])
|
||||||
next if !b.pbCanRaiseStatStage?(PBStats::ATTACK,user,self) &&
|
next if !b.pbCanRaiseStatStage?(:ATTACK,user,self) &&
|
||||||
!b.pbCanRaiseStatStage?(PBStats::SPATK,user,self)
|
!b.pbCanRaiseStatStage?(:SPECIAL_ATTACK,user,self)
|
||||||
@validTargets.push(b)
|
@validTargets.push(b)
|
||||||
end
|
end
|
||||||
if @validTargets.length==0
|
if @validTargets.length==0
|
||||||
@@ -1967,13 +1967,13 @@ class PokeBattle_Move_15C < PokeBattle_Move
|
|||||||
|
|
||||||
def pbEffectAgainstTarget(user,target)
|
def pbEffectAgainstTarget(user,target)
|
||||||
showAnim = true
|
showAnim = true
|
||||||
if target.pbCanRaiseStatStage?(PBStats::ATTACK,user,self)
|
if target.pbCanRaiseStatStage?(:ATTACK,user,self)
|
||||||
if target.pbRaiseStatStage(PBStats::ATTACK,1,user,showAnim)
|
if target.pbRaiseStatStage(:ATTACK,1,user,showAnim)
|
||||||
showAnim = false
|
showAnim = false
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
if target.pbCanRaiseStatStage?(PBStats::SPATK,user,self)
|
if target.pbCanRaiseStatStage?(:SPECIAL_ATTACK,user,self)
|
||||||
target.pbRaiseStatStage(PBStats::SPATK,1,user,showAnim)
|
target.pbRaiseStatStage(:SPECIAL_ATTACK,1,user,showAnim)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
@@ -1998,14 +1998,14 @@ class PokeBattle_Move_15D < PokeBattle_Move
|
|||||||
pbShowAnimation(@id,user,target,1) # Stat stage-draining animation
|
pbShowAnimation(@id,user,target,1) # Stat stage-draining animation
|
||||||
@battle.pbDisplay(_INTL("{1} stole the target's boosted stats!",user.pbThis))
|
@battle.pbDisplay(_INTL("{1} stole the target's boosted stats!",user.pbThis))
|
||||||
showAnim = true
|
showAnim = true
|
||||||
PBStats.eachBattleStat do |s|
|
GameData::Stat.each_battle do |s|
|
||||||
next if target.stages[s]<=0
|
next if target.stages[s.id] <= 0
|
||||||
if user.pbCanRaiseStatStage?(s,user,self)
|
if user.pbCanRaiseStatStage?(s.id,user,self)
|
||||||
if user.pbRaiseStatStage(s,target.stages[s],user,showAnim)
|
if user.pbRaiseStatStage(s.id,target.stages[s.id],user,showAnim)
|
||||||
showAnim = false
|
showAnim = false
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
target.stages[s] = 0
|
target.stages[s.id] = 0
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
super
|
super
|
||||||
@@ -2033,7 +2033,7 @@ end
|
|||||||
class PokeBattle_Move_15F < PokeBattle_StatDownMove
|
class PokeBattle_Move_15F < PokeBattle_StatDownMove
|
||||||
def initialize(battle,move)
|
def initialize(battle,move)
|
||||||
super
|
super
|
||||||
@statDown = [PBStats::DEFENSE,1]
|
@statDown = [:DEFENSE,1]
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
@@ -2054,10 +2054,10 @@ class PokeBattle_Move_160 < PokeBattle_Move
|
|||||||
# works even if the stat stage cannot be changed due to an ability or
|
# works even if the stat stage cannot be changed due to an ability or
|
||||||
# other effect.
|
# other effect.
|
||||||
if !@battle.moldBreaker && target.hasActiveAbility?(:CONTRARY) &&
|
if !@battle.moldBreaker && target.hasActiveAbility?(:CONTRARY) &&
|
||||||
target.statStageAtMax?(PBStats::ATTACK)
|
target.statStageAtMax?(:ATTACK)
|
||||||
@battle.pbDisplay(_INTL("But it failed!"))
|
@battle.pbDisplay(_INTL("But it failed!"))
|
||||||
return true
|
return true
|
||||||
elsif target.statStageAtMin?(PBStats::ATTACK)
|
elsif target.statStageAtMin?(:ATTACK)
|
||||||
@battle.pbDisplay(_INTL("But it failed!"))
|
@battle.pbDisplay(_INTL("But it failed!"))
|
||||||
return true
|
return true
|
||||||
end
|
end
|
||||||
@@ -2069,11 +2069,11 @@ class PokeBattle_Move_160 < PokeBattle_Move
|
|||||||
stageMul = [2,2,2,2,2,2, 2, 3,4,5,6,7,8]
|
stageMul = [2,2,2,2,2,2, 2, 3,4,5,6,7,8]
|
||||||
stageDiv = [8,7,6,5,4,3, 2, 2,2,2,2,2,2]
|
stageDiv = [8,7,6,5,4,3, 2, 2,2,2,2,2,2]
|
||||||
atk = target.attack
|
atk = target.attack
|
||||||
atkStage = target.stages[PBStats::ATTACK]+6
|
atkStage = target.stages[:ATTACK]+6
|
||||||
healAmt = (atk.to_f*stageMul[atkStage]/stageDiv[atkStage]).floor
|
healAmt = (atk.to_f*stageMul[atkStage]/stageDiv[atkStage]).floor
|
||||||
# Reduce target's Attack stat
|
# Reduce target's Attack stat
|
||||||
if target.pbCanLowerStatStage?(PBStats::ATTACK,user,self)
|
if target.pbCanLowerStatStage?(:ATTACK,user,self)
|
||||||
target.pbLowerStatStage(PBStats::ATTACK,1,user)
|
target.pbLowerStatStage(:ATTACK,1,user)
|
||||||
end
|
end
|
||||||
# Heal user
|
# Heal user
|
||||||
if target.hasActiveAbility?(:LIQUIDOOZE)
|
if target.hasActiveAbility?(:LIQUIDOOZE)
|
||||||
@@ -2160,10 +2160,10 @@ class PokeBattle_Move_164 < PokeBattle_Move_163
|
|||||||
stageMul = [2,2,2,2,2,2, 2, 3,4,5,6,7,8]
|
stageMul = [2,2,2,2,2,2, 2, 3,4,5,6,7,8]
|
||||||
stageDiv = [8,7,6,5,4,3, 2, 2,2,2,2,2,2]
|
stageDiv = [8,7,6,5,4,3, 2, 2,2,2,2,2,2]
|
||||||
atk = user.attack
|
atk = user.attack
|
||||||
atkStage = user.stages[PBStats::ATTACK]+6
|
atkStage = user.stages[:ATTACK]+6
|
||||||
realAtk = (atk.to_f*stageMul[atkStage]/stageDiv[atkStage]).floor
|
realAtk = (atk.to_f*stageMul[atkStage]/stageDiv[atkStage]).floor
|
||||||
spAtk = user.spatk
|
spAtk = user.spatk
|
||||||
spAtkStage = user.stages[PBStats::SPATK]+6
|
spAtkStage = user.stages[:SPECIAL_ATTACK]+6
|
||||||
realSpAtk = (spAtk.to_f*stageMul[spAtkStage]/stageDiv[spAtkStage]).floor
|
realSpAtk = (spAtk.to_f*stageMul[spAtkStage]/stageDiv[spAtkStage]).floor
|
||||||
# Determine move's category
|
# Determine move's category
|
||||||
@calcCategory = (realAtk>realSpAtk) ? 0 : 1
|
@calcCategory = (realAtk>realSpAtk) ? 0 : 1
|
||||||
|
|||||||
@@ -61,29 +61,29 @@ class PokeBattle_Battle
|
|||||||
evYield = defeatedBattler.pokemon.evYield
|
evYield = defeatedBattler.pokemon.evYield
|
||||||
# Num of effort points pkmn already has
|
# Num of effort points pkmn already has
|
||||||
evTotal = 0
|
evTotal = 0
|
||||||
PBStats.eachStat { |s| evTotal += pkmn.ev[s] }
|
GameData::Stat.each_main { |s| evTotal += pkmn.ev[s.id] }
|
||||||
# Modify EV yield based on pkmn's held item
|
# Modify EV yield based on pkmn's held item
|
||||||
if !BattleHandlers.triggerEVGainModifierItem(pkmn.item,pkmn,evYield)
|
if !BattleHandlers.triggerEVGainModifierItem(pkmn.item,pkmn,evYield)
|
||||||
BattleHandlers.triggerEVGainModifierItem(@initialItems[0][idxParty],pkmn,evYield)
|
BattleHandlers.triggerEVGainModifierItem(@initialItems[0][idxParty],pkmn,evYield)
|
||||||
end
|
end
|
||||||
# Double EV gain because of Pokérus
|
# Double EV gain because of Pokérus
|
||||||
if pkmn.pokerusStage>=1 # Infected or cured
|
if pkmn.pokerusStage>=1 # Infected or cured
|
||||||
evYield.collect! { |a| a*2 }
|
evYield.each_key { |stat| evYield[stat] *= 2 }
|
||||||
end
|
end
|
||||||
# Gain EVs for each stat in turn
|
# Gain EVs for each stat in turn
|
||||||
if pkmn.shadowPokemon? && pkmn.saved_ev
|
if pkmn.shadowPokemon? && pkmn.saved_ev
|
||||||
PBStats.eachStat { |s| evTotal += pkmn.saved_ev[s] }
|
pkmn.saved_ev.each_value { |e| evTotal += e }
|
||||||
PBStats.eachStat do |s|
|
GameData::Stat.each_main do |s|
|
||||||
evGain = evYield[s].clamp(0, Pokemon::EV_STAT_LIMIT - pkmn.ev[s] - pkmn.saved_ev[s])
|
evGain = evYield[s.id].clamp(0, Pokemon::EV_STAT_LIMIT - pkmn.ev[s.id] - pkmn.saved_ev[s.id])
|
||||||
evGain = evGain.clamp(0, Pokemon::EV_LIMIT - evTotal)
|
evGain = evGain.clamp(0, Pokemon::EV_LIMIT - evTotal)
|
||||||
pkmn.saved_ev[s] += evGain
|
pkmn.saved_ev[s.id] += evGain
|
||||||
evTotal += evGain
|
evTotal += evGain
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
PBStats.eachStat do |s|
|
GameData::Stat.each_main do |s|
|
||||||
evGain = evYield[s].clamp(0, Pokemon::EV_STAT_LIMIT - pkmn.ev[s])
|
evGain = evYield[s.id].clamp(0, Pokemon::EV_STAT_LIMIT - pkmn.ev[s.id])
|
||||||
evGain = evGain.clamp(0, Pokemon::EV_LIMIT - evTotal)
|
evGain = evGain.clamp(0, Pokemon::EV_LIMIT - evTotal)
|
||||||
pkmn.ev[s] += evGain
|
pkmn.ev[s.id] += evGain
|
||||||
evTotal += evGain
|
evTotal += evGain
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -394,8 +394,8 @@ class PokeBattle_Battle
|
|||||||
if battler.pbOwnSide.effects[PBEffects::StickyWeb] && !battler.fainted? &&
|
if battler.pbOwnSide.effects[PBEffects::StickyWeb] && !battler.fainted? &&
|
||||||
!battler.airborne?
|
!battler.airborne?
|
||||||
pbDisplay(_INTL("{1} was caught in a sticky web!",battler.pbThis))
|
pbDisplay(_INTL("{1} was caught in a sticky web!",battler.pbThis))
|
||||||
if battler.pbCanLowerStatStage?(PBStats::SPEED)
|
if battler.pbCanLowerStatStage?(:SPEED)
|
||||||
battler.pbLowerStatStage(PBStats::SPEED,1,nil)
|
battler.pbLowerStatStage(:SPEED,1,nil)
|
||||||
battler.pbItemStatRestoreCheck
|
battler.pbItemStatRestoreCheck
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -50,8 +50,8 @@ class PokeBattle_Battle
|
|||||||
end
|
end
|
||||||
elsif battler.status == :SLEEP
|
elsif battler.status == :SLEEP
|
||||||
battler.pbCureStatus
|
battler.pbCureStatus
|
||||||
elsif battler.pbCanRaiseStatStage?(PBStats::ACCURACY,battler)
|
elsif battler.pbCanRaiseStatStage?(:ACCURACY,battler)
|
||||||
battler.pbRaiseStatStage(PBStats::ACCURACY,1,battler)
|
battler.pbRaiseStatStage(:ACCURACY,1,battler)
|
||||||
else
|
else
|
||||||
pbDisplay(_INTL("But nothing happened!"))
|
pbDisplay(_INTL("But nothing happened!"))
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -61,38 +61,38 @@ class PokeBattle_AI
|
|||||||
]
|
]
|
||||||
allStatusItems.push(:RAGECANDYBAR) if Settings::RAGE_CANDY_BAR_CURES_STATUS_PROBLEMS
|
allStatusItems.push(:RAGECANDYBAR) if Settings::RAGE_CANDY_BAR_CURES_STATUS_PROBLEMS
|
||||||
xItems = {
|
xItems = {
|
||||||
:XATTACK => [PBStats::ATTACK, (Settings::X_STAT_ITEMS_RAISE_BY_TWO_STAGES) ? 2 : 1],
|
:XATTACK => [:ATTACK, (Settings::X_STAT_ITEMS_RAISE_BY_TWO_STAGES) ? 2 : 1],
|
||||||
:XATTACK2 => [PBStats::ATTACK, 2],
|
:XATTACK2 => [:ATTACK, 2],
|
||||||
:XATTACK3 => [PBStats::ATTACK, 3],
|
:XATTACK3 => [:ATTACK, 3],
|
||||||
:XATTACK6 => [PBStats::ATTACK, 6],
|
:XATTACK6 => [:ATTACK, 6],
|
||||||
:XDEFENSE => [PBStats::DEFENSE, (Settings::X_STAT_ITEMS_RAISE_BY_TWO_STAGES) ? 2 : 1],
|
:XDEFENSE => [:DEFENSE, (Settings::X_STAT_ITEMS_RAISE_BY_TWO_STAGES) ? 2 : 1],
|
||||||
:XDEFENSE2 => [PBStats::DEFENSE, 2],
|
:XDEFENSE2 => [:DEFENSE, 2],
|
||||||
:XDEFENSE3 => [PBStats::DEFENSE, 3],
|
:XDEFENSE3 => [:DEFENSE, 3],
|
||||||
:XDEFENSE6 => [PBStats::DEFENSE, 6],
|
:XDEFENSE6 => [:DEFENSE, 6],
|
||||||
:XDEFEND => [PBStats::DEFENSE, (Settings::X_STAT_ITEMS_RAISE_BY_TWO_STAGES) ? 2 : 1],
|
:XDEFEND => [:DEFENSE, (Settings::X_STAT_ITEMS_RAISE_BY_TWO_STAGES) ? 2 : 1],
|
||||||
:XDEFEND2 => [PBStats::DEFENSE, 2],
|
:XDEFEND2 => [:DEFENSE, 2],
|
||||||
:XDEFEND3 => [PBStats::DEFENSE, 3],
|
:XDEFEND3 => [:DEFENSE, 3],
|
||||||
:XDEFEND6 => [PBStats::DEFENSE, 6],
|
:XDEFEND6 => [:DEFENSE, 6],
|
||||||
:XSPATK => [PBStats::SPATK, (Settings::X_STAT_ITEMS_RAISE_BY_TWO_STAGES) ? 2 : 1],
|
:XSPATK => [:SPECIAL_ATTACK, (Settings::X_STAT_ITEMS_RAISE_BY_TWO_STAGES) ? 2 : 1],
|
||||||
:XSPATK2 => [PBStats::SPATK, 2],
|
:XSPATK2 => [:SPECIAL_ATTACK, 2],
|
||||||
:XSPATK3 => [PBStats::SPATK, 3],
|
:XSPATK3 => [:SPECIAL_ATTACK, 3],
|
||||||
:XSPATK6 => [PBStats::SPATK, 6],
|
:XSPATK6 => [:SPECIAL_ATTACK, 6],
|
||||||
:XSPECIAL => [PBStats::SPATK, (Settings::X_STAT_ITEMS_RAISE_BY_TWO_STAGES) ? 2 : 1],
|
:XSPECIAL => [:SPECIAL_ATTACK, (Settings::X_STAT_ITEMS_RAISE_BY_TWO_STAGES) ? 2 : 1],
|
||||||
:XSPECIAL2 => [PBStats::SPATK, 2],
|
:XSPECIAL2 => [:SPECIAL_ATTACK, 2],
|
||||||
:XSPECIAL3 => [PBStats::SPATK, 3],
|
:XSPECIAL3 => [:SPECIAL_ATTACK, 3],
|
||||||
:XSPECIAL6 => [PBStats::SPATK, 6],
|
:XSPECIAL6 => [:SPECIAL_ATTACK, 6],
|
||||||
:XSPDEF => [PBStats::SPDEF, (Settings::X_STAT_ITEMS_RAISE_BY_TWO_STAGES) ? 2 : 1],
|
:XSPDEF => [:SPECIAL_DEFENSE, (Settings::X_STAT_ITEMS_RAISE_BY_TWO_STAGES) ? 2 : 1],
|
||||||
:XSPDEF2 => [PBStats::SPDEF, 2],
|
:XSPDEF2 => [:SPECIAL_DEFENSE, 2],
|
||||||
:XSPDEF3 => [PBStats::SPDEF, 3],
|
:XSPDEF3 => [:SPECIAL_DEFENSE, 3],
|
||||||
:XSPDEF6 => [PBStats::SPDEF, 6],
|
:XSPDEF6 => [:SPECIAL_DEFENSE, 6],
|
||||||
:XSPEED => [PBStats::SPEED, (Settings::X_STAT_ITEMS_RAISE_BY_TWO_STAGES) ? 2 : 1],
|
:XSPEED => [:SPEED, (Settings::X_STAT_ITEMS_RAISE_BY_TWO_STAGES) ? 2 : 1],
|
||||||
:XSPEED2 => [PBStats::SPEED, 2],
|
:XSPEED2 => [:SPEED, 2],
|
||||||
:XSPEED3 => [PBStats::SPEED, 3],
|
:XSPEED3 => [:SPEED, 3],
|
||||||
:XSPEED6 => [PBStats::SPEED, 6],
|
:XSPEED6 => [:SPEED, 6],
|
||||||
:XACCURACY => [PBStats::ACCURACY, (Settings::X_STAT_ITEMS_RAISE_BY_TWO_STAGES) ? 2 : 1],
|
:XACCURACY => [:ACCURACY, (Settings::X_STAT_ITEMS_RAISE_BY_TWO_STAGES) ? 2 : 1],
|
||||||
:XACCURACY2 => [PBStats::ACCURACY, 2],
|
:XACCURACY2 => [:ACCURACY, 2],
|
||||||
:XACCURACY3 => [PBStats::ACCURACY, 3],
|
:XACCURACY3 => [:ACCURACY, 3],
|
||||||
:XACCURACY6 => [PBStats::ACCURACY, 6]
|
:XACCURACY6 => [:ACCURACY, 6]
|
||||||
}
|
}
|
||||||
losthp = battler.totalhp - battler.hp
|
losthp = battler.totalhp - battler.hp
|
||||||
preferFullRestore = (battler.hp <= battler.totalhp * 2 / 3 &&
|
preferFullRestore = (battler.hp <= battler.totalhp * 2 / 3 &&
|
||||||
|
|||||||
@@ -174,7 +174,7 @@ class PokeBattle_AI
|
|||||||
(target.semiInvulnerable? || target.effects[PBEffects::SkyDrop]>=0)
|
(target.semiInvulnerable? || target.effects[PBEffects::SkyDrop]>=0)
|
||||||
miss = true
|
miss = true
|
||||||
miss = false if user.hasActiveAbility?(:NOGUARD) || target.hasActiveAbility?(:NOGUARD)
|
miss = false if user.hasActiveAbility?(:NOGUARD) || target.hasActiveAbility?(:NOGUARD)
|
||||||
if miss && pbRoughStat(user,PBStats::SPEED,skill)>pbRoughStat(target,PBStats::SPEED,skill)
|
if miss && pbRoughStat(user,:SPEED,skill)>pbRoughStat(target,:SPEED,skill)
|
||||||
# Knows what can get past semi-invulnerability
|
# Knows what can get past semi-invulnerability
|
||||||
if target.effects[PBEffects::SkyDrop]>=0
|
if target.effects[PBEffects::SkyDrop]>=0
|
||||||
miss = false if move.hitsFlyingTargets?
|
miss = false if move.hitsFlyingTargets?
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
@@ -137,17 +137,17 @@ class PokeBattle_AI
|
|||||||
end
|
end
|
||||||
|
|
||||||
def pbRoughStat(battler,stat,skill)
|
def pbRoughStat(battler,stat,skill)
|
||||||
return battler.pbSpeed if skill>=PBTrainerAI.highSkill && stat==PBStats::SPEED
|
return battler.pbSpeed if skill>=PBTrainerAI.highSkill && stat==:SPEED
|
||||||
stageMul = [2,2,2,2,2,2, 2, 3,4,5,6,7,8]
|
stageMul = [2,2,2,2,2,2, 2, 3,4,5,6,7,8]
|
||||||
stageDiv = [8,7,6,5,4,3, 2, 2,2,2,2,2,2]
|
stageDiv = [8,7,6,5,4,3, 2, 2,2,2,2,2,2]
|
||||||
stage = battler.stages[stat]+6
|
stage = battler.stages[stat]+6
|
||||||
value = 0
|
value = 0
|
||||||
case stat
|
case stat
|
||||||
when PBStats::ATTACK then value = battler.attack
|
when :ATTACK then value = battler.attack
|
||||||
when PBStats::DEFENSE then value = battler.defense
|
when :DEFENSE then value = battler.defense
|
||||||
when PBStats::SPATK then value = battler.spatk
|
when :SPECIAL_ATTACK then value = battler.spatk
|
||||||
when PBStats::SPDEF then value = battler.spdef
|
when :SPECIAL_DEFENSE then value = battler.spdef
|
||||||
when PBStats::SPEED then value = battler.speed
|
when :SPEED then value = battler.speed
|
||||||
end
|
end
|
||||||
return (value.to_f*stageMul[stage]/stageDiv[stage]).floor
|
return (value.to_f*stageMul[stage]/stageDiv[stage]).floor
|
||||||
end
|
end
|
||||||
@@ -185,8 +185,8 @@ class PokeBattle_AI
|
|||||||
when "086" # Acrobatics
|
when "086" # Acrobatics
|
||||||
baseDmg *= 2 if !user.item || user.hasActiveItem?(:FLYINGGEM)
|
baseDmg *= 2 if !user.item || user.hasActiveItem?(:FLYINGGEM)
|
||||||
when "08D" # Gyro Ball
|
when "08D" # Gyro Ball
|
||||||
targetSpeed = pbRoughStat(target,PBStats::SPEED,skill)
|
targetSpeed = pbRoughStat(target,:SPEED,skill)
|
||||||
userSpeed = pbRoughStat(user,PBStats::SPEED,skill)
|
userSpeed = pbRoughStat(user,:SPEED,skill)
|
||||||
baseDmg = [[(25*targetSpeed/userSpeed).floor,150].min,1].max
|
baseDmg = [[(25*targetSpeed/userSpeed).floor,150].min,1].max
|
||||||
when "094" # Present
|
when "094" # Present
|
||||||
baseDmg = 50
|
baseDmg = 50
|
||||||
@@ -255,20 +255,20 @@ class PokeBattle_AI
|
|||||||
# Get the move's type
|
# Get the move's type
|
||||||
type = pbRoughType(move,user,skill)
|
type = pbRoughType(move,user,skill)
|
||||||
##### Calculate user's attack stat #####
|
##### Calculate user's attack stat #####
|
||||||
atk = pbRoughStat(user,PBStats::ATTACK,skill)
|
atk = pbRoughStat(user,:ATTACK,skill)
|
||||||
if move.function=="121" # Foul Play
|
if move.function=="121" # Foul Play
|
||||||
atk = pbRoughStat(target,PBStats::ATTACK,skill)
|
atk = pbRoughStat(target,:ATTACK,skill)
|
||||||
elsif move.specialMove?(type)
|
elsif move.specialMove?(type)
|
||||||
if move.function=="121" # Foul Play
|
if move.function=="121" # Foul Play
|
||||||
atk = pbRoughStat(target,PBStats::SPATK,skill)
|
atk = pbRoughStat(target,:SPECIAL_ATTACK,skill)
|
||||||
else
|
else
|
||||||
atk = pbRoughStat(user,PBStats::SPATK,skill)
|
atk = pbRoughStat(user,:SPECIAL_ATTACK,skill)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
##### Calculate target's defense stat #####
|
##### Calculate target's defense stat #####
|
||||||
defense = pbRoughStat(target,PBStats::DEFENSE,skill)
|
defense = pbRoughStat(target,:DEFENSE,skill)
|
||||||
if move.specialMove?(type) && move.function!="122" # Psyshock
|
if move.specialMove?(type) && move.function!="122" # Psyshock
|
||||||
defense = pbRoughStat(target,PBStats::SPDEF,skill)
|
defense = pbRoughStat(target,:SPECIAL_DEFENSE,skill)
|
||||||
end
|
end
|
||||||
##### Calculate all multiplier effects #####
|
##### Calculate all multiplier effects #####
|
||||||
multipliers = {
|
multipliers = {
|
||||||
@@ -568,8 +568,8 @@ class PokeBattle_AI
|
|||||||
# Calculate all modifier effects
|
# Calculate all modifier effects
|
||||||
modifiers = {}
|
modifiers = {}
|
||||||
modifiers[:base_accuracy] = baseAcc
|
modifiers[:base_accuracy] = baseAcc
|
||||||
modifiers[:accuracy_stage] = user.stages[PBStats::ACCURACY]
|
modifiers[:accuracy_stage] = user.stages[:ACCURACY]
|
||||||
modifiers[:evasion_stage] = target.stages[PBStats::EVASION]
|
modifiers[:evasion_stage] = target.stages[:EVASION]
|
||||||
modifiers[:accuracy_multiplier] = 1.0
|
modifiers[:accuracy_multiplier] = 1.0
|
||||||
modifiers[:evasion_multiplier] = 1.0
|
modifiers[:evasion_multiplier] = 1.0
|
||||||
pbCalcAccuracyModifiers(user,target,modifiers,move,type,skill)
|
pbCalcAccuracyModifiers(user,target,modifiers,move,type,skill)
|
||||||
|
|||||||
@@ -496,8 +496,7 @@ def pbBattleConfusionBerry(battler,battle,item,forced,flavor,confuseMsg)
|
|||||||
battle.pbDisplay(_INTL("{1} restored its health using its {2}!",battler.pbThis,itemName))
|
battle.pbDisplay(_INTL("{1} restored its health using its {2}!",battler.pbThis,itemName))
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
flavor_stat = [PBStats::ATTACK, PBStats::DEFENSE, PBStats::SPEED,
|
flavor_stat = [:ATTACK, :DEFENSE, :SPEED, :SPECIAL_ATTACK, :SPECIAL_DEFENSE][flavor]
|
||||||
PBStats::SPATK, PBStats::SPDEF][flavor]
|
|
||||||
battler.nature.stat_changes.each do |change|
|
battler.nature.stat_changes.each do |change|
|
||||||
next if change[1] > 0 || change[0] != flavor_stat
|
next if change[1] > 0 || change[0] != flavor_stat
|
||||||
battle.pbDisplay(confuseMsg)
|
battle.pbDisplay(confuseMsg)
|
||||||
|
|||||||
@@ -362,14 +362,14 @@ BattleHandlers::StatusCureAbility.copy(:WATERVEIL,:WATERBUBBLE)
|
|||||||
|
|
||||||
BattleHandlers::StatLossImmunityAbility.add(:BIGPECKS,
|
BattleHandlers::StatLossImmunityAbility.add(:BIGPECKS,
|
||||||
proc { |ability,battler,stat,battle,showMessages|
|
proc { |ability,battler,stat,battle,showMessages|
|
||||||
next false if stat!=PBStats::DEFENSE
|
next false if stat!=:DEFENSE
|
||||||
if showMessages
|
if showMessages
|
||||||
battle.pbShowAbilitySplash(battler)
|
battle.pbShowAbilitySplash(battler)
|
||||||
if PokeBattle_SceneConstants::USE_ABILITY_SPLASH
|
if PokeBattle_SceneConstants::USE_ABILITY_SPLASH
|
||||||
battle.pbDisplay(_INTL("{1}'s {2} cannot be lowered!",battler.pbThis,PBStats.getName(stat)))
|
battle.pbDisplay(_INTL("{1}'s {2} cannot be lowered!",battler.pbThis,GameData::Stat.get(stat).name))
|
||||||
else
|
else
|
||||||
battle.pbDisplay(_INTL("{1}'s {2} prevents {3} loss!",battler.pbThis,
|
battle.pbDisplay(_INTL("{1}'s {2} prevents {3} loss!",battler.pbThis,
|
||||||
battler.abilityName,PBStats.getName(stat)))
|
battler.abilityName,GameData::Stat.get(stat).name))
|
||||||
end
|
end
|
||||||
battle.pbHideAbilitySplash(battler)
|
battle.pbHideAbilitySplash(battler)
|
||||||
end
|
end
|
||||||
@@ -412,14 +412,14 @@ BattleHandlers::StatLossImmunityAbility.add(:FLOWERVEIL,
|
|||||||
|
|
||||||
BattleHandlers::StatLossImmunityAbility.add(:HYPERCUTTER,
|
BattleHandlers::StatLossImmunityAbility.add(:HYPERCUTTER,
|
||||||
proc { |ability,battler,stat,battle,showMessages|
|
proc { |ability,battler,stat,battle,showMessages|
|
||||||
next false if stat!=PBStats::ATTACK
|
next false if stat!=:ATTACK
|
||||||
if showMessages
|
if showMessages
|
||||||
battle.pbShowAbilitySplash(battler)
|
battle.pbShowAbilitySplash(battler)
|
||||||
if PokeBattle_SceneConstants::USE_ABILITY_SPLASH
|
if PokeBattle_SceneConstants::USE_ABILITY_SPLASH
|
||||||
battle.pbDisplay(_INTL("{1}'s {2} cannot be lowered!",battler.pbThis,PBStats.getName(stat)))
|
battle.pbDisplay(_INTL("{1}'s {2} cannot be lowered!",battler.pbThis,GameData::Stat.get(stat).name))
|
||||||
else
|
else
|
||||||
battle.pbDisplay(_INTL("{1}'s {2} prevents {3} loss!",battler.pbThis,
|
battle.pbDisplay(_INTL("{1}'s {2} prevents {3} loss!",battler.pbThis,
|
||||||
battler.abilityName,PBStats.getName(stat)))
|
battler.abilityName,GameData::Stat.get(stat).name))
|
||||||
end
|
end
|
||||||
battle.pbHideAbilitySplash(battler)
|
battle.pbHideAbilitySplash(battler)
|
||||||
end
|
end
|
||||||
@@ -429,14 +429,14 @@ BattleHandlers::StatLossImmunityAbility.add(:HYPERCUTTER,
|
|||||||
|
|
||||||
BattleHandlers::StatLossImmunityAbility.add(:KEENEYE,
|
BattleHandlers::StatLossImmunityAbility.add(:KEENEYE,
|
||||||
proc { |ability,battler,stat,battle,showMessages|
|
proc { |ability,battler,stat,battle,showMessages|
|
||||||
next false if stat!=PBStats::ACCURACY
|
next false if stat!=:ACCURACY
|
||||||
if showMessages
|
if showMessages
|
||||||
battle.pbShowAbilitySplash(battler)
|
battle.pbShowAbilitySplash(battler)
|
||||||
if PokeBattle_SceneConstants::USE_ABILITY_SPLASH
|
if PokeBattle_SceneConstants::USE_ABILITY_SPLASH
|
||||||
battle.pbDisplay(_INTL("{1}'s {2} cannot be lowered!",battler.pbThis,PBStats.getName(stat)))
|
battle.pbDisplay(_INTL("{1}'s {2} cannot be lowered!",battler.pbThis,GameData::Stat.get(stat).name))
|
||||||
else
|
else
|
||||||
battle.pbDisplay(_INTL("{1}'s {2} prevents {3} loss!",battler.pbThis,
|
battle.pbDisplay(_INTL("{1}'s {2} prevents {3} loss!",battler.pbThis,
|
||||||
battler.abilityName,PBStats.getName(stat)))
|
battler.abilityName,GameData::Stat.get(stat).name))
|
||||||
end
|
end
|
||||||
battle.pbHideAbilitySplash(battler)
|
battle.pbHideAbilitySplash(battler)
|
||||||
end
|
end
|
||||||
@@ -497,14 +497,14 @@ BattleHandlers::StatLossImmunityAllyAbility.add(:FLOWERVEIL,
|
|||||||
BattleHandlers::AbilityOnStatLoss.add(:COMPETITIVE,
|
BattleHandlers::AbilityOnStatLoss.add(:COMPETITIVE,
|
||||||
proc { |ability,battler,stat,user|
|
proc { |ability,battler,stat,user|
|
||||||
next if user && !user.opposes?(battler)
|
next if user && !user.opposes?(battler)
|
||||||
battler.pbRaiseStatStageByAbility(PBStats::SPATK,2,battler)
|
battler.pbRaiseStatStageByAbility(:SPECIAL_ATTACK,2,battler)
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
|
|
||||||
BattleHandlers::AbilityOnStatLoss.add(:DEFIANT,
|
BattleHandlers::AbilityOnStatLoss.add(:DEFIANT,
|
||||||
proc { |ability,battler,stat,user|
|
proc { |ability,battler,stat,user|
|
||||||
next if user && !user.opposes?(battler)
|
next if user && !user.opposes?(battler)
|
||||||
battler.pbRaiseStatStageByAbility(PBStats::ATTACK,2,battler)
|
battler.pbRaiseStatStageByAbility(:ATTACK,2,battler)
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
|
|
||||||
@@ -555,7 +555,7 @@ BattleHandlers::PriorityBracketChangeAbility.add(:STALL,
|
|||||||
|
|
||||||
BattleHandlers::AbilityOnFlinch.add(:STEADFAST,
|
BattleHandlers::AbilityOnFlinch.add(:STEADFAST,
|
||||||
proc { |ability,battler,battle|
|
proc { |ability,battler,battle|
|
||||||
battler.pbRaiseStatStageByAbility(PBStats::SPEED,1,battler)
|
battler.pbRaiseStatStageByAbility(:SPEED,1,battler)
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
|
|
||||||
@@ -625,19 +625,19 @@ BattleHandlers::MoveImmunityTargetAbility.add(:FLASHFIRE,
|
|||||||
|
|
||||||
BattleHandlers::MoveImmunityTargetAbility.add(:LIGHTNINGROD,
|
BattleHandlers::MoveImmunityTargetAbility.add(:LIGHTNINGROD,
|
||||||
proc { |ability,user,target,move,type,battle|
|
proc { |ability,user,target,move,type,battle|
|
||||||
next pbBattleMoveImmunityStatAbility(user,target,move,type,:ELECTRIC,PBStats::SPATK,1,battle)
|
next pbBattleMoveImmunityStatAbility(user,target,move,type,:ELECTRIC,:SPECIAL_ATTACK,1,battle)
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
|
|
||||||
BattleHandlers::MoveImmunityTargetAbility.add(:MOTORDRIVE,
|
BattleHandlers::MoveImmunityTargetAbility.add(:MOTORDRIVE,
|
||||||
proc { |ability,user,target,move,type,battle|
|
proc { |ability,user,target,move,type,battle|
|
||||||
next pbBattleMoveImmunityStatAbility(user,target,move,type,:ELECTRIC,PBStats::SPEED,1,battle)
|
next pbBattleMoveImmunityStatAbility(user,target,move,type,:ELECTRIC,:SPEED,1,battle)
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
|
|
||||||
BattleHandlers::MoveImmunityTargetAbility.add(:SAPSIPPER,
|
BattleHandlers::MoveImmunityTargetAbility.add(:SAPSIPPER,
|
||||||
proc { |ability,user,target,move,type,battle|
|
proc { |ability,user,target,move,type,battle|
|
||||||
next pbBattleMoveImmunityStatAbility(user,target,move,type,:GRASS,PBStats::ATTACK,1,battle)
|
next pbBattleMoveImmunityStatAbility(user,target,move,type,:GRASS,:ATTACK,1,battle)
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
|
|
||||||
@@ -658,7 +658,7 @@ BattleHandlers::MoveImmunityTargetAbility.add(:SOUNDPROOF,
|
|||||||
|
|
||||||
BattleHandlers::MoveImmunityTargetAbility.add(:STORMDRAIN,
|
BattleHandlers::MoveImmunityTargetAbility.add(:STORMDRAIN,
|
||||||
proc { |ability,user,target,move,type,battle|
|
proc { |ability,user,target,move,type,battle|
|
||||||
next pbBattleMoveImmunityStatAbility(user,target,move,type,:WATER,PBStats::SPATK,1,battle)
|
next pbBattleMoveImmunityStatAbility(user,target,move,type,:WATER,:SPECIAL_ATTACK,1,battle)
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
|
|
||||||
@@ -1311,15 +1311,15 @@ BattleHandlers::TargetAbilityOnHit.add(:AFTERMATH,
|
|||||||
BattleHandlers::TargetAbilityOnHit.add(:ANGERPOINT,
|
BattleHandlers::TargetAbilityOnHit.add(:ANGERPOINT,
|
||||||
proc { |ability,user,target,move,battle|
|
proc { |ability,user,target,move,battle|
|
||||||
next if !target.damageState.critical
|
next if !target.damageState.critical
|
||||||
next if !target.pbCanRaiseStatStage?(PBStats::ATTACK,target)
|
next if !target.pbCanRaiseStatStage?(:ATTACK,target)
|
||||||
battle.pbShowAbilitySplash(target)
|
battle.pbShowAbilitySplash(target)
|
||||||
target.stages[PBStats::ATTACK] = 6
|
target.stages[:ATTACK] = 6
|
||||||
battle.pbCommonAnimation("StatUp",target)
|
battle.pbCommonAnimation("StatUp",target)
|
||||||
if PokeBattle_SceneConstants::USE_ABILITY_SPLASH
|
if PokeBattle_SceneConstants::USE_ABILITY_SPLASH
|
||||||
battle.pbDisplay(_INTL("{1} maxed its {2}!",target.pbThis,PBStats.getName(PBStats::ATTACK)))
|
battle.pbDisplay(_INTL("{1} maxed its {2}!",target.pbThis,GameData::Stat.get(:ATTACK).name))
|
||||||
else
|
else
|
||||||
battle.pbDisplay(_INTL("{1}'s {2} maxed its {3}!",
|
battle.pbDisplay(_INTL("{1}'s {2} maxed its {3}!",
|
||||||
target.pbThis,target.abilityName,PBStats.getName(PBStats::ATTACK)))
|
target.pbThis,target.abilityName,GameData::Stat.get(:ATTACK).name))
|
||||||
end
|
end
|
||||||
battle.pbHideAbilitySplash(target)
|
battle.pbHideAbilitySplash(target)
|
||||||
}
|
}
|
||||||
@@ -1441,7 +1441,7 @@ BattleHandlers::TargetAbilityOnHit.add(:FLAMEBODY,
|
|||||||
BattleHandlers::TargetAbilityOnHit.add(:GOOEY,
|
BattleHandlers::TargetAbilityOnHit.add(:GOOEY,
|
||||||
proc { |ability,user,target,move,battle|
|
proc { |ability,user,target,move,battle|
|
||||||
next if !move.pbContactMove?(user)
|
next if !move.pbContactMove?(user)
|
||||||
user.pbLowerStatStageByAbility(PBStats::SPEED,1,target,true,true)
|
user.pbLowerStatStageByAbility(:SPEED,1,target,true,true)
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
|
|
||||||
@@ -1500,7 +1500,7 @@ BattleHandlers::TargetAbilityOnHit.copy(:IRONBARBS,:ROUGHSKIN)
|
|||||||
BattleHandlers::TargetAbilityOnHit.add(:JUSTIFIED,
|
BattleHandlers::TargetAbilityOnHit.add(:JUSTIFIED,
|
||||||
proc { |ability,user,target,move,battle|
|
proc { |ability,user,target,move,battle|
|
||||||
next if move.calcType != :DARK
|
next if move.calcType != :DARK
|
||||||
target.pbRaiseStatStageByAbility(PBStats::ATTACK,1,target)
|
target.pbRaiseStatStageByAbility(:ATTACK,1,target)
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
|
|
||||||
@@ -1549,13 +1549,13 @@ BattleHandlers::TargetAbilityOnHit.add(:POISONPOINT,
|
|||||||
BattleHandlers::TargetAbilityOnHit.add(:RATTLED,
|
BattleHandlers::TargetAbilityOnHit.add(:RATTLED,
|
||||||
proc { |ability,user,target,move,battle|
|
proc { |ability,user,target,move,battle|
|
||||||
next if ![:BUG, :DARK, :GHOST].include?(move.calcType)
|
next if ![:BUG, :DARK, :GHOST].include?(move.calcType)
|
||||||
target.pbRaiseStatStageByAbility(PBStats::SPEED,1,target)
|
target.pbRaiseStatStageByAbility(:SPEED,1,target)
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
|
|
||||||
BattleHandlers::TargetAbilityOnHit.add(:STAMINA,
|
BattleHandlers::TargetAbilityOnHit.add(:STAMINA,
|
||||||
proc { |ability,user,target,move,battle|
|
proc { |ability,user,target,move,battle|
|
||||||
target.pbRaiseStatStageByAbility(PBStats::DEFENSE,1,target)
|
target.pbRaiseStatStageByAbility(:DEFENSE,1,target)
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
|
|
||||||
@@ -1580,18 +1580,18 @@ BattleHandlers::TargetAbilityOnHit.add(:STATIC,
|
|||||||
BattleHandlers::TargetAbilityOnHit.add(:WATERCOMPACTION,
|
BattleHandlers::TargetAbilityOnHit.add(:WATERCOMPACTION,
|
||||||
proc { |ability,user,target,move,battle|
|
proc { |ability,user,target,move,battle|
|
||||||
next if move.calcType != :WATER
|
next if move.calcType != :WATER
|
||||||
target.pbRaiseStatStageByAbility(PBStats::DEFENSE,2,target)
|
target.pbRaiseStatStageByAbility(:DEFENSE,2,target)
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
|
|
||||||
BattleHandlers::TargetAbilityOnHit.add(:WEAKARMOR,
|
BattleHandlers::TargetAbilityOnHit.add(:WEAKARMOR,
|
||||||
proc { |ability,user,target,move,battle|
|
proc { |ability,user,target,move,battle|
|
||||||
next if !move.physicalMove?
|
next if !move.physicalMove?
|
||||||
next if !target.pbCanLowerStatStage?(PBStats::DEFENSE, target) &&
|
next if !target.pbCanLowerStatStage?(:DEFENSE, target) &&
|
||||||
!target.pbCanRaiseStatStage?(PBStats::SPEED, target)
|
!target.pbCanRaiseStatStage?(:SPEED, target)
|
||||||
battle.pbShowAbilitySplash(target)
|
battle.pbShowAbilitySplash(target)
|
||||||
target.pbLowerStatStageByAbility(PBStats::DEFENSE, 1, target, false)
|
target.pbLowerStatStageByAbility(:DEFENSE, 1, target, false)
|
||||||
target.pbRaiseStatStageByAbility(PBStats::SPEED,
|
target.pbRaiseStatStageByAbility(:SPEED,
|
||||||
(Settings::MECHANICS_GENERATION >= 7) ? 2 : 1, target, false)
|
(Settings::MECHANICS_GENERATION >= 7) ? 2 : 1, target, false)
|
||||||
battle.pbHideAbilitySplash(target)
|
battle.pbHideAbilitySplash(target)
|
||||||
}
|
}
|
||||||
@@ -1632,13 +1632,14 @@ BattleHandlers::UserAbilityEndOfMove.add(:BEASTBOOST,
|
|||||||
next if battle.pbAllFainted?(user.idxOpposingSide)
|
next if battle.pbAllFainted?(user.idxOpposingSide)
|
||||||
numFainted = 0
|
numFainted = 0
|
||||||
targets.each { |b| numFainted += 1 if b.damageState.fainted }
|
targets.each { |b| numFainted += 1 if b.damageState.fainted }
|
||||||
next if numFainted==0
|
next if numFainted == 0
|
||||||
userStats = user.plainStats
|
userStats = user.plainStats
|
||||||
highestStatValue = userStats.max
|
highestStatValue = 0
|
||||||
PBStats.eachMainBattleStat do |s|
|
userStats.each_value { |value| highestStatValue = value if highestStatValue < value }
|
||||||
next if userStats[s]<highestStatValue
|
GameData::Stat.each_main_battle do |s|
|
||||||
if user.pbCanRaiseStatStage?(s,user)
|
next if userStats[s.id] < highestStatValue
|
||||||
user.pbRaiseStatStageByAbility(s,numFainted,user)
|
if user.pbCanRaiseStatStage?(s.id, user)
|
||||||
|
user.pbRaiseStatStageByAbility(s.id, numFainted, user)
|
||||||
end
|
end
|
||||||
break
|
break
|
||||||
end
|
end
|
||||||
@@ -1690,8 +1691,8 @@ BattleHandlers::UserAbilityEndOfMove.add(:MOXIE,
|
|||||||
next if battle.pbAllFainted?(user.idxOpposingSide)
|
next if battle.pbAllFainted?(user.idxOpposingSide)
|
||||||
numFainted = 0
|
numFainted = 0
|
||||||
targets.each { |b| numFainted += 1 if b.damageState.fainted }
|
targets.each { |b| numFainted += 1 if b.damageState.fainted }
|
||||||
next if numFainted==0 || !user.pbCanRaiseStatStage?(PBStats::ATTACK,user)
|
next if numFainted==0 || !user.pbCanRaiseStatStage?(:ATTACK,user)
|
||||||
user.pbRaiseStatStageByAbility(PBStats::ATTACK,numFainted,user)
|
user.pbRaiseStatStageByAbility(:ATTACK,numFainted,user)
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
|
|
||||||
@@ -1703,8 +1704,8 @@ BattleHandlers::TargetAbilityAfterMoveUse.add(:BERSERK,
|
|||||||
proc { |ability,target,user,move,switched,battle|
|
proc { |ability,target,user,move,switched,battle|
|
||||||
next if !move.damagingMove?
|
next if !move.damagingMove?
|
||||||
next if target.damageState.initialHP<target.totalhp/2 || target.hp>=target.totalhp/2
|
next if target.damageState.initialHP<target.totalhp/2 || target.hp>=target.totalhp/2
|
||||||
next if !target.pbCanRaiseStatStage?(PBStats::SPATK,target)
|
next if !target.pbCanRaiseStatStage?(:SPECIAL_ATTACK,target)
|
||||||
target.pbRaiseStatStageByAbility(PBStats::SPATK,1,target)
|
target.pbRaiseStatStageByAbility(:SPECIAL_ATTACK,1,target)
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
|
|
||||||
@@ -1936,10 +1937,11 @@ BattleHandlers::EOREffectAbility.add(:BADDREAMS,
|
|||||||
|
|
||||||
BattleHandlers::EOREffectAbility.add(:MOODY,
|
BattleHandlers::EOREffectAbility.add(:MOODY,
|
||||||
proc { |ability,battler,battle|
|
proc { |ability,battler,battle|
|
||||||
randomUp = []; randomDown = []
|
randomUp = []
|
||||||
PBStats.eachBattleStat do |s|
|
randomDown = []
|
||||||
randomUp.push(s) if battler.pbCanRaiseStatStage?(s,battler)
|
GameData::Stat.each_battle do |s|
|
||||||
randomDown.push(s) if battler.pbCanLowerStatStage?(s,battler)
|
randomUp.push(s.id) if battler.pbCanRaiseStatStage?(s.id, battler)
|
||||||
|
randomDown.push(s.id) if battler.pbCanLowerStatStage?(s.id, battler)
|
||||||
end
|
end
|
||||||
next if randomUp.length==0 && randomDown.length==0
|
next if randomUp.length==0 && randomDown.length==0
|
||||||
battle.pbShowAbilitySplash(battler)
|
battle.pbShowAbilitySplash(battler)
|
||||||
@@ -1961,8 +1963,8 @@ BattleHandlers::EOREffectAbility.add(:SPEEDBOOST,
|
|||||||
proc { |ability,battler,battle|
|
proc { |ability,battler,battle|
|
||||||
# A Pokémon's turnCount is 0 if it became active after the beginning of a
|
# A Pokémon's turnCount is 0 if it became active after the beginning of a
|
||||||
# round
|
# round
|
||||||
if battler.turnCount>0 && battler.pbCanRaiseStatStage?(PBStats::SPEED,battler)
|
if battler.turnCount>0 && battler.pbCanRaiseStatStage?(:SPEED,battler)
|
||||||
battler.pbRaiseStatStageByAbility(PBStats::SPEED,1,battler)
|
battler.pbRaiseStatStageByAbility(:SPEED,1,battler)
|
||||||
end
|
end
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
@@ -2138,7 +2140,7 @@ BattleHandlers::AbilityOnSwitchIn.add(:DOWNLOAD,
|
|||||||
oDef += b.defense
|
oDef += b.defense
|
||||||
oSpDef += b.spdef
|
oSpDef += b.spdef
|
||||||
end
|
end
|
||||||
stat = (oDef<oSpDef) ? PBStats::ATTACK : PBStats::SPATK
|
stat = (oDef<oSpDef) ? :ATTACK : :SPECIAL_ATTACK
|
||||||
battler.pbRaiseStatStageByAbility(stat,1,battler)
|
battler.pbRaiseStatStageByAbility(stat,1,battler)
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
@@ -2408,7 +2410,7 @@ BattleHandlers::AbilityChangeOnBattlerFainting.copy(:POWEROFALCHEMY,:RECEIVER)
|
|||||||
|
|
||||||
BattleHandlers::AbilityOnBattlerFainting.add(:SOULHEART,
|
BattleHandlers::AbilityOnBattlerFainting.add(:SOULHEART,
|
||||||
proc { |ability,battler,fainted,battle|
|
proc { |ability,battler,fainted,battle|
|
||||||
battler.pbRaiseStatStageByAbility(PBStats::SPATK,1,battler)
|
battler.pbRaiseStatStageByAbility(:SPECIAL_ATTACK,1,battler)
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|||||||
@@ -54,7 +54,7 @@ BattleHandlers::HPHealItem.add(:AGUAVBERRY,
|
|||||||
|
|
||||||
BattleHandlers::HPHealItem.add(:APICOTBERRY,
|
BattleHandlers::HPHealItem.add(:APICOTBERRY,
|
||||||
proc { |item,battler,battle,forced|
|
proc { |item,battler,battle,forced|
|
||||||
next pbBattleStatIncreasingBerry(battler,battle,item,forced,PBStats::SPDEF)
|
next pbBattleStatIncreasingBerry(battler,battle,item,forced,:SPECIAL_DEFENSE)
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
|
|
||||||
@@ -84,7 +84,7 @@ BattleHandlers::HPHealItem.add(:FIGYBERRY,
|
|||||||
|
|
||||||
BattleHandlers::HPHealItem.add(:GANLONBERRY,
|
BattleHandlers::HPHealItem.add(:GANLONBERRY,
|
||||||
proc { |item,battler,battle,forced|
|
proc { |item,battler,battle,forced|
|
||||||
next pbBattleStatIncreasingBerry(battler,battle,item,forced,PBStats::DEFENSE)
|
next pbBattleStatIncreasingBerry(battler,battle,item,forced,:DEFENSE)
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
|
|
||||||
@@ -113,7 +113,7 @@ BattleHandlers::HPHealItem.add(:LANSATBERRY,
|
|||||||
|
|
||||||
BattleHandlers::HPHealItem.add(:LIECHIBERRY,
|
BattleHandlers::HPHealItem.add(:LIECHIBERRY,
|
||||||
proc { |item,battler,battle,forced|
|
proc { |item,battler,battle,forced|
|
||||||
next pbBattleStatIncreasingBerry(battler,battle,item,forced,PBStats::ATTACK)
|
next pbBattleStatIncreasingBerry(battler,battle,item,forced,:ATTACK)
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
|
|
||||||
@@ -161,13 +161,13 @@ BattleHandlers::HPHealItem.add(:ORANBERRY,
|
|||||||
|
|
||||||
BattleHandlers::HPHealItem.add(:PETAYABERRY,
|
BattleHandlers::HPHealItem.add(:PETAYABERRY,
|
||||||
proc { |item,battler,battle,forced|
|
proc { |item,battler,battle,forced|
|
||||||
next pbBattleStatIncreasingBerry(battler,battle,item,forced,PBStats::SPATK)
|
next pbBattleStatIncreasingBerry(battler,battle,item,forced,:SPECIAL_ATTACK)
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
|
|
||||||
BattleHandlers::HPHealItem.add(:SALACBERRY,
|
BattleHandlers::HPHealItem.add(:SALACBERRY,
|
||||||
proc { |item,battler,battle,forced|
|
proc { |item,battler,battle,forced|
|
||||||
next pbBattleStatIncreasingBerry(battler,battle,item,forced,PBStats::SPEED)
|
next pbBattleStatIncreasingBerry(battler,battle,item,forced,:SPEED)
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
|
|
||||||
@@ -191,7 +191,7 @@ BattleHandlers::HPHealItem.add(:SITRUSBERRY,
|
|||||||
BattleHandlers::HPHealItem.add(:STARFBERRY,
|
BattleHandlers::HPHealItem.add(:STARFBERRY,
|
||||||
proc { |item,battler,battle,forced|
|
proc { |item,battler,battle,forced|
|
||||||
stats = []
|
stats = []
|
||||||
PBStats.eachMainBattleStat { |s| stats.push(s) if battler.pbCanRaiseStatStage?(s,battler) }
|
GameData::Stat.each_main_battle { |s| stats.push(s.id) if battler.pbCanRaiseStatStage?(s.id, battler) }
|
||||||
next false if stats.length==0
|
next false if stats.length==0
|
||||||
stat = stats[battle.pbRandom(stats.length)]
|
stat = stats[battle.pbRandom(stats.length)]
|
||||||
next pbBattleStatIncreasingBerry(battler,battle,item,forced,stat,2)
|
next pbBattleStatIncreasingBerry(battler,battle,item,forced,stat,2)
|
||||||
@@ -995,9 +995,9 @@ BattleHandlers::CriticalCalcUserItem.add(:STICK,
|
|||||||
BattleHandlers::TargetItemOnHit.add(:ABSORBBULB,
|
BattleHandlers::TargetItemOnHit.add(:ABSORBBULB,
|
||||||
proc { |item,user,target,move,battle|
|
proc { |item,user,target,move,battle|
|
||||||
next if move.calcType != :WATER
|
next if move.calcType != :WATER
|
||||||
next if !target.pbCanRaiseStatStage?(PBStats::SPATK,target)
|
next if !target.pbCanRaiseStatStage?(:SPECIAL_ATTACK,target)
|
||||||
battle.pbCommonAnimation("UseItem",target)
|
battle.pbCommonAnimation("UseItem",target)
|
||||||
target.pbRaiseStatStageByCause(PBStats::SPATK,1,target,target.itemName)
|
target.pbRaiseStatStageByCause(:SPECIAL_ATTACK,1,target,target.itemName)
|
||||||
target.pbHeldItemTriggered(item)
|
target.pbHeldItemTriggered(item)
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
@@ -1013,9 +1013,9 @@ BattleHandlers::TargetItemOnHit.add(:AIRBALLOON,
|
|||||||
BattleHandlers::TargetItemOnHit.add(:CELLBATTERY,
|
BattleHandlers::TargetItemOnHit.add(:CELLBATTERY,
|
||||||
proc { |item,user,target,move,battle|
|
proc { |item,user,target,move,battle|
|
||||||
next if move.calcType != :ELECTRIC
|
next if move.calcType != :ELECTRIC
|
||||||
next if !target.pbCanRaiseStatStage?(PBStats::ATTACK,target)
|
next if !target.pbCanRaiseStatStage?(:ATTACK,target)
|
||||||
battle.pbCommonAnimation("UseItem",target)
|
battle.pbCommonAnimation("UseItem",target)
|
||||||
target.pbRaiseStatStageByCause(PBStats::ATTACK,1,target,target.itemName)
|
target.pbRaiseStatStageByCause(:ATTACK,1,target,target.itemName)
|
||||||
target.pbHeldItemTriggered(item)
|
target.pbHeldItemTriggered(item)
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
@@ -1061,9 +1061,9 @@ BattleHandlers::TargetItemOnHit.add(:KEEBERRY,
|
|||||||
BattleHandlers::TargetItemOnHit.add(:LUMINOUSMOSS,
|
BattleHandlers::TargetItemOnHit.add(:LUMINOUSMOSS,
|
||||||
proc { |item,user,target,move,battle|
|
proc { |item,user,target,move,battle|
|
||||||
next if move.calcType != :WATER
|
next if move.calcType != :WATER
|
||||||
next if !target.pbCanRaiseStatStage?(PBStats::SPDEF,target)
|
next if !target.pbCanRaiseStatStage?(:SPECIAL_DEFENSE,target)
|
||||||
battle.pbCommonAnimation("UseItem",target)
|
battle.pbCommonAnimation("UseItem",target)
|
||||||
target.pbRaiseStatStageByCause(PBStats::SPDEF,1,target,target.itemName)
|
target.pbRaiseStatStageByCause(:SPECIAL_DEFENSE,1,target,target.itemName)
|
||||||
target.pbHeldItemTriggered(item)
|
target.pbHeldItemTriggered(item)
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
@@ -1109,9 +1109,9 @@ BattleHandlers::TargetItemOnHit.add(:ROWAPBERRY,
|
|||||||
BattleHandlers::TargetItemOnHit.add(:SNOWBALL,
|
BattleHandlers::TargetItemOnHit.add(:SNOWBALL,
|
||||||
proc { |item,user,target,move,battle|
|
proc { |item,user,target,move,battle|
|
||||||
next if move.calcType != :ICE
|
next if move.calcType != :ICE
|
||||||
next if !target.pbCanRaiseStatStage?(PBStats::ATTACK,target)
|
next if !target.pbCanRaiseStatStage?(:ATTACK,target)
|
||||||
battle.pbCommonAnimation("UseItem",target)
|
battle.pbCommonAnimation("UseItem",target)
|
||||||
target.pbRaiseStatStageByCause(PBStats::ATTACK,1,target,target.itemName)
|
target.pbRaiseStatStageByCause(:ATTACK,1,target,target.itemName)
|
||||||
target.pbHeldItemTriggered(item)
|
target.pbHeldItemTriggered(item)
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
@@ -1138,16 +1138,16 @@ BattleHandlers::TargetItemOnHit.add(:WEAKNESSPOLICY,
|
|||||||
proc { |item,user,target,move,battle|
|
proc { |item,user,target,move,battle|
|
||||||
next if target.damageState.disguise
|
next if target.damageState.disguise
|
||||||
next if !PBTypeEffectiveness.superEffective?(target.damageState.typeMod)
|
next if !PBTypeEffectiveness.superEffective?(target.damageState.typeMod)
|
||||||
next if !target.pbCanRaiseStatStage?(PBStats::ATTACK,target) &&
|
next if !target.pbCanRaiseStatStage?(:ATTACK,target) &&
|
||||||
!target.pbCanRaiseStatStage?(PBStats::SPATK,target)
|
!target.pbCanRaiseStatStage?(:SPECIAL_ATTACK,target)
|
||||||
battle.pbCommonAnimation("UseItem",target)
|
battle.pbCommonAnimation("UseItem",target)
|
||||||
showAnim = true
|
showAnim = true
|
||||||
if target.pbCanRaiseStatStage?(PBStats::ATTACK,target)
|
if target.pbCanRaiseStatStage?(:ATTACK,target)
|
||||||
target.pbRaiseStatStageByCause(PBStats::ATTACK,2,target,target.itemName,showAnim)
|
target.pbRaiseStatStageByCause(:ATTACK,2,target,target.itemName,showAnim)
|
||||||
showAnim = false
|
showAnim = false
|
||||||
end
|
end
|
||||||
if target.pbCanRaiseStatStage?(PBStats::SPATK,target)
|
if target.pbCanRaiseStatStage?(:SPECIAL_ATTACK,target)
|
||||||
target.pbRaiseStatStageByCause(PBStats::SPATK,2,target,target.itemName,showAnim)
|
target.pbRaiseStatStageByCause(:SPECIAL_ATTACK,2,target,target.itemName,showAnim)
|
||||||
end
|
end
|
||||||
target.pbHeldItemTriggered(item)
|
target.pbHeldItemTriggered(item)
|
||||||
}
|
}
|
||||||
@@ -1180,28 +1180,28 @@ BattleHandlers::TargetItemOnHitPositiveBerry.add(:ENIGMABERRY,
|
|||||||
BattleHandlers::TargetItemOnHitPositiveBerry.add(:KEEBERRY,
|
BattleHandlers::TargetItemOnHitPositiveBerry.add(:KEEBERRY,
|
||||||
proc { |item,battler,battle,forced|
|
proc { |item,battler,battle,forced|
|
||||||
next false if !forced && !battler.canConsumeBerry?
|
next false if !forced && !battler.canConsumeBerry?
|
||||||
next false if !battler.pbCanRaiseStatStage?(PBStats::DEFENSE,battler)
|
next false if !battler.pbCanRaiseStatStage?(:DEFENSE,battler)
|
||||||
itemName = GameData::Item.get(item).name
|
itemName = GameData::Item.get(item).name
|
||||||
if !forced
|
if !forced
|
||||||
battle.pbCommonAnimation("EatBerry",battler)
|
battle.pbCommonAnimation("EatBerry",battler)
|
||||||
next battler.pbRaiseStatStageByCause(PBStats::DEFENSE,1,battler,itemName)
|
next battler.pbRaiseStatStageByCause(:DEFENSE,1,battler,itemName)
|
||||||
end
|
end
|
||||||
PBDebug.log("[Item triggered] #{battler.pbThis}'s #{itemName}")
|
PBDebug.log("[Item triggered] #{battler.pbThis}'s #{itemName}")
|
||||||
next battler.pbRaiseStatStage(PBStats::DEFENSE,1,battler)
|
next battler.pbRaiseStatStage(:DEFENSE,1,battler)
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
|
|
||||||
BattleHandlers::TargetItemOnHitPositiveBerry.add(:MARANGABERRY,
|
BattleHandlers::TargetItemOnHitPositiveBerry.add(:MARANGABERRY,
|
||||||
proc { |item,battler,battle,forced|
|
proc { |item,battler,battle,forced|
|
||||||
next false if !forced && !battler.canConsumeBerry?
|
next false if !forced && !battler.canConsumeBerry?
|
||||||
next false if !battler.pbCanRaiseStatStage?(PBStats::SPDEF,battler)
|
next false if !battler.pbCanRaiseStatStage?(:SPECIAL_DEFENSE,battler)
|
||||||
itemName = GameData::Item.get(item).name
|
itemName = GameData::Item.get(item).name
|
||||||
if !forced
|
if !forced
|
||||||
battle.pbCommonAnimation("EatBerry",battler)
|
battle.pbCommonAnimation("EatBerry",battler)
|
||||||
next battler.pbRaiseStatStageByCause(PBStats::SPDEF,1,battler,itemName)
|
next battler.pbRaiseStatStageByCause(:SPECIAL_DEFENSE,1,battler,itemName)
|
||||||
end
|
end
|
||||||
PBDebug.log("[Item triggered] #{battler.pbThis}'s #{itemName}")
|
PBDebug.log("[Item triggered] #{battler.pbThis}'s #{itemName}")
|
||||||
next battler.pbRaiseStatStage(PBStats::SPDEF,1,battler)
|
next battler.pbRaiseStatStage(:SPECIAL_DEFENSE,1,battler)
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
|
|
||||||
@@ -1313,9 +1313,9 @@ BattleHandlers::EndOfMoveItem.add(:LEPPABERRY,
|
|||||||
BattleHandlers::EndOfMoveStatRestoreItem.add(:WHITEHERB,
|
BattleHandlers::EndOfMoveStatRestoreItem.add(:WHITEHERB,
|
||||||
proc { |item,battler,battle,forced|
|
proc { |item,battler,battle,forced|
|
||||||
reducedStats = false
|
reducedStats = false
|
||||||
PBStats.eachBattleStat do |s|
|
GameData::Stat.each_battle do |s|
|
||||||
next if battler.stages[s]>=0
|
next if battler.stages[s.id] >= 0
|
||||||
battler.stages[s] = 0
|
battler.stages[s.id] = 0
|
||||||
reducedStats = true
|
reducedStats = true
|
||||||
end
|
end
|
||||||
next false if !reducedStats
|
next false if !reducedStats
|
||||||
@@ -1348,43 +1348,43 @@ BattleHandlers::ExpGainModifierItem.add(:LUCKYEGG,
|
|||||||
|
|
||||||
BattleHandlers::EVGainModifierItem.add(:MACHOBRACE,
|
BattleHandlers::EVGainModifierItem.add(:MACHOBRACE,
|
||||||
proc { |item,battler,evYield|
|
proc { |item,battler,evYield|
|
||||||
evYield.collect! { |a| a*2 }
|
evYield.each_key { |stat| evYield[stat] *= 2 }
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
|
|
||||||
BattleHandlers::EVGainModifierItem.add(:POWERANKLET,
|
BattleHandlers::EVGainModifierItem.add(:POWERANKLET,
|
||||||
proc { |item,battler,evYield|
|
proc { |item,battler,evYield|
|
||||||
evYield[PBStats::SPEED] += 4
|
evYield[:SPEED] += 4
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
|
|
||||||
BattleHandlers::EVGainModifierItem.add(:POWERBAND,
|
BattleHandlers::EVGainModifierItem.add(:POWERBAND,
|
||||||
proc { |item,battler,evYield|
|
proc { |item,battler,evYield|
|
||||||
evYield[PBStats::SPDEF] += 4
|
evYield[:SPECIAL_DEFENSE] += 4
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
|
|
||||||
BattleHandlers::EVGainModifierItem.add(:POWERBELT,
|
BattleHandlers::EVGainModifierItem.add(:POWERBELT,
|
||||||
proc { |item,battler,evYield|
|
proc { |item,battler,evYield|
|
||||||
evYield[PBStats::DEFENSE] += 4
|
evYield[:DEFENSE] += 4
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
|
|
||||||
BattleHandlers::EVGainModifierItem.add(:POWERBRACER,
|
BattleHandlers::EVGainModifierItem.add(:POWERBRACER,
|
||||||
proc { |item,battler,evYield|
|
proc { |item,battler,evYield|
|
||||||
evYield[PBStats::ATTACK] += 4
|
evYield[:ATTACK] += 4
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
|
|
||||||
BattleHandlers::EVGainModifierItem.add(:POWERLENS,
|
BattleHandlers::EVGainModifierItem.add(:POWERLENS,
|
||||||
proc { |item,battler,evYield|
|
proc { |item,battler,evYield|
|
||||||
evYield[PBStats::SPATK] += 4
|
evYield[:SPECIAL_ATTACK] += 4
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
|
|
||||||
BattleHandlers::EVGainModifierItem.add(:POWERWEIGHT,
|
BattleHandlers::EVGainModifierItem.add(:POWERWEIGHT,
|
||||||
proc { |item,battler,evYield|
|
proc { |item,battler,evYield|
|
||||||
evYield[PBStats::HP] += 4
|
evYield[:HP] += 4
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
|
|
||||||
@@ -1433,40 +1433,40 @@ BattleHandlers::TerrainExtenderItem.add(:TERRAINEXTENDER,
|
|||||||
BattleHandlers::TerrainStatBoostItem.add(:ELECTRICSEED,
|
BattleHandlers::TerrainStatBoostItem.add(:ELECTRICSEED,
|
||||||
proc { |item,battler,battle|
|
proc { |item,battler,battle|
|
||||||
next false if battle.field.terrain != :Electric
|
next false if battle.field.terrain != :Electric
|
||||||
next false if !battler.pbCanRaiseStatStage?(PBStats::DEFENSE,battler)
|
next false if !battler.pbCanRaiseStatStage?(:DEFENSE,battler)
|
||||||
itemName = GameData::Item.get(item).name
|
itemName = GameData::Item.get(item).name
|
||||||
battle.pbCommonAnimation("UseItem",battler)
|
battle.pbCommonAnimation("UseItem",battler)
|
||||||
next battler.pbRaiseStatStageByCause(PBStats::DEFENSE,1,battler,itemName)
|
next battler.pbRaiseStatStageByCause(:DEFENSE,1,battler,itemName)
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
|
|
||||||
BattleHandlers::TerrainStatBoostItem.add(:GRASSYSEED,
|
BattleHandlers::TerrainStatBoostItem.add(:GRASSYSEED,
|
||||||
proc { |item,battler,battle|
|
proc { |item,battler,battle|
|
||||||
next false if battle.field.terrain != :Grassy
|
next false if battle.field.terrain != :Grassy
|
||||||
next false if !battler.pbCanRaiseStatStage?(PBStats::DEFENSE,battler)
|
next false if !battler.pbCanRaiseStatStage?(:DEFENSE,battler)
|
||||||
itemName = GameData::Item.get(item).name
|
itemName = GameData::Item.get(item).name
|
||||||
battle.pbCommonAnimation("UseItem",battler)
|
battle.pbCommonAnimation("UseItem",battler)
|
||||||
next battler.pbRaiseStatStageByCause(PBStats::DEFENSE,1,battler,itemName)
|
next battler.pbRaiseStatStageByCause(:DEFENSE,1,battler,itemName)
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
|
|
||||||
BattleHandlers::TerrainStatBoostItem.add(:MISTYSEED,
|
BattleHandlers::TerrainStatBoostItem.add(:MISTYSEED,
|
||||||
proc { |item,battler,battle|
|
proc { |item,battler,battle|
|
||||||
next false if battle.field.terrain != :Misty
|
next false if battle.field.terrain != :Misty
|
||||||
next false if !battler.pbCanRaiseStatStage?(PBStats::SPDEF,battler)
|
next false if !battler.pbCanRaiseStatStage?(:SPECIAL_DEFENSE,battler)
|
||||||
itemName = GameData::Item.get(item).name
|
itemName = GameData::Item.get(item).name
|
||||||
battle.pbCommonAnimation("UseItem",battler)
|
battle.pbCommonAnimation("UseItem",battler)
|
||||||
next battler.pbRaiseStatStageByCause(PBStats::SPDEF,1,battler,itemName)
|
next battler.pbRaiseStatStageByCause(:SPECIAL_DEFENSE,1,battler,itemName)
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
|
|
||||||
BattleHandlers::TerrainStatBoostItem.add(:PSYCHICSEED,
|
BattleHandlers::TerrainStatBoostItem.add(:PSYCHICSEED,
|
||||||
proc { |item,battler,battle|
|
proc { |item,battler,battle|
|
||||||
next false if battle.field.terrain != :Psychic
|
next false if battle.field.terrain != :Psychic
|
||||||
next false if !battler.pbCanRaiseStatStage?(PBStats::SPDEF,battler)
|
next false if !battler.pbCanRaiseStatStage?(:SPECIAL_DEFENSE,battler)
|
||||||
itemName = GameData::Item.get(item).name
|
itemName = GameData::Item.get(item).name
|
||||||
battle.pbCommonAnimation("UseItem",battler)
|
battle.pbCommonAnimation("UseItem",battler)
|
||||||
next battler.pbRaiseStatStageByCause(PBStats::SPDEF,1,battler,itemName)
|
next battler.pbRaiseStatStageByCause(:SPECIAL_DEFENSE,1,battler,itemName)
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
|
|
||||||
@@ -1570,10 +1570,10 @@ BattleHandlers::ItemOnSwitchIn.add(:AIRBALLOON,
|
|||||||
|
|
||||||
BattleHandlers::ItemOnIntimidated.add(:ADRENALINEORB,
|
BattleHandlers::ItemOnIntimidated.add(:ADRENALINEORB,
|
||||||
proc { |item,battler,battle|
|
proc { |item,battler,battle|
|
||||||
next false if !battler.pbCanRaiseStatStage?(PBStats::SPEED,battler)
|
next false if !battler.pbCanRaiseStatStage?(:SPEED,battler)
|
||||||
itemName = GameData::Item.get(item).name
|
itemName = GameData::Item.get(item).name
|
||||||
battle.pbCommonAnimation("UseItem",battler)
|
battle.pbCommonAnimation("UseItem",battler)
|
||||||
next battler.pbRaiseStatStageByCause(PBStats::SPEED,1,battler,itemName)
|
next battler.pbRaiseStatStageByCause(:SPEED,1,battler,itemName)
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|||||||
@@ -143,7 +143,7 @@ BallHandlers::ModifyCatchRate.add(:QUICKBALL,proc { |ball,catchRate,battle,battl
|
|||||||
|
|
||||||
BallHandlers::ModifyCatchRate.add(:FASTBALL,proc { |ball,catchRate,battle,battler,ultraBeast|
|
BallHandlers::ModifyCatchRate.add(:FASTBALL,proc { |ball,catchRate,battle,battler,ultraBeast|
|
||||||
baseStats = battler.pokemon.baseStats
|
baseStats = battler.pokemon.baseStats
|
||||||
baseSpeed = baseStats[PBStats::SPEED]
|
baseSpeed = baseStats[:SPEED]
|
||||||
catchRate *= 4 if baseSpeed >= 100
|
catchRate *= 4 if baseSpeed >= 100
|
||||||
next [catchRate, 255].min
|
next [catchRate, 255].min
|
||||||
})
|
})
|
||||||
|
|||||||
@@ -269,21 +269,20 @@ def pbDayCareGenerateEgg
|
|||||||
finalmoves.push(Pokemon::Move.new(moves[i]))
|
finalmoves.push(Pokemon::Move.new(moves[i]))
|
||||||
end
|
end
|
||||||
# Inheriting Individual Values
|
# Inheriting Individual Values
|
||||||
ivs = []
|
ivs = {}
|
||||||
for i in 0...6
|
GameData::Stat.each_main { |s| ivs[s.id] = rand(Pokemon::IV_STAT_LIMIT + 1) }
|
||||||
ivs[i] = rand(32)
|
|
||||||
end
|
|
||||||
ivinherit = []
|
ivinherit = []
|
||||||
for i in 0...2
|
for i in 0...2
|
||||||
parent = [mother,father][i]
|
parent = [mother,father][i]
|
||||||
ivinherit[i] = PBStats::HP if parent.hasItem?(:POWERWEIGHT)
|
ivinherit[i] = :HP if parent.hasItem?(:POWERWEIGHT)
|
||||||
ivinherit[i] = PBStats::ATTACK if parent.hasItem?(:POWERBRACER)
|
ivinherit[i] = :ATTACK if parent.hasItem?(:POWERBRACER)
|
||||||
ivinherit[i] = PBStats::DEFENSE if parent.hasItem?(:POWERBELT)
|
ivinherit[i] = :DEFENSE if parent.hasItem?(:POWERBELT)
|
||||||
ivinherit[i] = PBStats::SPATK if parent.hasItem?(:POWERLENS)
|
ivinherit[i] = :SPECIAL_ATTACK if parent.hasItem?(:POWERLENS)
|
||||||
ivinherit[i] = PBStats::SPDEF if parent.hasItem?(:POWERBAND)
|
ivinherit[i] = :SPECIAL_DEFENSE if parent.hasItem?(:POWERBAND)
|
||||||
ivinherit[i] = PBStats::SPEED if parent.hasItem?(:POWERANKLET)
|
ivinherit[i] = :SPEED if parent.hasItem?(:POWERANKLET)
|
||||||
end
|
end
|
||||||
num = 0; r = rand(2)
|
num = 0
|
||||||
|
r = rand(2)
|
||||||
2.times do
|
2.times do
|
||||||
if ivinherit[r]!=nil
|
if ivinherit[r]!=nil
|
||||||
parent = [mother,father][r]
|
parent = [mother,father][r]
|
||||||
@@ -296,7 +295,7 @@ def pbDayCareGenerateEgg
|
|||||||
limit = (mother.hasItem?(:DESTINYKNOT) || father.hasItem?(:DESTINYKNOT)) ? 5 : 3
|
limit = (mother.hasItem?(:DESTINYKNOT) || father.hasItem?(:DESTINYKNOT)) ? 5 : 3
|
||||||
loop do
|
loop do
|
||||||
freestats = []
|
freestats = []
|
||||||
PBStats.eachStat { |s| freestats.push(s) if !ivinherit.include?(s) }
|
GameData::Stat.each_main { |s| freestats.push(s.id) if !ivinherit.include?(s.id) }
|
||||||
break if freestats.length==0
|
break if freestats.length==0
|
||||||
r = freestats[rand(freestats.length)]
|
r = freestats[rand(freestats.length)]
|
||||||
parent = [mother,father][rand(2)]
|
parent = [mother,father][rand(2)]
|
||||||
|
|||||||
@@ -264,49 +264,37 @@ end
|
|||||||
#===============================================================================
|
#===============================================================================
|
||||||
# Change EVs
|
# Change EVs
|
||||||
#===============================================================================
|
#===============================================================================
|
||||||
def pbJustRaiseEffortValues(pkmn,ev,evgain)
|
def pbJustRaiseEffortValues(pkmn, stat, evGain)
|
||||||
totalev = 0
|
stat = GameData::Stat.get(stat).id
|
||||||
for i in 0...6
|
evTotal = 0
|
||||||
totalev += pkmn.ev[i]
|
GameData::Stat.each_main { |s| evTotal += pkmn.ev[s.id] }
|
||||||
end
|
evGain = evGain.clamp(0, Pokemon::EV_STAT_LIMIT - pkmn.ev[stat])
|
||||||
if totalev+evgain>Pokemon::EV_LIMIT
|
evGain = evGain.clamp(0, Pokemon::EV_LIMIT - evTotal)
|
||||||
evgain = Pokemon::EV_LIMIT-totalev
|
if evGain > 0
|
||||||
end
|
pkmn.ev[stat] += evGain
|
||||||
if pkmn.ev[ev]+evgain>Pokemon::EV_STAT_LIMIT
|
|
||||||
evgain = Pokemon::EV_STAT_LIMIT-pkmn.ev[ev]
|
|
||||||
end
|
|
||||||
if evgain>0
|
|
||||||
pkmn.ev[ev] += evgain
|
|
||||||
pkmn.calcStats
|
pkmn.calcStats
|
||||||
end
|
end
|
||||||
return evgain
|
return evGain
|
||||||
end
|
end
|
||||||
|
|
||||||
def pbRaiseEffortValues(pkmn,ev,evgain=10,evlimit=true)
|
def pbRaiseEffortValues(pkmn, stat, evGain = 10, ev_limit = true)
|
||||||
return 0 if evlimit && pkmn.ev[ev]>=100
|
stat = GameData::Stat.get(stat).id
|
||||||
totalev = 0
|
return 0 if ev_limit && pkmn.ev[stat] >= 100
|
||||||
for i in 0...6
|
evTotal = 0
|
||||||
totalev += pkmn.ev[i]
|
GameData::Stat.each_main { |s| evTotal += pkmn.ev[s.id] }
|
||||||
end
|
evGain = evGain.clamp(0, Pokemon::EV_STAT_LIMIT - pkmn.ev[stat])
|
||||||
if totalev+evgain>Pokemon::EV_LIMIT
|
evGain = evGain.clamp(0, 100 - pkmn.ev[stat]) if ev_limit
|
||||||
evgain = Pokemon::EV_LIMIT-totalev
|
evGain = evGain.clamp(0, Pokemon::EV_LIMIT - evTotal)
|
||||||
end
|
if evGain > 0
|
||||||
if pkmn.ev[ev]+evgain>Pokemon::EV_STAT_LIMIT
|
pkmn.ev[stat] += evGain
|
||||||
evgain = Pokemon::EV_STAT_LIMIT-pkmn.ev[ev]
|
|
||||||
end
|
|
||||||
if evlimit && pkmn.ev[ev]+evgain>100
|
|
||||||
evgain = 100-pkmn.ev[ev]
|
|
||||||
end
|
|
||||||
if evgain>0
|
|
||||||
pkmn.ev[ev] += evgain
|
|
||||||
pkmn.calcStats
|
pkmn.calcStats
|
||||||
end
|
end
|
||||||
return evgain
|
return evGain
|
||||||
end
|
end
|
||||||
|
|
||||||
def pbRaiseHappinessAndLowerEV(pkmn,scene,ev,messages)
|
def pbRaiseHappinessAndLowerEV(pkmn,scene,stat,messages)
|
||||||
h = pkmn.happiness<255
|
h = pkmn.happiness<255
|
||||||
e = pkmn.ev[ev]>0
|
e = pkmn.ev[stat]>0
|
||||||
if !h && !e
|
if !h && !e
|
||||||
scene.pbDisplay(_INTL("It won't have any effect."))
|
scene.pbDisplay(_INTL("It won't have any effect."))
|
||||||
return false
|
return false
|
||||||
@@ -315,8 +303,8 @@ def pbRaiseHappinessAndLowerEV(pkmn,scene,ev,messages)
|
|||||||
pkmn.changeHappiness("evberry")
|
pkmn.changeHappiness("evberry")
|
||||||
end
|
end
|
||||||
if e
|
if e
|
||||||
pkmn.ev[ev] -= 10
|
pkmn.ev[stat] -= 10
|
||||||
pkmn.ev[ev] = 0 if pkmn.ev[ev]<0
|
pkmn.ev[stat] = 0 if pkmn.ev[stat]<0
|
||||||
pkmn.calcStats
|
pkmn.calcStats
|
||||||
end
|
end
|
||||||
scene.pbRefresh
|
scene.pbRefresh
|
||||||
|
|||||||
@@ -654,7 +654,7 @@ ItemHandlers::UseOnPokemon.add(:PPMAX,proc { |item,pkmn,scene|
|
|||||||
})
|
})
|
||||||
|
|
||||||
ItemHandlers::UseOnPokemon.add(:HPUP,proc { |item,pkmn,scene|
|
ItemHandlers::UseOnPokemon.add(:HPUP,proc { |item,pkmn,scene|
|
||||||
if pbRaiseEffortValues(pkmn,PBStats::HP)==0
|
if pbRaiseEffortValues(pkmn,:HP)==0
|
||||||
scene.pbDisplay(_INTL("It won't have any effect."))
|
scene.pbDisplay(_INTL("It won't have any effect."))
|
||||||
next false
|
next false
|
||||||
end
|
end
|
||||||
@@ -665,7 +665,7 @@ ItemHandlers::UseOnPokemon.add(:HPUP,proc { |item,pkmn,scene|
|
|||||||
})
|
})
|
||||||
|
|
||||||
ItemHandlers::UseOnPokemon.add(:PROTEIN,proc { |item,pkmn,scene|
|
ItemHandlers::UseOnPokemon.add(:PROTEIN,proc { |item,pkmn,scene|
|
||||||
if pbRaiseEffortValues(pkmn,PBStats::ATTACK)==0
|
if pbRaiseEffortValues(pkmn,:ATTACK)==0
|
||||||
scene.pbDisplay(_INTL("It won't have any effect."))
|
scene.pbDisplay(_INTL("It won't have any effect."))
|
||||||
next false
|
next false
|
||||||
end
|
end
|
||||||
@@ -675,7 +675,7 @@ ItemHandlers::UseOnPokemon.add(:PROTEIN,proc { |item,pkmn,scene|
|
|||||||
})
|
})
|
||||||
|
|
||||||
ItemHandlers::UseOnPokemon.add(:IRON,proc { |item,pkmn,scene|
|
ItemHandlers::UseOnPokemon.add(:IRON,proc { |item,pkmn,scene|
|
||||||
if pbRaiseEffortValues(pkmn,PBStats::DEFENSE)==0
|
if pbRaiseEffortValues(pkmn,:DEFENSE)==0
|
||||||
scene.pbDisplay(_INTL("It won't have any effect."))
|
scene.pbDisplay(_INTL("It won't have any effect."))
|
||||||
next false
|
next false
|
||||||
end
|
end
|
||||||
@@ -685,7 +685,7 @@ ItemHandlers::UseOnPokemon.add(:IRON,proc { |item,pkmn,scene|
|
|||||||
})
|
})
|
||||||
|
|
||||||
ItemHandlers::UseOnPokemon.add(:CALCIUM,proc { |item,pkmn,scene|
|
ItemHandlers::UseOnPokemon.add(:CALCIUM,proc { |item,pkmn,scene|
|
||||||
if pbRaiseEffortValues(pkmn,PBStats::SPATK)==0
|
if pbRaiseEffortValues(pkmn,:SPECIAL_ATTACK)==0
|
||||||
scene.pbDisplay(_INTL("It won't have any effect."))
|
scene.pbDisplay(_INTL("It won't have any effect."))
|
||||||
next false
|
next false
|
||||||
end
|
end
|
||||||
@@ -695,7 +695,7 @@ ItemHandlers::UseOnPokemon.add(:CALCIUM,proc { |item,pkmn,scene|
|
|||||||
})
|
})
|
||||||
|
|
||||||
ItemHandlers::UseOnPokemon.add(:ZINC,proc { |item,pkmn,scene|
|
ItemHandlers::UseOnPokemon.add(:ZINC,proc { |item,pkmn,scene|
|
||||||
if pbRaiseEffortValues(pkmn,PBStats::SPDEF)==0
|
if pbRaiseEffortValues(pkmn,:SPECIAL_DEFENSE)==0
|
||||||
scene.pbDisplay(_INTL("It won't have any effect."))
|
scene.pbDisplay(_INTL("It won't have any effect."))
|
||||||
next false
|
next false
|
||||||
end
|
end
|
||||||
@@ -705,7 +705,7 @@ ItemHandlers::UseOnPokemon.add(:ZINC,proc { |item,pkmn,scene|
|
|||||||
})
|
})
|
||||||
|
|
||||||
ItemHandlers::UseOnPokemon.add(:CARBOS,proc { |item,pkmn,scene|
|
ItemHandlers::UseOnPokemon.add(:CARBOS,proc { |item,pkmn,scene|
|
||||||
if pbRaiseEffortValues(pkmn,PBStats::SPEED)==0
|
if pbRaiseEffortValues(pkmn,:SPEED)==0
|
||||||
scene.pbDisplay(_INTL("It won't have any effect."))
|
scene.pbDisplay(_INTL("It won't have any effect."))
|
||||||
next false
|
next false
|
||||||
end
|
end
|
||||||
@@ -715,7 +715,7 @@ ItemHandlers::UseOnPokemon.add(:CARBOS,proc { |item,pkmn,scene|
|
|||||||
})
|
})
|
||||||
|
|
||||||
ItemHandlers::UseOnPokemon.add(:HEALTHWING,proc { |item,pkmn,scene|
|
ItemHandlers::UseOnPokemon.add(:HEALTHWING,proc { |item,pkmn,scene|
|
||||||
if pbRaiseEffortValues(pkmn,PBStats::HP,1,false)==0
|
if pbRaiseEffortValues(pkmn,:HP,1,false)==0
|
||||||
scene.pbDisplay(_INTL("It won't have any effect."))
|
scene.pbDisplay(_INTL("It won't have any effect."))
|
||||||
next false
|
next false
|
||||||
end
|
end
|
||||||
@@ -726,7 +726,7 @@ ItemHandlers::UseOnPokemon.add(:HEALTHWING,proc { |item,pkmn,scene|
|
|||||||
})
|
})
|
||||||
|
|
||||||
ItemHandlers::UseOnPokemon.add(:MUSCLEWING,proc { |item,pkmn,scene|
|
ItemHandlers::UseOnPokemon.add(:MUSCLEWING,proc { |item,pkmn,scene|
|
||||||
if pbRaiseEffortValues(pkmn,PBStats::ATTACK,1,false)==0
|
if pbRaiseEffortValues(pkmn,:ATTACK,1,false)==0
|
||||||
scene.pbDisplay(_INTL("It won't have any effect."))
|
scene.pbDisplay(_INTL("It won't have any effect."))
|
||||||
next false
|
next false
|
||||||
end
|
end
|
||||||
@@ -736,7 +736,7 @@ ItemHandlers::UseOnPokemon.add(:MUSCLEWING,proc { |item,pkmn,scene|
|
|||||||
})
|
})
|
||||||
|
|
||||||
ItemHandlers::UseOnPokemon.add(:RESISTWING,proc { |item,pkmn,scene|
|
ItemHandlers::UseOnPokemon.add(:RESISTWING,proc { |item,pkmn,scene|
|
||||||
if pbRaiseEffortValues(pkmn,PBStats::DEFENSE,1,false)==0
|
if pbRaiseEffortValues(pkmn,:DEFENSE,1,false)==0
|
||||||
scene.pbDisplay(_INTL("It won't have any effect."))
|
scene.pbDisplay(_INTL("It won't have any effect."))
|
||||||
next false
|
next false
|
||||||
end
|
end
|
||||||
@@ -746,7 +746,7 @@ ItemHandlers::UseOnPokemon.add(:RESISTWING,proc { |item,pkmn,scene|
|
|||||||
})
|
})
|
||||||
|
|
||||||
ItemHandlers::UseOnPokemon.add(:GENIUSWING,proc { |item,pkmn,scene|
|
ItemHandlers::UseOnPokemon.add(:GENIUSWING,proc { |item,pkmn,scene|
|
||||||
if pbRaiseEffortValues(pkmn,PBStats::SPATK,1,false)==0
|
if pbRaiseEffortValues(pkmn,:SPECIAL_ATTACK,1,false)==0
|
||||||
scene.pbDisplay(_INTL("It won't have any effect."))
|
scene.pbDisplay(_INTL("It won't have any effect."))
|
||||||
next false
|
next false
|
||||||
end
|
end
|
||||||
@@ -756,7 +756,7 @@ ItemHandlers::UseOnPokemon.add(:GENIUSWING,proc { |item,pkmn,scene|
|
|||||||
})
|
})
|
||||||
|
|
||||||
ItemHandlers::UseOnPokemon.add(:CLEVERWING,proc { |item,pkmn,scene|
|
ItemHandlers::UseOnPokemon.add(:CLEVERWING,proc { |item,pkmn,scene|
|
||||||
if pbRaiseEffortValues(pkmn,PBStats::SPDEF,1,false)==0
|
if pbRaiseEffortValues(pkmn,:SPECIAL_DEFENSE,1,false)==0
|
||||||
scene.pbDisplay(_INTL("It won't have any effect."))
|
scene.pbDisplay(_INTL("It won't have any effect."))
|
||||||
next false
|
next false
|
||||||
end
|
end
|
||||||
@@ -766,7 +766,7 @@ ItemHandlers::UseOnPokemon.add(:CLEVERWING,proc { |item,pkmn,scene|
|
|||||||
})
|
})
|
||||||
|
|
||||||
ItemHandlers::UseOnPokemon.add(:SWIFTWING,proc { |item,pkmn,scene|
|
ItemHandlers::UseOnPokemon.add(:SWIFTWING,proc { |item,pkmn,scene|
|
||||||
if pbRaiseEffortValues(pkmn,PBStats::SPEED,1,false)==0
|
if pbRaiseEffortValues(pkmn,:SPEED,1,false)==0
|
||||||
scene.pbDisplay(_INTL("It won't have any effect."))
|
scene.pbDisplay(_INTL("It won't have any effect."))
|
||||||
next false
|
next false
|
||||||
end
|
end
|
||||||
@@ -786,7 +786,7 @@ ItemHandlers::UseOnPokemon.add(:RARECANDY,proc { |item,pkmn,scene|
|
|||||||
})
|
})
|
||||||
|
|
||||||
ItemHandlers::UseOnPokemon.add(:POMEGBERRY,proc { |item,pkmn,scene|
|
ItemHandlers::UseOnPokemon.add(:POMEGBERRY,proc { |item,pkmn,scene|
|
||||||
next pbRaiseHappinessAndLowerEV(pkmn,scene,PBStats::HP,[
|
next pbRaiseHappinessAndLowerEV(pkmn,scene,:HP,[
|
||||||
_INTL("{1} adores you! Its base HP fell!",pkmn.name),
|
_INTL("{1} adores you! Its base HP fell!",pkmn.name),
|
||||||
_INTL("{1} became more friendly. Its base HP can't go lower.",pkmn.name),
|
_INTL("{1} became more friendly. Its base HP can't go lower.",pkmn.name),
|
||||||
_INTL("{1} became more friendly. However, its base HP fell!",pkmn.name)
|
_INTL("{1} became more friendly. However, its base HP fell!",pkmn.name)
|
||||||
@@ -794,7 +794,7 @@ ItemHandlers::UseOnPokemon.add(:POMEGBERRY,proc { |item,pkmn,scene|
|
|||||||
})
|
})
|
||||||
|
|
||||||
ItemHandlers::UseOnPokemon.add(:KELPSYBERRY,proc { |item,pkmn,scene|
|
ItemHandlers::UseOnPokemon.add(:KELPSYBERRY,proc { |item,pkmn,scene|
|
||||||
next pbRaiseHappinessAndLowerEV(pkmn,scene,PBStats::ATTACK,[
|
next pbRaiseHappinessAndLowerEV(pkmn,scene,:ATTACK,[
|
||||||
_INTL("{1} adores you! Its base Attack fell!",pkmn.name),
|
_INTL("{1} adores you! Its base Attack fell!",pkmn.name),
|
||||||
_INTL("{1} became more friendly. Its base Attack can't go lower.",pkmn.name),
|
_INTL("{1} became more friendly. Its base Attack can't go lower.",pkmn.name),
|
||||||
_INTL("{1} became more friendly. However, its base Attack fell!",pkmn.name)
|
_INTL("{1} became more friendly. However, its base Attack fell!",pkmn.name)
|
||||||
@@ -802,7 +802,7 @@ ItemHandlers::UseOnPokemon.add(:KELPSYBERRY,proc { |item,pkmn,scene|
|
|||||||
})
|
})
|
||||||
|
|
||||||
ItemHandlers::UseOnPokemon.add(:QUALOTBERRY,proc { |item,pkmn,scene|
|
ItemHandlers::UseOnPokemon.add(:QUALOTBERRY,proc { |item,pkmn,scene|
|
||||||
next pbRaiseHappinessAndLowerEV(pkmn,scene,PBStats::DEFENSE,[
|
next pbRaiseHappinessAndLowerEV(pkmn,scene,:DEFENSE,[
|
||||||
_INTL("{1} adores you! Its base Defense fell!",pkmn.name),
|
_INTL("{1} adores you! Its base Defense fell!",pkmn.name),
|
||||||
_INTL("{1} became more friendly. Its base Defense can't go lower.",pkmn.name),
|
_INTL("{1} became more friendly. Its base Defense can't go lower.",pkmn.name),
|
||||||
_INTL("{1} became more friendly. However, its base Defense fell!",pkmn.name)
|
_INTL("{1} became more friendly. However, its base Defense fell!",pkmn.name)
|
||||||
@@ -810,7 +810,7 @@ ItemHandlers::UseOnPokemon.add(:QUALOTBERRY,proc { |item,pkmn,scene|
|
|||||||
})
|
})
|
||||||
|
|
||||||
ItemHandlers::UseOnPokemon.add(:HONDEWBERRY,proc { |item,pkmn,scene|
|
ItemHandlers::UseOnPokemon.add(:HONDEWBERRY,proc { |item,pkmn,scene|
|
||||||
next pbRaiseHappinessAndLowerEV(pkmn,scene,PBStats::SPATK,[
|
next pbRaiseHappinessAndLowerEV(pkmn,scene,:SPECIAL_ATTACK,[
|
||||||
_INTL("{1} adores you! Its base Special Attack fell!",pkmn.name),
|
_INTL("{1} adores you! Its base Special Attack fell!",pkmn.name),
|
||||||
_INTL("{1} became more friendly. Its base Special Attack can't go lower.",pkmn.name),
|
_INTL("{1} became more friendly. Its base Special Attack can't go lower.",pkmn.name),
|
||||||
_INTL("{1} became more friendly. However, its base Special Attack fell!",pkmn.name)
|
_INTL("{1} became more friendly. However, its base Special Attack fell!",pkmn.name)
|
||||||
@@ -818,7 +818,7 @@ ItemHandlers::UseOnPokemon.add(:HONDEWBERRY,proc { |item,pkmn,scene|
|
|||||||
})
|
})
|
||||||
|
|
||||||
ItemHandlers::UseOnPokemon.add(:GREPABERRY,proc { |item,pkmn,scene|
|
ItemHandlers::UseOnPokemon.add(:GREPABERRY,proc { |item,pkmn,scene|
|
||||||
next pbRaiseHappinessAndLowerEV(pkmn,scene,PBStats::SPDEF,[
|
next pbRaiseHappinessAndLowerEV(pkmn,scene,:SPECIAL_DEFENSE,[
|
||||||
_INTL("{1} adores you! Its base Special Defense fell!",pkmn.name),
|
_INTL("{1} adores you! Its base Special Defense fell!",pkmn.name),
|
||||||
_INTL("{1} became more friendly. Its base Special Defense can't go lower.",pkmn.name),
|
_INTL("{1} became more friendly. Its base Special Defense can't go lower.",pkmn.name),
|
||||||
_INTL("{1} became more friendly. However, its base Special Defense fell!",pkmn.name)
|
_INTL("{1} became more friendly. However, its base Special Defense fell!",pkmn.name)
|
||||||
@@ -826,7 +826,7 @@ ItemHandlers::UseOnPokemon.add(:GREPABERRY,proc { |item,pkmn,scene|
|
|||||||
})
|
})
|
||||||
|
|
||||||
ItemHandlers::UseOnPokemon.add(:TAMATOBERRY,proc { |item,pkmn,scene|
|
ItemHandlers::UseOnPokemon.add(:TAMATOBERRY,proc { |item,pkmn,scene|
|
||||||
next pbRaiseHappinessAndLowerEV(pkmn,scene,PBStats::SPEED,[
|
next pbRaiseHappinessAndLowerEV(pkmn,scene,:SPEED,[
|
||||||
_INTL("{1} adores you! Its base Speed fell!",pkmn.name),
|
_INTL("{1} adores you! Its base Speed fell!",pkmn.name),
|
||||||
_INTL("{1} became more friendly. Its base Speed can't go lower.",pkmn.name),
|
_INTL("{1} became more friendly. Its base Speed can't go lower.",pkmn.name),
|
||||||
_INTL("{1} became more friendly. However, its base Speed fell!",pkmn.name)
|
_INTL("{1} became more friendly. However, its base Speed fell!",pkmn.name)
|
||||||
|
|||||||
@@ -201,39 +201,39 @@ ItemHandlers::CanUseInBattle.add(:YELLOWFLUTE,proc { |item,pokemon,battler,move,
|
|||||||
})
|
})
|
||||||
|
|
||||||
ItemHandlers::CanUseInBattle.add(:XATTACK,proc { |item,pokemon,battler,move,firstAction,battle,scene,showMessages|
|
ItemHandlers::CanUseInBattle.add(:XATTACK,proc { |item,pokemon,battler,move,firstAction,battle,scene,showMessages|
|
||||||
next pbBattleItemCanRaiseStat?(PBStats::ATTACK,battler,scene,showMessages)
|
next pbBattleItemCanRaiseStat?(:ATTACK,battler,scene,showMessages)
|
||||||
})
|
})
|
||||||
|
|
||||||
ItemHandlers::CanUseInBattle.copy(:XATTACK,:XATTACK2,:XATTACK3,:XATTACK6)
|
ItemHandlers::CanUseInBattle.copy(:XATTACK,:XATTACK2,:XATTACK3,:XATTACK6)
|
||||||
|
|
||||||
ItemHandlers::CanUseInBattle.add(:XDEFENSE,proc { |item,pokemon,battler,move,firstAction,battle,scene,showMessages|
|
ItemHandlers::CanUseInBattle.add(:XDEFENSE,proc { |item,pokemon,battler,move,firstAction,battle,scene,showMessages|
|
||||||
next pbBattleItemCanRaiseStat?(PBStats::DEFENSE,battler,scene,showMessages)
|
next pbBattleItemCanRaiseStat?(:DEFENSE,battler,scene,showMessages)
|
||||||
})
|
})
|
||||||
|
|
||||||
ItemHandlers::CanUseInBattle.copy(:XDEFENSE,
|
ItemHandlers::CanUseInBattle.copy(:XDEFENSE,
|
||||||
:XDEFENSE2,:XDEFENSE3,:XDEFENSE6,:XDEFEND,:XDEFEND2,:XDEFEND3,:XDEFEND6)
|
:XDEFENSE2,:XDEFENSE3,:XDEFENSE6,:XDEFEND,:XDEFEND2,:XDEFEND3,:XDEFEND6)
|
||||||
|
|
||||||
ItemHandlers::CanUseInBattle.add(:XSPATK,proc { |item,pokemon,battler,move,firstAction,battle,scene,showMessages|
|
ItemHandlers::CanUseInBattle.add(:XSPATK,proc { |item,pokemon,battler,move,firstAction,battle,scene,showMessages|
|
||||||
next pbBattleItemCanRaiseStat?(PBStats::SPATK,battler,scene,showMessages)
|
next pbBattleItemCanRaiseStat?(:SPECIAL_ATTACK,battler,scene,showMessages)
|
||||||
})
|
})
|
||||||
|
|
||||||
ItemHandlers::CanUseInBattle.copy(:XSPATK,
|
ItemHandlers::CanUseInBattle.copy(:XSPATK,
|
||||||
:XSPATK2,:XSPATK3,:XSPATK6,:XSPECIAL,:XSPECIAL2,:XSPECIAL3,:XSPECIAL6)
|
:XSPATK2,:XSPATK3,:XSPATK6,:XSPECIAL,:XSPECIAL2,:XSPECIAL3,:XSPECIAL6)
|
||||||
|
|
||||||
ItemHandlers::CanUseInBattle.add(:XSPDEF,proc { |item,pokemon,battler,move,firstAction,battle,scene,showMessages|
|
ItemHandlers::CanUseInBattle.add(:XSPDEF,proc { |item,pokemon,battler,move,firstAction,battle,scene,showMessages|
|
||||||
next pbBattleItemCanRaiseStat?(PBStats::SPDEF,battler,scene,showMessages)
|
next pbBattleItemCanRaiseStat?(:SPECIAL_DEFENSE,battler,scene,showMessages)
|
||||||
})
|
})
|
||||||
|
|
||||||
ItemHandlers::CanUseInBattle.copy(:XSPDEF,:XSPDEF2,:XSPDEF3,:XSPDEF6)
|
ItemHandlers::CanUseInBattle.copy(:XSPDEF,:XSPDEF2,:XSPDEF3,:XSPDEF6)
|
||||||
|
|
||||||
ItemHandlers::CanUseInBattle.add(:XSPEED,proc { |item,pokemon,battler,move,firstAction,battle,scene,showMessages|
|
ItemHandlers::CanUseInBattle.add(:XSPEED,proc { |item,pokemon,battler,move,firstAction,battle,scene,showMessages|
|
||||||
next pbBattleItemCanRaiseStat?(PBStats::SPEED,battler,scene,showMessages)
|
next pbBattleItemCanRaiseStat?(:SPEED,battler,scene,showMessages)
|
||||||
})
|
})
|
||||||
|
|
||||||
ItemHandlers::CanUseInBattle.copy(:XSPEED,:XSPEED2,:XSPEED3,:XSPEED6)
|
ItemHandlers::CanUseInBattle.copy(:XSPEED,:XSPEED2,:XSPEED3,:XSPEED6)
|
||||||
|
|
||||||
ItemHandlers::CanUseInBattle.add(:XACCURACY,proc { |item,pokemon,battler,move,firstAction,battle,scene,showMessages|
|
ItemHandlers::CanUseInBattle.add(:XACCURACY,proc { |item,pokemon,battler,move,firstAction,battle,scene,showMessages|
|
||||||
next pbBattleItemCanRaiseStat?(PBStats::ACCURACY,battler,scene,showMessages)
|
next pbBattleItemCanRaiseStat?(:ACCURACY,battler,scene,showMessages)
|
||||||
})
|
})
|
||||||
|
|
||||||
ItemHandlers::CanUseInBattle.copy(:XACCURACY,:XACCURACY2,:XACCURACY3,:XACCURACY6)
|
ItemHandlers::CanUseInBattle.copy(:XACCURACY,:XACCURACY2,:XACCURACY3,:XACCURACY6)
|
||||||
@@ -523,138 +523,138 @@ ItemHandlers::BattleUseOnBattler.add(:YELLOWFLUTE,proc { |item,battler,scene|
|
|||||||
ItemHandlers::BattleUseOnBattler.copy(:YELLOWFLUTE,:PERSIMBERRY)
|
ItemHandlers::BattleUseOnBattler.copy(:YELLOWFLUTE,:PERSIMBERRY)
|
||||||
|
|
||||||
ItemHandlers::BattleUseOnBattler.add(:XATTACK,proc { |item,battler,scene|
|
ItemHandlers::BattleUseOnBattler.add(:XATTACK,proc { |item,battler,scene|
|
||||||
battler.pbRaiseStatStage(PBStats::ATTACK,(Settings::X_STAT_ITEMS_RAISE_BY_TWO_STAGES) ? 2 : 1,battler)
|
battler.pbRaiseStatStage(:ATTACK,(Settings::X_STAT_ITEMS_RAISE_BY_TWO_STAGES) ? 2 : 1,battler)
|
||||||
battler.pokemon.changeHappiness("battleitem")
|
battler.pokemon.changeHappiness("battleitem")
|
||||||
})
|
})
|
||||||
|
|
||||||
ItemHandlers::BattleUseOnBattler.add(:XATTACK2,proc { |item,battler,scene|
|
ItemHandlers::BattleUseOnBattler.add(:XATTACK2,proc { |item,battler,scene|
|
||||||
battler.pbRaiseStatStage(PBStats::ATTACK,2,battler)
|
battler.pbRaiseStatStage(:ATTACK,2,battler)
|
||||||
battler.pokemon.changeHappiness("battleitem")
|
battler.pokemon.changeHappiness("battleitem")
|
||||||
})
|
})
|
||||||
|
|
||||||
ItemHandlers::BattleUseOnBattler.add(:XATTACK3,proc { |item,battler,scene|
|
ItemHandlers::BattleUseOnBattler.add(:XATTACK3,proc { |item,battler,scene|
|
||||||
battler.pbRaiseStatStage(PBStats::ATTACK,3,battler)
|
battler.pbRaiseStatStage(:ATTACK,3,battler)
|
||||||
battler.pokemon.changeHappiness("battleitem")
|
battler.pokemon.changeHappiness("battleitem")
|
||||||
})
|
})
|
||||||
|
|
||||||
ItemHandlers::BattleUseOnBattler.add(:XATTACK6,proc { |item,battler,scene|
|
ItemHandlers::BattleUseOnBattler.add(:XATTACK6,proc { |item,battler,scene|
|
||||||
battler.pbRaiseStatStage(PBStats::ATTACK,6,battler)
|
battler.pbRaiseStatStage(:ATTACK,6,battler)
|
||||||
battler.pokemon.changeHappiness("battleitem")
|
battler.pokemon.changeHappiness("battleitem")
|
||||||
})
|
})
|
||||||
|
|
||||||
ItemHandlers::BattleUseOnBattler.add(:XDEFENSE,proc { |item,battler,scene|
|
ItemHandlers::BattleUseOnBattler.add(:XDEFENSE,proc { |item,battler,scene|
|
||||||
battler.pbRaiseStatStage(PBStats::DEFENSE,(Settings::X_STAT_ITEMS_RAISE_BY_TWO_STAGES) ? 2 : 1,battler)
|
battler.pbRaiseStatStage(:DEFENSE,(Settings::X_STAT_ITEMS_RAISE_BY_TWO_STAGES) ? 2 : 1,battler)
|
||||||
battler.pokemon.changeHappiness("battleitem")
|
battler.pokemon.changeHappiness("battleitem")
|
||||||
})
|
})
|
||||||
|
|
||||||
ItemHandlers::BattleUseOnBattler.copy(:XDEFENSE,:XDEFEND)
|
ItemHandlers::BattleUseOnBattler.copy(:XDEFENSE,:XDEFEND)
|
||||||
|
|
||||||
ItemHandlers::BattleUseOnBattler.add(:XDEFENSE2,proc { |item,battler,scene|
|
ItemHandlers::BattleUseOnBattler.add(:XDEFENSE2,proc { |item,battler,scene|
|
||||||
battler.pbRaiseStatStage(PBStats::DEFENSE,2,battler)
|
battler.pbRaiseStatStage(:DEFENSE,2,battler)
|
||||||
battler.pokemon.changeHappiness("battleitem")
|
battler.pokemon.changeHappiness("battleitem")
|
||||||
})
|
})
|
||||||
|
|
||||||
ItemHandlers::BattleUseOnBattler.copy(:XDEFENSE2,:XDEFEND2)
|
ItemHandlers::BattleUseOnBattler.copy(:XDEFENSE2,:XDEFEND2)
|
||||||
|
|
||||||
ItemHandlers::BattleUseOnBattler.add(:XDEFENSE3,proc { |item,battler,scene|
|
ItemHandlers::BattleUseOnBattler.add(:XDEFENSE3,proc { |item,battler,scene|
|
||||||
battler.pbRaiseStatStage(PBStats::DEFENSE,3,battler)
|
battler.pbRaiseStatStage(:DEFENSE,3,battler)
|
||||||
battler.pokemon.changeHappiness("battleitem")
|
battler.pokemon.changeHappiness("battleitem")
|
||||||
})
|
})
|
||||||
|
|
||||||
ItemHandlers::BattleUseOnBattler.copy(:XDEFENSE3,:XDEFEND3)
|
ItemHandlers::BattleUseOnBattler.copy(:XDEFENSE3,:XDEFEND3)
|
||||||
|
|
||||||
ItemHandlers::BattleUseOnBattler.add(:XDEFENSE6,proc { |item,battler,scene|
|
ItemHandlers::BattleUseOnBattler.add(:XDEFENSE6,proc { |item,battler,scene|
|
||||||
battler.pbRaiseStatStage(PBStats::DEFENSE,6,battler)
|
battler.pbRaiseStatStage(:DEFENSE,6,battler)
|
||||||
battler.pokemon.changeHappiness("battleitem")
|
battler.pokemon.changeHappiness("battleitem")
|
||||||
})
|
})
|
||||||
|
|
||||||
ItemHandlers::BattleUseOnBattler.copy(:XDEFENSE6,:XDEFEND6)
|
ItemHandlers::BattleUseOnBattler.copy(:XDEFENSE6,:XDEFEND6)
|
||||||
|
|
||||||
ItemHandlers::BattleUseOnBattler.add(:XSPATK,proc { |item,battler,scene|
|
ItemHandlers::BattleUseOnBattler.add(:XSPATK,proc { |item,battler,scene|
|
||||||
battler.pbRaiseStatStage(PBStats::SPATK,(Settings::X_STAT_ITEMS_RAISE_BY_TWO_STAGES) ? 2 : 1,battler)
|
battler.pbRaiseStatStage(:SPECIAL_ATTACK,(Settings::X_STAT_ITEMS_RAISE_BY_TWO_STAGES) ? 2 : 1,battler)
|
||||||
battler.pokemon.changeHappiness("battleitem")
|
battler.pokemon.changeHappiness("battleitem")
|
||||||
})
|
})
|
||||||
|
|
||||||
ItemHandlers::BattleUseOnBattler.copy(:XSPATK,:XSPECIAL)
|
ItemHandlers::BattleUseOnBattler.copy(:XSPATK,:XSPECIAL)
|
||||||
|
|
||||||
ItemHandlers::BattleUseOnBattler.add(:XSPATK2,proc { |item,battler,scene|
|
ItemHandlers::BattleUseOnBattler.add(:XSPATK2,proc { |item,battler,scene|
|
||||||
battler.pbRaiseStatStage(PBStats::SPATK,2,battler)
|
battler.pbRaiseStatStage(:SPECIAL_ATTACK,2,battler)
|
||||||
battler.pokemon.changeHappiness("battleitem")
|
battler.pokemon.changeHappiness("battleitem")
|
||||||
})
|
})
|
||||||
|
|
||||||
ItemHandlers::BattleUseOnBattler.copy(:XSPATK2,:XSPECIAL2)
|
ItemHandlers::BattleUseOnBattler.copy(:XSPATK2,:XSPECIAL2)
|
||||||
|
|
||||||
ItemHandlers::BattleUseOnBattler.add(:XSPATK3,proc { |item,battler,scene|
|
ItemHandlers::BattleUseOnBattler.add(:XSPATK3,proc { |item,battler,scene|
|
||||||
battler.pbRaiseStatStage(PBStats::SPATK,3,battler)
|
battler.pbRaiseStatStage(:SPECIAL_ATTACK,3,battler)
|
||||||
battler.pokemon.changeHappiness("battleitem")
|
battler.pokemon.changeHappiness("battleitem")
|
||||||
})
|
})
|
||||||
|
|
||||||
ItemHandlers::BattleUseOnBattler.copy(:XSPATK3,:XSPECIAL3)
|
ItemHandlers::BattleUseOnBattler.copy(:XSPATK3,:XSPECIAL3)
|
||||||
|
|
||||||
ItemHandlers::BattleUseOnBattler.add(:XSPATK6,proc { |item,battler,scene|
|
ItemHandlers::BattleUseOnBattler.add(:XSPATK6,proc { |item,battler,scene|
|
||||||
battler.pbRaiseStatStage(PBStats::SPATK,6,battler)
|
battler.pbRaiseStatStage(:SPECIAL_ATTACK,6,battler)
|
||||||
battler.pokemon.changeHappiness("battleitem")
|
battler.pokemon.changeHappiness("battleitem")
|
||||||
})
|
})
|
||||||
|
|
||||||
ItemHandlers::BattleUseOnBattler.copy(:XSPATK6,:XSPECIAL6)
|
ItemHandlers::BattleUseOnBattler.copy(:XSPATK6,:XSPECIAL6)
|
||||||
|
|
||||||
ItemHandlers::BattleUseOnBattler.add(:XSPDEF,proc { |item,battler,scene|
|
ItemHandlers::BattleUseOnBattler.add(:XSPDEF,proc { |item,battler,scene|
|
||||||
battler.pbRaiseStatStage(PBStats::SPDEF,(Settings::X_STAT_ITEMS_RAISE_BY_TWO_STAGES) ? 2 : 1,battler)
|
battler.pbRaiseStatStage(:SPECIAL_DEFENSE,(Settings::X_STAT_ITEMS_RAISE_BY_TWO_STAGES) ? 2 : 1,battler)
|
||||||
battler.pokemon.changeHappiness("battleitem")
|
battler.pokemon.changeHappiness("battleitem")
|
||||||
})
|
})
|
||||||
|
|
||||||
ItemHandlers::BattleUseOnBattler.add(:XSPDEF2,proc { |item,battler,scene|
|
ItemHandlers::BattleUseOnBattler.add(:XSPDEF2,proc { |item,battler,scene|
|
||||||
battler.pbRaiseStatStage(PBStats::SPDEF,2,battler)
|
battler.pbRaiseStatStage(:SPECIAL_DEFENSE,2,battler)
|
||||||
battler.pokemon.changeHappiness("battleitem")
|
battler.pokemon.changeHappiness("battleitem")
|
||||||
})
|
})
|
||||||
|
|
||||||
ItemHandlers::BattleUseOnBattler.add(:XSPDEF3,proc { |item,battler,scene|
|
ItemHandlers::BattleUseOnBattler.add(:XSPDEF3,proc { |item,battler,scene|
|
||||||
battler.pbRaiseStatStage(PBStats::SPDEF,3,battler)
|
battler.pbRaiseStatStage(:SPECIAL_DEFENSE,3,battler)
|
||||||
battler.pokemon.changeHappiness("battleitem")
|
battler.pokemon.changeHappiness("battleitem")
|
||||||
})
|
})
|
||||||
|
|
||||||
ItemHandlers::BattleUseOnBattler.add(:XSPDEF6,proc { |item,battler,scene|
|
ItemHandlers::BattleUseOnBattler.add(:XSPDEF6,proc { |item,battler,scene|
|
||||||
battler.pbRaiseStatStage(PBStats::SPDEF,6,battler)
|
battler.pbRaiseStatStage(:SPECIAL_DEFENSE,6,battler)
|
||||||
battler.pokemon.changeHappiness("battleitem")
|
battler.pokemon.changeHappiness("battleitem")
|
||||||
})
|
})
|
||||||
|
|
||||||
ItemHandlers::BattleUseOnBattler.add(:XSPEED,proc { |item,battler,scene|
|
ItemHandlers::BattleUseOnBattler.add(:XSPEED,proc { |item,battler,scene|
|
||||||
battler.pbRaiseStatStage(PBStats::SPEED,(Settings::X_STAT_ITEMS_RAISE_BY_TWO_STAGES) ? 2 : 1,battler)
|
battler.pbRaiseStatStage(:SPEED,(Settings::X_STAT_ITEMS_RAISE_BY_TWO_STAGES) ? 2 : 1,battler)
|
||||||
battler.pokemon.changeHappiness("battleitem")
|
battler.pokemon.changeHappiness("battleitem")
|
||||||
})
|
})
|
||||||
|
|
||||||
ItemHandlers::BattleUseOnBattler.add(:XSPEED2,proc { |item,battler,scene|
|
ItemHandlers::BattleUseOnBattler.add(:XSPEED2,proc { |item,battler,scene|
|
||||||
battler.pbRaiseStatStage(PBStats::SPEED,2,battler)
|
battler.pbRaiseStatStage(:SPEED,2,battler)
|
||||||
battler.pokemon.changeHappiness("battleitem")
|
battler.pokemon.changeHappiness("battleitem")
|
||||||
})
|
})
|
||||||
|
|
||||||
ItemHandlers::BattleUseOnBattler.add(:XSPEED3,proc { |item,battler,scene|
|
ItemHandlers::BattleUseOnBattler.add(:XSPEED3,proc { |item,battler,scene|
|
||||||
battler.pbRaiseStatStage(PBStats::SPEED,3,battler)
|
battler.pbRaiseStatStage(:SPEED,3,battler)
|
||||||
battler.pokemon.changeHappiness("battleitem")
|
battler.pokemon.changeHappiness("battleitem")
|
||||||
})
|
})
|
||||||
|
|
||||||
ItemHandlers::BattleUseOnBattler.add(:XSPEED6,proc { |item,battler,scene|
|
ItemHandlers::BattleUseOnBattler.add(:XSPEED6,proc { |item,battler,scene|
|
||||||
battler.pbRaiseStatStage(PBStats::SPEED,6,battler)
|
battler.pbRaiseStatStage(:SPEED,6,battler)
|
||||||
battler.pokemon.changeHappiness("battleitem")
|
battler.pokemon.changeHappiness("battleitem")
|
||||||
})
|
})
|
||||||
|
|
||||||
ItemHandlers::BattleUseOnBattler.add(:XACCURACY,proc { |item,battler,scene|
|
ItemHandlers::BattleUseOnBattler.add(:XACCURACY,proc { |item,battler,scene|
|
||||||
battler.pbRaiseStatStage(PBStats::ACCURACY,(Settings::X_STAT_ITEMS_RAISE_BY_TWO_STAGES) ? 2 : 1,battler)
|
battler.pbRaiseStatStage(:ACCURACY,(Settings::X_STAT_ITEMS_RAISE_BY_TWO_STAGES) ? 2 : 1,battler)
|
||||||
battler.pokemon.changeHappiness("battleitem")
|
battler.pokemon.changeHappiness("battleitem")
|
||||||
})
|
})
|
||||||
|
|
||||||
ItemHandlers::BattleUseOnBattler.add(:XACCURACY2,proc { |item,battler,scene|
|
ItemHandlers::BattleUseOnBattler.add(:XACCURACY2,proc { |item,battler,scene|
|
||||||
battler.pbRaiseStatStage(PBStats::ACCURACY,2,battler)
|
battler.pbRaiseStatStage(:ACCURACY,2,battler)
|
||||||
battler.pokemon.changeHappiness("battleitem")
|
battler.pokemon.changeHappiness("battleitem")
|
||||||
})
|
})
|
||||||
|
|
||||||
ItemHandlers::BattleUseOnBattler.add(:XACCURACY3,proc { |item,battler,scene|
|
ItemHandlers::BattleUseOnBattler.add(:XACCURACY3,proc { |item,battler,scene|
|
||||||
battler.pbRaiseStatStage(PBStats::ACCURACY,3,battler)
|
battler.pbRaiseStatStage(:ACCURACY,3,battler)
|
||||||
battler.pokemon.changeHappiness("battleitem")
|
battler.pokemon.changeHappiness("battleitem")
|
||||||
})
|
})
|
||||||
|
|
||||||
ItemHandlers::BattleUseOnBattler.add(:XACCURACY6,proc { |item,battler,scene|
|
ItemHandlers::BattleUseOnBattler.add(:XACCURACY6,proc { |item,battler,scene|
|
||||||
battler.pbRaiseStatStage(PBStats::ACCURACY,6,battler)
|
battler.pbRaiseStatStage(:ACCURACY,6,battler)
|
||||||
battler.pokemon.changeHappiness("battleitem")
|
battler.pokemon.changeHappiness("battleitem")
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|||||||
@@ -367,7 +367,7 @@ end
|
|||||||
class PokeBattle_Move_12C < PokeBattle_TargetStatDownMove
|
class PokeBattle_Move_12C < PokeBattle_TargetStatDownMove
|
||||||
def initialize(battle,move)
|
def initialize(battle,move)
|
||||||
super
|
super
|
||||||
@statDown = [PBStats::EVASION,2]
|
@statDown = [:EVASION,2]
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
@@ -3,7 +3,7 @@
|
|||||||
# The player's party Pokémon are stored in the array $Trainer.party.
|
# The player's party Pokémon are stored in the array $Trainer.party.
|
||||||
#===============================================================================
|
#===============================================================================
|
||||||
class Pokemon
|
class Pokemon
|
||||||
# @return [Integer] this Pokémon's national Pokédex number
|
# @return [Symbol] this Pokémon's species
|
||||||
attr_reader :species
|
attr_reader :species
|
||||||
# If defined, this Pokémon's form will be this value even if a MultipleForms
|
# If defined, this Pokémon's form will be this value even if a MultipleForms
|
||||||
# handler tries to say otherwise.
|
# handler tries to say otherwise.
|
||||||
@@ -47,13 +47,13 @@ class Pokemon
|
|||||||
attr_accessor :poke_ball
|
attr_accessor :poke_ball
|
||||||
# @return [Integer] this Pokémon's markings, one bit per marking
|
# @return [Integer] this Pokémon's markings, one bit per marking
|
||||||
attr_accessor :markings
|
attr_accessor :markings
|
||||||
# @return [Array<Integer>] an array of IV values for HP, Atk, Def, Speed, Sp. Atk and Sp. Def
|
# @return [Hash<Integer>] a hash of IV values for HP, Atk, Def, Speed, Sp. Atk and Sp. Def
|
||||||
attr_accessor :iv
|
attr_accessor :iv
|
||||||
# An array of booleans indicating whether a stat is made to have maximum IVs
|
# An array of booleans indicating whether a stat is made to have maximum IVs
|
||||||
# (for Hyper Training). Set like @ivMaxed[PBStats::ATTACK] = true
|
# (for Hyper Training). Set like @ivMaxed[:ATTACK] = true
|
||||||
# @return [Array<Boolean>] an array of booleans that max each IV value
|
# @return [Hash<Boolean>] a hash of booleans that max each IV value
|
||||||
attr_accessor :ivMaxed
|
attr_accessor :ivMaxed
|
||||||
# @return [Array<Integer>] this Pokémon's effort values
|
# @return [Hash<Integer>] this Pokémon's effort values
|
||||||
attr_accessor :ev
|
attr_accessor :ev
|
||||||
# @return [Integer] calculated stats
|
# @return [Integer] calculated stats
|
||||||
attr_reader :totalhp, :attack, :defense, :spatk, :spdef, :speed
|
attr_reader :totalhp, :attack, :defense, :spatk, :spdef, :speed
|
||||||
@@ -277,18 +277,18 @@ class Pokemon
|
|||||||
# Types
|
# Types
|
||||||
#=============================================================================
|
#=============================================================================
|
||||||
|
|
||||||
# @return [Integer] this Pokémon's first type
|
# @return [Symbol] this Pokémon's first type
|
||||||
def type1
|
def type1
|
||||||
return species_data.type1
|
return species_data.type1
|
||||||
end
|
end
|
||||||
|
|
||||||
# @return [Integer] this Pokémon's second type, or the first type if none is defined
|
# @return [Symbol] this Pokémon's second type, or the first type if none is defined
|
||||||
def type2
|
def type2
|
||||||
sp_data = species_data
|
sp_data = species_data
|
||||||
return sp_data.type2 || sp_data.type1
|
return sp_data.type2 || sp_data.type1
|
||||||
end
|
end
|
||||||
|
|
||||||
# @return [Array<Integer>] an array of this Pokémon's types
|
# @return [Array<Symbol>] an array of this Pokémon's types
|
||||||
def types
|
def types
|
||||||
sp_data = species_data
|
sp_data = species_data
|
||||||
ret = [sp_data.type1]
|
ret = [sp_data.type1]
|
||||||
@@ -296,7 +296,7 @@ class Pokemon
|
|||||||
return ret
|
return ret
|
||||||
end
|
end
|
||||||
|
|
||||||
# @param type [Integer, Symbol, String] type to check
|
# @param type [Symbol, String, Integer] type to check
|
||||||
# @return [Boolean] whether this Pokémon has the specified type
|
# @return [Boolean] whether this Pokémon has the specified type
|
||||||
def hasType?(type)
|
def hasType?(type)
|
||||||
type = GameData::Type.get(type).id
|
type = GameData::Type.get(type).id
|
||||||
@@ -411,7 +411,7 @@ class Pokemon
|
|||||||
|
|
||||||
# Returns whether this Pokémon has a particular ability. If no value
|
# Returns whether this Pokémon has a particular ability. If no value
|
||||||
# is given, returns whether this Pokémon has an ability set.
|
# is given, returns whether this Pokémon has an ability set.
|
||||||
# @param check_ability [Symbol, GameData::Ability, Integer] ability ID to check
|
# @param check_ability [Symbol, GameData::Ability, Integer, nil] ability ID to check
|
||||||
# @return [Boolean] whether this Pokémon has a particular ability or
|
# @return [Boolean] whether this Pokémon has a particular ability or
|
||||||
# an ability at all
|
# an ability at all
|
||||||
def hasAbility?(check_ability = nil)
|
def hasAbility?(check_ability = nil)
|
||||||
@@ -441,7 +441,7 @@ class Pokemon
|
|||||||
|
|
||||||
# @return [GameData::Nature, nil] a Nature object corresponding to this Pokémon's nature
|
# @return [GameData::Nature, nil] a Nature object corresponding to this Pokémon's nature
|
||||||
def nature
|
def nature
|
||||||
@nature = GameData::Nature.get(@personalID % 25).id if !@nature
|
@nature = GameData::Nature.get(@personalID % (GameData::Nature::DATA.keys.length / 2)).id if !@nature
|
||||||
return GameData::Nature.try_get(@nature)
|
return GameData::Nature.try_get(@nature)
|
||||||
end
|
end
|
||||||
|
|
||||||
@@ -450,7 +450,7 @@ class Pokemon
|
|||||||
end
|
end
|
||||||
|
|
||||||
# Sets this Pokémon's nature to a particular nature.
|
# Sets this Pokémon's nature to a particular nature.
|
||||||
# @param value [Integer, String, Symbol] nature to change to
|
# @param value [Symbol, String, Integer, nil] nature to change to
|
||||||
def nature=(value)
|
def nature=(value)
|
||||||
return if value && !GameData::Nature.exists?(value)
|
return if value && !GameData::Nature.exists?(value)
|
||||||
@nature = (value) ? GameData::Nature.get(value).id : value
|
@nature = (value) ? GameData::Nature.get(value).id : value
|
||||||
@@ -518,7 +518,7 @@ class Pokemon
|
|||||||
return self.item == check_item
|
return self.item == check_item
|
||||||
end
|
end
|
||||||
|
|
||||||
# @return [Array<Integer>] the items this species can be found holding in the wild
|
# @return [Array<Symbol>] the items this species can be found holding in the wild
|
||||||
def wildHoldItems
|
def wildHoldItems
|
||||||
sp_data = species_data
|
sp_data = species_data
|
||||||
return [sp_data.wild_item_common, sp_data.wild_item_uncommon, sp_data.wild_item_rare]
|
return [sp_data.wild_item_common, sp_data.wild_item_uncommon, sp_data.wild_item_rare]
|
||||||
@@ -549,7 +549,7 @@ class Pokemon
|
|||||||
return @moves.length
|
return @moves.length
|
||||||
end
|
end
|
||||||
|
|
||||||
# @param move_id [Integer, Symbol, String] ID of the move to check
|
# @param move_id [Symbol, String, Integer] ID of the move to check
|
||||||
# @return [Boolean] whether the Pokémon knows the given move
|
# @return [Boolean] whether the Pokémon knows the given move
|
||||||
def hasMove?(move_id)
|
def hasMove?(move_id)
|
||||||
move_data = GameData::Move.try_get(move_id)
|
move_data = GameData::Move.try_get(move_id)
|
||||||
@@ -585,7 +585,7 @@ class Pokemon
|
|||||||
end
|
end
|
||||||
|
|
||||||
# Silently learns the given move. Will erase the first known move if it has to.
|
# Silently learns the given move. Will erase the first known move if it has to.
|
||||||
# @param move_id [Integer, Symbol, String] ID of the move to learn
|
# @param move_id [Symbol, String, Integer] ID of the move to learn
|
||||||
def learn_move(move_id)
|
def learn_move(move_id)
|
||||||
move_data = GameData::Move.try_get(move_id)
|
move_data = GameData::Move.try_get(move_id)
|
||||||
return if !move_data
|
return if !move_data
|
||||||
@@ -603,7 +603,7 @@ class Pokemon
|
|||||||
end
|
end
|
||||||
|
|
||||||
# Deletes the given move from the Pokémon.
|
# Deletes the given move from the Pokémon.
|
||||||
# @param move_id [Integer, Symbol, String] ID of the move to delete
|
# @param move_id [Symbol, String, Integer] ID of the move to delete
|
||||||
def forget_move(move_id)
|
def forget_move(move_id)
|
||||||
move_data = GameData::Move.try_get(move_id)
|
move_data = GameData::Move.try_get(move_id)
|
||||||
return if !move_data
|
return if !move_data
|
||||||
@@ -628,14 +628,14 @@ class Pokemon
|
|||||||
end
|
end
|
||||||
|
|
||||||
# Adds a move to this Pokémon's first moves.
|
# Adds a move to this Pokémon's first moves.
|
||||||
# @param move_id [Integer, Symbol, String] ID of the move to add
|
# @param move_id [Symbol, String, Integer] ID of the move to add
|
||||||
def add_first_move(move_id)
|
def add_first_move(move_id)
|
||||||
move_data = GameData::Move.try_get(move_id)
|
move_data = GameData::Move.try_get(move_id)
|
||||||
@first_moves.push(move_data.id) if move_data && !@first_moves.include?(move_data.id)
|
@first_moves.push(move_data.id) if move_data && !@first_moves.include?(move_data.id)
|
||||||
end
|
end
|
||||||
|
|
||||||
# Removes a move from this Pokémon's first moves.
|
# Removes a move from this Pokémon's first moves.
|
||||||
# @param move_id [Integer, Symbol, String] ID of the move to remove
|
# @param move_id [Symbol, String, Integer] ID of the move to remove
|
||||||
def remove_first_move(move_id)
|
def remove_first_move(move_id)
|
||||||
move_data = GameData::Move.try_get(move_id)
|
move_data = GameData::Move.try_get(move_id)
|
||||||
@first_moves.delete(move_data.id) if move_data
|
@first_moves.delete(move_data.id) if move_data
|
||||||
@@ -646,7 +646,7 @@ class Pokemon
|
|||||||
@first_moves.clear
|
@first_moves.clear
|
||||||
end
|
end
|
||||||
|
|
||||||
# @param move_id [Integer, Symbol, String] ID of the move to check
|
# @param move_id [Symbol, String, Integer] ID of the move to check
|
||||||
# @return [Boolean] whether the Pokémon is compatible with the given move
|
# @return [Boolean] whether the Pokémon is compatible with the given move
|
||||||
def compatible_with_move?(move_id)
|
def compatible_with_move?(move_id)
|
||||||
move_data = GameData::Move.try_get(move_id)
|
move_data = GameData::Move.try_get(move_id)
|
||||||
@@ -826,11 +826,6 @@ class Pokemon
|
|||||||
return species_data.name
|
return species_data.name
|
||||||
end
|
end
|
||||||
|
|
||||||
# @return [String] a string stating the Unown form of this Pokémon
|
|
||||||
def unownShape
|
|
||||||
return "ABCDEFGHIJKLMNOPQRSTUVWXYZ?!"[@form, 1]
|
|
||||||
end
|
|
||||||
|
|
||||||
# @return [Integer] the height of this Pokémon in decimetres (0.1 metres)
|
# @return [Integer] the height of this Pokémon in decimetres (0.1 metres)
|
||||||
def height
|
def height
|
||||||
return species_data.height
|
return species_data.height
|
||||||
@@ -841,9 +836,12 @@ class Pokemon
|
|||||||
return species_data.weight
|
return species_data.weight
|
||||||
end
|
end
|
||||||
|
|
||||||
# @return [Array<Integer>] the EV yield of this Pokémon (an array of six values)
|
# @return [Hash<Integer>] the EV yield of this Pokémon (a hash with six key/value pairs)
|
||||||
def evYield
|
def evYield
|
||||||
return species_data.evs.clone
|
this_evs = species_data.evs
|
||||||
|
ret = {}
|
||||||
|
GameData::Stat.each_main { |s| ret[s.id] = this_evs[s.id] }
|
||||||
|
return ret
|
||||||
end
|
end
|
||||||
|
|
||||||
# Changes the happiness of this Pokémon depending on what happened to change it.
|
# Changes the happiness of this Pokémon depending on what happened to change it.
|
||||||
@@ -891,17 +889,23 @@ class Pokemon
|
|||||||
# Stat calculations
|
# Stat calculations
|
||||||
#=============================================================================
|
#=============================================================================
|
||||||
|
|
||||||
# @return [Array<Integer>] this Pokémon's base stats, an array of six values
|
# @return [Hash<Integer>] this Pokémon's base stats, a hash with six key/value pairs
|
||||||
def baseStats
|
def baseStats
|
||||||
return species_data.base_stats.clone
|
this_base_stats = species_data.base_stats
|
||||||
|
ret = {}
|
||||||
|
GameData::Stat.each_main { |s| ret[s.id] = this_base_stats[s.id] }
|
||||||
|
return ret
|
||||||
end
|
end
|
||||||
|
|
||||||
# Returns this Pokémon's effective IVs, taking into account Hyper Training.
|
# Returns this Pokémon's effective IVs, taking into account Hyper Training.
|
||||||
# Only used for calculating stats.
|
# Only used for calculating stats.
|
||||||
# @return [Array<Boolean>] array containing this Pokémon's effective IVs
|
# @return [Hash<Integer>] hash containing this Pokémon's effective IVs
|
||||||
def calcIV
|
def calcIV
|
||||||
ret = self.iv.clone
|
this_ivs = self.iv
|
||||||
PBStats.eachStat { |s| ret[s] = IV_STAT_LIMIT if @ivMaxed[s] }
|
ret = {}
|
||||||
|
GameData::Stat.each_main do |s|
|
||||||
|
ret[s.id] = (@ivMaxed[s.id]) ? IV_STAT_LIMIT : this_ivs[s.id]
|
||||||
|
end
|
||||||
return ret
|
return ret
|
||||||
end
|
end
|
||||||
|
|
||||||
@@ -922,29 +926,29 @@ class Pokemon
|
|||||||
this_level = self.level
|
this_level = self.level
|
||||||
this_IV = self.calcIV
|
this_IV = self.calcIV
|
||||||
# Format stat multipliers due to nature
|
# Format stat multipliers due to nature
|
||||||
nature_mod = []
|
nature_mod = {}
|
||||||
PBStats.eachStat { |s| nature_mod[s] = 100 }
|
GameData::Stat.each_main { |s| nature_mod[s.id] = 100 }
|
||||||
this_nature = self.nature_for_stats
|
this_nature = self.nature_for_stats
|
||||||
if this_nature
|
if this_nature
|
||||||
this_nature.stat_changes.each { |change| nature_mod[change[0]] += change[1] }
|
this_nature.stat_changes.each { |change| nature_mod[change[0]] += change[1] }
|
||||||
end
|
end
|
||||||
# Calculate stats
|
# Calculate stats
|
||||||
stats = []
|
stats = {}
|
||||||
PBStats.eachStat do |s|
|
GameData::Stat.each_main do |s|
|
||||||
if s == PBStats::HP
|
if s.id == :HP
|
||||||
stats[s] = calcHP(base_stats[s], this_level, this_IV[s], @ev[s])
|
stats[s.id] = calcHP(base_stats[s.id], this_level, this_IV[s.id], @ev[s.id])
|
||||||
else
|
else
|
||||||
stats[s] = calcStat(base_stats[s], this_level, this_IV[s], @ev[s], nature_mod[s])
|
stats[s.id] = calcStat(base_stats[s.id], this_level, this_IV[s.id], @ev[s.id], nature_mod[s.id])
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
hpDiff = @totalhp - @hp
|
hpDiff = @totalhp - @hp
|
||||||
@totalhp = stats[PBStats::HP]
|
@totalhp = stats[:HP]
|
||||||
@hp = @totalhp - hpDiff
|
@hp = @totalhp - hpDiff
|
||||||
@attack = stats[PBStats::ATTACK]
|
@attack = stats[:ATTACK]
|
||||||
@defense = stats[PBStats::DEFENSE]
|
@defense = stats[:DEFENSE]
|
||||||
@spatk = stats[PBStats::SPATK]
|
@spatk = stats[:SPECIAL_ATTACK]
|
||||||
@spdef = stats[PBStats::SPDEF]
|
@spdef = stats[:SPECIAL_DEFENSE]
|
||||||
@speed = stats[PBStats::SPEED]
|
@speed = stats[:SPEED]
|
||||||
end
|
end
|
||||||
|
|
||||||
#=============================================================================
|
#=============================================================================
|
||||||
@@ -955,9 +959,14 @@ class Pokemon
|
|||||||
# @return [Pokemon] a copy of this Pokémon
|
# @return [Pokemon] a copy of this Pokémon
|
||||||
def clone
|
def clone
|
||||||
ret = super
|
ret = super
|
||||||
ret.iv = @iv.clone
|
ret.iv = {}
|
||||||
ret.ivMaxed = @ivMaxed.clone
|
ret.ivMaxed = {}
|
||||||
ret.ev = @ev.clone
|
ret.ev = {}
|
||||||
|
GameData::Stat.each_main do |s|
|
||||||
|
ret.iv[s.id] = @iv[s.id]
|
||||||
|
ret.ivMaxed[s.id] = @ivMaxed[s.id]
|
||||||
|
ret.ev[s.id] = @ev[s.id]
|
||||||
|
end
|
||||||
ret.moves = []
|
ret.moves = []
|
||||||
@moves.each_with_index { |m, i| ret.moves[i] = m.clone }
|
@moves.each_with_index { |m, i| ret.moves[i] = m.clone }
|
||||||
ret.first_moves = @first_moves.clone
|
ret.first_moves = @first_moves.clone
|
||||||
@@ -1004,12 +1013,12 @@ class Pokemon
|
|||||||
@happiness = species_data.happiness
|
@happiness = species_data.happiness
|
||||||
@poke_ball = :POKEBALL
|
@poke_ball = :POKEBALL
|
||||||
@markings = 0
|
@markings = 0
|
||||||
@iv = []
|
@iv = {}
|
||||||
@ivMaxed = []
|
@ivMaxed = {}
|
||||||
@ev = []
|
@ev = {}
|
||||||
PBStats.eachStat do |s|
|
GameData::Stat.each_main do |s|
|
||||||
@iv[s] = rand(IV_STAT_LIMIT + 1)
|
@iv[s.id] = rand(IV_STAT_LIMIT + 1)
|
||||||
@ev[s] = 0
|
@ev[s.id] = 0
|
||||||
end
|
end
|
||||||
if owner.is_a?(Owner)
|
if owner.is_a?(Owner)
|
||||||
@owner = owner
|
@owner = owner
|
||||||
|
|||||||
@@ -54,7 +54,8 @@ class Pokemon
|
|||||||
@heart_gauge = HEART_GAUGE_SIZE
|
@heart_gauge = HEART_GAUGE_SIZE
|
||||||
@hyper_mode = false
|
@hyper_mode = false
|
||||||
@saved_exp = 0
|
@saved_exp = 0
|
||||||
@saved_ev = [0, 0, 0, 0, 0, 0]
|
@saved_ev = {}
|
||||||
|
GameData::Stat.each_main { |s| @saved_ev[s.id] = 0 }
|
||||||
@shadow_moves = []
|
@shadow_moves = []
|
||||||
# Retrieve Shadow moveset for this Pokémon
|
# Retrieve Shadow moveset for this Pokémon
|
||||||
shadow_moveset = pbLoadShadowMovesets[species_data.id]
|
shadow_moveset = pbLoadShadowMovesets[species_data.id]
|
||||||
@@ -136,12 +137,12 @@ class Pokemon
|
|||||||
|
|
||||||
def add_evs(added_evs)
|
def add_evs(added_evs)
|
||||||
total = 0
|
total = 0
|
||||||
@ev.each { |e| total += e }
|
@ev.each_value { |e| total += e }
|
||||||
PBStats.each do |s|
|
GameData::Stat.each_main do |s|
|
||||||
addition = added_evs[s].clamp(0, Pokemon::EV_STAT_LIMIT - @ev[s])
|
addition = added_evs[s.id].clamp(0, Pokemon::EV_STAT_LIMIT - @ev[s.id])
|
||||||
addition = addition.clamp(0, Pokemon::EV_LIMIT - total)
|
addition = addition.clamp(0, Pokemon::EV_LIMIT - total)
|
||||||
next if addition == 0
|
next if addition == 0
|
||||||
@ev[s] += addition
|
@ev[s.id] += addition
|
||||||
total += addition
|
total += addition
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
@@ -149,7 +150,9 @@ class Pokemon
|
|||||||
alias :__shadow_clone :clone
|
alias :__shadow_clone :clone
|
||||||
def clone
|
def clone
|
||||||
ret = __shadow_clone
|
ret = __shadow_clone
|
||||||
ret.saved_ev = @saved_ev.clone if @saved_ev
|
if @saved_ev
|
||||||
|
GameData::Stat.each_main { |s| ret.saved_ev[s.id] = @saved_ev[s.id] }
|
||||||
|
end
|
||||||
ret.shadow_moves = @shadow_moves.clone if @shadow_moves
|
ret.shadow_moves = @shadow_moves.clone if @shadow_moves
|
||||||
return ret
|
return ret
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -56,13 +56,15 @@ class PokeBattle_Pokemon
|
|||||||
ret.tough = pkmn.tough if pkmn.tough
|
ret.tough = pkmn.tough if pkmn.tough
|
||||||
ret.sheen = pkmn.sheen if pkmn.sheen
|
ret.sheen = pkmn.sheen if pkmn.sheen
|
||||||
ret.pokerus = pkmn.pokerus if pkmn.pokerus
|
ret.pokerus = pkmn.pokerus if pkmn.pokerus
|
||||||
ret.name = pkmn.name
|
ret.name = pkmn.name if pkmn.name != ret.speciesName
|
||||||
ret.happiness = pkmn.happiness
|
ret.happiness = pkmn.happiness
|
||||||
ret.poke_ball = pbBallTypeToItem(pkmn.ballused).id
|
ret.poke_ball = pbBallTypeToItem(pkmn.ballused).id
|
||||||
ret.markings = pkmn.markings if pkmn.markings
|
ret.markings = pkmn.markings if pkmn.markings
|
||||||
ret.iv = pkmn.iv.clone
|
GameData::Stat.each_main do |s|
|
||||||
ret.ivMaxed = pkmn.ivMaxed.clone if pkmn.ivMaxed
|
ret.iv[s.id] = pkmn.iv[s.id_number]
|
||||||
ret.ev = pkmn.ev.clone
|
ret.ivMaxed[s.id] = pkmn.ivMaxed[s.id_number] if pkmn.ivMaxed
|
||||||
|
ret.ev[s.id] = pkmn.ev[s.id_number]
|
||||||
|
end
|
||||||
ret.obtain_method = pkmn.obtainMode
|
ret.obtain_method = pkmn.obtainMode
|
||||||
ret.obtain_map = pkmn.obtainMap
|
ret.obtain_map = pkmn.obtainMap
|
||||||
ret.obtain_text = pkmn.obtainText
|
ret.obtain_text = pkmn.obtainText
|
||||||
@@ -81,7 +83,9 @@ class PokeBattle_Pokemon
|
|||||||
ret.heart_gauge = pkmn.heartgauge
|
ret.heart_gauge = pkmn.heartgauge
|
||||||
ret.hyper_mode = pkmn.hypermode
|
ret.hyper_mode = pkmn.hypermode
|
||||||
ret.saved_exp = pkmn.savedexp
|
ret.saved_exp = pkmn.savedexp
|
||||||
ret.saved_ev = pkmn.savedev.clone
|
if pkmn.savedev
|
||||||
|
GameData::Stat.each_main { |s| ret.saved_ev[s.id] = pkmn.savedev[s.pbs_order] if s.pbs_order >= 0 }
|
||||||
|
end
|
||||||
ret.shadow_moves = []
|
ret.shadow_moves = []
|
||||||
pkmn.shadowmoves.each_with_index do |move, i|
|
pkmn.shadowmoves.each_with_index do |move, i|
|
||||||
ret.shadow_moves[i] = GameData::Move.get(move).id if move
|
ret.shadow_moves[i] = GameData::Move.get(move).id if move
|
||||||
|
|||||||
@@ -581,47 +581,50 @@ class PokemonSummary_Scene
|
|||||||
end
|
end
|
||||||
# Write characteristic
|
# Write characteristic
|
||||||
if showNature
|
if showNature
|
||||||
bestiv = 0
|
best_stat = nil
|
||||||
tiebreaker = @pokemon.personalID%6
|
best_iv = 0
|
||||||
for i in 0...6
|
stats_order = [:HP, :ATTACK, :DEFENSE, :SPEED, :SPECIAL_ATTACK, :SPECIAL_DEFENSE]
|
||||||
if @pokemon.iv[i]==@pokemon.iv[bestiv]
|
start_point = @pokemon.personalID % stats_order.length # Tiebreaker
|
||||||
bestiv = i if i>=tiebreaker && bestiv<tiebreaker
|
for i in 0...stats_order.length
|
||||||
elsif @pokemon.iv[i]>@pokemon.iv[bestiv]
|
stat = stats_order[(i + start_point) % stats_order.length]
|
||||||
bestiv = i
|
if !best_stat || @pokemon.iv[stat] > @pokemon.iv[best_stat]
|
||||||
|
best_stat = stat
|
||||||
|
best_iv = @pokemon.iv[best_stat]
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
characteristic = [_INTL("Loves to eat."),
|
characteristics = {
|
||||||
_INTL("Often dozes off."),
|
:HP => [_INTL("Loves to eat."),
|
||||||
_INTL("Often scatters things."),
|
_INTL("Takes plenty of siestas."),
|
||||||
_INTL("Scatters things often."),
|
_INTL("Nods off a lot."),
|
||||||
_INTL("Likes to relax."),
|
_INTL("Scatters things often."),
|
||||||
_INTL("Proud of its power."),
|
_INTL("Likes to relax.")],
|
||||||
_INTL("Likes to thrash about."),
|
:ATTACK => [_INTL("Proud of its power."),
|
||||||
_INTL("A little quick tempered."),
|
_INTL("Likes to thrash about."),
|
||||||
_INTL("Likes to fight."),
|
_INTL("A little quick tempered."),
|
||||||
_INTL("Quick tempered."),
|
_INTL("Likes to fight."),
|
||||||
_INTL("Sturdy body."),
|
_INTL("Quick tempered.")],
|
||||||
_INTL("Capable of taking hits."),
|
:DEFENSE => [_INTL("Sturdy body."),
|
||||||
_INTL("Highly persistent."),
|
_INTL("Capable of taking hits."),
|
||||||
_INTL("Good endurance."),
|
_INTL("Highly persistent."),
|
||||||
_INTL("Good perseverance."),
|
_INTL("Good endurance."),
|
||||||
_INTL("Likes to run."),
|
_INTL("Good perseverance.")],
|
||||||
_INTL("Alert to sounds."),
|
:SPECIAL_ATTACK => [_INTL("Highly curious."),
|
||||||
_INTL("Impetuous and silly."),
|
_INTL("Mischievous."),
|
||||||
_INTL("Somewhat of a clown."),
|
_INTL("Thoroughly cunning."),
|
||||||
_INTL("Quick to flee."),
|
_INTL("Often lost in thought."),
|
||||||
_INTL("Highly curious."),
|
_INTL("Very finicky.")],
|
||||||
_INTL("Mischievous."),
|
:SPECIAL_DEFENSE => [_INTL("Strong willed."),
|
||||||
_INTL("Thoroughly cunning."),
|
_INTL("Somewhat vain."),
|
||||||
_INTL("Often lost in thought."),
|
_INTL("Strongly defiant."),
|
||||||
_INTL("Very finicky."),
|
_INTL("Hates to lose."),
|
||||||
_INTL("Strong willed."),
|
_INTL("Somewhat stubborn.")],
|
||||||
_INTL("Somewhat vain."),
|
:SPEED => [_INTL("Likes to run."),
|
||||||
_INTL("Strongly defiant."),
|
_INTL("Alert to sounds."),
|
||||||
_INTL("Hates to lose."),
|
_INTL("Impetuous and silly."),
|
||||||
_INTL("Somewhat stubborn.")
|
_INTL("Somewhat of a clown."),
|
||||||
][bestiv*5+@pokemon.iv[bestiv]%5]
|
_INTL("Quick to flee.")]
|
||||||
memo += sprintf("<c3=404040,B0B0B0>%s\n",characteristic)
|
}
|
||||||
|
memo += sprintf("<c3=404040,B0B0B0>%s\n", characteristics[best_stat][best_iv % 5])
|
||||||
end
|
end
|
||||||
# Write all text
|
# Write all text
|
||||||
drawFormattedTextEx(overlay,232,78,268,memo)
|
drawFormattedTextEx(overlay,232,78,268,memo)
|
||||||
@@ -632,8 +635,8 @@ class PokemonSummary_Scene
|
|||||||
base = Color.new(248,248,248)
|
base = Color.new(248,248,248)
|
||||||
shadow = Color.new(104,104,104)
|
shadow = Color.new(104,104,104)
|
||||||
# Determine which stats are boosted and lowered by the Pokémon's nature
|
# Determine which stats are boosted and lowered by the Pokémon's nature
|
||||||
statshadows = []
|
statshadows = {}
|
||||||
PBStats.eachStat { |s| statshadows[s] = shadow }
|
GameData::Stat.each_main { |s| statshadows[s.id] = shadow }
|
||||||
if !@pokemon.shadowPokemon? || @pokemon.heartStage > 3
|
if !@pokemon.shadowPokemon? || @pokemon.heartStage > 3
|
||||||
@pokemon.nature_for_stats.stat_changes.each do |change|
|
@pokemon.nature_for_stats.stat_changes.each do |change|
|
||||||
statshadows[change[0]] = Color.new(136,96,72) if change[1] > 0
|
statshadows[change[0]] = Color.new(136,96,72) if change[1] > 0
|
||||||
@@ -642,17 +645,17 @@ class PokemonSummary_Scene
|
|||||||
end
|
end
|
||||||
# Write various bits of text
|
# Write various bits of text
|
||||||
textpos = [
|
textpos = [
|
||||||
[_INTL("HP"),292,76,2,base,statshadows[PBStats::HP]],
|
[_INTL("HP"),292,76,2,base,statshadows[:HP]],
|
||||||
[sprintf("%d/%d",@pokemon.hp,@pokemon.totalhp),462,76,1,Color.new(64,64,64),Color.new(176,176,176)],
|
[sprintf("%d/%d",@pokemon.hp,@pokemon.totalhp),462,76,1,Color.new(64,64,64),Color.new(176,176,176)],
|
||||||
[_INTL("Attack"),248,120,0,base,statshadows[PBStats::ATTACK]],
|
[_INTL("Attack"),248,120,0,base,statshadows[:ATTACK]],
|
||||||
[sprintf("%d",@pokemon.attack),456,120,1,Color.new(64,64,64),Color.new(176,176,176)],
|
[sprintf("%d",@pokemon.attack),456,120,1,Color.new(64,64,64),Color.new(176,176,176)],
|
||||||
[_INTL("Defense"),248,152,0,base,statshadows[PBStats::DEFENSE]],
|
[_INTL("Defense"),248,152,0,base,statshadows[:DEFENSE]],
|
||||||
[sprintf("%d",@pokemon.defense),456,152,1,Color.new(64,64,64),Color.new(176,176,176)],
|
[sprintf("%d",@pokemon.defense),456,152,1,Color.new(64,64,64),Color.new(176,176,176)],
|
||||||
[_INTL("Sp. Atk"),248,184,0,base,statshadows[PBStats::SPATK]],
|
[_INTL("Sp. Atk"),248,184,0,base,statshadows[:SPECIAL_ATTACK]],
|
||||||
[sprintf("%d",@pokemon.spatk),456,184,1,Color.new(64,64,64),Color.new(176,176,176)],
|
[sprintf("%d",@pokemon.spatk),456,184,1,Color.new(64,64,64),Color.new(176,176,176)],
|
||||||
[_INTL("Sp. Def"),248,216,0,base,statshadows[PBStats::SPDEF]],
|
[_INTL("Sp. Def"),248,216,0,base,statshadows[:SPECIAL_DEFENSE]],
|
||||||
[sprintf("%d",@pokemon.spdef),456,216,1,Color.new(64,64,64),Color.new(176,176,176)],
|
[sprintf("%d",@pokemon.spdef),456,216,1,Color.new(64,64,64),Color.new(176,176,176)],
|
||||||
[_INTL("Speed"),248,248,0,base,statshadows[PBStats::SPEED]],
|
[_INTL("Speed"),248,248,0,base,statshadows[:SPEED]],
|
||||||
[sprintf("%d",@pokemon.speed),456,248,1,Color.new(64,64,64),Color.new(176,176,176)],
|
[sprintf("%d",@pokemon.speed),456,248,1,Color.new(64,64,64),Color.new(176,176,176)],
|
||||||
[_INTL("Ability"),224,284,0,base,shadow]
|
[_INTL("Ability"),224,284,0,base,shadow]
|
||||||
]
|
]
|
||||||
|
|||||||
@@ -15,12 +15,12 @@ class TriadCard
|
|||||||
@form = form
|
@form = form
|
||||||
species_data = GameData::Species.get_species_form(@species, @form)
|
species_data = GameData::Species.get_species_form(@species, @form)
|
||||||
baseStats = species_data.base_stats
|
baseStats = species_data.base_stats
|
||||||
hp = baseStats[PBStats::HP]
|
hp = baseStats[:HP]
|
||||||
attack = baseStats[PBStats::ATTACK]
|
attack = baseStats[:ATTACK]
|
||||||
defense = baseStats[PBStats::DEFENSE]
|
defense = baseStats[:DEFENSE]
|
||||||
spAtk = baseStats[PBStats::SPATK]
|
spAtk = baseStats[:SPECIAL_ATTACK]
|
||||||
spDef = baseStats[PBStats::SPDEF]
|
spDef = baseStats[:SPECIAL_DEFENSE]
|
||||||
speed = baseStats[PBStats::SPEED]
|
speed = baseStats[:SPEED]
|
||||||
@type = species_data.type1
|
@type = species_data.type1
|
||||||
@type = species_data.type2 if @type == :NORMAL && species_data.type2
|
@type = species_data.type2 if @type == :NORMAL && species_data.type2
|
||||||
@west = baseStatToValue(attack + speed / 3)
|
@west = baseStatToValue(attack + speed / 3)
|
||||||
|
|||||||
@@ -262,7 +262,7 @@ end
|
|||||||
def pbBugContestScore(pkmn)
|
def pbBugContestScore(pkmn)
|
||||||
levelscore = pkmn.level * 4
|
levelscore = pkmn.level * 4
|
||||||
ivscore = 0
|
ivscore = 0
|
||||||
pkmn.iv.each { |iv| ivscore += iv.to_f / Pokemon::IV_STAT_LIMIT }
|
pkmn.iv.each_value { |iv| ivscore += iv.to_f / Pokemon::IV_STAT_LIMIT }
|
||||||
ivscore = (ivscore * 100).floor
|
ivscore = (ivscore * 100).floor
|
||||||
hpscore = (100.0 * pkmn.hp / pkmn.totalhp).floor
|
hpscore = (100.0 * pkmn.hp / pkmn.totalhp).floor
|
||||||
catch_rate = pkmn.species_data.catch_rate
|
catch_rate = pkmn.species_data.catch_rate
|
||||||
|
|||||||
@@ -26,53 +26,55 @@ class PBPokemon
|
|||||||
@move2 = move2 ? move2 : 0
|
@move2 = move2 ? move2 : 0
|
||||||
@move3 = move3 ? move3 : 0
|
@move3 = move3 ? move3 : 0
|
||||||
@move4 = move4 ? move4 : 0
|
@move4 = move4 ? move4 : 0
|
||||||
|
# TODO: Stat changes (what is @ev here? Seems to be a set of bit flags
|
||||||
|
# indicating each stat that should have EVs put into it. Could change it).
|
||||||
@ev = ev
|
@ev = ev
|
||||||
end
|
end
|
||||||
|
|
||||||
|
# This method is how each Pokémon is compiled from the PBS files listing
|
||||||
|
# Battle Tower/Cup Pokémon.
|
||||||
def self.fromInspected(str)
|
def self.fromInspected(str)
|
||||||
insp=str.gsub(/^\s+/,"").gsub(/\s+$/,"")
|
insp=str.gsub(/^\s+/,"").gsub(/\s+$/,"")
|
||||||
pieces=insp.split(/\s*;\s*/)
|
pieces=insp.split(/\s*;\s*/)
|
||||||
species = (GameData::Species.exists?(pieces[0])) ? GameData::Species.get(pieces[0]).id : nil
|
species = (GameData::Species.exists?(pieces[0])) ? GameData::Species.get(pieces[0]).id : nil
|
||||||
item = (GameData::Item.exists?(pieces[1])) ? GameData::Item.get(pieces[1]).id : nil
|
item = (GameData::Item.exists?(pieces[1])) ? GameData::Item.get(pieces[1]).id : nil
|
||||||
nature = (GameData::Nature.exists?(pieces[2])) ? GameData::Nature.get(pieces[2]).id : nil
|
nature = (GameData::Nature.exists?(pieces[2])) ? GameData::Nature.get(pieces[2]).id : nil
|
||||||
ev=pieces[3].split(/\s*,\s*/)
|
ev = pieces[3].split(/\s*,\s*/)
|
||||||
evvalue=0
|
ev_array = []
|
||||||
for i in 0...6
|
ev.each do |stat|
|
||||||
next if !ev[i]||ev[i]==""
|
case stat.upcase
|
||||||
evupcase=ev[i].upcase
|
when "HP" then ev_array.push(:HP)
|
||||||
evvalue|=0x01 if evupcase=="HP"
|
when "ATK" then ev_array.push(:ATTACK)
|
||||||
evvalue|=0x02 if evupcase=="ATK"
|
when "DEF" then ev_array.push(:DEFENSE)
|
||||||
evvalue|=0x04 if evupcase=="DEF"
|
when "SA", "SPATK" then ev_array.push(:SPECIAL_ATTACK)
|
||||||
evvalue|=0x08 if evupcase=="SPD"
|
when "SD", "SPDEF" then ev_array.push(:SPECIAL_DEFENSE)
|
||||||
evvalue|=0x10 if evupcase=="SA"
|
when "SPD" then ev_array.push(:SPEED)
|
||||||
evvalue|=0x20 if evupcase=="SD"
|
end
|
||||||
end
|
end
|
||||||
moves=pieces[4].split(/\s*,\s*/)
|
moves=pieces[4].split(/\s*,\s*/)
|
||||||
moveid=[]
|
moveid=[]
|
||||||
for i in 0...4
|
for i in 0...Pokemon::MAX_MOVES
|
||||||
move_data = GameData::Move.try_get(moves[i])
|
move_data = GameData::Move.try_get(moves[i])
|
||||||
moveid.push(move_data.id) if move_data
|
moveid.push(move_data.id) if move_data
|
||||||
end
|
end
|
||||||
moveid=[GameData::Move.get(1)] if moveid.length==0
|
moveid=[GameData::Move.get(1)] if moveid.length==0
|
||||||
return self.new(species, item, nature, moveid[0], moveid[1], moveid[2], moveid[3], evvalue)
|
return self.new(species, item, nature, moveid[0], moveid[1], moveid[2], moveid[3], ev_array)
|
||||||
end
|
end
|
||||||
|
|
||||||
def self.fromPokemon(pokemon)
|
def self.fromPokemon(pokemon)
|
||||||
evvalue=0
|
|
||||||
evvalue|=0x01 if pokemon.ev[0]>60
|
|
||||||
evvalue|=0x02 if pokemon.ev[1]>60
|
|
||||||
evvalue|=0x04 if pokemon.ev[2]>60
|
|
||||||
evvalue|=0x08 if pokemon.ev[3]>60
|
|
||||||
evvalue|=0x10 if pokemon.ev[4]>60
|
|
||||||
evvalue|=0x20 if pokemon.ev[5]>60
|
|
||||||
mov1 = (pokemon.moves[0]) ? pokemon.moves[0].id : nil
|
mov1 = (pokemon.moves[0]) ? pokemon.moves[0].id : nil
|
||||||
mov2 = (pokemon.moves[1]) ? pokemon.moves[1].id : nil
|
mov2 = (pokemon.moves[1]) ? pokemon.moves[1].id : nil
|
||||||
mov3 = (pokemon.moves[2]) ? pokemon.moves[2].id : nil
|
mov3 = (pokemon.moves[2]) ? pokemon.moves[2].id : nil
|
||||||
mov4 = (pokemon.moves[3]) ? pokemon.moves[3].id : nil
|
mov4 = (pokemon.moves[3]) ? pokemon.moves[3].id : nil
|
||||||
|
ev_array = []
|
||||||
|
GameData::Stat.each_main do |s|
|
||||||
|
ev_array.push(s.id) if pokemon.ev[s.id] > 60
|
||||||
|
end
|
||||||
return self.new(pokemon.species,pokemon.item_id,pokemon.nature,
|
return self.new(pokemon.species,pokemon.item_id,pokemon.nature,
|
||||||
mov1,mov2,mov3,mov4,evvalue)
|
mov1,mov2,mov3,mov4,ev_array)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
# Unused.
|
||||||
def self.constFromStr(mod,str)
|
def self.constFromStr(mod,str)
|
||||||
maxconst=0
|
maxconst=0
|
||||||
for constant in mod.constants
|
for constant in mod.constants
|
||||||
@@ -86,10 +88,12 @@ class PBPokemon
|
|||||||
return 0
|
return 0
|
||||||
end
|
end
|
||||||
|
|
||||||
|
# Unused.
|
||||||
def self.fromString(str)
|
def self.fromString(str)
|
||||||
return self.fromstring(str)
|
return self.fromstring(str)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
# Unused.
|
||||||
def self.fromstring(str)
|
def self.fromstring(str)
|
||||||
s=str.split(/\s*,\s*/)
|
s=str.split(/\s*,\s*/)
|
||||||
species=GameData::Species.get(s[1]).id
|
species=GameData::Species.get(s[1]).id
|
||||||
@@ -99,15 +103,12 @@ class PBPokemon
|
|||||||
move2=(s.length>=12) ? GameData::Move.get(s[5]).id : nil
|
move2=(s.length>=12) ? GameData::Move.get(s[5]).id : nil
|
||||||
move3=(s.length>=13) ? GameData::Move.get(s[6]).id : nil
|
move3=(s.length>=13) ? GameData::Move.get(s[6]).id : nil
|
||||||
move4=(s.length>=14) ? GameData::Move.get(s[7]).id : nil
|
move4=(s.length>=14) ? GameData::Move.get(s[7]).id : nil
|
||||||
ev=0
|
slen = s.length - 6
|
||||||
slen=s.length-6
|
ev_array = []
|
||||||
ev|=0x01 if s[slen].to_i>0
|
GameData::Stat.each_main do |s|
|
||||||
ev|=0x02 if s[slen+1].to_i>0
|
ev_array.push(s.id) if s[slen + s.pbs_order].to_i > 0
|
||||||
ev|=0x04 if s[slen+2].to_i>0
|
end
|
||||||
ev|=0x08 if s[slen+3].to_i>0
|
return self.new(species,item,nature,move1,move2,move3,move4,ev_array)
|
||||||
ev|=0x10 if s[slen+4].to_i>0
|
|
||||||
ev|=0x20 if s[slen+5].to_i>0
|
|
||||||
return self.new(species,item,nature,move1,move2,move3,move4,ev)
|
|
||||||
end
|
end
|
||||||
|
|
||||||
=begin
|
=begin
|
||||||
@@ -129,12 +130,10 @@ class PBPokemon
|
|||||||
c1=GameData::Species.get(@species).id.to_s
|
c1=GameData::Species.get(@species).id.to_s
|
||||||
c2=(@item) ? GameData::Item.get(@item).id.to_s : ""
|
c2=(@item) ? GameData::Item.get(@item).id.to_s : ""
|
||||||
c3=(@nature) ? GameData::Nature.get(@nature).id.to_s : ""
|
c3=(@nature) ? GameData::Nature.get(@nature).id.to_s : ""
|
||||||
evlist=""
|
evlist = ""
|
||||||
for i in 0...@ev
|
@ev.each do |stat|
|
||||||
if ((@ev&(1<<i))!=0)
|
evlist += "," if evlist != ""
|
||||||
evlist+="," if evlist.length>0
|
evlist += stat.real_name_brief
|
||||||
evlist+=["HP","ATK","DEF","SPD","SA","SD"][i]
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
c4=(@move1) ? GameData::Move.get(@move1).id_to_s : ""
|
c4=(@move1) ? GameData::Move.get(@move1).id_to_s : ""
|
||||||
c5=(@move2) ? GameData::Move.get(@move2).id_to_s : ""
|
c5=(@move2) ? GameData::Move.get(@move2).id_to_s : ""
|
||||||
@@ -143,6 +142,7 @@ class PBPokemon
|
|||||||
return "#{c1};#{c2};#{c3};#{evlist};#{c4},#{c5},#{c6},#{c7}"
|
return "#{c1};#{c2};#{c3};#{evlist};#{c4},#{c5},#{c6},#{c7}"
|
||||||
end
|
end
|
||||||
|
|
||||||
|
# Unused.
|
||||||
def tocompact
|
def tocompact
|
||||||
return "#{species},#{item},#{nature},#{move1},#{move2},#{move3},#{move4},#{ev}"
|
return "#{species},#{item},#{nature},#{move1},#{move2},#{move3},#{move4},#{ev}"
|
||||||
end
|
end
|
||||||
@@ -164,15 +164,10 @@ class PBPokemon
|
|||||||
pokemon.moves[1] = Pokemon::Move.new(self.convertMove(@move2))
|
pokemon.moves[1] = Pokemon::Move.new(self.convertMove(@move2))
|
||||||
pokemon.moves[2] = Pokemon::Move.new(self.convertMove(@move3))
|
pokemon.moves[2] = Pokemon::Move.new(self.convertMove(@move3))
|
||||||
pokemon.moves[3] = Pokemon::Move.new(self.convertMove(@move4))
|
pokemon.moves[3] = Pokemon::Move.new(self.convertMove(@move4))
|
||||||
evcount=0
|
if ev.length > 0
|
||||||
for i in 0...6
|
ev.each { |stat| pokemon.ev[stat] = Pokemon::EV_LIMIT / ev.length }
|
||||||
evcount+=1 if ((@ev&(1<<i))!=0)
|
|
||||||
end
|
|
||||||
evperstat=(evcount==0) ? 0 : Pokemon::EV_LIMIT/evcount
|
|
||||||
for i in 0...6
|
|
||||||
pokemon.iv[i]=iv
|
|
||||||
pokemon.ev[i]=((@ev&(1<<i))!=0) ? evperstat : 0
|
|
||||||
end
|
end
|
||||||
|
GameData::Stat.each_main { |s| pokemon.iv[s.id] = iv }
|
||||||
pokemon.calcStats
|
pokemon.calcStats
|
||||||
return pokemon
|
return pokemon
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -390,7 +390,7 @@ class StandardRestriction
|
|||||||
return false if speciesBlacklist.include?(pkmn.species)
|
return false if speciesBlacklist.include?(pkmn.species)
|
||||||
# Species with total base stat 600 or more are banned
|
# Species with total base stat 600 or more are banned
|
||||||
bst = 0
|
bst = 0
|
||||||
pkmn.baseStats.each { |s| bst += s }
|
pkmn.baseStats.each_value { |s| bst += s }
|
||||||
return false if bst >= 600
|
return false if bst >= 600
|
||||||
# Is valid
|
# Is valid
|
||||||
return true
|
return true
|
||||||
|
|||||||
@@ -269,7 +269,8 @@ def pbRandomPokemonFromRule(rule,trainer)
|
|||||||
next if r<7 && evolutions(species).length>0
|
next if r<7 && evolutions(species).length>0
|
||||||
break
|
break
|
||||||
end
|
end
|
||||||
ev=rand(63)+1
|
ev = []
|
||||||
|
GameData::Stat.each_main { |s| ev.push(s.id) if rand(100) < 50 }
|
||||||
nature = nil
|
nature = nil
|
||||||
keys = GameData::Nature::DATA.keys
|
keys = GameData::Nature::DATA.keys
|
||||||
loop do
|
loop do
|
||||||
@@ -281,8 +282,9 @@ def pbRandomPokemonFromRule(rule,trainer)
|
|||||||
raised_emphasis = false
|
raised_emphasis = false
|
||||||
lowered_emphasis = false
|
lowered_emphasis = false
|
||||||
nature_data.stat_changes.each do |change|
|
nature_data.stat_changes.each do |change|
|
||||||
raised_emphasis = true if change[1] > 0 && ((ev >> change[0]) & 1) != 0
|
next if !ev.include?(change[0])
|
||||||
lowered_emphasis = true if change[1] < 0 && ((ev >> change[0]) & 1) != 0
|
raised_emphasis = true if change[1] > 0
|
||||||
|
lowered_emphasis = true if change[1] < 0
|
||||||
end
|
end
|
||||||
next if rand(10) < 6 && !raised_emphasis
|
next if rand(10) < 6 && !raised_emphasis
|
||||||
next if rand(10) < 9 && lowered_emphasis
|
next if rand(10) < 9 && lowered_emphasis
|
||||||
@@ -340,18 +342,12 @@ def pbRandomPokemonFromRule(rule,trainer)
|
|||||||
next if species != :CLAMPERL
|
next if species != :CLAMPERL
|
||||||
when :THICKCLUB
|
when :THICKCLUB
|
||||||
next if species != :CUBONE && species != :MAROWAK
|
next if species != :CUBONE && species != :MAROWAK
|
||||||
end
|
when :LIECHIBERRY
|
||||||
if item == :LIECHIBERRY && (ev&0x02)==0
|
ev.push(:ATTACK) if !ev.include?(:ATTACK) && rand(100) < 50
|
||||||
next if rand(2)==0
|
when :SALACBERRY
|
||||||
ev|=0x02
|
ev.push(:SPEED) if !ev.include?(:SPEED) && rand(100) < 50
|
||||||
end
|
when :PETAYABERRY
|
||||||
if item == :SALACBERRY && (ev&0x08)==0
|
ev.push(:SPECIAL_ATTACK) if !ev.include?(:SPECIAL_ATTACK) && rand(100) < 50
|
||||||
next if rand(2)==0
|
|
||||||
ev|=0x08
|
|
||||||
end
|
|
||||||
if item == :PETAYABERRY && (ev&0x10)==0
|
|
||||||
next if rand(2)==0
|
|
||||||
ev|=0x10
|
|
||||||
end
|
end
|
||||||
break
|
break
|
||||||
end
|
end
|
||||||
@@ -414,11 +410,11 @@ def pbRandomPokemonFromRule(rule,trainer)
|
|||||||
hasSpecial=true if d.category==1
|
hasSpecial=true if d.category==1
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
if !hasPhysical && (ev&0x02)!=0
|
if !hasPhysical && ev.include?(:ATTACK)
|
||||||
# No physical attack, but emphasizes Attack
|
# No physical attack, but emphasizes Attack
|
||||||
next if rand(10)<8
|
next if rand(10)<8
|
||||||
end
|
end
|
||||||
if !hasSpecial && (ev&0x10)!=0
|
if !hasSpecial && ev.include?(:SPECIAL_ATTACK)
|
||||||
# No special attack, but emphasizes Special Attack
|
# No special attack, but emphasizes Special Attack
|
||||||
next if rand(10)<8
|
next if rand(10)<8
|
||||||
end
|
end
|
||||||
@@ -429,12 +425,12 @@ def pbRandomPokemonFromRule(rule,trainer)
|
|||||||
############
|
############
|
||||||
# Moves accepted
|
# Moves accepted
|
||||||
if hasPhysical && !hasSpecial
|
if hasPhysical && !hasSpecial
|
||||||
ev&=~0x10 if rand(10)<8 # Deemphasize Special Attack
|
ev.push(:ATTACK) if rand(10)<8
|
||||||
ev|=0x02 if rand(10)<8 # Emphasize Attack
|
ev.delete(:SPECIAL_ATTACK) if rand(10)<8
|
||||||
end
|
end
|
||||||
if !hasPhysical && hasSpecial
|
if !hasPhysical && hasSpecial
|
||||||
ev|=0x10 if rand(10)<8 # Emphasize Special Attack
|
ev.delete(:ATTACK) if rand(10)<8
|
||||||
ev&=~0x02 if rand(10)<8 # Deemphasize Attack
|
ev.push(:SPECIAL_ATTACK) if rand(10)<8
|
||||||
end
|
end
|
||||||
item = :LEFTOVERS if !hasNormal && item == :SILKSCARF
|
item = :LEFTOVERS if !hasNormal && item == :SILKSCARF
|
||||||
moves=newmoves
|
moves=newmoves
|
||||||
@@ -1100,16 +1096,11 @@ def isBattlePokemonDuplicate(pk,pk2)
|
|||||||
# Accept as same if moves are same and there are four moves each
|
# Accept as same if moves are same and there are four moves each
|
||||||
return true if moves1[Pokemon::MAX_MOVES - 1]
|
return true if moves1[Pokemon::MAX_MOVES - 1]
|
||||||
end
|
end
|
||||||
return true if pk.item==pk2.item &&
|
same_evs = true
|
||||||
pk.nature==pk2.nature &&
|
GameData::Stat.each_main { |s| same_evs = false if pk.ev[s.id] != pk2.ev[s.id] }
|
||||||
pk.ev[0]==pk2.ev[0] &&
|
return pk.item==pk2.item && pk.nature==pk2.nature && same_evs
|
||||||
pk.ev[1]==pk2.ev[1] &&
|
|
||||||
pk.ev[2]==pk2.ev[2] &&
|
|
||||||
pk.ev[3]==pk2.ev[3] &&
|
|
||||||
pk.ev[4]==pk2.ev[4] &&
|
|
||||||
pk.ev[5]==pk2.ev[5]
|
|
||||||
return false
|
|
||||||
end
|
end
|
||||||
|
return false
|
||||||
end
|
end
|
||||||
|
|
||||||
def pbRemoveDuplicates(party)
|
def pbRemoveDuplicates(party)
|
||||||
|
|||||||
@@ -255,12 +255,12 @@ end
|
|||||||
#===============================================================================
|
#===============================================================================
|
||||||
def pbSize(pkmn)
|
def pbSize(pkmn)
|
||||||
baseheight = pkmn.height
|
baseheight = pkmn.height
|
||||||
hpiv = pkmn.iv[0] & 15
|
hpiv = pkmn.iv[:HP] & 15
|
||||||
ativ = pkmn.iv[1] & 15
|
ativ = pkmn.iv[:ATTACK] & 15
|
||||||
dfiv = pkmn.iv[2] & 15
|
dfiv = pkmn.iv[:DEFENSE] & 15
|
||||||
spiv = pkmn.iv[3] & 15
|
saiv = pkmn.iv[:SPECIAL_ATTACK] & 15
|
||||||
saiv = pkmn.iv[4] & 15
|
sdiv = pkmn.iv[:SPECIAL_DEFENSE] & 15
|
||||||
sdiv = pkmn.iv[5] & 15
|
spiv = pkmn.iv[:SPEED] & 15
|
||||||
m = pkmn.personalID & 0xFF
|
m = pkmn.personalID & 0xFF
|
||||||
n = (pkmn.personalID >> 8) & 0xFF
|
n = (pkmn.personalID >> 8) & 0xFF
|
||||||
s = (((ativ ^ dfiv) * hpiv) ^ m) * 256 + (((saiv ^ sdiv) * spiv) ^ n)
|
s = (((ativ ^ dfiv) * hpiv) ^ m) * 256 + (((saiv ^ sdiv) * spiv) ^ n)
|
||||||
|
|||||||
@@ -250,7 +250,6 @@ PokemonDebugMenuCommands.register("hiddenvalues", {
|
|||||||
"name" => _INTL("EV/IV/pID..."),
|
"name" => _INTL("EV/IV/pID..."),
|
||||||
"always_show" => true,
|
"always_show" => true,
|
||||||
"effect" => proc { |pkmn, pkmnid, heldpoke, settingUpBattle, screen|
|
"effect" => proc { |pkmn, pkmnid, heldpoke, settingUpBattle, screen|
|
||||||
numstats = 6
|
|
||||||
cmd = 0
|
cmd = 0
|
||||||
loop do
|
loop do
|
||||||
persid = sprintf("0x%08X", pkmn.personalID)
|
persid = sprintf("0x%08X", pkmn.personalID)
|
||||||
@@ -265,9 +264,11 @@ PokemonDebugMenuCommands.register("hiddenvalues", {
|
|||||||
loop do
|
loop do
|
||||||
totalev = 0
|
totalev = 0
|
||||||
evcommands = []
|
evcommands = []
|
||||||
for i in 0...numstats
|
ev_id = []
|
||||||
evcommands.push(PBStats.getName(i) + " (#{pkmn.ev[i]})")
|
GameData::Stat.each_main do |s|
|
||||||
totalev += pkmn.ev[i]
|
evcommands.push(s.name + " (#{pkmn.ev[s.id]})")
|
||||||
|
ev_id.push(s.id)
|
||||||
|
totalev += pkmn.ev[s.id]
|
||||||
end
|
end
|
||||||
evcommands.push(_INTL("Randomise all"))
|
evcommands.push(_INTL("Randomise all"))
|
||||||
evcommands.push(_INTL("Max randomise all"))
|
evcommands.push(_INTL("Max randomise all"))
|
||||||
@@ -275,41 +276,37 @@ PokemonDebugMenuCommands.register("hiddenvalues", {
|
|||||||
totalev, Pokemon::EV_LIMIT,
|
totalev, Pokemon::EV_LIMIT,
|
||||||
100 * totalev / Pokemon::EV_LIMIT), evcommands, cmd2)
|
100 * totalev / Pokemon::EV_LIMIT), evcommands, cmd2)
|
||||||
break if cmd2 < 0
|
break if cmd2 < 0
|
||||||
if cmd2 < numstats
|
if cmd2 < ev_id.length
|
||||||
params = ChooseNumberParams.new
|
params = ChooseNumberParams.new
|
||||||
upperLimit = 0
|
upperLimit = 0
|
||||||
for i in 0...numstats
|
GameData::Stat.each_main { |s| upperLimit += pkmn.ev[s.id] if s.id != ev_id[cmd2] }
|
||||||
upperLimit += pkmn.ev[i] if i != cmd2
|
|
||||||
end
|
|
||||||
upperLimit = Pokemon::EV_LIMIT - upperLimit
|
upperLimit = Pokemon::EV_LIMIT - upperLimit
|
||||||
upperLimit = [upperLimit, Pokemon::EV_STAT_LIMIT].min
|
upperLimit = [upperLimit, Pokemon::EV_STAT_LIMIT].min
|
||||||
thisValue = [pkmn.ev[cmd2], upperLimit].min
|
thisValue = [pkmn.ev[ev_id[cmd2]], upperLimit].min
|
||||||
params.setRange(0, upperLimit)
|
params.setRange(0, upperLimit)
|
||||||
params.setDefaultValue(thisValue)
|
params.setDefaultValue(thisValue)
|
||||||
params.setCancelValue(thisValue)
|
params.setCancelValue(thisValue)
|
||||||
f = pbMessageChooseNumber(_INTL("Set the EV for {1} (max. {2}).",
|
f = pbMessageChooseNumber(_INTL("Set the EV for {1} (max. {2}).",
|
||||||
PBStats.getName(cmd2), upperLimit), params) { screen.pbUpdate }
|
GameData::Stat.get(ev_id[cmd2]).name, upperLimit), params) { screen.pbUpdate }
|
||||||
if f != pkmn.ev[cmd2]
|
if f != pkmn.ev[ev_id[cmd2]]
|
||||||
pkmn.ev[cmd2] = f
|
pkmn.ev[ev_id[cmd2]] = f
|
||||||
pkmn.calcStats
|
pkmn.calcStats
|
||||||
screen.pbRefreshSingle(pkmnid)
|
screen.pbRefreshSingle(pkmnid)
|
||||||
end
|
end
|
||||||
elsif cmd2 < evcommands.length # Randomise
|
else # (Max) Randomise all
|
||||||
evTotalTarget = Pokemon::EV_LIMIT
|
evTotalTarget = Pokemon::EV_LIMIT
|
||||||
if cmd2 == evcommands.length - 2
|
if cmd2 == evcommands.length - 2 # Randomize all (not max)
|
||||||
evTotalTarget = rand(Pokemon::EV_LIMIT)
|
evTotalTarget = rand(Pokemon::EV_LIMIT)
|
||||||
end
|
end
|
||||||
for i in 0...numstats
|
GameData::Stat.each_main { |s| pkmn.ev[s.id] = 0 }
|
||||||
pkmn.ev[i] = 0
|
|
||||||
end
|
|
||||||
while evTotalTarget > 0
|
while evTotalTarget > 0
|
||||||
r = rand(numstats)
|
r = rand(ev_id.length)
|
||||||
next if pkmn.ev[r] >= Pokemon::EV_STAT_LIMIT
|
next if pkmn.ev[ev_id[r]] >= Pokemon::EV_STAT_LIMIT
|
||||||
addVal = 1 + rand(Pokemon::EV_STAT_LIMIT/4)
|
addVal = 1 + rand(Pokemon::EV_STAT_LIMIT / 4)
|
||||||
addVal = evTotalTarget if addVal > evTotalTarget
|
addVal = addVal.clamp(0, evTotalTarget)
|
||||||
addVal = [addVal, Pokemon::EV_STAT_LIMIT - pkmn.ev[r]].min
|
addVal = addVal.clamp(0, Pokemon::EV_STAT_LIMIT - pkmn.ev[ev_id[r]])
|
||||||
next if addVal == 0
|
next if addVal == 0
|
||||||
pkmn.ev[r] += addVal
|
pkmn.ev[ev_id[r]] += addVal
|
||||||
evTotalTarget -= addVal
|
evTotalTarget -= addVal
|
||||||
end
|
end
|
||||||
pkmn.calcStats
|
pkmn.calcStats
|
||||||
@@ -322,32 +319,32 @@ PokemonDebugMenuCommands.register("hiddenvalues", {
|
|||||||
hiddenpower = pbHiddenPower(pkmn)
|
hiddenpower = pbHiddenPower(pkmn)
|
||||||
totaliv = 0
|
totaliv = 0
|
||||||
ivcommands = []
|
ivcommands = []
|
||||||
for i in 0...numstats
|
iv_id = []
|
||||||
ivcommands.push(PBStats.getName(i) + " (#{pkmn.iv[i]})")
|
GameData::Stat.each_main do |s|
|
||||||
totaliv += pkmn.iv[i]
|
ivcommands.push(s.name + " (#{pkmn.iv[s.id]})")
|
||||||
|
iv_id.push(s.id)
|
||||||
|
totaliv += pkmn.iv[s.id]
|
||||||
end
|
end
|
||||||
msg = _INTL("Change which IV?\nHidden Power:\n{1}, power {2}\nTotal: {3}/{4} ({5}%)",
|
msg = _INTL("Change which IV?\nHidden Power:\n{1}, power {2}\nTotal: {3}/{4} ({5}%)",
|
||||||
GameData::Type.get(hiddenpower[0]).name, hiddenpower[1], totaliv, numstats * 31,
|
GameData::Type.get(hiddenpower[0]).name, hiddenpower[1], totaliv,
|
||||||
100 * totaliv / (numstats * 31))
|
iv_id.length * Pokemon::IV_STAT_LIMIT, 100 * totaliv / (iv_id.length * Pokemon::IV_STAT_LIMIT))
|
||||||
ivcommands.push(_INTL("Randomise all"))
|
ivcommands.push(_INTL("Randomise all"))
|
||||||
cmd2 = screen.pbShowCommands(msg, ivcommands, cmd2)
|
cmd2 = screen.pbShowCommands(msg, ivcommands, cmd2)
|
||||||
break if cmd2 < 0
|
break if cmd2 < 0
|
||||||
if cmd2 < numstats
|
if cmd2 < iv_id.length
|
||||||
params = ChooseNumberParams.new
|
params = ChooseNumberParams.new
|
||||||
params.setRange(0, 31)
|
params.setRange(0, Pokemon::IV_STAT_LIMIT)
|
||||||
params.setDefaultValue(pkmn.iv[cmd2])
|
params.setDefaultValue(pkmn.iv[iv_id[cmd2]])
|
||||||
params.setCancelValue(pkmn.iv[cmd2])
|
params.setCancelValue(pkmn.iv[iv_id[cmd2]])
|
||||||
f = pbMessageChooseNumber(_INTL("Set the IV for {1} (max. 31).",
|
f = pbMessageChooseNumber(_INTL("Set the IV for {1} (max. 31).",
|
||||||
PBStats.getName(cmd2)), params) { screen.pbUpdate }
|
GameData::Stat.get(iv_id[cmd2]).name), params) { screen.pbUpdate }
|
||||||
if f != pkmn.iv[cmd2]
|
if f != pkmn.iv[iv_id[cmd2]]
|
||||||
pkmn.iv[cmd2] = f
|
pkmn.iv[iv_id[cmd2]] = f
|
||||||
pkmn.calcStats
|
pkmn.calcStats
|
||||||
screen.pbRefreshSingle(pkmnid)
|
screen.pbRefreshSingle(pkmnid)
|
||||||
end
|
end
|
||||||
elsif cmd2 == ivcommands.length - 1 # Randomise
|
else # Randomise all
|
||||||
for i in 0...numstats
|
GameData::Stat.each_main { |s| pkmn.iv[s.id] = rand(Pokemon::IV_STAT_LIMIT + 1) }
|
||||||
pkmn.iv[i] = rand(Pokemon::IV_STAT_LIMIT + 1)
|
|
||||||
end
|
|
||||||
pkmn.calcStats
|
pkmn.calcStats
|
||||||
screen.pbRefreshSingle(pkmnid)
|
screen.pbRefreshSingle(pkmnid)
|
||||||
end
|
end
|
||||||
@@ -667,10 +664,10 @@ PokemonDebugMenuCommands.register("setnature", {
|
|||||||
nature.stat_changes.each do |change|
|
nature.stat_changes.each do |change|
|
||||||
if change[1] > 0
|
if change[1] > 0
|
||||||
plus_text += "/" if !plus_text.empty?
|
plus_text += "/" if !plus_text.empty?
|
||||||
plus_text += PBStats.getNameBrief(change[0])
|
plus_text += GameData::Stat.get(change[0]).name_brief
|
||||||
elsif change[1] < 0
|
elsif change[1] < 0
|
||||||
minus_text += "/" if !minus_text.empty?
|
minus_text += "/" if !minus_text.empty?
|
||||||
minus_text += PBStats.getNameBrief(change[0])
|
minus_text += GameData::Stat.get(change[0]).name_brief
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
commands.push(_INTL("{1} (+{2}, -{3})", nature.real_name, plus_text, minus_text))
|
commands.push(_INTL("{1} (+{2}, -{3})", nature.real_name, plus_text, minus_text))
|
||||||
|
|||||||
@@ -1021,8 +1021,8 @@ def pbPokemonEditor
|
|||||||
spec.real_pokedex_entry,
|
spec.real_pokedex_entry,
|
||||||
spec.type1,
|
spec.type1,
|
||||||
(spec.type2 == spec.type1) ? nil : spec.type2,
|
(spec.type2 == spec.type1) ? nil : spec.type2,
|
||||||
spec.base_stats.clone,
|
spec.base_stats,
|
||||||
spec.evs.clone,
|
spec.evs,
|
||||||
spec.base_exp,
|
spec.base_exp,
|
||||||
spec.growth_rate,
|
spec.growth_rate,
|
||||||
spec.gender_ratio,
|
spec.gender_ratio,
|
||||||
|
|||||||
@@ -456,35 +456,38 @@ class IVsProperty
|
|||||||
end
|
end
|
||||||
|
|
||||||
def set(settingname, oldsetting)
|
def set(settingname, oldsetting)
|
||||||
oldsetting = [nil] if !oldsetting
|
oldsetting = {} if !oldsetting
|
||||||
for i in 0...6
|
|
||||||
oldsetting[i] = oldsetting[0] if !oldsetting[i]
|
|
||||||
end
|
|
||||||
properties = []
|
properties = []
|
||||||
properties[PBStats::HP] = [_INTL("HP"), LimitProperty2.new(@limit), _INTL("Individual values for the Pokémon's HP stat (0-{1}).", @limit)]
|
data = []
|
||||||
properties[PBStats::ATTACK] = [_INTL("Attack"), LimitProperty2.new(@limit), _INTL("Individual values for the Pokémon's Attack stat (0-{1}).", @limit)]
|
stat_ids = []
|
||||||
properties[PBStats::DEFENSE] = [_INTL("Defense"), LimitProperty2.new(@limit), _INTL("Individual values for the Pokémon's Defense stat (0-{1}).", @limit)]
|
GameData::Stat.each_main do |s|
|
||||||
properties[PBStats::SPATK] = [_INTL("Sp. Atk"), LimitProperty2.new(@limit), _INTL("Individual values for the Pokémon's Sp. Atk stat (0-{1}).", @limit)]
|
oldsetting[s.pbs_order] = 0 if !oldsetting[s.pbs_order]
|
||||||
properties[PBStats::SPDEF] = [_INTL("Sp. Def"), LimitProperty2.new(@limit), _INTL("Individual values for the Pokémon's Sp. Def stat (0-{1}).", @limit)]
|
properties[s.pbs_order] = [s.name, LimitProperty2.new(@limit),
|
||||||
properties[PBStats::SPEED] = [_INTL("Speed"), LimitProperty2.new(@limit), _INTL("Individual values for the Pokémon's Speed stat (0-{1}).", @limit)]
|
_INTL("Individual values for the Pokémon's {1} stat (0-{2}).", s.name, @limit)]
|
||||||
pbPropertyList(settingname, oldsetting, properties, false)
|
data[s.pbs_order] = oldsetting[s.id]
|
||||||
hasNonNil = false
|
stat_ids[s.pbs_order] = s.id
|
||||||
firstVal = oldsetting[0] || 0
|
|
||||||
for i in 0...6
|
|
||||||
(oldsetting[i]) ? hasNonNil = true : oldsetting[i] = firstVal
|
|
||||||
end
|
end
|
||||||
return (hasNonNil) ? oldsetting : nil
|
pbPropertyList(settingname, data, properties, false)
|
||||||
|
allZeroes = true
|
||||||
|
data.each_with_index do |value, i|
|
||||||
|
data[i] ||= 0
|
||||||
|
allZeroes = false if value && value != 0
|
||||||
|
end
|
||||||
|
return nil if allZeroes
|
||||||
|
ret = {}
|
||||||
|
stat_ids.each_with_index { |s, i| ret[s] = data[i] }
|
||||||
|
return ret
|
||||||
end
|
end
|
||||||
|
|
||||||
def defaultValue
|
def defaultValue
|
||||||
return nil
|
return 0
|
||||||
end
|
end
|
||||||
|
|
||||||
def format(value)
|
def format(value)
|
||||||
return "-" if !value
|
return "-" if !value
|
||||||
return value[0].to_s if value.uniq.length == 1
|
return value[0].to_s if value.uniq.length == 1
|
||||||
ret = ""
|
ret = ""
|
||||||
for i in 0...6
|
for i in 0...value.length
|
||||||
ret.concat(",") if i > 0
|
ret.concat(",") if i > 0
|
||||||
ret.concat((value[i] || 0).to_s)
|
ret.concat((value[i] || 0).to_s)
|
||||||
end
|
end
|
||||||
@@ -500,46 +503,44 @@ class EVsProperty
|
|||||||
end
|
end
|
||||||
|
|
||||||
def set(settingname, oldsetting)
|
def set(settingname, oldsetting)
|
||||||
oldsetting = [nil] if !oldsetting
|
oldsetting = {} if !oldsetting
|
||||||
for i in 0...6
|
|
||||||
oldsetting[i] = oldsetting[0] if !oldsetting[i]
|
|
||||||
end
|
|
||||||
properties = []
|
properties = []
|
||||||
properties[PBStats::HP] = [_INTL("HP"), LimitProperty2.new(@limit), _INTL("Effort values for the Pokémon's HP stat (0-{1}).", @limit)]
|
data = []
|
||||||
properties[PBStats::ATTACK] = [_INTL("Attack"), LimitProperty2.new(@limit), _INTL("Effort values for the Pokémon's Attack stat (0-{1}).", @limit)]
|
stat_ids = []
|
||||||
properties[PBStats::DEFENSE] = [_INTL("Defense"), LimitProperty2.new(@limit), _INTL("Effort values for the Pokémon's Defense stat (0-{1}).", @limit)]
|
GameData::Stat.each_main do |s|
|
||||||
properties[PBStats::SPATK] = [_INTL("Sp. Atk"), LimitProperty2.new(@limit), _INTL("Effort values for the Pokémon's Sp. Atk stat (0-{1}).", @limit)]
|
oldsetting[s.pbs_order] = 0 if !oldsetting[s.pbs_order]
|
||||||
properties[PBStats::SPDEF] = [_INTL("Sp. Def"), LimitProperty2.new(@limit), _INTL("Effort values for the Pokémon's Sp. Def stat (0-{1}).", @limit)]
|
properties[s.pbs_order] = [s.name, LimitProperty2.new(@limit),
|
||||||
properties[PBStats::SPEED] = [_INTL("Speed"), LimitProperty2.new(@limit), _INTL("Effort values for the Pokémon's Speed stat (0-{1}).", @limit)]
|
_INTL("Effort values for the Pokémon's {1} stat (0-{2}).", s.name, @limit)]
|
||||||
|
data[s.pbs_order] = oldsetting[s.id]
|
||||||
|
stat_ids[s.pbs_order] = s.id
|
||||||
|
end
|
||||||
loop do
|
loop do
|
||||||
pbPropertyList(settingname, oldsetting, properties, false)
|
pbPropertyList(settingname,data,properties,true)
|
||||||
evtotal = 0
|
evtotal = 0
|
||||||
for i in 0...6
|
data.each { |value| evtotal += value if value }
|
||||||
evtotal += oldsetting[i] if oldsetting[i]
|
break if evtotal <= Pokemon::EV_LIMIT
|
||||||
end
|
pbMessage(_INTL("Total EVs ({1}) are greater than allowed ({2}). Please reduce them.", evtotal, Pokemon::EV_LIMIT))
|
||||||
if evtotal > Pokemon::EV_LIMIT
|
|
||||||
pbMessage(_INTL("Total EVs ({1}) are greater than allowed ({2}). Please reduce them.", evtotal, Pokemon::EV_LIMIT))
|
|
||||||
else
|
|
||||||
break
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
hasNonNil = false
|
allZeroes = true
|
||||||
firstVal = oldsetting[0] || 0
|
data.each_with_index do |value, i|
|
||||||
for i in 0...6
|
data[i] ||= 0
|
||||||
(oldsetting[i]) ? hasNonNil = true : oldsetting[i] = firstVal
|
allZeroes = false if value && value != 0
|
||||||
end
|
end
|
||||||
return (hasNonNil) ? oldsetting : nil
|
return nil if allZeroes
|
||||||
|
ret = {}
|
||||||
|
stat_ids.each_with_index { |s, i| ret[s] = data[i] }
|
||||||
|
return ret
|
||||||
end
|
end
|
||||||
|
|
||||||
def defaultValue
|
def defaultValue
|
||||||
return nil
|
return 0
|
||||||
end
|
end
|
||||||
|
|
||||||
def format(value)
|
def format(value)
|
||||||
return "-" if !value
|
return "-" if !value
|
||||||
return value[0].to_s if value.uniq.length == 1
|
return value[0].to_s if value.uniq.length == 1
|
||||||
ret = ""
|
ret = ""
|
||||||
for i in 0...6
|
for i in 0...value.length
|
||||||
ret.concat(",") if i > 0
|
ret.concat(",") if i > 0
|
||||||
ret.concat((value[i] || 0).to_s)
|
ret.concat((value[i] || 0).to_s)
|
||||||
end
|
end
|
||||||
@@ -827,16 +828,18 @@ module BaseStatsProperty
|
|||||||
def self.set(settingname,oldsetting)
|
def self.set(settingname,oldsetting)
|
||||||
return oldsetting if !oldsetting
|
return oldsetting if !oldsetting
|
||||||
properties = []
|
properties = []
|
||||||
properties[PBStats::HP] = _INTL("Base HP"), NonzeroLimitProperty.new(255), _INTL("Base HP stat of the Pokémon.")
|
data = []
|
||||||
properties[PBStats::ATTACK] = _INTL("Base Attack"), NonzeroLimitProperty.new(255), _INTL("Base Attack stat of the Pokémon.")
|
stat_ids = []
|
||||||
properties[PBStats::DEFENSE] = _INTL("Base Defense"), NonzeroLimitProperty.new(255), _INTL("Base Defense stat of the Pokémon.")
|
GameData::Stat.each_main do |s|
|
||||||
properties[PBStats::SPATK] = _INTL("Base Sp. Attack"), NonzeroLimitProperty.new(255), _INTL("Base Special Attack stat of the Pokémon.")
|
properties[s.pbs_order] = [_INTL("Base {1}", s.name), NonzeroLimitProperty.new(255),
|
||||||
properties[PBStats::SPDEF] = _INTL("Base Sp. Defense"), NonzeroLimitProperty.new(255), _INTL("Base Special Defense stat of the Pokémon.")
|
_INTL("Base {1} stat of the Pokémon.", s.name)]
|
||||||
properties[PBStats::SPEED] = _INTL("Base Speed"), NonzeroLimitProperty.new(255), _INTL("Base Speed stat of the Pokémon.")
|
data[s.pbs_order] = oldsetting[s.id]
|
||||||
if !pbPropertyList(settingname,oldsetting,properties,true)
|
stat_ids[s.pbs_order] = s.id
|
||||||
oldsetting = nil
|
end
|
||||||
else
|
if pbPropertyList(settingname,data,properties,true)
|
||||||
oldsetting = nil if !oldsetting[0] || oldsetting[0]==0
|
ret = {}
|
||||||
|
stat_ids.each_with_index { |s, i| ret[s] = data[i] }
|
||||||
|
oldsetting = ret
|
||||||
end
|
end
|
||||||
return oldsetting
|
return oldsetting
|
||||||
end
|
end
|
||||||
@@ -856,16 +859,18 @@ module EffortValuesProperty
|
|||||||
def self.set(settingname,oldsetting)
|
def self.set(settingname,oldsetting)
|
||||||
return oldsetting if !oldsetting
|
return oldsetting if !oldsetting
|
||||||
properties = []
|
properties = []
|
||||||
properties[PBStats::HP] = [_INTL("HP EVs"), LimitProperty.new(255), _INTL("Number of HP Effort Value points gained from the Pokémon.")]
|
data = []
|
||||||
properties[PBStats::ATTACK] = [_INTL("Attack EVs"), LimitProperty.new(255), _INTL("Number of Attack Effort Value points gained from the Pokémon.")]
|
stat_ids = []
|
||||||
properties[PBStats::DEFENSE] = [_INTL("Defense EVs"), LimitProperty.new(255), _INTL("Number of Defense Effort Value points gained from the Pokémon.")]
|
GameData::Stat.each_main do |s|
|
||||||
properties[PBStats::SPATK] = [_INTL("Sp. Attack EVs"), LimitProperty.new(255), _INTL("Number of Special Attack Effort Value points gained from the Pokémon.")]
|
properties[s.pbs_order] = [_INTL("{1} EVs", s.name), LimitProperty.new(255),
|
||||||
properties[PBStats::SPDEF] = [_INTL("Sp. Defense EVs"), LimitProperty.new(255), _INTL("Number of Special Defense Effort Value points gained from the Pokémon.")]
|
_INTL("Number of {1} Effort Value points gained from the Pokémon.", s.name)]
|
||||||
properties[PBStats::SPEED] = [_INTL("Speed EVs"), LimitProperty.new(255), _INTL("Number of Speed Effort Value points gained from the Pokémon.")]
|
data[s.pbs_order] = oldsetting[s.id]
|
||||||
if !pbPropertyList(settingname,oldsetting,properties,true)
|
stat_ids[s.pbs_order] = s.id
|
||||||
oldsetting = nil
|
end
|
||||||
else
|
if pbPropertyList(settingname,oldsetting,properties,true)
|
||||||
oldsetting = nil if !oldsetting[0] || oldsetting[0]==0
|
ret = {}
|
||||||
|
stat_ids.each_with_index { |s, i| ret[s] = data[i] }
|
||||||
|
oldsetting = ret
|
||||||
end
|
end
|
||||||
return oldsetting
|
return oldsetting
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -416,6 +416,12 @@ module Compiler
|
|||||||
contents[key] = value
|
contents[key] = value
|
||||||
# Sanitise data
|
# Sanitise data
|
||||||
case key
|
case key
|
||||||
|
when "BaseStats", "EffortPoints"
|
||||||
|
value_hash = {}
|
||||||
|
GameData::Stat.each_main do |s|
|
||||||
|
value_hash[s.id] = value[s.pbs_order] if s.pbs_order >= 0
|
||||||
|
end
|
||||||
|
contents[key] = value_hash
|
||||||
when "Height", "Weight"
|
when "Height", "Weight"
|
||||||
# Convert height/weight to 1 decimal place and multiply by 10
|
# Convert height/weight to 1 decimal place and multiply by 10
|
||||||
value = (value * 10).round
|
value = (value * 10).round
|
||||||
@@ -588,6 +594,12 @@ module Compiler
|
|||||||
contents[key] = value
|
contents[key] = value
|
||||||
# Sanitise data
|
# Sanitise data
|
||||||
case key
|
case key
|
||||||
|
when "BaseStats", "EffortPoints"
|
||||||
|
value_hash = {}
|
||||||
|
GameData::Stat.each_main do |s|
|
||||||
|
value_hash[s.id] = value[s.pbs_order] if s.pbs_order >= 0
|
||||||
|
end
|
||||||
|
contents[key] = value_hash
|
||||||
when "Height", "Weight"
|
when "Height", "Weight"
|
||||||
# Convert height/weight to 1 decimal place and multiply by 10
|
# Convert height/weight to 1 decimal place and multiply by 10
|
||||||
value = (value * 10).round
|
value = (value * 10).round
|
||||||
@@ -1176,8 +1188,9 @@ module Compiler
|
|||||||
raise _INTL("Bad EV: {1} (must be 0-{2}).\r\n{3}", ev, Pokemon::EV_STAT_LIMIT, FileLineData.linereport)
|
raise _INTL("Bad EV: {1} (must be 0-{2}).\r\n{3}", ev, Pokemon::EV_STAT_LIMIT, FileLineData.linereport)
|
||||||
end
|
end
|
||||||
ev_total = 0
|
ev_total = 0
|
||||||
PBStats.eachStat do |stat|
|
GameData::Stat.each_main do |s|
|
||||||
ev_total += (stat < property_value.length) ? property_value[stat] : property_value[0]
|
next if s.pbs_order < 0
|
||||||
|
ev_total += (property_value[s.pbs_order] || property_value[0])
|
||||||
end
|
end
|
||||||
if ev_total > Pokemon::EV_LIMIT
|
if ev_total > Pokemon::EV_LIMIT
|
||||||
raise _INTL("Total EVs are greater than allowed ({1}).\r\n{2}", Pokemon::EV_LIMIT, FileLineData.linereport)
|
raise _INTL("Total EVs are greater than allowed ({1}).\r\n{2}", Pokemon::EV_LIMIT, FileLineData.linereport)
|
||||||
@@ -1202,7 +1215,17 @@ module Compiler
|
|||||||
if !current_pkmn
|
if !current_pkmn
|
||||||
raise _INTL("Pokémon hasn't been defined yet!\r\n{1}", FileLineData.linereport)
|
raise _INTL("Pokémon hasn't been defined yet!\r\n{1}", FileLineData.linereport)
|
||||||
end
|
end
|
||||||
current_pkmn[line_schema[0]] = property_value
|
case property_name
|
||||||
|
when "IV", "EV"
|
||||||
|
value_hash = {}
|
||||||
|
GameData::Stat.each_main do |s|
|
||||||
|
next if s.pbs_order < 0
|
||||||
|
value_hash[s.id] = property_value[s.pbs_order] || property_value[0]
|
||||||
|
end
|
||||||
|
current_pkmn[line_schema[0]] = value_hash
|
||||||
|
else
|
||||||
|
current_pkmn[line_schema[0]] = property_value
|
||||||
|
end
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
# Old format - backwards compatibility is SUCH fun!
|
# Old format - backwards compatibility is SUCH fun!
|
||||||
@@ -1282,9 +1305,11 @@ module Compiler
|
|||||||
# Write all line data to hash
|
# Write all line data to hash
|
||||||
moves = [line_data[3], line_data[4], line_data[5], line_data[6]]
|
moves = [line_data[3], line_data[4], line_data[5], line_data[6]]
|
||||||
moves.uniq!.compact!
|
moves.uniq!.compact!
|
||||||
ivs = []
|
ivs = {}
|
||||||
if line_data[12]
|
if line_data[12]
|
||||||
PBStats.each { |s| ivs[s] = line_data[12] }
|
GameData::Stat.each_main do |s|
|
||||||
|
ivs[s.id] = line_data[12] if s.pbs_order >= 0
|
||||||
|
end
|
||||||
end
|
end
|
||||||
current_pkmn[:level] = line_data[1]
|
current_pkmn[:level] = line_data[1]
|
||||||
current_pkmn[:item] = line_data[2] if line_data[2]
|
current_pkmn[:item] = line_data[2] if line_data[2]
|
||||||
|
|||||||
@@ -272,11 +272,18 @@ module Compiler
|
|||||||
f.write(sprintf("InternalName = %s\r\n", species.species))
|
f.write(sprintf("InternalName = %s\r\n", species.species))
|
||||||
f.write(sprintf("Type1 = %s\r\n", species.type1))
|
f.write(sprintf("Type1 = %s\r\n", species.type1))
|
||||||
f.write(sprintf("Type2 = %s\r\n", species.type2)) if species.type2 != species.type1
|
f.write(sprintf("Type2 = %s\r\n", species.type2)) if species.type2 != species.type1
|
||||||
f.write(sprintf("BaseStats = %s\r\n", species.base_stats.join(",")))
|
stats_array = []
|
||||||
|
evs_array = []
|
||||||
|
GameData::Stat.each_main do |s|
|
||||||
|
next if s.pbs_order < 0
|
||||||
|
stats_array[s.pbs_order] = species.base_stats[s.id]
|
||||||
|
evs_array[s.pbs_order] = species.evs[s.id]
|
||||||
|
end
|
||||||
|
f.write(sprintf("BaseStats = %s\r\n", stats_array.join(",")))
|
||||||
f.write(sprintf("GenderRate = %s\r\n", species.gender_ratio))
|
f.write(sprintf("GenderRate = %s\r\n", species.gender_ratio))
|
||||||
f.write(sprintf("GrowthRate = %s\r\n", species.growth_rate))
|
f.write(sprintf("GrowthRate = %s\r\n", species.growth_rate))
|
||||||
f.write(sprintf("BaseEXP = %d\r\n", species.base_exp))
|
f.write(sprintf("BaseEXP = %d\r\n", species.base_exp))
|
||||||
f.write(sprintf("EffortPoints = %s\r\n", species.evs.join(",")))
|
f.write(sprintf("EffortPoints = %s\r\n", evs_array.join(",")))
|
||||||
f.write(sprintf("Rareness = %d\r\n", species.catch_rate))
|
f.write(sprintf("Rareness = %d\r\n", species.catch_rate))
|
||||||
f.write(sprintf("Happiness = %d\r\n", species.happiness))
|
f.write(sprintf("Happiness = %d\r\n", species.happiness))
|
||||||
if species.abilities.length > 0
|
if species.abilities.length > 0
|
||||||
@@ -370,9 +377,16 @@ module Compiler
|
|||||||
f.write(sprintf("Type1 = %s\r\n", species.type1))
|
f.write(sprintf("Type1 = %s\r\n", species.type1))
|
||||||
f.write(sprintf("Type2 = %s\r\n", species.type2)) if species.type2 != species.type1
|
f.write(sprintf("Type2 = %s\r\n", species.type2)) if species.type2 != species.type1
|
||||||
end
|
end
|
||||||
f.write(sprintf("BaseStats = %s\r\n", species.base_stats.join(","))) if species.base_stats != base_species.base_stats
|
stats_array = []
|
||||||
|
evs_array = []
|
||||||
|
GameData::Stat.each_main do |s|
|
||||||
|
next if s.pbs_order < 0
|
||||||
|
stats_array[s.pbs_order] = species.base_stats[s.id]
|
||||||
|
evs_array[s.pbs_order] = species.evs[s.id]
|
||||||
|
end
|
||||||
|
f.write(sprintf("BaseStats = %s\r\n", stats_array.join(","))) if species.base_stats != base_species.base_stats
|
||||||
f.write(sprintf("BaseEXP = %d\r\n", species.base_exp)) if species.base_exp != base_species.base_exp
|
f.write(sprintf("BaseEXP = %d\r\n", species.base_exp)) if species.base_exp != base_species.base_exp
|
||||||
f.write(sprintf("EffortPoints = %s\r\n", species.evs.join(","))) if species.evs != base_species.evs
|
f.write(sprintf("EffortPoints = %s\r\n", evs_array.join(","))) if species.evs != base_species.evs
|
||||||
f.write(sprintf("Rareness = %d\r\n", species.catch_rate)) if species.catch_rate != base_species.catch_rate
|
f.write(sprintf("Rareness = %d\r\n", species.catch_rate)) if species.catch_rate != base_species.catch_rate
|
||||||
f.write(sprintf("Happiness = %d\r\n", species.happiness)) if species.happiness != base_species.happiness
|
f.write(sprintf("Happiness = %d\r\n", species.happiness)) if species.happiness != base_species.happiness
|
||||||
if species.abilities.length > 0 && species.abilities != base_species.abilities
|
if species.abilities.length > 0 && species.abilities != base_species.abilities
|
||||||
@@ -604,12 +618,15 @@ module Compiler
|
|||||||
f.write(sprintf(" Ability = %d\r\n", pkmn[:ability_flag])) if pkmn[:ability_flag]
|
f.write(sprintf(" Ability = %d\r\n", pkmn[:ability_flag])) if pkmn[:ability_flag]
|
||||||
f.write(sprintf(" Item = %s\r\n", pkmn[:item])) if pkmn[:item]
|
f.write(sprintf(" Item = %s\r\n", pkmn[:item])) if pkmn[:item]
|
||||||
f.write(sprintf(" Nature = %s\r\n", pkmn[:nature])) if pkmn[:nature]
|
f.write(sprintf(" Nature = %s\r\n", pkmn[:nature])) if pkmn[:nature]
|
||||||
if pkmn[:iv] && pkmn[:iv].length > 0
|
ivs_array = []
|
||||||
f.write(sprintf(" IV = %s\r\n", (pkmn[:iv].uniq.length == 1) ? pkmn[:iv][0] : pkmn[:iv].join(",")))
|
evs_array = []
|
||||||
end
|
GameData::Stat.each_main do |s|
|
||||||
if pkmn[:ev] && pkmn[:ev].length > 0
|
next if s.pbs_order < 0
|
||||||
f.write(sprintf(" EV = %s\r\n", (pkmn[:ev].uniq.length == 1) ? pkmn[:ev][0] : pkmn[:ev].join(",")))
|
ivs_array[s.pbs_order] = pkmn[:iv][s.id] if pkmn[:iv]
|
||||||
|
evs_array[s.pbs_order] = pkmn[:ev][s.id] if pkmn[:ev]
|
||||||
end
|
end
|
||||||
|
f.write(sprintf(" IV = %s\r\n", ivs_array.join(","))) if pkmn[:iv]
|
||||||
|
f.write(sprintf(" EV = %s\r\n", evs_array.join(","))) if pkmn[:ev]
|
||||||
f.write(sprintf(" Happiness = %d\r\n", pkmn[:happiness])) if pkmn[:happiness]
|
f.write(sprintf(" Happiness = %d\r\n", pkmn[:happiness])) if pkmn[:happiness]
|
||||||
f.write(sprintf(" Ball = %d\r\n", pkmn[:poke_ball])) if pkmn[:poke_ball]
|
f.write(sprintf(" Ball = %d\r\n", pkmn[:poke_ball])) if pkmn[:poke_ball]
|
||||||
end
|
end
|
||||||
@@ -687,6 +704,7 @@ module Compiler
|
|||||||
moves = { 0 => "" }
|
moves = { 0 => "" }
|
||||||
items = { 0 => "" }
|
items = { 0 => "" }
|
||||||
natures = {}
|
natures = {}
|
||||||
|
# TODO: Stat change (rewrite this).
|
||||||
evs = ["HP", "ATK", "DEF", "SPD", "SA", "SD"]
|
evs = ["HP", "ATK", "DEF", "SPD", "SA", "SD"]
|
||||||
File.open(filename,"wb") { |f|
|
File.open(filename,"wb") { |f|
|
||||||
add_PBS_header_to_file(f)
|
add_PBS_header_to_file(f)
|
||||||
@@ -697,9 +715,10 @@ module Compiler
|
|||||||
c1 = (species[pkmn.species]) ? species[pkmn.species] : (species[pkmn.species] = GameData::Species.get(pkmn.species).species.to_s)
|
c1 = (species[pkmn.species]) ? species[pkmn.species] : (species[pkmn.species] = GameData::Species.get(pkmn.species).species.to_s)
|
||||||
c2 = (items[pkmn.item]) ? items[pkmn.item] : (items[pkmn.item] = GameData::Item.get(pkmn.item).id.to_s)
|
c2 = (items[pkmn.item]) ? items[pkmn.item] : (items[pkmn.item] = GameData::Item.get(pkmn.item).id.to_s)
|
||||||
c3 = (natures[pkmn.nature]) ? natures[pkmn.nature] : (natures[pkmn.nature] = GameData::Nature.get(pkmn.nature).id.to_s)
|
c3 = (natures[pkmn.nature]) ? natures[pkmn.nature] : (natures[pkmn.nature] = GameData::Nature.get(pkmn.nature).id.to_s)
|
||||||
|
# TODO: Stat change (rewrite this).
|
||||||
evlist = ""
|
evlist = ""
|
||||||
ev = pkmn.ev
|
ev = pkmn.ev
|
||||||
for i in 0...ev
|
for i in 0...evs.length
|
||||||
if (ev & (1 << i)) != 0
|
if (ev & (1 << i)) != 0
|
||||||
evlist += "," if evlist.length > 0
|
evlist += "," if evlist.length > 0
|
||||||
evlist += evs[i]
|
evlist += evs[i]
|
||||||
|
|||||||
Reference in New Issue
Block a user