More aligning of code

This commit is contained in:
Maruno17
2021-12-19 12:19:08 +00:00
parent 13a238cc6a
commit 33781493f4
121 changed files with 977 additions and 838 deletions

View File

@@ -8,8 +8,9 @@ def pbEncountersEditor
commands = []
maps = []
list = pbListWindow([])
help_window = Window_UnformattedTextPokemon.newWithSize(_INTL("Edit wild encounters"),
Graphics.width / 2, 0, Graphics.width / 2, 96)
help_window = Window_UnformattedTextPokemon.newWithSize(
_INTL("Edit wild encounters"), Graphics.width / 2, 0, Graphics.width / 2, 96
)
help_window.z = 99999
ret = 0
need_refresh = true
@@ -128,8 +129,9 @@ def pbEncounterMapVersionEditor(enc_data)
commands = []
enc_types = []
list = pbListWindow([])
help_window = Window_UnformattedTextPokemon.newWithSize(_INTL("Edit map's encounters"),
Graphics.width / 2, 0, Graphics.width / 2, 96)
help_window = Window_UnformattedTextPokemon.newWithSize(
_INTL("Edit map's encounters"), Graphics.width / 2, 0, Graphics.width / 2, 96
)
help_window.z = 99999
ret = 0
need_refresh = true
@@ -219,7 +221,7 @@ def pbEncounterMapVersionEditor(enc_data)
end
if new_type_commands.length > 0
chosen_type_cmd = pbMessage(_INTL("Choose an encounter type to copy to."),
new_type_commands, -1)
new_type_commands, -1)
if chosen_type_cmd >= 0
new_type = new_types[chosen_type_cmd]
enc_data.step_chances[new_type] = enc_data.step_chances[this_type]
@@ -253,8 +255,9 @@ end
def pbEncounterTypeEditor(enc_data, enc_type)
commands = []
list = pbListWindow([])
help_window = Window_UnformattedTextPokemon.newWithSize(_INTL("Edit encounter slots"),
Graphics.width / 2, 0, Graphics.width / 2, 96)
help_window = Window_UnformattedTextPokemon.newWithSize(
_INTL("Edit encounter slots"), Graphics.width / 2, 0, Graphics.width / 2, 96
)
help_window.z = 99999
enc_type_name = ""
ret = 0
@@ -409,7 +412,7 @@ end
def pbTrainerTypeEditorNew(default_name)
# Choose a name
name = pbMessageFreeText(_INTL("Please enter the trainer type's name."),
(default_name) ? default_name.gsub(/_+/, " ") : "", false, 30)
(default_name) ? default_name.gsub(/_+/, " ") : "", false, 30)
if nil_or_empty?(name)
return nil if !default_name
name = default_name
@@ -942,7 +945,7 @@ end
def pbItemEditorNew(default_name)
# Choose a name
name = pbMessageFreeText(_INTL("Please enter the item's name."),
(default_name) ? default_name.gsub(/_+/, " ") : "", false, 30)
(default_name) ? default_name.gsub(/_+/, " ") : "", false, 30)
if nil_or_empty?(name)
return if !default_name
name = default_name
@@ -1171,8 +1174,9 @@ def pbRegionalDexEditor(dex)
viewport.z = 99999
cmd_window = pbListWindow([])
info = Window_AdvancedTextPokemon.newWithSize(
_INTL("Z+Up/Down: Rearrange entries\nZ+Right: Insert new entry\nZ+Left: Delete entry\nD: Clear entry"),
Graphics.width / 2, 64, Graphics.width / 2, Graphics.height - 64, viewport)
_INTL("Z+Up/Down: Rearrange entries\nZ+Right: Insert new entry\nZ+Left: Delete entry\nD: Clear entry"),
Graphics.width / 2, 64, Graphics.width / 2, Graphics.height - 64, viewport
)
info.z = 2
dex.compact!
ret = dex.clone
@@ -1226,7 +1230,9 @@ def pbRegionalDexEditor(dex)
when 0
if cmd[1] >= 0 # Edit entry
case pbMessage(_INTL("\\ts[]Do what with this entry?"),
[_INTL("Change species"), _INTL("Clear"), _INTL("Insert entry"), _INTL("Delete entry"), _INTL("Cancel")], 5)
[_INTL("Change species"), _INTL("Clear"),
_INTL("Insert entry"), _INTL("Delete entry"),
_INTL("Cancel")], 5)
when 0 # Change species
species = pbChooseSpeciesList(dex[cmd[1]])
if species
@@ -1252,7 +1258,7 @@ def pbRegionalDexEditor(dex)
end
else # Cancel
case pbMessage(_INTL("Save changes?"),
[_INTL("Yes"), _INTL("No"), _INTL("Cancel")], 3)
[_INTL("Yes"), _INTL("No"), _INTL("Cancel")], 3)
when 0 # Save all changes to Dex
dex.slice!(-1) while !dex[-1]
ret = dex
@@ -1276,11 +1282,14 @@ def pbRegionalDexEditorMain
cmd_window = pbListWindow([])
cmd_window.viewport = viewport
cmd_window.z = 2
title = Window_UnformattedTextPokemon.newWithSize(_INTL("Regional Dexes Editor"),
Graphics.width / 2, 0, Graphics.width / 2, 64, viewport)
title = Window_UnformattedTextPokemon.newWithSize(
_INTL("Regional Dexes Editor"), Graphics.width / 2, 0, Graphics.width / 2, 64, viewport
)
title.z = 2
info = Window_AdvancedTextPokemon.newWithSize(_INTL("Z+Up/Down: Rearrange Dexes"),
Graphics.width / 2, 64, Graphics.width / 2, Graphics.height - 64, viewport)
info = Window_AdvancedTextPokemon.newWithSize(
_INTL("Z+Up/Down: Rearrange Dexes"), Graphics.width / 2, 64,
Graphics.width / 2, Graphics.height - 64, viewport
)
info.z = 2
dex_lists = []
pbLoadRegionalDexes.each_with_index { |d, index| dex_lists[index] = d.clone }
@@ -1314,7 +1323,8 @@ def pbRegionalDexEditorMain
when 0 # Clicked on a command/Dex
if cmd[1] == 0 # Add new Dex
case pbMessage(_INTL("Fill in this new Dex?"),
[_INTL("Leave blank"), _INTL("National Dex"), _INTL("Nat. Dex grouped families"), _INTL("Cancel")], 4)
[_INTL("Leave blank"), _INTL("National Dex"),
_INTL("Nat. Dex grouped families"), _INTL("Cancel")], 4)
when 0 # Leave blank
dex_lists.push([])
refresh_list = true
@@ -1337,7 +1347,7 @@ def pbRegionalDexEditorMain
end
elsif cmd[1] > 0 # Edit a Dex
case pbMessage(_INTL("\\ts[]Do what with this Dex?"),
[_INTL("Edit"), _INTL("Copy"), _INTL("Delete"), _INTL("Cancel")], 4)
[_INTL("Edit"), _INTL("Copy"), _INTL("Delete"), _INTL("Cancel")], 4)
when 0 # Edit
dex_lists[cmd[1] - 1] = pbRegionalDexEditor(dex_lists[cmd[1] - 1])
refresh_list = true
@@ -1352,7 +1362,7 @@ def pbRegionalDexEditorMain
end
else # Cancel
case pbMessage(_INTL("Save changes?"),
[_INTL("Yes"), _INTL("No"), _INTL("Cancel")], 3)
[_INTL("Yes"), _INTL("No"), _INTL("Cancel")], 3)
when 0 # Save all changes to Dexes
save_data(dex_lists, "Data/regional_dexes.dat")
$game_temp.regional_dexes_data = nil
@@ -1432,11 +1442,14 @@ def pbAnimationsOrganiser
cmdwin = pbListWindow([])
cmdwin.viewport = viewport
cmdwin.z = 2
title = Window_UnformattedTextPokemon.newWithSize(_INTL("Animations Organiser"),
Graphics.width / 2, 0, Graphics.width / 2, 64, viewport)
title = Window_UnformattedTextPokemon.newWithSize(
_INTL("Animations Organiser"), Graphics.width / 2, 0, Graphics.width / 2, 64, viewport
)
title.z = 2
info = Window_AdvancedTextPokemon.newWithSize(_INTL("Z+Up/Down: Swap\nZ+Left: Delete\nZ+Right: Insert"),
Graphics.width / 2, 64, Graphics.width / 2, Graphics.height - 64, viewport)
info = Window_AdvancedTextPokemon.newWithSize(
_INTL("Z+Up/Down: Swap\nZ+Left: Delete\nZ+Right: Insert"),
Graphics.width / 2, 64, Graphics.width / 2, Graphics.height - 64, viewport
)
info.z = 2
commands = []
refreshlist = true
@@ -1474,7 +1487,7 @@ def pbAnimationsOrganiser
pbWait(Graphics.frame_rate * 2 / 10)
when 0
cmd2 = pbMessage(_INTL("Save changes?"),
[_INTL("Yes"), _INTL("No"), _INTL("Cancel")], 3)
[_INTL("Yes"), _INTL("No"), _INTL("Cancel")], 3)
if [0, 1].include?(cmd2)
if cmd2 == 0
# Save animations here

