Extra Gold XP & ACE
#1
Extra Gold XP

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! Grinning

There are no screenshots for this changes had never relied on any GUI at all. Winking

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. Grinning
Include me in your game credits! Laughing
That's all, folks! Winking
"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.

[Image: SP1-Scripter.png]
[Image: SP1-Writer.png]
[Image: SP1-Poet.png]
[Image: SP1-PixelArtist.png]
[Image: SP1-Reporter.png]

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! Laughing + Tongue sticking out

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
Reply }


Possibly Related Threads…
Thread Author Replies Views Last Post
   Kitsune's Extra Statistics DerVVulfman 10 21,890 07-21-2020, 03:45 AM
Last Post: DerVVulfman
   Extra ITEM for MOG Scene Item Laura DerVVulfman 0 5,177 06-29-2017, 03:44 AM
Last Post: DerVVulfman
   Extra Terrain Tags DerVVulfman 2 6,900 12-21-2014, 04:25 AM
Last Post: DerVVulfman
   Extra Autotiles DerVVulfman 0 4,663 04-13-2014, 04:07 AM
Last Post: DerVVulfman
   Yin's Extra Troops DerVVulfman 4 8,571 12-22-2011, 05:45 AM
Last Post: Yin



Users browsing this thread: 1 Guest(s)