Fixed rendering of some tiles for certain sizes of tilesets, more rubocopping

This commit is contained in:
Maruno17
2023-04-12 21:14:26 +01:00
parent 956a511ec5
commit a714086a39
42 changed files with 392 additions and 374 deletions

View File

@@ -15,6 +15,11 @@ Layout/ExtraSpacing:
AllowForAlignment: true AllowForAlignment: true
AllowBeforeTrailingComments: 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 # In a hash with multiple values (one per line), prefer the => to be lined up
# and text to otherwise be left-aligned. # and text to otherwise be left-aligned.
Layout/HashAlignment: Layout/HashAlignment:
@@ -207,3 +212,8 @@ Style/SymbolProc:
# it from the true/false results. # it from the true/false results.
Style/TernaryParentheses: Style/TernaryParentheses:
EnforcedStyle: require_parentheses 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

View File

@@ -1,8 +1,6 @@
############################# #===============================================================================
#
# HTTP utility functions # HTTP utility functions
# #===============================================================================
#############################
def pbPostData(url, postdata, filename = nil, depth = 0) def pbPostData(url, postdata, filename = nil, depth = 0)
if url[/^http:\/\/([^\/]+)(.*)$/] if url[/^http:\/\/([^\/]+)(.*)$/]
host = $1 host = $1

View File

@@ -571,15 +571,17 @@ class Translation
def setMapMessagesAsHash(map_id, array) def setMapMessagesAsHash(map_id, array)
load_default_messages load_default_messages
@default_game_messages[MessageTypes::EVENT_TEXTS] ||= [] @default_game_messages[MessageTypes::EVENT_TEXTS] ||= []
@default_game_messages[MessageTypes::EVENT_TEXTS][map_id] = priv_add_to_hash(MessageTypes::EVENT_TEXTS, @default_game_messages[MessageTypes::EVENT_TEXTS][map_id] = priv_add_to_hash(
array, nil, map_id) MessageTypes::EVENT_TEXTS, array, nil, map_id
)
end end
def addMapMessagesAsHash(map_id, array) def addMapMessagesAsHash(map_id, array)
load_default_messages load_default_messages
@default_game_messages[MessageTypes::EVENT_TEXTS] ||= [] @default_game_messages[MessageTypes::EVENT_TEXTS] ||= []
@default_game_messages[MessageTypes::EVENT_TEXTS][map_id] = priv_add_to_hash(MessageTypes::EVENT_TEXTS, @default_game_messages[MessageTypes::EVENT_TEXTS][map_id] = priv_add_to_hash(
array, @default_game_messages[MessageTypes::EVENT_TEXTS][map_id], map_id) MessageTypes::EVENT_TEXTS, array, @default_game_messages[MessageTypes::EVENT_TEXTS][map_id], map_id
)
end end
def get(type, id) def get(type, id)

View File

@@ -1,10 +1,10 @@
#============================================================================== #===============================================================================
# ** Game_System # ** Game_System
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
# This class handles data surrounding the system. Backround music, etc. # This class handles data surrounding the system. Backround music, etc.
# is managed here as well. Refer to "$game_system" for the instance of # is managed here as well. Refer to "$game_system" for the instance of
# this class. # this class.
#============================================================================== #===============================================================================
class Game_System class Game_System
attr_reader :map_interpreter # map event interpreter attr_reader :map_interpreter # map event interpreter
attr_reader :battle_interpreter # battle event interpreter attr_reader :battle_interpreter # battle event interpreter
@@ -39,7 +39,7 @@ class Game_System
@bgs_position = 0 @bgs_position = 0
end end
################################################################################ #-----------------------------------------------------------------------------
def bgm_play(bgm) def bgm_play(bgm)
old_pos = @bgm_position old_pos = @bgm_position
@@ -140,7 +140,7 @@ class Game_System
end end
end end
################################################################################ #-----------------------------------------------------------------------------
def me_play(me) def me_play(me)
me = RPG::AudioFile.new(me) if me.is_a?(String) me = RPG::AudioFile.new(me) if me.is_a?(String)
@@ -157,7 +157,7 @@ class Game_System
Graphics.frame_reset Graphics.frame_reset
end end
################################################################################ #-----------------------------------------------------------------------------
def bgs_play(bgs) def bgs_play(bgs)
@playing_bgs = (bgs.nil?) ? nil : bgs.clone @playing_bgs = (bgs.nil?) ? nil : bgs.clone
@@ -224,7 +224,7 @@ class Game_System
return (@playing_bgs) ? @playing_bgs.clone : nil return (@playing_bgs) ? @playing_bgs.clone : nil
end end
################################################################################ #-----------------------------------------------------------------------------
def se_play(se) def se_play(se)
se = RPG::AudioFile.new(se) if se.is_a?(String) se = RPG::AudioFile.new(se) if se.is_a?(String)
@@ -240,7 +240,7 @@ class Game_System
Audio.se_stop Audio.se_stop
end end
################################################################################ #-----------------------------------------------------------------------------
def battle_bgm def battle_bgm
return (@battle_bgm) ? @battle_bgm : $data_system.battle_bgm return (@battle_bgm) ? @battle_bgm : $data_system.battle_bgm
@@ -254,7 +254,7 @@ class Game_System
attr_writer :battle_end_me attr_writer :battle_end_me
################################################################################ #-----------------------------------------------------------------------------
def windowskin_name def windowskin_name
if @windowskin_name.nil? if @windowskin_name.nil?

View File