View File

@@ -17,8 +17,9 @@ class PokemonTilesetScene
@viewport.z = 99999
@sprites = {}
@sprites["title"] = Window_UnformattedTextPokemon.newWithSize(
_INTL("Tileset Editor\r\nA/S: SCROLL\r\nZ: MENU"),
TILESET_WIDTH, 0, Graphics.width - TILESET_WIDTH, 128, @viewport)
_INTL("Tileset Editor\r\nA/S: SCROLL\r\nZ: MENU"),
TILESET_WIDTH, 0, Graphics.width - TILESET_WIDTH, 128, @viewport
)
@sprites["tileset"] = BitmapSprite.new(TILESET_WIDTH, Graphics.height, @viewport)
@sprites["overlay"] = BitmapSprite.new(Graphics.width, Graphics.height, @viewport)
pbSetSystemFont(@sprites["overlay"].bitmap)
@@ -74,7 +75,7 @@ class PokemonTilesetScene
for xx in 0...TILES_PER_ROW
id_x_offset = (autotile_row) ? xx * TILES_PER_AUTOTILE : xx
@tilehelper.bltTile(@sprites["tileset"].bitmap, xx * TILE_SIZE, yy * TILE_SIZE,
id_y_offset + id_x_offset)
id_y_offset + id_x_offset)
end
end
end

View File

@@ -60,15 +60,16 @@ class SelectionSprite < Sprite
if @othersprite && !@othersprite.disposed? &&
@othersprite.bitmap && !@othersprite.bitmap.disposed?
@sprite.bitmap = pbDoEnsureBitmap(
@sprite.bitmap, @othersprite.bitmap.width, @othersprite.bitmap.height)
@sprite.bitmap, @othersprite.bitmap.width, @othersprite.bitmap.height
)
red = Color.new(255, 0, 0)
@sprite.bitmap.clear
@sprite.bitmap.fill_rect(0, 0, @othersprite.bitmap.width, 2, red)
@sprite.bitmap.fill_rect(0, @othersprite.bitmap.height - 2,
@othersprite.bitmap.width, 2, red)
@othersprite.bitmap.width, 2, red)
@sprite.bitmap.fill_rect(0, 0, 2, @othersprite.bitmap.height, red)
@sprite.bitmap.fill_rect(@othersprite.bitmap.width - 2, 0, 2,
@othersprite.bitmap.height, red)
@othersprite.bitmap.height, red)
end
end
@@ -324,8 +325,9 @@ class MapScreenScene
@selmapid = -1
@sprites["background"] = ColoredPlane.new(Color.new(160, 208, 240), @viewport)
@sprites["selsprite"] = SelectionSprite.new(@viewport)
@sprites["title"] = Window_UnformattedTextPokemon.newWithSize(_INTL("D: Help"),
0, Graphics.height - 64, Graphics.width, 64, @viewport)
@sprites["title"] = Window_UnformattedTextPokemon.newWithSize(
_INTL("D: Help"), 0, Graphics.height - 64, Graphics.width, 64, @viewport
)
@sprites["title"].z = 2
@mapinfos = pbLoadMapInfos
conns = MapFactoryHelper.getMapConnections
@@ -358,8 +360,9 @@ class MapScreenScene
helptext += _INTL("Double-click: Edit map's metadata\r\n")
helptext += _INTL("Drag map to move it\r\n")
helptext += _INTL("Arrow keys/drag canvas: Move around canvas")
title = Window_UnformattedTextPokemon.newWithSize(helptext,
0, 0, Graphics.width * 8 / 10, Graphics.height, @viewport)
title = Window_UnformattedTextPokemon.newWithSize(
helptext, 0, 0, Graphics.width * 8 / 10, Graphics.height, @viewport
)
title.z = 2
loop do
Graphics.update

View File

@@ -223,7 +223,7 @@ class AnimationWindow < SpriteWrapper
@contents.fill_rect(0, 0, @contents.width, @contents.height, Color.new(180, 180, 180))
@contents.blt(0, 0, @arrows.bitmap, Rect.new(0, 0, arrowwidth, 96))
@contents.blt(arrowwidth + NUMFRAMES * 96, 0, @arrows.bitmap,
Rect.new(arrowwidth, 0, arrowwidth, 96))
Rect.new(arrowwidth, 0, arrowwidth, 96))
havebitmap = (self.animbitmap && !self.animbitmap.disposed?)
if havebitmap
rect = Rect.new(0, 0, 0, 0)
@@ -484,7 +484,7 @@ class AnimationCanvas < Sprite
else
begin
@animbitmap = AnimatedBitmap.new("Graphics/Animations/" + @animation.graphic,
@animation.hue).deanimate
@animation.hue).deanimate
rescue
@animbitmap = nil
end
@@ -527,13 +527,13 @@ class AnimationCanvas < Sprite
@sprites["pokemon_1"].bitmap = @target
@sprites["pokemon_1"].z = 16
pbSpriteSetAnimFrame(@sprites["pokemon_0"],
pbCreateCel(Battle::Scene::FOCUSUSER_X,
Battle::Scene::FOCUSUSER_Y, -1, 2),
@sprites["pokemon_0"], @sprites["pokemon_1"])
pbCreateCel(Battle::Scene::FOCUSUSER_X,
Battle::Scene::FOCUSUSER_Y, -1, 2),
@sprites["pokemon_0"], @sprites["pokemon_1"])
pbSpriteSetAnimFrame(@sprites["pokemon_1"],
pbCreateCel(Battle::Scene::FOCUSTARGET_X,
Battle::Scene::FOCUSTARGET_Y, -2, 1),
@sprites["pokemon_0"], @sprites["pokemon_1"])
pbCreateCel(Battle::Scene::FOCUSTARGET_X,
Battle::Scene::FOCUSTARGET_Y, -2, 1),
@sprites["pokemon_0"], @sprites["pokemon_1"])
usersprite = @sprites["pokemon_#{oppmove ? 1 : 0}"]
targetsprite = @sprites["pokemon_#{oppmove ? 0 : 1}"]
olduserx = usersprite ? usersprite.x : 0
@@ -541,12 +541,15 @@ class AnimationCanvas < Sprite
oldtargetx = targetsprite ? targetsprite.x : 0
oldtargety = targetsprite ? targetsprite.y : 0
@player = PBAnimationPlayerX.new(@animation,
@battle.battlers[oppmove ? 1 : 0], @battle.battlers[oppmove ? 0 : 1], self, oppmove, true)
@battle.battlers[oppmove ? 1 : 0],
@battle.battlers[oppmove ? 0 : 1],
self, oppmove, true)
@player.setLineTransform(
Battle::Scene::FOCUSUSER_X, Battle::Scene::FOCUSUSER_Y,
Battle::Scene::FOCUSTARGET_X, Battle::Scene::FOCUSTARGET_Y,
olduserx, oldusery,
oldtargetx, oldtargety)
Battle::Scene::FOCUSUSER_X, Battle::Scene::FOCUSUSER_Y,
Battle::Scene::FOCUSTARGET_X, Battle::Scene::FOCUSTARGET_Y,
olduserx, oldusery,
oldtargetx, oldtargety
)
@player.start
@playing = true
@sprites["pokemon_0"].x += BORDERSIZE
@@ -992,10 +995,9 @@ class BitmapDisplayWindow < SpriteWindow_Base
wh = sx * wh
ww = self.contents.width
end
dest = Rect.new(
(self.contents.width - ww) / 2,
(self.contents.height - wh) / 2,
ww, wh)
dest = Rect.new((self.contents.width - ww) / 2,
(self.contents.height - wh) / 2,
ww, wh)
src = Rect.new(0, 0, bmap.width, bmap.height)
self.contents.stretch_blt(dest, bmap, src)
bmap.dispose
@@ -1009,7 +1011,8 @@ class AnimationNameWindow
@canvas = canvas
@oldname = nil
@window = Window_UnformattedTextPokemon.newWithSize(
_INTL("Name: {1}", @canvas.animation.name), x, y, width, height, viewport)
_INTL("Name: {1}", @canvas.animation.name), x, y, width, height, viewport
)
end
def viewport=(value); @window.viewport = value; end

