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

@@ -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