More aligning of code

This commit is contained in:
Maruno17
2021-12-19 12:19:08 +00:00
parent 13a238cc6a
commit 33781493f4
121 changed files with 977 additions and 838 deletions
@@ -816,7 +816,7 @@ class Interpreter
y = $game_variables[@parameters[5]] y = $game_variables[@parameters[5]]
end end
$game_screen.pictures[number].show(@parameters[1], @parameters[2], $game_screen.pictures[number].show(@parameters[1], @parameters[2],
x, y, @parameters[6], @parameters[7], @parameters[8], @parameters[9]) x, y, @parameters[6], @parameters[7], @parameters[8], @parameters[9])
return true return true
end end
#----------------------------------------------------------------------------- #-----------------------------------------------------------------------------
@@ -832,7 +832,7 @@ class Interpreter
y = $game_variables[@parameters[5]] y = $game_variables[@parameters[5]]
end end
$game_screen.pictures[number].move(@parameters[1] * Graphics.frame_rate / 20, $game_screen.pictures[number].move(@parameters[1] * Graphics.frame_rate / 20,
@parameters[2], x, y, @parameters[6], @parameters[7], @parameters[8], @parameters[9]) @parameters[2], x, y, @parameters[6], @parameters[7], @parameters[8], @parameters[9])
return true return true
end end
#----------------------------------------------------------------------------- #-----------------------------------------------------------------------------
@@ -849,7 +849,7 @@ class Interpreter
def command_234 def command_234
number = @parameters[0] + ($game_temp.in_battle ? 50 : 0) number = @parameters[0] + ($game_temp.in_battle ? 50 : 0)
$game_screen.pictures[number].start_tone_change(@parameters[1], $game_screen.pictures[number].start_tone_change(@parameters[1],
@parameters[2] * Graphics.frame_rate / 20) @parameters[2] * Graphics.frame_rate / 20)
return true return true
end end
#----------------------------------------------------------------------------- #-----------------------------------------------------------------------------
@@ -953,7 +953,8 @@ class Interpreter
sscreen = PokemonEntry.new(sscene) sscreen = PokemonEntry.new(sscene)
$game_actors[@parameters[0]].name = sscreen.pbStartScreen( $game_actors[@parameters[0]].name = sscreen.pbStartScreen(
_INTL("Enter {1}'s name.", $game_actors[@parameters[0]].name), _INTL("Enter {1}'s name.", $game_actors[@parameters[0]].name),
1, @parameters[1], $game_actors[@parameters[0]].name) 1, @parameters[1], $game_actors[@parameters[0]].name
)
} }
end end
return true return true
@@ -65,7 +65,7 @@ class Game_System
if bgm != nil && bgm.name != "" if bgm != nil && bgm.name != ""
if FileTest.audio_exist?("Audio/BGM/" + bgm.name) if FileTest.audio_exist?("Audio/BGM/" + bgm.name)
bgm_play_internal2("Audio/BGM/" + bgm.name, bgm_play_internal2("Audio/BGM/" + bgm.name,
bgm.volume, bgm.pitch, @bgm_position) if !@defaultBGM bgm.volume, bgm.pitch, @bgm_position) if !@defaultBGM
end end
else else
@bgm_position = position if !@bgm_paused @bgm_position = position if !@bgm_paused
@@ -74,7 +74,7 @@ class Game_System
end end
if @defaultBGM if @defaultBGM
bgm_play_internal2("Audio/BGM/" + @defaultBGM.name, bgm_play_internal2("Audio/BGM/" + @defaultBGM.name,
@defaultBGM.volume, @defaultBGM.pitch, @bgm_position) @defaultBGM.volume, @defaultBGM.pitch, @bgm_position)
end end
Graphics.frame_reset Graphics.frame_reset
end end
@@ -270,15 +270,14 @@ class PokemonMapFactory
# the array (3,-4), because (5-2=3) and (1-5=-4). # the array (3,-4), because (5-2=3) and (1-5=-4).
def getThisAndOtherEventRelativePos(thisEvent, otherEvent) def getThisAndOtherEventRelativePos(thisEvent, otherEvent)
return [0, 0] if !thisEvent || !otherEvent return [0, 0] if !thisEvent || !otherEvent
return getRelativePos( return getRelativePos(thisEvent.map.map_id, thisEvent.x, thisEvent.y,
thisEvent.map.map_id, thisEvent.x, thisEvent.y, otherEvent.map.map_id, otherEvent.x, otherEvent.y)
otherEvent.map.map_id, otherEvent.x, otherEvent.y)
end end
def getThisAndOtherPosRelativePos(thisEvent, otherMapID, otherX, otherY) def getThisAndOtherPosRelativePos(thisEvent, otherMapID, otherX, otherY)
return [0, 0] if !thisEvent return [0, 0] if !thisEvent
return getRelativePos( return getRelativePos(thisEvent.map.map_id, thisEvent.x, thisEvent.y,
thisEvent.map.map_id, thisEvent.x, thisEvent.y, otherMapID, otherX, otherY) otherMapID, otherX, otherY)
end end
# Unused # Unused
@@ -117,7 +117,8 @@ class Sprite_Character < RPG::Sprite
self.oy = @ch self.oy = @ch
else else
@charbitmap = AnimatedBitmap.new( @charbitmap = AnimatedBitmap.new(
'Graphics/Characters/' + @character_name, @character_hue) 'Graphics/Characters/' + @character_name, @character_hue
)
RPG::Cache.retain('Graphics/Characters/', @character_name, @character_hue) if @character == $game_player RPG::Cache.retain('Graphics/Characters/', @character_name, @character_hue) if @character == $game_player
@charbitmapAnimated = true @charbitmapAnimated = true
@bushbitmap.dispose if @bushbitmap @bushbitmap.dispose if @bushbitmap
@@ -38,15 +38,15 @@ class Sprite_Shadow < RPG::Sprite
@chbitmap.dispose if @chbitmap @chbitmap.dispose if @chbitmap
if @tile_id >= 384 if @tile_id >= 384
@chbitmap = pbGetTileBitmap(@character.map.tileset_name, @chbitmap = pbGetTileBitmap(@character.map.tileset_name,
@tile_id, @character.character_hue) @tile_id, @character.character_hue)
self.src_rect.set(0, 0, 32, 32) self.src_rect.set(0, 0, 32, 32)
@ch = 32 @ch = 32
@cw = 32 @cw = 32
self.ox = 16 self.ox = 16
self.oy = 32 self.oy = 32
else else
@chbitmap = AnimatedBitmap.new( @chbitmap = AnimatedBitmap.new('Graphics/Characters/' + @character.character_name,
'Graphics/Characters/' + @character.character_name, @character.character_hue) @character.character_hue)
@cw = @chbitmap.width / 4 @cw = @chbitmap.width / 4
@ch = @chbitmap.height / 4 @ch = @chbitmap.height / 4
self.ox = @cw / 2 self.ox = @cw / 2
@@ -379,7 +379,7 @@ class TilemapRenderer
filename = extra_autotile_arrays[1][tile_id - single_autotile_start_id] filename = extra_autotile_arrays[1][tile_id - single_autotile_start_id]
end end
tile.set_bitmap(filename, tile_id, true, @autotiles.animated?(filename), tile.set_bitmap(filename, tile_id, true, @autotiles.animated?(filename),
priority, @autotiles[filename]) priority, @autotiles[filename])
else else
filename = map.tileset_name filename = map.tileset_name
tile.set_bitmap(filename, tile_id, false, false, priority, @tilesets[filename]) tile.set_bitmap(filename, tile_id, false, false, priority, @tilesets[filename])
@@ -32,20 +32,20 @@ class TilemapRenderer
case id case id
when 1 # Top left corner when 1 # Top left corner
new_bitmap.blt(dest_x, dest_y, bitmap, new_bitmap.blt(dest_x, dest_y, bitmap,
Rect.new(frame * SOURCE_TILE_WIDTH * 3, SOURCE_TILE_HEIGHT * 4, Rect.new(frame * SOURCE_TILE_WIDTH * 3, SOURCE_TILE_HEIGHT * 4,
SOURCE_TILE_WIDTH, SOURCE_TILE_HEIGHT)) SOURCE_TILE_WIDTH, SOURCE_TILE_HEIGHT))
when 2 # Top right corner when 2 # Top right corner
new_bitmap.blt(dest_x, dest_y, bitmap, new_bitmap.blt(dest_x, dest_y, bitmap,
Rect.new(SOURCE_TILE_WIDTH + frame * SOURCE_TILE_WIDTH * 3, SOURCE_TILE_HEIGHT * 4, Rect.new(SOURCE_TILE_WIDTH + frame * SOURCE_TILE_WIDTH * 3, SOURCE_TILE_HEIGHT * 4,
SOURCE_TILE_WIDTH, SOURCE_TILE_HEIGHT)) SOURCE_TILE_WIDTH, SOURCE_TILE_HEIGHT))
when 4 # Bottom right corner when 4 # Bottom right corner
new_bitmap.blt(dest_x, dest_y, bitmap, new_bitmap.blt(dest_x, dest_y, bitmap,
Rect.new(SOURCE_TILE_WIDTH + frame * SOURCE_TILE_WIDTH * 3, SOURCE_TILE_HEIGHT * 5, Rect.new(SOURCE_TILE_WIDTH + frame * SOURCE_TILE_WIDTH * 3, SOURCE_TILE_HEIGHT * 5,
SOURCE_TILE_WIDTH, SOURCE_TILE_HEIGHT)) SOURCE_TILE_WIDTH, SOURCE_TILE_HEIGHT))
when 8 # Bottom left corner when 8 # Bottom left corner
new_bitmap.blt(dest_x, dest_y, bitmap, new_bitmap.blt(dest_x, dest_y, bitmap,
Rect.new(frame * SOURCE_TILE_WIDTH * 3, SOURCE_TILE_HEIGHT * 5, Rect.new(frame * SOURCE_TILE_WIDTH * 3, SOURCE_TILE_HEIGHT * 5,
SOURCE_TILE_WIDTH, SOURCE_TILE_HEIGHT)) SOURCE_TILE_WIDTH, SOURCE_TILE_HEIGHT))
end end
next next
end end
@@ -106,7 +106,7 @@ class TileDrawingHelper
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
end end
end end
@@ -180,9 +180,8 @@ def bltMinimapAutotile(dstBitmap, x, y, srcBitmap, id)
src = Rect.new(0, 0, 0, 0) src = Rect.new(0, 0, 0, 0)
for i in 0...4 for i in 0...4
tile_position = tiles[i] - 1 tile_position = tiles[i] - 1
src.set( src.set(tile_position % 6 * cxTile + anim,
tile_position % 6 * cxTile + anim, tile_position / 6 * cyTile, cxTile, cyTile)
tile_position / 6 * cyTile, cxTile, cyTile)
dstBitmap.blt(i % 2 * cxTile + x, i / 2 * cyTile + y, srcBitmap, src) dstBitmap.blt(i % 2 * cxTile + x, i / 2 * cyTile + y, srcBitmap, src)
end end
end end
@@ -522,24 +522,19 @@ class Window
@cursorbitmap.clear @cursorbitmap.clear
@sprites["cursor"].bitmap = @cursorbitmap @sprites["cursor"].bitmap = @cursorbitmap
@sprites["cursor"].src_rect.set(0, 0, width, height) @sprites["cursor"].src_rect.set(0, 0, width, height)
rect = Rect.new(margin, margin, rect = Rect.new(margin, margin, width - fullmargin, height - fullmargin)
width - fullmargin, height - fullmargin)
@cursorbitmap.stretch_blt(rect, @_windowskin, cursorrects[8]) @cursorbitmap.stretch_blt(rect, @_windowskin, cursorrects[8])
@cursorbitmap.blt(0, 0, @_windowskin, cursorrects[4]) # top left @cursorbitmap.blt(0, 0, @_windowskin, cursorrects[4]) # top left
@cursorbitmap.blt(width - margin, 0, @_windowskin, cursorrects[5]) # top right @cursorbitmap.blt(width - margin, 0, @_windowskin, cursorrects[5]) # top right
@cursorbitmap.blt(0, height - margin, @_windowskin, cursorrects[6]) # bottom right @cursorbitmap.blt(0, height - margin, @_windowskin, cursorrects[6]) # bottom right
@cursorbitmap.blt(width - margin, height - margin, @_windowskin, cursorrects[7]) # bottom left @cursorbitmap.blt(width - margin, height - margin, @_windowskin, cursorrects[7]) # bottom left
rect = Rect.new(margin, 0, rect = Rect.new(margin, 0, width - fullmargin, margin)
width - fullmargin, margin)
@cursorbitmap.stretch_blt(rect, @_windowskin, cursorrects[0]) @cursorbitmap.stretch_blt(rect, @_windowskin, cursorrects[0])
rect = Rect.new(0, margin, rect = Rect.new(0, margin, margin, height - fullmargin)
margin, height - fullmargin)
@cursorbitmap.stretch_blt(rect, @_windowskin, cursorrects[1]) @cursorbitmap.stretch_blt(rect, @_windowskin, cursorrects[1])
rect = Rect.new(width - margin, margin, rect = Rect.new(width - margin, margin, margin, height - fullmargin)
margin, height - fullmargin)
@cursorbitmap.stretch_blt(rect, @_windowskin, cursorrects[2]) @cursorbitmap.stretch_blt(rect, @_windowskin, cursorrects[2])
rect = Rect.new(margin, height - margin, rect = Rect.new(margin, height - margin, width - fullmargin, margin)
width - fullmargin, margin)
@cursorbitmap.stretch_blt(rect, @_windowskin, cursorrects[3]) @cursorbitmap.stretch_blt(rect, @_windowskin, cursorrects[3])
else else
@sprites["cursor"].visible = false @sprites["cursor"].visible = false
@@ -553,8 +548,7 @@ class Window
@sprites["side#{i}"].src_rect.set(0, 0, dwidth, dheight) @sprites["side#{i}"].src_rect.set(0, 0, dwidth, dheight)
@sidebitmaps[i].clear @sidebitmaps[i].clear
if sideRects[i].width > 0 && sideRects[i].height > 0 if sideRects[i].width > 0 && sideRects[i].height > 0
@sidebitmaps[i].stretch_blt(@sprites["side#{i}"].src_rect, @sidebitmaps[i].stretch_blt(@sprites["side#{i}"].src_rect, @_windowskin, sideRects[i])
@_windowskin, sideRects[i])
end end
end end
backwidth = @width - 4 backwidth = @width - 4
@@ -618,8 +618,7 @@ class SpriteWindow < Window
@sprites["corner1"].src_rect.set(cx, 0, endX, startY) @sprites["corner1"].src_rect.set(cx, 0, endX, startY)
@sprites["corner2"].src_rect.set(0, cy, startX, endY) @sprites["corner2"].src_rect.set(0, cy, startX, endY)
@sprites["corner3"].src_rect.set(cx, cy, endX, endY) @sprites["corner3"].src_rect.set(cx, cy, endX, endY)
backRect = Rect.new(@skinrect.x, @skinrect.y, backRect = Rect.new(@skinrect.x, @skinrect.y, @skinrect.width, @skinrect.height)
@skinrect.width, @skinrect.height)
blindsRect = nil blindsRect = nil
sideRects = [ sideRects = [
Rect.new(startX, 0, @skinrect.width, startY), # side0 (top) Rect.new(startX, 0, @skinrect.width, startY), # side0 (top)
@@ -753,10 +752,10 @@ class SpriteWindow < Window
if (@compat & CompatBits::StretchSides) > 0 && @skinformat == 0 if (@compat & CompatBits::StretchSides) > 0 && @skinformat == 0
# Compatibility mode: Stretch sides # Compatibility mode: Stretch sides
@sidebitmaps[i].stretch_blt(@sprites["side#{i}"].src_rect, @sidebitmaps[i].stretch_blt(@sprites["side#{i}"].src_rect,
@_windowskin, sideRects[i]) @_windowskin, sideRects[i])
else else
tileBitmap(@sidebitmaps[i], @sprites["side#{i}"].src_rect, tileBitmap(@sidebitmaps[i], @sprites["side#{i}"].src_rect,
@_windowskin, sideRects[i]) @_windowskin, sideRects[i])
end end
end end
end end
@@ -52,7 +52,7 @@ class Window_UnformattedTextPokemon < SpriteWindow_Base
dims = [0, 0] dims = [0, 0]
cwidth = maxwidth < 0 ? Graphics.width : maxwidth cwidth = maxwidth < 0 ? Graphics.width : maxwidth
getLineBrokenChunks(self.contents, text, getLineBrokenChunks(self.contents, text,
cwidth - self.borderX - SpriteWindow_Base::TEXTPADDING, dims, true) cwidth - self.borderX - SpriteWindow_Base::TEXTPADDING, dims, true)
return dims return dims
end end
@@ -99,10 +99,10 @@ class Window_UnformattedTextPokemon < SpriteWindow_Base
def refresh def refresh
self.contents = pbDoEnsureBitmap(self.contents, self.width - self.borderX, self.contents = pbDoEnsureBitmap(self.contents, self.width - self.borderX,
self.height - self.borderY) self.height - self.borderY)
self.contents.clear self.contents.clear
drawTextEx(self.contents, 0, 4, self.contents.width, 0, drawTextEx(self.contents, 0, 4, self.contents.width, 0,
@text.gsub(/\r/, ""), @baseColor, @shadowColor) @text.gsub(/\r/, ""), @baseColor, @shadowColor)
end end
end end
@@ -234,7 +234,7 @@ class Window_AdvancedTextPokemon < SpriteWindow_Base
dims = [0, 0] dims = [0, 0]
cwidth = (maxwidth < 0) ? Graphics.width : maxwidth cwidth = (maxwidth < 0) ? Graphics.width : maxwidth
chars = getFormattedTextForDims(self.contents, 0, 0, chars = getFormattedTextForDims(self.contents, 0, 0,
cwidth - self.borderX - 2 - 6, -1, text, @lineHeight, true) cwidth - self.borderX - 2 - 6, -1, text, @lineHeight, true)
for ch in chars for ch in chars
dims[0] = [dims[0], ch[1] + ch[3]].max dims[0] = [dims[0], ch[1] + ch[3]].max
dims[1] = [dims[1], ch[2] + ch[4]].max dims[1] = [dims[1], ch[2] + ch[4]].max
@@ -309,8 +309,8 @@ class Window_AdvancedTextPokemon < SpriteWindow_Base
if @letterbyletter if @letterbyletter
@fmtchars = [] @fmtchars = []
fmt = getFormattedText(self.contents, 0, 0, fmt = getFormattedText(self.contents, 0, 0,
self.width - self.borderX - SpriteWindow_Base::TEXTPADDING, -1, self.width - self.borderX - SpriteWindow_Base::TEXTPADDING, -1,
shadowctag(@baseColor, @shadowColor) + value, 32, true) shadowctag(@baseColor, @shadowColor) + value, 32, true)
@oldfont = self.contents.font.clone @oldfont = self.contents.font.clone
for ch in fmt for ch in fmt
chx = ch[1] + ch[3] chx = ch[1] + ch[3]
@@ -337,8 +337,8 @@ class Window_AdvancedTextPokemon < SpriteWindow_Base
fmt.clear fmt.clear
else else
@fmtchars = getFormattedText(self.contents, 0, 0, @fmtchars = getFormattedText(self.contents, 0, 0,
self.width - self.borderX - SpriteWindow_Base::TEXTPADDING, -1, self.width - self.borderX - SpriteWindow_Base::TEXTPADDING, -1,
shadowctag(@baseColor, @shadowColor) + value, 32, true) shadowctag(@baseColor, @shadowColor) + value, 32, true)
@oldfont = self.contents.font.clone @oldfont = self.contents.font.clone
for ch in @fmtchars for ch in @fmtchars
chx = ch[1] + ch[3] chx = ch[1] + ch[3]
@@ -660,7 +660,7 @@ class Window_InputNumberPokemon < SpriteWindow_Base
def refresh def refresh
self.contents = pbDoEnsureBitmap(self.contents, self.contents = pbDoEnsureBitmap(self.contents,
self.width - self.borderX, self.height - self.borderY) self.width - self.borderX, self.height - self.borderY)
pbSetSystemFont(self.contents) pbSetSystemFont(self.contents)
self.contents.clear self.contents.clear
s = sprintf("%0*d", @digits_max, @number.abs) s = sprintf("%0*d", @digits_max, @number.abs)
@@ -1226,7 +1226,7 @@ class Window_CommandPokemon < Window_DrawableCommand
pbSetSystemFont(self.contents) if @starting pbSetSystemFont(self.contents) if @starting
rect = drawCursor(index, rect) rect = drawCursor(index, rect)
pbDrawShadowText(self.contents, rect.x, rect.y, rect.width, rect.height, pbDrawShadowText(self.contents, rect.x, rect.y, rect.width, rect.height,
@commands[index], self.baseColor, self.shadowColor) @commands[index], self.baseColor, self.shadowColor)
end end
end end
@@ -1248,8 +1248,8 @@ class Window_AdvancedCommandPokemon < Window_DrawableCommand
def textWidth(bitmap, text) def textWidth(bitmap, text)
dims = [nil, 0] dims = [nil, 0]
chars = getFormattedText(bitmap, 0, 0, chars = getFormattedText(bitmap, 0, 0,
Graphics.width - self.borderX - SpriteWindow_Base::TEXTPADDING - 16, Graphics.width - self.borderX - SpriteWindow_Base::TEXTPADDING - 16,
-1, text, self.rowHeight, true, true) -1, text, self.rowHeight, true, true)
for ch in chars for ch in chars
dims[0] = dims[0] ? [dims[0], ch[1]].min : ch[1] dims[0] = dims[0] ? [dims[0], ch[1]].min : ch[1]
dims[1] = [dims[1], ch[1] + ch[3]].max dims[1] = [dims[1], ch[1] + ch[3]].max
@@ -1342,11 +1342,10 @@ class Window_AdvancedCommandPokemon < Window_DrawableCommand
if toUnformattedText(@commands[index]).gsub(/\n/, "") == @commands[index] if toUnformattedText(@commands[index]).gsub(/\n/, "") == @commands[index]
# Use faster alternative for unformatted text without line breaks # Use faster alternative for unformatted text without line breaks
pbDrawShadowText(self.contents, rect.x, rect.y, rect.width, rect.height, pbDrawShadowText(self.contents, rect.x, rect.y, rect.width, rect.height,
@commands[index], self.baseColor, self.shadowColor) @commands[index], self.baseColor, self.shadowColor)
else else
chars = getFormattedText( chars = getFormattedText(self.contents, rect.x, rect.y + 4, rect.width, rect.height,
self.contents, rect.x, rect.y + 4, rect.width, rect.height, @commands[index], rect.height, true, true)
@commands[index], rect.height, true, true)
drawFormattedChars(self.contents, chars) drawFormattedChars(self.contents, chars)
end end
end end
@@ -136,11 +136,11 @@ class AnimatedSprite < SpriteWrapper
end end
if @animbitmap.width % framewidth != 0 if @animbitmap.width % framewidth != 0
raise _INTL("Bitmap's width ({1}) is not a multiple of frame width ({2}) [Bitmap={3}]", raise _INTL("Bitmap's width ({1}) is not a multiple of frame width ({2}) [Bitmap={3}]",
@animbitmap.width, framewidth, animname) @animbitmap.width, framewidth, animname)
end end
if @animbitmap.height % frameheight != 0 if @animbitmap.height % frameheight != 0
raise _INTL("Bitmap's height ({1}) is not a multiple of frame height ({2}) [Bitmap={3}]", raise _INTL("Bitmap's height ({1}) is not a multiple of frame height ({2}) [Bitmap={3}]",
@animbitmap.height, frameheight, animname) @animbitmap.height, frameheight, animname)
end end
@framecount = framecount @framecount = framecount
@framewidth = framewidth @framewidth = framewidth
@@ -167,7 +167,7 @@ class AnimatedSprite < SpriteWrapper
end end
if @animbitmap.width % framecount != 0 if @animbitmap.width % framecount != 0
raise _INTL("Bitmap's width ({1}) is not a multiple of frame count ({2}) [Bitmap={3}]", raise _INTL("Bitmap's width ({1}) is not a multiple of frame count ({2}) [Bitmap={3}]",
@animbitmap.width, framewidth, animname) @animbitmap.width, framewidth, animname)
end end
@framecount = framecount @framecount = framecount
@framewidth = @animbitmap.width / @framecount @framewidth = @animbitmap.width / @framecount
@@ -31,7 +31,7 @@ def colorToRgb32(color)
return sprintf("%02X%02X%02X", color.red.to_i, color.green.to_i, color.blue.to_i) return sprintf("%02X%02X%02X", color.red.to_i, color.green.to_i, color.blue.to_i)
else else
return sprintf("%02X%02X%02X%02X", return sprintf("%02X%02X%02X%02X",
color.red.to_i, color.green.to_i, color.blue.to_i, color.alpha.to_i) color.red.to_i, color.green.to_i, color.blue.to_i, color.alpha.to_i)
end end
end end
@@ -163,10 +163,9 @@ def getFormattedTextForDims(bitmap, xDst, yDst, widthDst, heightDst, text, lineh
if newlineBreaks if newlineBreaks
text2.gsub!(/<(\/?)(br)(\s*\=\s*([^>]*))?>/i, "\n") text2.gsub!(/<(\/?)(br)(\s*\=\s*([^>]*))?>/i, "\n")
end end
return getFormattedText( return getFormattedText(bitmap, xDst, yDst, widthDst, heightDst,
bitmap, xDst, yDst, widthDst, heightDst, text2, lineheight, newlineBreaks,
text2, lineheight, newlineBreaks, explicitBreaksOnly, true)
explicitBreaksOnly, true)
end end
def getFormattedTextFast(bitmap, xDst, yDst, widthDst, heightDst, text, lineheight, def getFormattedTextFast(bitmap, xDst, yDst, widthDst, heightDst, text, lineheight,
@@ -412,7 +411,7 @@ def getFormattedText(bitmap, xDst, yDst, widthDst, heightDst, text, lineheight =
end end
if controls.length == 0 if controls.length == 0
ret = getFormattedTextFast(bitmap, xDst, yDst, widthDst, heightDst, text, lineheight, ret = getFormattedTextFast(bitmap, xDst, yDst, widthDst, heightDst, text, lineheight,
newlineBreaks, explicitBreaksOnly) newlineBreaks, explicitBreaksOnly)
dummybitmap.dispose if dummybitmap dummybitmap.dispose if dummybitmap
return ret return ret
end end
@@ -1051,7 +1050,7 @@ def drawSingleFormattedChar(bitmap, ch)
end end
if ch[10] # underline if ch[10] # underline
bitmap.fill_rect(ch[1], ch[2] + ch[4] - 4 - [(ch[4] - bitmap.font.size) / 2, 0].max - 2, bitmap.fill_rect(ch[1], ch[2] + ch[4] - 4 - [(ch[4] - bitmap.font.size) / 2, 0].max - 2,
ch[3] - 2, 2, ch[8]) ch[3] - 2, 2, ch[8])
end end
if ch[11] # strikeout if ch[11] # strikeout
bitmap.fill_rect(ch[1], ch[2] + (ch[4] / 2) - 4, ch[3] - 2, 2, ch[8]) bitmap.fill_rect(ch[1], ch[2] + (ch[4] / 2) - 4, ch[3] - 2, 2, ch[8])
@@ -1088,7 +1087,7 @@ end
def drawTextEx(bitmap, x, y, width, numlines, text, baseColor, shadowColor) def drawTextEx(bitmap, x, y, width, numlines, text, baseColor, shadowColor)
normtext = getLineBrokenChunks(bitmap, text, width, nil, true) normtext = getLineBrokenChunks(bitmap, text, width, nil, true)
renderLineBrokenChunksWithShadow(bitmap, x, y, normtext, numlines * 32, renderLineBrokenChunksWithShadow(bitmap, x, y, normtext, numlines * 32,
baseColor, shadowColor) baseColor, shadowColor)
end 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)
@@ -713,9 +713,9 @@ def pbMessage(message, commands = nil, cmdIfCancel = 0, skin = nil, defaultCmd =
msgwindow = pbCreateMessageWindow(nil, skin) msgwindow = pbCreateMessageWindow(nil, skin)
if commands if commands
ret = pbMessageDisplay(msgwindow, message, true, ret = pbMessageDisplay(msgwindow, message, true,
proc { |msgwindow| proc { |msgwindow|
next Kernel.pbShowCommands(msgwindow, commands, cmdIfCancel, defaultCmd, &block) next Kernel.pbShowCommands(msgwindow, commands, cmdIfCancel, defaultCmd, &block)
}, &block) }, &block)
else else
pbMessageDisplay(msgwindow, message, &block) pbMessageDisplay(msgwindow, message, &block)
end end
@@ -735,9 +735,9 @@ end
def pbMessageChooseNumber(message, params, &block) def pbMessageChooseNumber(message, params, &block)
msgwindow = pbCreateMessageWindow(nil, params.messageSkin) msgwindow = pbCreateMessageWindow(nil, params.messageSkin)
ret = pbMessageDisplay(msgwindow, message, true, ret = pbMessageDisplay(msgwindow, message, true,
proc { |msgwindow| proc { |msgwindow|
next pbChooseNumber(msgwindow, params, &block) next pbChooseNumber(msgwindow, params, &block)
}, &block) }, &block)
pbDisposeMessageWindow(msgwindow) pbDisposeMessageWindow(msgwindow)
return ret return ret
end end
@@ -878,9 +878,9 @@ end
def pbMessageFreeText(message, currenttext, passwordbox, maxlength, width = 240, &block) def pbMessageFreeText(message, currenttext, passwordbox, maxlength, width = 240, &block)
msgwindow = pbCreateMessageWindow msgwindow = pbCreateMessageWindow
retval = pbMessageDisplay(msgwindow, message, true, retval = pbMessageDisplay(msgwindow, message, true,
proc { |msgwindow| proc { |msgwindow|
next pbFreeText(msgwindow, currenttext, passwordbox, maxlength, width, &block) next pbFreeText(msgwindow, currenttext, passwordbox, maxlength, width, &block)
}, &block) }, &block)
pbDisposeMessageWindow(msgwindow) pbDisposeMessageWindow(msgwindow)
return retval return retval
end end
@@ -173,7 +173,7 @@ class Window_TextEntry < SpriteWindow_Base
def refresh def refresh
self.contents = pbDoEnsureBitmap(self.contents, self.width - self.borderX, self.contents = pbDoEnsureBitmap(self.contents, self.width - self.borderX,
self.height - self.borderY) self.height - self.borderY)
bitmap = self.contents bitmap = self.contents
bitmap.clear bitmap.clear
x = 0 x = 0
@@ -333,7 +333,7 @@ class Window_MultilineTextEntry < SpriteWindow_Base
def getTextChars def getTextChars
if !@textchars if !@textchars
@textchars = getLineBrokenText(self.contents, @helper.text, @textchars = getLineBrokenText(self.contents, @helper.text,
self.contents.width, nil) self.contents.width, nil)
end end
return @textchars return @textchars
end end
@@ -503,7 +503,7 @@ class Window_MultilineTextEntry < SpriteWindow_Base
def refresh def refresh
newContents = pbDoEnsureBitmap(self.contents, self.width - self.borderX, newContents = pbDoEnsureBitmap(self.contents, self.width - self.borderX,
self.height - self.borderY) self.height - self.borderY)
@textchars = nil if self.contents != newContents @textchars = nil if self.contents != newContents
self.contents = newContents self.contents = newContents
bitmap = self.contents bitmap = self.contents
+1 -1
View File
@@ -30,7 +30,7 @@ def pbResolveAudioFile(str, volume = nil, pitch = nil)
if str.is_a?(RPG::AudioFile) if str.is_a?(RPG::AudioFile)
if volume || pitch if volume || pitch
return RPG::AudioFile.new(str.name, volume || str.volume || 100, return RPG::AudioFile.new(str.name, volume || str.volume || 100,
pitch || str.pitch || 100) pitch || str.pitch || 100)
else else
return str return str
end end
+2 -2
View File
@@ -415,10 +415,10 @@ module Transitions
@overworld_bitmap.height * inv_proportion) @overworld_bitmap.height * inv_proportion)
# Take all of buffer_original, shrink it and put it into buffer_temp # Take all of buffer_original, shrink it and put it into buffer_temp
@buffer_temp.stretch_blt(new_size_rect, @buffer_temp.stretch_blt(new_size_rect,
@buffer_original, Rect.new(0, 0, @overworld_bitmap.width, @overworld_bitmap.height)) @buffer_original, Rect.new(0, 0, @overworld_bitmap.width, @overworld_bitmap.height))
# Take shrunken area from buffer_temp and stretch it into buffer # Take shrunken area from buffer_temp and stretch it into buffer
@overworld_bitmap.stretch_blt(Rect.new(0, 0, @overworld_bitmap.width, @overworld_bitmap.height), @overworld_bitmap.stretch_blt(Rect.new(0, 0, @overworld_bitmap.width, @overworld_bitmap.height),
@buffer_temp, new_size_rect) @buffer_temp, new_size_rect)
if @timer >= @start_black_fade if @timer >= @start_black_fade
@overworld_sprite.opacity = 255 * (1 - (@timer - @start_black_fade) / (@duration - @start_black_fade)) @overworld_sprite.opacity = 255 * (1 - (@timer - @start_black_fade) / (@duration - @start_black_fade))
end end
@@ -28,7 +28,7 @@ module GameData
# Look for a graphic matching this combination's parameters # Look for a graphic matching this combination's parameters
try_species_text = try_species try_species_text = try_species
ret = pbResolveBitmap(sprintf("%s%s%s%s%s%s", path, try_subfolder, ret = pbResolveBitmap(sprintf("%s%s%s%s%s%s", path, try_subfolder,
try_species_text, try_form, try_gender, try_shadow)) try_species_text, try_form, try_gender, try_shadow))
return ret if ret return ret if ret
end end
return nil return nil
@@ -701,8 +701,8 @@ class Battle
@field.weather = newWeather @field.weather = newWeather
duration = (fixedDuration) ? 5 : -1 duration = (fixedDuration) ? 5 : -1
if duration > 0 && user && user.itemActive? if duration > 0 && user && user.itemActive?
duration = Battle::ItemEffects.triggerWeatherExtender(user.item, duration = Battle::ItemEffects.triggerWeatherExtender(user.item, @field.weather,
@field.weather, duration, user, self) duration, user, self)
end end
@field.weatherDuration = duration @field.weatherDuration = duration
weather_data = GameData::BattleWeather.try_get(@field.weather) weather_data = GameData::BattleWeather.try_get(@field.weather)
@@ -779,8 +779,8 @@ class Battle
@field.terrain = newTerrain @field.terrain = newTerrain
duration = (fixedDuration) ? 5 : -1 duration = (fixedDuration) ? 5 : -1
if duration > 0 && user && user.itemActive? if duration > 0 && user && user.itemActive?
duration = Battle::ItemEffects.triggerTerrainExtender(user.item, duration = Battle::ItemEffects.triggerTerrainExtender(user.item, newTerrain,
newTerrain, duration, user, self) duration, user, self)
end end
@field.terrainDuration = duration @field.terrainDuration = duration
terrain_data = GameData::BattleTerrain.try_get(@field.terrain) terrain_data = GameData::BattleTerrain.try_get(@field.terrain)
@@ -56,14 +56,14 @@ class Battle
# Compare the have values with the need values # Compare the have values with the need values
if requireds.length > sideCounts.length if requireds.length > sideCounts.length
raise _INTL("Error: def pbGetOwnerIndexFromBattlerIndex gives invalid owner index ({1} for battle type {2}v{3}, trainers {4}v{5})", raise _INTL("Error: def pbGetOwnerIndexFromBattlerIndex gives invalid owner index ({1} for battle type {2}v{3}, trainers {4}v{5})",
requireds.length - 1, @sideSizes[0], @sideSizes[1], side1counts.length, side2counts.length) requireds.length - 1, @sideSizes[0], @sideSizes[1], side1counts.length, side2counts.length)
end end
sideCounts.each_with_index do |_count, i| sideCounts.each_with_index do |_count, i|
if !requireds[i] || requireds[i] == 0 if !requireds[i] || requireds[i] == 0
raise _INTL("Player-side trainer {1} has no battler position for their Pokémon to go (trying {2}v{3} battle)", raise _INTL("Player-side trainer {1} has no battler position for their Pokémon to go (trying {2}v{3} battle)",
i + 1, @sideSizes[0], @sideSizes[1]) if side == 0 i + 1, @sideSizes[0], @sideSizes[1]) if side == 0
raise _INTL("Opposing trainer {1} has no battler position for their Pokémon to go (trying {2}v{3} battle)", raise _INTL("Opposing trainer {1} has no battler position for their Pokémon to go (trying {2}v{3} battle)",
i + 1, @sideSizes[0], @sideSizes[1]) if side == 1 i + 1, @sideSizes[0], @sideSizes[1]) if side == 1
end end
next if requireds[i] <= sideCounts[i] # Trainer has enough Pokémon to fill their positions next if requireds[i] <= sideCounts[i] # Trainer has enough Pokémon to fill their positions
if requireds[i] == 1 if requireds[i] == 1
@@ -166,10 +166,10 @@ class Battle
pbDisplayPaused(_INTL("Oh! A wild {1} appeared!", foeParty[0].name)) pbDisplayPaused(_INTL("Oh! A wild {1} appeared!", foeParty[0].name))
when 2 when 2
pbDisplayPaused(_INTL("Oh! A wild {1} and {2} appeared!", foeParty[0].name, pbDisplayPaused(_INTL("Oh! A wild {1} and {2} appeared!", foeParty[0].name,
foeParty[1].name)) foeParty[1].name))
when 3 when 3
pbDisplayPaused(_INTL("Oh! A wild {1}, {2} and {3} appeared!", foeParty[0].name, pbDisplayPaused(_INTL("Oh! A wild {1}, {2} and {3} appeared!", foeParty[0].name,
foeParty[1].name, foeParty[2].name)) foeParty[1].name, foeParty[2].name))
end end
else # Trainer battle else # Trainer battle
case @opponent.length case @opponent.length
@@ -177,10 +177,10 @@ class Battle
pbDisplayPaused(_INTL("You are challenged by {1}!", @opponent[0].full_name)) pbDisplayPaused(_INTL("You are challenged by {1}!", @opponent[0].full_name))
when 2 when 2
pbDisplayPaused(_INTL("You are challenged by {1} and {2}!", @opponent[0].full_name, pbDisplayPaused(_INTL("You are challenged by {1} and {2}!", @opponent[0].full_name,
@opponent[1].full_name)) @opponent[1].full_name))
when 3 when 3
pbDisplayPaused(_INTL("You are challenged by {1}, {2} and {3}!", pbDisplayPaused(_INTL("You are challenged by {1}, {2} and {3}!",
@opponent[0].full_name, @opponent[1].full_name, @opponent[2].full_name)) @opponent[0].full_name, @opponent[1].full_name, @opponent[2].full_name))
end end
end end
# Send out Pokémon (opposing trainers first) # Send out Pokémon (opposing trainers first)
@@ -199,10 +199,10 @@ class Battle
msg += _INTL("{1} sent out {2}!", t.full_name, @battlers[sent[0]].name) msg += _INTL("{1} sent out {2}!", t.full_name, @battlers[sent[0]].name)
when 2 when 2
msg += _INTL("{1} sent out {2} and {3}!", t.full_name, msg += _INTL("{1} sent out {2} and {3}!", t.full_name,
@battlers[sent[0]].name, @battlers[sent[1]].name) @battlers[sent[0]].name, @battlers[sent[1]].name)
when 3 when 3
msg += _INTL("{1} sent out {2}, {3} and {4}!", t.full_name, msg += _INTL("{1} sent out {2}, {3} and {4}!", t.full_name,
@battlers[sent[0]].name, @battlers[sent[1]].name, @battlers[sent[2]].name) @battlers[sent[0]].name, @battlers[sent[1]].name, @battlers[sent[2]].name)
end end
toSendOut.concat(sent) toSendOut.concat(sent)
end end
@@ -217,7 +217,7 @@ class Battle
msg += _INTL("Go! {1} and {2}!", @battlers[sent[0]].name, @battlers[sent[1]].name) msg += _INTL("Go! {1} and {2}!", @battlers[sent[0]].name, @battlers[sent[1]].name)
when 3 when 3
msg += _INTL("Go! {1}, {2} and {3}!", @battlers[sent[0]].name, msg += _INTL("Go! {1}, {2} and {3}!", @battlers[sent[0]].name,
@battlers[sent[1]].name, @battlers[sent[2]].name) @battlers[sent[1]].name, @battlers[sent[2]].name)
end end
toSendOut.concat(sent) toSendOut.concat(sent)
end end
@@ -403,10 +403,10 @@ class Battle
pbDisplayPaused(_INTL("You defeated {1}!", @opponent[0].full_name)) pbDisplayPaused(_INTL("You defeated {1}!", @opponent[0].full_name))
when 2 when 2
pbDisplayPaused(_INTL("You defeated {1} and {2}!", @opponent[0].full_name, pbDisplayPaused(_INTL("You defeated {1} and {2}!", @opponent[0].full_name,
@opponent[1].full_name)) @opponent[1].full_name))
when 3 when 3
pbDisplayPaused(_INTL("You defeated {1}, {2} and {3}!", @opponent[0].full_name, pbDisplayPaused(_INTL("You defeated {1}, {2} and {3}!", @opponent[0].full_name,
@opponent[1].full_name, @opponent[2].full_name)) @opponent[1].full_name, @opponent[2].full_name))
end end
@opponent.each_with_index do |_t, i| @opponent.each_with_index do |_t, i|
@scene.pbShowOpponent(i) @scene.pbShowOpponent(i)
@@ -431,10 +431,10 @@ class Battle
pbDisplayPaused(_INTL("You lost against {1}!", @opponent[0].full_name)) pbDisplayPaused(_INTL("You lost against {1}!", @opponent[0].full_name))
when 2 when 2
pbDisplayPaused(_INTL("You lost against {1} and {2}!", pbDisplayPaused(_INTL("You lost against {1} and {2}!",
@opponent[0].full_name, @opponent[1].full_name)) @opponent[0].full_name, @opponent[1].full_name))
when 3 when 3
pbDisplayPaused(_INTL("You lost against {1}, {2} and {3}!", pbDisplayPaused(_INTL("You lost against {1}, {2} and {3}!",
@opponent[0].full_name, @opponent[1].full_name, @opponent[2].full_name)) @opponent[0].full_name, @opponent[1].full_name, @opponent[2].full_name))
end end
end end
# Lose money from losing a battle # Lose money from losing a battle
@@ -174,7 +174,7 @@ class Battle
if newLevel < curLevel if newLevel < curLevel
debugInfo = "Levels: #{curLevel}->#{newLevel} | Exp: #{pkmn.exp}->#{expFinal} | gain: #{expGained}" debugInfo = "Levels: #{curLevel}->#{newLevel} | Exp: #{pkmn.exp}->#{expFinal} | gain: #{expGained}"
raise _INTL("{1}'s new level is less than its\r\ncurrent level, which shouldn't happen.\r\n[Debug: {2}]", raise _INTL("{1}'s new level is less than its\r\ncurrent level, which shouldn't happen.\r\n[Debug: {2}]",
pkmn.name, debugInfo) pkmn.name, debugInfo)
end end
# Give Exp # Give Exp
if pkmn.shadowPokemon? if pkmn.shadowPokemon?
@@ -219,7 +219,7 @@ class Battle
@scene.pbRefreshOne(battler.index) if battler @scene.pbRefreshOne(battler.index) if battler
pbDisplayPaused(_INTL("{1} grew to Lv. {2}!", pkmn.name, curLevel)) pbDisplayPaused(_INTL("{1} grew to Lv. {2}!", pkmn.name, curLevel))
@scene.pbLevelUp(pkmn, battler, oldTotalHP, oldAttack, oldDefense, @scene.pbLevelUp(pkmn, battler, oldTotalHP, oldAttack, oldDefense,
oldSpAtk, oldSpDef, oldSpeed) oldSpAtk, oldSpDef, oldSpeed)
# Learn all moves learned at this level # Learn all moves learned at this level
moveList = pkmn.getMoveList moveList = pkmn.getMoveList
moveList.each { |m| pbLearnMove(idxParty, m[1]) if m[0] == curLevel } moveList.each { |m| pbLearnMove(idxParty, m[1]) if m[0] == curLevel }
@@ -249,7 +249,7 @@ class Battle
end end
# Pokémon already knows the maximum number of moves; try to forget one to learn the new move # Pokémon already knows the maximum number of moves; try to forget one to learn the new move
pbDisplayPaused(_INTL("{1} wants to learn {2}, but it already knows {3} moves.", pbDisplayPaused(_INTL("{1} wants to learn {2}, but it already knows {3} moves.",
pkmnName, moveName, pkmn.numMoves.to_word)) pkmnName, moveName, pkmn.numMoves.to_word))
if pbDisplayConfirm(_INTL("Should {1} forget a move to learn {2}?", pkmnName, moveName)) if pbDisplayConfirm(_INTL("Should {1} forget a move to learn {2}?", pkmnName, moveName))
loop do loop do
forgetMove = @scene.pbForgetMove(pkmn, newMove) forgetMove = @scene.pbForgetMove(pkmn, newMove)
@@ -19,18 +19,16 @@ class Battle
if partyScene if partyScene
owner = pbGetOwnerFromPartyIndex(idxBattler, idxParty) owner = pbGetOwnerFromPartyIndex(idxBattler, idxParty)
partyScene.pbDisplay(_INTL("You can't switch {1}'s Pokémon with one of yours!", partyScene.pbDisplay(_INTL("You can't switch {1}'s Pokémon with one of yours!",
owner.name)) owner.name))
end end
return false return false
end end
if party[idxParty].fainted? if party[idxParty].fainted?
partyScene.pbDisplay(_INTL("{1} has no energy left to battle!", partyScene.pbDisplay(_INTL("{1} has no energy left to battle!", party[idxParty].name)) if partyScene
party[idxParty].name)) if partyScene
return false return false
end end
if pbFindBattler(idxParty, idxBattler) if pbFindBattler(idxParty, idxBattler)
partyScene.pbDisplay(_INTL("{1} is already in battle!", partyScene.pbDisplay(_INTL("{1} is already in battle!", party[idxParty].name)) if partyScene
party[idxParty].name)) if partyScene
return false return false
end end
return true return true
@@ -48,7 +46,7 @@ class Battle
allSameSideBattlers(idxBattler).each do |b| allSameSideBattlers(idxBattler).each do |b|
next if choices[b.index][0] != :SwitchOut || choices[b.index][1] != idxParty next if choices[b.index][0] != :SwitchOut || choices[b.index][1] != idxParty
partyScene.pbDisplay(_INTL("{1} has already been selected.", partyScene.pbDisplay(_INTL("{1} has already been selected.",
pbParty(idxBattler)[idxParty].name)) if partyScene pbParty(idxBattler)[idxParty].name)) if partyScene
return false return false
end end
# Check whether battler can switch out # Check whether battler can switch out
@@ -77,7 +75,7 @@ class Battle
next if !b.abilityActive? next if !b.abilityActive?
if Battle::AbilityEffects.triggerTrappingByTarget(b.ability, battler, b, self) if Battle::AbilityEffects.triggerTrappingByTarget(b.ability, battler, b, self)
partyScene.pbDisplay(_INTL("{1}'s {2} prevents switching!", partyScene.pbDisplay(_INTL("{1}'s {2} prevents switching!",
b.pbThis, b.abilityName)) if partyScene b.pbThis, b.abilityName)) if partyScene
return false return false
end end
end end
@@ -85,7 +83,7 @@ class Battle
next if !b.itemActive? next if !b.itemActive?
if Battle::ItemEffects.triggerTrappingByTarget(b.item, battler, b, self) if Battle::ItemEffects.triggerTrappingByTarget(b.item, battler, b, self)
partyScene.pbDisplay(_INTL("{1}'s {2} prevents switching!", partyScene.pbDisplay(_INTL("{1}'s {2} prevents switching!",
b.pbThis, b.itemName)) if partyScene b.pbThis, b.itemName)) if partyScene
return false return false
end end
end end
@@ -172,7 +170,7 @@ class Battle
idxPartyForName = new_index if new_index >= 0 && new_index != idxPartyNew idxPartyForName = new_index if new_index >= 0 && new_index != idxPartyNew
end end
if pbDisplayConfirm(_INTL("{1} is about to send in {2}. Will you switch your Pokémon?", if pbDisplayConfirm(_INTL("{1} is about to send in {2}. Will you switch your Pokémon?",
opponent.full_name, enemyParty[idxPartyForName].name)) opponent.full_name, enemyParty[idxPartyForName].name))
idxPlayerPartyNew = pbSwitchInBetween(0, false, true) idxPlayerPartyNew = pbSwitchInBetween(0, false, true)
if idxPlayerPartyNew >= 0 if idxPlayerPartyNew >= 0
pbMessageOnRecall(@battlers[0]) pbMessageOnRecall(@battlers[0])
@@ -10,7 +10,7 @@ class Battle
# Embargo # Embargo
if battler && battler.effects[PBEffects::Embargo] > 0 if battler && battler.effects[PBEffects::Embargo] > 0
scene.pbDisplay(_INTL("Embargo's effect prevents the item's use on {1}!", scene.pbDisplay(_INTL("Embargo's effect prevents the item's use on {1}!",
battler.pbThis(true))) if showMessages battler.pbThis(true))) if showMessages
return false return false
end end
return true return true
@@ -140,7 +140,7 @@ class Battle
pbDisplay(_INTL("{1}'s fervent wish has reached {2}!", trainerName, battler.pbThis)) pbDisplay(_INTL("{1}'s fervent wish has reached {2}!", trainerName, battler.pbThis))
else else
pbDisplay(_INTL("{1}'s {2} is reacting to {3}'s {4}!", pbDisplay(_INTL("{1}'s {2} is reacting to {3}'s {4}!",
battler.pbThis, battler.itemName, trainerName, pbGetMegaRingName(idxBattler))) battler.pbThis, battler.itemName, trainerName, pbGetMegaRingName(idxBattler)))
end end
pbCommonAnimation("MegaEvolution", battler) pbCommonAnimation("MegaEvolution", battler)
battler.pokemon.makeMega battler.pokemon.makeMega
@@ -128,8 +128,8 @@ class Battle
next false next false
end end
next false if !pkmn next false if !pkmn
next false if !ItemHandlers.triggerCanUseInBattle(item, next false if !ItemHandlers.triggerCanUseInBattle(item, pkmn, battler, idxMove,
pkmn, battler, idxMove, firstAction, self, itemScene) firstAction, self, itemScene)
next false if !pbRegisterItem(idxBattler, item, idxPkmn, idxMove) next false if !pbRegisterItem(idxBattler, item, idxPkmn, idxMove)
ret = true ret = true
next true next true
@@ -231,7 +231,7 @@ class Battle
next if !moveUser # User is fainted next if !moveUser # User is fainted
move = pos.effects[PBEffects::FutureSightMove] move = pos.effects[PBEffects::FutureSightMove]
pbDisplay(_INTL("{1} took the {2} attack!", @battlers[idxPos].pbThis, pbDisplay(_INTL("{1} took the {2} attack!", @battlers[idxPos].pbThis,
GameData::Move.get(move).name)) GameData::Move.get(move).name))
# NOTE: Future Sight failing against the target here doesn't count towards # NOTE: Future Sight failing against the target here doesn't count towards
# Stomping Tantrum. # Stomping Tantrum.
userLastMoveFailed = moveUser.lastMoveFailed userLastMoveFailed = moveUser.lastMoveFailed
@@ -332,7 +332,7 @@ class Battle
pbCommonAnimation("LeechSeed", recipient, b) pbCommonAnimation("LeechSeed", recipient, b)
b.pbTakeEffectDamage(b.totalhp / 8) { |hp_lost| b.pbTakeEffectDamage(b.totalhp / 8) { |hp_lost|
recipient.pbRecoverHPFromDrain(hp_lost, b, recipient.pbRecoverHPFromDrain(hp_lost, b,
_INTL("{1}'s health is sapped by Leech Seed!", b.pbThis)) _INTL("{1}'s health is sapped by Leech Seed!", b.pbThis))
recipient.pbAbilitiesOnDamageTaken recipient.pbAbilitiesOnDamageTaken
} }
recipient.pbFaint if recipient.fainted? recipient.pbFaint if recipient.fainted?
@@ -519,53 +519,53 @@ class Battle
for side in 0...2 for side in 0...2
# Reflect # Reflect
pbEORCountDownSideEffect(side, PBEffects::Reflect, pbEORCountDownSideEffect(side, PBEffects::Reflect,
_INTL("{1}'s Reflect wore off!", @battlers[side].pbTeam)) _INTL("{1}'s Reflect wore off!", @battlers[side].pbTeam))
# Light Screen # Light Screen
pbEORCountDownSideEffect(side, PBEffects::LightScreen, pbEORCountDownSideEffect(side, PBEffects::LightScreen,
_INTL("{1}'s Light Screen wore off!", @battlers[side].pbTeam)) _INTL("{1}'s Light Screen wore off!", @battlers[side].pbTeam))
# Safeguard # Safeguard
pbEORCountDownSideEffect(side, PBEffects::Safeguard, pbEORCountDownSideEffect(side, PBEffects::Safeguard,
_INTL("{1} is no longer protected by Safeguard!", @battlers[side].pbTeam)) _INTL("{1} is no longer protected by Safeguard!", @battlers[side].pbTeam))
# Mist # Mist
pbEORCountDownSideEffect(side, PBEffects::Mist, pbEORCountDownSideEffect(side, PBEffects::Mist,
_INTL("{1} is no longer protected by mist!", @battlers[side].pbTeam)) _INTL("{1} is no longer protected by mist!", @battlers[side].pbTeam))
# Tailwind # Tailwind
pbEORCountDownSideEffect(side, PBEffects::Tailwind, pbEORCountDownSideEffect(side, PBEffects::Tailwind,
_INTL("{1}'s Tailwind petered out!", @battlers[side].pbTeam)) _INTL("{1}'s Tailwind petered out!", @battlers[side].pbTeam))
# Lucky Chant # Lucky Chant
pbEORCountDownSideEffect(side, PBEffects::LuckyChant, pbEORCountDownSideEffect(side, PBEffects::LuckyChant,
_INTL("{1}'s Lucky Chant wore off!", @battlers[side].pbTeam)) _INTL("{1}'s Lucky Chant wore off!", @battlers[side].pbTeam))
# Pledge Rainbow # Pledge Rainbow
pbEORCountDownSideEffect(side, PBEffects::Rainbow, pbEORCountDownSideEffect(side, PBEffects::Rainbow,
_INTL("The rainbow on {1}'s side disappeared!", @battlers[side].pbTeam(true))) _INTL("The rainbow on {1}'s side disappeared!", @battlers[side].pbTeam(true)))
# Pledge Sea of Fire # Pledge Sea of Fire
pbEORCountDownSideEffect(side, PBEffects::SeaOfFire, pbEORCountDownSideEffect(side, PBEffects::SeaOfFire,
_INTL("The sea of fire around {1} disappeared!", @battlers[side].pbTeam(true))) _INTL("The sea of fire around {1} disappeared!", @battlers[side].pbTeam(true)))
# Pledge Swamp # Pledge Swamp
pbEORCountDownSideEffect(side, PBEffects::Swamp, pbEORCountDownSideEffect(side, PBEffects::Swamp,
_INTL("The swamp around {1} disappeared!", @battlers[side].pbTeam(true))) _INTL("The swamp around {1} disappeared!", @battlers[side].pbTeam(true)))
# Aurora Veil # Aurora Veil
pbEORCountDownSideEffect(side, PBEffects::AuroraVeil, pbEORCountDownSideEffect(side, PBEffects::AuroraVeil,
_INTL("{1}'s Aurora Veil wore off!", @battlers[side].pbTeam(true))) _INTL("{1}'s Aurora Veil wore off!", @battlers[side].pbTeam(true)))
end end
# Trick Room # Trick Room
pbEORCountDownFieldEffect(PBEffects::TrickRoom, pbEORCountDownFieldEffect(PBEffects::TrickRoom,
_INTL("The twisted dimensions returned to normal!")) _INTL("The twisted dimensions returned to normal!"))
# Gravity # Gravity
pbEORCountDownFieldEffect(PBEffects::Gravity, pbEORCountDownFieldEffect(PBEffects::Gravity,
_INTL("Gravity returned to normal!")) _INTL("Gravity returned to normal!"))
# Water Sport # Water Sport
pbEORCountDownFieldEffect(PBEffects::WaterSportField, pbEORCountDownFieldEffect(PBEffects::WaterSportField,
_INTL("The effects of Water Sport have faded.")) _INTL("The effects of Water Sport have faded."))
# Mud Sport # Mud Sport
pbEORCountDownFieldEffect(PBEffects::MudSportField, pbEORCountDownFieldEffect(PBEffects::MudSportField,
_INTL("The effects of Mud Sport have faded.")) _INTL("The effects of Mud Sport have faded."))
# Wonder Room # Wonder Room
pbEORCountDownFieldEffect(PBEffects::WonderRoom, pbEORCountDownFieldEffect(PBEffects::WonderRoom,
_INTL("Wonder Room wore off, and Defense and Sp. Def stats returned to normal!")) _INTL("Wonder Room wore off, and Defense and Sp. Def stats returned to normal!"))
# Magic Room # Magic Room
pbEORCountDownFieldEffect(PBEffects::MagicRoom, pbEORCountDownFieldEffect(PBEffects::MagicRoom,
_INTL("Magic Room wore off, and held items' effects returned to normal!")) _INTL("Magic Room wore off, and held items' effects returned to normal!"))
# End of terrains # End of terrains
pbEORTerrain pbEORTerrain
priority.each do |b| priority.each do |b|
@@ -62,7 +62,7 @@ class Battle::Battler
when :Electric when :Electric
if newStatus == :SLEEP if newStatus == :SLEEP
@battle.pbDisplay(_INTL("{1} surrounds itself with electrified terrain!", @battle.pbDisplay(_INTL("{1} surrounds itself with electrified terrain!",
pbThis(true))) if showMessages pbThis(true))) if showMessages
return false return false
end end
when :Misty when :Misty
@@ -133,19 +133,19 @@ class Battle::Battler
case newStatus case newStatus
when :SLEEP when :SLEEP
msg = _INTL("{1} stays awake because of {2}'s {3}!", msg = _INTL("{1} stays awake because of {2}'s {3}!",
pbThis, immAlly.pbThis(true), immAlly.abilityName) pbThis, immAlly.pbThis(true), immAlly.abilityName)
when :POISON when :POISON
msg = _INTL("{1} cannot be poisoned because of {2}'s {3}!", msg = _INTL("{1} cannot be poisoned because of {2}'s {3}!",
pbThis, immAlly.pbThis(true), immAlly.abilityName) pbThis, immAlly.pbThis(true), immAlly.abilityName)
when :BURN when :BURN
msg = _INTL("{1} cannot be burned because of {2}'s {3}!", msg = _INTL("{1} cannot be burned because of {2}'s {3}!",
pbThis, immAlly.pbThis(true), immAlly.abilityName) pbThis, immAlly.pbThis(true), immAlly.abilityName)
when :PARALYSIS when :PARALYSIS
msg = _INTL("{1} cannot be paralyzed because of {2}'s {3}!", msg = _INTL("{1} cannot be paralyzed because of {2}'s {3}!",
pbThis, immAlly.pbThis(true), immAlly.abilityName) pbThis, immAlly.pbThis(true), immAlly.abilityName)
when :FROZEN when :FROZEN
msg = _INTL("{1} cannot be frozen solid because of {2}'s {3}!", msg = _INTL("{1} cannot be frozen solid because of {2}'s {3}!",
pbThis, immAlly.pbThis(true), immAlly.abilityName) pbThis, immAlly.pbThis(true), immAlly.abilityName)
end end
else else
case newStatus case newStatus
@@ -15,7 +15,7 @@ class Battle::Battler
# Check the stat stage # Check the stat stage
if statStageAtMax?(stat) if statStageAtMax?(stat)
@battle.pbDisplay(_INTL("{1}'s {2} won't go any higher!", @battle.pbDisplay(_INTL("{1}'s {2} won't go any higher!",
pbThis, GameData::Stat.get(stat).name)) if showFailMsg pbThis, GameData::Stat.get(stat).name)) if showFailMsg
return false return false
end end
return true return true
@@ -142,22 +142,25 @@ class Battle::Battler
end end
if abilityActive? if abilityActive?
return false if !@battle.moldBreaker && Battle::AbilityEffects.triggerStatLossImmunity( return false if !@battle.moldBreaker && Battle::AbilityEffects.triggerStatLossImmunity(
self.ability, self, stat, @battle, showFailMsg) self.ability, self, stat, @battle, showFailMsg
)
return false if Battle::AbilityEffects.triggerStatLossImmunityNonIgnorable( return false if Battle::AbilityEffects.triggerStatLossImmunityNonIgnorable(
self.ability, self, stat, @battle, showFailMsg) self.ability, self, stat, @battle, showFailMsg
)
end end
if !@battle.moldBreaker if !@battle.moldBreaker
allAllies.each do |b| allAllies.each do |b|
next if !b.abilityActive? next if !b.abilityActive?
return false if Battle::AbilityEffects.triggerStatLossImmunityFromAlly( return false if Battle::AbilityEffects.triggerStatLossImmunityFromAlly(
b.ability, b, self, stat, @battle, showFailMsg) b.ability, b, self, stat, @battle, showFailMsg
)
end end
end end
end end
# Check the stat stage # Check the stat stage
if statStageAtMin?(stat) if statStageAtMin?(stat)
@battle.pbDisplay(_INTL("{1}'s {2} won't go any lower!", @battle.pbDisplay(_INTL("{1}'s {2} won't go any lower!",
pbThis, GameData::Stat.get(stat).name)) if showFailMsg pbThis, GameData::Stat.get(stat).name)) if showFailMsg
return false return false
end end
return true return true
@@ -298,7 +301,7 @@ class Battle::Battler
@battle.pbDisplay(_INTL("{1} is protected by its substitute!", pbThis)) @battle.pbDisplay(_INTL("{1} is protected by its substitute!", pbThis))
else else
@battle.pbDisplay(_INTL("{1}'s substitute protected it from {2}'s {3}!", @battle.pbDisplay(_INTL("{1}'s substitute protected it from {2}'s {3}!",
pbThis, user.pbThis(true), user.abilityName)) pbThis, user.pbThis(true), user.abilityName))
end end
return false return false
end end
@@ -308,7 +311,7 @@ class Battle::Battler
@battle.pbDisplay(_INTL("{1}'s {2} cannot be lowered!", pbThis, GameData::Stat.get(:ATTACK).name)) @battle.pbDisplay(_INTL("{1}'s {2} cannot be lowered!", pbThis, GameData::Stat.get(:ATTACK).name))
else else
@battle.pbDisplay(_INTL("{1}'s {2} prevents {3} loss!", pbThis, abilityName, @battle.pbDisplay(_INTL("{1}'s {2} prevents {3} loss!", pbThis, abilityName,
GameData::Stat.get(:ATTACK).name)) GameData::Stat.get(:ATTACK).name))
end end
@battle.pbHideAbilitySplash(self) @battle.pbHideAbilitySplash(self)
return false return false
@@ -322,14 +325,14 @@ class Battle::Battler
if !hasActiveAbility?(:CONTRARY) if !hasActiveAbility?(:CONTRARY)
if pbOwnSide.effects[PBEffects::Mist] > 0 if pbOwnSide.effects[PBEffects::Mist] > 0
@battle.pbDisplay(_INTL("{1} is protected from {2}'s {3} by Mist!", @battle.pbDisplay(_INTL("{1} is protected from {2}'s {3} by Mist!",
pbThis, user.pbThis(true), user.abilityName)) pbThis, user.pbThis(true), user.abilityName))
return false return false
end end
if abilityActive? if abilityActive?
if Battle::AbilityEffects.triggerStatLossImmunity(self.ability, self, :ATTACK, @battle, false) || if Battle::AbilityEffects.triggerStatLossImmunity(self.ability, self, :ATTACK, @battle, false) ||
Battle::AbilityEffects.triggerStatLossImmunityNonIgnorable(self.ability, self, :ATTACK, @battle, false) Battle::AbilityEffects.triggerStatLossImmunityNonIgnorable(self.ability, self, :ATTACK, @battle, false)
@battle.pbDisplay(_INTL("{1}'s {2} prevented {3}'s {4} from working!", @battle.pbDisplay(_INTL("{1}'s {2} prevented {3}'s {4} from working!",
pbThis, abilityName, user.pbThis(true), user.abilityName)) pbThis, abilityName, user.pbThis(true), user.abilityName))
return false return false
end end
end end
@@ -337,7 +340,7 @@ class Battle::Battler
next if !b.abilityActive? next if !b.abilityActive?
if Battle::AbilityEffects.triggerStatLossImmunityFromAlly(b.ability, b, self, :ATTACK, @battle, false) if Battle::AbilityEffects.triggerStatLossImmunityFromAlly(b.ability, b, self, :ATTACK, @battle, false)
@battle.pbDisplay(_INTL("{1} is protected from {2}'s {3} by {4}'s {5}!", @battle.pbDisplay(_INTL("{1} is protected from {2}'s {3} by {4}'s {5}!",
pbThis, user.pbThis(true), user.abilityName, b.pbThis(true), b.abilityName)) pbThis, user.pbThis(true), user.abilityName, b.pbThis(true), b.abilityName))
return false return false
end end
end end
@@ -124,7 +124,7 @@ class Battle::Battler
@battle.pbDisplay(_INTL("It doesn't affect {1}...", pbThis(true))) @battle.pbDisplay(_INTL("It doesn't affect {1}...", pbThis(true)))
else else
@battle.pbDisplay(_INTL("{1}'s {2} made {3} ineffective!", @battle.pbDisplay(_INTL("{1}'s {2} made {3} ineffective!",
pbThis, abilityName, move.name)) pbThis, abilityName, move.name))
end end
end end
@battle.pbHideAbilitySplash(self) @battle.pbHideAbilitySplash(self)
@@ -154,7 +154,7 @@ class Battle::Battler
@battle.pbDisplay(_INTL("It doesn't affect {1}...", pbThis(true))) @battle.pbDisplay(_INTL("It doesn't affect {1}...", pbThis(true)))
else else
@battle.pbDisplay(_INTL("{1}'s {2} made {3} ineffective!", @battle.pbDisplay(_INTL("{1}'s {2} made {3} ineffective!",
pbThis, abilityName, move.name)) pbThis, abilityName, move.name))
end end
end end
@battle.pbHideAbilitySplash(self) @battle.pbHideAbilitySplash(self)
@@ -249,10 +249,10 @@ class Battle::Battler
@battle.pbShowAbilitySplash(b) @battle.pbShowAbilitySplash(b)
if Battle::Scene::USE_ABILITY_SPLASH if Battle::Scene::USE_ABILITY_SPLASH
@battle.pbDisplay(_INTL("{1} shared its {2} with {3}!", @battle.pbDisplay(_INTL("{1} shared its {2} with {3}!",
b.pbThis, b.itemName, pbThis(true))) b.pbThis, b.itemName, pbThis(true)))
else else
@battle.pbDisplay(_INTL("{1}'s {2} let it share its {3} with {4}!", @battle.pbDisplay(_INTL("{1}'s {2} let it share its {3} with {4}!",
b.pbThis, b.abilityName, b.itemName, pbThis(true))) b.pbThis, b.abilityName, b.itemName, pbThis(true)))
end end
self.item = b.item self.item = b.item
b.item = nil b.item = nil
@@ -557,7 +557,7 @@ class Battle::Battler
@battle.pbHideAbilitySplash(nextUser) @battle.pbHideAbilitySplash(nextUser)
if !Battle::Scene::USE_ABILITY_SPLASH if !Battle::Scene::USE_ABILITY_SPLASH
@battle.pbDisplay(_INTL("{1} kept the dance going with {2}!", @battle.pbDisplay(_INTL("{1} kept the dance going with {2}!",
nextUser.pbThis, nextUser.abilityName)) nextUser.pbThis, nextUser.abilityName))
end end
nextUser.effects[PBEffects::Dancer] = true nextUser.effects[PBEffects::Dancer] = true
if nextUser.pbCanChooseMove?(move, false) if nextUser.pbCanChooseMove?(move, false)
@@ -641,7 +641,7 @@ class Battle::Battler
# actual removal of the item happens in def pbEffectsAfterMove. # actual removal of the item happens in def pbEffectsAfterMove.
@battle.pbCommonAnimation("UseItem", user) @battle.pbCommonAnimation("UseItem", user)
@battle.pbDisplay(_INTL("The {1} strengthened {2}'s power!", @battle.pbDisplay(_INTL("The {1} strengthened {2}'s power!",
GameData::Item.get(user.effects[PBEffects::GemConsumed]).name, move.name)) GameData::Item.get(user.effects[PBEffects::GemConsumed]).name, move.name))
end end
# Messages about missed target(s) (relevant for multi-target moves only) # Messages about missed target(s) (relevant for multi-target moves only)
if !move.pbRepeatHit? if !move.pbRepeatHit?
@@ -87,8 +87,7 @@ class Battle::Battler
# executing them) # executing them)
if hasActiveItem?(:ASSAULTVEST) && move.statusMove? && move.id != :MEFIRST && commandPhase if hasActiveItem?(:ASSAULTVEST) && move.statusMove? && move.id != :MEFIRST && commandPhase
if showMessages if showMessages
msg = _INTL("The effects of the {1} prevent status moves from being used!", msg = _INTL("The effects of the {1} prevent status moves from being used!", itemName)
itemName)
(commandPhase) ? @battle.pbDisplayPaused(msg) : @battle.pbDisplay(msg) (commandPhase) ? @battle.pbDisplayPaused(msg) : @battle.pbDisplay(msg)
end end
return false return false
@@ -277,7 +276,7 @@ class Battle::Battler
if @effects[PBEffects::Attract] >= 0 if @effects[PBEffects::Attract] >= 0
@battle.pbCommonAnimation("Attract", self) @battle.pbCommonAnimation("Attract", self)
@battle.pbDisplay(_INTL("{1} is in love with {2}!", pbThis, @battle.pbDisplay(_INTL("{1} is in love with {2}!", pbThis,
@battle.battlers[@effects[PBEffects::Attract]].pbThis(true))) @battle.battlers[@effects[PBEffects::Attract]].pbThis(true)))
if @battle.pbRandom(100) < 50 if @battle.pbRandom(100) < 50
@battle.pbDisplay(_INTL("{1} is immobilized by love!", pbThis)) @battle.pbDisplay(_INTL("{1} is immobilized by love!", pbThis))
@lastMoveFailed = true @lastMoveFailed = true
@@ -71,7 +71,7 @@ class Battle::Battler
if target.effects[PBEffects::Grudge] && target.fainted? if target.effects[PBEffects::Grudge] && target.fainted?
move.pp = 0 move.pp = 0
@battle.pbDisplay(_INTL("{1}'s {2} lost all of its PP due to the grudge!", @battle.pbDisplay(_INTL("{1}'s {2} lost all of its PP due to the grudge!",
user.pbThis, move.name)) user.pbThis, move.name))
end end
# Destiny Bond (recording that it should apply) # Destiny Bond (recording that it should apply)
if target.effects[PBEffects::DestinyBond] && target.fainted? if target.effects[PBEffects::DestinyBond] && target.fainted?
@@ -86,8 +86,8 @@ class Battle::Move
return false if @battle.moldBreaker return false if @battle.moldBreaker
ret = false ret = false
if target.abilityActive? if target.abilityActive?
ret = Battle::AbilityEffects.triggerMoveImmunity(target.ability, ret = Battle::AbilityEffects.triggerMoveImmunity(target.ability, user, target,
user, target, self, @calcType, @battle, show_message) self, @calcType, @battle, show_message)
end end
return ret return ret
end end
@@ -131,7 +131,7 @@ class Battle::Move
@battle.pbDisplay(_INTL("{1} is unaffected!", target.pbThis)) @battle.pbDisplay(_INTL("{1} is unaffected!", target.pbThis))
else else
@battle.pbDisplay(_INTL("{1} is unaffected because of its {2}!", @battle.pbDisplay(_INTL("{1} is unaffected because of its {2}!",
target.pbThis, target.abilityName)) target.pbThis, target.abilityName))
end end
@battle.pbHideAbilitySplash(target) @battle.pbHideAbilitySplash(target)
end end
@@ -145,7 +145,7 @@ class Battle::Move
@battle.pbDisplay(_INTL("{1} is unaffected!", target.pbThis)) @battle.pbDisplay(_INTL("{1} is unaffected!", target.pbThis))
else else
@battle.pbDisplay(_INTL("{1} is unaffected because of {2}'s {3}!", @battle.pbDisplay(_INTL("{1} is unaffected because of {2}'s {3}!",
target.pbThis, b.pbThis(true), b.abilityName)) target.pbThis, b.pbThis(true), b.abilityName))
end end
@battle.pbHideAbilitySplash(target) @battle.pbHideAbilitySplash(target)
end end
@@ -294,7 +294,7 @@ class Battle::Move
if target.damageState.affection_critical if target.damageState.affection_critical
if numTargets > 1 if numTargets > 1
@battle.pbDisplay(_INTL("{1} landed a critical hit on {2}, wishing to be praised!", @battle.pbDisplay(_INTL("{1} landed a critical hit on {2}, wishing to be praised!",
user.pbThis, target.pbThis(true))) user.pbThis, target.pbThis(true)))
else else
@battle.pbDisplay(_INTL("{1} landed a critical hit, wishing to be praised!", user.pbThis)) @battle.pbDisplay(_INTL("{1} landed a critical hit, wishing to be praised!", user.pbThis))
end end
@@ -131,26 +131,31 @@ class Battle::Move
def pbCalcAccuracyModifiers(user, target, modifiers) def pbCalcAccuracyModifiers(user, target, modifiers)
# Ability effects that alter accuracy calculation # Ability effects that alter accuracy calculation
if user.abilityActive? if user.abilityActive?
Battle::AbilityEffects.triggerAccuracyCalcFromUser(user.ability, Battle::AbilityEffects.triggerAccuracyCalcFromUser(
modifiers, user, target, self, @calcType) user.ability, modifiers, user, target, self, @calcType
)
end end
user.allAllies.each do |b| user.allAllies.each do |b|
next if !b.abilityActive? next if !b.abilityActive?
Battle::AbilityEffects.triggerAccuracyCalcFromAlly(b.ability, Battle::AbilityEffects.triggerAccuracyCalcFromAlly(
modifiers, user, target, self, @calcType) b.ability, modifiers, user, target, self, @calcType
)
end end
if target.abilityActive? && !@battle.moldBreaker if target.abilityActive? && !@battle.moldBreaker
Battle::AbilityEffects.triggerAccuracyCalcFromTarget(target.ability, Battle::AbilityEffects.triggerAccuracyCalcFromTarget(
modifiers, user, target, self, @calcType) target.ability, modifiers, user, target, self, @calcType
)
end end
# Item effects that alter accuracy calculation # Item effects that alter accuracy calculation
if user.itemActive? if user.itemActive?
Battle::ItemEffects.triggerAccuracyCalcFromUser(user.item, Battle::ItemEffects.triggerAccuracyCalcFromUser(
modifiers, user, target, self, @calcType) user.item, modifiers, user, target, self, @calcType
)
end end
if target.itemActive? if target.itemActive?
Battle::ItemEffects.triggerAccuracyCalcFromTarget(target.item, Battle::ItemEffects.triggerAccuracyCalcFromTarget(
modifiers, user, target, self, @calcType) target.item, modifiers, user, target, self, @calcType
)
end end
# Other effects, inc. ones that set accuracy_multiplier or evasion_stage to # Other effects, inc. ones that set accuracy_multiplier or evasion_stage to
# specific values # specific values
@@ -295,8 +300,9 @@ class Battle::Move
end end
# Ability effects that alter damage # Ability effects that alter damage
if user.abilityActive? if user.abilityActive?
Battle::AbilityEffects.triggerDamageCalcFromUser(user.ability, Battle::AbilityEffects.triggerDamageCalcFromUser(
user, target, self, multipliers, baseDmg, type) user.ability, user, target, self, multipliers, baseDmg, type
)
end end
if !@battle.moldBreaker if !@battle.moldBreaker
# NOTE: It's odd that the user's Mold Breaker prevents its partner's # NOTE: It's odd that the user's Mold Breaker prevents its partner's
@@ -304,29 +310,35 @@ class Battle::Move
# how it works. # how it works.
user.allAllies.each do |b| user.allAllies.each do |b|
next if !b.abilityActive? next if !b.abilityActive?
Battle::AbilityEffects.triggerDamageCalcFromAlly(b.ability, Battle::AbilityEffects.triggerDamageCalcFromAlly(
user, target, self, multipliers, baseDmg, type) b.ability, user, target, self, multipliers, baseDmg, type
)
end end
if target.abilityActive? if target.abilityActive?
Battle::AbilityEffects.triggerDamageCalcFromTarget(target.ability, Battle::AbilityEffects.triggerDamageCalcFromTarget(
user, target, self, multipliers, baseDmg, type) if !@battle.moldBreaker target.ability, user, target, self, multipliers, baseDmg, type
Battle::AbilityEffects.triggerDamageCalcFromTargetNonIgnorable(target.ability, )
user, target, self, multipliers, baseDmg, type) Battle::AbilityEffects.triggerDamageCalcFromTargetNonIgnorable(
target.ability, user, target, self, multipliers, baseDmg, type
)
end end
target.allAllies.each do |b| target.allAllies.each do |b|
next if !b.abilityActive? next if !b.abilityActive?
Battle::AbilityEffects.triggerDamageCalcFromTargetAlly(b.ability, Battle::AbilityEffects.triggerDamageCalcFromTargetAlly(
user, target, self, multipliers, baseDmg, type) b.ability, user, target, self, multipliers, baseDmg, type
)
end end
end end
# Item effects that alter damage # Item effects that alter damage
if user.itemActive? if user.itemActive?
Battle::ItemEffects.triggerDamageCalcFromUser(user.item, Battle::ItemEffects.triggerDamageCalcFromUser(
user, target, self, multipliers, baseDmg, type) user.item, user, target, self, multipliers, baseDmg, type
)
end end
if target.itemActive? if target.itemActive?
Battle::ItemEffects.triggerDamageCalcFromTarget(target.item, Battle::ItemEffects.triggerDamageCalcFromTarget(
user, target, self, multipliers, baseDmg, type) target.item, user, target, self, multipliers, baseDmg, type
)
end end
# Parental Bond's second attack # Parental Bond's second attack
if user.effects[PBEffects::ParentalBond] == 1 if user.effects[PBEffects::ParentalBond] == 1
@@ -256,7 +256,7 @@ class Battle::Move::TargetMultiStatDownMove < Battle::Move
for i in 0...@statDown.length / 2 for i in 0...@statDown.length / 2
next if !target.pbCanLowerStatStage?(@statDown[i * 2], user, self) next if !target.pbCanLowerStatStage?(@statDown[i * 2], user, self)
if target.pbLowerStatStage(@statDown[i * 2], @statDown[i * 2 + 1], user, if target.pbLowerStatStage(@statDown[i * 2], @statDown[i * 2 + 1], user,
showAnim, false, (showMirrorArmorSplash) ? 1 : 3) showAnim, false, (showMirrorArmorSplash) ? 1 : 3)
showAnim = false showAnim = false
end end
showMirrorArmorSplash = false showMirrorArmorSplash = false
@@ -567,7 +567,7 @@ class Battle::Move::PledgeMove < Battle::Move
user.effects[PBEffects::FirstPledge] = nil user.effects[PBEffects::FirstPledge] = nil
return if !@pledgeSetup return if !@pledgeSetup
@battle.pbDisplay(_INTL("{1} is waiting for {2}'s move...", @battle.pbDisplay(_INTL("{1} is waiting for {2}'s move...",
user.pbThis, @pledgeOtherUser.pbThis(true))) user.pbThis, @pledgeOtherUser.pbThis(true)))
@pledgeOtherUser.effects[PBEffects::FirstPledge] = @function @pledgeOtherUser.effects[PBEffects::FirstPledge] = @function
@pledgeOtherUser.effects[PBEffects::MoveNext] = true @pledgeOtherUser.effects[PBEffects::MoveNext] = true
user.lastMoveFailed = true # Treated as a failure for Stomping Tantrum user.lastMoveFailed = true # Treated as a failure for Stomping Tantrum
@@ -386,7 +386,7 @@ class Battle::Move::AddSpikesToFoeSide < Battle::Move
def pbEffectGeneral(user) def pbEffectGeneral(user)
user.pbOpposingSide.effects[PBEffects::Spikes] += 1 user.pbOpposingSide.effects[PBEffects::Spikes] += 1
@battle.pbDisplay(_INTL("Spikes were scattered all around {1}'s feet!", @battle.pbDisplay(_INTL("Spikes were scattered all around {1}'s feet!",
user.pbOpposingTeam(true))) user.pbOpposingTeam(true)))
end end
end end
@@ -408,7 +408,7 @@ class Battle::Move::AddToxicSpikesToFoeSide < Battle::Move
def pbEffectGeneral(user) def pbEffectGeneral(user)
user.pbOpposingSide.effects[PBEffects::ToxicSpikes] += 1 user.pbOpposingSide.effects[PBEffects::ToxicSpikes] += 1
@battle.pbDisplay(_INTL("Poison spikes were scattered all around {1}'s feet!", @battle.pbDisplay(_INTL("Poison spikes were scattered all around {1}'s feet!",
user.pbOpposingTeam(true))) user.pbOpposingTeam(true)))
end end
end end
@@ -429,7 +429,7 @@ class Battle::Move::AddStealthRocksToFoeSide < Battle::Move
def pbEffectGeneral(user) def pbEffectGeneral(user)
user.pbOpposingSide.effects[PBEffects::StealthRock] = true user.pbOpposingSide.effects[PBEffects::StealthRock] = true
@battle.pbDisplay(_INTL("Pointed stones float in the air around {1}!", @battle.pbDisplay(_INTL("Pointed stones float in the air around {1}!",
user.pbOpposingTeam(true))) user.pbOpposingTeam(true)))
end end
end end
@@ -450,7 +450,7 @@ class Battle::Move::AddStickyWebToFoeSide < Battle::Move
def pbEffectGeneral(user) def pbEffectGeneral(user)
user.pbOpposingSide.effects[PBEffects::StickyWeb] = true user.pbOpposingSide.effects[PBEffects::StickyWeb] = true
@battle.pbDisplay(_INTL("A sticky web has been laid out beneath {1}'s feet!", @battle.pbDisplay(_INTL("A sticky web has been laid out beneath {1}'s feet!",
user.pbOpposingTeam(true))) user.pbOpposingTeam(true)))
end end
end end
@@ -672,7 +672,7 @@ class Battle::Move::UserSwapsPositionsWithAlly < Battle::Move
idxB = @idxAlly idxB = @idxAlly
if @battle.pbSwapBattlers(idxA, idxB) if @battle.pbSwapBattlers(idxA, idxB)
@battle.pbDisplay(_INTL("{1} and {2} switched places!", @battle.pbDisplay(_INTL("{1} and {2} switched places!",
@battle.battlers[idxB].pbThis, @battle.battlers[idxA].pbThis(true))) @battle.battlers[idxB].pbThis, @battle.battlers[idxA].pbThis(true)))
[idxA, idxB].each { |idx| @battle.pbEffectsOnBattlerEnteringPosition(@battle.battlers[idx]) } [idxA, idxB].each { |idx| @battle.pbEffectsOnBattlerEnteringPosition(@battle.battlers[idx]) }
end end
end end
@@ -1386,7 +1386,7 @@ class Battle::Move::LowerPoisonedTargetAtkSpAtkSpd1 < Battle::Move
for i in 0...@statDown.length / 2 for i in 0...@statDown.length / 2
next if !target.pbCanLowerStatStage?(@statDown[i * 2], user, self) next if !target.pbCanLowerStatStage?(@statDown[i * 2], user, self)
if target.pbLowerStatStage(@statDown[i * 2], @statDown[i * 2 + 1], user, if target.pbLowerStatStage(@statDown[i * 2], @statDown[i * 2 + 1], user,
showAnim, false, (showMirrorArmorSplash) ? 1 : 3) showAnim, false, (showMirrorArmorSplash) ? 1 : 3)
showAnim = false showAnim = false
end end
showMirrorArmorSplash = false showMirrorArmorSplash = false
@@ -820,7 +820,7 @@ class Battle::Move::SetUserTypesToTargetTypes < Battle::Move
def pbEffectAgainstTarget(user, target) def pbEffectAgainstTarget(user, target)
user.pbChangeTypes(target) user.pbChangeTypes(target)
@battle.pbDisplay(_INTL("{1}'s type changed to match {2}'s!", @battle.pbDisplay(_INTL("{1}'s type changed to match {2}'s!",
user.pbThis, target.pbThis(true))) user.pbThis, target.pbThis(true)))
end end
end end
@@ -1067,7 +1067,7 @@ class Battle::Move::SetUserAbilityToTargetAbility < Battle::Move
user.ability = target.ability user.ability = target.ability
@battle.pbReplaceAbilitySplash(user) @battle.pbReplaceAbilitySplash(user)
@battle.pbDisplay(_INTL("{1} copied {2}'s {3}!", @battle.pbDisplay(_INTL("{1} copied {2}'s {3}!",
user.pbThis, target.pbThis(true), target.abilityName)) user.pbThis, target.pbThis(true), target.abilityName))
@battle.pbHideAbilitySplash(user) @battle.pbHideAbilitySplash(user)
user.pbOnLosingAbility(oldAbil) user.pbOnLosingAbility(oldAbil)
user.pbTriggerAbilityOnGainingIt user.pbTriggerAbilityOnGainingIt
@@ -1169,7 +1169,7 @@ class Battle::Move::UserTargetSwapAbilities < Battle::Move
@battle.pbDisplay(_INTL("{1} swapped Abilities with its target!", user.pbThis)) @battle.pbDisplay(_INTL("{1} swapped Abilities with its target!", user.pbThis))
else else
@battle.pbDisplay(_INTL("{1} swapped its {2} Ability with its target's {3} Ability!", @battle.pbDisplay(_INTL("{1} swapped its {2} Ability with its target's {3} Ability!",
user.pbThis, target.abilityName, user.abilityName)) user.pbThis, target.abilityName, user.abilityName))
end end
if user.opposes?(target) if user.opposes?(target)
@battle.pbHideAbilitySplash(user) @battle.pbHideAbilitySplash(user)
@@ -1359,7 +1359,7 @@ class Battle::Move::StartGravity < Battle::Move
showMessage = true showMessage = true
end end
@battle.pbDisplay(_INTL("{1} couldn't stay airborne because of gravity!", @battle.pbDisplay(_INTL("{1} couldn't stay airborne because of gravity!",
b.pbThis)) if showMessage b.pbThis)) if showMessage
end end
end end
end end
@@ -80,7 +80,7 @@ class Battle::Move::OHKO < Battle::Move::FixedDamageMove
@battle.pbDisplay(_INTL("But it failed to affect {1}!", target.pbThis(true))) @battle.pbDisplay(_INTL("But it failed to affect {1}!", target.pbThis(true)))
else else
@battle.pbDisplay(_INTL("But it failed to affect {1} because of its {2}!", @battle.pbDisplay(_INTL("But it failed to affect {1} because of its {2}!",
target.pbThis(true), target.abilityName)) target.pbThis(true), target.abilityName))
end end
@battle.pbHideAbilitySplash(target) @battle.pbHideAbilitySplash(target)
end end
@@ -149,12 +149,12 @@ class Battle::Move::DamageTargetAlly < Battle::Move
end end
if hitAlly.length == 2 if hitAlly.length == 2
@battle.pbDisplay(_INTL("The bursting flame hit {1} and {2}!", @battle.pbDisplay(_INTL("The bursting flame hit {1} and {2}!",
@battle.battlers[hitAlly[0][0]].pbThis(true), @battle.battlers[hitAlly[0][0]].pbThis(true),
@battle.battlers[hitAlly[1][0]].pbThis(true))) @battle.battlers[hitAlly[1][0]].pbThis(true)))
elsif hitAlly.length > 0 elsif hitAlly.length > 0
hitAlly.each do |b| hitAlly.each do |b|
@battle.pbDisplay(_INTL("The bursting flame hit {1}!", @battle.pbDisplay(_INTL("The bursting flame hit {1}!",
@battle.battlers[b[0]].pbThis(true))) @battle.battlers[b[0]].pbThis(true)))
end end
end end
hitAlly.each { |b| @battle.battlers[b[0]].pbItemHPHealCheck } hitAlly.each { |b| @battle.battlers[b[0]].pbItemHPHealCheck }
@@ -824,7 +824,7 @@ class Battle::Move::StartWeakenDamageAgainstUserSideIfHail < Battle::Move
user.pbOwnSide.effects[PBEffects::AuroraVeil] = 5 user.pbOwnSide.effects[PBEffects::AuroraVeil] = 5
user.pbOwnSide.effects[PBEffects::AuroraVeil] = 8 if user.hasActiveItem?(:LIGHTCLAY) user.pbOwnSide.effects[PBEffects::AuroraVeil] = 8 if user.hasActiveItem?(:LIGHTCLAY)
@battle.pbDisplay(_INTL("{1} made {2} stronger against physical and special moves!", @battle.pbDisplay(_INTL("{1} made {2} stronger against physical and special moves!",
@name, user.pbTeam(true))) @name, user.pbTeam(true)))
end end
end end
@@ -468,7 +468,7 @@ class Battle::Move::UserLosesHalfOfTotalHPExplosive < Battle::Move
@battle.pbDisplay(_INTL("{1} cannot use {2}!", user.pbThis, @name)) @battle.pbDisplay(_INTL("{1} cannot use {2}!", user.pbThis, @name))
else else
@battle.pbDisplay(_INTL("{1} cannot use {2} because of {3}'s {4}!", @battle.pbDisplay(_INTL("{1} cannot use {2} because of {3}'s {4}!",
user.pbThis, @name, bearer.pbThis(true), bearer.abilityName)) user.pbThis, @name, bearer.pbThis(true), bearer.abilityName))
end end
@battle.pbHideAbilitySplash(bearer) @battle.pbHideAbilitySplash(bearer)
return true return true
@@ -500,7 +500,7 @@ class Battle::Move::UserFaintsExplosive < Battle::Move
@battle.pbDisplay(_INTL("{1} cannot use {2}!", user.pbThis, @name)) @battle.pbDisplay(_INTL("{1} cannot use {2}!", user.pbThis, @name))
else else
@battle.pbDisplay(_INTL("{1} cannot use {2} because of {3}'s {4}!", @battle.pbDisplay(_INTL("{1} cannot use {2} because of {3}'s {4}!",
user.pbThis, @name, bearer.pbThis(true), bearer.abilityName)) user.pbThis, @name, bearer.pbThis(true), bearer.abilityName))
end end
@battle.pbHideAbilitySplash(bearer) @battle.pbHideAbilitySplash(bearer)
return true return true
@@ -98,7 +98,7 @@ class Battle::Move::UserTargetSwapItems < Battle::Move
@battle.pbDisplay(_INTL("But it failed to affect {1}!", target.pbThis(true))) @battle.pbDisplay(_INTL("But it failed to affect {1}!", target.pbThis(true)))
else else
@battle.pbDisplay(_INTL("But it failed to affect {1} because of its {2}!", @battle.pbDisplay(_INTL("But it failed to affect {1} because of its {2}!",
target.pbThis(true), target.abilityName)) target.pbThis(true), target.abilityName))
end end
@battle.pbHideAbilitySplash(target) @battle.pbHideAbilitySplash(target)
end end
@@ -223,7 +223,7 @@ class Battle::Move::CorrodeTargetItem < Battle::Move
@battle.pbDisplay(_INTL("{1} is unaffected!", target.pbThis)) @battle.pbDisplay(_INTL("{1} is unaffected!", target.pbThis))
else else
@battle.pbDisplay(_INTL("{1} is unaffected because of its {2}!", @battle.pbDisplay(_INTL("{1} is unaffected because of its {2}!",
target.pbThis(true), target.abilityName)) target.pbThis(true), target.abilityName))
end end
@battle.pbHideAbilitySplash(target) @battle.pbHideAbilitySplash(target)
end end
@@ -239,7 +239,7 @@ class Battle::Move::CorrodeTargetItem < Battle::Move
def pbEffectAgainstTarget(user, target) def pbEffectAgainstTarget(user, target)
@battle.corrosiveGas[target.index % 2][target.pokemonIndex] = true @battle.corrosiveGas[target.index % 2][target.pokemonIndex] = true
@battle.pbDisplay(_INTL("{1} corroded {2}'s {3}!", @battle.pbDisplay(_INTL("{1} corroded {2}'s {3}!",
user.pbThis, target.pbThis(true), target.itemName)) user.pbThis, target.pbThis(true), target.itemName))
end end
end end
@@ -521,7 +521,7 @@ class Battle::Move::UserAddStockpileRaiseDefSpDef1 < Battle::Move
def pbEffectGeneral(user) def pbEffectGeneral(user)
user.effects[PBEffects::Stockpile] += 1 user.effects[PBEffects::Stockpile] += 1
@battle.pbDisplay(_INTL("{1} stockpiled {2}!", @battle.pbDisplay(_INTL("{1} stockpiled {2}!",
user.pbThis, user.effects[PBEffects::Stockpile])) user.pbThis, user.effects[PBEffects::Stockpile]))
showAnim = true showAnim = true
if user.pbCanRaiseStatStage?(:DEFENSE, user, self) if user.pbCanRaiseStatStage?(:DEFENSE, user, self)
if user.pbRaiseStatStage(:DEFENSE, 1, user, showAnim) if user.pbRaiseStatStage(:DEFENSE, 1, user, showAnim)
@@ -37,7 +37,7 @@ class Battle::Move::SwitchOutUserStatusMove < Battle::Move
def pbEndOfMoveUsageEffect(user, targets, numHits, switchedBattlers) def pbEndOfMoveUsageEffect(user, targets, numHits, switchedBattlers)
return if user.wild? return if user.wild?
@battle.pbDisplay(_INTL("{1} went back to {2}!", user.pbThis, @battle.pbDisplay(_INTL("{1} went back to {2}!", user.pbThis,
@battle.pbGetOwnerName(user.index))) @battle.pbGetOwnerName(user.index)))
@battle.pbPursuit(user.index) @battle.pbPursuit(user.index)
return if user.fainted? return if user.fainted?
newPkmn = @battle.pbGetReplacementPokemonIndex(user.index) # Owner chooses newPkmn = @battle.pbGetReplacementPokemonIndex(user.index) # Owner chooses
@@ -71,7 +71,7 @@ class Battle::Move::SwitchOutUserDamagingMove < Battle::Move
return if targetSwitched return if targetSwitched
return if !@battle.pbCanChooseNonActive?(user.index) return if !@battle.pbCanChooseNonActive?(user.index)
@battle.pbDisplay(_INTL("{1} went back to {2}!", user.pbThis, @battle.pbDisplay(_INTL("{1} went back to {2}!", user.pbThis,
@battle.pbGetOwnerName(user.index))) @battle.pbGetOwnerName(user.index)))
@battle.pbPursuit(user.index) @battle.pbPursuit(user.index)
return if user.fainted? return if user.fainted?
newPkmn = @battle.pbGetReplacementPokemonIndex(user.index) # Owner chooses newPkmn = @battle.pbGetReplacementPokemonIndex(user.index) # Owner chooses
@@ -103,7 +103,7 @@ class Battle::Move::LowerTargetAtkSpAtk1SwitchOutUser < Battle::Move::TargetMult
return if switcher.fainted? || numHits == 0 return if switcher.fainted? || numHits == 0
return if !@battle.pbCanChooseNonActive?(switcher.index) return if !@battle.pbCanChooseNonActive?(switcher.index)
@battle.pbDisplay(_INTL("{1} went back to {2}!", switcher.pbThis, @battle.pbDisplay(_INTL("{1} went back to {2}!", switcher.pbThis,
@battle.pbGetOwnerName(switcher.index))) @battle.pbGetOwnerName(switcher.index)))
@battle.pbPursuit(switcher.index) @battle.pbPursuit(switcher.index)
return if switcher.fainted? return if switcher.fainted?
newPkmn = @battle.pbGetReplacementPokemonIndex(switcher.index) # Owner chooses newPkmn = @battle.pbGetReplacementPokemonIndex(switcher.index) # Owner chooses
@@ -673,7 +673,7 @@ class Battle::Move::LowerPPOfTargetLastMoveBy3 < Battle::Move
reduction = [3, last_move.pp].min reduction = [3, last_move.pp].min
target.pbSetPP(last_move, last_move.pp - reduction) target.pbSetPP(last_move, last_move.pp - reduction)
@battle.pbDisplay(_INTL("It reduced the PP of {1}'s {2} by {3}!", @battle.pbDisplay(_INTL("It reduced the PP of {1}'s {2} by {3}!",
target.pbThis(true), last_move.name, reduction)) target.pbThis(true), last_move.name, reduction))
end end
end end
@@ -698,7 +698,7 @@ class Battle::Move::LowerPPOfTargetLastMoveBy4 < Battle::Move
reduction = [4, last_move.pp].min reduction = [4, last_move.pp].min
target.pbSetPP(last_move, last_move.pp - reduction) target.pbSetPP(last_move, last_move.pp - reduction)
@battle.pbDisplay(_INTL("It reduced the PP of {1}'s {2} by {3}!", @battle.pbDisplay(_INTL("It reduced the PP of {1}'s {2} by {3}!",
target.pbThis(true), last_move.name, reduction)) target.pbThis(true), last_move.name, reduction))
end end
end end
@@ -733,7 +733,7 @@ class Battle::Move::DisableTargetLastMoveUsed < Battle::Move
target.effects[PBEffects::Disable] = 5 target.effects[PBEffects::Disable] = 5
target.effects[PBEffects::DisableMove] = target.lastRegularMoveUsed target.effects[PBEffects::DisableMove] = target.lastRegularMoveUsed
@battle.pbDisplay(_INTL("{1}'s {2} was disabled!", target.pbThis, @battle.pbDisplay(_INTL("{1}'s {2} was disabled!", target.pbThis,
GameData::Move.get(target.lastRegularMoveUsed).name)) GameData::Move.get(target.lastRegularMoveUsed).name))
target.pbItemStatusCureCheck target.pbItemStatusCureCheck
end end
end end
@@ -853,7 +853,7 @@ class Battle::Move::DisableTargetStatusMoves < Battle::Move
@battle.pbDisplay(_INTL("But it failed!")) @battle.pbDisplay(_INTL("But it failed!"))
else else
@battle.pbDisplay(_INTL("But it failed because of {1}'s {2}!", @battle.pbDisplay(_INTL("But it failed because of {1}'s {2}!",
target.pbThis(true), target.abilityName)) target.pbThis(true), target.abilityName))
end end
@battle.pbHideAbilitySplash(target) @battle.pbHideAbilitySplash(target)
end end
@@ -897,8 +897,10 @@ end
class Battle::Move::DisableTargetSoundMoves < Battle::Move class Battle::Move::DisableTargetSoundMoves < Battle::Move
def pbAdditionalEffect(user, target) def pbAdditionalEffect(user, target)
return if target.fainted? || target.damageState.substitute return if target.fainted? || target.damageState.substitute
@battle.pbDisplay(_INTL("The effects of {1} prevent {2} from using certain moves!", if target.effects[PBEffects::ThroatChop] == 0
@name, target.pbThis(true))) if target.effects[PBEffects::ThroatChop] == 0 @battle.pbDisplay(_INTL("The effects of {1} prevent {2} from using certain moves!",
@name, target.pbThis(true)))
end
target.effects[PBEffects::ThroatChop] = 3 target.effects[PBEffects::ThroatChop] = 3
end end
end end
@@ -28,11 +28,12 @@ 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/Pictures/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(
16, Graphics.height - 96 + 2, Graphics.width - 32, 96, @viewport) "", 16, Graphics.height - 96 + 2, Graphics.width - 32, 96, @viewport
)
msgWindow.z = 200 msgWindow.z = 200
msgWindow.opacity = 0 msgWindow.opacity = 0
msgWindow.baseColor = MESSAGE_BASE_COLOR msgWindow.baseColor = MESSAGE_BASE_COLOR
@@ -49,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
for side in 0...2 for side in 0...2
partyBar = pbAddSprite("partyBar_#{side}", 0, 0, partyBar = pbAddSprite("partyBar_#{side}", 0, 0,
"Graphics/Pictures/Battle/overlay_lineup", @viewport) "Graphics/Pictures/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
@@ -139,7 +140,7 @@ class Battle::Scene
for side in 0...2 for side in 0...2
baseX, baseY = Battle::Scene.pbBattlerPosition(side) baseX, baseY = Battle::Scene.pbBattlerPosition(side)
base = pbAddSprite("base_#{side}", baseX, baseY, base = pbAddSprite("base_#{side}", baseX, baseY,
(side == 0) ? playerBase : enemyBase, @viewport) (side == 0) ? playerBase : enemyBase, @viewport)
base.z = 1 base.z = 1
if base.bitmap if base.bitmap
base.ox = base.bitmap.width / 2 base.ox = base.bitmap.width / 2
@@ -200,10 +200,10 @@ class Battle::Scene
# Start Bag screen # Start Bag screen
itemScene = PokemonBag_Scene.new itemScene = PokemonBag_Scene.new
itemScene.pbStartScene($bag, true, itemScene.pbStartScene($bag, true,
proc { |item| proc { |item|
useType = GameData::Item.get(item).battle_use useType = GameData::Item.get(item).battle_use
next useType && useType > 0 next useType && useType > 0
}, false) }, false)
# Loop while in Bag screen # Loop while in Bag screen
wasTargeting = false wasTargeting = false
loop do loop do
@@ -58,8 +58,9 @@ class Battle::Scene
# Animates a party lineup appearing for the given side # Animates a party lineup appearing for the given side
#============================================================================= #=============================================================================
def pbShowPartyLineup(side, fullAnim = false) def pbShowPartyLineup(side, fullAnim = false)
@animations.push(Animation::LineupAppear.new(@sprites, @viewport, @animations.push(Animation::LineupAppear.new(
side, @battle.pbParty(side), @battle.pbPartyStarts(side), fullAnim)) @sprites, @viewport, side, @battle.pbParty(side), @battle.pbPartyStarts(side), fullAnim
))
if !fullAnim if !fullAnim
while inPartyAnimation? while inPartyAnimation?
pbUpdate pbUpdate
@@ -112,13 +113,15 @@ class Battle::Scene
pbChangePokemon(b[0], pkmn) pbChangePokemon(b[0], pkmn)
pbRefresh pbRefresh
if @battle.opposes?(b[0]) if @battle.opposes?(b[0])
sendOutAnim = Animation::PokeballTrainerSendOut.new(@sprites, @viewport, sendOutAnim = Animation::PokeballTrainerSendOut.new(
@battle.pbGetOwnerIndexFromBattlerIndex(b[0]) + 1, @sprites, @viewport, @battle.pbGetOwnerIndexFromBattlerIndex(b[0]) + 1,
@battle.battlers[b[0]], startBattle, i) @battle.battlers[b[0]], startBattle, i
)
else else
sendOutAnim = Animation::PokeballPlayerSendOut.new(@sprites, @viewport, sendOutAnim = Animation::PokeballPlayerSendOut.new(
@battle.pbGetOwnerIndexFromBattlerIndex(b[0]) + 1, @sprites, @viewport, @battle.pbGetOwnerIndexFromBattlerIndex(b[0]) + 1,
@battle.battlers[b[0]], startBattle, i) @battle.battlers[b[0]], startBattle, i
)
end end
dataBoxAnim = Animation::DataBoxAppear.new(@sprites, @viewport, b[0]) dataBoxAnim = Animation::DataBoxAppear.new(@sprites, @viewport, b[0])
sendOutAnims.push([sendOutAnim, dataBoxAnim, false]) sendOutAnims.push([sendOutAnim, dataBoxAnim, false])
@@ -296,11 +299,13 @@ class Battle::Scene
def pbLevelUp(pkmn, _battler, oldTotalHP, oldAttack, oldDefense, oldSpAtk, oldSpDef, oldSpeed) def pbLevelUp(pkmn, _battler, oldTotalHP, oldAttack, oldDefense, oldSpAtk, oldSpDef, oldSpeed)
pbTopRightWindow( pbTopRightWindow(
_INTL("Max. HP<r>+{1}\r\nAttack<r>+{2}\r\nDefense<r>+{3}\r\nSp. Atk<r>+{4}\r\nSp. Def<r>+{5}\r\nSpeed<r>+{6}", _INTL("Max. HP<r>+{1}\r\nAttack<r>+{2}\r\nDefense<r>+{3}\r\nSp. Atk<r>+{4}\r\nSp. Def<r>+{5}\r\nSpeed<r>+{6}",
pkmn.totalhp - oldTotalHP, pkmn.attack - oldAttack, pkmn.defense - oldDefense, pkmn.totalhp - oldTotalHP, pkmn.attack - oldAttack, pkmn.defense - oldDefense,
pkmn.spatk - oldSpAtk, pkmn.spdef - oldSpDef, pkmn.speed - oldSpeed)) pkmn.spatk - oldSpAtk, pkmn.spdef - oldSpDef, pkmn.speed - oldSpeed)
)
pbTopRightWindow( pbTopRightWindow(
_INTL("Max. HP<r>{1}\r\nAttack<r>{2}\r\nDefense<r>{3}\r\nSp. Atk<r>{4}\r\nSp. Def<r>{5}\r\nSpeed<r>{6}", _INTL("Max. HP<r>{1}\r\nAttack<r>{2}\r\nDefense<r>{3}\r\nSp. Atk<r>{4}\r\nSp. Def<r>{5}\r\nSpeed<r>{6}",
pkmn.totalhp, pkmn.attack, pkmn.defense, pkmn.spatk, pkmn.spdef, pkmn.speed)) pkmn.totalhp, pkmn.attack, pkmn.defense, pkmn.spatk, pkmn.spdef, pkmn.speed)
)
end end
#============================================================================= #=============================================================================
@@ -326,8 +331,9 @@ class Battle::Scene
#============================================================================= #=============================================================================
def pbThrow(ball, shakes, critical, targetBattler, showPlayer = false) def pbThrow(ball, shakes, critical, targetBattler, showPlayer = false)
@briefMessage = false @briefMessage = false
captureAnim = Animation::PokeballThrowCapture.new(@sprites, @viewport, captureAnim = Animation::PokeballThrowCapture.new(
ball, shakes, critical, @battle.battlers[targetBattler], showPlayer) @sprites, @viewport, ball, shakes, critical, @battle.battlers[targetBattler], showPlayer
)
loop do loop do
captureAnim.update captureAnim.update
pbUpdate pbUpdate
@@ -367,8 +373,9 @@ class Battle::Scene
def pbThrowAndDeflect(ball, idxBattler) def pbThrowAndDeflect(ball, idxBattler)
@briefMessage = false @briefMessage = false
throwAnim = Animation::PokeballThrowDeflect.new(@sprites, @viewport, throwAnim = Animation::PokeballThrowDeflect.new(
ball, @battle.battlers[idxBattler]) @sprites, @viewport, ball, @battle.battlers[idxBattler]
)
loop do loop do
throwAnim.update throwAnim.update
pbUpdate pbUpdate
@@ -533,8 +540,9 @@ class Battle::Scene
targetHeight = userHeight targetHeight = userHeight
end end
animPlayer.setLineTransform( animPlayer.setLineTransform(
FOCUSUSER_X, FOCUSUSER_Y, FOCUSTARGET_X, FOCUSTARGET_Y, FOCUSUSER_X, FOCUSUSER_Y, FOCUSTARGET_X, FOCUSTARGET_Y,
oldUserX, oldUserY - userHeight / 2, oldTargetX, oldTargetY - targetHeight / 2) oldUserX, oldUserY - userHeight / 2, oldTargetX, oldTargetY - targetHeight / 2
)
# Play the animation # Play the animation
animPlayer.start animPlayer.start
loop do loop do
@@ -118,8 +118,9 @@ class Battle::Scene::CommandMenu < Battle::Scene::MenuBase
self.x = 0 self.x = 0
self.y = Graphics.height - 96 self.y = Graphics.height - 96
# Create message box (shows "What will X do?") # Create message box (shows "What will X do?")
@msgBox = Window_UnformattedTextPokemon.newWithSize("", @msgBox = Window_UnformattedTextPokemon.newWithSize(
self.x + 16, self.y + 2, 220, Graphics.height - self.y, viewport) "", self.x + 16, self.y + 2, 220, Graphics.height - self.y, viewport
)
@msgBox.baseColor = TEXT_BASE_COLOR @msgBox.baseColor = TEXT_BASE_COLOR
@msgBox.shadowColor = TEXT_SHADOW_COLOR @msgBox.shadowColor = TEXT_SHADOW_COLOR
@msgBox.windowskin = nil @msgBox.windowskin = nil
@@ -146,8 +147,9 @@ class Battle::Scene::CommandMenu < Battle::Scene::MenuBase
end end
else else
# Create command window (shows Fight/Bag/Pokémon/Run) # Create command window (shows Fight/Bag/Pokémon/Run)
@cmdWindow = Window_CommandPokemon.newWithSize([], @cmdWindow = Window_CommandPokemon.newWithSize(
self.x + Graphics.width - 240, self.y, 240, Graphics.height - self.y, viewport) [], self.x + Graphics.width - 240, self.y, 240, Graphics.height - self.y, viewport
)
@cmdWindow.columns = 2 @cmdWindow.columns = 2
@cmdWindow.columnSpacing = 4 @cmdWindow.columnSpacing = 4
@cmdWindow.ignore_input = true @cmdWindow.ignore_input = true
@@ -287,15 +289,17 @@ class Battle::Scene::FightMenu < Battle::Scene::MenuBase
addSprite("shiftButton", @shiftButton) addSprite("shiftButton", @shiftButton)
else else
# Create message box (shows type and PP of selected move) # Create message box (shows type and PP of selected move)
@msgBox = Window_AdvancedTextPokemon.newWithSize("", @msgBox = Window_AdvancedTextPokemon.newWithSize(
self.x + 320, self.y, Graphics.width - 320, Graphics.height - self.y, viewport) "", self.x + 320, self.y, Graphics.width - 320, Graphics.height - self.y, viewport
)
@msgBox.baseColor = TEXT_BASE_COLOR @msgBox.baseColor = TEXT_BASE_COLOR
@msgBox.shadowColor = TEXT_SHADOW_COLOR @msgBox.shadowColor = TEXT_SHADOW_COLOR
pbSetNarrowFont(@msgBox.contents) pbSetNarrowFont(@msgBox.contents)
addSprite("msgBox", @msgBox) addSprite("msgBox", @msgBox)
# Create command window (shows moves) # Create command window (shows moves)
@cmdWindow = Window_CommandPokemon.newWithSize([], @cmdWindow = Window_CommandPokemon.newWithSize(
self.x, self.y, 320, Graphics.height - self.y, viewport) [], self.x, self.y, 320, Graphics.height - self.y, viewport
)
@cmdWindow.columns = 2 @cmdWindow.columns = 2
@cmdWindow.columnSpacing = 4 @cmdWindow.columnSpacing = 4
@cmdWindow.ignore_input = true @cmdWindow.ignore_input = true
@@ -392,7 +396,7 @@ class Battle::Scene::FightMenu < Battle::Scene::MenuBase
@msgBox.text = _INTL("PP: ---<br>TYPE/{1}", moveType) @msgBox.text = _INTL("PP: ---<br>TYPE/{1}", moveType)
else else
@msgBox.text = _ISPRINTF("PP: {1: 2d}/{2: 2d}<br>TYPE/{3:s}", @msgBox.text = _ISPRINTF("PP: {1: 2d}/{2: 2d}<br>TYPE/{3:s}",
move.pp, move.total_pp, moveType) move.pp, move.total_pp, moveType)
end end
return return
end end
@@ -42,7 +42,7 @@ class Battle::Scene::Animation::Intro < Battle::Scene::Animation
blackScreen.moveOpacity(0, 8, 0) blackScreen.moveOpacity(0, 8, 0)
# Fading blackness over command bar # Fading blackness over command bar
blackBar = addNewSprite(@sprites["cmdBar_bg"].x, @sprites["cmdBar_bg"].y, blackBar = addNewSprite(@sprites["cmdBar_bg"].x, @sprites["cmdBar_bg"].y,
"Graphics/Battle animations/black_bar") "Graphics/Battle animations/black_bar")
blackBar.setZ(0, 998) blackBar.setZ(0, 998)
blackBar.moveOpacity(appearTime * 3 / 4, appearTime / 4, 0) blackBar.moveOpacity(appearTime * 3 / 4, appearTime / 4, 0)
end end
@@ -448,7 +448,7 @@ class Battle::Scene::Animation::PokeballPlayerSendOut < Battle::Scene::Animation
delay = ball.totalDuration # 0 or 7 delay = ball.totalDuration # 0 or 7
# Poké Ball trajectory animation # Poké Ball trajectory animation
createBallTrajectory(ball, delay, 12, createBallTrajectory(ball, delay, 12,
ballStartX, ballStartY, ballMidX, ballMidY, battlerStartX, battlerStartY - 18) ballStartX, ballStartY, ballMidX, ballMidY, battlerStartX, battlerStartY - 18)
ball.setZ(9, batSprite.z - 1) ball.setZ(9, batSprite.z - 1)
delay = ball.totalDuration + 4 delay = ball.totalDuration + 4
delay += 10 * @idxOrder # Stagger appearances if multiple Pokémon are sent out at once delay += 10 * @idxOrder # Stagger appearances if multiple Pokémon are sent out at once
@@ -651,8 +651,7 @@ class Battle::Scene::Animation::BattlerFaint < Battle::Scene::Animation
shadow = addSprite(shaSprite, PictureOrigin::Center) shadow = addSprite(shaSprite, PictureOrigin::Center)
# Get approx duration depending on sprite's position/size. Min 20 frames. # Get approx duration depending on sprite's position/size. Min 20 frames.
battlerTop = batSprite.y - batSprite.height battlerTop = batSprite.y - batSprite.height
cropY = Battle::Scene.pbBattlerPosition(@idxBattler, cropY = Battle::Scene.pbBattlerPosition(@idxBattler, @battle.pbSideSize(@idxBattler))[1]
@battle.pbSideSize(@idxBattler))[1]
cropY += 8 cropY += 8
duration = (cropY - battlerTop) / 8 duration = (cropY - battlerTop) / 8
duration = 10 if duration < 10 # Min 0.5 seconds duration = 10 if duration < 10 # Min 0.5 seconds
@@ -734,7 +733,7 @@ class Battle::Scene::Animation::PokeballThrowCapture < Battle::Scene::Animation
# Poké Ball arc animation # Poké Ball arc animation
ball.setSE(delay, "Battle throw") ball.setSE(delay, "Battle throw")
createBallTrajectory(ball, delay, 16, createBallTrajectory(ball, delay, 16,
ballStartX, ballStartY, ballMidX, ballMidY, ballEndX, ballEndY) ballStartX, ballStartY, ballMidX, ballMidY, ballEndX, ballEndY)
ball.setZ(9, batSprite.z + 1) ball.setZ(9, batSprite.z + 1)
ball.setSE(delay + 16, "Battle ball hit") ball.setSE(delay + 16, "Battle ball hit")
# Poké Ball opens up # Poké Ball opens up
@@ -867,7 +866,7 @@ class Battle::Scene::Animation::PokeballThrowDeflect < Battle::Scene::Animation
# Poké Ball arc animation # Poké Ball arc animation
ball.setSE(0, "Battle throw") ball.setSE(0, "Battle throw")
createBallTrajectory(ball, 0, 16, createBallTrajectory(ball, 0, 16,
ballStartX, ballStartY, ballMidX, ballMidY, ballEndX, ballEndY) ballStartX, ballStartY, ballMidX, ballMidY, ballEndX, ballEndY)
# Poké Ball knocked back # Poké Ball knocked back
delay = ball.totalDuration delay = ball.totalDuration
ball.setSE(delay, "Battle ball drop") ball.setSE(delay, "Battle ball drop")
@@ -105,7 +105,7 @@ class Battle::AI
next if !i next if !i
next if !@battle.pbCanUseItemOnPokemon?(i, pkmn, battler, @battle.scene, false) next if !@battle.pbCanUseItemOnPokemon?(i, pkmn, battler, @battle.scene, false)
next if !ItemHandlers.triggerCanUseInBattle(i, pkmn, battler, nil, next if !ItemHandlers.triggerCanUseInBattle(i, pkmn, battler, nil,
false, self, @battle.scene, false) false, self, @battle.scene, false)
# Log HP healing items # Log HP healing items
if losthp > 0 if losthp > 0
power = hpItems[i] power = hpItems[i]
@@ -271,11 +271,13 @@ class Battle::AI
if GameData::Type.exists?(:FLYING) if GameData::Type.exists?(:FLYING)
if skill >= PBTrainerAI.highSkill if skill >= PBTrainerAI.highSkill
targetTypes = target.pbTypes(true) targetTypes = target.pbTypes(true)
mult = Effectiveness.calculate(:FLYING, mult = Effectiveness.calculate(
targetTypes[0], targetTypes[1], targetTypes[2]) :FLYING, targetTypes[0], targetTypes[1], targetTypes[2]
)
else else
mult = Effectiveness.calculate(:FLYING, mult = Effectiveness.calculate(
target.types[0], target.types[1], target.effects[PBEffects::Type3]) :FLYING, target.types[0], target.types[1], target.effects[PBEffects::Type3]
)
end end
baseDmg = (baseDmg.to_f * mult / Effectiveness::NORMAL_EFFECTIVE).round baseDmg = (baseDmg.to_f * mult / Effectiveness::NORMAL_EFFECTIVE).round
end end
@@ -338,15 +340,17 @@ class Battle::AI
break break
end end
if canCheck if canCheck
Battle::AbilityEffects.triggerDamageCalcFromUser(user.ability, Battle::AbilityEffects.triggerDamageCalcFromUser(
user, target, move, multipliers, baseDmg, type) user.ability, user, target, move, multipliers, baseDmg, type
)
end end
end end
if skill >= PBTrainerAI.mediumSkill && !moldBreaker if skill >= PBTrainerAI.mediumSkill && !moldBreaker
user.allAllies.each do |b| user.allAllies.each do |b|
next if !b.abilityActive? next if !b.abilityActive?
Battle::AbilityEffects.triggerDamageCalcFromAlly(b.ability, Battle::AbilityEffects.triggerDamageCalcFromAlly(
user, target, move, multipliers, baseDmg, type) b.ability, user, target, move, multipliers, baseDmg, type
)
end end
end end
if skill >= PBTrainerAI.bestSkill && !moldBreaker && target.abilityActive? if skill >= PBTrainerAI.bestSkill && !moldBreaker && target.abilityActive?
@@ -360,15 +364,17 @@ class Battle::AI
break break
end end
if canCheck if canCheck
Battle::AbilityEffects.triggerDamageCalcFromTarget(target.ability, Battle::AbilityEffects.triggerDamageCalcFromTarget(
user, target, move, multipliers, baseDmg, type) target.ability, user, target, move, multipliers, baseDmg, type
)
end end
end end
if skill >= PBTrainerAI.bestSkill && !moldBreaker if skill >= PBTrainerAI.bestSkill && !moldBreaker
target.allAllies.each do |b| target.allAllies.each do |b|
next if !b.abilityActive? next if !b.abilityActive?
Battle::AbilityEffects.triggerDamageCalcFromTargetAlly(b.ability, Battle::AbilityEffects.triggerDamageCalcFromTargetAlly(
user, target, move, multipliers, baseDmg, type) b.ability, user, target, move, multipliers, baseDmg, type
)
end end
end end
# Item effects that alter damage # Item effects that alter damage
@@ -379,16 +385,18 @@ class Battle::AI
# round. # round.
itemBlacklist = [:EXPERTBELT, :LIFEORB] itemBlacklist = [:EXPERTBELT, :LIFEORB]
if !itemBlacklist.include?(user.item_id) if !itemBlacklist.include?(user.item_id)
Battle::ItemEffects.triggerDamageCalcFromUser(user.item, Battle::ItemEffects.triggerDamageCalcFromUser(
user, target, move, multipliers, baseDmg, type) user.item, user, target, move, multipliers, baseDmg, type
)
end end
end end
if skill >= PBTrainerAI.bestSkill && target.itemActive? if skill >= PBTrainerAI.bestSkill && target.itemActive?
# NOTE: Type-weakening berries aren't suitable for checking at the start # NOTE: Type-weakening berries aren't suitable for checking at the start
# of the round. # of the round.
if target.item && !target.item.is_berry? if target.item && !target.item.is_berry?
Battle::ItemEffects.triggerDamageCalcFromTarget(target.item, Battle::ItemEffects.triggerDamageCalcFromTarget(
user, target, move, multipliers, baseDmg, type) target.item, user, target, move, multipliers, baseDmg, type
)
end end
end end
# Global abilities # Global abilities
@@ -640,32 +648,37 @@ class Battle::AI
# Ability effects that alter accuracy calculation # Ability effects that alter accuracy calculation
if skill >= PBTrainerAI.mediumSkill if skill >= PBTrainerAI.mediumSkill
if user.abilityActive? if user.abilityActive?
Battle::AbilityEffects.triggerAccuracyCalcFromUser(user.ability, Battle::AbilityEffects.triggerAccuracyCalcFromUser(
modifiers, user, target, move, type) user.ability, modifiers, user, target, move, type
)
end end
user.allAllies.each do |b| user.allAllies.each do |b|
next if !b.abilityActive? next if !b.abilityActive?
Battle::AbilityEffects.triggerAccuracyCalcFromAlly(b.ability, Battle::AbilityEffects.triggerAccuracyCalcFromAlly(
modifiers, user, target, move, type) b.ability, modifiers, user, target, move, type
)
end end
end end
if skill >= PBTrainerAI.bestSkill if skill >= PBTrainerAI.bestSkill
if target.abilityActive? && !moldBreaker if target.abilityActive? && !moldBreaker
Battle::AbilityEffects.triggerAccuracyCalcFromTarget(target.ability, Battle::AbilityEffects.triggerAccuracyCalcFromTarget(
modifiers, user, target, move, type) target.ability, modifiers, user, target, move, type
)
end end
end end
# Item effects that alter accuracy calculation # Item effects that alter accuracy calculation
if skill >= PBTrainerAI.mediumSkill if skill >= PBTrainerAI.mediumSkill
if user.itemActive? if user.itemActive?
Battle::ItemEffects.triggerAccuracyCalcFromUser(user.item, Battle::ItemEffects.triggerAccuracyCalcFromUser(
modifiers, user, target, move, type) user.item, modifiers, user, target, move, type
)
end end
end end
if skill >= PBTrainerAI.bestSkill if skill >= PBTrainerAI.bestSkill
if target.itemActive? if target.itemActive?
Battle::ItemEffects.triggerAccuracyCalcFromTarget(target.item, Battle::ItemEffects.triggerAccuracyCalcFromTarget(
modifiers, user, target, move, type) target.item, modifiers, user, target, move, type
)
end end
end end
# Other effects, inc. ones that set accuracy_multiplier or evasion_stage to specific values # Other effects, inc. ones that set accuracy_multiplier or evasion_stage to specific values
@@ -222,7 +222,8 @@ class RPG::Animation
timing.se = RPG::AudioFile.new( timing.se = RPG::AudioFile.new(
othertiming.se.name.clone, othertiming.se.name.clone,
othertiming.se.volume, othertiming.se.volume,
othertiming.se.pitch) othertiming.se.pitch
)
timing.flash_scope = othertiming.flash_scope timing.flash_scope = othertiming.flash_scope
timing.flash_color = othertiming.flash_color.clone timing.flash_color = othertiming.flash_color.clone
timing.flash_duration = othertiming.flash_duration timing.flash_duration = othertiming.flash_duration
@@ -290,57 +291,57 @@ class PBAnimTiming
when 1 when 1
text = sprintf("[%d] Set BG: \"%s\"", @frame + 1, name) text = sprintf("[%d] Set BG: \"%s\"", @frame + 1, name)
text += sprintf(" (color=%s,%s,%s,%s)", text += sprintf(" (color=%s,%s,%s,%s)",
(@colorRed != nil) ? @colorRed.to_i : "-", (@colorRed != nil) ? @colorRed.to_i : "-",
(@colorGreen != nil) ? @colorGreen.to_i : "-", (@colorGreen != nil) ? @colorGreen.to_i : "-",
(@colorBlue != nil) ? @colorBlue.to_i : "-", (@colorBlue != nil) ? @colorBlue.to_i : "-",
(@colorAlpha != nil) ? @colorAlpha.to_i : "-") (@colorAlpha != nil) ? @colorAlpha.to_i : "-")
text += sprintf(" (opacity=%s)", @opacity.to_i) text += sprintf(" (opacity=%s)", @opacity.to_i)
text += sprintf(" (coords=%s,%s)", text += sprintf(" (coords=%s,%s)",
(@bgX != nil) ? @bgX : "-", (@bgX != nil) ? @bgX : "-",
(@bgY != nil) ? @bgY : "-") (@bgY != nil) ? @bgY : "-")
return text return text
when 2 when 2
text = sprintf("[%d] Change BG: @%d", @frame + 1, duration) text = sprintf("[%d] Change BG: @%d", @frame + 1, duration)
if @colorRed != nil || @colorGreen != nil || @colorBlue != nil || @colorAlpha != nil if @colorRed != nil || @colorGreen != nil || @colorBlue != nil || @colorAlpha != nil
text += sprintf(" (color=%s,%s,%s,%s)", text += sprintf(" (color=%s,%s,%s,%s)",
(@colorRed != nil) ? @colorRed.to_i : "-", (@colorRed != nil) ? @colorRed.to_i : "-",
(@colorGreen != nil) ? @colorGreen.to_i : "-", (@colorGreen != nil) ? @colorGreen.to_i : "-",
(@colorBlue != nil) ? @colorBlue.to_i : "-", (@colorBlue != nil) ? @colorBlue.to_i : "-",
(@colorAlpha != nil) ? @colorAlpha.to_i : "-") (@colorAlpha != nil) ? @colorAlpha.to_i : "-")
end end
text += sprintf(" (opacity=%s)", @opacity.to_i) if @opacity != nil text += sprintf(" (opacity=%s)", @opacity.to_i) if @opacity != nil
if @bgX != nil || @bgY != nil if @bgX != nil || @bgY != nil
text += sprintf(" (coords=%s,%s)", text += sprintf(" (coords=%s,%s)",
(@bgX != nil) ? @bgX : "-", (@bgX != nil) ? @bgX : "-",
(@bgY != nil) ? @bgY : "-") (@bgY != nil) ? @bgY : "-")
end end
return text return text
when 3 when 3
text = sprintf("[%d] Set FG: \"%s\"", @frame + 1, name) text = sprintf("[%d] Set FG: \"%s\"", @frame + 1, name)
text += sprintf(" (color=%s,%s,%s,%s)", text += sprintf(" (color=%s,%s,%s,%s)",
(@colorRed != nil) ? @colorRed.to_i : "-", (@colorRed != nil) ? @colorRed.to_i : "-",
(@colorGreen != nil) ? @colorGreen.to_i : "-", (@colorGreen != nil) ? @colorGreen.to_i : "-",
(@colorBlue != nil) ? @colorBlue.to_i : "-", (@colorBlue != nil) ? @colorBlue.to_i : "-",
(@colorAlpha != nil) ? @colorAlpha.to_i : "-") (@colorAlpha != nil) ? @colorAlpha.to_i : "-")
text += sprintf(" (opacity=%s)", @opacity.to_i) text += sprintf(" (opacity=%s)", @opacity.to_i)
text += sprintf(" (coords=%s,%s)", text += sprintf(" (coords=%s,%s)",
(@bgX != nil) ? @bgX : "-", (@bgX != nil) ? @bgX : "-",
(@bgY != nil) ? @bgY : "-") (@bgY != nil) ? @bgY : "-")
return text return text
when 4 when 4
text = sprintf("[%d] Change FG: @%d", @frame + 1, duration) text = sprintf("[%d] Change FG: @%d", @frame + 1, duration)
if @colorRed != nil || @colorGreen != nil || @colorBlue != nil || @colorAlpha != nil if @colorRed != nil || @colorGreen != nil || @colorBlue != nil || @colorAlpha != nil
text += sprintf(" (color=%s,%s,%s,%s)", text += sprintf(" (color=%s,%s,%s,%s)",
(@colorRed != nil) ? @colorRed.to_i : "-", (@colorRed != nil) ? @colorRed.to_i : "-",
(@colorGreen != nil) ? @colorGreen.to_i : "-", (@colorGreen != nil) ? @colorGreen.to_i : "-",
(@colorBlue != nil) ? @colorBlue.to_i : "-", (@colorBlue != nil) ? @colorBlue.to_i : "-",
(@colorAlpha != nil) ? @colorAlpha.to_i : "-") (@colorAlpha != nil) ? @colorAlpha.to_i : "-")
end end
text += sprintf(" (opacity=%s)", @opacity.to_i) if @opacity != nil text += sprintf(" (opacity=%s)", @opacity.to_i) if @opacity != nil
if @bgX != nil || @bgY != nil if @bgX != nil || @bgY != nil
text += sprintf(" (coords=%s,%s)", text += sprintf(" (coords=%s,%s)",
(@bgX != nil) ? @bgX : "-", (@bgX != nil) ? @bgX : "-",
(@bgY != nil) ? @bgY : "-") (@bgY != nil) ? @bgY : "-")
end end
return text return text
end end
@@ -638,11 +639,11 @@ def pbSpriteSetAnimFrame(sprite, frame, user = nil, target = nil, inEditor = fal
if pattern >= 0 if pattern >= 0
animwidth = 192 animwidth = 192
sprite.src_rect.set((pattern % 5) * animwidth, (pattern / 5) * animwidth, sprite.src_rect.set((pattern % 5) * animwidth, (pattern / 5) * animwidth,
animwidth, animwidth) animwidth, animwidth)
else else
sprite.src_rect.set(0, 0, sprite.src_rect.set(0, 0,
(sprite.bitmap) ? sprite.bitmap.width : 128, (sprite.bitmap) ? sprite.bitmap.width : 128,
(sprite.bitmap) ? sprite.bitmap.height : 128) (sprite.bitmap) ? sprite.bitmap.height : 128)
end end
sprite.zoom_x = frame[AnimFrame::ZOOMX] / 100.0 sprite.zoom_x = frame[AnimFrame::ZOOMX] / 100.0
sprite.zoom_y = frame[AnimFrame::ZOOMY] / 100.0 sprite.zoom_y = frame[AnimFrame::ZOOMY] / 100.0
@@ -807,7 +808,7 @@ class PBAnimationPlayerX
# Load the animation's spritesheet and assign it to all the sprites. # Load the animation's spritesheet and assign it to all the sprites.
if !@animbitmap || @animbitmap.disposed? if !@animbitmap || @animbitmap.disposed?
@animbitmap = AnimatedBitmap.new("Graphics/Animations/" + @animation.graphic, @animbitmap = AnimatedBitmap.new("Graphics/Animations/" + @animation.graphic,
@animation.hue).deanimate @animation.hue).deanimate
for i in 0...MAX_SPRITES for i in 0...MAX_SPRITES
@animsprites[i].bitmap = @animbitmap if @animsprites[i] @animsprites[i].bitmap = @animbitmap if @animsprites[i]
end end
@@ -851,10 +852,9 @@ class PBAnimationPlayerX
sprite.y = cel[AnimFrame::Y] + @userOrig[1] - Battle::Scene::FOCUSUSER_Y sprite.y = cel[AnimFrame::Y] + @userOrig[1] - Battle::Scene::FOCUSUSER_Y
when 3 # Focused on user and target when 3 # Focused on user and target
next if !@srcLine || !@dstLine next if !@srcLine || !@dstLine
point = transformPoint( point = transformPoint(@srcLine[0], @srcLine[1], @srcLine[2], @srcLine[3],
@srcLine[0], @srcLine[1], @srcLine[2], @srcLine[3], @dstLine[0], @dstLine[1], @dstLine[2], @dstLine[3],
@dstLine[0], @dstLine[1], @dstLine[2], @dstLine[3], sprite.x, sprite.y)
sprite.x, sprite.y)
sprite.x = point[0] sprite.x = point[0]
sprite.y = point[1] sprite.y = point[1]
if isReversed(@srcLine[0], @srcLine[2], @dstLine[0], @dstLine[2]) && if isReversed(@srcLine[0], @srcLine[2], @dstLine[0], @dstLine[2]) &&
@@ -122,7 +122,7 @@ class Battle::Scene::Animation::ThrowBait < Battle::Scene::Animation
trainer = addSprite(traSprite, PictureOrigin::Bottom) trainer = addSprite(traSprite, PictureOrigin::Bottom)
# Set up bait sprite # Set up bait sprite
ball = addNewSprite(ballStartX, ballStartY, ball = addNewSprite(ballStartX, ballStartY,
"Graphics/Battle animations/safari_bait", PictureOrigin::Center) "Graphics/Battle animations/safari_bait", PictureOrigin::Center)
ball.setZ(0, batSprite.z + 1) ball.setZ(0, batSprite.z + 1)
# Trainer animation # Trainer animation
if traSprite.bitmap.width >= traSprite.bitmap.height * 2 if traSprite.bitmap.width >= traSprite.bitmap.height * 2
@@ -132,7 +132,7 @@ class Battle::Scene::Animation::ThrowBait < Battle::Scene::Animation
# Bait arc animation # Bait arc animation
ball.setSE(delay, "Battle throw") ball.setSE(delay, "Battle throw")
createBallTrajectory(ball, delay, 12, createBallTrajectory(ball, delay, 12,
ballStartX, ballStartY, ballMidX, ballMidY, ballEndX, ballEndY) ballStartX, ballStartY, ballMidX, ballMidY, ballEndX, ballEndY)
ball.setZ(9, batSprite.z + 1) ball.setZ(9, batSprite.z + 1)
delay = ball.totalDuration delay = ball.totalDuration
ball.moveOpacity(delay + 8, 2, 0) ball.moveOpacity(delay + 8, 2, 0)
@@ -187,7 +187,7 @@ class Battle::Scene::Animation::ThrowRock < Battle::Scene::Animation
trainer = addSprite(traSprite, PictureOrigin::Bottom) trainer = addSprite(traSprite, PictureOrigin::Bottom)
# Set up bait sprite # Set up bait sprite
ball = addNewSprite(ballStartX, ballStartY, ball = addNewSprite(ballStartX, ballStartY,
"Graphics/Battle animations/safari_rock", PictureOrigin::Center) "Graphics/Battle animations/safari_rock", PictureOrigin::Center)
ball.setZ(0, batSprite.z + 1) ball.setZ(0, batSprite.z + 1)
# Trainer animation # Trainer animation
if traSprite.bitmap.width >= traSprite.bitmap.height * 2 if traSprite.bitmap.width >= traSprite.bitmap.height * 2
@@ -197,7 +197,7 @@ class Battle::Scene::Animation::ThrowRock < Battle::Scene::Animation
# Bait arc animation # Bait arc animation
ball.setSE(delay, "Battle throw") ball.setSE(delay, "Battle throw")
createBallTrajectory(ball, delay, 12, createBallTrajectory(ball, delay, 12,
ballStartX, ballStartY, ballMidX, ballMidY, ballEndX, ballEndY) ballStartX, ballStartY, ballMidX, ballMidY, ballEndX, ballEndY)
ball.setZ(9, batSprite.z + 1) ball.setZ(9, batSprite.z + 1)
delay = ball.totalDuration delay = ball.totalDuration
ball.setSE(delay, "Battle damage weak") ball.setSE(delay, "Battle damage weak")
@@ -205,7 +205,7 @@ class Battle::Scene::Animation::ThrowRock < Battle::Scene::Animation
ball.setVisible(delay + 4, false) ball.setVisible(delay + 4, false)
# Set up anger sprite # Set up anger sprite
anger = addNewSprite(ballEndX - 42, ballEndY - 36, anger = addNewSprite(ballEndX - 42, ballEndY - 36,
"Graphics/Battle animations/safari_anger", PictureOrigin::Center) "Graphics/Battle animations/safari_anger", PictureOrigin::Center)
anger.setVisible(0, false) anger.setVisible(0, false)
anger.setZ(0, batSprite.z + 1) anger.setZ(0, batSprite.z + 1)
# Show anger appearing # Show anger appearing
@@ -63,9 +63,8 @@ class BugContestBattle < Battle
lastPokemon = pbBugContestState.lastPokemon lastPokemon = pbBugContestState.lastPokemon
pbDisplayPaused(_INTL("You already caught a {1}.", lastPokemon.name)) pbDisplayPaused(_INTL("You already caught a {1}.", lastPokemon.name))
helptext = _INTL("STOCK POKéMON:\n {1} Lv.{2} MaxHP: {3}\nTHIS POKéMON:\n {4} Lv.{5} MaxHP: {6}", helptext = _INTL("STOCK POKéMON:\n {1} Lv.{2} MaxHP: {3}\nTHIS POKéMON:\n {4} Lv.{5} MaxHP: {6}",
lastPokemon.name, lastPokemon.level, lastPokemon.totalhp, lastPokemon.name, lastPokemon.level, lastPokemon.totalhp,
pkmn.name, pkmn.level, pkmn.totalhp pkmn.name, pkmn.level, pkmn.totalhp)
)
@scene.pbShowHelp(helptext) @scene.pbShowHelp(helptext)
if pbDisplayConfirm(_INTL("Switch Pokémon?")) if pbDisplayConfirm(_INTL("Switch Pokémon?"))
pbBugContestState.lastPokemon = pkmn pbBugContestState.lastPokemon = pkmn
@@ -182,7 +182,7 @@ class BattleArenaBattle < Battle
# Make judgment # Make judgment
if points[0] == points[1] if points[0] == points[1]
pbDisplay(_INTL("{1} tied the opponent\n{2} in a referee's decision!", pbDisplay(_INTL("{1} tied the opponent\n{2} in a referee's decision!",
@battlers[0].name, @battlers[1].name)) @battlers[0].name, @battlers[1].name))
# NOTE: Pokémon doesn't really lose HP, but the effect is mostly the # NOTE: Pokémon doesn't really lose HP, but the effect is mostly the
# same. # same.
@battlers[0].hp = 0 @battlers[0].hp = 0
@@ -191,12 +191,12 @@ class BattleArenaBattle < Battle
@battlers[1].pbFaint(false) @battlers[1].pbFaint(false)
elsif points[0] > points[1] elsif points[0] > points[1]
pbDisplay(_INTL("{1} defeated the opponent\n{2} in a referee's decision!", pbDisplay(_INTL("{1} defeated the opponent\n{2} in a referee's decision!",
@battlers[0].name, @battlers[1].name)) @battlers[0].name, @battlers[1].name))
@battlers[1].hp = 0 @battlers[1].hp = 0
@battlers[1].pbFaint(false) @battlers[1].pbFaint(false)
else else
pbDisplay(_INTL("{1} lost to the opponent\n{2} in a referee's decision!", pbDisplay(_INTL("{1} lost to the opponent\n{2} in a referee's decision!",
@battlers[0].name, @battlers[1].name)) @battlers[0].name, @battlers[1].name))
@battlers[0].hp = 0 @battlers[0].hp = 0
@battlers[0].pbFaint(false) @battlers[0].pbFaint(false)
end end
@@ -266,7 +266,7 @@ class Battle::Scene
def pbBattleArenaBattlers(battler1, battler2) def pbBattleArenaBattlers(battler1, battler2)
pbMessage(_INTL("REFEREE: {1} VS {2}!\nCommence battling!\\wtnp[20]", pbMessage(_INTL("REFEREE: {1} VS {2}!\nCommence battling!\\wtnp[20]",
battler1.name, battler2.name)) { pbBattleArenaUpdate } battler1.name, battler2.name)) { pbBattleArenaUpdate }
end end
def pbBattleArenaJudgment(battler1, battler2, ratings1, ratings2) def pbBattleArenaJudgment(battler1, battler2, ratings1, ratings2)
@@ -277,7 +277,7 @@ class Battle::Scene
msgwindow = pbCreateMessageWindow msgwindow = pbCreateMessageWindow
dimmingvp = Viewport.new(0, 0, Graphics.width, Graphics.height - msgwindow.height) dimmingvp = Viewport.new(0, 0, Graphics.width, Graphics.height - msgwindow.height)
pbMessageDisplay(msgwindow, pbMessageDisplay(msgwindow,
_INTL("REFEREE: That's it! We will now go to judging to determine the winner!\\wtnp[20]")) { _INTL("REFEREE: That's it! We will now go to judging to determine the winner!\\wtnp[20]")) {
pbBattleArenaUpdate pbBattleArenaUpdate
dimmingvp.update dimmingvp.update
} }
@@ -305,21 +305,21 @@ class Battle::Scene
end end
updateJudgment(infowindow, 1, battler1, battler2, ratings1, ratings2) updateJudgment(infowindow, 1, battler1, battler2, ratings1, ratings2)
pbMessageDisplay(msgwindow, pbMessageDisplay(msgwindow,
_INTL("REFEREE: Judging category 1, Mind!\nThe Pokémon showing the most guts!\\wtnp[40]")) { _INTL("REFEREE: Judging category 1, Mind!\nThe Pokémon showing the most guts!\\wtnp[40]")) {
pbBattleArenaUpdate pbBattleArenaUpdate
dimmingvp.update dimmingvp.update
infowindow.update infowindow.update
} }
updateJudgment(infowindow, 2, battler1, battler2, ratings1, ratings2) updateJudgment(infowindow, 2, battler1, battler2, ratings1, ratings2)
pbMessageDisplay(msgwindow, pbMessageDisplay(msgwindow,
_INTL("REFEREE: Judging category 2, Skill!\nThe Pokémon using moves the best!\\wtnp[40]")) { _INTL("REFEREE: Judging category 2, Skill!\nThe Pokémon using moves the best!\\wtnp[40]")) {
pbBattleArenaUpdate pbBattleArenaUpdate
dimmingvp.update dimmingvp.update
infowindow.update infowindow.update
} }
updateJudgment(infowindow, 3, battler1, battler2, ratings1, ratings2) updateJudgment(infowindow, 3, battler1, battler2, ratings1, ratings2)
pbMessageDisplay(msgwindow, pbMessageDisplay(msgwindow,
_INTL("REFEREE: Judging category 3, Body!\nThe Pokémon with the most vitality!\\wtnp[40]")) { _INTL("REFEREE: Judging category 3, Body!\nThe Pokémon with the most vitality!\\wtnp[40]")) {
pbBattleArenaUpdate pbBattleArenaUpdate
dimmingvp.update dimmingvp.update
infowindow.update infowindow.update
@@ -332,23 +332,23 @@ class Battle::Scene
end end
if total1 == total2 if total1 == total2
pbMessageDisplay(msgwindow, pbMessageDisplay(msgwindow,
_INTL("REFEREE: Judgment: {1} to {2}!\nWe have a draw!\\wtnp[40]", total1, total2)) { _INTL("REFEREE: Judgment: {1} to {2}!\nWe have a draw!\\wtnp[40]", total1, total2)) {
pbBattleArenaUpdate pbBattleArenaUpdate
dimmingvp.update dimmingvp.update
infowindow.update infowindow.update
} }
elsif total1 > total2 elsif total1 > total2
pbMessageDisplay(msgwindow, pbMessageDisplay(msgwindow,
_INTL("REFEREE: Judgment: {1} to {2}!\nThe winner is {3}'s {4}!\\wtnp[40]", _INTL("REFEREE: Judgment: {1} to {2}!\nThe winner is {3}'s {4}!\\wtnp[40]",
total1, total2, @battle.pbGetOwnerName(battler1.index), battler1.name)) { total1, total2, @battle.pbGetOwnerName(battler1.index), battler1.name)) {
pbBattleArenaUpdate pbBattleArenaUpdate
dimmingvp.update dimmingvp.update
infowindow.update infowindow.update
} }
else else
pbMessageDisplay(msgwindow, pbMessageDisplay(msgwindow,
_INTL("REFEREE: Judgment: {1} to {2}!\nThe winner is {3}!\\wtnp[40]", _INTL("REFEREE: Judgment: {1} to {2}!\nThe winner is {3}!\\wtnp[40]",
total1, total2, battler2.name)) { total1, total2, battler2.name)) {
pbBattleArenaUpdate pbBattleArenaUpdate
dimmingvp.update dimmingvp.update
infowindow.update infowindow.update
@@ -31,7 +31,7 @@ def pbCaveEntranceEx(exiting)
for i in 0...totalBands for i in 0...totalBands
currentGray = grays[i] currentGray = grays[i]
sprite.bitmap.fill_rect(Rect.new(x, y, rectwidth, rectheight), sprite.bitmap.fill_rect(Rect.new(x, y, rectwidth, rectheight),
Color.new(currentGray, currentGray, currentGray)) Color.new(currentGray, currentGray, currentGray))
x += bandwidth x += bandwidth
y += bandheight y += bandheight
rectwidth -= bandwidth * 2 rectwidth -= bandwidth * 2
+4 -3
View File
@@ -507,7 +507,8 @@ def pbMoveRoute(event, commands, waitComplete = false)
i += 2 i += 2
when PBMoveRoute::Graphic when PBMoveRoute::Graphic
route.list.push(RPG::MoveCommand.new(commands[i], route.list.push(RPG::MoveCommand.new(commands[i],
[commands[i + 1], commands[i + 2], commands[i + 3], commands[i + 4]])) [commands[i + 1], commands[i + 2],
commands[i + 3], commands[i + 4]]))
i += 4 i += 4
else else
route.list.push(RPG::MoveCommand.new(commands[i])) route.list.push(RPG::MoveCommand.new(commands[i]))
@@ -728,7 +729,7 @@ def pbItemBall(item, quantity = 1)
pbMessage(_INTL("\\me[{1}]You found a \\c[1]{2}\\c[0]!\\wtnp[30]", meName, itemname)) pbMessage(_INTL("\\me[{1}]You found a \\c[1]{2}\\c[0]!\\wtnp[30]", meName, itemname))
end end
pbMessage(_INTL("You put the {1} in\\nyour Bag's <icon=bagPocket{2}>\\c[1]{3}\\c[0] pocket.", pbMessage(_INTL("You put the {1} in\\nyour Bag's <icon=bagPocket{2}>\\c[1]{3}\\c[0] pocket.",
itemname, pocket, PokemonBag.pocket_names[pocket - 1])) itemname, pocket, PokemonBag.pocket_names[pocket - 1]))
return true return true
end end
# Can't add the item # Can't add the item
@@ -774,7 +775,7 @@ def pbReceiveItem(item, quantity = 1)
end end
if $bag.add(item, quantity) # If item can be added if $bag.add(item, quantity) # If item can be added
pbMessage(_INTL("You put the {1} in\\nyour Bag's <icon=bagPocket{2}>\\c[1]{3}\\c[0] pocket.", pbMessage(_INTL("You put the {1} in\\nyour Bag's <icon=bagPocket{2}>\\c[1]{3}\\c[0] pocket.",
itemname, pocket, PokemonBag.pocket_names[pocket - 1])) itemname, pocket, PokemonBag.pocket_names[pocket - 1]))
return true return true
end end
return false # Can't add the item return false # Can't add the item
@@ -508,8 +508,7 @@ def pbTrainerBattle(trainerID, trainerName, endSpeech = nil,
# Perform the battle # Perform the battle
if $game_temp.waiting_trainer if $game_temp.waiting_trainer
decision = pbTrainerBattleCore($game_temp.waiting_trainer[0], decision = pbTrainerBattleCore($game_temp.waiting_trainer[0],
[trainerID, trainerName, trainerPartyID, endSpeech] [trainerID, trainerName, trainerPartyID, endSpeech])
)
else else
decision = pbTrainerBattleCore([trainerID, trainerName, trainerPartyID, endSpeech]) decision = pbTrainerBattleCore([trainerID, trainerName, trainerPartyID, endSpeech])
end end
@@ -91,7 +91,8 @@ def pbHiddenMoveAnimation(pokemon)
interp = RectInterpolator.new( interp = RectInterpolator.new(
Rect.new(0, Graphics.height / 2, Graphics.width, 0), Rect.new(0, Graphics.height / 2, Graphics.width, 0),
Rect.new(0, (Graphics.height - bg.bitmap.height) / 2, Graphics.width, bg.bitmap.height), Rect.new(0, (Graphics.height - bg.bitmap.height) / 2, Graphics.width, bg.bitmap.height),
Graphics.frame_rate / 4) Graphics.frame_rate / 4
)
ptinterp = nil ptinterp = nil
phase = 1 phase = 1
frames = 0 frames = 0
@@ -110,7 +111,8 @@ def pbHiddenMoveAnimation(pokemon)
ptinterp = PointInterpolator.new( ptinterp = PointInterpolator.new(
Graphics.width + (sprite.bitmap.width / 2), bg.bitmap.height / 2, Graphics.width + (sprite.bitmap.width / 2), bg.bitmap.height / 2,
Graphics.width / 2, bg.bitmap.height / 2, Graphics.width / 2, bg.bitmap.height / 2,
Graphics.frame_rate * 4 / 10) Graphics.frame_rate * 4 / 10
)
end end
when 2 # Slide Pokémon sprite in from right to centre when 2 # Slide Pokémon sprite in from right to centre
ptinterp.update ptinterp.update
@@ -129,7 +131,8 @@ def pbHiddenMoveAnimation(pokemon)
ptinterp = PointInterpolator.new( ptinterp = PointInterpolator.new(
Graphics.width / 2, bg.bitmap.height / 2, Graphics.width / 2, bg.bitmap.height / 2,
-(sprite.bitmap.width / 2), bg.bitmap.height / 2, -(sprite.bitmap.width / 2), bg.bitmap.height / 2,
Graphics.frame_rate * 4 / 10) Graphics.frame_rate * 4 / 10
)
frames = 0 frames = 0
end end
when 4 # Slide Pokémon sprite off from centre to left when 4 # Slide Pokémon sprite off from centre to left
@@ -142,7 +145,8 @@ def pbHiddenMoveAnimation(pokemon)
interp = RectInterpolator.new( interp = RectInterpolator.new(
Rect.new(0, (Graphics.height - bg.bitmap.height) / 2, Graphics.width, bg.bitmap.height), Rect.new(0, (Graphics.height - bg.bitmap.height) / 2, Graphics.width, bg.bitmap.height),
Rect.new(0, Graphics.height / 2, Graphics.width, 0), Rect.new(0, Graphics.height / 2, Graphics.width, 0),
Graphics.frame_rate / 4) Graphics.frame_rate / 4
)
end end
when 5 # Shrink viewport height from full to zero when 5 # Shrink viewport height from full to zero
interp.update interp.update
@@ -272,7 +272,7 @@ class BerryPlantSprite
@old_stage > 0 && berry_plant.growth_stage <= GameData::BerryPlant::NUMBER_OF_GROWTH_STAGES + 1 @old_stage > 0 && berry_plant.growth_stage <= GameData::BerryPlant::NUMBER_OF_GROWTH_STAGES + 1
spriteset = $scene.spriteset(@map.map_id) spriteset = $scene.spriteset(@map.map_id)
spriteset.addUserAnimation(Settings::PLANT_SPARKLE_ANIMATION_ID, spriteset.addUserAnimation(Settings::PLANT_SPARKLE_ANIMATION_ID,
@event.x, @event.y, false, 1) if spriteset @event.x, @event.y, false, 1) if spriteset
end end
end end
@old_stage = berry_plant.growth_stage @old_stage = berry_plant.growth_stage
@@ -356,7 +356,7 @@ def pbBerryPlant
GameData::BerryPlant::WATERING_CANS.each do |item| GameData::BerryPlant::WATERING_CANS.each do |item|
next if !$bag.has?(item) next if !$bag.has?(item)
break if !pbConfirmMessage(_INTL("Want to sprinkle some water with the {1}?", break if !pbConfirmMessage(_INTL("Want to sprinkle some water with the {1}?",
GameData::Item.get(item).name)) GameData::Item.get(item).name))
berry_plant.water berry_plant.water
pbMessage(_INTL("{1} watered the plant.\\wtnp[40]", $player.name)) pbMessage(_INTL("{1} watered the plant.\\wtnp[40]", $player.name))
if Settings::NEW_BERRY_PLANTS if Settings::NEW_BERRY_PLANTS
@@ -376,7 +376,7 @@ def pbBerryPlant
pbMessage(_INTL("{1} has been laid down.\1", GameData::Item.get(berry_plant.mulch_id).name)) pbMessage(_INTL("{1} has been laid down.\1", GameData::Item.get(berry_plant.mulch_id).name))
else else
case pbMessage(_INTL("It's soft, earthy soil."), case pbMessage(_INTL("It's soft, earthy soil."),
[_INTL("Fertilize"), _INTL("Plant Berry"), _INTL("Exit")], -1) [_INTL("Fertilize"), _INTL("Plant Berry"), _INTL("Exit")], -1)
when 0 # Fertilize when 0 # Fertilize
mulch = nil mulch = nil
pbFadeOutIn { pbFadeOutIn {
@@ -417,10 +417,10 @@ def pbBerryPlant
$bag.remove(berry) $bag.remove(berry)
if Settings::NEW_BERRY_PLANTS if Settings::NEW_BERRY_PLANTS
pbMessage(_INTL("The {1} was planted in the soft, earthy soil.", pbMessage(_INTL("The {1} was planted in the soft, earthy soil.",
GameData::Item.get(berry).name)) GameData::Item.get(berry).name))
else else
pbMessage(_INTL("{1} planted a {2} in the soft loamy soil.", pbMessage(_INTL("{1} planted a {2} in the soft loamy soil.",
$player.name, GameData::Item.get(berry).name)) $player.name, GameData::Item.get(berry).name))
end end
end end
end end
@@ -454,7 +454,7 @@ def pbPickBerry(berry, qty = 1)
end end
pocket = berry.pocket pocket = berry.pocket
pbMessage(_INTL("{1} put the \\c[1]{2}\\c[0] in the <icon=bagPocket{3}>\\c[1]{4}\\c[0] Pocket.\1", pbMessage(_INTL("{1} put the \\c[1]{2}\\c[0] in the <icon=bagPocket{3}>\\c[1]{4}\\c[0] Pocket.\1",
$player.name, berry_name, pocket, PokemonBag.pocket_names[pocket - 1])) $player.name, berry_name, pocket, PokemonBag.pocket_names[pocket - 1]))
if Settings::NEW_BERRY_PLANTS if Settings::NEW_BERRY_PLANTS
pbMessage(_INTL("The soil returned to its soft and earthy state.")) pbMessage(_INTL("The soil returned to its soft and earthy state."))
else else
@@ -575,11 +575,11 @@ module RandomDungeonGenerator
for y in 0...maxHeight / cellHeight for y in 0...maxHeight / cellHeight
for x in 0...maxWidth / cellWidth for x in 0...maxWidth / cellWidth
pattern = maze.getEdgePattern(x, y) pattern = maze.getEdgePattern(x, y)
if DungeonMaze.paint_cell_contents( next if !DungeonMaze.paint_cell_contents(
self, BUFFER_X + x * cellWidth, BUFFER_Y + y * cellHeight, self, BUFFER_X + x * cellWidth, BUFFER_Y + y * cellHeight,
corridor_patterns[pattern], DungeonMaze::TURN_NONE) corridor_patterns[pattern], DungeonMaze::TURN_NONE
roomcount += 1 )
end roomcount += 1
end end
end end
# If no rooms were generated, make the whole map a room # If no rooms were generated, make the whole map a room
+14 -12
View File
@@ -161,9 +161,9 @@ def pbChangeLevel(pkmn, new_level, scene)
special_defense_diff = pkmn.spdef - old_special_defense special_defense_diff = pkmn.spdef - old_special_defense
speed_diff = pkmn.speed - old_speed speed_diff = pkmn.speed - old_speed
pbTopRightWindow(_INTL("Max. HP<r>{1}\r\nAttack<r>{2}\r\nDefense<r>{3}\r\nSp. Atk<r>{4}\r\nSp. Def<r>{5}\r\nSpeed<r>{6}", pbTopRightWindow(_INTL("Max. HP<r>{1}\r\nAttack<r>{2}\r\nDefense<r>{3}\r\nSp. Atk<r>{4}\r\nSp. Def<r>{5}\r\nSpeed<r>{6}",
total_hp_diff, attack_diff, defense_diff, special_attack_diff, special_defense_diff, speed_diff), scene) total_hp_diff, attack_diff, defense_diff, special_attack_diff, special_defense_diff, speed_diff), scene)
pbTopRightWindow(_INTL("Max. HP<r>{1}\r\nAttack<r>{2}\r\nDefense<r>{3}\r\nSp. Atk<r>{4}\r\nSp. Def<r>{5}\r\nSpeed<r>{6}", pbTopRightWindow(_INTL("Max. HP<r>{1}\r\nAttack<r>{2}\r\nDefense<r>{3}\r\nSp. Atk<r>{4}\r\nSp. Def<r>{5}\r\nSpeed<r>{6}",
pkmn.totalhp, pkmn.attack, pkmn.defense, pkmn.spatk, pkmn.spdef, pkmn.speed), scene) pkmn.totalhp, pkmn.attack, pkmn.defense, pkmn.spatk, pkmn.spdef, pkmn.speed), scene)
else else
pkmn.changeHappiness("vitamin") pkmn.changeHappiness("vitamin")
if scene.is_a?(PokemonPartyScreen) if scene.is_a?(PokemonPartyScreen)
@@ -178,9 +178,9 @@ def pbChangeLevel(pkmn, new_level, scene)
special_defense_diff = pkmn.spdef - old_special_defense special_defense_diff = pkmn.spdef - old_special_defense
speed_diff = pkmn.speed - old_speed speed_diff = pkmn.speed - old_speed
pbTopRightWindow(_INTL("Max. HP<r>+{1}\r\nAttack<r>+{2}\r\nDefense<r>+{3}\r\nSp. Atk<r>+{4}\r\nSp. Def<r>+{5}\r\nSpeed<r>+{6}", pbTopRightWindow(_INTL("Max. HP<r>+{1}\r\nAttack<r>+{2}\r\nDefense<r>+{3}\r\nSp. Atk<r>+{4}\r\nSp. Def<r>+{5}\r\nSpeed<r>+{6}",
total_hp_diff, attack_diff, defense_diff, special_attack_diff, special_defense_diff, speed_diff), scene) total_hp_diff, attack_diff, defense_diff, special_attack_diff, special_defense_diff, speed_diff), scene)
pbTopRightWindow(_INTL("Max. HP<r>{1}\r\nAttack<r>{2}\r\nDefense<r>{3}\r\nSp. Atk<r>{4}\r\nSp. Def<r>{5}\r\nSpeed<r>{6}", pbTopRightWindow(_INTL("Max. HP<r>{1}\r\nAttack<r>{2}\r\nDefense<r>{3}\r\nSp. Atk<r>{4}\r\nSp. Def<r>{5}\r\nSpeed<r>{6}",
pkmn.totalhp, pkmn.attack, pkmn.defense, pkmn.spatk, pkmn.spdef, pkmn.speed), scene) pkmn.totalhp, pkmn.attack, pkmn.defense, pkmn.spatk, pkmn.spdef, pkmn.speed), scene)
# Learn new moves upon level up # Learn new moves upon level up
movelist = pkmn.getMoveList movelist = pkmn.getMoveList
for i in movelist for i in movelist
@@ -259,9 +259,9 @@ def pbChangeExp(pkmn, new_exp, scene)
special_defense_diff = pkmn.spdef - old_special_defense special_defense_diff = pkmn.spdef - old_special_defense
speed_diff = pkmn.speed - old_speed speed_diff = pkmn.speed - old_speed
pbTopRightWindow(_INTL("Max. HP<r>{1}\r\nAttack<r>{2}\r\nDefense<r>{3}\r\nSp. Atk<r>{4}\r\nSp. Def<r>{5}\r\nSpeed<r>{6}", pbTopRightWindow(_INTL("Max. HP<r>{1}\r\nAttack<r>{2}\r\nDefense<r>{3}\r\nSp. Atk<r>{4}\r\nSp. Def<r>{5}\r\nSpeed<r>{6}",
total_hp_diff, attack_diff, defense_diff, special_attack_diff, special_defense_diff, speed_diff), scene) total_hp_diff, attack_diff, defense_diff, special_attack_diff, special_defense_diff, speed_diff), scene)
pbTopRightWindow(_INTL("Max. HP<r>{1}\r\nAttack<r>{2}\r\nDefense<r>{3}\r\nSp. Atk<r>{4}\r\nSp. Def<r>{5}\r\nSpeed<r>{6}", pbTopRightWindow(_INTL("Max. HP<r>{1}\r\nAttack<r>{2}\r\nDefense<r>{3}\r\nSp. Atk<r>{4}\r\nSp. Def<r>{5}\r\nSpeed<r>{6}",
pkmn.totalhp, pkmn.attack, pkmn.defense, pkmn.spatk, pkmn.spdef, pkmn.speed), scene) pkmn.totalhp, pkmn.attack, pkmn.defense, pkmn.spatk, pkmn.spdef, pkmn.speed), scene)
else # Gains Exp else # Gains Exp
difference = new_exp - pkmn.exp difference = new_exp - pkmn.exp
if scene.is_a?(PokemonPartyScreen) if scene.is_a?(PokemonPartyScreen)
@@ -287,9 +287,9 @@ def pbChangeExp(pkmn, new_exp, scene)
special_defense_diff = pkmn.spdef - old_special_defense special_defense_diff = pkmn.spdef - old_special_defense
speed_diff = pkmn.speed - old_speed speed_diff = pkmn.speed - old_speed
pbTopRightWindow(_INTL("Max. HP<r>+{1}\r\nAttack<r>+{2}\r\nDefense<r>+{3}\r\nSp. Atk<r>+{4}\r\nSp. Def<r>+{5}\r\nSpeed<r>+{6}", pbTopRightWindow(_INTL("Max. HP<r>+{1}\r\nAttack<r>+{2}\r\nDefense<r>+{3}\r\nSp. Atk<r>+{4}\r\nSp. Def<r>+{5}\r\nSpeed<r>+{6}",
total_hp_diff, attack_diff, defense_diff, special_attack_diff, special_defense_diff, speed_diff), scene) total_hp_diff, attack_diff, defense_diff, special_attack_diff, special_defense_diff, speed_diff), scene)
pbTopRightWindow(_INTL("Max. HP<r>{1}\r\nAttack<r>{2}\r\nDefense<r>{3}\r\nSp. Atk<r>{4}\r\nSp. Def<r>{5}\r\nSpeed<r>{6}", pbTopRightWindow(_INTL("Max. HP<r>{1}\r\nAttack<r>{2}\r\nDefense<r>{3}\r\nSp. Atk<r>{4}\r\nSp. Def<r>{5}\r\nSpeed<r>{6}",
pkmn.totalhp, pkmn.attack, pkmn.defense, pkmn.spatk, pkmn.spdef, pkmn.speed), scene) pkmn.totalhp, pkmn.attack, pkmn.defense, pkmn.spatk, pkmn.spdef, pkmn.speed), scene)
# Learn new moves upon level up # Learn new moves upon level up
movelist = pkmn.getMoveList movelist = pkmn.getMoveList
for i in movelist for i in movelist
@@ -495,7 +495,7 @@ def pbNatureChangingMint(new_nature, item, pkmn, scene)
pkmn.calc_stats pkmn.calc_stats
scene.pbRefresh scene.pbRefresh
scene.pbDisplay(_INTL("{1}'s stats may have changed due to the effects of the {2}!", scene.pbDisplay(_INTL("{1}'s stats may have changed due to the effects of the {2}!",
pkmn.name, GameData::Item.get(item).name)) pkmn.name, GameData::Item.get(item).name))
return true return true
end end
@@ -596,7 +596,7 @@ def pbLearnMove(pkmn, move, ignore_if_known = false, by_machine = false, &block)
return true return true
end end
pbMessage(_INTL("{1} wants to learn {2}, but it already knows {3} moves.\1", pbMessage(_INTL("{1} wants to learn {2}, but it already knows {3} moves.\1",
pkmn_name, move_name, pkmn.numMoves.to_word), &block) pkmn_name, move_name, pkmn.numMoves.to_word), &block)
if pbConfirmMessage(_INTL("Should {1} forget a move to learn {2}?", pkmn_name, move_name), &block) if pbConfirmMessage(_INTL("Should {1} forget a move to learn {2}?", pkmn_name, move_name), &block)
loop do loop do
move_index = pbForgetMove(pkmn, move) move_index = pbForgetMove(pkmn, move)
@@ -688,7 +688,8 @@ def pbUseItem(bag, item, bagscene = nil)
max_at_once = [max_at_once, $bag.quantity(item)].min max_at_once = [max_at_once, $bag.quantity(item)].min
if max_at_once > 1 if max_at_once > 1
qty = screen.scene.pbChooseNumber( qty = screen.scene.pbChooseNumber(
_INTL("How many {1} do you want to use?", GameData::Item.get(item).name), max_at_once) _INTL("How many {1} do you want to use?", GameData::Item.get(item).name), max_at_once
)
screen.scene.pbSetHelpText("") if screen.is_a?(PokemonPartyScreen) screen.scene.pbSetHelpText("") if screen.is_a?(PokemonPartyScreen)
end end
if qty >= 1 if qty >= 1
@@ -749,7 +750,8 @@ def pbUseItemOnPokemon(item, pkmn, scene)
max_at_once = [max_at_once, $bag.quantity(item)].min max_at_once = [max_at_once, $bag.quantity(item)].min
if max_at_once > 1 if max_at_once > 1
qty = scene.scene.pbChooseNumber( qty = scene.scene.pbChooseNumber(
_INTL("How many {1} do you want to use?", itm.name), max_at_once) _INTL("How many {1} do you want to use?", itm.name), max_at_once
)
scene.scene.pbSetHelpText("") if scene.is_a?(PokemonPartyScreen) scene.scene.pbSetHelpText("") if scene.is_a?(PokemonPartyScreen)
end end
return false if qty <= 0 return false if qty <= 0
+1 -1
View File
@@ -48,7 +48,7 @@ def pbPhoneRegisterBattle(message, event, trainertype, trainername, maxbattles)
message = _INTL("Let me register you.") if !message message = _INTL("Let me register you.") if !message
return if !pbConfirmMessage(message) return if !pbConfirmMessage(message)
displayname = _INTL("{1} {2}", GameData::TrainerType.get(trainertype).name, displayname = _INTL("{1} {2}", GameData::TrainerType.get(trainertype).name,
pbGetMessageFromHash(MessageTypes::TrainerNames, trainername)) pbGetMessageFromHash(MessageTypes::TrainerNames, trainername))
if contact # Previously registered, just make visible if contact # Previously registered, just make visible
contact[0] = true contact[0] = true
else # Add new contact else # Add new contact
+1 -1
View File
@@ -35,7 +35,7 @@ def pbCanUsePokeRadar?
# Can't use Radar if it isn't fully charged # Can't use Radar if it isn't fully charged
if $PokemonGlobal.pokeradarBattery && $PokemonGlobal.pokeradarBattery > 0 if $PokemonGlobal.pokeradarBattery && $PokemonGlobal.pokeradarBattery > 0
pbMessage(_INTL("The battery has run dry!\nFor it to recharge, you need to walk another {1} steps.", pbMessage(_INTL("The battery has run dry!\nFor it to recharge, you need to walk another {1} steps.",
$PokemonGlobal.pokeradarBattery)) $PokemonGlobal.pokeradarBattery))
return false return false
end end
return true return true
+14 -11
View File
@@ -41,22 +41,25 @@ def pbDisplayMail(mail, _bearer = nil)
if GameData::Item.get(mail.item).is_icon_mail? if GameData::Item.get(mail.item).is_icon_mail?
if mail.poke1 if mail.poke1
sprites["bearer"] = IconSprite.new(64, 288, viewport) sprites["bearer"] = IconSprite.new(64, 288, viewport)
bitmapFileName = GameData::Species.icon_filename(mail.poke1[0], bitmapFileName = GameData::Species.icon_filename(
mail.poke1[3], mail.poke1[1], mail.poke1[2], mail.poke1[4], mail.poke1[5]) mail.poke1[0], mail.poke1[3], mail.poke1[1], mail.poke1[2], mail.poke1[4], mail.poke1[5]
)
sprites["bearer"].setBitmap(bitmapFileName) sprites["bearer"].setBitmap(bitmapFileName)
sprites["bearer"].src_rect.set(0, 0, 64, 64) sprites["bearer"].src_rect.set(0, 0, 64, 64)
end end
if mail.poke2 if mail.poke2
sprites["bearer2"] = IconSprite.new(144, 288, viewport) sprites["bearer2"] = IconSprite.new(144, 288, viewport)
bitmapFileName = GameData::Species.icon_filename(mail.poke2[0], bitmapFileName = GameData::Species.icon_filename(
mail.poke2[3], mail.poke2[1], mail.poke2[2], mail.poke2[4], mail.poke2[5]) mail.poke2[0], mail.poke2[3], mail.poke2[1], mail.poke2[2], mail.poke2[4], mail.poke2[5]
)
sprites["bearer2"].setBitmap(bitmapFileName) sprites["bearer2"].setBitmap(bitmapFileName)
sprites["bearer2"].src_rect.set(0, 0, 64, 64) sprites["bearer2"].src_rect.set(0, 0, 64, 64)
end end
if mail.poke3 if mail.poke3
sprites["bearer3"] = IconSprite.new(224, 288, viewport) sprites["bearer3"] = IconSprite.new(224, 288, viewport)
bitmapFileName = GameData::Species.icon_filename(mail.poke3[0], bitmapFileName = GameData::Species.icon_filename(
mail.poke3[3], mail.poke3[1], mail.poke3[2], mail.poke3[4], mail.poke3[5]) mail.poke3[0], mail.poke3[3], mail.poke3[1], mail.poke3[2], mail.poke3[4], mail.poke3[5]
)
sprites["bearer3"].setBitmap(bitmapFileName) sprites["bearer3"].setBitmap(bitmapFileName)
sprites["bearer3"].src_rect.set(0, 0, 64, 64) sprites["bearer3"].src_rect.set(0, 0, 64, 64)
end end
@@ -68,14 +71,14 @@ def pbDisplayMail(mail, _bearer = nil)
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, 32 * 7))
drawTextEx(overlay, 48, 52, Graphics.width - (48 * 2), 7, mail.message, drawTextEx(overlay, 48, 52, Graphics.width - (48 * 2), 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 * 1))
drawTextEx(overlay, 336, 326, 144, 1, mail.sender, drawTextEx(overlay, 336, 326, 144, 1, mail.sender,
(isDark) ? baseForDarkBG : baseForLightBG, (isDark) ? baseForDarkBG : baseForLightBG,
(isDark) ? shadowForDarkBG : shadowForLightBG) (isDark) ? shadowForDarkBG : shadowForLightBG)
end end
pbFadeInAndShow(sprites) pbFadeInAndShow(sprites)
loop do loop do
@@ -95,7 +98,7 @@ def pbWriteMail(item, pkmn, pkmnid, scene)
message = "" message = ""
loop do loop do
message = pbMessageFreeText(_INTL("Please enter a message (max. 250 characters)."), message = pbMessageFreeText(_INTL("Please enter a message (max. 250 characters)."),
"", false, 250, Graphics.width) { scene.pbUpdate } "", false, 250, Graphics.width) { scene.pbUpdate }
if message != "" if message != ""
# Store mail if a message was written # Store mail if a message was written
poke1 = poke2 = nil poke1 = poke2 = nil
+3 -2
View File
@@ -78,7 +78,8 @@ class PokemonBag
max_size = max_pocket_size(pocket) max_size = max_pocket_size(pocket)
max_size = @pockets[pocket].length + 1 if max_size < 0 # Infinite size max_size = @pockets[pocket].length + 1 if max_size < 0 # Infinite size
return ItemStorageHelper.can_add?( return ItemStorageHelper.can_add?(
@pockets[pocket], max_size, Settings::BAG_MAX_PER_SLOT, item_data.id, qty) @pockets[pocket], max_size, Settings::BAG_MAX_PER_SLOT, item_data.id, qty
)
end end
def add(item, qty = 1) def add(item, qty = 1)
@@ -88,7 +89,7 @@ class PokemonBag
max_size = max_pocket_size(pocket) max_size = max_pocket_size(pocket)
max_size = @pockets[pocket].length + 1 if max_size < 0 # Infinite size max_size = @pockets[pocket].length + 1 if max_size < 0 # Infinite size
ret = ItemStorageHelper.add(@pockets[pocket], ret = ItemStorageHelper.add(@pockets[pocket],
max_size, Settings::BAG_MAX_PER_SLOT, item_data.id, qty) max_size, Settings::BAG_MAX_PER_SLOT, item_data.id, qty)
if ret && Settings::BAG_POCKET_AUTO_SORT[pocket - 1] if ret && Settings::BAG_POCKET_AUTO_SORT[pocket - 1]
@pockets[pocket].sort! { |a, b| GameData::Item.keys.index(a[0]) <=> GameData::Item.keys.index(b[0]) } @pockets[pocket].sort! { |a, b| GameData::Item.keys.index(a[0]) <=> GameData::Item.keys.index(b[0]) }
end end
@@ -24,7 +24,7 @@ def pbNewTrainer(tr_type, tr_name, tr_version, save_changes = true)
params.setRange(1, GameData::GrowthRate.max_level) params.setRange(1, GameData::GrowthRate.max_level)
params.setDefaultValue(10) params.setDefaultValue(10)
level = pbMessageChooseNumber(_INTL("Set the level for {1} (max. #{params.maxNumber}).", level = pbMessageChooseNumber(_INTL("Set the level for {1} (max. #{params.maxNumber}).",
GameData::Species.get(species).name), params) GameData::Species.get(species).name), params)
party.push([species, level]) party.push([species, level])
break break
else else
@@ -87,7 +87,7 @@ def pbTrainerCheck(tr_type, tr_name, max_battles, tr_version = 0)
return true if GameData::Trainer.exists?(tr_type, tr_name, tr_version) return true if GameData::Trainer.exists?(tr_type, tr_name, tr_version)
# Add new trainer # Add new trainer
if pbConfirmMessage(_INTL("Add new trainer variant {1} (of {2}) for {3} {4}?", if pbConfirmMessage(_INTL("Add new trainer variant {1} (of {2}) for {3} {4}?",
tr_version, max_battles, tr_type.to_s, tr_name)) tr_version, max_battles, tr_type.to_s, tr_name))
pbNewTrainer(tr_type, tr_name, tr_version) pbNewTrainer(tr_type, tr_name, tr_version)
end end
return true return true
@@ -18,7 +18,7 @@ class PokemonEggHatch_Scene
@viewport.z = 99999 @viewport.z = 99999
# Create background image # Create background image
addBackgroundOrColoredPlane(@sprites, "background", "hatchbg", addBackgroundOrColoredPlane(@sprites, "background", "hatchbg",
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)
@sprites["pokemon"].setOffset(PictureOrigin::Bottom) @sprites["pokemon"].setOffset(PictureOrigin::Bottom)
@@ -46,7 +46,7 @@ class PokemonEggHatch_Scene
@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.new(255, 255, 255)) Color.new(255, 255, 255))
@sprites["overlay"].opacity = 0 @sprites["overlay"].opacity = 0
# Start up scene # Start up scene
pbFadeInAndShow(@sprites) pbFadeInAndShow(@sprites)
@@ -103,10 +103,10 @@ class PokemonEggHatch_Scene
pbMEPlay("Evolution success") pbMEPlay("Evolution success")
@pokemon.name = nil @pokemon.name = nil
pbMessage(_INTL("\\se[]{1} hatched from the Egg!\\wt[80]", @pokemon.name)) { update } pbMessage(_INTL("\\se[]{1} hatched from the Egg!\\wt[80]", @pokemon.name)) { update }
if pbConfirmMessage( if pbConfirmMessage(_INTL("Would you like to nickname the newly hatched {1}?",
_INTL("Would you like to nickname the newly hatched {1}?", @pokemon.name)) { update } @pokemon.name)) { update }
nickname = pbEnterPokemonName(_INTL("{1}'s nickname?", @pokemon.name), nickname = pbEnterPokemonName(_INTL("{1}'s nickname?", @pokemon.name),
0, Pokemon::MAX_NAME_SIZE, "", @pokemon, true) 0, Pokemon::MAX_NAME_SIZE, "", @pokemon, true)
@pokemon.name = nickname @pokemon.name = nickname
@nicknamed = true @nicknamed = true
end end
@@ -496,7 +496,7 @@ class PokemonEvolutionScene
@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", "evolutionbg",
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)
rsprite1.setPokemonBitmap(@pokemon, false) rsprite1.setPokemonBitmap(@pokemon, false)
@@ -534,7 +534,7 @@ class PokemonEvolutionScene
pbBGMStop pbBGMStop
@pokemon.play_cry @pokemon.play_cry
pbMessageDisplay(@sprites["msgwindow"], pbMessageDisplay(@sprites["msgwindow"],
_INTL("\\se[]What? {1} is evolving!\\^", @pokemon.name)) { pbUpdate } _INTL("\\se[]What? {1} is evolving!\\^", @pokemon.name)) { pbUpdate }
pbMessageWaitForInput(@sprites["msgwindow"], 50, true) { pbUpdate } pbMessageWaitForInput(@sprites["msgwindow"], 50, true) { pbUpdate }
pbPlayDecisionSE pbPlayDecisionSE
oldstate = pbSaveSpriteState(@sprites["rsprite1"]) oldstate = pbSaveSpriteState(@sprites["rsprite1"])
@@ -560,7 +560,7 @@ class PokemonEvolutionScene
if canceled if canceled
$stats.evolutions_cancelled += 1 $stats.evolutions_cancelled += 1
pbMessageDisplay(@sprites["msgwindow"], pbMessageDisplay(@sprites["msgwindow"],
_INTL("Huh? {1} stopped evolving!", @pokemon.name)) { pbUpdate } _INTL("Huh? {1} stopped evolving!", @pokemon.name)) { pbUpdate }
else else
pbEvolutionSuccess pbEvolutionSuccess
end end
@@ -580,8 +580,8 @@ class PokemonEvolutionScene
pbMEPlay("Evolution success") pbMEPlay("Evolution success")
newspeciesname = GameData::Species.get(@newspecies).name newspeciesname = GameData::Species.get(@newspecies).name
pbMessageDisplay(@sprites["msgwindow"], pbMessageDisplay(@sprites["msgwindow"],
_INTL("\\se[]Congratulations! Your {1} evolved into {2}!\\wt[80]", _INTL("\\se[]Congratulations! Your {1} evolved into {2}!\\wt[80]",
@pokemon.name, newspeciesname)) { pbUpdate } @pokemon.name, newspeciesname)) { pbUpdate }
@sprites["msgwindow"].text = "" @sprites["msgwindow"].text = ""
# Check for consumed item and check if Pokémon should be duplicated # Check for consumed item and check if Pokémon should be duplicated
pbEvolutionMethodAfterEvolution pbEvolutionMethodAfterEvolution
@@ -37,7 +37,7 @@ class PokemonTrade_Scene
@trader1 = trader1 @trader1 = trader1
@trader2 = trader2 @trader2 = trader2
addBackgroundOrColoredPlane(@sprites, "background", "tradebg", addBackgroundOrColoredPlane(@sprites, "background", "tradebg",
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)
@sprites["rsprite1"].setOffset(PictureOrigin::Bottom) @sprites["rsprite1"].setOffset(PictureOrigin::Bottom)
@@ -176,21 +176,21 @@ class PokemonTrade_Scene
speciesname1 = GameData::Species.get(@pokemon.species).name speciesname1 = GameData::Species.get(@pokemon.species).name
speciesname2 = GameData::Species.get(@pokemon2.species).name speciesname2 = GameData::Species.get(@pokemon2.species).name
pbMessageDisplay(@sprites["msgwindow"], pbMessageDisplay(@sprites["msgwindow"],
_ISPRINTF("{1:s}\r\nID: {2:05d} OT: {3:s}\\wtnp[0]", _ISPRINTF("{1:s}\r\nID: {2:05d} OT: {3:s}\\wtnp[0]",
@pokemon.name, @pokemon.owner.public_id, @pokemon.owner.name)) { pbUpdate } @pokemon.name, @pokemon.owner.public_id, @pokemon.owner.name)) { pbUpdate }
pbMessageWaitForInput(@sprites["msgwindow"], 50, true) { pbUpdate } pbMessageWaitForInput(@sprites["msgwindow"], 50, true) { pbUpdate }
pbPlayDecisionSE pbPlayDecisionSE
pbScene1 pbScene1
pbMessageDisplay(@sprites["msgwindow"], pbMessageDisplay(@sprites["msgwindow"],
_INTL("For {1}'s {2},\r\n{3} sends {4}.\1", @trader1, speciesname1, @trader2, speciesname2)) { pbUpdate } _INTL("For {1}'s {2},\r\n{3} sends {4}.\1", @trader1, speciesname1, @trader2, speciesname2)) { pbUpdate }
pbMessageDisplay(@sprites["msgwindow"], pbMessageDisplay(@sprites["msgwindow"],
_INTL("{1} bids farewell to {2}.", @trader2, speciesname2)) { pbUpdate } _INTL("{1} bids farewell to {2}.", @trader2, speciesname2)) { pbUpdate }
pbScene2 pbScene2
pbMessageDisplay(@sprites["msgwindow"], pbMessageDisplay(@sprites["msgwindow"],
_ISPRINTF("{1:s}\r\nID: {2:05d} OT: {3:s}\1", _ISPRINTF("{1:s}\r\nID: {2:05d} OT: {3:s}\1",
@pokemon2.name, @pokemon2.owner.public_id, @pokemon2.owner.name)) { pbUpdate } @pokemon2.name, @pokemon2.owner.public_id, @pokemon2.owner.name)) { pbUpdate }
pbMessageDisplay(@sprites["msgwindow"], pbMessageDisplay(@sprites["msgwindow"],
_INTL("Take good care of {1}.", speciesname2)) { pbUpdate } _INTL("Take good care of {1}.", speciesname2)) { pbUpdate }
end end
end end
@@ -283,13 +283,13 @@ class HallOfFame_Scene
lefttext += _INTL("IDNo.<r>{1}<br>", pubid) lefttext += _INTL("IDNo.<r>{1}<br>", pubid)
lefttext += _ISPRINTF("Time<r>{1:02d}:{2:02d}<br>", hour, min) lefttext += _ISPRINTF("Time<r>{1:02d}:{2:02d}<br>", hour, min)
lefttext += _INTL("Pokédex<r>{1}/{2}<br>", lefttext += _INTL("Pokédex<r>{1}/{2}<br>",
$player.pokedex.owned_count, $player.pokedex.seen_count) $player.pokedex.owned_count, $player.pokedex.seen_count)
@sprites["messagebox"] = Window_AdvancedTextPokemon.new(lefttext) @sprites["messagebox"] = Window_AdvancedTextPokemon.new(lefttext)
@sprites["messagebox"].viewport = @viewport @sprites["messagebox"].viewport = @viewport
@sprites["messagebox"].width = 192 if @sprites["messagebox"].width < 192 @sprites["messagebox"].width = 192 if @sprites["messagebox"].width < 192
@sprites["msgwindow"] = pbCreateMessageWindow(@viewport) @sprites["msgwindow"] = pbCreateMessageWindow(@viewport)
pbMessageDisplay(@sprites["msgwindow"], pbMessageDisplay(@sprites["msgwindow"],
_INTL("League champion!\nCongratulations!\\^")) _INTL("League champion!\nCongratulations!\\^"))
end end
def writePokemonData(pokemon, hallNumber = -1) def writePokemonData(pokemon, hallNumber = -1)
+4 -4
View File
@@ -130,15 +130,15 @@ class PokemonPauseMenu
@scene.pbShowInfo(_INTL("Balls: {1}", pbSafariState.ballcount)) @scene.pbShowInfo(_INTL("Balls: {1}", pbSafariState.ballcount))
else else
@scene.pbShowInfo(_INTL("Steps: {1}/{2}\nBalls: {3}", @scene.pbShowInfo(_INTL("Steps: {1}/{2}\nBalls: {3}",
pbSafariState.steps, Settings::SAFARI_STEPS, pbSafariState.ballcount)) pbSafariState.steps, Settings::SAFARI_STEPS, pbSafariState.ballcount))
end end
commands[cmdQuit = commands.length] = _INTL("Quit") commands[cmdQuit = commands.length] = _INTL("Quit")
elsif pbInBugContest? elsif pbInBugContest?
if pbBugContestState.lastPokemon if pbBugContestState.lastPokemon
@scene.pbShowInfo(_INTL("Caught: {1}\nLevel: {2}\nBalls: {3}", @scene.pbShowInfo(_INTL("Caught: {1}\nLevel: {2}\nBalls: {3}",
pbBugContestState.lastPokemon.speciesName, pbBugContestState.lastPokemon.speciesName,
pbBugContestState.lastPokemon.level, pbBugContestState.lastPokemon.level,
pbBugContestState.ballcount)) pbBugContestState.ballcount))
else else
@scene.pbShowInfo(_INTL("Caught: None\nBalls: {1}", pbBugContestState.ballcount)) @scene.pbShowInfo(_INTL("Caught: None\nBalls: {1}", pbBugContestState.ballcount))
end end
+4 -3
View File
@@ -18,9 +18,9 @@ class Window_DexesList < Window_CommandPokemon
super(index, count, rect) super(index, count, rect)
if index >= 0 && index < @commands2.length if index >= 0 && index < @commands2.length
pbDrawShadowText(self.contents, rect.x + 254, rect.y, 64, rect.height, pbDrawShadowText(self.contents, rect.x + 254, rect.y, 64, rect.height,
sprintf("%d", @commands2[index][0]), self.baseColor, self.shadowColor, 1) sprintf("%d", @commands2[index][0]), self.baseColor, self.shadowColor, 1)
pbDrawShadowText(self.contents, rect.x + 350, rect.y, 64, rect.height, pbDrawShadowText(self.contents, rect.x + 350, rect.y, 64, rect.height,
sprintf("%d", @commands2[index][1]), self.baseColor, self.shadowColor, 1) sprintf("%d", @commands2[index][1]), self.baseColor, self.shadowColor, 1)
allseen = (@commands2[index][0] >= @commands2[index][2]) allseen = (@commands2[index][0] >= @commands2[index][2])
allown = (@commands2[index][1] >= @commands2[index][2]) allown = (@commands2[index][1] >= @commands2[index][2])
pbDrawImagePositions(self.contents, [ pbDrawImagePositions(self.contents, [
@@ -47,7 +47,8 @@ class PokemonPokedexMenu_Scene
@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/Pictures/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
)
@sprites["headings"].windowskin = nil @sprites["headings"].windowskin = nil
@sprites["commands"] = Window_DexesList.new(commands, commands2, Graphics.width - 84) @sprites["commands"] = Window_DexesList.new(commands, commands2, Graphics.width - 84)
@sprites["commands"].x = 40 @sprites["commands"].x = 40
+1 -1
View File
@@ -49,7 +49,7 @@ class Window_Pokedex < Window_DrawableCommand
text = sprintf("%03d ----------", indexNumber) text = sprintf("%03d ----------", indexNumber)
end end
pbDrawShadowText(self.contents, rect.x + 36, rect.y + 6, rect.width, rect.height, pbDrawShadowText(self.contents, rect.x + 36, rect.y + 6, rect.width, rect.height,
text, self.baseColor, self.shadowColor) text, self.baseColor, self.shadowColor)
end end
def refresh def refresh
+23 -16
View File
@@ -127,7 +127,7 @@ class Window_CommandPokemonColor < Window_CommandPokemon
shadow = Color.new(128, 192, 240) shadow = Color.new(128, 192, 240)
end end
pbDrawShadowText(self.contents, rect.x, rect.y, rect.width, rect.height, pbDrawShadowText(self.contents, rect.x, rect.y, rect.width, rect.height,
@commands[index], base, shadow) @commands[index], base, shadow)
end end
end end
@@ -406,16 +406,14 @@ class PokemonPartyPanel < SpriteWrapper
# Draw shiny icon # Draw shiny icon
if @pokemon.shiny? if @pokemon.shiny?
pbDrawImagePositions(@overlaysprite.bitmap, pbDrawImagePositions(@overlaysprite.bitmap,
[["Graphics/Pictures/shiny", 80, 48, 0, 0, 16, 16]] [["Graphics/Pictures/shiny", 80, 48, 0, 0, 16, 16]])
)
end end
end end
pbDrawTextPositions(@overlaysprite.bitmap, textpos) pbDrawTextPositions(@overlaysprite.bitmap, textpos)
# Draw level text # Draw level text
if !@pokemon.egg? if !@pokemon.egg?
pbDrawImagePositions(@overlaysprite.bitmap, pbDrawImagePositions(@overlaysprite.bitmap,
[["Graphics/Pictures/Party/overlay_lv", 20, 70, 0, 0, 22, 14]] [["Graphics/Pictures/Party/overlay_lv", 20, 70, 0, 0, 22, 14]])
)
pbSetSmallFont(@overlaysprite.bitmap) pbSetSmallFont(@overlaysprite.bitmap)
pbDrawTextPositions(@overlaysprite.bitmap, [ pbDrawTextPositions(@overlaysprite.bitmap, [
[@pokemon.level.to_s, 42, 57, 0, basecolor, shadowcolor] [@pokemon.level.to_s, 42, 57, 0, basecolor, shadowcolor]
@@ -461,7 +459,8 @@ class PokemonParty_Scene
@sprites["messagebox"].letterbyletter = true @sprites["messagebox"].letterbyletter = true
pbBottomLeftLines(@sprites["messagebox"], 2) pbBottomLeftLines(@sprites["messagebox"], 2)
@sprites["storagetext"] = Window_UnformattedTextPokemon.new( @sprites["storagetext"] = Window_UnformattedTextPokemon.new(
@can_access_storage ? _INTL("[Special]: To Boxes") : "") @can_access_storage ? _INTL("[Special]: To Boxes") : ""
)
@sprites["storagetext"].x = 32 @sprites["storagetext"].x = 32
@sprites["storagetext"].y = Graphics.height - @sprites["messagebox"].height - 16 @sprites["storagetext"].y = Graphics.height - @sprites["messagebox"].height - 16
@sprites["storagetext"].z = 10 @sprites["storagetext"].z = 10
@@ -1103,11 +1102,15 @@ class PokemonPartyScreen
annot.push((elig) ? _INTL("ABLE") : _INTL("NOT ABLE")) annot.push((elig) ? _INTL("ABLE") : _INTL("NOT ABLE"))
end end
ret = -1 ret = -1
@scene.pbStartScene(@party, @scene.pbStartScene(
(@party.length > 1) ? _INTL("Choose a Pokémon.") : _INTL("Choose Pokémon or cancel."), annot) @party,
(@party.length > 1) ? _INTL("Choose a Pokémon.") : _INTL("Choose Pokémon or cancel."),
annot
)
loop do loop do
@scene.pbSetHelpText( @scene.pbSetHelpText(
(@party.length > 1) ? _INTL("Choose a Pokémon.") : _INTL("Choose Pokémon or cancel.")) (@party.length > 1) ? _INTL("Choose a Pokémon.") : _INTL("Choose Pokémon or cancel.")
)
pkmnid = @scene.pbChoosePokemon pkmnid = @scene.pbChoosePokemon
break if pkmnid < 0 break if pkmnid < 0
if !eligibility[pkmnid] && !allowIneligible if !eligibility[pkmnid] && !allowIneligible
@@ -1131,11 +1134,15 @@ class PokemonPartyScreen
annot.push((elig) ? _INTL("ABLE") : _INTL("NOT ABLE")) annot.push((elig) ? _INTL("ABLE") : _INTL("NOT ABLE"))
end end
ret = -1 ret = -1
@scene.pbStartScene(@party, @scene.pbStartScene(
(@party.length > 1) ? _INTL("Choose a Pokémon.") : _INTL("Choose Pokémon or cancel."), annot) @party,
(@party.length > 1) ? _INTL("Choose a Pokémon.") : _INTL("Choose Pokémon or cancel."),
annot
)
loop do loop do
@scene.pbSetHelpText( @scene.pbSetHelpText(
(@party.length > 1) ? _INTL("Choose a Pokémon.") : _INTL("Choose Pokémon or cancel.")) (@party.length > 1) ? _INTL("Choose a Pokémon.") : _INTL("Choose Pokémon or cancel.")
)
pkmnid = @scene.pbChoosePokemon pkmnid = @scene.pbChoosePokemon
break if pkmnid < 0 break if pkmnid < 0
if !eligibility[pkmnid] && !allowIneligible if !eligibility[pkmnid] && !allowIneligible
@@ -1158,8 +1165,8 @@ class PokemonPartyScreen
end end
end end
@scene.pbStartScene(@party, @scene.pbStartScene(@party,
(@party.length > 1) ? _INTL("Choose a Pokémon.") : _INTL("Choose Pokémon or cancel."), (@party.length > 1) ? _INTL("Choose a Pokémon.") : _INTL("Choose Pokémon or cancel."),
nil, false, can_access_storage) nil, false, can_access_storage)
loop do loop do
@scene.pbSetHelpText((@party.length > 1) ? _INTL("Choose a Pokémon.") : _INTL("Choose Pokémon or cancel.")) @scene.pbSetHelpText((@party.length > 1) ? _INTL("Choose a Pokémon.") : _INTL("Choose Pokémon or cancel."))
pkmnid = @scene.pbChoosePokemon(false, -1, 1) pkmnid = @scene.pbChoosePokemon(false, -1, 1)
@@ -1250,7 +1257,7 @@ class PokemonPartyScreen
return [pkmn, pkmn.moves[i].id] return [pkmn, pkmn.moves[i].id]
end end
@scene.pbStartScene(@party, @scene.pbStartScene(@party,
(@party.length > 1) ? _INTL("Choose a Pokémon.") : _INTL("Choose Pokémon or cancel.")) (@party.length > 1) ? _INTL("Choose a Pokémon.") : _INTL("Choose Pokémon or cancel."))
break break
end end
return [pkmn, pkmn.moves[i].id] return [pkmn, pkmn.moves[i].id]
@@ -1273,7 +1280,7 @@ class PokemonPartyScreen
end end
elsif cmdMail >= 0 && command == cmdMail elsif cmdMail >= 0 && command == cmdMail
command = @scene.pbShowCommands(_INTL("Do what with the mail?"), command = @scene.pbShowCommands(_INTL("Do what with the mail?"),
[_INTL("Read"), _INTL("Take"), _INTL("Cancel")]) [_INTL("Read"), _INTL("Take"), _INTL("Cancel")])
case command case command
when 0 # Read when 0 # Read
pbFadeOutIn { pbFadeOutIn {
+1 -1
View File
@@ -1084,7 +1084,7 @@ class PokemonSummary_Scene
markrect.x = i * MARK_WIDTH markrect.x = i * MARK_WIDTH
markrect.y = [(markings[i] || 0), mark_variants - 1].min * MARK_HEIGHT markrect.y = [(markings[i] || 0), mark_variants - 1].min * MARK_HEIGHT
@sprites["markingoverlay"].bitmap.blt(300 + 58 * (i % 3), 154 + 50 * (i / 3), @sprites["markingoverlay"].bitmap.blt(300 + 58 * (i % 3), 154 + 50 * (i / 3),
@markingbitmap.bitmap, markrect) @markingbitmap.bitmap, markrect)
end end
textpos = [ textpos = [
[_INTL("Mark {1}", pokemon.name), 366, 90, 2, base, shadow], [_INTL("Mark {1}", pokemon.name), 366, 90, 2, base, shadow],
+12 -7
View File
@@ -197,8 +197,9 @@ class PokemonBag_Scene
@sprites["itemlist"].baseColor = ITEMLISTBASECOLOR @sprites["itemlist"].baseColor = ITEMLISTBASECOLOR
@sprites["itemlist"].shadowColor = ITEMLISTSHADOWCOLOR @sprites["itemlist"].shadowColor = ITEMLISTSHADOWCOLOR
@sprites["itemicon"] = ItemIconSprite.new(48, Graphics.height - 48, nil, @viewport) @sprites["itemicon"] = ItemIconSprite.new(48, Graphics.height - 48, nil, @viewport)
@sprites["itemtext"] = Window_UnformattedTextPokemon.newWithSize("", @sprites["itemtext"] = Window_UnformattedTextPokemon.newWithSize(
72, 270, Graphics.width - 72 - 24, 128, @viewport) "", 72, 270, Graphics.width - 72 - 24, 128, @viewport
)
@sprites["itemtext"].baseColor = ITEMTEXTBASECOLOR @sprites["itemtext"].baseColor = ITEMTEXTBASECOLOR
@sprites["itemtext"].shadowColor = ITEMTEXTSHADOWCOLOR @sprites["itemtext"].shadowColor = ITEMTEXTSHADOWCOLOR
@sprites["itemtext"].visible = true @sprites["itemtext"].visible = true
@@ -268,13 +269,16 @@ class PokemonBag_Scene
if @choosing && @filterlist if @choosing && @filterlist
for i in 1...@bag.pockets.length for i in 1...@bag.pockets.length
if @filterlist[i].length == 0 if @filterlist[i].length == 0
@sprites["pocketicon"].bitmap.blt(6 + (i - 1) * 22, 6, @sprites["pocketicon"].bitmap.blt(
@pocketbitmap.bitmap, Rect.new((i - 1) * 20, 28, 20, 20)) 6 + (i - 1) * 22, 6, @pocketbitmap.bitmap, Rect.new((i - 1) * 20, 28, 20, 20)
)
end end
end end
end end
@sprites["pocketicon"].bitmap.blt(2 + (@sprites["itemlist"].pocket - 1) * 22, 2, @sprites["pocketicon"].bitmap.blt(
@pocketbitmap.bitmap, Rect.new((@sprites["itemlist"].pocket - 1) * 28, 0, 28, 28)) 2 + (@sprites["itemlist"].pocket - 1) * 22, 2, @pocketbitmap.bitmap,
Rect.new((@sprites["itemlist"].pocket - 1) * 28, 0, 28, 28)
)
# Refresh the item window # Refresh the item window
@sprites["itemlist"].refresh @sprites["itemlist"].refresh
# Refresh more things # Refresh more things
@@ -552,7 +556,8 @@ class PokemonBagScreen
params.setRange(0, Settings::BAG_MAX_PER_SLOT) params.setRange(0, Settings::BAG_MAX_PER_SLOT)
params.setDefaultValue(qty) params.setDefaultValue(qty)
newqty = pbMessageChooseNumber( newqty = pbMessageChooseNumber(
_INTL("Choose new quantity of {1} (max. #{Settings::BAG_MAX_PER_SLOT}).", itemplural), params) { @scene.pbUpdate } _INTL("Choose new quantity of {1} (max. #{Settings::BAG_MAX_PER_SLOT}).", itemplural), params
) { @scene.pbUpdate }
if newqty > qty if newqty > qty
@bag.add(item, newqty - qty) @bag.add(item, newqty - qty)
elsif newqty < qty elsif newqty < qty
+1 -1
View File
@@ -185,7 +185,7 @@ class PokemonRegionMap_Scene
f.write("\#-------------------------------\r\n") f.write("\#-------------------------------\r\n")
f.write(sprintf("[%d]\r\n", i)) f.write(sprintf("[%d]\r\n", i))
f.write(sprintf("Name = %s\r\nFilename = %s\r\n", f.write(sprintf("Name = %s\r\nFilename = %s\r\n",
Compiler.csvQuote(map[0]), Compiler.csvQuote(map[1]))) Compiler.csvQuote(map[0]), Compiler.csvQuote(map[1])))
for loc in map[2] for loc in map[2]
f.write("Point = ") f.write("Point = ")
Compiler.pbWriteCsvRecord(loc, f, [nil, "uussUUUU"]) Compiler.pbWriteCsvRecord(loc, f, [nil, "uussUUUU"])
+7 -6
View File
@@ -43,13 +43,15 @@ class PokemonPhoneScene
@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["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["header"] = Window_UnformattedTextPokemon.newWithSize(_INTL("Phone"), @sprites["header"] = Window_UnformattedTextPokemon.newWithSize(
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.new(0, 0, 0)
mapname = (@trainers[0][2]) ? pbGetMapNameFromId(@trainers[0][2]) : "" mapname = (@trainers[0][2]) ? pbGetMapNameFromId(@trainers[0][2]) : ""
@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"].text = "<ac>" + mapname
@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) addBackgroundPlane(@sprites, "bg", "phonebg", @viewport)
@@ -68,8 +70,7 @@ class PokemonPhoneScene
for trainer in @trainers for trainer in @trainers
if trainer.length == 4 if trainer.length == 4
displayname = _INTL("{1} {2}", GameData::TrainerType.get(trainer[0]).name, displayname = _INTL("{1} {2}", GameData::TrainerType.get(trainer[0]).name,
pbGetMessageFromHash(MessageTypes::TrainerNames, trainer[1]) pbGetMessageFromHash(MessageTypes::TrainerNames, trainer[1]))
)
commands.push(displayname) # trainer's display name commands.push(displayname) # trainer's display name
else else
commands.push(trainer[1]) # NPC's display name commands.push(trainer[1]) # NPC's display name
+5 -3
View File
@@ -14,12 +14,14 @@ class PokemonJukebox_Scene
@sprites["background"] = IconSprite.new(0, 0, @viewport) @sprites["background"] = IconSprite.new(0, 0, @viewport)
@sprites["background"].setBitmap("Graphics/Pictures/jukeboxbg") @sprites["background"].setBitmap("Graphics/Pictures/jukeboxbg")
@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.new(0, 0, 0)
@sprites["header"].windowskin = nil @sprites["header"].windowskin = nil
@sprites["commands"] = Window_CommandPokemon.newWithSize(@commands, @sprites["commands"] = Window_CommandPokemon.newWithSize(
94, 92, 324, 224, @viewport) @commands, 94, 92, 324, 224, @viewport
)
@sprites["commands"].windowskin = nil @sprites["commands"].windowskin = nil
pbFadeInAndShow(@sprites) { pbUpdate } pbFadeInAndShow(@sprites) { pbUpdate }
end end
+3 -3
View File
@@ -45,9 +45,9 @@ class PokemonTrainerCard_Scene
time = (hour > 0) ? _INTL("{1}h {2}m", hour, min) : _INTL("{1}m", min) time = (hour > 0) ? _INTL("{1}h {2}m", hour, min) : _INTL("{1}m", min)
$PokemonGlobal.startTime = pbGetTimeNow if !$PokemonGlobal.startTime $PokemonGlobal.startTime = pbGetTimeNow if !$PokemonGlobal.startTime
starttime = _INTL("{1} {2}, {3}", starttime = _INTL("{1} {2}, {3}",
pbGetAbbrevMonthName($PokemonGlobal.startTime.mon), pbGetAbbrevMonthName($PokemonGlobal.startTime.mon),
$PokemonGlobal.startTime.day, $PokemonGlobal.startTime.day,
$PokemonGlobal.startTime.year) $PokemonGlobal.startTime.year)
textPositions = [ textPositions = [
[_INTL("Name"), 34, 58, 0, baseColor, shadowColor], [_INTL("Name"), 34, 58, 0, baseColor, shadowColor],
[$player.name, 302, 58, 1, baseColor, shadowColor], [$player.name, 302, 58, 1, baseColor, shadowColor],
+4 -2
View File
@@ -106,8 +106,10 @@ class PokemonLoad_Scene
addBackgroundOrColoredPlane(@sprites, "background", "loadbg", Color.new(248, 248, 248), @viewport) addBackgroundOrColoredPlane(@sprites, "background", "loadbg", Color.new(248, 248, 248), @viewport)
y = 16 * 2 y = 16 * 2
for i in 0...commands.length for i in 0...commands.length
@sprites["panel#{i}"] = PokemonLoadPanel.new(i, commands[i], @sprites["panel#{i}"] = PokemonLoadPanel.new(
(show_continue) ? (i == 0) : false, trainer, frame_count, stats, map_id, @viewport) i, commands[i], (show_continue) ? (i == 0) : false, trainer,
frame_count, stats, map_id, @viewport
)
@sprites["panel#{i}"].x = 24 * 2 @sprites["panel#{i}"].x = 24 * 2
@sprites["panel#{i}"].y = y @sprites["panel#{i}"].y = y
@sprites["panel#{i}"].pbRefresh @sprites["panel#{i}"].pbRefresh
+1 -2
View File
@@ -87,8 +87,7 @@ class PokemonSaveScreen
pbMessage(_INTL('WARNING!')) pbMessage(_INTL('WARNING!'))
pbMessage(_INTL('There is a different game file that is already saved.')) pbMessage(_INTL('There is a different game file that is already saved.'))
pbMessage(_INTL("If you save now, the other file's adventure, including items and Pokémon, will be entirely lost.")) pbMessage(_INTL("If you save now, the other file's adventure, including items and Pokémon, will be entirely lost."))
if !pbConfirmMessageSerious( if !pbConfirmMessageSerious(_INTL('Are you sure you want to save now and overwrite the other save file?'))
_INTL('Are you sure you want to save now and overwrite the other save file?'))
pbSEPlay('GUI save choice') pbSEPlay('GUI save choice')
@scene.pbEndScreen @scene.pbEndScreen
return false return false
+19 -17
View File
@@ -205,7 +205,7 @@ class Window_PokemonOption < Window_DrawableCommand
optionname = (index == @options.length) ? _INTL("Cancel") : @options[index].name optionname = (index == @options.length) ? _INTL("Cancel") : @options[index].name
optionwidth = rect.width * 9 / 20 optionwidth = rect.width * 9 / 20
pbDrawShadowText(self.contents, rect.x, rect.y, optionwidth, rect.height, optionname, pbDrawShadowText(self.contents, rect.x, rect.y, optionwidth, rect.height, optionname,
@nameBaseColor, @nameShadowColor) @nameBaseColor, @nameShadowColor)
return if index == @options.length return if index == @options.length
if @options[index].is_a?(EnumOption) if @options[index].is_a?(EnumOption)
if @options[index].values.length > 1 if @options[index].values.length > 1
@@ -219,42 +219,42 @@ class Window_PokemonOption < Window_DrawableCommand
ivalue = 0 ivalue = 0
for value in @options[index].values for value in @options[index].values
pbDrawShadowText(self.contents, xpos, rect.y, optionwidth, rect.height, value, pbDrawShadowText(self.contents, xpos, rect.y, optionwidth, rect.height, value,
(ivalue == self[index]) ? @selBaseColor : self.baseColor, (ivalue == self[index]) ? @selBaseColor : self.baseColor,
(ivalue == self[index]) ? @selShadowColor : self.shadowColor (ivalue == self[index]) ? @selShadowColor : self.shadowColor)
)
xpos += self.contents.text_size(value).width xpos += self.contents.text_size(value).width
xpos += spacing xpos += spacing
ivalue += 1 ivalue += 1
end end
else else
pbDrawShadowText(self.contents, rect.x + optionwidth, rect.y, optionwidth, rect.height, pbDrawShadowText(self.contents, rect.x + optionwidth, rect.y, optionwidth, rect.height,
optionname, self.baseColor, self.shadowColor) optionname, self.baseColor, self.shadowColor)
end end
elsif @options[index].is_a?(NumberOption) elsif @options[index].is_a?(NumberOption)
value = _INTL("Type {1}/{2}", @options[index].optstart + self[index], value = _INTL("Type {1}/{2}", @options[index].optstart + self[index],
@options[index].optend - @options[index].optstart + 1) @options[index].optend - @options[index].optstart + 1)
xpos = optionwidth + rect.x xpos = optionwidth + rect.x
pbDrawShadowText(self.contents, xpos, rect.y, optionwidth, rect.height, value, pbDrawShadowText(self.contents, xpos, rect.y, optionwidth, rect.height, value,
@selBaseColor, @selShadowColor) @selBaseColor, @selShadowColor)
elsif @options[index].is_a?(SliderOption) elsif @options[index].is_a?(SliderOption)
value = sprintf(" %d", @options[index].optend) value = sprintf(" %d", @options[index].optend)
sliderlength = optionwidth - self.contents.text_size(value).width sliderlength = optionwidth - self.contents.text_size(value).width
xpos = optionwidth + rect.x xpos = optionwidth + rect.x
self.contents.fill_rect(xpos, rect.y - 2 + rect.height / 2, self.contents.fill_rect(xpos, rect.y - 2 + rect.height / 2,
optionwidth - self.contents.text_size(value).width, 4, self.baseColor) optionwidth - self.contents.text_size(value).width, 4, self.baseColor)
self.contents.fill_rect( self.contents.fill_rect(
xpos + (sliderlength - 8) * (@options[index].optstart + self[index]) / @options[index].optend, xpos + (sliderlength - 8) * (@options[index].optstart + self[index]) / @options[index].optend,
rect.y - 8 + rect.height / 2, rect.y - 8 + rect.height / 2,
8, 16, @selBaseColor) 8, 16, @selBaseColor
)
value = sprintf("%d", @options[index].optstart + self[index]) value = sprintf("%d", @options[index].optstart + self[index])
xpos += optionwidth - self.contents.text_size(value).width xpos += optionwidth - self.contents.text_size(value).width
pbDrawShadowText(self.contents, xpos, rect.y, optionwidth, rect.height, value, pbDrawShadowText(self.contents, xpos, rect.y, optionwidth, rect.height, value,
@selBaseColor, @selShadowColor) @selBaseColor, @selShadowColor)
else else
value = @options[index].values[self[index]] value = @options[index].values[self[index]]
xpos = optionwidth + rect.x xpos = optionwidth + rect.x
pbDrawShadowText(self.contents, xpos, rect.y, optionwidth, rect.height, value, pbDrawShadowText(self.contents, xpos, rect.y, optionwidth, rect.height, value,
@selBaseColor, @selShadowColor) @selBaseColor, @selShadowColor)
end end
end end
@@ -291,7 +291,8 @@ class PokemonOption_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["title"] = Window_UnformattedTextPokemon.newWithSize( @sprites["title"] = Window_UnformattedTextPokemon.newWithSize(
_INTL("Options"), 0, 0, Graphics.width, 64, @viewport) _INTL("Options"), 0, 0, Graphics.width, 64, @viewport
)
@sprites["textbox"] = pbCreateMessageWindow @sprites["textbox"] = pbCreateMessageWindow
@sprites["textbox"].text = _INTL("Speech frame {1}.", 1 + $PokemonSystem.textskin) @sprites["textbox"].text = _INTL("Speech frame {1}.", 1 + $PokemonSystem.textskin)
@sprites["textbox"].letterbyletter = false @sprites["textbox"].letterbyletter = false
@@ -376,9 +377,10 @@ class PokemonOption_Scene
) )
] ]
@PokemonOptions = pbAddOnOptions(@PokemonOptions) @PokemonOptions = pbAddOnOptions(@PokemonOptions)
@sprites["option"] = Window_PokemonOption.new(@PokemonOptions, 0, @sprites["option"] = Window_PokemonOption.new(
@sprites["title"].height, Graphics.width, @PokemonOptions, 0, @sprites["title"].height, Graphics.width,
Graphics.height - @sprites["title"].height - @sprites["textbox"].height) Graphics.height - @sprites["title"].height - @sprites["textbox"].height
)
@sprites["option"].viewport = @viewport @sprites["option"].viewport = @viewport
@sprites["option"].visible = true @sprites["option"].visible = true
# Get the values of each option # Get the values of each option
+10 -11
View File
@@ -95,9 +95,9 @@ class MosaicPokemonSprite < PokemonSprite
@mosaicbitmap2.clear @mosaicbitmap2.clear
@mosaicbitmap.stretch_blt(Rect.new(0, 0, newWidth, newHeight), @oldbitmap, @oldbitmap.rect) @mosaicbitmap.stretch_blt(Rect.new(0, 0, newWidth, newHeight), @oldbitmap, @oldbitmap.rect)
@mosaicbitmap2.stretch_blt( @mosaicbitmap2.stretch_blt(
Rect.new(-@mosaic / 2 + 1, -@mosaic / 2 + 1, Rect.new(-@mosaic / 2 + 1, -@mosaic / 2 + 1, @mosaicbitmap2.width, @mosaicbitmap2.height),
@mosaicbitmap2.width, @mosaicbitmap2.height), @mosaicbitmap, Rect.new(0, 0, newWidth, newHeight)
@mosaicbitmap, Rect.new(0, 0, newWidth, newHeight)) )
self.bitmap = @mosaicbitmap2 self.bitmap = @mosaicbitmap2
end end
@inrefresh = false @inrefresh = false
@@ -410,7 +410,7 @@ class PokemonBoxSprite < SpriteWrapper
widthval = @contents.text_size(boxname).width widthval = @contents.text_size(boxname).width
xval = 162 - (widthval / 2) xval = 162 - (widthval / 2)
pbDrawShadowText(@contents, xval, 8, widthval, 32, pbDrawShadowText(@contents, xval, 8, widthval, 32,
boxname, Color.new(248, 248, 248), Color.new(40, 48, 48)) boxname, Color.new(248, 248, 248), Color.new(40, 48, 48))
@refreshBox = false @refreshBox = false
end end
yval = self.y + 30 yval = self.y + 30
@@ -1326,7 +1326,7 @@ class PokemonStorageScene
markrect.x = i * MARK_WIDTH markrect.x = i * MARK_WIDTH
markrect.y = [(markings[i] || 0), mark_variants - 1].min * MARK_HEIGHT markrect.y = [(markings[i] || 0), mark_variants - 1].min * MARK_HEIGHT
@sprites["markingoverlay"].bitmap.blt(336 + 58 * (i % 3), 106 + 50 * (i / 3), @sprites["markingoverlay"].bitmap.blt(336 + 58 * (i % 3), 106 + 50 * (i / 3),
@markingbitmap.bitmap, markrect) @markingbitmap.bitmap, markrect)
end end
textpos = [ textpos = [
[_INTL("OK"), 402, 208, 2, base, shadow, 1], [_INTL("OK"), 402, 208, 2, base, shadow, 1],
@@ -1923,13 +1923,12 @@ class PokemonStorageScreen
def pbBoxCommands def pbBoxCommands
commands = [ commands = [
_INTL("Jump"), _INTL("Jump"),
_INTL("Wallpaper"), _INTL("Wallpaper"),
_INTL("Name"), _INTL("Name"),
_INTL("Cancel") _INTL("Cancel")
] ]
command = pbShowCommands( command = pbShowCommands(_INTL("What do you want to do?"), commands)
_INTL("What do you want to do?"), commands)
case command case command
when 0 when 0
destbox = @scene.pbChooseBox(_INTL("Jump to which Box?")) destbox = @scene.pbChooseBox(_INTL("Jump to which Box?"))
+4 -6
View File
@@ -44,8 +44,7 @@ class StorageSystemPC
[_INTL("Organize the Pokémon in Boxes and in your party."), [_INTL("Organize the Pokémon in Boxes and in your party."),
_INTL("Move Pokémon stored in Boxes to your party."), _INTL("Move Pokémon stored in Boxes to your party."),
_INTL("Store Pokémon in your party in Boxes."), _INTL("Store Pokémon in your party in Boxes."),
_INTL("Return to the previous menu.")], -1, command _INTL("Return to the previous menu.")], -1, command)
)
if command >= 0 && command < 3 if command >= 0 && command < 3
case command case command
when 1 # Withdraw when 1 # Withdraw
@@ -123,8 +122,7 @@ def pbPCItemStorage
[_INTL("Take out items from the PC."), [_INTL("Take out items from the PC."),
_INTL("Store items in the PC."), _INTL("Store items in the PC."),
_INTL("Throw away items stored in the PC."), _INTL("Throw away items stored in the PC."),
_INTL("Go back to the previous menu.")], -1, command _INTL("Go back to the previous menu.")], -1, command)
)
case command case command
when 0 # Withdraw Item when 0 # Withdraw Item
if !$PokemonGlobal.pcItemStorage if !$PokemonGlobal.pcItemStorage
@@ -179,7 +177,7 @@ def pbPCMailbox
if command >= 0 && command < $PokemonGlobal.mailbox.length if command >= 0 && command < $PokemonGlobal.mailbox.length
mailIndex = command mailIndex = command
commandMail = pbMessage(_INTL("What do you want to do with {1}'s Mail?", commandMail = pbMessage(_INTL("What do you want to do with {1}'s Mail?",
$PokemonGlobal.mailbox[mailIndex].sender), [ $PokemonGlobal.mailbox[mailIndex].sender), [
_INTL("Read"), _INTL("Read"),
_INTL("Move to Bag"), _INTL("Move to Bag"),
_INTL("Give"), _INTL("Give"),
@@ -241,7 +239,7 @@ def pbPokeCenterPC
loop do loop do
commands = PokemonPCList.getCommandList commands = PokemonPCList.getCommandList
command = pbMessage(_INTL("Which PC should be accessed?"), commands, command = pbMessage(_INTL("Which PC should be accessed?"), commands,
commands.length, nil, command) commands.length, nil, command)
break if !PokemonPCList.callCommand(command) break if !PokemonPCList.callCommand(command)
end end
pbSEPlay("PC close") pbSEPlay("PC close")
+15 -12
View File
@@ -203,13 +203,15 @@ class PokemonMart_Scene
@sprites["background"].setBitmap("Graphics/Pictures/martScreen") @sprites["background"].setBitmap("Graphics/Pictures/martScreen")
@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(stock, winAdapter, @sprites["itemwindow"] = Window_PokemonMart.new(
Graphics.width - 316 - 16, 12, 330 + 16, Graphics.height - 126) stock, winAdapter, Graphics.width - 316 - 16, 12, 330 + 16, Graphics.height - 126
)
@sprites["itemwindow"].viewport = @viewport @sprites["itemwindow"].viewport = @viewport
@sprites["itemwindow"].index = 0 @sprites["itemwindow"].index = 0
@sprites["itemwindow"].refresh @sprites["itemwindow"].refresh
@sprites["itemtextwindow"] = Window_UnformattedTextPokemon.newWithSize("", @sprites["itemtextwindow"] = Window_UnformattedTextPokemon.newWithSize(
64, Graphics.height - 96 - 16, Graphics.width - 64, 128, @viewport) "", 64, Graphics.height - 96 - 16, Graphics.width - 64, 128, @viewport
)
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.new(0, 0, 0)
@@ -554,7 +556,7 @@ class PokemonMartScreen
end end
if GameData::Item.get(item).is_important? if GameData::Item.get(item).is_important?
if !pbConfirm(_INTL("Certainly. You want {1}. That will be ${2}. OK?", if !pbConfirm(_INTL("Certainly. You want {1}. That will be ${2}. OK?",
itemname, price.to_s_formatted)) itemname, price.to_s_formatted))
next next
end end
quantity = 1 quantity = 1
@@ -562,11 +564,12 @@ class PokemonMartScreen
maxafford = (price <= 0) ? Settings::BAG_MAX_PER_SLOT : @adapter.getMoney / price maxafford = (price <= 0) ? Settings::BAG_MAX_PER_SLOT : @adapter.getMoney / price
maxafford = Settings::BAG_MAX_PER_SLOT if maxafford > Settings::BAG_MAX_PER_SLOT maxafford = Settings::BAG_MAX_PER_SLOT if maxafford > Settings::BAG_MAX_PER_SLOT
quantity = @scene.pbChooseNumber( quantity = @scene.pbChooseNumber(
_INTL("{1}? Certainly. How many would you like?", itemname), item, maxafford) _INTL("{1}? Certainly. How many would you like?", itemname), item, maxafford
)
next if quantity == 0 next if quantity == 0
price *= quantity price *= quantity
if !pbConfirm(_INTL("{1}, and you want {2}. That will be ${3}. OK?", if !pbConfirm(_INTL("{1}, and you want {2}. That will be ${3}. OK?",
itemname, quantity, price.to_s_formatted)) itemname, quantity, price.to_s_formatted))
next next
end end
end end
@@ -633,7 +636,8 @@ class PokemonMartScreen
@scene.pbShowMoney @scene.pbShowMoney
if qty > 1 if qty > 1
qty = @scene.pbChooseNumber( qty = @scene.pbChooseNumber(
_INTL("{1}? How many would you like to sell?", itemname), item, qty) _INTL("{1}? How many would you like to sell?", itemname), item, qty
)
end end
if qty == 0 if qty == 0
@scene.pbHideMoney @scene.pbHideMoney
@@ -669,9 +673,8 @@ def pbPokemonMart(stock, speech = nil, cantsell = false)
commands[cmdBuy = commands.length] = _INTL("Buy") commands[cmdBuy = commands.length] = _INTL("Buy")
commands[cmdSell = commands.length] = _INTL("Sell") if !cantsell commands[cmdSell = commands.length] = _INTL("Sell") if !cantsell
commands[cmdQuit = commands.length] = _INTL("Quit") commands[cmdQuit = commands.length] = _INTL("Quit")
cmd = pbMessage( cmd = pbMessage(speech ? speech : _INTL("Welcome! How may I serve you?"),
speech ? speech : _INTL("Welcome! How may I serve you?"), commands, cmdQuit + 1)
commands, cmdQuit + 1)
loop do loop do
if cmdBuy >= 0 && cmd == cmdBuy if cmdBuy >= 0 && cmd == cmdBuy
scene = PokemonMart_Scene.new scene = PokemonMart_Scene.new
@@ -686,7 +689,7 @@ def pbPokemonMart(stock, speech = nil, cantsell = false)
break break
end end
cmd = pbMessage(_INTL("Is there anything else I can help you with?"), cmd = pbMessage(_INTL("Is there anything else I can help you with?"),
commands, cmdQuit + 1) commands, cmdQuit + 1)
end end
$game_temp.clear_mart_prices $game_temp.clear_mart_prices
end end
+1 -1
View File
@@ -105,7 +105,7 @@ class MoveRelearner_Scene
end end
pbDrawImagePositions(overlay, imagepos) pbDrawImagePositions(overlay, imagepos)
drawTextEx(overlay, 272, 214, 230, 5, selMoveData.description, drawTextEx(overlay, 272, 214, 230, 5, selMoveData.description,
Color.new(64, 64, 64), Color.new(176, 176, 176)) Color.new(64, 64, 64), Color.new(176, 176, 176))
end end
# Processes the scene # Processes the scene
+14 -11
View File
@@ -411,7 +411,8 @@ class PurifyChamberScreen
if @chamber.setCount(set) == 0 && @chamber.isPurifiableIgnoreRegular?(set) if @chamber.setCount(set) == 0 && @chamber.isPurifiableIgnoreRegular?(set)
pkmn = @chamber.getShadow(set) pkmn = @chamber.getShadow(set)
@scene.pbDisplay( @scene.pbDisplay(
_INTL("This {1} is ready to open its heart. However, there must be at least one regular Pokémon in the set to perform a purification ceremony.", pkmn.name)) _INTL("This {1} is ready to open its heart. However, there must be at least one regular Pokémon in the set to perform a purification ceremony.", pkmn.name)
)
end end
end end
@@ -447,7 +448,8 @@ class PurifyChamberScreen
commands.push(_INTL("CANCEL")) commands.push(_INTL("CANCEL"))
choice = @scene.pbShowCommands( choice = @scene.pbShowCommands(
_INTL("What shall I do with this {1}?", _INTL("What shall I do with this {1}?",
heldpkmn ? heldpkmn.name : curpkmn.name), commands) heldpkmn ? heldpkmn.name : curpkmn.name), commands
)
if choice == 0 if choice == 0
if heldpkmn if heldpkmn
if pbPlace(heldpkmn, cmd[1]) # calls place or shift as appropriate if pbPlace(heldpkmn, cmd[1]) # calls place or shift as appropriate
@@ -664,7 +666,7 @@ class Window_PurifyChamberSets < Window_DrawableCommand
end end
if @chamber.setCount(index) > 0 if @chamber.setCount(index) > 0
pbDrawGauge(self.contents, Rect.new(rect.x + 16, rect.y + 6, 48, 8), pbDrawGauge(self.contents, Rect.new(rect.x + 16, rect.y + 6, 48, 8),
Color.new(0, 0, 256), @chamber[index].tempo, PurifyChamber.maximumTempo) Color.new(0, 0, 256), @chamber[index].tempo, PurifyChamber.maximumTempo)
end end
if @chamber.getShadow(index) if @chamber.getShadow(index)
pbDrawGauge(self.contents, Rect.new(rect.x + 16, rect.y + 18, 48, 8), pbDrawGauge(self.contents, Rect.new(rect.x + 16, rect.y + 18, 48, 8),
@@ -949,12 +951,12 @@ class PurifyChamberSetView < SpriteWrapper
if pkmn if pkmn
if pkmn.types.length == 1 if pkmn.types.length == 1
textpos.push([_INTL("{1} Lv.{2} {3}", pkmn.name, pkmn.level, textpos.push([_INTL("{1} Lv.{2} {3}", pkmn.name, pkmn.level,
GameData::Type.get(pkmn.types[0]).name), GameData::Type.get(pkmn.types[0]).name),
2, -6, 0, Color.new(248, 248, 248), Color.new(128, 128, 128)]) 2, -6, 0, Color.new(248, 248, 248), Color.new(128, 128, 128)])
else else
textpos.push([_INTL("{1} Lv.{2} {3}/{4}", pkmn.name, pkmn.level, textpos.push([_INTL("{1} Lv.{2} {3}/{4}", pkmn.name, pkmn.level,
GameData::Type.get(pkmn.types[0]).name, GameData::Type.get(pkmn.types[0]).name,
GameData::Type.get(pkmn.types[1]).name), GameData::Type.get(pkmn.types[1]).name),
2, -6, 0, Color.new(248, 248, 248), Color.new(128, 128, 128)]) 2, -6, 0, Color.new(248, 248, 248), Color.new(128, 128, 128)])
end end
textpos.push([_INTL("FLOW"), 2 + @info.bitmap.width / 2, 18, 0, textpos.push([_INTL("FLOW"), 2 + @info.bitmap.width / 2, 18, 0,
@@ -964,15 +966,15 @@ class PurifyChamberSetView < SpriteWrapper
Color.new(192, 0, 256), pkmn.heart_gauge, pkmn.max_gauge_size) Color.new(192, 0, 256), pkmn.heart_gauge, pkmn.max_gauge_size)
# draw flow gauge # draw flow gauge
pbDrawGauge(@info.bitmap, Rect.new(@info.bitmap.width * 3 / 4, 24 + 8, @info.bitmap.width * 1 / 4, 8), pbDrawGauge(@info.bitmap, Rect.new(@info.bitmap.width * 3 / 4, 24 + 8, @info.bitmap.width * 1 / 4, 8),
Color.new(0, 0, 248), @chamber.chamberFlow(@set), 6) Color.new(0, 0, 248), @chamber.chamberFlow(@set), 6)
end end
if @chamber.setCount(@set) > 0 if @chamber.setCount(@set) > 0
textpos.push([_INTL("TEMPO"), 2, 18, 0, textpos.push([_INTL("TEMPO"), 2, 18, 0,
Color.new(248, 248, 248), Color.new(128, 128, 128)]) Color.new(248, 248, 248), Color.new(128, 128, 128)])
# draw tempo gauge # draw tempo gauge
pbDrawGauge(@info.bitmap, Rect.new(@info.bitmap.width * 1 / 4, 24 + 8, @info.bitmap.width * 1 / 4, 8), pbDrawGauge(@info.bitmap, Rect.new(@info.bitmap.width * 1 / 4, 24 + 8, @info.bitmap.width * 1 / 4, 8),
Color.new(0, 0, 248), @chamber[@set].tempo, Color.new(0, 0, 248), @chamber[@set].tempo,
PurifyChamber.maximumTempo) PurifyChamber.maximumTempo)
end end
pbDrawTextPositions(@info.bitmap, textpos) pbDrawTextPositions(@info.bitmap, textpos)
@info.x = Graphics.width - @info.bitmap.width @info.x = Graphics.width - @info.bitmap.width
@@ -1111,9 +1113,10 @@ class PurifyChamberScene
@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", "purifychamberbg",
Color.new(0, 0, 0), @viewport) Color.new(0, 0, 0), @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
)
@sprites["setview"] = PurifyChamberSetView.new(@chamber, set, @viewport) @sprites["setview"] = PurifyChamberSetView.new(@chamber, set, @viewport)
@sprites["msgwindow"] = Window_AdvancedTextPokemon.new("") @sprites["msgwindow"] = Window_AdvancedTextPokemon.new("")
@sprites["msgwindow"].viewport = @viewportmsg @sprites["msgwindow"].viewport = @viewportmsg
+4 -3
View File
@@ -23,7 +23,8 @@ def pbEditMysteryGift(type, item, id = 0, giftname = "")
commands.push(_INTL("[Custom]")) commands.push(_INTL("[Custom]"))
loop do loop do
command = pbMessage( command = pbMessage(
_INTL("Choose a phrase to be where the gift Pokémon was obtained from."), commands, -1) _INTL("Choose a phrase to be where the gift Pokémon was obtained from."), commands, -1
)
if command < 0 if command < 0
return nil if pbConfirmMessage(_INTL("Stop editing this gift?")) return nil if pbConfirmMessage(_INTL("Stop editing this gift?"))
elsif command < commands.length - 1 elsif command < commands.length - 1
@@ -45,7 +46,7 @@ def pbEditMysteryGift(type, item, id = 0, giftname = "")
params.setCancelValue(0) params.setCancelValue(0)
loop do loop do
newtype = pbMessageChooseNumber(_INTL("Choose a quantity of {1}.", newtype = pbMessageChooseNumber(_INTL("Choose a quantity of {1}.",
GameData::Item.get(item).name), params) GameData::Item.get(item).name), params)
if newtype == 0 if newtype == 0
return nil if pbConfirmMessage(_INTL("Stop editing this gift?")) return nil if pbConfirmMessage(_INTL("Stop editing this gift?"))
else else
@@ -400,7 +401,7 @@ def pbReceiveMysteryGift(id)
pbMessage(_INTL("\\me[Item get]You obtained some \\c[1]{1}\\c[0]!\\wtnp[30]", itemname)) pbMessage(_INTL("\\me[Item get]You obtained some \\c[1]{1}\\c[0]!\\wtnp[30]", itemname))
elsif itm.is_machine? # TM or HM elsif itm.is_machine? # TM or HM
pbMessage(_INTL("\\me[Item get]You obtained \\c[1]{1} {2}\\c[0]!\\wtnp[30]", itemname, pbMessage(_INTL("\\me[Item get]You obtained \\c[1]{1} {2}\\c[0]!\\wtnp[30]", itemname,
GameData::Move.get(itm.move).name)) GameData::Move.get(itm.move).name))
elsif qty > 1 elsif qty > 1
pbMessage(_INTL("\\me[Item get]You obtained {1} \\c[1]{2}\\c[0]!\\wtnp[30]", qty, itemname)) pbMessage(_INTL("\\me[Item get]You obtained {1} \\c[1]{2}\\c[0]!\\wtnp[30]", qty, itemname))
elsif itemname.starts_with_vowel? elsif itemname.starts_with_vowel?
+7 -6
View File
@@ -50,16 +50,16 @@ class Window_CharacterEntry < Window_DrawableCommand
rect = drawCursor(index, rect) rect = drawCursor(index, rect)
if index == @charset.length # -1 if index == @charset.length # -1
pbDrawShadowText(self.contents, rect.x, rect.y, rect.width, rect.height, "[ ]", pbDrawShadowText(self.contents, rect.x, rect.y, rect.width, rect.height, "[ ]",
self.baseColor, self.shadowColor) self.baseColor, self.shadowColor)
elsif index == @charset.length + 1 # -2 elsif index == @charset.length + 1 # -2
pbDrawShadowText(self.contents, rect.x, rect.y, rect.width, rect.height, @othercharset, pbDrawShadowText(self.contents, rect.x, rect.y, rect.width, rect.height, @othercharset,
self.baseColor, self.shadowColor) self.baseColor, self.shadowColor)
elsif index == @charset.length + 2 # -3 elsif index == @charset.length + 2 # -3
pbDrawShadowText(self.contents, rect.x, rect.y, rect.width, rect.height, _INTL("OK"), pbDrawShadowText(self.contents, rect.x, rect.y, rect.width, rect.height, _INTL("OK"),
self.baseColor, self.shadowColor) self.baseColor, self.shadowColor)
else else
pbDrawShadowText(self.contents, rect.x, rect.y, rect.width, rect.height, @charset[index], pbDrawShadowText(self.contents, rect.x, rect.y, rect.width, rect.height, @charset[index],
self.baseColor, self.shadowColor) self.baseColor, self.shadowColor)
end end
end end
end end
@@ -81,8 +81,9 @@ class PokemonEntryScene
@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 USEKEYBOARD if USEKEYBOARD
@sprites["entry"] = Window_TextEntry_Keyboard.new(initialText, @sprites["entry"] = Window_TextEntry_Keyboard.new(
0, 0, 400 - 112, 96, helptext, true) initialText, 0, 0, 400 - 112, 96, helptext, true
)
Input.text_input = true Input.text_input = true
else else
@sprites["entry"] = Window_TextEntry.new(initialText, 0, 0, 400, 96, helptext, true) @sprites["entry"] = Window_TextEntry.new(initialText, 0, 0, 400, 96, helptext, true)
@@ -419,7 +419,8 @@ def pbDuel(trainer_id, trainer_name, event, speeches)
trainer_id = GameData::TrainerType.get(trainer_id).id trainer_id = GameData::TrainerType.get(trainer_id).id
duel = PokemonDuel.new duel = PokemonDuel.new
opponent = NPCTrainer.new( opponent = NPCTrainer.new(
pbGetMessageFromHash(MessageTypes::TrainerNames, trainer_name), trainer_id) pbGetMessageFromHash(MessageTypes::TrainerNames, trainer_name), trainer_id
)
speech_texts = [] speech_texts = []
for i in 0...12 for i in 0...12
speech_texts.push(_I(speeches[i])) speech_texts.push(_I(speeches[i]))
@@ -169,8 +169,9 @@ class TriadScene
@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", "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
)
for i in 0...@battle.width * @battle.height for i in 0...@battle.width * @battle.height
@sprites["sprite#{i}"] = SpriteWrapper.new(@viewport) @sprites["sprite#{i}"] = SpriteWrapper.new(@viewport)
@sprites["sprite#{i}"].x = Graphics.width / 2 - 118 + (i % 3) * 78 @sprites["sprite#{i}"].x = Graphics.width / 2 - 118 + (i % 3) * 78
@@ -637,7 +638,7 @@ class TriadScreen
def pbAdd(items, item) def pbAdd(items, item)
return ItemStorageHelper.add(items, $PokemonGlobal.triads.maxSize, return ItemStorageHelper.add(items, $PokemonGlobal.triads.maxSize,
TriadStorage::MAX_PER_SLOT, item, 1) TriadStorage::MAX_PER_SLOT, item, 1)
end end
def pbSubtract(items, item) def pbSubtract(items, item)
@@ -719,7 +720,7 @@ class TriadScreen
for i in 0...$PokemonGlobal.triads.length for i in 0...$PokemonGlobal.triads.length
item = $PokemonGlobal.triads[i] item = $PokemonGlobal.triads[i]
ItemStorageHelper.add(@triadCards, $PokemonGlobal.triads.maxSize, ItemStorageHelper.add(@triadCards, $PokemonGlobal.triads.maxSize,
TriadStorage::MAX_PER_SLOT, item[0], item[1]) TriadStorage::MAX_PER_SLOT, item[0], item[1])
count += item[1] # Add item count to total count count += item[1] # Add item count to total count
end end
@board = [] @board = []
@@ -1076,7 +1077,8 @@ def pbBuyTriads
cmdwindow = Window_CommandPokemonEx.newWithSize(realcommands, 0, 0, Graphics.width / 2, Graphics.height) cmdwindow = Window_CommandPokemonEx.newWithSize(realcommands, 0, 0, Graphics.width / 2, Graphics.height)
cmdwindow.z = 99999 cmdwindow.z = 99999
goldwindow = Window_UnformattedTextPokemon.newWithSize( goldwindow = Window_UnformattedTextPokemon.newWithSize(
_INTL("Money:\r\n{1}", pbGetGoldString), 0, 0, 32, 32) _INTL("Money:\r\n{1}", pbGetGoldString), 0, 0, 32, 32
)
goldwindow.resizeToFit(goldwindow.text, Graphics.width) goldwindow.resizeToFit(goldwindow.text, Graphics.width)
goldwindow.x = Graphics.width - goldwindow.width goldwindow.x = Graphics.width - goldwindow.width
goldwindow.y = 0 goldwindow.y = 0
@@ -1118,7 +1120,8 @@ def pbBuyTriads
params.setInitialValue(1) params.setInitialValue(1)
params.setCancelValue(0) params.setCancelValue(0)
quantity = pbMessageChooseNumber( quantity = pbMessageChooseNumber(
_INTL("The {1} card? Certainly. How many would you like?", itemname), params) _INTL("The {1} card? Certainly. How many would you like?", itemname), params
)
next if quantity <= 0 next if quantity <= 0
price *= quantity price *= quantity
next if !pbConfirmMessage(_INTL("{1}, and you want {2}. That will be ${3}. OK?", itemname, quantity, price.to_s_formatted)) next if !pbConfirmMessage(_INTL("{1}, and you want {2}. That will be ${3}. OK?", itemname, quantity, price.to_s_formatted))
@@ -1162,7 +1165,8 @@ def pbSellTriads
cmdwindow = Window_CommandPokemonEx.newWithSize(commands, 0, 0, Graphics.width / 2, Graphics.height) cmdwindow = Window_CommandPokemonEx.newWithSize(commands, 0, 0, Graphics.width / 2, Graphics.height)
cmdwindow.z = 99999 cmdwindow.z = 99999
goldwindow = Window_UnformattedTextPokemon.newWithSize( goldwindow = Window_UnformattedTextPokemon.newWithSize(
_INTL("Money:\r\n{1}", pbGetGoldString), 0, 0, 32, 32) _INTL("Money:\r\n{1}", pbGetGoldString), 0, 0, 32, 32
)
goldwindow.resizeToFit(goldwindow.text, Graphics.width) goldwindow.resizeToFit(goldwindow.text, Graphics.width)
goldwindow.x = Graphics.width - goldwindow.width goldwindow.x = Graphics.width - goldwindow.width
goldwindow.y = 0 goldwindow.y = 0
@@ -1216,7 +1220,8 @@ def pbSellTriads
params.setInitialValue(1) params.setInitialValue(1)
params.setCancelValue(0) params.setCancelValue(0)
quantity = pbMessageChooseNumber( quantity = pbMessageChooseNumber(
_INTL("The {1} card? How many would you like to sell?", itemname), params) _INTL("The {1} card? How many would you like to sell?", itemname), params
)
end end
if quantity > 0 if quantity > 0
price /= 4 price /= 4
@@ -254,7 +254,7 @@ class SlotMachineScene
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/Pictures/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)
@@ -85,12 +85,12 @@ class VoltorbFlip
pbUpdateColumnNumbers(0, 0, i) pbUpdateColumnNumbers(0, 0, i)
end end
pbDrawShadowText(@sprites["text"].bitmap, 8, 16, 118, 26, pbDrawShadowText(@sprites["text"].bitmap, 8, 16, 118, 26,
_INTL("Your coins"), Color.new(60, 60, 60), Color.new(150, 190, 170), 1) _INTL("Your coins"), Color.new(60, 60, 60), Color.new(150, 190, 170), 1)
pbDrawShadowText(@sprites["text"].bitmap, 8, 82, 118, 26, pbDrawShadowText(@sprites["text"].bitmap, 8, 82, 118, 26,
_INTL("Earned coins"), Color.new(60, 60, 60), Color.new(150, 190, 170), 1) _INTL("Earned coins"), Color.new(60, 60, 60), Color.new(150, 190, 170), 1)
# Draw current level # Draw current level
pbDrawShadowText(@sprites["level"].bitmap, 8, 150, 118, 28, pbDrawShadowText(@sprites["level"].bitmap, 8, 150, 118, 28,
_INTL("Level {1}", @level.to_s), Color.new(60, 60, 60), Color.new(150, 190, 170), 1) _INTL("Level {1}", @level.to_s), Color.new(60, 60, 60), Color.new(150, 190, 170), 1)
# Displays total and current coins # Displays total and current coins
pbUpdateCoins pbUpdateCoins
# Draw curtain effect # Draw curtain effect
@@ -492,9 +492,9 @@ class MiningGameScene
for index in revealed for index in revealed
burieditem = @items[index] burieditem = @items[index]
revealeditems.bitmap.blt(32 * burieditem[1], 64 + 32 * burieditem[2], revealeditems.bitmap.blt(32 * burieditem[1], 64 + 32 * burieditem[2],
@itembitmap.bitmap, @itembitmap.bitmap,
Rect.new(32 * ITEMS[burieditem[0]][2], 32 * ITEMS[burieditem[0]][3], Rect.new(32 * ITEMS[burieditem[0]][2], 32 * ITEMS[burieditem[0]][3],
32 * ITEMS[burieditem[0]][4], 32 * ITEMS[burieditem[0]][5])) 32 * ITEMS[burieditem[0]][4], 32 * ITEMS[burieditem[0]][5]))
if i > halfFlashTime if i > halfFlashTime
revealeditems.color = Color.new(255, 255, 255, (halfFlashTime * 2 - i) * alphaDiff) revealeditems.color = Color.new(255, 255, 255, (halfFlashTime * 2 - i) * alphaDiff)
else else
@@ -531,7 +531,7 @@ class MiningGameScene
collapseFraction = (Graphics.height.to_f / collapseTime).ceil collapseFraction = (Graphics.height.to_f / collapseTime).ceil
for i in 1..collapseTime for i in 1..collapseTime
@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.new(0, 0, 0))
Graphics.update Graphics.update
end end
pbMessage(_INTL("The wall collapsed!")) pbMessage(_INTL("The wall collapsed!"))
@@ -590,10 +590,10 @@ class MiningGameScene
for i in @itemswon for i in @itemswon
if $bag.add(i) if $bag.add(i)
pbMessage(_INTL("One {1} was obtained.\\se[Mining item get]\\wtnp[30]", pbMessage(_INTL("One {1} was obtained.\\se[Mining item get]\\wtnp[30]",
GameData::Item.get(i).name)) GameData::Item.get(i).name))
else else
pbMessage(_INTL("One {1} was found, but you have no room for it.", pbMessage(_INTL("One {1} was found, but you have no room for it.",
GameData::Item.get(i).name)) GameData::Item.get(i).name))
end end
end end
end end
@@ -56,11 +56,13 @@ class TilePuzzleCursor < BitmapSprite
if @game != 3 if @game != 3
expand = (@holding) ? 0 : 4 expand = (@holding) ? 0 : 4
for i in 0...4 for i in 0...4
self.bitmap.blt(x + (i % 2) * (@tilewidth - @cursorbitmap.width / 4) + expand * (((i % 2) * 2) - 1), self.bitmap.blt(
y + (i / 2) * (@tileheight - @cursorbitmap.height / 2) + expand * (((i / 2) * 2) - 1), x + (i % 2) * (@tilewidth - @cursorbitmap.width / 4) + expand * (((i % 2) * 2) - 1),
@cursorbitmap.bitmap, Rect.new( y + (i / 2) * (@tileheight - @cursorbitmap.height / 2) + expand * (((i / 2) * 2) - 1),
(i % 2) * @cursorbitmap.width / 4, (i / 2) * @cursorbitmap.height / 2, @cursorbitmap.bitmap, Rect.new((i % 2) * @cursorbitmap.width / 4,
@cursorbitmap.width / 4, @cursorbitmap.height / 2)) (i / 2) * @cursorbitmap.height / 2,
@cursorbitmap.width / 4, @cursorbitmap.height / 2)
)
end end
end end
# Arrows # Arrows
@@ -72,10 +74,10 @@ class TilePuzzleCursor < BitmapSprite
(@tileheight - @cursorbitmap.height / 2) / 2, -expand] (@tileheight - @cursorbitmap.height / 2) / 2, -expand]
for i in 0...4 for i in 0...4
if @arrows[i] if @arrows[i]
self.bitmap.blt(x + xin[i], y + yin[i], @cursorbitmap.bitmap, Rect.new( self.bitmap.blt(x + xin[i], y + yin[i], @cursorbitmap.bitmap,
@cursorbitmap.width / 2 + (i % 2) * (@cursorbitmap.width / 4), Rect.new(@cursorbitmap.width / 2 + (i % 2) * (@cursorbitmap.width / 4),
(i / 2) * (@cursorbitmap.height / 2), (i / 2) * (@cursorbitmap.height / 2),
@cursorbitmap.width / 4, @cursorbitmap.height / 2)) @cursorbitmap.width / 4, @cursorbitmap.height / 2))
end end
end end
end end
@@ -122,11 +124,11 @@ class TilePuzzleScene
@sprites["tile#{i}"].bitmap.clear @sprites["tile#{i}"].bitmap.clear
if rotatebitmaps[@angles[i]] if rotatebitmaps[@angles[i]]
@sprites["tile#{i}"].bitmap.blt(0, 0, rotatebitmaps[@angles[i]].bitmap, @sprites["tile#{i}"].bitmap.blt(0, 0, rotatebitmaps[@angles[i]].bitmap,
Rect.new(@tilewidth * (i % @boardwidth), @tileheight * (i / @boardwidth), @tilewidth, @tileheight)) Rect.new(@tilewidth * (i % @boardwidth), @tileheight * (i / @boardwidth), @tilewidth, @tileheight))
@sprites["tile#{i}"].angle = 0 @sprites["tile#{i}"].angle = 0
else else
@sprites["tile#{i}"].bitmap.blt(0, 0, @tilebitmap.bitmap, @sprites["tile#{i}"].bitmap.blt(0, 0, @tilebitmap.bitmap,
Rect.new(@tilewidth * (i % @boardwidth), @tileheight * (i / @boardwidth), @tilewidth, @tileheight)) Rect.new(@tilewidth * (i % @boardwidth), @tileheight * (i / @boardwidth), @tilewidth, @tileheight))
@sprites["tile#{i}"].angle = @angles[i] * 90 @sprites["tile#{i}"].angle = @angles[i] * 90
end end
end end
@@ -173,13 +175,13 @@ class TilePuzzleScene
@sprites["tile#{i}"].oy = @tileheight / 2 @sprites["tile#{i}"].oy = @tileheight / 2
break if @game == 3 && i >= @boardwidth * @boardheight - 1 break if @game == 3 && i >= @boardwidth * @boardheight - 1
@sprites["tile#{i}"].bitmap.blt(0, 0, @tilebitmap.bitmap, @sprites["tile#{i}"].bitmap.blt(0, 0, @tilebitmap.bitmap,
Rect.new(@tilewidth * (i % @boardwidth), @tileheight * (i / @boardwidth), @tilewidth, @tileheight)) Rect.new(@tilewidth * (i % @boardwidth), @tileheight * (i / @boardwidth), @tilewidth, @tileheight))
end end
@heldtile = -1 @heldtile = -1
@angles = [] @angles = []
@tiles = pbShuffleTiles @tiles = pbShuffleTiles
@sprites["cursor"] = TilePuzzleCursor.new(@game, pbDefaultCursorPosition, @sprites["cursor"] = TilePuzzleCursor.new(@game, pbDefaultCursorPosition,
@tilewidth, @tileheight, @boardwidth, @boardheight) @tilewidth, @tileheight, @boardwidth, @boardheight)
update update
pbFadeInAndShow(@sprites) pbFadeInAndShow(@sprites)
end end
@@ -509,8 +511,8 @@ class TilePuzzleScene
extratile = @sprites["tile#{@boardwidth * @boardheight - 1}"] extratile = @sprites["tile#{@boardwidth * @boardheight - 1}"]
extratile.bitmap.clear extratile.bitmap.clear
extratile.bitmap.blt(0, 0, @tilebitmap.bitmap, extratile.bitmap.blt(0, 0, @tilebitmap.bitmap,
Rect.new(@tilewidth * (@boardwidth - 1), @tileheight * (@boardheight - 1), Rect.new(@tilewidth * (@boardwidth - 1), @tileheight * (@boardheight - 1),
@tilewidth, @tileheight)) @tilewidth, @tileheight))
extratile.opacity = 0 extratile.opacity = 0
appearTime = Graphics.frame_rate * 8 / 10 appearTime = Graphics.frame_rate * 8 / 10
opacityDiff = (255.0 / appearTime).ceil opacityDiff = (255.0 / appearTime).ceil
@@ -20,8 +20,8 @@ class BattleChallenge
@numRounds = numrounds @numRounds = numrounds
@rules = rules @rules = rules
register(id, id[/double/], 3, register(id, id[/double/], 3,
id[/^factory/] ? BattleFactoryID : BattleTowerID, id[/^factory/] ? BattleFactoryID : BattleTowerID,
id[/open$/] ? 1 : 0) id[/open$/] ? 1 : 0)
pbWriteCup(id, rules) pbWriteCup(id, rules)
end end
@@ -99,8 +99,8 @@ class BattleChallenge
bttrainers = pbGetBTTrainers(@id) bttrainers = pbGetBTTrainers(@id)
trainerdata = bttrainers[self.nextTrainer] trainerdata = bttrainers[self.nextTrainer]
ret = pbOrganizedBattleEx(opponent, self.rules, ret = pbOrganizedBattleEx(opponent, self.rules,
pbGetMessageFromHash(MessageTypes::EndSpeechLose, trainerdata[4]), pbGetMessageFromHash(MessageTypes::EndSpeechLose, trainerdata[4]),
pbGetMessageFromHash(MessageTypes::EndSpeechWin, trainerdata[3])) pbGetMessageFromHash(MessageTypes::EndSpeechWin, trainerdata[3]))
return ret return ret
end end
@@ -372,8 +372,9 @@ class BattleFactoryData
bttrainers = pbGetBTTrainers(pbBattleChallenge.currentChallenge) bttrainers = pbGetBTTrainers(pbBattleChallenge.currentChallenge)
trainerdata = bttrainers[@trainerid] trainerdata = bttrainers[@trainerid]
@opponent = NPCTrainer.new( @opponent = NPCTrainer.new(
pbGetMessageFromHash(MessageTypes::TrainerNames, trainerdata[1]), pbGetMessageFromHash(MessageTypes::TrainerNames, trainerdata[1]),
trainerdata[0]) trainerdata[0]
)
opponentPkmn = pbBattleFactoryPokemon(pbBattleChallenge.rules, @bcdata.wins, @bcdata.swaps, @rentals) opponentPkmn = pbBattleFactoryPokemon(pbBattleChallenge.rules, @bcdata.wins, @bcdata.swaps, @rentals)
@opponent.party = opponentPkmn.sample(3) @opponent.party = opponentPkmn.sample(3)
end end
@@ -394,10 +395,11 @@ class BattleFactoryData
bttrainers = pbGetBTTrainers(pbBattleChallenge.currentChallenge) bttrainers = pbGetBTTrainers(pbBattleChallenge.currentChallenge)
trainerdata = bttrainers[trainerid] trainerdata = bttrainers[trainerid]
@opponent = NPCTrainer.new( @opponent = NPCTrainer.new(
pbGetMessageFromHash(MessageTypes::TrainerNames, trainerdata[1]), pbGetMessageFromHash(MessageTypes::TrainerNames, trainerdata[1]),
trainerdata[0]) trainerdata[0]
)
opponentPkmn = pbBattleFactoryPokemon(pbBattleChallenge.rules, @bcdata.wins, @bcdata.swaps, opponentPkmn = pbBattleFactoryPokemon(pbBattleChallenge.rules, @bcdata.wins, @bcdata.swaps,
[].concat(@rentals).concat(@oldopponent)) [].concat(@rentals).concat(@oldopponent))
@opponent.party = opponentPkmn.sample(3) @opponent.party = opponentPkmn.sample(3)
end end
@@ -417,7 +419,7 @@ class BattleFactoryData
bttrainers = pbGetBTTrainers(pbBattleChallenge.currentChallenge) bttrainers = pbGetBTTrainers(pbBattleChallenge.currentChallenge)
trainerdata = bttrainers[@trainerid] trainerdata = bttrainers[@trainerid]
return pbOrganizedBattleEx(@opponent, challenge.rules, return pbOrganizedBattleEx(@opponent, challenge.rules,
pbGetMessageFromHash(MessageTypes::EndSpeechLose, trainerdata[4]), pbGetMessageFromHash(MessageTypes::EndSpeechLose, trainerdata[4]),
pbGetMessageFromHash(MessageTypes::EndSpeechWin, trainerdata[3])) pbGetMessageFromHash(MessageTypes::EndSpeechWin, trainerdata[3]))
end end
end end
@@ -148,7 +148,7 @@ class PBPokemon
ev_array.push(s.id) if pkmn.ev[s.id] > 60 ev_array.push(s.id) if pkmn.ev[s.id] > 60
end end
return self.new(pkmn.species, pkmn.item_id, pkmn.nature, return self.new(pkmn.species, pkmn.item_id, pkmn.nature,
mov1, mov2, mov3, mov4, ev_array) mov1, mov2, mov3, mov4, ev_array)
end end
def initialize(species, item, nature, move1, move2, move3, move4, ev) def initialize(species, item, nature, move1, move2, move3, move4, ev)
@@ -43,8 +43,9 @@ def pbGenerateBattleTrainer(idxTrainer, rules)
# Create the trainer # Create the trainer
trainerdata = bttrainers[idxTrainer] trainerdata = bttrainers[idxTrainer]
opponent = NPCTrainer.new( opponent = NPCTrainer.new(
pbGetMessageFromHash(MessageTypes::TrainerNames, trainerdata[1]), pbGetMessageFromHash(MessageTypes::TrainerNames, trainerdata[1]),
trainerdata[0]) trainerdata[0]
)
# Determine how many IVs the trainer's Pokémon will have # Determine how many IVs the trainer's Pokémon will have
indvalues = 31 indvalues = 31
indvalues = 21 if idxTrainer < 220 indvalues = 21 if idxTrainer < 220
@@ -7,13 +7,17 @@ class BattleSwapScene
@sprites = {} @sprites = {}
addBackgroundPlane(@sprites, "bg", "rentbg", @viewport) addBackgroundPlane(@sprites, "bg", "rentbg", @viewport)
@sprites["title"] = Window_UnformattedTextPokemon.newWithSize( @sprites["title"] = Window_UnformattedTextPokemon.newWithSize(
_INTL("RENTAL POKéMON"), 0, 0, Graphics.width, 64, @viewport) _INTL("RENTAL POKéMON"), 0, 0, Graphics.width, 64, @viewport
)
@sprites["list"] = Window_AdvancedCommandPokemonEx.newWithSize( @sprites["list"] = Window_AdvancedCommandPokemonEx.newWithSize(
[], 0, 64, Graphics.width, Graphics.height - 128, @viewport) [], 0, 64, Graphics.width, Graphics.height - 128, @viewport
@sprites["help"] = Window_UnformattedTextPokemon.newWithSize("", )
0, Graphics.height - 64, Graphics.width, 64, @viewport) @sprites["help"] = Window_UnformattedTextPokemon.newWithSize(
@sprites["msgwindow"] = Window_AdvancedTextPokemon.newWithSize("", "", 0, Graphics.height - 64, Graphics.width, 64, @viewport
0, Graphics.height - 64, Graphics.height, 64, @viewport) )
@sprites["msgwindow"] = Window_AdvancedTextPokemon.newWithSize(
"", 0, Graphics.height - 64, Graphics.height, 64, @viewport
)
@sprites["msgwindow"].visible = false @sprites["msgwindow"].visible = false
pbUpdateChoices([]) pbUpdateChoices([])
pbDeactivateWindows(@sprites) pbDeactivateWindows(@sprites)
@@ -29,13 +33,17 @@ class BattleSwapScene
@sprites = {} @sprites = {}
addBackgroundPlane(@sprites, "bg", "swapbg", @viewport) addBackgroundPlane(@sprites, "bg", "swapbg", @viewport)
@sprites["title"] = Window_UnformattedTextPokemon.newWithSize( @sprites["title"] = Window_UnformattedTextPokemon.newWithSize(
_INTL("POKéMON SWAP"), 0, 0, Graphics.width, 64, @viewport) _INTL("POKéMON SWAP"), 0, 0, Graphics.width, 64, @viewport
)
@sprites["list"] = Window_AdvancedCommandPokemonEx.newWithSize( @sprites["list"] = Window_AdvancedCommandPokemonEx.newWithSize(
[], 0, 64, Graphics.width, Graphics.height - 128, @viewport) [], 0, 64, Graphics.width, Graphics.height - 128, @viewport
)
@sprites["help"] = Window_UnformattedTextPokemon.newWithSize( @sprites["help"] = Window_UnformattedTextPokemon.newWithSize(
"", 0, Graphics.height - 64, Graphics.width, 64, @viewport) "", 0, Graphics.height - 64, Graphics.width, 64, @viewport
)
@sprites["msgwindow"] = Window_AdvancedTextPokemon.newWithSize( @sprites["msgwindow"] = Window_AdvancedTextPokemon.newWithSize(
"", 0, Graphics.height - 64, Graphics.width, 64, @viewport) "", 0, Graphics.height - 64, Graphics.width, 64, @viewport
)
@sprites["msgwindow"].visible = false @sprites["msgwindow"].visible = false
pbInitSwapScreen pbInitSwapScreen
pbDeactivateWindows(@sprites) pbDeactivateWindows(@sprites)

Some files were not shown because too many files have changed in this diff Show More