View File

@@ -8,8 +8,8 @@ module ShadowText
x += (w / 2) - (width / 2)
end
pbDrawShadowText(bitmap, x, y, w, h, t,
disabled ? Color.new(26 * 8, 26 * 8, 25 * 8) : Color.new(12 * 8, 12 * 8, 12 * 8),
Color.new(26 * 8, 26 * 8, 25 * 8))
disabled ? Color.new(26 * 8, 26 * 8, 25 * 8) : Color.new(12 * 8, 12 * 8, 12 * 8),
Color.new(26 * 8, 26 * 8, 25 * 8))
end
end
@@ -47,10 +47,7 @@ class UIControl
end
def toAbsoluteRect(rc)
return Rect.new(
rc.x + self.parentX,
rc.y + self.parentY,
rc.width, rc.height)
return Rect.new(rc.x + self.parentX, rc.y + self.parentY, rc.width, rc.height)
end
def parentX
@@ -442,7 +439,7 @@ class Slider < UIControl
shadowtext(bitmap, x, y, size, height, self.label)
x += size
shadowtext(bitmap, x, y, leftarrows.width, height, _INTL(" << "),
self.disabled || self.curvalue == self.minvalue)
self.disabled || self.curvalue == self.minvalue)
@leftarrow = Rect.new(x, y, leftarrows.width, height)
x += leftarrows.width
if !self.disabled
@@ -451,7 +448,7 @@ class Slider < UIControl
end
x += numbers
shadowtext(bitmap, x, y, rightarrows.width, height, _INTL(" >> "),
self.disabled || self.curvalue == self.maxvalue)
self.disabled || self.curvalue == self.maxvalue)
@rightarrow = Rect.new(x, y, rightarrows.width, height)
end
end
@@ -690,7 +687,7 @@ class TextSlider < UIControl
shadowtext(bitmap, x, y, size, height, self.label)
x += size
shadowtext(bitmap, x, y, leftarrows.width, height, _INTL(" << "),
self.disabled || self.curvalue == self.minvalue)
self.disabled || self.curvalue == self.minvalue)
@leftarrow = Rect.new(x, y, leftarrows.width, height)
x += leftarrows.width
if !self.disabled
@@ -699,7 +696,7 @@ class TextSlider < UIControl
end
x += @maxoptionwidth
shadowtext(bitmap, x, y, rightarrows.width, height, _INTL(" >> "),
self.disabled || self.curvalue == self.maxvalue)
self.disabled || self.curvalue == self.maxvalue)
@rightarrow = Rect.new(x, y, rightarrows.width, height)
end
end

View File

@@ -283,8 +283,9 @@ def pbDefinePath(canvas)
showline = false
sliderwin2.visible = false
# This window displays the mouse's current position
window = Window_UnformattedTextPokemon.newWithSize("",
0, 320 - 64, 128, 64, canvas.viewport)
window = Window_UnformattedTextPokemon.newWithSize(
"", 0, 320 - 64, 128, 64, canvas.viewport
)
loop do
Graphics.update
Input.update
@@ -363,8 +364,9 @@ def pbDefinePath(canvas)
point.dispose
end
points.clear
window = Window_UnformattedTextPokemon.newWithSize("",
0, 320 - 64, 128, 64, canvas.viewport)
window = Window_UnformattedTextPokemon.newWithSize(
"", 0, 320 - 64, 128, 64, canvas.viewport
)
sliderwin2.visible = false
loop do
Graphics.update

View File

@@ -128,8 +128,9 @@ def pbAnimList(animations, canvas, animwin)
cmdwin.index = animations.selected
cmdwin.viewport = canvas.viewport
helpwindow = Window_UnformattedTextPokemon.newWithSize(
_INTL("Enter: Load/rename an animation\nEsc: Cancel"),
320, 0, 320, 128, canvas.viewport)
_INTL("Enter: Load/rename an animation\nEsc: Cancel"),
320, 0, 320, 128, canvas.viewport
)
maxsizewindow = ControlWindow.new(0, 416, 320, 32 * 3)
maxsizewindow.addSlider(_INTL("Total Animations:"), 1, 2000, animations.length)
maxsizewindow.addButton(_INTL("Resize Animation List"))

View File

