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

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