mirror of
https://github.com/infinitefusion/infinitefusion-e18.git
synced 2025-12-07 21:24:59 +00:00
More tweaks from the Rubocop overlord
This commit is contained in:
@@ -89,8 +89,8 @@ class PokemonEggHatch_Scene
|
||||
@pokemon.species_data.apply_metrics_to_sprite(@sprites["pokemon"], 1)
|
||||
@sprites["hatch"].visible = false
|
||||
for i in 1..fadeTime
|
||||
@sprites["pokemon"].tone = Tone.new(255 - i * toneDiff, 255 - i * toneDiff, 255 - i * toneDiff)
|
||||
@sprites["overlay"].opacity = 255 - i * toneDiff
|
||||
@sprites["pokemon"].tone = Tone.new(255 - (i * toneDiff), 255 - (i * toneDiff), 255 - (i * toneDiff))
|
||||
@sprites["overlay"].opacity = 255 - (i * toneDiff)
|
||||
updateScene
|
||||
end
|
||||
@sprites["pokemon"].tone = Tone.new(0, 0, 0)
|
||||
|
||||
@@ -34,13 +34,13 @@ class SpriteMetafile
|
||||
def initialize(viewport = nil)
|
||||
@metafile = []
|
||||
@values = [
|
||||
viewport,
|
||||
Tone.new(0, 0, 0, 0), Rect.new(0, 0, 0, 0),
|
||||
true,
|
||||
0, 0, 0, 0, 0, 100, 100,
|
||||
0, false, 0, 255, 0,
|
||||
Color.new(0, 0, 0, 0), Color.new(0, 0, 0, 0),
|
||||
0
|
||||
viewport,
|
||||
Tone.new(0, 0, 0, 0), Rect.new(0, 0, 0, 0),
|
||||
true,
|
||||
0, 0, 0, 0, 0, 100, 100,
|
||||
0, false, 0, 255, 0,
|
||||
Color.new(0, 0, 0, 0), Color.new(0, 0, 0, 0),
|
||||
0
|
||||
]
|
||||
end
|
||||
|
||||
|
||||
@@ -93,8 +93,8 @@ class PokemonTrade_Scene
|
||||
pictureBall.moveXY(delay, 6, Graphics.width / 2, -32)
|
||||
# Play animation
|
||||
pbRunPictures(
|
||||
[picturePoke, pictureBall],
|
||||
[@sprites["rsprite1"], spriteBall]
|
||||
[picturePoke, pictureBall],
|
||||
[@sprites["rsprite1"], spriteBall]
|
||||
)
|
||||
spriteBall.dispose
|
||||
end
|
||||
@@ -124,12 +124,12 @@ class PokemonTrade_Scene
|
||||
d = [1, 2, 4, 8][i] # Fraction of the starting height each bounce rises to
|
||||
delay -= t if i == 0
|
||||
if i > 0
|
||||
pictureBall.setZoomXY(delay, 100 + 5 * (5 - i), 100 - 5 * (5 - i)) # Squish
|
||||
pictureBall.setZoomXY(delay, 100 + (5 * (5 - i)), 100 - (5 * (5 - i))) # Squish
|
||||
pictureBall.moveZoom(delay, 2, 100) # Unsquish
|
||||
pictureBall.moveXY(delay, t, Graphics.width / 2, y - 100 / d)
|
||||
pictureBall.moveXY(delay, t, Graphics.width / 2, y - (100 / d))
|
||||
end
|
||||
pictureBall.moveXY(delay + t, t, Graphics.width / 2, y)
|
||||
pictureBall.setSE(delay + 2 * t, "Battle ball drop")
|
||||
pictureBall.setSE(delay + (2 * t), "Battle ball drop")
|
||||
delay = pictureBall.totalDuration
|
||||
end
|
||||
picturePoke.setXY(delay, Graphics.width / 2, y)
|
||||
@@ -150,8 +150,8 @@ class PokemonTrade_Scene
|
||||
picturePoke.setSE(delay, cry) if cry
|
||||
# Play animation
|
||||
pbRunPictures(
|
||||
[picturePoke, pictureBall],
|
||||
[@sprites["rsprite2"], spriteBall]
|
||||
[picturePoke, pictureBall],
|
||||
[@sprites["rsprite2"], spriteBall]
|
||||
)
|
||||
spriteBall.dispose
|
||||
end
|
||||
|
||||
@@ -139,10 +139,10 @@ class HallOfFame_Scene
|
||||
def xpointformula(battlernumber)
|
||||
ret = 0
|
||||
if !SINGLEROW
|
||||
ret = 32 + 160 * xpositionformula(battlernumber)
|
||||
ret = 32 + (160 * xpositionformula(battlernumber))
|
||||
else
|
||||
ret = (60 * (battlernumber / 2) + 48) * (xpositionformula(battlernumber) - 1)
|
||||
ret += Graphics.width / 2 - 56
|
||||
ret = ((60 * (battlernumber / 2)) + 48) * (xpositionformula(battlernumber) - 1)
|
||||
ret += (Graphics.width / 2) - 56
|
||||
end
|
||||
return ret
|
||||
end
|
||||
@@ -150,9 +150,9 @@ class HallOfFame_Scene
|
||||
def ypointformula(battlernumber)
|
||||
ret = 0
|
||||
if !SINGLEROW
|
||||
ret = 32 + 128 * ypositionformula(battlernumber) / 2
|
||||
ret = 32 + (128 * ypositionformula(battlernumber) / 2)
|
||||
else
|
||||
ret = 96 - 8 * (battlernumber / 2)
|
||||
ret = 96 - (8 * (battlernumber / 2))
|
||||
end
|
||||
return ret
|
||||
end
|
||||
@@ -311,16 +311,16 @@ class HallOfFame_Scene
|
||||
dexnumber = _ISPRINTF("No. {1:03d}", number)
|
||||
end
|
||||
textPositions = [
|
||||
[dexnumber, 32, Graphics.height - 86, 0, BASECOLOR, SHADOWCOLOR],
|
||||
[pokename, Graphics.width - 192, Graphics.height - 86, 2, BASECOLOR, SHADOWCOLOR],
|
||||
[_INTL("Lv. {1}", pokemon.egg? ? "?" : pokemon.level),
|
||||
64, Graphics.height - 54, 0, BASECOLOR, SHADOWCOLOR],
|
||||
[_INTL("IDNo.{1}", pokemon.egg? ? "?????" : idno),
|
||||
Graphics.width - 192, Graphics.height - 54, 2, BASECOLOR, SHADOWCOLOR]
|
||||
[dexnumber, 32, Graphics.height - 86, 0, BASECOLOR, SHADOWCOLOR],
|
||||
[pokename, Graphics.width - 192, Graphics.height - 86, 2, BASECOLOR, SHADOWCOLOR],
|
||||
[_INTL("Lv. {1}", pokemon.egg? ? "?" : pokemon.level),
|
||||
64, Graphics.height - 54, 0, BASECOLOR, SHADOWCOLOR],
|
||||
[_INTL("IDNo.{1}", pokemon.egg? ? "?????" : idno),
|
||||
Graphics.width - 192, Graphics.height - 54, 2, BASECOLOR, SHADOWCOLOR]
|
||||
]
|
||||
if (hallNumber > -1)
|
||||
textPositions.push([_INTL("Hall of Fame No."), Graphics.width / 2 - 104, -6, 0, BASECOLOR, SHADOWCOLOR])
|
||||
textPositions.push([hallNumber.to_s, Graphics.width / 2 + 104, -6, 1, BASECOLOR, SHADOWCOLOR])
|
||||
textPositions.push([_INTL("Hall of Fame No."), (Graphics.width / 2) - 104, -6, 0, BASECOLOR, SHADOWCOLOR])
|
||||
textPositions.push([hallNumber.to_s, (Graphics.width / 2) + 104, -6, 1, BASECOLOR, SHADOWCOLOR])
|
||||
end
|
||||
pbDrawTextPositions(overlay, textPositions)
|
||||
end
|
||||
|
||||
@@ -118,14 +118,14 @@ _END_
|
||||
pcred = PluginManager.credits(plugin)
|
||||
plugin_credits << "\"#{plugin}\" v.#{PluginManager.version(plugin)} by:\n"
|
||||
if pcred.size >= 5
|
||||
plugin_credits << pcred[0] + "\n"
|
||||
plugin_credits << (pcred[0] + "\n")
|
||||
i = 1
|
||||
until i >= pcred.size
|
||||
plugin_credits << pcred[i] + "<s>" + (pcred[i + 1] || "") + "\n"
|
||||
plugin_credits << (pcred[i] + "<s>" + (pcred[i + 1] || "") + "\n")
|
||||
i += 2
|
||||
end
|
||||
else
|
||||
pcred.each { |name| plugin_credits << name + "\n" }
|
||||
pcred.each { |name| plugin_credits << (name + "\n") }
|
||||
end
|
||||
plugin_credits << "\n"
|
||||
end
|
||||
@@ -148,7 +148,7 @@ _END_
|
||||
credit_bitmap = Bitmap.new(Graphics.width, @bitmap_height + 16)
|
||||
pbSetSystemFont(credit_bitmap)
|
||||
for j in 0...lines_per_bitmap
|
||||
line = credit_lines[i * lines_per_bitmap + j]
|
||||
line = credit_lines[(i * lines_per_bitmap) + j]
|
||||
next if !line
|
||||
line = line.split("<s>")
|
||||
xpos = 0
|
||||
@@ -156,29 +156,29 @@ _END_
|
||||
linewidth = Graphics.width
|
||||
for k in 0...line.length
|
||||
if line.length > 1
|
||||
xpos = (k == 0) ? 0 : 20 + Graphics.width / 2
|
||||
xpos = (k == 0) ? 0 : 20 + (Graphics.width / 2)
|
||||
align = (k == 0) ? 2 : 0 # Right align : left align
|
||||
linewidth = Graphics.width / 2 - 20
|
||||
linewidth = (Graphics.width / 2) - 20
|
||||
end
|
||||
credit_bitmap.font.color = TEXT_SHADOW_COLOR
|
||||
credit_bitmap.draw_text(xpos, j * 32 + 12, linewidth, 32, line[k], align)
|
||||
credit_bitmap.draw_text(xpos, (j * 32) + 12, linewidth, 32, line[k], align)
|
||||
credit_bitmap.font.color = TEXT_OUTLINE_COLOR
|
||||
credit_bitmap.draw_text(xpos + 2, j * 32 + 2, linewidth, 32, line[k], align)
|
||||
credit_bitmap.draw_text(xpos, j * 32 + 2, linewidth, 32, line[k], align)
|
||||
credit_bitmap.draw_text(xpos - 2, j * 32 + 2, linewidth, 32, line[k], align)
|
||||
credit_bitmap.draw_text(xpos + 2, j * 32 + 4, linewidth, 32, line[k], align)
|
||||
credit_bitmap.draw_text(xpos - 2, j * 32 + 4, linewidth, 32, line[k], align)
|
||||
credit_bitmap.draw_text(xpos + 2, j * 32 + 6, linewidth, 32, line[k], align)
|
||||
credit_bitmap.draw_text(xpos, j * 32 + 6, linewidth, 32, line[k], align)
|
||||
credit_bitmap.draw_text(xpos - 2, j * 32 + 6, linewidth, 32, line[k], align)
|
||||
credit_bitmap.draw_text(xpos + 2, (j * 32) + 2, linewidth, 32, line[k], align)
|
||||
credit_bitmap.draw_text(xpos, (j * 32) + 2, linewidth, 32, line[k], align)
|
||||
credit_bitmap.draw_text(xpos - 2, (j * 32) + 2, linewidth, 32, line[k], align)
|
||||
credit_bitmap.draw_text(xpos + 2, (j * 32) + 4, linewidth, 32, line[k], align)
|
||||
credit_bitmap.draw_text(xpos - 2, (j * 32) + 4, linewidth, 32, line[k], align)
|
||||
credit_bitmap.draw_text(xpos + 2, (j * 32) + 6, linewidth, 32, line[k], align)
|
||||
credit_bitmap.draw_text(xpos, (j * 32) + 6, linewidth, 32, line[k], align)
|
||||
credit_bitmap.draw_text(xpos - 2, (j * 32) + 6, linewidth, 32, line[k], align)
|
||||
credit_bitmap.font.color = TEXT_BASE_COLOR
|
||||
credit_bitmap.draw_text(xpos, j * 32 + 4, linewidth, 32, line[k], align)
|
||||
credit_bitmap.draw_text(xpos, (j * 32) + 4, linewidth, 32, line[k], align)
|
||||
end
|
||||
end
|
||||
credit_sprite = Sprite.new(text_viewport)
|
||||
credit_sprite.bitmap = credit_bitmap
|
||||
credit_sprite.z = 9998
|
||||
credit_sprite.oy = @realOY - @bitmap_height * i
|
||||
credit_sprite.oy = @realOY - (@bitmap_height * i)
|
||||
@credit_sprites[i] = credit_sprite
|
||||
end
|
||||
#-------------------------------
|
||||
@@ -245,6 +245,6 @@ _END_
|
||||
return if cancel?
|
||||
return if last?
|
||||
@realOY += SCROLL_SPEED * delta
|
||||
@credit_sprites.each_with_index { |s, i| s.oy = @realOY - @bitmap_height * i }
|
||||
@credit_sprites.each_with_index { |s, i| s.oy = @realOY - (@bitmap_height * i) }
|
||||
end
|
||||
end
|
||||
|
||||
@@ -143,8 +143,8 @@ class PokemonPauseMenu
|
||||
@scene.pbShowInfo(_INTL("Caught: None\nBalls: {1}", pbBugContestState.ballcount))
|
||||
end
|
||||
commands[cmdQuit = commands.length] = _INTL("Quit Contest")
|
||||
else
|
||||
commands[cmdSave = commands.length] = _INTL("Save") if $game_system && !$game_system.save_disabled
|
||||
elsif $game_system && !$game_system.save_disabled
|
||||
commands[cmdSave = commands.length] = _INTL("Save")
|
||||
end
|
||||
commands[cmdOption = commands.length] = _INTL("Options")
|
||||
commands[cmdDebug = commands.length] = _INTL("Debug") if $DEBUG
|
||||
@@ -160,23 +160,21 @@ class PokemonPauseMenu
|
||||
screen.pbStartScreen
|
||||
@scene.pbRefresh
|
||||
}
|
||||
elsif $player.pokedex.accessible_dexes.length == 1
|
||||
$PokemonGlobal.pokedexDex = $player.pokedex.accessible_dexes[0]
|
||||
pbFadeOutIn {
|
||||
scene = PokemonPokedex_Scene.new
|
||||
screen = PokemonPokedexScreen.new(scene)
|
||||
screen.pbStartScreen
|
||||
@scene.pbRefresh
|
||||
}
|
||||
else
|
||||
if $player.pokedex.accessible_dexes.length == 1
|
||||
$PokemonGlobal.pokedexDex = $player.pokedex.accessible_dexes[0]
|
||||
pbFadeOutIn {
|
||||
scene = PokemonPokedex_Scene.new
|
||||
screen = PokemonPokedexScreen.new(scene)
|
||||
screen.pbStartScreen
|
||||
@scene.pbRefresh
|
||||
}
|
||||
else
|
||||
pbFadeOutIn {
|
||||
scene = PokemonPokedexMenu_Scene.new
|
||||
screen = PokemonPokedexMenuScreen.new(scene)
|
||||
screen.pbStartScreen
|
||||
@scene.pbRefresh
|
||||
}
|
||||
end
|
||||
pbFadeOutIn {
|
||||
scene = PokemonPokedexMenu_Scene.new
|
||||
screen = PokemonPokedexMenuScreen.new(scene)
|
||||
screen.pbStartScreen
|
||||
@scene.pbRefresh
|
||||
}
|
||||
end
|
||||
elsif cmdPokemon >= 0 && command == cmdPokemon
|
||||
pbPlayDecisionSE
|
||||
@@ -243,14 +241,12 @@ class PokemonPauseMenu
|
||||
else
|
||||
pbShowMenu
|
||||
end
|
||||
elsif pbConfirmMessage(_INTL("Would you like to end the Contest now?"))
|
||||
@scene.pbEndScene
|
||||
pbBugContestState.pbStartJudging
|
||||
return
|
||||
else
|
||||
if pbConfirmMessage(_INTL("Would you like to end the Contest now?"))
|
||||
@scene.pbEndScene
|
||||
pbBugContestState.pbStartJudging
|
||||
return
|
||||
else
|
||||
pbShowMenu
|
||||
end
|
||||
pbShowMenu
|
||||
end
|
||||
elsif cmdSave >= 0 && command == cmdSave
|
||||
@scene.pbHideMenu
|
||||
|
||||
@@ -23,10 +23,11 @@ class Window_DexesList < Window_CommandPokemon
|
||||
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, [
|
||||
["Graphics/Pictures/Pokedex/icon_menuseenown", rect.x + 236, rect.y + 2, (allseen) ? 24 : 0, 0, 24, 24],
|
||||
["Graphics/Pictures/Pokedex/icon_menuseenown", rect.x + 332, rect.y + 2, (allown) ? 24 : 0, 24, 24, 24]
|
||||
])
|
||||
pbDrawImagePositions(
|
||||
self.contents,
|
||||
[["Graphics/Pictures/Pokedex/icon_menuseenown", rect.x + 236, rect.y + 2, (allseen) ? 24 : 0, 0, 24, 24],
|
||||
["Graphics/Pictures/Pokedex/icon_menuseenown", rect.x + 332, rect.y + 2, (allown) ? 24 : 0, 24, 24, 24]]
|
||||
)
|
||||
end
|
||||
end
|
||||
end
|
||||
@@ -47,7 +48,7 @@ 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)
|
||||
|
||||
@@ -169,7 +169,7 @@ class PokedexSearchSelectionSprite < SpriteWrapper
|
||||
self.y = 52
|
||||
when 1, 2, 3, 4 # Name, type, height, weight
|
||||
self.x = 114
|
||||
self.y = 110 + (@index - 1) * 52
|
||||
self.y = 110 + ((@index - 1) * 52)
|
||||
when 5 # Color
|
||||
self.x = 382
|
||||
self.y = 110
|
||||
@@ -177,7 +177,7 @@ class PokedexSearchSelectionSprite < SpriteWrapper
|
||||
self.x = 420
|
||||
self.y = 214
|
||||
when 7, 8, 9 # Reset, start, cancel
|
||||
self.x = 4 + (@index - 7) * 176
|
||||
self.x = 4 + ((@index - 7) * 176)
|
||||
self.y = 334
|
||||
end
|
||||
else # Parameter screen
|
||||
@@ -207,11 +207,11 @@ class PokedexSearchSelectionSprite < SpriteWrapper
|
||||
case @index
|
||||
when -1 # Blank option
|
||||
if @mode == 3 || @mode == 4 # Height/weight range
|
||||
self.x = @xstart + (@cmds + 1) * @xgap * (@minmax % 2)
|
||||
self.y = @ystart + @ygap * ((@minmax + 1) % 2)
|
||||
self.x = @xstart + ((@cmds + 1) * @xgap * (@minmax % 2))
|
||||
self.y = @ystart + (@ygap * ((@minmax + 1) % 2))
|
||||
else
|
||||
self.x = @xstart + (@cols - 1) * @xgap
|
||||
self.y = @ystart + (@cmds / @cols).floor * @ygap
|
||||
self.x = @xstart + ((@cols - 1) * @xgap)
|
||||
self.y = @ystart + ((@cmds / @cols).floor * @ygap)
|
||||
end
|
||||
when -2 # OK
|
||||
self.x = 4
|
||||
@@ -223,19 +223,19 @@ class PokedexSearchSelectionSprite < SpriteWrapper
|
||||
case @mode
|
||||
when 0, 1, 2, 5, 6 # Order, name, type, color, shape
|
||||
if @index >= @cmds
|
||||
self.x = @xstart + (@cols - 1) * @xgap
|
||||
self.y = @ystart + (@cmds / @cols).floor * @ygap
|
||||
self.x = @xstart + ((@cols - 1) * @xgap)
|
||||
self.y = @ystart + ((@cmds / @cols).floor * @ygap)
|
||||
else
|
||||
self.x = @xstart + (@index % @cols) * @xgap
|
||||
self.y = @ystart + (@index / @cols).floor * @ygap
|
||||
self.x = @xstart + ((@index % @cols) * @xgap)
|
||||
self.y = @ystart + ((@index / @cols).floor * @ygap)
|
||||
end
|
||||
when 3, 4 # Height, weight
|
||||
if @index >= @cmds
|
||||
self.x = @xstart + (@cmds + 1) * @xgap * ((@minmax + 1) % 2)
|
||||
self.x = @xstart + ((@cmds + 1) * @xgap * ((@minmax + 1) % 2))
|
||||
else
|
||||
self.x = @xstart + (@index + 1) * @xgap
|
||||
self.x = @xstart + ((@index + 1) * @xgap)
|
||||
end
|
||||
self.y = @ystart + @ygap * ((@minmax + 1) % 2)
|
||||
self.y = @ystart + (@ygap * ((@minmax + 1) % 2))
|
||||
end
|
||||
end
|
||||
end
|
||||
@@ -424,7 +424,7 @@ class PokemonPokedex_Scene
|
||||
end
|
||||
end
|
||||
textpos = [
|
||||
[dexname, Graphics.width / 2, -2, 2, Color.new(248, 248, 248), Color.new(0, 0, 0)]
|
||||
[dexname, Graphics.width / 2, -2, 2, Color.new(248, 248, 248), Color.new(0, 0, 0)]
|
||||
]
|
||||
textpos.push([GameData::Species.get(iconspecies).name, 112, 46, 2, base, shadow]) if iconspecies
|
||||
if @searchResults
|
||||
@@ -462,8 +462,8 @@ class PokemonPokedex_Scene
|
||||
overlay.blt(468, y, @sliderbitmap.bitmap, Rect.new(40, 0, 40, 8))
|
||||
i = 0
|
||||
while i * 16 < boxheight - 8 - 16
|
||||
height = [boxheight - 8 - 16 - i * 16, 16].min
|
||||
overlay.blt(468, y + 8 + i * 16, @sliderbitmap.bitmap, Rect.new(40, 8, 40, height))
|
||||
height = [boxheight - 8 - 16 - (i * 16), 16].min
|
||||
overlay.blt(468, y + 8 + (i * 16), @sliderbitmap.bitmap, Rect.new(40, 8, 40, height))
|
||||
i += 1
|
||||
end
|
||||
overlay.blt(468, y + boxheight - 16, @sliderbitmap.bitmap, Rect.new(40, 24, 40, 16))
|
||||
@@ -477,17 +477,17 @@ class PokemonPokedex_Scene
|
||||
shadow = Color.new(72, 72, 72)
|
||||
# Write various bits of text
|
||||
textpos = [
|
||||
[_INTL("Search Mode"), Graphics.width / 2, -2, 2, base, shadow],
|
||||
[_INTL("Order"), 136, 52, 2, base, shadow],
|
||||
[_INTL("Name"), 58, 110, 2, base, shadow],
|
||||
[_INTL("Type"), 58, 162, 2, base, shadow],
|
||||
[_INTL("Height"), 58, 214, 2, base, shadow],
|
||||
[_INTL("Weight"), 58, 266, 2, base, shadow],
|
||||
[_INTL("Color"), 326, 110, 2, base, shadow],
|
||||
[_INTL("Shape"), 454, 162, 2, base, shadow],
|
||||
[_INTL("Reset"), 80, 338, 2, base, shadow, 1],
|
||||
[_INTL("Start"), Graphics.width / 2, 338, 2, base, shadow, 1],
|
||||
[_INTL("Cancel"), Graphics.width - 80, 338, 2, base, shadow, 1]
|
||||
[_INTL("Search Mode"), Graphics.width / 2, -2, 2, base, shadow],
|
||||
[_INTL("Order"), 136, 52, 2, base, shadow],
|
||||
[_INTL("Name"), 58, 110, 2, base, shadow],
|
||||
[_INTL("Type"), 58, 162, 2, base, shadow],
|
||||
[_INTL("Height"), 58, 214, 2, base, shadow],
|
||||
[_INTL("Weight"), 58, 266, 2, base, shadow],
|
||||
[_INTL("Color"), 326, 110, 2, base, shadow],
|
||||
[_INTL("Shape"), 454, 162, 2, base, shadow],
|
||||
[_INTL("Reset"), 80, 338, 2, base, shadow, 1],
|
||||
[_INTL("Start"), Graphics.width / 2, 338, 2, base, shadow, 1],
|
||||
[_INTL("Cancel"), Graphics.width - 80, 338, 2, base, shadow, 1]
|
||||
]
|
||||
# Write order, name and color parameters
|
||||
textpos.push([@orderCommands[params[0]], 344, 58, 2, base, shadow, 1])
|
||||
@@ -549,9 +549,9 @@ class PokemonPokedex_Scene
|
||||
shadow = Color.new(72, 72, 72)
|
||||
# Write various bits of text
|
||||
textpos = [
|
||||
[_INTL("Search Mode"), Graphics.width / 2, -2, 2, base, shadow],
|
||||
[_INTL("OK"), 80, 338, 2, base, shadow, 1],
|
||||
[_INTL("Cancel"), Graphics.width - 80, 338, 2, base, shadow, 1]
|
||||
[_INTL("Search Mode"), Graphics.width / 2, -2, 2, base, shadow],
|
||||
[_INTL("OK"), 80, 338, 2, base, shadow, 1],
|
||||
[_INTL("Cancel"), Graphics.width - 80, 338, 2, base, shadow, 1]
|
||||
]
|
||||
title = [_INTL("Order"), _INTL("Name"), _INTL("Type"), _INTL("Height"),
|
||||
_INTL("Weight"), _INTL("Color"), _INTL("Shape")][mode]
|
||||
@@ -615,11 +615,11 @@ class PokemonPokedex_Scene
|
||||
when 2 # Type icons
|
||||
for i in 0...2
|
||||
if !sel[i] || sel[i] < 0
|
||||
textpos.push(["----", 298 + 128 * i, 58, 2, base, shadow, 1])
|
||||
textpos.push(["----", 298 + (128 * i), 58, 2, base, shadow, 1])
|
||||
else
|
||||
type_number = @typeCommands[sel[i]].icon_position
|
||||
typerect = Rect.new(0, type_number * 32, 96, 32)
|
||||
overlay.blt(250 + 128 * i, 58, @typebitmap.bitmap, typerect)
|
||||
overlay.blt(250 + (128 * i), 58, @typebitmap.bitmap, typerect)
|
||||
end
|
||||
end
|
||||
when 3 # Height range
|
||||
@@ -677,10 +677,10 @@ class PokemonPokedex_Scene
|
||||
end
|
||||
# Draw selected option(s) button graphic
|
||||
if [3, 4].include?(mode) # Height, weight
|
||||
xpos1 = xstart + (sel[0] + 1) * xgap
|
||||
xpos1 = xstart + ((sel[0] + 1) * xgap)
|
||||
xpos1 = xstart if sel[0] < -1
|
||||
xpos2 = xstart + (sel[1] + 1) * xgap
|
||||
xpos2 = xstart + cols * xgap if sel[1] < 0
|
||||
xpos2 = xstart + ((sel[1] + 1) * xgap)
|
||||
xpos2 = xstart + (cols * xgap) if sel[1] < 0
|
||||
xpos2 = xstart if sel[1] >= cols - 1
|
||||
ypos1 = ystart + 172
|
||||
ypos2 = ystart + 28
|
||||
@@ -698,9 +698,9 @@ class PokemonPokedex_Scene
|
||||
for i in 0...sel.length
|
||||
selrect = Rect.new(0, selbuttony, @selbitmap.bitmap.width, selbuttonheight)
|
||||
if sel[i] >= 0
|
||||
overlay.blt(xstart + (sel[i] % cols) * xgap, ystart + (sel[i] / cols).floor * ygap, @selbitmap.bitmap, selrect)
|
||||
overlay.blt(xstart + ((sel[i] % cols) * xgap), ystart + ((sel[i] / cols).floor * ygap), @selbitmap.bitmap, selrect)
|
||||
else
|
||||
overlay.blt(xstart + (cols - 1) * xgap, ystart + (cmds.length / cols).floor * ygap, @selbitmap.bitmap, selrect)
|
||||
overlay.blt(xstart + ((cols - 1) * xgap), ystart + ((cmds.length / cols).floor * ygap), @selbitmap.bitmap, selrect)
|
||||
end
|
||||
end
|
||||
end
|
||||
@@ -708,35 +708,35 @@ class PokemonPokedex_Scene
|
||||
case mode
|
||||
when 0, 1 # Order, name
|
||||
for i in 0...cmds.length
|
||||
x = xstart + halfwidth + (i % cols) * xgap
|
||||
y = ystart + 6 + (i / cols).floor * ygap
|
||||
x = xstart + halfwidth + ((i % cols) * xgap)
|
||||
y = ystart + 6 + ((i / cols).floor * ygap)
|
||||
textpos.push([cmds[i], x, y, 2, base, shadow, 1])
|
||||
end
|
||||
if mode != 0
|
||||
textpos.push([(mode == 1) ? "-" : "----",
|
||||
xstart + halfwidth + (cols - 1) * xgap, ystart + 6 + (cmds.length / cols).floor * ygap, 2, base, shadow, 1])
|
||||
xstart + halfwidth + ((cols - 1) * xgap), ystart + 6 + ((cmds.length / cols).floor * ygap), 2, base, shadow, 1])
|
||||
end
|
||||
when 2 # Type
|
||||
typerect = Rect.new(0, 0, 96, 32)
|
||||
for i in 0...cmds.length
|
||||
typerect.y = @typeCommands[i].icon_position * 32
|
||||
overlay.blt(xstart + 14 + (i % cols) * xgap, ystart + 6 + (i / cols).floor * ygap, @typebitmap.bitmap, typerect)
|
||||
overlay.blt(xstart + 14 + ((i % cols) * xgap), ystart + 6 + ((i / cols).floor * ygap), @typebitmap.bitmap, typerect)
|
||||
end
|
||||
textpos.push(["----",
|
||||
xstart + halfwidth + (cols - 1) * xgap, ystart + 6 + (cmds.length / cols).floor * ygap, 2, base, shadow, 1])
|
||||
xstart + halfwidth + ((cols - 1) * xgap), ystart + 6 + ((cmds.length / cols).floor * ygap), 2, base, shadow, 1])
|
||||
when 5 # Color
|
||||
for i in 0...cmds.length
|
||||
x = xstart + halfwidth + (i % cols) * xgap
|
||||
y = ystart + 6 + (i / cols).floor * ygap
|
||||
x = xstart + halfwidth + ((i % cols) * xgap)
|
||||
y = ystart + 6 + ((i / cols).floor * ygap)
|
||||
textpos.push([cmds[i].name, x, y, 2, base, shadow, 1])
|
||||
end
|
||||
textpos.push(["----",
|
||||
xstart + halfwidth + (cols - 1) * xgap, ystart + 6 + (cmds.length / cols).floor * ygap, 2, base, shadow, 1])
|
||||
xstart + halfwidth + ((cols - 1) * xgap), ystart + 6 + ((cmds.length / cols).floor * ygap), 2, base, shadow, 1])
|
||||
when 6 # Shape
|
||||
shaperect = Rect.new(0, 0, 60, 60)
|
||||
for i in 0...cmds.length
|
||||
shaperect.y = @shapeCommands[i].icon_position * 60
|
||||
overlay.blt(xstart + 4 + (i % cols) * xgap, ystart + 4 + (i / cols).floor * ygap, @shapebitmap.bitmap, shaperect)
|
||||
overlay.blt(xstart + 4 + ((i % cols) * xgap), ystart + 4 + ((i / cols).floor * ygap), @shapebitmap.bitmap, shaperect)
|
||||
end
|
||||
end
|
||||
# Draw all text
|
||||
@@ -986,7 +986,7 @@ class PokemonPokedex_Scene
|
||||
else
|
||||
if Input.trigger?(Input::UP)
|
||||
if index == -1 # From blank
|
||||
index = cmds.length - 1 - (cmds.length - 1) % cols - 1
|
||||
index = cmds.length - 1 - ((cmds.length - 1) % cols) - 1
|
||||
elsif index == -2 # From OK
|
||||
index = ((cmds.length - 1) / cols).floor * cols
|
||||
elsif index == -3 && mode == 0 # From Cancel
|
||||
|
||||
@@ -28,11 +28,12 @@ class PokemonPokedexInfo_Scene
|
||||
@sprites["areamap"].y += (Graphics.height + 32 - @sprites["areamap"].bitmap.height) / 2
|
||||
for hidden in Settings::REGION_MAP_EXTRAS
|
||||
if hidden[0] == @region && hidden[1] > 0 && $game_switches[hidden[1]]
|
||||
pbDrawImagePositions(@sprites["areamap"].bitmap, [
|
||||
["Graphics/Pictures/#{hidden[4]}",
|
||||
pbDrawImagePositions(
|
||||
@sprites["areamap"].bitmap,
|
||||
[["Graphics/Pictures/#{hidden[4]}",
|
||||
hidden[2] * PokemonRegionMap_Scene::SQUARE_WIDTH,
|
||||
hidden[3] * PokemonRegionMap_Scene::SQUARE_HEIGHT]
|
||||
])
|
||||
hidden[3] * PokemonRegionMap_Scene::SQUARE_HEIGHT]]
|
||||
)
|
||||
end
|
||||
end
|
||||
@sprites["areahighlight"] = BitmapSprite.new(Graphics.width, Graphics.height, @viewport)
|
||||
@@ -218,8 +219,8 @@ class PokemonPokedexInfo_Scene
|
||||
indexText = sprintf("%03d", indexNumber)
|
||||
end
|
||||
textpos = [
|
||||
[_INTL("{1}{2} {3}", indexText, " ", species_data.name),
|
||||
246, 36, 0, Color.new(248, 248, 248), Color.new(0, 0, 0)]
|
||||
[_INTL("{1}{2} {3}", indexText, " ", species_data.name),
|
||||
246, 36, 0, Color.new(248, 248, 248), Color.new(0, 0, 0)]
|
||||
]
|
||||
if @show_battled_count
|
||||
textpos.push([_INTL("Number Battled"), 314, 152, 0, base, shadow])
|
||||
@@ -261,7 +262,7 @@ class PokemonPokedexInfo_Scene
|
||||
species_data.types.each_with_index do |type, i|
|
||||
type_number = GameData::Type.get(type).icon_position
|
||||
type_rect = Rect.new(0, type_number * 32, 96, 32)
|
||||
overlay.blt(296 + 100 * i, 120, @typebitmap.bitmap, type_rect)
|
||||
overlay.blt(296 + (100 * i), 120, @typebitmap.bitmap, type_rect)
|
||||
end
|
||||
else
|
||||
# Write the category
|
||||
@@ -316,16 +317,16 @@ class PokemonPokedexInfo_Scene
|
||||
mapsize = map_metadata.town_map_size
|
||||
if mapsize && mapsize[0] && mapsize[0] > 0
|
||||
sqwidth = mapsize[0]
|
||||
sqheight = (mapsize[1].length * 1.0 / mapsize[0]).ceil
|
||||
sqheight = (mapsize[1].length.to_f / mapsize[0]).ceil
|
||||
for i in 0...sqwidth
|
||||
for j in 0...sqheight
|
||||
if mapsize[1][i + j * sqwidth, 1].to_i > 0
|
||||
points[mappos[1] + i + (mappos[2] + j) * mapwidth] = true
|
||||
if mapsize[1][i + (j * sqwidth), 1].to_i > 0
|
||||
points[mappos[1] + i + ((mappos[2] + j) * mapwidth)] = true
|
||||
end
|
||||
end
|
||||
end
|
||||
else
|
||||
points[mappos[1] + mappos[2] * mapwidth] = true
|
||||
points[mappos[1] + (mappos[2] * mapwidth)] = true
|
||||
end
|
||||
end
|
||||
# Draw coloured squares on each square of the region map with a nest
|
||||
@@ -357,10 +358,11 @@ class PokemonPokedexInfo_Scene
|
||||
# Set the text
|
||||
textpos = []
|
||||
if points.length == 0
|
||||
pbDrawImagePositions(overlay, [
|
||||
[sprintf("Graphics/Pictures/Pokedex/overlay_areanone"), 108, 188]
|
||||
])
|
||||
textpos.push([_INTL("Area unknown"), Graphics.width / 2, Graphics.height / 2 - 6, 2, base, shadow])
|
||||
pbDrawImagePositions(
|
||||
overlay,
|
||||
[[sprintf("Graphics/Pictures/Pokedex/overlay_areanone"), 108, 188]]
|
||||
)
|
||||
textpos.push([_INTL("Area unknown"), Graphics.width / 2, (Graphics.height / 2) - 6, 2, base, shadow])
|
||||
end
|
||||
textpos.push([pbGetMessage(MessageTypes::RegionNames, @region), 414, 38, 2, base, shadow])
|
||||
textpos.push([_INTL("{1}'s area", GameData::Species.get(@species).name),
|
||||
@@ -382,8 +384,8 @@ class PokemonPokedexInfo_Scene
|
||||
end
|
||||
end
|
||||
textpos = [
|
||||
[GameData::Species.get(@species).name, Graphics.width / 2, Graphics.height - 94, 2, base, shadow],
|
||||
[formname, Graphics.width / 2, Graphics.height - 62, 2, base, shadow]
|
||||
[GameData::Species.get(@species).name, Graphics.width / 2, Graphics.height - 94, 2, base, shadow],
|
||||
[formname, Graphics.width / 2, Graphics.height - 62, 2, base, shadow]
|
||||
]
|
||||
# Draw all text
|
||||
pbDrawTextPositions(overlay, textpos)
|
||||
|
||||
@@ -140,7 +140,7 @@ class PokemonPartyBlankPanel < SpriteWrapper
|
||||
def initialize(_pokemon, index, viewport = nil)
|
||||
super(viewport)
|
||||
self.x = (index % 2) * Graphics.width / 2
|
||||
self.y = 16 * (index % 2) + 96 * (index / 2)
|
||||
self.y = (16 * (index % 2)) + (96 * (index / 2))
|
||||
@panelbgsprite = AnimatedBitmap.new("Graphics/Pictures/Party/panel_blank")
|
||||
self.bitmap = @panelbgsprite.bitmap
|
||||
@text = nil
|
||||
@@ -177,7 +177,7 @@ class PokemonPartyPanel < SpriteWrapper
|
||||
@active = (index == 0) # true = rounded panel, false = rectangular panel
|
||||
@refreshing = true
|
||||
self.x = (index % 2) * Graphics.width / 2
|
||||
self.y = 16 * (index % 2) + 96 * (index / 2)
|
||||
self.y = (16 * (index % 2)) + (96 * (index / 2))
|
||||
@panelbgsprite = ChangelingSprite.new(0, 0, viewport)
|
||||
@panelbgsprite.z = self.z
|
||||
if @active # Rounded panel
|
||||
@@ -374,7 +374,7 @@ class PokemonPartyPanel < SpriteWrapper
|
||||
textpos.push([sprintf("% 3d /% 3d", @pokemon.hp, @pokemon.totalhp), 224, 54, 1, basecolor, shadowcolor])
|
||||
# Draw HP bar
|
||||
if @pokemon.hp > 0
|
||||
w = @pokemon.hp * 96 * 1.0 / @pokemon.totalhp
|
||||
w = @pokemon.hp * 96 / @pokemon.totalhp.to_f
|
||||
w = 1 if w < 1
|
||||
w = ((w / 2).round) * 2
|
||||
hpzone = 0
|
||||
@@ -415,16 +415,14 @@ class PokemonPartyPanel < SpriteWrapper
|
||||
pbDrawImagePositions(@overlaysprite.bitmap,
|
||||
[["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]
|
||||
])
|
||||
pbDrawTextPositions(@overlaysprite.bitmap,
|
||||
[[@pokemon.level.to_s, 42, 57, 0, basecolor, shadowcolor]])
|
||||
end
|
||||
# Draw annotation text
|
||||
if @text && @text.length > 0
|
||||
pbSetSystemFont(@overlaysprite.bitmap)
|
||||
pbDrawTextPositions(@overlaysprite.bitmap, [
|
||||
[@text, 96, 52, 0, basecolor, shadowcolor]
|
||||
])
|
||||
pbDrawTextPositions(@overlaysprite.bitmap,
|
||||
[[@text, 96, 52, 0, basecolor, shadowcolor]])
|
||||
end
|
||||
end
|
||||
@refreshing = false
|
||||
@@ -514,10 +512,8 @@ class PokemonParty_Scene
|
||||
pbPlayDecisionSE if @sprites["messagebox"].pausing?
|
||||
@sprites["messagebox"].resume
|
||||
end
|
||||
else
|
||||
if Input.trigger?(Input::BACK) || Input.trigger?(Input::USE)
|
||||
break
|
||||
end
|
||||
elsif Input.trigger?(Input::BACK) || Input.trigger?(Input::USE)
|
||||
break
|
||||
end
|
||||
end
|
||||
@sprites["messagebox"].visible = false
|
||||
|
||||
@@ -78,7 +78,7 @@ class RibbonSelectionSprite < MoveSelectionSprite
|
||||
def refresh
|
||||
w = @movesel.width
|
||||
h = @movesel.height / 2
|
||||
self.x = 228 + (self.index % 4) * 68
|
||||
self.x = 228 + ((self.index % 4) * 68)
|
||||
self.y = 76 + ((self.index / 4).floor * 68)
|
||||
self.bitmap = @movesel.bitmap
|
||||
if self.preselected
|
||||
@@ -291,7 +291,7 @@ class PokemonSummary_Scene
|
||||
(@markingbitmap.bitmap.width / MARK_WIDTH).times do |i|
|
||||
markrect.x = i * MARK_WIDTH
|
||||
markrect.y = [(markings[i] || 0), mark_variants - 1].min * MARK_HEIGHT
|
||||
bitmap.blt(x + i * MARK_WIDTH, y, @markingbitmap.bitmap, markrect)
|
||||
bitmap.blt(x + (i * MARK_WIDTH), y, @markingbitmap.bitmap, markrect)
|
||||
end
|
||||
end
|
||||
|
||||
@@ -340,10 +340,10 @@ class PokemonSummary_Scene
|
||||
_INTL("MOVES"),
|
||||
_INTL("RIBBONS")][page - 1]
|
||||
textpos = [
|
||||
[pagename, 26, 10, 0, base, shadow],
|
||||
[@pokemon.name, 46, 56, 0, base, shadow],
|
||||
[@pokemon.level.to_s, 46, 86, 0, Color.new(64, 64, 64), Color.new(176, 176, 176)],
|
||||
[_INTL("Item"), 66, 312, 0, base, shadow]
|
||||
[pagename, 26, 10, 0, base, shadow],
|
||||
[@pokemon.name, 46, 56, 0, base, shadow],
|
||||
[@pokemon.level.to_s, 46, 86, 0, Color.new(64, 64, 64), Color.new(176, 176, 176)],
|
||||
[_INTL("Item"), 66, 312, 0, base, shadow]
|
||||
]
|
||||
# Write the held item's name
|
||||
if @pokemon.hasItem?
|
||||
@@ -381,19 +381,19 @@ class PokemonSummary_Scene
|
||||
if @pokemon.shadowPokemon?
|
||||
shadowfract = @pokemon.heart_gauge.to_f / @pokemon.max_gauge_size
|
||||
imagepos = [
|
||||
["Graphics/Pictures/Summary/overlay_shadow", 224, 240],
|
||||
["Graphics/Pictures/Summary/overlay_shadowbar", 242, 280, 0, 0, (shadowfract * 248).floor, -1]
|
||||
["Graphics/Pictures/Summary/overlay_shadow", 224, 240],
|
||||
["Graphics/Pictures/Summary/overlay_shadowbar", 242, 280, 0, 0, (shadowfract * 248).floor, -1]
|
||||
]
|
||||
pbDrawImagePositions(overlay, imagepos)
|
||||
end
|
||||
# Write various bits of text
|
||||
textpos = [
|
||||
[_INTL("Dex No."), 238, 74, 0, base, shadow],
|
||||
[_INTL("Species"), 238, 106, 0, base, shadow],
|
||||
[@pokemon.speciesName, 435, 106, 2, Color.new(64, 64, 64), Color.new(176, 176, 176)],
|
||||
[_INTL("Type"), 238, 138, 0, base, shadow],
|
||||
[_INTL("OT"), 238, 170, 0, base, shadow],
|
||||
[_INTL("ID No."), 238, 202, 0, base, shadow]
|
||||
[_INTL("Dex No."), 238, 74, 0, base, shadow],
|
||||
[_INTL("Species"), 238, 106, 0, base, shadow],
|
||||
[@pokemon.speciesName, 435, 106, 2, Color.new(64, 64, 64), Color.new(176, 176, 176)],
|
||||
[_INTL("Type"), 238, 138, 0, base, shadow],
|
||||
[_INTL("OT"), 238, 170, 0, base, shadow],
|
||||
[_INTL("ID No."), 238, 202, 0, base, shadow]
|
||||
]
|
||||
# Write the Regional/National Dex number
|
||||
dexnum = 0
|
||||
@@ -459,16 +459,15 @@ class PokemonSummary_Scene
|
||||
@pokemon.types.each_with_index do |type, i|
|
||||
type_number = GameData::Type.get(type).icon_position
|
||||
type_rect = Rect.new(0, type_number * 28, 64, 28)
|
||||
type_x = (@pokemon.types.length == 1) ? 402 : 370 + 66 * i
|
||||
type_x = (@pokemon.types.length == 1) ? 402 : 370 + (66 * i)
|
||||
overlay.blt(type_x, 146, @typebitmap.bitmap, type_rect)
|
||||
end
|
||||
# Draw Exp bar
|
||||
if @pokemon.level < GameData::GrowthRate.max_level
|
||||
w = @pokemon.exp_fraction * 128
|
||||
w = ((w / 2).round) * 2
|
||||
pbDrawImagePositions(overlay, [
|
||||
["Graphics/Pictures/Summary/overlay_exp", 362, 372, 0, 0, w, 6]
|
||||
])
|
||||
pbDrawImagePositions(overlay,
|
||||
[["Graphics/Pictures/Summary/overlay_exp", 362, 372, 0, 0, w, 6]])
|
||||
end
|
||||
end
|
||||
|
||||
@@ -488,9 +487,9 @@ class PokemonSummary_Scene
|
||||
pbDrawImagePositions(overlay, imagepos)
|
||||
# Write various bits of text
|
||||
textpos = [
|
||||
[_INTL("TRAINER MEMO"), 26, 10, 0, base, shadow],
|
||||
[@pokemon.name, 46, 56, 0, base, shadow],
|
||||
[_INTL("Item"), 66, 312, 0, base, shadow]
|
||||
[_INTL("TRAINER MEMO"), 26, 10, 0, base, shadow],
|
||||
[@pokemon.name, 46, 56, 0, base, shadow],
|
||||
[_INTL("Item"), 66, 312, 0, base, shadow]
|
||||
]
|
||||
# Write the held item's name
|
||||
if @pokemon.hasItem?
|
||||
@@ -639,19 +638,19 @@ class PokemonSummary_Scene
|
||||
end
|
||||
# Write various bits of text
|
||||
textpos = [
|
||||
[_INTL("HP"), 292, 70, 2, base, statshadows[:HP]],
|
||||
[sprintf("%d/%d", @pokemon.hp, @pokemon.totalhp), 462, 70, 1, Color.new(64, 64, 64), Color.new(176, 176, 176)],
|
||||
[_INTL("Attack"), 248, 114, 0, base, statshadows[:ATTACK]],
|
||||
[sprintf("%d", @pokemon.attack), 456, 114, 1, Color.new(64, 64, 64), Color.new(176, 176, 176)],
|
||||
[_INTL("Defense"), 248, 146, 0, base, statshadows[:DEFENSE]],
|
||||
[sprintf("%d", @pokemon.defense), 456, 146, 1, Color.new(64, 64, 64), Color.new(176, 176, 176)],
|
||||
[_INTL("Sp. Atk"), 248, 178, 0, base, statshadows[:SPECIAL_ATTACK]],
|
||||
[sprintf("%d", @pokemon.spatk), 456, 178, 1, Color.new(64, 64, 64), Color.new(176, 176, 176)],
|
||||
[_INTL("Sp. Def"), 248, 210, 0, base, statshadows[:SPECIAL_DEFENSE]],
|
||||
[sprintf("%d", @pokemon.spdef), 456, 210, 1, Color.new(64, 64, 64), Color.new(176, 176, 176)],
|
||||
[_INTL("Speed"), 248, 242, 0, base, statshadows[:SPEED]],
|
||||
[sprintf("%d", @pokemon.speed), 456, 242, 1, Color.new(64, 64, 64), Color.new(176, 176, 176)],
|
||||
[_INTL("Ability"), 224, 278, 0, base, shadow]
|
||||
[_INTL("HP"), 292, 70, 2, base, statshadows[:HP]],
|
||||
[sprintf("%d/%d", @pokemon.hp, @pokemon.totalhp), 462, 70, 1, Color.new(64, 64, 64), Color.new(176, 176, 176)],
|
||||
[_INTL("Attack"), 248, 114, 0, base, statshadows[:ATTACK]],
|
||||
[sprintf("%d", @pokemon.attack), 456, 114, 1, Color.new(64, 64, 64), Color.new(176, 176, 176)],
|
||||
[_INTL("Defense"), 248, 146, 0, base, statshadows[:DEFENSE]],
|
||||
[sprintf("%d", @pokemon.defense), 456, 146, 1, Color.new(64, 64, 64), Color.new(176, 176, 176)],
|
||||
[_INTL("Sp. Atk"), 248, 178, 0, base, statshadows[:SPECIAL_ATTACK]],
|
||||
[sprintf("%d", @pokemon.spatk), 456, 178, 1, Color.new(64, 64, 64), Color.new(176, 176, 176)],
|
||||
[_INTL("Sp. Def"), 248, 210, 0, base, statshadows[:SPECIAL_DEFENSE]],
|
||||
[sprintf("%d", @pokemon.spdef), 456, 210, 1, Color.new(64, 64, 64), Color.new(176, 176, 176)],
|
||||
[_INTL("Speed"), 248, 242, 0, base, statshadows[:SPEED]],
|
||||
[sprintf("%d", @pokemon.speed), 456, 242, 1, Color.new(64, 64, 64), Color.new(176, 176, 176)],
|
||||
[_INTL("Ability"), 224, 278, 0, base, shadow]
|
||||
]
|
||||
# Draw ability name and description
|
||||
ability = @pokemon.ability
|
||||
@@ -663,14 +662,14 @@ class PokemonSummary_Scene
|
||||
pbDrawTextPositions(overlay, textpos)
|
||||
# Draw HP bar
|
||||
if @pokemon.hp > 0
|
||||
w = @pokemon.hp * 96 * 1.0 / @pokemon.totalhp
|
||||
w = @pokemon.hp * 96 / @pokemon.totalhp.to_f
|
||||
w = 1 if w < 1
|
||||
w = ((w / 2).round) * 2
|
||||
hpzone = 0
|
||||
hpzone = 1 if @pokemon.hp <= (@pokemon.totalhp / 2).floor
|
||||
hpzone = 2 if @pokemon.hp <= (@pokemon.totalhp / 4).floor
|
||||
imagepos = [
|
||||
["Graphics/Pictures/Summary/overlay_hp", 360, 110, 0, hpzone * 6, w, 6]
|
||||
["Graphics/Pictures/Summary/overlay_hp", 360, 110, 0, hpzone * 6, w, 6]
|
||||
]
|
||||
pbDrawImagePositions(overlay, imagepos)
|
||||
end
|
||||
@@ -747,10 +746,10 @@ class PokemonSummary_Scene
|
||||
end
|
||||
# Write various bits of text
|
||||
textpos = [
|
||||
[_INTL("MOVES"), 26, 10, 0, base, shadow],
|
||||
[_INTL("CATEGORY"), 20, 116, 0, base, shadow],
|
||||
[_INTL("POWER"), 20, 148, 0, base, shadow],
|
||||
[_INTL("ACCURACY"), 20, 180, 0, base, shadow]
|
||||
[_INTL("MOVES"), 26, 10, 0, base, shadow],
|
||||
[_INTL("CATEGORY"), 20, 116, 0, base, shadow],
|
||||
[_INTL("POWER"), 20, 148, 0, base, shadow],
|
||||
[_INTL("ACCURACY"), 20, 180, 0, base, shadow]
|
||||
]
|
||||
imagepos = []
|
||||
# Write move names, types and PP amounts for each known move
|
||||
@@ -792,7 +791,7 @@ class PokemonSummary_Scene
|
||||
@pokemon.types.each_with_index do |type, i|
|
||||
type_number = GameData::Type.get(type).icon_position
|
||||
type_rect = Rect.new(0, type_number * 28, 64, 28)
|
||||
type_x = (@pokemon.types.length == 1) ? 130 : 96 + 70 * i
|
||||
type_x = (@pokemon.types.length == 1) ? 130 : 96 + (70 * i)
|
||||
overlay.blt(type_x, 78, @typebitmap.bitmap, type_rect)
|
||||
end
|
||||
end
|
||||
@@ -835,20 +834,20 @@ class PokemonSummary_Scene
|
||||
@sprites["downarrow"].visible = false
|
||||
# Write various bits of text
|
||||
textpos = [
|
||||
[_INTL("No. of Ribbons:"), 234, 326, 0, Color.new(64, 64, 64), Color.new(176, 176, 176)],
|
||||
[@pokemon.numRibbons.to_s, 450, 326, 1, Color.new(64, 64, 64), Color.new(176, 176, 176)]
|
||||
[_INTL("No. of Ribbons:"), 234, 326, 0, Color.new(64, 64, 64), Color.new(176, 176, 176)],
|
||||
[@pokemon.numRibbons.to_s, 450, 326, 1, Color.new(64, 64, 64), Color.new(176, 176, 176)]
|
||||
]
|
||||
# Draw all text
|
||||
pbDrawTextPositions(overlay, textpos)
|
||||
# Show all ribbons
|
||||
imagepos = []
|
||||
coord = 0
|
||||
for i in @ribbonOffset * 4...@ribbonOffset * 4 + 12
|
||||
for i in @ribbonOffset * 4...(@ribbonOffset * 4) + 12
|
||||
break if !@pokemon.ribbons[i]
|
||||
ribbon_data = GameData::Ribbon.get(@pokemon.ribbons[i])
|
||||
ribn = ribbon_data.icon_position
|
||||
imagepos.push(["Graphics/Pictures/ribbons",
|
||||
230 + 68 * (coord % 4), 78 + 68 * (coord / 4).floor,
|
||||
230 + (68 * (coord % 4)), 78 + (68 * (coord / 4).floor),
|
||||
64 * (ribn % 8), 64 * (ribn / 8).floor, 64, 64])
|
||||
coord += 1
|
||||
end
|
||||
@@ -870,12 +869,12 @@ class PokemonSummary_Scene
|
||||
desc = ribbonid ? GameData::Ribbon.get(ribbonid).description : ""
|
||||
# Draw the description box
|
||||
imagepos = [
|
||||
["Graphics/Pictures/Summary/overlay_ribbon", 8, 280]
|
||||
["Graphics/Pictures/Summary/overlay_ribbon", 8, 280]
|
||||
]
|
||||
pbDrawImagePositions(overlay, imagepos)
|
||||
# Draw name of selected ribbon
|
||||
textpos = [
|
||||
[name, 18, 280, 0, nameBase, nameShadow]
|
||||
[name, 18, 280, 0, nameBase, nameShadow]
|
||||
]
|
||||
pbDrawTextPositions(overlay, textpos)
|
||||
# Draw selected ribbon's description
|
||||
@@ -939,21 +938,19 @@ class PokemonSummary_Scene
|
||||
break if !switching
|
||||
@sprites["movepresel"].visible = false
|
||||
switching = false
|
||||
else
|
||||
if !@pokemon.shadowPokemon?
|
||||
if !switching
|
||||
@sprites["movepresel"].index = selmove
|
||||
@sprites["movepresel"].visible = true
|
||||
oldselmove = selmove
|
||||
switching = true
|
||||
else
|
||||
tmpmove = @pokemon.moves[oldselmove]
|
||||
@pokemon.moves[oldselmove] = @pokemon.moves[selmove]
|
||||
@pokemon.moves[selmove] = tmpmove
|
||||
@sprites["movepresel"].visible = false
|
||||
switching = false
|
||||
drawSelectedMove(nil, @pokemon.moves[selmove])
|
||||
end
|
||||
elsif !@pokemon.shadowPokemon?
|
||||
if !switching
|
||||
@sprites["movepresel"].index = selmove
|
||||
@sprites["movepresel"].visible = true
|
||||
oldselmove = selmove
|
||||
switching = true
|
||||
else
|
||||
tmpmove = @pokemon.moves[oldselmove]
|
||||
@pokemon.moves[oldselmove] = @pokemon.moves[selmove]
|
||||
@pokemon.moves[selmove] = tmpmove
|
||||
@sprites["movepresel"].visible = false
|
||||
switching = false
|
||||
drawSelectedMove(nil, @pokemon.moves[selmove])
|
||||
end
|
||||
end
|
||||
elsif Input.trigger?(Input::UP)
|
||||
@@ -1009,7 +1006,7 @@ class PokemonSummary_Scene
|
||||
if !switching
|
||||
if @pokemon.ribbons[selribbon]
|
||||
pbPlayDecisionSE
|
||||
@sprites["ribbonpresel"].index = selribbon - @ribbonOffset * 4
|
||||
@sprites["ribbonpresel"].index = selribbon - (@ribbonOffset * 4)
|
||||
oldselribbon = selribbon
|
||||
@sprites["ribbonpresel"].visible = true
|
||||
switching = true
|
||||
@@ -1056,8 +1053,8 @@ class PokemonSummary_Scene
|
||||
@ribbonOffset = (selribbon / 4).floor - 2 if selribbon >= (@ribbonOffset + 3) * 4
|
||||
@ribbonOffset = 0 if @ribbonOffset < 0
|
||||
@ribbonOffset = numRows - 3 if @ribbonOffset > numRows - 3
|
||||
@sprites["ribbonsel"].index = selribbon - @ribbonOffset * 4
|
||||
@sprites["ribbonpresel"].index = oldselribbon - @ribbonOffset * 4
|
||||
@sprites["ribbonsel"].index = selribbon - (@ribbonOffset * 4)
|
||||
@sprites["ribbonpresel"].index = oldselribbon - (@ribbonOffset * 4)
|
||||
drawSelectedRibbon(@pokemon.ribbons[selribbon])
|
||||
end
|
||||
end
|
||||
@@ -1083,20 +1080,20 @@ class PokemonSummary_Scene
|
||||
(@markingbitmap.bitmap.width / MARK_WIDTH).times do |i|
|
||||
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),
|
||||
@sprites["markingoverlay"].bitmap.blt(300 + (58 * (i % 3)), 154 + (50 * (i / 3)),
|
||||
@markingbitmap.bitmap, markrect)
|
||||
end
|
||||
textpos = [
|
||||
[_INTL("Mark {1}", pokemon.name), 366, 90, 2, base, shadow],
|
||||
[_INTL("OK"), 366, 242, 2, base, shadow],
|
||||
[_INTL("Cancel"), 366, 292, 2, base, shadow]
|
||||
[_INTL("Mark {1}", pokemon.name), 366, 90, 2, base, shadow],
|
||||
[_INTL("OK"), 366, 242, 2, base, shadow],
|
||||
[_INTL("Cancel"), 366, 292, 2, base, shadow]
|
||||
]
|
||||
pbDrawTextPositions(@sprites["markingoverlay"].bitmap, textpos)
|
||||
redraw = false
|
||||
end
|
||||
# Reposition the cursor
|
||||
@sprites["markingsel"].x = 284 + 58 * (index % 3)
|
||||
@sprites["markingsel"].y = 144 + 50 * (index / 3)
|
||||
@sprites["markingsel"].x = 284 + (58 * (index % 3))
|
||||
@sprites["markingsel"].y = 144 + (50 * (index / 3))
|
||||
case index
|
||||
when 6 # OK
|
||||
@sprites["markingsel"].x = 284
|
||||
|
||||
@@ -47,9 +47,9 @@ class Window_PokemonBag < Window_DrawableCommand
|
||||
item > self.top_item + self.page_item_max
|
||||
return Rect.new(0, 0, 0, 0)
|
||||
else
|
||||
cursor_width = (self.width - self.borderX - (@column_max - 1) * @column_spacing) / @column_max
|
||||
cursor_width = (self.width - self.borderX - ((@column_max - 1) * @column_spacing)) / @column_max
|
||||
x = item % @column_max * (cursor_width + @column_spacing)
|
||||
y = item / @column_max * @row_height - @virtualOy
|
||||
y = (item / @column_max * @row_height) - @virtualOy
|
||||
return Rect.new(x, y, cursor_width, @row_height)
|
||||
end
|
||||
end
|
||||
@@ -76,17 +76,17 @@ class Window_PokemonBag < Window_DrawableCommand
|
||||
shadowColor = Color.new(248, 144, 144)
|
||||
end
|
||||
textpos.push(
|
||||
[@adapter.getDisplayName(item), rect.x, rect.y - 2, false, baseColor, shadowColor]
|
||||
[@adapter.getDisplayName(item), rect.x, rect.y - 2, false, baseColor, shadowColor]
|
||||
)
|
||||
if GameData::Item.get(item).is_important?
|
||||
if @bag.registered?(item)
|
||||
pbDrawImagePositions(self.contents, [
|
||||
["Graphics/Pictures/Bag/icon_register", rect.x + rect.width - 72, rect.y + 8, 0, 0, -1, 24]
|
||||
])
|
||||
pbDrawImagePositions(
|
||||
self.contents,
|
||||
[["Graphics/Pictures/Bag/icon_register", rect.x + rect.width - 72, rect.y + 8, 0, 0, -1, 24]])
|
||||
elsif pbCanRegisterItem?(item)
|
||||
pbDrawImagePositions(self.contents, [
|
||||
["Graphics/Pictures/Bag/icon_register", rect.x + rect.width - 72, rect.y + 8, 0, 24, -1, 24]
|
||||
])
|
||||
pbDrawImagePositions(
|
||||
self.contents,
|
||||
[["Graphics/Pictures/Bag/icon_register", rect.x + rect.width - 72, rect.y + 8, 0, 24, -1, 24]])
|
||||
end
|
||||
else
|
||||
qty = (@filterlist) ? thispocket[@filterlist[@pocket][index]][1] : thispocket[index][1]
|
||||
@@ -190,7 +190,7 @@ class PokemonBag_Scene
|
||||
@sprites["rightarrow"].y = 76
|
||||
@sprites["rightarrow"].visible = (!@choosing || numfilledpockets > 1)
|
||||
@sprites["rightarrow"].play
|
||||
@sprites["itemlist"] = Window_PokemonBag.new(@bag, @filterlist, lastpocket, 168, -8, 314, 40 + 32 + ITEMSVISIBLE * 32)
|
||||
@sprites["itemlist"] = Window_PokemonBag.new(@bag, @filterlist, lastpocket, 168, -8, 314, 40 + 32 + (ITEMSVISIBLE * 32))
|
||||
@sprites["itemlist"].viewport = @viewport
|
||||
@sprites["itemlist"].pocket = lastpocket
|
||||
@sprites["itemlist"].index = @bag.last_viewed_index(lastpocket)
|
||||
@@ -270,13 +270,13 @@ class PokemonBag_Scene
|
||||
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)
|
||||
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,
|
||||
2 + ((@sprites["itemlist"].pocket - 1) * 22), 2, @pocketbitmap.bitmap,
|
||||
Rect.new((@sprites["itemlist"].pocket - 1) * 28, 0, 28, 28)
|
||||
)
|
||||
# Refresh the item window
|
||||
@@ -290,9 +290,9 @@ class PokemonBag_Scene
|
||||
overlay = @sprites["overlay"].bitmap
|
||||
overlay.clear
|
||||
# Draw the pocket name
|
||||
pbDrawTextPositions(overlay, [
|
||||
[PokemonBag.pocket_names[@bag.last_viewed_pocket - 1], 94, 176, 2, POCKETNAMEBASECOLOR, POCKETNAMESHADOWCOLOR]
|
||||
])
|
||||
pbDrawTextPositions(
|
||||
overlay,
|
||||
[[PokemonBag.pocket_names[@bag.last_viewed_pocket - 1], 94, 176, 2, POCKETNAMEBASECOLOR, POCKETNAMESHADOWCOLOR]])
|
||||
# Draw slider arrows
|
||||
showslider = false
|
||||
if itemlist.top_row > 0
|
||||
@@ -314,8 +314,8 @@ class PokemonBag_Scene
|
||||
overlay.blt(470, y, @sliderbitmap.bitmap, Rect.new(36, 0, 36, 4))
|
||||
i = 0
|
||||
while i * 16 < boxheight - 4 - 18
|
||||
height = [boxheight - 4 - 18 - i * 16, 16].min
|
||||
overlay.blt(470, y + 4 + i * 16, @sliderbitmap.bitmap, Rect.new(36, 4, 36, height))
|
||||
height = [boxheight - 4 - 18 - (i * 16), 16].min
|
||||
overlay.blt(470, y + 4 + (i * 16), @sliderbitmap.bitmap, Rect.new(36, 4, 36, height))
|
||||
i += 1
|
||||
end
|
||||
overlay.blt(470, y + boxheight - 18, @sliderbitmap.bitmap, Rect.new(36, 20, 36, 18))
|
||||
@@ -377,8 +377,7 @@ class PokemonBag_Scene
|
||||
pbPlayCancelSE
|
||||
pbRefresh
|
||||
end
|
||||
else
|
||||
# Change pockets
|
||||
else # Change pockets
|
||||
if Input.trigger?(Input::LEFT)
|
||||
newpocket = itemwindow.pocket
|
||||
loop do
|
||||
@@ -386,8 +385,8 @@ class PokemonBag_Scene
|
||||
break if !@choosing || newpocket == itemwindow.pocket
|
||||
if @filterlist
|
||||
break if @filterlist[newpocket].length > 0
|
||||
else
|
||||
break if @bag.pockets[newpocket].length > 0
|
||||
elsif @bag.pockets[newpocket].length > 0
|
||||
break
|
||||
end
|
||||
end
|
||||
if itemwindow.pocket != newpocket
|
||||
@@ -404,8 +403,8 @@ class PokemonBag_Scene
|
||||
break if !@choosing || newpocket == itemwindow.pocket
|
||||
if @filterlist
|
||||
break if @filterlist[newpocket].length > 0
|
||||
else
|
||||
break if @bag.pockets[newpocket].length > 0
|
||||
elsif @bag.pockets[newpocket].length > 0
|
||||
break
|
||||
end
|
||||
end
|
||||
if itemwindow.pocket != newpocket
|
||||
@@ -539,11 +538,10 @@ class PokemonBagScreen
|
||||
elsif cmdDebug >= 0 && command == cmdDebug # Debug
|
||||
command = 0
|
||||
loop do
|
||||
command = @scene.pbShowCommands(_INTL("Do what with {1}?", itemname), [
|
||||
_INTL("Change quantity"),
|
||||
_INTL("Make Mystery Gift"),
|
||||
_INTL("Cancel")
|
||||
], command)
|
||||
command = @scene.pbShowCommands(_INTL("Do what with {1}?", itemname),
|
||||
[_INTL("Change quantity"),
|
||||
_INTL("Make Mystery Gift"),
|
||||
_INTL("Cancel")], command)
|
||||
case command
|
||||
### Cancel ###
|
||||
when -1, 2
|
||||
|
||||
@@ -42,11 +42,11 @@ class PokegearButton < SpriteWrapper
|
||||
rect.y = @button.height / 2 if @selected
|
||||
self.bitmap.blt(0, 0, @button.bitmap, rect)
|
||||
textpos = [
|
||||
[@name, self.bitmap.width / 2, 4, 2, Color.new(248, 248, 248), Color.new(40, 40, 40)]
|
||||
[@name, self.bitmap.width / 2, 4, 2, Color.new(248, 248, 248), Color.new(40, 40, 40)]
|
||||
]
|
||||
pbDrawTextPositions(self.bitmap, textpos)
|
||||
imagepos = [
|
||||
[sprintf("Graphics/Pictures/Pokegear/icon_" + @image), 18, 10]
|
||||
[sprintf("Graphics/Pictures/Pokegear/icon_" + @image), 18, 10]
|
||||
]
|
||||
pbDrawImagePositions(self.bitmap, imagepos)
|
||||
end
|
||||
|
||||
@@ -116,9 +116,9 @@ class PokemonRegionMap_Scene
|
||||
@sprites["map2"].x = @sprites["map"].x
|
||||
@sprites["map2"].y = @sprites["map"].y
|
||||
end
|
||||
pbDrawImagePositions(@sprites["map2"].bitmap, [
|
||||
["Graphics/Pictures/#{graphic[4]}", graphic[2] * SQUARE_WIDTH, graphic[3] * SQUARE_HEIGHT]
|
||||
])
|
||||
pbDrawImagePositions(
|
||||
@sprites["map2"].bitmap,
|
||||
[["Graphics/Pictures/#{graphic[4]}", graphic[2] * SQUARE_WIDTH, graphic[3] * SQUARE_HEIGHT]])
|
||||
end
|
||||
@sprites["mapbottom"] = MapBottomSprite.new(@viewport)
|
||||
@sprites["mapbottom"].mapname = pbGetMessage(MessageTypes::RegionNames, mapindex)
|
||||
@@ -163,11 +163,11 @@ class PokemonRegionMap_Scene
|
||||
end
|
||||
|
||||
def point_x_to_screen_x(x)
|
||||
return -SQUARE_WIDTH / 2 + (x * SQUARE_WIDTH) + (Graphics.width - @sprites["map"].bitmap.width) / 2
|
||||
return (-SQUARE_WIDTH / 2) + (x * SQUARE_WIDTH) + ((Graphics.width - @sprites["map"].bitmap.width) / 2)
|
||||
end
|
||||
|
||||
def point_y_to_screen_y(y)
|
||||
return -SQUARE_HEIGHT / 2 + (y * SQUARE_HEIGHT) + (Graphics.height - @sprites["map"].bitmap.height) / 2
|
||||
return (-SQUARE_HEIGHT / 2) + (y * SQUARE_HEIGHT) + ((Graphics.height - @sprites["map"].bitmap.height) / 2)
|
||||
end
|
||||
|
||||
def location_shown?(point)
|
||||
@@ -248,9 +248,9 @@ class PokemonRegionMap_Scene
|
||||
return if @fly_map || !Settings::CAN_FLY_FROM_TOWN_MAP || !pbCanFly?
|
||||
@sprites["help"].bitmap.clear
|
||||
text = (@mode == 0) ? _INTL("ACTION: Fly") : _INTL("ACTION: Cancel Fly")
|
||||
pbDrawTextPositions(@sprites["help"].bitmap, [
|
||||
[text, Graphics.width - 16, -8, 1, Color.new(248, 248, 248), Color.new(0, 0, 0)]
|
||||
])
|
||||
pbDrawTextPositions(
|
||||
@sprites["help"].bitmap,
|
||||
[[text, Graphics.width - 16, -8, 1, Color.new(248, 248, 248), Color.new(0, 0, 0)]])
|
||||
@sprites.each do |key, sprite|
|
||||
next if !key.include?("point")
|
||||
sprite.visible = (@mode == 1)
|
||||
|
||||
@@ -64,8 +64,8 @@ class PokemonPhoneScene
|
||||
@sprites["icon"].setBitmap(filename)
|
||||
charwidth = @sprites["icon"].bitmap.width
|
||||
charheight = @sprites["icon"].bitmap.height
|
||||
@sprites["icon"].x = 86 - charwidth / 8
|
||||
@sprites["icon"].y = 134 - charheight / 8
|
||||
@sprites["icon"].x = 86 - (charwidth / 8)
|
||||
@sprites["icon"].y = 134 - (charheight / 8)
|
||||
@sprites["icon"].src_rect = Rect.new(0, 0, charwidth / 4, charheight / 4)
|
||||
for trainer in @trainers
|
||||
if trainer.length == 4
|
||||
@@ -78,7 +78,7 @@ class PokemonPhoneScene
|
||||
end
|
||||
@sprites["list"].commands = commands
|
||||
for i in 0...@sprites["list"].page_item_max
|
||||
@sprites["rematch[#{i}]"] = IconSprite.new(468, 62 + i * 32, @viewport)
|
||||
@sprites["rematch[#{i}]"] = IconSprite.new(468, 62 + (i * 32), @viewport)
|
||||
j = i + @sprites["list"].top_item
|
||||
next if j >= commands.length
|
||||
trainer = @trainers[j]
|
||||
@@ -115,8 +115,8 @@ class PokemonPhoneScene
|
||||
@sprites["icon"].setBitmap(filename)
|
||||
charwidth = @sprites["icon"].bitmap.width
|
||||
charheight = @sprites["icon"].bitmap.height
|
||||
@sprites["icon"].x = 86 - charwidth / 8
|
||||
@sprites["icon"].y = 134 - charheight / 8
|
||||
@sprites["icon"].x = 86 - (charwidth / 8)
|
||||
@sprites["icon"].y = 134 - (charheight / 8)
|
||||
@sprites["icon"].src_rect = Rect.new(0, 0, charwidth / 4, charheight / 4)
|
||||
mapname = (trainer[2]) ? pbGetMapNameFromId(trainer[2]) : ""
|
||||
@sprites["bottom"].text = "<ac>" + mapname
|
||||
|
||||
@@ -14,7 +14,7 @@ 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)
|
||||
|
||||
@@ -49,25 +49,25 @@ class PokemonTrainerCard_Scene
|
||||
$PokemonGlobal.startTime.day,
|
||||
$PokemonGlobal.startTime.year)
|
||||
textPositions = [
|
||||
[_INTL("Name"), 34, 58, 0, baseColor, shadowColor],
|
||||
[$player.name, 302, 58, 1, baseColor, shadowColor],
|
||||
[_INTL("ID No."), 332, 58, 0, baseColor, shadowColor],
|
||||
[sprintf("%05d", $player.public_ID), 468, 58, 1, baseColor, shadowColor],
|
||||
[_INTL("Money"), 34, 106, 0, baseColor, shadowColor],
|
||||
[_INTL("${1}", $player.money.to_s_formatted), 302, 106, 1, baseColor, shadowColor],
|
||||
[_INTL("Pokédex"), 34, 154, 0, baseColor, shadowColor],
|
||||
[sprintf("%d/%d", $player.pokedex.owned_count, $player.pokedex.seen_count), 302, 154, 1, baseColor, shadowColor],
|
||||
[_INTL("Time"), 34, 202, 0, baseColor, shadowColor],
|
||||
[time, 302, 202, 1, baseColor, shadowColor],
|
||||
[_INTL("Started"), 34, 250, 0, baseColor, shadowColor],
|
||||
[starttime, 302, 250, 1, baseColor, shadowColor]
|
||||
[_INTL("Name"), 34, 58, 0, baseColor, shadowColor],
|
||||
[$player.name, 302, 58, 1, baseColor, shadowColor],
|
||||
[_INTL("ID No."), 332, 58, 0, baseColor, shadowColor],
|
||||
[sprintf("%05d", $player.public_ID), 468, 58, 1, baseColor, shadowColor],
|
||||
[_INTL("Money"), 34, 106, 0, baseColor, shadowColor],
|
||||
[_INTL("${1}", $player.money.to_s_formatted), 302, 106, 1, baseColor, shadowColor],
|
||||
[_INTL("Pokédex"), 34, 154, 0, baseColor, shadowColor],
|
||||
[sprintf("%d/%d", $player.pokedex.owned_count, $player.pokedex.seen_count), 302, 154, 1, baseColor, shadowColor],
|
||||
[_INTL("Time"), 34, 202, 0, baseColor, shadowColor],
|
||||
[time, 302, 202, 1, baseColor, shadowColor],
|
||||
[_INTL("Started"), 34, 250, 0, baseColor, shadowColor],
|
||||
[starttime, 302, 250, 1, baseColor, shadowColor]
|
||||
]
|
||||
pbDrawTextPositions(overlay, textPositions)
|
||||
x = 72
|
||||
region = pbGetCurrentRegion(0) # Get the current region
|
||||
imagePositions = []
|
||||
for i in 0...8
|
||||
if $player.badges[i + region * 8]
|
||||
if $player.badges[i + (region * 8)]
|
||||
imagePositions.push(["Graphics/Pictures/Trainer Card/icon_badges", x, 310, i * 32, region * 32, 32, 32])
|
||||
end
|
||||
x += 48
|
||||
|
||||
@@ -58,7 +58,7 @@ class PokemonLoadPanel < SpriteWrapper
|
||||
if @isContinue
|
||||
self.bitmap.blt(0, 0, @bgbitmap.bitmap, Rect.new(0, (@selected) ? 111 * 2 : 0, @bgbitmap.width, 111 * 2))
|
||||
else
|
||||
self.bitmap.blt(0, 0, @bgbitmap.bitmap, Rect.new(0, 111 * 2 * 2 + ((@selected) ? 23 * 2 : 0), @bgbitmap.width, 23 * 2))
|
||||
self.bitmap.blt(0, 0, @bgbitmap.bitmap, Rect.new(0, (111 * 2 * 2) + ((@selected) ? 23 * 2 : 0), @bgbitmap.width, 23 * 2))
|
||||
end
|
||||
textpos = []
|
||||
if @isContinue
|
||||
@@ -140,7 +140,7 @@ class PokemonLoad_Scene
|
||||
@sprites["panel#{oldi}"].pbRefresh
|
||||
@sprites["panel#{newi}"].selected = true
|
||||
@sprites["panel#{newi}"].pbRefresh
|
||||
while @sprites["panel#{newi}"].y > Graphics.height - 40 * 2
|
||||
while @sprites["panel#{newi}"].y > Graphics.height - (40 * 2)
|
||||
for i in 0...@commands.length
|
||||
@sprites["panel#{i}"].y -= 24 * 2
|
||||
end
|
||||
@@ -171,15 +171,15 @@ class PokemonLoad_Scene
|
||||
@sprites["player"] = TrainerWalkingCharSprite.new(filename, @viewport)
|
||||
charwidth = @sprites["player"].bitmap.width
|
||||
charheight = @sprites["player"].bitmap.height
|
||||
@sprites["player"].x = 56 * 2 - charwidth / 8
|
||||
@sprites["player"].y = 56 * 2 - charheight / 8
|
||||
@sprites["player"].x = (56 * 2) - (charwidth / 8)
|
||||
@sprites["player"].y = (56 * 2) - (charheight / 8)
|
||||
@sprites["player"].src_rect = Rect.new(0, 0, charwidth / 4, charheight / 4)
|
||||
end
|
||||
for i in 0...trainer.party.length
|
||||
@sprites["party#{i}"] = PokemonIconSprite.new(trainer.party[i], @viewport)
|
||||
@sprites["party#{i}"].setOffset(PictureOrigin::Center)
|
||||
@sprites["party#{i}"].x = (167 + 33 * (i % 2)) * 2
|
||||
@sprites["party#{i}"].y = (56 + 25 * (i / 2)) * 2
|
||||
@sprites["party#{i}"].x = (167 + (33 * (i % 2))) * 2
|
||||
@sprites["party#{i}"].y = (56 + (25 * (i / 2))) * 2
|
||||
@sprites["party#{i}"].z = 99999
|
||||
end
|
||||
end
|
||||
|
||||
@@ -207,7 +207,8 @@ class Window_PokemonOption < Window_DrawableCommand
|
||||
pbDrawShadowText(self.contents, rect.x, rect.y, optionwidth, rect.height, optionname,
|
||||
@nameBaseColor, @nameShadowColor)
|
||||
return if index == @options.length
|
||||
if @options[index].is_a?(EnumOption)
|
||||
case @options[index]
|
||||
when EnumOption
|
||||
if @options[index].values.length > 1
|
||||
totalwidth = 0
|
||||
for value in @options[index].values
|
||||
@@ -229,21 +230,21 @@ class Window_PokemonOption < Window_DrawableCommand
|
||||
pbDrawShadowText(self.contents, rect.x + optionwidth, rect.y, optionwidth, rect.height,
|
||||
optionname, self.baseColor, self.shadowColor)
|
||||
end
|
||||
elsif @options[index].is_a?(NumberOption)
|
||||
when NumberOption
|
||||
value = _INTL("Type {1}/{2}", @options[index].optstart + self[index],
|
||||
@options[index].optend - @options[index].optstart + 1)
|
||||
xpos = optionwidth + rect.x
|
||||
pbDrawShadowText(self.contents, xpos, rect.y, optionwidth, rect.height, value,
|
||||
@selBaseColor, @selShadowColor)
|
||||
elsif @options[index].is_a?(SliderOption)
|
||||
when 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,
|
||||
self.contents.fill_rect(xpos, rect.y - 2 + (rect.height / 2),
|
||||
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,
|
||||
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])
|
||||
@@ -301,80 +302,80 @@ class PokemonOption_Scene
|
||||
# setter and a getter for that option. To delete an option, comment it out
|
||||
# or delete it. The game's options may be placed in any order.
|
||||
@PokemonOptions = [
|
||||
SliderOption.new(_INTL("Music Volume"), 0, 100, 5,
|
||||
proc { $PokemonSystem.bgmvolume },
|
||||
proc { |value|
|
||||
if $PokemonSystem.bgmvolume != value
|
||||
$PokemonSystem.bgmvolume = value
|
||||
if $game_system.playing_bgm != nil && !inloadscreen
|
||||
playingBGM = $game_system.getPlayingBGM
|
||||
$game_system.bgm_pause
|
||||
$game_system.bgm_resume(playingBGM)
|
||||
end
|
||||
end
|
||||
}
|
||||
),
|
||||
SliderOption.new(_INTL("SE Volume"), 0, 100, 5,
|
||||
proc { $PokemonSystem.sevolume },
|
||||
proc { |value|
|
||||
if $PokemonSystem.sevolume != value
|
||||
$PokemonSystem.sevolume = value
|
||||
if $game_system.playing_bgs != nil
|
||||
$game_system.playing_bgs.volume = value
|
||||
playingBGS = $game_system.getPlayingBGS
|
||||
$game_system.bgs_pause
|
||||
$game_system.bgs_resume(playingBGS)
|
||||
end
|
||||
pbPlayCursorSE
|
||||
end
|
||||
}
|
||||
),
|
||||
EnumOption.new(_INTL("Text Speed"), [_INTL("Slow"), _INTL("Normal"), _INTL("Fast")],
|
||||
proc { $PokemonSystem.textspeed },
|
||||
proc { |value|
|
||||
$PokemonSystem.textspeed = value
|
||||
MessageConfig.pbSetTextSpeed(MessageConfig.pbSettingToTextSpeed(value))
|
||||
}
|
||||
),
|
||||
EnumOption.new(_INTL("Battle Effects"), [_INTL("On"), _INTL("Off")],
|
||||
proc { $PokemonSystem.battlescene },
|
||||
proc { |value| $PokemonSystem.battlescene = value }
|
||||
),
|
||||
EnumOption.new(_INTL("Battle Style"), [_INTL("Switch"), _INTL("Set")],
|
||||
proc { $PokemonSystem.battlestyle },
|
||||
proc { |value| $PokemonSystem.battlestyle = value }
|
||||
),
|
||||
EnumOption.new(_INTL("Default Movement"), [_INTL("Walking"), _INTL("Running")],
|
||||
proc { $PokemonSystem.runstyle },
|
||||
proc { |value| $PokemonSystem.runstyle = value }
|
||||
),
|
||||
NumberOption.new(_INTL("Speech Frame"), 1, Settings::SPEECH_WINDOWSKINS.length,
|
||||
proc { $PokemonSystem.textskin },
|
||||
proc { |value|
|
||||
$PokemonSystem.textskin = value
|
||||
MessageConfig.pbSetSpeechFrame("Graphics/Windowskins/" + Settings::SPEECH_WINDOWSKINS[value])
|
||||
}
|
||||
),
|
||||
NumberOption.new(_INTL("Menu Frame"), 1, Settings::MENU_WINDOWSKINS.length,
|
||||
proc { $PokemonSystem.frame },
|
||||
proc { |value|
|
||||
$PokemonSystem.frame = value
|
||||
MessageConfig.pbSetSystemFrame("Graphics/Windowskins/" + Settings::MENU_WINDOWSKINS[value])
|
||||
}
|
||||
),
|
||||
EnumOption.new(_INTL("Text Entry"), [_INTL("Cursor"), _INTL("Keyboard")],
|
||||
proc { $PokemonSystem.textinput },
|
||||
proc { |value| $PokemonSystem.textinput = value }
|
||||
),
|
||||
EnumOption.new(_INTL("Screen Size"), [_INTL("S"), _INTL("M"), _INTL("L"), _INTL("XL"), _INTL("Full")],
|
||||
proc { [$PokemonSystem.screensize, 4].min },
|
||||
proc { |value|
|
||||
if $PokemonSystem.screensize != value
|
||||
$PokemonSystem.screensize = value
|
||||
pbSetResizeFactor($PokemonSystem.screensize)
|
||||
end
|
||||
}
|
||||
)
|
||||
SliderOption.new(_INTL("Music Volume"), 0, 100, 5,
|
||||
proc { $PokemonSystem.bgmvolume },
|
||||
proc { |value|
|
||||
if $PokemonSystem.bgmvolume != value
|
||||
$PokemonSystem.bgmvolume = value
|
||||
if $game_system.playing_bgm != nil && !inloadscreen
|
||||
playingBGM = $game_system.getPlayingBGM
|
||||
$game_system.bgm_pause
|
||||
$game_system.bgm_resume(playingBGM)
|
||||
end
|
||||
end
|
||||
}
|
||||
),
|
||||
SliderOption.new(_INTL("SE Volume"), 0, 100, 5,
|
||||
proc { $PokemonSystem.sevolume },
|
||||
proc { |value|
|
||||
if $PokemonSystem.sevolume != value
|
||||
$PokemonSystem.sevolume = value
|
||||
if $game_system.playing_bgs != nil
|
||||
$game_system.playing_bgs.volume = value
|
||||
playingBGS = $game_system.getPlayingBGS
|
||||
$game_system.bgs_pause
|
||||
$game_system.bgs_resume(playingBGS)
|
||||
end
|
||||
pbPlayCursorSE
|
||||
end
|
||||
}
|
||||
),
|
||||
EnumOption.new(_INTL("Text Speed"), [_INTL("Slow"), _INTL("Normal"), _INTL("Fast")],
|
||||
proc { $PokemonSystem.textspeed },
|
||||
proc { |value|
|
||||
$PokemonSystem.textspeed = value
|
||||
MessageConfig.pbSetTextSpeed(MessageConfig.pbSettingToTextSpeed(value))
|
||||
}
|
||||
),
|
||||
EnumOption.new(_INTL("Battle Effects"), [_INTL("On"), _INTL("Off")],
|
||||
proc { $PokemonSystem.battlescene },
|
||||
proc { |value| $PokemonSystem.battlescene = value }
|
||||
),
|
||||
EnumOption.new(_INTL("Battle Style"), [_INTL("Switch"), _INTL("Set")],
|
||||
proc { $PokemonSystem.battlestyle },
|
||||
proc { |value| $PokemonSystem.battlestyle = value }
|
||||
),
|
||||
EnumOption.new(_INTL("Default Movement"), [_INTL("Walking"), _INTL("Running")],
|
||||
proc { $PokemonSystem.runstyle },
|
||||
proc { |value| $PokemonSystem.runstyle = value }
|
||||
),
|
||||
NumberOption.new(_INTL("Speech Frame"), 1, Settings::SPEECH_WINDOWSKINS.length,
|
||||
proc { $PokemonSystem.textskin },
|
||||
proc { |value|
|
||||
$PokemonSystem.textskin = value
|
||||
MessageConfig.pbSetSpeechFrame("Graphics/Windowskins/" + Settings::SPEECH_WINDOWSKINS[value])
|
||||
}
|
||||
),
|
||||
NumberOption.new(_INTL("Menu Frame"), 1, Settings::MENU_WINDOWSKINS.length,
|
||||
proc { $PokemonSystem.frame },
|
||||
proc { |value|
|
||||
$PokemonSystem.frame = value
|
||||
MessageConfig.pbSetSystemFrame("Graphics/Windowskins/" + Settings::MENU_WINDOWSKINS[value])
|
||||
}
|
||||
),
|
||||
EnumOption.new(_INTL("Text Entry"), [_INTL("Cursor"), _INTL("Keyboard")],
|
||||
proc { $PokemonSystem.textinput },
|
||||
proc { |value| $PokemonSystem.textinput = value }
|
||||
),
|
||||
EnumOption.new(_INTL("Screen Size"), [_INTL("S"), _INTL("M"), _INTL("L"), _INTL("XL"), _INTL("Full")],
|
||||
proc { [$PokemonSystem.screensize, 4].min },
|
||||
proc { |value|
|
||||
if $PokemonSystem.screensize != value
|
||||
$PokemonSystem.screensize = value
|
||||
pbSetResizeFactor($PokemonSystem.screensize)
|
||||
end
|
||||
}
|
||||
)
|
||||
]
|
||||
@PokemonOptions = pbAddOnOptions(@PokemonOptions)
|
||||
@sprites["option"] = Window_PokemonOption.new(
|
||||
|
||||
@@ -56,7 +56,7 @@ class ReadyMenuButton < SpriteWrapper
|
||||
|
||||
def refresh
|
||||
sel = (@selected == @index && (@side == 0) == @command[2])
|
||||
self.y = (Graphics.height - @button.height / 2) / 2 - (@selected - @index) * (@button.height / 2 + 4)
|
||||
self.y = ((Graphics.height - (@button.height / 2)) / 2) - ((@selected - @index) * ((@button.height / 2) + 4))
|
||||
if @command[2] # Pokémon
|
||||
self.x = (sel) ? 0 : -16
|
||||
@icon.x = self.x + 52
|
||||
@@ -64,14 +64,14 @@ class ReadyMenuButton < SpriteWrapper
|
||||
else # Item
|
||||
self.x = (sel) ? Graphics.width - @button.width : Graphics.width + 16 - @button.width
|
||||
@icon.x = self.x + 32
|
||||
@icon.y = self.y + @button.height / 4
|
||||
@icon.y = self.y + (@button.height / 4)
|
||||
end
|
||||
self.bitmap.clear
|
||||
rect = Rect.new(0, (sel) ? @button.height / 2 : 0, @button.width, @button.height / 2)
|
||||
self.bitmap.blt(0, 0, @button.bitmap, rect)
|
||||
textx = (@command[2]) ? 164 : (GameData::Item.get(@command[0]).is_important?) ? 146 : 124
|
||||
textpos = [
|
||||
[@command[1], textx, 16, 2, Color.new(248, 248, 248), Color.new(40, 40, 40), 1]
|
||||
[@command[1], textx, 16, 2, Color.new(248, 248, 248), Color.new(40, 40, 40), 1]
|
||||
]
|
||||
if !@command[2]
|
||||
if !GameData::Item.get(@command[0]).is_important?
|
||||
|
||||
@@ -19,11 +19,11 @@ class PokemonBoxIcon < IconSprite
|
||||
self.oy = self.src_rect.height / 2 # 32
|
||||
self.x += self.src_rect.width / 2 # 32
|
||||
self.y += self.src_rect.height / 2 # 32
|
||||
@release.tween(self, [
|
||||
[Interpolator::ZOOM_X, 0],
|
||||
[Interpolator::ZOOM_Y, 0],
|
||||
[Interpolator::OPACITY, 0]
|
||||
], 100)
|
||||
@release.tween(self,
|
||||
[[Interpolator::ZOOM_X, 0],
|
||||
[Interpolator::ZOOM_Y, 0],
|
||||
[Interpolator::OPACITY, 0]],
|
||||
100)
|
||||
@startRelease = true
|
||||
end
|
||||
|
||||
@@ -95,7 +95,7 @@ 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),
|
||||
Rect.new((-@mosaic / 2) + 1, (-@mosaic / 2) + 1, @mosaicbitmap2.width, @mosaicbitmap2.height),
|
||||
@mosaicbitmap, Rect.new(0, 0, newWidth, newHeight)
|
||||
)
|
||||
self.bitmap = @mosaicbitmap2
|
||||
@@ -244,12 +244,12 @@ class PokemonBoxArrow < SpriteWrapper
|
||||
if @grabbingState > 0
|
||||
if @grabbingState <= 4 * Graphics.frame_rate / 20
|
||||
@handsprite.changeBitmap((@quickswap) ? "grabq" : "grab")
|
||||
self.y = @spriteY + 4.0 * @grabbingState * 20 / Graphics.frame_rate
|
||||
self.y = @spriteY + (4.0 * @grabbingState * 20 / Graphics.frame_rate)
|
||||
@grabbingState += 1
|
||||
elsif @grabbingState <= 8 * Graphics.frame_rate / 20
|
||||
@holding = true
|
||||
@handsprite.changeBitmap((@quickswap) ? "fistq" : "fist")
|
||||
self.y = @spriteY + 4 * (8 * Graphics.frame_rate / 20 - @grabbingState) * 20 / Graphics.frame_rate
|
||||
self.y = @spriteY + (4 * ((8 * Graphics.frame_rate / 20) - @grabbingState) * 20 / Graphics.frame_rate)
|
||||
@grabbingState += 1
|
||||
else
|
||||
@grabbingState = 0
|
||||
@@ -257,13 +257,13 @@ class PokemonBoxArrow < SpriteWrapper
|
||||
elsif @placingState > 0
|
||||
if @placingState <= 4 * Graphics.frame_rate / 20
|
||||
@handsprite.changeBitmap((@quickswap) ? "fistq" : "fist")
|
||||
self.y = @spriteY + 4.0 * @placingState * 20 / Graphics.frame_rate
|
||||
self.y = @spriteY + (4.0 * @placingState * 20 / Graphics.frame_rate)
|
||||
@placingState += 1
|
||||
elsif @placingState <= 8 * Graphics.frame_rate / 20
|
||||
@holding = false
|
||||
@heldpkmn = nil
|
||||
@handsprite.changeBitmap((@quickswap) ? "grabq" : "grab")
|
||||
self.y = @spriteY + 4 * (8 * Graphics.frame_rate / 20 - @placingState) * 20 / Graphics.frame_rate
|
||||
self.y = @spriteY + (4 * ((8 * Graphics.frame_rate / 20) - @placingState) * 20 / Graphics.frame_rate)
|
||||
@placingState += 1
|
||||
else
|
||||
@placingState = 0
|
||||
@@ -417,7 +417,7 @@ class PokemonBoxSprite < SpriteWrapper
|
||||
for j in 0...PokemonBox::BOX_HEIGHT
|
||||
xval = self.x + 10
|
||||
for k in 0...PokemonBox::BOX_WIDTH
|
||||
sprite = @pokemonsprites[j * PokemonBox::BOX_WIDTH + k]
|
||||
sprite = @pokemonsprites[(j * PokemonBox::BOX_WIDTH) + k]
|
||||
if sprite && !sprite.disposed?
|
||||
sprite.viewport = self.viewport
|
||||
sprite.x = xval
|
||||
@@ -529,14 +529,15 @@ class PokemonBoxPartySprite < SpriteWrapper
|
||||
|
||||
def refresh
|
||||
@contents.blt(0, 0, @boxbitmap.bitmap, Rect.new(0, 0, 172, 352))
|
||||
pbDrawTextPositions(self.bitmap, [
|
||||
[_INTL("Back"), 86, 240, 2, Color.new(248, 248, 248), Color.new(80, 80, 80), 1]
|
||||
])
|
||||
pbDrawTextPositions(
|
||||
self.bitmap,
|
||||
[[_INTL("Back"), 86, 240, 2, Color.new(248, 248, 248), Color.new(80, 80, 80), 1]]
|
||||
)
|
||||
xvalues = [] # [18, 90, 18, 90, 18, 90]
|
||||
yvalues = [] # [2, 18, 66, 82, 130, 146]
|
||||
for i in 0...Settings::MAX_PARTY_SIZE
|
||||
xvalues.push(18 + 72 * (i % 2))
|
||||
yvalues.push(2 + 16 * (i % 2) + 64 * (i / 2))
|
||||
xvalues.push(18 + (72 * (i % 2)))
|
||||
yvalues.push(2 + (16 * (i % 2)) + (64 * (i / 2)))
|
||||
end
|
||||
@pokemonsprites.delete_if { |sprite| sprite && sprite.disposed? }
|
||||
@pokemonsprites.each { |sprite| sprite.refresh if sprite }
|
||||
@@ -705,8 +706,8 @@ class PokemonStorageScene
|
||||
arrow.x = 207 * 2
|
||||
arrow.y = 139 * 2
|
||||
else
|
||||
arrow.x = (97 + 24 * (selection % PokemonBox::BOX_WIDTH)) * 2
|
||||
arrow.y = (8 + 24 * (selection / PokemonBox::BOX_WIDTH)) * 2
|
||||
arrow.x = (97 + (24 * (selection % PokemonBox::BOX_WIDTH))) * 2
|
||||
arrow.y = (8 + (24 * (selection / PokemonBox::BOX_WIDTH))) * 2
|
||||
end
|
||||
end
|
||||
|
||||
@@ -717,9 +718,9 @@ class PokemonStorageScene
|
||||
when -1 # Box name
|
||||
selection = -2
|
||||
when -2 # Party
|
||||
selection = PokemonBox::BOX_SIZE - 1 - PokemonBox::BOX_WIDTH * 2 / 3 # 25
|
||||
selection = PokemonBox::BOX_SIZE - 1 - (PokemonBox::BOX_WIDTH * 2 / 3) # 25
|
||||
when -3 # Close Box
|
||||
selection = PokemonBox::BOX_SIZE - PokemonBox::BOX_WIDTH / 3 # 28
|
||||
selection = PokemonBox::BOX_SIZE - (PokemonBox::BOX_WIDTH / 3) # 28
|
||||
else
|
||||
selection -= PokemonBox::BOX_WIDTH
|
||||
selection = -1 if selection < 0
|
||||
@@ -735,7 +736,7 @@ class PokemonStorageScene
|
||||
else
|
||||
selection += PokemonBox::BOX_WIDTH
|
||||
if selection >= PokemonBox::BOX_SIZE
|
||||
if selection < PokemonBox::BOX_SIZE + PokemonBox::BOX_WIDTH / 2
|
||||
if selection < PokemonBox::BOX_SIZE + (PokemonBox::BOX_WIDTH / 2)
|
||||
selection = -2 # Party
|
||||
else
|
||||
selection = -3 # Close Box
|
||||
@@ -775,8 +776,8 @@ class PokemonStorageScene
|
||||
xvalues = [] # [200, 272, 200, 272, 200, 272, 236]
|
||||
yvalues = [] # [2, 18, 66, 82, 130, 146, 220]
|
||||
for i in 0...Settings::MAX_PARTY_SIZE
|
||||
xvalues.push(200 + 72 * (i % 2))
|
||||
yvalues.push(2 + 16 * (i % 2) + 64 * (i / 2))
|
||||
xvalues.push(200 + (72 * (i % 2)))
|
||||
yvalues.push(2 + (16 * (i % 2)) + (64 * (i / 2)))
|
||||
end
|
||||
xvalues.push(236)
|
||||
yvalues.push(220)
|
||||
@@ -1325,12 +1326,12 @@ class PokemonStorageScene
|
||||
(@markingbitmap.bitmap.width / MARK_WIDTH).times do |i|
|
||||
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),
|
||||
@sprites["markingoverlay"].bitmap.blt(336 + (58 * (i % 3)), 106 + (50 * (i / 3)),
|
||||
@markingbitmap.bitmap, markrect)
|
||||
end
|
||||
textpos = [
|
||||
[_INTL("OK"), 402, 208, 2, base, shadow, 1],
|
||||
[_INTL("Cancel"), 402, 272, 2, base, shadow, 1]
|
||||
[_INTL("OK"), 402, 208, 2, base, shadow, 1],
|
||||
[_INTL("Cancel"), 402, 272, 2, base, shadow, 1]
|
||||
]
|
||||
pbDrawTextPositions(@sprites["markingoverlay"].bitmap, textpos)
|
||||
pbMarkingSetArrow(@sprites["arrow"], index)
|
||||
@@ -1392,7 +1393,7 @@ class PokemonStorageScene
|
||||
(@markingbitmap.bitmap.width / MARK_WIDTH).times do |i|
|
||||
markrect.x = i * MARK_WIDTH
|
||||
markrect.y = [(markings[i] || 0), mark_variants - 1].min * MARK_HEIGHT
|
||||
bitmap.blt(x + i * MARK_WIDTH, y, @markingbitmap.bitmap, markrect)
|
||||
bitmap.blt(x + (i * MARK_WIDTH), y, @markingbitmap.bitmap, markrect)
|
||||
end
|
||||
end
|
||||
|
||||
@@ -1401,10 +1402,11 @@ class PokemonStorageScene
|
||||
overlay.clear
|
||||
buttonbase = Color.new(248, 248, 248)
|
||||
buttonshadow = Color.new(80, 80, 80)
|
||||
pbDrawTextPositions(overlay, [
|
||||
[_INTL("Party: {1}", (@storage.party.length rescue 0)), 270, 326, 2, buttonbase, buttonshadow, 1],
|
||||
[_INTL("Exit"), 446, 326, 2, buttonbase, buttonshadow, 1]
|
||||
])
|
||||
pbDrawTextPositions(
|
||||
overlay,
|
||||
[[_INTL("Party: {1}", (@storage.party.length rescue 0)), 270, 326, 2, buttonbase, buttonshadow, 1],
|
||||
[_INTL("Exit"), 446, 326, 2, buttonbase, buttonshadow, 1]]
|
||||
)
|
||||
pokemon = nil
|
||||
if @screen.pbHeldPokemon
|
||||
pokemon = @screen.pbHeldPokemon
|
||||
@@ -1422,7 +1424,7 @@ class PokemonStorageScene
|
||||
nonshadow = Color.new(224, 224, 224)
|
||||
pokename = pokemon.name
|
||||
textstrings = [
|
||||
[pokename, 10, 2, false, base, shadow]
|
||||
[pokename, 10, 2, false, base, shadow]
|
||||
]
|
||||
if !pokemon.egg?
|
||||
imagepos = []
|
||||
@@ -1450,7 +1452,7 @@ class PokemonStorageScene
|
||||
pokemon.types.each_with_index do |type, i|
|
||||
type_number = GameData::Type.get(type).icon_position
|
||||
type_rect = Rect.new(0, type_number * 28, 64, 28)
|
||||
type_x = (pokemon.types.length == 1) ? 52 : 18 + 70 * i
|
||||
type_x = (pokemon.types.length == 1) ? 52 : 18 + (70 * i)
|
||||
overlay.blt(type_x, 272, typebitmap.bitmap, type_rect)
|
||||
end
|
||||
drawMarkings(overlay, 70, 240, 128, 20, pokemon.markings)
|
||||
@@ -1588,13 +1590,12 @@ class PokemonStorageScreen
|
||||
end
|
||||
pokemon = @storage[selected[0], selected[1]]
|
||||
next if !pokemon
|
||||
command = pbShowCommands(_INTL("{1} is selected.", pokemon.name), [
|
||||
_INTL("Withdraw"),
|
||||
_INTL("Summary"),
|
||||
_INTL("Mark"),
|
||||
_INTL("Release"),
|
||||
_INTL("Cancel")
|
||||
])
|
||||
command = pbShowCommands(_INTL("{1} is selected.", pokemon.name),
|
||||
[_INTL("Withdraw"),
|
||||
_INTL("Summary"),
|
||||
_INTL("Mark"),
|
||||
_INTL("Release"),
|
||||
_INTL("Cancel")])
|
||||
case command
|
||||
when 0 then pbWithdraw(selected, nil)
|
||||
when 1 then pbSummary(selected, nil)
|
||||
@@ -1620,13 +1621,12 @@ class PokemonStorageScreen
|
||||
else
|
||||
pokemon = @storage[-1, selected]
|
||||
next if !pokemon
|
||||
command = pbShowCommands(_INTL("{1} is selected.", pokemon.name), [
|
||||
_INTL("Store"),
|
||||
_INTL("Summary"),
|
||||
_INTL("Mark"),
|
||||
_INTL("Release"),
|
||||
_INTL("Cancel")
|
||||
])
|
||||
command = pbShowCommands(_INTL("{1} is selected.", pokemon.name),
|
||||
[_INTL("Store"),
|
||||
_INTL("Summary"),
|
||||
_INTL("Mark"),
|
||||
_INTL("Release"),
|
||||
_INTL("Cancel")])
|
||||
case command
|
||||
when 0 then pbStore([-1, selected], nil)
|
||||
when 1 then pbSummary([-1, selected], nil)
|
||||
@@ -1976,11 +1976,11 @@ class PokemonStorageScreen
|
||||
pokemon = @storage[selected[0], selected[1]]
|
||||
next if !pokemon
|
||||
commands = [
|
||||
_INTL("Select"),
|
||||
_INTL("Summary"),
|
||||
_INTL("Withdraw"),
|
||||
_INTL("Item"),
|
||||
_INTL("Mark")
|
||||
_INTL("Select"),
|
||||
_INTL("Summary"),
|
||||
_INTL("Withdraw"),
|
||||
_INTL("Item"),
|
||||
_INTL("Mark")
|
||||
]
|
||||
commands.push(_INTL("Cancel"))
|
||||
commands[2] = _INTL("Store") if selected[0] == -1
|
||||
|
||||
@@ -78,7 +78,7 @@ class ItemStorage_Scene
|
||||
@sprites["background"].setBitmap("Graphics/Pictures/pcItembg")
|
||||
@sprites["icon"] = ItemIconSprite.new(50, 334, nil, @viewport)
|
||||
# Item list
|
||||
@sprites["itemwindow"] = Window_PokemonItemStorage.new(@bag, 98, 14, 334, 32 + ITEMSVISIBLE * 32)
|
||||
@sprites["itemwindow"] = Window_PokemonItemStorage.new(@bag, 98, 14, 334, 32 + (ITEMSVISIBLE * 32))
|
||||
@sprites["itemwindow"].viewport = @viewport
|
||||
@sprites["itemwindow"].index = 0
|
||||
@sprites["itemwindow"].baseColor = ITEMLISTBASECOLOR
|
||||
|
||||
@@ -176,13 +176,13 @@ def pbPCMailbox
|
||||
command = pbShowCommands(nil, commands, -1, command)
|
||||
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), [
|
||||
_INTL("Read"),
|
||||
commandMail = pbMessage(
|
||||
_INTL("What do you want to do with {1}'s Mail?", $PokemonGlobal.mailbox[mailIndex].sender),
|
||||
[_INTL("Read"),
|
||||
_INTL("Move to Bag"),
|
||||
_INTL("Give"),
|
||||
_INTL("Cancel")
|
||||
], -1)
|
||||
_INTL("Cancel")], -1
|
||||
)
|
||||
case commandMail
|
||||
when 0 # Read
|
||||
pbFadeOutIn {
|
||||
@@ -214,11 +214,10 @@ end
|
||||
def pbTrainerPCMenu
|
||||
command = 0
|
||||
loop do
|
||||
command = pbMessage(_INTL("What do you want to do?"), [
|
||||
_INTL("Item Storage"),
|
||||
_INTL("Mailbox"),
|
||||
_INTL("Turn Off")
|
||||
], -1, nil, command)
|
||||
command = pbMessage(_INTL("What do you want to do?"),
|
||||
[_INTL("Item Storage"),
|
||||
_INTL("Mailbox"),
|
||||
_INTL("Turn Off")], -1, nil, command)
|
||||
case command
|
||||
when 0 then pbPCItemStorage
|
||||
when 1 then pbPCMailbox
|
||||
|
||||
@@ -56,8 +56,8 @@ class PokemonMartAdapter
|
||||
if $game_temp.mart_prices && $game_temp.mart_prices[item]
|
||||
if selling
|
||||
return $game_temp.mart_prices[item][1] if $game_temp.mart_prices[item][1] >= 0
|
||||
else
|
||||
return $game_temp.mart_prices[item][0] if $game_temp.mart_prices[item][0] > 0
|
||||
elsif $game_temp.mart_prices[item][0] > 0
|
||||
return $game_temp.mart_prices[item][0]
|
||||
end
|
||||
end
|
||||
return GameData::Item.get(item).sell_price if selling
|
||||
|
||||
@@ -55,11 +55,11 @@ class MoveRelearner_Scene
|
||||
@pokemon.types.each_with_index do |type, i|
|
||||
type_number = GameData::Type.get(type).icon_position
|
||||
type_rect = Rect.new(0, type_number * 28, 64, 28)
|
||||
type_x = (@pokemon.types.length == 1) ? 400 : 366 + 70 * i
|
||||
type_x = (@pokemon.types.length == 1) ? 400 : 366 + (70 * i)
|
||||
overlay.blt(type_x, 70, @typebitmap.bitmap, type_rect)
|
||||
end
|
||||
textpos = [
|
||||
[_INTL("Teach which move?"), 16, 2, 0, Color.new(88, 88, 80), Color.new(168, 184, 184)]
|
||||
[_INTL("Teach which move?"), 16, 2, 0, Color.new(88, 88, 80), Color.new(168, 184, 184)]
|
||||
]
|
||||
imagepos = []
|
||||
yPos = 76
|
||||
@@ -82,7 +82,7 @@ class MoveRelearner_Scene
|
||||
yPos += 64
|
||||
end
|
||||
imagepos.push(["Graphics/Pictures/reminderSel",
|
||||
0, 78 + (@sprites["commands"].index - @sprites["commands"].top_item) * 64,
|
||||
0, 78 + ((@sprites["commands"].index - @sprites["commands"].top_item) * 64),
|
||||
0, 0, 258, 72])
|
||||
selMoveData = GameData::Move.get(@moves[@sprites["commands"].index])
|
||||
basedamage = selMoveData.display_damage(@pokemon)
|
||||
@@ -119,7 +119,7 @@ class MoveRelearner_Scene
|
||||
pbUpdate
|
||||
if @sprites["commands"].index != oldcmd
|
||||
@sprites["background"].x = 0
|
||||
@sprites["background"].y = 78 + (@sprites["commands"].index - @sprites["commands"].top_item) * 64
|
||||
@sprites["background"].y = 78 + ((@sprites["commands"].index - @sprites["commands"].top_item) * 64)
|
||||
pbDrawMoveList
|
||||
end
|
||||
if Input.trigger?(Input::BACK)
|
||||
|
||||
@@ -53,7 +53,7 @@ class PurifyChamberSet
|
||||
attr_reader :facing # Index in list of Pokémon the Shadow Pokémon is facing
|
||||
|
||||
def partialSum(x)
|
||||
return (x * x + x) / 2 # pattern: 1, 3, 6, 10, 15, 21, 28, ...
|
||||
return ((x * x) + x) / 2 # pattern: 1, 3, 6, 10, 15, 21, 28, ...
|
||||
end
|
||||
|
||||
def length
|
||||
@@ -163,7 +163,7 @@ class PurifyChamber
|
||||
|
||||
def self.maximumTempo # Calculates the maximum possible tempo
|
||||
x = SETSIZE + 1
|
||||
return ((x * x + x) / 2) - 1
|
||||
return (((x * x) + x) / 2) - 1
|
||||
end
|
||||
|
||||
def initialize
|
||||
@@ -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,8 +448,8 @@ class PurifyChamberScreen
|
||||
end
|
||||
commands.push(_INTL("CANCEL"))
|
||||
choice = @scene.pbShowCommands(
|
||||
_INTL("What shall I do with this {1}?",
|
||||
heldpkmn ? heldpkmn.name : curpkmn.name), commands
|
||||
_INTL("What shall I do with this {1}?", heldpkmn ? heldpkmn.name : curpkmn.name),
|
||||
commands
|
||||
)
|
||||
if choice == 0
|
||||
if heldpkmn
|
||||
@@ -610,10 +611,8 @@ class PurifyChamberScreen
|
||||
end
|
||||
else
|
||||
chamber.currentSet = set
|
||||
cmd = @scene.pbShowCommands(
|
||||
_INTL("What do you want to do?"),
|
||||
[_INTL("EDIT"), _INTL("SWITCH"), _INTL("CANCEL")]
|
||||
)
|
||||
cmd = @scene.pbShowCommands(_INTL("What do you want to do?"),
|
||||
[_INTL("EDIT"), _INTL("SWITCH"), _INTL("CANCEL")])
|
||||
case cmd
|
||||
when 0 # edit
|
||||
if !pbOpenSetDetail
|
||||
@@ -748,7 +747,7 @@ class DirectFlowDiagram
|
||||
end
|
||||
|
||||
def setAngle(angle1)
|
||||
@angle = angle1 - (angle1 / 360).floor * 360
|
||||
@angle = angle1 - ((angle1 / 360).floor * 360)
|
||||
end
|
||||
end
|
||||
|
||||
@@ -831,8 +830,8 @@ class FlowDiagram
|
||||
end
|
||||
|
||||
def setRange(angle1, angle2)
|
||||
@startAngle = angle1 - (angle1 / 360).floor * 360
|
||||
@endAngle = angle2 - (angle2 / 360).floor * 360
|
||||
@startAngle = angle1 - ((angle1 / 360).floor * 360)
|
||||
@endAngle = angle2 - ((angle2 / 360).floor * 360)
|
||||
if @startAngle == @endAngle && angle1 != angle2
|
||||
@startAngle = 0
|
||||
@endAngle = 359.99
|
||||
@@ -866,7 +865,7 @@ class PurifyChamberSetView < SpriteWrapper
|
||||
for i in 0...PurifyChamber::SETSIZE * 2
|
||||
@__sprites[i + 1] = PokemonIconSprite.new(nil, viewport)
|
||||
end
|
||||
@__sprites[1 + PurifyChamber::SETSIZE * 2] = PokemonIconSprite.new(nil, viewport)
|
||||
@__sprites[1 + (PurifyChamber::SETSIZE * 2)] = PokemonIconSprite.new(nil, viewport)
|
||||
@chamber = chamber
|
||||
refresh
|
||||
end
|
||||
@@ -893,9 +892,9 @@ class PurifyChamberSetView < SpriteWrapper
|
||||
oldcursor = @cursor
|
||||
if @cursor == 0 && points > 0
|
||||
@cursor = 1 if button == Input::UP
|
||||
@cursor = points * 1 / 4 + 1 if button == Input::RIGHT
|
||||
@cursor = points * 2 / 4 + 1 if button == Input::DOWN
|
||||
@cursor = points * 3 / 4 + 1 if button == Input::LEFT
|
||||
@cursor = (points * 1 / 4) + 1 if button == Input::RIGHT
|
||||
@cursor = (points * 2 / 4) + 1 if button == Input::DOWN
|
||||
@cursor = (points * 3 / 4) + 1 if button == Input::LEFT
|
||||
elsif @cursor > 0
|
||||
pos = @cursor - 1
|
||||
if @chamber.setCount(@set) == PurifyChamber::SETSIZE
|
||||
@@ -959,7 +958,7 @@ class PurifyChamberSetView < SpriteWrapper
|
||||
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,
|
||||
textpos.push([_INTL("FLOW"), 2 + (@info.bitmap.width / 2), 18, 0,
|
||||
Color.new(248, 248, 248), Color.new(128, 128, 128)])
|
||||
# draw heart gauge
|
||||
pbDrawGauge(@info.bitmap, Rect.new(@info.bitmap.width * 3 / 4, 8, @info.bitmap.width * 1 / 4, 8),
|
||||
@@ -1004,11 +1003,11 @@ class PurifyChamberSetView < SpriteWrapper
|
||||
@__sprites[i + 1].pokemon = pkmn
|
||||
checkCursor(i + 1)
|
||||
end
|
||||
@__sprites[1 + PurifyChamber::SETSIZE * 2].pokemon = @heldpkmn
|
||||
@__sprites[1 + PurifyChamber::SETSIZE * 2].visible = @view.visible
|
||||
@__sprites[1 + PurifyChamber::SETSIZE * 2].x = @view.x + 32
|
||||
@__sprites[1 + PurifyChamber::SETSIZE * 2].y = @view.y - 6 + 40
|
||||
@__sprites[1 + PurifyChamber::SETSIZE * 2].z = 3
|
||||
@__sprites[1 + (PurifyChamber::SETSIZE * 2)].pokemon = @heldpkmn
|
||||
@__sprites[1 + (PurifyChamber::SETSIZE * 2)].visible = @view.visible
|
||||
@__sprites[1 + (PurifyChamber::SETSIZE * 2)].x = @view.x + 32
|
||||
@__sprites[1 + (PurifyChamber::SETSIZE * 2)].y = @view.y - 6 + 40
|
||||
@__sprites[1 + (PurifyChamber::SETSIZE * 2)].z = 3
|
||||
end
|
||||
|
||||
def getCurrent
|
||||
@@ -1115,7 +1114,7 @@ class PurifyChamberScene
|
||||
addBackgroundOrColoredPlane(@sprites, "bg", "purifychamberbg",
|
||||
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("")
|
||||
|
||||
@@ -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?"))
|
||||
@@ -73,13 +74,11 @@ def pbEditMysteryGift(type, item, id = 0, giftname = "")
|
||||
newid = pbMessageChooseNumber(_INTL("Choose a unique ID for this gift."), params)
|
||||
if newid == 0
|
||||
return nil if pbConfirmMessage(_INTL("Stop editing this gift?"))
|
||||
elsif idlist.include?(newid)
|
||||
pbMessage(_INTL("That ID is already used by a Mystery Gift."))
|
||||
else
|
||||
if idlist.include?(newid)
|
||||
pbMessage(_INTL("That ID is already used by a Mystery Gift."))
|
||||
else
|
||||
id = newid
|
||||
break
|
||||
end
|
||||
id = newid
|
||||
break
|
||||
end
|
||||
end
|
||||
end
|
||||
@@ -377,7 +376,7 @@ def pbReceiveMysteryGift(id)
|
||||
end
|
||||
gift = $player.mystery_gifts[index]
|
||||
if gift[1] == 0 # Pokémon
|
||||
gift[2].personalID = rand(2**16) | rand(2**16) << 16
|
||||
gift[2].personalID = rand(2**16) | (rand(2**16) << 16)
|
||||
gift[2].calc_stats
|
||||
time = pbGetTimeNow
|
||||
gift[2].timeReceived = time.getgm.to_i
|
||||
|
||||
@@ -71,8 +71,8 @@ end
|
||||
#===============================================================================
|
||||
class PokemonEntryScene
|
||||
@@Characters = [
|
||||
[("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz").scan(/./), "[*]"],
|
||||
[("0123456789 !@\#$%^&*() ~`-_+={}[] :;'\"<>,.?/ ").scan(/./), "[A]"]
|
||||
[("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz").scan(/./), "[*]"],
|
||||
[("0123456789 !@\#$%^&*() ~`-_+={}[] :;'\"<>,.?/ ").scan(/./), "[A]"]
|
||||
]
|
||||
USEKEYBOARD = true
|
||||
|
||||
@@ -104,13 +104,13 @@ class PokemonEntryScene
|
||||
end
|
||||
if minlength == 0
|
||||
@sprites["helpwindow"] = Window_UnformattedTextPokemon.newWithSize(
|
||||
_INTL("Enter text using the keyboard. Press\nEnter to confirm, or Esc to cancel."),
|
||||
32, Graphics.height - 96, Graphics.width - 64, 96, @viewport
|
||||
_INTL("Enter text using the keyboard. Press\nEnter to confirm, or Esc to cancel."),
|
||||
32, Graphics.height - 96, Graphics.width - 64, 96, @viewport
|
||||
)
|
||||
else
|
||||
@sprites["helpwindow"] = Window_UnformattedTextPokemon.newWithSize(
|
||||
_INTL("Enter text using the keyboard.\nPress Enter to confirm."),
|
||||
32, Graphics.height - 96, Graphics.width - 64, 96, @viewport
|
||||
_INTL("Enter text using the keyboard.\nPress Enter to confirm."),
|
||||
32, Graphics.height - 96, Graphics.width - 64, 96, @viewport
|
||||
)
|
||||
end
|
||||
@sprites["helpwindow"].letterbyletter = false
|
||||
@@ -131,8 +131,8 @@ class PokemonEntryScene
|
||||
@sprites["subject"] = TrainerWalkingCharSprite.new(filename, @viewport)
|
||||
charwidth = @sprites["subject"].bitmap.width
|
||||
charheight = @sprites["subject"].bitmap.height
|
||||
@sprites["subject"].x = 44 * 2 - charwidth / 8
|
||||
@sprites["subject"].y = 38 * 2 - charheight / 4
|
||||
@sprites["subject"].x = (44 * 2) - (charwidth / 8)
|
||||
@sprites["subject"].y = (38 * 2) - (charheight / 4)
|
||||
end
|
||||
when 2 # Pokémon
|
||||
if pokemon
|
||||
@@ -165,16 +165,16 @@ class PokemonEntryScene
|
||||
@sprites["subject"] = TrainerWalkingCharSprite.new(pokemon.to_s, @viewport)
|
||||
charwidth = @sprites["subject"].bitmap.width
|
||||
charheight = @sprites["subject"].bitmap.height
|
||||
@sprites["subject"].x = 44 * 2 - charwidth / 8
|
||||
@sprites["subject"].y = 38 * 2 - charheight / 4
|
||||
@sprites["subject"].x = (44 * 2) - (charwidth / 8)
|
||||
@sprites["subject"].y = (38 * 2) - (charheight / 4)
|
||||
when 4 # Storage box
|
||||
@sprites["subject"] = TrainerWalkingCharSprite.new(nil, @viewport)
|
||||
@sprites["subject"].altcharset = "Graphics/Pictures/Naming/icon_storage"
|
||||
@sprites["subject"].animspeed = 4
|
||||
charwidth = @sprites["subject"].bitmap.width
|
||||
charheight = @sprites["subject"].bitmap.height
|
||||
@sprites["subject"].x = 44 * 2 - charwidth / 8
|
||||
@sprites["subject"].y = 26 * 2 - charheight / 2
|
||||
@sprites["subject"].x = (44 * 2) - (charwidth / 8)
|
||||
@sprites["subject"].y = (26 * 2) - (charheight / 2)
|
||||
end
|
||||
pbFadeInAndShow(@sprites)
|
||||
end
|
||||
@@ -321,8 +321,8 @@ class PokemonEntryScene2
|
||||
@cursortype = 2
|
||||
else
|
||||
if value >= 0
|
||||
@sprite.x = 52 + 32 * (value % PokemonEntryScene2::ROWS)
|
||||
@sprite.y = 180 + 38 * (value / PokemonEntryScene2::ROWS)
|
||||
@sprite.x = 52 + (32 * (value % PokemonEntryScene2::ROWS))
|
||||
@sprite.y = 180 + (38 * (value / PokemonEntryScene2::ROWS))
|
||||
@cursortype = 0
|
||||
end
|
||||
end
|
||||
@@ -388,8 +388,8 @@ class PokemonEntryScene2
|
||||
textPos = []
|
||||
for y in 0...COLUMNS
|
||||
for x in 0...ROWS
|
||||
pos = y * ROWS + x
|
||||
textPos.push([@@Characters[i][0][pos], 44 + x * 32, 12 + y * 38, 2,
|
||||
pos = (y * ROWS) + x
|
||||
textPos.push([@@Characters[i][0][pos], 44 + (x * 32), 12 + (y * 38), 2,
|
||||
Color.new(16, 24, 32), Color.new(160, 160, 160)])
|
||||
end
|
||||
end
|
||||
@@ -416,8 +416,8 @@ class PokemonEntryScene2
|
||||
@sprites["subject"] = TrainerWalkingCharSprite.new(filename, @viewport)
|
||||
charwidth = @sprites["subject"].bitmap.width
|
||||
charheight = @sprites["subject"].bitmap.height
|
||||
@sprites["subject"].x = 88 - charwidth / 8
|
||||
@sprites["subject"].y = 76 - charheight / 4
|
||||
@sprites["subject"].x = 88 - (charwidth / 8)
|
||||
@sprites["subject"].y = 76 - (charheight / 4)
|
||||
end
|
||||
when 2 # Pokémon
|
||||
if pokemon
|
||||
@@ -450,16 +450,16 @@ class PokemonEntryScene2
|
||||
@sprites["subject"] = TrainerWalkingCharSprite.new(pokemon.to_s, @viewport)
|
||||
charwidth = @sprites["subject"].bitmap.width
|
||||
charheight = @sprites["subject"].bitmap.height
|
||||
@sprites["subject"].x = 88 - charwidth / 8
|
||||
@sprites["subject"].y = 76 - charheight / 4
|
||||
@sprites["subject"].x = 88 - (charwidth / 8)
|
||||
@sprites["subject"].y = 76 - (charheight / 4)
|
||||
when 4 # Storage box
|
||||
@sprites["subject"] = TrainerWalkingCharSprite.new(nil, @viewport)
|
||||
@sprites["subject"].altcharset = "Graphics/Pictures/Naming/icon_storage"
|
||||
@sprites["subject"].animspeed = 4
|
||||
charwidth = @sprites["subject"].bitmap.width
|
||||
charheight = @sprites["subject"].bitmap.height
|
||||
@sprites["subject"].x = 88 - charwidth / 8
|
||||
@sprites["subject"].y = 52 - charheight / 2
|
||||
@sprites["subject"].x = 88 - (charwidth / 8)
|
||||
@sprites["subject"].y = 52 - (charheight / 2)
|
||||
end
|
||||
@sprites["bgoverlay"] = BitmapSprite.new(Graphics.width, Graphics.height, @viewport)
|
||||
pbDoUpdateOverlay
|
||||
@@ -469,7 +469,7 @@ class PokemonEntryScene2
|
||||
@maxlength = maxlength
|
||||
@maxlength.times { |i|
|
||||
@sprites["blank#{i}"] = SpriteWrapper.new(@viewport)
|
||||
@sprites["blank#{i}"].x = 160 + 24 * i
|
||||
@sprites["blank#{i}"].x = 160 + (24 * i)
|
||||
@sprites["blank#{i}"].bitmap = @bitmaps[@bitmaps.length - 1]
|
||||
@blanks[i] = 0
|
||||
}
|
||||
@@ -502,7 +502,7 @@ class PokemonEntryScene2
|
||||
def pbDoUpdateOverlay2
|
||||
overlay = @sprites["overlay"].bitmap
|
||||
overlay.clear
|
||||
modeIcon = [[_INTL("Graphics/Pictures/Naming/icon_mode"), 44 + @mode * 62, 120, @mode * 60, 0, 60, 44]]
|
||||
modeIcon = [[_INTL("Graphics/Pictures/Naming/icon_mode"), 44 + (@mode * 62), 120, @mode * 60, 0, 60, 44]]
|
||||
pbDrawImagePositions(overlay, modeIcon)
|
||||
end
|
||||
|
||||
@@ -513,7 +513,7 @@ class PokemonEntryScene2
|
||||
bgoverlay.clear
|
||||
pbSetSystemFont(bgoverlay)
|
||||
textPositions = [
|
||||
[@helptext, 160, 6, false, Color.new(16, 24, 32), Color.new(168, 184, 184)]
|
||||
[@helptext, 160, 6, false, Color.new(16, 24, 32), Color.new(168, 184, 184)]
|
||||
]
|
||||
chars = @helper.textChars
|
||||
x = 166
|
||||
@@ -587,7 +587,7 @@ class PokemonEntryScene2
|
||||
return false if m >= ROWS - 1
|
||||
chset = @@Characters[@mode][0]
|
||||
COLUMNS.times do |i|
|
||||
return false if chset[i * ROWS + m] != " "
|
||||
return false if chset[(i * ROWS) + m] != " "
|
||||
end
|
||||
return true
|
||||
end
|
||||
@@ -627,11 +627,11 @@ class PokemonEntryScene2
|
||||
if @cursorpos < 0 # Controls
|
||||
case @cursorpos
|
||||
when MODE1 then @cursorpos = ROWS * (COLUMNS - 1)
|
||||
when MODE2 then @cursorpos = ROWS * (COLUMNS - 1) + 2
|
||||
when MODE3 then @cursorpos = ROWS * (COLUMNS - 1) + 4
|
||||
when MODE4 then @cursorpos = ROWS * (COLUMNS - 1) + 6
|
||||
when BACK then @cursorpos = ROWS * (COLUMNS - 1) + 9
|
||||
when OK then @cursorpos = ROWS * (COLUMNS - 1) + 11
|
||||
when MODE2 then @cursorpos = (ROWS * (COLUMNS - 1)) + 2
|
||||
when MODE3 then @cursorpos = (ROWS * (COLUMNS - 1)) + 4
|
||||
when MODE4 then @cursorpos = (ROWS * (COLUMNS - 1)) + 6
|
||||
when BACK then @cursorpos = (ROWS * (COLUMNS - 1)) + 9
|
||||
when OK then @cursorpos = (ROWS * (COLUMNS - 1)) + 11
|
||||
end
|
||||
elsif @cursorpos < ROWS # Top row of letters
|
||||
case @cursorpos
|
||||
@@ -644,7 +644,7 @@ class PokemonEntryScene2
|
||||
end
|
||||
else
|
||||
cursordiv = wrapmod(cursordiv - 1, COLUMNS)
|
||||
@cursorpos = cursordiv * ROWS + cursormod
|
||||
@cursorpos = (cursordiv * ROWS) + cursormod
|
||||
end
|
||||
elsif Input.repeat?(Input::DOWN)
|
||||
if @cursorpos < 0 # Controls
|
||||
@@ -667,7 +667,7 @@ class PokemonEntryScene2
|
||||
end
|
||||
else
|
||||
cursordiv = wrapmod(cursordiv + 1, COLUMNS)
|
||||
@cursorpos = cursordiv * ROWS + cursormod
|
||||
@cursorpos = (cursordiv * ROWS) + cursormod
|
||||
end
|
||||
end
|
||||
if @cursorpos != oldcursor # Cursor position changed
|
||||
@@ -717,7 +717,7 @@ class PokemonEntryScene2
|
||||
else
|
||||
cursormod = @cursorpos % ROWS
|
||||
cursordiv = @cursorpos / ROWS
|
||||
charpos = cursordiv * ROWS + cursormod
|
||||
charpos = (cursordiv * ROWS) + cursormod
|
||||
chset = @@Characters[@mode][0]
|
||||
if @helper.length >= @maxlength
|
||||
@helper.delete
|
||||
|
||||
Reference in New Issue
Block a user