mirror of
https://github.com/infinitefusion/infinitefusion-e18.git
synced 2026-07-22 15:47:00 +00:00
Update 6.8
This commit is contained in:
@@ -66,12 +66,17 @@ module Effectiveness
|
||||
SUPER_EFFECTIVE_ONE = 4
|
||||
NORMAL_EFFECTIVE = NORMAL_EFFECTIVE_ONE ** 3
|
||||
|
||||
NOT_VERY_EFFECTIVE = 4
|
||||
EXTREMELY_EFFECTIVE = 32
|
||||
module_function
|
||||
|
||||
def ineffective?(value)
|
||||
return value == INEFFECTIVE
|
||||
end
|
||||
|
||||
def mostly_ineffective?(value)
|
||||
return value > INEFFECTIVE && value < NOT_VERY_EFFECTIVE
|
||||
end
|
||||
def not_very_effective?(value)
|
||||
return value > INEFFECTIVE && value < NORMAL_EFFECTIVE
|
||||
end
|
||||
@@ -88,6 +93,10 @@ module Effectiveness
|
||||
return value > NORMAL_EFFECTIVE
|
||||
end
|
||||
|
||||
def extremely_effective?(value)
|
||||
return value >= EXTREMELY_EFFECTIVE
|
||||
end
|
||||
|
||||
def ineffective_type?(attack_type, defend_type1, defend_type2 = nil, defend_type3 = nil)
|
||||
value = calculate(attack_type, defend_type1, defend_type2, defend_type3)
|
||||
return ineffective?(value)
|
||||
|
||||
@@ -192,26 +192,23 @@ module GameData
|
||||
end
|
||||
# @return [String] the translated name of this species
|
||||
def name
|
||||
return @real_name
|
||||
#return pbGetMessage(MessageTypes::Species, @id_number)
|
||||
ret = MessageTypes.get(MessageTypes::Species, @id_number)
|
||||
return (ret && !ret.empty?) ? ret : @real_name
|
||||
end
|
||||
|
||||
# @return [String] the translated name of this form of this species
|
||||
def form_name
|
||||
return @real_form_name
|
||||
#return pbGetMessage(MessageTypes::FormNames, @id_number)
|
||||
ret = MessageTypes.get(MessageTypes::FormNames, @id_number)
|
||||
return (ret && !ret.empty?) ? ret : @real_form_name
|
||||
end
|
||||
|
||||
# @return [String] the translated Pokédex category of this species
|
||||
def category
|
||||
return @real_category
|
||||
#return pbGetMessage(MessageTypes::Kinds, @id_number)
|
||||
ret = MessageTypes.get(MessageTypes::Kinds, @id_number)
|
||||
return (ret && !ret.empty?) ? ret : @real_category
|
||||
end
|
||||
|
||||
# @return [String] the translated Pokédex entry of this species
|
||||
def pokedex_entry
|
||||
return @real_pokedex_entry
|
||||
#return pbGetMessage(MessageTypes::Entries, @id_number)
|
||||
ret = MessageTypes.get(MessageTypes::Entries, @id_number)
|
||||
return (ret && !ret.empty?) ? ret : @real_pokedex_entry
|
||||
end
|
||||
|
||||
def is_fusion
|
||||
@@ -287,6 +284,40 @@ module GameData
|
||||
return ret
|
||||
end
|
||||
|
||||
def get_ordered_family_species(exclude_invalid = true)
|
||||
baby = self.get_baby_species
|
||||
tree = GameData::Species.get(baby).build_evo_tree(exclude_invalid)
|
||||
result = []
|
||||
flatten_evo_tree(tree, result)
|
||||
return result
|
||||
end
|
||||
|
||||
private
|
||||
|
||||
def flatten_evo_tree(node, result)
|
||||
result << node[:species]
|
||||
node[:children].each { |child| flatten_evo_tree(child, result) }
|
||||
end
|
||||
|
||||
def build_evo_tree(exclude_invalid = true)
|
||||
evos = self.get_evolutions(exclude_invalid)
|
||||
evos = evos.sort do |a, b|
|
||||
a_is_level = (a[1] == :Level)
|
||||
b_is_level = (b[1] == :Level)
|
||||
if a_is_level && b_is_level
|
||||
(a[2] || 0) <=> (b[2] || 0)
|
||||
elsif a_is_level then -1
|
||||
elsif b_is_level then 1
|
||||
else a[1].to_s <=> b[1].to_s
|
||||
end
|
||||
end
|
||||
|
||||
{
|
||||
species: @species,
|
||||
children: evos.map { |evo| GameData::Species.get(evo[0]).build_evo_tree(exclude_invalid) }
|
||||
}
|
||||
end
|
||||
|
||||
def get_previous_species
|
||||
return @species if @evolutions.length == 0
|
||||
@evolutions.each { |evo| return evo[0] if evo[3] } # Is the prevolution
|
||||
|
||||
@@ -226,7 +226,8 @@ module GameData
|
||||
|
||||
def self.play_cry_from_species(species, form = 0, volume = 90, pitch = 100)
|
||||
dex_num = getDexNumberForSpecies(species)
|
||||
return if !dex_num
|
||||
return unless dex_num
|
||||
return unless dex_num.is_a?(Integer)
|
||||
return play_triple_fusion_cry(species, volume, pitch) if dex_num > Settings::ZAPMOLCUNO_NB
|
||||
if dex_num > NB_POKEMON
|
||||
body_number = getBodyID(dex_num)
|
||||
@@ -254,9 +255,6 @@ module GameData
|
||||
|
||||
def self.play_triple_fusion_cry(species_id, volume, pitch)
|
||||
fusion_components = get_triple_fusion_components(species_id)
|
||||
|
||||
echoln fusion_components
|
||||
echoln species_id
|
||||
for id in fusion_components
|
||||
cry_filename = self.check_cry_file(id,nil)
|
||||
pbSEPlay(cry_filename,volume-10) rescue nil
|
||||
|
||||
@@ -45,10 +45,10 @@ module GameData
|
||||
|
||||
def self.front_sprite_filename(tr_type)
|
||||
tr_type_data = self.try_get(tr_type)
|
||||
path = "Graphics/Trainers/"
|
||||
file = sprintf("trainer%03d", tr_type_data.id_number)
|
||||
ret = path + file
|
||||
return ret if pbResolveBitmap(ret)
|
||||
path = "Graphics/Trainers/#{tr_type.to_s}"
|
||||
#file = sprintf("trainer%03d", tr_type_data.id_number)
|
||||
#ret = path + file
|
||||
return path if pbResolveBitmap(path)
|
||||
end
|
||||
|
||||
def self.player_front_sprite_filename(tr_type)
|
||||
|
||||
@@ -11,12 +11,17 @@ module GameData
|
||||
|
||||
|
||||
attr_accessor :loseText_rematch
|
||||
attr_accessor :loseText_rematch_double
|
||||
|
||||
attr_accessor :battleText
|
||||
attr_accessor :preRematchText
|
||||
attr_accessor :preRematchText_caught
|
||||
attr_accessor :preRematchText_evolved
|
||||
attr_accessor :preRematchText_fused
|
||||
attr_accessor :preRematchText_unfused
|
||||
attr_accessor :preRematchText_reversed
|
||||
attr_accessor :preRematchText_gift
|
||||
attr_accessor :infoText
|
||||
|
||||
DATA = {}
|
||||
DATA_FILENAME = "trainers.dat"
|
||||
@@ -28,6 +33,8 @@ module GameData
|
||||
"Form" => [:form, "u"],
|
||||
"Name" => [:name, "s"],
|
||||
"Moves" => [:moves, "*e", :Move],
|
||||
"MovesHard" => [:moves_hard, "*e", :Move],
|
||||
"MovesEasy" => [:moves_easy, "*e", :Move],
|
||||
"Ability" => [:ability, "s"],
|
||||
"AbilityIndex" => [:ability_index, "u"],
|
||||
"Item" => [:item, "e", :Item],
|
||||
@@ -42,12 +49,16 @@ module GameData
|
||||
"Ball" => [:poke_ball, "s"],
|
||||
|
||||
"LoseTextRematch" => [:loseText_rematch, "s"],
|
||||
"LoseTextRematchDouble" => [:loseText_rematch_double, "s"],
|
||||
"BattleText" => [:battleText, "s"],
|
||||
"PreRematchText" => [:preRematchText, "s"],
|
||||
"PreRematchText_caught" => [:preRematchText_caught, "s"],
|
||||
"PreRematchText_evolved" => [:preRematchText_evolved, "s"],
|
||||
"PreRematchText_fused" => [:preRematchText_fused, "s"],
|
||||
"PreRematchText_unfused" => [:preRematchText_unfused, "s"],
|
||||
"PreRematchText_reversed" => [:preRematchText_reversed, "s"],
|
||||
"PreRematchText_gift" => [:preRematchText_gift, "s"],
|
||||
"TrainerInfo" => [:infoText, "s"],
|
||||
|
||||
|
||||
}
|
||||
@@ -112,14 +123,17 @@ module GameData
|
||||
pkmn[:ev][s.id] ||= 0 if pkmn[:ev]
|
||||
end
|
||||
end
|
||||
|
||||
@battleText = hash[:battleText]
|
||||
@loseText_rematch = hash[:loseText_rematch] || @real_lose_text
|
||||
@preRematchText = hash[:preRematchText] || "Are you up for a rematch? Or maybe you want to trade..."
|
||||
@preRematchText = hash[:preRematchText] || _INTL("Are you up for a rematch? Or maybe you want to trade...")
|
||||
@preRematchText_caught = hash[:preRematchText_caught] || @preRematchText
|
||||
@preRematchText_evolved = hash[:preRematchText_evolved] || @preRematchText
|
||||
@preRematchText_fused = hash[:preRematchText_fused] || @preRematchText
|
||||
@preRematchText_unfused = hash[:preRematchText_unfused] || @preRematchText
|
||||
@preRematchText_reversed = hash[:preRematchText_reversed] || @preRematchText
|
||||
@preRematchText_gift = hash[:preRematchText_gift] || @preRematchText
|
||||
@infoText = hash[:infoText]
|
||||
|
||||
end
|
||||
|
||||
# @return [String] the translated name of this trainer
|
||||
@@ -127,6 +141,10 @@ module GameData
|
||||
return pbGetMessageFromHash(MessageTypes::TrainerNames, @real_name)
|
||||
end
|
||||
|
||||
def battle_text
|
||||
return pbGetMessageFromHash(MessageTypes::BeginSpeech, @battleText)
|
||||
end
|
||||
|
||||
# @return [String] the translated in-battle lose message of this trainer
|
||||
def lose_text
|
||||
return pbGetMessageFromHash(MessageTypes::TrainerLoseText, @real_lose_text)
|
||||
@@ -160,6 +178,14 @@ module GameData
|
||||
return pbGetMessageFromHash(MessageTypes::BeginSpeech, @preRematchText_reversed)
|
||||
end
|
||||
|
||||
def preRematch_text_gift
|
||||
return pbGetMessageFromHash(MessageTypes::BeginSpeech, @preRematchText_gift)
|
||||
end
|
||||
|
||||
def infoText
|
||||
return pbGetMessageFromHash(MessageTypes::TrainerInfoText, @infoText)
|
||||
end
|
||||
|
||||
def replace_species_with_placeholder(species)
|
||||
case species
|
||||
when Settings::RIVAL_STARTER_PLACEHOLDER_SPECIES
|
||||
@@ -186,6 +212,7 @@ module GameData
|
||||
end
|
||||
|
||||
def generateRandomGymSpecies(old_species)
|
||||
echoln "GENERATING GYM SPECIES"
|
||||
gym_index = pbGet(VAR_CURRENT_GYM_TYPE)
|
||||
return old_species if gym_index == -1
|
||||
return generateRandomChampionSpecies(old_species) if gym_index == 999
|
||||
@@ -195,10 +222,12 @@ module GameData
|
||||
customsList = getCustomSpeciesList()
|
||||
bst_range = pbGet(VAR_RANDOMIZER_TRAINER_BST)
|
||||
gym_type = GameData::Type.get(type_id)
|
||||
echoln "type: #{gym_type.id}"
|
||||
|
||||
while true
|
||||
new_species = $game_switches[SWITCH_RANDOM_GYM_CUSTOMS] ? getSpecies(getNewCustomSpecies(old_species, customsList, bst_range)) : getSpecies(getNewSpecies(old_species, bst_range))
|
||||
if new_species.hasType?(gym_type) || $game_switches[SWITCH_RANDOM_GYM_CUSTOMS] || $game_switches[SWITCH_LEGENDARY_MODE]
|
||||
# Note: gym Type validation is handled in-house for legendary mode
|
||||
return new_species if $game_switches[SWITCH_LEGENDARY_MODE] # new_species = $game_switches[SWITCH_RANDOM_GYM_CUSTOMS] ? getSpecies(getNewCustomSpecies(old_species, customsList, bst_range)) : getSpecies(getNewSpecies(old_species, bst_range))
|
||||
if new_species.hasType?(gym_type)
|
||||
return new_species
|
||||
end
|
||||
end
|
||||
@@ -248,7 +277,7 @@ module GameData
|
||||
end
|
||||
|
||||
def replace_species_to_randomized_regular(species, trainerId, pokemonIndex)
|
||||
if $PokemonGlobal.randomTrainersHash[trainerId] == nil
|
||||
if !$PokemonGlobal.randomTrainersHash || $PokemonGlobal.randomTrainersHash[trainerId] == nil
|
||||
Kernel.pbMessage(_INTL("The trainers need to be re-shuffled."))
|
||||
Kernel.pbShuffleTrainers()
|
||||
end
|
||||
@@ -384,7 +413,11 @@ module GameData
|
||||
else
|
||||
pkmn.item = pkmn_data[:item]
|
||||
end
|
||||
if pkmn_data[:moves] && pkmn_data[:moves].length > 0 && original_species == species
|
||||
if pkmn_data[:moves_hard] && pkmn_data[:moves_hard].length > 0 && $game_switches[SWITCH_GAME_DIFFICULTY_HARD] && original_species == species
|
||||
pkmn_data[:moves_hard].each { |move| pkmn.learn_move(move) }
|
||||
elsif pkmn_data[:moves_easy] && pkmn_data[:moves_easy].length > 0 && $game_switches[SWITCH_GAME_DIFFICULTY_EASY] && original_species == species
|
||||
pkmn_data[:moves_easy].each { |move| pkmn.learn_move(move) }
|
||||
elsif pkmn_data[:moves] && pkmn_data[:moves].length > 0 && original_species == species
|
||||
pkmn_data[:moves].each { |move| pkmn.learn_move(move) }
|
||||
else
|
||||
pkmn.reset_moves
|
||||
@@ -392,13 +425,6 @@ module GameData
|
||||
pkmn.ability_index = pkmn_data[:ability_index]
|
||||
pkmn.ability = pkmn_data[:ability]
|
||||
|
||||
if $game_switches[SWITCH_DOUBLE_ABILITIES] && pkmn.isFusion?
|
||||
secondary_ability_index = pkmn.ability_index == 0 ? 1 : 0
|
||||
pkmn.ability2_index = secondary_ability_index
|
||||
pkmn.ability2 = pkmn.getAbilityList[secondary_ability_index][0]
|
||||
#print "Primary: {1}, Secondary: {2}",pkmn.ability.id, pkmn.ability2.id
|
||||
end
|
||||
|
||||
pkmn.gender = pkmn_data[:gender] || ((trainer.male?) ? 0 : 1)
|
||||
pkmn.shiny = (pkmn_data[:shininess]) ? true : false
|
||||
if pkmn_data[:nature]
|
||||
|
||||
@@ -14,6 +14,7 @@ module GameData
|
||||
attr_reader :snap_edges
|
||||
attr_reader :random_dungeon
|
||||
attr_reader :battle_background
|
||||
attr_reader :battle_background_water
|
||||
attr_reader :wild_battle_BGM
|
||||
attr_reader :trainer_battle_BGM
|
||||
attr_reader :wild_victory_ME
|
||||
@@ -39,13 +40,14 @@ module GameData
|
||||
"SnapEdges" => [11, "b"],
|
||||
"Dungeon" => [12, "b"],
|
||||
"BattleBack" => [13, "s"],
|
||||
"WildBattleBGM" => [14, "s"],
|
||||
"TrainerBattleBGM" => [15, "s"],
|
||||
"WildVictoryME" => [16, "s"],
|
||||
"TrainerVictoryME" => [17, "s"],
|
||||
"WildCaptureME" => [18, "s"],
|
||||
"MapSize" => [19, "us"],
|
||||
"Environment" => [20, "e", :Environment]
|
||||
"BattleBackWater" => [14, "s"],
|
||||
"WildBattleBGM" => [15, "s"],
|
||||
"TrainerBattleBGM" => [16, "s"],
|
||||
"WildVictoryME" => [17, "s"],
|
||||
"TrainerVictoryME" => [18, "s"],
|
||||
"WildCaptureME" => [19, "s"],
|
||||
"MapSize" => [20, "us"],
|
||||
"Environment" => [21, "e", :Environment]
|
||||
}
|
||||
|
||||
extend ClassMethodsIDNumbers
|
||||
@@ -66,6 +68,7 @@ module GameData
|
||||
["SnapEdges", BooleanProperty, _INTL("If true, when the player goes near this map's edge, the game doesn't center the player as usual.")],
|
||||
["Dungeon", BooleanProperty, _INTL("If true, this map has a randomly generated layout. See the wiki for more information.")],
|
||||
["BattleBack", StringProperty, _INTL("PNG files named 'XXX_bg', 'XXX_base0', 'XXX_base1', 'XXX_message' in Battlebacks folder, where XXX is this property's value.")],
|
||||
["BattleBackWater", StringProperty, _INTL("PNG files named 'XXX_bg', 'XXX_base0', 'XXX_base1', 'XXX_message' in Battlebacks folder, where XXX is this property's value.")],
|
||||
["WildBattleBGM", BGMProperty, _INTL("Default BGM for wild Pokémon battles on this map.")],
|
||||
["TrainerBattleBGM", BGMProperty, _INTL("Default BGM for trainer battles on this map.")],
|
||||
["WildVictoryME", MEProperty, _INTL("Default ME played after winning a wild Pokémon battle on this map.")],
|
||||
@@ -91,6 +94,7 @@ module GameData
|
||||
@snap_edges = hash[:snap_edges]
|
||||
@random_dungeon = hash[:random_dungeon]
|
||||
@battle_background = hash[:battle_background]
|
||||
@battle_background_water = hash[:battle_background_water]
|
||||
@wild_battle_BGM = hash[:wild_battle_BGM]
|
||||
@trainer_battle_BGM = hash[:trainer_battle_BGM]
|
||||
@wild_victory_ME = hash[:wild_victory_ME]
|
||||
@@ -115,6 +119,7 @@ module GameData
|
||||
when "SnapEdges" then return @snap_edges
|
||||
when "Dungeon" then return @random_dungeon
|
||||
when "BattleBack" then return @battle_background
|
||||
when "BattleBackWater" then return @battle_background_water
|
||||
when "WildBattleBGM" then return @wild_battle_BGM
|
||||
when "TrainerBattleBGM" then return @trainer_battle_BGM
|
||||
when "WildVictoryME" then return @wild_victory_ME
|
||||
|
||||
Reference in New Issue
Block a user