@@ -1,9 +1,9 @@
#============================================================================== #===============================================================================
# ** Game_Map # ** Game_Map
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
# This class handles the map. It includes scrolling and passable determining # This class handles the map. It includes scrolling and passable determining
# functions. Refer to "$game_map" for the instance of this class. # functions. Refer to "$game_map" for the instance of this class.
#============================================================================== #===============================================================================
class Game_Map class Game_Map
attr_accessor :map_id attr_accessor :map_id
attr_accessor :tileset_name # tileset file name attr_accessor :tileset_name # tileset file name

View File

@@ -1,13 +1,13 @@
#======================================================================= #===============================================================================
# This module is a little fix that works around PC hardware limitations. # This module is a little fix that works around PC hardware limitations. Since
# Since Essentials isn't working with software rendering anymore, it now # Essentials isn't working with software rendering anymore, it now has to deal
# has to deal with the limits of the GPU. For the most part this is no # with the limits of the GPU. For the most part this is no big deal, but people
# big deal, but people do have some really big tilesets. # do have some really big tilesets.
# #
# The fix is simple enough: If your tileset is too big, a new # The fix is simple enough: If your tileset is too big, a new bitmap will be
# bitmap will be constructed with all the excess pixels sent to the # constructed with all the excess pixels sent to the image's right side. This
# image's right side. This basically means that you now have a limit # basically means that you now have a limit far higher than you should ever
# far higher than you should ever actually need. # actually need.
# #
# Hardware limit -> max tileset length: # Hardware limit -> max tileset length:
# 1024px -> 4096px # 1024px -> 4096px
@@ -15,9 +15,9 @@
# 4096px -> 65536px (enough to load pretty much any tileset) # 4096px -> 65536px (enough to load pretty much any tileset)
# 8192px -> 262144px # 8192px -> 262144px
# 16384px -> 1048576px (what most people have at this point) # 16384px -> 1048576px (what most people have at this point)
#
# ~Roza/Zoroark # ~Roza/Zoroark
#======================================================================= #===============================================================================
class TilemapRenderer class TilemapRenderer
module TilesetWrapper module TilesetWrapper
TILESET_WIDTH = SOURCE_TILE_WIDTH * TILESET_TILES_PER_ROW TILESET_WIDTH = SOURCE_TILE_WIDTH * TILESET_TILES_PER_ROW
@@ -37,6 +37,7 @@ class TilemapRenderer
end end
bmp = Bitmap.new(TILESET_WIDTH * columns, MAX_TEX_SIZE) bmp = Bitmap.new(TILESET_WIDTH * columns, MAX_TEX_SIZE)
remainder = height % MAX_TEX_SIZE remainder = height % MAX_TEX_SIZE
remainder = MAX_TEX_SIZE if remainder == 0
columns.times do |col| columns.times do |col|
srcrect = Rect.new(0, col * MAX_TEX_SIZE, width, (col + 1 == columns) ? remainder : MAX_TEX_SIZE) srcrect = Rect.new(0, col * MAX_TEX_SIZE, width, (col + 1 == columns) ? remainder : MAX_TEX_SIZE)
bmp.blt(col * TILESET_WIDTH, 0, originalbmp, srcrect) bmp.blt(col * TILESET_WIDTH, 0, originalbmp, srcrect)

View File

