mirror of
https://github.com/infinitefusion/infinitefusion-e18.git
synced 2026-01-30 18:21:03 +00:00
Removed redundant "\r" from various messages, removed usages of BitmapWrapper, fixed Lure Ball error in battles started in the Debug menu, improved Terrain Tag editor, fixed some Compiler errors, enabled vsync, fixed event graphics frozen to the screen when using $game_player.moveto directly.
This commit is contained in:
@@ -41,7 +41,7 @@ module Kernel
|
|||||||
|
|
||||||
def echoln(string)
|
def echoln(string)
|
||||||
echo string
|
echo string
|
||||||
echo "\r\n"
|
echo "\n"
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
@@ -10,10 +10,10 @@ module Deprecation
|
|||||||
def warn_method(method_name, removal_version = nil, alternative = nil)
|
def warn_method(method_name, removal_version = nil, alternative = nil)
|
||||||
text = _INTL('Usage of deprecated method "{1}" or its alias.', method_name)
|
text = _INTL('Usage of deprecated method "{1}" or its alias.', method_name)
|
||||||
unless removal_version.nil?
|
unless removal_version.nil?
|
||||||
text += "\r\n" + _INTL("The method is slated to be removed in Essentials {1}.", removal_version)
|
text += "\n" + _INTL("The method is slated to be removed in Essentials {1}.", removal_version)
|
||||||
end
|
end
|
||||||
unless alternative.nil?
|
unless alternative.nil?
|
||||||
text += "\r\n" + _INTL("Use \"{1}\" instead.", alternative)
|
text += "\n" + _INTL("Use \"{1}\" instead.", alternative)
|
||||||
end
|
end
|
||||||
Console.echo_warn text
|
Console.echo_warn text
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -25,7 +25,7 @@ module Mouse
|
|||||||
|
|
||||||
# Returns the position of the mouse relative to the game window.
|
# Returns the position of the mouse relative to the game window.
|
||||||
def getMousePos(catch_anywhere = false)
|
def getMousePos(catch_anywhere = false)
|
||||||
return nil unless System.mouse_in_window || catch_anywhere
|
return nil unless Input.mouse_in_window || catch_anywhere
|
||||||
return Input.mouse_x, Input.mouse_y
|
return Input.mouse_x, Input.mouse_y
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -413,7 +413,7 @@ module PluginManager
|
|||||||
Compiler.pbCompilerEachPreppedLine(filename) do |line, line_no|
|
Compiler.pbCompilerEachPreppedLine(filename) do |line, line_no|
|
||||||
# split line up into property name and values
|
# split line up into property name and values
|
||||||
if !line[/^\s*(\w+)\s*=\s*(.*)$/]
|
if !line[/^\s*(\w+)\s*=\s*(.*)$/]
|
||||||
raise _INTL("Bad line syntax (expected syntax like XXX=YYY)\r\n{1}", FileLineData.linereport)
|
raise _INTL("Bad line syntax (expected syntax like XXX=YYY)\n{1}", FileLineData.linereport)
|
||||||
end
|
end
|
||||||
property = $~[1].upcase
|
property = $~[1].upcase
|
||||||
data = $~[2].split(",")
|
data = $~[2].split(",")
|
||||||
|
|||||||
@@ -243,6 +243,7 @@ class Game_Event < Game_Character
|
|||||||
|
|
||||||
def should_update?(recalc = false)
|
def should_update?(recalc = false)
|
||||||
return @to_update if !recalc
|
return @to_update if !recalc
|
||||||
|
return true if @updated_last_frame
|
||||||
return true if @trigger && (@trigger == 3 || @trigger == 4)
|
return true if @trigger && (@trigger == 3 || @trigger == 4)
|
||||||
return true if @move_route_forcing || @moveto_happened
|
return true if @move_route_forcing || @moveto_happened
|
||||||
return true if @event.name[/update/i]
|
return true if @event.name[/update/i]
|
||||||
@@ -256,7 +257,9 @@ class Game_Event < Game_Character
|
|||||||
|
|
||||||
def update
|
def update
|
||||||
@to_update = should_update?(true)
|
@to_update = should_update?(true)
|
||||||
|
@updated_last_frame = false
|
||||||
return if !@to_update
|
return if !@to_update
|
||||||
|
@updated_last_frame = true
|
||||||
@moveto_happened = false
|
@moveto_happened = false
|
||||||
last_moving = moving?
|
last_moving = moving?
|
||||||
super
|
super
|
||||||
|
|||||||
@@ -68,9 +68,9 @@ class Sprite_Character < RPG::Sprite
|
|||||||
@oldbushdepth = 0
|
@oldbushdepth = 0
|
||||||
@spriteoffset = false
|
@spriteoffset = false
|
||||||
if !character || character == $game_player || (character.name[/reflection/i] rescue false)
|
if !character || character == $game_player || (character.name[/reflection/i] rescue false)
|
||||||
@reflection = Sprite_Reflection.new(self, character, viewport)
|
@reflection = Sprite_Reflection.new(self, viewport)
|
||||||
end
|
end
|
||||||
@surfbase = Sprite_SurfBase.new(self, character, viewport) if character == $game_player
|
@surfbase = Sprite_SurfBase.new(self, viewport) if character == $game_player
|
||||||
self.zoom_x = TilemapRenderer::ZOOM_X
|
self.zoom_x = TilemapRenderer::ZOOM_X
|
||||||
self.zoom_y = TilemapRenderer::ZOOM_Y
|
self.zoom_y = TilemapRenderer::ZOOM_Y
|
||||||
update
|
update
|
||||||
@@ -94,51 +94,55 @@ class Sprite_Character < RPG::Sprite
|
|||||||
@reflection = nil
|
@reflection = nil
|
||||||
@surfbase&.dispose
|
@surfbase&.dispose
|
||||||
@surfbase = nil
|
@surfbase = nil
|
||||||
|
@character = nil
|
||||||
super
|
super
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def refresh_graphic
|
||||||
|
return if @tile_id == @character.tile_id &&
|
||||||
|
@character_name == @character.character_name &&
|
||||||
|
@character_hue == @character.character_hue &&
|
||||||
|
@oldbushdepth == @character.bush_depth
|
||||||
|
@tile_id = @character.tile_id
|
||||||
|
@character_name = @character.character_name
|
||||||
|
@character_hue = @character.character_hue
|
||||||
|
@oldbushdepth = @character.bush_depth
|
||||||
|
@charbitmap&.dispose
|
||||||
|
@charbitmap = nil
|
||||||
|
@bushbitmap&.dispose
|
||||||
|
@bushbitmap = nil
|
||||||
|
if @tile_id >= 384
|
||||||
|
@charbitmap = pbGetTileBitmap(@character.map.tileset_name, @tile_id,
|
||||||
|
@character_hue, @character.width, @character.height)
|
||||||
|
@charbitmapAnimated = false
|
||||||
|
@spriteoffset = false
|
||||||
|
@cw = Game_Map::TILE_WIDTH * @character.width
|
||||||
|
@ch = Game_Map::TILE_HEIGHT * @character.height
|
||||||
|
self.src_rect.set(0, 0, @cw, @ch)
|
||||||
|
self.ox = @cw / 2
|
||||||
|
self.oy = @ch
|
||||||
|
elsif @character_name != ""
|
||||||
|
@charbitmap = AnimatedBitmap.new(
|
||||||
|
"Graphics/Characters/" + @character_name, @character_hue
|
||||||
|
)
|
||||||
|
RPG::Cache.retain("Graphics/Characters/", @character_name, @character_hue) if @character == $game_player
|
||||||
|
@charbitmapAnimated = true
|
||||||
|
@spriteoffset = @character_name[/offset/i]
|
||||||
|
@cw = @charbitmap.width / 4
|
||||||
|
@ch = @charbitmap.height / 4
|
||||||
|
self.ox = @cw / 2
|
||||||
|
else
|
||||||
|
self.bitmap = nil
|
||||||
|
@cw = 0
|
||||||
|
@ch = 0
|
||||||
|
end
|
||||||
|
@character.sprite_size = [@cw, @ch]
|
||||||
|
end
|
||||||
|
|
||||||
def update
|
def update
|
||||||
return if @character.is_a?(Game_Event) && !@character.should_update?
|
return if @character.is_a?(Game_Event) && !@character.should_update?
|
||||||
super
|
super
|
||||||
if @tile_id != @character.tile_id ||
|
refresh_graphic
|
||||||
@character_name != @character.character_name ||
|
|
||||||
@character_hue != @character.character_hue ||
|
|
||||||
@oldbushdepth != @character.bush_depth
|
|
||||||
@tile_id = @character.tile_id
|
|
||||||
@character_name = @character.character_name
|
|
||||||
@character_hue = @character.character_hue
|
|
||||||
@oldbushdepth = @character.bush_depth
|
|
||||||
@charbitmap&.dispose
|
|
||||||
@charbitmap = nil
|
|
||||||
@bushbitmap&.dispose
|
|
||||||
@bushbitmap = nil
|
|
||||||
if @tile_id >= 384
|
|
||||||
@charbitmap = pbGetTileBitmap(@character.map.tileset_name, @tile_id,
|
|
||||||
@character_hue, @character.width, @character.height)
|
|
||||||
@charbitmapAnimated = false
|
|
||||||
@spriteoffset = false
|
|
||||||
@cw = Game_Map::TILE_WIDTH * @character.width
|
|
||||||
@ch = Game_Map::TILE_HEIGHT * @character.height
|
|
||||||
self.src_rect.set(0, 0, @cw, @ch)
|
|
||||||
self.ox = @cw / 2
|
|
||||||
self.oy = @ch
|
|
||||||
elsif @character_name != ""
|
|
||||||
@charbitmap = AnimatedBitmap.new(
|
|
||||||
"Graphics/Characters/" + @character_name, @character_hue
|
|
||||||
)
|
|
||||||
RPG::Cache.retain("Graphics/Characters/", @character_name, @character_hue) if @character == $game_player
|
|
||||||
@charbitmapAnimated = true
|
|
||||||
@spriteoffset = @character_name[/offset/i]
|
|
||||||
@cw = @charbitmap.width / 4
|
|
||||||
@ch = @charbitmap.height / 4
|
|
||||||
self.ox = @cw / 2
|
|
||||||
else
|
|
||||||
self.bitmap = nil
|
|
||||||
@cw = 0
|
|
||||||
@ch = 0
|
|
||||||
end
|
|
||||||
@character.sprite_size = [@cw, @ch]
|
|
||||||
end
|
|
||||||
return if !@charbitmap
|
return if !@charbitmap
|
||||||
@charbitmap.update if @charbitmapAnimated
|
@charbitmap.update if @charbitmapAnimated
|
||||||
bushdepth = @character.bush_depth
|
bushdepth = @character.bush_depth
|
||||||
|
|||||||
@@ -1,14 +1,13 @@
|
|||||||
class Sprite_Reflection
|
class Sprite_Reflection
|
||||||
attr_reader :visible
|
attr_reader :visible
|
||||||
attr_accessor :event
|
|
||||||
|
|
||||||
def initialize(sprite, event, viewport = nil)
|
def initialize(parent_sprite, viewport = nil)
|
||||||
@rsprite = sprite
|
@parent_sprite = parent_sprite
|
||||||
@sprite = nil
|
@sprite = nil
|
||||||
@event = event
|
@height = 0
|
||||||
@height = 0
|
|
||||||
@fixedheight = false
|
@fixedheight = false
|
||||||
if @event && @event != $game_player && @event.name[/reflection\((\d+)\)/i]
|
if @parent_sprite.character && @parent_sprite.character != $game_player &&
|
||||||
|
@parent_sprite.character.name[/reflection\((\d+)\)/i]
|
||||||
@height = $~[1].to_i || 0
|
@height = $~[1].to_i || 0
|
||||||
@fixedheight = true
|
@fixedheight = true
|
||||||
end
|
end
|
||||||
@@ -18,15 +17,19 @@ class Sprite_Reflection
|
|||||||
end
|
end
|
||||||
|
|
||||||
def dispose
|
def dispose
|
||||||
if !@disposed
|
return if @disposed
|
||||||
@sprite&.dispose
|
@sprite&.dispose
|
||||||
@sprite = nil
|
@sprite = nil
|
||||||
@disposed = true
|
@parent_sprite = nil
|
||||||
end
|
@disposed = true
|
||||||
end
|
end
|
||||||
|
|
||||||
def disposed?
|
def disposed?
|
||||||
@disposed
|
return @disposed
|
||||||
|
end
|
||||||
|
|
||||||
|
def event
|
||||||
|
return @parent_sprite.character
|
||||||
end
|
end
|
||||||
|
|
||||||
def visible=(value)
|
def visible=(value)
|
||||||
@@ -36,7 +39,7 @@ class Sprite_Reflection
|
|||||||
|
|
||||||
def update
|
def update
|
||||||
return if disposed?
|
return if disposed?
|
||||||
shouldShow = @rsprite.visible
|
shouldShow = @parent_sprite.visible
|
||||||
if !shouldShow
|
if !shouldShow
|
||||||
# Just-in-time disposal of sprite
|
# Just-in-time disposal of sprite
|
||||||
if @sprite
|
if @sprite
|
||||||
@@ -48,38 +51,38 @@ class Sprite_Reflection
|
|||||||
# Just-in-time creation of sprite
|
# Just-in-time creation of sprite
|
||||||
@sprite = Sprite.new(@viewport) if !@sprite
|
@sprite = Sprite.new(@viewport) if !@sprite
|
||||||
if @sprite
|
if @sprite
|
||||||
x = @rsprite.x - (@rsprite.ox * TilemapRenderer::ZOOM_X)
|
x = @parent_sprite.x - (@parent_sprite.ox * TilemapRenderer::ZOOM_X)
|
||||||
y = @rsprite.y - (@rsprite.oy * TilemapRenderer::ZOOM_Y)
|
y = @parent_sprite.y - (@parent_sprite.oy * TilemapRenderer::ZOOM_Y)
|
||||||
y -= Game_Map::TILE_HEIGHT * TilemapRenderer::ZOOM_Y if @rsprite.character.character_name[/offset/i]
|
y -= Game_Map::TILE_HEIGHT * TilemapRenderer::ZOOM_Y if event.character_name[/offset/i]
|
||||||
@height = $PokemonGlobal.bridge if !@fixedheight
|
@height = $PokemonGlobal.bridge if !@fixedheight
|
||||||
y += @height * TilemapRenderer::ZOOM_Y * Game_Map::TILE_HEIGHT / 2
|
y += @height * TilemapRenderer::ZOOM_Y * Game_Map::TILE_HEIGHT / 2
|
||||||
width = @rsprite.src_rect.width
|
width = @parent_sprite.src_rect.width
|
||||||
height = @rsprite.src_rect.height
|
height = @parent_sprite.src_rect.height
|
||||||
@sprite.x = x + ((width / 2) * TilemapRenderer::ZOOM_X)
|
@sprite.x = x + ((width / 2) * TilemapRenderer::ZOOM_X)
|
||||||
@sprite.y = y + ((height + (height / 2)) * TilemapRenderer::ZOOM_Y)
|
@sprite.y = y + ((height + (height / 2)) * TilemapRenderer::ZOOM_Y)
|
||||||
@sprite.ox = width / 2
|
@sprite.ox = width / 2
|
||||||
@sprite.oy = (height / 2) - 2 # Hard-coded 2 pixel shift up
|
@sprite.oy = (height / 2) - 2 # Hard-coded 2 pixel shift up
|
||||||
@sprite.oy -= @rsprite.character.bob_height * 2
|
@sprite.oy -= event.bob_height * 2
|
||||||
@sprite.z = -50 # Still water is -100, map is 0 and above
|
@sprite.z = -50 # Still water is -100, map is 0 and above
|
||||||
@sprite.z += 1 if @event == $game_player
|
@sprite.z += 1 if event == $game_player
|
||||||
@sprite.zoom_x = @rsprite.zoom_x
|
@sprite.zoom_x = @parent_sprite.zoom_x
|
||||||
@sprite.zoom_y = @rsprite.zoom_y
|
@sprite.zoom_y = @parent_sprite.zoom_y
|
||||||
frame = (Graphics.frame_count % 40) / 10
|
frame = (Graphics.frame_count % 40) / 10
|
||||||
@sprite.zoom_x *= [1.0, 0.95, 1.0, 1.05][frame]
|
@sprite.zoom_x *= [1.0, 0.95, 1.0, 1.05][frame]
|
||||||
@sprite.angle = 180.0
|
@sprite.angle = 180.0
|
||||||
@sprite.mirror = true
|
@sprite.mirror = true
|
||||||
@sprite.bitmap = @rsprite.bitmap
|
@sprite.bitmap = @parent_sprite.bitmap
|
||||||
@sprite.tone = @rsprite.tone
|
@sprite.tone = @parent_sprite.tone
|
||||||
if @height > 0
|
if @height > 0
|
||||||
@sprite.color = Color.new(48, 96, 160, 255) # Dark still water
|
@sprite.color = Color.new(48, 96, 160, 255) # Dark still water
|
||||||
@sprite.opacity = @rsprite.opacity
|
@sprite.opacity = @parent_sprite.opacity
|
||||||
@sprite.visible = !Settings::TIME_SHADING # Can't time-tone a colored sprite
|
@sprite.visible = !Settings::TIME_SHADING # Can't time-tone a colored sprite
|
||||||
else
|
else
|
||||||
@sprite.color = Color.new(224, 224, 224, 96)
|
@sprite.color = Color.new(224, 224, 224, 96)
|
||||||
@sprite.opacity = @rsprite.opacity * 3 / 4
|
@sprite.opacity = @parent_sprite.opacity * 3 / 4
|
||||||
@sprite.visible = true
|
@sprite.visible = true
|
||||||
end
|
end
|
||||||
@sprite.src_rect = @rsprite.src_rect
|
@sprite.src_rect = @parent_sprite.src_rect
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -1,11 +1,9 @@
|
|||||||
class Sprite_SurfBase
|
class Sprite_SurfBase
|
||||||
attr_reader :visible
|
attr_reader :visible
|
||||||
attr_accessor :event
|
|
||||||
|
|
||||||
def initialize(sprite, event, viewport = nil)
|
def initialize(parent_sprite, viewport = nil)
|
||||||
@rsprite = sprite
|
@parent_sprite = parent_sprite
|
||||||
@sprite = nil
|
@sprite = nil
|
||||||
@event = event
|
|
||||||
@viewport = viewport
|
@viewport = viewport
|
||||||
@disposed = false
|
@disposed = false
|
||||||
@surfbitmap = AnimatedBitmap.new("Graphics/Characters/base_surf")
|
@surfbitmap = AnimatedBitmap.new("Graphics/Characters/base_surf")
|
||||||
@@ -23,13 +21,18 @@ class Sprite_SurfBase
|
|||||||
return if @disposed
|
return if @disposed
|
||||||
@sprite&.dispose
|
@sprite&.dispose
|
||||||
@sprite = nil
|
@sprite = nil
|
||||||
|
@parent_sprite = nil
|
||||||
@surfbitmap.dispose
|
@surfbitmap.dispose
|
||||||
@divebitmap.dispose
|
@divebitmap.dispose
|
||||||
@disposed = true
|
@disposed = true
|
||||||
end
|
end
|
||||||
|
|
||||||
def disposed?
|
def disposed?
|
||||||
@disposed
|
return @disposed
|
||||||
|
end
|
||||||
|
|
||||||
|
def event
|
||||||
|
return @parent_sprite.character
|
||||||
end
|
end
|
||||||
|
|
||||||
def visible=(value)
|
def visible=(value)
|
||||||
@@ -49,41 +52,40 @@ class Sprite_SurfBase
|
|||||||
end
|
end
|
||||||
# Just-in-time creation of sprite
|
# Just-in-time creation of sprite
|
||||||
@sprite = Sprite.new(@viewport) if !@sprite
|
@sprite = Sprite.new(@viewport) if !@sprite
|
||||||
if @sprite
|
return if !@sprite
|
||||||
if $PokemonGlobal.surfing
|
if $PokemonGlobal.surfing
|
||||||
@sprite.bitmap = @surfbitmap.bitmap
|
@sprite.bitmap = @surfbitmap.bitmap
|
||||||
cw = @cws
|
cw = @cws
|
||||||
ch = @chs
|
ch = @chs
|
||||||
elsif $PokemonGlobal.diving
|
elsif $PokemonGlobal.diving
|
||||||
@sprite.bitmap = @divebitmap.bitmap
|
@sprite.bitmap = @divebitmap.bitmap
|
||||||
cw = @cwd
|
cw = @cwd
|
||||||
ch = @chd
|
ch = @chd
|
||||||
end
|
|
||||||
sx = @event.pattern_surf * cw
|
|
||||||
sy = ((@event.direction - 2) / 2) * ch
|
|
||||||
@sprite.src_rect.set(sx, sy, cw, ch)
|
|
||||||
if $game_temp.surf_base_coords
|
|
||||||
spr_x = ((($game_temp.surf_base_coords[0] * Game_Map::REAL_RES_X) - @event.map.display_x).to_f / Game_Map::X_SUBPIXELS).round
|
|
||||||
spr_x += (Game_Map::TILE_WIDTH / 2)
|
|
||||||
spr_x = ((spr_x - (Graphics.width / 2)) * TilemapRenderer::ZOOM_X) + (Graphics.width / 2) if TilemapRenderer::ZOOM_X != 1
|
|
||||||
@sprite.x = spr_x
|
|
||||||
spr_y = ((($game_temp.surf_base_coords[1] * Game_Map::REAL_RES_Y) - @event.map.display_y).to_f / Game_Map::Y_SUBPIXELS).round
|
|
||||||
spr_y += (Game_Map::TILE_HEIGHT / 2) + 16
|
|
||||||
spr_y = ((spr_y - (Graphics.height / 2)) * TilemapRenderer::ZOOM_Y) + (Graphics.height / 2) if TilemapRenderer::ZOOM_Y != 1
|
|
||||||
@sprite.y = spr_y
|
|
||||||
else
|
|
||||||
@sprite.x = @rsprite.x
|
|
||||||
@sprite.y = @rsprite.y
|
|
||||||
end
|
|
||||||
@sprite.ox = cw / 2
|
|
||||||
@sprite.oy = ch - 16 # Assume base needs offsetting
|
|
||||||
@sprite.oy -= @event.bob_height
|
|
||||||
@sprite.z = @event.screen_z(ch) - 1
|
|
||||||
@sprite.zoom_x = @rsprite.zoom_x
|
|
||||||
@sprite.zoom_y = @rsprite.zoom_y
|
|
||||||
@sprite.tone = @rsprite.tone
|
|
||||||
@sprite.color = @rsprite.color
|
|
||||||
@sprite.opacity = @rsprite.opacity
|
|
||||||
end
|
end
|
||||||
|
sx = event.pattern_surf * cw
|
||||||
|
sy = ((event.direction - 2) / 2) * ch
|
||||||
|
@sprite.src_rect.set(sx, sy, cw, ch)
|
||||||
|
if $game_temp.surf_base_coords
|
||||||
|
spr_x = ((($game_temp.surf_base_coords[0] * Game_Map::REAL_RES_X) - event.map.display_x).to_f / Game_Map::X_SUBPIXELS).round
|
||||||
|
spr_x += (Game_Map::TILE_WIDTH / 2)
|
||||||
|
spr_x = ((spr_x - (Graphics.width / 2)) * TilemapRenderer::ZOOM_X) + (Graphics.width / 2) if TilemapRenderer::ZOOM_X != 1
|
||||||
|
@sprite.x = spr_x
|
||||||
|
spr_y = ((($game_temp.surf_base_coords[1] * Game_Map::REAL_RES_Y) - event.map.display_y).to_f / Game_Map::Y_SUBPIXELS).round
|
||||||
|
spr_y += (Game_Map::TILE_HEIGHT / 2) + 16
|
||||||
|
spr_y = ((spr_y - (Graphics.height / 2)) * TilemapRenderer::ZOOM_Y) + (Graphics.height / 2) if TilemapRenderer::ZOOM_Y != 1
|
||||||
|
@sprite.y = spr_y
|
||||||
|
else
|
||||||
|
@sprite.x = @parent_sprite.x
|
||||||
|
@sprite.y = @parent_sprite.y
|
||||||
|
end
|
||||||
|
@sprite.ox = cw / 2
|
||||||
|
@sprite.oy = ch - 16 # Assume base needs offsetting
|
||||||
|
@sprite.oy -= event.bob_height
|
||||||
|
@sprite.z = event.screen_z(ch) - 1
|
||||||
|
@sprite.zoom_x = @parent_sprite.zoom_x
|
||||||
|
@sprite.zoom_y = @parent_sprite.zoom_y
|
||||||
|
@sprite.tone = @parent_sprite.tone
|
||||||
|
@sprite.color = @parent_sprite.color
|
||||||
|
@sprite.opacity = @parent_sprite.opacity
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -163,8 +163,8 @@ end
|
|||||||
#===============================================================================
|
#===============================================================================
|
||||||
def createMinimap(mapid)
|
def createMinimap(mapid)
|
||||||
map = load_data(sprintf("Data/Map%03d.rxdata", mapid)) rescue nil
|
map = load_data(sprintf("Data/Map%03d.rxdata", mapid)) rescue nil
|
||||||
return BitmapWrapper.new(32, 32) if !map
|
return Bitmap.new(32, 32) if !map
|
||||||
bitmap = BitmapWrapper.new(map.width * 4, map.height * 4)
|
bitmap = Bitmap.new(map.width * 4, map.height * 4)
|
||||||
black = Color.black
|
black = Color.black
|
||||||
tilesets = $data_tilesets
|
tilesets = $data_tilesets
|
||||||
tileset = tilesets[map.tileset_id]
|
tileset = tilesets[map.tileset_id]
|
||||||
|
|||||||
@@ -1074,7 +1074,7 @@ class Window_DrawableCommand < SpriteWindow_SelectableEx
|
|||||||
windowheight += self.borderY
|
windowheight += self.borderY
|
||||||
if !width || width < 0
|
if !width || width < 0
|
||||||
width = 0
|
width = 0
|
||||||
tmpbitmap = BitmapWrapper.new(1, 1)
|
tmpbitmap = Bitmap.new(1, 1)
|
||||||
pbSetSystemFont(tmpbitmap)
|
pbSetSystemFont(tmpbitmap)
|
||||||
commands.each do |i|
|
commands.each do |i|
|
||||||
width = [width, tmpbitmap.text_size(i).width].max
|
width = [width, tmpbitmap.text_size(i).width].max
|
||||||
|
|||||||
@@ -1,93 +1,3 @@
|
|||||||
#===============================================================================
|
|
||||||
# SpriteWrapper is a class which wraps (most of) Sprite's properties.
|
|
||||||
# (unused) Use class Sprite instead
|
|
||||||
#===============================================================================
|
|
||||||
class SpriteWrapper
|
|
||||||
def initialize(viewport = nil)
|
|
||||||
@sprite = Sprite.new(viewport)
|
|
||||||
end
|
|
||||||
|
|
||||||
def dispose; @sprite.dispose; end
|
|
||||||
def disposed?; return @sprite.disposed?; end
|
|
||||||
def viewport; return @sprite.viewport; end
|
|
||||||
def flash(color, duration); return @sprite.flash(color, duration); end
|
|
||||||
def update; return @sprite.update; end
|
|
||||||
def x; @sprite.x; end
|
|
||||||
def x=(value); @sprite.x = value; end
|
|
||||||
def y; @sprite.y; end
|
|
||||||
def y=(value); @sprite.y = value; end
|
|
||||||
def bitmap; @sprite.bitmap; end
|
|
||||||
def bitmap=(value); @sprite.bitmap = value; end
|
|
||||||
def src_rect; @sprite.src_rect; end
|
|
||||||
def src_rect=(value); @sprite.src_rect = value; end
|
|
||||||
def visible; @sprite.visible; end
|
|
||||||
def visible=(value); @sprite.visible = value; end
|
|
||||||
def z; @sprite.z; end
|
|
||||||
def z=(value); @sprite.z = value; end
|
|
||||||
def ox; @sprite.ox; end
|
|
||||||
def ox=(value); @sprite.ox = value; end
|
|
||||||
def oy; @sprite.oy; end
|
|
||||||
def oy=(value); @sprite.oy = value; end
|
|
||||||
def zoom_x; @sprite.zoom_x; end
|
|
||||||
def zoom_x=(value); @sprite.zoom_x = value; end
|
|
||||||
def zoom_y; @sprite.zoom_y; end
|
|
||||||
def zoom_y=(value); @sprite.zoom_y = value; end
|
|
||||||
def angle; @sprite.angle; end
|
|
||||||
def angle=(value); @sprite.angle = value; end
|
|
||||||
def mirror; @sprite.mirror; end
|
|
||||||
def mirror=(value); @sprite.mirror = value; end
|
|
||||||
def bush_depth; @sprite.bush_depth; end
|
|
||||||
def bush_depth=(value); @sprite.bush_depth = value; end
|
|
||||||
def opacity; @sprite.opacity; end
|
|
||||||
def opacity=(value); @sprite.opacity = value; end
|
|
||||||
def blend_type; @sprite.blend_type; end
|
|
||||||
def blend_type=(value); @sprite.blend_type = value; end
|
|
||||||
def color; @sprite.color; end
|
|
||||||
def color=(value); @sprite.color = value; end
|
|
||||||
def tone; @sprite.tone; end
|
|
||||||
def tone=(value); @sprite.tone = value; end
|
|
||||||
|
|
||||||
def viewport=(value)
|
|
||||||
return if self.viewport == value
|
|
||||||
bitmap = @sprite.bitmap
|
|
||||||
src_rect = @sprite.src_rect
|
|
||||||
visible = @sprite.visible
|
|
||||||
x = @sprite.x
|
|
||||||
y = @sprite.y
|
|
||||||
z = @sprite.z
|
|
||||||
ox = @sprite.ox
|
|
||||||
oy = @sprite.oy
|
|
||||||
zoom_x = @sprite.zoom_x
|
|
||||||
zoom_y = @sprite.zoom_y
|
|
||||||
angle = @sprite.angle
|
|
||||||
mirror = @sprite.mirror
|
|
||||||
bush_depth = @sprite.bush_depth
|
|
||||||
opacity = @sprite.opacity
|
|
||||||
blend_type = @sprite.blend_type
|
|
||||||
color = @sprite.color
|
|
||||||
tone = @sprite.tone
|
|
||||||
@sprite.dispose
|
|
||||||
@sprite = Sprite.new(value)
|
|
||||||
@sprite.bitmap = bitmap
|
|
||||||
@sprite.src_rect = src_rect
|
|
||||||
@sprite.visible = visible
|
|
||||||
@sprite.x = x
|
|
||||||
@sprite.y = y
|
|
||||||
@sprite.z = z
|
|
||||||
@sprite.ox = ox
|
|
||||||
@sprite.oy = oy
|
|
||||||
@sprite.zoom_x = zoom_x
|
|
||||||
@sprite.zoom_y = zoom_y
|
|
||||||
@sprite.angle = angle
|
|
||||||
@sprite.mirror = mirror
|
|
||||||
@sprite.bush_depth = bush_depth
|
|
||||||
@sprite.opacity = opacity
|
|
||||||
@sprite.blend_type = blend_type
|
|
||||||
@sprite.color = color
|
|
||||||
@sprite.tone = tone
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
#===============================================================================
|
#===============================================================================
|
||||||
# Sprite class that maintains a bitmap of its own.
|
# Sprite class that maintains a bitmap of its own.
|
||||||
# This bitmap can't be changed to a different one.
|
# This bitmap can't be changed to a different one.
|
||||||
@@ -58,7 +58,7 @@ class PngAnimatedBitmap
|
|||||||
@frameDelay = delay
|
@frameDelay = delay
|
||||||
subWidth = panorama.width / numFrames
|
subWidth = panorama.width / numFrames
|
||||||
numFrames.times do |i|
|
numFrames.times do |i|
|
||||||
subBitmap = BitmapWrapper.new(subWidth, panorama.height)
|
subBitmap = Bitmap.new(subWidth, panorama.height)
|
||||||
subBitmap.blt(0, 0, panorama, Rect.new(subWidth * i, 0, subWidth, panorama.height))
|
subBitmap.blt(0, 0, panorama, Rect.new(subWidth * i, 0, subWidth, panorama.height))
|
||||||
@frames.push(subBitmap)
|
@frames.push(subBitmap)
|
||||||
end
|
end
|
||||||
@@ -155,7 +155,7 @@ class GifBitmap
|
|||||||
rescue
|
rescue
|
||||||
@bitmap = nil
|
@bitmap = nil
|
||||||
end
|
end
|
||||||
@bitmap = BitmapWrapper.new(32, 32) if @bitmap.nil?
|
@bitmap = Bitmap.new(32, 32) if @bitmap.nil?
|
||||||
@bitmap.play if @bitmap&.animated?
|
@bitmap.play if @bitmap&.animated?
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
@@ -221,7 +221,7 @@ class FaceWindowVX < SpriteWindow_Base
|
|||||||
self.contents&.dispose
|
self.contents&.dispose
|
||||||
@faceIndex = faceinfo[1].to_i
|
@faceIndex = faceinfo[1].to_i
|
||||||
@facebitmaptmp = AnimatedBitmap.new(facefile)
|
@facebitmaptmp = AnimatedBitmap.new(facefile)
|
||||||
@facebitmap = BitmapWrapper.new(96, 96)
|
@facebitmap = Bitmap.new(96, 96)
|
||||||
@facebitmap.blt(0, 0, @facebitmaptmp.bitmap,
|
@facebitmap.blt(0, 0, @facebitmaptmp.bitmap,
|
||||||
Rect.new((@faceIndex % 4) * 96, (@faceIndex / 4) * 96, 96, 96))
|
Rect.new((@faceIndex % 4) * 96, (@faceIndex / 4) * 96, 96, 96))
|
||||||
self.contents = @facebitmap
|
self.contents = @facebitmap
|
||||||
|
|||||||
@@ -202,7 +202,7 @@ class Battle
|
|||||||
# Opposing trainers and partner trainers's messages about sending out Pokémon
|
# Opposing trainers and partner trainers's messages about sending out Pokémon
|
||||||
trainers.each_with_index do |t, i|
|
trainers.each_with_index do |t, i|
|
||||||
next if side == 0 && i == 0 # The player's message is shown last
|
next if side == 0 && i == 0 # The player's message is shown last
|
||||||
msg += "\r\n" if msg.length > 0
|
msg += "\n" if msg.length > 0
|
||||||
sent = sendOuts[side][i]
|
sent = sendOuts[side][i]
|
||||||
case sent.length
|
case sent.length
|
||||||
when 1
|
when 1
|
||||||
@@ -218,7 +218,7 @@ class Battle
|
|||||||
end
|
end
|
||||||
# The player's message about sending out Pokémon
|
# The player's message about sending out Pokémon
|
||||||
if side == 0
|
if side == 0
|
||||||
msg += "\r\n" if msg.length > 0
|
msg += "\n" if msg.length > 0
|
||||||
sent = sendOuts[side][0]
|
sent = sendOuts[side][0]
|
||||||
case sent.length
|
case sent.length
|
||||||
when 1
|
when 1
|
||||||
|
|||||||
@@ -173,7 +173,7 @@ class Battle
|
|||||||
newLevel = growth_rate.level_from_exp(expFinal)
|
newLevel = growth_rate.level_from_exp(expFinal)
|
||||||
if newLevel < curLevel
|
if newLevel < curLevel
|
||||||
debugInfo = "Levels: #{curLevel}->#{newLevel} | Exp: #{pkmn.exp}->#{expFinal} | gain: #{expGained}"
|
debugInfo = "Levels: #{curLevel}->#{newLevel} | Exp: #{pkmn.exp}->#{expFinal} | gain: #{expGained}"
|
||||||
raise _INTL("{1}'s new level is less than its current level, which shouldn't happen.", pkmn.name) + "\r\n[#{debugInfo}]"
|
raise _INTL("{1}'s new level is less than its current level, which shouldn't happen.", pkmn.name) + "\n[#{debugInfo}]"
|
||||||
end
|
end
|
||||||
# Give Exp
|
# Give Exp
|
||||||
if pkmn.shadowPokemon?
|
if pkmn.shadowPokemon?
|
||||||
|
|||||||
@@ -297,12 +297,12 @@ class Battle::Scene
|
|||||||
#=============================================================================
|
#=============================================================================
|
||||||
def pbLevelUp(pkmn, _battler, oldTotalHP, oldAttack, oldDefense, oldSpAtk, oldSpDef, oldSpeed)
|
def pbLevelUp(pkmn, _battler, oldTotalHP, oldAttack, oldDefense, oldSpAtk, oldSpDef, oldSpeed)
|
||||||
pbTopRightWindow(
|
pbTopRightWindow(
|
||||||
_INTL("Max. HP<r>+{1}\r\nAttack<r>+{2}\r\nDefense<r>+{3}\r\nSp. Atk<r>+{4}\r\nSp. Def<r>+{5}\r\nSpeed<r>+{6}",
|
_INTL("Max. HP<r>+{1}\nAttack<r>+{2}\nDefense<r>+{3}\nSp. Atk<r>+{4}\nSp. Def<r>+{5}\nSpeed<r>+{6}",
|
||||||
pkmn.totalhp - oldTotalHP, pkmn.attack - oldAttack, pkmn.defense - oldDefense,
|
pkmn.totalhp - oldTotalHP, pkmn.attack - oldAttack, pkmn.defense - oldDefense,
|
||||||
pkmn.spatk - oldSpAtk, pkmn.spdef - oldSpDef, pkmn.speed - oldSpeed)
|
pkmn.spatk - oldSpAtk, pkmn.spdef - oldSpDef, pkmn.speed - oldSpeed)
|
||||||
)
|
)
|
||||||
pbTopRightWindow(
|
pbTopRightWindow(
|
||||||
_INTL("Max. HP<r>{1}\r\nAttack<r>{2}\r\nDefense<r>{3}\r\nSp. Atk<r>{4}\r\nSp. Def<r>{5}\r\nSpeed<r>{6}",
|
_INTL("Max. HP<r>{1}\nAttack<r>{2}\nDefense<r>{3}\nSp. Atk<r>{4}\nSp. Def<r>{5}\nSpeed<r>{6}",
|
||||||
pkmn.totalhp, pkmn.attack, pkmn.defense, pkmn.spatk, pkmn.spdef, pkmn.speed)
|
pkmn.totalhp, pkmn.attack, pkmn.defense, pkmn.spatk, pkmn.spdef, pkmn.speed)
|
||||||
)
|
)
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -93,7 +93,7 @@ class Battle::Scene::PokemonDataBox < Sprite
|
|||||||
@expBar.bitmap = @expBarBitmap.bitmap
|
@expBar.bitmap = @expBarBitmap.bitmap
|
||||||
@sprites["expBar"] = @expBar
|
@sprites["expBar"] = @expBar
|
||||||
# Create sprite wrapper that displays everything except the above
|
# Create sprite wrapper that displays everything except the above
|
||||||
@contents = BitmapWrapper.new(@databoxBitmap.width, @databoxBitmap.height)
|
@contents = Bitmap.new(@databoxBitmap.width, @databoxBitmap.height)
|
||||||
self.bitmap = @contents
|
self.bitmap = @contents
|
||||||
self.visible = false
|
self.visible = false
|
||||||
self.z = 150 + ((@battler.index / 2) * 5)
|
self.z = 150 + ((@battler.index / 2) * 5)
|
||||||
@@ -420,7 +420,7 @@ class Battle::Scene::AbilitySplashBar < Sprite
|
|||||||
@bgSprite.src_rect.y = (side == 0) ? 0 : @bgBitmap.height / 2
|
@bgSprite.src_rect.y = (side == 0) ? 0 : @bgBitmap.height / 2
|
||||||
@bgSprite.src_rect.height = @bgBitmap.height / 2
|
@bgSprite.src_rect.height = @bgBitmap.height / 2
|
||||||
# Create bitmap that displays the text
|
# Create bitmap that displays the text
|
||||||
@contents = BitmapWrapper.new(@bgBitmap.width, @bgBitmap.height / 2)
|
@contents = Bitmap.new(@bgBitmap.width, @bgBitmap.height / 2)
|
||||||
self.bitmap = @contents
|
self.bitmap = @contents
|
||||||
pbSetSystemFont(self.bitmap)
|
pbSetSystemFont(self.bitmap)
|
||||||
# Position the bar
|
# Position the bar
|
||||||
|
|||||||
@@ -114,8 +114,11 @@ Battle::PokeBallEffects::ModifyCatchRate.add(:LEVELBALL, proc { |ball, catchRate
|
|||||||
})
|
})
|
||||||
|
|
||||||
Battle::PokeBallEffects::ModifyCatchRate.add(:LUREBALL, proc { |ball, catchRate, battle, battler|
|
Battle::PokeBallEffects::ModifyCatchRate.add(:LUREBALL, proc { |ball, catchRate, battle, battler|
|
||||||
multiplier = (Settings::NEW_POKE_BALL_CATCH_RATES) ? 5 : 3
|
if $game_temp.encounter_type &&
|
||||||
catchRate *= multiplier if GameData::EncounterType.get($game_temp.encounter_type).type == :fishing
|
GameData::EncounterType.get($game_temp.encounter_type).type == :fishing
|
||||||
|
multiplier = (Settings::NEW_POKE_BALL_CATCH_RATES) ? 5 : 3
|
||||||
|
catchRate *= multiplier
|
||||||
|
end
|
||||||
next [catchRate, 255].min
|
next [catchRate, 255].min
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|||||||
@@ -67,7 +67,7 @@ class Battle::Scene::SafariDataBox < Sprite
|
|||||||
@databox = AnimatedBitmap.new("Graphics/UI/Battle/databox_safari")
|
@databox = AnimatedBitmap.new("Graphics/UI/Battle/databox_safari")
|
||||||
self.x = Graphics.width - 232
|
self.x = Graphics.width - 232
|
||||||
self.y = Graphics.height - 184
|
self.y = Graphics.height - 184
|
||||||
@contents = BitmapWrapper.new(@databox.width, @databox.height)
|
@contents = Bitmap.new(@databox.width, @databox.height)
|
||||||
self.bitmap = @contents
|
self.bitmap = @contents
|
||||||
self.visible = false
|
self.visible = false
|
||||||
self.z = 50
|
self.z = 50
|
||||||
|
|||||||
@@ -46,7 +46,7 @@ class DarknessSprite < Sprite
|
|||||||
|
|
||||||
def initialize(viewport = nil)
|
def initialize(viewport = nil)
|
||||||
super(viewport)
|
super(viewport)
|
||||||
@darkness = BitmapWrapper.new(Graphics.width, Graphics.height)
|
@darkness = Bitmap.new(Graphics.width, Graphics.height)
|
||||||
@radius = radiusMin
|
@radius = radiusMin
|
||||||
self.bitmap = @darkness
|
self.bitmap = @darkness
|
||||||
self.z = 99998
|
self.z = 99998
|
||||||
|
|||||||
@@ -56,7 +56,7 @@ def pbFishing(hasEncounter, rodType = 1)
|
|||||||
if hasEncounter && rand(100) < biteChance
|
if hasEncounter && rand(100) < biteChance
|
||||||
$scene.spriteset.addUserAnimation(Settings::EXCLAMATION_ANIMATION_ID, $game_player.x, $game_player.y, true, 3)
|
$scene.spriteset.addUserAnimation(Settings::EXCLAMATION_ANIMATION_ID, $game_player.x, $game_player.y, true, 3)
|
||||||
frames = Graphics.frame_rate - rand(Graphics.frame_rate / 2) # 0.5-1 second
|
frames = Graphics.frame_rate - rand(Graphics.frame_rate / 2) # 0.5-1 second
|
||||||
if !pbWaitForInput(msgWindow, message + "\r\n" + _INTL("Oh! A bite!"), frames)
|
if !pbWaitForInput(msgWindow, message + "\n" + _INTL("Oh! A bite!"), frames)
|
||||||
pbFishingEnd { pbMessageDisplay(msgWindow, _INTL("The Pokémon got away...")) }
|
pbFishingEnd { pbMessageDisplay(msgWindow, _INTL("The Pokémon got away...")) }
|
||||||
break
|
break
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -306,7 +306,7 @@ module RandomDungeon
|
|||||||
@width.times do |x|
|
@width.times do |x|
|
||||||
ret += TEXT_SYMBOLS[value(x, y)] || "\e[30m\e[41m?\e[0m"
|
ret += TEXT_SYMBOLS[value(x, y)] || "\e[30m\e[41m?\e[0m"
|
||||||
end
|
end
|
||||||
ret += "\r\n"
|
ret += "\n"
|
||||||
end
|
end
|
||||||
return ret
|
return ret
|
||||||
end
|
end
|
||||||
@@ -1076,7 +1076,7 @@ EventHandlers.add(:on_game_map_setup, :random_dungeon,
|
|||||||
#===============================================================================
|
#===============================================================================
|
||||||
MenuHandlers.add(:debug_menu, :test_random_dungeon, {
|
MenuHandlers.add(:debug_menu, :test_random_dungeon, {
|
||||||
"name" => _INTL("Test Random Dungeon Generation"),
|
"name" => _INTL("Test Random Dungeon Generation"),
|
||||||
"parent" => :other_menu,
|
"parent" => :main,
|
||||||
"description" => _INTL("Generates a random dungeon and echoes it to the console."),
|
"description" => _INTL("Generates a random dungeon and echoes it to the console."),
|
||||||
"effect" => proc {
|
"effect" => proc {
|
||||||
tileset = :cave # :forest # :cave
|
tileset = :cave # :forest # :cave
|
||||||
|
|||||||
@@ -160,9 +160,9 @@ def pbChangeLevel(pkmn, new_level, scene)
|
|||||||
special_attack_diff = pkmn.spatk - old_special_attack
|
special_attack_diff = pkmn.spatk - old_special_attack
|
||||||
special_defense_diff = pkmn.spdef - old_special_defense
|
special_defense_diff = pkmn.spdef - old_special_defense
|
||||||
speed_diff = pkmn.speed - old_speed
|
speed_diff = pkmn.speed - old_speed
|
||||||
pbTopRightWindow(_INTL("Max. HP<r>{1}\r\nAttack<r>{2}\r\nDefense<r>{3}\r\nSp. Atk<r>{4}\r\nSp. Def<r>{5}\r\nSpeed<r>{6}",
|
pbTopRightWindow(_INTL("Max. HP<r>{1}\nAttack<r>{2}\nDefense<r>{3}\nSp. Atk<r>{4}\nSp. Def<r>{5}\nSpeed<r>{6}",
|
||||||
total_hp_diff, attack_diff, defense_diff, special_attack_diff, special_defense_diff, speed_diff), scene)
|
total_hp_diff, attack_diff, defense_diff, special_attack_diff, special_defense_diff, speed_diff), scene)
|
||||||
pbTopRightWindow(_INTL("Max. HP<r>{1}\r\nAttack<r>{2}\r\nDefense<r>{3}\r\nSp. Atk<r>{4}\r\nSp. Def<r>{5}\r\nSpeed<r>{6}",
|
pbTopRightWindow(_INTL("Max. HP<r>{1}\nAttack<r>{2}\nDefense<r>{3}\nSp. Atk<r>{4}\nSp. Def<r>{5}\nSpeed<r>{6}",
|
||||||
pkmn.totalhp, pkmn.attack, pkmn.defense, pkmn.spatk, pkmn.spdef, pkmn.speed), scene)
|
pkmn.totalhp, pkmn.attack, pkmn.defense, pkmn.spatk, pkmn.spdef, pkmn.speed), scene)
|
||||||
else
|
else
|
||||||
pkmn.changeHappiness("vitamin")
|
pkmn.changeHappiness("vitamin")
|
||||||
@@ -177,9 +177,9 @@ def pbChangeLevel(pkmn, new_level, scene)
|
|||||||
special_attack_diff = pkmn.spatk - old_special_attack
|
special_attack_diff = pkmn.spatk - old_special_attack
|
||||||
special_defense_diff = pkmn.spdef - old_special_defense
|
special_defense_diff = pkmn.spdef - old_special_defense
|
||||||
speed_diff = pkmn.speed - old_speed
|
speed_diff = pkmn.speed - old_speed
|
||||||
pbTopRightWindow(_INTL("Max. HP<r>+{1}\r\nAttack<r>+{2}\r\nDefense<r>+{3}\r\nSp. Atk<r>+{4}\r\nSp. Def<r>+{5}\r\nSpeed<r>+{6}",
|
pbTopRightWindow(_INTL("Max. HP<r>+{1}\nAttack<r>+{2}\nDefense<r>+{3}\nSp. Atk<r>+{4}\nSp. Def<r>+{5}\nSpeed<r>+{6}",
|
||||||
total_hp_diff, attack_diff, defense_diff, special_attack_diff, special_defense_diff, speed_diff), scene)
|
total_hp_diff, attack_diff, defense_diff, special_attack_diff, special_defense_diff, speed_diff), scene)
|
||||||
pbTopRightWindow(_INTL("Max. HP<r>{1}\r\nAttack<r>{2}\r\nDefense<r>{3}\r\nSp. Atk<r>{4}\r\nSp. Def<r>{5}\r\nSpeed<r>{6}",
|
pbTopRightWindow(_INTL("Max. HP<r>{1}\nAttack<r>{2}\nDefense<r>{3}\nSp. Atk<r>{4}\nSp. Def<r>{5}\nSpeed<r>{6}",
|
||||||
pkmn.totalhp, pkmn.attack, pkmn.defense, pkmn.spatk, pkmn.spdef, pkmn.speed), scene)
|
pkmn.totalhp, pkmn.attack, pkmn.defense, pkmn.spatk, pkmn.spdef, pkmn.speed), scene)
|
||||||
# Learn new moves upon level up
|
# Learn new moves upon level up
|
||||||
movelist = pkmn.getMoveList
|
movelist = pkmn.getMoveList
|
||||||
@@ -258,9 +258,9 @@ def pbChangeExp(pkmn, new_exp, scene)
|
|||||||
special_attack_diff = pkmn.spatk - old_special_attack
|
special_attack_diff = pkmn.spatk - old_special_attack
|
||||||
special_defense_diff = pkmn.spdef - old_special_defense
|
special_defense_diff = pkmn.spdef - old_special_defense
|
||||||
speed_diff = pkmn.speed - old_speed
|
speed_diff = pkmn.speed - old_speed
|
||||||
pbTopRightWindow(_INTL("Max. HP<r>{1}\r\nAttack<r>{2}\r\nDefense<r>{3}\r\nSp. Atk<r>{4}\r\nSp. Def<r>{5}\r\nSpeed<r>{6}",
|
pbTopRightWindow(_INTL("Max. HP<r>{1}\nAttack<r>{2}\nDefense<r>{3}\nSp. Atk<r>{4}\nSp. Def<r>{5}\nSpeed<r>{6}",
|
||||||
total_hp_diff, attack_diff, defense_diff, special_attack_diff, special_defense_diff, speed_diff), scene)
|
total_hp_diff, attack_diff, defense_diff, special_attack_diff, special_defense_diff, speed_diff), scene)
|
||||||
pbTopRightWindow(_INTL("Max. HP<r>{1}\r\nAttack<r>{2}\r\nDefense<r>{3}\r\nSp. Atk<r>{4}\r\nSp. Def<r>{5}\r\nSpeed<r>{6}",
|
pbTopRightWindow(_INTL("Max. HP<r>{1}\nAttack<r>{2}\nDefense<r>{3}\nSp. Atk<r>{4}\nSp. Def<r>{5}\nSpeed<r>{6}",
|
||||||
pkmn.totalhp, pkmn.attack, pkmn.defense, pkmn.spatk, pkmn.spdef, pkmn.speed), scene)
|
pkmn.totalhp, pkmn.attack, pkmn.defense, pkmn.spatk, pkmn.spdef, pkmn.speed), scene)
|
||||||
else # Gains Exp
|
else # Gains Exp
|
||||||
difference = new_exp - pkmn.exp
|
difference = new_exp - pkmn.exp
|
||||||
@@ -286,9 +286,9 @@ def pbChangeExp(pkmn, new_exp, scene)
|
|||||||
special_attack_diff = pkmn.spatk - old_special_attack
|
special_attack_diff = pkmn.spatk - old_special_attack
|
||||||
special_defense_diff = pkmn.spdef - old_special_defense
|
special_defense_diff = pkmn.spdef - old_special_defense
|
||||||
speed_diff = pkmn.speed - old_speed
|
speed_diff = pkmn.speed - old_speed
|
||||||
pbTopRightWindow(_INTL("Max. HP<r>+{1}\r\nAttack<r>+{2}\r\nDefense<r>+{3}\r\nSp. Atk<r>+{4}\r\nSp. Def<r>+{5}\r\nSpeed<r>+{6}",
|
pbTopRightWindow(_INTL("Max. HP<r>+{1}\nAttack<r>+{2}\nDefense<r>+{3}\nSp. Atk<r>+{4}\nSp. Def<r>+{5}\nSpeed<r>+{6}",
|
||||||
total_hp_diff, attack_diff, defense_diff, special_attack_diff, special_defense_diff, speed_diff), scene)
|
total_hp_diff, attack_diff, defense_diff, special_attack_diff, special_defense_diff, speed_diff), scene)
|
||||||
pbTopRightWindow(_INTL("Max. HP<r>{1}\r\nAttack<r>{2}\r\nDefense<r>{3}\r\nSp. Atk<r>{4}\r\nSp. Def<r>{5}\r\nSpeed<r>{6}",
|
pbTopRightWindow(_INTL("Max. HP<r>{1}\nAttack<r>{2}\nDefense<r>{3}\nSp. Atk<r>{4}\nSp. Def<r>{5}\nSpeed<r>{6}",
|
||||||
pkmn.totalhp, pkmn.attack, pkmn.defense, pkmn.spatk, pkmn.spdef, pkmn.speed), scene)
|
pkmn.totalhp, pkmn.attack, pkmn.defense, pkmn.spatk, pkmn.spdef, pkmn.speed), scene)
|
||||||
# Learn new moves upon level up
|
# Learn new moves upon level up
|
||||||
movelist = pkmn.getMoveList
|
movelist = pkmn.getMoveList
|
||||||
|
|||||||
@@ -22,7 +22,7 @@ class ButtonEventScene < EventScene
|
|||||||
addLabelForScreen(1, 134, 244, 352, _INTL("Take a screenshot. It is put in the same folder as the save file."))
|
addLabelForScreen(1, 134, 244, 352, _INTL("Take a screenshot. It is put in the same folder as the save file."))
|
||||||
|
|
||||||
addImageForScreen(2, 16, 158, "Graphics/UI/Controls help/help_arrows")
|
addImageForScreen(2, 16, 158, "Graphics/UI/Controls help/help_arrows")
|
||||||
addLabelForScreen(2, 134, 100, 352, _INTL("Use the Arrow keys to move the main character.\r\n\r\nYou can also use the Arrow keys to select entries and navigate menus."))
|
addLabelForScreen(2, 134, 100, 352, _INTL("Use the Arrow keys to move the main character.\n\nYou can also use the Arrow keys to select entries and navigate menus."))
|
||||||
|
|
||||||
addImageForScreen(3, 16, 90, "Graphics/UI/Controls help/help_usekey")
|
addImageForScreen(3, 16, 90, "Graphics/UI/Controls help/help_usekey")
|
||||||
addImageForScreen(3, 16, 236, "Graphics/UI/Controls help/help_backkey")
|
addImageForScreen(3, 16, 236, "Graphics/UI/Controls help/help_backkey")
|
||||||
|
|||||||
@@ -175,18 +175,18 @@ class PokemonTrade_Scene
|
|||||||
speciesname1 = GameData::Species.get(@pokemon.species).name
|
speciesname1 = GameData::Species.get(@pokemon.species).name
|
||||||
speciesname2 = GameData::Species.get(@pokemon2.species).name
|
speciesname2 = GameData::Species.get(@pokemon2.species).name
|
||||||
pbMessageDisplay(@sprites["msgwindow"],
|
pbMessageDisplay(@sprites["msgwindow"],
|
||||||
_ISPRINTF("{1:s}\r\nID: {2:05d} OT: {3:s}",
|
_ISPRINTF("{1:s}\nID: {2:05d} OT: {3:s}",
|
||||||
@pokemon.name, @pokemon.owner.public_id, @pokemon.owner.name) + "\\wtnp[0]") { pbUpdate }
|
@pokemon.name, @pokemon.owner.public_id, @pokemon.owner.name) + "\\wtnp[0]") { pbUpdate }
|
||||||
pbMessageWaitForInput(@sprites["msgwindow"], 50, true) { pbUpdate }
|
pbMessageWaitForInput(@sprites["msgwindow"], 50, true) { pbUpdate }
|
||||||
pbPlayDecisionSE
|
pbPlayDecisionSE
|
||||||
pbScene1
|
pbScene1
|
||||||
pbMessageDisplay(@sprites["msgwindow"],
|
pbMessageDisplay(@sprites["msgwindow"],
|
||||||
_INTL("For {1}'s {2},\r\n{3} sends {4}.", @trader1, speciesname1, @trader2, speciesname2) + "\1") { pbUpdate }
|
_INTL("For {1}'s {2},\n{3} sends {4}.", @trader1, speciesname1, @trader2, speciesname2) + "\1") { pbUpdate }
|
||||||
pbMessageDisplay(@sprites["msgwindow"],
|
pbMessageDisplay(@sprites["msgwindow"],
|
||||||
_INTL("{1} bids farewell to {2}.", @trader2, speciesname2)) { pbUpdate }
|
_INTL("{1} bids farewell to {2}.", @trader2, speciesname2)) { pbUpdate }
|
||||||
pbScene2
|
pbScene2
|
||||||
pbMessageDisplay(@sprites["msgwindow"],
|
pbMessageDisplay(@sprites["msgwindow"],
|
||||||
_ISPRINTF("{1:s}\r\nID: {2:05d} OT: {3:s}",
|
_ISPRINTF("{1:s}\nID: {2:05d} OT: {3:s}",
|
||||||
@pokemon2.name, @pokemon2.owner.public_id, @pokemon2.owner.name) + "\1") { pbUpdate }
|
@pokemon2.name, @pokemon2.owner.public_id, @pokemon2.owner.name) + "\1") { pbUpdate }
|
||||||
pbMessageDisplay(@sprites["msgwindow"],
|
pbMessageDisplay(@sprites["msgwindow"],
|
||||||
_INTL("Take good care of {1}.", speciesname2)) { pbUpdate }
|
_INTL("Take good care of {1}.", speciesname2)) { pbUpdate }
|
||||||
|
|||||||
@@ -19,7 +19,7 @@ class PokegearButton < Sprite
|
|||||||
else
|
else
|
||||||
@button = AnimatedBitmap.new("Graphics/UI/Pokegear/icon_button")
|
@button = AnimatedBitmap.new("Graphics/UI/Pokegear/icon_button")
|
||||||
end
|
end
|
||||||
@contents = BitmapWrapper.new(@button.width, @button.height)
|
@contents = Bitmap.new(@button.width, @button.height)
|
||||||
self.bitmap = @contents
|
self.bitmap = @contents
|
||||||
self.x = x - (@button.width / 2)
|
self.x = x - (@button.width / 2)
|
||||||
self.y = y
|
self.y = y
|
||||||
|
|||||||
@@ -12,7 +12,7 @@ class MapBottomSprite < Sprite
|
|||||||
@mapname = ""
|
@mapname = ""
|
||||||
@maplocation = ""
|
@maplocation = ""
|
||||||
@mapdetails = ""
|
@mapdetails = ""
|
||||||
self.bitmap = BitmapWrapper.new(Graphics.width, Graphics.height)
|
self.bitmap = Bitmap.new(Graphics.width, Graphics.height)
|
||||||
pbSetSystemFont(self.bitmap)
|
pbSetSystemFont(self.bitmap)
|
||||||
refresh
|
refresh
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -49,7 +49,7 @@ class PokemonLoadPanel < Sprite
|
|||||||
return if disposed?
|
return if disposed?
|
||||||
@refreshing = true
|
@refreshing = true
|
||||||
if !self.bitmap || self.bitmap.disposed?
|
if !self.bitmap || self.bitmap.disposed?
|
||||||
self.bitmap = BitmapWrapper.new(@bgbitmap.width, 222)
|
self.bitmap = Bitmap.new(@bgbitmap.width, 222)
|
||||||
pbSetSystemFont(self.bitmap)
|
pbSetSystemFont(self.bitmap)
|
||||||
end
|
end
|
||||||
if @refreshBitmap
|
if @refreshBitmap
|
||||||
|
|||||||
@@ -17,7 +17,7 @@ class ReadyMenuButton < Sprite
|
|||||||
else
|
else
|
||||||
@button = AnimatedBitmap.new("Graphics/UI/Ready Menu/icon_itembutton")
|
@button = AnimatedBitmap.new("Graphics/UI/Ready Menu/icon_itembutton")
|
||||||
end
|
end
|
||||||
@contents = BitmapWrapper.new(@button.width, @button.height / 2)
|
@contents = Bitmap.new(@button.width, @button.height / 2)
|
||||||
self.bitmap = @contents
|
self.bitmap = @contents
|
||||||
pbSetSystemFont(self.bitmap)
|
pbSetSystemFont(self.bitmap)
|
||||||
if @command[2]
|
if @command[2]
|
||||||
|
|||||||
@@ -304,7 +304,7 @@ class PokemonBoxSprite < Sprite
|
|||||||
pokemon = @storage[boxnumber, i]
|
pokemon = @storage[boxnumber, i]
|
||||||
@pokemonsprites[i] = PokemonBoxIcon.new(pokemon, viewport)
|
@pokemonsprites[i] = PokemonBoxIcon.new(pokemon, viewport)
|
||||||
end
|
end
|
||||||
@contents = BitmapWrapper.new(324, 296)
|
@contents = Bitmap.new(324, 296)
|
||||||
self.bitmap = @contents
|
self.bitmap = @contents
|
||||||
self.x = 184
|
self.x = 184
|
||||||
self.y = 18
|
self.y = 18
|
||||||
@@ -454,7 +454,7 @@ class PokemonBoxPartySprite < Sprite
|
|||||||
pokemon = @party[i]
|
pokemon = @party[i]
|
||||||
@pokemonsprites[i] = PokemonBoxIcon.new(pokemon, viewport) if pokemon
|
@pokemonsprites[i] = PokemonBoxIcon.new(pokemon, viewport) if pokemon
|
||||||
end
|
end
|
||||||
@contents = BitmapWrapper.new(172, 352)
|
@contents = Bitmap.new(172, 352)
|
||||||
self.bitmap = @contents
|
self.bitmap = @contents
|
||||||
self.x = 182
|
self.x = 182
|
||||||
self.y = Graphics.height - 352
|
self.y = Graphics.height - 352
|
||||||
|
|||||||
@@ -236,7 +236,7 @@ class PokemonMart_Scene
|
|||||||
@sprites["qtywindow"].y = Graphics.height - 102 - @sprites["qtywindow"].height
|
@sprites["qtywindow"].y = Graphics.height - 102 - @sprites["qtywindow"].height
|
||||||
itemwindow.refresh
|
itemwindow.refresh
|
||||||
end
|
end
|
||||||
@sprites["moneywindow"].text = _INTL("Money:\r\n<r>{1}", @adapter.getMoneyString)
|
@sprites["moneywindow"].text = _INTL("Money:\n<r>{1}", @adapter.getMoneyString)
|
||||||
end
|
end
|
||||||
|
|
||||||
def pbStartBuyOrSellScene(buying, stock, adapter)
|
def pbStartBuyOrSellScene(buying, stock, adapter)
|
||||||
|
|||||||
@@ -151,7 +151,7 @@ class BattlePointShop_Scene
|
|||||||
@sprites["qtywindow"].y = Graphics.height - 102 - @sprites["qtywindow"].height
|
@sprites["qtywindow"].y = Graphics.height - 102 - @sprites["qtywindow"].height
|
||||||
itemwindow.refresh
|
itemwindow.refresh
|
||||||
end
|
end
|
||||||
@sprites["battlepointwindow"].text = _INTL("Battle Points:\r\n<r>{1}", @adapter.getBPString)
|
@sprites["battlepointwindow"].text = _INTL("Battle Points:\n<r>{1}", @adapter.getBPString)
|
||||||
end
|
end
|
||||||
|
|
||||||
def pbStartScene(stock, adapter)
|
def pbStartScene(stock, adapter)
|
||||||
|
|||||||
@@ -390,7 +390,7 @@ class PokemonEntryScene2
|
|||||||
pbDrawTextPositions(b, textPos)
|
pbDrawTextPositions(b, textPos)
|
||||||
@bitmaps[@@Characters.length + i] = b
|
@bitmaps[@@Characters.length + i] = b
|
||||||
end
|
end
|
||||||
underline_bitmap = BitmapWrapper.new(24, 6)
|
underline_bitmap = Bitmap.new(24, 6)
|
||||||
underline_bitmap.fill_rect(2, 2, 22, 4, Color.new(168, 184, 184))
|
underline_bitmap.fill_rect(2, 2, 22, 4, Color.new(168, 184, 184))
|
||||||
underline_bitmap.fill_rect(0, 0, 22, 4, Color.new(16, 24, 32))
|
underline_bitmap.fill_rect(0, 0, 22, 4, Color.new(16, 24, 32))
|
||||||
@bitmaps.push(underline_bitmap)
|
@bitmaps.push(underline_bitmap)
|
||||||
|
|||||||
@@ -46,7 +46,7 @@ class DuelWindow < Window_AdvancedTextPokemon
|
|||||||
name_tag = shadowc3tag(PLAYER_TEXT_BASE, PLAYER_TEXT_SHADOW)
|
name_tag = shadowc3tag(PLAYER_TEXT_BASE, PLAYER_TEXT_SHADOW)
|
||||||
end
|
end
|
||||||
hp_tag = shadowc3tag(HP_TEXT_BASE, HP_TEXT_SHADOW)
|
hp_tag = shadowc3tag(HP_TEXT_BASE, HP_TEXT_SHADOW)
|
||||||
self.text = name_tag + fmtescape(@name) + "\r\n" + hp_tag + _INTL("HP: {1}", @hp)
|
self.text = name_tag + fmtescape(@name) + "\n" + hp_tag + _INTL("HP: {1}", @hp)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
@@ -85,7 +85,7 @@ class TriadCard
|
|||||||
end
|
end
|
||||||
|
|
||||||
def self.createBack(type = nil, noback = false)
|
def self.createBack(type = nil, noback = false)
|
||||||
bitmap = BitmapWrapper.new(80, 96)
|
bitmap = Bitmap.new(80, 96)
|
||||||
if !noback
|
if !noback
|
||||||
cardbitmap = AnimatedBitmap.new("Graphics/UI/Triple Triad/card_opponent")
|
cardbitmap = AnimatedBitmap.new("Graphics/UI/Triple Triad/card_opponent")
|
||||||
bitmap.blt(0, 0, cardbitmap.bitmap, Rect.new(0, 0, cardbitmap.width, cardbitmap.height))
|
bitmap.blt(0, 0, cardbitmap.bitmap, Rect.new(0, 0, cardbitmap.width, cardbitmap.height))
|
||||||
@@ -103,7 +103,7 @@ class TriadCard
|
|||||||
|
|
||||||
def createBitmap(owner)
|
def createBitmap(owner)
|
||||||
return TriadCard.createBack if owner == 0
|
return TriadCard.createBack if owner == 0
|
||||||
bitmap = BitmapWrapper.new(80, 96)
|
bitmap = Bitmap.new(80, 96)
|
||||||
if owner == 2 # Opponent
|
if owner == 2 # Opponent
|
||||||
cardbitmap = AnimatedBitmap.new("Graphics/UI/Triple Triad/card_opponent")
|
cardbitmap = AnimatedBitmap.new("Graphics/UI/Triple Triad/card_opponent")
|
||||||
else # Player
|
else # Player
|
||||||
@@ -196,7 +196,7 @@ class TriadScene
|
|||||||
@cardIndexes.push(i)
|
@cardIndexes.push(i)
|
||||||
end
|
end
|
||||||
@sprites["overlay"] = Sprite.new(@viewport)
|
@sprites["overlay"] = Sprite.new(@viewport)
|
||||||
@sprites["overlay"].bitmap = BitmapWrapper.new(Graphics.width, Graphics.height)
|
@sprites["overlay"].bitmap = Bitmap.new(Graphics.width, Graphics.height)
|
||||||
pbSetSystemFont(@sprites["overlay"].bitmap)
|
pbSetSystemFont(@sprites["overlay"].bitmap)
|
||||||
pbDrawTextPositions(
|
pbDrawTextPositions(
|
||||||
@sprites["overlay"].bitmap,
|
@sprites["overlay"].bitmap,
|
||||||
@@ -204,7 +204,7 @@ class TriadScene
|
|||||||
[@battle.playerName, Graphics.width - 52, 10, :center, Color.new(248, 248, 248), Color.new(96, 96, 96)]]
|
[@battle.playerName, Graphics.width - 52, 10, :center, Color.new(248, 248, 248), Color.new(96, 96, 96)]]
|
||||||
)
|
)
|
||||||
@sprites["score"] = Sprite.new(@viewport)
|
@sprites["score"] = Sprite.new(@viewport)
|
||||||
@sprites["score"].bitmap = BitmapWrapper.new(Graphics.width, Graphics.height)
|
@sprites["score"].bitmap = Bitmap.new(Graphics.width, Graphics.height)
|
||||||
pbSetSystemFont(@sprites["score"].bitmap)
|
pbSetSystemFont(@sprites["score"].bitmap)
|
||||||
pbBGMPlay("Triple Triad")
|
pbBGMPlay("Triple Triad")
|
||||||
# Fade in all sprites
|
# Fade in all sprites
|
||||||
@@ -1067,7 +1067,7 @@ def pbBuyTriads
|
|||||||
cmdwindow = Window_CommandPokemonEx.newWithSize(realcommands, 0, 0, Graphics.width / 2, Graphics.height)
|
cmdwindow = Window_CommandPokemonEx.newWithSize(realcommands, 0, 0, Graphics.width / 2, Graphics.height)
|
||||||
cmdwindow.z = 99999
|
cmdwindow.z = 99999
|
||||||
goldwindow = Window_UnformattedTextPokemon.newWithSize(
|
goldwindow = Window_UnformattedTextPokemon.newWithSize(
|
||||||
_INTL("Money:\r\n{1}", pbGetGoldString), 0, 0, 32, 32
|
_INTL("Money:\n{1}", pbGetGoldString), 0, 0, 32, 32
|
||||||
)
|
)
|
||||||
goldwindow.resizeToFit(goldwindow.text, Graphics.width)
|
goldwindow.resizeToFit(goldwindow.text, Graphics.width)
|
||||||
goldwindow.x = Graphics.width - goldwindow.width
|
goldwindow.x = Graphics.width - goldwindow.width
|
||||||
@@ -1125,7 +1125,7 @@ def pbBuyTriads
|
|||||||
end
|
end
|
||||||
$PokemonGlobal.triads.add(item, quantity)
|
$PokemonGlobal.triads.add(item, quantity)
|
||||||
$player.money -= price
|
$player.money -= price
|
||||||
goldwindow.text = _INTL("Money:\r\n{1}", pbGetGoldString)
|
goldwindow.text = _INTL("Money:\n{1}", pbGetGoldString)
|
||||||
pbMessage(_INTL("Here you are! Thank you!") + "\\se[Mart buy item]")
|
pbMessage(_INTL("Here you are! Thank you!") + "\\se[Mart buy item]")
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
@@ -1157,7 +1157,7 @@ def pbSellTriads
|
|||||||
cmdwindow = Window_CommandPokemonEx.newWithSize(commands, 0, 0, Graphics.width / 2, Graphics.height)
|
cmdwindow = Window_CommandPokemonEx.newWithSize(commands, 0, 0, Graphics.width / 2, Graphics.height)
|
||||||
cmdwindow.z = 99999
|
cmdwindow.z = 99999
|
||||||
goldwindow = Window_UnformattedTextPokemon.newWithSize(
|
goldwindow = Window_UnformattedTextPokemon.newWithSize(
|
||||||
_INTL("Money:\r\n{1}", pbGetGoldString), 0, 0, 32, 32
|
_INTL("Money:\n{1}", pbGetGoldString), 0, 0, 32, 32
|
||||||
)
|
)
|
||||||
goldwindow.resizeToFit(goldwindow.text, Graphics.width)
|
goldwindow.resizeToFit(goldwindow.text, Graphics.width)
|
||||||
goldwindow.x = Graphics.width - goldwindow.width
|
goldwindow.x = Graphics.width - goldwindow.width
|
||||||
@@ -1218,7 +1218,7 @@ def pbSellTriads
|
|||||||
price *= quantity
|
price *= quantity
|
||||||
if pbConfirmMessage(_INTL("I can pay ${1}. Would that be OK?", price.to_s_formatted))
|
if pbConfirmMessage(_INTL("I can pay ${1}. Would that be OK?", price.to_s_formatted))
|
||||||
$player.money += price
|
$player.money += price
|
||||||
goldwindow.text = _INTL("Money:\r\n{1}", pbGetGoldString)
|
goldwindow.text = _INTL("Money:\n{1}", pbGetGoldString)
|
||||||
$PokemonGlobal.triads.remove(item, quantity)
|
$PokemonGlobal.triads.remove(item, quantity)
|
||||||
pbMessage(_INTL("Turned over the {1} card and received ${2}.", itemname, price.to_s_formatted) + "\\se[Mart buy item]")
|
pbMessage(_INTL("Turned over the {1} card and received ${2}.", itemname, price.to_s_formatted) + "\\se[Mart buy item]")
|
||||||
commands = []
|
commands = []
|
||||||
|
|||||||
@@ -2,14 +2,16 @@
|
|||||||
# Edits the terrain tags of tiles in tilesets.
|
# Edits the terrain tags of tiles in tilesets.
|
||||||
#===============================================================================
|
#===============================================================================
|
||||||
class PokemonTilesetScene
|
class PokemonTilesetScene
|
||||||
TILE_SIZE = 32 # in pixels
|
TILE_SIZE = 32 # in pixels
|
||||||
TILES_PER_ROW = 8
|
TILES_PER_ROW = 8
|
||||||
TILESET_WIDTH = TILES_PER_ROW * TILE_SIZE
|
TILESET_WIDTH = TILES_PER_ROW * TILE_SIZE
|
||||||
TILES_PER_AUTOTILE = 48
|
TILES_PER_AUTOTILE = 48
|
||||||
TILESET_START_ID = TILES_PER_ROW * TILES_PER_AUTOTILE
|
TILESET_START_ID = TILES_PER_ROW * TILES_PER_AUTOTILE
|
||||||
CURSOR_COLOR = Color.new(255, 0, 0)
|
TILE_BACKGROUND = Color.magenta
|
||||||
TEXT_COLOR = Color.new(80, 80, 80)
|
CURSOR_COLOR = Color.new(255, 0, 0) # Red
|
||||||
TEXT_SHADOW_COLOR = Color.new(192, 192, 192)
|
CURSOR_OUTLINE_COLOR = Color.white
|
||||||
|
TEXT_COLOR = Color.white
|
||||||
|
TEXT_SHADOW_COLOR = Color.black
|
||||||
|
|
||||||
def initialize
|
def initialize
|
||||||
@tilesets_data = load_data("Data/Tilesets.rxdata")
|
@tilesets_data = load_data("Data/Tilesets.rxdata")
|
||||||
@@ -17,11 +19,14 @@ class PokemonTilesetScene
|
|||||||
@viewport.z = 99999
|
@viewport.z = 99999
|
||||||
@sprites = {}
|
@sprites = {}
|
||||||
@sprites["title"] = Window_UnformattedTextPokemon.newWithSize(
|
@sprites["title"] = Window_UnformattedTextPokemon.newWithSize(
|
||||||
_INTL("Tileset Editor\r\nA/S: SCROLL\r\nZ: MENU"),
|
_INTL("Tileset Editor\nA/S: SCROLL\nZ: MENU"),
|
||||||
TILESET_WIDTH, 0, Graphics.width - TILESET_WIDTH, 128, @viewport
|
TILESET_WIDTH, 0, Graphics.width - TILESET_WIDTH, 128, @viewport
|
||||||
)
|
)
|
||||||
|
@sprites["background"] = BitmapSprite.new(Graphics.width, Graphics.height, @viewport)
|
||||||
@sprites["tileset"] = BitmapSprite.new(TILESET_WIDTH, Graphics.height, @viewport)
|
@sprites["tileset"] = BitmapSprite.new(TILESET_WIDTH, Graphics.height, @viewport)
|
||||||
|
@sprites["tileset"].z = 10
|
||||||
@sprites["overlay"] = BitmapSprite.new(Graphics.width, Graphics.height, @viewport)
|
@sprites["overlay"] = BitmapSprite.new(Graphics.width, Graphics.height, @viewport)
|
||||||
|
@sprites["overlay"].z = 20
|
||||||
pbSetSystemFont(@sprites["overlay"].bitmap)
|
pbSetSystemFont(@sprites["overlay"].bitmap)
|
||||||
@visible_height = @sprites["tileset"].bitmap.height / TILE_SIZE
|
@visible_height = @sprites["tileset"].bitmap.height / TILE_SIZE
|
||||||
load_tileset(1)
|
load_tileset(1)
|
||||||
@@ -68,11 +73,14 @@ class PokemonTilesetScene
|
|||||||
end
|
end
|
||||||
|
|
||||||
def draw_tiles
|
def draw_tiles
|
||||||
|
@sprites["background"].bitmap.clear
|
||||||
@sprites["tileset"].bitmap.clear
|
@sprites["tileset"].bitmap.clear
|
||||||
@visible_height.times do |yy|
|
@visible_height.times do |yy|
|
||||||
autotile_row = (@top_y == 0 && yy == 0) # Autotiles
|
autotile_row = (@top_y == 0 && yy == 0) # Autotiles
|
||||||
id_y_offset = (autotile_row) ? 0 : TILESET_START_ID + ((@top_y + yy - 1) * TILES_PER_ROW)
|
id_y_offset = (autotile_row) ? 0 : TILESET_START_ID + ((@top_y + yy - 1) * TILES_PER_ROW)
|
||||||
|
break if @top_y + yy >= @height
|
||||||
TILES_PER_ROW.times do |xx|
|
TILES_PER_ROW.times do |xx|
|
||||||
|
@sprites["background"].bitmap.fill_rect(xx * TILE_SIZE, yy * TILE_SIZE, TILE_SIZE, TILE_SIZE, TILE_BACKGROUND)
|
||||||
id_x_offset = (autotile_row) ? xx * TILES_PER_AUTOTILE : xx
|
id_x_offset = (autotile_row) ? xx * TILES_PER_AUTOTILE : xx
|
||||||
@tilehelper.bltTile(@sprites["tileset"].bitmap, xx * TILE_SIZE, yy * TILE_SIZE,
|
@tilehelper.bltTile(@sprites["tileset"].bitmap, xx * TILE_SIZE, yy * TILE_SIZE,
|
||||||
id_y_offset + id_x_offset)
|
id_y_offset + id_x_offset)
|
||||||
@@ -88,33 +96,48 @@ class PokemonTilesetScene
|
|||||||
TILES_PER_ROW.times do |xx|
|
TILES_PER_ROW.times do |xx|
|
||||||
tile_id = tile_ID_from_coordinates(xx, @top_y + yy)
|
tile_id = tile_ID_from_coordinates(xx, @top_y + yy)
|
||||||
terr = @tileset.terrain_tags[tile_id]
|
terr = @tileset.terrain_tags[tile_id]
|
||||||
textpos.push([terr.to_s, (xx * TILE_SIZE) + (TILE_SIZE / 2), (yy * TILE_SIZE) + 6, :center, TEXT_COLOR, TEXT_SHADOW_COLOR])
|
next if terr == 0
|
||||||
|
textpos.push([terr.to_s, (xx * TILE_SIZE) + (TILE_SIZE / 2), (yy * TILE_SIZE) + 6,
|
||||||
|
:center, TEXT_COLOR, TEXT_SHADOW_COLOR, :outline])
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
pbDrawTextPositions(@sprites["overlay"].bitmap, textpos)
|
pbDrawTextPositions(@sprites["overlay"].bitmap, textpos)
|
||||||
# Draw cursor
|
# Draw cursor
|
||||||
cursor_x = @x * TILE_SIZE
|
draw_cursor
|
||||||
cursor_y = (@y - @top_y) * TILE_SIZE
|
|
||||||
@sprites["overlay"].bitmap.fill_rect(cursor_x, cursor_y, TILE_SIZE, 4, CURSOR_COLOR)
|
|
||||||
@sprites["overlay"].bitmap.fill_rect(cursor_x, cursor_y, 4, TILE_SIZE, CURSOR_COLOR)
|
|
||||||
@sprites["overlay"].bitmap.fill_rect(cursor_x, cursor_y + TILE_SIZE - 4, TILE_SIZE, 4, CURSOR_COLOR)
|
|
||||||
@sprites["overlay"].bitmap.fill_rect(cursor_x + TILE_SIZE - 4, cursor_y, 4, TILE_SIZE, CURSOR_COLOR)
|
|
||||||
# Draw information about selected tile on right side
|
# Draw information about selected tile on right side
|
||||||
draw_tile_details
|
draw_tile_details
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def draw_cursor
|
||||||
|
cursor_x = @x * TILE_SIZE
|
||||||
|
cursor_y = (@y - @top_y) * TILE_SIZE
|
||||||
|
cursor_width = TILE_SIZE
|
||||||
|
cursor_height = TILE_SIZE
|
||||||
|
bitmap = @sprites["overlay"].bitmap
|
||||||
|
bitmap.fill_rect(cursor_x - 2, cursor_y - 2, cursor_width + 4, 8, CURSOR_OUTLINE_COLOR)
|
||||||
|
bitmap.fill_rect(cursor_x - 2, cursor_y - 2, 8, cursor_height + 4, CURSOR_OUTLINE_COLOR)
|
||||||
|
bitmap.fill_rect(cursor_x - 2, cursor_y + cursor_height - 6, cursor_width + 4, 8, CURSOR_OUTLINE_COLOR)
|
||||||
|
bitmap.fill_rect(cursor_x + cursor_width - 6, cursor_y - 2, 8, cursor_height + 4, CURSOR_OUTLINE_COLOR)
|
||||||
|
bitmap.fill_rect(cursor_x, cursor_y, cursor_width, 4, CURSOR_COLOR)
|
||||||
|
bitmap.fill_rect(cursor_x, cursor_y, 4, cursor_height, CURSOR_COLOR)
|
||||||
|
bitmap.fill_rect(cursor_x, cursor_y + cursor_height - 4, cursor_width, 4, CURSOR_COLOR)
|
||||||
|
bitmap.fill_rect(cursor_x + cursor_width - 4, cursor_y, 4, cursor_height, CURSOR_COLOR)
|
||||||
|
end
|
||||||
|
|
||||||
def draw_tile_details
|
def draw_tile_details
|
||||||
overlay = @sprites["overlay"].bitmap
|
overlay = @sprites["overlay"].bitmap
|
||||||
tile_x = (Graphics.width * 3 / 4) - TILE_SIZE
|
tile_size = 4 # Size multiplier
|
||||||
tile_y = (Graphics.height / 2) - TILE_SIZE
|
tile_x = (Graphics.width * 3 / 4) - (TILE_SIZE * tile_size / 2)
|
||||||
|
tile_y = (Graphics.height / 2) - (TILE_SIZE * tile_size / 2)
|
||||||
tile_id = tile_ID_from_coordinates(@x, @y) || 0
|
tile_id = tile_ID_from_coordinates(@x, @y) || 0
|
||||||
# Draw tile (at 200% size)
|
# Draw tile (at 400% size)
|
||||||
@tilehelper.bltSmallTile(overlay, tile_x, tile_y, TILE_SIZE * 2, TILE_SIZE * 2, tile_id)
|
@sprites["background"].bitmap.fill_rect(tile_x, tile_y, TILE_SIZE * tile_size, TILE_SIZE * tile_size, TILE_BACKGROUND)
|
||||||
|
@tilehelper.bltSmallTile(overlay, tile_x, tile_y, TILE_SIZE * tile_size, TILE_SIZE * tile_size, tile_id)
|
||||||
# Draw box around tile image
|
# Draw box around tile image
|
||||||
overlay.fill_rect(tile_x - 1, tile_y - 1, (TILE_SIZE * 2) + 2, 1, Color.white)
|
overlay.fill_rect(tile_x - 1, tile_y - 1, (TILE_SIZE * tile_size) + 2, 1, Color.white)
|
||||||
overlay.fill_rect(tile_x - 1, tile_y - 1, 1, (TILE_SIZE * 2) + 2, Color.white)
|
overlay.fill_rect(tile_x - 1, tile_y - 1, 1, (TILE_SIZE * tile_size) + 2, Color.white)
|
||||||
overlay.fill_rect(tile_x - 1, tile_y + (TILE_SIZE * 2), (TILE_SIZE * 2) + 2, 1, Color.white)
|
overlay.fill_rect(tile_x - 1, tile_y + (TILE_SIZE * tile_size), (TILE_SIZE * tile_size) + 2, 1, Color.white)
|
||||||
overlay.fill_rect(tile_x + (TILE_SIZE * 2), tile_y - 1, 1, (TILE_SIZE * 2) + 2, Color.white)
|
overlay.fill_rect(tile_x + (TILE_SIZE * tile_size), tile_y - 1, 1, (TILE_SIZE * tile_size) + 2, Color.white)
|
||||||
# Write terrain tag info about selected tile
|
# Write terrain tag info about selected tile
|
||||||
terrain_tag = @tileset.terrain_tags[tile_id] || 0
|
terrain_tag = @tileset.terrain_tags[tile_id] || 0
|
||||||
if GameData::TerrainTag.exists?(terrain_tag)
|
if GameData::TerrainTag.exists?(terrain_tag)
|
||||||
@@ -123,8 +146,10 @@ class PokemonTilesetScene
|
|||||||
terrain_tag_name = terrain_tag.to_s
|
terrain_tag_name = terrain_tag.to_s
|
||||||
end
|
end
|
||||||
textpos = [
|
textpos = [
|
||||||
[_INTL("Terrain Tag:"), tile_x + TILE_SIZE, tile_y + (TILE_SIZE * 2) + 22, :center, Color.new(248, 248, 248), Color.new(40, 40, 40)],
|
[_INTL("Terrain Tag:"), Graphics.width * 3 / 4, tile_y + (TILE_SIZE * tile_size) + 22,
|
||||||
[terrain_tag_name, tile_x + TILE_SIZE, tile_y + (TILE_SIZE * 2) + 54, :center, Color.new(248, 248, 248), Color.new(40, 40, 40)]
|
:center, Color.new(248, 248, 248), Color.new(40, 40, 40)],
|
||||||
|
[terrain_tag_name, Graphics.width * 3 / 4, tile_y + (TILE_SIZE * tile_size) + 54,
|
||||||
|
:center, Color.new(248, 248, 248), Color.new(40, 40, 40)]
|
||||||
]
|
]
|
||||||
# Draw all text
|
# Draw all text
|
||||||
pbDrawTextPositions(overlay, textpos)
|
pbDrawTextPositions(overlay, textpos)
|
||||||
@@ -176,9 +201,9 @@ class PokemonTilesetScene
|
|||||||
elsif Input.repeat?(Input::RIGHT)
|
elsif Input.repeat?(Input::RIGHT)
|
||||||
update_cursor_position(1, 0)
|
update_cursor_position(1, 0)
|
||||||
elsif Input.repeat?(Input::JUMPUP)
|
elsif Input.repeat?(Input::JUMPUP)
|
||||||
update_cursor_position(0, -@visible_height)
|
update_cursor_position(0, -@visible_height / 2)
|
||||||
elsif Input.repeat?(Input::JUMPDOWN)
|
elsif Input.repeat?(Input::JUMPDOWN)
|
||||||
update_cursor_position(0, @visible_height)
|
update_cursor_position(0, @visible_height / 2)
|
||||||
elsif Input.trigger?(Input::ACTION)
|
elsif Input.trigger?(Input::ACTION)
|
||||||
commands = [
|
commands = [
|
||||||
_INTL("Go to bottom"),
|
_INTL("Go to bottom"),
|
||||||
|
|||||||
@@ -107,7 +107,7 @@ class RegionMapSprite
|
|||||||
def createRegionMap(map)
|
def createRegionMap(map)
|
||||||
town_map = GameData::TownMap.get(map)
|
town_map = GameData::TownMap.get(map)
|
||||||
bitmap = AnimatedBitmap.new("Graphics/UI/Town Map/#{town_map.filename}").deanimate
|
bitmap = AnimatedBitmap.new("Graphics/UI/Town Map/#{town_map.filename}").deanimate
|
||||||
retbitmap = BitmapWrapper.new(bitmap.width / 2, bitmap.height / 2)
|
retbitmap = Bitmap.new(bitmap.width / 2, bitmap.height / 2)
|
||||||
retbitmap.stretch_blt(
|
retbitmap.stretch_blt(
|
||||||
Rect.new(0, 0, bitmap.width / 2, bitmap.height / 2),
|
Rect.new(0, 0, bitmap.width / 2, bitmap.height / 2),
|
||||||
bitmap,
|
bitmap,
|
||||||
@@ -350,12 +350,12 @@ class MapScreenScene
|
|||||||
end
|
end
|
||||||
|
|
||||||
def helpWindow
|
def helpWindow
|
||||||
helptext = _INTL("A: Add map to canvas") + "\r\n"
|
helptext = _INTL("A: Add map to canvas") + "\n"
|
||||||
helptext += _INTL("DEL: Delete map from canvas") + "\r\n"
|
helptext += _INTL("DEL: Delete map from canvas") + "\n"
|
||||||
helptext += _INTL("S: Go to another map") + "\r\n"
|
helptext += _INTL("S: Go to another map") + "\n"
|
||||||
helptext += _INTL("Click to select a map") + "\r\n"
|
helptext += _INTL("Click to select a map") + "\n"
|
||||||
helptext += _INTL("Double-click: Edit map's metadata") + "\r\n"
|
helptext += _INTL("Double-click: Edit map's metadata") + "\n"
|
||||||
helptext += _INTL("Drag map to move it") + "\r\n"
|
helptext += _INTL("Drag map to move it") + "\n"
|
||||||
helptext += _INTL("Arrow keys/drag canvas: Move around canvas")
|
helptext += _INTL("Arrow keys/drag canvas: Move around canvas")
|
||||||
title = Window_UnformattedTextPokemon.newWithSize(
|
title = Window_UnformattedTextPokemon.newWithSize(
|
||||||
helptext, 0, 0, Graphics.width * 8 / 10, Graphics.height, @viewport
|
helptext, 0, 0, Graphics.width * 8 / 10, Graphics.height, @viewport
|
||||||
|
|||||||
@@ -262,21 +262,21 @@ module Battle::DebugMixin
|
|||||||
return ret if battler.nil?
|
return ret if battler.nil?
|
||||||
# Battler index, name
|
# Battler index, name
|
||||||
ret += sprintf("[%d] %s", battler.index, battler.pbThis)
|
ret += sprintf("[%d] %s", battler.index, battler.pbThis)
|
||||||
ret += "\r\n"
|
ret += "\n"
|
||||||
# Species
|
# Species
|
||||||
ret += _INTL("Species: {1}", GameData::Species.get(battler.species).name)
|
ret += _INTL("Species: {1}", GameData::Species.get(battler.species).name)
|
||||||
ret += "\r\n"
|
ret += "\n"
|
||||||
# Form number
|
# Form number
|
||||||
ret += _INTL("Form: {1}", battler.form)
|
ret += _INTL("Form: {1}", battler.form)
|
||||||
ret += "\r\n"
|
ret += "\n"
|
||||||
# Level, gender, shininess
|
# Level, gender, shininess
|
||||||
ret += _INTL("Level {1}, {2}", battler.level,
|
ret += _INTL("Level {1}, {2}", battler.level,
|
||||||
(battler.pokemon.male?) ? "♂" : (battler.pokemon.female?) ? "♀" : _INTL("genderless"))
|
(battler.pokemon.male?) ? "♂" : (battler.pokemon.female?) ? "♀" : _INTL("genderless"))
|
||||||
ret += ", " + _INTL("shiny") if battler.pokemon.shiny?
|
ret += ", " + _INTL("shiny") if battler.pokemon.shiny?
|
||||||
ret += "\r\n"
|
ret += "\n"
|
||||||
# HP
|
# HP
|
||||||
ret += _INTL("HP: {1}/{2} ({3}%)", battler.hp, battler.totalhp, (100.0 * battler.hp / battler.totalhp).to_i)
|
ret += _INTL("HP: {1}/{2} ({3}%)", battler.hp, battler.totalhp, (100.0 * battler.hp / battler.totalhp).to_i)
|
||||||
ret += "\r\n"
|
ret += "\n"
|
||||||
# Status
|
# Status
|
||||||
ret += _INTL("Status: {1}", GameData::Status.get(battler.status).name)
|
ret += _INTL("Status: {1}", GameData::Status.get(battler.status).name)
|
||||||
case battler.status
|
case battler.status
|
||||||
@@ -287,7 +287,7 @@ module Battle::DebugMixin
|
|||||||
ret += " " + _INTL("(toxic, {1}/16)", battler.effects[PBEffects::Toxic])
|
ret += " " + _INTL("(toxic, {1}/16)", battler.effects[PBEffects::Toxic])
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
ret += "\r\n"
|
ret += "\n"
|
||||||
# Stat stages
|
# Stat stages
|
||||||
stages = []
|
stages = []
|
||||||
GameData::Stat.each_battle do |stat|
|
GameData::Stat.each_battle do |stat|
|
||||||
@@ -299,10 +299,10 @@ module Battle::DebugMixin
|
|||||||
stages.push(stage_text)
|
stages.push(stage_text)
|
||||||
end
|
end
|
||||||
ret += _INTL("Stat stages: {1}", (stages.empty?) ? "-" : stages.join(", "))
|
ret += _INTL("Stat stages: {1}", (stages.empty?) ? "-" : stages.join(", "))
|
||||||
ret += "\r\n"
|
ret += "\n"
|
||||||
# Ability
|
# Ability
|
||||||
ret += _INTL("Ability: {1}", (battler.ability) ? battler.abilityName : "-")
|
ret += _INTL("Ability: {1}", (battler.ability) ? battler.abilityName : "-")
|
||||||
ret += "\r\n"
|
ret += "\n"
|
||||||
# Held item
|
# Held item
|
||||||
ret += _INTL("Item: {1}", (battler.item) ? battler.itemName : "-")
|
ret += _INTL("Item: {1}", (battler.item) ? battler.itemName : "-")
|
||||||
return ret
|
return ret
|
||||||
@@ -314,18 +314,18 @@ module Battle::DebugMixin
|
|||||||
sp_data = pkmn.species_data
|
sp_data = pkmn.species_data
|
||||||
# Name, species
|
# Name, species
|
||||||
ret += sprintf("%s (%s)", pkmn.name, sp_data.name)
|
ret += sprintf("%s (%s)", pkmn.name, sp_data.name)
|
||||||
ret += "\r\n"
|
ret += "\n"
|
||||||
# Form number
|
# Form number
|
||||||
ret += _INTL("Form: {1}", sp_data.form)
|
ret += _INTL("Form: {1}", sp_data.form)
|
||||||
ret += "\r\n"
|
ret += "\n"
|
||||||
# Level, gender, shininess
|
# Level, gender, shininess
|
||||||
ret += _INTL("Level {1}, {2}", pkmn.level,
|
ret += _INTL("Level {1}, {2}", pkmn.level,
|
||||||
(pkmn.male?) ? "♂" : (pkmn.female?) ? "♀" : _INTL("genderless"))
|
(pkmn.male?) ? "♂" : (pkmn.female?) ? "♀" : _INTL("genderless"))
|
||||||
ret += ", " + _INTL("shiny") if pkmn.shiny?
|
ret += ", " + _INTL("shiny") if pkmn.shiny?
|
||||||
ret += "\r\n"
|
ret += "\n"
|
||||||
# HP
|
# HP
|
||||||
ret += _INTL("HP: {1}/{2} ({3}%)", pkmn.hp, pkmn.totalhp, (100.0 * pkmn.hp / pkmn.totalhp).to_i)
|
ret += _INTL("HP: {1}/{2} ({3}%)", pkmn.hp, pkmn.totalhp, (100.0 * pkmn.hp / pkmn.totalhp).to_i)
|
||||||
ret += "\r\n"
|
ret += "\n"
|
||||||
# Status
|
# Status
|
||||||
ret += _INTL("Status: {1}", GameData::Status.get(pkmn.status).name)
|
ret += _INTL("Status: {1}", GameData::Status.get(pkmn.status).name)
|
||||||
case pkmn.status
|
case pkmn.status
|
||||||
@@ -334,10 +334,10 @@ module Battle::DebugMixin
|
|||||||
when :POISON
|
when :POISON
|
||||||
ret += " " + _INTL("(toxic)") if pkmn.statusCount > 0
|
ret += " " + _INTL("(toxic)") if pkmn.statusCount > 0
|
||||||
end
|
end
|
||||||
ret += "\r\n"
|
ret += "\n"
|
||||||
# Ability
|
# Ability
|
||||||
ret += _INTL("Ability: {1}", pkmn.ability&.name || "-")
|
ret += _INTL("Ability: {1}", pkmn.ability&.name || "-")
|
||||||
ret += "\r\n"
|
ret += "\n"
|
||||||
# Held item
|
# Held item
|
||||||
ret += _INTL("Item: {1}", pkmn.item&.name || "-")
|
ret += _INTL("Item: {1}", pkmn.item&.name || "-")
|
||||||
return ret
|
return ret
|
||||||
|
|||||||
@@ -252,10 +252,10 @@ MenuHandlers.add(:battle_debug_menu, :weather, {
|
|||||||
msg = _INTL("Current weather: {1}", weather_data.name || _INTL("Unknown"))
|
msg = _INTL("Current weather: {1}", weather_data.name || _INTL("Unknown"))
|
||||||
if weather_data.id != :None
|
if weather_data.id != :None
|
||||||
if battle.field.weatherDuration > 0
|
if battle.field.weatherDuration > 0
|
||||||
msg += "\r\n"
|
msg += "\n"
|
||||||
msg += _INTL("Duration : {1} more round(s)", battle.field.weatherDuration)
|
msg += _INTL("Duration : {1} more round(s)", battle.field.weatherDuration)
|
||||||
elsif battle.field.weatherDuration < 0
|
elsif battle.field.weatherDuration < 0
|
||||||
msg += "\r\n"
|
msg += "\n"
|
||||||
msg += _INTL("Duration : Infinite")
|
msg += _INTL("Duration : Infinite")
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
@@ -314,10 +314,10 @@ MenuHandlers.add(:battle_debug_menu, :terrain, {
|
|||||||
msg = _INTL("Current terrain: {1}", terrain_data.name || _INTL("Unknown"))
|
msg = _INTL("Current terrain: {1}", terrain_data.name || _INTL("Unknown"))
|
||||||
if terrain_data.id != :None
|
if terrain_data.id != :None
|
||||||
if battle.field.terrainDuration > 0
|
if battle.field.terrainDuration > 0
|
||||||
msg += "\r\n"
|
msg += "\n"
|
||||||
msg += _INTL("Duration : {1} more round(s)", battle.field.terrainDuration)
|
msg += _INTL("Duration : {1} more round(s)", battle.field.terrainDuration)
|
||||||
elsif battle.field.terrainDuration < 0
|
elsif battle.field.terrainDuration < 0
|
||||||
msg += "\r\n"
|
msg += "\n"
|
||||||
msg += _INTL("Duration : Infinite")
|
msg += _INTL("Duration : Infinite")
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
@@ -373,7 +373,7 @@ MenuHandlers.add(:battle_debug_menu, :environment_time, {
|
|||||||
loop do
|
loop do
|
||||||
environment_data = GameData::Environment.try_get(battle.environment)
|
environment_data = GameData::Environment.try_get(battle.environment)
|
||||||
msg = _INTL("Environment: {1}", environment_data.name || _INTL("Unknown"))
|
msg = _INTL("Environment: {1}", environment_data.name || _INTL("Unknown"))
|
||||||
msg += "\r\n"
|
msg += "\n"
|
||||||
msg += _INTL("Time of day: {1}", [_INTL("Day"), _INTL("Evening"), _INTL("Night")][battle.time])
|
msg += _INTL("Time of day: {1}", [_INTL("Day"), _INTL("Evening"), _INTL("Night")][battle.time])
|
||||||
cmd = pbMessage("\\ts[]" + msg, [_INTL("Change environment"),
|
cmd = pbMessage("\\ts[]" + msg, [_INTL("Change environment"),
|
||||||
_INTL("Change time of day")], -1, nil, cmd)
|
_INTL("Change time of day")], -1, nil, cmd)
|
||||||
|
|||||||
@@ -431,7 +431,7 @@ MenuHandlers.add(:battle_pokemon_debug_menu, :set_types, {
|
|||||||
commands.push(_INTL("Extra type: {1}", extra_type_name))
|
commands.push(_INTL("Extra type: {1}", extra_type_name))
|
||||||
types.push(extra_type)
|
types.push(extra_type)
|
||||||
msg = _INTL("Effective types: {1}", battler.pbTypes(true).map { |t| GameData::Type.get(t).name }.join("/"))
|
msg = _INTL("Effective types: {1}", battler.pbTypes(true).map { |t| GameData::Type.get(t).name }.join("/"))
|
||||||
msg += "\r\n" + _INTL("(Change a type to itself to remove it.)")
|
msg += "\n" + _INTL("(Change a type to itself to remove it.)")
|
||||||
cmd = pbMessage("\\ts[]" + msg, commands, -1, nil, cmd)
|
cmd = pbMessage("\\ts[]" + msg, commands, -1, nil, cmd)
|
||||||
break if cmd < 0
|
break if cmd < 0
|
||||||
old_type = types[cmd]
|
old_type = types[cmd]
|
||||||
|
|||||||
@@ -632,7 +632,7 @@ class TrainerBattleLister
|
|||||||
tr_data = GameData::Trainer.get(@ids[index][0], @ids[index][1], @ids[index][2])
|
tr_data = GameData::Trainer.get(@ids[index][0], @ids[index][1], @ids[index][2])
|
||||||
if tr_data
|
if tr_data
|
||||||
tr_data.pokemon.each_with_index do |pkmn, i|
|
tr_data.pokemon.each_with_index do |pkmn, i|
|
||||||
text += "\r\n" if i > 0
|
text += "\n" if i > 0
|
||||||
text += sprintf("%s Lv.%d", GameData::Species.get(pkmn[:species]).real_name, pkmn[:level])
|
text += sprintf("%s Lv.%d", GameData::Species.get(pkmn[:species]).real_name, pkmn[:level])
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -40,12 +40,12 @@ module FileLineData
|
|||||||
def self.linereport
|
def self.linereport
|
||||||
if @section
|
if @section
|
||||||
if @key.nil?
|
if @key.nil?
|
||||||
return _INTL("File {1}, section {2}\r\n{3}", @file, @section, @value) + "\r\n\r\n"
|
return _INTL("File {1}, section {2}\n{3}", @file, @section, @value) + "\n\n"
|
||||||
else
|
else
|
||||||
return _INTL("File {1}, section {2}, key {3}\r\n{4}", @file, @section, @key, @value) + "\r\n\r\n"
|
return _INTL("File {1}, section {2}, key {3}\n{4}", @file, @section, @key, @value) + "\n\n"
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
return _INTL("File {1}, line {2}\r\n{3}", @file, @lineno, @linedata) + "\r\n\r\n"
|
return _INTL("File {1}, line {2}\n{3}", @file, @lineno, @linedata) + "\n\n"
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
@@ -112,11 +112,11 @@ module Compiler
|
|||||||
else
|
else
|
||||||
if sectionname.nil?
|
if sectionname.nil?
|
||||||
FileLineData.setLine(line, lineno)
|
FileLineData.setLine(line, lineno)
|
||||||
raise _INTL("Expected a section at the beginning of the file. This error may also occur if the file was not saved in UTF-8.\r\n{1}", FileLineData.linereport)
|
raise _INTL("Expected a section at the beginning of the file. This error may also occur if the file was not saved in UTF-8.\n{1}", FileLineData.linereport)
|
||||||
end
|
end
|
||||||
if !line[/^\s*(\w+)\s*=\s*(.*)$/]
|
if !line[/^\s*(\w+)\s*=\s*(.*)$/]
|
||||||
FileLineData.setSection(sectionname, nil, line)
|
FileLineData.setSection(sectionname, nil, line)
|
||||||
raise _INTL("Bad line syntax (expected syntax like XXX=YYY)\r\n{1}", FileLineData.linereport)
|
raise _INTL("Bad line syntax (expected syntax like XXX=YYY)\n{1}", FileLineData.linereport)
|
||||||
end
|
end
|
||||||
r1 = $~[1]
|
r1 = $~[1]
|
||||||
r2 = $~[2]
|
r2 = $~[2]
|
||||||
@@ -316,7 +316,7 @@ module Compiler
|
|||||||
end
|
end
|
||||||
str[0, fieldbytes] = ""
|
str[0, fieldbytes] = ""
|
||||||
if !str[/^\s*,/] && !str[/^\s*$/]
|
if !str[/^\s*,/] && !str[/^\s*$/]
|
||||||
raise _INTL("Invalid quoted field (in: {1})\r\n{2}", str, FileLineData.linereport)
|
raise _INTL("Invalid quoted field (in: {1})\n{2}", str, FileLineData.linereport)
|
||||||
end
|
end
|
||||||
str[0, str.length] = $~.post_match
|
str[0, str.length] = $~.post_match
|
||||||
else
|
else
|
||||||
@@ -337,14 +337,14 @@ module Compiler
|
|||||||
field = csvfield!(str)
|
field = csvfield!(str)
|
||||||
return true if field[/^(?:1|TRUE|YES|Y)$/i]
|
return true if field[/^(?:1|TRUE|YES|Y)$/i]
|
||||||
return false if field[/^(?:0|FALSE|NO|N)$/i]
|
return false if field[/^(?:0|FALSE|NO|N)$/i]
|
||||||
raise _INTL("Field {1} is not a Boolean value (true, false, 1, 0)\r\n{2}", field, FileLineData.linereport)
|
raise _INTL("Field {1} is not a Boolean value (true, false, 1, 0)\n{2}", field, FileLineData.linereport)
|
||||||
end
|
end
|
||||||
|
|
||||||
# Unused
|
# Unused
|
||||||
def csvInt!(str, _line = -1)
|
def csvInt!(str, _line = -1)
|
||||||
ret = csvfield!(str)
|
ret = csvfield!(str)
|
||||||
if !ret[/^\-?\d+$/]
|
if !ret[/^\-?\d+$/]
|
||||||
raise _INTL("Field {1} is not an integer\r\n{2}", ret, FileLineData.linereport)
|
raise _INTL("Field {1} is not an integer\n{2}", ret, FileLineData.linereport)
|
||||||
end
|
end
|
||||||
return ret.to_i
|
return ret.to_i
|
||||||
end
|
end
|
||||||
@@ -353,7 +353,7 @@ module Compiler
|
|||||||
def csvPosInt!(str, _line = -1)
|
def csvPosInt!(str, _line = -1)
|
||||||
ret = csvfield!(str)
|
ret = csvfield!(str)
|
||||||
if !ret[/^\d+$/]
|
if !ret[/^\d+$/]
|
||||||
raise _INTL("Field {1} is not a positive integer\r\n{2}", ret, FileLineData.linereport)
|
raise _INTL("Field {1} is not a positive integer\n{2}", ret, FileLineData.linereport)
|
||||||
end
|
end
|
||||||
return ret.to_i
|
return ret.to_i
|
||||||
end
|
end
|
||||||
@@ -361,7 +361,7 @@ module Compiler
|
|||||||
# Unused
|
# Unused
|
||||||
def csvFloat!(str, _line = -1)
|
def csvFloat!(str, _line = -1)
|
||||||
ret = csvfield!(str)
|
ret = csvfield!(str)
|
||||||
return Float(ret) rescue raise _INTL("Field {1} is not a number\r\n{2}", ret, FileLineData.linereport)
|
return Float(ret) rescue raise _INTL("Field {1} is not a number\n{2}", ret, FileLineData.linereport)
|
||||||
end
|
end
|
||||||
|
|
||||||
# Unused
|
# Unused
|
||||||
@@ -385,45 +385,45 @@ module Compiler
|
|||||||
case schema.downcase
|
case schema.downcase
|
||||||
when "i" # Integer
|
when "i" # Integer
|
||||||
if !value[/^\-?\d+$/]
|
if !value[/^\-?\d+$/]
|
||||||
raise _INTL("Field {1} is not an integer\r\n{2}", value, FileLineData.linereport)
|
raise _INTL("Field {1} is not an integer\n{2}", value, FileLineData.linereport)
|
||||||
end
|
end
|
||||||
return value.to_i
|
return value.to_i
|
||||||
when "u" # Positive integer or zero
|
when "u" # Positive integer or zero
|
||||||
if !value[/^\d+$/]
|
if !value[/^\d+$/]
|
||||||
raise _INTL("Field {1} is not a positive integer or 0\r\n{2}", value, FileLineData.linereport)
|
raise _INTL("Field {1} is not a positive integer or 0\n{2}", value, FileLineData.linereport)
|
||||||
end
|
end
|
||||||
return value.to_i
|
return value.to_i
|
||||||
when "v" # Positive integer
|
when "v" # Positive integer
|
||||||
if !value[/^\d+$/]
|
if !value[/^\d+$/]
|
||||||
raise _INTL("Field {1} is not a positive integer\r\n{2}", value, FileLineData.linereport)
|
raise _INTL("Field {1} is not a positive integer\n{2}", value, FileLineData.linereport)
|
||||||
end
|
end
|
||||||
if value.to_i == 0
|
if value.to_i == 0
|
||||||
raise _INTL("Field '{1}' must be greater than 0\r\n{2}", value, FileLineData.linereport)
|
raise _INTL("Field '{1}' must be greater than 0\n{2}", value, FileLineData.linereport)
|
||||||
end
|
end
|
||||||
return value.to_i
|
return value.to_i
|
||||||
when "x" # Hexadecimal number
|
when "x" # Hexadecimal number
|
||||||
if !value[/^[A-F0-9]+$/i]
|
if !value[/^[A-F0-9]+$/i]
|
||||||
raise _INTL("Field '{1}' is not a hexadecimal number\r\n{2}", value, FileLineData.linereport)
|
raise _INTL("Field '{1}' is not a hexadecimal number\n{2}", value, FileLineData.linereport)
|
||||||
end
|
end
|
||||||
return value.hex
|
return value.hex
|
||||||
when "f" # Floating point number
|
when "f" # Floating point number
|
||||||
if !value[/^\-?^\d*\.?\d*$/]
|
if !value[/^\-?^\d*\.?\d*$/]
|
||||||
raise _INTL("Field {1} is not a number\r\n{2}", value, FileLineData.linereport)
|
raise _INTL("Field {1} is not a number\n{2}", value, FileLineData.linereport)
|
||||||
end
|
end
|
||||||
return value.to_f
|
return value.to_f
|
||||||
when "b" # Boolean
|
when "b" # Boolean
|
||||||
return true if value[/^(?:1|TRUE|YES|Y)$/i]
|
return true if value[/^(?:1|TRUE|YES|Y)$/i]
|
||||||
return false if value[/^(?:0|FALSE|NO|N)$/i]
|
return false if value[/^(?:0|FALSE|NO|N)$/i]
|
||||||
raise _INTL("Field {1} is not a Boolean value (true, false, 1, 0)\r\n{2}", value, FileLineData.linereport)
|
raise _INTL("Field {1} is not a Boolean value (true, false, 1, 0)\n{2}", value, FileLineData.linereport)
|
||||||
when "n" # Name
|
when "n" # Name
|
||||||
if !value[/^(?![0-9])\w+$/]
|
if !value[/^(?![0-9])\w+$/]
|
||||||
raise _INTL("Field '{1}' must contain only letters, digits, and\r\nunderscores and can't begin with a number.\r\n{2}", value, FileLineData.linereport)
|
raise _INTL("Field '{1}' must contain only letters, digits, and\nunderscores and can't begin with a number.\n{2}", value, FileLineData.linereport)
|
||||||
end
|
end
|
||||||
when "s" # String
|
when "s" # String
|
||||||
when "q" # Unformatted text
|
when "q" # Unformatted text
|
||||||
when "m" # Symbol
|
when "m" # Symbol
|
||||||
if !value[/^(?![0-9])\w+$/]
|
if !value[/^(?![0-9])\w+$/]
|
||||||
raise _INTL("Field '{1}' must contain only letters, digits, and\r\nunderscores and can't begin with a number.\r\n{2}", value, FileLineData.linereport)
|
raise _INTL("Field '{1}' must contain only letters, digits, and\nunderscores and can't begin with a number.\n{2}", value, FileLineData.linereport)
|
||||||
end
|
end
|
||||||
return value.to_sym
|
return value.to_sym
|
||||||
when "e" # Enumerable
|
when "e" # Enumerable
|
||||||
@@ -440,10 +440,10 @@ module Compiler
|
|||||||
when Module
|
when Module
|
||||||
begin
|
begin
|
||||||
if nil_or_empty?(ret) || !enumer.const_defined?(ret)
|
if nil_or_empty?(ret) || !enumer.const_defined?(ret)
|
||||||
raise _INTL("Undefined value {1} in {2}\r\n{3}", ret, enumer.name, FileLineData.linereport)
|
raise _INTL("Undefined value {1} in {2}\n{3}", ret, enumer.name, FileLineData.linereport)
|
||||||
end
|
end
|
||||||
rescue NameError
|
rescue NameError
|
||||||
raise _INTL("Incorrect value {1} in {2}\r\n{3}", ret, enumer.name, FileLineData.linereport)
|
raise _INTL("Incorrect value {1} in {2}\n{3}", ret, enumer.name, FileLineData.linereport)
|
||||||
end
|
end
|
||||||
return enumer.const_get(ret.to_sym)
|
return enumer.const_get(ret.to_sym)
|
||||||
when Symbol, String
|
when Symbol, String
|
||||||
@@ -451,36 +451,36 @@ module Compiler
|
|||||||
enumer = GameData.const_get(enumer.to_sym)
|
enumer = GameData.const_get(enumer.to_sym)
|
||||||
begin
|
begin
|
||||||
if nil_or_empty?(ret) || !enumer.exists?(ret.to_sym)
|
if nil_or_empty?(ret) || !enumer.exists?(ret.to_sym)
|
||||||
raise _INTL("Undefined value {1} in {2}\r\n{3}", ret, enumer.name, FileLineData.linereport)
|
raise _INTL("Undefined value {1} in {2}\n{3}", ret, enumer.name, FileLineData.linereport)
|
||||||
end
|
end
|
||||||
rescue NameError
|
rescue NameError
|
||||||
raise _INTL("Incorrect value {1} in {2}\r\n{3}", ret, enumer.name, FileLineData.linereport)
|
raise _INTL("Incorrect value {1} in {2}\n{3}", ret, enumer.name, FileLineData.linereport)
|
||||||
end
|
end
|
||||||
return ret.to_sym
|
return ret.to_sym
|
||||||
end
|
end
|
||||||
enumer = Object.const_get(enumer.to_sym)
|
enumer = Object.const_get(enumer.to_sym)
|
||||||
begin
|
begin
|
||||||
if nil_or_empty?(ret) || !enumer.const_defined?(ret)
|
if nil_or_empty?(ret) || !enumer.const_defined?(ret)
|
||||||
raise _INTL("Undefined value {1} in {2}\r\n{3}", ret, enumer.name, FileLineData.linereport)
|
raise _INTL("Undefined value {1} in {2}\n{3}", ret, enumer.name, FileLineData.linereport)
|
||||||
end
|
end
|
||||||
rescue NameError
|
rescue NameError
|
||||||
raise _INTL("Incorrect value {1} in {2}\r\n{3}", ret, enumer.name, FileLineData.linereport)
|
raise _INTL("Incorrect value {1} in {2}\n{3}", ret, enumer.name, FileLineData.linereport)
|
||||||
end
|
end
|
||||||
return enumer.const_get(ret.to_sym)
|
return enumer.const_get(ret.to_sym)
|
||||||
when Array
|
when Array
|
||||||
idx = findIndex(enumer) { |item| ret == item }
|
idx = findIndex(enumer) { |item| ret == item }
|
||||||
if idx < 0
|
if idx < 0
|
||||||
raise _INTL("Undefined value {1} (expected one of: {2})\r\n{3}", ret, enumer.inspect, FileLineData.linereport)
|
raise _INTL("Undefined value {1} (expected one of: {2})\n{3}", ret, enumer.inspect, FileLineData.linereport)
|
||||||
end
|
end
|
||||||
return idx
|
return idx
|
||||||
when Hash
|
when Hash
|
||||||
value = enumer[ret]
|
value = enumer[ret]
|
||||||
if value.nil?
|
if value.nil?
|
||||||
raise _INTL("Undefined value {1} (expected one of: {2})\r\n{3}", ret, enumer.keys.inspect, FileLineData.linereport)
|
raise _INTL("Undefined value {1} (expected one of: {2})\n{3}", ret, enumer.keys.inspect, FileLineData.linereport)
|
||||||
end
|
end
|
||||||
return value
|
return value
|
||||||
end
|
end
|
||||||
raise _INTL("Enumeration not defined\r\n{1}", FileLineData.linereport)
|
raise _INTL("Enumeration not defined\n{1}", FileLineData.linereport)
|
||||||
end
|
end
|
||||||
|
|
||||||
# Unused
|
# Unused
|
||||||
@@ -540,7 +540,7 @@ module Compiler
|
|||||||
if nil_or_empty?(field)
|
if nil_or_empty?(field)
|
||||||
subrecord.push(nil)
|
subrecord.push(nil)
|
||||||
elsif !field[/^\-?\d+$/]
|
elsif !field[/^\-?\d+$/]
|
||||||
raise _INTL("Field {1} is not an integer\r\n{2}", field, FileLineData.linereport)
|
raise _INTL("Field {1} is not an integer\n{2}", field, FileLineData.linereport)
|
||||||
else
|
else
|
||||||
subrecord.push(field.to_i)
|
subrecord.push(field.to_i)
|
||||||
end
|
end
|
||||||
@@ -551,29 +551,29 @@ module Compiler
|
|||||||
if nil_or_empty?(field)
|
if nil_or_empty?(field)
|
||||||
subrecord.push(nil)
|
subrecord.push(nil)
|
||||||
elsif !field[/^\d+$/]
|
elsif !field[/^\d+$/]
|
||||||
raise _INTL("Field '{1}' must be 0 or greater\r\n{2}", field, FileLineData.linereport)
|
raise _INTL("Field '{1}' must be 0 or greater\n{2}", field, FileLineData.linereport)
|
||||||
else
|
else
|
||||||
subrecord.push(field.to_i)
|
subrecord.push(field.to_i)
|
||||||
end
|
end
|
||||||
when "v" # Positive integer
|
when "v" # Positive integer
|
||||||
field = csvPosInt!(rec, lineno)
|
field = csvPosInt!(rec, lineno)
|
||||||
raise _INTL("Field '{1}' must be greater than 0\r\n{2}", field, FileLineData.linereport) if field == 0
|
raise _INTL("Field '{1}' must be greater than 0\n{2}", field, FileLineData.linereport) if field == 0
|
||||||
subrecord.push(field)
|
subrecord.push(field)
|
||||||
when "V" # Optional positive integer
|
when "V" # Optional positive integer
|
||||||
field = csvfield!(rec)
|
field = csvfield!(rec)
|
||||||
if nil_or_empty?(field)
|
if nil_or_empty?(field)
|
||||||
subrecord.push(nil)
|
subrecord.push(nil)
|
||||||
elsif !field[/^\d+$/]
|
elsif !field[/^\d+$/]
|
||||||
raise _INTL("Field '{1}' must be greater than 0\r\n{2}", field, FileLineData.linereport)
|
raise _INTL("Field '{1}' must be greater than 0\n{2}", field, FileLineData.linereport)
|
||||||
elsif field.to_i == 0
|
elsif field.to_i == 0
|
||||||
raise _INTL("Field '{1}' must be greater than 0\r\n{2}", field, FileLineData.linereport)
|
raise _INTL("Field '{1}' must be greater than 0\n{2}", field, FileLineData.linereport)
|
||||||
else
|
else
|
||||||
subrecord.push(field.to_i)
|
subrecord.push(field.to_i)
|
||||||
end
|
end
|
||||||
when "x" # Hexadecimal number
|
when "x" # Hexadecimal number
|
||||||
field = csvfield!(rec)
|
field = csvfield!(rec)
|
||||||
if !field[/^[A-Fa-f0-9]+$/]
|
if !field[/^[A-Fa-f0-9]+$/]
|
||||||
raise _INTL("Field '{1}' is not a hexadecimal number\r\n{2}", field, FileLineData.linereport)
|
raise _INTL("Field '{1}' is not a hexadecimal number\n{2}", field, FileLineData.linereport)
|
||||||
end
|
end
|
||||||
subrecord.push(field.hex)
|
subrecord.push(field.hex)
|
||||||
when "X" # Optional hexadecimal number
|
when "X" # Optional hexadecimal number
|
||||||
@@ -581,7 +581,7 @@ module Compiler
|
|||||||
if nil_or_empty?(field)
|
if nil_or_empty?(field)
|
||||||
subrecord.push(nil)
|
subrecord.push(nil)
|
||||||
elsif !field[/^[A-Fa-f0-9]+$/]
|
elsif !field[/^[A-Fa-f0-9]+$/]
|
||||||
raise _INTL("Field '{1}' is not a hexadecimal number\r\n{2}", field, FileLineData.linereport)
|
raise _INTL("Field '{1}' is not a hexadecimal number\n{2}", field, FileLineData.linereport)
|
||||||
else
|
else
|
||||||
subrecord.push(field.hex)
|
subrecord.push(field.hex)
|
||||||
end
|
end
|
||||||
@@ -592,7 +592,7 @@ module Compiler
|
|||||||
if nil_or_empty?(field)
|
if nil_or_empty?(field)
|
||||||
subrecord.push(nil)
|
subrecord.push(nil)
|
||||||
elsif !field[/^\-?^\d*\.?\d*$/]
|
elsif !field[/^\-?^\d*\.?\d*$/]
|
||||||
raise _INTL("Field {1} is not a floating point number\r\n{2}", field, FileLineData.linereport)
|
raise _INTL("Field {1} is not a floating point number\n{2}", field, FileLineData.linereport)
|
||||||
else
|
else
|
||||||
subrecord.push(field.to_f)
|
subrecord.push(field.to_f)
|
||||||
end
|
end
|
||||||
@@ -610,7 +610,7 @@ module Compiler
|
|||||||
when "n" # Name
|
when "n" # Name
|
||||||
field = csvfield!(rec)
|
field = csvfield!(rec)
|
||||||
if !field[/^(?![0-9])\w+$/]
|
if !field[/^(?![0-9])\w+$/]
|
||||||
raise _INTL("Field '{1}' must contain only letters, digits, and\r\nunderscores and can't begin with a number.\r\n{2}", field, FileLineData.linereport)
|
raise _INTL("Field '{1}' must contain only letters, digits, and\nunderscores and can't begin with a number.\n{2}", field, FileLineData.linereport)
|
||||||
end
|
end
|
||||||
subrecord.push(field)
|
subrecord.push(field)
|
||||||
when "N" # Optional name
|
when "N" # Optional name
|
||||||
@@ -618,7 +618,7 @@ module Compiler
|
|||||||
if nil_or_empty?(field)
|
if nil_or_empty?(field)
|
||||||
subrecord.push(nil)
|
subrecord.push(nil)
|
||||||
elsif !field[/^(?![0-9])\w+$/]
|
elsif !field[/^(?![0-9])\w+$/]
|
||||||
raise _INTL("Field '{1}' must contain only letters, digits, and\r\nunderscores and can't begin with a number.\r\n{2}", field, FileLineData.linereport)
|
raise _INTL("Field '{1}' must contain only letters, digits, and\nunderscores and can't begin with a number.\n{2}", field, FileLineData.linereport)
|
||||||
else
|
else
|
||||||
subrecord.push(field)
|
subrecord.push(field)
|
||||||
end
|
end
|
||||||
@@ -640,7 +640,7 @@ module Compiler
|
|||||||
when "m" # Symbol
|
when "m" # Symbol
|
||||||
field = csvfield!(rec)
|
field = csvfield!(rec)
|
||||||
if !field[/^(?![0-9])\w+$/]
|
if !field[/^(?![0-9])\w+$/]
|
||||||
raise _INTL("Field '{1}' must contain only letters, digits, and\r\nunderscores and can't begin with a number.\r\n{2}", field, FileLineData.linereport)
|
raise _INTL("Field '{1}' must contain only letters, digits, and\nunderscores and can't begin with a number.\n{2}", field, FileLineData.linereport)
|
||||||
end
|
end
|
||||||
subrecord.push(field.to_sym)
|
subrecord.push(field.to_sym)
|
||||||
when "M" # Optional symbol
|
when "M" # Optional symbol
|
||||||
@@ -648,7 +648,7 @@ module Compiler
|
|||||||
if nil_or_empty?(field)
|
if nil_or_empty?(field)
|
||||||
subrecord.push(nil)
|
subrecord.push(nil)
|
||||||
elsif !field[/^(?![0-9])\w+$/]
|
elsif !field[/^(?![0-9])\w+$/]
|
||||||
raise _INTL("Field '{1}' must contain only letters, digits, and\r\nunderscores and can't begin with a number.\r\n{2}", field, FileLineData.linereport)
|
raise _INTL("Field '{1}' must contain only letters, digits, and\nunderscores and can't begin with a number.\n{2}", field, FileLineData.linereport)
|
||||||
else
|
else
|
||||||
subrecord.push(field.to_sym)
|
subrecord.push(field.to_sym)
|
||||||
end
|
end
|
||||||
@@ -851,7 +851,7 @@ module Compiler
|
|||||||
clonitem.sub!(/\s*$/, "")
|
clonitem.sub!(/\s*$/, "")
|
||||||
itm = GameData::Item.try_get(clonitem)
|
itm = GameData::Item.try_get(clonitem)
|
||||||
if !itm
|
if !itm
|
||||||
raise _INTL("Undefined item constant name: {1}\r\nMake sure the item is defined in PBS/items.txt.\r\n{2}", item, FileLineData.linereport)
|
raise _INTL("Undefined item constant name: {1}\nMake sure the item is defined in PBS/items.txt.\n{2}", item, FileLineData.linereport)
|
||||||
end
|
end
|
||||||
return itm.id
|
return itm.id
|
||||||
end
|
end
|
||||||
@@ -864,7 +864,7 @@ module Compiler
|
|||||||
clonspecies = "NIDORANfE" if clonspecies == "NIDORANFE"
|
clonspecies = "NIDORANfE" if clonspecies == "NIDORANFE"
|
||||||
spec = GameData::Species.try_get(clonspecies)
|
spec = GameData::Species.try_get(clonspecies)
|
||||||
if !spec
|
if !spec
|
||||||
raise _INTL("Undefined species constant name: {1}\r\nMake sure the species is defined in PBS/pokemon.txt.\r\n{2}", species, FileLineData.linereport)
|
raise _INTL("Undefined species constant name: {1}\nMake sure the species is defined in PBS/pokemon.txt.\n{2}", species, FileLineData.linereport)
|
||||||
end
|
end
|
||||||
return spec.id
|
return spec.id
|
||||||
end
|
end
|
||||||
@@ -876,7 +876,7 @@ module Compiler
|
|||||||
mov = GameData::Move.try_get(clonmove)
|
mov = GameData::Move.try_get(clonmove)
|
||||||
if !mov
|
if !mov
|
||||||
return nil if skip_unknown
|
return nil if skip_unknown
|
||||||
raise _INTL("Undefined move constant name: {1}\r\nMake sure the move is defined in PBS/moves.txt.\r\n{2}", move, FileLineData.linereport)
|
raise _INTL("Undefined move constant name: {1}\nMake sure the move is defined in PBS/moves.txt.\n{2}", move, FileLineData.linereport)
|
||||||
end
|
end
|
||||||
return mov.id
|
return mov.id
|
||||||
end
|
end
|
||||||
@@ -888,7 +888,7 @@ module Compiler
|
|||||||
clonnature.sub!(/\s*$/, "")
|
clonnature.sub!(/\s*$/, "")
|
||||||
nat = GameData::Nature.try_get(clonnature)
|
nat = GameData::Nature.try_get(clonnature)
|
||||||
if !nat
|
if !nat
|
||||||
raise _INTL("Undefined nature constant name: {1}\r\nMake sure the nature is defined in the scripts.\r\n{2}", nature, FileLineData.linereport)
|
raise _INTL("Undefined nature constant name: {1}\nMake sure the nature is defined in the scripts.\n{2}", nature, FileLineData.linereport)
|
||||||
end
|
end
|
||||||
return nat.id
|
return nat.id
|
||||||
end
|
end
|
||||||
@@ -900,7 +900,7 @@ module Compiler
|
|||||||
clontype.sub!(/\s*$/, "")
|
clontype.sub!(/\s*$/, "")
|
||||||
typ = GameData::TrainerType.try_get(clontype)
|
typ = GameData::TrainerType.try_get(clontype)
|
||||||
if !typ
|
if !typ
|
||||||
raise _INTL("Undefined Trainer type constant name: {1}\r\nMake sure the trainer type is defined in PBS/trainer_types.txt.\r\n{2}", type, FileLineData.linereport)
|
raise _INTL("Undefined Trainer type constant name: {1}\nMake sure the trainer type is defined in PBS/trainer_types.txt.\n{2}", type, FileLineData.linereport)
|
||||||
end
|
end
|
||||||
return typ.id
|
return typ.id
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -54,7 +54,7 @@ module Compiler
|
|||||||
# Validate and modify the compiled data
|
# Validate and modify the compiled data
|
||||||
yield false, data_hash if block_given?
|
yield false, data_hash if block_given?
|
||||||
if game_data.exists?(data_hash[:id])
|
if game_data.exists?(data_hash[:id])
|
||||||
raise _INTL("Section name '{1}' is used twice.\r\n{2}", data_hash[:id], FileLineData.linereport)
|
raise _INTL("Section name '{1}' is used twice.\n{2}", data_hash[:id], FileLineData.linereport)
|
||||||
end
|
end
|
||||||
# Add section's data to records
|
# Add section's data to records
|
||||||
game_data.register(data_hash)
|
game_data.register(data_hash)
|
||||||
@@ -116,19 +116,19 @@ module Compiler
|
|||||||
FileLineData.setLine(line, lineno)
|
FileLineData.setLine(line, lineno)
|
||||||
record = get_csv_record(line, schema)
|
record = get_csv_record(line, schema)
|
||||||
if !pbRgssExists?(sprintf("Data/Map%03d.rxdata", record[0]))
|
if !pbRgssExists?(sprintf("Data/Map%03d.rxdata", record[0]))
|
||||||
print _INTL("Warning: Map {1}, as mentioned in the map connection data, was not found.\r\n{2}", record[0], FileLineData.linereport)
|
print _INTL("Warning: Map {1}, as mentioned in the map connection data, was not found.\n{2}", record[0], FileLineData.linereport)
|
||||||
elsif !pbRgssExists?(sprintf("Data/Map%03d.rxdata", record[3]))
|
elsif !pbRgssExists?(sprintf("Data/Map%03d.rxdata", record[3]))
|
||||||
print _INTL("Warning: Map {1}, as mentioned in the map connection data, was not found.\r\n{2}", record[3], FileLineData.linereport)
|
print _INTL("Warning: Map {1}, as mentioned in the map connection data, was not found.\n{2}", record[3], FileLineData.linereport)
|
||||||
end
|
end
|
||||||
case record[1]
|
case record[1]
|
||||||
when "N"
|
when "N"
|
||||||
raise _INTL("North side of first map must connect with south side of second map\r\n{1}", FileLineData.linereport) if record[4] != "S"
|
raise _INTL("North side of first map must connect with south side of second map\n{1}", FileLineData.linereport) if record[4] != "S"
|
||||||
when "S"
|
when "S"
|
||||||
raise _INTL("South side of first map must connect with north side of second map\r\n{1}", FileLineData.linereport) if record[4] != "N"
|
raise _INTL("South side of first map must connect with north side of second map\n{1}", FileLineData.linereport) if record[4] != "N"
|
||||||
when "E"
|
when "E"
|
||||||
raise _INTL("East side of first map must connect with west side of second map\r\n{1}", FileLineData.linereport) if record[4] != "W"
|
raise _INTL("East side of first map must connect with west side of second map\n{1}", FileLineData.linereport) if record[4] != "W"
|
||||||
when "W"
|
when "W"
|
||||||
raise _INTL("West side of first map must connect with east side of second map\r\n{1}", FileLineData.linereport) if record[4] != "E"
|
raise _INTL("West side of first map must connect with east side of second map\n{1}", FileLineData.linereport) if record[4] != "E"
|
||||||
end
|
end
|
||||||
records.push(record)
|
records.push(record)
|
||||||
end
|
end
|
||||||
@@ -210,10 +210,10 @@ module Compiler
|
|||||||
|
|
||||||
def validate_compiled_move(hash)
|
def validate_compiled_move(hash)
|
||||||
if (hash[:category] || 2) == 2 && (hash[:power] || 0) != 0
|
if (hash[:category] || 2) == 2 && (hash[:power] || 0) != 0
|
||||||
raise _INTL("Move {1} is defined as a Status move with a non-zero base damage.\r\n{2}",
|
raise _INTL("Move {1} is defined as a Status move with a non-zero base damage.\n{2}",
|
||||||
hash[:real_name], FileLineData.linereport)
|
hash[:real_name], FileLineData.linereport)
|
||||||
elsif (hash[:category] || 2) != 2 && (hash[:power] || 0) == 0
|
elsif (hash[:category] || 2) != 2 && (hash[:power] || 0) == 0
|
||||||
print _INTL("Warning: Move {1} is defined as Physical or Special but has a base damage of 0. Changing it to a Status move.\r\n{2}",
|
print _INTL("Warning: Move {1} is defined as Physical or Special but has a base damage of 0. Changing it to a Status move.\n{2}",
|
||||||
hash[:real_name], FileLineData.linereport)
|
hash[:real_name], FileLineData.linereport)
|
||||||
hash[:category] = 2
|
hash[:category] = 2
|
||||||
end
|
end
|
||||||
@@ -424,7 +424,7 @@ module Compiler
|
|||||||
# Validate and modify the compiled data
|
# Validate and modify the compiled data
|
||||||
validate_compiled_pokemon_form(data_hash)
|
validate_compiled_pokemon_form(data_hash)
|
||||||
if GameData::Species.exists?(data_hash[:id])
|
if GameData::Species.exists?(data_hash[:id])
|
||||||
raise _INTL("Section name '{1}' is used twice.\r\n{2}", data_hash[:id], FileLineData.linereport)
|
raise _INTL("Section name '{1}' is used twice.\n{2}", data_hash[:id], FileLineData.linereport)
|
||||||
end
|
end
|
||||||
# Add section's data to records
|
# Add section's data to records
|
||||||
GameData::Species.register(data_hash)
|
GameData::Species.register(data_hash)
|
||||||
@@ -443,9 +443,9 @@ module Compiler
|
|||||||
hash[:form] = hash[:id][1]
|
hash[:form] = hash[:id][1]
|
||||||
hash[:id] = sprintf("%s_%d", hash[:species].to_s, hash[:form]).to_sym
|
hash[:id] = sprintf("%s_%d", hash[:species].to_s, hash[:form]).to_sym
|
||||||
if !GameData::Species.exists?(hash[:species])
|
if !GameData::Species.exists?(hash[:species])
|
||||||
raise _INTL("Undefined species ID '{1}'.\r\n{3}", hash[:species], FileLineData.linereport)
|
raise _INTL("Undefined species ID '{1}'.\n{3}", hash[:species], FileLineData.linereport)
|
||||||
elsif GameData::Species.exists?(hash[:id])
|
elsif GameData::Species.exists?(hash[:id])
|
||||||
raise _INTL("Form {1} for species ID {2} is defined twice.\r\n{3}", hash[:form], hash[:species], FileLineData.linereport)
|
raise _INTL("Form {1} for species ID {2} is defined twice.\n{3}", hash[:form], hash[:species], FileLineData.linereport)
|
||||||
end
|
end
|
||||||
# Perform the same validations on this form as for a regular species
|
# Perform the same validations on this form as for a regular species
|
||||||
validate_compiled_pokemon(hash)
|
validate_compiled_pokemon(hash)
|
||||||
@@ -477,6 +477,20 @@ module Compiler
|
|||||||
end
|
end
|
||||||
|
|
||||||
def validate_all_compiled_pokemon_forms
|
def validate_all_compiled_pokemon_forms
|
||||||
|
# Enumerate all evolution parameters (this couldn't be done earlier)
|
||||||
|
GameData::Species.each do |species|
|
||||||
|
FileLineData.setSection(species.id.to_s, "Evolutions", nil) # For error reporting
|
||||||
|
species.evolutions.each do |evo|
|
||||||
|
param_type = GameData::Evolution.get(evo[1]).parameter
|
||||||
|
if param_type.nil?
|
||||||
|
evo[2] = nil
|
||||||
|
elsif param_type == Integer
|
||||||
|
evo[2] = cast_csv_value(evo[2], "u") if evo[2].is_a?(String)
|
||||||
|
elsif param_type != String
|
||||||
|
evo[2] = cast_csv_value(evo[2], "e", param_type) if evo[2].is_a?(String)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
# Add prevolution "evolution" entry for all evolved species
|
# Add prevolution "evolution" entry for all evolved species
|
||||||
all_evos = {}
|
all_evos = {}
|
||||||
GameData::Species.each do |species| # Build a hash of prevolutions for each species
|
GameData::Species.each do |species| # Build a hash of prevolutions for each species
|
||||||
@@ -573,11 +587,11 @@ module Compiler
|
|||||||
if line[/^\s*\[\s*(\d+)\s*\]\s*$/]
|
if line[/^\s*\[\s*(\d+)\s*\]\s*$/]
|
||||||
section = $~[1].to_i
|
section = $~[1].to_i
|
||||||
if dex_lists[section]
|
if dex_lists[section]
|
||||||
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.\n{2}", section, FileLineData.linereport)
|
||||||
end
|
end
|
||||||
dex_lists[section] = []
|
dex_lists[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.\n{1}", FileLineData.linereport) if !section
|
||||||
species_list = line.split(",")
|
species_list = line.split(",")
|
||||||
species_list.each do |species|
|
species_list.each do |species|
|
||||||
next if !species || species.empty?
|
next if !species || species.empty?
|
||||||
@@ -594,7 +608,7 @@ module Compiler
|
|||||||
next if list == unique_list
|
next if list == unique_list
|
||||||
list.each_with_index do |s, i|
|
list.each_with_index do |s, i|
|
||||||
next if unique_list[i] == s
|
next if unique_list[i] == s
|
||||||
raise _INTL("Dex list number {1} has species {2} listed twice.\r\n{3}", index, s, FileLineData.linereport)
|
raise _INTL("Dex list number {1} has species {2} listed twice.\n{3}", index, s, FileLineData.linereport)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
# Save all data
|
# Save all data
|
||||||
@@ -646,17 +660,17 @@ module Compiler
|
|||||||
if current_type && line[/^\d+,/] # Species line
|
if current_type && line[/^\d+,/] # Species line
|
||||||
values = line.split(",").collect! { |v| v.strip }
|
values = line.split(",").collect! { |v| v.strip }
|
||||||
if !values || values.length < 3
|
if !values || values.length < 3
|
||||||
raise _INTL("Expected a species entry line for encounter type {1} for map '{2}', got \"{3}\" instead.\r\n{4}",
|
raise _INTL("Expected a species entry line for encounter type {1} for map '{2}', got \"{3}\" instead.\n{4}",
|
||||||
GameData::EncounterType.get(current_type).real_name, encounter_hash[:map], line, FileLineData.linereport)
|
GameData::EncounterType.get(current_type).real_name, encounter_hash[:map], line, FileLineData.linereport)
|
||||||
end
|
end
|
||||||
values = get_csv_record(line, [nil, "vevV", nil, :Species])
|
values = get_csv_record(line, [nil, "vevV", nil, :Species])
|
||||||
values[3] = values[2] if !values[3]
|
values[3] = values[2] if !values[3]
|
||||||
if values[2] > max_level
|
if values[2] > max_level
|
||||||
raise _INTL("Level number {1} is not valid (max. {2}).\r\n{3}", values[2], max_level, FileLineData.linereport)
|
raise _INTL("Level number {1} is not valid (max. {2}).\n{3}", values[2], max_level, FileLineData.linereport)
|
||||||
elsif values[3] > max_level
|
elsif values[3] > max_level
|
||||||
raise _INTL("Level number {1} is not valid (max. {2}).\r\n{3}", values[3], max_level, FileLineData.linereport)
|
raise _INTL("Level number {1} is not valid (max. {2}).\n{3}", values[3], max_level, FileLineData.linereport)
|
||||||
elsif values[2] > values[3]
|
elsif values[2] > values[3]
|
||||||
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}\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
|
elsif line[/^\[\s*(.+)\s*\]$/] # Map ID line
|
||||||
@@ -685,7 +699,7 @@ module Compiler
|
|||||||
# Raise an error if a map/version combo is used twice
|
# Raise an error if a map/version combo is used twice
|
||||||
key = sprintf("%s_%d", map_number, map_version).to_sym
|
key = sprintf("%s_%d", map_number, map_version).to_sym
|
||||||
if GameData::Encounter::DATA[key]
|
if GameData::Encounter::DATA[key]
|
||||||
raise _INTL("Encounters for map '{1}' are defined twice.\r\n{2}", map_number, FileLineData.linereport)
|
raise _INTL("Encounters for map '{1}' are defined twice.\n{2}", map_number, FileLineData.linereport)
|
||||||
end
|
end
|
||||||
step_chances = {}
|
step_chances = {}
|
||||||
# Construct encounter hash
|
# Construct encounter hash
|
||||||
@@ -699,7 +713,7 @@ module Compiler
|
|||||||
}
|
}
|
||||||
current_type = nil
|
current_type = nil
|
||||||
elsif !encounter_hash # File began with something other than a map ID line
|
elsif !encounter_hash # File began with something other than a map ID line
|
||||||
raise _INTL("Expected a map number, got \"{1}\" instead.\r\n{2}", line, FileLineData.linereport)
|
raise _INTL("Expected a map number, got \"{1}\" instead.\n{2}", line, FileLineData.linereport)
|
||||||
else
|
else
|
||||||
# Check if line is an encounter method name or not
|
# Check if line is an encounter method name or not
|
||||||
values = line.split(",").collect! { |v| v.strip }
|
values = line.split(",").collect! { |v| v.strip }
|
||||||
@@ -709,7 +723,7 @@ module Compiler
|
|||||||
step_chances[current_type] ||= GameData::EncounterType.get(current_type).trigger_chance
|
step_chances[current_type] ||= GameData::EncounterType.get(current_type).trigger_chance
|
||||||
encounter_hash[:types][current_type] = []
|
encounter_hash[:types][current_type] = []
|
||||||
else
|
else
|
||||||
raise _INTL("Undefined encounter type \"{1}\" for map '{2}'.\r\n{3}",
|
raise _INTL("Undefined encounter type \"{1}\" for map '{2}'.\n{3}",
|
||||||
line, encounter_hash[:map], FileLineData.linereport)
|
line, encounter_hash[:map], FileLineData.linereport)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
@@ -800,7 +814,7 @@ module Compiler
|
|||||||
elsif line[/^\s*(\w+)\s*=\s*(.*)$/]
|
elsif line[/^\s*(\w+)\s*=\s*(.*)$/]
|
||||||
# XXX=YYY lines
|
# XXX=YYY lines
|
||||||
if !data_hash
|
if !data_hash
|
||||||
raise _INTL("Expected a section at the beginning of the file.\r\n{1}", FileLineData.linereport)
|
raise _INTL("Expected a section at the beginning of the file.\n{1}", FileLineData.linereport)
|
||||||
end
|
end
|
||||||
key = $~[1]
|
key = $~[1]
|
||||||
if schema[key] # Property of the trainer
|
if schema[key] # Property of the trainer
|
||||||
@@ -816,7 +830,7 @@ module Compiler
|
|||||||
end
|
end
|
||||||
elsif sub_schema[key] # Property of a Pokémon
|
elsif sub_schema[key] # Property of a Pokémon
|
||||||
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!\n{1}", FileLineData.linereport)
|
||||||
end
|
end
|
||||||
current_pkmn[sub_schema[key][0]] = get_csv_record($~[2], sub_schema[key])
|
current_pkmn[sub_schema[key][0]] = get_csv_record($~[2], sub_schema[key])
|
||||||
end
|
end
|
||||||
@@ -843,18 +857,18 @@ module Compiler
|
|||||||
hash[:version] = hash[:id][2]
|
hash[:version] = hash[:id][2]
|
||||||
# Ensure the trainer has at least one Pokémon
|
# Ensure the trainer has at least one Pokémon
|
||||||
if hash[:pokemon].empty?
|
if hash[:pokemon].empty?
|
||||||
raise _INTL("Trainer with ID {1} has no Pokémon.\r\n{2}", hash[:id], FileLineData.linereport)
|
raise _INTL("Trainer with ID {1} has no Pokémon.\n{2}", hash[:id], FileLineData.linereport)
|
||||||
end
|
end
|
||||||
max_level = GameData::GrowthRate.max_level
|
max_level = GameData::GrowthRate.max_level
|
||||||
hash[:pokemon].each do |pkmn|
|
hash[:pokemon].each do |pkmn|
|
||||||
# Ensure valid level
|
# Ensure valid level
|
||||||
if pkmn[:level] > max_level
|
if pkmn[:level] > max_level
|
||||||
raise _INTL("Invalid Pokémon level {1} (must be 1-{2}).\r\n{3}",
|
raise _INTL("Invalid Pokémon level {1} (must be 1-{2}).\n{3}",
|
||||||
pkmn[:level], max_level, FileLineData.linereport)
|
pkmn[:level], max_level, FileLineData.linereport)
|
||||||
end
|
end
|
||||||
# Ensure valid name length
|
# Ensure valid name length
|
||||||
if pkmn[:real_name] && pkmn[:real_name].length > Pokemon::MAX_NAME_SIZE
|
if pkmn[:real_name] && pkmn[:real_name].length > Pokemon::MAX_NAME_SIZE
|
||||||
raise _INTL("Invalid Pokémon nickname: {1} (must be 1-{2} characters).\r\n{3}",
|
raise _INTL("Invalid Pokémon nickname: {1} (must be 1-{2} characters).\n{3}",
|
||||||
pkmn[:real_name], Pokemon::MAX_NAME_SIZE, FileLineData.linereport)
|
pkmn[:real_name], Pokemon::MAX_NAME_SIZE, FileLineData.linereport)
|
||||||
end
|
end
|
||||||
# Ensure no duplicate moves
|
# Ensure no duplicate moves
|
||||||
@@ -866,7 +880,7 @@ module Compiler
|
|||||||
next if s.pbs_order < 0
|
next if s.pbs_order < 0
|
||||||
iv_hash[s.id] = pkmn[:iv][s.pbs_order] || pkmn[:iv][0]
|
iv_hash[s.id] = pkmn[:iv][s.pbs_order] || pkmn[:iv][0]
|
||||||
if iv_hash[s.id] > Pokemon::IV_STAT_LIMIT
|
if iv_hash[s.id] > Pokemon::IV_STAT_LIMIT
|
||||||
raise _INTL("Invalid IV: {1} (must be 0-{2}).\r\n{3}",
|
raise _INTL("Invalid IV: {1} (must be 0-{2}).\n{3}",
|
||||||
iv_hash[s.id], Pokemon::IV_STAT_LIMIT, FileLineData.linereport)
|
iv_hash[s.id], Pokemon::IV_STAT_LIMIT, FileLineData.linereport)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
@@ -881,26 +895,26 @@ module Compiler
|
|||||||
ev_hash[s.id] = pkmn[:ev][s.pbs_order] || pkmn[:ev][0]
|
ev_hash[s.id] = pkmn[:ev][s.pbs_order] || pkmn[:ev][0]
|
||||||
ev_total += ev_hash[s.id]
|
ev_total += ev_hash[s.id]
|
||||||
if ev_hash[s.id] > Pokemon::EV_STAT_LIMIT
|
if ev_hash[s.id] > Pokemon::EV_STAT_LIMIT
|
||||||
raise _INTL("Invalid EV: {1} (must be 0-{2}).\r\n{3}",
|
raise _INTL("Invalid EV: {1} (must be 0-{2}).\n{3}",
|
||||||
ev_hash[s.id], Pokemon::EV_STAT_LIMIT, FileLineData.linereport)
|
ev_hash[s.id], Pokemon::EV_STAT_LIMIT, FileLineData.linereport)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
pkmn[:ev] = ev_hash
|
pkmn[:ev] = ev_hash
|
||||||
if ev_total > Pokemon::EV_LIMIT
|
if ev_total > Pokemon::EV_LIMIT
|
||||||
raise _INTL("Invalid EV set (must sum to {1} or less).\r\n{2}",
|
raise _INTL("Invalid EV set (must sum to {1} or less).\n{2}",
|
||||||
Pokemon::EV_LIMIT, FileLineData.linereport)
|
Pokemon::EV_LIMIT, FileLineData.linereport)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
# Ensure valid happiness
|
# Ensure valid happiness
|
||||||
if pkmn[:happiness]
|
if pkmn[:happiness]
|
||||||
if pkmn[:happiness] > 255
|
if pkmn[:happiness] > 255
|
||||||
raise _INTL("Bad happiness: {1} (must be 0-255).\r\n{2}", pkmn[:happiness], FileLineData.linereport)
|
raise _INTL("Bad happiness: {1} (must be 0-255).\n{2}", pkmn[:happiness], FileLineData.linereport)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
# Ensure valid Poké Ball
|
# Ensure valid Poké Ball
|
||||||
if pkmn[:poke_ball]
|
if pkmn[:poke_ball]
|
||||||
if !GameData::Item.get(pkmn[:poke_ball]).is_poke_ball?
|
if !GameData::Item.get(pkmn[:poke_ball]).is_poke_ball?
|
||||||
raise _INTL("Value {1} isn't a defined Poké Ball.\r\n{2}", pkmn[:poke_ball], FileLineData.linereport)
|
raise _INTL("Value {1} isn't a defined Poké Ball.\n{2}", pkmn[:poke_ball], FileLineData.linereport)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
@@ -965,10 +979,10 @@ module Compiler
|
|||||||
rsection[schema[0]] = record
|
rsection[schema[0]] = record
|
||||||
end
|
end
|
||||||
if !rsection[0]
|
if !rsection[0]
|
||||||
raise _INTL("No trainer data file given in section {1}.\r\n{2}", name, FileLineData.linereport)
|
raise _INTL("No trainer data file given in section {1}.\n{2}", name, FileLineData.linereport)
|
||||||
end
|
end
|
||||||
if !rsection[1]
|
if !rsection[1]
|
||||||
raise _INTL("No trainer data file given in section {1}.\r\n{2}", name, FileLineData.linereport)
|
raise _INTL("No trainer data file given in section {1}.\n{2}", name, FileLineData.linereport)
|
||||||
end
|
end
|
||||||
rsection[3] = rsection[0]
|
rsection[3] = rsection[0]
|
||||||
rsection[4] = rsection[1]
|
rsection[4] = rsection[1]
|
||||||
@@ -1097,12 +1111,12 @@ module Compiler
|
|||||||
if data_hash[:id] == 0
|
if data_hash[:id] == 0
|
||||||
validate_compiled_global_metadata(data_hash)
|
validate_compiled_global_metadata(data_hash)
|
||||||
if GameData::Metadata.exists?(data_hash[:id])
|
if GameData::Metadata.exists?(data_hash[:id])
|
||||||
raise _INTL("Global metadata ID '{1}' is used twice.\r\n{2}", data_hash[:id], FileLineData.linereport)
|
raise _INTL("Global metadata ID '{1}' is used twice.\n{2}", data_hash[:id], FileLineData.linereport)
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
validate_compiled_player_metadata(data_hash)
|
validate_compiled_player_metadata(data_hash)
|
||||||
if GameData::PlayerMetadata.exists?(data_hash[:id])
|
if GameData::PlayerMetadata.exists?(data_hash[:id])
|
||||||
raise _INTL("Player metadata ID '{1}' is used twice.\r\n{2}", data_hash[:id], FileLineData.linereport)
|
raise _INTL("Player metadata ID '{1}' is used twice.\n{2}", data_hash[:id], FileLineData.linereport)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
# Add section's data to records
|
# Add section's data to records
|
||||||
@@ -1123,7 +1137,7 @@ module Compiler
|
|||||||
|
|
||||||
def validate_compiled_global_metadata(hash)
|
def validate_compiled_global_metadata(hash)
|
||||||
if hash[:home].nil?
|
if hash[:home].nil?
|
||||||
raise _INTL("The entry 'Home' is required in metadata.txt section 0.\r\n{1}", FileLineData.linereport)
|
raise _INTL("The entry 'Home' is required in metadata.txt section 0.\n{1}", FileLineData.linereport)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
@@ -1134,11 +1148,11 @@ module Compiler
|
|||||||
def validate_all_compiled_metadata
|
def validate_all_compiled_metadata
|
||||||
# Ensure global metadata is defined
|
# Ensure global metadata is defined
|
||||||
if !GameData::Metadata.exists?(0)
|
if !GameData::Metadata.exists?(0)
|
||||||
raise _INTL("Global metadata is not defined in metadata.txt but should be.\r\n{1}", FileLineData.linereport)
|
raise _INTL("Global metadata is not defined in metadata.txt but should be.\n{1}", FileLineData.linereport)
|
||||||
end
|
end
|
||||||
# Ensure player character 1's metadata is defined
|
# Ensure player character 1's metadata is defined
|
||||||
if !GameData::PlayerMetadata.exists?(1)
|
if !GameData::PlayerMetadata.exists?(1)
|
||||||
raise _INTL("Metadata for player character 1 is not defined in metadata.txt but should be.\r\n{1}", FileLineData.linereport)
|
raise _INTL("Metadata for player character 1 is not defined in metadata.txt but should be.\n{1}", FileLineData.linereport)
|
||||||
end
|
end
|
||||||
# Get storage creator's name for translating
|
# Get storage creator's name for translating
|
||||||
storage_creator = [GameData::Metadata.get.real_storage_creator]
|
storage_creator = [GameData::Metadata.get.real_storage_creator]
|
||||||
@@ -1157,7 +1171,7 @@ module Compiler
|
|||||||
def validate_compiled_map_metadata(hash)
|
def validate_compiled_map_metadata(hash)
|
||||||
# Give the map its RMXP map name if it doesn't define its own
|
# Give the map its RMXP map name if it doesn't define its own
|
||||||
if nil_or_empty?(hash[:real_name])
|
if nil_or_empty?(hash[:real_name])
|
||||||
hash[:real_name] = pbLoadMapInfos[id].name
|
hash[:real_name] = pbLoadMapInfos[hash[:id]].name
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
@@ -1202,7 +1216,7 @@ module Compiler
|
|||||||
hash[:id] = sprintf("%s_%d", hash[:area].to_s, hash[:version]).to_sym
|
hash[:id] = sprintf("%s_%d", hash[:area].to_s, hash[:version]).to_sym
|
||||||
end
|
end
|
||||||
if GameData::DungeonParameters.exists?(hash[:id])
|
if GameData::DungeonParameters.exists?(hash[:id])
|
||||||
raise _INTL("Version {1} of dungeon area {2} is defined twice.\r\n{3}", hash[:version], hash[:area], FileLineData.linereport)
|
raise _INTL("Version {1} of dungeon area {2} is defined twice.\n{3}", hash[:version], hash[:area], FileLineData.linereport)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
@@ -72,7 +72,7 @@
|
|||||||
// Sync screen redraws to the monitor refresh rate
|
// Sync screen redraws to the monitor refresh rate
|
||||||
// (default: disabled)
|
// (default: disabled)
|
||||||
//
|
//
|
||||||
// "vsync": false,
|
"vsync": true,
|
||||||
|
|
||||||
|
|
||||||
// Specify the window width on startup. If set to 0,
|
// Specify the window width on startup. If set to 0,
|
||||||
|
|||||||
Reference in New Issue
Block a user