Update 6.8

This commit is contained in:
chardub
2026-07-10 15:42:06 -04:00
parent 5b85e72cb2
commit 6a6f126a18
7871 changed files with 493194 additions and 224826 deletions
@@ -0,0 +1,149 @@
class Game_Temp
attr_accessor :choose_number_window
end
class ExpExtraction
attr_accessor :exp_to_extract
attr_accessor :nb_candies
attr_reader :valid_exp
attr_reader :max_value
attr_reader :full_price
BASE_PRICE = 1000
LOSS_PER_CANDY = 50
def initialize(pokemon, unit_price)
@pokemon = pokemon
@unit_price = unit_price
@exp_to_extract = 0
@nb_candies = (@exp_to_extract / 1000).floor
@full_price = BASE_PRICE + @unit_price * @nb_candies
@total_exp = pokemon.exp_gained_with_player
pokemon.exp_gained_with_player = 0 if !pokemon.exp_gained_with_player
@valid_exp = [pokemon.exp_gained_with_player,pokemon.exp].min
@max_value = @valid_exp / 1000.floor
update_text
end
def update(nb_candies)
return if nb_candies == @nb_candies
@nb_candies = nb_candies
@exp_to_extract = @nb_candies * 1000
@nb_candies = (@exp_to_extract / 1000).floor
@full_price = calculate_price
update_text
end
def calculate_price # todo: scale exponentially with bigger numbers
return BASE_PRICE + @unit_price * @nb_candies
end
def update_text
Kernel.pbClearNumber()
Kernel.pbClearText()
return if @max_value < 1
Kernel.pbDisplayText(_INTL("Exp to extract:"), 80, 100,)
Kernel.pbDisplayText("#{@exp_to_extract} / #{@valid_exp}", 120, 130,)
Kernel.pbDisplayText(_INTL("Price:"), 40, 170,)
Kernel.pbDisplayText("$#{@full_price}", 80, 200,)
end
def dispose
Kernel.pbClearText()
Kernel.pbClearNumber()
$game_temp.choose_number_window = nil
end
end
# nbCandiesVariable: variable in which to store the nb. of candies obtained.
# The event does a little animation before giving out the candies.
#
def extractExpFromPokemon(pokemon, unitPrice, nbCandiesVariable = 1)
expExtraction = ExpExtraction.new(pokemon, unitPrice)
if expExtraction.max_value < 1
pbCallBubDown(2, @event_id)
pbMessage(_INTL("Oh, I'm sorry, but this Pokémon does not have enough Exp. available for the procedure."))
pbCallBubDown(2, @event_id)
pbMessage(_INTL("Keep in mind that only the Exp. that was obtained with a Trainer can be safely extracted. Any Exp. it gained as a wild Pokémon is no good!"))
return false
end
update_proc = proc {
cmdwindow = $game_temp.choose_number_window
if cmdwindow
current_number = cmdwindow.number
expExtraction.update(current_number)
end
}
params = ChooseNumberParams.new
params.setRange(0, expExtraction.max_value)
params.setDefaultValue(1)
params.setCancelValue(0)
value = pbMessageChooseNumber(_INTL("\\GHow many \\C[1]Exp. Candies\\C[0] to extract?"), params, &update_proc)
new_exp = pokemon.exp - expExtraction.exp_to_extract
new_exp -= ExpExtraction::LOSS_PER_CANDY*expExtraction.nb_candies
new_exp -= expExtraction.nb_candies
new_exp = 0 if new_exp < 0
nb_candies = expExtraction.nb_candies
new_level = pokemon.calculate_level_at_exp(new_exp)
expExtraction.dispose
if expExtraction.nb_candies <= 0 || value <=0 #value:0 means that it was cancelled
return false
end
if $Trainer.money < expExtraction.full_price
pbCallBubDown(2, @event_id)
pbMessage(_INTL("Oh, I'm sorry, but you don't have enough money to afford the procedure. You might want to try a smaller extraction."))
return false
end
pbCallBubDown(2, @event_id)
if pbConfirmMessage(_INTL("Your {1} will go from \\C[1]Level {2}\\C[0] to \\C[1]Level {3}\\C[0] after all the Exp. Candies are extracted. Do you still want to continue?", pokemon.name, pokemon.level, new_level))
exp_to_extract = expExtraction.exp_to_extract + ExpExtraction::LOSS_PER_CANDY*expExtraction.nb_candies
removeExp(pokemon, exp_to_extract)
pbSet(nbCandiesVariable, nb_candies)
$Trainer.money -= expExtraction.full_price
else
return false
end
end
def removeExp(pokemon, exp_to_remove)
pokemon.exp_gained_with_player = 0 unless pokemon.exp_gained_with_player
pokemon.exp_gained_with_player -= exp_to_remove
pokemon.exp_gained_with_player = 0 if pokemon.exp_gained_with_player < 0
if pokemon.exp_gained_since_fused && pokemon.exp_gained_with_player > 0
pokemon.exp_gained_since_fused -= exp_to_remove
if pokemon.exp_gained_since_fused < 0
pokemon.exp_when_fused_head = 0 unless pokemon.exp_when_fused_head
pokemon.exp_when_fused_body = 0 unless pokemon.exp_when_fused_body
difference = pokemon.exp_gained_since_fused.abs
pokemon.exp_gained_since_fused = 0
pokemon.exp_when_fused_head -= difference / 2
pokemon.exp_when_fused_body -= difference / 2
pokemon.exp_when_fused_head = 0 if pokemon.exp_when_fused_head < 0
pokemon.exp_when_fused_body = 0 if pokemon.exp_when_fused_body < 0
end
pokemon.exp_gained_since_fused = 0 if pokemon.exp_gained_since_fused < 0
end
pokemon.exp -= exp_to_remove
pokemon.exp = 0 if pokemon.exp < 0
pokemon.calc_stats
end
@@ -110,7 +110,7 @@ CARD_BACKGROUND_UNLOCKABLES = {
"RUBY" => SWITCH_HOENN_HAIR_COLLECTION,
"SAPPHIRE" => SWITCH_HOENN_HAIR_COLLECTION,
"EMERALD" => SWITCH_HOENN_HAIR_COLLECTION,
"BARS_BOACH" => SWITCH_HOENN_HAIR_COLLECTION,
"BARS-BOACH" => SWITCH_HOENN_HAIR_COLLECTION,
"RIVALS" => SWITCH_HOENN_HAIR_COLLECTION,
@@ -179,7 +179,7 @@ end
def purchaseCardBackground(price = 1000)
$Trainer.unlocked_card_backgrounds = [] if ! $Trainer.unlocked_card_backgrounds
purchasable_cards = []
current_city = pbGet(VAR_CURRENT_MART)
current_city = pbGet(VAR_CURRENT_CITY)
current_city = :PEWTER if !current_city.is_a?(Symbol)
for card in CARD_BACKGROUND_CITY_EXCLUSIVES.keys
purchasable_cards << card if current_city == CARD_BACKGROUND_CITY_EXCLUSIVES[card] && !$Trainer.unlocked_card_backgrounds.include?(card)
@@ -219,7 +219,7 @@ def purchaseCardBackground(price = 1000)
pbSEPlay("Mart buy item")
$Trainer.money -= price
unlock_card_background(chosen)
pbSEPlay("Item get")
pbMEPlay("Item get")
pbMessage(_INTL("\\GYou purchased the {1} Trainer Card background!", name))
if pbConfirmMessage(_INTL("Would you like to swap your current Trainer Card for the newly purchased one?"))
pbSEPlay("GUI trainer card open")
@@ -305,4 +305,4 @@ class TrainerCardBackgroundLister
#sprite.ox = @sprite.bitmap.width/2 if @sprite.bitmap
#@sprite.oy = @sprite.bitmap.height/2 if @sprite
end
end
end
@@ -6,7 +6,7 @@ class PokemonStorage
commands = [cmd_play, cmd_info, cmd_cancel]
$Trainer.quest_points = initialize_quest_points unless $Trainer.quest_points
choice = pbMessage(_INTL("\\qpWould you like to play the Wallpaper Lottery? (Costs \\C[1]1 Quest point\\C[0])"),commands,2)
choice = pbMessage(_INTL("\\qpWould you like to play the Wallpaper Lottery? (Costs \\C[1]1 Quest point\\C[0])"), commands, 2)
case commands[choice]
when cmd_play
@@ -16,7 +16,7 @@ class PokemonStorage
end
locked_wallpapers = []
for i in BASICWALLPAPERQTY..allWallpapers.length-1
for i in BASICWALLPAPERQTY..allWallpapers.length - 1
locked_wallpapers << i unless isAvailableWallpaper?(i)
end
if locked_wallpapers.empty?
@@ -27,7 +27,6 @@ class PokemonStorage
unlocked_index = locked_wallpapers.sample
$Trainer.quest_points -= 1
$game_system.bgm_memorize
$game_system.bgm_stop
@@ -47,7 +46,7 @@ class PokemonStorage
wallpaper_name = allWallpapers[wallpaper_id]
pbUnlockWallpaper(wallpaper_id)
path = "Graphics/Pictures/Storage/Wallpapers/box_#{wallpaper_id}"
pictureViewport = showPicture(path, 50,-45)
pictureViewport = showPicture(path, 50, -45)
musical_effect = "Key item get"
pbMessage(_INTL("\\qp\\me[{1}]Obtained a new wallpaper: \\c[1]{2}\\c[0]!", musical_effect, wallpaper_name))
pictureViewport.dispose if pictureViewport
@@ -56,7 +55,12 @@ end
class WallpaperLotteryPC
def shouldShow?
return player_has_quest_journal?
if Settings::KANTO
return player_has_quest_journal?
end
if Settings::HOENN
return $game_switches[SWITCH_UNLOCKED_WALLPAPER_LOTTERY]
end
end
def name