release 6.2

This commit is contained in:
infinitefusion
2024-06-28 12:01:39 -04:00
parent 0b9e83f554
commit 3a488c9ba6
7249 changed files with 713866 additions and 136365 deletions

View File

@@ -209,7 +209,7 @@ def pbHatch(pokemon)
pokemon.hatched_map = $game_map.map_id
if player_on_hidden_ability_map
chosenAbility = pokemon.getAbilityList.sample #format: [[:ABILITY, index],...]
pokemon.ability = chosenAbility[0]
#pokemon.ability = chosenAbility[0]
pokemon.ability_index = chosenAbility[1]
end

View File

@@ -633,9 +633,9 @@ class PokemonEvolutionScene
if allNewPossibleAbilities.include?(oldAbility)
@pokemon.ability=oldAbility
end
# if allNewPossibleAbilities.include?(oldAbility)
# @pokemon.ability=oldAbility
# end
# Learn moves upon evolution for evolved species
movelist = @pokemon.getMoveList

View File

@@ -219,6 +219,10 @@ def pbStartTrade(pokemonIndex,newpoke,nickname,trainerName,trainerGender=0,saveg
Kernel.Autosave if savegame
myPokemon = $Trainer.party[pokemonIndex]
heldItem = myPokemon.item
echoln heldItem
$PokemonBag.pbStoreItem(heldItem, 1) if heldItem
opponent = NPCTrainer.new(trainerName,trainerGender)
opponent.id = $Trainer.make_foreign_ID
yourPokemon = nil

View File

@@ -245,7 +245,7 @@ class HallOfFame_Scene
def createTrainerBattler
@sprites["trainer"] = IconSprite.new(@viewport)
@sprites["trainer"].setBitmap(GameData::TrainerType.front_sprite_filename($Trainer.trainer_type))
@sprites["trainer"].setBitmapDirectly(generate_front_trainer_sprite_bitmap())
if !SINGLEROW
@sprites["trainer"].x = Graphics.width - 96
@sprites["trainer"].y = 160
@@ -276,14 +276,9 @@ class HallOfFame_Scene
end
end
#Get difficulty for displaying in-game
def getDifficulty
if $game_switches[SWITCH_GAME_DIFFICULTY_EASY]
return "Easy"
elsif $game_switches[SWITCH_GAME_DIFFICULTY_HARD]
return "Hard"
else
return "Normal"
end
return getDisplayDifficulty()
end
def writeTrainerData
@@ -344,7 +339,7 @@ class HallOfFame_Scene
pbDrawTextPositions(overlay, [[_INTL("Welcome to the Hall of Fame!"),
Graphics.width / 2, Graphics.height - 80, 2, BASECOLOR, SHADOWCOLOR]])
writeCurrentDate(overlay, 120 , Graphics.height - 50)
writeCurrentDate(overlay, 120, Graphics.height - 50)
writeGameMode(overlay, (Graphics.width / 2) + 100, Graphics.height - 50)
end
@@ -364,7 +359,7 @@ class HallOfFame_Scene
end
if $game_switches[SWITCH_SINGLE_POKEMON_MODE]
pokemon_number = pbGet(VAR_SINGLE_POKEMON_MODE)
if pokemon_number.is_a?(Integer) && pokemon_number >0
if pokemon_number.is_a?(Integer) && pokemon_number > 0
pokemon = GameData::Species.get(pokemon_number)
gameMode = pokemon.real_name + " mode"
else

View File

@@ -110,6 +110,8 @@ Knuckles
UnworthyPie
Doctor Miawoo
Chardub
elupsis
TCGrunler#4583
The following free ressources were also used
with their respective authors' consent:
@@ -211,6 +213,7 @@ _END_
# Stop Editing
def main
endCredits() if $PokemonSystem.on_mobile
#-------------------------------
# Animated Background Setup
#-------------------------------
@@ -326,13 +329,17 @@ _END_
# Check if the credits should be cancelled
def cancel?
if Input.trigger?(Input::USE) && $PokemonGlobal.creditsPlayed
$scene = Scene_Map.new
pbBGMFade(1.0)
endCredits
return true
end
return false
end
def endCredits
$scene = Scene_Map.new
pbBGMFade(1.0)
end
# Checks if credits bitmap has reached its ending point
def last?
if @realOY > @total_height + @trim

View File

@@ -251,7 +251,7 @@ class PokemonPauseMenu
elsif cmdOption >= 0 && command == cmdOption
pbPlayDecisionSE
pbFadeOutIn {
scene = PokemonOption_Scene.new
scene = PokemonGameOption_Scene.new
screen = PokemonOptionScreen.new(scene)
screen.pbStartScreen
pbUpdateSceneMap

View File

@@ -427,9 +427,9 @@ class PokemonPartyPanel < SpriteWrapper
end
# Draw shiny icon
if @pokemon.shiny?
imagePos=[]
addShinyStarsToGraphicsArray(imagePos,80,48,@pokemon.bodyShiny?,@pokemon.headShiny?,@pokemon.debugShiny?,0,0,16,16)
pbDrawImagePositions(@overlaysprite.bitmap,imagePos)
imagePos = []
addShinyStarsToGraphicsArray(imagePos, 80, 48, @pokemon.bodyShiny?, @pokemon.headShiny?, @pokemon.debugShiny?, 0, 0, 16, 16)
pbDrawImagePositions(@overlaysprite.bitmap, imagePos)
end
end
pbDrawTextPositions(@overlaysprite.bitmap, textpos)
@@ -467,6 +467,7 @@ end
# Pokémon party visuals
#===============================================================================
class PokemonParty_Scene
attr_accessor :viewport
def pbStartScene(party, starthelptext, annotations = nil, multiselect = false)
@sprites = {}
@party = party
@@ -691,6 +692,15 @@ class PokemonParty_Scene
return ret
end
def pbOpenHatScreen(pokemon)
#oldsprites = pbFadeOutAndHide(@sprites)
scene = PokemonHatView.new
screen = PokemonHatPresenter.new(scene, pokemon)
screen.pbStartScreen()
yield if block_given?
#pbFadeInAndShow(@sprites, oldsprites)
end
def pbUseItem(bag, pokemon)
ret = nil
pbFadeOutIn {
@@ -1152,6 +1162,31 @@ class PokemonPartyScreen
return ret
end
def pbPokemonHat(pokemon)
cmd = 0
msg = "What should you do?"
loop do
cmd = @scene.pbShowCommands(msg, [
_INTL("Put on hat"),
_INTL("Remove hat"),
_INTL("Back")], cmd)
echoln cmd
break if cmd == -1
if cmd == 0 #Put on hat
@scene.pbOpenHatScreen(pokemon)
pbDisplay(_INTL("{1} put on a hat!",pokemon.name))
elsif cmd == 1 #remove hat
if pbConfirm(_INTL("Remove {1}'s hat?",pokemon.name))
pokemon.hat=nil
pbDisplay(_INTL("{1}'s hat was removed",pokemon.name))
end
else
break
end
end
end
def pbPokemonRename(pkmn, pkmnid)
cmd = 0
loop do
@@ -1160,7 +1195,7 @@ class PokemonPartyScreen
_INTL("{1} has no nickname.", speciesname)][pkmn.name == speciesname ? 1 : 0]
cmd = @scene.pbShowCommands(msg, [
_INTL("Rename"),
_INTL("Quit")], cmd)
_INTL("Back")], cmd)
# Break
if cmd == -1
break
@@ -1201,6 +1236,8 @@ class PokemonPartyScreen
cmdSwitch = -1
cmdMail = -1
cmdItem = -1
cmdHat = -1
# Build the commands
commands[cmdSummary = commands.length] = _INTL("Summary")
commands[cmdDebug = commands.length] = _INTL("Debug") if $DEBUG
@@ -1214,6 +1251,7 @@ class PokemonPartyScreen
end
end
commands[cmdSwitch = commands.length] = _INTL("Switch") if @party.length > 1
commands[cmdHat = commands.length] = _INTL("Hat") if !pkmn.egg? && $game_switches[SWITCH_UNLOCKED_POKEMON_HATS]
if !pkmn.egg?
if pkmn.mail
commands[cmdMail = commands.length] = _INTL("Mail")
@@ -1281,8 +1319,10 @@ class PokemonPartyScreen
@scene.pbSummary(pkmnid) {
@scene.pbSetHelpText((@party.length > 1) ? _INTL("Choose a Pokémon.") : _INTL("Choose Pokémon or cancel."))
}
elsif cmdHat >= 0 && command == cmdHat
pbPokemonHat(pkmn)
elsif cmdNickname >= 0 && command == cmdNickname
pbPokemonRename(pkmn,pkmnid)
pbPokemonRename(pkmn, pkmnid)
elsif cmdDebug >= 0 && command == cmdDebug
pbPokemonDebug(pkmn, pkmnid)
elsif cmdSwitch >= 0 && command == cmdSwitch

