mirror of
https://github.com/infinitefusion/infinitefusion-e18.git
synced 2025-12-07 13:15:01 +00:00
Cleaned up evolution method definitions, rewrote the "Fill Bag" Debug feature to make it much faster, removed all instances of changing the game window's title
This commit is contained in:
@@ -43,8 +43,8 @@ module Kernel
|
|||||||
end
|
end
|
||||||
|
|
||||||
def echoln(string)
|
def echoln(string)
|
||||||
echo(string)
|
echo string
|
||||||
echo("\r\n")
|
echo "\r\n"
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
@@ -650,7 +650,7 @@ module PluginManager
|
|||||||
# Check if plugins need compiling
|
# Check if plugins need compiling
|
||||||
#-----------------------------------------------------------------------------
|
#-----------------------------------------------------------------------------
|
||||||
def self.compilePlugins(order, plugins)
|
def self.compilePlugins(order, plugins)
|
||||||
echo 'Compiling plugin scripts...'
|
echo "Compiling plugin scripts..."
|
||||||
scripts = []
|
scripts = []
|
||||||
# go through the entire order one by one
|
# go through the entire order one by one
|
||||||
for o in order
|
for o in order
|
||||||
@@ -672,8 +672,8 @@ module PluginManager
|
|||||||
File.open("Data/PluginScripts.rxdata", 'wb') { |f| Marshal.dump(scripts, f) }
|
File.open("Data/PluginScripts.rxdata", 'wb') { |f| Marshal.dump(scripts, f) }
|
||||||
# collect garbage
|
# collect garbage
|
||||||
GC.start
|
GC.start
|
||||||
echoln ' done.'
|
echoln " done."
|
||||||
echoln ''
|
echoln ""
|
||||||
end
|
end
|
||||||
#-----------------------------------------------------------------------------
|
#-----------------------------------------------------------------------------
|
||||||
# Check if plugins need compiling
|
# Check if plugins need compiling
|
||||||
@@ -711,7 +711,7 @@ module PluginManager
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
echoln '' if !echoed_plugins.empty?
|
echoln "" if !echoed_plugins.empty?
|
||||||
end
|
end
|
||||||
#-----------------------------------------------------------------------------
|
#-----------------------------------------------------------------------------
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -199,9 +199,9 @@ module SaveData
|
|||||||
conversions_to_run.each do |conversion|
|
conversions_to_run.each do |conversion|
|
||||||
echo "#{conversion.title}..."
|
echo "#{conversion.title}..."
|
||||||
conversion.run(save_data)
|
conversion.run(save_data)
|
||||||
echoln ' done.'
|
echoln " done."
|
||||||
end
|
end
|
||||||
echoln '' if conversions_to_run.length > 0
|
echoln "" if conversions_to_run.length > 0
|
||||||
save_data[:essentials_version] = Essentials::VERSION
|
save_data[:essentials_version] = Essentials::VERSION
|
||||||
save_data[:game_version] = Settings::GAME_VERSION
|
save_data[:game_version] = Settings::GAME_VERSION
|
||||||
return true
|
return true
|
||||||
|
|||||||
@@ -31,7 +31,7 @@ class PokemonMapFactory
|
|||||||
return @maps[@mapIndex] if @maps[@mapIndex]
|
return @maps[@mapIndex] if @maps[@mapIndex]
|
||||||
raise "No maps in save file... (mapIndex=#{@mapIndex})" if @maps.length==0
|
raise "No maps in save file... (mapIndex=#{@mapIndex})" if @maps.length==0
|
||||||
if @maps[0]
|
if @maps[0]
|
||||||
echoln("Using next map, may be incorrect (mapIndex=#{@mapIndex}, length=#{@maps.length})")
|
echoln "Using next map, may be incorrect (mapIndex=#{@mapIndex}, length=#{@maps.length})"
|
||||||
return @maps[0]
|
return @maps[0]
|
||||||
end
|
end
|
||||||
raise "No maps in save file... (all maps empty; mapIndex=#{@mapIndex})"
|
raise "No maps in save file... (all maps empty; mapIndex=#{@mapIndex})"
|
||||||
|
|||||||
@@ -9,21 +9,21 @@ class ClippableSprite < Sprite_Character
|
|||||||
super
|
super
|
||||||
@_src_rect = self.src_rect
|
@_src_rect = self.src_rect
|
||||||
tmright = @tilemap.map_data.xsize*Game_Map::TILE_WIDTH-@tilemap.ox
|
tmright = @tilemap.map_data.xsize*Game_Map::TILE_WIDTH-@tilemap.ox
|
||||||
echoln("x=#{self.x},ox=#{self.ox},tmright=#{tmright},tmox=#{@tilemap.ox}")
|
echoln "x=#{self.x},ox=#{self.ox},tmright=#{tmright},tmox=#{@tilemap.ox}"
|
||||||
if @tilemap.ox-self.ox<-self.x
|
if @tilemap.ox-self.ox<-self.x
|
||||||
# clipped on left
|
# clipped on left
|
||||||
diff = -self.x-@tilemap.ox+self.ox
|
diff = -self.x-@tilemap.ox+self.ox
|
||||||
self.src_rect = Rect.new(@_src_rect.x+diff,@_src_rect.y,
|
self.src_rect = Rect.new(@_src_rect.x+diff,@_src_rect.y,
|
||||||
@_src_rect.width-diff,@_src_rect.height)
|
@_src_rect.width-diff,@_src_rect.height)
|
||||||
echoln("clipped out left: #{diff} #{@tilemap.ox-self.ox} #{self.x}")
|
echoln "clipped out left: #{diff} #{@tilemap.ox-self.ox} #{self.x}"
|
||||||
elsif tmright-self.ox<self.x
|
elsif tmright-self.ox<self.x
|
||||||
# clipped on right
|
# clipped on right
|
||||||
diff = self.x-tmright+self.ox
|
diff = self.x-tmright+self.ox
|
||||||
self.src_rect = Rect.new(@_src_rect.x,@_src_rect.y,
|
self.src_rect = Rect.new(@_src_rect.x,@_src_rect.y,
|
||||||
@_src_rect.width-diff,@_src_rect.height)
|
@_src_rect.width-diff,@_src_rect.height)
|
||||||
echoln("clipped out right: #{diff} #{tmright+self.ox} #{self.x}")
|
echoln "clipped out right: #{diff} #{tmright+self.ox} #{self.x}"
|
||||||
else
|
else
|
||||||
echoln("-not- clipped out left: #{diff} #{@tilemap.ox-self.ox} #{self.x}")
|
echoln "-not- clipped out left: #{diff} #{@tilemap.ox-self.ox} #{self.x}"
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -38,7 +38,7 @@ module Graphics
|
|||||||
if Graphics.frame_count % 40 == 0
|
if Graphics.frame_count % 40 == 0
|
||||||
count = 0
|
count = 0
|
||||||
ObjectSpace.each_object(Object) { |o| count += 1 }
|
ObjectSpace.each_object(Object) { |o| count += 1 }
|
||||||
echoln("Objects: #{count}")
|
echoln "Objects: #{count}"
|
||||||
end
|
end
|
||||||
=end
|
=end
|
||||||
@@transition.update if @@transition && !@@transition.disposed?
|
@@transition.update if @@transition && !@@transition.disposed?
|
||||||
|
|||||||
@@ -4,7 +4,6 @@ module GameData
|
|||||||
attr_reader :real_name
|
attr_reader :real_name
|
||||||
attr_reader :type # :land, :cave, :water, :fishing, :contest, :none
|
attr_reader :type # :land, :cave, :water, :fishing, :contest, :none
|
||||||
attr_reader :trigger_chance
|
attr_reader :trigger_chance
|
||||||
attr_reader :old_slots
|
|
||||||
|
|
||||||
DATA = {}
|
DATA = {}
|
||||||
|
|
||||||
@@ -19,7 +18,6 @@ module GameData
|
|||||||
@real_name = hash[:id].to_s || "Unnamed"
|
@real_name = hash[:id].to_s || "Unnamed"
|
||||||
@type = hash[:type] || :none
|
@type = hash[:type] || :none
|
||||||
@trigger_chance = hash[:trigger_chance] || 0
|
@trigger_chance = hash[:trigger_chance] || 0
|
||||||
@old_slots = hash[:old_slots]
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
@@ -29,169 +27,144 @@ end
|
|||||||
GameData::EncounterType.register({
|
GameData::EncounterType.register({
|
||||||
:id => :Land,
|
:id => :Land,
|
||||||
:type => :land,
|
:type => :land,
|
||||||
:trigger_chance => 21,
|
:trigger_chance => 21
|
||||||
:old_slots => [20, 20, 10, 10, 10, 10, 5, 5, 4, 4, 1, 1]
|
|
||||||
})
|
})
|
||||||
|
|
||||||
GameData::EncounterType.register({
|
GameData::EncounterType.register({
|
||||||
:id => :LandDay,
|
:id => :LandDay,
|
||||||
:type => :land,
|
:type => :land,
|
||||||
:trigger_chance => 21,
|
:trigger_chance => 21
|
||||||
:old_slots => [20, 20, 10, 10, 10, 10, 5, 5, 4, 4, 1, 1]
|
|
||||||
})
|
})
|
||||||
|
|
||||||
GameData::EncounterType.register({
|
GameData::EncounterType.register({
|
||||||
:id => :LandNight,
|
:id => :LandNight,
|
||||||
:type => :land,
|
:type => :land,
|
||||||
:trigger_chance => 21,
|
:trigger_chance => 21
|
||||||
:old_slots => [20, 20, 10, 10, 10, 10, 5, 5, 4, 4, 1, 1]
|
|
||||||
})
|
})
|
||||||
|
|
||||||
GameData::EncounterType.register({
|
GameData::EncounterType.register({
|
||||||
:id => :LandMorning,
|
:id => :LandMorning,
|
||||||
:type => :land,
|
:type => :land,
|
||||||
:trigger_chance => 21,
|
:trigger_chance => 21
|
||||||
:old_slots => [20, 20, 10, 10, 10, 10, 5, 5, 4, 4, 1, 1]
|
|
||||||
})
|
})
|
||||||
|
|
||||||
GameData::EncounterType.register({
|
GameData::EncounterType.register({
|
||||||
:id => :LandAfternoon,
|
:id => :LandAfternoon,
|
||||||
:type => :land,
|
:type => :land,
|
||||||
:trigger_chance => 21,
|
:trigger_chance => 21
|
||||||
:old_slots => [20, 20, 10, 10, 10, 10, 5, 5, 4, 4, 1, 1]
|
|
||||||
})
|
})
|
||||||
|
|
||||||
GameData::EncounterType.register({
|
GameData::EncounterType.register({
|
||||||
:id => :LandEvening,
|
:id => :LandEvening,
|
||||||
:type => :land,
|
:type => :land,
|
||||||
:trigger_chance => 21,
|
:trigger_chance => 21
|
||||||
:old_slots => [20, 20, 10, 10, 10, 10, 5, 5, 4, 4, 1, 1]
|
|
||||||
})
|
})
|
||||||
|
|
||||||
GameData::EncounterType.register({
|
GameData::EncounterType.register({
|
||||||
:id => :Cave,
|
:id => :Cave,
|
||||||
:type => :cave,
|
:type => :cave,
|
||||||
:trigger_chance => 5,
|
:trigger_chance => 5
|
||||||
:old_slots => [20, 20, 10, 10, 10, 10, 5, 5, 4, 4, 1, 1]
|
|
||||||
})
|
})
|
||||||
|
|
||||||
GameData::EncounterType.register({
|
GameData::EncounterType.register({
|
||||||
:id => :CaveDay,
|
:id => :CaveDay,
|
||||||
:type => :cave,
|
:type => :cave,
|
||||||
:trigger_chance => 5,
|
:trigger_chance => 5
|
||||||
:old_slots => [20, 20, 10, 10, 10, 10, 5, 5, 4, 4, 1, 1]
|
|
||||||
})
|
})
|
||||||
|
|
||||||
GameData::EncounterType.register({
|
GameData::EncounterType.register({
|
||||||
:id => :CaveNight,
|
:id => :CaveNight,
|
||||||
:type => :cave,
|
:type => :cave,
|
||||||
:trigger_chance => 5,
|
:trigger_chance => 5
|
||||||
:old_slots => [20, 20, 10, 10, 10, 10, 5, 5, 4, 4, 1, 1]
|
|
||||||
})
|
})
|
||||||
|
|
||||||
GameData::EncounterType.register({
|
GameData::EncounterType.register({
|
||||||
:id => :CaveMorning,
|
:id => :CaveMorning,
|
||||||
:type => :cave,
|
:type => :cave,
|
||||||
:trigger_chance => 5,
|
:trigger_chance => 5
|
||||||
:old_slots => [20, 20, 10, 10, 10, 10, 5, 5, 4, 4, 1, 1]
|
|
||||||
})
|
})
|
||||||
|
|
||||||
GameData::EncounterType.register({
|
GameData::EncounterType.register({
|
||||||
:id => :CaveAfternoon,
|
:id => :CaveAfternoon,
|
||||||
:type => :cave,
|
:type => :cave,
|
||||||
:trigger_chance => 5,
|
:trigger_chance => 5
|
||||||
:old_slots => [20, 20, 10, 10, 10, 10, 5, 5, 4, 4, 1, 1]
|
|
||||||
})
|
})
|
||||||
|
|
||||||
GameData::EncounterType.register({
|
GameData::EncounterType.register({
|
||||||
:id => :CaveEvening,
|
:id => :CaveEvening,
|
||||||
:type => :cave,
|
:type => :cave,
|
||||||
:trigger_chance => 5,
|
:trigger_chance => 5
|
||||||
:old_slots => [20, 20, 10, 10, 10, 10, 5, 5, 4, 4, 1, 1]
|
|
||||||
})
|
})
|
||||||
|
|
||||||
GameData::EncounterType.register({
|
GameData::EncounterType.register({
|
||||||
:id => :Water,
|
:id => :Water,
|
||||||
:type => :water,
|
:type => :water,
|
||||||
:trigger_chance => 2,
|
:trigger_chance => 2
|
||||||
:old_slots => [60, 30, 5, 4, 1]
|
|
||||||
})
|
})
|
||||||
|
|
||||||
GameData::EncounterType.register({
|
GameData::EncounterType.register({
|
||||||
:id => :WaterDay,
|
:id => :WaterDay,
|
||||||
:type => :water,
|
:type => :water,
|
||||||
:trigger_chance => 2,
|
:trigger_chance => 2
|
||||||
:old_slots => [60, 30, 5, 4, 1]
|
|
||||||
})
|
})
|
||||||
|
|
||||||
GameData::EncounterType.register({
|
GameData::EncounterType.register({
|
||||||
:id => :WaterNight,
|
:id => :WaterNight,
|
||||||
:type => :water,
|
:type => :water,
|
||||||
:trigger_chance => 2,
|
:trigger_chance => 2
|
||||||
:old_slots => [60, 30, 5, 4, 1]
|
|
||||||
})
|
})
|
||||||
|
|
||||||
GameData::EncounterType.register({
|
GameData::EncounterType.register({
|
||||||
:id => :WaterMorning,
|
:id => :WaterMorning,
|
||||||
:type => :water,
|
:type => :water,
|
||||||
:trigger_chance => 2,
|
:trigger_chance => 2
|
||||||
:old_slots => [60, 30, 5, 4, 1]
|
|
||||||
})
|
})
|
||||||
|
|
||||||
GameData::EncounterType.register({
|
GameData::EncounterType.register({
|
||||||
:id => :WaterAfternoon,
|
:id => :WaterAfternoon,
|
||||||
:type => :water,
|
:type => :water,
|
||||||
:trigger_chance => 2,
|
:trigger_chance => 2
|
||||||
:old_slots => [60, 30, 5, 4, 1]
|
|
||||||
})
|
})
|
||||||
|
|
||||||
GameData::EncounterType.register({
|
GameData::EncounterType.register({
|
||||||
:id => :WaterEvening,
|
:id => :WaterEvening,
|
||||||
:type => :water,
|
:type => :water,
|
||||||
:trigger_chance => 2,
|
:trigger_chance => 2
|
||||||
:old_slots => [60, 30, 5, 4, 1]
|
|
||||||
})
|
})
|
||||||
|
|
||||||
GameData::EncounterType.register({
|
GameData::EncounterType.register({
|
||||||
:id => :OldRod,
|
:id => :OldRod,
|
||||||
:type => :fishing,
|
:type => :fishing
|
||||||
:old_slots => [70, 30]
|
|
||||||
})
|
})
|
||||||
|
|
||||||
GameData::EncounterType.register({
|
GameData::EncounterType.register({
|
||||||
:id => :GoodRod,
|
:id => :GoodRod,
|
||||||
:type => :fishing,
|
:type => :fishing
|
||||||
:old_slots => [60, 20, 20]
|
|
||||||
})
|
})
|
||||||
|
|
||||||
GameData::EncounterType.register({
|
GameData::EncounterType.register({
|
||||||
:id => :SuperRod,
|
:id => :SuperRod,
|
||||||
:type => :fishing,
|
:type => :fishing
|
||||||
:old_slots => [40, 40, 15, 4, 1]
|
|
||||||
})
|
})
|
||||||
|
|
||||||
GameData::EncounterType.register({
|
GameData::EncounterType.register({
|
||||||
:id => :RockSmash,
|
:id => :RockSmash,
|
||||||
:type => :none,
|
:type => :none,
|
||||||
:trigger_chance => 50,
|
:trigger_chance => 50
|
||||||
:old_slots => [60, 30, 5, 4, 1]
|
|
||||||
})
|
})
|
||||||
|
|
||||||
GameData::EncounterType.register({
|
GameData::EncounterType.register({
|
||||||
:id => :HeadbuttLow,
|
:id => :HeadbuttLow,
|
||||||
:type => :none,
|
:type => :none
|
||||||
:old_slots => [30, 25, 20, 10, 5, 5, 4, 1]
|
|
||||||
})
|
})
|
||||||
|
|
||||||
GameData::EncounterType.register({
|
GameData::EncounterType.register({
|
||||||
:id => :HeadbuttHigh,
|
:id => :HeadbuttHigh,
|
||||||
:type => :none,
|
:type => :none
|
||||||
:old_slots => [30, 25, 20, 10, 5, 5, 4, 1]
|
|
||||||
})
|
})
|
||||||
|
|
||||||
GameData::EncounterType.register({
|
GameData::EncounterType.register({
|
||||||
:id => :BugContest,
|
:id => :BugContest,
|
||||||
:type => :contest,
|
:type => :contest,
|
||||||
:trigger_chance => 21,
|
:trigger_chance => 21
|
||||||
:old_slots => [20, 20, 10, 10, 10, 10, 5, 5, 4, 4, 1, 1]
|
|
||||||
})
|
})
|
||||||
|
|||||||
@@ -21,7 +21,7 @@ class PokemonBag
|
|||||||
@choices[i] = 0
|
@choices[i] = 0
|
||||||
end
|
end
|
||||||
@registeredItems = []
|
@registeredItems = []
|
||||||
@registeredIndex = [0, 0, 1]
|
@registeredIndex = [0, 0, 1] # Used by the Ready Menu to remember cursor positions
|
||||||
end
|
end
|
||||||
|
|
||||||
def rearrange
|
def rearrange
|
||||||
@@ -44,6 +44,9 @@ class PokemonBag
|
|||||||
|
|
||||||
def clear
|
def clear
|
||||||
@pockets.each { |pocket| pocket.clear }
|
@pockets.each { |pocket| pocket.clear }
|
||||||
|
for i in 0..PokemonBag.numPockets
|
||||||
|
@choices[i] = 0
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
def pockets
|
def pockets
|
||||||
|
|||||||
@@ -419,24 +419,24 @@ class MapScreenScene
|
|||||||
end
|
end
|
||||||
|
|
||||||
def onRightClick(mapid,x,y)
|
def onRightClick(mapid,x,y)
|
||||||
# echoln("rightclick (#{mapid})")
|
# echoln "rightclick (#{mapid})"
|
||||||
end
|
end
|
||||||
|
|
||||||
def onMouseUp(mapid)
|
def onMouseUp(mapid)
|
||||||
# echoln("mouseup (#{mapid})")
|
# echoln "mouseup (#{mapid})"
|
||||||
@dragging=false if @dragging
|
@dragging=false if @dragging
|
||||||
end
|
end
|
||||||
|
|
||||||
def onRightMouseUp(mapid)
|
def onRightMouseUp(mapid)
|
||||||
# echoln("rightmouseup (#{mapid})")
|
# echoln "rightmouseup (#{mapid})"
|
||||||
end
|
end
|
||||||
|
|
||||||
def onMouseOver(mapid,x,y)
|
def onMouseOver(mapid,x,y)
|
||||||
# echoln("mouseover (#{mapid},#{x},#{y})")
|
# echoln "mouseover (#{mapid},#{x},#{y})"
|
||||||
end
|
end
|
||||||
|
|
||||||
def onMouseMove(mapid,x,y)
|
def onMouseMove(mapid,x,y)
|
||||||
# echoln("mousemove (#{mapid},#{x},#{y})")
|
# echoln "mousemove (#{mapid},#{x},#{y})"
|
||||||
if @dragging
|
if @dragging
|
||||||
if @dragmapid>=0
|
if @dragmapid>=0
|
||||||
sprite=getMapSprite(@dragmapid)
|
sprite=getMapSprite(@dragmapid)
|
||||||
|
|||||||
@@ -483,7 +483,7 @@ DebugMenuCommands.register("additem", {
|
|||||||
DebugMenuCommands.register("fillbag", {
|
DebugMenuCommands.register("fillbag", {
|
||||||
"parent" => "itemsmenu",
|
"parent" => "itemsmenu",
|
||||||
"name" => _INTL("Fill Bag"),
|
"name" => _INTL("Fill Bag"),
|
||||||
"description" => _INTL("Add a certain number of every item to the Bag."),
|
"description" => _INTL("Empties the Bag and then fills it with a certain number of every item."),
|
||||||
"effect" => proc {
|
"effect" => proc {
|
||||||
params = ChooseNumberParams.new
|
params = ChooseNumberParams.new
|
||||||
params.setRange(1, Settings::BAG_MAX_PER_SLOT)
|
params.setRange(1, Settings::BAG_MAX_PER_SLOT)
|
||||||
@@ -491,7 +491,19 @@ DebugMenuCommands.register("fillbag", {
|
|||||||
params.setCancelValue(0)
|
params.setCancelValue(0)
|
||||||
qty = pbMessageChooseNumber(_INTL("Choose the number of items."), params)
|
qty = pbMessageChooseNumber(_INTL("Choose the number of items."), params)
|
||||||
if qty > 0
|
if qty > 0
|
||||||
GameData::Item.each { |i| $PokemonBag.pbStoreItem(i.id, qty) }
|
$PokemonBag.clear
|
||||||
|
# NOTE: This doesn't simply use $PokemonBag.pbStoreItem for every item in
|
||||||
|
# turn, because that's really slow when done in bulk.
|
||||||
|
pocket_sizes = Settings::BAG_MAX_POCKET_SIZE
|
||||||
|
bag = $PokemonBag.pockets # Called here so that it only rearranges itself once
|
||||||
|
GameData::Item.each do |i|
|
||||||
|
next if !pocket_sizes[i.pocket] || pocket_sizes[i.pocket] == 0
|
||||||
|
next if bag[i.pocket].length >= pocket_sizes[i.pocket]
|
||||||
|
item_qty = (i.is_important?) ? 1 : qty
|
||||||
|
bag[i.pocket].push([i.id, item_qty])
|
||||||
|
end
|
||||||
|
# NOTE: Auto-sorting pockets don't need to be sorted afterwards, because
|
||||||
|
# items are added in the same order they would be sorted into.
|
||||||
pbMessage(_INTL("The Bag was filled with {1} of each item.", qty))
|
pbMessage(_INTL("The Bag was filled with {1} of each item.", qty))
|
||||||
end
|
end
|
||||||
}
|
}
|
||||||
@@ -1081,7 +1093,7 @@ DebugMenuCommands.register("compiledata", {
|
|||||||
"always_show" => true,
|
"always_show" => true,
|
||||||
"effect" => proc {
|
"effect" => proc {
|
||||||
msgwindow = pbCreateMessageWindow
|
msgwindow = pbCreateMessageWindow
|
||||||
Compiler.compile_all(true) { |msg| pbMessageDisplay(msgwindow, msg, false); echoln(msg) }
|
Compiler.compile_all(true) { |msg| echoln msg }
|
||||||
pbMessageDisplay(msgwindow, _INTL("All game data was compiled."))
|
pbMessageDisplay(msgwindow, _INTL("All game data was compiled."))
|
||||||
pbDisposeMessageWindow(msgwindow)
|
pbDisposeMessageWindow(msgwindow)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -681,21 +681,22 @@ end
|
|||||||
# Properly erases all non-existent tiles in maps (including event graphics)
|
# Properly erases all non-existent tiles in maps (including event graphics)
|
||||||
#===============================================================================
|
#===============================================================================
|
||||||
def pbDebugFixInvalidTiles
|
def pbDebugFixInvalidTiles
|
||||||
num_errors = 0
|
total_errors = 0
|
||||||
num_error_maps = 0
|
num_error_maps = 0
|
||||||
tilesets = $data_tilesets
|
tilesets = $data_tilesets
|
||||||
mapData = Compiler::MapData.new
|
mapData = Compiler::MapData.new
|
||||||
t = Time.now.to_i
|
t = Time.now.to_i
|
||||||
Graphics.update
|
Graphics.update
|
||||||
|
total_maps = mapData.mapinfos.keys.length
|
||||||
|
echoln _INTL("Checking {1} maps for invalid tiles...", total_maps)
|
||||||
for id in mapData.mapinfos.keys.sort
|
for id in mapData.mapinfos.keys.sort
|
||||||
if Time.now.to_i - t >= 5
|
if Time.now.to_i - t >= 5
|
||||||
Graphics.update
|
Graphics.update
|
||||||
t = Time.now.to_i
|
t = Time.now.to_i
|
||||||
end
|
end
|
||||||
changed = false
|
map_errors = 0
|
||||||
map = mapData.getMap(id)
|
map = mapData.getMap(id)
|
||||||
next if !map || !mapData.mapinfos[id]
|
next if !map || !mapData.mapinfos[id]
|
||||||
pbSetWindowText(_INTL("Processing map {1} ({2})", id, mapData.mapinfos[id].name))
|
|
||||||
passages = mapData.getTilesetPassages(map, id)
|
passages = mapData.getTilesetPassages(map, id)
|
||||||
# Check all tiles in map for non-existent tiles
|
# Check all tiles in map for non-existent tiles
|
||||||
for x in 0...map.data.xsize
|
for x in 0...map.data.xsize
|
||||||
@@ -704,8 +705,7 @@ def pbDebugFixInvalidTiles
|
|||||||
tile_id = map.data[x, y, i]
|
tile_id = map.data[x, y, i]
|
||||||
next if pbCheckTileValidity(tile_id, map, tilesets, passages)
|
next if pbCheckTileValidity(tile_id, map, tilesets, passages)
|
||||||
map.data[x, y, i] = 0
|
map.data[x, y, i] = 0
|
||||||
changed = true
|
map_errors += 1
|
||||||
num_errors += 1
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
@@ -716,19 +716,22 @@ def pbDebugFixInvalidTiles
|
|||||||
next if page.graphic.tile_id <= 0
|
next if page.graphic.tile_id <= 0
|
||||||
next if pbCheckTileValidity(page.graphic.tile_id, map, tilesets, passages)
|
next if pbCheckTileValidity(page.graphic.tile_id, map, tilesets, passages)
|
||||||
page.graphic.tile_id = 0
|
page.graphic.tile_id = 0
|
||||||
changed = true
|
map_errors += 1
|
||||||
num_errors += 1
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
next if !changed
|
next if map_errors == 0
|
||||||
# Map was changed; save it
|
# Map was changed; save it
|
||||||
|
echoln _INTL("{1} error tile(s) found on map {2}: {3}.", map_errors, id, mapData.mapinfos[id].name)
|
||||||
|
total_errors += map_errors
|
||||||
num_error_maps += 1
|
num_error_maps += 1
|
||||||
mapData.saveMap(id)
|
mapData.saveMap(id)
|
||||||
end
|
end
|
||||||
if num_error_maps == 0
|
if num_error_maps == 0
|
||||||
|
echoln _INTL("Done. No errors found.")
|
||||||
pbMessage(_INTL("No invalid tiles were found."))
|
pbMessage(_INTL("No invalid tiles were found."))
|
||||||
else
|
else
|
||||||
pbMessage(_INTL("{1} error(s) were found across {2} map(s) and fixed.", num_errors, num_error_maps))
|
echoln _INTL("Done. {1} errors found and fixed. Close RPG Maker XP to ensure fixes are applied.", total_errors)
|
||||||
|
pbMessage(_INTL("{1} error(s) were found across {2} map(s) and fixed.", total_errors, num_error_maps))
|
||||||
pbMessage(_INTL("Close RPG Maker XP to ensure the changes are applied properly."))
|
pbMessage(_INTL("Close RPG Maker XP to ensure the changes are applied properly."))
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -123,7 +123,6 @@ module Compiler
|
|||||||
end
|
end
|
||||||
lineno += 1
|
lineno += 1
|
||||||
Graphics.update if lineno%1000==0
|
Graphics.update if lineno%1000==0
|
||||||
pbSetWindowText(_INTL("Processing {1} line {2}",FileLineData.file,lineno)) if lineno%200==0
|
|
||||||
}
|
}
|
||||||
yield lastsection,sectionname if havesection
|
yield lastsection,sectionname if havesection
|
||||||
end
|
end
|
||||||
@@ -726,7 +725,7 @@ module Compiler
|
|||||||
compile_metadata # Depends on TrainerType
|
compile_metadata # Depends on TrainerType
|
||||||
yield(_INTL("Compiling animations"))
|
yield(_INTL("Compiling animations"))
|
||||||
compile_animations
|
compile_animations
|
||||||
yield(_INTL("Converting events"))
|
yield("")
|
||||||
compile_trainer_events(mustCompile)
|
compile_trainer_events(mustCompile)
|
||||||
yield(_INTL("Saving messages"))
|
yield(_INTL("Saving messages"))
|
||||||
pbSetTextMessages
|
pbSetTextMessages
|
||||||
@@ -736,7 +735,6 @@ module Compiler
|
|||||||
echoln ""
|
echoln ""
|
||||||
echoln _INTL("*** Finished full compile ***")
|
echoln _INTL("*** Finished full compile ***")
|
||||||
echoln ""
|
echoln ""
|
||||||
pbSetWindowText(nil)
|
|
||||||
end
|
end
|
||||||
|
|
||||||
def main
|
def main
|
||||||
@@ -828,7 +826,7 @@ module Compiler
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
# Recompile all data
|
# Recompile all data
|
||||||
compile_all(mustCompile) { |msg| pbSetWindowText(msg); echoln(msg) }
|
compile_all(mustCompile) { |msg| echoln msg }
|
||||||
rescue Exception
|
rescue Exception
|
||||||
e = $!
|
e = $!
|
||||||
raise e if "#{e.class}"=="Reset" || e.is_a?(Reset) || e.is_a?(SystemExit)
|
raise e if "#{e.class}"=="Reset" || e.is_a?(Reset) || e.is_a?(SystemExit)
|
||||||
|
|||||||
@@ -908,7 +908,6 @@ module Compiler
|
|||||||
raise _INTL("Dex list number {1} is defined at least twice.\r\n{2}", section, FileLineData.linereport)
|
raise _INTL("Dex list number {1} is defined at least twice.\r\n{2}", section, FileLineData.linereport)
|
||||||
end
|
end
|
||||||
dex_lists[section] = []
|
dex_lists[section] = []
|
||||||
pbSetWindowText(_INTL("Processing {1} section [{2}]", FileLineData.file, section))
|
|
||||||
else
|
else
|
||||||
raise _INTL("Expected a section at the beginning of the file.\r\n{1}", FileLineData.linereport) if !section
|
raise _INTL("Expected a section at the beginning of the file.\r\n{1}", FileLineData.linereport) if !section
|
||||||
species_list = line.split(",")
|
species_list = line.split(",")
|
||||||
@@ -1031,7 +1030,7 @@ module Compiler
|
|||||||
raise _INTL("Minimum level is greater than maximum level: {1}\r\n{2}", line, FileLineData.linereport)
|
raise _INTL("Minimum level is greater than maximum level: {1}\r\n{2}", line, FileLineData.linereport)
|
||||||
end
|
end
|
||||||
encounter_hash[:types][current_type].push(values)
|
encounter_hash[:types][current_type].push(values)
|
||||||
elsif line[/^\[\s*(.+)\s*\]$/] # Map ID line (new format)
|
elsif line[/^\[\s*(.+)\s*\]$/] # Map ID line
|
||||||
values = $~[1].split(',').collect! { |v| v.strip.to_i }
|
values = $~[1].split(',').collect! { |v| v.strip.to_i }
|
||||||
values[1] = 0 if !values[1]
|
values[1] = 0 if !values[1]
|
||||||
map_number = values[0]
|
map_number = values[0]
|
||||||
|
|||||||
@@ -248,12 +248,13 @@ module Compiler
|
|||||||
# Save Pokémon data to PBS file
|
# Save Pokémon data to PBS file
|
||||||
#=============================================================================
|
#=============================================================================
|
||||||
def write_pokemon
|
def write_pokemon
|
||||||
|
echo _INTL("Writing species")
|
||||||
File.open("PBS/pokemon.txt", "wb") { |f|
|
File.open("PBS/pokemon.txt", "wb") { |f|
|
||||||
idx = 0
|
idx = 0
|
||||||
add_PBS_header_to_file(f)
|
add_PBS_header_to_file(f)
|
||||||
GameData::Species.each_species do |species|
|
GameData::Species.each_species do |species|
|
||||||
|
echo "." if idx % 50 == 0
|
||||||
idx += 1
|
idx += 1
|
||||||
pbSetWindowText(_INTL("Writing species {1}...", idx))
|
|
||||||
Graphics.update if idx % 100 == 0
|
Graphics.update if idx % 100 == 0
|
||||||
f.write("\#-------------------------------\r\n")
|
f.write("\#-------------------------------\r\n")
|
||||||
f.write(sprintf("[%s]\r\n", species.id))
|
f.write(sprintf("[%s]\r\n", species.id))
|
||||||
@@ -335,7 +336,7 @@ module Compiler
|
|||||||
f.write(sprintf("Incense = %s\r\n", species.incense)) if species.incense
|
f.write(sprintf("Incense = %s\r\n", species.incense)) if species.incense
|
||||||
end
|
end
|
||||||
}
|
}
|
||||||
pbSetWindowText(nil)
|
echoln _INTL("done")
|
||||||
Graphics.update
|
Graphics.update
|
||||||
end
|
end
|
||||||
|
|
||||||
@@ -350,7 +351,6 @@ module Compiler
|
|||||||
next if species.form == 0
|
next if species.form == 0
|
||||||
base_species = GameData::Species.get(species.species)
|
base_species = GameData::Species.get(species.species)
|
||||||
idx += 1
|
idx += 1
|
||||||
pbSetWindowText(_INTL("Writing form {1}...", idx))
|
|
||||||
Graphics.update if idx % 100 == 0
|
Graphics.update if idx % 100 == 0
|
||||||
f.write("\#-------------------------------\r\n")
|
f.write("\#-------------------------------\r\n")
|
||||||
f.write(sprintf("[%s,%d]\r\n", species.species, species.form))
|
f.write(sprintf("[%s,%d]\r\n", species.species, species.form))
|
||||||
@@ -441,7 +441,6 @@ module Compiler
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
}
|
}
|
||||||
pbSetWindowText(nil)
|
|
||||||
Graphics.update
|
Graphics.update
|
||||||
end
|
end
|
||||||
|
|
||||||
@@ -573,12 +572,13 @@ module Compiler
|
|||||||
# Save individual trainer data to PBS file
|
# Save individual trainer data to PBS file
|
||||||
#=============================================================================
|
#=============================================================================
|
||||||
def write_trainers
|
def write_trainers
|
||||||
|
echo _INTL("Writing trainers")
|
||||||
File.open("PBS/trainers.txt", "wb") { |f|
|
File.open("PBS/trainers.txt", "wb") { |f|
|
||||||
idx = 0
|
idx = 0
|
||||||
add_PBS_header_to_file(f)
|
add_PBS_header_to_file(f)
|
||||||
GameData::Trainer.each do |trainer|
|
GameData::Trainer.each do |trainer|
|
||||||
|
echo "." if idx % 50 == 0
|
||||||
idx += 1
|
idx += 1
|
||||||
pbSetWindowText(_INTL("Writing trainer {1}...", idx))
|
|
||||||
Graphics.update if idx % 50 == 0
|
Graphics.update if idx % 50 == 0
|
||||||
f.write("\#-------------------------------\r\n")
|
f.write("\#-------------------------------\r\n")
|
||||||
if trainer.version > 0
|
if trainer.version > 0
|
||||||
@@ -617,7 +617,7 @@ module Compiler
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
}
|
}
|
||||||
pbSetWindowText(nil)
|
echoln _INTL("done")
|
||||||
Graphics.update
|
Graphics.update
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
@@ -1380,11 +1380,11 @@ module Compiler
|
|||||||
t = Time.now.to_i
|
t = Time.now.to_i
|
||||||
Graphics.update
|
Graphics.update
|
||||||
trainerChecker = TrainerChecker.new
|
trainerChecker = TrainerChecker.new
|
||||||
|
echo _INTL("Processing {1} maps...", mapData.mapinfos.keys.length)
|
||||||
for id in mapData.mapinfos.keys.sort
|
for id in mapData.mapinfos.keys.sort
|
||||||
changed = false
|
changed = false
|
||||||
map = mapData.getMap(id)
|
map = mapData.getMap(id)
|
||||||
next if !map || !mapData.mapinfos[id]
|
next if !map || !mapData.mapinfos[id]
|
||||||
pbSetWindowText(_INTL("Processing map {1} ({2})",id,mapData.mapinfos[id].name))
|
|
||||||
for key in map.events.keys
|
for key in map.events.keys
|
||||||
if Time.now.to_i-t>=5
|
if Time.now.to_i-t>=5
|
||||||
Graphics.update
|
Graphics.update
|
||||||
@@ -1415,12 +1415,15 @@ module Compiler
|
|||||||
if changed
|
if changed
|
||||||
mapData.saveMap(id)
|
mapData.saveMap(id)
|
||||||
mapData.saveTilesets
|
mapData.saveTilesets
|
||||||
|
echoln ""
|
||||||
|
echo _INTL("Map {1}: '{2}' modified and saved.", id, mapData.mapinfos[id].name)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
echoln ""
|
||||||
changed = false
|
changed = false
|
||||||
Graphics.update
|
Graphics.update
|
||||||
commonEvents = load_data("Data/CommonEvents.rxdata")
|
commonEvents = load_data("Data/CommonEvents.rxdata")
|
||||||
pbSetWindowText(_INTL("Processing common events"))
|
echoln _INTL("Processing common events")
|
||||||
for key in 0...commonEvents.length
|
for key in 0...commonEvents.length
|
||||||
newevent = fix_event_use(commonEvents[key],0,mapData)
|
newevent = fix_event_use(commonEvents[key],0,mapData)
|
||||||
if newevent
|
if newevent
|
||||||
|
|||||||
Reference in New Issue
Block a user