@@ -18,13 +18,13 @@ def shadowc3tag(base, shadow)
base_text = base.to_rgb32 base_text = base.to_rgb32
else else
base_text = sprintf("%02X%02X%02X", base[0], base[1], base[2]) 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 end
if shadow.is_a?(Color) if shadow.is_a?(Color)
shadow_text = shadow.to_rgb32 shadow_text = shadow.to_rgb32
else else
shadow_text = sprintf("%02X%02X%02X", shadow[0], shadow[1], shadow[2]) 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 end
return sprintf("<c3=%s,%s>", base_text, shadow_text) return sprintf("<c3=%s,%s>", base_text, shadow_text)
end end
@@ -428,7 +428,7 @@ def getFormattedText(bitmap, xDst, yDst, widthDst, heightDst, text, lineheight =
graphicHeight = nil graphicHeight = nil
graphicRect = nil graphicRect = nil
controls.length.times do |i| controls.length.times do |i|
if controls[i] && controls[i][2] == position next if !controls[i] || controls[i][2] != position
control = controls[i][0] control = controls[i][0]
param = controls[i][1] param = controls[i][1]
endtag = controls[i][3] endtag = controls[i][3]
@@ -547,7 +547,6 @@ def getFormattedText(bitmap, xDst, yDst, widthDst, heightDst, text, lineheight =
end end
controls[i] = nil controls[i] = nil
end end
end
bitmap.font.bold = (boldcount > 0) bitmap.font.bold = (boldcount > 0)
bitmap.font.italic = (italiccount > 0) bitmap.font.italic = (italiccount > 0)
if graphic if graphic

View File

@@ -551,7 +551,7 @@ def pbMessageDisplay(msgwindow, message, letterbyletter = true, commandProc = ni
elsif signWaitCount == 0 && letterbyletter elsif signWaitCount == 0 && letterbyletter
pbPlayDecisionSE pbPlayDecisionSE
end end
########## Position message window ############## # Position message window
pbRepositionMessageWindow(msgwindow, linecount) pbRepositionMessageWindow(msgwindow, linecount)
if facewindow if facewindow
pbPositionNearMsgWindow(facewindow, msgwindow, :left) pbPositionNearMsgWindow(facewindow, msgwindow, :left)
@@ -559,7 +559,7 @@ def pbMessageDisplay(msgwindow, message, letterbyletter = true, commandProc = ni
facewindow.z = msgwindow.z facewindow.z = msgwindow.z
end end
atTop = (msgwindow.y == 0) atTop = (msgwindow.y == 0)
########## Show text ############################# # Show text
msgwindow.text = text msgwindow.text = text
Graphics.frame_reset if Graphics.frame_rate > 40 Graphics.frame_reset if Graphics.frame_rate > 40
loop do loop do

View File

@@ -1,4 +1,3 @@
#####################################
# Needed because RGSS doesn't call at_exit procs on exit # Needed because RGSS doesn't call at_exit procs on exit
# Exit is not called when game is reset (using F12) # Exit is not called when game is reset (using F12)
$AtExitProcs = [] if !$AtExitProcs $AtExitProcs = [] if !$AtExitProcs

View File

@@ -38,7 +38,7 @@ def pbResolveAudioFile(str, volume = nil, pitch = nil)
return str return str
end end
################################################################################ #===============================================================================
# Plays a BGM file. # Plays a BGM file.
# param -- Either a string showing the filename # 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 (timeInSeconds > 0.0) ? Audio.bgm_fade((timeInSeconds * 1000).floor) : Audio.bgm_stop
end end
################################################################################ #===============================================================================
# Plays an ME file. # Plays an ME file.
# param -- Either a string showing the filename # 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 (timeInSeconds > 0.0) ? Audio.me_fade((timeInSeconds * 1000).floor) : Audio.me_stop
end end
################################################################################ #===============================================================================
# Plays a BGS file. # Plays a BGS file.
# param -- Either a string showing the filename # 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 (timeInSeconds > 0.0) ? Audio.bgs_fade((timeInSeconds * 1000).floor) : Audio.bgs_stop
end end
################################################################################ #===============================================================================
# Plays an SE file. # Plays an SE file.
# param -- Either a string showing the filename # param -- Either a string showing the filename
@@ -232,7 +232,7 @@ def pbSEStop(_timeInSeconds = 0.0)
end end
end end
################################################################################ #===============================================================================
# Plays a sound effect that plays when the player moves the cursor. # Plays a sound effect that plays when the player moves the cursor.
def pbPlayCursorSE def pbPlayCursorSE

View File

@@ -418,7 +418,7 @@ module GameData
ret = nil if ret == :None ret = nil if ret == :None
when "Evolutions" when "Evolutions"
if ret if ret
ret = ret.select { |evo| !evo[3] } # Remove prevolutions ret = ret.reject { |evo| evo[3] } # Remove prevolutions
ret.each do |evo| ret.each do |evo|
param_type = GameData::Evolution.get(evo[1]).parameter param_type = GameData::Evolution.get(evo[1]).parameter
if !param_type.nil? if !param_type.nil?

View File

@@ -213,16 +213,14 @@ class Battle::Scene::PokemonDataBox < Sprite
nameWidth = self.bitmap.text_size(@battler.name).width nameWidth = self.bitmap.text_size(@battler.name).width
nameOffset = 0 nameOffset = 0
nameOffset = nameWidth - 116 if nameWidth > 116 nameOffset = nameWidth - 116 if nameWidth > 116
pbDrawTextPositions(self.bitmap, pbDrawTextPositions(self.bitmap, [[@battler.name, @spriteBaseX + 8 - nameOffset, 12, :left,
[[@battler.name, @spriteBaseX + 8 - nameOffset, 12, :left, NAME_BASE_COLOR, NAME_SHADOW_COLOR]] NAME_BASE_COLOR, NAME_SHADOW_COLOR]]
) )
end end
def draw_level def draw_level
# "Lv" graphic # "Lv" graphic
pbDrawImagePositions(self.bitmap, pbDrawImagePositions(self.bitmap, [["Graphics/UI/Battle/overlay_lv", @spriteBaseX + 140, 16]])
[["Graphics/UI/Battle/overlay_lv", @spriteBaseX + 140, 16]]
)
# Level number # Level number
pbDrawNumber(@battler.level, self.bitmap, @spriteBaseX + 162, 16) pbDrawNumber(@battler.level, self.bitmap, @spriteBaseX + 162, 16)
end end

View File

@@ -1,9 +1,9 @@
################################################################################ #===============================================================================
# This section was created solely for you to put various bits of code that # 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. # 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 # Be sure that any code you use here ONLY applies to the Pokémon/trainers you
# want it to apply to! # want it to apply to!
################################################################################ #===============================================================================
# Make all wild Pokémon shiny while a certain Switch is ON (see Settings). # Make all wild Pokémon shiny while a certain Switch is ON (see Settings).
EventHandlers.add(:on_wild_pokemon_created, :make_shiny_switch, EventHandlers.add(:on_wild_pokemon_created, :make_shiny_switch,

View File

@@ -506,8 +506,9 @@ ItemHandlers::UseOnPokemon.add(:FULLHEAL, proc { |item, qty, pkmn, scene|
}) })
ItemHandlers::UseOnPokemon.copy(:FULLHEAL, ItemHandlers::UseOnPokemon.copy(:FULLHEAL,
:LAVACOOKIE, :OLDGATEAU, :CASTELIACONE, :LUMIOSEGALETTE, :SHALOURSABLE, :LAVACOOKIE, :OLDGATEAU, :CASTELIACONE,
:BIGMALASADA, :PEWTERCRUNCHIES, :LUMBERRY) :LUMIOSEGALETTE, :SHALOURSABLE, :BIGMALASADA,
:PEWTERCRUNCHIES, :LUMBERRY)
ItemHandlers::UseOnPokemon.copy(:FULLHEAL, :RAGECANDYBAR) if Settings::RAGE_CANDY_BAR_CURES_STATUS_PROBLEMS ItemHandlers::UseOnPokemon.copy(:FULLHEAL, :RAGECANDYBAR) if Settings::RAGE_CANDY_BAR_CURES_STATUS_PROBLEMS
ItemHandlers::UseOnPokemon.add(:FULLRESTORE, proc { |item, qty, pkmn, scene| 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_index = 2
pkmn.ability = nil pkmn.ability = nil
scene.pbRefresh scene.pbRefresh
scene.pbDisplay(_INTL("{1}'s Ability changed! Its Ability is now {2}!", scene.pbDisplay(_INTL("{1}'s Ability changed! Its Ability is now {2}!", pkmn.name, new_ability_name))
pkmn.name, new_ability_name))
next true next true
end end
next false next false
@@ -1209,8 +1209,7 @@ ItemHandlers::UseOnPokemon.add(:ROTOMCATALOG, proc { |item, qty, pkmn, scene|
_INTL("Lawn mower"), _INTL("Lawn mower"),
_INTL("Cancel") _INTL("Cancel")
] ]
new_form = scene.pbShowCommands(_INTL("Which appliance would you like to order?"), new_form = scene.pbShowCommands(_INTL("Which appliance would you like to order?"), choices, pkmn.form)
choices, pkmn.form)
if new_form == pkmn.form if new_form == pkmn.form
scene.pbDisplay(_INTL("It won't have any effect.")) scene.pbDisplay(_INTL("It won't have any effect."))
next false next false

View File

@@ -72,9 +72,10 @@ ItemHandlers::CanUseInBattle.add(:POTION, proc { |item, pokemon, battler, move,
}) })
ItemHandlers::CanUseInBattle.copy(:POTION, ItemHandlers::CanUseInBattle.copy(:POTION,
:SUPERPOTION, :HYPERPOTION, :MAXPOTION, :BERRYJUICE, :SWEETHEART, :FRESHWATER, :SUPERPOTION, :HYPERPOTION, :MAXPOTION,
:SODAPOP, :LEMONADE, :MOOMOOMILK, :ORANBERRY, :SITRUSBERRY, :ENERGYPOWDER, :BERRYJUICE, :SWEETHEART, :FRESHWATER, :SODAPOP,
:ENERGYROOT) :LEMONADE, :MOOMOOMILK, :ORANBERRY, :SITRUSBERRY,
:ENERGYPOWDER, :ENERGYROOT)
ItemHandlers::CanUseInBattle.copy(:POTION, :RAGECANDYBAR) if !Settings::RAGE_CANDY_BAR_CURES_STATUS_PROBLEMS 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| 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, ItemHandlers::CanUseInBattle.copy(:FULLHEAL,
:LAVACOOKIE, :OLDGATEAU, :CASTELIACONE, :LUMIOSEGALETTE, :SHALOURSABLE, :LAVACOOKIE, :OLDGATEAU, :CASTELIACONE,
:BIGMALASADA, :PEWTERCRUNCHIES, :LUMBERRY, :HEALPOWDER) :LUMIOSEGALETTE, :SHALOURSABLE, :BIGMALASADA,
:PEWTERCRUNCHIES, :LUMBERRY, :HEALPOWDER)
ItemHandlers::CanUseInBattle.copy(:FULLHEAL, :RAGECANDYBAR) if Settings::RAGE_CANDY_BAR_CURES_STATUS_PROBLEMS 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| 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, 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| ItemHandlers::CanUseInBattle.add(:XSPATK, proc { |item, pokemon, battler, move, firstAction, battle, scene, showMessages|
next pbBattleItemCanRaiseStat?(:SPECIAL_ATTACK, battler, scene, showMessages) next pbBattleItemCanRaiseStat?(:SPECIAL_ATTACK, battler, scene, showMessages)
}) })
ItemHandlers::CanUseInBattle.copy(:XSPATK, 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| ItemHandlers::CanUseInBattle.add(:XSPDEF, proc { |item, pokemon, battler, move, firstAction, battle, scene, showMessages|
next pbBattleItemCanRaiseStat?(:SPECIAL_DEFENSE, battler, 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, ItemHandlers::BattleUseOnPokemon.copy(:FULLHEAL,
:LAVACOOKIE, :OLDGATEAU, :CASTELIACONE, :LUMIOSEGALETTE, :SHALOURSABLE, :LAVACOOKIE, :OLDGATEAU, :CASTELIACONE,
:BIGMALASADA, :PEWTERCRUNCHIES, :LUMBERRY) :LUMIOSEGALETTE, :SHALOURSABLE, :BIGMALASADA,
:PEWTERCRUNCHIES, :LUMBERRY)
ItemHandlers::BattleUseOnPokemon.copy(:FULLHEAL, :RAGECANDYBAR) if Settings::RAGE_CANDY_BAR_CURES_STATUS_PROBLEMS ItemHandlers::BattleUseOnPokemon.copy(:FULLHEAL, :RAGECANDYBAR) if Settings::RAGE_CANDY_BAR_CURES_STATUS_PROBLEMS
ItemHandlers::BattleUseOnPokemon.add(:FULLRESTORE, proc { |item, pokemon, battler, choices, scene| ItemHandlers::BattleUseOnPokemon.add(:FULLRESTORE, proc { |item, pokemon, battler, choices, scene|

View File

@@ -45,59 +45,59 @@ class Scene_Credits
# This next piece of code is the credits. # This next piece of code is the credits.
# Start Editing # 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: "Pokémon Essentials" was created by:
Flameguru Poccil (Peter O.)
Poccil (Peter O.) Maruno
Maruno Inspired by work by Flameguru
With contributions from: With contributions from:
AvatarMonkeyKirby<s>Marin AvatarMonkeyKirby<s>Marin
Boushy<s>MiDas Mike Boushy<s>MiDas Mike
Brother1440<s>Near Fantastica Brother1440<s>Near Fantastica
FL.<s>PinkMan FL.<s>PinkMan
Genzai Kawakami<s>Popper Genzai Kawakami<s>Popper
Golisopod User<s>Rataime Golisopod User<s>Rataime
help-14<s>Savordez help-14<s>Savordez
IceGod64<s>SoundSpawn IceGod64<s>SoundSpawn
Jacob O. Wobbrock<s>the__end Jacob O. Wobbrock<s>the__end
KitsuneKouta<s>Venom12 KitsuneKouta<s>Venom12
Lisa Anthony<s>Wachunga Lisa Anthony<s>Wachunga
Luka S.J.<s> Luka S.J.<s>
and everyone else who helped out and everyone else who helped out
"mkxp-z" by: "mkxp-z" by:
Roza Roza
Based on "mkxp" by Ancurio et al. Based on "mkxp" by Ancurio et al.
"RPG Maker XP" by: "RPG Maker XP" by:
Enterbrain Enterbrain
Pokémon is owned by: Pokémon is owned by:
The Pokémon Company The Pokémon Company
Nintendo Nintendo
Affiliated with Game Freak Affiliated with Game Freak
This is a non-profit fan-made game. This is a non-profit fan-made game.
No copyright infringements intended. No copyright infringements intended.
Please support the official games! Please support the official games!
_END_ _END_
# Stop Editing # Stop Editing
def main def main
@@ -150,29 +150,31 @@ _END_
lines_per_bitmap.times do |j| lines_per_bitmap.times do |j|
line = credit_lines[(i * lines_per_bitmap) + j] line = credit_lines[(i * lines_per_bitmap) + j]
next if !line next if !line
line += " " if line.end_with?("<s>")
line = line.split("<s>") line = line.split("<s>")
xpos = 0 xpos = 0
align = 1 # Centre align align = 1 # Centre align
linewidth = Graphics.width linewidth = Graphics.width
line.length.times do |k| line.length.times do |k|
text = line[k].strip
if line.length > 1 if line.length > 1
xpos = (k == 0) ? 0 : 20 + (Graphics.width / 2) xpos = (k == 0) ? 0 : 20 + (Graphics.width / 2)
align = (k == 0) ? 2 : 0 # Right align : left align align = (k == 0) ? 2 : 0 # Right align : left align
linewidth = (Graphics.width / 2) - 20 linewidth = (Graphics.width / 2) - 20
end end
credit_bitmap.font.color = TEXT_SHADOW_COLOR 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.font.color = TEXT_OUTLINE_COLOR
credit_bitmap.draw_text(xpos + 2, (j * 32) + 2, 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, line[k], align) credit_bitmap.draw_text(xpos, (j * 32) + 2, linewidth, 32, text, align)
credit_bitmap.draw_text(xpos - 2, (j * 32) + 2, linewidth, 32, line[k], 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, line[k], 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, line[k], 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, line[k], align) credit_bitmap.draw_text(xpos + 2, (j * 32) + 6, linewidth, 32, text, align)
credit_bitmap.draw_text(xpos, (j * 32) + 6, linewidth, 32, line[k], align) credit_bitmap.draw_text(xpos, (j * 32) + 6, linewidth, 32, text, align)
credit_bitmap.draw_text(xpos - 2, (j * 32) + 6, linewidth, 32, line[k], align) credit_bitmap.draw_text(xpos - 2, (j * 32) + 6, linewidth, 32, text, align)
credit_bitmap.font.color = TEXT_BASE_COLOR 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
end end
credit_sprite = Sprite.new(text_viewport) credit_sprite = Sprite.new(text_viewport)

View File

@@ -546,7 +546,7 @@ class PokemonSummary_Scene
showNature = !@pokemon.shadowPokemon? || @pokemon.heartStage <= 3 showNature = !@pokemon.shadowPokemon? || @pokemon.heartStage <= 3
if showNature if showNature
nature_name = red_text_tag + @pokemon.nature.name + black_text_tag 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 end
# Write date received # Write date received
if @pokemon.timeReceived if @pokemon.timeReceived

View File

@@ -114,10 +114,10 @@ class PokemonSaveScreen
$game_temp.begun_new_game = false $game_temp.begun_new_game = false
pbSEPlay("GUI save choice") pbSEPlay("GUI save choice")
if Game.save 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 ret = true
else else
pbMessage("\\se[]" +_INTL("Save failed.\\wtnp[30]")) pbMessage("\\se[]" + _INTL("Save failed.\\wtnp[30]"))
ret = false ret = false
end end
else else

View File

@@ -681,7 +681,7 @@ class DirectFlowDiagram
@distance = 96 @distance = 96
end end
# 0=none, 1=weak, 2=strong # 0=none, 1=weak, 2=strong
def setFlowStrength(strength) def setFlowStrength(strength)
@strength = strength @strength = strength
end end
@@ -755,7 +755,7 @@ class FlowDiagram
@distance = 96 @distance = 96
end end
# 0=none, 1=weak, 2=strong # 0=none, 1=weak, 2=strong
def setFlowStrength(strength) def setFlowStrength(strength)
@strength = strength @strength = strength
end end

View File

@@ -1,7 +1,7 @@
################################################################################ #===============================================================================
# "Lottery" mini-game # "Lottery" mini-game
# By Maruno # By Maruno
################################################################################ #===============================================================================
def pbSetLotteryNumber(variable = 1) def pbSetLotteryNumber(variable = 1)
t = pbGetTimeNow t = pbGetTimeNow
hash = t.day + (t.month << 5) + (t.year << 9) hash = t.day + (t.month << 5) + (t.year << 9)

View File

@@ -238,9 +238,6 @@ class StandardRules < PokemonRuleSet
end end
end end
###########################################
# Generation IV Cups
###########################################
#=============================================================================== #===============================================================================
# #
#=============================================================================== #===============================================================================

View File

@@ -48,14 +48,16 @@ class LevelAdjustment
adj1 = nil adj1 = nil
adj2 = nil adj2 = nil
ret = [getOldExp(team1, team2), getOldExp(team2, team1)] ret = [getOldExp(team1, team2), getOldExp(team2, team1)]
if @adjustment == BOTH_TEAMS || @adjustment == MY_TEAM case @adjustment
when BOTH_TEAMS
adj1 = getAdjustment(team1, team2) 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) 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) adj2 = getTheirAdjustment(team2, team1)
end end
if adj1 if adj1

View File

@@ -1,9 +1,9 @@
module BattleAnimationEditor module BattleAnimationEditor
module_function module_function
#=============================================================================== #=============================================================================
# Controls # Controls
#=============================================================================== #=============================================================================
class Window_Menu < Window_CommandPokemon class Window_Menu < Window_CommandPokemon
def initialize(commands, x, y) def initialize(commands, x, y)
tempbitmap = Bitmap.new(32, 32) tempbitmap = Bitmap.new(32, 32)
@@ -41,9 +41,9 @@ module BattleAnimationEditor
end end
end end
#=============================================================================== #=============================================================================
# Clipboard # Clipboard
#=============================================================================== #=============================================================================
module Clipboard module Clipboard
@data = nil @data = nil
@typekey = "" @typekey = ""
@@ -63,9 +63,9 @@ module BattleAnimationEditor
end end
end end
#=============================================================================== #=============================================================================
# #
#=============================================================================== #=============================================================================
def pbTrackPopupMenu(commands) def pbTrackPopupMenu(commands)
mousepos = Mouse.getMousePos mousepos = Mouse.getMousePos
return -1 if !mousepos return -1 if !mousepos
@@ -94,9 +94,9 @@ module BattleAnimationEditor
return -1 return -1
end end
#=============================================================================== #=============================================================================
# Sprite sheet scrolling bar # Sprite sheet scrolling bar
#=============================================================================== #=============================================================================
class AnimationWindow < Sprite class AnimationWindow < Sprite
attr_reader :animbitmap attr_reader :animbitmap
attr_reader :start attr_reader :start
@@ -232,9 +232,9 @@ module BattleAnimationEditor
end end
end end
#=============================================================================== #=============================================================================
# #
#=============================================================================== #=============================================================================
class CanvasAnimationWindow < AnimationWindow class CanvasAnimationWindow < AnimationWindow
def animbitmap def animbitmap
return @canvas.animbitmap return @canvas.animbitmap
@@ -246,9 +246,9 @@ module BattleAnimationEditor
end end
end end
#=============================================================================== #=============================================================================
# Cel sprite # Cel sprite
#=============================================================================== #=============================================================================
class InvalidatableSprite < Sprite class InvalidatableSprite < Sprite
def initialize(viewport = nil) def initialize(viewport = nil)
super(viewport) super(viewport)
@@ -283,9 +283,9 @@ module BattleAnimationEditor
def refresh; end def refresh; end
end end
#=============================================================================== #=============================================================================
# #
#=============================================================================== #=============================================================================
class SpriteFrame < InvalidatableSprite class SpriteFrame < InvalidatableSprite
attr_reader :id attr_reader :id
attr_reader :locked attr_reader :locked
@@ -352,9 +352,9 @@ module BattleAnimationEditor
end end
end end
#=============================================================================== #=============================================================================
# Canvas # Canvas
#=============================================================================== #=============================================================================
class AnimationCanvas < Sprite class AnimationCanvas < Sprite
attr_reader :viewport attr_reader :viewport
attr_reader :sprites attr_reader :sprites
@@ -930,9 +930,9 @@ module BattleAnimationEditor
end end
end end
#=============================================================================== #=============================================================================
# Window classes # Window classes
#=============================================================================== #=============================================================================
class BitmapDisplayWindow < SpriteWindow_Base class BitmapDisplayWindow < SpriteWindow_Base
attr_reader :bitmapname attr_reader :bitmapname
attr_reader :hue attr_reader :hue
@@ -982,9 +982,9 @@ module BattleAnimationEditor
end end
end end
#=============================================================================== #=============================================================================
# #
#=============================================================================== #=============================================================================
class AnimationNameWindow class AnimationNameWindow
def initialize(canvas, x, y, width, height, viewport = nil) def initialize(canvas, x, y, width, height, viewport = nil)
@canvas = canvas @canvas = canvas

View File

@@ -1,9 +1,7 @@
module BattleAnimationEditor module BattleAnimationEditor
module_function #=============================================================================
#===============================================================================
# #
#=============================================================================== #=============================================================================
module ShadowText module ShadowText
def shadowtext(bitmap, x, y, w, h, t, disabled = false, align = 0) def shadowtext(bitmap, x, y, w, h, t, disabled = false, align = 0)
width = bitmap.text_size(t).width width = bitmap.text_size(t).width
@@ -19,9 +17,9 @@ module BattleAnimationEditor
end end
end end
#=============================================================================== #=============================================================================
# #
#=============================================================================== #=============================================================================
class UIControl class UIControl
include ShadowText include ShadowText
attr_accessor :bitmap attr_accessor :bitmap
@@ -95,9 +93,9 @@ module BattleAnimationEditor
end end
end end
#=============================================================================== #=============================================================================
# #
#=============================================================================== #=============================================================================
class Label < UIControl class Label < UIControl
def text=(value) def text=(value)
self.label = value self.label = value
@@ -112,9 +110,9 @@ module BattleAnimationEditor
end end
end end
#=============================================================================== #=============================================================================
# #
#=============================================================================== #=============================================================================
class Button < UIControl class Button < UIControl
attr_accessor :label attr_accessor :label
@@ -169,9 +167,9 @@ module BattleAnimationEditor
end end
end end
#=============================================================================== #=============================================================================
# #
#=============================================================================== #=============================================================================
class Checkbox < Button class Checkbox < Button
attr_reader :checked attr_reader :checked
@@ -230,9 +228,9 @@ module BattleAnimationEditor
end end
end end
#=============================================================================== #=============================================================================
# #
#=============================================================================== #=============================================================================
class TextField < UIControl class TextField < UIControl
attr_accessor :label attr_accessor :label
attr_reader :text attr_reader :text
@@ -366,9 +364,9 @@ module BattleAnimationEditor
end end
end end
#=============================================================================== #=============================================================================
# #
#=============================================================================== #=============================================================================
class Slider < UIControl class Slider < UIControl
attr_reader :minvalue attr_reader :minvalue
attr_reader :maxvalue attr_reader :maxvalue
@@ -480,9 +478,9 @@ module BattleAnimationEditor
end end
end end
#=============================================================================== #=============================================================================
# #
#=============================================================================== #=============================================================================
class OptionalSlider < Slider class OptionalSlider < Slider
def initialize(label, minvalue, maxvalue, curvalue) def initialize(label, minvalue, maxvalue, curvalue)
@slider = Slider.new(label, minvalue, maxvalue, curvalue) @slider = Slider.new(label, minvalue, maxvalue, curvalue)
@@ -551,7 +549,7 @@ module BattleAnimationEditor
@checkbox.refresh @checkbox.refresh
end end
#----------------------------------------------------------------------------- #---------------------------------------------------------------------------
private private
@@ -573,9 +571,9 @@ module BattleAnimationEditor
end end
end end
#=============================================================================== #=============================================================================
# #
#=============================================================================== #=============================================================================
class ArrayCountSlider < Slider class ArrayCountSlider < Slider
def maxvalue def maxvalue
return @array.length - 1 return @array.length - 1
@@ -587,9 +585,9 @@ module BattleAnimationEditor
end end
end end
#=============================================================================== #=============================================================================
# #
#=============================================================================== #=============================================================================
class FrameCountSlider < Slider class FrameCountSlider < Slider
def maxvalue def maxvalue
return @canvas.animation.length return @canvas.animation.length
@@ -601,9 +599,9 @@ module BattleAnimationEditor
end end
end end
#=============================================================================== #=============================================================================
# #
#=============================================================================== #=============================================================================
class FrameCountButton < Button class FrameCountButton < Button
def label def label
return _INTL("Total Frames: {1}", @canvas.animation.length) return _INTL("Total Frames: {1}", @canvas.animation.length)
@@ -615,9 +613,9 @@ module BattleAnimationEditor
end end
end end
#=============================================================================== #=============================================================================
# #
#=============================================================================== #=============================================================================
class TextSlider < UIControl class TextSlider < UIControl
attr_reader :minvalue attr_reader :minvalue
attr_reader :maxvalue attr_reader :maxvalue
@@ -735,9 +733,9 @@ module BattleAnimationEditor
end end
end end
#=============================================================================== #=============================================================================
# #
#=============================================================================== #=============================================================================
class OptionalTextSlider < TextSlider class OptionalTextSlider < TextSlider
def initialize(label, options, curval) def initialize(label, options, curval)
@slider = TextSlider.new(label, options, curval) @slider = TextSlider.new(label, options, curval)
@@ -806,7 +804,7 @@ module BattleAnimationEditor
@checkbox.refresh @checkbox.refresh
end end
#----------------------------------------------------------------------------- #---------------------------------------------------------------------------
private private
@@ -828,9 +826,9 @@ module BattleAnimationEditor
end end
end end
#=============================================================================== #=============================================================================
# #
#=============================================================================== #=============================================================================
class ControlWindow < SpriteWindow_Base class ControlWindow < SpriteWindow_Base
attr_reader :controls attr_reader :controls

View File

@@ -1,9 +1,9 @@
module BattleAnimationEditor module BattleAnimationEditor
module_function module_function
#=============================================================================== #=============================================================================
# Paths and interpolation # Paths and interpolation
#=============================================================================== #=============================================================================
class ControlPointSprite < Sprite class ControlPointSprite < Sprite
attr_accessor :dragging attr_accessor :dragging
@@ -51,9 +51,9 @@ module BattleAnimationEditor
end end
end end
#=============================================================================== #=============================================================================
# #
#=============================================================================== #=============================================================================
class PointSprite < Sprite class PointSprite < Sprite
def initialize(x, y, viewport = nil) def initialize(x, y, viewport = nil)
super(viewport) super(viewport)
@@ -69,9 +69,9 @@ module BattleAnimationEditor
end end
end end
#=============================================================================== #=============================================================================
# #
#=============================================================================== #=============================================================================
class PointPath class PointPath
include Enumerable include Enumerable
@@ -179,9 +179,9 @@ module BattleAnimationEditor
end end
end end
#=============================================================================== #=============================================================================
# #
#=============================================================================== #=============================================================================
def catmullRom(p1, p2, p3, p4, t) def catmullRom(p1, p2, p3, p4, t)
# p1=prevPoint, p2=startPoint, p3=endPoint, p4=nextPoint, t is from 0 through 1 # p1=prevPoint, p2=startPoint, p3=endPoint, p4=nextPoint, t is from 0 through 1
t2 = t * t t2 = t * t

View File

@@ -1,9 +1,9 @@
module BattleAnimationEditor module BattleAnimationEditor
module_function module_function
################################################################################ #=============================================================================
# Importing and exporting # Importing and exporting
################################################################################ #=============================================================================
def pbRgssChdir(dir) def pbRgssChdir(dir)
RTP.eachPathFor(dir) { |path| Dir.chdir(path) { yield } } RTP.eachPathFor(dir) { |path| Dir.chdir(path) { yield } }
end end
@@ -83,9 +83,9 @@ module BattleAnimationEditor
return return
end end
################################################################################ #=============================================================================
# Format conversion # Format conversion
################################################################################ #=============================================================================
def pbConvertAnimToNewFormat(textdata) def pbConvertAnimToNewFormat(textdata)
needconverting = false needconverting = false
textdata.length.times do |i| textdata.length.times do |i|

View File

@@ -1,9 +1,9 @@
module BattleAnimationEditor module BattleAnimationEditor
module_function module_function
#=============================================================================== #=============================================================================
# Mini battle scene # Mini battle scene
#=============================================================================== #=============================================================================
class MiniBattler class MiniBattler
attr_accessor :index attr_accessor :index
attr_accessor :pokemon attr_accessor :pokemon
@@ -11,9 +11,9 @@ module BattleAnimationEditor
def initialize(index); self.index = index; end def initialize(index); self.index = index; end
end end
#=============================================================================== #=============================================================================
# #
#=============================================================================== #=============================================================================
class MiniBattle class MiniBattle
attr_accessor :battlers attr_accessor :battlers
@@ -23,9 +23,9 @@ module BattleAnimationEditor
end end
end end
#=============================================================================== #=============================================================================
# Pop-up menus for buttons in bottom menu # Pop-up menus for buttons in bottom menu
#=============================================================================== #=============================================================================
def pbSelectAnim(canvas, animwin) def pbSelectAnim(canvas, animwin)
animfiles = [] animfiles = []
pbRgssChdir(File.join("Graphics", "Animations")) { animfiles.concat(Dir.glob("*.png")) } pbRgssChdir(File.join("Graphics", "Animations")) { animfiles.concat(Dir.glob("*.png")) }
@@ -182,9 +182,9 @@ module BattleAnimationEditor
cmdwin.dispose cmdwin.dispose
end end
#=============================================================================== #=============================================================================
# Pop-up menus for individual cels # Pop-up menus for individual cels
#=============================================================================== #=============================================================================
def pbChooseNum(cel) def pbChooseNum(cel)
ret = cel ret = cel
sliderwin2 = ControlWindow.new(0, 0, 320, 32 * 5) sliderwin2 = ControlWindow.new(0, 0, 320, 32 * 5)
@@ -370,9 +370,9 @@ module BattleAnimationEditor
return return
end end
#=============================================================================== #=============================================================================
# Pop-up menus for buttons in right hand menu # Pop-up menus for buttons in right hand menu
#=============================================================================== #=============================================================================
def pbTimingList(canvas) def pbTimingList(canvas)
commands = [] commands = []
cmdNewSound = -1 cmdNewSound = -1

View File

@@ -260,7 +260,7 @@ module Compiler
(0...values.length).each do |i| (0...values.length).each do |i|
value = values[i] value = values[i]
next if !value || value.empty? next if !value || value.empty?
quote_count = value.count('"') #scan(/(?:^|\G|[^\\])(\\)*"/).length quote_count = value.count('"')
if !quote_count.zero? if !quote_count.zero?
# Quote marks found in value # Quote marks found in value
(i...(values.length - 1)).each do |j| (i...(values.length - 1)).each do |j|

View File

@@ -606,15 +606,19 @@ module Compiler
push_choice(firstpage.list, 0, "Yes", 3) push_choice(firstpage.list, 0, "Yes", 3)
if common_event > 0 if common_event > 0
if battleid > 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 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 end
else else
if battleid > 0 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 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
end end
push_choice(firstpage.list, 1, "No", 3) push_choice(firstpage.list, 1, "No", 3)
@@ -694,15 +698,19 @@ module Compiler
push_choice(lastpage.list, 0, "Yes", 2) push_choice(lastpage.list, 0, "Yes", 2)
if common_event > 0 if common_event > 0
if battleid > 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 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 end
else else
if battleid > 0 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 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
end end
push_choice(lastpage.list, 1, "No", 2) push_choice(lastpage.list, 1, "No", 2)