Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # Script Four Tiered Currency Script, version 0.1
- # Author: Bgillisp
- # Released: 9/29/2014
- # This script sets it up so that there are 4 currencies in the game
- # The currencies are currently Brozne, Copper, Silver, and Gold
- # with 100 Bronze = 1 Copper, 100 Copper = 1 Silver,
- # and 100 Silver = 1 Gold
- # This script auto-adjusts the display for the parties gold and
- # shops to show all values in the new currency. Whenever the party
- # has 100 of a currency, it auto-converts to the new currency. So
- # if you find 150 Bronze in a battle, the script will convert it
- # to 1 Copper, 50 Bronze in the display
- # To use, set all enemy drops and all item prices to their value
- # in bronze. For instance, if you want an item to cost 4 Silver,
- # set the price to 400 in the database. The script will do the rest.
- # Requires an adjust limits script if you want to have items
- # cost more than 999999 Bronze (99 Silver, 99 Copper, and 99 Bronze)
- # Early beta version, more features coming.
- # Pending features:
- # -Change the display after battles to show the new currency.
- # Currently, it will show the award in the currency set under the
- # system tab. Set the currenty to Bronze in the game for now,
- # and it will be functional, but more work is needed on this.
- # -Fix it so that an adjust limits script is not required.
- #----------------------------------------------------------------------------
- # Editable region
- #None, hardcoded for early testing. Will fix in another release.
- #End of Editable Region
- #--------------------------------------------------------------------------
- #Do not edit anything below here unless you know what you are doing.
- #Failure to ahead to this warning may result in unpredictable behavior in
- #your game. Consider yourself warned
- #__________________________________________________________________________
- class Game_Party < Game_Unit
- #Overwrite method, max_gold
- #Keep max gold at 999,999,999,999.
- def max_gold
- return 999999999999
- end
- end
- class Window_Base < Window
- #Overwrite method, draw currency value
- def draw_currency_value(value, unit, x, y, width)
- cx = text_size(unit).width
- change_color(normal_color)
- store = value
- tier1 = store % 100
- tier2 = (store / 100).to_i % 100
- tier3 = (store / 10000).to_i % 100
- tier4 = (store / 1000000).to_i
- text = sprintf("%2dG %2dS %2dC %2dB", tier4, tier3, tier2, tier1)
- draw_text(x, y, width, line_height, text, 2)
- end
- end
- class Window_ShopBuy < Window_Selectable
- #Overwrite method, draw_item
- def draw_item(index)
- item = @data[index]
- rect = item_rect(index)
- draw_item_name(item, rect.x, rect.y, enable?(item))
- rect.width -= 4
- store = price(item)
- tier1 = store % 100
- tier2 = (store / 100).to_i % 100
- tier3 = (store / 10000).to_i % 100
- tier4 = (store / 1000000).to_i
- text = ""
- if(tier4 != 0)
- text = sprintf("%2dG", tier4)
- end
- if(tier3 != 0)
- text += sprintf("% 2dS", tier3)
- end
- if(tier2 != 0)
- text += sprintf("% 2dC", tier2)
- end
- if(tier1 != 0)
- text += sprintf("% 2dB", tier1)
- end
- #Default if the item is free.
- if(text == "")
- text = "0B"
- end
- #Display the new text for currency
- draw_text(rect, text, 2)
- #draw_text(rect, price(item), 2)
- end
- end
RAW Paste Data