@@ -156,7 +156,7 @@ end
module StringProperty
def self.set(settingname, oldsetting)
return pbMessageFreeText(_INTL("Set the value for {1}.", settingname),
(oldsetting) ? oldsetting : "", false, 250, Graphics.width)
(oldsetting) ? oldsetting : "", false, 250, Graphics.width)
end
def self.format(value)
@@ -177,7 +177,7 @@ class LimitStringProperty
def set(settingname, oldsetting)
return pbMessageFreeText(_INTL("Set the value for {1}.", settingname),
(oldsetting) ? oldsetting : "", false, @limit)
(oldsetting) ? oldsetting : "", false, @limit)
end
end
@@ -265,7 +265,7 @@ class StringListProperty
entry = real_cmds[cmd]
if entry[1] == -1 # Add new value
new_value = pbMessageFreeText(_INTL("Enter the new value."),
"", false, 250, Graphics.width)
"", false, 250, Graphics.width)
if !nil_or_empty?(new_value)
if real_cmds.any? { |e| e[0] == new_value }
oldsel = new_value # Already have value; just move cursor to it
@@ -276,10 +276,10 @@ class StringListProperty
end
else # Edit value
case pbMessage(_INTL("\\ts[]Do what with this value?"),
[_INTL("Edit"), _INTL("Delete"), _INTL("Cancel")], 3)
[_INTL("Edit"), _INTL("Delete"), _INTL("Cancel")], 3)
when 0 # Edit
new_value = pbMessageFreeText(_INTL("Enter the new value."),
entry[0], false, 250, Graphics.width)
entry[0], false, 250, Graphics.width)
if !nil_or_empty?(new_value)
if real_cmds.any? { |e| e[0] == new_value } # Already have value; delete this one
real_cmds.delete_at(cmd)
@@ -684,8 +684,9 @@ end
def chooseMapPoint(map, rgnmap = false)
viewport = Viewport.new(0, 0, Graphics.width, Graphics.height)
viewport.z = 99999
title = Window_UnformattedTextPokemon.newWithSize(_INTL("Click a point on the map."),
0, Graphics.height - 64, Graphics.width, 64, viewport)
title = Window_UnformattedTextPokemon.newWithSize(
_INTL("Click a point on the map."), 0, Graphics.height - 64, Graphics.width, 64, viewport
)
title.z = 2
if rgnmap
sprite = RegionMapSprite.new(map, viewport)
@@ -739,7 +740,7 @@ module MapCoordsFacingProperty
mappoint = chooseMapPoint(chosenmap)
if mappoint
facing = pbMessage(_INTL("Choose the direction to face in."),
[_INTL("Down"), _INTL("Left"), _INTL("Right"), _INTL("Up")], -1)
[_INTL("Down"), _INTL("Left"), _INTL("Right"), _INTL("Up")], -1)
return (facing >= 0) ? [chosenmap, mappoint[0], mappoint[1], [2, 4, 6, 8][facing]] : oldsetting
else
return oldsetting
@@ -848,7 +849,7 @@ end
module ItemNameProperty
def self.set(settingname, oldsetting)
return pbMessageFreeText(_INTL("Set the value for {1}.", settingname),
(oldsetting) ? oldsetting : "", false, 30)
(oldsetting) ? oldsetting : "", false, 30)
end
def self.defaultValue
@@ -1039,7 +1040,7 @@ class GameDataPoolProperty
end
else # Edit existing value
case pbMessage(_INTL("\\ts[]Do what with this value?"),
[_INTL("Change value"), _INTL("Delete"), _INTL("Cancel")], 3)
[_INTL("Change value"), _INTL("Delete"), _INTL("Cancel")], 3)
when 0 # Change value
new_value = pbChooseFromGameDataList(@game_data, entry[0])
if new_value && new_value != entry[0]
@@ -1065,7 +1066,7 @@ class GameDataPoolProperty
end
else # Cancel/quit
case pbMessage(_INTL("Apply changes?"),
[_INTL("Yes"), _INTL("No"), _INTL("Cancel")], 3)
[_INTL("Yes"), _INTL("No"), _INTL("Cancel")], 3)
when 0
values.shift # Remove the "add value" option
for i in 0...values.length
@@ -1173,7 +1174,7 @@ module LevelUpMovesProperty
end
else # Edit existing move
case pbMessage(_INTL("\\ts[]Do what with this move?"),
[_INTL("Change level"), _INTL("Change move"), _INTL("Delete"), _INTL("Cancel")], 4)
[_INTL("Change level"), _INTL("Change move"), _INTL("Delete"), _INTL("Cancel")], 4)
when 0 # Change level
params = ChooseNumberParams.new
params.setRange(0, GameData::GrowthRate.max_level)
@@ -1219,7 +1220,7 @@ module LevelUpMovesProperty
end
else # Cancel/quit
case pbMessage(_INTL("Save changes?"),
[_INTL("Yes"), _INTL("No"), _INTL("Cancel")], 3)
[_INTL("Yes"), _INTL("No"), _INTL("Cancel")], 3)
when 0
realcmds.shift
for i in 0...realcmds.length
@@ -1320,14 +1321,14 @@ class EvolutionsProperty
param_type = evo_method_data.parameter
if param_type.nil?
commands.push(_INTL("{1}: {2}",
GameData::Species.get(realcmds[i][0]).name, evo_method_data.real_name))
GameData::Species.get(realcmds[i][0]).name, evo_method_data.real_name))
else
if param_type.is_a?(Symbol) && !GameData.const_defined?(param_type)
level = getConstantName(param_type, level)
end
level = "???" if !level || (level.is_a?(String) && level.empty?)
commands.push(_INTL("{1}: {2}, {3}",
GameData::Species.get(realcmds[i][0]).name, evo_method_data.real_name, level.to_s))
GameData::Species.get(realcmds[i][0]).name, evo_method_data.real_name, level.to_s))
end
end
cmd[1] = i if oldsel >= 0 && realcmds[i][3] == oldsel
@@ -1379,8 +1380,8 @@ class EvolutionsProperty
end
else # Edit evolution
case pbMessage(_INTL("\\ts[]Do what with this evolution?"),
[_INTL("Change species"), _INTL("Change method"),
_INTL("Change parameter"), _INTL("Delete"), _INTL("Cancel")], 5)
[_INTL("Change species"), _INTL("Change method"),
_INTL("Change parameter"), _INTL("Delete"), _INTL("Cancel")], 5)
when 0 # Change species
newspecies = pbChooseSpeciesList(entry[0])
if newspecies
@@ -1451,7 +1452,7 @@ class EvolutionsProperty
end
else
cmd2 = pbMessage(_INTL("Save changes?"),
[_INTL("Yes"), _INTL("No"), _INTL("Cancel")], 3)
[_INTL("Yes"), _INTL("No"), _INTL("Cancel")], 3)
if [0, 1].include?(cmd2)
if cmd2 == 0
for i in 0...realcmds.length
@@ -1531,10 +1532,10 @@ module EncounterSlotProperty
if species_data.form > 0
if value[2] == value[3]
return sprintf("%d, %s_%d (Lv.%d)", value[0],
species_data.real_name, species_data.form, value[2])
species_data.real_name, species_data.form, value[2])
end
return sprintf("%d, %s_%d (Lv.%d-%d)", value[0],
species_data.real_name, species_data.form, value[2], value[3])
species_data.real_name, species_data.form, value[2], value[3])
end
if value[2] == value[3]
return sprintf("%d, %s (Lv.%d)", value[0], species_data.real_name, value[2])
@@ -1554,11 +1555,13 @@ def pbPropertyList(title, data, properties, saveprompt = false)
list = pbListWindow([], Graphics.width / 2)
list.viewport = viewport
list.z = 2
title = Window_UnformattedTextPokemon.newWithSize(title,
list.width, 0, Graphics.width / 2, 64, viewport)
title = Window_UnformattedTextPokemon.newWithSize(
title, list.width, 0, Graphics.width / 2, 64, viewport
)
title.z = 2
desc = Window_UnformattedTextPokemon.newWithSize("",
list.width, title.height, Graphics.width / 2, Graphics.height - title.height, viewport)
desc = Window_UnformattedTextPokemon.newWithSize(
"", list.width, title.height, Graphics.width / 2, Graphics.height - title.height, viewport
)
desc.z = 2
selectedmap = -1
retval = nil
@@ -1614,7 +1617,7 @@ def pbPropertyList(title, data, properties, saveprompt = false)
end
if selectedmap == -1 && saveprompt
cmd = pbMessage(_INTL("Save changes?"),
[_INTL("Yes"), _INTL("No"), _INTL("Cancel")], 3)
[_INTL("Yes"), _INTL("No"), _INTL("Cancel")], 3)
if cmd == 2
selectedmap = list.index
else

View File

@@ -270,7 +270,7 @@ module Battle::DebugMixin
help_text += _INTL("Form: {1}", battler.form)
help_text += "\r\n"
help_text += _INTL("Level {1}, {2}", battler.level,
(battler.pokemon.male?) ? "" : (battler.pokemon.female?) ? "" : "genderless")
(battler.pokemon.male?) ? "" : (battler.pokemon.female?) ? "" : "genderless")
help_text += ", " + _INTL("Shiny") if battler.pokemon.shiny?
help_text += "\r\n"
help_text += _INTL("HP: {1}/{2} ({3}%)", battler.hp, battler.totalhp, (100.0 * battler.hp / battler.totalhp).to_i)

View File

