diff --git a/.rubocop.yml b/.rubocop.yml index 516658de1..e0b0273c4 100644 --- a/.rubocop.yml +++ b/.rubocop.yml @@ -15,6 +15,11 @@ Layout/ExtraSpacing: AllowForAlignment: true AllowBeforeTrailingComments: true +# Looks better than having hash elements shifted way to the right just to line +# up with the hash's opening bracket. +Layout/FirstHashElementIndentation: + EnforcedStyle: consistent + # In a hash with multiple values (one per line), prefer the => to be lined up # and text to otherwise be left-aligned. Layout/HashAlignment: @@ -207,3 +212,8 @@ Style/SymbolProc: # it from the true/false results. Style/TernaryParentheses: EnforcedStyle: require_parentheses + +# This prefers "x += 1 while x < 10" and "x += 1 until x == 10". This hides +# loops, which is not good. +Style/WhileUntilModifier: + Enabled: false diff --git a/Data/Scripts/001_Settings.rb b/Data/Scripts/001_Settings.rb index 6f7c62fdb..fda727b2d 100644 --- a/Data/Scripts/001_Settings.rb +++ b/Data/Scripts/001_Settings.rb @@ -446,5 +446,5 @@ end module Essentials VERSION = "20.1.dev" ERROR_TEXT = "" - MKXPZ_VERSION = "2.3.1" + MKXPZ_VERSION = "2.4" end diff --git a/Data/Scripts/001_Technical/001_MKXP_Compatibility.rb b/Data/Scripts/001_Technical/001_MKXP_Compatibility.rb index c40084e58..2ff0c10a1 100644 --- a/Data/Scripts/001_Technical/001_MKXP_Compatibility.rb +++ b/Data/Scripts/001_Technical/001_MKXP_Compatibility.rb @@ -1,5 +1,6 @@ -# Using mkxp-z v2.3.1 - https://gitlab.com/mkxp-z/mkxp-z/-/releases/v2.3.1 +# Using mkxp-z v2.4.0 - https://gitlab.com/mkxp-z/mkxp-z/-/releases/v2.4.0 $VERBOSE = nil +begin; require 'zlib'; rescue; nil; end Font.default_shadow = false if Font.respond_to?(:default_shadow) Graphics.frame_rate = 40 Encoding.default_internal = Encoding::UTF_8 @@ -49,6 +50,6 @@ end if System::VERSION != Essentials::MKXPZ_VERSION printf(sprintf("\e[1;33mWARNING: mkxp-z version %s detected, but this version of Pokémon Essentials was designed for mkxp-z version %s.\e[0m\r\n", - System::VERSION, Essentials::MKXPZ_VERSION)) + System::VERSION, Essentials::MKXPZ_VERSION)) printf("\e[1;33mWARNING: Pokémon Essentials may not work properly.\e[0m\r\n") end diff --git a/Data/Scripts/001_Technical/002_Files/003_HTTP_Utilities.rb b/Data/Scripts/001_Technical/002_Files/003_HTTP_Utilities.rb index a402f79f5..70282ef27 100644 --- a/Data/Scripts/001_Technical/002_Files/003_HTTP_Utilities.rb +++ b/Data/Scripts/001_Technical/002_Files/003_HTTP_Utilities.rb @@ -1,8 +1,6 @@ -############################# -# +#=============================================================================== # HTTP utility functions -# -############################# +#=============================================================================== def pbPostData(url, postdata, filename = nil, depth = 0) if url[/^http:\/\/([^\/]+)(.*)$/] host = $1 @@ -21,11 +19,11 @@ def pbPostData(url, postdata, filename = nil, depth = 0) body, "application/x-www-form-urlencoded", { - "Host" => host, # might not be necessary + "Host" => host, # might not be necessary "Proxy-Connection" => "Close", - "Content-Length" => body.bytesize.to_s, - "Pragma" => "no-cache", - "User-Agent" => userAgent + "Content-Length" => body.bytesize.to_s, + "Pragma" => "no-cache", + "User-Agent" => userAgent } ) rescue "" return ret if !ret.is_a?(Hash) @@ -40,8 +38,8 @@ end def pbDownloadData(url, filename = nil, authorization = nil, depth = 0, &block) headers = { "Proxy-Connection" => "Close", - "Pragma" => "no-cache", - "User-Agent" => "Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.0.14) Gecko/2009082707 Firefox/3.0.14" + "Pragma" => "no-cache", + "User-Agent" => "Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.0.14) Gecko/2009082707 Firefox/3.0.14" } headers["authorization"] = authorization if authorization ret = HTTPLite.get(url, headers) rescue "" diff --git a/Data/Scripts/001_Technical/003_Intl_Messages.rb b/Data/Scripts/001_Technical/003_Intl_Messages.rb index 3583e8c02..590b70292 100644 --- a/Data/Scripts/001_Technical/003_Intl_Messages.rb +++ b/Data/Scripts/001_Technical/003_Intl_Messages.rb @@ -571,15 +571,17 @@ class Translation def setMapMessagesAsHash(map_id, array) load_default_messages @default_game_messages[MessageTypes::EVENT_TEXTS] ||= [] - @default_game_messages[MessageTypes::EVENT_TEXTS][map_id] = priv_add_to_hash(MessageTypes::EVENT_TEXTS, - array, nil, map_id) + @default_game_messages[MessageTypes::EVENT_TEXTS][map_id] = priv_add_to_hash( + MessageTypes::EVENT_TEXTS, array, nil, map_id + ) end def addMapMessagesAsHash(map_id, array) load_default_messages @default_game_messages[MessageTypes::EVENT_TEXTS] ||= [] - @default_game_messages[MessageTypes::EVENT_TEXTS][map_id] = priv_add_to_hash(MessageTypes::EVENT_TEXTS, - array, @default_game_messages[MessageTypes::EVENT_TEXTS][map_id], map_id) + @default_game_messages[MessageTypes::EVENT_TEXTS][map_id] = priv_add_to_hash( + MessageTypes::EVENT_TEXTS, array, @default_game_messages[MessageTypes::EVENT_TEXTS][map_id], map_id + ) end def get(type, id) diff --git a/Data/Scripts/001_Technical/005_PluginManager.rb b/Data/Scripts/001_Technical/005_PluginManager.rb index 0a616989f..b0ac2956f 100644 --- a/Data/Scripts/001_Technical/005_PluginManager.rb +++ b/Data/Scripts/001_Technical/005_PluginManager.rb @@ -277,13 +277,13 @@ module PluginManager end # Add plugin to class variable @@Plugins[name] = { - :name => name, - :version => version, - :essentials => essentials, - :link => link, - :dependencies => dependencies, + :name => name, + :version => version, + :essentials => essentials, + :link => link, + :dependencies => dependencies, :incompatibilities => incompats, - :credits => credits + :credits => credits } end diff --git a/Data/Scripts/002_Save data/003_SaveData_Conversion.rb b/Data/Scripts/002_Save data/003_SaveData_Conversion.rb index 73a0431ab..f1116af6b 100644 --- a/Data/Scripts/002_Save data/003_SaveData_Conversion.rb +++ b/Data/Scripts/002_Save data/003_SaveData_Conversion.rb @@ -15,7 +15,7 @@ module SaveData # Populated during runtime by SaveData.register_conversion calls. @conversions = { essentials: {}, - game: {} + game: {} } #============================================================================= @@ -171,7 +171,7 @@ module SaveData conversions_to_run = [] versions = { essentials: save_data[:essentials_version] || "18.1", - game: save_data[:game_version] || "0.0.0" + game: save_data[:game_version] || "0.0.0" } [:essentials, :game].each do |trigger_type| # Ensure the versions are sorted from lowest to highest diff --git a/Data/Scripts/004_Game classes/002_Game_System.rb b/Data/Scripts/004_Game classes/002_Game_System.rb index 9b0353956..1af2197a2 100644 --- a/Data/Scripts/004_Game classes/002_Game_System.rb +++ b/Data/Scripts/004_Game classes/002_Game_System.rb @@ -1,10 +1,10 @@ -#============================================================================== +#=============================================================================== # ** Game_System #------------------------------------------------------------------------------ # This class handles data surrounding the system. Backround music, etc. # is managed here as well. Refer to "$game_system" for the instance of # this class. -#============================================================================== +#=============================================================================== class Game_System attr_reader :map_interpreter # map event interpreter attr_reader :battle_interpreter # battle event interpreter @@ -39,7 +39,7 @@ class Game_System @bgs_position = 0 end -################################################################################ + #----------------------------------------------------------------------------- def bgm_play(bgm) old_pos = @bgm_position @@ -140,7 +140,7 @@ class Game_System end end -################################################################################ + #----------------------------------------------------------------------------- def me_play(me) me = RPG::AudioFile.new(me) if me.is_a?(String) @@ -157,7 +157,7 @@ class Game_System Graphics.frame_reset end -################################################################################ + #----------------------------------------------------------------------------- def bgs_play(bgs) @playing_bgs = (bgs.nil?) ? nil : bgs.clone @@ -224,7 +224,7 @@ class Game_System return (@playing_bgs) ? @playing_bgs.clone : nil end -################################################################################ + #----------------------------------------------------------------------------- def se_play(se) se = RPG::AudioFile.new(se) if se.is_a?(String) @@ -240,7 +240,7 @@ class Game_System Audio.se_stop end -################################################################################ + #----------------------------------------------------------------------------- def battle_bgm return (@battle_bgm) ? @battle_bgm : $data_system.battle_bgm @@ -254,7 +254,7 @@ class Game_System attr_writer :battle_end_me -################################################################################ + #----------------------------------------------------------------------------- def windowskin_name if @windowskin_name.nil? diff --git a/Data/Scripts/004_Game classes/004_Game_Map.rb b/Data/Scripts/004_Game classes/004_Game_Map.rb index 0cd19eb24..64e78d685 100644 --- a/Data/Scripts/004_Game classes/004_Game_Map.rb +++ b/Data/Scripts/004_Game classes/004_Game_Map.rb @@ -1,9 +1,9 @@ -#============================================================================== +#=============================================================================== # ** Game_Map #------------------------------------------------------------------------------ # This class handles the map. It includes scrolling and passable determining # functions. Refer to "$game_map" for the instance of this class. -#============================================================================== +#=============================================================================== class Game_Map attr_accessor :map_id attr_accessor :tileset_name # tileset file name diff --git a/Data/Scripts/005_Sprites/003_Sprite_Character.rb b/Data/Scripts/005_Sprites/003_Sprite_Character.rb index c5cc6643a..e99453b06 100644 --- a/Data/Scripts/005_Sprites/003_Sprite_Character.rb +++ b/Data/Scripts/005_Sprites/003_Sprite_Character.rb @@ -165,12 +165,12 @@ class Sprite_Character < RPG::Sprite end this_x = @character.screen_x this_x = ((this_x - (Graphics.width / 2)) * TilemapRenderer::ZOOM_X) + (Graphics.width / 2) if TilemapRenderer::ZOOM_X != 1 - self.x = this_x + self.x = this_x this_y = @character.screen_y this_y = ((this_y - (Graphics.height / 2)) * TilemapRenderer::ZOOM_Y) + (Graphics.height / 2) if TilemapRenderer::ZOOM_Y != 1 - self.y = this_y - self.z = @character.screen_z(@ch) - self.opacity = @character.opacity + self.y = this_y + self.z = @character.screen_z(@ch) + self.opacity = @character.opacity self.blend_type = @character.blend_type if @character.animation_id != 0 animation = $data_animations[@character.animation_id] diff --git a/Data/Scripts/006_Map renderer/002_TilesetWrapper.rb b/Data/Scripts/006_Map renderer/002_TilesetWrapper.rb index ed243fd4b..7790888ba 100644 --- a/Data/Scripts/006_Map renderer/002_TilesetWrapper.rb +++ b/Data/Scripts/006_Map renderer/002_TilesetWrapper.rb @@ -1,13 +1,13 @@ -#======================================================================= -# This module is a little fix that works around PC hardware limitations. -# Since Essentials isn't working with software rendering anymore, it now -# has to deal with the limits of the GPU. For the most part this is no -# big deal, but people do have some really big tilesets. +#=============================================================================== +# This module is a little fix that works around PC hardware limitations. Since +# Essentials isn't working with software rendering anymore, it now has to deal +# with the limits of the GPU. For the most part this is no big deal, but people +# do have some really big tilesets. # -# The fix is simple enough: If your tileset is too big, a new -# bitmap will be constructed with all the excess pixels sent to the -# image's right side. This basically means that you now have a limit -# far higher than you should ever actually need. +# The fix is simple enough: If your tileset is too big, a new bitmap will be +# constructed with all the excess pixels sent to the image's right side. This +# basically means that you now have a limit far higher than you should ever +# actually need. # # Hardware limit -> max tileset length: # 1024px -> 4096px @@ -15,9 +15,9 @@ # 4096px -> 65536px (enough to load pretty much any tileset) # 8192px -> 262144px # 16384px -> 1048576px (what most people have at this point) - +# # ~Roza/Zoroark -#======================================================================= +#=============================================================================== class TilemapRenderer module TilesetWrapper TILESET_WIDTH = SOURCE_TILE_WIDTH * TILESET_TILES_PER_ROW @@ -37,6 +37,7 @@ class TilemapRenderer end bmp = Bitmap.new(TILESET_WIDTH * columns, MAX_TEX_SIZE) remainder = height % MAX_TEX_SIZE + remainder = MAX_TEX_SIZE if remainder == 0 columns.times do |col| srcrect = Rect.new(0, col * MAX_TEX_SIZE, width, (col + 1 == columns) ? remainder : MAX_TEX_SIZE) bmp.blt(col * TILESET_WIDTH, 0, originalbmp, srcrect) diff --git a/Data/Scripts/007_Objects and windows/010_DrawText.rb b/Data/Scripts/007_Objects and windows/010_DrawText.rb index dff209602..3a097c417 100644 --- a/Data/Scripts/007_Objects and windows/010_DrawText.rb +++ b/Data/Scripts/007_Objects and windows/010_DrawText.rb @@ -18,13 +18,13 @@ def shadowc3tag(base, shadow) base_text = base.to_rgb32 else base_text = sprintf("%02X%02X%02X", base[0], base[1], base[2]) - base_text += sprintf("02X", base[3]) if base[3] + base_text += sprintf("%02X", base[3]) if base[3] end if shadow.is_a?(Color) shadow_text = shadow.to_rgb32 else shadow_text = sprintf("%02X%02X%02X", shadow[0], shadow[1], shadow[2]) - shadow_text += sprintf("02X", shadow[3]) if shadow[3] + shadow_text += sprintf("%02X", shadow[3]) if shadow[3] end return sprintf("", base_text, shadow_text) end @@ -428,125 +428,124 @@ def getFormattedText(bitmap, xDst, yDst, widthDst, heightDst, text, lineheight = graphicHeight = nil graphicRect = nil controls.length.times do |i| - if controls[i] && controls[i][2] == position - control = controls[i][0] - param = controls[i][1] - endtag = controls[i][3] - case control - when "c" - if endtag - colorstack.pop - else - color = Color.new_from_rgb(param) - colorstack.push([color, nil]) - end - when "c2" - if endtag - colorstack.pop - else - base = Color.new_from_rgb(param[0, 4]) - shadow = Color.new_from_rgb(param[4, 4]) - colorstack.push([base, shadow]) - end - when "c3" - if endtag - colorstack.pop - else - param = param.split(",") - # get pure colors unaffected by opacity - oldColors = getLastParam(colorstack, defaultcolors) - base = (param[0] && param[0] != "") ? Color.new_from_rgb(param[0]) : oldColors[0] - shadow = (param[1] && param[1] != "") ? Color.new_from_rgb(param[1]) : oldColors[1] - colorstack.push([base, shadow]) - end - when "o" - if endtag - opacitystack.pop - else - opacitystack.push(param.sub(/\s+$/, "").to_i) - end - when "b" - boldcount += (endtag ? -1 : 1) - when "i" - italiccount += (endtag ? -1 : 1) - when "u" - underlinecount += (endtag ? -1 : 1) - when "s" - strikecount += (endtag ? -1 : 1) - when "outln" - outlinecount += (endtag ? -1 : 1) - when "outln2" - outline2count += (endtag ? -1 : 1) - when "fs" # Font size - if endtag - fontsizestack.pop - else - fontsizestack.push(param.sub(/\s+$/, "").to_i) - end - fontsize = getLastParam(fontsizestack, defaultfontsize) - bitmap.font.size = fontsize - when "fn" # Font name - if endtag - fontnamestack.pop - else - fontname = param.sub(/\s+$/, "") - fontnamestack.push(Font.exist?(fontname) ? fontname : "Arial") - end - fontname = getLastParam(fontnamestack, defaultfontname) - bitmap.font.name = fontname - when "ar" # Right align - if endtag - alignstack.pop - else - alignstack.push(1) - end - nextline = 1 if x > 0 && nextline == 0 - when "al" # Left align - if endtag - alignstack.pop - else - alignstack.push(0) - end - nextline = 1 if x > 0 && nextline == 0 - when "ac" # Center align - if endtag - alignstack.pop - else - alignstack.push(2) - end - nextline = 1 if x > 0 && nextline == 0 - when "icon" # Icon - if !endtag - param = param.sub(/\s+$/, "") - graphic = "Graphics/Icons/#{param}" - controls[i] = nil - break - end - when "img" # Icon - if !endtag - param = param.sub(/\s+$/, "") - param = param.split("|") - graphic = param[0] - if param.length > 1 - graphicX = param[1].to_i - graphicY = param[2].to_i - graphicWidth = param[3].to_i - graphicHeight = param[4].to_i - end - controls[i] = nil - break - end - when "br" # Line break - nextline += 1 if !endtag - when "r" # Right align this line - if !endtag - x = 0 - rightalign = 1 - lastword = [characters.length, x] - end + next if !controls[i] || controls[i][2] != position + control = controls[i][0] + param = controls[i][1] + endtag = controls[i][3] + case control + when "c" + if endtag + colorstack.pop + else + color = Color.new_from_rgb(param) + colorstack.push([color, nil]) + end + when "c2" + if endtag + colorstack.pop + else + base = Color.new_from_rgb(param[0, 4]) + shadow = Color.new_from_rgb(param[4, 4]) + colorstack.push([base, shadow]) + end + when "c3" + if endtag + colorstack.pop + else + param = param.split(",") + # get pure colors unaffected by opacity + oldColors = getLastParam(colorstack, defaultcolors) + base = (param[0] && param[0] != "") ? Color.new_from_rgb(param[0]) : oldColors[0] + shadow = (param[1] && param[1] != "") ? Color.new_from_rgb(param[1]) : oldColors[1] + colorstack.push([base, shadow]) + end + when "o" + if endtag + opacitystack.pop + else + opacitystack.push(param.sub(/\s+$/, "").to_i) + end + when "b" + boldcount += (endtag ? -1 : 1) + when "i" + italiccount += (endtag ? -1 : 1) + when "u" + underlinecount += (endtag ? -1 : 1) + when "s" + strikecount += (endtag ? -1 : 1) + when "outln" + outlinecount += (endtag ? -1 : 1) + when "outln2" + outline2count += (endtag ? -1 : 1) + when "fs" # Font size + if endtag + fontsizestack.pop + else + fontsizestack.push(param.sub(/\s+$/, "").to_i) + end + fontsize = getLastParam(fontsizestack, defaultfontsize) + bitmap.font.size = fontsize + when "fn" # Font name + if endtag + fontnamestack.pop + else + fontname = param.sub(/\s+$/, "") + fontnamestack.push(Font.exist?(fontname) ? fontname : "Arial") + end + fontname = getLastParam(fontnamestack, defaultfontname) + bitmap.font.name = fontname + when "ar" # Right align + if endtag + alignstack.pop + else + alignstack.push(1) + end + nextline = 1 if x > 0 && nextline == 0 + when "al" # Left align + if endtag + alignstack.pop + else + alignstack.push(0) + end + nextline = 1 if x > 0 && nextline == 0 + when "ac" # Center align + if endtag + alignstack.pop + else + alignstack.push(2) + end + nextline = 1 if x > 0 && nextline == 0 + when "icon" # Icon + if !endtag + param = param.sub(/\s+$/, "") + graphic = "Graphics/Icons/#{param}" + controls[i] = nil + break + end + when "img" # Icon + if !endtag + param = param.sub(/\s+$/, "") + param = param.split("|") + graphic = param[0] + if param.length > 1 + graphicX = param[1].to_i + graphicY = param[2].to_i + graphicWidth = param[3].to_i + graphicHeight = param[4].to_i + end + controls[i] = nil + break + end + when "br" # Line break + nextline += 1 if !endtag + when "r" # Right align this line + if !endtag + x = 0 + rightalign = 1 + lastword = [characters.length, x] end - controls[i] = nil end + controls[i] = nil end bitmap.font.bold = (boldcount > 0) bitmap.font.italic = (italiccount > 0) diff --git a/Data/Scripts/007_Objects and windows/011_Messages.rb b/Data/Scripts/007_Objects and windows/011_Messages.rb index 848f9ff0e..f85369805 100644 --- a/Data/Scripts/007_Objects and windows/011_Messages.rb +++ b/Data/Scripts/007_Objects and windows/011_Messages.rb @@ -551,7 +551,7 @@ def pbMessageDisplay(msgwindow, message, letterbyletter = true, commandProc = ni elsif signWaitCount == 0 && letterbyletter pbPlayDecisionSE end - ########## Position message window ############## + # Position message window pbRepositionMessageWindow(msgwindow, linecount) if facewindow pbPositionNearMsgWindow(facewindow, msgwindow, :left) @@ -559,7 +559,7 @@ def pbMessageDisplay(msgwindow, message, letterbyletter = true, commandProc = ni facewindow.z = msgwindow.z end atTop = (msgwindow.y == 0) - ########## Show text ############################# + # Show text msgwindow.text = text Graphics.frame_reset if Graphics.frame_rate > 40 loop do diff --git a/Data/Scripts/008_Audio/001_Audio.rb b/Data/Scripts/008_Audio/001_Audio.rb index 1b8b7309c..5942acdfb 100644 --- a/Data/Scripts/008_Audio/001_Audio.rb +++ b/Data/Scripts/008_Audio/001_Audio.rb @@ -1,4 +1,3 @@ -##################################### # Needed because RGSS doesn't call at_exit procs on exit # Exit is not called when game is reset (using F12) $AtExitProcs = [] if !$AtExitProcs diff --git a/Data/Scripts/008_Audio/002_Audio_Play.rb b/Data/Scripts/008_Audio/002_Audio_Play.rb index 70dc1233d..6f1b4adc7 100644 --- a/Data/Scripts/008_Audio/002_Audio_Play.rb +++ b/Data/Scripts/008_Audio/002_Audio_Play.rb @@ -38,7 +38,7 @@ def pbResolveAudioFile(str, volume = nil, pitch = nil) return str end -################################################################################ +#=============================================================================== # Plays a BGM file. # param -- Either a string showing the filename @@ -88,7 +88,7 @@ def pbBGMStop(timeInSeconds = 0.0) (timeInSeconds > 0.0) ? Audio.bgm_fade((timeInSeconds * 1000).floor) : Audio.bgm_stop end -################################################################################ +#=============================================================================== # Plays an ME file. # param -- Either a string showing the filename @@ -138,7 +138,7 @@ def pbMEStop(timeInSeconds = 0.0) (timeInSeconds > 0.0) ? Audio.me_fade((timeInSeconds * 1000).floor) : Audio.me_stop end -################################################################################ +#=============================================================================== # Plays a BGS file. # param -- Either a string showing the filename @@ -188,7 +188,7 @@ def pbBGSStop(timeInSeconds = 0.0) (timeInSeconds > 0.0) ? Audio.bgs_fade((timeInSeconds * 1000).floor) : Audio.bgs_stop end -################################################################################ +#=============================================================================== # Plays an SE file. # param -- Either a string showing the filename @@ -232,7 +232,7 @@ def pbSEStop(_timeInSeconds = 0.0) end end -################################################################################ +#=============================================================================== # Plays a sound effect that plays when the player moves the cursor. def pbPlayCursorSE diff --git a/Data/Scripts/010_Data/002_PBS data/008_Species.rb b/Data/Scripts/010_Data/002_PBS data/008_Species.rb index 71d59f161..a1bd7a624 100644 --- a/Data/Scripts/010_Data/002_PBS data/008_Species.rb +++ b/Data/Scripts/010_Data/002_PBS data/008_Species.rb @@ -418,7 +418,7 @@ module GameData ret = nil if ret == :None when "Evolutions" if ret - ret = ret.select { |evo| !evo[3] } # Remove prevolutions + ret = ret.reject { |evo| evo[3] } # Remove prevolutions ret.each do |evo| param_type = GameData::Evolution.get(evo[1]).parameter if !param_type.nil? diff --git a/Data/Scripts/011_Battle/003_Move/011_MoveEffects_Items.rb b/Data/Scripts/011_Battle/003_Move/011_MoveEffects_Items.rb index 3303c9114..ca50257d5 100644 --- a/Data/Scripts/011_Battle/003_Move/011_MoveEffects_Items.rb +++ b/Data/Scripts/011_Battle/003_Move/011_MoveEffects_Items.rb @@ -169,8 +169,8 @@ class Battle::Move::RemoveTargetItem < Battle::Move def pbBaseDamage(baseDmg, user, target) if Settings::MECHANICS_GENERATION >= 6 && target.item && !target.unlosableItem?(target.item) - # NOTE: Damage is still boosted even if target has Sticky Hold or a - # substitute. + # NOTE: Damage is still boosted even if target has Sticky Hold or a + # substitute. baseDmg = (baseDmg * 1.5).round end return baseDmg diff --git a/Data/Scripts/011_Battle/004_Scene/006_Battle_Scene_Objects.rb b/Data/Scripts/011_Battle/004_Scene/006_Battle_Scene_Objects.rb index 18db00389..9ef2ec50f 100644 --- a/Data/Scripts/011_Battle/004_Scene/006_Battle_Scene_Objects.rb +++ b/Data/Scripts/011_Battle/004_Scene/006_Battle_Scene_Objects.rb @@ -213,16 +213,14 @@ class Battle::Scene::PokemonDataBox < Sprite nameWidth = self.bitmap.text_size(@battler.name).width nameOffset = 0 nameOffset = nameWidth - 116 if nameWidth > 116 - pbDrawTextPositions(self.bitmap, - [[@battler.name, @spriteBaseX + 8 - nameOffset, 12, :left, NAME_BASE_COLOR, NAME_SHADOW_COLOR]] + pbDrawTextPositions(self.bitmap, [[@battler.name, @spriteBaseX + 8 - nameOffset, 12, :left, + NAME_BASE_COLOR, NAME_SHADOW_COLOR]] ) end def draw_level # "Lv" graphic - pbDrawImagePositions(self.bitmap, - [["Graphics/UI/Battle/overlay_lv", @spriteBaseX + 140, 16]] - ) + pbDrawImagePositions(self.bitmap, [["Graphics/UI/Battle/overlay_lv", @spriteBaseX + 140, 16]]) # Level number pbDrawNumber(@battler.level, self.bitmap, @spriteBaseX + 162, 16) end diff --git a/Data/Scripts/011_Battle/004_Scene/007_Battle_Scene_BaseAnimation.rb b/Data/Scripts/011_Battle/004_Scene/007_Battle_Scene_BaseAnimation.rb index 1f60f42c2..44508ddd1 100644 --- a/Data/Scripts/011_Battle/004_Scene/007_Battle_Scene_BaseAnimation.rb +++ b/Data/Scripts/011_Battle/004_Scene/007_Battle_Scene_BaseAnimation.rb @@ -446,7 +446,7 @@ module Battle::Scene::Animation::BallAnimationMixin particle.moveDelta(start, particle_lifetime, max_radius * Math.cos(radian), max_radius * Math.sin(radian)) particle.moveZoom(start, particle_lifetime, 10) particle.moveTone(start + particle_lifetime - particle_fade_duration, - particle_fade_duration / 2, variances[7 - (3 * num)]) + particle_fade_duration / 2, variances[7 - (3 * num)]) particle.moveOpacity(start + particle_lifetime - particle_fade_duration, particle_fade_duration, 0) # Fade out at end diff --git a/Data/Scripts/012_Overworld/002_Battle triggering/004_Overworld_EncounterModifiers.rb b/Data/Scripts/012_Overworld/002_Battle triggering/004_Overworld_EncounterModifiers.rb index a1f69f4d1..c0b6d74b3 100644 --- a/Data/Scripts/012_Overworld/002_Battle triggering/004_Overworld_EncounterModifiers.rb +++ b/Data/Scripts/012_Overworld/002_Battle triggering/004_Overworld_EncounterModifiers.rb @@ -1,9 +1,9 @@ -################################################################################ +#=============================================================================== # This section was created solely for you to put various bits of code that # modify various wild Pokémon and trainers immediately prior to battling them. # Be sure that any code you use here ONLY applies to the Pokémon/trainers you # want it to apply to! -################################################################################ +#=============================================================================== # Make all wild Pokémon shiny while a certain Switch is ON (see Settings). EventHandlers.add(:on_wild_pokemon_created, :make_shiny_switch, diff --git a/Data/Scripts/013_Items/002_Item_Effects.rb b/Data/Scripts/013_Items/002_Item_Effects.rb index 2d7becaf5..0372d035a 100644 --- a/Data/Scripts/013_Items/002_Item_Effects.rb +++ b/Data/Scripts/013_Items/002_Item_Effects.rb @@ -506,8 +506,9 @@ ItemHandlers::UseOnPokemon.add(:FULLHEAL, proc { |item, qty, pkmn, scene| }) ItemHandlers::UseOnPokemon.copy(:FULLHEAL, - :LAVACOOKIE, :OLDGATEAU, :CASTELIACONE, :LUMIOSEGALETTE, :SHALOURSABLE, - :BIGMALASADA, :PEWTERCRUNCHIES, :LUMBERRY) + :LAVACOOKIE, :OLDGATEAU, :CASTELIACONE, + :LUMIOSEGALETTE, :SHALOURSABLE, :BIGMALASADA, + :PEWTERCRUNCHIES, :LUMBERRY) ItemHandlers::UseOnPokemon.copy(:FULLHEAL, :RAGECANDYBAR) if Settings::RAGE_CANDY_BAR_CURES_STATUS_PROBLEMS ItemHandlers::UseOnPokemon.add(:FULLRESTORE, proc { |item, qty, pkmn, scene| @@ -1075,8 +1076,7 @@ ItemHandlers::UseOnPokemon.add(:ABILITYPATCH, proc { |item, qty, pkmn, scene| pkmn.ability_index = 2 pkmn.ability = nil scene.pbRefresh - scene.pbDisplay(_INTL("{1}'s Ability changed! Its Ability is now {2}!", - pkmn.name, new_ability_name)) + scene.pbDisplay(_INTL("{1}'s Ability changed! Its Ability is now {2}!", pkmn.name, new_ability_name)) next true end next false @@ -1209,8 +1209,7 @@ ItemHandlers::UseOnPokemon.add(:ROTOMCATALOG, proc { |item, qty, pkmn, scene| _INTL("Lawn mower"), _INTL("Cancel") ] - new_form = scene.pbShowCommands(_INTL("Which appliance would you like to order?"), - choices, pkmn.form) + new_form = scene.pbShowCommands(_INTL("Which appliance would you like to order?"), choices, pkmn.form) if new_form == pkmn.form scene.pbDisplay(_INTL("It won't have any effect.")) next false @@ -1233,7 +1232,7 @@ ItemHandlers::UseOnPokemon.add(:ZYGARDECUBE, proc { |item, qty, pkmn, scene| next false end case scene.pbShowCommands(_INTL("What will you do with {1}?", pkmn.name), - [_INTL("Change form"), _INTL("Change Ability"), _INTL("Cancel")]) + [_INTL("Change form"), _INTL("Change Ability"), _INTL("Cancel")]) when 0 # Change form newForm = (pkmn.form == 0) ? 1 : 0 pkmn.setForm(newForm) do diff --git a/Data/Scripts/013_Items/003_Item_BattleEffects.rb b/Data/Scripts/013_Items/003_Item_BattleEffects.rb index 8cae93539..e9f89caf7 100644 --- a/Data/Scripts/013_Items/003_Item_BattleEffects.rb +++ b/Data/Scripts/013_Items/003_Item_BattleEffects.rb @@ -72,9 +72,10 @@ ItemHandlers::CanUseInBattle.add(:POTION, proc { |item, pokemon, battler, move, }) ItemHandlers::CanUseInBattle.copy(:POTION, - :SUPERPOTION, :HYPERPOTION, :MAXPOTION, :BERRYJUICE, :SWEETHEART, :FRESHWATER, - :SODAPOP, :LEMONADE, :MOOMOOMILK, :ORANBERRY, :SITRUSBERRY, :ENERGYPOWDER, - :ENERGYROOT) + :SUPERPOTION, :HYPERPOTION, :MAXPOTION, + :BERRYJUICE, :SWEETHEART, :FRESHWATER, :SODAPOP, + :LEMONADE, :MOOMOOMILK, :ORANBERRY, :SITRUSBERRY, + :ENERGYPOWDER, :ENERGYROOT) ItemHandlers::CanUseInBattle.copy(:POTION, :RAGECANDYBAR) if !Settings::RAGE_CANDY_BAR_CURES_STATUS_PROBLEMS ItemHandlers::CanUseInBattle.add(:AWAKENING, proc { |item, pokemon, battler, move, firstAction, battle, scene, showMessages| @@ -126,8 +127,9 @@ ItemHandlers::CanUseInBattle.add(:FULLHEAL, proc { |item, pokemon, battler, move }) ItemHandlers::CanUseInBattle.copy(:FULLHEAL, - :LAVACOOKIE, :OLDGATEAU, :CASTELIACONE, :LUMIOSEGALETTE, :SHALOURSABLE, - :BIGMALASADA, :PEWTERCRUNCHIES, :LUMBERRY, :HEALPOWDER) + :LAVACOOKIE, :OLDGATEAU, :CASTELIACONE, + :LUMIOSEGALETTE, :SHALOURSABLE, :BIGMALASADA, + :PEWTERCRUNCHIES, :LUMBERRY, :HEALPOWDER) ItemHandlers::CanUseInBattle.copy(:FULLHEAL, :RAGECANDYBAR) if Settings::RAGE_CANDY_BAR_CURES_STATUS_PROBLEMS ItemHandlers::CanUseInBattle.add(:FULLRESTORE, proc { |item, pokemon, battler, move, firstAction, battle, scene, showMessages| @@ -220,14 +222,16 @@ ItemHandlers::CanUseInBattle.add(:XDEFENSE, proc { |item, pokemon, battler, move }) ItemHandlers::CanUseInBattle.copy(:XDEFENSE, - :XDEFENSE2, :XDEFENSE3, :XDEFENSE6, :XDEFEND, :XDEFEND2, :XDEFEND3, :XDEFEND6) + :XDEFENSE2, :XDEFENSE3, :XDEFENSE6, + :XDEFEND, :XDEFEND2, :XDEFEND3, :XDEFEND6) ItemHandlers::CanUseInBattle.add(:XSPATK, proc { |item, pokemon, battler, move, firstAction, battle, scene, showMessages| next pbBattleItemCanRaiseStat?(:SPECIAL_ATTACK, battler, scene, showMessages) }) ItemHandlers::CanUseInBattle.copy(:XSPATK, - :XSPATK2, :XSPATK3, :XSPATK6, :XSPECIAL, :XSPECIAL2, :XSPECIAL3, :XSPECIAL6) + :XSPATK2, :XSPATK3, :XSPATK6, + :XSPECIAL, :XSPECIAL2, :XSPECIAL3, :XSPECIAL6) ItemHandlers::CanUseInBattle.add(:XSPDEF, proc { |item, pokemon, battler, move, firstAction, battle, scene, showMessages| next pbBattleItemCanRaiseStat?(:SPECIAL_DEFENSE, battler, scene, showMessages) @@ -429,8 +433,9 @@ ItemHandlers::BattleUseOnPokemon.add(:FULLHEAL, proc { |item, pokemon, battler, }) ItemHandlers::BattleUseOnPokemon.copy(:FULLHEAL, - :LAVACOOKIE, :OLDGATEAU, :CASTELIACONE, :LUMIOSEGALETTE, :SHALOURSABLE, - :BIGMALASADA, :PEWTERCRUNCHIES, :LUMBERRY) + :LAVACOOKIE, :OLDGATEAU, :CASTELIACONE, + :LUMIOSEGALETTE, :SHALOURSABLE, :BIGMALASADA, + :PEWTERCRUNCHIES, :LUMBERRY) ItemHandlers::BattleUseOnPokemon.copy(:FULLHEAL, :RAGECANDYBAR) if Settings::RAGE_CANDY_BAR_CURES_STATUS_PROBLEMS ItemHandlers::BattleUseOnPokemon.add(:FULLRESTORE, proc { |item, pokemon, battler, choices, scene| diff --git a/Data/Scripts/013_Items/004_Item_Phone.rb b/Data/Scripts/013_Items/004_Item_Phone.rb index 6f96044d9..d3e8b8c88 100644 --- a/Data/Scripts/013_Items/004_Item_Phone.rb +++ b/Data/Scripts/013_Items/004_Item_Phone.rb @@ -397,7 +397,7 @@ class Phone if contact.common_event_call? if !pbCommonEvent(contact.common_event_id) pbMessage(_INTL("{1}'s messages not defined.\nCouldn't call common event {2}.", - contact.display_name, contact.common_event_id)) + contact.display_name, contact.common_event_id)) end else call = generate_trainer_dialogue(contact) @@ -421,7 +421,7 @@ class Phone if contact.common_event_call? if !pbCommonEvent(contact.common_event_id) pbMessage(_INTL("{1}'s messages not defined.\nCouldn't call common event {2}.", - contact.display_name, contact.common_event_id)) + contact.display_name, contact.common_event_id)) end else call = generate_trainer_dialogue(contact) diff --git a/Data/Scripts/014_Pokemon/001_Pokemon-related/002_ShadowPokemon_Other.rb b/Data/Scripts/014_Pokemon/001_Pokemon-related/002_ShadowPokemon_Other.rb index 370019041..51fd0f689 100644 --- a/Data/Scripts/014_Pokemon/001_Pokemon-related/002_ShadowPokemon_Other.rb +++ b/Data/Scripts/014_Pokemon/001_Pokemon-related/002_ShadowPokemon_Other.rb @@ -297,7 +297,7 @@ ItemHandlers::BattleUseOnPokemon.add(:JOYSCENT, proc { |item, pokemon, battler, if pokemon.hyper_mode pokemon.hyper_mode = false scene.pbDisplay(_INTL("{1} came to its senses from the {2}!", - battler&.pbThis || pokemon.name, GameData::Item.get(item).name)) + battler&.pbThis || pokemon.name, GameData::Item.get(item).name)) end pbRaiseHappinessAndReduceHeart(pokemon, scene, 1, false) next true @@ -307,7 +307,7 @@ ItemHandlers::BattleUseOnPokemon.add(:EXCITESCENT, proc { |item, pokemon, battle if pokemon.hyper_mode pokemon.hyper_mode = false scene.pbDisplay(_INTL("{1} came to its senses from the {2}!", - battler&.pbThis || pokemon.name, GameData::Item.get(item).name)) + battler&.pbThis || pokemon.name, GameData::Item.get(item).name)) end pbRaiseHappinessAndReduceHeart(pokemon, scene, 2, false) next true @@ -317,7 +317,7 @@ ItemHandlers::BattleUseOnPokemon.add(:VIVIDSCENT, proc { |item, pokemon, battler if pokemon.hyper_mode pokemon.hyper_mode = false scene.pbDisplay(_INTL("{1} came to its senses from the {2}!", - battler&.pbThis || pokemon.name, GameData::Item.get(item).name)) + battler&.pbThis || pokemon.name, GameData::Item.get(item).name)) end pbRaiseHappinessAndReduceHeart(pokemon, scene, 3, false) next true diff --git a/Data/Scripts/016_UI/001_Non-interactive UI/004_UI_Evolution.rb b/Data/Scripts/016_UI/001_Non-interactive UI/004_UI_Evolution.rb index 0e10ba0e4..a85379867 100644 --- a/Data/Scripts/016_UI/001_Non-interactive UI/004_UI_Evolution.rb +++ b/Data/Scripts/016_UI/001_Non-interactive UI/004_UI_Evolution.rb @@ -592,7 +592,7 @@ class PokemonEvolutionScene newspeciesname = GameData::Species.get(@newspecies).name pbMessageDisplay(@sprites["msgwindow"], "\\se[]" + _INTL("Congratulations! Your {1} evolved into {2}!\\wt[80]", - @pokemon.name, newspeciesname)) { pbUpdate } + @pokemon.name, newspeciesname)) { pbUpdate } @sprites["msgwindow"].text = "" # Check for consumed item and check if Pokémon should be duplicated pbEvolutionMethodAfterEvolution diff --git a/Data/Scripts/016_UI/001_Non-interactive UI/007_UI_Credits.rb b/Data/Scripts/016_UI/001_Non-interactive UI/007_UI_Credits.rb index 4fae0cb96..de3698eab 100644 --- a/Data/Scripts/016_UI/001_Non-interactive UI/007_UI_Credits.rb +++ b/Data/Scripts/016_UI/001_Non-interactive UI/007_UI_Credits.rb @@ -45,59 +45,59 @@ class Scene_Credits # This next piece of code is the credits. # Start Editing - CREDIT = <<_END_ + CREDIT = <<~_END_ -Your credits go here. + Your credits go here. -Your credits go here. + Your credits go here. -Your credits go here. + Your credits go here. -Your credits go here. + Your credits go here. -Your credits go here. + Your credits go here. -{INSERTS_PLUGIN_CREDITS_DO_NOT_REMOVE} + {INSERTS_PLUGIN_CREDITS_DO_NOT_REMOVE} -"Pokémon Essentials" was created by: -Flameguru -Poccil (Peter O.) -Maruno + "Pokémon Essentials" was created by: + Poccil (Peter O.) + Maruno + Inspired by work by Flameguru -With contributions from: -AvatarMonkeyKirbyMarin -BoushyMiDas Mike -Brother1440Near Fantastica -FL.PinkMan -Genzai KawakamiPopper -Golisopod UserRataime -help-14Savordez -IceGod64SoundSpawn -Jacob O. Wobbrockthe__end -KitsuneKoutaVenom12 -Lisa AnthonyWachunga -Luka S.J. -and everyone else who helped out + With contributions from: + AvatarMonkeyKirbyMarin + BoushyMiDas Mike + Brother1440Near Fantastica + FL.PinkMan + Genzai KawakamiPopper + Golisopod UserRataime + help-14Savordez + IceGod64SoundSpawn + Jacob O. Wobbrockthe__end + KitsuneKoutaVenom12 + Lisa AnthonyWachunga + Luka S.J. + and everyone else who helped out -"mkxp-z" by: -Roza -Based on "mkxp" by Ancurio et al. + "mkxp-z" by: + Roza + Based on "mkxp" by Ancurio et al. -"RPG Maker XP" by: -Enterbrain + "RPG Maker XP" by: + Enterbrain -Pokémon is owned by: -The Pokémon Company -Nintendo -Affiliated with Game Freak + Pokémon is owned by: + The Pokémon Company + Nintendo + Affiliated with Game Freak -This is a non-profit fan-made game. -No copyright infringements intended. -Please support the official games! + This is a non-profit fan-made game. + No copyright infringements intended. + Please support the official games! -_END_ + _END_ # Stop Editing def main @@ -150,29 +150,31 @@ _END_ lines_per_bitmap.times do |j| line = credit_lines[(i * lines_per_bitmap) + j] next if !line + line += " " if line.end_with?("") line = line.split("") xpos = 0 align = 1 # Centre align linewidth = Graphics.width line.length.times do |k| + text = line[k].strip if line.length > 1 xpos = (k == 0) ? 0 : 20 + (Graphics.width / 2) align = (k == 0) ? 2 : 0 # Right align : left align 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, text, 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, text, align) + credit_bitmap.draw_text(xpos, (j * 32) + 2, linewidth, 32, text, align) + credit_bitmap.draw_text(xpos - 2, (j * 32) + 2, linewidth, 32, text, align) + credit_bitmap.draw_text(xpos + 2, (j * 32) + 4, linewidth, 32, text, align) + credit_bitmap.draw_text(xpos - 2, (j * 32) + 4, linewidth, 32, text, align) + credit_bitmap.draw_text(xpos + 2, (j * 32) + 6, linewidth, 32, text, align) + credit_bitmap.draw_text(xpos, (j * 32) + 6, linewidth, 32, text, align) + credit_bitmap.draw_text(xpos - 2, (j * 32) + 6, linewidth, 32, text, 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, text, align) end end credit_sprite = Sprite.new(text_viewport) diff --git a/Data/Scripts/016_UI/006_UI_Summary.rb b/Data/Scripts/016_UI/006_UI_Summary.rb index 3ee1cfec9..fa9d424ea 100644 --- a/Data/Scripts/016_UI/006_UI_Summary.rb +++ b/Data/Scripts/016_UI/006_UI_Summary.rb @@ -546,7 +546,7 @@ class PokemonSummary_Scene showNature = !@pokemon.shadowPokemon? || @pokemon.heartStage <= 3 if showNature nature_name = red_text_tag + @pokemon.nature.name + black_text_tag - memo += _INTL("{1} nature.", @pokemon.nature.name) + "\n" + memo += _INTL("{1} nature.", nature_name) + "\n" end # Write date received if @pokemon.timeReceived diff --git a/Data/Scripts/016_UI/014_UI_Save.rb b/Data/Scripts/016_UI/014_UI_Save.rb index e339a92b1..b292362f2 100644 --- a/Data/Scripts/016_UI/014_UI_Save.rb +++ b/Data/Scripts/016_UI/014_UI_Save.rb @@ -114,10 +114,10 @@ class PokemonSaveScreen $game_temp.begun_new_game = false pbSEPlay("GUI save choice") if Game.save - pbMessage("\\se[]" +_INTL("{1} saved the game.\\me[GUI save game]\\wtnp[30]", $player.name)) + pbMessage("\\se[]" + _INTL("{1} saved the game.\\me[GUI save game]\\wtnp[30]", $player.name)) ret = true else - pbMessage("\\se[]" +_INTL("Save failed.\\wtnp[30]")) + pbMessage("\\se[]" + _INTL("Save failed.\\wtnp[30]")) ret = false end else diff --git a/Data/Scripts/016_UI/019_UI_PC.rb b/Data/Scripts/016_UI/019_UI_PC.rb index 87a83d7fb..0a526e36b 100644 --- a/Data/Scripts/016_UI/019_UI_PC.rb +++ b/Data/Scripts/016_UI/019_UI_PC.rb @@ -5,14 +5,14 @@ def pbPCItemStorage command = 0 loop do command = pbShowCommandsWithHelp(nil, - [_INTL("Withdraw Item"), - _INTL("Deposit Item"), - _INTL("Toss Item"), - _INTL("Exit")], - [_INTL("Take out items from the PC."), - _INTL("Store items in the PC."), - _INTL("Throw away items stored in the PC."), - _INTL("Go back to the previous menu.")], -1, command) + [_INTL("Withdraw Item"), + _INTL("Deposit Item"), + _INTL("Toss Item"), + _INTL("Exit")], + [_INTL("Take out items from the PC."), + _INTL("Store items in the PC."), + _INTL("Throw away items stored in the PC."), + _INTL("Go back to the previous menu.")], -1, command) case command when 0 # Withdraw Item if !$PokemonGlobal.pcItemStorage @@ -170,14 +170,14 @@ MenuHandlers.add(:pc_menu, :pokemon_storage, { command = 0 loop do command = pbShowCommandsWithHelp(nil, - [_INTL("Organize Boxes"), - _INTL("Withdraw Pokémon"), - _INTL("Deposit Pokémon"), - _INTL("See ya!")], - [_INTL("Organize the Pokémon in Boxes and in your party."), - _INTL("Move Pokémon stored in Boxes to your party."), - _INTL("Store Pokémon in your party in Boxes."), - _INTL("Return to the previous menu.")], -1, command) + [_INTL("Organize Boxes"), + _INTL("Withdraw Pokémon"), + _INTL("Deposit Pokémon"), + _INTL("See ya!")], + [_INTL("Organize the Pokémon in Boxes and in your party."), + _INTL("Move Pokémon stored in Boxes to your party."), + _INTL("Store Pokémon in your party in Boxes."), + _INTL("Return to the previous menu.")], -1, command) break if command < 0 case command when 0 # Organize diff --git a/Data/Scripts/016_UI/020_UI_PokeMart.rb b/Data/Scripts/016_UI/020_UI_PokeMart.rb index 80e5a8860..d608c0d8f 100644 --- a/Data/Scripts/016_UI/020_UI_PokeMart.rb +++ b/Data/Scripts/016_UI/020_UI_PokeMart.rb @@ -616,7 +616,7 @@ class PokemonMartScreen end if GameData::Item.get(item).is_important? next if !pbConfirm(_INTL("So you want the {1}?\nIt'll be ${2}. All right?", - itemname, price.to_s_formatted)) + itemname, price.to_s_formatted)) quantity = 1 else maxafford = (price <= 0) ? Settings::BAG_MAX_PER_SLOT : @adapter.getMoney / price diff --git a/Data/Scripts/016_UI/023_UI_PurifyChamber.rb b/Data/Scripts/016_UI/023_UI_PurifyChamber.rb index 292dae0ca..1c8390998 100644 --- a/Data/Scripts/016_UI/023_UI_PurifyChamber.rb +++ b/Data/Scripts/016_UI/023_UI_PurifyChamber.rb @@ -681,7 +681,7 @@ class DirectFlowDiagram @distance = 96 end -# 0=none, 1=weak, 2=strong + # 0=none, 1=weak, 2=strong def setFlowStrength(strength) @strength = strength end @@ -755,7 +755,7 @@ class FlowDiagram @distance = 96 end -# 0=none, 1=weak, 2=strong + # 0=none, 1=weak, 2=strong def setFlowStrength(strength) @strength = strength end diff --git a/Data/Scripts/017_Minigames/005_Minigame_Lottery.rb b/Data/Scripts/017_Minigames/005_Minigame_Lottery.rb index cdd322725..accf250af 100644 --- a/Data/Scripts/017_Minigames/005_Minigame_Lottery.rb +++ b/Data/Scripts/017_Minigames/005_Minigame_Lottery.rb @@ -1,7 +1,7 @@ -################################################################################ +#=============================================================================== # "Lottery" mini-game # By Maruno -################################################################################ +#=============================================================================== def pbSetLotteryNumber(variable = 1) t = pbGetTimeNow hash = t.day + (t.month << 5) + (t.year << 9) diff --git a/Data/Scripts/018_Alternate battle modes/002_Battle Frontier rules/002_Challenge_Rulesets.rb b/Data/Scripts/018_Alternate battle modes/002_Battle Frontier rules/002_Challenge_Rulesets.rb index b6fa87777..270a8fed2 100644 --- a/Data/Scripts/018_Alternate battle modes/002_Battle Frontier rules/002_Challenge_Rulesets.rb +++ b/Data/Scripts/018_Alternate battle modes/002_Battle Frontier rules/002_Challenge_Rulesets.rb @@ -238,9 +238,6 @@ class StandardRules < PokemonRuleSet end end -########################################### -# Generation IV Cups -########################################### #=============================================================================== # #=============================================================================== diff --git a/Data/Scripts/018_Alternate battle modes/002_Battle Frontier rules/004_Challenge_LevelAdjustment.rb b/Data/Scripts/018_Alternate battle modes/002_Battle Frontier rules/004_Challenge_LevelAdjustment.rb index 1e200b30c..5948bc2d8 100644 --- a/Data/Scripts/018_Alternate battle modes/002_Battle Frontier rules/004_Challenge_LevelAdjustment.rb +++ b/Data/Scripts/018_Alternate battle modes/002_Battle Frontier rules/004_Challenge_LevelAdjustment.rb @@ -48,14 +48,16 @@ class LevelAdjustment adj1 = nil adj2 = nil ret = [getOldExp(team1, team2), getOldExp(team2, team1)] - if @adjustment == BOTH_TEAMS || @adjustment == MY_TEAM + case @adjustment + when BOTH_TEAMS adj1 = getAdjustment(team1, team2) - elsif @adjustment == BOTH_TEAMS_DIFFERENT - adj1 = getMyAdjustment(team1, team2) - end - if @adjustment == BOTH_TEAMS || @adjustment == ENEMY_TEAM adj2 = getAdjustment(team2, team1) - elsif @adjustment == BOTH_TEAMS_DIFFERENT + when MY_TEAM + adj1 = getAdjustment(team1, team2) + when ENEMY_TEAM + adj2 = getAdjustment(team2, team1) + when BOTH_TEAMS_DIFFERENT + adj1 = getMyAdjustment(team1, team2) adj2 = getTheirAdjustment(team2, team1) end if adj1 diff --git a/Data/Scripts/020_Debug/002_Animation editor/001_AnimEditor_SceneElements.rb b/Data/Scripts/020_Debug/002_Animation editor/001_AnimEditor_SceneElements.rb index fc67b0a0f..c40bd9e44 100644 --- a/Data/Scripts/020_Debug/002_Animation editor/001_AnimEditor_SceneElements.rb +++ b/Data/Scripts/020_Debug/002_Animation editor/001_AnimEditor_SceneElements.rb @@ -1,9 +1,9 @@ module BattleAnimationEditor module_function - #=============================================================================== + #============================================================================= # Controls - #=============================================================================== + #============================================================================= class Window_Menu < Window_CommandPokemon def initialize(commands, x, y) tempbitmap = Bitmap.new(32, 32) @@ -41,9 +41,9 @@ module BattleAnimationEditor end end - #=============================================================================== + #============================================================================= # Clipboard - #=============================================================================== + #============================================================================= module Clipboard @data = nil @typekey = "" @@ -63,9 +63,9 @@ module BattleAnimationEditor end end - #=============================================================================== + #============================================================================= # - #=============================================================================== + #============================================================================= def pbTrackPopupMenu(commands) mousepos = Mouse.getMousePos return -1 if !mousepos @@ -94,9 +94,9 @@ module BattleAnimationEditor return -1 end - #=============================================================================== + #============================================================================= # Sprite sheet scrolling bar - #=============================================================================== + #============================================================================= class AnimationWindow < Sprite attr_reader :animbitmap attr_reader :start @@ -232,9 +232,9 @@ module BattleAnimationEditor end end - #=============================================================================== + #============================================================================= # - #=============================================================================== + #============================================================================= class CanvasAnimationWindow < AnimationWindow def animbitmap return @canvas.animbitmap @@ -246,9 +246,9 @@ module BattleAnimationEditor end end - #=============================================================================== + #============================================================================= # Cel sprite - #=============================================================================== + #============================================================================= class InvalidatableSprite < Sprite def initialize(viewport = nil) super(viewport) @@ -283,9 +283,9 @@ module BattleAnimationEditor def refresh; end end - #=============================================================================== + #============================================================================= # - #=============================================================================== + #============================================================================= class SpriteFrame < InvalidatableSprite attr_reader :id attr_reader :locked @@ -352,9 +352,9 @@ module BattleAnimationEditor end end - #=============================================================================== + #============================================================================= # Canvas - #=============================================================================== + #============================================================================= class AnimationCanvas < Sprite attr_reader :viewport attr_reader :sprites @@ -930,9 +930,9 @@ module BattleAnimationEditor end end - #=============================================================================== + #============================================================================= # Window classes - #=============================================================================== + #============================================================================= class BitmapDisplayWindow < SpriteWindow_Base attr_reader :bitmapname attr_reader :hue @@ -982,9 +982,9 @@ module BattleAnimationEditor end end - #=============================================================================== + #============================================================================= # - #=============================================================================== + #============================================================================= class AnimationNameWindow def initialize(canvas, x, y, width, height, viewport = nil) @canvas = canvas diff --git a/Data/Scripts/020_Debug/002_Animation editor/002_AnimEditor_ControlsButtons.rb b/Data/Scripts/020_Debug/002_Animation editor/002_AnimEditor_ControlsButtons.rb index f14572f92..6a705c3cb 100644 --- a/Data/Scripts/020_Debug/002_Animation editor/002_AnimEditor_ControlsButtons.rb +++ b/Data/Scripts/020_Debug/002_Animation editor/002_AnimEditor_ControlsButtons.rb @@ -1,9 +1,7 @@ module BattleAnimationEditor - module_function - - #=============================================================================== + #============================================================================= # - #=============================================================================== + #============================================================================= module ShadowText def shadowtext(bitmap, x, y, w, h, t, disabled = false, align = 0) width = bitmap.text_size(t).width @@ -19,9 +17,9 @@ module BattleAnimationEditor end end - #=============================================================================== + #============================================================================= # - #=============================================================================== + #============================================================================= class UIControl include ShadowText attr_accessor :bitmap @@ -95,9 +93,9 @@ module BattleAnimationEditor end end - #=============================================================================== + #============================================================================= # - #=============================================================================== + #============================================================================= class Label < UIControl def text=(value) self.label = value @@ -112,9 +110,9 @@ module BattleAnimationEditor end end - #=============================================================================== + #============================================================================= # - #=============================================================================== + #============================================================================= class Button < UIControl attr_accessor :label @@ -169,9 +167,9 @@ module BattleAnimationEditor end end - #=============================================================================== + #============================================================================= # - #=============================================================================== + #============================================================================= class Checkbox < Button attr_reader :checked @@ -230,9 +228,9 @@ module BattleAnimationEditor end end - #=============================================================================== + #============================================================================= # - #=============================================================================== + #============================================================================= class TextField < UIControl attr_accessor :label attr_reader :text @@ -366,9 +364,9 @@ module BattleAnimationEditor end end - #=============================================================================== + #============================================================================= # - #=============================================================================== + #============================================================================= class Slider < UIControl attr_reader :minvalue attr_reader :maxvalue @@ -480,9 +478,9 @@ module BattleAnimationEditor end end - #=============================================================================== + #============================================================================= # - #=============================================================================== + #============================================================================= class OptionalSlider < Slider def initialize(label, minvalue, maxvalue, curvalue) @slider = Slider.new(label, minvalue, maxvalue, curvalue) @@ -551,7 +549,7 @@ module BattleAnimationEditor @checkbox.refresh end - #----------------------------------------------------------------------------- + #--------------------------------------------------------------------------- private @@ -573,9 +571,9 @@ module BattleAnimationEditor end end - #=============================================================================== + #============================================================================= # - #=============================================================================== + #============================================================================= class ArrayCountSlider < Slider def maxvalue return @array.length - 1 @@ -587,9 +585,9 @@ module BattleAnimationEditor end end - #=============================================================================== + #============================================================================= # - #=============================================================================== + #============================================================================= class FrameCountSlider < Slider def maxvalue return @canvas.animation.length @@ -601,9 +599,9 @@ module BattleAnimationEditor end end - #=============================================================================== + #============================================================================= # - #=============================================================================== + #============================================================================= class FrameCountButton < Button def label return _INTL("Total Frames: {1}", @canvas.animation.length) @@ -615,9 +613,9 @@ module BattleAnimationEditor end end - #=============================================================================== + #============================================================================= # - #=============================================================================== + #============================================================================= class TextSlider < UIControl attr_reader :minvalue attr_reader :maxvalue @@ -735,9 +733,9 @@ module BattleAnimationEditor end end - #=============================================================================== + #============================================================================= # - #=============================================================================== + #============================================================================= class OptionalTextSlider < TextSlider def initialize(label, options, curval) @slider = TextSlider.new(label, options, curval) @@ -806,7 +804,7 @@ module BattleAnimationEditor @checkbox.refresh end - #----------------------------------------------------------------------------- + #--------------------------------------------------------------------------- private @@ -828,9 +826,9 @@ module BattleAnimationEditor end end - #=============================================================================== + #============================================================================= # - #=============================================================================== + #============================================================================= class ControlWindow < SpriteWindow_Base attr_reader :controls diff --git a/Data/Scripts/020_Debug/002_Animation editor/003_AnimEditor_Interpolation.rb b/Data/Scripts/020_Debug/002_Animation editor/003_AnimEditor_Interpolation.rb index df4fe74c3..4d5d5a9a9 100644 --- a/Data/Scripts/020_Debug/002_Animation editor/003_AnimEditor_Interpolation.rb +++ b/Data/Scripts/020_Debug/002_Animation editor/003_AnimEditor_Interpolation.rb @@ -1,9 +1,9 @@ module BattleAnimationEditor module_function - #=============================================================================== + #============================================================================= # Paths and interpolation - #=============================================================================== + #============================================================================= class ControlPointSprite < Sprite attr_accessor :dragging @@ -51,9 +51,9 @@ module BattleAnimationEditor end end - #=============================================================================== + #============================================================================= # - #=============================================================================== + #============================================================================= class PointSprite < Sprite def initialize(x, y, viewport = nil) super(viewport) @@ -69,9 +69,9 @@ module BattleAnimationEditor end end - #=============================================================================== + #============================================================================= # - #=============================================================================== + #============================================================================= class PointPath include Enumerable @@ -179,9 +179,9 @@ module BattleAnimationEditor end end - #=============================================================================== + #============================================================================= # - #=============================================================================== + #============================================================================= def catmullRom(p1, p2, p3, p4, t) # p1=prevPoint, p2=startPoint, p3=endPoint, p4=nextPoint, t is from 0 through 1 t2 = t * t diff --git a/Data/Scripts/020_Debug/002_Animation editor/004_AnimEditor_ExportImport.rb b/Data/Scripts/020_Debug/002_Animation editor/004_AnimEditor_ExportImport.rb index 45e07eabf..633e902f0 100644 --- a/Data/Scripts/020_Debug/002_Animation editor/004_AnimEditor_ExportImport.rb +++ b/Data/Scripts/020_Debug/002_Animation editor/004_AnimEditor_ExportImport.rb @@ -1,9 +1,9 @@ module BattleAnimationEditor module_function - ################################################################################ + #============================================================================= # Importing and exporting - ################################################################################ + #============================================================================= def pbRgssChdir(dir) RTP.eachPathFor(dir) { |path| Dir.chdir(path) { yield } } end @@ -83,9 +83,9 @@ module BattleAnimationEditor return end - ################################################################################ + #============================================================================= # Format conversion - ################################################################################ + #============================================================================= def pbConvertAnimToNewFormat(textdata) needconverting = false textdata.length.times do |i| diff --git a/Data/Scripts/020_Debug/002_Animation editor/005_AnimEditor_Functions.rb b/Data/Scripts/020_Debug/002_Animation editor/005_AnimEditor_Functions.rb index 9622e52ab..5efad2258 100644 --- a/Data/Scripts/020_Debug/002_Animation editor/005_AnimEditor_Functions.rb +++ b/Data/Scripts/020_Debug/002_Animation editor/005_AnimEditor_Functions.rb @@ -1,9 +1,9 @@ module BattleAnimationEditor module_function - #=============================================================================== + #============================================================================= # Mini battle scene - #=============================================================================== + #============================================================================= class MiniBattler attr_accessor :index attr_accessor :pokemon @@ -11,9 +11,9 @@ module BattleAnimationEditor def initialize(index); self.index = index; end end - #=============================================================================== + #============================================================================= # - #=============================================================================== + #============================================================================= class MiniBattle attr_accessor :battlers @@ -23,9 +23,9 @@ module BattleAnimationEditor end end - #=============================================================================== + #============================================================================= # Pop-up menus for buttons in bottom menu - #=============================================================================== + #============================================================================= def pbSelectAnim(canvas, animwin) animfiles = [] pbRgssChdir(File.join("Graphics", "Animations")) { animfiles.concat(Dir.glob("*.png")) } @@ -182,9 +182,9 @@ module BattleAnimationEditor cmdwin.dispose end - #=============================================================================== + #============================================================================= # Pop-up menus for individual cels - #=============================================================================== + #============================================================================= def pbChooseNum(cel) ret = cel sliderwin2 = ControlWindow.new(0, 0, 320, 32 * 5) @@ -370,9 +370,9 @@ module BattleAnimationEditor return end - #=============================================================================== + #============================================================================= # Pop-up menus for buttons in right hand menu - #=============================================================================== + #============================================================================= def pbTimingList(canvas) commands = [] cmdNewSound = -1 diff --git a/Data/Scripts/021_Compiler/001_Compiler.rb b/Data/Scripts/021_Compiler/001_Compiler.rb index c1d52b25d..7ae172fe2 100644 --- a/Data/Scripts/021_Compiler/001_Compiler.rb +++ b/Data/Scripts/021_Compiler/001_Compiler.rb @@ -260,7 +260,7 @@ module Compiler (0...values.length).each do |i| value = values[i] next if !value || value.empty? - quote_count = value.count('"') #scan(/(?:^|\G|[^\\])(\\)*"/).length + quote_count = value.count('"') if !quote_count.zero? # Quote marks found in value (i...(values.length - 1)).each do |j| diff --git a/Data/Scripts/021_Compiler/004_Compiler_MapsAndEvents.rb b/Data/Scripts/021_Compiler/004_Compiler_MapsAndEvents.rb index f03ee0ec9..bf7f6a9be 100644 --- a/Data/Scripts/021_Compiler/004_Compiler_MapsAndEvents.rb +++ b/Data/Scripts/021_Compiler/004_Compiler_MapsAndEvents.rb @@ -606,15 +606,19 @@ module Compiler push_choice(firstpage.list, 0, "Yes", 3) if common_event > 0 if battleid > 0 - push_script(firstpage.list, sprintf("Phone.add(get_self,\n %s, %d, %d, %d\n)", brieftrcombo, battles.length, battleid, common_event), 3) + push_script(firstpage.list, sprintf("Phone.add(get_self,\n %s, %d, %d, %d\n)", + brieftrcombo, battles.length, battleid, common_event), 3) else - push_script(firstpage.list, sprintf("Phone.add(get_self,\n %s, %d, nil, %d\n)", brieftrcombo, battles.length, common_event), 3) + push_script(firstpage.list, sprintf("Phone.add(get_self,\n %s, %d, nil, %d\n)", + brieftrcombo, battles.length, common_event), 3) end else if battleid > 0 - push_script(firstpage.list, sprintf("Phone.add(get_self,\n %s, %d, %d\n)", brieftrcombo, battles.length, battleid), 3) + push_script(firstpage.list, sprintf("Phone.add(get_self,\n %s, %d, %d\n)", + brieftrcombo, battles.length, battleid), 3) else - push_script(firstpage.list, sprintf("Phone.add(get_self,\n %s, %d\n)", brieftrcombo, battles.length), 3) + push_script(firstpage.list, sprintf("Phone.add(get_self,\n %s, %d\n)", + brieftrcombo, battles.length), 3) end end push_choice(firstpage.list, 1, "No", 3) @@ -694,15 +698,19 @@ module Compiler push_choice(lastpage.list, 0, "Yes", 2) if common_event > 0 if battleid > 0 - push_script(lastpage.list, sprintf("Phone.add(get_self,\n %s, %d, %d, %d\n)", brieftrcombo, battles.length, battleid, common_event), 2) + push_script(lastpage.list, sprintf("Phone.add(get_self,\n %s, %d, %d, %d\n)", + brieftrcombo, battles.length, battleid, common_event), 2) else - push_script(lastpage.list, sprintf("Phone.add(get_self,\n %s, %d, nil, %d\n)", brieftrcombo, battles.length, common_event), 2) + push_script(lastpage.list, sprintf("Phone.add(get_self,\n %s, %d, nil, %d\n)", + brieftrcombo, battles.length, common_event), 2) end else if battleid > 0 - push_script(lastpage.list, sprintf("Phone.add(get_self,\n %s, %d, %d\n)", brieftrcombo, battles.length, battleid), 2) + push_script(lastpage.list, sprintf("Phone.add(get_self,\n %s, %d, %d\n)", + brieftrcombo, battles.length, battleid), 2) else - push_script(lastpage.list, sprintf("Phone.add(get_self,\n %s, %d\n)", brieftrcombo, battles.length), 2) + push_script(lastpage.list, sprintf("Phone.add(get_self,\n %s, %d\n)", + brieftrcombo, battles.length), 2) end end push_choice(lastpage.list, 1, "No", 2) diff --git a/Game.exe b/Game.exe index e20773f50..b6c05ed57 100644 Binary files a/Game.exe and b/Game.exe differ diff --git a/mkxp.json b/mkxp.json index 5d33c1bc1..dabfba40a 100644 --- a/mkxp.json +++ b/mkxp.json @@ -15,8 +15,10 @@ // - Enables/disables the extra console window on Windows. It appears by // default whenever mkxp-z is started in debug mode. // "MKXPZ_MACOS_METAL" - // - Setting this to 0 will force the usage of OpenGL over Metal. - // Probably not a good idea unless you have some kind of issue. + // - Setting this will influence the rendering backend used. + // Probably not a good idea to mess with it unless you have some kind of issue. + // OpenGL is default on x86, and Metal is the default on Apple Silicon. + // This takes priority over the config option if it's set. // "MKXPZ_FOLDER_SELECT" // - Allows the manual selection of the game's folder at startup. // Only works on macOS at the moment. @@ -129,6 +131,23 @@ // "solidFonts": false, + // Prefer the use of Metal over OpenGL on macOS. + // This defaults to false under Intel machines, + // and true under ARM/Apple Silicon ones (which + // merely emulate OpenGL anyway) + // + // Try changing this if you have graphics problems. + // Metal is far better, but ANGLE may not initialize correctly + // on some Intel machines. + // + // On Apple Silicon it's probably better to not touch it. + // Emulated OpenGL is buggy, and it will also break things like + // the Steam overlay. + // (default: true if Apple Silicon, false if Intel) + // + // "preferMetalRenderer": true, + + // Work around buggy graphics drivers which don't // properly synchronize texture access, most // apparent when text doesn't show up or the map @@ -143,9 +162,9 @@ // implementations of this functionality, so // disabling it can be used as a workaround. // Does nothing on macOS. - // (default: enabled) + // (default: disabled) // - "enableBlitting": false, + // "enableBlitting": false, // Limit the maximum size (width, height) of @@ -159,6 +178,30 @@ // "maxTextureSize": 0, + // Scale up the game screen by an integer amount, + // as large as the current window size allows, before + // doing any last additional scalings to fill part or + // all of the remaining window space (or none at all + // if lastMileScaling is disabled). + // If fixedAspectRatio is disabled, the integer scale + // factors in horizontal and vertical direction can differ + // depending on how much space is available, otherwise + // they are forced to the smaller of the two. + // (default: disabled) + // + // "integerScalingActive": false, + + + // When integer scaling is enabled, this option controls + // whether the scaled game screen is further scaled + // (with linear interpolation when smoothScaling is enabled) + // to fill the rest of the game window. + // Note that this option still respects fixedAspectRatio. + // (default: enabled) + // + // "integerScalingLastMile": true, + + // Set the base path of the game to '/path/to/game' // (default: executable directory) // @@ -178,6 +221,12 @@ // "enableReset": true, + // Enable F1/keybinding menu + // (default: enabled) + // + // "enableSettings": true, + + // Allow symlinks for game assets to be followed // (default: disabled) // @@ -187,10 +236,9 @@ // Organisation / company and application / game // name to build the directory path where mkxp // will store game specific data (eg. key bindings). - // If not specified, mkxp will save to a common - // directory shared by all games. Note that these - // are TWO individual config entries, and both need - // to be defined for this to take effect. + // If not specified, mkxp-z will use a folder based + // on the name of the game, if possible, defaulting + // to "." for Org and "mkxp-z" for App otherwise. // (default: none) // // "dataPathOrg": "mycompany", diff --git a/x64-msvcrt-ruby310.dll b/x64-msvcrt-ruby310.dll index 27fd5d5c5..ba6e223eb 100644 Binary files a/x64-msvcrt-ruby310.dll and b/x64-msvcrt-ruby310.dll differ diff --git a/zlib1.dll b/zlib1.dll index c79a30b86..571908d03 100644 Binary files a/zlib1.dll and b/zlib1.dll differ