Merge branch 'dev' into ai

This commit is contained in:
Maruno17
2022-08-19 21:37:14 +01:00
72 changed files with 1423 additions and 939 deletions
+14 -5
View File
@@ -1,6 +1,6 @@
#==============================================================================# #==============================================================================#
# Pokémon Essentials # # Pokémon Essentials #
# Version 20.1 # # Version 20.1.dev #
# https://github.com/Maruno17/pokemon-essentials # # https://github.com/Maruno17/pokemon-essentials #
#==============================================================================# #==============================================================================#
@@ -132,6 +132,15 @@ module Settings
# Whether overworld weather can set the default terrain effect in battle. # Whether overworld weather can set the default terrain effect in battle.
# Storm weather sets Electric Terrain, and fog weather sets Misty Terrain. # Storm weather sets Electric Terrain, and fog weather sets Misty Terrain.
OVERWORLD_WEATHER_SETS_BATTLE_TERRAIN = (MECHANICS_GENERATION >= 8) OVERWORLD_WEATHER_SETS_BATTLE_TERRAIN = (MECHANICS_GENERATION >= 8)
# The default setting for Phone.rematches_enabled, which determines whether
# trainers registered in the Phone can become ready for a rematch. If false,
# Phone.rematches_enabled = true will enable rematches at any point you want.
PHONE_REMATCHES_POSSIBLE_FROM_BEGINNING = false
# Whether the messages in a phone call with a trainer are colored blue or red
# depending on that trainer's gender. Note that this doesn't apply to contacts
# that are not trainers; they will need to be colored manually in their Common
# Events.
COLOR_PHONE_CALL_MESSAGES_BY_CONTACT_GENDER = true
#============================================================================= #=============================================================================
@@ -237,11 +246,11 @@ module Settings
# * Game Switch; the graphic is shown if this is ON (non-wall maps only). # * Game Switch; the graphic is shown if this is ON (non-wall maps only).
# * X coordinate of the graphic on the map, in squares. # * X coordinate of the graphic on the map, in squares.
# * Y coordinate of the graphic on the map, in squares. # * Y coordinate of the graphic on the map, in squares.
# * Name of the graphic, found in the Graphics/Pictures folder. # * Name of the graphic, found in the Graphics/UI/Town Map folder.
# * The graphic will always (true) or never (false) be shown on a wall map. # * The graphic will always (true) or never (false) be shown on a wall map.
REGION_MAP_EXTRAS = [ REGION_MAP_EXTRAS = [
[0, 51, 16, 15, "mapHiddenBerth", false], [0, 51, 16, 15, "hidden_Berth", false],
[0, 52, 20, 14, "mapHiddenFaraday", false] [0, 52, 20, 14, "hidden_Faraday", false]
] ]
# Whether the player can use Fly while looking at the Town Map. This is only # Whether the player can use Fly while looking at the Town Map. This is only
@@ -433,6 +442,6 @@ end
# DO NOT EDIT THESE! # DO NOT EDIT THESE!
module Essentials module Essentials
VERSION = "20.1" VERSION = "20.1.dev"
ERROR_TEXT = "" ERROR_TEXT = ""
end end
+122 -18
View File
@@ -23,7 +23,7 @@ end
#=============================================================================== #===============================================================================
class String class String
def starts_with_vowel? def starts_with_vowel?
return ["a", "e", "i", "o", "u"].include?(self[0, 1].downcase) return ["a", "e", "i", "o", "u"].include?(self[0].downcase)
end end
def first(n = 1); return self[0...n]; end def first(n = 1); return self[0...n]; end
@@ -52,7 +52,7 @@ class String
end end
def numeric? def numeric?
return !self[/^[+-]?([0-9]+)(?:\.[0-9]+)?$/].nil? return !self[/\A[+-]?\d+(?:\.\d+)?\Z/].nil?
end end
end end
@@ -188,17 +188,95 @@ class Color
return init_original(*args) return init_original(*args)
end end
# Returns this color as a hex string like "#RRGGBB". def self.new_from_rgb(param)
def to_hex return Font.default_color if !param
r = sprintf("%02X", self.red) base_int = param.to_i(16)
g = sprintf("%02X", self.green) case param.length
b = sprintf("%02X", self.blue) when 8 # 32-bit hex
return ("#" + r + g + b).upcase return Color.new(
(base_int >> 24) & 0xFF,
(base_int >> 16) & 0xFF,
(base_int >> 8) & 0xFF,
(base_int) & 0xFF
)
when 6 # 24-bit hex
return Color.new(
(base_int >> 16) & 0xFF,
(base_int >> 8) & 0xFF,
(base_int) & 0xFF
)
when 4 # 15-bit hex
return Color.new(
((base_int) & 0x1F) << 3,
((base_int >> 5) & 0x1F) << 3,
((base_int >> 10) & 0x1F) << 3
)
when 1, 2 # Color number
case base_int
when 0 then return Color.white
when 1 then return Color.blue
when 2 then return Color.red
when 3 then return Color.green
when 4 then return Color.cyan
when 5 then return Color.pink
when 6 then return Color.yellow
when 7 then return Color.gray
else return Font.default_color
end
end
return Font.default_color
end end
# Returns this color as a 24-bit color integer. # @return [String] the 15-bit representation of this color in a string, ignoring its alpha
def to_rgb15
ret = (self.red >> 3)
ret |= ((self.green >> 3) << 5)
ret |= ((self.blue >> 3) << 10)
return sprintf("%04X", ret)
end
# @return [String] this color in the format "RRGGBB", ignoring its alpha
def to_rgb24
return sprintf("%02X%02X%02X", self.red, self.green, self.blue)
end
# @return [String] this color in the format "RRGGBBAA" (or "RRGGBB" if this color's alpha is 255)
def to_rgb32(always_include_alpha = false)
return sprintf("%02X%02X%02X", self.red, self.green, self.blue) if self.alpha == 255 && !always_include_alpha
return sprintf("%02X%02X%02X%02X", self.red, self.green, self.blue, self.alpha)
end
# @return [String] this color in the format "#RRGGBB", ignoring its alpha
def to_hex
return "#" + to_rgb24
end
# @return [Integer] this color in RGB format converted to an integer
def to_i def to_i
return self.to_hex.delete("#").to_i(16) return self.to_rgb24.to_i(16)
end
# @return [Color] the contrasting color to this one
def get_contrast_color
r = self.red
g = self.green
b = self.blue
yuv = [
(r * 0.299) + (g * 0.587) + (b * 0.114),
(r * -0.1687) + (g * -0.3313) + (b * 0.500) + 0.5,
(r * 0.500) + (g * -0.4187) + (b * -0.0813) + 0.5
]
if yuv[0] < 127.5
yuv[0] += (255 - yuv[0]) / 2
else
yuv[0] = yuv[0] / 2
end
return Color.new(
yuv[0] + (1.4075 * (yuv[2] - 0.5)),
yuv[0] - (0.3455 * (yuv[1] - 0.5)) - (0.7169 * (yuv[2] - 0.5)),
yuv[0] + (1.7790 * (yuv[1] - 0.5)),
self.alpha
)
end end
# Converts the provided hex string/24-bit integer to RGB values. # Converts the provided hex string/24-bit integer to RGB values.
@@ -223,18 +301,44 @@ class Color
return nil return nil
end end
# Returns color object for some commonly used colors # Returns color object for some commonly used colors.
def self.red; return Color.new(255, 0, 0); end def self.red; return Color.new(255, 128, 128); end
def self.green; return Color.new( 0, 255, 0); end def self.green; return Color.new(128, 255, 128); end
def self.blue; return Color.new( 0, 0, 255); end def self.blue; return Color.new(128, 128, 255); end
def self.black; return Color.new( 0, 0, 0); end def self.yellow; return Color.new(255, 255, 128); end
def self.white; return Color.new(255, 255, 255); end
def self.yellow; return Color.new(255, 255, 0); end
def self.magenta; return Color.new(255, 0, 255); end def self.magenta; return Color.new(255, 0, 255); end
def self.teal; return Color.new( 0, 255, 255); end def self.cyan; return Color.new(128, 255, 255); end
def self.white; return Color.new(255, 255, 255); end
def self.gray; return Color.new(192, 192, 192); end
def self.black; return Color.new( 0, 0, 0); end
def self.pink; return Color.new(255, 128, 255); end
def self.orange; return Color.new(255, 155, 0); end def self.orange; return Color.new(255, 155, 0); end
def self.purple; return Color.new(155, 0, 255); end def self.purple; return Color.new(155, 0, 255); end
def self.brown; return Color.new(112, 72, 32); end def self.brown; return Color.new(112, 72, 32); end
# TODO: These are from def getSkinColor. It isn't appropriate to make Color
# objects of these, though, as they're just converted straight back into
# hex strings.
# def self.text_blue; return Color.new( 0, 112, 248); end
# def self.text_blue_light; return Color.new(120, 184, 232); end
# def self.text_red; return Color.new(232, 32, 16); end
# def self.text_red_light; return Color.new(248, 168, 184); end
# def self.text_green; return Color.new( 96, 176, 72); end
# def self.text_green_light; return Color.new(174, 208, 144); end
# def self.text_cyan; return Color.new( 72, 216, 216); end
# def self.text_cyan_light; return Color.new(168, 224, 224); end
# def self.text_magenta; return Color.new(208, 56, 184); end
# def self.text_magenta_light; return Color.new(232, 160, 224); end
# def self.text_yellow; return Color.new(232, 208, 32); end
# def self.text_yellow_light; return Color.new(248, 232, 136); end
# def self.text_gray; return Color.new(160, 160, 168); end
# def self.text_gray_light; return Color.new(208, 208, 216); end
# def self.text_white; return Color.new(240, 240, 248); end
# def self.text_white_light; return Color.new(200, 200, 208); end # Intentionally darker than text_white
# def self.text_purple; return Color.new(114, 64, 232); end
# def self.text_purple_light; return Color.new(184, 168, 224); end
# def self.text_orange; return Color.new(248, 152, 24); end
# def self.text_orange_light; return Color.new(248, 200, 152); end
end end
#=============================================================================== #===============================================================================
+1 -1
View File
@@ -201,7 +201,7 @@ class SpriteAnimation
sprite.y = sprite_y + cell_data[i, 2] sprite.y = sprite_y + cell_data[i, 2]
next if quick_update next if quick_update
sprite.visible = true sprite.visible = true
sprite.src_rect.set(pattern % 5 * 192, pattern / 5 * 192, 192, 192) sprite.src_rect.set((pattern % 5) * 192, (pattern / 5) * 192, 192, 192)
case @_animation_height case @_animation_height
when 0 then sprite.z = 1 when 0 then sprite.z = 1
when 1 then sprite.z = sprite.y + (Game_Map::TILE_HEIGHT * 3 / 2) + 1 when 1 then sprite.z = sprite.y + (Game_Map::TILE_HEIGHT * 3 / 2) + 1
@@ -348,3 +348,35 @@ SaveData.register_conversion(:v20_convert_pokemon_markings) do
end end
end end
end end
#===============================================================================
SaveData.register_conversion(:v21_replace_phone_data) do
essentials_version 21
display_title "Updating Phone data format"
to_value :global_metadata do |global|
if !global.phone
global.instance_eval do
@phone = Phone.new
@phoneTime = nil # Don't bother using this
if @phoneNumbers
@phoneNumbers.each do |contact|
if contact.length > 4
# Trainer
# TODO: Is there any way to ensure the versions count is accurate?
Phone.add_silent(contact[6], contact[7], contact[1], contact[2], 0, [contact[5], 3].max)
new_contact = Phone.get(contact[1], contact[2], 0)
new_contact.visible = contact[0]
new_contact.version = contact[5]
new_contact.rematch_flag = [contact[4] - 1, 0].max
else
# Non-trainer
Phone.add_silent(contact[3], contact[2], contact[1])
end
end
@phoneNumbers = nil
end
end
end
end
end
@@ -87,7 +87,7 @@ class Sprite_Shadow < RPG::Sprite
end end
@deltax = ScreenPosHelper.pbScreenX(@source) - self.x @deltax = ScreenPosHelper.pbScreenX(@source) - self.x
@deltay = ScreenPosHelper.pbScreenY(@source) - self.y @deltay = ScreenPosHelper.pbScreenY(@source) - self.y
self.color = Color.new(0, 0, 0) self.color = Color.black
@distance = ((@deltax**2) + (@deltay**2)) @distance = ((@deltax**2) + (@deltay**2))
self.opacity = @self_opacity * 13_000 / ((@distance * 370 / @distancemax) + 6000) self.opacity = @self_opacity * 13_000 / ((@distance * 370 / @distancemax) + 6000)
self.angle = 57.3 * Math.atan2(@deltax, @deltay) self.angle = 57.3 * Math.atan2(@deltax, @deltay)
@@ -104,7 +104,7 @@ class TileDrawingHelper
src = Rect.new(0, 0, 0, 0) src = Rect.new(0, 0, 0, 0)
4.times do |i| 4.times do |i|
tile_position = tiles[i] - 1 tile_position = tiles[i] - 1
src.set((tile_position % 6 * 16) + anim, tile_position / 6 * 16, 16, 16) src.set(((tile_position % 6) * 16) + anim, (tile_position / 6) * 16, 16, 16)
bitmap.stretch_blt(Rect.new((i % 2 * cxTile) + x, (i / 2 * cyTile) + y, cxTile, cyTile), bitmap.stretch_blt(Rect.new((i % 2 * cxTile) + x, (i / 2 * cyTile) + y, cxTile, cyTile),
autotile, src) autotile, src)
end end
@@ -113,7 +113,7 @@ class TileDrawingHelper
def bltSmallRegularTile(bitmap, x, y, cxTile, cyTile, id) def bltSmallRegularTile(bitmap, x, y, cxTile, cyTile, id)
return if id < 384 || !@tileset || @tileset.disposed? return if id < 384 || !@tileset || @tileset.disposed?
rect = Rect.new((id - 384) % 8 * 32, (id - 384) / 8 * 32, 32, 32) rect = Rect.new(((id - 384) % 8) * 32, ((id - 384) / 8) * 32, 32, 32)
rect = TilemapRenderer::TilesetWrapper.getWrappedRect(rect) if @shouldWrap rect = TilemapRenderer::TilesetWrapper.getWrappedRect(rect) if @shouldWrap
bitmap.stretch_blt(Rect.new(x, y, cxTile, cyTile), @tileset, rect) bitmap.stretch_blt(Rect.new(x, y, cxTile, cyTile), @tileset, rect)
end end
@@ -150,7 +150,7 @@ 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 BitmapWrapper.new(32, 32) if !map
bitmap = BitmapWrapper.new(map.width * 4, map.height * 4) bitmap = BitmapWrapper.new(map.width * 4, map.height * 4)
black = Color.new(0, 0, 0) black = Color.black
tilesets = $data_tilesets tilesets = $data_tilesets
tileset = tilesets[map.tileset_id] tileset = tilesets[map.tileset_id]
return bitmap if !tileset return bitmap if !tileset
@@ -196,7 +196,7 @@ end
def getPassabilityMinimap(mapid) def getPassabilityMinimap(mapid)
map = load_data(sprintf("Data/Map%03d.rxdata", mapid)) map = load_data(sprintf("Data/Map%03d.rxdata", mapid))
tileset = $data_tilesets[map.tileset_id] tileset = $data_tilesets[map.tileset_id]
minimap = AnimatedBitmap.new("Graphics/Pictures/minimap_tiles") minimap = AnimatedBitmap.new("Graphics/UI/minimap_tiles")
ret = Bitmap.new(map.width * 6, map.height * 6) ret = Bitmap.new(map.width * 6, map.height * 6)
passtable = Table.new(map.width, map.height) passtable = Table.new(map.width, map.height)
passages = tileset.passages passages = tileset.passages
@@ -221,6 +221,6 @@ def getPassabilityMinimap(mapid)
bltMinimapAutotile(ret, i * 6, j * 6, minimap.bitmap, tile) bltMinimapAutotile(ret, i * 6, j * 6, minimap.bitmap, tile)
end end
end end
minimap.disposes minimap.dispose
return ret return ret
end end
@@ -67,7 +67,7 @@ module RPG
ret.addRef ret.addRef
else else
ret = BitmapWrapper.new(32 * width, 32 * height) ret = BitmapWrapper.new(32 * width, 32 * height)
x = (tile_id - 384) % 8 * 32 x = ((tile_id - 384) % 8) * 32
y = (((tile_id - 384) / 8) - height + 1) * 32 y = (((tile_id - 384) / 8) - height + 1) * 32
tileset = yield(filename) tileset = yield(filename)
ret.blt(0, 0, tileset, Rect.new(x, y, 32 * width, 32 * height)) ret.blt(0, 0, tileset, Rect.new(x, y, 32 * width, 32 * height))
@@ -86,6 +86,10 @@ module RPG
self.load_bitmap("Graphics/Transitions/", filename) self.load_bitmap("Graphics/Transitions/", filename)
end end
def self.ui(filename)
self.load_bitmap("Graphics/UI/", filename)
end
def self.retain(folder_name, filename = "", hue = 0) def self.retain(folder_name, filename = "", hue = 0)
path = folder_name + filename path = folder_name + filename
ret = fromCache(path) ret = fromCache(path)
@@ -342,10 +342,10 @@ def getSkinColor(windowskin, color, isDarkSkin)
"F0F0F8", "C8C8D0", # 8 White "F0F0F8", "C8C8D0", # 8 White
"9040E8", "B8A8E0", # 9 Purple "9040E8", "B8A8E0", # 9 Purple
"F89818", "F8C898", # 10 Orange "F89818", "F8C898", # 10 Orange
colorToRgb32(MessageConfig::DARK_TEXT_MAIN_COLOR), MessageConfig::DARK_TEXT_MAIN_COLOR.to_rgb24,
colorToRgb32(MessageConfig::DARK_TEXT_SHADOW_COLOR), # 11 Dark default MessageConfig::DARK_TEXT_SHADOW_COLOR.to_rgb24, # 11 Dark default
colorToRgb32(MessageConfig::LIGHT_TEXT_MAIN_COLOR), MessageConfig::LIGHT_TEXT_MAIN_COLOR.to_rgb24,
colorToRgb32(MessageConfig::LIGHT_TEXT_SHADOW_COLOR) # 12 Light default MessageConfig::LIGHT_TEXT_SHADOW_COLOR.to_rgb24 # 12 Light default
] ]
if color == 0 || color > textcolors.length / 2 # No special colour, use default if color == 0 || color > textcolors.length / 2 # No special colour, use default
if isDarkSkin # Dark background, light text if isDarkSkin # Dark background, light text
@@ -365,7 +365,7 @@ def getSkinColor(windowskin, color, isDarkSkin)
x = 64 + ((color % 8) * 8) x = 64 + ((color % 8) * 8)
y = 96 + ((color / 8) * 8) y = 96 + ((color / 8) * 8)
pixel = windowskin.get_pixel(x, y) pixel = windowskin.get_pixel(x, y)
return shadowctagFromColor(pixel) return shadowc3tag(pixel, pixel.get_contrast_color)
end end
end end
@@ -717,12 +717,12 @@ end
#=============================================================================== #===============================================================================
# Adds a background to the sprite hash. # Adds a background to the sprite hash.
# _planename_ is the hash key of the background. # _planename_ is the hash key of the background.
# _background_ is a filename within the Graphics/Pictures/ folder and can be # _background_ is a filename within the Graphics/UI/ folder and can be
# an animated image. # an animated image.
# _viewport_ is a viewport to place the background in. # _viewport_ is a viewport to place the background in.
def addBackgroundPlane(sprites, planename, background, viewport = nil) def addBackgroundPlane(sprites, planename, background, viewport = nil)
sprites[planename] = AnimatedPlane.new(viewport) sprites[planename] = AnimatedPlane.new(viewport)
bitmapName = pbResolveBitmap("Graphics/Pictures/#{background}") bitmapName = pbResolveBitmap("Graphics/UI/#{background}")
if bitmapName.nil? if bitmapName.nil?
# Plane should exist in any case # Plane should exist in any case
sprites[planename].bitmap = nil sprites[planename].bitmap = nil
@@ -739,12 +739,12 @@ end
# Adds a background to the sprite hash. # Adds a background to the sprite hash.
# _planename_ is the hash key of the background. # _planename_ is the hash key of the background.
# _background_ is a filename within the Graphics/Pictures/ folder and can be # _background_ is a filename within the Graphics/UI/ folder and can be
# an animated image. # an animated image.
# _color_ is the color to use if the background can't be found. # _color_ is the color to use if the background can't be found.
# _viewport_ is a viewport to place the background in. # _viewport_ is a viewport to place the background in.
def addBackgroundOrColoredPlane(sprites, planename, background, color, viewport = nil) def addBackgroundOrColoredPlane(sprites, planename, background, color, viewport = nil)
bitmapName = pbResolveBitmap("Graphics/Pictures/#{background}") bitmapName = pbResolveBitmap("Graphics/UI/#{background}")
if bitmapName.nil? if bitmapName.nil?
# Plane should exist in any case # Plane should exist in any case
sprites[planename] = ColoredPlane.new(color, viewport) sprites[planename] = ColoredPlane.new(color, viewport)
@@ -417,7 +417,7 @@ class Window_AdvancedTextPokemon < SpriteWindow_Base
def allocPause def allocPause
return if @pausesprite return if @pausesprite
@pausesprite = AnimatedSprite.create("Graphics/Pictures/pause", 4, 3) @pausesprite = AnimatedSprite.create("Graphics/UI/pause_arrow", 4, 3)
@pausesprite.z = 100000 @pausesprite.z = 100000
@pausesprite.visible = false @pausesprite.visible = false
end end
@@ -447,13 +447,13 @@ class Window_AdvancedTextPokemon < SpriteWindow_Base
when 1 # Lower right when 1 # Lower right
pauseWidth = @pausesprite.bitmap ? @pausesprite.framewidth : 16 pauseWidth = @pausesprite.bitmap ? @pausesprite.framewidth : 16
pauseHeight = @pausesprite.bitmap ? @pausesprite.frameheight : 16 pauseHeight = @pausesprite.bitmap ? @pausesprite.frameheight : 16
@pausesprite.x = self.x + self.width - (20 * 2) + (pauseWidth / 2) @pausesprite.x = self.x + self.width - 40 + (pauseWidth / 2)
@pausesprite.y = self.y + self.height - (30 * 2) + (pauseHeight / 2) @pausesprite.y = self.y + self.height - 60 + (pauseHeight / 2)
when 2 # Lower middle when 2 # Lower middle
pauseWidth = @pausesprite.bitmap ? @pausesprite.framewidth : 16 pauseWidth = @pausesprite.bitmap ? @pausesprite.framewidth : 16
pauseHeight = @pausesprite.bitmap ? @pausesprite.frameheight : 16 pauseHeight = @pausesprite.bitmap ? @pausesprite.frameheight : 16
@pausesprite.x = self.x + (self.width / 2) - (pauseWidth / 2) @pausesprite.x = self.x + (self.width / 2) - (pauseWidth / 2)
@pausesprite.y = self.y + self.height - (18 * 2) + (pauseHeight / 2) @pausesprite.y = self.y + self.height - 36 + (pauseHeight / 2)
end end
end end
@@ -958,10 +958,10 @@ end
#=============================================================================== #===============================================================================
module UpDownArrowMixin module UpDownArrowMixin
def initUpDownArrow def initUpDownArrow
@uparrow = AnimatedSprite.create("Graphics/Pictures/uparrow", 8, 2, self.viewport) @uparrow = AnimatedSprite.create("Graphics/UI/up_arrow", 8, 2, self.viewport)
@downarrow = AnimatedSprite.create("Graphics/Pictures/downarrow", 8, 2, self.viewport) @downarrow = AnimatedSprite.create("Graphics/UI/down_arrow", 8, 2, self.viewport)
RPG::Cache.retain("Graphics/Pictures/uparrow") RPG::Cache.retain("Graphics/UI/up_arrow")
RPG::Cache.retain("Graphics/Pictures/downarrow") RPG::Cache.retain("Graphics/UI/down_arrow")
@uparrow.z = 99998 @uparrow.z = 99998
@downarrow.z = 99998 @downarrow.z = 99998
@uparrow.visible = false @uparrow.visible = false
@@ -1043,11 +1043,11 @@ class Window_DrawableCommand < SpriteWindow_SelectableEx
super(x, y, width, height) super(x, y, width, height)
self.viewport = viewport if viewport self.viewport = viewport if viewport
if isDarkWindowskin(self.windowskin) if isDarkWindowskin(self.windowskin)
@selarrow = AnimatedBitmap.new("Graphics/Pictures/selarrow_white") @selarrow = AnimatedBitmap.new("Graphics/UI/sel_arrow_white")
RPG::Cache.retain("Graphics/Pictures/selarrow_white") RPG::Cache.retain("Graphics/UI/sel_arrow_white")
else else
@selarrow = AnimatedBitmap.new("Graphics/Pictures/selarrow") @selarrow = AnimatedBitmap.new("Graphics/UI/sel_arrow")
RPG::Cache.retain("Graphics/Pictures/selarrow") RPG::Cache.retain("Graphics/UI/sel_arrow")
end end
@index = 0 @index = 0
colors = getDefaultTextColors(self.windowskin) colors = getDefaultTextColors(self.windowskin)
@@ -1,118 +1,57 @@
#=============================================================================== #===============================================================================
# Text colours # Text colours
#=============================================================================== #===============================================================================
# TODO: Unused.
def ctag(color) def ctag(color)
ret = (color.red.to_i << 24) return sprintf("<c=%s>", color.to_rgb32(true))
ret |= ((color.green.to_i) << 16)
ret |= ((color.blue.to_i) << 8)
ret |= ((color.alpha.to_i))
return sprintf("<c=%08X>", ret)
end end
def shadowctag(base, shadow) def shadowctag(base, shadow)
return sprintf("<c2=%s%s>", colorToRgb16(base), colorToRgb16(shadow)) return sprintf("<c2=%s%s>", base.to_rgb15, shadow.to_rgb15)
end end
def shadowc3tag(base, shadow) def shadowc3tag(base, shadow)
return sprintf("<c3=%s,%s>", colorToRgb32(base), colorToRgb32(shadow)) return sprintf("<c3=%s,%s>", base.to_rgb32, shadow.to_rgb32)
end end
# TODO: Unused.
def shadowctagFromColor(color) def shadowctagFromColor(color)
return shadowc3tag(color, getContrastColor(color)) return shadowc3tag(color, color.get_contrast_color)
end end
# TODO: Unused.
def shadowctagFromRgb(param) def shadowctagFromRgb(param)
return shadowctagFromColor(rgbToColor(param)) return shadowctagFromColor(Color.new_from_rgb(param))
end end
# @deprecated This method is slated to be removed in v22.
def colorToRgb32(color) def colorToRgb32(color)
return "" if !color Deprecation.warn_method("colorToRgb32", "v22", "color.to_rgb32")
if color.alpha.to_i == 255 return color.to_rgb32
return sprintf("%02X%02X%02X", color.red.to_i, color.green.to_i, color.blue.to_i)
else
return sprintf("%02X%02X%02X%02X",
color.red.to_i, color.green.to_i, color.blue.to_i, color.alpha.to_i)
end
end end
# @deprecated This method is slated to be removed in v22.
def colorToRgb16(color) def colorToRgb16(color)
ret = (color.red.to_i >> 3) Deprecation.warn_method("colorToRgb16", "v22", "color.to_rgb15")
ret |= ((color.green.to_i >> 3) << 5) return color.to_rgb15
ret |= ((color.blue.to_i >> 3) << 10)
return sprintf("%04X", ret)
end end
# @deprecated This method is slated to be removed in v22.
def rgbToColor(param) def rgbToColor(param)
return Font.default_color if !param Deprecation.warn_method("rgbToColor", "v22", "Color.new_from_rgb(param)")
baseint = param.to_i(16) return Color.new_from_rgb(param)
case param.length
when 8 # 32-bit hex
return Color.new(
(baseint >> 24) & 0xFF,
(baseint >> 16) & 0xFF,
(baseint >> 8) & 0xFF,
(baseint) & 0xFF
)
when 6 # 24-bit hex
return Color.new(
(baseint >> 16) & 0xFF,
(baseint >> 8) & 0xFF,
(baseint) & 0xFF
)
when 4 # 16-bit hex
return Color.new(
((baseint) & 0x1F) << 3,
((baseint >> 5) & 0x1F) << 3,
((baseint >> 10) & 0x1F) << 3
)
when 1 # Color number
i = param.to_i
return Font.default_color if i >= 8
return [
Color.new(255, 255, 255, 255),
Color.new(128, 128, 255, 255),
Color.new(255, 128, 128, 255),
Color.new(128, 255, 128, 255),
Color.new(128, 255, 255, 255),
Color.new(255, 128, 255, 255),
Color.new(255, 255, 128, 255),
Color.new(192, 192, 192, 255)
][i]
else
return Font.default_color
end
end end
def Rgb16ToColor(param) # @deprecated This method is slated to be removed in v22.
baseint = param.to_i(16) def rgb15ToColor(param)
return Color.new( Deprecation.warn_method("rgb15ToColor", "v22", "Color.new_from_rgb(param)")
((baseint) & 0x1F) << 3, return Color.new_from_rgb(param)
((baseint >> 5) & 0x1F) << 3,
((baseint >> 10) & 0x1F) << 3
)
end end
# @deprecated This method is slated to be removed in v22.
def getContrastColor(color) def getContrastColor(color)
raise "No color given" if !color Deprecation.warn_method("getContrastColor", "v22", "color.get_contrast_color")
r = color.red return color.get_contrast_color
g = color.green
b = color.blue
yuv = [
(r * 0.299) + (g * 0.587) + (b * 0.114),
(r * -0.1687) + (g * -0.3313) + (b * 0.500) + 0.5,
(r * 0.500) + (g * -0.4187) + (b * -0.0813) + 0.5
]
if yuv[0] < 127.5
yuv[0] += (255 - yuv[0]) / 2
else
yuv[0] = yuv[0] / 2
end
return Color.new(
yuv[0] + (1.4075 * (yuv[2] - 0.5)),
yuv[0] - (0.3455 * (yuv[1] - 0.5)) - (0.7169 * (yuv[2] - 0.5)),
yuv[0] + (1.7790 * (yuv[1] - 0.5)),
color.alpha
)
end end
@@ -151,8 +90,8 @@ def itemIconTag(item)
if item.respond_to?("icon_name") if item.respond_to?("icon_name")
return sprintf("<icon=%s>", item.icon_name) return sprintf("<icon=%s>", item.icon_name)
else else
ix = item.icon_index % 16 * 24 ix = (item.icon_index % 16) * 24
iy = item.icon_index / 16 * 24 iy = (item.icon_index / 16) * 24
return sprintf("<img=Graphics/System/Iconset|%d|%d|24|24>", ix, iy) return sprintf("<img=Graphics/System/Iconset|%d|%d|24|24>", ix, iy)
end end
end end
@@ -481,15 +420,15 @@ def getFormattedText(bitmap, xDst, yDst, widthDst, heightDst, text, lineheight =
if endtag if endtag
colorstack.pop colorstack.pop
else else
color = rgbToColor(param) color = Color.new_from_rgb(param)
colorstack.push([color, nil]) colorstack.push([color, nil])
end end
when "c2" when "c2"
if endtag if endtag
colorstack.pop colorstack.pop
else else
base = Rgb16ToColor(param[0, 4]) base = Color.new_from_rgb(param[0, 4])
shadow = Rgb16ToColor(param[4, 4]) shadow = Color.new_from_rgb(param[4, 4])
colorstack.push([base, shadow]) colorstack.push([base, shadow])
end end
when "c3" when "c3"
@@ -499,8 +438,8 @@ def getFormattedText(bitmap, xDst, yDst, widthDst, heightDst, text, lineheight =
param = param.split(",") param = param.split(",")
# get pure colors unaffected by opacity # get pure colors unaffected by opacity
oldColors = getLastParam(colorstack, defaultcolors) oldColors = getLastParam(colorstack, defaultcolors)
base = (param[0] && param[0] != "") ? rgbToColor(param[0]) : oldColors[0] base = (param[0] && param[0] != "") ? Color.new_from_rgb(param[0]) : oldColors[0]
shadow = (param[1] && param[1] != "") ? rgbToColor(param[1]) : oldColors[1] shadow = (param[1] && param[1] != "") ? Color.new_from_rgb(param[1]) : oldColors[1]
colorstack.push([base, shadow]) colorstack.push([base, shadow])
end end
when "o" when "o"
@@ -921,7 +860,7 @@ def getLineBrokenChunks(bitmap, value, width, dims, plain = false)
end end
textcols = [] textcols = []
if ccheck[/</] && !plain if ccheck[/</] && !plain
ccheck.scan(re) { textcols.push(rgbToColor($1)) } ccheck.scan(re) { textcols.push(Color.new_from_rgb($1)) }
words = ccheck.split(reNoMatch) # must have no matches because split can include match words = ccheck.split(reNoMatch) # must have no matches because split can include match
else else
words = [ccheck] words = [ccheck]
@@ -1086,7 +1025,7 @@ end
def drawFormattedTextEx(bitmap, x, y, width, text, baseColor = nil, shadowColor = nil, lineheight = 32) def drawFormattedTextEx(bitmap, x, y, width, text, baseColor = nil, shadowColor = nil, lineheight = 32)
base = baseColor ? baseColor.clone : Color.new(96, 96, 96) base = baseColor ? baseColor.clone : Color.new(96, 96, 96)
shadow = shadowColor ? shadowColor.clone : Color.new(208, 208, 200) shadow = shadowColor ? shadowColor.clone : Color.new(208, 208, 200)
text = "<c2=" + colorToRgb16(base) + colorToRgb16(shadow) + ">" + text text = shadowctag(base, shadow) + text
chars = getFormattedText(bitmap, x, y, width, -1, text, lineheight) chars = getFormattedText(bitmap, x, y, width, -1, text, lineheight)
drawFormattedChars(bitmap, chars) drawFormattedChars(bitmap, chars)
end end
@@ -507,7 +507,7 @@ class Window_MultilineTextEntry < SpriteWindow_Base
bitmap.clear bitmap.clear
getTextChars getTextChars
height = self.height - self.borderY height = self.height - self.borderY
cursorcolor = Color.new(0, 0, 0) cursorcolor = Color.black
textchars = getTextChars textchars = getTextChars
startY = getLineY(@firstline) startY = getLineY(@firstline)
textchars.each do |text| textchars.each do |text|
+4 -4
View File
@@ -256,7 +256,7 @@ module Transitions
@overworld_sprite.visible = false @overworld_sprite.visible = false
# Black background # Black background
@black_sprite = BitmapSprite.new(Graphics.width, Graphics.height, @viewport) @black_sprite = BitmapSprite.new(Graphics.width, Graphics.height, @viewport)
@black_sprite.bitmap.fill_rect(0, 0, Graphics.width, Graphics.height, Color.new(0, 0, 0)) @black_sprite.bitmap.fill_rect(0, 0, Graphics.width, Graphics.height, Color.black)
# Overworld sprites # Overworld sprites
sprite_width = @overworld_bitmap.width / NUM_SPRITES_X sprite_width = @overworld_bitmap.width / NUM_SPRITES_X
sprite_height = @overworld_bitmap.height / NUM_SPRITES_Y sprite_height = @overworld_bitmap.height / NUM_SPRITES_Y
@@ -1292,7 +1292,7 @@ module Transitions
@foe_sprite = new_sprite(Graphics.width + @foe_bitmap.width, @sprites[0].y + @sprites[0].height - 12, @foe_sprite = new_sprite(Graphics.width + @foe_bitmap.width, @sprites[0].y + @sprites[0].height - 12,
@foe_bitmap, @foe_bitmap.width / 2, @foe_bitmap.height) @foe_bitmap, @foe_bitmap.width / 2, @foe_bitmap.height)
@foe_sprite.z = 7 @foe_sprite.z = 7
@foe_sprite.color = Color.new(0, 0, 0) @foe_sprite.color = Color.black
# Sprite with foe's name written in it # Sprite with foe's name written in it
@text_sprite = BitmapSprite.new(Graphics.width, @bar_bitmap.height, @viewport) @text_sprite = BitmapSprite.new(Graphics.width, @bar_bitmap.height, @viewport)
@text_sprite.y = BAR_Y @text_sprite.y = BAR_Y
@@ -1481,13 +1481,13 @@ module Transitions
@player_bar_sprite.y + BAR_HEIGHT - TRAINER_Y_OFFSET, @player_bar_sprite.y + BAR_HEIGHT - TRAINER_Y_OFFSET,
@player_bitmap, @player_bitmap.width / 2, @player_bitmap.height) @player_bitmap, @player_bitmap.width / 2, @player_bitmap.height)
@player_sprite.z = 7 @player_sprite.z = 7
@player_sprite.color = Color.new(0, 0, 0) @player_sprite.color = Color.black
# Foe sprite # Foe sprite
@foe_sprite = new_sprite(@foe_bar_sprite.x + (@bar_bitmap.width / 2) - TRAINER_X_OFFSET, @foe_sprite = new_sprite(@foe_bar_sprite.x + (@bar_bitmap.width / 2) - TRAINER_X_OFFSET,
@foe_bar_sprite.y + @foe_bitmap.height - TRAINER_Y_OFFSET, @foe_bar_sprite.y + @foe_bitmap.height - TRAINER_Y_OFFSET,
@foe_bitmap, @foe_bitmap.width / 2, @foe_bitmap.height) @foe_bitmap, @foe_bitmap.width / 2, @foe_bitmap.height)
@foe_sprite.z = 7 @foe_sprite.z = 7
@foe_sprite.color = Color.new(0, 0, 0) @foe_sprite.color = Color.black
# Sprite with foe's name written in it # Sprite with foe's name written in it
@text_sprite = BitmapSprite.new(@bar_bitmap.width / 2, BAR_HEIGHT, @viewport) @text_sprite = BitmapSprite.new(@bar_bitmap.width / 2, BAR_HEIGHT, @viewport)
@text_sprite.x = @foe_bar_start_x @text_sprite.x = @foe_bar_start_x
@@ -1,6 +1,6 @@
# NOTE: The order these shapes are registered are the order they are listed in # NOTE: The order these shapes are registered are the order they are listed in
# the Pokédex search screen. # the Pokédex search screen.
# "Graphics/Pictures/Pokedex/icon_shapes.png" contains icons for these # "Graphics/UI/Pokedex/icon_shapes.png" contains icons for these
# shapes. # shapes.
module GameData module GameData
class BodyShape class BodyShape
@@ -1,7 +1,7 @@
# NOTE: "Graphics/Pictures/statuses.png" also contains icons for being fainted # NOTE: "Graphics/UI/statuses.png" also contains icons for being fainted and for
# and for having Pokérus, in that order, at the bottom of the graphic. # having Pokérus, in that order, at the bottom of the graphic.
# "Graphics/Pictures/Battle/icon_statuses.png" also contains an icon for # "Graphics/UI/Battle/icon_statuses.png" also contains an icon for bad
# bad poisoning (toxic), at the bottom of the graphic. # poisoning (toxic), at the bottom of the graphic.
# Both graphics automatically handle varying numbers of defined statuses, # Both graphics automatically handle varying numbers of defined statuses,
# as long as their extra icons remain at the bottom of them. # as long as their extra icons remain at the bottom of them.
module GameData module GameData
@@ -67,16 +67,16 @@ module GameData
return nil if !item_data return nil if !item_data
name_base = (item_data.is_mail?) ? "mail" : "item" name_base = (item_data.is_mail?) ? "mail" : "item"
# Check for files # Check for files
ret = sprintf("Graphics/Pictures/Party/icon_%s_%s", name_base, item_data.id) ret = sprintf("Graphics/UI/Party/icon_%s_%s", name_base, item_data.id)
return ret if pbResolveBitmap(ret) return ret if pbResolveBitmap(ret)
return sprintf("Graphics/Pictures/Party/icon_%s", name_base) return sprintf("Graphics/UI/Party/icon_%s", name_base)
end end
def self.mail_filename(item) def self.mail_filename(item)
item_data = self.try_get(item) item_data = self.try_get(item)
return nil if !item_data return nil if !item_data
# Check for files # Check for files
ret = sprintf("Graphics/Pictures/Mail/mail_%s", item_data.id) ret = sprintf("Graphics/UI/Mail/mail_%s", item_data.id)
return pbResolveBitmap(ret) ? ret : nil return pbResolveBitmap(ret) ? ret : nil
end end
@@ -71,12 +71,12 @@ module GameData
end end
def self.map_icon_filename(tr_type) def self.map_icon_filename(tr_type)
return self.check_file(tr_type, "Graphics/Pictures/mapPlayer") return self.check_file(tr_type, "Graphics/UI/Town Map/player_")
end end
def self.player_map_icon_filename(tr_type) def self.player_map_icon_filename(tr_type)
outfit = ($player) ? $player.outfit : 0 outfit = ($player) ? $player.outfit : 0
return self.check_file(tr_type, "Graphics/Pictures/mapPlayer", sprintf("_%d", outfit)) return self.check_file(tr_type, "Graphics/UI/Town Map/player_", sprintf("_%d", outfit))
end end
def initialize(hash) def initialize(hash)
@@ -579,7 +579,7 @@ class Battle
swaps.each do |pair| swaps.each do |pair|
next if pbSideSize(pair[0]) == 2 && swaps.length > 1 next if pbSideSize(pair[0]) == 2 && swaps.length > 1
next if !pbSwapBattlers(pair[0], pair[1]) next if !pbSwapBattlers(pair[0], pair[1])
case pbSideSize(side) case pbSideSize(pair[1])
when 2 when 2
pbDisplay(_INTL("{1} moved across!", @battlers[pair[1]].pbThis)) pbDisplay(_INTL("{1} moved across!", @battlers[pair[1]].pbThis))
when 3 when 3
@@ -28,7 +28,7 @@ class Battle::Scene
pbCreateBackdropSprites pbCreateBackdropSprites
# Create message box graphic # Create message box graphic
messageBox = pbAddSprite("messageBox", 0, Graphics.height - 96, messageBox = pbAddSprite("messageBox", 0, Graphics.height - 96,
"Graphics/Pictures/Battle/overlay_message", @viewport) "Graphics/UI/Battle/overlay_message", @viewport)
messageBox.z = 195 messageBox.z = 195
# Create message window (displays the message) # Create message window (displays the message)
msgWindow = Window_AdvancedTextPokemon.newWithSize( msgWindow = Window_AdvancedTextPokemon.newWithSize(
@@ -50,7 +50,7 @@ class Battle::Scene
# The party lineup graphics (bar and balls) for both sides # The party lineup graphics (bar and balls) for both sides
2.times do |side| 2.times do |side|
partyBar = pbAddSprite("partyBar_#{side}", 0, 0, partyBar = pbAddSprite("partyBar_#{side}", 0, 0,
"Graphics/Pictures/Battle/overlay_lineup", @viewport) "Graphics/UI/Battle/overlay_lineup", @viewport)
partyBar.z = 120 partyBar.z = 120
partyBar.mirror = true if side == 0 # Player's lineup bar only partyBar.mirror = true if side == 0 # Player's lineup bar only
partyBar.visible = false partyBar.visible = false
@@ -97,10 +97,10 @@ end
# Command menu (Fight/Pokémon/Bag/Run) # Command menu (Fight/Pokémon/Bag/Run)
#=============================================================================== #===============================================================================
class Battle::Scene::CommandMenu < Battle::Scene::MenuBase class Battle::Scene::CommandMenu < Battle::Scene::MenuBase
# If true, displays graphics from Graphics/Pictures/Battle/overlay_command.png # If true, displays graphics from Graphics/UI/Battle/overlay_command.png
# and Graphics/Pictures/Battle/cursor_command.png. # and Graphics/UI/Battle/cursor_command.png.
# If false, just displays text and the command window over the graphic # If false, just displays text and the command window over the graphic
# Graphics/Pictures/Battle/overlay_message.png. You will need to edit def # Graphics/UI/Battle/overlay_message.png. You will need to edit def
# pbShowWindow to make the graphic appear while the command menu is being # pbShowWindow to make the graphic appear while the command menu is being
# displayed. # displayed.
USE_GRAPHICS = true USE_GRAPHICS = true
@@ -128,10 +128,10 @@ class Battle::Scene::CommandMenu < Battle::Scene::MenuBase
if USE_GRAPHICS if USE_GRAPHICS
# Create background graphic # Create background graphic
background = IconSprite.new(self.x, self.y, viewport) background = IconSprite.new(self.x, self.y, viewport)
background.setBitmap("Graphics/Pictures/Battle/overlay_command") background.setBitmap("Graphics/UI/Battle/overlay_command")
addSprite("background", background) addSprite("background", background)
# Create bitmaps # Create bitmaps
@buttonBitmap = AnimatedBitmap.new(_INTL("Graphics/Pictures/Battle/cursor_command")) @buttonBitmap = AnimatedBitmap.new(_INTL("Graphics/UI/Battle/cursor_command"))
# Create action buttons # Create action buttons
@buttons = Array.new(4) do |i| # 4 command options, therefore 4 buttons @buttons = Array.new(4) do |i| # 4 command options, therefore 4 buttons
button = Sprite.new(viewport) button = Sprite.new(viewport)
@@ -205,10 +205,10 @@ class Battle::Scene::FightMenu < Battle::Scene::MenuBase
GET_MOVE_TEXT_COLOR_FROM_MOVE_BUTTON = true GET_MOVE_TEXT_COLOR_FROM_MOVE_BUTTON = true
# If true, displays graphics from Graphics/Pictures/Battle/overlay_fight.png # If true, displays graphics from Graphics/UI/Battle/overlay_fight.png
# and Graphics/Pictures/Battle/cursor_fight.png. # and Graphics/UI/Battle/cursor_fight.png.
# If false, just displays text and the command window over the graphic # If false, just displays text and the command window over the graphic
# Graphics/Pictures/Battle/overlay_message.png. You will need to edit def # Graphics/UI/Battle/overlay_message.png. You will need to edit def
# pbShowWindow to make the graphic appear while the command menu is being # pbShowWindow to make the graphic appear while the command menu is being
# displayed. # displayed.
USE_GRAPHICS = true USE_GRAPHICS = true
@@ -231,13 +231,13 @@ class Battle::Scene::FightMenu < Battle::Scene::MenuBase
# 0=don't show, 1=show unpressed, 2=show pressed # 0=don't show, 1=show unpressed, 2=show pressed
if USE_GRAPHICS if USE_GRAPHICS
# Create bitmaps # Create bitmaps
@buttonBitmap = AnimatedBitmap.new(_INTL("Graphics/Pictures/Battle/cursor_fight")) @buttonBitmap = AnimatedBitmap.new(_INTL("Graphics/UI/Battle/cursor_fight"))
@typeBitmap = AnimatedBitmap.new(_INTL("Graphics/Pictures/types")) @typeBitmap = AnimatedBitmap.new(_INTL("Graphics/UI/types"))
@megaEvoBitmap = AnimatedBitmap.new(_INTL("Graphics/Pictures/Battle/cursor_mega")) @megaEvoBitmap = AnimatedBitmap.new(_INTL("Graphics/UI/Battle/cursor_mega"))
@shiftBitmap = AnimatedBitmap.new(_INTL("Graphics/Pictures/Battle/cursor_shift")) @shiftBitmap = AnimatedBitmap.new(_INTL("Graphics/UI/Battle/cursor_shift"))
# Create background graphic # Create background graphic
background = IconSprite.new(0, Graphics.height - 96, viewport) background = IconSprite.new(0, Graphics.height - 96, viewport)
background.setBitmap("Graphics/Pictures/Battle/overlay_fight") background.setBitmap("Graphics/UI/Battle/overlay_fight")
addSprite("background", background) addSprite("background", background)
# Create move buttons # Create move buttons
@buttons = Array.new(Pokemon::MAX_MOVES) do |i| @buttons = Array.new(Pokemon::MAX_MOVES) do |i|
@@ -472,7 +472,7 @@ class Battle::Scene::TargetMenu < Battle::Scene::MenuBase
# NOTE: @mode is for which buttons are shown as selected. # NOTE: @mode is for which buttons are shown as selected.
# 0=select 1 button (@index), 1=select all buttons with text # 0=select 1 button (@index), 1=select all buttons with text
# Create bitmaps # Create bitmaps
@buttonBitmap = AnimatedBitmap.new("Graphics/Pictures/Battle/cursor_target") @buttonBitmap = AnimatedBitmap.new("Graphics/UI/Battle/cursor_target")
# Create target buttons # Create target buttons
@buttons = Array.new(maxIndex + 1) do |i| @buttons = Array.new(maxIndex + 1) do |i|
numButtons = @sideSizes[i % 2] numButtons = @sideSizes[i % 2]
@@ -42,15 +42,15 @@ class Battle::Scene::PokemonDataBox < Sprite
onPlayerSide = @battler.index.even? onPlayerSide = @battler.index.even?
# Get the data box graphic and set whether the HP numbers/Exp bar are shown # Get the data box graphic and set whether the HP numbers/Exp bar are shown
if sideSize == 1 # One Pokémon on side, use the regular dara box BG if sideSize == 1 # One Pokémon on side, use the regular dara box BG
bgFilename = ["Graphics/Pictures/Battle/databox_normal", bgFilename = ["Graphics/UI/Battle/databox_normal",
"Graphics/Pictures/Battle/databox_normal_foe"][@battler.index % 2] "Graphics/UI/Battle/databox_normal_foe"][@battler.index % 2]
if onPlayerSide if onPlayerSide
@showHP = true @showHP = true
@showExp = true @showExp = true
end end
else # Multiple Pokémon on side, use the thin dara box BG else # Multiple Pokémon on side, use the thin dara box BG
bgFilename = ["Graphics/Pictures/Battle/databox_thin", bgFilename = ["Graphics/UI/Battle/databox_thin",
"Graphics/Pictures/Battle/databox_thin_foe"][@battler.index % 2] "Graphics/UI/Battle/databox_thin_foe"][@battler.index % 2]
end end
@databoxBitmap&.dispose @databoxBitmap&.dispose
@databoxBitmap = AnimatedBitmap.new(bgFilename) @databoxBitmap = AnimatedBitmap.new(bgFilename)
@@ -76,9 +76,9 @@ class Battle::Scene::PokemonDataBox < Sprite
def initializeOtherGraphics(viewport) def initializeOtherGraphics(viewport)
# Create other bitmaps # Create other bitmaps
@numbersBitmap = AnimatedBitmap.new("Graphics/Pictures/Battle/icon_numbers") @numbersBitmap = AnimatedBitmap.new("Graphics/UI/Battle/icon_numbers")
@hpBarBitmap = AnimatedBitmap.new("Graphics/Pictures/Battle/overlay_hp") @hpBarBitmap = AnimatedBitmap.new("Graphics/UI/Battle/overlay_hp")
@expBarBitmap = AnimatedBitmap.new("Graphics/Pictures/Battle/overlay_exp") @expBarBitmap = AnimatedBitmap.new("Graphics/UI/Battle/overlay_exp")
# Create sprite to draw HP numbers on # Create sprite to draw HP numbers on
@hpNumbers = BitmapSprite.new(124, 16, viewport) @hpNumbers = BitmapSprite.new(124, 16, viewport)
# pbSetSmallFont(@hpNumbers.bitmap) # pbSetSmallFont(@hpNumbers.bitmap)
@@ -221,7 +221,7 @@ class Battle::Scene::PokemonDataBox < Sprite
def draw_level def draw_level
# "Lv" graphic # "Lv" graphic
pbDrawImagePositions(self.bitmap, pbDrawImagePositions(self.bitmap,
[["Graphics/Pictures/Battle/overlay_lv", @spriteBaseX + 140, 16]] [["Graphics/UI/Battle/overlay_lv", @spriteBaseX + 140, 16]]
) )
# Level number # Level number
pbDrawNumber(@battler.level, self.bitmap, @spriteBaseX + 162, 16) pbDrawNumber(@battler.level, self.bitmap, @spriteBaseX + 162, 16)
@@ -244,26 +244,26 @@ class Battle::Scene::PokemonDataBox < Sprite
s = GameData::Status.get(@battler.status).icon_position s = GameData::Status.get(@battler.status).icon_position
end end
return if s < 0 return if s < 0
pbDrawImagePositions(self.bitmap, [["Graphics/Pictures/Battle/icon_statuses", @spriteBaseX + 24, 36, pbDrawImagePositions(self.bitmap, [["Graphics/UI/Battle/icon_statuses", @spriteBaseX + 24, 36,
0, s * STATUS_ICON_HEIGHT, -1, STATUS_ICON_HEIGHT]]) 0, s * STATUS_ICON_HEIGHT, -1, STATUS_ICON_HEIGHT]])
end end
def draw_shiny_icon def draw_shiny_icon
return if !@battler.shiny? return if !@battler.shiny?
shiny_x = (@battler.opposes?(0)) ? 206 : -6 # Foe's/player's shiny_x = (@battler.opposes?(0)) ? 206 : -6 # Foe's/player's
pbDrawImagePositions(self.bitmap, [["Graphics/Pictures/shiny", @spriteBaseX + shiny_x, 36]]) pbDrawImagePositions(self.bitmap, [["Graphics/UI/shiny", @spriteBaseX + shiny_x, 36]])
end end
def draw_special_form_icon def draw_special_form_icon
# Mega Evolution/Primal Reversion icon # Mega Evolution/Primal Reversion icon
if @battler.mega? if @battler.mega?
pbDrawImagePositions(self.bitmap, [["Graphics/Pictures/Battle/icon_mega", @spriteBaseX + 8, 34]]) pbDrawImagePositions(self.bitmap, [["Graphics/UI/Battle/icon_mega", @spriteBaseX + 8, 34]])
elsif @battler.primal? elsif @battler.primal?
filename = nil filename = nil
if @battler.isSpecies?(:GROUDON) if @battler.isSpecies?(:GROUDON)
filename = "Graphics/Pictures/Battle/icon_primal_Groudon" filename = "Graphics/UI/Battle/icon_primal_Groudon"
elsif @battler.isSpecies?(:KYOGRE) elsif @battler.isSpecies?(:KYOGRE)
filename = "Graphics/Pictures/Battle/icon_primal_Kyogre" filename = "Graphics/UI/Battle/icon_primal_Kyogre"
end end
primalX = (@battler.opposes?) ? 208 : -28 # Foe's/player's primalX = (@battler.opposes?) ? 208 : -28 # Foe's/player's
pbDrawImagePositions(self.bitmap, [[filename, @spriteBaseX + primalX, 4]]) if filename pbDrawImagePositions(self.bitmap, [[filename, @spriteBaseX + primalX, 4]]) if filename
@@ -272,7 +272,7 @@ class Battle::Scene::PokemonDataBox < Sprite
def draw_owned_icon def draw_owned_icon
return if !@battler.owned? || !@battler.opposes?(0) # Draw for foe Pokémon only return if !@battler.owned? || !@battler.opposes?(0) # Draw for foe Pokémon only
pbDrawImagePositions(self.bitmap, [["Graphics/Pictures/Battle/icon_own", @spriteBaseX + 8, 36]]) pbDrawImagePositions(self.bitmap, [["Graphics/UI/Battle/icon_own", @spriteBaseX + 8, 36]])
end end
def refresh def refresh
@@ -418,7 +418,7 @@ class Battle::Scene::AbilitySplashBar < Sprite
@side = side @side = side
@battler = nil @battler = nil
# Create sprite wrapper that displays background graphic # Create sprite wrapper that displays background graphic
@bgBitmap = AnimatedBitmap.new("Graphics/Pictures/Battle/ability_bar") @bgBitmap = AnimatedBitmap.new("Graphics/UI/Battle/ability_bar")
@bgSprite = Sprite.new(viewport) @bgSprite = Sprite.new(viewport)
@bgSprite.bitmap = @bgBitmap.bitmap @bgSprite.bitmap = @bgBitmap.bitmap
@bgSprite.src_rect.y = (side == 0) ? 0 : @bgBitmap.height / 2 @bgSprite.src_rect.y = (side == 0) ? 0 : @bgBitmap.height / 2
@@ -105,7 +105,7 @@ module Battle::Scene::Animation::BallAnimationMixin
if traSprite.bitmap.width < traSprite.bitmap.height * 2 if traSprite.bitmap.width < traSprite.bitmap.height * 2
ball.setVisible(7, true) ball.setVisible(7, true)
ballStartX = traSprite.x ballStartX = traSprite.x
ballStartX -= ball.totalDuration * (Graphics.width / (2 * 16)) if !safariThrow ballStartX -= ball.totalDuration * (Graphics.width / 32) if !safariThrow
ballStartY = traSprite.y - (traSprite.bitmap.height / 2) ballStartY = traSprite.y - (traSprite.bitmap.height / 2)
return ballStartX, ballStartY return ballStartX, ballStartY
end end
@@ -122,11 +122,11 @@ module Battle::Scene::Animation::BallAnimationMixin
# Arm stretched out behind player # Arm stretched out behind player
ball.setVisible(0, true) ball.setVisible(0, true)
ball.setXY(0, coordSets[0][0], coordSets[0][1]) ball.setXY(0, coordSets[0][0], coordSets[0][1])
ball.moveDelta(0, 5, -5 * (Graphics.width / (2 * 16)), 0) if !safariThrow ball.moveDelta(0, 5, -5 * (Graphics.width / 32), 0) if !safariThrow
ball.setDelta(0, -12, 0) if safariThrow ball.setDelta(0, -12, 0) if safariThrow
# Arm mid throw # Arm mid throw
ball.setDelta(5, coordSets[1][0], coordSets[1][1]) ball.setDelta(5, coordSets[1][0], coordSets[1][1])
ball.moveDelta(5, 2, -2 * (Graphics.width / (2 * 16)), 0) if !safariThrow ball.moveDelta(5, 2, -2 * (Graphics.width / 32), 0) if !safariThrow
ball.setDelta(5, 34, 0) if safariThrow ball.setDelta(5, 34, 0) if safariThrow
# Start of throw # Start of throw
ball.setDelta(7, coordSets[2][0], coordSets[2][1]) ball.setDelta(7, coordSets[2][0], coordSets[2][1])
@@ -137,7 +137,7 @@ module Battle::Scene::Animation::BallAnimationMixin
ballStartX += c[0] ballStartX += c[0]
ballStartY += c[1] ballStartY += c[1]
end end
ballStartX -= ball.totalDuration * (Graphics.width / (2 * 16)) if !safariThrow ballStartX -= ball.totalDuration * (Graphics.width / 32) if !safariThrow
ballStartX += 8 if safariThrow # -12 + 34 - 14 ballStartX += 8 if safariThrow # -12 + 34 - 14
return ballStartX, ballStartY return ballStartX, ballStartY
end end
@@ -162,14 +162,14 @@ class Battle::Scene::Animation::LineupAppear < Battle::Scene::Animation
def createBall(idxBall, delay, dir) def createBall(idxBall, delay, dir)
# Choose ball's graphic # Choose ball's graphic
idxParty = getPartyIndexFromBallIndex(idxBall) idxParty = getPartyIndexFromBallIndex(idxBall)
graphicFilename = "Graphics/Pictures/Battle/icon_ball_empty" graphicFilename = "Graphics/UI/Battle/icon_ball_empty"
if idxParty >= 0 && idxParty < @party.length && @party[idxParty] if idxParty >= 0 && idxParty < @party.length && @party[idxParty]
if !@party[idxParty].able? if !@party[idxParty].able?
graphicFilename = "Graphics/Pictures/Battle/icon_ball_faint" graphicFilename = "Graphics/UI/Battle/icon_ball_faint"
elsif @party[idxParty].status != :NONE elsif @party[idxParty].status != :NONE
graphicFilename = "Graphics/Pictures/Battle/icon_ball_status" graphicFilename = "Graphics/UI/Battle/icon_ball_status"
else else
graphicFilename = "Graphics/Pictures/Battle/icon_ball" graphicFilename = "Graphics/UI/Battle/icon_ball"
end end
end end
# Set up ball sprite # Set up ball sprite
@@ -268,7 +268,7 @@ class PBAnimTiming
@colorAlpha = nil @colorAlpha = nil
@duration = 5 @duration = 5
@flashScope = 0 @flashScope = 0
@flashColor = Color.new(255, 255, 255, 255) @flashColor = Color.white
@flashDuration = 5 @flashDuration = 5
end end
@@ -722,7 +722,7 @@ class PBAnimationPlayerX
@animsprites[i].visible = false @animsprites[i].visible = false
end end
# Create background colour sprite # Create background colour sprite
@bgColor = ColoredPlane.new(Color.new(0, 0, 0), @viewport) @bgColor = ColoredPlane.new(Color.black, @viewport)
@bgColor.z = 5 @bgColor.z = 5
@bgColor.opacity = 0 @bgColor.opacity = 0
@bgColor.refresh @bgColor.refresh
@@ -733,7 +733,7 @@ class PBAnimationPlayerX
@bgGraphic.opacity = 0 @bgGraphic.opacity = 0
@bgGraphic.refresh @bgGraphic.refresh
# Create foreground colour sprite # Create foreground colour sprite
@foColor = ColoredPlane.new(Color.new(0, 0, 0), @viewport) @foColor = ColoredPlane.new(Color.black, @viewport)
@foColor.z = 85 @foColor.z = 85
@foColor.opacity = 0 @foColor.opacity = 0
@foColor.refresh @foColor.refresh
@@ -66,7 +66,7 @@ class Battle::Scene::SafariDataBox < Sprite
super(viewport) super(viewport)
@selected = 0 @selected = 0
@battle = battle @battle = battle
@databox = AnimatedBitmap.new("Graphics/Pictures/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 = BitmapWrapper.new(@databox.width, @databox.height)
@@ -256,9 +256,9 @@ class Battle::Scene
phase.times do |i| phase.times do |i|
y = [48, 80, 112][i] y = [48, 80, 112][i]
x = (ratings1[i] == ratings2[i]) ? 64 : ((ratings1[i] > ratings2[i]) ? 0 : 32) x = (ratings1[i] == ratings2[i]) ? 64 : ((ratings1[i] > ratings2[i]) ? 0 : 32)
images.push(["Graphics/Pictures/judgment", 64 - 16, y, x, 0, 32, 32]) images.push(["Graphics/UI/Battle/judgment", 64 - 16, y, x, 0, 32, 32])
x = (ratings1[i] == ratings2[i]) ? 64 : ((ratings1[i] < ratings2[i]) ? 0 : 32) x = (ratings1[i] == ratings2[i]) ? 64 : ((ratings1[i] < ratings2[i]) ? 0 : 32)
images.push(["Graphics/Pictures/judgment", 224 - 16, y, x, 0, 32, 32]) images.push(["Graphics/UI/Battle/judgment", 224 - 16, y, x, 0, 32, 32])
end end
pbDrawImagePositions(window.contents, images) pbDrawImagePositions(window.contents, images)
window.contents.fill_rect(16, 150, 256, 4, Color.new(80, 80, 80)) window.contents.fill_rect(16, 150, 256, 4, Color.new(80, 80, 80))
@@ -69,7 +69,7 @@ class DarknessSprite < Sprite
end end
def refresh def refresh
@darkness.fill_rect(0, 0, Graphics.width, Graphics.height, Color.new(0, 0, 0, 255)) @darkness.fill_rect(0, 0, Graphics.width, Graphics.height, Color.black)
cx = Graphics.width / 2 cx = Graphics.width / 2
cy = Graphics.height / 2 cy = Graphics.height / 2
cradius = @radius cradius = @radius
@@ -138,7 +138,7 @@ def pbBattleAnimation(bgm = nil, battletype = 0, foe = nil)
$PokemonGlobal.nextBattleBack = nil $PokemonGlobal.nextBattleBack = nil
$PokemonEncounters.reset_step_count $PokemonEncounters.reset_step_count
# Fade back to the overworld in 0.4 seconds # Fade back to the overworld in 0.4 seconds
viewport.color = Color.new(0, 0, 0, 255) viewport.color = Color.black
timer = 0.0 timer = 0.0
loop do loop do
Graphics.update Graphics.update
@@ -179,7 +179,7 @@ def pbBattleAnimationCore(anim, viewport, location, num_flashes = 2)
$game_temp.background_bitmap = Graphics.snap_to_bitmap $game_temp.background_bitmap = Graphics.snap_to_bitmap
# Play main animation # Play main animation
Graphics.freeze Graphics.freeze
viewport.color = Color.new(0, 0, 0, 255) # Ensure screen is black viewport.color = Color.black # Ensure screen is black
Graphics.transition(25, "Graphics/Transitions/" + anim) Graphics.transition(25, "Graphics/Transitions/" + anim)
# Slight pause after animation before starting up the battle scene # Slight pause after animation before starting up the battle scene
pbWait(Graphics.frame_rate / 10) pbWait(Graphics.frame_rate / 10)
@@ -421,7 +421,7 @@ SpecialBattleIntroAnimations.register("alternate_vs_trainer_animation", 50, #
viewvs.dispose viewvs.dispose
viewopp.dispose viewopp.dispose
viewplayer.dispose viewplayer.dispose
viewport.color = Color.new(0, 0, 0, 255) # Ensure screen is black viewport.color = Color.black # Ensure screen is black
} }
) )
@@ -14,8 +14,9 @@ class PokemonGlobalMetadata
attr_accessor :stepcount attr_accessor :stepcount
attr_accessor :pcItemStorage attr_accessor :pcItemStorage
attr_accessor :mailbox attr_accessor :mailbox
attr_accessor :phoneNumbers attr_accessor :phoneNumbers # Deprecated
attr_accessor :phoneTime attr_accessor :phoneTime # Deprecated
attr_accessor :phone
attr_accessor :partner attr_accessor :partner
attr_accessor :creditsPlayed attr_accessor :creditsPlayed
# Pokédex # Pokédex
@@ -64,8 +65,7 @@ class PokemonGlobalMetadata
@stepcount = 0 @stepcount = 0
@pcItemStorage = nil @pcItemStorage = nil
@mailbox = nil @mailbox = nil
@phoneNumbers = [] @phone = Phone.new
@phoneTime = 0
@partner = nil @partner = nil
@creditsPlayed = false @creditsPlayed = false
# Pokédex # Pokédex
@@ -72,17 +72,17 @@ def pbHiddenMoveAnimation(pokemon)
viewport = Viewport.new(0, 0, 0, 0) viewport = Viewport.new(0, 0, 0, 0)
viewport.z = 99999 viewport.z = 99999
bg = Sprite.new(viewport) bg = Sprite.new(viewport)
bg.bitmap = RPG::Cache.picture("hiddenMovebg") bg.bitmap = RPG::Cache.ui("Field move/bg")
sprite = PokemonSprite.new(viewport) sprite = PokemonSprite.new(viewport)
sprite.setOffset(PictureOrigin::CENTER) sprite.setOffset(PictureOrigin::CENTER)
sprite.setPokemonBitmap(pokemon) sprite.setPokemonBitmap(pokemon)
sprite.z = 1 sprite.z = 1
sprite.visible = false sprite.visible = false
strobebitmap = AnimatedBitmap.new("Graphics/Pictures/hiddenMoveStrobes") strobebitmap = AnimatedBitmap.new("Graphics/UI/Field move/strobes")
strobes = [] strobes = []
15.times do |i| 15.times do |i|
strobe = BitmapSprite.new(26 * 2, 8 * 2, viewport) strobe = BitmapSprite.new(52, 16, viewport)
strobe.bitmap.blt(0, 0, strobebitmap.bitmap, Rect.new(0, (i % 2) * 8 * 2, 26 * 2, 8 * 2)) strobe.bitmap.blt(0, 0, strobebitmap.bitmap, Rect.new(0, (i % 2) * 16, 52, 16))
strobe.z = (i.even? ? 2 : 0) strobe.z = (i.even? ? 2 : 0)
strobe.visible = false strobe.visible = false
strobes.push(strobe) strobes.push(strobe)
+633 -259
View File
@@ -1,305 +1,679 @@
#=============================================================================== # TODO: Add an information window with details of the person in a phone call.
# Register contacts # Make this work with common event calls (create and dispose the info
#=============================================================================== # window in start_message and end_message).
def pbPhoneRegisterNPC(ident, name, mapid, showmessage = true) # TODO: Rewrite the Phone UI. Have more than one method. Choosable icons/marks
$PokemonGlobal.phoneNumbers = [] if !$PokemonGlobal.phoneNumbers # for each contact? Show an icon representing phone signal.
exists = pbFindPhoneTrainer(ident, name)
if exists
return if exists[0] # Already visible
exists[0] = true # Make visible
else
phonenum = [true, ident, name, mapid]
$PokemonGlobal.phoneNumbers.push(phonenum)
end
pbMessage(_INTL("\\me[Register phone]Registered {1} in the Pokégear.", name)) if showmessage
end
def pbPhoneRegister(event, trainertype, trainername) # TODO: Add a trainer comment for giving a trainer a common event ID.
$PokemonGlobal.phoneNumbers = [] if !$PokemonGlobal.phoneNumbers # TODO: Add calling a contact at a particular time forcing rematch readiness.
return if pbFindPhoneTrainer(trainertype, trainername) # Add trainer comments for this.
phonenum = [] # TODO: Allow individual trainers to never arrange a rematch by themself, thus
phonenum.push(true) # requiring the player to call them at their particular time of day/week.
phonenum.push(trainertype) # TODO: Be able to put the Phone on silent mode (prevent all phone calls from
phonenum.push(trainername) # trainers, but allow scripted calls as normal).
phonenum.push(0) # time to next battle
phonenum.push(0) # can battle
phonenum.push(0) # battle count
if event
phonenum.push(event.map.map_id)
phonenum.push(event.id)
end
$PokemonGlobal.phoneNumbers.push(phonenum)
end
def pbPhoneDeleteContact(index) # TODO: Better messages, more customisation of messages.
$PokemonGlobal.phoneNumbers[index][0] = false # Remove from contact list # TODO: Add a Debug way of upgrading old phone script calls to new ones, or at
if $PokemonGlobal.phoneNumbers[index].length == 8 # least to find events using old phone scripts for the dev to update.
$PokemonGlobal.phoneNumbers[index][3] = 0 # Reset countdown #===============================================================================
$PokemonGlobal.phoneNumbers[index][4] = 0 # Reset countdown #
#===============================================================================
class Phone
attr_accessor :contacts
attr_accessor :rematch_variant, :rematches_enabled
attr_accessor :time_to_next_call, :last_refresh_time
def initialize
@contacts = []
@rematch_variant = 0 # Original variant is 0, first rematch variant is 1, etc.
@rematches_enabled = Settings::PHONE_REMATCHES_POSSIBLE_FROM_BEGINNING
@time_to_next_call = 0.0
@last_refresh_time = 0
end
# Returns a visible contact only.
def get(trainer, *args)
@contacts.each do |contact|
next if !contact.visible?
next if contact.trainer? != trainer
if trainer
next if contact.trainer_type != args[0] ||
contact.name != args[1] || contact.start_version != (args[2] || 0)
else
next if contact.name != args[0]
end
return contact
end
return nil
end
def get_version(trainer_type, name, start_version = 0)
return 0 if !GameData::TrainerType.exists?(trainer_type)
trainer_type = GameData::TrainerType.get(trainer_type).id
contact = get(true, trainer_type, name, start_version)
return (contact) ? contact.version : 0
end
# Trainer type, name[, start_version]
# Name
def can_add?(*args)
return false if !$player.has_pokegear
if args.length == 1
# Non-trainer (name only)
return false if get(false, args[0])
else
# Trainer (has at least trainer type and name)
return false if !GameData::TrainerType.exists?(args[0])
trainer_type = GameData::TrainerType.get(args[0]).id
return false if get(true, trainer_type, args[1], args[2] || 0)
end
return true
end
# Event, trainer type, name, versions_count = 1, start_version = 0
# Map ID, event ID, trainer type, name, versions_count = 1, start_version = 0
# Map ID, name, common event ID
def add(*args)
if args[0].is_a?(Game_Event)
# Trainer
return false if !GameData::TrainerType.exists?(args[1])
trainer_type = GameData::TrainerType.get(args[1]).id
name = args[2]
contact = get(true, trainer_type, name, args[3] || 0)
if contact
contact.visible = true
else
contact = Contact.new(true, args[0].map_id, args[0].id,
trainer_type, name, args[3] || 1, args[4] || 0)
contact.increment_version
@contacts.push(contact)
end
elsif args[1].is_a?(Numeric)
# Trainer
return false if !GameData::TrainerType.exists?(args[2])
trainer_type = GameData::TrainerType.get(args[2]).id
name = args[3]
contact = get(true, trainer_type, name, args[4] || 0)
if contact
contact.visible = true
else
contact = Contact.new(true, args[0], args[1],
trainer_type, name, args[4] || 1, args[5] || 0)
contact.increment_version
@contacts.push(contact)
end
else
# Non-trainer
name = args[1]
contact = get(false, name)
if contact
contact.visible = true
else
contact = Contact.new(false, *args)
@contacts.push(contact)
end
end
return true
end
#=============================================================================
# Checks once every second.
def refresh_ready_trainers
return if !@rematches_enabled
time = pbGetTimeNow.to_i
return if @last_refresh_time == time
@last_refresh_time = time
@contacts.each do |contact|
next if !contact.trainer? || !contact.visible?
next if contact.rematch_flag > 0 # Already ready for rematch
if contact.time_to_ready <= 0
contact.time_to_ready = rand(20...40) * 60 # 20-40 minutes
end
contact.time_to_ready -= 1
next if contact.time_to_ready > 0
contact.rematch_flag = 1 # Ready for rematch
contact.set_trainer_event_ready_for_rematch
end
end
def reset_after_win(trainer_type, name, start_version = 0)
return if !GameData::TrainerType.exists?(trainer_type)
trainer_type = GameData::TrainerType.get(trainer_type).id
contact = get(true, trainer_type, name, start_version)
return if !contact
contact.variant_beaten = contact.version - contact.start_version
contact.increment_version
contact.rematch_flag = 0
contact.time_to_ready = 0.0
end
#=============================================================================
def self.rematch_variant
return $PokemonGlobal.phone.rematch_variant
end
def self.rematch_variant=(value)
$PokemonGlobal.phone.rematch_variant = value
end
def self.rematches_enabled
return $PokemonGlobal.phone.rematches_enabled
end
def self.rematches_enabled=(value)
$PokemonGlobal.phone.rematches_enabled = value
end
def self.get_trainer(*args)
return $PokemonGlobal.phone.get(true, *args)
end
def self.can_add?(*args)
return $PokemonGlobal.phone.can_add?(*args)
end
def self.add(*args)
ret = $PokemonGlobal.phone.add(*args)
if ret
if args[0].is_a?(Game_Event)
contact = $PokemonGlobal.phone.get(true, args[1], args[2], (args[4] || 0))
elsif args[1].is_a?(Numeric)
contact = $PokemonGlobal.phone.get(true, args[2], args[3], (args[5] || 0))
else
contact = $PokemonGlobal.phone.get(false, args[1])
end
pbMessage(_INTL("\\me[Register phone]Registered {1} in the Pokégear!", contact.display_name))
end
return ret
end
def self.add_silent(*args)
return $PokemonGlobal.phone.add(*args)
end
def self.increment_version(trainer_type, name, start_version = 0)
contact = $PokemonGlobal.phone.get(trainer_type, name, start_version)
contact.increment_version if contact
end
# TODO: Rename this.
def self.variant(trainer_type, name, start_version = 0)
contact = $PokemonGlobal.phone.get(trainer_type, name, start_version)
return contact.version - contact.start_version if contact
return start_version
end
def self.battle(trainer_type, name, start_version = 0)
contact = $PokemonGlobal.phone.get(true, trainer_type, name, start_version)
return false if !contact
contact.increment_version if contact.version == contact.start_version + contact.variant_beaten
return TrainerBattle.start(trainer_type, name, contact.version)
end
def self.reset_after_win(trainer_type, name, start_version = 0)
$PokemonGlobal.phone.reset_after_win(trainer_type, name, start_version)
end
def self.variant_beaten(trainer_type, name, start_version = 0)
contact = $PokemonGlobal.phone.get(true, trainer_type, name, start_version)
return 0 if !contact
return contact.variant_beaten
end end
end end
def pbPhoneRegisterBattle(message, event, trainertype, trainername, maxbattles) #===============================================================================
return false if !$player.has_pokegear # Can't register without a Pokégear #
return false if !GameData::TrainerType.exists?(trainertype) #===============================================================================
trainertype = GameData::TrainerType.get(trainertype).id class Phone
contact = pbFindPhoneTrainer(trainertype, trainername) class Contact
return false if contact && contact[0] # Existing contact and is visible attr_accessor :map_id, :event_id
message = _INTL("Let me register you.") if !message attr_accessor :name
return false if !pbConfirmMessage(message) attr_accessor :trainer_type, :start_version, :versions_count, :version
displayname = _INTL("{1} {2}", GameData::TrainerType.get(trainertype).name, attr_accessor :time_to_ready, :rematch_flag, :variant_beaten
pbGetMessageFromHash(MessageTypes::TrainerNames, trainername)) attr_accessor :common_event_id
if contact # Previously registered, just make visible attr_accessor :visible
contact[0] = true
else # Add new contact # Map ID, event ID, trainer type, name, versions count = 1, start version = 0
pbPhoneRegister(event, trainertype, trainername) # Map ID, name, common event ID
pbPhoneIncrement(trainertype, trainername, maxbattles) def initialize(trainer, *args)
@trainer = trainer
if @trainer
# Trainer
@map_id = args[0]
@event_id = args[1]
@trainer_type = args[2]
@name = args[3]
@versions_count = [args[4] || 1, 1].max # Includes the original version
@start_version = args[5] || 0
@version = @start_version
@variant_beaten = 0
@time_to_ready = 0
@rematch_flag = 0 # 0=counting down, 1=ready for rematch, 2=ready and told player
@common_event_id = 0
else
# Non-trainer
@map_id = args[0]
@name = args[1]
@common_event_id = args[2] || 0
end
@visible = true
end
def trainer?
return @trainer
end
def visible?
return @visible
end
def visible=(value)
return if @visible == value
@visible = value
if !value && trainer?
@time_to_ready = 0
@rematch_flag = 0
$game_self_switches[[@map_id, @event_id, "A"]] = true
$game_map.need_refresh = true
end
end
def common_event_call?
return @common_event_id > 0
end
def can_rematch?
return trainer? && @rematch_flag >= 1
end
def display_name
if trainer?
return sprintf("%s %s", GameData::TrainerType.get(@trainer_type).name,
pbGetMessageFromHash(MessageTypes::TrainerNames, @name))
end
return _INTL(@name)
end
def increment_version
return if !trainer?
max_variant = [$PokemonGlobal.phone.rematch_variant, @versions_count - 1].min
return if @version - @start_version >= max_variant
@version += 1
@time_to_ready = 0
@rematch_flag = 0
end
def set_trainer_event_ready_for_rematch
return if !@trainer
$game_self_switches[[@map_id, @event_id, "A"]] = false
$game_self_switches[[@map_id, @event_id, "B"]] = true
$game_map.need_refresh = true
end
end end
pbMessage(_INTL("\\me[Register phone]Registered {1} in the Pokégear.", displayname))
return true
end end
#=============================================================================== #===============================================================================
# Contact information #
#=============================================================================== #===============================================================================
def pbRandomPhoneTrainer class Phone
$PokemonGlobal.phoneNumbers = [] if !$PokemonGlobal.phoneNumbers module Call
temparray = [] module_function
this_map_metadata = $game_map.metadata
return nil if !this_map_metadata || !this_map_metadata.town_map_position def can_make?
currentRegion = this_map_metadata.town_map_position[0] return false if $game_map.metadata.has_flag?("NoPhoneSignal")
$PokemonGlobal.phoneNumbers.each do |num| return true
next if !num[0] || num.length != 8 # if not visible or not a trainer end
next if $game_map.map_id == num[6] # Can't call if on same map
caller_map_metadata = GameData::MapMetadata.try_get(num[6]) # For the player initiating the call.
next if !caller_map_metadata || !caller_map_metadata.town_map_position def can_call_contact?(contact)
# Can't call if in different region return false if !contact
next if caller_map_metadata.town_map_position[0] != currentRegion if !can_make?
temparray.push(num) pbMessage(_INTL("There is no phone signal here..."))
return false
end
return true if !contact.trainer?
if contact.map_id == $game_map.map_id
pbMessage(_INTL("The Trainer is close by.\nTalk to the Trainer in person!"))
return false
end
caller_map_metadata = GameData::MapMetadata.try_get(contact.map_id)
this_map_metadata = $game_map.metadata
if !caller_map_metadata || !caller_map_metadata.town_map_position ||
!this_map_metadata || !this_map_metadata.town_map_position ||
caller_map_metadata.town_map_position[0] != this_map_metadata.town_map_position[0]
pbMessage(_INTL("The Trainer is out of range."))
return false
end
return true
end
# Get a random trainer contact from the region the player is currently in,
# but is not in the same map as the player.
def get_random_trainer_for_incoming_call
player_location = $game_map.metadata&.town_map_position
return nil if !player_location
player_region = player_location[0]
valid_contacts = []
$PokemonGlobal.phone.contacts.each do |contact|
next if !contact.trainer? || !contact.visible?
next if contact.map_id == $game_map.map_id
# TODO: next if the contact's map name is the same as the current map's?
caller_map_metadata = GameData::MapMetadata.try_get(contact.map_id)
next if !caller_map_metadata || !caller_map_metadata.town_map_position
next if caller_map_metadata.town_map_position[0] != player_region
valid_contacts.push(contact)
end
return valid_contacts.sample
end
#===========================================================================
def make_incoming
return if !can_make?
contact = get_random_trainer_for_incoming_call
if contact
call = generate_trainer_dialogue(contact)
play(call, contact)
end
end
# Phone::Contact
# Trainer type, name[, start_version]
# Name (for non-trainers)
def make_outgoing(*args)
if args[0].is_a?(Phone::Contact)
contact = args[0]
elsif args.length > 1
contact = Phone.get(true, args[0], args[1], args[2] || 0) # Trainer
else
contact = Phone.get(false, args[0]) # Non-trainer
end
raise _INTL("Couldn't find phone contact given: {1}.", args.inspect) if !contact
return if !can_call_contact?(contact)
if contact.common_event_call?
if !pbCommonEvent(contact.common_event_id)
pbMessage(_INTL("{1}'s messages not defined.\nCouldn't call common event {2}.",
contact.display_name, contact.common_event_id))
end
else
call = generate_trainer_dialogue(contact)
play(call, contact)
end
end
def start_message(contact)
pbMessage(_INTL("......\\wt[5] ......\\1"))
end
def play(dialogue, contact)
start_message(contact)
contact_pokemon_species = get_random_contact_pokemon_species(contact)
random_encounter_species = get_random_encounter_species(contact)
contact_map_name = get_map_name(contact)
gender_colour_text = ""
if Settings::COLOR_PHONE_CALL_MESSAGES_BY_CONTACT_GENDER && contact.trainer?
data = GameData::TrainerType.try_get(contact.trainer_type)
if data
case data.gender
when 0 then gender_colour_text = "\\b"
when 1 then gender_colour_text = "\\r"
end
end
end
messages = dialogue.split("\\m")
messages.each_with_index do |message, i|
message.gsub!(/\\TN/, _INTL(contact.name))
message.gsub!(/\\TP/, contact_pokemon_species)
message.gsub!(/\\TE/, random_encounter_species)
message.gsub!(/\\TM/, contact_map_name)
message += "\\1" if i < messages.length - 1
pbMessage(gender_colour_text + message)
end
end_message(contact)
end
def end_message(contact)
pbMessage(_INTL("Click!\\wt[10]\n......\\wt[5] ......\\1"))
end
#===========================================================================
def generate_trainer_dialogue(contact)
validate contact => Phone::Contact
get_random_message = lambda do |messages|
msg = messages.sample
return "" if !msg
return pbGetMessageFromHash(MessageTypes::PhoneMessages, msg)
end
phone_data = pbLoadPhoneData
# Choose random greeting depending on time of day
ret = get_random_message.call(phone_data.greetings)
time = pbGetTimeNow
if PBDayNight.isMorning?(time)
modcall = get_random_message.call(phone_data.greetingsMorning)
ret = modcall if !nil_or_empty?(modcall)
elsif PBDayNight.isEvening?(time)
modcall = get_random_message.call(phone_data.greetingsEvening)
ret = modcall if !nil_or_empty?(modcall)
end
ret += "\\m"
if Phone.rematches_enabled && (contact.rematch_flag == 1 ||
(contact.rematch_flag == 2 && rand(100) < 50))
# If ready for rematch, tell the player (50% chance to remind the player)
ret += get_random_message.call(phone_data.battleRequests)
contact.rematch_flag = 2 # Ready for rematch and told player
elsif rand(100) < 75
# Choose random body
ret += get_random_message.call(phone_data.bodies1)
ret += "\\m"
ret += get_random_message.call(phone_data.bodies2)
else
# Choose random generic
ret += get_random_message.call(phone_data.generics)
end
return ret
end
def get_random_contact_pokemon_species(contact)
return "" if !contact.trainer?
version = [contact.version - 1, contact.start_version].max
trainer_data = GameData::Trainer.try_get(contact.trainer_type, contact.name, version)
return "" if !trainer_data
pkmn = trainer_data.pokemon.sample[:species]
return GameData::Species.get(pkmn).name
end
def get_random_encounter_species(contact)
return "" if !contact.trainer?
encounter_data = GameData::Encounter.get(contact.map_id, $PokemonGlobal.encounter_version)
return "" if !encounter_data
get_species_from_table = lambda do |encounter_table|
return nil if !encounter_table || encounter_table.length == 0
len = [encounter_table.length, 4].min # From first 4 slots only
return encounter_table[rand(len)][1]
end
enc_tables = encounter_data.types
species = get_species_from_table.call(enc_tables[:Land])
if !species
species = get_species_from_table.call(enc_tables[:Cave])
if !species
species = get_species_from_table.call(enc_tables[:Water])
end
end
return "" if !species
return GameData::Species.get(species).name
end
def get_map_name(contact)
return pbGetMapNameFromId(contact.map_id)
end
end end
return nil if temparray.length == 0
return temparray[rand(temparray.length)]
end
def pbFindPhoneTrainer(tr_type, tr_name) # Ignores whether visible or not
return nil if !$PokemonGlobal.phoneNumbers
$PokemonGlobal.phoneNumbers.each do |num|
return num if num[1] == tr_type && num[2] == tr_name # If a match
end
return nil
end
def pbHasPhoneTrainer?(tr_type, tr_name)
return pbFindPhoneTrainer(tr_type, tr_name) != nil
end
def pbPhoneBattleCount(tr_type, tr_name)
trainer = pbFindPhoneTrainer(tr_type, tr_name)
return (trainer) ? trainer[5] : 0
end
def pbPhoneReadyToBattle?(tr_type, tr_name)
trainer = pbFindPhoneTrainer(tr_type, tr_name)
return (trainer && trainer[4] >= 2)
end end
#=============================================================================== #===============================================================================
# Contact rematch data modifications #
#===============================================================================
def pbPhoneIncrement(tr_type, tr_name, maxbattles)
trainer = pbFindPhoneTrainer(tr_type, tr_name)
return if !trainer
trainer[5] += 1 if trainer[5] < maxbattles # Increment battle count
trainer[3] = 0 # reset time to can-battle
trainer[4] = 0 # reset can-battle flag
end
def pbPhoneReset(tr_type, tr_name)
trainer = pbFindPhoneTrainer(tr_type, tr_name)
return false if !trainer
trainer[3] = 0 # reset time to can-battle
trainer[4] = 0 # reset can-battle flag
return true
end
def pbSetReadyToBattle(num)
return if !num[6] || !num[7]
$game_self_switches[[num[6], num[7], "A"]] = false
$game_self_switches[[num[6], num[7], "B"]] = true
$game_map.need_refresh = true
end
#===============================================================================
# Phone-related counters
#=============================================================================== #===============================================================================
EventHandlers.add(:on_frame_update, :phone_call_counter, EventHandlers.add(:on_frame_update, :phone_call_counter,
proc { proc {
next if !$player&.has_pokegear next if !$player&.has_pokegear
# Reset time to next phone call if necessary
if !$PokemonGlobal.phoneTime || $PokemonGlobal.phoneTime <= 0
$PokemonGlobal.phoneTime = rand(20...40) * 60 * Graphics.frame_rate
end
# Don't count down various phone times if other things are happening # Don't count down various phone times if other things are happening
$PokemonGlobal.phoneNumbers = [] if !$PokemonGlobal.phoneNumbers
next if $game_temp.in_menu || $game_temp.in_battle || $game_temp.message_window_showing next if $game_temp.in_menu || $game_temp.in_battle || $game_temp.message_window_showing
next if $game_player.move_route_forcing || pbMapInterpreterRunning? next if $game_player.move_route_forcing || pbMapInterpreterRunning?
# Count down time to next phone call
$PokemonGlobal.phoneTime -= 1
# Count down time to next can-battle for each trainer contact # Count down time to next can-battle for each trainer contact
if $PokemonGlobal.phoneTime % Graphics.frame_rate == 0 # Every second $PokemonGlobal.phone.refresh_ready_trainers
$PokemonGlobal.phoneNumbers.each do |num| # Count down time to next phone call
next if !num[0] || num.length != 8 # if not visible or not a trainer if $PokemonGlobal.phone.time_to_next_call <= 0
# Reset time to next can-battle if necessary $PokemonGlobal.phone.time_to_next_call = rand(20...40) * 60.0 # 20-40 minutes
if num[4] == 0
num[3] = rand(20...40) * 60 # 20-40 minutes
num[4] = 1
end
# Count down time to next can-battle
num[3] -= 1
# Ready to battle
if num[3] <= 0 && num[4] == 1
num[4] = 2 # set ready-to-battle flag
pbSetReadyToBattle(num)
end
end
end end
$PokemonGlobal.phone.time_to_next_call -= Graphics.delta_s
next if $PokemonGlobal.phone.time_to_next_call > 0
# Time for a random phone call; generate one # Time for a random phone call; generate one
if $PokemonGlobal.phoneTime <= 0 Phone::Call.make_incoming
# find all trainer phone numbers
phonenum = pbRandomPhoneTrainer
if phonenum
call = pbPhoneGenerateCall(phonenum)
pbPhoneCall(call, phonenum)
end
end
} }
) )
#=============================================================================== #===============================================================================
# Player calls a contact # Deprecated.
#=============================================================================== #===============================================================================
def pbCallTrainer(trtype, trname) # Called by events.
trainer = pbFindPhoneTrainer(trtype, trname) # @>Conditional Branch: Phone.can_add?(trainer_type, name, start_version)
return if !trainer # @>Text: Let me register you.
# Special NPC contacts # @>Show Choices: Yes, No
if trainer.length != 8 # : When [Yes]
if !pbCommonEvent(trtype) # @>Conditional Branch: Phone.add(get_self, trainer_type, name, start_version, versions_count)
pbMessage(_INTL("{1}'s messages not defined.\nCouldn't call common event {2}.", trainer[2], trtype)) # @>Text: Thanks! (optional)
end # @>
return # : Branch End
end # : When [No]
# Trainer contacts # @>Text: Oh, okay then. (optional)
if $game_map.map_id == trainer[6] # @>
pbMessage(_INTL("The Trainer is close by.\nTalk to the Trainer in person!")) # : Branch End
return # : Branch End
end # @>
caller_map_metadata = GameData::MapMetadata.try_get(trainer[6]) # @deprecated This method is slated to be removed in v22.
this_map_metadata = $game_map.metadata def pbPhoneRegisterBattle(message, event, trainer_type, name, versions_count)
if !caller_map_metadata || !caller_map_metadata.town_map_position || Deprecation.warn_method("pbPhoneRegisterBattle", "v22", "several scripts and event commands; see def pbPhoneRegisterBattle")
!this_map_metadata || !this_map_metadata.town_map_position || return false if !Phone.can_add?(trainer_type, name, 0)
caller_map_metadata.town_map_position[0] != this_map_metadata.town_map_position[0] message = _INTL("Let me register you.") if !message
pbMessage(_INTL("The Trainer is out of range.")) return false if !pbConfirmMessage(message)
return # Can't call if in different region return Phone.add(event, trainer_type, name, 0, versions_count)
end
call = pbPhoneGenerateCall(trainer)
pbPhoneCall(call, trainer)
end end
#=============================================================================== # @deprecated This method is slated to be removed in v22.
# Generate phone message def pbPhoneRegister(event, trainer_type, name)
#=============================================================================== Deprecation.warn_method("pbPhoneRegister", "v22", "Phone.add_silent(event, trainer_type, name)")
def pbPhoneGenerateCall(phonenum) Phone.add_silent(event, trainer_type, name)
phoneData = pbLoadPhoneData end
# Choose random greeting depending on time of day
call = pbRandomPhoneItem(phoneData.greetings) # Called by events.
time = pbGetTimeNow # @deprecated This method is slated to be removed in v22.
if PBDayNight.isMorning?(time) def pbPhoneRegisterNPC(common_event_id, name, map_id, show_message = true)
modcall = pbRandomPhoneItem(phoneData.greetingsMorning) Deprecation.warn_method("pbPhoneRegisterNPC", "v22", "Phone.add(map_id, name, common_event_id) or Phone.add_silent(map_id, name, common_event_id)")
call = modcall if modcall && modcall != "" if show_message
elsif PBDayNight.isEvening?(time) Phone.add(map_id, name, common_event_id)
modcall = pbRandomPhoneItem(phoneData.greetingsEvening)
call = modcall if modcall && modcall != ""
end
call += "\\m"
if phonenum[4] == 2 || (rand(2) == 0 && phonenum[4] == 3)
# If "can battle" is set, make ready to battle
call += pbRandomPhoneItem(phoneData.battleRequests)
pbSetReadyToBattle(phonenum)
phonenum[4] = 3
elsif rand(4) < 3
# Choose random body
call += pbRandomPhoneItem(phoneData.bodies1)
call += "\\m"
call += pbRandomPhoneItem(phoneData.bodies2)
else else
# Choose random generic Phone.add_silent(map_id, name, common_event_id)
call += pbRandomPhoneItem(phoneData.generics)
end end
return call
end end
def pbRandomPhoneItem(array) # @deprecated This method is slated to be removed in v22.
ret = array[rand(array.length)] def pbPhoneDeleteContact(index)
ret = "" if !ret Deprecation.warn_method("pbPhoneDeleteContact", "v22", "$PokemonGlobal.phone.contacts[index].visible = false")
return pbGetMessageFromHash(MessageTypes::PhoneMessages, ret) $PokemonGlobal.phone.contacts[index].visible = false
end end
def pbRandomEncounterSpecies(enc_table) # @deprecated This method is slated to be removed in v22.
return nil if !enc_table || enc_table.length == 0 def pbFindPhoneTrainer(trainer_type, name)
len = [enc_table.length, 4].min Deprecation.warn_method("pbFindPhoneTrainer", "v22", "Phone.get(trainer_type, name)")
return enc_table[rand(len)][1] return Phone.get(trainer_type, name)
end end
def pbEncounterSpecies(phonenum) # @deprecated This method is slated to be removed in v22.
return "" if !phonenum[6] || phonenum[6] == 0 def pbHasPhoneTrainer?(trainer_type, name)
encounter_data = GameData::Encounter.get(phonenum[6], $PokemonGlobal.encounter_version) Deprecation.warn_method("pbHasPhoneTrainer", "v22", "Phone.get(trainer_type, name) != nil")
return "" if !encounter_data return Phone.get(trainer_type, name) != nil
enc_tables = encounter_data.types
species = pbRandomEncounterSpecies(enc_tables[:Land])
if !species
species = pbRandomEncounterSpecies(enc_tables[:Cave])
if !species
species = pbRandomEncounterSpecies(enc_tables[:Water])
end
end
return "" if !species
return GameData::Species.get(species).name
end end
def pbTrainerSpecies(phonenum) # @deprecated This method is slated to be removed in v22.
return "" if !phonenum[0] def pbPhoneReadyToBattle?(trainer_type, name)
partyid = [0, phonenum[5] - 1].max Deprecation.warn_method("pbPhoneReadyToBattle", "v22", "Phone.get(trainer_type, name).can_rematch?")
trainer_data = GameData::Trainer.try_get(phonenum[1], phonenum[2], partyid) contact = Phone.get(trainer_type, name)
return "" if !trainer_data return contact && contact.can_rematch?
if trainer_data.pokemon.length == 1
pkmn = trainer_data.pokemon[0][:species]
else
pkmn = trainer_data.pokemon[rand(trainer_data.pokemon.length)][:species]
end
return GameData::Species.get(pkmn).name
end end
def pbTrainerMapName(phonenum) # @deprecated This method is slated to be removed in v22.
return "" if !phonenum[6] || phonenum[6] == 0 def pbPhoneReset(tr_type, tr_name)
return pbGetMapNameFromId(phonenum[6]) Deprecation.warn_method("pbPhoneReadyToBattle", "v22", "Phone.get(trainer_type, name) and other things")
contact = Phone.get(trainer_type, name)
return false if !contact
contact.time_to_ready = 0
contact.rematch_flag = 0
$game_self_switches[[contact.map_id, contact.event_id, "A"]] = true
$game_map.need_refresh = true
return true
end end
#=============================================================================== # Called by events.
# The phone call itself # @deprecated This method is slated to be removed in v22.
#=============================================================================== def pbPhoneBattleCount(trainer_type, name)
def pbPhoneCall(call, phonenum) Deprecation.warn_method("pbPhoneBattleCount", "v22", "Phone.variant(trainer_type, name)")
pbMessage(_INTL("......\\wt[5] ......\\1")) return Phone.variant(trainer_type, name)
encspecies = pbEncounterSpecies(phonenum) end
trainerspecies = pbTrainerSpecies(phonenum)
trainermap = pbTrainerMapName(phonenum) # Called by events.
messages = call.split("\\m") # @deprecated This method is slated to be removed in v22.
messages.length.times do |i| def pbPhoneIncrement(trainer_type, name, versions_count)
messages[i].gsub!(/\\TN/, phonenum[2]) Deprecation.warn_method("pbPhoneIncrement", "v22", "Phone.increment_version(trainer_type, name, start_version)")
messages[i].gsub!(/\\TP/, trainerspecies) Phone.increment_version(trainer_type, name, 0)
messages[i].gsub!(/\\TE/, encspecies) end
messages[i].gsub!(/\\TM/, trainermap)
messages[i] += "\\1" if i < messages.length - 1 # Used in phone calls that say they're ready for a rematch, used in Debug function.
pbMessage(messages[i]) # @deprecated This method is slated to be removed in v22.
end def pbSetReadyToBattle(contact)
pbMessage(_INTL("Click!\\wt[10]\n......\\wt[5] ......\\1")) Deprecation.warn_method("pbSetReadyToBattle", "v22", "contact.set_trainer_event_ready_for_rematch")
contact.set_trainer_event_ready_for_rematch
end
# @deprecated This method is slated to be removed in v22.
def pbRandomPhoneTrainer
Deprecation.warn_method("pbRandomPhoneTrainer", "v22", "Phone::Call.get_random_trainer_for_incoming_call")
return Phone::Call.get_random_trainer_for_incoming_call
end
# @deprecated This method is slated to be removed in v22.
def pbCallTrainer(trainer_type, name)
Deprecation.warn_method("pbCallTrainer", "v22", "Phone::Call.make_outgoing(trainer_type, name)")
Phone::Call.make_outgoing(trainer_type, name)
end
# @deprecated This method is slated to be removed in v22.
def pbPhoneGenerateCall(contact)
Deprecation.warn_method("pbPhoneGenerateCall", "v22", "Phone::Call.generate_trainer_dialogue(contact)")
return Phone::Call.generate_trainer_dialogue(contact)
end
# @deprecated This method is slated to be removed in v22.
def pbPhoneCall(dialogue, contact)
Deprecation.warn_method("pbPhoneCall", "v22", "Phone::Call.play(dialogue, contact)")
Phone::Call.play(dialogue, contact)
end
# @deprecated This method is slated to be removed in v22.
def pbEncounterSpecies(contact)
Deprecation.warn_method("pbEncounterSpecies", "v22", "Phone::Call.get_random_encounter_species(contact)")
return Phone::Call.get_random_encounter_species(contact)
end
# @deprecated This method is slated to be removed in v22.
def pbTrainerSpecies(contact)
Deprecation.warn_method("pbTrainerSpecies", "v22", "Phone::Call.get_random_contact_pokemon_species(contact)")
return Phone::Call.get_random_contact_pokemon_species(contact)
end
# @deprecated This method is slated to be removed in v22.
def pbTrainerMapName(contact)
Deprecation.warn_method("pbTrainerMapName", "v22", "Phone::Call.get_map_name(contact)")
return Phone::Call.get_map_name(contact)
end end
+3 -3
View File
@@ -32,7 +32,7 @@ def pbDisplayMail(mail, _bearer = nil)
sprites = {} sprites = {}
viewport = Viewport.new(0, 0, Graphics.width, Graphics.height) viewport = Viewport.new(0, 0, Graphics.width, Graphics.height)
viewport.z = 99999 viewport.z = 99999
addBackgroundPlane(sprites, "background", "mailbg", viewport) addBackgroundPlane(sprites, "background", "Mail/bg", viewport)
sprites["card"] = IconSprite.new(0, 0, viewport) sprites["card"] = IconSprite.new(0, 0, viewport)
sprites["card"].setBitmap(GameData::Item.mail_filename(mail.item)) sprites["card"].setBitmap(GameData::Item.mail_filename(mail.item))
sprites["overlay"] = BitmapSprite.new(Graphics.width, Graphics.height, viewport) sprites["overlay"] = BitmapSprite.new(Graphics.width, Graphics.height, viewport)
@@ -69,13 +69,13 @@ def pbDisplayMail(mail, _bearer = nil)
baseForLightBG = Color.new(80, 80, 88) baseForLightBG = Color.new(80, 80, 88)
shadowForLightBG = Color.new(168, 168, 176) shadowForLightBG = Color.new(168, 168, 176)
if mail.message && mail.message != "" if mail.message && mail.message != ""
isDark = isDarkBackground(sprites["card"].bitmap, Rect.new(48, 48, Graphics.width - 96, 32 * 7)) isDark = isDarkBackground(sprites["card"].bitmap, Rect.new(48, 48, Graphics.width - 96, 224))
drawTextEx(overlay, 48, 52, Graphics.width - 94, 7, mail.message, drawTextEx(overlay, 48, 52, Graphics.width - 94, 7, mail.message,
(isDark) ? baseForDarkBG : baseForLightBG, (isDark) ? baseForDarkBG : baseForLightBG,
(isDark) ? shadowForDarkBG : shadowForLightBG) (isDark) ? shadowForDarkBG : shadowForLightBG)
end end
if mail.sender && mail.sender != "" if mail.sender && mail.sender != ""
isDark = isDarkBackground(sprites["card"].bitmap, Rect.new(336, 322, 144, 32 * 1)) isDark = isDarkBackground(sprites["card"].bitmap, Rect.new(336, 322, 144, 32))
drawTextEx(overlay, 336, 328, 144, 1, mail.sender, drawTextEx(overlay, 336, 328, 144, 1, mail.sender,
(isDark) ? baseForDarkBG : baseForLightBG, (isDark) ? baseForDarkBG : baseForLightBG,
(isDark) ? shadowForDarkBG : shadowForLightBG) (isDark) ? shadowForDarkBG : shadowForLightBG)
@@ -260,8 +260,7 @@ MultipleForms.register(:ROTOM, {
MultipleForms.register(:GIRATINA, { MultipleForms.register(:GIRATINA, {
"getForm" => proc { |pkmn| "getForm" => proc { |pkmn|
next 1 if pkmn.hasItem?(:GRISEOUSORB) next 1 if pkmn.hasItem?(:GRISEOUSORB)
if $game_map && if $game_map && $game_map.metadata&.has_flag?("DistortionWorld")
GameData::MapMetadata.get($game_map.map_id)&.has_flag?("DistortionWorld")
next 1 next 1
end end
next 0 next 0
@@ -10,27 +10,27 @@ class ButtonEventScene < EventScene
super super
Graphics.freeze Graphics.freeze
@current_screen = 1 @current_screen = 1
addImage(0, 0, "Graphics/Pictures/Controls help/help_bg") addImage(0, 0, "Graphics/UI/Controls help/bg")
@labels = [] @labels = []
@label_screens = [] @label_screens = []
@keys = [] @keys = []
@key_screens = [] @key_screens = []
addImageForScreen(1, 44, 122, "Graphics/Pictures/Controls help/help_f1") addImageForScreen(1, 44, 122, "Graphics/UI/Controls help/help_f1")
addImageForScreen(1, 44, 252, "Graphics/Pictures/Controls help/help_f8") addImageForScreen(1, 44, 252, "Graphics/UI/Controls help/help_f8")
addLabelForScreen(1, 134, 84, 352, _INTL("Opens the Key Bindings window, where you can choose which keyboard keys to use for each control.")) addLabelForScreen(1, 134, 84, 352, _INTL("Opens the Key Bindings window, where you can choose which keyboard keys to use for each control."))
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/Pictures/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.\r\n\r\nYou can also use the Arrow keys to select entries and navigate menus."))
addImageForScreen(3, 16, 90, "Graphics/Pictures/Controls help/help_usekey") addImageForScreen(3, 16, 90, "Graphics/UI/Controls help/help_usekey")
addImageForScreen(3, 16, 236, "Graphics/Pictures/Controls help/help_backkey") addImageForScreen(3, 16, 236, "Graphics/UI/Controls help/help_backkey")
addLabelForScreen(3, 134, 68, 352, _INTL("Used to confirm a choice, interact with people and things, and move through text. (Default: C)")) addLabelForScreen(3, 134, 68, 352, _INTL("Used to confirm a choice, interact with people and things, and move through text. (Default: C)"))
addLabelForScreen(3, 134, 196, 352, _INTL("Used to exit, cancel a choice, and cancel a mode. While moving around, hold to move at a different speed. (Default: X)")) addLabelForScreen(3, 134, 196, 352, _INTL("Used to exit, cancel a choice, and cancel a mode. While moving around, hold to move at a different speed. (Default: X)"))
addImageForScreen(4, 16, 90, "Graphics/Pictures/Controls help/help_actionkey") addImageForScreen(4, 16, 90, "Graphics/UI/Controls help/help_actionkey")
addImageForScreen(4, 16, 236, "Graphics/Pictures/Controls help/help_specialkey") addImageForScreen(4, 16, 236, "Graphics/UI/Controls help/help_specialkey")
addLabelForScreen(4, 134, 68, 352, _INTL("Used to open the Pause Menu. Also has various functions depending on context. (Default: Z)")) addLabelForScreen(4, 134, 68, 352, _INTL("Used to open the Pause Menu. Also has various functions depending on context. (Default: Z)"))
addLabelForScreen(4, 134, 196, 352, _INTL("Press to open the Ready Menu, where registered items and available field moves can be used. (Default: D)")) addLabelForScreen(4, 134, 196, 352, _INTL("Press to open the Ready Menu, where registered items and available field moves can be used. (Default: D)"))
@@ -68,7 +68,7 @@ class ButtonEventScene < EventScene
# End scene # End scene
$game_temp.background_bitmap = Graphics.snap_to_bitmap $game_temp.background_bitmap = Graphics.snap_to_bitmap
Graphics.freeze Graphics.freeze
@viewport.color = Color.new(0, 0, 0, 255) # Ensure screen is black @viewport.color = Color.black # Ensure screen is black
Graphics.transition(8, "fadetoblack") Graphics.transition(8, "fadetoblack")
$game_temp.background_bitmap.dispose $game_temp.background_bitmap.dispose
scene.dispose scene.dispose
@@ -17,7 +17,7 @@ class PokemonEggHatch_Scene
@viewport = Viewport.new(0, 0, Graphics.width, Graphics.height) @viewport = Viewport.new(0, 0, Graphics.width, Graphics.height)
@viewport.z = 99999 @viewport.z = 99999
# Create background image # Create background image
addBackgroundOrColoredPlane(@sprites, "background", "hatchbg", addBackgroundOrColoredPlane(@sprites, "background", "hatch_bg",
Color.new(248, 248, 248), @viewport) Color.new(248, 248, 248), @viewport)
# Create egg sprite/Pokémon sprite # Create egg sprite/Pokémon sprite
@sprites["pokemon"] = PokemonSprite.new(@viewport) @sprites["pokemon"] = PokemonSprite.new(@viewport)
@@ -45,8 +45,7 @@ class PokemonEggHatch_Scene
@sprites["overlay"] = BitmapSprite.new(Graphics.width, Graphics.height, @viewport) @sprites["overlay"] = BitmapSprite.new(Graphics.width, Graphics.height, @viewport)
@sprites["overlay"].z = 200 @sprites["overlay"].z = 200
@sprites["overlay"].bitmap = Bitmap.new(Graphics.width, Graphics.height) @sprites["overlay"].bitmap = Bitmap.new(Graphics.width, Graphics.height)
@sprites["overlay"].bitmap.fill_rect(0, 0, Graphics.width, Graphics.height, @sprites["overlay"].bitmap.fill_rect(0, 0, Graphics.width, Graphics.height, Color.white)
Color.new(255, 255, 255))
@sprites["overlay"].opacity = 0 @sprites["overlay"].opacity = 0
# Start up scene # Start up scene
pbFadeInAndShow(@sprites) pbFadeInAndShow(@sprites)
@@ -496,7 +496,7 @@ class PokemonEvolutionScene
@viewport.z = 99999 @viewport.z = 99999
@msgviewport = Viewport.new(0, 0, Graphics.width, Graphics.height) @msgviewport = Viewport.new(0, 0, Graphics.width, Graphics.height)
@msgviewport.z = 99999 @msgviewport.z = 99999
addBackgroundOrColoredPlane(@sprites, "background", "evolutionbg", addBackgroundOrColoredPlane(@sprites, "background", "evolution_bg",
Color.new(248, 248, 248), @bgviewport) Color.new(248, 248, 248), @bgviewport)
rsprite1 = PokemonSprite.new(@viewport) rsprite1 = PokemonSprite.new(@viewport)
rsprite1.setOffset(PictureOrigin::CENTER) rsprite1.setOffset(PictureOrigin::CENTER)
@@ -32,7 +32,7 @@ class PokemonTrade_Scene
@pokemon2 = pokemon2 @pokemon2 = pokemon2
@trader1 = trader1 @trader1 = trader1
@trader2 = trader2 @trader2 = trader2
addBackgroundOrColoredPlane(@sprites, "background", "tradebg", addBackgroundOrColoredPlane(@sprites, "background", "trade_bg",
Color.new(248, 248, 248), @viewport) Color.new(248, 248, 248), @viewport)
@sprites["rsprite1"] = PokemonSprite.new(@viewport) @sprites["rsprite1"] = PokemonSprite.new(@viewport)
@sprites["rsprite1"].setPokemonBitmap(@pokemon, false) @sprites["rsprite1"].setPokemonBitmap(@pokemon, false)
@@ -70,7 +70,7 @@ class PokemonTrade_Scene
picturePoke.setOrigin(0, PictureOrigin::BOTTOM) picturePoke.setOrigin(0, PictureOrigin::BOTTOM)
picturePoke.setVisible(0, true) picturePoke.setVisible(0, true)
# Change Pokémon color # Change Pokémon color
picturePoke.moveColor(2, 5, Color.new(31 * 8, 22 * 8, 30 * 8, 255)) picturePoke.moveColor(2, 5, Color.new(248, 176, 140))
# Recall # Recall
delay = picturePoke.totalDuration delay = picturePoke.totalDuration
picturePoke.setSE(delay, "Battle recall") picturePoke.setSE(delay, "Battle recall")
@@ -110,7 +110,7 @@ class PokemonTrade_Scene
# Starting position of sprite # Starting position of sprite
picturePoke.setOrigin(0, PictureOrigin::BOTTOM) picturePoke.setOrigin(0, PictureOrigin::BOTTOM)
picturePoke.setZoom(0, 0) picturePoke.setZoom(0, 0)
picturePoke.setColor(0, Color.new(31 * 8, 22 * 8, 30 * 8, 255)) picturePoke.setColor(0, Color.new(248, 176, 240))
picturePoke.setVisible(0, false) picturePoke.setVisible(0, false)
# Dropping ball # Dropping ball
y = Graphics.height - 96 - 16 - 16 # end point of Poké Ball y = Graphics.height - 96 - 16 - 16 # end point of Poké Ball
@@ -141,7 +141,7 @@ class PokemonTrade_Scene
picturePoke.moveXY(delay, 8, Graphics.width / 2, @sprites["rsprite2"].y) picturePoke.moveXY(delay, 8, Graphics.width / 2, @sprites["rsprite2"].y)
# Return Pokémon's color to normal and play cry # Return Pokémon's color to normal and play cry
delay = picturePoke.totalDuration delay = picturePoke.totalDuration
picturePoke.moveColor(delay, 5, Color.new(31 * 8, 22 * 8, 30 * 8, 0)) picturePoke.moveColor(delay, 5, Color.new(248, 176, 240, 0))
cry = GameData::Species.cry_filename_from_pokemon(@pokemon2) cry = GameData::Species.cry_filename_from_pokemon(@pokemon2)
picturePoke.setSE(delay, cry) if cry picturePoke.setSE(delay, cry) if cry
# Play animation # Play animation
@@ -48,9 +48,9 @@ class HallOfFame_Scene
@viewport = Viewport.new(0, 0, Graphics.width, Graphics.height) @viewport = Viewport.new(0, 0, Graphics.width, Graphics.height)
@viewport.z = 99999 @viewport.z = 99999
# Comment the below line to doesn't use a background # Comment the below line to doesn't use a background
addBackgroundPlane(@sprites, "bg", "hallfamebg", @viewport) addBackgroundPlane(@sprites, "bg", "Hall of Fame/bg", @viewport)
@sprites["hallbars"] = IconSprite.new(@viewport) @sprites["hallbars"] = IconSprite.new(@viewport)
@sprites["hallbars"].setBitmap("Graphics/Pictures/hallfamebars") @sprites["hallbars"].setBitmap("Graphics/UI/Hall of Fame/bars")
@sprites["overlay"] = BitmapSprite.new(Graphics.width, Graphics.height, @viewport) @sprites["overlay"] = BitmapSprite.new(Graphics.width, Graphics.height, @viewport)
@sprites["overlay"].z = 10 @sprites["overlay"].z = 10
pbSetSystemFont(@sprites["overlay"].bitmap) pbSetSystemFont(@sprites["overlay"].bitmap)
@@ -161,7 +161,7 @@ class HallOfFame_Scene
def xpositionformula(battlernumber) def xpositionformula(battlernumber)
ret = 0 ret = 0
if SINGLEROW if SINGLEROW
ret = battlernumber % 2 * 2 ret = (battlernumber % 2) * 2
else else
ret = (battlernumber / 3).even? ? (19 - battlernumber) % 3 : (19 + battlernumber) % 3 ret = (battlernumber / 3).even? ? (19 - battlernumber) % 3 : (19 + battlernumber) % 3
end end
@@ -173,7 +173,7 @@ class HallOfFame_Scene
if SINGLEROW if SINGLEROW
ret = 1 ret = 1
else else
ret = (battlernumber / 3) % 2 * 2 ret = ((battlernumber / 3) % 2) * 2
end end
return ret return ret
end end
@@ -201,7 +201,7 @@ _END_
pbBGMFade(2.0) pbBGMFade(2.0)
$game_temp.background_bitmap = Graphics.snap_to_bitmap $game_temp.background_bitmap = Graphics.snap_to_bitmap
Graphics.freeze Graphics.freeze
viewport.color = Color.new(0, 0, 0, 255) # Ensure screen is black viewport.color = Color.black # Ensure screen is black
Graphics.transition(8, "fadetoblack") Graphics.transition(8, "fadetoblack")
$game_temp.background_bitmap.dispose $game_temp.background_bitmap.dispose
@background_sprite.dispose @background_sprite.dispose
+5 -5
View File
@@ -8,9 +8,9 @@ class Window_DexesList < Window_CommandPokemon
def initialize(commands, commands2, width) def initialize(commands, commands2, width)
@commands2 = commands2 @commands2 = commands2
super(commands, width) super(commands, width)
@selarrow = AnimatedBitmap.new("Graphics/Pictures/selarrow_white") @selarrow = AnimatedBitmap.new("Graphics/UI/sel_arrow_white")
self.baseColor = Color.new(248, 248, 248) self.baseColor = Color.new(248, 248, 248)
self.shadowColor = Color.new(0, 0, 0) self.shadowColor = Color.black
self.windowskin = nil self.windowskin = nil
end end
@@ -25,8 +25,8 @@ class Window_DexesList < Window_CommandPokemon
allown = (@commands2[index][1] >= @commands2[index][2]) allown = (@commands2[index][1] >= @commands2[index][2])
pbDrawImagePositions( pbDrawImagePositions(
self.contents, self.contents,
[["Graphics/Pictures/Pokedex/icon_menuseenown", rect.x + 236, rect.y + 6, (allseen) ? 24 : 0, 0, 24, 24], [["Graphics/UI/Pokedex/icon_menuseenown", rect.x + 236, rect.y + 6, (allseen) ? 24 : 0, 0, 24, 24],
["Graphics/Pictures/Pokedex/icon_menuseenown", rect.x + 332, rect.y + 6, (allown) ? 24 : 0, 24, 24, 24]] ["Graphics/UI/Pokedex/icon_menuseenown", rect.x + 332, rect.y + 6, (allown) ? 24 : 0, 24, 24, 24]]
) )
end end
end end
@@ -46,7 +46,7 @@ class PokemonPokedexMenu_Scene
@viewport.z = 99999 @viewport.z = 99999
@sprites = {} @sprites = {}
@sprites["background"] = IconSprite.new(0, 0, @viewport) @sprites["background"] = IconSprite.new(0, 0, @viewport)
@sprites["background"].setBitmap(_INTL("Graphics/Pictures/Pokedex/bg_menu")) @sprites["background"].setBitmap(_INTL("Graphics/UI/Pokedex/bg_menu"))
@sprites["headings"] = Window_AdvancedTextPokemon.newWithSize( @sprites["headings"] = Window_AdvancedTextPokemon.newWithSize(
_INTL("<c3=F8F8F8,C02028>SEEN<r>OBTAINED</c3>"), 286, 136, 208, 64, @viewport _INTL("<c3=F8F8F8,C02028>SEEN<r>OBTAINED</c3>"), 286, 136, 208, 64, @viewport
) )
+23 -23
View File
@@ -5,9 +5,9 @@ class Window_Pokedex < Window_DrawableCommand
def initialize(x, y, width, height, viewport) def initialize(x, y, width, height, viewport)
@commands = [] @commands = []
super(x, y, width, height, viewport) super(x, y, width, height, viewport)
@selarrow = AnimatedBitmap.new("Graphics/Pictures/Pokedex/cursor_list") @selarrow = AnimatedBitmap.new("Graphics/UI/Pokedex/cursor_list")
@pokeballOwn = AnimatedBitmap.new("Graphics/Pictures/Pokedex/icon_own") @pokeballOwn = AnimatedBitmap.new("Graphics/UI/Pokedex/icon_own")
@pokeballSeen = AnimatedBitmap.new("Graphics/Pictures/Pokedex/icon_seen") @pokeballSeen = AnimatedBitmap.new("Graphics/UI/Pokedex/icon_seen")
self.baseColor = Color.new(88, 88, 80) self.baseColor = Color.new(88, 88, 80)
self.shadowColor = Color.new(168, 184, 184) self.shadowColor = Color.new(168, 184, 184)
self.windowskin = nil self.windowskin = nil
@@ -86,7 +86,7 @@ class PokedexSearchSelectionSprite < Sprite
def initialize(viewport = nil) def initialize(viewport = nil)
super(viewport) super(viewport)
@selbitmap = AnimatedBitmap.new("Graphics/Pictures/Pokedex/cursor_search") @selbitmap = AnimatedBitmap.new("Graphics/UI/Pokedex/cursor_search")
self.bitmap = @selbitmap.bitmap self.bitmap = @selbitmap.bitmap
self.mode = -1 self.mode = -1
@index = 0 @index = 0
@@ -262,12 +262,12 @@ class PokemonPokedex_Scene
end end
def pbStartScene def pbStartScene
@sliderbitmap = AnimatedBitmap.new("Graphics/Pictures/Pokedex/icon_slider") @sliderbitmap = AnimatedBitmap.new("Graphics/UI/Pokedex/icon_slider")
@typebitmap = AnimatedBitmap.new(_INTL("Graphics/Pictures/Pokedex/icon_types")) @typebitmap = AnimatedBitmap.new(_INTL("Graphics/UI/Pokedex/icon_types"))
@shapebitmap = AnimatedBitmap.new("Graphics/Pictures/Pokedex/icon_shapes") @shapebitmap = AnimatedBitmap.new("Graphics/UI/Pokedex/icon_shapes")
@hwbitmap = AnimatedBitmap.new("Graphics/Pictures/Pokedex/icon_hw") @hwbitmap = AnimatedBitmap.new("Graphics/UI/Pokedex/icon_hw")
@selbitmap = AnimatedBitmap.new("Graphics/Pictures/Pokedex/icon_searchsel") @selbitmap = AnimatedBitmap.new("Graphics/UI/Pokedex/icon_searchsel")
@searchsliderbitmap = AnimatedBitmap.new(_INTL("Graphics/Pictures/Pokedex/icon_searchslider")) @searchsliderbitmap = AnimatedBitmap.new(_INTL("Graphics/UI/Pokedex/icon_searchslider"))
@sprites = {} @sprites = {}
@viewport = Viewport.new(0, 0, Graphics.width, Graphics.height) @viewport = Viewport.new(0, 0, Graphics.width, Graphics.height)
@viewport.z = 99999 @viewport.z = 99999
@@ -405,9 +405,9 @@ class PokemonPokedex_Scene
@sprites["pokedex"].index = index @sprites["pokedex"].index = index
@sprites["pokedex"].refresh @sprites["pokedex"].refresh
if @searchResults if @searchResults
@sprites["background"].setBitmap("Graphics/Pictures/Pokedex/bg_listsearch") @sprites["background"].setBitmap("Graphics/UI/Pokedex/bg_listsearch")
else else
@sprites["background"].setBitmap("Graphics/Pictures/Pokedex/bg_list") @sprites["background"].setBitmap("Graphics/UI/Pokedex/bg_list")
end end
pbRefresh pbRefresh
end end
@@ -428,7 +428,7 @@ class PokemonPokedex_Scene
end end
end end
textpos = [ textpos = [
[dexname, Graphics.width / 2, 10, 2, Color.new(248, 248, 248), Color.new(0, 0, 0)] [dexname, Graphics.width / 2, 10, 2, Color.new(248, 248, 248), Color.black]
] ]
textpos.push([GameData::Species.get(iconspecies).name, 112, 58, 2, base, shadow]) if iconspecies textpos.push([GameData::Species.get(iconspecies).name, 112, 58, 2, base, shadow]) if iconspecies
if @searchResults if @searchResults
@@ -902,19 +902,19 @@ class PokemonPokedex_Scene
ret = nil ret = nil
# Set background # Set background
case mode case mode
when 0 then @sprites["searchbg"].setBitmap("Graphics/Pictures/Pokedex/bg_search_order") when 0 then @sprites["searchbg"].setBitmap("Graphics/UI/Pokedex/bg_search_order")
when 1 then @sprites["searchbg"].setBitmap("Graphics/Pictures/Pokedex/bg_search_name") when 1 then @sprites["searchbg"].setBitmap("Graphics/UI/Pokedex/bg_search_name")
when 2 when 2
count = 0 count = 0
GameData::Type.each { |t| count += 1 if !t.pseudo_type && t.id != :SHADOW } GameData::Type.each { |t| count += 1 if !t.pseudo_type && t.id != :SHADOW }
if count == 18 if count == 18
@sprites["searchbg"].setBitmap("Graphics/Pictures/Pokedex/bg_search_type_18") @sprites["searchbg"].setBitmap("Graphics/UI/Pokedex/bg_search_type_18")
else else
@sprites["searchbg"].setBitmap("Graphics/Pictures/Pokedex/bg_search_type") @sprites["searchbg"].setBitmap("Graphics/UI/Pokedex/bg_search_type")
end end
when 3, 4 then @sprites["searchbg"].setBitmap("Graphics/Pictures/Pokedex/bg_search_size") when 3, 4 then @sprites["searchbg"].setBitmap("Graphics/UI/Pokedex/bg_search_size")
when 5 then @sprites["searchbg"].setBitmap("Graphics/Pictures/Pokedex/bg_search_color") when 5 then @sprites["searchbg"].setBitmap("Graphics/UI/Pokedex/bg_search_color")
when 6 then @sprites["searchbg"].setBitmap("Graphics/Pictures/Pokedex/bg_search_shape") when 6 then @sprites["searchbg"].setBitmap("Graphics/UI/Pokedex/bg_search_shape")
end end
selindex = selitems.clone selindex = selitems.clone
index = selindex[0] index = selindex[0]
@@ -1087,7 +1087,7 @@ class PokemonPokedex_Scene
end end
Input.update Input.update
# Set background image # Set background image
@sprites["searchbg"].setBitmap("Graphics/Pictures/Pokedex/bg_search") @sprites["searchbg"].setBitmap("Graphics/UI/Pokedex/bg_search")
@sprites["searchcursor"].mode = -1 @sprites["searchcursor"].mode = -1
@sprites["searchcursor"].index = mainindex @sprites["searchcursor"].index = mainindex
return ret return ret
@@ -1246,9 +1246,9 @@ class PokemonPokedex_Scene
end end
pbFadeOutAndHide(@sprites) pbFadeOutAndHide(@sprites)
if @searchResults if @searchResults
@sprites["background"].setBitmap("Graphics/Pictures/Pokedex/bg_listsearch") @sprites["background"].setBitmap("Graphics/UI/Pokedex/bg_listsearch")
else else
@sprites["background"].setBitmap("Graphics/Pictures/Pokedex/bg_list") @sprites["background"].setBitmap("Graphics/UI/Pokedex/bg_list")
end end
pbRefresh pbRefresh
pbFadeInAndShow(@sprites, oldsprites) pbFadeInAndShow(@sprites, oldsprites)
+15 -15
View File
@@ -10,7 +10,7 @@ class PokemonPokedexInfo_Scene
@region = region @region = region
@page = 1 @page = 1
@show_battled_count = false @show_battled_count = false
@typebitmap = AnimatedBitmap.new(_INTL("Graphics/Pictures/Pokedex/icon_types")) @typebitmap = AnimatedBitmap.new(_INTL("Graphics/UI/Pokedex/icon_types"))
@sprites = {} @sprites = {}
@sprites["background"] = IconSprite.new(0, 0, @viewport) @sprites["background"] = IconSprite.new(0, 0, @viewport)
@sprites["infosprite"] = PokemonSprite.new(@viewport) @sprites["infosprite"] = PokemonSprite.new(@viewport)
@@ -23,21 +23,21 @@ class PokemonPokedexInfo_Scene
@region = (mappos) ? mappos[0] : 0 # Region 0 default @region = (mappos) ? mappos[0] : 0 # Region 0 default
end end
@sprites["areamap"] = IconSprite.new(0, 0, @viewport) @sprites["areamap"] = IconSprite.new(0, 0, @viewport)
@sprites["areamap"].setBitmap("Graphics/Pictures/#{@mapdata[@region][1]}") @sprites["areamap"].setBitmap("Graphics/UI/Town Map/#{@mapdata[@region][1]}")
@sprites["areamap"].x += (Graphics.width - @sprites["areamap"].bitmap.width) / 2 @sprites["areamap"].x += (Graphics.width - @sprites["areamap"].bitmap.width) / 2
@sprites["areamap"].y += (Graphics.height + 32 - @sprites["areamap"].bitmap.height) / 2 @sprites["areamap"].y += (Graphics.height + 32 - @sprites["areamap"].bitmap.height) / 2
Settings::REGION_MAP_EXTRAS.each do |hidden| Settings::REGION_MAP_EXTRAS.each do |hidden|
next if hidden[0] != @region || hidden[1] <= 0 || !$game_switches[hidden[1]] next if hidden[0] != @region || hidden[1] <= 0 || !$game_switches[hidden[1]]
pbDrawImagePositions( pbDrawImagePositions(
@sprites["areamap"].bitmap, @sprites["areamap"].bitmap,
[["Graphics/Pictures/#{hidden[4]}", [["Graphics/UI/Town Map/#{hidden[4]}",
hidden[2] * PokemonRegionMap_Scene::SQUARE_WIDTH, hidden[2] * PokemonRegionMap_Scene::SQUARE_WIDTH,
hidden[3] * PokemonRegionMap_Scene::SQUARE_HEIGHT]] hidden[3] * PokemonRegionMap_Scene::SQUARE_HEIGHT]]
) )
end end
@sprites["areahighlight"] = BitmapSprite.new(Graphics.width, Graphics.height, @viewport) @sprites["areahighlight"] = BitmapSprite.new(Graphics.width, Graphics.height, @viewport)
@sprites["areaoverlay"] = IconSprite.new(0, 0, @viewport) @sprites["areaoverlay"] = IconSprite.new(0, 0, @viewport)
@sprites["areaoverlay"].setBitmap("Graphics/Pictures/Pokedex/overlay_area") @sprites["areaoverlay"].setBitmap("Graphics/UI/Pokedex/overlay_area")
@sprites["formfront"] = PokemonSprite.new(@viewport) @sprites["formfront"] = PokemonSprite.new(@viewport)
@sprites["formfront"].setOffset(PictureOrigin::CENTER) @sprites["formfront"].setOffset(PictureOrigin::CENTER)
@sprites["formfront"].x = 130 @sprites["formfront"].x = 130
@@ -49,12 +49,12 @@ class PokemonPokedexInfo_Scene
@sprites["formicon"].setOffset(PictureOrigin::CENTER) @sprites["formicon"].setOffset(PictureOrigin::CENTER)
@sprites["formicon"].x = 82 @sprites["formicon"].x = 82
@sprites["formicon"].y = 328 @sprites["formicon"].y = 328
@sprites["uparrow"] = AnimatedSprite.new("Graphics/Pictures/uparrow", 8, 28, 40, 2, @viewport) @sprites["uparrow"] = AnimatedSprite.new("Graphics/UI/up_arrow", 8, 28, 40, 2, @viewport)
@sprites["uparrow"].x = 242 @sprites["uparrow"].x = 242
@sprites["uparrow"].y = 268 @sprites["uparrow"].y = 268
@sprites["uparrow"].play @sprites["uparrow"].play
@sprites["uparrow"].visible = false @sprites["uparrow"].visible = false
@sprites["downarrow"] = AnimatedSprite.new("Graphics/Pictures/downarrow", 8, 28, 40, 2, @viewport) @sprites["downarrow"] = AnimatedSprite.new("Graphics/UI/down_arrow", 8, 28, 40, 2, @viewport)
@sprites["downarrow"].x = 242 @sprites["downarrow"].x = 242
@sprites["downarrow"].y = 348 @sprites["downarrow"].y = 348
@sprites["downarrow"].play @sprites["downarrow"].play
@@ -94,7 +94,7 @@ class PokemonPokedexInfo_Scene
@index = 0 @index = 0
@page = 1 @page = 1
@brief = true @brief = true
@typebitmap = AnimatedBitmap.new(_INTL("Graphics/Pictures/Pokedex/icon_types")) @typebitmap = AnimatedBitmap.new(_INTL("Graphics/UI/Pokedex/icon_types"))
@sprites = {} @sprites = {}
@sprites["background"] = IconSprite.new(0, 0, @viewport) @sprites["background"] = IconSprite.new(0, 0, @viewport)
@sprites["infosprite"] = PokemonSprite.new(@viewport) @sprites["infosprite"] = PokemonSprite.new(@viewport)
@@ -198,13 +198,13 @@ class PokemonPokedexInfo_Scene
end end
def drawPageInfo def drawPageInfo
@sprites["background"].setBitmap(_INTL("Graphics/Pictures/Pokedex/bg_info")) @sprites["background"].setBitmap(_INTL("Graphics/UI/Pokedex/bg_info"))
overlay = @sprites["overlay"].bitmap overlay = @sprites["overlay"].bitmap
base = Color.new(88, 88, 80) base = Color.new(88, 88, 80)
shadow = Color.new(168, 184, 184) shadow = Color.new(168, 184, 184)
imagepos = [] imagepos = []
if @brief if @brief
imagepos.push([_INTL("Graphics/Pictures/Pokedex/overlay_info"), 0, 0]) imagepos.push([_INTL("Graphics/UI/Pokedex/overlay_info"), 0, 0])
end end
species_data = GameData::Species.get_species_form(@species, @form) species_data = GameData::Species.get_species_form(@species, @form)
# Write various bits of text # Write various bits of text
@@ -216,7 +216,7 @@ class PokemonPokedexInfo_Scene
end end
textpos = [ textpos = [
[_INTL("{1}{2} {3}", indexText, " ", species_data.name), [_INTL("{1}{2} {3}", indexText, " ", species_data.name),
246, 48, 0, Color.new(248, 248, 248), Color.new(0, 0, 0)] 246, 48, 0, Color.new(248, 248, 248), Color.black]
] ]
if @show_battled_count if @show_battled_count
textpos.push([_INTL("Number Battled"), 314, 164, 0, base, shadow]) textpos.push([_INTL("Number Battled"), 314, 164, 0, base, shadow])
@@ -243,7 +243,7 @@ class PokemonPokedexInfo_Scene
end end
end end
# Draw the Pokédex entry text # Draw the Pokédex entry text
drawTextEx(overlay, 40, 246, Graphics.width - (40 * 2), 4, # overlay, x, y, width, num lines drawTextEx(overlay, 40, 246, Graphics.width - 80, 4, # overlay, x, y, width, num lines
species_data.pokedex_entry, base, shadow) species_data.pokedex_entry, base, shadow)
# Draw the footprint # Draw the footprint
footprintfile = GameData::Species.footprint_filename(@species, @form) footprintfile = GameData::Species.footprint_filename(@species, @form)
@@ -253,7 +253,7 @@ class PokemonPokedexInfo_Scene
footprint.dispose footprint.dispose
end end
# Show the owned icon # Show the owned icon
imagepos.push(["Graphics/Pictures/Pokedex/icon_own", 212, 44]) imagepos.push(["Graphics/UI/Pokedex/icon_own", 212, 44])
# Draw the type icon(s) # Draw the type icon(s)
species_data.types.each_with_index do |type, i| species_data.types.each_with_index do |type, i|
type_number = GameData::Type.get(type).icon_position type_number = GameData::Type.get(type).icon_position
@@ -333,7 +333,7 @@ class PokemonPokedexInfo_Scene
end end
def drawPageArea def drawPageArea
@sprites["background"].setBitmap(_INTL("Graphics/Pictures/Pokedex/bg_area")) @sprites["background"].setBitmap(_INTL("Graphics/UI/Pokedex/bg_area"))
overlay = @sprites["overlay"].bitmap overlay = @sprites["overlay"].bitmap
base = Color.new(88, 88, 80) base = Color.new(88, 88, 80)
shadow = Color.new(168, 184, 184) shadow = Color.new(168, 184, 184)
@@ -371,7 +371,7 @@ class PokemonPokedexInfo_Scene
if points.length == 0 if points.length == 0
pbDrawImagePositions( pbDrawImagePositions(
overlay, overlay,
[[sprintf("Graphics/Pictures/Pokedex/overlay_areanone"), 108, 188]] [[sprintf("Graphics/UI/Pokedex/overlay_areanone"), 108, 188]]
) )
textpos.push([_INTL("Area unknown"), Graphics.width / 2, (Graphics.height / 2) + 6, 2, base, shadow]) textpos.push([_INTL("Area unknown"), Graphics.width / 2, (Graphics.height / 2) + 6, 2, base, shadow])
end end
@@ -382,7 +382,7 @@ class PokemonPokedexInfo_Scene
end end
def drawPageForms def drawPageForms
@sprites["background"].setBitmap(_INTL("Graphics/Pictures/Pokedex/bg_forms")) @sprites["background"].setBitmap(_INTL("Graphics/UI/Pokedex/bg_forms"))
overlay = @sprites["overlay"].bitmap overlay = @sprites["overlay"].bitmap
base = Color.new(88, 88, 80) base = Color.new(88, 88, 80)
shadow = Color.new(168, 184, 184) shadow = Color.new(168, 184, 184)
+29 -29
View File
@@ -9,11 +9,11 @@ class PokemonPartyConfirmCancelSprite < Sprite
@refreshBitmap = true @refreshBitmap = true
@bgsprite = ChangelingSprite.new(0, 0, viewport) @bgsprite = ChangelingSprite.new(0, 0, viewport)
if narrowbox if narrowbox
@bgsprite.addBitmap("desel", "Graphics/Pictures/Party/icon_cancel_narrow") @bgsprite.addBitmap("desel", "Graphics/UI/Party/icon_cancel_narrow")
@bgsprite.addBitmap("sel", "Graphics/Pictures/Party/icon_cancel_narrow_sel") @bgsprite.addBitmap("sel", "Graphics/UI/Party/icon_cancel_narrow_sel")
else else
@bgsprite.addBitmap("desel", "Graphics/Pictures/Party/icon_cancel") @bgsprite.addBitmap("desel", "Graphics/UI/Party/icon_cancel")
@bgsprite.addBitmap("sel", "Graphics/Pictures/Party/icon_cancel_sel") @bgsprite.addBitmap("sel", "Graphics/UI/Party/icon_cancel_sel")
end end
@bgsprite.changeBitmap("desel") @bgsprite.changeBitmap("desel")
@overlaysprite = BitmapSprite.new(@bgsprite.bitmap.width, @bgsprite.bitmap.height, viewport) @overlaysprite = BitmapSprite.new(@bgsprite.bitmap.width, @bgsprite.bitmap.height, viewport)
@@ -140,7 +140,7 @@ class PokemonPartyBlankPanel < Sprite
super(viewport) super(viewport)
self.x = (index % 2) * Graphics.width / 2 self.x = (index % 2) * Graphics.width / 2
self.y = (16 * (index % 2)) + (96 * (index / 2)) self.y = (16 * (index % 2)) + (96 * (index / 2))
@panelbgsprite = AnimatedBitmap.new("Graphics/Pictures/Party/panel_blank") @panelbgsprite = AnimatedBitmap.new("Graphics/UI/Party/panel_blank")
self.bitmap = @panelbgsprite.bitmap self.bitmap = @panelbgsprite.bitmap
@text = nil @text = nil
end end
@@ -186,31 +186,31 @@ class PokemonPartyPanel < Sprite
@panelbgsprite = ChangelingSprite.new(0, 0, viewport) @panelbgsprite = ChangelingSprite.new(0, 0, viewport)
@panelbgsprite.z = self.z @panelbgsprite.z = self.z
if @active # Rounded panel if @active # Rounded panel
@panelbgsprite.addBitmap("able", "Graphics/Pictures/Party/panel_round") @panelbgsprite.addBitmap("able", "Graphics/UI/Party/panel_round")
@panelbgsprite.addBitmap("ablesel", "Graphics/Pictures/Party/panel_round_sel") @panelbgsprite.addBitmap("ablesel", "Graphics/UI/Party/panel_round_sel")
@panelbgsprite.addBitmap("fainted", "Graphics/Pictures/Party/panel_round_faint") @panelbgsprite.addBitmap("fainted", "Graphics/UI/Party/panel_round_faint")
@panelbgsprite.addBitmap("faintedsel", "Graphics/Pictures/Party/panel_round_faint_sel") @panelbgsprite.addBitmap("faintedsel", "Graphics/UI/Party/panel_round_faint_sel")
@panelbgsprite.addBitmap("swap", "Graphics/Pictures/Party/panel_round_swap") @panelbgsprite.addBitmap("swap", "Graphics/UI/Party/panel_round_swap")
@panelbgsprite.addBitmap("swapsel", "Graphics/Pictures/Party/panel_round_swap_sel") @panelbgsprite.addBitmap("swapsel", "Graphics/UI/Party/panel_round_swap_sel")
@panelbgsprite.addBitmap("swapsel2", "Graphics/Pictures/Party/panel_round_swap_sel2") @panelbgsprite.addBitmap("swapsel2", "Graphics/UI/Party/panel_round_swap_sel2")
else # Rectangular panel else # Rectangular panel
@panelbgsprite.addBitmap("able", "Graphics/Pictures/Party/panel_rect") @panelbgsprite.addBitmap("able", "Graphics/UI/Party/panel_rect")
@panelbgsprite.addBitmap("ablesel", "Graphics/Pictures/Party/panel_rect_sel") @panelbgsprite.addBitmap("ablesel", "Graphics/UI/Party/panel_rect_sel")
@panelbgsprite.addBitmap("fainted", "Graphics/Pictures/Party/panel_rect_faint") @panelbgsprite.addBitmap("fainted", "Graphics/UI/Party/panel_rect_faint")
@panelbgsprite.addBitmap("faintedsel", "Graphics/Pictures/Party/panel_rect_faint_sel") @panelbgsprite.addBitmap("faintedsel", "Graphics/UI/Party/panel_rect_faint_sel")
@panelbgsprite.addBitmap("swap", "Graphics/Pictures/Party/panel_rect_swap") @panelbgsprite.addBitmap("swap", "Graphics/UI/Party/panel_rect_swap")
@panelbgsprite.addBitmap("swapsel", "Graphics/Pictures/Party/panel_rect_swap_sel") @panelbgsprite.addBitmap("swapsel", "Graphics/UI/Party/panel_rect_swap_sel")
@panelbgsprite.addBitmap("swapsel2", "Graphics/Pictures/Party/panel_rect_swap_sel2") @panelbgsprite.addBitmap("swapsel2", "Graphics/UI/Party/panel_rect_swap_sel2")
end end
@hpbgsprite = ChangelingSprite.new(0, 0, viewport) @hpbgsprite = ChangelingSprite.new(0, 0, viewport)
@hpbgsprite.z = self.z + 1 @hpbgsprite.z = self.z + 1
@hpbgsprite.addBitmap("able", "Graphics/Pictures/Party/overlay_hp_back") @hpbgsprite.addBitmap("able", "Graphics/UI/Party/overlay_hp_back")
@hpbgsprite.addBitmap("fainted", "Graphics/Pictures/Party/overlay_hp_back_faint") @hpbgsprite.addBitmap("fainted", "Graphics/UI/Party/overlay_hp_back_faint")
@hpbgsprite.addBitmap("swap", "Graphics/Pictures/Party/overlay_hp_back_swap") @hpbgsprite.addBitmap("swap", "Graphics/UI/Party/overlay_hp_back_swap")
@ballsprite = ChangelingSprite.new(0, 0, viewport) @ballsprite = ChangelingSprite.new(0, 0, viewport)
@ballsprite.z = self.z + 1 @ballsprite.z = self.z + 1
@ballsprite.addBitmap("desel", "Graphics/Pictures/Party/icon_ball") @ballsprite.addBitmap("desel", "Graphics/UI/Party/icon_ball")
@ballsprite.addBitmap("sel", "Graphics/Pictures/Party/icon_ball_sel") @ballsprite.addBitmap("sel", "Graphics/UI/Party/icon_ball_sel")
@pkmnsprite = PokemonIconSprite.new(pokemon, viewport) @pkmnsprite = PokemonIconSprite.new(pokemon, viewport)
@pkmnsprite.setOffset(PictureOrigin::CENTER) @pkmnsprite.setOffset(PictureOrigin::CENTER)
@pkmnsprite.active = @active @pkmnsprite.active = @active
@@ -220,8 +220,8 @@ class PokemonPartyPanel < Sprite
@overlaysprite = BitmapSprite.new(Graphics.width, Graphics.height, viewport) @overlaysprite = BitmapSprite.new(Graphics.width, Graphics.height, viewport)
@overlaysprite.z = self.z + 4 @overlaysprite.z = self.z + 4
pbSetSystemFont(@overlaysprite.bitmap) pbSetSystemFont(@overlaysprite.bitmap)
@hpbar = AnimatedBitmap.new("Graphics/Pictures/Party/overlay_hp") @hpbar = AnimatedBitmap.new("Graphics/UI/Party/overlay_hp")
@statuses = AnimatedBitmap.new(_INTL("Graphics/Pictures/statuses")) @statuses = AnimatedBitmap.new(_INTL("Graphics/UI/statuses"))
@selected = false @selected = false
@preselected = false @preselected = false
@switching = false @switching = false
@@ -380,7 +380,7 @@ class PokemonPartyPanel < Sprite
return if @pokemon.egg? return if @pokemon.egg?
# "Lv" graphic # "Lv" graphic
pbDrawImagePositions(@overlaysprite.bitmap, pbDrawImagePositions(@overlaysprite.bitmap,
[["Graphics/Pictures/Party/overlay_lv", 20, 70, 0, 0, 22, 14]]) [["Graphics/UI/Party/overlay_lv", 20, 70, 0, 0, 22, 14]])
# Level number # Level number
pbSetSmallFont(@overlaysprite.bitmap) pbSetSmallFont(@overlaysprite.bitmap)
pbDrawTextPositions(@overlaysprite.bitmap, pbDrawTextPositions(@overlaysprite.bitmap,
@@ -434,7 +434,7 @@ class PokemonPartyPanel < Sprite
def draw_shiny_icon def draw_shiny_icon
return if @pokemon.egg? || !@pokemon.shiny? return if @pokemon.egg? || !@pokemon.shiny?
pbDrawImagePositions(@overlaysprite.bitmap, pbDrawImagePositions(@overlaysprite.bitmap,
[["Graphics/Pictures/shiny", 80, 48, 0, 0, 16, 16]]) [["Graphics/UI/shiny", 80, 48, 0, 0, 16, 16]])
end end
def draw_annotation def draw_annotation
@@ -498,7 +498,7 @@ class PokemonParty_Scene
@sprites["storagetext"].z = 10 @sprites["storagetext"].z = 10
@sprites["storagetext"].viewport = @viewport @sprites["storagetext"].viewport = @viewport
@sprites["storagetext"].baseColor = Color.new(248, 248, 248) @sprites["storagetext"].baseColor = Color.new(248, 248, 248)
@sprites["storagetext"].shadowColor = Color.new(0, 0, 0) @sprites["storagetext"].shadowColor = Color.black
@sprites["storagetext"].windowskin = nil @sprites["storagetext"].windowskin = nil
@sprites["helpwindow"] = Window_UnformattedTextPokemon.new(starthelptext) @sprites["helpwindow"] = Window_UnformattedTextPokemon.new(starthelptext)
@sprites["helpwindow"].viewport = @viewport @sprites["helpwindow"].viewport = @viewport
+27 -27
View File
@@ -7,7 +7,7 @@ class MoveSelectionSprite < Sprite
def initialize(viewport = nil, fifthmove = false) def initialize(viewport = nil, fifthmove = false)
super(viewport) super(viewport)
@movesel = AnimatedBitmap.new("Graphics/Pictures/Summary/cursor_move") @movesel = AnimatedBitmap.new("Graphics/UI/Summary/cursor_move")
@frame = 0 @frame = 0
@index = 0 @index = 0
@fifthmove = fifthmove @fifthmove = fifthmove
@@ -61,7 +61,7 @@ end
class RibbonSelectionSprite < MoveSelectionSprite class RibbonSelectionSprite < MoveSelectionSprite
def initialize(viewport = nil) def initialize(viewport = nil)
super(viewport) super(viewport)
@movesel = AnimatedBitmap.new("Graphics/Pictures/Summary/cursor_ribbon") @movesel = AnimatedBitmap.new("Graphics/UI/Summary/cursor_ribbon")
@frame = 0 @frame = 0
@index = 0 @index = 0
@preselected = false @preselected = false
@@ -117,8 +117,8 @@ class PokemonSummary_Scene
@pokemon = @party[@partyindex] @pokemon = @party[@partyindex]
@inbattle = inbattle @inbattle = inbattle
@page = 1 @page = 1
@typebitmap = AnimatedBitmap.new(_INTL("Graphics/Pictures/types")) @typebitmap = AnimatedBitmap.new(_INTL("Graphics/UI/types"))
@markingbitmap = AnimatedBitmap.new("Graphics/Pictures/Summary/markings") @markingbitmap = AnimatedBitmap.new("Graphics/UI/Summary/markings")
@sprites = {} @sprites = {}
@sprites["background"] = IconSprite.new(0, 0, @viewport) @sprites["background"] = IconSprite.new(0, 0, @viewport)
@sprites["pokemon"] = PokemonSprite.new(@viewport) @sprites["pokemon"] = PokemonSprite.new(@viewport)
@@ -145,24 +145,24 @@ class PokemonSummary_Scene
@sprites["ribbonpresel"].preselected = true @sprites["ribbonpresel"].preselected = true
@sprites["ribbonsel"] = RibbonSelectionSprite.new(@viewport) @sprites["ribbonsel"] = RibbonSelectionSprite.new(@viewport)
@sprites["ribbonsel"].visible = false @sprites["ribbonsel"].visible = false
@sprites["uparrow"] = AnimatedSprite.new("Graphics/Pictures/uparrow", 8, 28, 40, 2, @viewport) @sprites["uparrow"] = AnimatedSprite.new("Graphics/UI/up_arrow", 8, 28, 40, 2, @viewport)
@sprites["uparrow"].x = 350 @sprites["uparrow"].x = 350
@sprites["uparrow"].y = 56 @sprites["uparrow"].y = 56
@sprites["uparrow"].play @sprites["uparrow"].play
@sprites["uparrow"].visible = false @sprites["uparrow"].visible = false
@sprites["downarrow"] = AnimatedSprite.new("Graphics/Pictures/downarrow", 8, 28, 40, 2, @viewport) @sprites["downarrow"] = AnimatedSprite.new("Graphics/UI/down_arrow", 8, 28, 40, 2, @viewport)
@sprites["downarrow"].x = 350 @sprites["downarrow"].x = 350
@sprites["downarrow"].y = 260 @sprites["downarrow"].y = 260
@sprites["downarrow"].play @sprites["downarrow"].play
@sprites["downarrow"].visible = false @sprites["downarrow"].visible = false
@sprites["markingbg"] = IconSprite.new(260, 88, @viewport) @sprites["markingbg"] = IconSprite.new(260, 88, @viewport)
@sprites["markingbg"].setBitmap("Graphics/Pictures/Summary/overlay_marking") @sprites["markingbg"].setBitmap("Graphics/UI/Summary/overlay_marking")
@sprites["markingbg"].visible = false @sprites["markingbg"].visible = false
@sprites["markingoverlay"] = BitmapSprite.new(Graphics.width, Graphics.height, @viewport) @sprites["markingoverlay"] = BitmapSprite.new(Graphics.width, Graphics.height, @viewport)
@sprites["markingoverlay"].visible = false @sprites["markingoverlay"].visible = false
pbSetSystemFont(@sprites["markingoverlay"].bitmap) pbSetSystemFont(@sprites["markingoverlay"].bitmap)
@sprites["markingsel"] = IconSprite.new(0, 0, @viewport) @sprites["markingsel"] = IconSprite.new(0, 0, @viewport)
@sprites["markingsel"].setBitmap("Graphics/Pictures/Summary/cursor_marking") @sprites["markingsel"].setBitmap("Graphics/UI/Summary/cursor_marking")
@sprites["markingsel"].src_rect.height = @sprites["markingsel"].bitmap.height / 2 @sprites["markingsel"].src_rect.height = @sprites["markingsel"].bitmap.height / 2
@sprites["markingsel"].visible = false @sprites["markingsel"].visible = false
@sprites["messagebox"] = Window_AdvancedTextPokemon.new("") @sprites["messagebox"] = Window_AdvancedTextPokemon.new("")
@@ -183,7 +183,7 @@ class PokemonSummary_Scene
@partyindex = partyindex @partyindex = partyindex
@pokemon = @party[@partyindex] @pokemon = @party[@partyindex]
@page = 4 @page = 4
@typebitmap = AnimatedBitmap.new(_INTL("Graphics/Pictures/types")) @typebitmap = AnimatedBitmap.new(_INTL("Graphics/UI/types"))
@sprites = {} @sprites = {}
@sprites["background"] = IconSprite.new(0, 0, @viewport) @sprites["background"] = IconSprite.new(0, 0, @viewport)
@sprites["overlay"] = BitmapSprite.new(Graphics.width, Graphics.height, @viewport) @sprites["overlay"] = BitmapSprite.new(Graphics.width, Graphics.height, @viewport)
@@ -306,10 +306,10 @@ class PokemonSummary_Scene
base = Color.new(248, 248, 248) base = Color.new(248, 248, 248)
shadow = Color.new(104, 104, 104) shadow = Color.new(104, 104, 104)
# Set background image # Set background image
@sprites["background"].setBitmap("Graphics/Pictures/Summary/bg_#{page}") @sprites["background"].setBitmap("Graphics/UI/Summary/bg_#{page}")
imagepos = [] imagepos = []
# Show the Poké Ball containing the Pokémon # Show the Poké Ball containing the Pokémon
ballimage = sprintf("Graphics/Pictures/Summary/icon_ball_%s", @pokemon.poke_ball) ballimage = sprintf("Graphics/UI/Summary/icon_ball_%s", @pokemon.poke_ball)
imagepos.push([ballimage, 14, 60]) imagepos.push([ballimage, 14, 60])
# Show status/fainted/Pokérus infected icon # Show status/fainted/Pokérus infected icon
status = -1 status = -1
@@ -321,15 +321,15 @@ class PokemonSummary_Scene
status = GameData::Status.count status = GameData::Status.count
end end
if status >= 0 if status >= 0
imagepos.push(["Graphics/Pictures/statuses", 124, 100, 0, 16 * status, 44, 16]) imagepos.push(["Graphics/UI/statuses", 124, 100, 0, 16 * status, 44, 16])
end end
# Show Pokérus cured icon # Show Pokérus cured icon
if @pokemon.pokerusStage == 2 if @pokemon.pokerusStage == 2
imagepos.push([sprintf("Graphics/Pictures/Summary/icon_pokerus"), 176, 100]) imagepos.push([sprintf("Graphics/UI/Summary/icon_pokerus"), 176, 100])
end end
# Show shininess star # Show shininess star
if @pokemon.shiny? if @pokemon.shiny?
imagepos.push([sprintf("Graphics/Pictures/shiny"), 2, 134]) imagepos.push([sprintf("Graphics/UI/shiny"), 2, 134])
end end
# Draw all images # Draw all images
pbDrawImagePositions(overlay, imagepos) pbDrawImagePositions(overlay, imagepos)
@@ -381,8 +381,8 @@ class PokemonSummary_Scene
if @pokemon.shadowPokemon? if @pokemon.shadowPokemon?
shadowfract = @pokemon.heart_gauge.to_f / @pokemon.max_gauge_size shadowfract = @pokemon.heart_gauge.to_f / @pokemon.max_gauge_size
imagepos = [ imagepos = [
["Graphics/Pictures/Summary/overlay_shadow", 224, 240], ["Graphics/UI/Summary/overlay_shadow", 224, 240],
["Graphics/Pictures/Summary/overlay_shadowbar", 242, 280, 0, 0, (shadowfract * 248).floor, -1] ["Graphics/UI/Summary/overlay_shadowbar", 242, 280, 0, 0, (shadowfract * 248).floor, -1]
] ]
pbDrawImagePositions(overlay, imagepos) pbDrawImagePositions(overlay, imagepos)
end end
@@ -468,7 +468,7 @@ class PokemonSummary_Scene
w = @pokemon.exp_fraction * 128 w = @pokemon.exp_fraction * 128
w = ((w / 2).round) * 2 w = ((w / 2).round) * 2
pbDrawImagePositions(overlay, pbDrawImagePositions(overlay,
[["Graphics/Pictures/Summary/overlay_exp", 362, 372, 0, 0, w, 6]]) [["Graphics/UI/Summary/overlay_exp", 362, 372, 0, 0, w, 6]])
end end
end end
@@ -479,10 +479,10 @@ class PokemonSummary_Scene
base = Color.new(248, 248, 248) base = Color.new(248, 248, 248)
shadow = Color.new(104, 104, 104) shadow = Color.new(104, 104, 104)
# Set background image # Set background image
@sprites["background"].setBitmap("Graphics/Pictures/Summary/bg_egg") @sprites["background"].setBitmap("Graphics/UI/Summary/bg_egg")
imagepos = [] imagepos = []
# Show the Poké Ball containing the Pokémon # Show the Poké Ball containing the Pokémon
ballimage = sprintf("Graphics/Pictures/Summary/icon_ball_%s", @pokemon.poke_ball) ballimage = sprintf("Graphics/UI/Summary/icon_ball_%s", @pokemon.poke_ball)
imagepos.push([ballimage, 14, 60]) imagepos.push([ballimage, 14, 60])
# Draw all images # Draw all images
pbDrawImagePositions(overlay, imagepos) pbDrawImagePositions(overlay, imagepos)
@@ -670,7 +670,7 @@ class PokemonSummary_Scene
hpzone = 1 if @pokemon.hp <= (@pokemon.totalhp / 2).floor hpzone = 1 if @pokemon.hp <= (@pokemon.totalhp / 2).floor
hpzone = 2 if @pokemon.hp <= (@pokemon.totalhp / 4).floor hpzone = 2 if @pokemon.hp <= (@pokemon.totalhp / 4).floor
imagepos = [ imagepos = [
["Graphics/Pictures/Summary/overlay_hp", 360, 110, 0, hpzone * 6, w, 6] ["Graphics/UI/Summary/overlay_hp", 360, 110, 0, hpzone * 6, w, 6]
] ]
pbDrawImagePositions(overlay, imagepos) pbDrawImagePositions(overlay, imagepos)
end end
@@ -699,7 +699,7 @@ class PokemonSummary_Scene
move = @pokemon.moves[i] move = @pokemon.moves[i]
if move if move
type_number = GameData::Type.get(move.display_type(@pokemon)).icon_position type_number = GameData::Type.get(move.display_type(@pokemon)).icon_position
imagepos.push(["Graphics/Pictures/types", 248, yPos - 4, 0, type_number * 28, 64, 28]) imagepos.push(["Graphics/UI/types", 248, yPos - 4, 0, type_number * 28, 64, 28])
textpos.push([move.name, 316, yPos, 0, moveBase, moveShadow]) textpos.push([move.name, 316, yPos, 0, moveBase, moveShadow])
if move.total_pp > 0 if move.total_pp > 0
textpos.push([_INTL("PP"), 342, yPos + 32, 0, moveBase, moveShadow]) textpos.push([_INTL("PP"), 342, yPos + 32, 0, moveBase, moveShadow])
@@ -741,9 +741,9 @@ class PokemonSummary_Scene
Color.new(136, 48, 48)] # Zero PP Color.new(136, 48, 48)] # Zero PP
# Set background image # Set background image
if move_to_learn if move_to_learn
@sprites["background"].setBitmap("Graphics/Pictures/Summary/bg_learnmove") @sprites["background"].setBitmap("Graphics/UI/Summary/bg_learnmove")
else else
@sprites["background"].setBitmap("Graphics/Pictures/Summary/bg_movedetail") @sprites["background"].setBitmap("Graphics/UI/Summary/bg_movedetail")
end end
# Write various bits of text # Write various bits of text
textpos = [ textpos = [
@@ -765,7 +765,7 @@ class PokemonSummary_Scene
end end
if move if move
type_number = GameData::Type.get(move.display_type(@pokemon)).icon_position type_number = GameData::Type.get(move.display_type(@pokemon)).icon_position
imagepos.push(["Graphics/Pictures/types", 248, yPos - 4, 0, type_number * 28, 64, 28]) imagepos.push(["Graphics/UI/types", 248, yPos - 4, 0, type_number * 28, 64, 28])
textpos.push([move.name, 316, yPos, 0, moveBase, moveShadow]) textpos.push([move.name, 316, yPos, 0, moveBase, moveShadow])
if move.total_pp > 0 if move.total_pp > 0
textpos.push([_INTL("PP"), 342, yPos + 32, 0, moveBase, moveShadow]) textpos.push([_INTL("PP"), 342, yPos + 32, 0, moveBase, moveShadow])
@@ -823,7 +823,7 @@ class PokemonSummary_Scene
# Draw all text # Draw all text
pbDrawTextPositions(overlay, textpos) pbDrawTextPositions(overlay, textpos)
# Draw selected move's damage category icon # Draw selected move's damage category icon
imagepos = [["Graphics/Pictures/category", 166, 124, 0, selected_move.display_category(@pokemon) * 28, 64, 28]] imagepos = [["Graphics/UI/category", 166, 124, 0, selected_move.display_category(@pokemon) * 28, 64, 28]]
pbDrawImagePositions(overlay, imagepos) pbDrawImagePositions(overlay, imagepos)
# Draw selected move's description # Draw selected move's description
drawTextEx(overlay, 4, 224, 230, 5, selected_move.description, base, shadow) drawTextEx(overlay, 4, 224, 230, 5, selected_move.description, base, shadow)
@@ -847,7 +847,7 @@ class PokemonSummary_Scene
break if !@pokemon.ribbons[i] break if !@pokemon.ribbons[i]
ribbon_data = GameData::Ribbon.get(@pokemon.ribbons[i]) ribbon_data = GameData::Ribbon.get(@pokemon.ribbons[i])
ribn = ribbon_data.icon_position ribn = ribbon_data.icon_position
imagepos.push(["Graphics/Pictures/ribbons", imagepos.push(["Graphics/UI/Summary/ribbons",
230 + (68 * (coord % 4)), 78 + (68 * (coord / 4).floor), 230 + (68 * (coord % 4)), 78 + (68 * (coord / 4).floor),
64 * (ribn % 8), 64 * (ribn / 8).floor, 64, 64]) 64 * (ribn % 8), 64 * (ribn / 8).floor, 64, 64])
coord += 1 coord += 1
@@ -870,7 +870,7 @@ class PokemonSummary_Scene
desc = ribbonid ? GameData::Ribbon.get(ribbonid).description : "" desc = ribbonid ? GameData::Ribbon.get(ribbonid).description : ""
# Draw the description box # Draw the description box
imagepos = [ imagepos = [
["Graphics/Pictures/Summary/overlay_ribbon", 8, 280] ["Graphics/UI/Summary/overlay_ribbon", 8, 280]
] ]
pbDrawImagePositions(overlay, imagepos) pbDrawImagePositions(overlay, imagepos)
# Draw name of selected ribbon # Draw name of selected ribbon
+12 -12
View File
@@ -12,8 +12,8 @@ class Window_PokemonBag < Window_DrawableCommand
@sorting = false @sorting = false
@adapter = PokemonMartAdapter.new @adapter = PokemonMartAdapter.new
super(x, y, width, height) super(x, y, width, height)
@selarrow = AnimatedBitmap.new("Graphics/Pictures/Bag/cursor") @selarrow = AnimatedBitmap.new("Graphics/UI/Bag/cursor")
@swaparrow = AnimatedBitmap.new("Graphics/Pictures/Bag/cursor_swap") @swaparrow = AnimatedBitmap.new("Graphics/UI/Bag/cursor_swap")
self.windowskin = nil self.windowskin = nil
end end
@@ -82,12 +82,12 @@ class Window_PokemonBag < Window_DrawableCommand
if @bag.registered?(item) if @bag.registered?(item)
pbDrawImagePositions( pbDrawImagePositions(
self.contents, self.contents,
[["Graphics/Pictures/Bag/icon_register", rect.x + rect.width - 72, rect.y + 8, 0, 0, -1, 24]] [["Graphics/UI/Bag/icon_register", rect.x + rect.width - 72, rect.y + 8, 0, 0, -1, 24]]
) )
elsif pbCanRegisterItem?(item) elsif pbCanRegisterItem?(item)
pbDrawImagePositions( pbDrawImagePositions(
self.contents, self.contents,
[["Graphics/Pictures/Bag/icon_register", rect.x + rect.width - 72, rect.y + 8, 0, 24, -1, 24]] [["Graphics/UI/Bag/icon_register", rect.x + rect.width - 72, rect.y + 8, 0, 24, -1, 24]]
) )
end end
else else
@@ -172,8 +172,8 @@ class PokemonBag_Scene
end end
end end
@bag.last_viewed_pocket = lastpocket @bag.last_viewed_pocket = lastpocket
@sliderbitmap = AnimatedBitmap.new("Graphics/Pictures/Bag/icon_slider") @sliderbitmap = AnimatedBitmap.new("Graphics/UI/Bag/icon_slider")
@pocketbitmap = AnimatedBitmap.new("Graphics/Pictures/Bag/icon_pocket") @pocketbitmap = AnimatedBitmap.new("Graphics/UI/Bag/icon_pocket")
@sprites = {} @sprites = {}
@sprites["background"] = IconSprite.new(0, 0, @viewport) @sprites["background"] = IconSprite.new(0, 0, @viewport)
@sprites["overlay"] = BitmapSprite.new(Graphics.width, Graphics.height, @viewport) @sprites["overlay"] = BitmapSprite.new(Graphics.width, Graphics.height, @viewport)
@@ -182,12 +182,12 @@ class PokemonBag_Scene
@sprites["pocketicon"] = BitmapSprite.new(186, 32, @viewport) @sprites["pocketicon"] = BitmapSprite.new(186, 32, @viewport)
@sprites["pocketicon"].x = 0 @sprites["pocketicon"].x = 0
@sprites["pocketicon"].y = 224 @sprites["pocketicon"].y = 224
@sprites["leftarrow"] = AnimatedSprite.new("Graphics/Pictures/leftarrow", 8, 40, 28, 2, @viewport) @sprites["leftarrow"] = AnimatedSprite.new("Graphics/UI/left_arrow", 8, 40, 28, 2, @viewport)
@sprites["leftarrow"].x = -4 @sprites["leftarrow"].x = -4
@sprites["leftarrow"].y = 76 @sprites["leftarrow"].y = 76
@sprites["leftarrow"].visible = (!@choosing || numfilledpockets > 1) @sprites["leftarrow"].visible = (!@choosing || numfilledpockets > 1)
@sprites["leftarrow"].play @sprites["leftarrow"].play
@sprites["rightarrow"] = AnimatedSprite.new("Graphics/Pictures/rightarrow", 8, 40, 28, 2, @viewport) @sprites["rightarrow"] = AnimatedSprite.new("Graphics/UI/right_arrow", 8, 40, 28, 2, @viewport)
@sprites["rightarrow"].x = 150 @sprites["rightarrow"].x = 150
@sprites["rightarrow"].y = 76 @sprites["rightarrow"].y = 76
@sprites["rightarrow"].visible = (!@choosing || numfilledpockets > 1) @sprites["rightarrow"].visible = (!@choosing || numfilledpockets > 1)
@@ -258,13 +258,13 @@ class PokemonBag_Scene
def pbRefresh def pbRefresh
# Set the background image # Set the background image
@sprites["background"].setBitmap(sprintf("Graphics/Pictures/Bag/bg_#{@bag.last_viewed_pocket}")) @sprites["background"].setBitmap(sprintf("Graphics/UI/Bag/bg_#{@bag.last_viewed_pocket}"))
# Set the bag sprite # Set the bag sprite
fbagexists = pbResolveBitmap(sprintf("Graphics/Pictures/Bag/bag_#{@bag.last_viewed_pocket}_f")) fbagexists = pbResolveBitmap(sprintf("Graphics/UI/Bag/bag_#{@bag.last_viewed_pocket}_f"))
if $player.female? && fbagexists if $player.female? && fbagexists
@sprites["bagsprite"].setBitmap("Graphics/Pictures/Bag/bag_#{@bag.last_viewed_pocket}_f") @sprites["bagsprite"].setBitmap("Graphics/UI/Bag/bag_#{@bag.last_viewed_pocket}_f")
else else
@sprites["bagsprite"].setBitmap("Graphics/Pictures/Bag/bag_#{@bag.last_viewed_pocket}") @sprites["bagsprite"].setBitmap("Graphics/UI/Bag/bag_#{@bag.last_viewed_pocket}")
end end
# Draw the pocket icons # Draw the pocket icons
@sprites["pocketicon"].bitmap.clear @sprites["pocketicon"].bitmap.clear
+8 -8
View File
@@ -14,10 +14,10 @@ class PokegearButton < Sprite
@image = command[0] @image = command[0]
@name = command[1] @name = command[1]
@selected = false @selected = false
if $player.female? && pbResolveBitmap(sprintf("Graphics/Pictures/Pokegear/icon_button_f")) if $player.female? && pbResolveBitmap(sprintf("Graphics/UI/Pokegear/icon_button_f"))
@button = AnimatedBitmap.new("Graphics/Pictures/Pokegear/icon_button_f") @button = AnimatedBitmap.new("Graphics/UI/Pokegear/icon_button_f")
else else
@button = AnimatedBitmap.new("Graphics/Pictures/Pokegear/icon_button") @button = AnimatedBitmap.new("Graphics/UI/Pokegear/icon_button")
end end
@contents = BitmapWrapper.new(@button.width, @button.height) @contents = BitmapWrapper.new(@button.width, @button.height)
self.bitmap = @contents self.bitmap = @contents
@@ -49,7 +49,7 @@ class PokegearButton < Sprite
] ]
pbDrawTextPositions(self.bitmap, textpos) pbDrawTextPositions(self.bitmap, textpos)
imagepos = [ imagepos = [
[sprintf("Graphics/Pictures/Pokegear/icon_" + @image), 18, 10] [sprintf("Graphics/UI/Pokegear/icon_" + @image), 18, 10]
] ]
pbDrawImagePositions(self.bitmap, imagepos) pbDrawImagePositions(self.bitmap, imagepos)
end end
@@ -73,10 +73,10 @@ class PokemonPokegear_Scene
@viewport.z = 99999 @viewport.z = 99999
@sprites = {} @sprites = {}
@sprites["background"] = IconSprite.new(0, 0, @viewport) @sprites["background"] = IconSprite.new(0, 0, @viewport)
if $player.female? && pbResolveBitmap(sprintf("Graphics/Pictures/Pokegear/bg_f")) if $player.female? && pbResolveBitmap(sprintf("Graphics/UI/Pokegear/bg_f"))
@sprites["background"].setBitmap("Graphics/Pictures/Pokegear/bg_f") @sprites["background"].setBitmap("Graphics/UI/Pokegear/bg_f")
else else
@sprites["background"].setBitmap("Graphics/Pictures/Pokegear/bg") @sprites["background"].setBitmap("Graphics/UI/Pokegear/bg")
end end
@commands.length.times do |i| @commands.length.times do |i|
@sprites["button#{i}"] = PokegearButton.new(@commands[i], Graphics.width / 2, 0, @viewport) @sprites["button#{i}"] = PokegearButton.new(@commands[i], Graphics.width / 2, 0, @viewport)
@@ -180,7 +180,7 @@ MenuHandlers.add(:pokegear_menu, :phone, {
"name" => _INTL("Phone"), "name" => _INTL("Phone"),
"icon_name" => "phone", "icon_name" => "phone",
"order" => 20, "order" => 20,
"condition" => proc { next $PokemonGlobal.phoneNumbers && $PokemonGlobal.phoneNumbers.length > 0 }, # "condition" => proc { next $PokemonGlobal.phone && $PokemonGlobal.phone.contacts.length > 0 },
"effect" => proc { |menu| "effect" => proc { |menu|
pbFadeOutIn { PokemonPhoneScene.new.start } pbFadeOutIn { PokemonPhoneScene.new.start }
next false next false
+6 -6
View File
@@ -104,9 +104,9 @@ class PokemonRegionMap_Scene
pbMessage(_INTL("The map data cannot be found.")) pbMessage(_INTL("The map data cannot be found."))
return false return false
end end
addBackgroundOrColoredPlane(@sprites, "background", "mapbg", Color.new(0, 0, 0), @viewport) addBackgroundOrColoredPlane(@sprites, "background", "Town Map/bg", Color.black, @viewport)
@sprites["map"] = IconSprite.new(0, 0, @viewport) @sprites["map"] = IconSprite.new(0, 0, @viewport)
@sprites["map"].setBitmap("Graphics/Pictures/#{@map[1]}") @sprites["map"].setBitmap("Graphics/UI/Town Map/#{@map[1]}")
@sprites["map"].x += (Graphics.width - @sprites["map"].bitmap.width) / 2 @sprites["map"].x += (Graphics.width - @sprites["map"].bitmap.width) / 2
@sprites["map"].y += (Graphics.height - @sprites["map"].bitmap.height) / 2 @sprites["map"].y += (Graphics.height - @sprites["map"].bitmap.height) / 2
Settings::REGION_MAP_EXTRAS.each do |graphic| Settings::REGION_MAP_EXTRAS.each do |graphic|
@@ -118,7 +118,7 @@ class PokemonRegionMap_Scene
end end
pbDrawImagePositions( pbDrawImagePositions(
@sprites["map2"].bitmap, @sprites["map2"].bitmap,
[["Graphics/Pictures/#{graphic[4]}", graphic[2] * SQUARE_WIDTH, graphic[3] * SQUARE_HEIGHT]] [["Graphics/UI/Town Map/#{graphic[4]}", graphic[2] * SQUARE_WIDTH, graphic[3] * SQUARE_HEIGHT]]
) )
end end
@sprites["mapbottom"] = MapBottomSprite.new(@viewport) @sprites["mapbottom"] = MapBottomSprite.new(@viewport)
@@ -136,7 +136,7 @@ class PokemonRegionMap_Scene
(TOP..BOTTOM).each do |j| (TOP..BOTTOM).each do |j|
healspot = pbGetHealingSpot(i, j) healspot = pbGetHealingSpot(i, j)
next if !healspot || !$PokemonGlobal.visitedMaps[healspot[0]] next if !healspot || !$PokemonGlobal.visitedMaps[healspot[0]]
@sprites["point#{k}"] = AnimatedSprite.create("Graphics/Pictures/mapFly", 2, 16) @sprites["point#{k}"] = AnimatedSprite.create("Graphics/UI/Town Map/icon_fly", 2, 16)
@sprites["point#{k}"].viewport = @viewport @sprites["point#{k}"].viewport = @viewport
@sprites["point#{k}"].x = point_x_to_screen_x(i) @sprites["point#{k}"].x = point_x_to_screen_x(i)
@sprites["point#{k}"].y = point_y_to_screen_y(j) @sprites["point#{k}"].y = point_y_to_screen_y(j)
@@ -145,7 +145,7 @@ class PokemonRegionMap_Scene
k += 1 k += 1
end end
end end
@sprites["cursor"] = AnimatedSprite.create("Graphics/Pictures/mapCursor", 2, 5) @sprites["cursor"] = AnimatedSprite.create("Graphics/UI/Town Map/cursor", 2, 5)
@sprites["cursor"].viewport = @viewport @sprites["cursor"].viewport = @viewport
@sprites["cursor"].x = point_x_to_screen_x(@map_x) @sprites["cursor"].x = point_x_to_screen_x(@map_x)
@sprites["cursor"].y = point_y_to_screen_y(@map_y) @sprites["cursor"].y = point_y_to_screen_y(@map_y)
@@ -250,7 +250,7 @@ class PokemonRegionMap_Scene
text = (@mode == 0) ? _INTL("ACTION: Fly") : _INTL("ACTION: Cancel Fly") text = (@mode == 0) ? _INTL("ACTION: Fly") : _INTL("ACTION: Cancel Fly")
pbDrawTextPositions( pbDrawTextPositions(
@sprites["help"].bitmap, @sprites["help"].bitmap,
[[text, Graphics.width - 16, 4, 1, Color.new(248, 248, 248), Color.new(0, 0, 0)]] [[text, Graphics.width - 16, 4, 1, Color.new(248, 248, 248), Color.black]]
) )
@sprites.each do |key, sprite| @sprites.each do |key, sprite|
next if !key.include?("point") next if !key.include?("point")
+50 -60
View File
@@ -3,9 +3,9 @@
#=============================================================================== #===============================================================================
class Window_PhoneList < Window_CommandPokemon class Window_PhoneList < Window_CommandPokemon
def drawCursor(index, rect) def drawCursor(index, rect)
selarrow = AnimatedBitmap.new("Graphics/Pictures/phoneSel") selarrow = AnimatedBitmap.new("Graphics/UI/Phone/cursor")
if self.index == index if self.index == index
pbCopyBitmap(self.contents, selarrow.bitmap, rect.x, rect.y) pbCopyBitmap(self.contents, selarrow.bitmap, rect.x, rect.y + 2)
end end
return Rect.new(rect.x + 28, rect.y + 8, rect.width - 16, rect.height) return Rect.new(rect.x + 28, rect.y + 8, rect.width - 16, rect.height)
end end
@@ -22,44 +22,60 @@ end
#=============================================================================== #===============================================================================
class PokemonPhoneScene class PokemonPhoneScene
def start def start
commands = [] # Get list of contacts
@trainers = [] @contacts = []
if $PokemonGlobal.phoneNumbers $PokemonGlobal.phone.contacts.each do |contact|
$PokemonGlobal.phoneNumbers.each do |num| @contacts.push(contact) if contact.visible?
if num[0] # if visible
if num.length == 8 # if trainer
@trainers.push([num[1], num[2], num[6], (num[4] >= 2)])
else # if NPC
@trainers.push([num[1], num[2], num[3]])
end
end
end
end end
if @trainers.length == 0 if @contacts.length == 0
pbMessage(_INTL("There are no phone numbers stored.")) pbMessage(_INTL("There are no phone numbers stored."))
return return
end end
# Create list of commands (display names of contacts) and count rematches
commands = []
rematch_count = 0
@contacts.each do |contact|
commands.push(contact.display_name)
rematch_count += 1 if contact.can_rematch?
end
# Create viewport and sprites
@sprites = {} @sprites = {}
@viewport = Viewport.new(0, 0, Graphics.width, Graphics.height) @viewport = Viewport.new(0, 0, Graphics.width, Graphics.height)
@viewport.z = 99999 @viewport.z = 99999
addBackgroundPlane(@sprites, "bg", "Phone/bg", @viewport)
@sprites["list"] = Window_PhoneList.newEmpty(152, 32, Graphics.width - 142, Graphics.height - 80, @viewport) @sprites["list"] = Window_PhoneList.newEmpty(152, 32, Graphics.width - 142, Graphics.height - 80, @viewport)
@sprites["list"].windowskin = nil
@sprites["list"].commands = commands
@sprites["list"].page_item_max.times do |i|
@sprites["rematch[#{i}]"] = IconSprite.new(468, 62 + (i * 32), @viewport)
j = i + @sprites["list"].top_item
if j < @contacts.length && @contacts[j].can_rematch?
@sprites["rematch[#{i}]"].setBitmap("Graphics/UI/Phone/icon_rematch")
end
end
@sprites["header"] = Window_UnformattedTextPokemon.newWithSize( @sprites["header"] = Window_UnformattedTextPokemon.newWithSize(
_INTL("Phone"), 2, -18, 128, 64, @viewport _INTL("Phone"), 2, -18, 128, 64, @viewport
) )
@sprites["header"].baseColor = Color.new(248, 248, 248) @sprites["header"].baseColor = Color.new(248, 248, 248)
@sprites["header"].shadowColor = Color.new(0, 0, 0) @sprites["header"].shadowColor = Color.black
mapname = (@trainers[0][2]) ? pbGetMapNameFromId(@trainers[0][2]) : "" @sprites["header"].windowskin = nil
@sprites["bottom"] = Window_AdvancedTextPokemon.newWithSize( @sprites["bottom"] = Window_AdvancedTextPokemon.newWithSize(
"", 162, Graphics.height - 64, Graphics.width - 158, 64, @viewport "", 162, Graphics.height - 64, Graphics.width - 158, 64, @viewport
) )
@sprites["bottom"].text = "<ac>" + mapname @sprites["bottom"].windowskin = nil
map_name = (@contacts[0].map_id > 0) ? pbGetMapNameFromId(@contacts[0].map_id) : ""
@sprites["bottom"].text = "<ac>" + map_name
@sprites["info"] = Window_AdvancedTextPokemon.newWithSize("", -8, 224, 180, 160, @viewport) @sprites["info"] = Window_AdvancedTextPokemon.newWithSize("", -8, 224, 180, 160, @viewport)
addBackgroundPlane(@sprites, "bg", "phonebg", @viewport) @sprites["info"].windowskin = nil
infotext = _INTL("Registered<br>")
infotext += _INTL(" <r>{1}<br>", @sprites["list"].commands.length)
infotext += _INTL("Waiting for a rematch<r>{1}", rematch_count)
@sprites["info"].text = infotext
@sprites["icon"] = IconSprite.new(70, 102, @viewport) @sprites["icon"] = IconSprite.new(70, 102, @viewport)
if @trainers[0].length == 4 if @contacts[0].trainer?
filename = GameData::TrainerType.charset_filename(@trainers[0][0]) filename = GameData::TrainerType.charset_filename(@contacts[0].trainer_type)
else else
filename = sprintf("Graphics/Characters/phone%03d", @trainers[0][0]) filename = sprintf("Graphics/Characters/phone%03d", @contacts[0].common_event_id)
end end
@sprites["icon"].setBitmap(filename) @sprites["icon"].setBitmap(filename)
charwidth = @sprites["icon"].bitmap.width charwidth = @sprites["icon"].bitmap.width
@@ -67,33 +83,7 @@ class PokemonPhoneScene
@sprites["icon"].x = 86 - (charwidth / 8) @sprites["icon"].x = 86 - (charwidth / 8)
@sprites["icon"].y = 134 - (charheight / 8) @sprites["icon"].y = 134 - (charheight / 8)
@sprites["icon"].src_rect = Rect.new(0, 0, charwidth / 4, charheight / 4) @sprites["icon"].src_rect = Rect.new(0, 0, charwidth / 4, charheight / 4)
@trainers.each do |trainer| # Start scene
if trainer.length == 4
displayname = _INTL("{1} {2}", GameData::TrainerType.get(trainer[0]).name,
pbGetMessageFromHash(MessageTypes::TrainerNames, trainer[1]))
commands.push(displayname) # trainer's display name
else
commands.push(trainer[1]) # NPC's display name
end
end
@sprites["list"].commands = commands
@sprites["list"].page_item_max.times do |i|
@sprites["rematch[#{i}]"] = IconSprite.new(468, 62 + (i * 32), @viewport)
j = i + @sprites["list"].top_item
next if j >= commands.length
trainer = @trainers[j]
if trainer.length == 4 && trainer[3]
@sprites["rematch[#{i}]"].setBitmap("Graphics/Pictures/phoneRematch")
end
end
rematchcount = 0
@trainers.each do |trainer|
rematchcount += 1 if trainer.length == 4 && trainer[3]
end
infotext = _INTL("Registered<br>")
infotext += _INTL(" <r>{1}<br>", @sprites["list"].commands.length)
infotext += _INTL("Waiting for a rematch<r>{1}", rematchcount)
@sprites["info"].text = infotext
pbFadeInAndShow(@sprites) pbFadeInAndShow(@sprites)
pbActivateWindow(@sprites, "list") { pbActivateWindow(@sprites, "list") {
oldindex = -1 oldindex = -1
@@ -101,12 +91,13 @@ class PokemonPhoneScene
Graphics.update Graphics.update
Input.update Input.update
pbUpdateSpriteHash(@sprites) pbUpdateSpriteHash(@sprites)
# Cursor moved, update display
if @sprites["list"].index != oldindex if @sprites["list"].index != oldindex
trainer = @trainers[@sprites["list"].index] contact = @contacts[@sprites["list"].index]
if trainer.length == 4 if contact.trainer?
filename = GameData::TrainerType.charset_filename(trainer[0]) filename = GameData::TrainerType.charset_filename(contact.trainer_type)
else else
filename = sprintf("Graphics/Characters/phone%03d", trainer[0]) filename = sprintf("Graphics/Characters/phone%03d", contact.common_event_id)
end end
@sprites["icon"].setBitmap(filename) @sprites["icon"].setBitmap(filename)
charwidth = @sprites["icon"].bitmap.width charwidth = @sprites["icon"].bitmap.width
@@ -114,24 +105,23 @@ class PokemonPhoneScene
@sprites["icon"].x = 86 - (charwidth / 8) @sprites["icon"].x = 86 - (charwidth / 8)
@sprites["icon"].y = 134 - (charheight / 8) @sprites["icon"].y = 134 - (charheight / 8)
@sprites["icon"].src_rect = Rect.new(0, 0, charwidth / 4, charheight / 4) @sprites["icon"].src_rect = Rect.new(0, 0, charwidth / 4, charheight / 4)
mapname = (trainer[2]) ? pbGetMapNameFromId(trainer[2]) : "" map_name = (contact.map_id > 0) ? pbGetMapNameFromId(contact.map_id) : ""
@sprites["bottom"].text = "<ac>" + mapname @sprites["bottom"].text = "<ac>" + map_name
@sprites["list"].page_item_max.times do |i| @sprites["list"].page_item_max.times do |i|
@sprites["rematch[#{i}]"].clearBitmaps @sprites["rematch[#{i}]"].clearBitmaps
j = i + @sprites["list"].top_item j = i + @sprites["list"].top_item
next if j >= commands.length if j < @contacts.length && @contacts[j].can_rematch?
trainer = @trainers[j] @sprites["rematch[#{i}]"].setBitmap("Graphics/UI/Phone/icon_rematch")
if trainer.length == 4 && trainer[3]
@sprites["rematch[#{i}]"].setBitmap("Graphics/Pictures/phoneRematch")
end end
end end
end end
# Get inputs
if Input.trigger?(Input::BACK) if Input.trigger?(Input::BACK)
pbPlayCloseMenuSE pbPlayCloseMenuSE
break break
elsif Input.trigger?(Input::USE) elsif Input.trigger?(Input::USE)
index = @sprites["list"].index index = @sprites["list"].index
pbCallTrainer(@trainers[index][0], @trainers[index][1]) if index >= 0 Phone::Call.make_outgoing(@contacts[index]) if index >= 0
end end
end end
} }
+2 -2
View File
@@ -12,12 +12,12 @@ class PokemonJukebox_Scene
@viewport.z = 99999 @viewport.z = 99999
@sprites = {} @sprites = {}
@sprites["background"] = IconSprite.new(0, 0, @viewport) @sprites["background"] = IconSprite.new(0, 0, @viewport)
@sprites["background"].setBitmap("Graphics/Pictures/jukeboxbg") @sprites["background"].setBitmap("Graphics/UI/jukebox_bg")
@sprites["header"] = Window_UnformattedTextPokemon.newWithSize( @sprites["header"] = Window_UnformattedTextPokemon.newWithSize(
_INTL("Jukebox"), 2, -18, 128, 64, @viewport _INTL("Jukebox"), 2, -18, 128, 64, @viewport
) )
@sprites["header"].baseColor = Color.new(248, 248, 248) @sprites["header"].baseColor = Color.new(248, 248, 248)
@sprites["header"].shadowColor = Color.new(0, 0, 0) @sprites["header"].shadowColor = Color.black
@sprites["header"].windowskin = nil @sprites["header"].windowskin = nil
@sprites["commands"] = Window_CommandPokemon.newWithSize( @sprites["commands"] = Window_CommandPokemon.newWithSize(
@commands, 94, 92, 324, 224, @viewport @commands, 94, 92, 324, 224, @viewport
+5 -5
View File
@@ -10,18 +10,18 @@ class PokemonTrainerCard_Scene
@viewport = Viewport.new(0, 0, Graphics.width, Graphics.height) @viewport = Viewport.new(0, 0, Graphics.width, Graphics.height)
@viewport.z = 99999 @viewport.z = 99999
@sprites = {} @sprites = {}
background = pbResolveBitmap(sprintf("Graphics/Pictures/Trainer Card/bg_f")) background = pbResolveBitmap(sprintf("Graphics/UI/Trainer Card/bg_f"))
if $player.female? && background if $player.female? && background
addBackgroundPlane(@sprites, "bg", "Trainer Card/bg_f", @viewport) addBackgroundPlane(@sprites, "bg", "Trainer Card/bg_f", @viewport)
else else
addBackgroundPlane(@sprites, "bg", "Trainer Card/bg", @viewport) addBackgroundPlane(@sprites, "bg", "Trainer Card/bg", @viewport)
end end
cardexists = pbResolveBitmap(sprintf("Graphics/Pictures/Trainer Card/card_f")) cardexists = pbResolveBitmap(sprintf("Graphics/UI/Trainer Card/card_f"))
@sprites["card"] = IconSprite.new(0, 0, @viewport) @sprites["card"] = IconSprite.new(0, 0, @viewport)
if $player.female? && cardexists if $player.female? && cardexists
@sprites["card"].setBitmap("Graphics/Pictures/Trainer Card/card_f") @sprites["card"].setBitmap("Graphics/UI/Trainer Card/card_f")
else else
@sprites["card"].setBitmap("Graphics/Pictures/Trainer Card/card") @sprites["card"].setBitmap("Graphics/UI/Trainer Card/card")
end end
@sprites["overlay"] = BitmapSprite.new(Graphics.width, Graphics.height, @viewport) @sprites["overlay"] = BitmapSprite.new(Graphics.width, Graphics.height, @viewport)
pbSetSystemFont(@sprites["overlay"].bitmap) pbSetSystemFont(@sprites["overlay"].bitmap)
@@ -68,7 +68,7 @@ class PokemonTrainerCard_Scene
imagePositions = [] imagePositions = []
8.times do |i| 8.times do |i|
if $player.badges[i + (region * 8)] if $player.badges[i + (region * 8)]
imagePositions.push(["Graphics/Pictures/Trainer Card/icon_badges", x, 310, i * 32, region * 32, 32, 32]) imagePositions.push(["Graphics/UI/Trainer Card/icon_badges", x, 310, i * 32, region * 32, 32, 32])
end end
x += 48 x += 48
end end
+3 -3
View File
@@ -20,7 +20,7 @@ class PokemonLoadPanel < Sprite
@totalsec = (stats) ? stats.play_time.to_i : ((framecount || 0) / Graphics.frame_rate) @totalsec = (stats) ? stats.play_time.to_i : ((framecount || 0) / Graphics.frame_rate)
@mapid = mapid @mapid = mapid
@selected = (index == 0) @selected = (index == 0)
@bgbitmap = AnimatedBitmap.new("Graphics/Pictures/loadPanels") @bgbitmap = AnimatedBitmap.new("Graphics/UI/Load/panels")
@refreshBitmap = true @refreshBitmap = true
@refreshing = false @refreshing = false
refresh refresh
@@ -103,7 +103,7 @@ class PokemonLoad_Scene
@sprites = {} @sprites = {}
@viewport = Viewport.new(0, 0, Graphics.width, Graphics.height) @viewport = Viewport.new(0, 0, Graphics.width, Graphics.height)
@viewport.z = 99998 @viewport.z = 99998
addBackgroundOrColoredPlane(@sprites, "background", "loadbg", Color.new(248, 248, 248), @viewport) addBackgroundOrColoredPlane(@sprites, "background", "Load/bg", Color.new(248, 248, 248), @viewport)
y = 32 y = 32
commands.length.times do |i| commands.length.times do |i|
@sprites["panel#{i}"] = PokemonLoadPanel.new( @sprites["panel#{i}"] = PokemonLoadPanel.new(
@@ -128,7 +128,7 @@ class PokemonLoad_Scene
@sprites = {} @sprites = {}
@viewport = Viewport.new(0, 0, Graphics.width, Graphics.height) @viewport = Viewport.new(0, 0, Graphics.width, Graphics.height)
@viewport.z = 99998 @viewport.z = 99998
addBackgroundOrColoredPlane(@sprites, "background", "loadbg", Color.new(248, 248, 248), @viewport) addBackgroundOrColoredPlane(@sprites, "background", "Load/bg", Color.new(248, 248, 248), @viewport)
end end
def pbUpdate def pbUpdate
+3 -3
View File
@@ -13,9 +13,9 @@ class ReadyMenuButton < Sprite
@selected = selected @selected = selected
@side = side @side = side
if @command[2] if @command[2]
@button = AnimatedBitmap.new("Graphics/Pictures/Ready Menu/icon_movebutton") @button = AnimatedBitmap.new("Graphics/UI/Ready Menu/icon_movebutton")
else else
@button = AnimatedBitmap.new("Graphics/Pictures/Ready Menu/icon_itembutton") @button = AnimatedBitmap.new("Graphics/UI/Ready Menu/icon_itembutton")
end end
@contents = BitmapWrapper.new(@button.width, @button.height / 2) @contents = BitmapWrapper.new(@button.width, @button.height / 2)
self.bitmap = @contents self.bitmap = @contents
@@ -124,7 +124,7 @@ class PokemonReadyMenu_Scene
@viewport.z = 99999 @viewport.z = 99999
@sprites = {} @sprites = {}
@sprites["cmdwindow"] = Window_CommandPokemon.new((@index[2] == 0) ? @movecommands : @itemcommands) @sprites["cmdwindow"] = Window_CommandPokemon.new((@index[2] == 0) ? @movecommands : @itemcommands)
@sprites["cmdwindow"].height = 6 * 32 @sprites["cmdwindow"].height = 192
@sprites["cmdwindow"].visible = false @sprites["cmdwindow"].visible = false
@sprites["cmdwindow"].viewport = @viewport @sprites["cmdwindow"].viewport = @viewport
@commands[0].length.times do |i| @commands[0].length.times do |i|
+25 -25
View File
@@ -130,14 +130,14 @@ class PokemonBoxArrow < Sprite
@placingState = 0 @placingState = 0
@heldpkmn = nil @heldpkmn = nil
@handsprite = ChangelingSprite.new(0, 0, viewport) @handsprite = ChangelingSprite.new(0, 0, viewport)
@handsprite.addBitmap("point1", "Graphics/Pictures/Storage/cursor_point_1") @handsprite.addBitmap("point1", "Graphics/UI/Storage/cursor_point_1")
@handsprite.addBitmap("point2", "Graphics/Pictures/Storage/cursor_point_2") @handsprite.addBitmap("point2", "Graphics/UI/Storage/cursor_point_2")
@handsprite.addBitmap("grab", "Graphics/Pictures/Storage/cursor_grab") @handsprite.addBitmap("grab", "Graphics/UI/Storage/cursor_grab")
@handsprite.addBitmap("fist", "Graphics/Pictures/Storage/cursor_fist") @handsprite.addBitmap("fist", "Graphics/UI/Storage/cursor_fist")
@handsprite.addBitmap("point1q", "Graphics/Pictures/Storage/cursor_point_1_q") @handsprite.addBitmap("point1q", "Graphics/UI/Storage/cursor_point_1_q")
@handsprite.addBitmap("point2q", "Graphics/Pictures/Storage/cursor_point_2_q") @handsprite.addBitmap("point2q", "Graphics/UI/Storage/cursor_point_2_q")
@handsprite.addBitmap("grabq", "Graphics/Pictures/Storage/cursor_grab_q") @handsprite.addBitmap("grabq", "Graphics/UI/Storage/cursor_grab_q")
@handsprite.addBitmap("fistq", "Graphics/Pictures/Storage/cursor_fist_q") @handsprite.addBitmap("fistq", "Graphics/UI/Storage/cursor_fist_q")
@handsprite.changeBitmap("fist") @handsprite.changeBitmap("fist")
@spriteX = self.x @spriteX = self.x
@spriteY = self.y @spriteY = self.y
@@ -372,7 +372,7 @@ class PokemonBoxSprite < Sprite
@storage[@boxnumber].background = @bg @storage[@boxnumber].background = @bg
end end
@boxbitmap&.dispose @boxbitmap&.dispose
@boxbitmap = AnimatedBitmap.new("Graphics/Pictures/Storage/box_#{@bg}") @boxbitmap = AnimatedBitmap.new("Graphics/UI/Storage/box_#{@bg}")
end end
end end
@@ -447,7 +447,7 @@ class PokemonBoxPartySprite < Sprite
def initialize(party, viewport = nil) def initialize(party, viewport = nil)
super(viewport) super(viewport)
@party = party @party = party
@boxbitmap = AnimatedBitmap.new("Graphics/Pictures/Storage/overlay_party") @boxbitmap = AnimatedBitmap.new("Graphics/UI/Storage/overlay_party")
@pokemonsprites = [] @pokemonsprites = []
Settings::MAX_PARTY_SIZE.times do |i| Settings::MAX_PARTY_SIZE.times do |i|
@pokemonsprites[i] = nil @pokemonsprites[i] = nil
@@ -593,7 +593,7 @@ class PokemonStorageScene
addBackgroundPlane(@sprites, "background", "Storage/bg", @bgviewport) addBackgroundPlane(@sprites, "background", "Storage/bg", @bgviewport)
@sprites["box"] = PokemonBoxSprite.new(@storage, @storage.currentBox, @boxviewport) @sprites["box"] = PokemonBoxSprite.new(@storage, @storage.currentBox, @boxviewport)
@sprites["boxsides"] = IconSprite.new(0, 0, @boxsidesviewport) @sprites["boxsides"] = IconSprite.new(0, 0, @boxsidesviewport)
@sprites["boxsides"].setBitmap("Graphics/Pictures/Storage/overlay_main") @sprites["boxsides"].setBitmap("Graphics/UI/Storage/overlay_main")
@sprites["overlay"] = BitmapSprite.new(Graphics.width, Graphics.height, @boxsidesviewport) @sprites["overlay"] = BitmapSprite.new(Graphics.width, Graphics.height, @boxsidesviewport)
pbSetSystemFont(@sprites["overlay"].bitmap) pbSetSystemFont(@sprites["overlay"].bitmap)
@sprites["pokemon"] = AutoMosaicPokemonSprite.new(@boxsidesviewport) @sprites["pokemon"] = AutoMosaicPokemonSprite.new(@boxsidesviewport)
@@ -605,9 +605,9 @@ class PokemonStorageScene
@sprites["boxparty"].x = 182 @sprites["boxparty"].x = 182
@sprites["boxparty"].y = Graphics.height @sprites["boxparty"].y = Graphics.height
end end
@markingbitmap = AnimatedBitmap.new("Graphics/Pictures/Storage/markings") @markingbitmap = AnimatedBitmap.new("Graphics/UI/Storage/markings")
@sprites["markingbg"] = IconSprite.new(292, 68, @boxsidesviewport) @sprites["markingbg"] = IconSprite.new(292, 68, @boxsidesviewport)
@sprites["markingbg"].setBitmap("Graphics/Pictures/Storage/overlay_marking") @sprites["markingbg"].setBitmap("Graphics/UI/Storage/overlay_marking")
@sprites["markingbg"].visible = false @sprites["markingbg"].visible = false
@sprites["markingoverlay"] = BitmapSprite.new(Graphics.width, Graphics.height, @boxsidesviewport) @sprites["markingoverlay"] = BitmapSprite.new(Graphics.width, Graphics.height, @boxsidesviewport)
@sprites["markingoverlay"].visible = false @sprites["markingoverlay"].visible = false
@@ -695,15 +695,15 @@ class PokemonStorageScene
def pbSetArrow(arrow, selection) def pbSetArrow(arrow, selection)
case selection case selection
when -1, -4, -5 # Box name, move left, move right when -1, -4, -5 # Box name, move left, move right
arrow.x = 157 * 2 arrow.x = 314
arrow.y = -12 * 2 arrow.y = -24
when -2 # Party Pokémon when -2 # Party Pokémon
arrow.x = 119 * 2 arrow.x = 238
arrow.y = 139 * 2 arrow.y = 278
when -3 # Close Box when -3 # Close Box
arrow.x = 207 * 2 arrow.x = 414
arrow.y = 139 * 2 arrow.y = 278
else else
arrow.x = (97 + (24 * (selection % PokemonBox::BOX_WIDTH))) * 2 arrow.x = (97 + (24 * (selection % PokemonBox::BOX_WIDTH))) * 2
arrow.y = (8 + (24 * (selection / PokemonBox::BOX_WIDTH))) * 2 arrow.y = (8 + (24 * (selection / PokemonBox::BOX_WIDTH))) * 2
@@ -1429,7 +1429,7 @@ class PokemonStorageScene
elsif pokemon.female? elsif pokemon.female?
textstrings.push([_INTL(""), 148, 14, false, Color.new(248, 56, 32), Color.new(224, 152, 144)]) textstrings.push([_INTL(""), 148, 14, false, Color.new(248, 56, 32), Color.new(224, 152, 144)])
end end
imagepos.push(["Graphics/Pictures/Storage/overlay_lv", 6, 246]) imagepos.push(["Graphics/UI/Storage/overlay_lv", 6, 246])
textstrings.push([pokemon.level.to_s, 28, 240, false, base, shadow]) textstrings.push([pokemon.level.to_s, 28, 240, false, base, shadow])
if pokemon.ability if pokemon.ability
textstrings.push([pokemon.ability.name, 86, 312, 2, base, shadow]) textstrings.push([pokemon.ability.name, 86, 312, 2, base, shadow])
@@ -1442,9 +1442,9 @@ class PokemonStorageScene
textstrings.push([_INTL("No item"), 86, 348, 2, nonbase, nonshadow]) textstrings.push([_INTL("No item"), 86, 348, 2, nonbase, nonshadow])
end end
if pokemon.shiny? if pokemon.shiny?
imagepos.push(["Graphics/Pictures/shiny", 156, 198]) imagepos.push(["Graphics/UI/shiny", 156, 198])
end end
typebitmap = AnimatedBitmap.new(_INTL("Graphics/Pictures/types")) typebitmap = AnimatedBitmap.new(_INTL("Graphics/UI/types"))
pokemon.types.each_with_index do |type, i| pokemon.types.each_with_index do |type, i|
type_number = GameData::Type.get(type).icon_position type_number = GameData::Type.get(type).icon_position
type_rect = Rect.new(0, type_number * 28, 64, 28) type_rect = Rect.new(0, type_number * 28, 64, 28)
+1 -1
View File
@@ -75,7 +75,7 @@ class ItemStorage_Scene
@bag = bag @bag = bag
@sprites = {} @sprites = {}
@sprites["background"] = IconSprite.new(0, 0, @viewport) @sprites["background"] = IconSprite.new(0, 0, @viewport)
@sprites["background"].setBitmap("Graphics/Pictures/pcItembg") @sprites["background"].setBitmap("Graphics/UI/itemstorage_bg")
@sprites["icon"] = ItemIconSprite.new(50, 334, nil, @viewport) @sprites["icon"] = ItemIconSprite.new(50, 334, nil, @viewport)
# Item list # Item list
@sprites["itemwindow"] = Window_PokemonItemStorage.new(@bag, 98, 14, 334, 32 + (ITEMSVISIBLE * 32)) @sprites["itemwindow"] = Window_PokemonItemStorage.new(@bag, 98, 14, 334, 32 + (ITEMSVISIBLE * 32))
+3 -5
View File
@@ -157,7 +157,7 @@ class Window_PokemonMart < Window_DrawableCommand
@stock = stock @stock = stock
@adapter = adapter @adapter = adapter
super(x, y, width, height, viewport) super(x, y, width, height, viewport)
@selarrow = AnimatedBitmap.new("Graphics/Pictures/martSel") @selarrow = AnimatedBitmap.new("Graphics/UI/Mart/cursor")
@baseColor = Color.new(88, 88, 80) @baseColor = Color.new(88, 88, 80)
@shadowColor = Color.new(168, 184, 184) @shadowColor = Color.new(168, 184, 184)
self.windowskin = nil self.windowskin = nil
@@ -224,7 +224,7 @@ class PokemonMart_Scene
@adapter = adapter @adapter = adapter
@sprites = {} @sprites = {}
@sprites["background"] = IconSprite.new(0, 0, @viewport) @sprites["background"] = IconSprite.new(0, 0, @viewport)
@sprites["background"].setBitmap("Graphics/Pictures/martScreen") @sprites["background"].setBitmap("Graphics/UI/Mart/bg")
@sprites["icon"] = ItemIconSprite.new(36, Graphics.height - 50, nil, @viewport) @sprites["icon"] = ItemIconSprite.new(36, Graphics.height - 50, nil, @viewport)
winAdapter = buying ? BuyAdapter.new(adapter) : SellAdapter.new(adapter) winAdapter = buying ? BuyAdapter.new(adapter) : SellAdapter.new(adapter)
@sprites["itemwindow"] = Window_PokemonMart.new( @sprites["itemwindow"] = Window_PokemonMart.new(
@@ -238,7 +238,7 @@ class PokemonMart_Scene
) )
pbPrepareWindow(@sprites["itemtextwindow"]) pbPrepareWindow(@sprites["itemtextwindow"])
@sprites["itemtextwindow"].baseColor = Color.new(248, 248, 248) @sprites["itemtextwindow"].baseColor = Color.new(248, 248, 248)
@sprites["itemtextwindow"].shadowColor = Color.new(0, 0, 0) @sprites["itemtextwindow"].shadowColor = Color.black
@sprites["itemtextwindow"].windowskin = nil @sprites["itemtextwindow"].windowskin = nil
@sprites["helpwindow"] = Window_AdvancedTextPokemon.new("") @sprites["helpwindow"] = Window_AdvancedTextPokemon.new("")
pbPrepareWindow(@sprites["helpwindow"]) pbPrepareWindow(@sprites["helpwindow"])
@@ -460,7 +460,6 @@ class PokemonMart_Scene
ret = 0 ret = 0
helpwindow = @sprites["helpwindow"] helpwindow = @sprites["helpwindow"]
itemprice = @adapter.getPrice(item, !@buying) itemprice = @adapter.getPrice(item, !@buying)
itemprice /= 2 if !@buying
pbDisplay(helptext, true) pbDisplay(helptext, true)
using(numwindow = Window_AdvancedTextPokemon.new("")) do # Showing number of items using(numwindow = Window_AdvancedTextPokemon.new("")) do # Showing number of items
pbPrepareWindow(numwindow) pbPrepareWindow(numwindow)
@@ -681,7 +680,6 @@ class PokemonMartScreen
@scene.pbHideMoney @scene.pbHideMoney
next next
end end
price /= 2
price *= qty price *= qty
if pbConfirm(_INTL("I can pay ${1}.\nWould that be OK?", price.to_s_formatted)) if pbConfirm(_INTL("I can pay ${1}.\nWould that be OK?", price.to_s_formatted))
old_money = @adapter.getMoney old_money = @adapter.getMoney
+12 -12
View File
@@ -25,13 +25,13 @@ class MoveRelearner_Scene
@viewport = Viewport.new(0, 0, Graphics.width, Graphics.height) @viewport = Viewport.new(0, 0, Graphics.width, Graphics.height)
@viewport.z = 99999 @viewport.z = 99999
@sprites = {} @sprites = {}
addBackgroundPlane(@sprites, "bg", "reminderbg", @viewport) addBackgroundPlane(@sprites, "bg", "Move Reminder/bg", @viewport)
@sprites["pokeicon"] = PokemonIconSprite.new(@pokemon, @viewport) @sprites["pokeicon"] = PokemonIconSprite.new(@pokemon, @viewport)
@sprites["pokeicon"].setOffset(PictureOrigin::CENTER) @sprites["pokeicon"].setOffset(PictureOrigin::CENTER)
@sprites["pokeicon"].x = 320 @sprites["pokeicon"].x = 320
@sprites["pokeicon"].y = 84 @sprites["pokeicon"].y = 84
@sprites["background"] = IconSprite.new(0, 0, @viewport) @sprites["background"] = IconSprite.new(0, 0, @viewport)
@sprites["background"].setBitmap("Graphics/Pictures/reminderSel") @sprites["background"].setBitmap("Graphics/UI/Move Reminder/cursor")
@sprites["background"].y = 78 @sprites["background"].y = 78
@sprites["background"].src_rect = Rect.new(0, 72, 258, 72) @sprites["background"].src_rect = Rect.new(0, 72, 258, 72)
@sprites["overlay"] = BitmapSprite.new(Graphics.width, Graphics.height, @viewport) @sprites["overlay"] = BitmapSprite.new(Graphics.width, Graphics.height, @viewport)
@@ -42,7 +42,7 @@ class MoveRelearner_Scene
@sprites["msgwindow"] = Window_AdvancedTextPokemon.new("") @sprites["msgwindow"] = Window_AdvancedTextPokemon.new("")
@sprites["msgwindow"].visible = false @sprites["msgwindow"].visible = false
@sprites["msgwindow"].viewport = @viewport @sprites["msgwindow"].viewport = @viewport
@typebitmap = AnimatedBitmap.new(_INTL("Graphics/Pictures/types")) @typebitmap = AnimatedBitmap.new(_INTL("Graphics/UI/types"))
pbDrawMoveList pbDrawMoveList
pbDeactivateWindows(@sprites) pbDeactivateWindows(@sprites)
# Fade in all sprites # Fade in all sprites
@@ -68,8 +68,8 @@ class MoveRelearner_Scene
if moveobject if moveobject
moveData = GameData::Move.get(moveobject) moveData = GameData::Move.get(moveobject)
type_number = GameData::Type.get(moveData.display_type(@pokemon)).icon_position type_number = GameData::Type.get(moveData.display_type(@pokemon)).icon_position
imagepos.push(["Graphics/Pictures/types", 12, yPos - 4, 0, type_number * 28, 64, 28]) imagepos.push(["Graphics/UI/types", 12, yPos - 4, 0, type_number * 28, 64, 28])
textpos.push([moveData.name, 80, yPos, 0, Color.new(248, 248, 248), Color.new(0, 0, 0)]) textpos.push([moveData.name, 80, yPos, 0, Color.new(248, 248, 248), Color.black])
textpos.push([_INTL("PP"), 112, yPos + 32, 0, Color.new(64, 64, 64), Color.new(176, 176, 176)]) textpos.push([_INTL("PP"), 112, yPos + 32, 0, Color.new(64, 64, 64), Color.new(176, 176, 176)])
if moveData.total_pp > 0 if moveData.total_pp > 0
textpos.push([_INTL("{1}/{1}", moveData.total_pp), 230, yPos + 32, 1, textpos.push([_INTL("{1}/{1}", moveData.total_pp), 230, yPos + 32, 1,
@@ -80,27 +80,27 @@ class MoveRelearner_Scene
end end
yPos += 64 yPos += 64
end end
imagepos.push(["Graphics/Pictures/reminderSel", imagepos.push(["Graphics/UI/Move Reminder/cursor",
0, 78 + ((@sprites["commands"].index - @sprites["commands"].top_item) * 64), 0, 78 + ((@sprites["commands"].index - @sprites["commands"].top_item) * 64),
0, 0, 258, 72]) 0, 0, 258, 72])
selMoveData = GameData::Move.get(@moves[@sprites["commands"].index]) selMoveData = GameData::Move.get(@moves[@sprites["commands"].index])
basedamage = selMoveData.display_damage(@pokemon) basedamage = selMoveData.display_damage(@pokemon)
category = selMoveData.display_category(@pokemon) category = selMoveData.display_category(@pokemon)
accuracy = selMoveData.display_accuracy(@pokemon) accuracy = selMoveData.display_accuracy(@pokemon)
textpos.push([_INTL("CATEGORY"), 272, 120, 0, Color.new(248, 248, 248), Color.new(0, 0, 0)]) textpos.push([_INTL("CATEGORY"), 272, 120, 0, Color.new(248, 248, 248), Color.black])
textpos.push([_INTL("POWER"), 272, 152, 0, Color.new(248, 248, 248), Color.new(0, 0, 0)]) textpos.push([_INTL("POWER"), 272, 152, 0, Color.new(248, 248, 248), Color.black])
textpos.push([basedamage <= 1 ? basedamage == 1 ? "???" : "---" : sprintf("%d", basedamage), textpos.push([basedamage <= 1 ? basedamage == 1 ? "???" : "---" : sprintf("%d", basedamage),
468, 152, 2, Color.new(64, 64, 64), Color.new(176, 176, 176)]) 468, 152, 2, Color.new(64, 64, 64), Color.new(176, 176, 176)])
textpos.push([_INTL("ACCURACY"), 272, 184, 0, Color.new(248, 248, 248), Color.new(0, 0, 0)]) textpos.push([_INTL("ACCURACY"), 272, 184, 0, Color.new(248, 248, 248), Color.black])
textpos.push([accuracy == 0 ? "---" : "#{accuracy}%", textpos.push([accuracy == 0 ? "---" : "#{accuracy}%",
468, 184, 2, Color.new(64, 64, 64), Color.new(176, 176, 176)]) 468, 184, 2, Color.new(64, 64, 64), Color.new(176, 176, 176)])
pbDrawTextPositions(overlay, textpos) pbDrawTextPositions(overlay, textpos)
imagepos.push(["Graphics/Pictures/category", 436, 116, 0, category * 28, 64, 28]) imagepos.push(["Graphics/UI/category", 436, 116, 0, category * 28, 64, 28])
if @sprites["commands"].index < @moves.length - 1 if @sprites["commands"].index < @moves.length - 1
imagepos.push(["Graphics/Pictures/reminderButtons", 48, 350, 0, 0, 76, 32]) imagepos.push(["Graphics/UI/Move Reminder/buttons", 48, 350, 0, 0, 76, 32])
end end
if @sprites["commands"].index > 0 if @sprites["commands"].index > 0
imagepos.push(["Graphics/Pictures/reminderButtons", 134, 350, 76, 0, 76, 32]) imagepos.push(["Graphics/UI/Move Reminder/buttons", 134, 350, 76, 0, 76, 32])
end end
pbDrawImagePositions(overlay, imagepos) pbDrawImagePositions(overlay, imagepos)
drawTextEx(overlay, 272, 216, 230, 5, selMoveData.description, drawTextEx(overlay, 272, 216, 230, 5, selMoveData.description,
+5 -5
View File
@@ -27,7 +27,7 @@ end
#=============================================================================== #===============================================================================
def pbDrawGauge(bitmap, rect, color, value, maxValue) def pbDrawGauge(bitmap, rect, color, value, maxValue)
return if !bitmap return if !bitmap
bitmap.fill_rect(rect.x, rect.y, rect.width, rect.height, Color.new(0, 0, 0)) bitmap.fill_rect(rect.x, rect.y, rect.width, rect.height, Color.black)
width = (maxValue <= 0) ? 0 : (rect.width - 4) * value / maxValue width = (maxValue <= 0) ? 0 : (rect.width - 4) * value / maxValue
if rect.width >= 4 && rect.height >= 4 if rect.width >= 4 && rect.height >= 4
bitmap.fill_rect(rect.x + 2, rect.y + 2, rect.width - 4, rect.height - 4, Color.new(248, 248, 248)) bitmap.fill_rect(rect.x + 2, rect.y + 2, rect.width - 4, rect.height - 4, Color.new(248, 248, 248))
@@ -713,7 +713,7 @@ class DirectFlowDiagram
def ensurePoint(j) def ensurePoint(j)
if !@points[j] || @points[j].disposed? if !@points[j] || @points[j].disposed?
@points[j] = BitmapSprite.new(8, 8, @viewport) @points[j] = BitmapSprite.new(8, 8, @viewport)
@points[j].bitmap.fill_rect(0, 0, 8, 8, Color.new(0, 0, 0)) @points[j].bitmap.fill_rect(0, 0, 8, 8, Color.black)
end end
@points[j].tone = (@strength == 2) ? Tone.new(232, 232, 248) : Tone.new(16, 16, 232) @points[j].tone = (@strength == 2) ? Tone.new(232, 232, 248) : Tone.new(16, 16, 232)
@points[j].visible = (@strength != 0) @points[j].visible = (@strength != 0)
@@ -787,7 +787,7 @@ class FlowDiagram
def ensurePoint(j) def ensurePoint(j)
if !@points[j] || @points[j].disposed? if !@points[j] || @points[j].disposed?
@points[j] = BitmapSprite.new(8, 8, @viewport) @points[j] = BitmapSprite.new(8, 8, @viewport)
@points[j].bitmap.fill_rect(0, 0, 8, 8, Color.new(0, 0, 0)) @points[j].bitmap.fill_rect(0, 0, 8, 8, Color.black)
end end
@points[j].tone = (@strength == 2) ? Tone.new(232, 232, 248) : Tone.new(16, 16, 232) @points[j].tone = (@strength == 2) ? Tone.new(232, 232, 248) : Tone.new(16, 16, 232)
@points[j].visible = (@strength != 0) @points[j].visible = (@strength != 0)
@@ -854,7 +854,7 @@ class PurifyChamberSetView < Sprite
@heldpkmn = nil @heldpkmn = nil
@cursor = -1 @cursor = -1
@view = BitmapSprite.new(64, 64, viewport) @view = BitmapSprite.new(64, 64, viewport)
@view.bitmap.fill_rect(8, 8, 48, 48, Color.new(255, 255, 255)) @view.bitmap.fill_rect(8, 8, 48, 48, Color.white)
@view.bitmap.fill_rect(10, 10, 44, 44, Color.new(255, 255, 255, 128)) @view.bitmap.fill_rect(10, 10, 44, 44, Color.new(255, 255, 255, 128))
@info = BitmapSprite.new(Graphics.width - 112, 48, viewport) @info = BitmapSprite.new(Graphics.width - 112, 48, viewport)
@flows = [] @flows = []
@@ -1114,7 +1114,7 @@ class PurifyChamberScene
@viewport.z = 99999 @viewport.z = 99999
@viewportmsg = Viewport.new(0, 0, Graphics.width, Graphics.height) @viewportmsg = Viewport.new(0, 0, Graphics.width, Graphics.height)
@viewportmsg.z = 99999 @viewportmsg.z = 99999
addBackgroundOrColoredPlane(@sprites, "bg", "purifychamberbg", addBackgroundOrColoredPlane(@sprites, "bg", "purifychamber_bg",
Color.new(64, 48, 96), @viewport) Color.new(64, 48, 96), @viewport)
@sprites["setwindow"] = Window_PurifyChamberSets.new( @sprites["setwindow"] = Window_PurifyChamberSets.new(
@chamber, 0, 0, 112, Graphics.height, @viewport @chamber, 0, 0, 112, Graphics.height, @viewport
+1 -1
View File
@@ -242,7 +242,7 @@ def pbDownloadMysteryGift(trainer)
sprites = {} sprites = {}
viewport = Viewport.new(0, 0, Graphics.width, Graphics.height) viewport = Viewport.new(0, 0, Graphics.width, Graphics.height)
viewport.z = 99999 viewport.z = 99999
addBackgroundPlane(sprites, "background", "mysteryGiftbg", viewport) addBackgroundPlane(sprites, "background", "mysterygift_bg", viewport)
pbFadeInAndShow(sprites) pbFadeInAndShow(sprites)
sprites["msgwindow"] = pbCreateMessageWindow sprites["msgwindow"] = pbCreateMessageWindow
pbMessageDisplay(sprites["msgwindow"], _INTL("Searching for a gift.\nPlease wait...\\wtnp[0]")) pbMessageDisplay(sprites["msgwindow"], _INTL("Searching for a gift.\nPlease wait...\\wtnp[0]"))
+27 -27
View File
@@ -124,22 +124,22 @@ class PokemonEntryScene
meta = GameData::PlayerMetadata.get($player.character_ID) meta = GameData::PlayerMetadata.get($player.character_ID)
if meta if meta
@sprites["shadow"] = IconSprite.new(0, 0, @viewport) @sprites["shadow"] = IconSprite.new(0, 0, @viewport)
@sprites["shadow"].setBitmap("Graphics/Pictures/Naming/icon_shadow") @sprites["shadow"].setBitmap("Graphics/UI/Naming/icon_shadow")
@sprites["shadow"].x = 33 * 2 @sprites["shadow"].x = 66
@sprites["shadow"].y = 32 * 2 @sprites["shadow"].y = 64
filename = pbGetPlayerCharset(meta.walk_charset, nil, true) filename = pbGetPlayerCharset(meta.walk_charset, nil, true)
@sprites["subject"] = TrainerWalkingCharSprite.new(filename, @viewport) @sprites["subject"] = TrainerWalkingCharSprite.new(filename, @viewport)
charwidth = @sprites["subject"].bitmap.width charwidth = @sprites["subject"].bitmap.width
charheight = @sprites["subject"].bitmap.height charheight = @sprites["subject"].bitmap.height
@sprites["subject"].x = (44 * 2) - (charwidth / 8) @sprites["subject"].x = 88 - (charwidth / 8)
@sprites["subject"].y = (38 * 2) - (charheight / 4) @sprites["subject"].y = 76 - (charheight / 4)
end end
when 2 # Pokémon when 2 # Pokémon
if pokemon if pokemon
@sprites["shadow"] = IconSprite.new(0, 0, @viewport) @sprites["shadow"] = IconSprite.new(0, 0, @viewport)
@sprites["shadow"].setBitmap("Graphics/Pictures/Naming/icon_shadow") @sprites["shadow"].setBitmap("Graphics/UI/Naming/icon_shadow")
@sprites["shadow"].x = 33 * 2 @sprites["shadow"].x = 66
@sprites["shadow"].y = 32 * 2 @sprites["shadow"].y = 64
@sprites["subject"] = PokemonIconSprite.new(pokemon, @viewport) @sprites["subject"] = PokemonIconSprite.new(pokemon, @viewport)
@sprites["subject"].setOffset(PictureOrigin::CENTER) @sprites["subject"].setOffset(PictureOrigin::CENTER)
@sprites["subject"].x = 88 @sprites["subject"].x = 88
@@ -159,22 +159,22 @@ class PokemonEntryScene
end end
when 3 # NPC when 3 # NPC
@sprites["shadow"] = IconSprite.new(0, 0, @viewport) @sprites["shadow"] = IconSprite.new(0, 0, @viewport)
@sprites["shadow"].setBitmap("Graphics/Pictures/Naming/icon_shadow") @sprites["shadow"].setBitmap("Graphics/UI/Naming/icon_shadow")
@sprites["shadow"].x = 33 * 2 @sprites["shadow"].x = 66
@sprites["shadow"].y = 32 * 2 @sprites["shadow"].y = 64
@sprites["subject"] = TrainerWalkingCharSprite.new(pokemon.to_s, @viewport) @sprites["subject"] = TrainerWalkingCharSprite.new(pokemon.to_s, @viewport)
charwidth = @sprites["subject"].bitmap.width charwidth = @sprites["subject"].bitmap.width
charheight = @sprites["subject"].bitmap.height charheight = @sprites["subject"].bitmap.height
@sprites["subject"].x = (44 * 2) - (charwidth / 8) @sprites["subject"].x = 88 - (charwidth / 8)
@sprites["subject"].y = (38 * 2) - (charheight / 4) @sprites["subject"].y = 76 - (charheight / 4)
when 4 # Storage box when 4 # Storage box
@sprites["subject"] = TrainerWalkingCharSprite.new(nil, @viewport) @sprites["subject"] = TrainerWalkingCharSprite.new(nil, @viewport)
@sprites["subject"].altcharset = "Graphics/Pictures/Naming/icon_storage" @sprites["subject"].altcharset = "Graphics/UI/Naming/icon_storage"
@sprites["subject"].animspeed = 4 @sprites["subject"].animspeed = 4
charwidth = @sprites["subject"].bitmap.width charwidth = @sprites["subject"].bitmap.width
charheight = @sprites["subject"].bitmap.height charheight = @sprites["subject"].bitmap.height
@sprites["subject"].x = (44 * 2) - (charwidth / 8) @sprites["subject"].x = 88 - (charwidth / 8)
@sprites["subject"].y = (26 * 2) - (charheight / 2) @sprites["subject"].y = 52 - (charheight / 2)
end end
pbFadeInAndShow(@sprites) pbFadeInAndShow(@sprites)
end end
@@ -281,9 +281,9 @@ class PokemonEntryScene2
def initialize(viewport) def initialize(viewport)
@sprite = Sprite.new(viewport) @sprite = Sprite.new(viewport)
@cursortype = 0 @cursortype = 0
@cursor1 = AnimatedBitmap.new("Graphics/Pictures/Naming/cursor_1") @cursor1 = AnimatedBitmap.new("Graphics/UI/Naming/cursor_1")
@cursor2 = AnimatedBitmap.new("Graphics/Pictures/Naming/cursor_2") @cursor2 = AnimatedBitmap.new("Graphics/UI/Naming/cursor_2")
@cursor3 = AnimatedBitmap.new("Graphics/Pictures/Naming/cursor_3") @cursor3 = AnimatedBitmap.new("Graphics/UI/Naming/cursor_3")
@cursorPos = 0 @cursorPos = 0
updateInternal updateInternal
end end
@@ -382,7 +382,7 @@ class PokemonEntryScene2
# Create bitmaps # Create bitmaps
@bitmaps = [] @bitmaps = []
@@Characters.length.times do |i| @@Characters.length.times do |i|
@bitmaps[i] = AnimatedBitmap.new(sprintf("Graphics/Pictures/Naming/overlay_tab_#{i + 1}")) @bitmaps[i] = AnimatedBitmap.new(sprintf("Graphics/UI/Naming/overlay_tab_#{i + 1}"))
b = @bitmaps[i].bitmap.clone b = @bitmaps[i].bitmap.clone
pbSetSystemFont(b) pbSetSystemFont(b)
textPos = [] textPos = []
@@ -403,13 +403,13 @@ class PokemonEntryScene2
# Create sprites # Create sprites
@sprites = {} @sprites = {}
@sprites["bg"] = IconSprite.new(0, 0, @viewport) @sprites["bg"] = IconSprite.new(0, 0, @viewport)
@sprites["bg"].setBitmap("Graphics/Pictures/Naming/bg") @sprites["bg"].setBitmap("Graphics/UI/Naming/bg")
case subject case subject
when 1 # Player when 1 # Player
meta = GameData::PlayerMetadata.get($player.character_ID) meta = GameData::PlayerMetadata.get($player.character_ID)
if meta if meta
@sprites["shadow"] = IconSprite.new(0, 0, @viewport) @sprites["shadow"] = IconSprite.new(0, 0, @viewport)
@sprites["shadow"].setBitmap("Graphics/Pictures/Naming/icon_shadow") @sprites["shadow"].setBitmap("Graphics/UI/Naming/icon_shadow")
@sprites["shadow"].x = 66 @sprites["shadow"].x = 66
@sprites["shadow"].y = 64 @sprites["shadow"].y = 64
filename = pbGetPlayerCharset(meta.walk_charset, nil, true) filename = pbGetPlayerCharset(meta.walk_charset, nil, true)
@@ -422,7 +422,7 @@ class PokemonEntryScene2
when 2 # Pokémon when 2 # Pokémon
if pokemon if pokemon
@sprites["shadow"] = IconSprite.new(0, 0, @viewport) @sprites["shadow"] = IconSprite.new(0, 0, @viewport)
@sprites["shadow"].setBitmap("Graphics/Pictures/Naming/icon_shadow") @sprites["shadow"].setBitmap("Graphics/UI/Naming/icon_shadow")
@sprites["shadow"].x = 66 @sprites["shadow"].x = 66
@sprites["shadow"].y = 64 @sprites["shadow"].y = 64
@sprites["subject"] = PokemonIconSprite.new(pokemon, @viewport) @sprites["subject"] = PokemonIconSprite.new(pokemon, @viewport)
@@ -444,7 +444,7 @@ class PokemonEntryScene2
end end
when 3 # NPC when 3 # NPC
@sprites["shadow"] = IconSprite.new(0, 0, @viewport) @sprites["shadow"] = IconSprite.new(0, 0, @viewport)
@sprites["shadow"].setBitmap("Graphics/Pictures/Naming/icon_shadow") @sprites["shadow"].setBitmap("Graphics/UI/Naming/icon_shadow")
@sprites["shadow"].x = 66 @sprites["shadow"].x = 66
@sprites["shadow"].y = 64 @sprites["shadow"].y = 64
@sprites["subject"] = TrainerWalkingCharSprite.new(pokemon.to_s, @viewport) @sprites["subject"] = TrainerWalkingCharSprite.new(pokemon.to_s, @viewport)
@@ -454,7 +454,7 @@ class PokemonEntryScene2
@sprites["subject"].y = 76 - (charheight / 4) @sprites["subject"].y = 76 - (charheight / 4)
when 4 # Storage box when 4 # Storage box
@sprites["subject"] = TrainerWalkingCharSprite.new(nil, @viewport) @sprites["subject"] = TrainerWalkingCharSprite.new(nil, @viewport)
@sprites["subject"].altcharset = "Graphics/Pictures/Naming/icon_storage" @sprites["subject"].altcharset = "Graphics/UI/Naming/icon_storage"
@sprites["subject"].animspeed = 4 @sprites["subject"].animspeed = 4
charwidth = @sprites["subject"].bitmap.width charwidth = @sprites["subject"].bitmap.width
charheight = @sprites["subject"].bitmap.height charheight = @sprites["subject"].bitmap.height
@@ -484,7 +484,7 @@ class PokemonEntryScene2
@sprites["controls"] = IconSprite.new(0, 0, @viewport) @sprites["controls"] = IconSprite.new(0, 0, @viewport)
@sprites["controls"].x = 16 @sprites["controls"].x = 16
@sprites["controls"].y = 96 @sprites["controls"].y = 96
@sprites["controls"].setBitmap(_INTL("Graphics/Pictures/Naming/overlay_controls")) @sprites["controls"].setBitmap(_INTL("Graphics/UI/Naming/overlay_controls"))
@init = true @init = true
@sprites["overlay"] = BitmapSprite.new(Graphics.width, Graphics.height, @viewport) @sprites["overlay"] = BitmapSprite.new(Graphics.width, Graphics.height, @viewport)
pbDoUpdateOverlay2 pbDoUpdateOverlay2
@@ -502,7 +502,7 @@ class PokemonEntryScene2
def pbDoUpdateOverlay2 def pbDoUpdateOverlay2
overlay = @sprites["overlay"].bitmap overlay = @sprites["overlay"].bitmap
overlay.clear overlay.clear
modeIcon = [[_INTL("Graphics/Pictures/Naming/icon_mode"), 44 + (@mode * 62), 120, @mode * 60, 0, 60, 44]] modeIcon = [[_INTL("Graphics/UI/Naming/icon_mode"), 44 + (@mode * 62), 120, @mode * 60, 0, 60, 44]]
pbDrawImagePositions(overlay, modeIcon) pbDrawImagePositions(overlay, modeIcon)
end end
@@ -84,12 +84,12 @@ class TriadCard
def self.createBack(type = nil, noback = false) def self.createBack(type = nil, noback = false)
bitmap = BitmapWrapper.new(80, 96) bitmap = BitmapWrapper.new(80, 96)
if !noback if !noback
cardbitmap = AnimatedBitmap.new("Graphics/Pictures/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))
cardbitmap.dispose cardbitmap.dispose
end end
if type if type
typebitmap = AnimatedBitmap.new(_INTL("Graphics/Pictures/types")) typebitmap = AnimatedBitmap.new(_INTL("Graphics/UI/types"))
type_number = GameData::Type.get(type).icon_position type_number = GameData::Type.get(type).icon_position
typerect = Rect.new(0, type_number * 28, 64, 28) typerect = Rect.new(0, type_number * 28, 64, 28)
bitmap.blt(8, 50, typebitmap.bitmap, typerect, 192) bitmap.blt(8, 50, typebitmap.bitmap, typerect, 192)
@@ -102,13 +102,13 @@ class TriadCard
return TriadCard.createBack if owner == 0 return TriadCard.createBack if owner == 0
bitmap = BitmapWrapper.new(80, 96) bitmap = BitmapWrapper.new(80, 96)
if owner == 2 # Opponent if owner == 2 # Opponent
cardbitmap = AnimatedBitmap.new("Graphics/Pictures/triad_card_opponent") cardbitmap = AnimatedBitmap.new("Graphics/UI/Triple Triad/card_opponent")
else # Player else # Player
cardbitmap = AnimatedBitmap.new("Graphics/Pictures/triad_card_player") cardbitmap = AnimatedBitmap.new("Graphics/UI/Triple Triad/card_player")
end end
typebitmap = AnimatedBitmap.new(_INTL("Graphics/Pictures/types")) typebitmap = AnimatedBitmap.new(_INTL("Graphics/UI/types"))
iconbitmap = AnimatedBitmap.new(GameData::Species.icon_filename(@species, @form)) iconbitmap = AnimatedBitmap.new(GameData::Species.icon_filename(@species, @form))
numbersbitmap = AnimatedBitmap.new("Graphics/Pictures/triad_numbers") numbersbitmap = AnimatedBitmap.new("Graphics/UI/Triple Triad/numbers")
# Draw card background # Draw card background
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))
# Draw type icon # Draw type icon
@@ -168,7 +168,7 @@ class TriadScene
# Allocate viewport # Allocate viewport
@viewport = Viewport.new(0, 0, Graphics.width, Graphics.height) @viewport = Viewport.new(0, 0, Graphics.width, Graphics.height)
@viewport.z = 99999 @viewport.z = 99999
addBackgroundPlane(@sprites, "background", "triad_bg", @viewport) addBackgroundPlane(@sprites, "background", "Triple Triad/bg", @viewport)
@sprites["helpwindow"] = Window_AdvancedTextPokemon.newWithSize( @sprites["helpwindow"] = Window_AdvancedTextPokemon.newWithSize(
"", 0, Graphics.height - 64, Graphics.width, 64, @viewport "", 0, Graphics.height - 64, Graphics.width, 64, @viewport
) )
@@ -32,8 +32,8 @@ class SlotMachineReel < BitmapSprite
@stopping = false @stopping = false
@slipping = 0 @slipping = 0
@index = rand(@reel.length) @index = rand(@reel.length)
@images = AnimatedBitmap.new(_INTL("Graphics/Pictures/Slot Machine/images")) @images = AnimatedBitmap.new(_INTL("Graphics/UI/Slot Machine/images"))
@shading = AnimatedBitmap.new("Graphics/Pictures/Slot Machine/ReelOverlay") @shading = AnimatedBitmap.new("Graphics/UI/Slot Machine/ReelOverlay")
update update
end end
@@ -88,7 +88,7 @@ class SlotMachineScore < BitmapSprite
@viewport = Viewport.new(x, y, 70, 22) @viewport = Viewport.new(x, y, 70, 22)
@viewport.z = 99999 @viewport.z = 99999
super(70, 22, @viewport) super(70, 22, @viewport)
@numbers = AnimatedBitmap.new("Graphics/Pictures/Slot Machine/numbers") @numbers = AnimatedBitmap.new("Graphics/UI/Slot Machine/numbers")
self.score = score self.score = score
end end
@@ -181,10 +181,10 @@ class SlotMachineScene
Input.update Input.update
update update
@sprites["window2"].bitmap&.clear @sprites["window2"].bitmap&.clear
@sprites["window1"].setBitmap(sprintf("Graphics/Pictures/Slot Machine/win")) @sprites["window1"].setBitmap(sprintf("Graphics/UI/Slot Machine/win"))
@sprites["window1"].src_rect.set(152 * ((frame / timePerFrame) % 4), 0, 152, 208) @sprites["window1"].src_rect.set(152 * ((frame / timePerFrame) % 4), 0, 152, 208)
if bonus > 0 if bonus > 0
@sprites["window2"].setBitmap(sprintf("Graphics/Pictures/Slot Machine/bonus")) @sprites["window2"].setBitmap(sprintf("Graphics/UI/Slot Machine/bonus"))
@sprites["window2"].src_rect.set(152 * (bonus - 1), 0, 152, 208) @sprites["window2"].src_rect.set(152 * (bonus - 1), 0, 152, 208)
end end
@sprites["light1"].visible = true @sprites["light1"].visible = true
@@ -229,7 +229,7 @@ class SlotMachineScene
Input.update Input.update
update update
@sprites["window2"].bitmap&.clear @sprites["window2"].bitmap&.clear
@sprites["window1"].setBitmap(sprintf("Graphics/Pictures/Slot Machine/lose")) @sprites["window1"].setBitmap(sprintf("Graphics/UI/Slot Machine/lose"))
@sprites["window1"].src_rect.set(152 * ((frame / timePerFrame) % 2), 0, 152, 208) @sprites["window1"].src_rect.set(152 * ((frame / timePerFrame) % 2), 0, 152, 208)
frame += 1 frame += 1
end end
@@ -247,25 +247,25 @@ class SlotMachineScene
@sprites["reel3"] = SlotMachineReel.new(224, 112, difficulty) @sprites["reel3"] = SlotMachineReel.new(224, 112, difficulty)
(1..3).each do |i| (1..3).each do |i|
@sprites["button#{i}"] = IconSprite.new(68 + (80 * (i - 1)), 260, @viewport) @sprites["button#{i}"] = IconSprite.new(68 + (80 * (i - 1)), 260, @viewport)
@sprites["button#{i}"].setBitmap(sprintf("Graphics/Pictures/Slot Machine/button")) @sprites["button#{i}"].setBitmap(sprintf("Graphics/UI/Slot Machine/button"))
@sprites["button#{i}"].visible = false @sprites["button#{i}"].visible = false
end end
(1..5).each do |i| (1..5).each do |i|
y = [170, 122, 218, 82, 82][i - 1] y = [170, 122, 218, 82, 82][i - 1]
@sprites["row#{i}"] = IconSprite.new(2, y, @viewport) @sprites["row#{i}"] = IconSprite.new(2, y, @viewport)
@sprites["row#{i}"].setBitmap(sprintf("Graphics/Pictures/Slot Machine/line%1d%s", @sprites["row#{i}"].setBitmap(sprintf("Graphics/UI/Slot Machine/line%1d%s",
1 + (i / 2), (i >= 4) ? ((i == 4) ? "a" : "b") : "")) 1 + (i / 2), (i >= 4) ? ((i == 4) ? "a" : "b") : ""))
@sprites["row#{i}"].visible = false @sprites["row#{i}"].visible = false
end end
@sprites["light1"] = IconSprite.new(16, 32, @viewport) @sprites["light1"] = IconSprite.new(16, 32, @viewport)
@sprites["light1"].setBitmap(sprintf("Graphics/Pictures/Slot Machine/lights")) @sprites["light1"].setBitmap(sprintf("Graphics/UI/Slot Machine/lights"))
@sprites["light1"].visible = false @sprites["light1"].visible = false
@sprites["light2"] = IconSprite.new(240, 32, @viewport) @sprites["light2"] = IconSprite.new(240, 32, @viewport)
@sprites["light2"].setBitmap(sprintf("Graphics/Pictures/Slot Machine/lights")) @sprites["light2"].setBitmap(sprintf("Graphics/UI/Slot Machine/lights"))
@sprites["light2"].mirror = true @sprites["light2"].mirror = true
@sprites["light2"].visible = false @sprites["light2"].visible = false
@sprites["window1"] = IconSprite.new(358, 96, @viewport) @sprites["window1"] = IconSprite.new(358, 96, @viewport)
@sprites["window1"].setBitmap(sprintf("Graphics/Pictures/Slot Machine/insert")) @sprites["window1"].setBitmap(sprintf("Graphics/UI/Slot Machine/insert"))
@sprites["window1"].src_rect.set(0, 0, 152, 208) @sprites["window1"].src_rect.set(0, 0, 152, 208)
@sprites["window2"] = IconSprite.new(358, 96, @viewport) @sprites["window2"] = IconSprite.new(358, 96, @viewport)
@sprites["credit"] = SlotMachineScore.new(360, 66, $player.coins) @sprites["credit"] = SlotMachineScore.new(360, 66, $player.coins)
@@ -292,7 +292,7 @@ class SlotMachineScene
pbMessage(_INTL("You've run out of Coins.\nGame over!")) pbMessage(_INTL("You've run out of Coins.\nGame over!"))
break break
elsif @gameRunning # Reels are spinning elsif @gameRunning # Reels are spinning
@sprites["window1"].setBitmap(sprintf("Graphics/Pictures/Slot Machine/stop")) @sprites["window1"].setBitmap(sprintf("Graphics/UI/Slot Machine/stop"))
@sprites["window1"].src_rect.set(152 * ((frame / spinFrameTime) % 4), 0, 152, 208) @sprites["window1"].src_rect.set(152 * ((frame / spinFrameTime) % 4), 0, 152, 208)
if Input.trigger?(Input::USE) if Input.trigger?(Input::USE)
pbSEPlay("Slots stop") pbSEPlay("Slots stop")
@@ -322,10 +322,10 @@ class SlotMachineScene
end end
@gameEnd = false @gameEnd = false
else # Awaiting coins for the next spin else # Awaiting coins for the next spin
@sprites["window1"].setBitmap(sprintf("Graphics/Pictures/Slot Machine/insert")) @sprites["window1"].setBitmap(sprintf("Graphics/UI/Slot Machine/insert"))
@sprites["window1"].src_rect.set(152 * ((frame / insertFrameTime) % 2), 0, 152, 208) @sprites["window1"].src_rect.set(152 * ((frame / insertFrameTime) % 2), 0, 152, 208)
if @wager > 0 if @wager > 0
@sprites["window2"].setBitmap(sprintf("Graphics/Pictures/Slot Machine/press")) @sprites["window2"].setBitmap(sprintf("Graphics/UI/Slot Machine/press"))
@sprites["window2"].src_rect.set(152 * ((frame / insertFrameTime) % 2), 0, 152, 208) @sprites["window2"].src_rect.set(152 * ((frame / insertFrameTime) % 2), 0, 152, 208)
end end
if Input.trigger?(Input::DOWN) && @wager < 3 && @sprites["credit"].score > 0 if Input.trigger?(Input::DOWN) && @wager < 3 && @sprites["credit"].score > 0
@@ -37,7 +37,7 @@ class VoltorbFlip
@index = [0, 0] @index = [0, 0]
# [x,y,points,selected] # [x,y,points,selected]
@squares = [0, 0, 0, false] @squares = [0, 0, 0, false]
@directory = "Graphics/Pictures/Voltorb Flip/" @directory = "Graphics/UI/Voltorb Flip/"
squareValues = [] squareValues = []
total = 1 total = 1
voltorbs = 0 voltorbs = 0
@@ -152,24 +152,24 @@ class VoltorbFlip
@viewport = Viewport.new(0, 0, Graphics.width, Graphics.height) @viewport = Viewport.new(0, 0, Graphics.width, Graphics.height)
@viewport.z = 99999 @viewport.z = 99999
@sprites["bg"] = Sprite.new(@viewport) @sprites["bg"] = Sprite.new(@viewport)
@sprites["bg"].bitmap = RPG::Cache.load_bitmap(@directory, "boardbg") @sprites["bg"].bitmap = RPG::Cache.load_bitmap(@directory, "bg")
@sprites["text"] = BitmapSprite.new(Graphics.width, Graphics.height, @viewport) @sprites["text"] = BitmapSprite.new(Graphics.width, Graphics.height, @viewport)
pbSetSystemFont(@sprites["text"].bitmap) pbSetSystemFont(@sprites["text"].bitmap)
@sprites["level"] = BitmapSprite.new(Graphics.width, Graphics.height, @viewport) @sprites["level"] = BitmapSprite.new(Graphics.width, Graphics.height, @viewport)
pbSetSystemFont(@sprites["level"].bitmap) pbSetSystemFont(@sprites["level"].bitmap)
@sprites["curtain"] = BitmapSprite.new(Graphics.width, Graphics.height, @viewport) @sprites["curtain"] = BitmapSprite.new(Graphics.width, Graphics.height, @viewport)
@sprites["curtain"].z = 99999 @sprites["curtain"].z = 99999
@sprites["curtain"].bitmap.fill_rect(0, 0, Graphics.width, Graphics.height, Color.new(0, 0, 0)) @sprites["curtain"].bitmap.fill_rect(0, 0, Graphics.width, Graphics.height, Color.black)
@sprites["curtain"].opacity = 0 @sprites["curtain"].opacity = 0
@sprites["curtainL"] = BitmapSprite.new(Graphics.width, Graphics.height, @viewport) @sprites["curtainL"] = BitmapSprite.new(Graphics.width, Graphics.height, @viewport)
@sprites["curtainL"].z = 99999 @sprites["curtainL"].z = 99999
@sprites["curtainL"].x = Graphics.width / 2 @sprites["curtainL"].x = Graphics.width / 2
@sprites["curtainL"].angle = -90 @sprites["curtainL"].angle = -90
@sprites["curtainL"].bitmap.fill_rect(0, 0, Graphics.width, Graphics.height, Color.new(0, 0, 0)) @sprites["curtainL"].bitmap.fill_rect(0, 0, Graphics.width, Graphics.height, Color.black)
@sprites["curtainR"] = BitmapSprite.new(Graphics.width, Graphics.height * 2, @viewport) @sprites["curtainR"] = BitmapSprite.new(Graphics.width, Graphics.height * 2, @viewport)
@sprites["curtainR"].z = 99999 @sprites["curtainR"].z = 99999
@sprites["curtainR"].x = Graphics.width / 2 @sprites["curtainR"].x = Graphics.width / 2
@sprites["curtainR"].bitmap.fill_rect(0, 0, Graphics.width, Graphics.height * 2, Color.new(0, 0, 0)) @sprites["curtainR"].bitmap.fill_rect(0, 0, Graphics.width, Graphics.height * 2, Color.black)
@sprites["cursor"] = BitmapSprite.new(Graphics.width, Graphics.height, @viewport) @sprites["cursor"] = BitmapSprite.new(Graphics.width, Graphics.height, @viewport)
@sprites["cursor"].z = 99998 @sprites["cursor"].z = 99998
@sprites["icon"] = BitmapSprite.new(Graphics.width, Graphics.height, @viewport) @sprites["icon"] = BitmapSprite.new(Graphics.width, Graphics.height, @viewport)
@@ -12,7 +12,7 @@ class MiningGameCounter < BitmapSprite
@viewport.z = 99999 @viewport.z = 99999
super(416, 60, @viewport) super(416, 60, @viewport)
@hits = 0 @hits = 0
@image = AnimatedBitmap.new("Graphics/Pictures/Mining/cracks") @image = AnimatedBitmap.new("Graphics/UI/Mining/cracks")
update update
end end
@@ -53,7 +53,7 @@ class MiningGameTile < BitmapSprite
else else
@layer = 6 # 15% @layer = 6 # 15%
end end
@image = AnimatedBitmap.new("Graphics/Pictures/Mining/tiles") @image = AnimatedBitmap.new("Graphics/UI/Mining/tiles")
update update
end end
@@ -89,9 +89,9 @@ class MiningGameCursor < BitmapSprite
@mode = mode @mode = mode
@hit = 0 # 0=regular, 1=hit item, 2=hit iron @hit = 0 # 0=regular, 1=hit item, 2=hit iron
@counter = 0 @counter = 0
@cursorbitmap = AnimatedBitmap.new("Graphics/Pictures/Mining/cursor") @cursorbitmap = AnimatedBitmap.new("Graphics/UI/Mining/cursor")
@toolbitmap = AnimatedBitmap.new("Graphics/Pictures/Mining/tools") @toolbitmap = AnimatedBitmap.new("Graphics/UI/Mining/tools")
@hitsbitmap = AnimatedBitmap.new("Graphics/Pictures/Mining/hits") @hitsbitmap = AnimatedBitmap.new("Graphics/UI/Mining/hits")
update update
end end
@@ -230,10 +230,10 @@ class MiningGameScene
@sprites = {} @sprites = {}
@viewport = Viewport.new(0, 0, Graphics.width, Graphics.height) @viewport = Viewport.new(0, 0, Graphics.width, Graphics.height)
@viewport.z = 99999 @viewport.z = 99999
addBackgroundPlane(@sprites, "bg", "Mining/miningbg", @viewport) addBackgroundPlane(@sprites, "bg", "Mining/bg", @viewport)
@sprites["itemlayer"] = BitmapSprite.new(Graphics.width, Graphics.height, @viewport) @sprites["itemlayer"] = BitmapSprite.new(Graphics.width, Graphics.height, @viewport)
@itembitmap = AnimatedBitmap.new("Graphics/Pictures/Mining/items") @itembitmap = AnimatedBitmap.new("Graphics/UI/Mining/items")
@ironbitmap = AnimatedBitmap.new("Graphics/Pictures/Mining/irons") @ironbitmap = AnimatedBitmap.new("Graphics/UI/Mining/irons")
@items = [] @items = []
@itemswon = [] @itemswon = []
@iron = [] @iron = []
@@ -247,7 +247,7 @@ class MiningGameScene
@sprites["crack"] = MiningGameCounter.new(0, 4) @sprites["crack"] = MiningGameCounter.new(0, 4)
@sprites["cursor"] = MiningGameCursor.new(58, 0) # central position, pick @sprites["cursor"] = MiningGameCursor.new(58, 0) # central position, pick
@sprites["tool"] = IconSprite.new(434, 254, @viewport) @sprites["tool"] = IconSprite.new(434, 254, @viewport)
@sprites["tool"].setBitmap(sprintf("Graphics/Pictures/Mining/toolicons")) @sprites["tool"].setBitmap(sprintf("Graphics/UI/Mining/toolicons"))
@sprites["tool"].src_rect.set(0, 0, 68, 100) @sprites["tool"].src_rect.set(0, 0, 68, 100)
update update
pbFadeInAndShow(@sprites) pbFadeInAndShow(@sprites)
@@ -531,7 +531,7 @@ class MiningGameScene
collapseFraction = (Graphics.height.to_f / collapseTime).ceil collapseFraction = (Graphics.height.to_f / collapseTime).ceil
(1..collapseTime).each do |i| (1..collapseTime).each do |i|
@sprites["collapse"].bitmap.fill_rect(0, collapseFraction * (i - 1), @sprites["collapse"].bitmap.fill_rect(0, collapseFraction * (i - 1),
Graphics.width, collapseFraction * i, Color.new(0, 0, 0)) Graphics.width, collapseFraction * i, Color.black)
Graphics.update Graphics.update
end end
pbMessage(_INTL("The wall collapsed!")) pbMessage(_INTL("The wall collapsed!"))
@@ -35,7 +35,7 @@ class TilePuzzleCursor < BitmapSprite
@arrows = [] @arrows = []
@selected = false @selected = false
@holding = false @holding = false
@cursorbitmap = AnimatedBitmap.new("Graphics/Pictures/Tile Puzzle/cursor") @cursorbitmap = AnimatedBitmap.new("Graphics/UI/Tile Puzzle/cursor")
update update
end end
@@ -148,23 +148,23 @@ class TilePuzzleScene
@sprites = {} @sprites = {}
@viewport = Viewport.new(0, 0, Graphics.width, Graphics.height) @viewport = Viewport.new(0, 0, Graphics.width, Graphics.height)
@viewport.z = 99999 @viewport.z = 99999
if pbResolveBitmap("Graphics/Pictures/Tile Puzzle/bg#{@board}") if pbResolveBitmap("Graphics/UI/Tile Puzzle/bg#{@board}")
addBackgroundPlane(@sprites, "bg", "Tile Puzzle/bg#{@board}", @viewport) addBackgroundPlane(@sprites, "bg", "Tile Puzzle/bg#{@board}", @viewport)
else else
addBackgroundPlane(@sprites, "bg", "Tile Puzzle/bg", @viewport) addBackgroundPlane(@sprites, "bg", "Tile Puzzle/bg", @viewport)
end end
@tilebitmap = AnimatedBitmap.new("Graphics/Pictures/Tile Puzzle/tiles#{@board}") @tilebitmap = AnimatedBitmap.new("Graphics/UI/Tile Puzzle/tiles#{@board}")
@tilebitmap1 = nil @tilebitmap1 = nil
@tilebitmap2 = nil @tilebitmap2 = nil
@tilebitmap3 = nil @tilebitmap3 = nil
if pbResolveBitmap("Graphics/Pictures/Tile Puzzle/tiles#{@board}_1") if pbResolveBitmap("Graphics/UI/Tile Puzzle/tiles#{@board}_1")
@tilebitmap1 = AnimatedBitmap.new("Graphics/Pictures/Tile Puzzle/tiles#{@board}_1") @tilebitmap1 = AnimatedBitmap.new("Graphics/UI/Tile Puzzle/tiles#{@board}_1")
end end
if pbResolveBitmap("Graphics/Pictures/Tile Puzzle/tiles#{@board}_2") if pbResolveBitmap("Graphics/UI/Tile Puzzle/tiles#{@board}_2")
@tilebitmap2 = AnimatedBitmap.new("Graphics/Pictures/Tile Puzzle/tiles#{@board}_2") @tilebitmap2 = AnimatedBitmap.new("Graphics/UI/Tile Puzzle/tiles#{@board}_2")
end end
if pbResolveBitmap("Graphics/Pictures/Tile Puzzle/tiles#{@board}_3") if pbResolveBitmap("Graphics/UI/Tile Puzzle/tiles#{@board}_3")
@tilebitmap3 = AnimatedBitmap.new("Graphics/Pictures/Tile Puzzle/tiles#{@board}_3") @tilebitmap3 = AnimatedBitmap.new("Graphics/UI/Tile Puzzle/tiles#{@board}_3")
end end
@tilewidth = @tilebitmap.width / @boardwidth @tilewidth = @tilebitmap.width / @boardwidth
@tileheight = @tilebitmap.height / @boardheight @tileheight = @tilebitmap.height / @boardheight
@@ -111,10 +111,10 @@ class PokemonTilesetScene
# Draw tile (at 200% size) # Draw tile (at 200% size)
@tilehelper.bltSmallTile(overlay, tile_x, tile_y, TILE_SIZE * 2, TILE_SIZE * 2, tile_id) @tilehelper.bltSmallTile(overlay, tile_x, tile_y, TILE_SIZE * 2, TILE_SIZE * 2, 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.new(255, 255, 255)) 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, 1, (TILE_SIZE * 2) + 2, Color.new(255, 255, 255)) overlay.fill_rect(tile_x - 1, tile_y - 1, 1, (TILE_SIZE * 2) + 2, Color.white)
overlay.fill_rect(tile_x - 1, tile_y + (TILE_SIZE * 2), (TILE_SIZE * 2) + 2, 1, Color.new(255, 255, 255)) overlay.fill_rect(tile_x - 1, tile_y + (TILE_SIZE * 2), (TILE_SIZE * 2) + 2, 1, Color.white)
overlay.fill_rect(tile_x + (TILE_SIZE * 2), tile_y - 1, 1, (TILE_SIZE * 2) + 2, Color.new(255, 255, 255)) overlay.fill_rect(tile_x + (TILE_SIZE * 2), tile_y - 1, 1, (TILE_SIZE * 2) + 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)
@@ -107,7 +107,7 @@ class RegionMapSprite
def createRegionMap(map) def createRegionMap(map)
@mapdata = pbLoadTownMapData @mapdata = pbLoadTownMapData
@map = @mapdata[map] @map = @mapdata[map]
bitmap = AnimatedBitmap.new("Graphics/Pictures/#{@map[1]}").deanimate bitmap = AnimatedBitmap.new("Graphics/UI/Town Map/#{@map[1]}").deanimate
retbitmap = BitmapWrapper.new(bitmap.width / 2, bitmap.height / 2) retbitmap = BitmapWrapper.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),
@@ -67,7 +67,7 @@ class SpritePositioner
@sprites["base_1"].y -= @sprites["base_1"].bitmap.height / 2 if @sprites["base_1"].bitmap @sprites["base_1"].y -= @sprites["base_1"].bitmap.height / 2 if @sprites["base_1"].bitmap
@sprites["base_1"].z = 1 @sprites["base_1"].z = 1
@sprites["messageBox"] = IconSprite.new(0, Graphics.height - 96, @viewport) @sprites["messageBox"] = IconSprite.new(0, Graphics.height - 96, @viewport)
@sprites["messageBox"].setBitmap("Graphics/Pictures/Battle/debug_message") @sprites["messageBox"].setBitmap("Graphics/UI/Debug/battle_message")
@sprites["messageBox"].z = 2 @sprites["messageBox"].z = 2
@sprites["shadow_1"] = IconSprite.new(0, 0, @viewport) @sprites["shadow_1"] = IconSprite.new(0, 0, @viewport)
@sprites["shadow_1"].z = 3 @sprites["shadow_1"].z = 3
@@ -339,7 +339,7 @@ class SpritePositioner
pbFadeInAndShow(@sprites) { update } pbFadeInAndShow(@sprites) { update }
@starting = false @starting = false
end end
cw = Window_CommandPokemonEx.newEmpty(0, 0, 260, 32 + (24 * 6), @viewport) cw = Window_CommandPokemonEx.newEmpty(0, 0, 260, 176, @viewport)
cw.rowHeight = 24 cw.rowHeight = 24
pbSetSmallFont(cw.contents) pbSetSmallFont(cw.contents)
cw.x = Graphics.width - cw.width cw.x = Graphics.width - cw.width
@@ -173,7 +173,7 @@ class AnimationWindow < Sprite
def initialize(x, y, width, height, viewport = nil) def initialize(x, y, width, height, viewport = nil)
super(viewport) super(viewport)
@animbitmap = nil @animbitmap = nil
@arrows = AnimatedBitmap.new("Graphics/Pictures/arrows") @arrows = AnimatedBitmap.new("Graphics/UI/Debug/anim_editor_arrows")
self.x = x self.x = x
self.y = y self.y = y
@start = 0 @start = 0
@@ -368,12 +368,12 @@ class SpriteFrame < InvalidatableSprite
@previous = previous @previous = previous
@locked = false @locked = false
@selected = false @selected = false
@selcolor = Color.new(0, 0, 0) @selcolor = Color.black
@unselcolor = Color.new(220, 220, 220) @unselcolor = Color.new(220, 220, 220)
@prevcolor = Color.new(64, 128, 192) @prevcolor = Color.new(64, 128, 192)
@contents = Bitmap.new(64, 64) @contents = Bitmap.new(64, 64)
self.z = (@previous) ? 49 : 50 self.z = (@previous) ? 49 : 50
@iconbitmap = AnimatedBitmap.new("Graphics/Pictures/animFrameIcon") @iconbitmap = AnimatedBitmap.new("Graphics/UI/Debug/anim_editor_frame_icons")
self.bitmap = @contents self.bitmap = @contents
self.invalidate self.invalidate
end end
@@ -453,9 +453,9 @@ class AnimationCanvas < Sprite
@playingframe = 0 @playingframe = 0
@player = nil @player = nil
@battle = MiniBattle.new @battle = MiniBattle.new
@user = AnimatedBitmap.new("Graphics/Pictures/testback").deanimate @user = AnimatedBitmap.new("Graphics/UI/Debug/anim_editor_battler_back").deanimate
@target = AnimatedBitmap.new("Graphics/Pictures/testfront").deanimate @target = AnimatedBitmap.new("Graphics/UI/Debug/anim_editor_battler_front").deanimate
@testscreen = AnimatedBitmap.new("Graphics/Pictures/testscreen") @testscreen = AnimatedBitmap.new("Graphics/UI/Debug/anim_editor_battle_bg")
self.bitmap = @testscreen.bitmap self.bitmap = @testscreen.bitmap
PBAnimation::MAX_SPRITES.times do |i| PBAnimation::MAX_SPRITES.times do |i|
@lastframesprites[i] = SpriteFrame.new(i, @celsprites[i], viewport, true) @lastframesprites[i] = SpriteFrame.new(i, @celsprites[i], viewport, true)
@@ -7,11 +7,11 @@ class ControlPointSprite < Sprite
def initialize(red, viewport = nil) def initialize(red, viewport = nil)
super(viewport) super(viewport)
self.bitmap = Bitmap.new(6, 6) self.bitmap = Bitmap.new(6, 6)
self.bitmap.fill_rect(0, 0, 6, 1, Color.new(0, 0, 0)) self.bitmap.fill_rect(0, 0, 6, 1, Color.black)
self.bitmap.fill_rect(0, 0, 1, 6, Color.new(0, 0, 0)) self.bitmap.fill_rect(0, 0, 1, 6, Color.black)
self.bitmap.fill_rect(0, 5, 6, 1, Color.new(0, 0, 0)) self.bitmap.fill_rect(0, 5, 6, 1, Color.black)
self.bitmap.fill_rect(5, 0, 1, 6, Color.new(0, 0, 0)) self.bitmap.fill_rect(5, 0, 1, 6, Color.black)
color = (red) ? Color.new(255, 0, 0) : Color.new(0, 0, 0) color = (red) ? Color.new(255, 0, 0) : Color.black
self.bitmap.fill_rect(2, 2, 2, 2, color) self.bitmap.fill_rect(2, 2, 2, 2, color)
self.x = -6 self.x = -6
self.y = -6 self.y = -6
@@ -54,7 +54,7 @@ class PointSprite < Sprite
def initialize(x, y, viewport = nil) def initialize(x, y, viewport = nil)
super(viewport) super(viewport)
self.bitmap = Bitmap.new(2, 2) self.bitmap = Bitmap.new(2, 2)
self.bitmap.fill_rect(0, 0, 2, 2, Color.new(0, 0, 0)) self.bitmap.fill_rect(0, 0, 2, 2, Color.black)
self.x = x self.x = x
self.y = y self.y = y
end end
@@ -391,13 +391,13 @@ MenuHandlers.add(:debug_menu, :ready_rematches, {
"parent" => :battle_menu, "parent" => :battle_menu,
"description" => _INTL("Make all trainers in the phone ready for rematches."), "description" => _INTL("Make all trainers in the phone ready for rematches."),
"effect" => proc { "effect" => proc {
if !$PokemonGlobal.phoneNumbers || $PokemonGlobal.phoneNumbers.length == 0 if !$PokemonGlobal.phone || $PokemonGlobal.phone.contacts.length == 0
pbMessage(_INTL("There are no trainers in the Phone.")) pbMessage(_INTL("There are no trainers in the Phone."))
else else
$PokemonGlobal.phoneNumbers.each do |i| $PokemonGlobal.phone.contacts.each do |contact|
next if i.length != 8 # Isn't a trainer with an event next if !contact.trainer?
i[4] = 2 contact.rematch_flag = 1
pbSetReadyToBattle(i) contact.set_trainer_event_ready_for_rematch
end end
pbMessage(_INTL("All trainers in the Phone are now ready to rebattle.")) pbMessage(_INTL("All trainers in the Phone are now ready to rebattle."))
end end
@@ -68,14 +68,14 @@ class SpriteWindow_DebugVariables < Window_DrawableCommand
x += (w / 2) - (width / 2) x += (w / 2) - (width / 2)
end end
y += 8 # TEXT OFFSET y += 8 # TEXT OFFSET
base = Color.new(12 * 8, 12 * 8, 12 * 8) base = Color.new(96, 96, 96)
case colors case colors
when 1 # Red when 1 # Red
base = Color.new(168, 48, 56) base = Color.new(168, 48, 56)
when 2 # Green when 2 # Green
base = Color.new(0, 144, 0) base = Color.new(0, 144, 0)
end end
pbDrawShadowText(self.contents, x, y, [width, w].max, h, t, base, Color.new(26 * 8, 26 * 8, 25 * 8)) pbDrawShadowText(self.contents, x, y, [width, w].max, h, t, base, Color.new(208, 208, 200))
end end
def drawItem(index, _count, rect) def drawItem(index, _count, rect)
@@ -394,18 +394,18 @@ class SpriteWindow_DebugRoamers < Window_DrawableCommand
width = self.contents.text_size(t).width width = self.contents.text_size(t).width
case align case align
when 1 when 1
x += (w - width) # Right aligned x += (w - width) # Right aligned
when 2 when 2
x += (w / 2) - (width / 2) # Centre aligned x += (w / 2) - (width / 2) # Centre aligned
end end
base = Color.new(12 * 8, 12 * 8, 12 * 8) base = Color.new(96, 96, 96)
case colors case colors
when 1 when 1
base = Color.new(168, 48, 56) # Red base = Color.new(168, 48, 56) # Red
when 2 when 2
base = Color.new(0, 144, 0) # Green base = Color.new(0, 144, 0) # Green
end end
pbDrawShadowText(self.contents, x, y, [width, w].max, h, t, base, Color.new(26 * 8, 26 * 8, 25 * 8)) pbDrawShadowText(self.contents, x, y, [width, w].max, h, t, base, Color.new(208, 208, 200))
end end
def drawItem(index, _count, rect) def drawItem(index, _count, rect)
@@ -198,6 +198,21 @@ module Compiler
list.push(RPG::EventCommand.new(412, indent - 1, [])) list.push(RPG::EventCommand.new(412, indent - 1, []))
end end
# cancel is 1/2/3/4 for the options, 0 for disallow, 5 for branch
def push_choices(list, choices, cancel = 0, indent = 0)
list.push(RPG::EventCommand.new(102, indent, [choices, cancel, [0, 1, 2, 3]]))
end
def push_choice(list, index, text, indent = 0)
list.push(RPG::EventCommand.new(0, indent, [])) if index > 0
list.push(RPG::EventCommand.new(402, indent - 1, [index, text]))
end
def push_choices_end(list, indent = 0)
list.push(RPG::EventCommand.new(0, indent, []))
list.push(RPG::EventCommand.new(404, indent - 1, []))
end
def push_self_switch(list, swtch, switchOn, indent = 0) def push_self_switch(list, swtch, switchOn, indent = 0)
list.push(RPG::EventCommand.new(123, indent, [swtch, switchOn ? 0 : 1])) list.push(RPG::EventCommand.new(123, indent, [swtch, switchOn ? 0 : 1]))
end end
@@ -491,14 +506,13 @@ module Compiler
end end
end end
# Compile the trainer comments # Compile the trainer comments
rewriteComments = false # You can change this rewriteComments = true #false # You can change this
battles = [] battles = []
trtype = nil trtype = nil
trname = nil trname = nil
battleid = 0 battleid = 0
doublebattle = false doublebattle = false
backdrop = nil backdrop = nil
endspeeches = []
outcome = 0 outcome = 0
continue = false continue = false
endbattles = [] endbattles = []
@@ -522,34 +536,32 @@ module Compiler
value = $~[1].gsub(/^\s+/, "").gsub(/\s+$/, "") value = $~[1].gsub(/^\s+/, "").gsub(/\s+$/, "")
doublebattle = true if value.upcase == "TRUE" || value.upcase == "YES" doublebattle = true if value.upcase == "TRUE" || value.upcase == "YES"
push_comment(firstpage.list, command) if rewriteComments push_comment(firstpage.list, command) if rewriteComments
elsif command[/^Backdrop\:\s*([\s\S]+)$/i]
backdrop = $~[1].gsub(/^\s+/, "").gsub(/\s+$/, "")
push_comment(firstpage.list, command) if rewriteComments
elsif command[/^EndSpeech\:\s*([\s\S]+)$/i]
endspeeches.push(command)
push_comment(firstpage.list, command) if rewriteComments
elsif command[/^Outcome\:\s*(\d+)$/i]
outcome = $~[1].to_i
push_comment(firstpage.list, command) if rewriteComments
elsif command[/^Continue\:\s*([\s\S]+)$/i] elsif command[/^Continue\:\s*([\s\S]+)$/i]
value = $~[1].gsub(/^\s+/, "").gsub(/\s+$/, "") value = $~[1].gsub(/^\s+/, "").gsub(/\s+$/, "")
continue = true if value.upcase == "TRUE" || value.upcase == "YES" continue = true if value.upcase == "TRUE" || value.upcase == "YES"
push_comment(firstpage.list, command) if rewriteComments push_comment(firstpage.list, command) if rewriteComments
elsif command[/^EndBattle\:\s*([\s\S]+)$/i]
endbattles.push($~[1].gsub(/^\s+/, "").gsub(/\s+$/, ""))
push_comment(firstpage.list, command) if rewriteComments
elsif command[/^EndIfSwitch\:\s*([\s\S]+)$/i] elsif command[/^EndIfSwitch\:\s*([\s\S]+)$/i]
endifswitch.push(($~[1].gsub(/^\s+/, "").gsub(/\s+$/, "")).to_i) endifswitch.push(($~[1].gsub(/^\s+/, "").gsub(/\s+$/, "")).to_i)
push_comment(firstpage.list, command) if rewriteComments push_comment(firstpage.list, command) if rewriteComments
elsif command[/^VanishIfSwitch\:\s*([\s\S]+)$/i] elsif command[/^VanishIfSwitch\:\s*([\s\S]+)$/i]
vanishifswitch.push(($~[1].gsub(/^\s+/, "").gsub(/\s+$/, "")).to_i) vanishifswitch.push(($~[1].gsub(/^\s+/, "").gsub(/\s+$/, "")).to_i)
push_comment(firstpage.list, command) if rewriteComments push_comment(firstpage.list, command) if rewriteComments
elsif command[/^Backdrop\:\s*([\s\S]+)$/i]
backdrop = $~[1].gsub(/^\s+/, "").gsub(/\s+$/, "")
push_comment(firstpage.list, command) if rewriteComments
elsif command[/^Outcome\:\s*(\d+)$/i]
outcome = $~[1].to_i
push_comment(firstpage.list, command) if rewriteComments
elsif command[/^EndBattle\:\s*([\s\S]+)$/i]
endbattles.push($~[1].gsub(/^\s+/, "").gsub(/\s+$/, ""))
push_comment(firstpage.list, command) if rewriteComments
elsif command[/^RegSpeech\:\s*([\s\S]+)$/i] elsif command[/^RegSpeech\:\s*([\s\S]+)$/i]
regspeech = $~[1].gsub(/^\s+/, "").gsub(/\s+$/, "") regspeech = $~[1].gsub(/^\s+/, "").gsub(/\s+$/, "")
push_comment(firstpage.list, command) if rewriteComments push_comment(firstpage.list, command) if rewriteComments
end end
end end
return nil if battles.length <= 0 return nil if battles.length <= 0
endbattles.push("...") if endbattles.length == 0
# Run trainer check now, except in editor # Run trainer check now, except in editor
trainerChecker.pbTrainerBattleCheck(trtype, trname, battleid) trainerChecker.pbTrainerBattleCheck(trtype, trname, battleid)
# Set the event's charset to one depending on the trainer type if the event # Set the event's charset to one depending on the trainer type if the event
@@ -562,32 +574,43 @@ module Compiler
end end
end end
# Create strings that will be used repeatedly # Create strings that will be used repeatedly
safetrcombo = sprintf(":%s,\"%s\"", trtype, safequote(trname)) # :YOUNGSTER,"Joey" safetrcombo = sprintf(":%s, \"%s\"", trtype, safequote(trname)) # :YOUNGSTER, "Joey"
brieftrcombo = safetrcombo
safetrcombo = sprintf("%s, %d", safetrcombo, battleid) if battleid > 0 # :YOUNGSTER, "Joey", 1
introplay = sprintf("pbTrainerIntro(:%s)", trtype) introplay = sprintf("pbTrainerIntro(:%s)", trtype)
# Write first page # Write first page
push_comment(firstpage.list, endspeeches[0]) if endspeeches[0] # Just so it isn't lost
push_script(firstpage.list, introplay) # pbTrainerIntro push_script(firstpage.list, introplay) # pbTrainerIntro
push_script(firstpage.list, "pbNoticePlayer(get_self)") push_script(firstpage.list, "pbNoticePlayer(get_self)")
push_text(firstpage.list, battles[0]) push_text(firstpage.list, battles[0])
if battles.length > 1 # Has rematches if battles.length > 1 # Has rematches
push_script(firstpage.list, sprintf("pbTrainerCheck(%s,%d,%d)", safetrcombo, battles.length, battleid)) if battleid > 0
push_script(firstpage.list, sprintf("pbTrainerCheck(%s, %d, %d)", brieftrcombo, battles.length, battleid))
else
push_script(firstpage.list, sprintf("pbTrainerCheck(%s, %d)", brieftrcombo, battles.length))
end
end end
push_script(firstpage.list, "setBattleRule(\"double\")") if doublebattle push_script(firstpage.list, "setBattleRule(\"double\")") if doublebattle
push_script(firstpage.list, sprintf("setBattleRule(\"backdrop\",\"%s\")", safequote(backdrop))) if backdrop push_script(firstpage.list, sprintf("setBattleRule(\n \"backdrop\", \"%s\"\n)", safequote(backdrop))) if backdrop
push_script(firstpage.list, sprintf("setBattleRule(\"outcomeVar\",%d)", outcome)) if outcome > 1 push_script(firstpage.list, sprintf("setBattleRule(\"outcomeVar\", %d)", outcome)) if outcome > 1
push_script(firstpage.list, "setBattleRule(\"canLose\")") if continue push_script(firstpage.list, "setBattleRule(\"canLose\")") if continue
if battleid > 0 battleString = sprintf("TrainerBattle.start(%s)", safetrcombo)
battleString = sprintf("TrainerBattle.start(%s,%d)", safetrcombo, battleid)
else
battleString = sprintf("TrainerBattle.start(%s)", safetrcombo)
end
push_branch(firstpage.list, battleString) push_branch(firstpage.list, battleString)
if battles.length > 1 # Has rematches if battles.length > 1 # Has rematches
push_script(firstpage.list, push_branch(firstpage.list, sprintf("Phone.can_add?(%s)", safetrcombo), 1)
sprintf("pbPhoneRegisterBattle(_I(\"%s\"),get_self,%s,%d)", push_text(firstpage.list, regspeech, 2)
regspeech, safetrcombo, battles.length), 1) push_choices(firstpage.list, ["Yes", "No"], 2, 2)
push_choice(firstpage.list, 0, "Yes", 3)
if battleid > 0
push_script(firstpage.list, sprintf("Phone.add(get_self,\n %s, %d, %d\n)", brieftrcombo, battles.length, battleid), 3)
else
push_script(firstpage.list, sprintf("Phone.add(get_self,\n %s, %d\n)", brieftrcombo, battles.length), 3)
end
push_choice(firstpage.list, 1, "No", 3)
push_choices_end(firstpage.list, 3)
push_branch_end(firstpage.list, 2)
end end
push_self_switch(firstpage.list, "A", true, 1) push_self_switch(firstpage.list, "A", true, 1)
push_self_switch(firstpage.list, "B", true, 1) if battles.length > 1
push_branch_end(firstpage.list, 1) push_branch_end(firstpage.list, 1)
push_script(firstpage.list, "pbTrainerEnd", 0) push_script(firstpage.list, "pbTrainerEnd", 0)
push_end(firstpage.list) push_end(firstpage.list)
@@ -604,53 +627,66 @@ module Compiler
rematchpage.condition = lastpage.condition.clone rematchpage.condition = lastpage.condition.clone
rematchpage.condition.self_switch_valid = true rematchpage.condition.self_switch_valid = true
rematchpage.condition.self_switch_ch = "B" rematchpage.condition.self_switch_ch = "B"
# Write rematch and last pages # Write rematch page
(1...battles.length).each do |i| push_script(rematchpage.list, introplay, 0) # pbTrainerIntro
# Run trainer check now, except in editor if battles.length == 2
trainerChecker.pbTrainerBattleCheck(trtype, trname, battleid + i) push_text(rematchpage.list, battles[1], 0)
if i == battles.length - 1 else
push_branch(rematchpage.list, sprintf("pbPhoneBattleCount(%s)>=%d", safetrcombo, i)) (1...battles.length).each do |i|
push_branch(lastpage.list, sprintf("pbPhoneBattleCount(%s)>%d", safetrcombo, i)) # Run trainer check now, except in editor
else trainerChecker.pbTrainerBattleCheck(trtype, trname, battleid + i)
push_branch(rematchpage.list, sprintf("pbPhoneBattleCount(%s)==%d", safetrcombo, i)) if i == 1
push_branch(lastpage.list, sprintf("pbPhoneBattleCount(%s)==%d", safetrcombo, i)) push_branch(rematchpage.list, sprintf("Phone.variant(%s) <= %d", safetrcombo, i))
elsif i == battles.length - 1
push_branch(rematchpage.list, sprintf("Phone.variant(%s) >= %d", safetrcombo, i))
else
push_branch(rematchpage.list, sprintf("Phone.variant(%s) == %d", safetrcombo, i))
end
push_text(rematchpage.list, battles[i], 1)
push_branch_end(rematchpage.list, 1)
end end
# Rematch page
push_script(rematchpage.list, introplay, 1) # pbTrainerIntro
push_text(rematchpage.list, battles[i], 1)
push_script(rematchpage.list, "setBattleRule(\"double\")", 1) if doublebattle
push_script(rematchpage.list, sprintf("setBattleRule(\"backdrop\",%s)", safequote(backdrop)), 1) if backdrop
push_script(rematchpage.list, sprintf("setBattleRule(\"outcomeVar\",%d)", outcome), 1) if outcome > 1
push_script(rematchpage.list, "setBattleRule(\"canLose\")", 1) if continue
battleString = sprintf("TrainerBattle.start(%s,%d)", safetrcombo, battleid + i)
push_branch(rematchpage.list, battleString, 1)
push_script(rematchpage.list, sprintf("pbPhoneIncrement(%s,%d)", safetrcombo, battles.length), 2)
push_self_switch(rematchpage.list, "A", true, 2)
push_self_switch(rematchpage.list, "B", false, 2)
push_script(rematchpage.list, "pbTrainerEnd", 2)
push_branch_end(rematchpage.list, 2)
push_exit(rematchpage.list, 1) # Exit Event Processing
push_branch_end(rematchpage.list, 1)
# Last page
if endbattles.length > 0
ebattle = (endbattles[i]) ? endbattles[i] : endbattles[endbattles.length - 1]
push_text(lastpage.list, ebattle, 1)
end
push_script(lastpage.list,
sprintf("pbPhoneRegisterBattle(_I(\"%s\"),get_self,%s,%d)",
regspeech, safetrcombo, battles.length), 1)
push_exit(lastpage.list, 1) # Exit Event Processing
push_branch_end(lastpage.list, 1)
end end
# Finish writing rematch page push_script(rematchpage.list, "setBattleRule(\"double\")", 1) if doublebattle
push_script(rematchpage.list, sprintf("setBattleRule(\n \"backdrop\", %s\n)", safequote(backdrop)), 1) if backdrop
push_script(rematchpage.list, sprintf("setBattleRule(\"outcomeVar\", %d)", outcome), 1) if outcome > 1
push_script(rematchpage.list, "setBattleRule(\"canLose\")", 1) if continue
battleString = sprintf("Phone.battle(%s)", safetrcombo)
push_branch(rematchpage.list, battleString, 0)
push_script(rematchpage.list, sprintf("Phone.reset_after_win(\n %s\n)", safetrcombo), 1)
push_self_switch(rematchpage.list, "A", true, 1)
push_script(rematchpage.list, "pbTrainerEnd", 1)
push_branch_end(rematchpage.list, 1)
push_end(rematchpage.list) push_end(rematchpage.list)
# Finish writing last page # Write last page
ebattle = (endbattles[0]) ? endbattles[0] : "..." if endbattles.length > 0
push_text(lastpage.list, ebattle) if battles.length == 1
push_text(lastpage.list, endbattles[0], 0)
else
(0...battles.length).each do |i|
if i == battles.length - 1
push_branch(lastpage.list, sprintf("Phone.variant_beaten(%s) >= %d", safetrcombo, i))
else
push_branch(lastpage.list, sprintf("Phone.variant_beaten(%s) == %d", safetrcombo, i))
end
ebattle = (endbattles[i]) ? endbattles[i] : endbattles[endbattles.length - 1]
push_text(lastpage.list, ebattle, 1)
push_branch_end(lastpage.list, 1)
end
end
end
if battles.length > 1 if battles.length > 1
push_script(lastpage.list, push_branch(lastpage.list, sprintf("Phone.can_add?(%s)", safetrcombo), 0)
sprintf("pbPhoneRegisterBattle(_I(\"%s\"),get_self,%s,%d)", push_text(lastpage.list, regspeech, 1)
regspeech, safetrcombo, battles.length)) push_choices(lastpage.list, ["Yes", "No"], 2, 1)
push_choice(lastpage.list, 0, "Yes", 2)
if battleid > 0
push_script(lastpage.list, sprintf("Phone.add(get_self,\n %s, %d, %d\n)", brieftrcombo, battles.length, battleid), 2)
else
push_script(lastpage.list, sprintf("Phone.add(get_self,\n %s, %d\n)", brieftrcombo, battles.length), 2)
end
push_choice(lastpage.list, 1, "No", 2)
push_choices_end(lastpage.list, 2)
push_branch_end(lastpage.list, 1)
end end
push_end(lastpage.list) push_end(lastpage.list)
# Add pages to the new event # Add pages to the new event
+16 -16
View File
@@ -1,34 +1,34 @@
# See the documentation on the wiki to learn how to edit this file. # See the documentation on the wiki to learn how to edit this file.
#------------------------------- #-------------------------------
[<Generics>] [<Generics>]
How are your Pokémon doing?\mMy \TP's really energetic. It's a handful!\mOh yeah, I managed to beat a tough \TE.\mI need to make my party stronger. How are your Pokémon doing?\mMy \TP's really energetic. It's a handful!\mOh yeah, I managed to beat a tough \TE.\mI need to make my party stronger.
My \TP's looking really awesome.\mI wish I could show you.\mHey, listen! I almost caught a \TE the other day.\mOh, it was sooooooo close, too! My \TP's looking really awesome.\mI wish I could show you.\mHey, listen! I almost caught a \TE the other day.\mOh, it was sooooooo close, too!
#------------------------------- #-------------------------------
[<BattleRequests>] [<BattleRequests>]
Want to battle? It's not going to be a repeat of the last time we met.\mI'll be waiting for you around \TM. Want to battle? It's not going to be a repeat of the last time we met.\mI'll be waiting for you around \TM.
Do you want to battle? I'm going to win this time!\mI'll be waiting for you around \TM.\mLook for me, OK? My \TP will be expecting you. Do you want to battle? I'm going to win this time!\mI'll be waiting for you around \TM.\mLook for me, OK? My \TP will be expecting you.
#------------------------------- #-------------------------------
[<GreetingsMorning>] [<GreetingsMorning>]
Good morning, \PN.\mThis is \TN. Did I wake you? Good morning, \PN.\mThis is \TN. Did I wake you?
#------------------------------- #-------------------------------
[<GreetingsEvening>] [<GreetingsEvening>]
\PN, good evening! Hi.\mThis is \TN. \PN, good evening! Hi.\mThis is \TN.
#------------------------------- #-------------------------------
[<Greetings>] [<Greetings>]
Hello. This is \TN. Hello. This is \TN.
Good day, \PN! Hi. This is \TN. Good day, \PN! Hi. This is \TN.
How are you doing? \PN, howdy! This is \TN. Isn't it nice out? How are you doing? \PN, howdy! This is \TN. Isn't it nice out?
\PN, good day! It's me, \TN. Got a minute? \PN, good day! It's me, \TN. Got a minute?
Hello, \PN. This is \TN. How are things? Hello, \PN. This is \TN. How are things?
#------------------------------- #-------------------------------
[<Bodies1>] [<Bodies1>]
How are your Pokémon doing?\mMy \TP's really energetic. It's a handful! How are your Pokémon doing?\mMy \TP's really energetic. It's a handful!
How are your Pokémon doing?\mI always keep my \TP in top shape by going to Pokémon Centers. How are your Pokémon doing?\mI always keep my \TP in top shape by going to Pokémon Centers.
My \TP's looking really awesome. I wish I could show you. My \TP's looking really awesome. I wish I could show you.
I dressed my \TP and it looks even cuter than before. I dressed my \TP and it looks even cuter than before.
#------------------------------- #-------------------------------
[<Bodies2>] [<Bodies2>]
Oh yeah, I managed to beat a tough \TE.\mI need to make my party stronger. Oh yeah, I managed to beat a tough \TE.\mI need to make my party stronger.
You have to hear this! I battled \TE the other day.\mIt was easy! I had a type advantage. You have to hear this! I battled \TE the other day.\mIt was easy! I had a type advantage.
Hey, listen! I almost caught \TE the other day.\mOh, it was sooooooo close, too! Hey, listen! I almost caught \TE the other day.\mOh, it was sooooooo close, too!
Guess what happened the other day. I missed catching \TE again.\mMaybe I'm not very good at this. Guess what happened the other day. I missed catching \TE again.\mMaybe I'm not very good at this.