mirror of
https://github.com/infinitefusion/infinitefusion-e18.git
synced 2026-01-22 14:26:01 +00:00
Lots of rubocop
This commit is contained in:
@@ -59,13 +59,13 @@ module Compiler
|
||||
def findIndex(a)
|
||||
index = -1
|
||||
count = 0
|
||||
a.each { |i|
|
||||
a.each do |i|
|
||||
if yield i
|
||||
index = count
|
||||
break
|
||||
end
|
||||
count += 1
|
||||
}
|
||||
end
|
||||
return index
|
||||
end
|
||||
|
||||
@@ -97,7 +97,7 @@ module Compiler
|
||||
havesection = false
|
||||
sectionname = nil
|
||||
lastsection = {}
|
||||
f.each_line { |line|
|
||||
f.each_line do |line|
|
||||
if lineno == 1 && line[0].ord == 0xEF && line[1].ord == 0xBB && line[2].ord == 0xBF
|
||||
line = line[3, line.length - 3]
|
||||
end
|
||||
@@ -130,7 +130,7 @@ module Compiler
|
||||
end
|
||||
lineno += 1
|
||||
Graphics.update if lineno % 1000 == 0
|
||||
}
|
||||
end
|
||||
yield lastsection, sectionname if havesection
|
||||
end
|
||||
|
||||
@@ -139,16 +139,16 @@ module Compiler
|
||||
# ribbons.txt, trainer_types.txt, battle_facility_lists.txt, Battle Tower
|
||||
# trainers PBS files and dungeon_parameters.txt
|
||||
def pbEachFileSection(f, schema = nil)
|
||||
pbEachFileSectionEx(f, schema) { |section, name|
|
||||
pbEachFileSectionEx(f, schema) do |section, name|
|
||||
yield section, name if block_given? && name[/^.+$/]
|
||||
}
|
||||
end
|
||||
end
|
||||
|
||||
# Used for metadata.txt and map_metadata.txt
|
||||
def pbEachFileSectionNumbered(f, schema = nil)
|
||||
pbEachFileSectionEx(f, schema) { |section, name|
|
||||
pbEachFileSectionEx(f, schema) do |section, name|
|
||||
yield section, name.to_i if block_given? && name[/^\d+$/]
|
||||
}
|
||||
end
|
||||
end
|
||||
|
||||
# Used by translated text compiler
|
||||
@@ -157,7 +157,7 @@ module Compiler
|
||||
havesection = false
|
||||
sectionname = nil
|
||||
lastsection = []
|
||||
f.each_line { |line|
|
||||
f.each_line do |line|
|
||||
if lineno == 1 && line[0].ord == 0xEF && line[1].ord == 0xBB && line[2].ord == 0xBF
|
||||
line = line[3, line.length - 3]
|
||||
end
|
||||
@@ -177,29 +177,29 @@ module Compiler
|
||||
end
|
||||
lineno += 1
|
||||
Graphics.update if lineno % 500 == 0
|
||||
}
|
||||
end
|
||||
yield lastsection, sectionname if havesection
|
||||
end
|
||||
|
||||
# Unused
|
||||
def pbEachCommentedLine(f)
|
||||
lineno = 1
|
||||
f.each_line { |line|
|
||||
f.each_line do |line|
|
||||
if lineno == 1 && line[0].ord == 0xEF && line[1].ord == 0xBB && line[2].ord == 0xBF
|
||||
line = line[3, line.length - 3]
|
||||
end
|
||||
line.force_encoding(Encoding::UTF_8)
|
||||
yield line, lineno if !line[/^\#/] && !line[/^\s*$/]
|
||||
lineno += 1
|
||||
}
|
||||
end
|
||||
end
|
||||
|
||||
# Used for town_map.txt and Battle Tower Pokémon PBS files
|
||||
def pbCompilerEachCommentedLine(filename)
|
||||
File.open(filename, "rb") { |f|
|
||||
File.open(filename, "rb") do |f|
|
||||
FileLineData.file = filename
|
||||
lineno = 1
|
||||
f.each_line { |line|
|
||||
f.each_line do |line|
|
||||
if lineno == 1 && line[0].ord == 0xEF && line[1].ord == 0xBB && line[2].ord == 0xBF
|
||||
line = line[3, line.length - 3]
|
||||
end
|
||||
@@ -209,14 +209,14 @@ module Compiler
|
||||
yield line, lineno
|
||||
end
|
||||
lineno += 1
|
||||
}
|
||||
}
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
# Unused
|
||||
def pbEachPreppedLine(f)
|
||||
lineno = 1
|
||||
f.each_line { |line|
|
||||
f.each_line do |line|
|
||||
if lineno == 1 && line[0].ord == 0xEF && line[1].ord == 0xBB && line[2].ord == 0xBF
|
||||
line = line[3, line.length - 3]
|
||||
end
|
||||
@@ -224,16 +224,16 @@ module Compiler
|
||||
line = prepline(line)
|
||||
yield line, lineno if !line[/^\#/] && !line[/^\s*$/]
|
||||
lineno += 1
|
||||
}
|
||||
end
|
||||
end
|
||||
|
||||
# Used for map_connections.txt, phone.txt, regional_dexes.txt, encounters.txt,
|
||||
# trainers.txt and dungeon_tilesets.txt
|
||||
def pbCompilerEachPreppedLine(filename)
|
||||
File.open(filename, "rb") { |f|
|
||||
File.open(filename, "rb") do |f|
|
||||
FileLineData.file = filename
|
||||
lineno = 1
|
||||
f.each_line { |line|
|
||||
f.each_line do |line|
|
||||
if lineno == 1 && line[0].ord == 0xEF && line[1].ord == 0xBB && line[2].ord == 0xBF
|
||||
line = line[3, line.length - 3]
|
||||
end
|
||||
@@ -244,8 +244,8 @@ module Compiler
|
||||
yield line, lineno
|
||||
end
|
||||
lineno += 1
|
||||
}
|
||||
}
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
#=============================================================================
|
||||
@@ -408,10 +408,11 @@ module Compiler
|
||||
repeat = false
|
||||
schema_length = schema[1].length
|
||||
start = 0
|
||||
if schema[1][0, 1] == "*"
|
||||
case schema[1][0, 1]
|
||||
when "*"
|
||||
repeat = true
|
||||
start = 1
|
||||
elsif schema[1][0, 1] == "^"
|
||||
when "^"
|
||||
start = 1
|
||||
schema_length -= 1
|
||||
end
|
||||
@@ -740,16 +741,16 @@ module Compiler
|
||||
def edit_and_rewrite_pbs_file_text(filename)
|
||||
return if !block_given?
|
||||
lines = []
|
||||
File.open(filename, "rb") { |f|
|
||||
File.open(filename, "rb") do |f|
|
||||
f.each_line { |line| lines.push(line) }
|
||||
}
|
||||
end
|
||||
changed = false
|
||||
lines.each { |line| changed = true if yield line }
|
||||
if changed
|
||||
Console.markup_style("Changes made to file #{filename}.", text: :yellow)
|
||||
File.open(filename, "wb") { |f|
|
||||
File.open(filename, "wb") do |f|
|
||||
lines.each { |line| f.write(line) }
|
||||
}
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
@@ -882,9 +883,9 @@ module Compiler
|
||||
data_files.each do |filename|
|
||||
if safeExists?("Data/" + filename)
|
||||
begin
|
||||
File.open("Data/#{filename}") { |file|
|
||||
File.open("Data/#{filename}") do |file|
|
||||
latestDataTime = [latestDataTime, file.mtime.to_i].max
|
||||
}
|
||||
end
|
||||
rescue SystemCallError
|
||||
mustCompile = true
|
||||
end
|
||||
|
||||
@@ -10,13 +10,13 @@ module Compiler
|
||||
base_filename = game_data::PBS_BASE_FILENAME
|
||||
base_filename = base_filename[0] if base_filename.is_a?(Array) # For Species
|
||||
file_suffix = File.basename(path, ".txt")[base_filename.length + 1, path.length] || ""
|
||||
File.open(path, "rb") { |f|
|
||||
File.open(path, "rb") do |f|
|
||||
FileLineData.file = path # For error reporting
|
||||
# Read a whole section's lines at once, then run through this code.
|
||||
# contents is a hash containing all the XXX=YYY lines in that section, where
|
||||
# the keys are the XXX and the values are the YYY (as unprocessed strings).
|
||||
idx = 0
|
||||
pbEachFileSection(f, schema) { |contents, section_name|
|
||||
pbEachFileSection(f, schema) do |contents, section_name|
|
||||
echo "." if idx % 50 == 0
|
||||
Graphics.update if idx % 250 == 0
|
||||
idx += 1
|
||||
@@ -55,8 +55,8 @@ module Compiler
|
||||
end
|
||||
# Add section's data to records
|
||||
game_data.register(data_hash)
|
||||
}
|
||||
}
|
||||
end
|
||||
end
|
||||
process_pbs_file_message_end
|
||||
end
|
||||
yield true, nil if block_given?
|
||||
@@ -90,9 +90,9 @@ module Compiler
|
||||
end
|
||||
point_names.uniq!
|
||||
interest_names.uniq!
|
||||
MessageTypes.setMessagesAsHash(MessageTypes::Regions, region_names)
|
||||
MessageTypes.setMessagesAsHash(MessageTypes::RegionLocations, point_names)
|
||||
MessageTypes.setMessagesAsHash(MessageTypes::RegionDescriptions, interest_names)
|
||||
MessageTypes.setMessagesAsHash(MessageTypes::REGION_NAMES, region_names)
|
||||
MessageTypes.setMessagesAsHash(MessageTypes::REGION_LOCATION_NAMES, point_names)
|
||||
MessageTypes.setMessagesAsHash(MessageTypes::REGION_LOCATION_DESCRIPTIONS, interest_names)
|
||||
end
|
||||
|
||||
#=============================================================================
|
||||
@@ -102,7 +102,7 @@ module Compiler
|
||||
records = []
|
||||
paths.each do |path|
|
||||
compile_pbs_file_message_start(path)
|
||||
pbCompilerEachPreppedLine(path) { |line, lineno|
|
||||
pbCompilerEachPreppedLine(path) do |line, lineno|
|
||||
hashenum = {
|
||||
"N" => "N", "North" => "N",
|
||||
"E" => "E", "East" => "E",
|
||||
@@ -134,7 +134,7 @@ module Compiler
|
||||
raise _INTL("West side of first map must connect with east side of second map\r\n{1}", FileLineData.linereport) if record[4] != "E"
|
||||
end
|
||||
records.push(record)
|
||||
}
|
||||
end
|
||||
process_pbs_file_message_end
|
||||
end
|
||||
save_data(records, "Data/map_connections.dat")
|
||||
@@ -175,7 +175,7 @@ module Compiler
|
||||
# Get type names for translating
|
||||
type_names.push(type.real_name)
|
||||
end
|
||||
MessageTypes.setMessagesAsHash(MessageTypes::Types, type_names)
|
||||
MessageTypes.setMessagesAsHash(MessageTypes::TYPE_NAMES, type_names)
|
||||
end
|
||||
|
||||
#=============================================================================
|
||||
@@ -198,8 +198,8 @@ module Compiler
|
||||
ability_names.push(ability.real_name)
|
||||
ability_descriptions.push(ability.real_description)
|
||||
end
|
||||
MessageTypes.setMessagesAsHash(MessageTypes::Abilities, ability_names)
|
||||
MessageTypes.setMessagesAsHash(MessageTypes::AbilityDescriptions, ability_descriptions)
|
||||
MessageTypes.setMessagesAsHash(MessageTypes::ABILITY_NAMES, ability_names)
|
||||
MessageTypes.setMessagesAsHash(MessageTypes::ABILITY_DESCRIPTIONS, ability_descriptions)
|
||||
end
|
||||
|
||||
#=============================================================================
|
||||
@@ -230,8 +230,8 @@ module Compiler
|
||||
move_names.push(move.real_name)
|
||||
move_descriptions.push(move.real_description)
|
||||
end
|
||||
MessageTypes.setMessagesAsHash(MessageTypes::Moves, move_names)
|
||||
MessageTypes.setMessagesAsHash(MessageTypes::MoveDescriptions, move_descriptions)
|
||||
MessageTypes.setMessagesAsHash(MessageTypes::MOVE_NAMES, move_names)
|
||||
MessageTypes.setMessagesAsHash(MessageTypes::MOVE_DESCRIPTIONS, move_descriptions)
|
||||
end
|
||||
|
||||
#=============================================================================
|
||||
@@ -260,11 +260,11 @@ module Compiler
|
||||
item_portion_names_plural.push(item.real_portion_name_plural)
|
||||
item_descriptions.push(item.real_description)
|
||||
end
|
||||
MessageTypes.setMessagesAsHash(MessageTypes::Items, item_names)
|
||||
MessageTypes.setMessagesAsHash(MessageTypes::ItemPlurals, item_names_plural)
|
||||
MessageTypes.setMessagesAsHash(MessageTypes::ItemPortions, item_portion_names)
|
||||
MessageTypes.setMessagesAsHash(MessageTypes::ItemPortionPlurals, item_portion_names_plural)
|
||||
MessageTypes.setMessagesAsHash(MessageTypes::ItemDescriptions, item_descriptions)
|
||||
MessageTypes.setMessagesAsHash(MessageTypes::ITEM_NAMES, item_names)
|
||||
MessageTypes.setMessagesAsHash(MessageTypes::ITEM_NAME_PLURALS, item_names_plural)
|
||||
MessageTypes.setMessagesAsHash(MessageTypes::ITEM_PORTION_NAMES, item_portion_names)
|
||||
MessageTypes.setMessagesAsHash(MessageTypes::ITEM_PORTION_NAME_PLURALS, item_portion_names_plural)
|
||||
MessageTypes.setMessagesAsHash(MessageTypes::ITEM_DESCRIPTIONS, item_descriptions)
|
||||
end
|
||||
|
||||
#=============================================================================
|
||||
@@ -369,10 +369,10 @@ module Compiler
|
||||
species_categories.push(species.real_category)
|
||||
species_pokedex_entries.push(species.real_pokedex_entry)
|
||||
end
|
||||
MessageTypes.setMessagesAsHash(MessageTypes::Species, species_names)
|
||||
MessageTypes.setMessagesAsHash(MessageTypes::SpeciesForms, species_form_names)
|
||||
MessageTypes.setMessagesAsHash(MessageTypes::SpeciesCategories, species_categories)
|
||||
MessageTypes.setMessagesAsHash(MessageTypes::PokedexEntries, species_pokedex_entries)
|
||||
MessageTypes.setMessagesAsHash(MessageTypes::SPECIES_NAMES, species_names)
|
||||
MessageTypes.setMessagesAsHash(MessageTypes::SPECIES_FORM_NAMES, species_form_names)
|
||||
MessageTypes.setMessagesAsHash(MessageTypes::SPECIES_CATEGORIES, species_categories)
|
||||
MessageTypes.setMessagesAsHash(MessageTypes::POKEDEX_ENTRIES, species_pokedex_entries)
|
||||
end
|
||||
|
||||
#=============================================================================
|
||||
@@ -386,13 +386,13 @@ module Compiler
|
||||
paths.each do |path|
|
||||
compile_pbs_file_message_start(path)
|
||||
file_suffix = File.basename(path, ".txt")[GameData::Species::PBS_BASE_FILENAME[1].length + 1, path.length] || ""
|
||||
File.open(path, "rb") { |f|
|
||||
File.open(path, "rb") do |f|
|
||||
FileLineData.file = path # For error reporting
|
||||
# Read a whole section's lines at once, then run through this code.
|
||||
# contents is a hash containing all the XXX=YYY lines in that section, where
|
||||
# the keys are the XXX and the values are the YYY (as unprocessed strings).
|
||||
idx = 0
|
||||
pbEachFileSection(f, schema) { |contents, section_name|
|
||||
pbEachFileSection(f, schema) do |contents, section_name|
|
||||
echo "." if idx % 50 == 0
|
||||
Graphics.update if idx % 250 == 0
|
||||
idx += 1
|
||||
@@ -431,8 +431,8 @@ module Compiler
|
||||
end
|
||||
# Add section's data to records
|
||||
GameData::Species.register(data_hash)
|
||||
}
|
||||
}
|
||||
end
|
||||
end
|
||||
process_pbs_file_message_end
|
||||
end
|
||||
validate_all_compiled_pokemon_forms
|
||||
@@ -508,9 +508,9 @@ module Compiler
|
||||
species_categories.push(species.real_category)
|
||||
species_pokedex_entries.push(species.real_pokedex_entry)
|
||||
end
|
||||
MessageTypes.addMessagesAsHash(MessageTypes::SpeciesForms, species_form_names)
|
||||
MessageTypes.addMessagesAsHash(MessageTypes::SpeciesCategories, species_categories)
|
||||
MessageTypes.addMessagesAsHash(MessageTypes::PokedexEntries, species_pokedex_entries)
|
||||
MessageTypes.addMessagesAsHash(MessageTypes::SPECIES_FORM_NAMES, species_form_names)
|
||||
MessageTypes.addMessagesAsHash(MessageTypes::SPECIES_CATEGORIES, species_categories)
|
||||
MessageTypes.addMessagesAsHash(MessageTypes::POKEDEX_ENTRIES, species_pokedex_entries)
|
||||
end
|
||||
|
||||
#=============================================================================
|
||||
@@ -562,7 +562,7 @@ module Compiler
|
||||
paths.each do |path|
|
||||
compile_pbs_file_message_start(path)
|
||||
section = nil
|
||||
pbCompilerEachPreppedLine(path) { |line, line_no|
|
||||
pbCompilerEachPreppedLine(path) do |line, line_no|
|
||||
Graphics.update if line_no % 200 == 0
|
||||
if line[/^\s*\[\s*(\d+)\s*\]\s*$/]
|
||||
section = $~[1].to_i
|
||||
@@ -579,7 +579,7 @@ module Compiler
|
||||
dex_lists[section].push(s)
|
||||
end
|
||||
end
|
||||
}
|
||||
end
|
||||
process_pbs_file_message_end
|
||||
end
|
||||
# Check for duplicate species in a Regional Dex
|
||||
@@ -615,8 +615,8 @@ module Compiler
|
||||
ribbon_names.push(ribbon.real_name)
|
||||
ribbon_descriptions.push(ribbon.real_description)
|
||||
end
|
||||
MessageTypes.setMessagesAsHash(MessageTypes::RibbonNames, ribbon_names)
|
||||
MessageTypes.setMessagesAsHash(MessageTypes::RibbonDescriptions, ribbon_descriptions)
|
||||
MessageTypes.setMessagesAsHash(MessageTypes::RIBBON_NAMES, ribbon_names)
|
||||
MessageTypes.setMessagesAsHash(MessageTypes::RIBBON_DESCRIPTIONS, ribbon_descriptions)
|
||||
end
|
||||
|
||||
#=============================================================================
|
||||
@@ -632,7 +632,7 @@ module Compiler
|
||||
step_chances = nil
|
||||
current_type = nil
|
||||
idx = 0
|
||||
pbCompilerEachPreppedLine(path) { |line, line_no|
|
||||
pbCompilerEachPreppedLine(path) do |line, line_no|
|
||||
echo "." if idx % 50 == 0
|
||||
idx += 1
|
||||
Graphics.update if idx % 250 == 0
|
||||
@@ -707,7 +707,7 @@ module Compiler
|
||||
line, encounter_hash[:map], FileLineData.linereport)
|
||||
end
|
||||
end
|
||||
}
|
||||
end
|
||||
# Add last map's encounter data to records
|
||||
if encounter_hash
|
||||
encounter_hash[:types].each_value do |slots|
|
||||
@@ -750,7 +750,7 @@ module Compiler
|
||||
GameData::TrainerType.each do |tr_type|
|
||||
trainer_type_names.push(tr_type.real_name)
|
||||
end
|
||||
MessageTypes.setMessagesAsHash(MessageTypes::TrainerTypes, trainer_type_names)
|
||||
MessageTypes.setMessagesAsHash(MessageTypes::TRAINER_TYPE_NAMES, trainer_type_names)
|
||||
end
|
||||
|
||||
#=============================================================================
|
||||
@@ -770,7 +770,7 @@ module Compiler
|
||||
section_name = nil
|
||||
section_line = nil
|
||||
# Read each line of trainers.txt at a time and compile it as a trainer property
|
||||
pbCompilerEachPreppedLine(path) { |line, line_no|
|
||||
pbCompilerEachPreppedLine(path) do |line, line_no|
|
||||
echo "." if idx % 50 == 0
|
||||
idx += 1
|
||||
Graphics.update if idx % 250 == 0
|
||||
@@ -815,7 +815,7 @@ module Compiler
|
||||
current_pkmn[sub_schema[key][0]] = pbGetCsvRecord($~[2], line_no, sub_schema[key])
|
||||
end
|
||||
end
|
||||
}
|
||||
end
|
||||
# Add last trainer's data to records
|
||||
if data_hash
|
||||
FileLineData.setSection(section_name, nil, section_line)
|
||||
@@ -908,8 +908,8 @@ module Compiler
|
||||
trainer_names.push(trainer.real_name)
|
||||
lose_texts.push(trainer.real_lose_text)
|
||||
end
|
||||
MessageTypes.setMessagesAsHash(MessageTypes::TrainerNames, trainer_names)
|
||||
MessageTypes.setMessagesAsHash(MessageTypes::TrainerLoseTexts, lose_texts)
|
||||
MessageTypes.setMessagesAsHash(MessageTypes::TRAINER_NAMES, trainer_names)
|
||||
MessageTypes.setMessagesAsHash(MessageTypes::TRAINER_SPEECHES_LOSE, lose_texts)
|
||||
end
|
||||
|
||||
#=============================================================================
|
||||
@@ -923,23 +923,23 @@ module Compiler
|
||||
"Challenges" => [2, "*s"]
|
||||
}
|
||||
if !safeExists?(path)
|
||||
File.open(path, "wb") { |f|
|
||||
File.open(path, "wb") do |f|
|
||||
f.write(0xEF.chr)
|
||||
f.write(0xBB.chr)
|
||||
f.write(0xBF.chr)
|
||||
f.write("[DefaultTrainerList]\r\n")
|
||||
f.write("Trainers = battle_tower_trainers.txt\r\n")
|
||||
f.write("Pokemon = battle_tower_pokemon.txt\r\n")
|
||||
}
|
||||
end
|
||||
end
|
||||
sections = []
|
||||
MessageTypes.setMessagesAsHash(MessageTypes::FrontierIntroSpeeches, [])
|
||||
MessageTypes.setMessagesAsHash(MessageTypes::FrontierEndSpeechesWin, [])
|
||||
MessageTypes.setMessagesAsHash(MessageTypes::FrontierEndSpeechesLose, [])
|
||||
File.open(path, "rb") { |f|
|
||||
MessageTypes.setMessagesAsHash(MessageTypes::FRONTIER_INTRO_SPEECHES, [])
|
||||
MessageTypes.setMessagesAsHash(MessageTypes::FRONTIER_END_SPEECHES_WIN, [])
|
||||
MessageTypes.setMessagesAsHash(MessageTypes::FRONTIER_END_SPEECHES_LOSE, [])
|
||||
File.open(path, "rb") do |f|
|
||||
FileLineData.file = path
|
||||
idx = 0
|
||||
pbEachFileSection(f) { |section, name|
|
||||
pbEachFileSection(f) do |section, name|
|
||||
echo "."
|
||||
idx += 1
|
||||
Graphics.update
|
||||
@@ -970,9 +970,9 @@ module Compiler
|
||||
if safeExists?("PBS/" + rsection[1])
|
||||
filename = "PBS/" + rsection[1]
|
||||
rsection[1] = []
|
||||
pbCompilerEachCommentedLine(filename) { |line, _lineno|
|
||||
pbCompilerEachCommentedLine(filename) do |line, _lineno|
|
||||
rsection[1].push(PBPokemon.fromInspected(line))
|
||||
}
|
||||
end
|
||||
else
|
||||
rsection[1] = []
|
||||
end
|
||||
@@ -982,8 +982,8 @@ module Compiler
|
||||
end
|
||||
rsection[2].compact!
|
||||
sections.push(rsection)
|
||||
}
|
||||
}
|
||||
end
|
||||
end
|
||||
save_data(sections, "Data/trainer_lists.dat")
|
||||
process_pbs_file_message_end
|
||||
end
|
||||
@@ -1003,9 +1003,9 @@ module Compiler
|
||||
endspeechwin = []
|
||||
endspeechlose = []
|
||||
if safeExists?(filename)
|
||||
File.open(filename, "rb") { |f|
|
||||
File.open(filename, "rb") do |f|
|
||||
FileLineData.file = filename
|
||||
pbEachFileSection(f) { |section, name|
|
||||
pbEachFileSection(f) do |section, name|
|
||||
rsection = []
|
||||
section.each_key do |key|
|
||||
FileLineData.setSection(name, key, section[key])
|
||||
@@ -1019,13 +1019,13 @@ module Compiler
|
||||
endspeechwin.push(rsection[3])
|
||||
endspeechlose.push(rsection[4])
|
||||
sections.push(rsection)
|
||||
}
|
||||
}
|
||||
end
|
||||
end
|
||||
end
|
||||
MessageTypes.addMessagesAsHash(MessageTypes::TrainerNames, trainernames)
|
||||
MessageTypes.addMessagesAsHash(MessageTypes::FrontierIntroSpeeches, beginspeech)
|
||||
MessageTypes.addMessagesAsHash(MessageTypes::FrontierEndSpeechesWin, endspeechwin)
|
||||
MessageTypes.addMessagesAsHash(MessageTypes::FrontierEndSpeechesLose, endspeechlose)
|
||||
MessageTypes.addMessagesAsHash(MessageTypes::TRAINER_NAMES, trainernames)
|
||||
MessageTypes.addMessagesAsHash(MessageTypes::FRONTIER_INTRO_SPEECHES, beginspeech)
|
||||
MessageTypes.addMessagesAsHash(MessageTypes::FRONTIER_END_SPEECHES_WIN, endspeechwin)
|
||||
MessageTypes.addMessagesAsHash(MessageTypes::FRONTIER_END_SPEECHES_LOSE, endspeechlose)
|
||||
return sections
|
||||
end
|
||||
|
||||
@@ -1043,13 +1043,13 @@ module Compiler
|
||||
compile_pbs_file_message_start(path)
|
||||
file_suffix = File.basename(path, ".txt")[GameData::Metadata::PBS_BASE_FILENAME.length + 1, path.length] || ""
|
||||
# Read from PBS file
|
||||
File.open(path, "rb") { |f|
|
||||
File.open(path, "rb") do |f|
|
||||
FileLineData.file = path # For error reporting
|
||||
# Read a whole section's lines at once, then run through this code.
|
||||
# contents is a hash containing all the XXX=YYY lines in that section, where
|
||||
# the keys are the XXX and the values are the YYY (as unprocessed strings).
|
||||
idx = 0
|
||||
pbEachFileSection(f) { |contents, section_name|
|
||||
pbEachFileSection(f) do |contents, section_name|
|
||||
echo "." if idx % 50 == 0
|
||||
Graphics.update if idx % 250 == 0
|
||||
idx += 1
|
||||
@@ -1100,8 +1100,8 @@ module Compiler
|
||||
else
|
||||
GameData::PlayerMetadata.register(data_hash)
|
||||
end
|
||||
}
|
||||
}
|
||||
end
|
||||
end
|
||||
process_pbs_file_message_end
|
||||
end
|
||||
validate_all_compiled_metadata
|
||||
@@ -1131,7 +1131,7 @@ module Compiler
|
||||
end
|
||||
# Get storage creator's name for translating
|
||||
storage_creator = [GameData::Metadata.get.real_storage_creator]
|
||||
MessageTypes.setMessagesAsHash(MessageTypes::StorageCreator, storage_creator)
|
||||
MessageTypes.setMessagesAsHash(MessageTypes::STORAGE_CREATOR_NAME, storage_creator)
|
||||
end
|
||||
|
||||
#=============================================================================
|
||||
@@ -1154,7 +1154,7 @@ module Compiler
|
||||
# Get map names for translating
|
||||
map_names = []
|
||||
GameData::MapMetadata.each { |map| map_names[map.id] = map.real_name }
|
||||
MessageTypes.setMessagesAsHash(MessageTypes::MapNames, map_names)
|
||||
MessageTypes.setMessagesAsHash(MessageTypes::MAP_NAMES, map_names)
|
||||
end
|
||||
|
||||
#=============================================================================
|
||||
@@ -1232,7 +1232,7 @@ module Compiler
|
||||
msgs.each { |msg| messages.push(msg) }
|
||||
end
|
||||
end
|
||||
MessageTypes.setMessagesAsHash(MessageTypes::PhoneMessages, messages)
|
||||
MessageTypes.setMessagesAsHash(MessageTypes::PHONE_MESSAGES, messages)
|
||||
end
|
||||
|
||||
#=============================================================================
|
||||
@@ -1247,20 +1247,18 @@ module Compiler
|
||||
end
|
||||
changed = false
|
||||
move2anim = [{}, {}]
|
||||
=begin
|
||||
anims = load_data("Data/Animations.rxdata")
|
||||
for anim in anims
|
||||
next if !anim || anim.frames.length==1
|
||||
found = false
|
||||
for i in 0...pbanims.length
|
||||
if pbanims[i] && pbanims[i].id==anim.id
|
||||
found = true if pbanims[i].array.length>1
|
||||
break
|
||||
end
|
||||
end
|
||||
pbanims[anim.id] = pbConvertRPGAnimation(anim) if !found
|
||||
end
|
||||
=end
|
||||
# anims = load_data("Data/Animations.rxdata")
|
||||
# for anim in anims
|
||||
# next if !anim || anim.frames.length == 1
|
||||
# found = false
|
||||
# for i in 0...pbanims.length
|
||||
# if pbanims[i] && pbanims[i].id == anim.id
|
||||
# found = true if pbanims[i].array.length > 1
|
||||
# break
|
||||
# end
|
||||
# end
|
||||
# pbanims[anim.id] = pbConvertRPGAnimation(anim) if !found
|
||||
# end
|
||||
pbanims.length.times do |i|
|
||||
next if !pbanims[i]
|
||||
if pbanims[i].name[/^OppMove\:\s*(.*)$/]
|
||||
|
||||
@@ -26,7 +26,7 @@ module Compiler
|
||||
idx = 0
|
||||
paths.each do |path|
|
||||
write_pbs_file_message_start(path[0])
|
||||
File.open(path[0], "wb") { |f|
|
||||
File.open(path[0], "wb") do |f|
|
||||
add_PBS_header_to_file(f)
|
||||
# Write each element in turn
|
||||
game_data.each do |element|
|
||||
@@ -59,7 +59,7 @@ module Compiler
|
||||
end
|
||||
end
|
||||
end
|
||||
}
|
||||
end
|
||||
process_pbs_file_message_end
|
||||
end
|
||||
end
|
||||
@@ -107,7 +107,7 @@ module Compiler
|
||||
return if !conndata
|
||||
write_pbs_file_message_start(path)
|
||||
mapinfos = pbLoadMapInfos
|
||||
File.open(path, "wb") { |f|
|
||||
File.open(path, "wb") do |f|
|
||||
add_PBS_header_to_file(f)
|
||||
f.write("\#-------------------------------\r\n")
|
||||
conndata.each do |conn|
|
||||
@@ -127,7 +127,7 @@ module Compiler
|
||||
end
|
||||
f.write("\r\n")
|
||||
end
|
||||
}
|
||||
end
|
||||
process_pbs_file_message_end
|
||||
end
|
||||
|
||||
@@ -184,7 +184,7 @@ module Compiler
|
||||
idx = 0
|
||||
paths.each do |path|
|
||||
write_pbs_file_message_start(path[0])
|
||||
File.open(path[0], "wb") { |f|
|
||||
File.open(path[0], "wb") do |f|
|
||||
add_PBS_header_to_file(f)
|
||||
# Write each element in turn
|
||||
GameData::Species.each_species do |element|
|
||||
@@ -217,7 +217,7 @@ module Compiler
|
||||
end
|
||||
end
|
||||
end
|
||||
}
|
||||
end
|
||||
process_pbs_file_message_end
|
||||
end
|
||||
end
|
||||
@@ -243,7 +243,7 @@ module Compiler
|
||||
idx = 0
|
||||
paths.each do |path|
|
||||
write_pbs_file_message_start(path[0])
|
||||
File.open(path[0], "wb") { |f|
|
||||
File.open(path[0], "wb") do |f|
|
||||
add_PBS_header_to_file(f)
|
||||
# Write each element in turn
|
||||
GameData::Species.each do |element|
|
||||
@@ -277,7 +277,7 @@ module Compiler
|
||||
end
|
||||
end
|
||||
end
|
||||
}
|
||||
end
|
||||
process_pbs_file_message_end
|
||||
end
|
||||
end
|
||||
@@ -304,7 +304,7 @@ module Compiler
|
||||
idx = 0
|
||||
paths.each do |path|
|
||||
write_pbs_file_message_start(path[0])
|
||||
File.open(path[0], "wb") { |f|
|
||||
File.open(path[0], "wb") do |f|
|
||||
add_PBS_header_to_file(f)
|
||||
# Write each element in turn
|
||||
GameData::SpeciesMetrics.each do |element|
|
||||
@@ -345,7 +345,7 @@ module Compiler
|
||||
end
|
||||
end
|
||||
end
|
||||
}
|
||||
end
|
||||
process_pbs_file_message_end
|
||||
end
|
||||
end
|
||||
@@ -364,7 +364,7 @@ module Compiler
|
||||
def write_regional_dexes(path = "PBS/regional_dexes.txt")
|
||||
write_pbs_file_message_start(path)
|
||||
dex_lists = pbLoadRegionalDexes
|
||||
File.open(path, "wb") { |f|
|
||||
File.open(path, "wb") do |f|
|
||||
add_PBS_header_to_file(f)
|
||||
# Write each Dex list in turn
|
||||
dex_lists.each_with_index do |list, index|
|
||||
@@ -386,7 +386,7 @@ module Compiler
|
||||
end
|
||||
f.write("\r\n")
|
||||
end
|
||||
}
|
||||
end
|
||||
process_pbs_file_message_end
|
||||
end
|
||||
|
||||
@@ -406,7 +406,7 @@ module Compiler
|
||||
idx = 0
|
||||
paths.each do |path|
|
||||
write_pbs_file_message_start(path[0])
|
||||
File.open(path[0], "wb") { |f|
|
||||
File.open(path[0], "wb") do |f|
|
||||
add_PBS_header_to_file(f)
|
||||
GameData::Encounter.each do |element|
|
||||
next if element.pbs_file_suffix != path[1]
|
||||
@@ -436,7 +436,7 @@ module Compiler
|
||||
end
|
||||
end
|
||||
end
|
||||
}
|
||||
end
|
||||
process_pbs_file_message_end
|
||||
end
|
||||
end
|
||||
@@ -458,7 +458,7 @@ module Compiler
|
||||
idx = 0
|
||||
paths.each do |path|
|
||||
write_pbs_file_message_start(path[0])
|
||||
File.open(path[0], "wb") { |f|
|
||||
File.open(path[0], "wb") do |f|
|
||||
add_PBS_header_to_file(f)
|
||||
# Write each element in turn
|
||||
GameData::Trainer.each do |element|
|
||||
@@ -500,7 +500,7 @@ module Compiler
|
||||
end
|
||||
end
|
||||
end
|
||||
}
|
||||
end
|
||||
process_pbs_file_message_end
|
||||
end
|
||||
end
|
||||
@@ -512,7 +512,7 @@ module Compiler
|
||||
trainerlists = load_data("Data/trainer_lists.dat") rescue nil
|
||||
return if !trainerlists
|
||||
write_pbs_file_message_start(path)
|
||||
File.open(path, "wb") { |f|
|
||||
File.open(path, "wb") do |f|
|
||||
add_PBS_header_to_file(f)
|
||||
trainerlists.each do |tr|
|
||||
echo "."
|
||||
@@ -524,7 +524,7 @@ module Compiler
|
||||
write_battle_tower_trainers(tr[0], "PBS/" + tr[3])
|
||||
write_battle_tower_pokemon(tr[1], "PBS/" + tr[4])
|
||||
end
|
||||
}
|
||||
end
|
||||
process_pbs_file_message_end
|
||||
end
|
||||
|
||||
@@ -541,7 +541,7 @@ module Compiler
|
||||
"EndSpeechLose" => [4, "s"],
|
||||
"PokemonNos" => [5, "*u"]
|
||||
}
|
||||
File.open(filename, "wb") { |f|
|
||||
File.open(filename, "wb") do |f|
|
||||
add_PBS_header_to_file(f)
|
||||
bttrainers.length.times do |i|
|
||||
next if !bttrainers[i]
|
||||
@@ -563,7 +563,7 @@ module Compiler
|
||||
f.write(sprintf("\r\n"))
|
||||
end
|
||||
end
|
||||
}
|
||||
end
|
||||
Graphics.update
|
||||
end
|
||||
|
||||
@@ -584,7 +584,7 @@ module Compiler
|
||||
:SPECIAL_DEFENSE => "SD",
|
||||
:SPEED => "SPD"
|
||||
}
|
||||
File.open(filename, "wb") { |f|
|
||||
File.open(filename, "wb") do |f|
|
||||
add_PBS_header_to_file(f)
|
||||
f.write("\#-------------------------------\r\n")
|
||||
btpokemon.length.times do |i|
|
||||
@@ -597,15 +597,15 @@ module Compiler
|
||||
end
|
||||
c3 = (natures[pkmn.nature]) ? natures[pkmn.nature] : (natures[pkmn.nature] = GameData::Nature.get(pkmn.nature).id.to_s)
|
||||
evlist = ""
|
||||
pkmn.ev.each_with_index do |stat, i|
|
||||
evlist += "," if i > 0
|
||||
pkmn.ev.each_with_index do |stat, j|
|
||||
evlist += "," if j > 0
|
||||
evlist += evs[stat]
|
||||
end
|
||||
c4 = c5 = c6 = c7 = ""
|
||||
[pkmn.move1, pkmn.move2, pkmn.move3, pkmn.move4].each_with_index do |move, i|
|
||||
[pkmn.move1, pkmn.move2, pkmn.move3, pkmn.move4].each_with_index do |move, j|
|
||||
next if !move
|
||||
text = (moves[move]) ? moves[move] : (moves[move] = GameData::Move.get(move).id.to_s)
|
||||
case i
|
||||
case j
|
||||
when 0 then c4 = text
|
||||
when 1 then c5 = text
|
||||
when 2 then c6 = text
|
||||
@@ -614,7 +614,7 @@ module Compiler
|
||||
end
|
||||
f.write("#{c1};#{c2};#{c3};#{evlist};#{c4},#{c5},#{c6},#{c7}\r\n")
|
||||
end
|
||||
}
|
||||
end
|
||||
Graphics.update
|
||||
end
|
||||
|
||||
@@ -641,7 +641,7 @@ module Compiler
|
||||
player_schema = GameData::PlayerMetadata.schema
|
||||
paths.each do |path|
|
||||
write_pbs_file_message_start(path[0])
|
||||
File.open(path[0], "wb") { |f|
|
||||
File.open(path[0], "wb") do |f|
|
||||
add_PBS_header_to_file(f)
|
||||
# Write each element in turn
|
||||
[GameData::Metadata, GameData::PlayerMetadata].each do |game_data|
|
||||
@@ -675,7 +675,7 @@ module Compiler
|
||||
end
|
||||
end
|
||||
end
|
||||
}
|
||||
end
|
||||
process_pbs_file_message_end
|
||||
end
|
||||
end
|
||||
@@ -692,7 +692,7 @@ module Compiler
|
||||
idx = 0
|
||||
paths.each do |path|
|
||||
write_pbs_file_message_start(path[0])
|
||||
File.open(path[0], "wb") { |f|
|
||||
File.open(path[0], "wb") do |f|
|
||||
add_PBS_header_to_file(f)
|
||||
GameData::MapMetadata.each do |element|
|
||||
next if element.pbs_file_suffix != path[1]
|
||||
@@ -721,7 +721,7 @@ module Compiler
|
||||
end
|
||||
end
|
||||
end
|
||||
}
|
||||
end
|
||||
process_pbs_file_message_end
|
||||
end
|
||||
end
|
||||
@@ -737,7 +737,7 @@ module Compiler
|
||||
tilesets = load_data("Data/Tilesets.rxdata")
|
||||
paths.each do |path|
|
||||
write_pbs_file_message_start(path[0])
|
||||
File.open(path[0], "wb") { |f|
|
||||
File.open(path[0], "wb") do |f|
|
||||
add_PBS_header_to_file(f)
|
||||
# Write each element in turn
|
||||
GameData::DungeonTileset.each do |element|
|
||||
@@ -769,7 +769,7 @@ module Compiler
|
||||
end
|
||||
end
|
||||
end
|
||||
}
|
||||
end
|
||||
process_pbs_file_message_end
|
||||
end
|
||||
end
|
||||
|
||||
@@ -46,12 +46,12 @@ module Compiler
|
||||
return false if !$DEBUG
|
||||
mapfiles = {}
|
||||
# Get IDs of all maps in the Data folder
|
||||
Dir.chdir("Data") {
|
||||
Dir.chdir("Data") do
|
||||
mapData = sprintf("Map*.rxdata")
|
||||
Dir.glob(mapData).each do |map|
|
||||
mapfiles[$1.to_i(10)] = true if map[/map(\d+)\.rxdata/i]
|
||||
end
|
||||
}
|
||||
end
|
||||
mapinfos = pbLoadMapInfos
|
||||
maxOrder = 0
|
||||
# Exclude maps found in mapinfos
|
||||
@@ -93,19 +93,19 @@ module Compiler
|
||||
i = 0
|
||||
while i < commands.length
|
||||
case commands[i]
|
||||
when PBMoveRoute::Wait, PBMoveRoute::SwitchOn, PBMoveRoute::SwitchOff,
|
||||
PBMoveRoute::ChangeSpeed, PBMoveRoute::ChangeFreq, PBMoveRoute::Opacity,
|
||||
PBMoveRoute::Blending, PBMoveRoute::PlaySE, PBMoveRoute::Script
|
||||
when PBMoveRoute::WAIT, PBMoveRoute::SWITCH_ON, PBMoveRoute::SWITCH_OFF,
|
||||
PBMoveRoute::CHANGE_SPEED, PBMoveRoute::CHANGE_FREQUENCY, PBMoveRoute::OPACITY,
|
||||
PBMoveRoute::BLENDING, PBMoveRoute::PLAY_SE, PBMoveRoute::SCRIPT
|
||||
route.list.push(RPG::MoveCommand.new(commands[i], [commands[i + 1]]))
|
||||
i += 1
|
||||
when PBMoveRoute::ScriptAsync
|
||||
route.list.push(RPG::MoveCommand.new(PBMoveRoute::Script, [commands[i + 1]]))
|
||||
route.list.push(RPG::MoveCommand.new(PBMoveRoute::Wait, [0]))
|
||||
when PBMoveRoute::SCRIPT_ASYNC
|
||||
route.list.push(RPG::MoveCommand.new(PBMoveRoute::SCRIPT, [commands[i + 1]]))
|
||||
route.list.push(RPG::MoveCommand.new(PBMoveRoute::WAIT, [0]))
|
||||
i += 1
|
||||
when PBMoveRoute::Jump
|
||||
when PBMoveRoute::JUMP
|
||||
route.list.push(RPG::MoveCommand.new(commands[i], [commands[i + 1], commands[i + 2]]))
|
||||
i += 2
|
||||
when PBMoveRoute::Graphic
|
||||
when PBMoveRoute::GRAPHIC
|
||||
route.list.push(RPG::MoveCommand.new(commands[i], [commands[i + 1], commands[i + 2], commands[i + 3], commands[i + 4]]))
|
||||
i += 4
|
||||
else
|
||||
@@ -241,7 +241,7 @@ module Compiler
|
||||
push_event(list, 208, [0], 1) # Change Transparent Flag
|
||||
push_wait(list, 6, 1) # Wait
|
||||
push_event(list, 208, [1], 1) # Change Transparent Flag
|
||||
push_move_route_and_wait(list, -1, [PBMoveRoute::Down], 1)
|
||||
push_move_route_and_wait(list, -1, [PBMoveRoute::DOWN], 1)
|
||||
push_branch_end(list, 1)
|
||||
push_script(list, "setTempSwitchOn(\"A\")")
|
||||
push_end(list)
|
||||
@@ -647,9 +647,10 @@ module Compiler
|
||||
(1...battles.length).each do |i|
|
||||
# Run trainer check now, except in editor
|
||||
trainerChecker.pbTrainerBattleCheck(trtype, trname, battleid + i)
|
||||
if i == 1
|
||||
case i
|
||||
when 1
|
||||
push_branch(rematchpage.list, sprintf("Phone.variant(%s) <= %d", safetrcombo, i))
|
||||
elsif i == battles.length - 1
|
||||
when battles.length - 1
|
||||
push_branch(rematchpage.list, sprintf("Phone.variant(%s) >= %d", safetrcombo, i))
|
||||
else
|
||||
push_branch(rematchpage.list, sprintf("Phone.variant(%s) == %d", safetrcombo, i))
|
||||
@@ -837,24 +838,24 @@ module Compiler
|
||||
list.clear
|
||||
push_move_route_and_wait( # Move Route for door opening
|
||||
list, 0,
|
||||
[PBMoveRoute::PlaySE, RPG::AudioFile.new("Door enter"), PBMoveRoute::Wait, 2,
|
||||
PBMoveRoute::TurnLeft, PBMoveRoute::Wait, 2,
|
||||
PBMoveRoute::TurnRight, PBMoveRoute::Wait, 2,
|
||||
PBMoveRoute::TurnUp, PBMoveRoute::Wait, 2]
|
||||
[PBMoveRoute::PLAY_SE, RPG::AudioFile.new("Door enter"), PBMoveRoute::WAIT, 2,
|
||||
PBMoveRoute::TURN_LEFT, PBMoveRoute::WAIT, 2,
|
||||
PBMoveRoute::TURN_RIGHT, PBMoveRoute::WAIT, 2,
|
||||
PBMoveRoute::TURN_UP, PBMoveRoute::WAIT, 2]
|
||||
)
|
||||
push_move_route_and_wait( # Move Route for player entering door
|
||||
list, -1,
|
||||
[PBMoveRoute::ThroughOn, PBMoveRoute::Up, PBMoveRoute::ThroughOff]
|
||||
[PBMoveRoute::THROUGH_ON, PBMoveRoute::UP, PBMoveRoute::THROUGH_OFF]
|
||||
)
|
||||
push_event(list, 208, [0]) # Change Transparent Flag (invisible)
|
||||
push_script(list, "Followers.follow_into_door")
|
||||
push_event(list, 210, []) # Wait for Move's Completion
|
||||
push_move_route_and_wait( # Move Route for door closing
|
||||
list, 0,
|
||||
[PBMoveRoute::Wait, 2,
|
||||
PBMoveRoute::TurnRight, PBMoveRoute::Wait, 2,
|
||||
PBMoveRoute::TurnLeft, PBMoveRoute::Wait, 2,
|
||||
PBMoveRoute::TurnDown, PBMoveRoute::Wait, 2]
|
||||
[PBMoveRoute::WAIT, 2,
|
||||
PBMoveRoute::TURN_RIGHT, PBMoveRoute::WAIT, 2,
|
||||
PBMoveRoute::TURN_LEFT, PBMoveRoute::WAIT, 2,
|
||||
PBMoveRoute::TURN_DOWN, PBMoveRoute::WAIT, 2]
|
||||
)
|
||||
push_event(list, 223, [Tone.new(-255, -255, -255), 6]) # Change Screen Color Tone
|
||||
push_wait(list, 8) # Wait
|
||||
@@ -870,17 +871,17 @@ module Compiler
|
||||
push_script(list, "Followers.hide_followers", 1)
|
||||
push_move_route_and_wait( # Move Route for setting door to open
|
||||
list, 0,
|
||||
[PBMoveRoute::TurnLeft, PBMoveRoute::Wait, 6],
|
||||
[PBMoveRoute::TURN_LEFT, PBMoveRoute::WAIT, 6],
|
||||
1
|
||||
)
|
||||
push_event(list, 208, [1], 1) # Change Transparent Flag (visible)
|
||||
push_move_route_and_wait(list, -1, [PBMoveRoute::Down], 1) # Move Route for player exiting door
|
||||
push_move_route_and_wait(list, -1, [PBMoveRoute::DOWN], 1) # Move Route for player exiting door
|
||||
push_script(list, "Followers.put_followers_on_player", 1)
|
||||
push_move_route_and_wait( # Move Route for door closing
|
||||
list, 0,
|
||||
[PBMoveRoute::TurnUp, PBMoveRoute::Wait, 2,
|
||||
PBMoveRoute::TurnRight, PBMoveRoute::Wait, 2,
|
||||
PBMoveRoute::TurnDown, PBMoveRoute::Wait, 2],
|
||||
[PBMoveRoute::TURN_UP, PBMoveRoute::WAIT, 2,
|
||||
PBMoveRoute::TURN_RIGHT, PBMoveRoute::WAIT, 2,
|
||||
PBMoveRoute::TURN_DOWN, PBMoveRoute::WAIT, 2],
|
||||
1
|
||||
)
|
||||
push_branch_end(list, 1)
|
||||
@@ -1163,17 +1164,13 @@ module Compiler
|
||||
# Using old method of recovering
|
||||
case script
|
||||
when "foriin$player.partyi.healend"
|
||||
(i..lastScript).each do |j|
|
||||
list.delete_at(i)
|
||||
end
|
||||
(lastScript - i).times { list.delete_at(i) }
|
||||
list.insert(i,
|
||||
RPG::EventCommand.new(314, list[i].indent, [0])) # Recover All
|
||||
changed = true
|
||||
when "pbFadeOutIn(99999){foriin$player.partyi.healend}"
|
||||
oldIndent = list[i].indent
|
||||
(i..lastScript).each do |j|
|
||||
list.delete_at(i)
|
||||
end
|
||||
(lastScript - i).times { list.delete_at(i) }
|
||||
list.insert(
|
||||
i,
|
||||
RPG::EventCommand.new(223, oldIndent, [Tone.new(-255, -255, -255), 6]), # Fade to black
|
||||
|
||||
Reference in New Issue
Block a user