09-12-2024, 03:53 AM
Extra Gold ACE
by Kyonides
by Kyonides
Introduction
Usually you could just change a method in the Game_Party class to set a permanent limit for the amount of gold the party can keep in its purse. This scriptlet pretends to override that by allowing you the game developer to change the Maximum Gold Limit in game at any given time.
It includes several script calls for your convenience so please read the instructions, namely the Script Calls section of my scriptlet. By the way, I forgot to mention that you can also set an initial maximum limit by modifying the value of the MAX_GOLD constant. It's the only constant there so you won't miss it!
There are no screenshots for this changes had never relied on any GUI at all.
Code:
# * Extra Gold XP & ACE
# Scripter : Kyonides Arkanthes
# 2021-09-09
=begin
*** Script Calls ***
- Check out how much Extra Gold the party has earned - They cannot spend it!
$game_party.extra_gold
- Reach Maximum Gold Limit
$game_party.extra_gold_to_purse
- Check out what is the current Maximum Gold Limit
$game_party.max_gold
- Change Maximum Gold Limit at Any Given Time In Game
$game_party.max_gold = NewLimit
- Has the Party's Purse reached the Maximum Gold Limit?
$game_party.gold_max?
=end
class Game_Party
MAX_GOLD = 9999
alias :kyon_extra_gold_gm_pty_init :initialize
def initialize
kyon_extra_gold_gm_pty_init
@max_gold = MAX_GOLD
@extra_gold = 0
end
def gain_gold(amount)
next_gold = [[@gold + amount, 0].max, max_gold].min
diff = @gold - next_gold
@extra_gold += diff if diff > 0
@gold = next_gold
end
def extra_gold_to_purse
diff = max_gold - @gold
@extra_gold -= diff
@gold = diff > 0 ? max_gold : @gold
end
def gold_max?() max_gold == @gold end
attr_reader :extra_gold
attr_accessor :max_gold
end
Terms & Conditions
Free for use anywhere.
Include me in your game credits!
That's all, folks!
"For God has not destined us for wrath, but for obtaining salvation through our Lord Jesus Christ," 1 Thessalonians 5:9
Maranatha!
The Internet might be either your friend or enemy. It just depends on whether or not she has a bad hair day.
My Original Stories (available in English and Spanish)
List of Compiled Binary Executables I have published...
HiddenChest & Roole
Give me a free copy of your completed game if you include at least 3 of my scripts!
Just some scripts I've already published on the board...
KyoGemBoost XP VX & ACE, RandomEnkounters XP, KSkillShop XP, Kolloseum States XP, KEvents XP, KScenario XP & Gosu, KyoPrizeShop XP Mangostan, Kuests XP, KyoDiscounts XP VX, ACE & MV, KChest XP VX & ACE 2016, KTelePort XP, KSkillMax XP & VX & ACE, Gem Roulette XP VX & VX Ace, KRespawnPoint XP, VX & VX Ace, GiveAway XP VX & ACE, Klearance XP VX & ACE, KUnits XP VX, ACE & Gosu 2017, KLevel XP, KRumors XP & ACE, KMonsterPals XP VX & ACE, KStatsRefill XP VX & ACE, KLotto XP VX & ACE, KItemDesc XP & VX, KPocket XP & VX, OpenChest XP VX & ACE
Maranatha!
The Internet might be either your friend or enemy. It just depends on whether or not she has a bad hair day.
My Original Stories (available in English and Spanish)
List of Compiled Binary Executables I have published...
HiddenChest & Roole
Give me a free copy of your completed game if you include at least 3 of my scripts!
Just some scripts I've already published on the board...
KyoGemBoost XP VX & ACE, RandomEnkounters XP, KSkillShop XP, Kolloseum States XP, KEvents XP, KScenario XP & Gosu, KyoPrizeShop XP Mangostan, Kuests XP, KyoDiscounts XP VX, ACE & MV, KChest XP VX & ACE 2016, KTelePort XP, KSkillMax XP & VX & ACE, Gem Roulette XP VX & VX Ace, KRespawnPoint XP, VX & VX Ace, GiveAway XP VX & ACE, Klearance XP VX & ACE, KUnits XP VX, ACE & Gosu 2017, KLevel XP, KRumors XP & ACE, KMonsterPals XP VX & ACE, KStatsRefill XP VX & ACE, KLotto XP VX & ACE, KItemDesc XP & VX, KPocket XP & VX, OpenChest XP VX & ACE