View File

@@ -1276,10 +1276,13 @@ class PokemonSummary_Scene
cmdTakeItem = -1
cmdPokedex = -1
cmdMark = -1
cmdHat = -1
if !@pokemon.egg?
if pbBattleChallenge.currentChallenge == -1
commands[cmdGiveItem = commands.length] = _INTL("Give item")
commands[cmdTakeItem = commands.length] = _INTL("Take item") if @pokemon.hasItem?
commands[cmdHat = commands.length] = _INTL("Hat") if !@pokemon.egg? && $game_switches[SWITCH_UNLOCKED_POKEMON_HATS]
end
commands[cmdPokedex = commands.length] = _INTL("View Pokédex") if $Trainer.has_pokedex
end
@@ -1298,6 +1301,8 @@ class PokemonSummary_Scene
end
elsif cmdTakeItem >= 0 && command == cmdTakeItem
dorefresh = pbTakeItemFromPokemon(@pokemon, self)
elsif cmdHat >= 0 && command == cmdHat
pbPokemonHatFromSummary(@pokemon)
elsif cmdPokedex >= 0 && command == cmdPokedex
$Trainer.pokedex.register_last_seen(@pokemon)
pbFadeOutIn {
@@ -1313,6 +1318,47 @@ class PokemonSummary_Scene
return dorefresh
end
def pbOpenHatScreenSummary(pokemon)
#oldsprites = pbFadeOutAndHide(@sprites)
x_pos = -8 #todo: Set as relative position instead of hardcoded value
y_pos = 94#
scene = PokemonHatView.new(x_pos,y_pos,false)
screen = PokemonHatPresenter.new(scene, pokemon)
screen.pbStartScreen()
yield if block_given?
#pbFadeInAndShow(@sprites, oldsprites)
end
def pbPokemonHatFromSummary(pokemon)
cmd = 0
msg = "What should you do?"
loop do
cmd = pbShowCommands([
_INTL("Put on hat"),
_INTL("Remove hat"),
_INTL("Back")])
echoln cmd
break if cmd == -1
if cmd == 0 #Put on hat
@sprites["pokemon"].visible=false
pbOpenHatScreenSummary(pokemon)
@sprites["pokemon"].visible=true
pbDisplay(_INTL("{1} put on a hat!",pokemon.name))
#@sprites["pokemon"].visible=false
elsif cmd == 1 #remove hat
if pbConfirm(_INTL("Remove {1}'s hat?",pokemon.name))
pokemon.hat=nil
pbDisplay(_INTL("{1}'s hat was removed",pokemon.name))
end
else
break
end
pbChangePokemon()
end
end
def pbChooseMoveToForget(move_to_learn)
new_move = (move_to_learn) ? Pokemon::Move.new(move_to_learn) : nil
selmove = 0

View File

@@ -35,7 +35,8 @@ class PokemonTrainerCard_Scene
@sprites["overlay"] = BitmapSprite.new(Graphics.width,Graphics.height,@viewport)
pbSetSystemFont(@sprites["overlay"].bitmap)
@sprites["trainer"] = IconSprite.new(336,112,@viewport)
@sprites["trainer"].setBitmap(GameData::TrainerType.player_front_sprite_filename($Trainer.trainer_type))
@sprites["trainer"].setBitmapDirectly(generate_front_trainer_sprite_bitmap())
@sprites["trainer"].x -= (@sprites["trainer"].bitmap.width-128)/2
@sprites["trainer"].y -= (@sprites["trainer"].bitmap.height-128)
@sprites["trainer"].z = 2

View File

@@ -65,8 +65,12 @@ class PokemonLoadPanel < SpriteWrapper
textpos.push([@title,16*2,2*2,0,TEXTCOLOR,TEXTSHADOWCOLOR])
textpos.push([_INTL("Badges:"),16*2,53*2,0,TEXTCOLOR,TEXTSHADOWCOLOR])
textpos.push([@trainer.badge_count.to_s,103*2,53*2,1,TEXTCOLOR,TEXTSHADOWCOLOR])
textpos.push([_INTL("Pokédex:"),16*2,69*2,0,TEXTCOLOR,TEXTSHADOWCOLOR])
textpos.push([@trainer.pokedex.seen_count.to_s,103*2,69*2,1,TEXTCOLOR,TEXTSHADOWCOLOR])
# textpos.push([_INTL("Pokédex:"),16*2,69*2,0,TEXTCOLOR,TEXTSHADOWCOLOR])
# textpos.push([@trainer.pokedex.seen_count.to_s,103*2,69*2,1,TEXTCOLOR,TEXTSHADOWCOLOR])
textpos.push([_INTL(getDisplayDifficultyFromIndex(@trainer.lowest_difficulty)),16*2,69*2,0,TEXTCOLOR,TEXTSHADOWCOLOR])
textpos.push([getGameModeFromIndex(@trainer.game_mode),103*2,69*2,1,TEXTCOLOR,TEXTSHADOWCOLOR])
textpos.push([_INTL("Time:"),16*2,85*2,0,TEXTCOLOR,TEXTSHADOWCOLOR])
hour = @totalsec / 60 / 60
min = @totalsec / 60 % 60
@@ -166,7 +170,7 @@ class PokemonLoad_Scene
meta = GameData::Metadata.get_player(trainer.character_ID)
if meta
filename = pbGetPlayerCharset(meta,1,trainer,true)
@sprites["player"] = TrainerWalkingCharSprite.new(filename,@viewport)
@sprites["player"] = TrainerWalkingCharSprite.new(filename,@viewport,trainer)
charwidth = @sprites["player"].bitmap.width
charheight = @sprites["player"].bitmap.height
@sprites["player"].x = 56*2-charwidth/8
@@ -341,7 +345,7 @@ class PokemonLoadScreen
pbFadeOutIn { pbDownloadMysteryGift(@save_data[:player]) }
when cmd_options
pbFadeOutIn do
scene = PokemonOption_Scene.new
scene = PokemonGameOption_Scene.new
screen = PokemonOptionScreen.new(scene)
screen.pbStartScreen(true)
end

View File

@@ -19,6 +19,8 @@ class PokemonSystem
attr_accessor :download_sprites
attr_accessor :speedup
attr_accessor :speedup_speed
attr_accessor :max_nb_sprites_download
attr_accessor :on_mobile
def initialize
@textspeed = 1 # Text speed (0=slow, 1=normal, 2=fast)
@@ -37,6 +39,8 @@ class PokemonSystem
@speedup = 0 #0= hold, 1=toggle
@speedup_speed = 3 #for hold only
@download_sprites = 0
@max_nb_sprites_download = 5
end
end
@@ -349,6 +353,7 @@ class PokemonOption_Scene
def initialize
@autosave_menu = false
@manually_changed_difficulty=false
end
def initUIElements
@@ -411,192 +416,9 @@ class PokemonOption_Scene
end
end
#IMPLEMENT IN INHERITED CLASSES
def pbGetOptions(inloadscreen = false)
options = []
options << SliderOption.new(_INTL("Music Volume"), 0, 100, 5,
proc { $PokemonSystem.bgmvolume },
proc { |value|
if $PokemonSystem.bgmvolume != value
$PokemonSystem.bgmvolume = value
if $game_system.playing_bgm != nil && !inloadscreen
playingBGM = $game_system.getPlayingBGM
$game_system.bgm_pause
$game_system.bgm_resume(playingBGM)
end
end
}, "Sets the volume for background music"
)
options << SliderOption.new(_INTL("SE Volume"), 0, 100, 5,
proc { $PokemonSystem.sevolume },
proc { |value|
if $PokemonSystem.sevolume != value
$PokemonSystem.sevolume = value
if $game_system.playing_bgs != nil
$game_system.playing_bgs.volume = value
playingBGS = $game_system.getPlayingBGS
$game_system.bgs_pause
$game_system.bgs_resume(playingBGS)
end
pbPlayCursorSE
end
}, "Sets the volume for sound effects"
)
options << EnumOption.new(_INTL("Default Movement"), [_INTL("Walking"), _INTL("Running")],
proc { $PokemonSystem.runstyle },
proc { |value| $PokemonSystem.runstyle = value },
["Default to walking when not holding the Run key",
"Default to running when not holding the Run key"]
)
options << EnumOption.new(_INTL("Text Speed"), [_INTL("Normal"), _INTL("Fast")],
proc { $PokemonSystem.textspeed },
proc { |value|
$PokemonSystem.textspeed = value
MessageConfig.pbSetTextSpeed(MessageConfig.pbSettingToTextSpeed(value))
}, "Sets the speed at which the text is displayed"
)
if $game_switches
options <<
EnumOption.new(_INTL("Autosave"), [_INTL("On"), _INTL("Off")],
proc { $game_switches[AUTOSAVE_ENABLED_SWITCH] ? 0 : 1 },
proc { |value|
if !$game_switches[AUTOSAVE_ENABLED_SWITCH] && value == 0
@autosave_menu = true
openAutosaveMenu()
end
$game_switches[AUTOSAVE_ENABLED_SWITCH] = value == 0
},
"Automatically saves when healing at Pokémon centers"
)
end
options << EnumOption.new(_INTL("Speed-up type"), [_INTL("Hold"), _INTL("Toggle")],
proc { $PokemonSystem.speedup },
proc { |value|
$PokemonSystem.speedup = value
}, "Pick how you want speed-up to be enabled"
)
options << SliderOption.new(_INTL("Speed-up speed"), 1, 10, 1,
proc { $PokemonSystem.speedup_speed },
proc { |value|
$PokemonSystem.speedup_speed = value
}, "Sets by how much to speed up the game when holding the speed up button (Default: 3x)"
)
# if $game_switches && ($game_switches[SWITCH_NEW_GAME_PLUS] || $game_switches[SWITCH_BEAT_THE_LEAGUE]) #beat the league
# options << EnumOption.new(_INTL("Text Speed"), [_INTL("Normal"), _INTL("Fast"), _INTL("Instant")],
# proc { $PokemonSystem.textspeed },
# proc { |value|
# $PokemonSystem.textspeed = value
# MessageConfig.pbSetTextSpeed(MessageConfig.pbSettingToTextSpeed(value))
# }, "Sets the speed at which the text is displayed"
# )
# else
# options << EnumOption.new(_INTL("Text Speed"), [_INTL("Normal"), _INTL("Fast")],
# proc { $PokemonSystem.textspeed },
# proc { |value|
# $PokemonSystem.textspeed = value
# MessageConfig.pbSetTextSpeed(MessageConfig.pbSettingToTextSpeed(value))
# }, "Sets the speed at which the text is displayed"
# )
# end
options <<
EnumOption.new(_INTL("Download sprites"), [_INTL("On"), _INTL("Off")],
proc { $PokemonSystem.download_sprites },
proc { |value|
$PokemonSystem.download_sprites = value
},
"Automatically download custom sprites from the internet"
)
if $game_switches && ($game_switches[SWITCH_NEW_GAME_PLUS] || $game_switches[SWITCH_BEAT_THE_LEAGUE]) #beat the league
options <<
EnumOption.new(_INTL("Battle type"), [_INTL("1v1"), _INTL("2v2"), _INTL("3v3")],
proc { $PokemonSystem.battle_type },
proc { |value|
if value == 0
$game_variables[VAR_DEFAULT_BATTLE_TYPE] = [1, 1]
elsif value == 1
$game_variables[VAR_DEFAULT_BATTLE_TYPE] = [2, 2]
elsif value == 2
$game_variables[VAR_DEFAULT_BATTLE_TYPE] = [3, 3]
else
$game_variables[VAR_DEFAULT_BATTLE_TYPE] = [1, 1]
end
$PokemonSystem.battle_type = value
}, "Sets the number of Pokémon sent out in battles (when possible)"
)
end
options << EnumOption.new(_INTL("Battle Effects"), [_INTL("On"), _INTL("Off")],
proc { $PokemonSystem.battlescene },
proc { |value| $PokemonSystem.battlescene = value },
"Display move animations in battles"
)
options << EnumOption.new(_INTL("Battle Style"), [_INTL("Switch"), _INTL("Set")],
proc { $PokemonSystem.battlestyle },
proc { |value| $PokemonSystem.battlestyle = value },
["Prompts to switch Pokémon before the opponent sends out the next one",
"No prompt to switch Pokémon before the opponent sends the next one"]
)
options << NumberOption.new(_INTL("Speech Frame"), 1, Settings::SPEECH_WINDOWSKINS.length,
proc { $PokemonSystem.textskin },
proc { |value|
$PokemonSystem.textskin = value
MessageConfig.pbSetSpeechFrame("Graphics/Windowskins/" + Settings::SPEECH_WINDOWSKINS[value])
}
)
# NumberOption.new(_INTL("Menu Frame"),1,Settings::MENU_WINDOWSKINS.length,
# proc { $PokemonSystem.frame },
# proc { |value|
# $PokemonSystem.frame = value
# MessageConfig.pbSetSystemFrame("Graphics/Windowskins/" + Settings::MENU_WINDOWSKINS[value])
# }
# ),
options << EnumOption.new(_INTL("Text Entry"), [_INTL("Cursor"), _INTL("Keyboard")],
proc { $PokemonSystem.textinput },
proc { |value| $PokemonSystem.textinput = value },
["Enter text by selecting letters on the screen",
"Enter text by typing on the keyboard"]
)
if $game_variables
options << EnumOption.new(_INTL("Fusion icons"), [_INTL("Combined"), _INTL("DNA")],
proc { $game_variables[VAR_FUSION_ICON_STYLE] },
proc { |value| $game_variables[VAR_FUSION_ICON_STYLE] = value },
["Combines both Pokémon's party icons",
"Uses the same party icon for all fusions"]
)
end
options << EnumOption.new(_INTL("Screen Size"), [_INTL("S"), _INTL("M"), _INTL("L"), _INTL("XL"), _INTL("Full")],
proc { [$PokemonSystem.screensize, 4].min },
proc { |value|
if $PokemonSystem.screensize != value
$PokemonSystem.screensize = value
pbSetResizeFactor($PokemonSystem.screensize)
end
}, "Sets the size of the screen"
)
options << EnumOption.new(_INTL("Quick Surf"), [_INTL("Off"), _INTL("On")],
proc { $PokemonSystem.quicksurf },
proc { |value| $PokemonSystem.quicksurf = value },
"Start surfing automatically when interacting with water"
)
options << EnumOption.new(_INTL("Level caps"), [_INTL("Off"), _INTL("On")],
proc { $PokemonSystem.level_caps },
proc { |value| $PokemonSystem.level_caps = value },
"Prevents leveling above the next gym leader's highest leveled Pokemon"
)
return options
end

View File

@@ -79,6 +79,14 @@ class PokemonMartAdapter
def removeItem(item)
return $PokemonBag.pbDeleteItem(item)
end
def getBaseColorOverride(item)
return nil
end
def getShadowColorOverride(item)
return nil
end
end
#===============================================================================
@@ -97,6 +105,14 @@ class BuyAdapter
@adapter.getDisplayPrice(item, false)
end
def getBaseColorOverride(item)
return @adapter.getBaseColorOverride(item)
end
def getShadowColorOverride(item)
return @adapter.getShadowColorOverride(item)
end
def isSelling?
return false
end
@@ -125,6 +141,15 @@ class SellAdapter
def isSelling?
return true
end
def getBaseColorOverride(item)
return @adapter.getBaseColorOverride(item)
end
def getShadowColorOverride(item)
return @adapter.getShadowColorOverride(item)
end
end
#===============================================================================
@@ -158,11 +183,18 @@ class Window_PokemonMart < Window_DrawableCommand
else
item = @stock[index]
itemname = @adapter.getDisplayName(item)
baseColorOverride = @adapter.getBaseColorOverride(item)
shadowColorOverride = @adapter.getShadowColorOverride(item)
baseColor = baseColorOverride ? baseColorOverride : self.baseColor
shadowColor = shadowColorOverride ? shadowColorOverride : self.shadowColor
qty = @adapter.getDisplayPrice(item)
sizeQty = self.contents.text_size(qty).width
xQty = rect.x + rect.width - sizeQty - 2 - 16
textpos.push([itemname, rect.x, ypos - 4, false, self.baseColor, self.shadowColor])
textpos.push([qty, xQty, ypos - 4, false, self.baseColor, self.shadowColor])
textpos.push([itemname, rect.x, ypos - 4, false, baseColor, shadowColor])
textpos.push([qty, xQty, ypos - 4, false, baseColor, shadowColor])
end
pbDrawTextPositions(self.contents, textpos)
end
@@ -188,15 +220,23 @@ class PokemonMart_Scene
itemwindow = @sprites["itemwindow"]
@sprites["icon"].item = itemwindow.item
@sprites["itemtextwindow"].text =
(itemwindow.item) ? @adapter.getDescription(itemwindow.item) : _INTL("Quit shopping.")
(itemwindow.item) ? @adapter.getDescription(itemwindow.item) : _INTL("Quit shopping.")
itemwindow.refresh
end
@sprites["moneywindow"].text = _INTL("{2}:\r\n<r>{1}", @adapter.getMoneyString,@currency_name)
end
def scroll_map()
pbScrollMap(6, 5, 5)
end
def scroll_back_map()
pbScrollMap(4, 5, 5)
end
def pbStartBuyOrSellScene(buying, stock, adapter)
# Scroll right before showing screen
pbScrollMap(6, 5, 5)
scroll_map()
@viewport = Viewport.new(0, 0, Graphics.width, Graphics.height)
@viewport.z = 99999
@stock = stock
@@ -207,12 +247,12 @@ class PokemonMart_Scene
@sprites["icon"] = ItemIconSprite.new(36, Graphics.height - 50, nil, @viewport)
winAdapter = buying ? BuyAdapter.new(adapter) : SellAdapter.new(adapter)
@sprites["itemwindow"] = Window_PokemonMart.new(stock, winAdapter,
Graphics.width - 316 - 16, 12, 330 + 16, Graphics.height - 126)
Graphics.width - 316 - 16, 12, 330 + 16, Graphics.height - 126)
@sprites["itemwindow"].viewport = @viewport
@sprites["itemwindow"].index = 0
@sprites["itemwindow"].refresh
@sprites["itemtextwindow"] = Window_UnformattedTextPokemon.newWithSize("",
64, Graphics.height - 96 - 16, Graphics.width - 64, 128, @viewport)
64, Graphics.height - 96 - 16, Graphics.width - 64, 128, @viewport)
pbPrepareWindow(@sprites["itemtextwindow"])
@sprites["itemtextwindow"].baseColor = Color.new(248, 248, 248)
@sprites["itemtextwindow"].shadowColor = Color.new(0, 0, 0)
@@ -291,9 +331,10 @@ class PokemonMart_Scene
def pbEndBuyScene
pbDisposeSpriteHash(@sprites)
Kernel.pbClearText()
@viewport.dispose
# Scroll left after showing screen
pbScrollMap(4, 5, 5)
scroll_back_map()
end
def pbEndSellScene
@@ -418,64 +459,64 @@ class PokemonMart_Scene
itemprice /= 2 if !@buying
pbDisplay(helptext, true)
using(numwindow = Window_AdvancedTextPokemon.new("")) { # Showing number of items
qty = @adapter.getQuantity(item)
using(inbagwindow = Window_AdvancedTextPokemon.new("")) { # Showing quantity in bag
pbPrepareWindow(numwindow)
pbPrepareWindow(inbagwindow)
numwindow.viewport = @viewport
numwindow.width = 224
numwindow.height = 64
numwindow.baseColor = Color.new(88, 88, 80)
numwindow.shadowColor = Color.new(168, 184, 184)
inbagwindow.visible = @buying
inbagwindow.viewport = @viewport
inbagwindow.width = 190
inbagwindow.height = 64
inbagwindow.baseColor = Color.new(88, 88, 80)
inbagwindow.shadowColor = Color.new(168, 184, 184)
inbagwindow.text = _INTL("In Bag:<r>{1} ", qty)
qty = @adapter.getQuantity(item)
using(inbagwindow = Window_AdvancedTextPokemon.new("")) { # Showing quantity in bag
pbPrepareWindow(numwindow)
pbPrepareWindow(inbagwindow)
numwindow.viewport = @viewport
numwindow.width = 224
numwindow.height = 64
numwindow.baseColor = Color.new(88, 88, 80)
numwindow.shadowColor = Color.new(168, 184, 184)
inbagwindow.visible = @buying
inbagwindow.viewport = @viewport
inbagwindow.width = 190
inbagwindow.height = 64
inbagwindow.baseColor = Color.new(88, 88, 80)
inbagwindow.shadowColor = Color.new(168, 184, 184)
inbagwindow.text = _INTL("In Bag:<r>{1} ", qty)
numwindow.text = _INTL("x{1}<r>$ {2}", curnumber, (curnumber * itemprice).to_s_formatted)
pbBottomRight(numwindow)
numwindow.y -= helpwindow.height
pbBottomLeft(inbagwindow)
inbagwindow.y -= helpwindow.height
loop do
Graphics.update
Input.update
numwindow.update
inbagwindow.update
self.update
if Input.repeat?(Input::LEFT)
pbPlayCursorSE
curnumber -= 10
curnumber = 1 if curnumber < 1
numwindow.text = _INTL("x{1}<r>$ {2}", curnumber, (curnumber * itemprice).to_s_formatted)
pbBottomRight(numwindow)
numwindow.y -= helpwindow.height
pbBottomLeft(inbagwindow)
inbagwindow.y -= helpwindow.height
loop do
Graphics.update
Input.update
numwindow.update
inbagwindow.update
self.update
if Input.repeat?(Input::LEFT)
pbPlayCursorSE
curnumber -= 10
curnumber = 1 if curnumber < 1
numwindow.text = _INTL("x{1}<r>$ {2}", curnumber, (curnumber * itemprice).to_s_formatted)
elsif Input.repeat?(Input::RIGHT)
pbPlayCursorSE
curnumber += 10
curnumber = maximum if curnumber > maximum
numwindow.text = _INTL("x{1}<r>$ {2}", curnumber, (curnumber * itemprice).to_s_formatted)
elsif Input.repeat?(Input::UP)
pbPlayCursorSE
curnumber += 1
curnumber = 1 if curnumber > maximum
numwindow.text = _INTL("x{1}<r>$ {2}", curnumber, (curnumber * itemprice).to_s_formatted)
elsif Input.repeat?(Input::DOWN)
pbPlayCursorSE
curnumber -= 1
curnumber = maximum if curnumber < 1
numwindow.text = _INTL("x{1}<r>$ {2}", curnumber, (curnumber * itemprice).to_s_formatted)
elsif Input.trigger?(Input::USE)
pbPlayDecisionSE
ret = curnumber
break
elsif Input.trigger?(Input::BACK)
pbPlayCancelSE
ret = 0
break
end
end
}
elsif Input.repeat?(Input::RIGHT)
pbPlayCursorSE
curnumber += 10
curnumber = maximum if curnumber > maximum
numwindow.text = _INTL("x{1}<r>$ {2}", curnumber, (curnumber * itemprice).to_s_formatted)
elsif Input.repeat?(Input::UP)
pbPlayCursorSE
curnumber += 1
curnumber = 1 if curnumber > maximum
numwindow.text = _INTL("x{1}<r>$ {2}", curnumber, (curnumber * itemprice).to_s_formatted)
elsif Input.repeat?(Input::DOWN)
pbPlayCursorSE
curnumber -= 1
curnumber = maximum if curnumber < 1
numwindow.text = _INTL("x{1}<r>$ {2}", curnumber, (curnumber * itemprice).to_s_formatted)
elsif Input.trigger?(Input::USE)
pbPlayDecisionSE
ret = curnumber
break
elsif Input.trigger?(Input::BACK)
pbPlayCancelSE
ret = 0
break
end
end
}
}
helpwindow.visible = false
return ret
@@ -494,7 +535,7 @@ class PokemonMart_Scene
if itemwindow.item != olditem
@sprites["icon"].item = itemwindow.item
@sprites["itemtextwindow"].text =
(itemwindow.item) ? @adapter.getDescription(itemwindow.item) : _INTL("Quit shopping.")
(itemwindow.item) ? @adapter.getDescription(itemwindow.item) : _INTL("Quit shopping.")
end
if Input.trigger?(Input::BACK)
pbPlayCloseMenuSE
@@ -557,7 +598,7 @@ class PokemonMartScreen
end
if GameData::Item.get(item).is_important?
if !pbConfirm(_INTL("Certainly. You want {1}. That will be ${2}. OK?",
itemname,price.to_s_formatted))
itemname,price.to_s_formatted))
next
end
quantity=1
@@ -565,11 +606,11 @@ class PokemonMartScreen
maxafford = (price <= 0) ? Settings::BAG_MAX_PER_SLOT : @adapter.getMoney / price
maxafford = Settings::BAG_MAX_PER_SLOT if maxafford > Settings::BAG_MAX_PER_SLOT
quantity=@scene.pbChooseNumber(
_INTL("{1}? Certainly. How many would you like?",itemname),item,maxafford)
_INTL("{1}? Certainly. How many would you like?",itemname),item,maxafford)
next if quantity==0
price*=quantity
if !pbConfirm(_INTL("{1}, and you want {2}. That will be ${3}. OK?",
itemname,quantity,price.to_s_formatted))
itemname,quantity,price.to_s_formatted))
next
end
end
@@ -626,7 +667,7 @@ class PokemonMartScreen
@scene.pbShowMoney
if qty>1
qty=@scene.pbChooseNumber(
_INTL("{1}? How many would you like to sell?",itemname),item,qty)
_INTL("{1}? How many would you like to sell?",itemname),item,qty)
end
if qty==0
@scene.pbHideMoney
@@ -653,11 +694,11 @@ def replaceShopStockWithRandomized(stock)
newStock = []
for item in stock
newItem =$PokemonGlobal.randomItemsHash[item]
if newItem != nil && GameData::Item.get(newItem).price >0 && !Settings::EXCLUDE_FROM_RANDOM_SHOPS.include?(newItem)
newStock << newItem
else
newStock << item
end
if newItem != nil && GameData::Item.get(newItem).price >0 && !Settings::EXCLUDE_FROM_RANDOM_SHOPS.include?(newItem)
newStock << newItem
else
newStock << item
end
end
return newStock
end
@@ -685,8 +726,8 @@ def pbPokemonMart(stock,speech=nil,cantsell=false)
commands[cmdSell = commands.length] = _INTL("Sell") if !cantsell
commands[cmdQuit = commands.length] = _INTL("Quit")
cmd = pbMessage(
speech ? speech : _INTL("Welcome! How may I serve you?"),
commands,cmdQuit+1)
speech ? speech : _INTL("Welcome! How may I serve you?"),
commands,cmdQuit+1)
loop do
if cmdBuy>=0 && cmd==cmdBuy
scene = PokemonMart_Scene.new
@@ -701,7 +742,7 @@ def pbPokemonMart(stock,speech=nil,cantsell=false)
break
end
cmd = pbMessage(_INTL("Is there anything else I can help you with?"),
commands,cmdQuit+1)
commands,cmdQuit+1)
end
$game_temp.clear_mart_prices
end