@@ -211,7 +211,7 @@ DebugMenuCommands.register("testwildbattle", {
params.setInitialValue(5)
params.setCancelValue(0)
level = pbMessageChooseNumber(_INTL("Set the wild {1}'s level.",
GameData::Species.get(species).name), params)
GameData::Species.get(species).name), params)
if level > 0
$game_temp.encounter_type = nil
pbWildBattle(species, level)
@@ -257,7 +257,8 @@ DebugMenuCommands.register("testwildbattleadvanced", {
params.setInitialValue(size0)
params.setCancelValue(0)
newSize = pbMessageChooseNumber(
_INTL("Choose the number of battlers on the player's side (max. {1}).", maxVal), params)
_INTL("Choose the number of battlers on the player's side (max. {1}).", maxVal), params
)
size0 = newSize if newSize > 0
elsif pkmnCmd == pkmnCmds.length - 3 # Add Pokémon
species = pbChooseSpeciesList
@@ -267,7 +268,7 @@ DebugMenuCommands.register("testwildbattleadvanced", {
params.setInitialValue(5)
params.setCancelValue(0)
level = pbMessageChooseNumber(_INTL("Set the wild {1}'s level.",
GameData::Species.get(species).name), params)
GameData::Species.get(species).name), params)
pkmn.push(Pokemon.new(species, level)) if level > 0
end
else # Edit a Pokémon
@@ -324,8 +325,9 @@ DebugMenuCommands.register("testtrainerbattleadvanced", {
next
elsif size1 > trainers.length && trainers[0][1].party_count == 1
pbMessage(
_INTL("Opposing side size cannot be {1}, as that requires the first trainer to have 2 or more Pokémon, which they don't.",
size1))
_INTL("Opposing side size cannot be {1}, as that requires the first trainer to have 2 or more Pokémon, which they don't.",
size1)
)
next
end
setBattleRule(sprintf("%dv%d", size0, size1))
@@ -347,7 +349,8 @@ DebugMenuCommands.register("testtrainerbattleadvanced", {
params.setInitialValue(size1)
params.setCancelValue(0)
newSize = pbMessageChooseNumber(
_INTL("Choose the number of battlers on the opponent's side (max. {1}).", maxVal), params)
_INTL("Choose the number of battlers on the opponent's side (max. {1}).", maxVal), params
)
size1 = newSize if newSize > 0
elsif trainerCmd == trainerCmds.length - 3 # Set player side size
if !pbCanDoubleBattle?
@@ -360,7 +363,8 @@ DebugMenuCommands.register("testtrainerbattleadvanced", {
params.setInitialValue(size0)
params.setCancelValue(0)
newSize = pbMessageChooseNumber(
_INTL("Choose the number of battlers on the player's side (max. {1}).", maxVal), params)
_INTL("Choose the number of battlers on the player's side (max. {1}).", maxVal), params
)
size0 = newSize if newSize > 0
elsif trainerCmd == trainerCmds.length - 4 # Add trainer
trainerdata = pbListScreen(_INTL("CHOOSE A TRAINER"), TrainerBattleLister.new(0, false))
@@ -371,7 +375,7 @@ DebugMenuCommands.register("testtrainerbattleadvanced", {
else # Edit a trainer
if pbConfirmMessage(_INTL("Change this trainer?"))
trainerdata = pbListScreen(_INTL("CHOOSE A TRAINER"),
TrainerBattleLister.new(trainers[trainerCmd][0], false))
TrainerBattleLister.new(trainers[trainerCmd][0], false))
if trainerdata
tr = pbLoadTrainer(trainerdata[0], trainerdata[1], trainerdata[2])
trainers[trainerCmd] = [0, tr]
@@ -480,7 +484,7 @@ DebugMenuCommands.register("additem", {
params.setInitialValue(1)
params.setCancelValue(0)
qty = pbMessageChooseNumber(_INTL("Add how many {1}?",
GameData::Item.get(item).name_plural), params)
GameData::Item.get(item).name_plural), params)
if qty > 0
$bag.add(item, qty)
pbMessage(_INTL("Gave {1}x {2}.", qty, GameData::Item.get(item).name))
@@ -660,7 +664,7 @@ DebugMenuCommands.register("fillboxes", {
pbMessage(_INTL("Storage boxes were filled with one Pokémon of each species."))
if !completed
pbMessage(_INTL("Note: The number of storage spaces ({1} boxes of {2}) is less than the number of species.",
Settings::NUM_STORAGE_BOXES, box_qty))
Settings::NUM_STORAGE_BOXES, box_qty))
end
}
})

View File

@@ -139,7 +139,7 @@ def pbDebugVariableScreen(id)
$game_map.need_refresh = true
elsif $game_variables[id].is_a?(String)
value = pbMessageFreeText(_INTL("Set variable {1}.", id),
$game_variables[id], false, 250, Graphics.width)
$game_variables[id], false, 250, Graphics.width)
$game_variables[id] = value
$game_map.need_refresh = true
end

View File

@@ -58,7 +58,8 @@ PokemonDebugMenuCommands.register("sethp", {
params.setRange(0, pkmn.totalhp)
params.setDefaultValue(pkmn.hp)
newhp = pbMessageChooseNumber(
_INTL("Set {1}'s HP (max. {2}).", pkmn.name, pkmn.totalhp), params) { screen.pbUpdate }
_INTL("Set {1}'s HP (max. {2}).", pkmn.name, pkmn.totalhp), params
) { screen.pbUpdate }
if newhp != pkmn.hp
pkmn.hp = newhp
screen.pbRefreshSingle(pkmnid)
@@ -90,7 +91,7 @@ PokemonDebugMenuCommands.register("setstatus", {
msg = _INTL("Current status: {1}", GameData::Status.get(pkmn.status).name)
if pkmn.status == :SLEEP
msg = _INTL("Current status: {1} (turns: {2})",
GameData::Status.get(pkmn.status).name, pkmn.statusCount)
GameData::Status.get(pkmn.status).name, pkmn.statusCount)
end
cmd = screen.pbShowCommands(msg, commands, cmd)
break if cmd < 0
@@ -106,7 +107,8 @@ PokemonDebugMenuCommands.register("setstatus", {
params.setRange(0, 9)
params.setDefaultValue(3)
count = pbMessageChooseNumber(
_INTL("Set the Pokémon's sleep count."), params) { screen.pbUpdate }
_INTL("Set the Pokémon's sleep count."), params
) { screen.pbUpdate }
cancel = true if count <= 0
end
if !cancel
@@ -164,9 +166,9 @@ PokemonDebugMenuCommands.register("setpokerus", {
_INTL("Has strain {1}, infectious for {2} more days.", pokerus / 16, pokerus % 16),
_INTL("Has strain {1}, not infectious.", pokerus / 16)][pkmn.pokerusStage]
cmd = screen.pbShowCommands(msg,
[_INTL("Give random strain"),
_INTL("Make not infectious"),
_INTL("Clear Pokérus")], cmd)
[_INTL("Give random strain"),
_INTL("Make not infectious"),
_INTL("Clear Pokérus")], cmd)
break if cmd < 0
case cmd
when 0 # Give random strain
@@ -209,7 +211,8 @@ PokemonDebugMenuCommands.register("setlevel", {
params.setRange(1, GameData::GrowthRate.max_level)
params.setDefaultValue(pkmn.level)
level = pbMessageChooseNumber(
_INTL("Set the Pokémon's level (max. {1}).", params.maxNumber), params) { screen.pbUpdate }
_INTL("Set the Pokémon's level (max. {1}).", params.maxNumber), params
) { screen.pbUpdate }
if level != pkmn.level
pkmn.level = level
pkmn.calc_stats
@@ -237,7 +240,8 @@ PokemonDebugMenuCommands.register("setexp", {
params.setRange(minxp, maxxp - 1)
params.setDefaultValue(pkmn.exp)
newexp = pbMessageChooseNumber(
_INTL("Set the Pokémon's Exp (range {1}-{2}).", minxp, maxxp - 1), params) { screen.pbUpdate }
_INTL("Set the Pokémon's Exp (range {1}-{2}).", minxp, maxxp - 1), params
) { screen.pbUpdate }
if newexp != pkmn.exp
pkmn.exp = newexp
pkmn.calc_stats
@@ -258,9 +262,9 @@ PokemonDebugMenuCommands.register("hiddenvalues", {
loop do
persid = sprintf("0x%08X", pkmn.personalID)
cmd = screen.pbShowCommands(_INTL("Personal ID is {1}.", persid),
[_INTL("Set EVs"),
_INTL("Set IVs"),
_INTL("Randomise pID")], cmd)
[_INTL("Set EVs"),
_INTL("Set IVs"),
_INTL("Randomise pID")], cmd)
break if cmd < 0
case cmd
when 0 # Set EVs
@@ -277,8 +281,8 @@ PokemonDebugMenuCommands.register("hiddenvalues", {
evcommands.push(_INTL("Randomise all"))
evcommands.push(_INTL("Max randomise all"))
cmd2 = screen.pbShowCommands(_INTL("Change which EV?\nTotal: {1}/{2} ({3}%)",
totalev, Pokemon::EV_LIMIT,
100 * totalev / Pokemon::EV_LIMIT), evcommands, cmd2)
totalev, Pokemon::EV_LIMIT,
100 * totalev / Pokemon::EV_LIMIT), evcommands, cmd2)
break if cmd2 < 0
if cmd2 < ev_id.length
params = ChooseNumberParams.new
@@ -291,7 +295,7 @@ PokemonDebugMenuCommands.register("hiddenvalues", {
params.setDefaultValue(thisValue)
params.setCancelValue(thisValue)
f = pbMessageChooseNumber(_INTL("Set the EV for {1} (max. {2}).",
GameData::Stat.get(ev_id[cmd2]).name, upperLimit), params) { screen.pbUpdate }
GameData::Stat.get(ev_id[cmd2]).name, upperLimit), params) { screen.pbUpdate }
if f != pkmn.ev[ev_id[cmd2]]
pkmn.ev[ev_id[cmd2]] = f
pkmn.calc_stats
@@ -330,8 +334,8 @@ PokemonDebugMenuCommands.register("hiddenvalues", {
totaliv += pkmn.iv[s.id]
end
msg = _INTL("Change which IV?\nHidden Power:\n{1}, power {2}\nTotal: {3}/{4} ({5}%)",
GameData::Type.get(hiddenpower[0]).name, hiddenpower[1], totaliv,
iv_id.length * Pokemon::IV_STAT_LIMIT, 100 * totaliv / (iv_id.length * Pokemon::IV_STAT_LIMIT))
GameData::Type.get(hiddenpower[0]).name, hiddenpower[1], totaliv,
iv_id.length * Pokemon::IV_STAT_LIMIT, 100 * totaliv / (iv_id.length * Pokemon::IV_STAT_LIMIT))
ivcommands.push(_INTL("Randomise all"))
cmd2 = screen.pbShowCommands(msg, ivcommands, cmd2)
break if cmd2 < 0
@@ -341,7 +345,7 @@ PokemonDebugMenuCommands.register("hiddenvalues", {
params.setDefaultValue(pkmn.iv[iv_id[cmd2]])
params.setCancelValue(pkmn.iv[iv_id[cmd2]])
f = pbMessageChooseNumber(_INTL("Set the IV for {1} (max. 31).",
GameData::Stat.get(iv_id[cmd2]).name), params) { screen.pbUpdate }
GameData::Stat.get(iv_id[cmd2]).name), params) { screen.pbUpdate }
if f != pkmn.iv[iv_id[cmd2]]
pkmn.iv[iv_id[cmd2]] = f
pkmn.calc_stats
@@ -372,7 +376,8 @@ PokemonDebugMenuCommands.register("sethappiness", {
params.setRange(0, 255)
params.setDefaultValue(pkmn.happiness)
h = pbMessageChooseNumber(
_INTL("Set the Pokémon's happiness (max. 255)."), params) { screen.pbUpdate }
_INTL("Set the Pokémon's happiness (max. 255)."), params
) { screen.pbUpdate }
if h != pkmn.happiness
pkmn.happiness = h
screen.pbRefreshSingle(pkmnid)
@@ -396,7 +401,8 @@ PokemonDebugMenuCommands.register("setbeauty", {
params.setRange(0, 255)
params.setDefaultValue(pkmn.beauty)
newval = pbMessageChooseNumber(
_INTL("Set the Pokémon's Beauty (max. 255)."), params) { screen.pbUpdate }
_INTL("Set the Pokémon's Beauty (max. 255)."), params
) { screen.pbUpdate }
if newval != pkmn.beauty
pkmn.beauty = newval
screen.pbRefreshSingle(pkmnid)
@@ -414,7 +420,8 @@ PokemonDebugMenuCommands.register("setcool", {
params.setRange(0, 255)
params.setDefaultValue(pkmn.cool)
newval = pbMessageChooseNumber(
_INTL("Set the Pokémon's Cool (max. 255)."), params) { screen.pbUpdate }
_INTL("Set the Pokémon's Cool (max. 255)."), params
) { screen.pbUpdate }
if newval != pkmn.cool
pkmn.cool = newval
screen.pbRefreshSingle(pkmnid)
@@ -432,7 +439,8 @@ PokemonDebugMenuCommands.register("setcute", {
params.setRange(0, 255)
params.setDefaultValue(pkmn.cute)
newval = pbMessageChooseNumber(
_INTL("Set the Pokémon's Cute (max. 255)."), params) { screen.pbUpdate }
_INTL("Set the Pokémon's Cute (max. 255)."), params
) { screen.pbUpdate }
if newval != pkmn.cute
pkmn.cute = newval
screen.pbRefreshSingle(pkmnid)
@@ -450,7 +458,8 @@ PokemonDebugMenuCommands.register("setsmart", {
params.setRange(0, 255)
params.setDefaultValue(pkmn.smart)
newval = pbMessageChooseNumber(
_INTL("Set the Pokémon's Smart (max. 255)."), params) { screen.pbUpdate }
_INTL("Set the Pokémon's Smart (max. 255)."), params
) { screen.pbUpdate }
if newval != pkmn.smart
pkmn.smart = newval
screen.pbRefreshSingle(pkmnid)
@@ -468,7 +477,8 @@ PokemonDebugMenuCommands.register("settough", {
params.setRange(0, 255)
params.setDefaultValue(pkmn.tough)
newval = pbMessageChooseNumber(
_INTL("Set the Pokémon's Tough (max. 255)."), params) { screen.pbUpdate }
_INTL("Set the Pokémon's Tough (max. 255)."), params
) { screen.pbUpdate }
if newval != pkmn.tough
pkmn.tough = newval
screen.pbRefreshSingle(pkmnid)
@@ -486,7 +496,8 @@ PokemonDebugMenuCommands.register("setsheen", {
params.setRange(0, 255)
params.setDefaultValue(pkmn.sheen)
newval = pbMessageChooseNumber(
_INTL("Set the Pokémon's Sheen (max. 255)."), params) { screen.pbUpdate }
_INTL("Set the Pokémon's Sheen (max. 255)."), params
) { screen.pbUpdate }
if newval != pkmn.sheen
pkmn.sheen = newval
screen.pbRefreshSingle(pkmnid)
@@ -575,9 +586,9 @@ PokemonDebugMenuCommands.register("setmovepp", {
loop do
msg = _INTL("{1}: PP {2}/{3} (PP Up {4}/3)", movename, move.pp, move.total_pp, move.ppup)
cmd2 = screen.pbShowCommands(msg,
[_INTL("Set PP"),
_INTL("Full PP"),
_INTL("Set PP Up")], cmd2)
[_INTL("Set PP"),
_INTL("Full PP"),
_INTL("Set PP Up")], cmd2)
break if cmd2 < 0
case cmd2
when 0 # Change PP
@@ -585,7 +596,8 @@ PokemonDebugMenuCommands.register("setmovepp", {
params.setRange(0, move.total_pp)
params.setDefaultValue(move.pp)
h = pbMessageChooseNumber(
_INTL("Set PP of {1} (max. {2}).", movename, move.total_pp), params) { screen.pbUpdate }
_INTL("Set PP of {1} (max. {2}).", movename, move.total_pp), params
) { screen.pbUpdate }
move.pp = h
when 1 # Full PP
move.pp = move.total_pp
@@ -594,7 +606,8 @@ PokemonDebugMenuCommands.register("setmovepp", {
params.setRange(0, 3)
params.setDefaultValue(move.ppup)
h = pbMessageChooseNumber(
_INTL("Set PP Up of {1} (max. 3).", movename), params) { screen.pbUpdate }
_INTL("Set PP Up of {1} (max. 3).", movename), params
) { screen.pbUpdate }
move.ppup = h
move.pp = move.total_pp if move.pp > move.total_pp
end
@@ -765,9 +778,9 @@ PokemonDebugMenuCommands.register("setgender", {
loop do
msg = [_INTL("Gender is male."), _INTL("Gender is female.")][pkmn.male? ? 0 : 1]
cmd = screen.pbShowCommands(msg,
[_INTL("Make male"),
_INTL("Make female"),
_INTL("Reset")], cmd)
[_INTL("Make male"),
_INTL("Make female"),
_INTL("Reset")], cmd)
break if cmd < 0
case cmd
when 0 # Make male
@@ -801,9 +814,9 @@ PokemonDebugMenuCommands.register("speciesform", {
msg = [_INTL("Species {1}, form {2}.", pkmn.speciesName, pkmn.form),
_INTL("Species {1}, form {2} (forced).", pkmn.speciesName, pkmn.form)][(pkmn.forced_form.nil?) ? 0 : 1]
cmd = screen.pbShowCommands(msg,
[_INTL("Set species"),
_INTL("Set form"),
_INTL("Remove form override")], cmd)
[_INTL("Set species"),
_INTL("Set form"),
_INTL("Remove form override")], cmd)
break if cmd < 0
case cmd
when 0 # Set species
@@ -869,11 +882,8 @@ PokemonDebugMenuCommands.register("setshininess", {
loop do
msg_idx = pkmn.shiny? ? (pkmn.super_shiny? ? 1 : 0) : 2
msg = [_INTL("Is shiny."), _INTL("Is super shiny."), _INTL("Is normal (not shiny).")][msg_idx]
cmd = screen.pbShowCommands(msg,
[_INTL("Make shiny"),
_INTL("Make super shiny"),
_INTL("Make normal"),
_INTL("Reset")], cmd)
cmd = screen.pbShowCommands(msg, [_INTL("Make shiny"), _INTL("Make super shiny"),
_INTL("Make normal"), _INTL("Reset")], cmd)
break if cmd < 0
case cmd
when 0 # Make shiny
@@ -934,7 +944,7 @@ PokemonDebugMenuCommands.register("setribbons", {
ids = []
GameData::Ribbon.each do |ribbon_data|
commands.push(_INTL("{1} {2}",
(pkmn.hasRibbon?(ribbon_data.id)) ? "[Y]" : "[ ]", ribbon_data.name))
(pkmn.hasRibbon?(ribbon_data.id)) ? "[Y]" : "[ ]", ribbon_data.name))
ids.push(ribbon_data.id)
end
commands.push(_INTL("Give all"))
@@ -1000,11 +1010,11 @@ PokemonDebugMenuCommands.register("ownership", {
_INTL("Foreign Pokémon\n{1}\n{2}\n{3} ({4})",
pkmn.owner.name, gender, pkmn.owner.public_id, pkmn.owner.id)][pkmn.foreign?($player) ? 1 : 0]
cmd = screen.pbShowCommands(msg,
[_INTL("Make player's"),
_INTL("Set OT's name"),
_INTL("Set OT's gender"),
_INTL("Random foreign ID"),
_INTL("Set foreign ID")], cmd)
[_INTL("Make player's"),
_INTL("Set OT's name"),
_INTL("Set OT's gender"),
_INTL("Random foreign ID"),
_INTL("Set foreign ID")], cmd)
break if cmd < 0
case cmd
when 0 # Make player's
@@ -1013,7 +1023,7 @@ PokemonDebugMenuCommands.register("ownership", {
pkmn.owner.name = pbEnterPlayerName(_INTL("{1}'s OT's name?", pkmn.name), 1, Settings::MAX_PLAYER_NAME_SIZE)
when 2 # Set OT's gender
cmd2 = screen.pbShowCommands(_INTL("Set OT's gender."),
[_INTL("Male"), _INTL("Female"), _INTL("Unknown")], pkmn.owner.gender)
[_INTL("Male"), _INTL("Female"), _INTL("Unknown")], pkmn.owner.gender)
pkmn.owner.gender = cmd2 if cmd2 >= 0
when 3 # Random foreign ID
pkmn.owner.id = $player.make_foreign_ID
@@ -1022,7 +1032,8 @@ PokemonDebugMenuCommands.register("ownership", {
params.setRange(0, 65535)
params.setDefaultValue(pkmn.owner.public_id)
val = pbMessageChooseNumber(
_INTL("Set the new ID (max. 65535)."), params) { screen.pbUpdate }
_INTL("Set the new ID (max. 65535)."), params
) { screen.pbUpdate }
pkmn.owner.id = val | val << 16
end
end
@@ -1073,9 +1084,9 @@ PokemonDebugMenuCommands.register("setegg", {
msg = [_INTL("Not an egg"),
_INTL("Egg (hatches in {1} steps).", pkmn.steps_to_hatch)][pkmn.egg? ? 1 : 0]
cmd = screen.pbShowCommands(msg,
[_INTL("Make egg"),
_INTL("Make Pokémon"),
_INTL("Set steps left to 1")], cmd)
[_INTL("Make egg"),
_INTL("Make Pokémon"),
_INTL("Set steps left to 1")], cmd)
break if cmd < 0
case cmd
when 0 # Make egg
@@ -1131,8 +1142,9 @@ PokemonDebugMenuCommands.register("shadowpkmn", {
params.setRange(0, pkmn.max_gauge_size)
params.setDefaultValue(pkmn.heart_gauge)
val = pbMessageChooseNumber(
_INTL("Set the heart gauge (max. {1}).", pkmn.max_gauge_size),
params) { screen.pbUpdate }
_INTL("Set the heart gauge (max. {1}).", pkmn.max_gauge_size),
params
) { screen.pbUpdate }
if val != oldheart
pkmn.adjustHeart(val - oldheart)
pkmn.check_ready_to_purify

View File

@@ -162,7 +162,8 @@ BattleDebugMenuCommands.register("weather", {
when 0 # Change type
weather_cmd = weather_types.index(battle.field.weather) || 0
new_weather = pbMessage(
"\\ts[]" + _INTL("Choose the new weather type."), weather_cmds, -1, nil, weather_cmd)
"\\ts[]" + _INTL("Choose the new weather type."), weather_cmds, -1, nil, weather_cmd
)
if new_weather >= 0
battle.field.weather = weather_types[new_weather]
battle.field.weatherDuration = 5 if battle.field.weatherDuration == 0
@@ -177,7 +178,8 @@ BattleDebugMenuCommands.register("weather", {
params.setInitialValue([battle.field.weatherDuration, 0].max)
params.setCancelValue([battle.field.weatherDuration, 0].max)
new_duration = pbMessageChooseNumber(
"\\ts[]" + _INTL("Choose the new weather duration (0=infinite)."), params)
"\\ts[]" + _INTL("Choose the new weather duration (0=infinite)."), params
)
if new_duration != [battle.field.weatherDuration, 0].max
battle.field.weatherDuration = (new_duration == 0) ? -1 : new_duration
end
@@ -223,7 +225,8 @@ BattleDebugMenuCommands.register("terrain", {
when 0 # Change type
terrain_cmd = terrain_types.index(battle.field.terrain) || 0
new_terrain = pbMessage(
"\\ts[]" + _INTL("Choose the new terrain type."), terrain_cmds, -1, nil, terrain_cmd)
"\\ts[]" + _INTL("Choose the new terrain type."), terrain_cmds, -1, nil, terrain_cmd
)
if new_terrain >= 0
battle.field.terrain = terrain_types[new_terrain]
battle.field.terrainDuration = 5 if battle.field.terrainDuration == 0
@@ -238,7 +241,8 @@ BattleDebugMenuCommands.register("terrain", {
params.setInitialValue([battle.field.terrainDuration, 0].max)
params.setCancelValue([battle.field.terrainDuration, 0].max)
new_duration = pbMessageChooseNumber(
"\\ts[]" + _INTL("Choose the new terrain duration (0=infinite)."), params)
"\\ts[]" + _INTL("Choose the new terrain duration (0=infinite)."), params
)
if new_duration != [battle.field.terrainDuration, 0].max
battle.field.terrainDuration = (new_duration == 0) ? -1 : new_duration
end
@@ -275,13 +279,14 @@ BattleDebugMenuCommands.register("environment", {
when 0 # Change environment
environment_cmd = environment_types.index(battle.environment) || 0
new_environment = pbMessage(
"\\ts[]" + _INTL("Choose the new environment."), environment_cmds, -1, nil, environment_cmd)
"\\ts[]" + _INTL("Choose the new environment."), environment_cmds, -1, nil, environment_cmd
)
if new_environment >= 0
battle.environment = environment_types[new_environment]
end
when 1 # Change time of day
new_time = pbMessage("\\ts[]" + _INTL("Choose the new time."),
[_INTL("Day"), _INTL("Evening"), _INTL("Night")], -1, nil, battle.time)
[_INTL("Day"), _INTL("Evening"), _INTL("Night")], -1, nil, battle.time)
battle.time = new_time if new_time >= 0 && new_time != battle.time
end
end
@@ -358,7 +363,7 @@ BattleDebugMenuCommands.register("mega_evolution", {
end
end
cmd = pbMessage("\\ts[]" + _INTL("Choose trainer to toggle whether they can Mega Evolve."),
commands, -1, nil, cmd)
commands, -1, nil, cmd)
break if cmd < 0
real_cmd = cmds[cmd]
if battle.megaEvolution[real_cmd[0]][real_cmd[1]] == -1
@@ -384,6 +389,6 @@ BattleDebugMenuCommands.register("speed_order", {
commands.push(sprintf("[%d] %s (speed: %d)", b.index, b.pbThis, value[1]))
end
pbMessage("\\ts[]" + _INTL("Battlers are listed from fastest to slowest. Speeds include modifiers."),
commands, -1)
commands, -1)
}
})

View File

@@ -72,7 +72,8 @@ BattlerDebugMenuCommands.register("sethp", {
params.setRange(1, battler.totalhp)
params.setDefaultValue(battler.hp)
new_hp = pbMessageChooseNumber(
"\\ts[]" + _INTL("Set {1}'s HP (1-{2}).", battler.pbThis(true), battler.totalhp), params)
"\\ts[]" + _INTL("Set {1}'s HP (1-{2}).", battler.pbThis(true), battler.totalhp), params
)
battler.hp = new_hp if new_hp != battler.hp
}
})
@@ -126,7 +127,8 @@ BattlerDebugMenuCommands.register("setstatus", {
params.setDefaultValue(0)
params.setCancelValue(-1)
count = pbMessageChooseNumber(
"\\ts[]" + _INTL("Set {1}'s toxic count (0-15).", battler.pbThis(true)), params)
"\\ts[]" + _INTL("Set {1}'s toxic count (0-15).", battler.pbThis(true)), params
)
next if count < 0
battler.statusCount = 1
battler.effects[PBEffects::Toxic] = count
@@ -192,7 +194,8 @@ BattlerDebugMenuCommands.register("setstatstages", {
params.setNegativesAllowed(true)
params.setDefaultValue(battler.stages[stat_ids[cmd]])
value = pbMessageChooseNumber(
"\\ts[]" + _INTL("Set the stage for {1}.", GameData::Stat.get(stat_ids[cmd]).name), params)
"\\ts[]" + _INTL("Set the stage for {1}.", GameData::Stat.get(stat_ids[cmd]).name), params
)
battler.stages[stat_ids[cmd]] = value
else # Reset all stats
GameData::Stat.each_battle { |stat| battler.stages[stat.id] = 0 }
@@ -214,7 +217,8 @@ BattlerDebugMenuCommands.register("setlevel", {
params.setRange(1, GameData::GrowthRate.max_level)
params.setDefaultValue(pkmn.level)
level = pbMessageChooseNumber(
"\\ts[]" + _INTL("Set the Pokémon's level (max. {1}).", params.maxNumber), params)
"\\ts[]" + _INTL("Set the Pokémon's level (max. {1}).", params.maxNumber), params
)
if level != pkmn.level
pkmn.level = level
pkmn.calc_stats
@@ -242,7 +246,8 @@ BattlerDebugMenuCommands.register("setexp", {
params.setRange(min_exp, max_exp - 1)
params.setDefaultValue(pkmn.exp)
new_exp = pbMessageChooseNumber(
"\\ts[]" + _INTL("Set the Pokémon's Exp (range {1}-{2}).", min_exp, max_exp - 1), params)
"\\ts[]" + _INTL("Set the Pokémon's Exp (range {1}-{2}).", min_exp, max_exp - 1), params
)
pkmn.exp = new_exp if new_exp != pkmn.exp
}
})
@@ -273,7 +278,7 @@ BattlerDebugMenuCommands.register("hiddenvalues", {
ev_commands.push(_INTL("Randomise all"))
ev_commands.push(_INTL("Max randomise all"))
cmd2 = pbMessage("\\ts[]" + _INTL("Change which EV?\nTotal: {1}/{2} ({3}%)",
total_evs, Pokemon::EV_LIMIT, 100 * total_evs / Pokemon::EV_LIMIT),
total_evs, Pokemon::EV_LIMIT, 100 * total_evs / Pokemon::EV_LIMIT),
ev_commands, -1, nil, cmd2)
break if cmd2 < 0
if cmd2 < ev_id.length
@@ -287,7 +292,7 @@ BattlerDebugMenuCommands.register("hiddenvalues", {
params.setDefaultValue(thisValue)
params.setCancelValue(thisValue)
f = pbMessageChooseNumber("\\ts[]" + _INTL("Set the EV for {1} (max. {2}).",
GameData::Stat.get(ev_id[cmd2]).name, upperLimit), params)
GameData::Stat.get(ev_id[cmd2]).name, upperLimit), params)
if f != pkmn.ev[ev_id[cmd2]]
pkmn.ev[ev_id[cmd2]] = f
pkmn.calc_stats
@@ -326,8 +331,8 @@ BattlerDebugMenuCommands.register("hiddenvalues", {
totaliv += pkmn.iv[s.id]
end
msg = _INTL("Change which IV?\nHidden Power:\n{1}, power {2}\nTotal: {3}/{4} ({5}%)",
GameData::Type.get(hiddenpower[0]).name, hiddenpower[1], totaliv,
iv_id.length * Pokemon::IV_STAT_LIMIT, 100 * totaliv / (iv_id.length * Pokemon::IV_STAT_LIMIT))
GameData::Type.get(hiddenpower[0]).name, hiddenpower[1], totaliv,
iv_id.length * Pokemon::IV_STAT_LIMIT, 100 * totaliv / (iv_id.length * Pokemon::IV_STAT_LIMIT))
ivcommands.push(_INTL("Randomise all"))
cmd2 = pbMessage("\\ts[]" + msg, ivcommands, -1, nil, cmd2)
break if cmd2 < 0
@@ -337,7 +342,7 @@ BattlerDebugMenuCommands.register("hiddenvalues", {
params.setDefaultValue(pkmn.iv[iv_id[cmd2]])
params.setCancelValue(pkmn.iv[iv_id[cmd2]])
f = pbMessageChooseNumber("\\ts[]" + _INTL("Set the IV for {1} (max. 31).",
GameData::Stat.get(iv_id[cmd2]).name), params)
GameData::Stat.get(iv_id[cmd2]).name), params)
if f != pkmn.iv[iv_id[cmd2]]
pkmn.iv[iv_id[cmd2]] = f
pkmn.calc_stats
@@ -434,7 +439,7 @@ BattlerDebugMenuCommands.register("teachmove", {
"effect" => proc { |battler, pkmn, battle|
if pkmn.numMoves >= Pokemon::MAX_MOVES
pbMessage("\\ts[]" + _INTL("{1} already knows {2} moves. It needs to forget one first.",
pkmn.name, pkmn.numMoves))
pkmn.name, pkmn.numMoves))
next
end
new_move = pbChooseMoveList
@@ -514,7 +519,8 @@ BattlerDebugMenuCommands.register("setmovepp", {
params.setRange(0, move.total_pp)
params.setDefaultValue(move.pp)
h = pbMessageChooseNumber(
"\\ts[]" + _INTL("Set PP of {1} (max. {2}).", move_name, move.total_pp), params)
"\\ts[]" + _INTL("Set PP of {1} (max. {2}).", move_name, move.total_pp), params
)
move.pp = h
if battler && battler.moves[move_indices[cmd]].id == move.id
battler.moves[move_indices[cmd]].pp = move.pp
@@ -529,7 +535,8 @@ BattlerDebugMenuCommands.register("setmovepp", {
params.setRange(0, 3)
params.setDefaultValue(move.ppup)
h = pbMessageChooseNumber(
"\\ts[]" + _INTL("Set PP Up of {1} (max. 3).", move_name), params)
"\\ts[]" + _INTL("Set PP Up of {1} (max. 3).", move_name), params
)
move.ppup = h
move.pp = move.total_pp if move.pp > move.total_pp
if battler && battler.moves[move_indices[cmd]].id == move.id
@@ -599,7 +606,7 @@ BattlerDebugMenuCommands.register("setability", {
]
loop do
msg = _INTL("Battler's ability is {1}. Pokémon's ability is {2}.",
battler.abilityName, pkmn.ability.name)
battler.abilityName, pkmn.ability.name)
cmd = pbMessage("\\ts[]" + msg, commands, -1, nil, cmd)
break if cmd < 0
case cmd

View File

@@ -16,8 +16,9 @@ def pbListScreen(title, lister)
list = pbListWindow([])
list.viewport = viewport
list.z = 2
title = Window_UnformattedTextPokemon.newWithSize(title,
Graphics.width / 2, 0, Graphics.width / 2, 64, viewport)
title = Window_UnformattedTextPokemon.newWithSize(
title, Graphics.width / 2, 0, Graphics.width / 2, 64, viewport
)
title.z = 2
lister.setViewport(viewport)
selectedmap = -1
@@ -63,8 +64,9 @@ def pbListScreenBlock(title, lister)
list = pbListWindow([], Graphics.width / 2)
list.viewport = viewport
list.z = 2
title = Window_UnformattedTextPokemon.newWithSize(title,
Graphics.width / 2, 0, Graphics.width / 2, 64, viewport)
title = Window_UnformattedTextPokemon.newWithSize(
title, Graphics.width / 2, 0, Graphics.width / 2, 64, viewport
)
title.z = 2
lister.setViewport(viewport)
selectedmap = -1
@@ -552,8 +554,9 @@ class TrainerBattleLister
def initialize(selection, includeNew)
@sprite = IconSprite.new(Graphics.width * 3 / 4, (Graphics.height / 2) + 32)
@sprite.z = 2
@pkmnList = Window_UnformattedTextPokemon.newWithSize("",
Graphics.width / 2, Graphics.height - 64, Graphics.width / 2, 64)
@pkmnList = Window_UnformattedTextPokemon.newWithSize(
"", Graphics.width / 2, Graphics.height - 64, Graphics.width / 2, 64
)
@pkmnList.z = 3
@selection = selection
@commands = []
@@ -604,12 +607,12 @@ class TrainerBattleLister
for t in cmds
if t[3] > 0
@commands.push(_INTL("{1} {2} ({3}) x{4}",
GameData::TrainerType.get(t[1]).name, t[2], t[3],
GameData::Trainer.get(t[1], t[2], t[3]).pokemon.length))
GameData::TrainerType.get(t[1]).name, t[2], t[3],
GameData::Trainer.get(t[1], t[2], t[3]).pokemon.length))
else
@commands.push(_INTL("{1} {2} x{3}",
GameData::TrainerType.get(t[1]).name, t[2],
GameData::Trainer.get(t[1], t[2], t[3]).pokemon.length))
GameData::TrainerType.get(t[1]).name, t[2],
GameData::Trainer.get(t[1], t[2], t[3]).pokemon.length))
end
@ids.push([t[1], t[2], t[3]])
end