Version: 1
By: MephistoX
Introduction
This Script allow your party to has more Currencies Types, you can customize the Initial quantity of these, the max that you can carry, the Currency name and the Icon.
Features
- Easy to Use
- No more
Script
It's very very short, I didn't put a Header, of my name or instrucctiosn or Sintax, Because its innecesary.
Code:
#==============================================================================
# ** Game_Party => Meph's New Currencies
#==============================================================================
Â
class Game_Party
 #--------------------------------------------------------------------------
 # * Public Instance Variables
 #--------------------------------------------------------------------------
 attr_reader  :silver
 #--------------------------------------------------------------------------
 # * Alias Listing
 #--------------------------------------------------------------------------
 alias_method  :meph_curry_gprty_init,  :initialize
 #--------------------------------------------------------------------------
 # * Object Initialization
 #--------------------------------------------------------------------------
 def initialize
  meph_curry_gprty_init
  @silver = {'Name' => 'Plata', 'Value' => 0, 'Max' => 1000, 'Icon' => '001-Weapon01'}
 end
 #--------------------------------------------------------------------------
 # * Get Currency
 #--------------------------------------------------------------------------
 def gain(currency, n)
  # eval the string, this was made to get each defined currency
  s  = "@#{(c = currency.downcase)}['Value'] ="
  s += "[[@#{c}['Value'] + n, 0].max, @#{c}['Max']].min"
  eval(s)
 end
 #--------------------------------------------------------------------------
 # * Lose Currency
 #--------------------------------------------------------------------------
 def lose(currency, n)
  # use the gain method, in a reverse mode with a -integer
  gain(currency, -n)
 end
end
Instructions
To create your new currencies:
1. Create a Instance Variable, after my alias:
Example:
Code:
@currency = {'Name' => 'Name', 'Value' => 0, 'Max' => 1000, 'Icon' => '001-Weapon01'}
Â
'Currency' => Your currency Name
'Name' => In-Game Currency Name
'Value' => Initial Currency Quantity
'Max' => Max of the currency that party can carry
'Icon' => In-Game Icon (I didn't give a real use to this...use your brain :)
<span style="color:#996600;"
2. Public your Currency as a Instance Variable.
Code:
attr_reader  :yourcurrency_name
Remember that the Currency name, and this must be the same.
That's All, now if you want to gain X quantity of your new currency, use:
Code:
$game_party.gain('YourCurrencyName', quantity)
If you Want to show your currency in a window, use:
Code:
self.contents.draw_text(x, y, w, h, $game_party."currency"['Value'].to_s)
I explain in a Quick Form, for Advanced Users, If you need Help with this, I can give the trick
Compatibility
Work With everything......I guess..
Credits and Thanks
No credit Required, but you can't say that you made it!. :box:
Thats All!