TMC Tiny More Currencies
Dieses Script lässt euch mehr Währungen für euer Spiel einstellen und damit arbeiten.
Wechselt oder handelt damit, wie euch beliebt! Inkl. deutscher Demo!
Features:
- Erstellt eigene neue Währungen
- Bestimmt mit welchen Währungen Händler handeln
- Nutzt Wechselstuben und Tauschgeschäfte, um Währungen zu wechseln
- Macht Währungen bekannt/unbekannt im Laufe eures Spiels
Script:
- #╔═───────────────────────────────────────────────────────────────────────────═#
- #║ Tinys More Currencies (Mainscript)
- #║ By TinyMine
- #║
- #║ First Published/Erstveröffentlicht 12.04.2014
- #║
- #║ Visit : http://rpgmaker-vx-ace.de/ for further Information
- #║
- #║ Suggestions? Support? Bugs? Contact me in http://rpgmaker-vx-ace.de/
- #║
- #║ Credits required : TinyMine
- #║ Commercial Use? : Contact me in http://rpgmaker-vx-ace.de/
- #║ Editable? : Only by original editor TinyMine
- #║
- #║
- #║ Version : 1.2 // 04.09.2014
- #╚═───────────────────────────────────────────────────────────────────────────═#
- $imported ||= {}
- $imported[:TINY_TMC] = 1.2
- #╔═───────────────────────────────────────────────────────────────────────────═#
- #║ █ Inhalt
- #║
- #║ - Erweitert euer Spiel um mehr als nur eine Währung
- #║
- #╚═───────────────────────────────────────────────────────────────────────────═#
- #╔═───────────────────────────────────────────────────────────────────────────═#
- #║ █ Updates
- #║
- #║ ■ 1.2
- #║ - BUGFIX: Kein Absturz mehr beim umtauschen
- #║
- #║ ■ 1.1
- #║ - Malus Unterstützung für Tauschoperationen
- #║ - Neuer Befehl um Goldstand von nicht-aktiven Währungen zu überprüfen
- #║
- #║ ■ 1.01
- #║ - Bessere Unterstützung für Kommawerte der Währungen
- #║
- #║ ■ 1.0
- #║ - Erschienen
- #║
- #╚═───────────────────────────────────────────────────────────────────────────═#
- #╔═───────────────────────────────────────────────────────────────────────────═#
- #║ █ Addons
- #║
- #║ ■ TMC Menu 1.0
- #║ - Lässt das Goldfenster im Hauptmenü alle Goldarten anzeigen, sobald
- #║ sie bekannt sind.
- #║
- #║ ■ TMC Exchanger 1.0
- #║ - Erweitert euer Spiel um einen Geldwechsler, der Währungen in andere
- #║ umtauschen kann.
- #║
- #╚═───────────────────────────────────────────────────────────────────────────═#
- #╔═───────────────────────────────────────────────────────────────────────────═#
- #║ █ Verwendung im Spiel
- #║
- #║ folgende Scriptcommands werden verwendet
- #║
- #║ ■ Um einem Spieler Geld von einer fremden Währung zu geben:
- #║
- #║ change_gold(Menge, ID)
- #║
- #║ Der normale Goldbefehl, den der Maker liefert, gibt immer in die Währung
- #║ Gold, die derzeit mit dem nächsten Befehl aktiv ist...
- #║
- #║ ■ Um die Währung die derzeit beim Händler aktiv sein soll zu ändern:
- #║
- #║ change_currency(ID)
- #║
- #║ Ist eine Währung durch "change_currency(...)" gewählt arbeiten die
- #║ gewöhnlichen Befehle des RPG Makers VX ACE mit der aktuellen Währung.
- #║
- #║ ■ Um eine Währung manuell gegen eine andere zu tauschen:
- #║
- #║ exchange_gold(von ID, zu ID, Menge, Malus)
- #║
- #║ Wechsle eine Währung "von ID" zu einer anderen Währung "zu ID" und gib
- #║ an, wieviel "Menge" von der "von ID" Währung umgetauscht werden soll.
- #║ Der Malus wird in Prozent angegeben und ist optional: Wird keiner
- #║ angegeben, so wird die Menge zu einem 100% umgewandelt.
- #║
- #║ ■ Um zu überprüfen, ob eine Währung bereits im Spiel verwendet wurde:
- #║
- #║ currency_known?(ID)
- #║
- #║ Eine Währung wird automatisch dann bekannt, wenn sie entweder manuell
- #║ durch "change_currency(...)" aktiviert wurde oder durch
- #║ "change_gold(...)" oder "exchange_gold(...)"gegeben wurde.
- #║
- #║ ■ Um zu überprüfen, wieviel der Spieler von einer Währung besitzt,
- #║ die nicht durch "change_currency(...)" aktiv ist:
- #║
- #║ gold?(ID)
- #║
- #║ Ist die Währung noch nicht bekannt wird automatisch 0 zurück gegeben.
- #║
- #╚═───────────────────────────────────────────────────────────────────────────═#
- module TINY
- module TMC
- CURRENCIES = {
- #╔═───────────────────────────────────────────────────────────────────────────═#
- #║ █ Editierbare Region ** EINSTELLUNGEN ** Editierbare Reion █
- #╚═───────────────────────────────────────────────────────────────────────────═#
- # Erstelle hier nun deine eigenen Währungen :
- # Die "Wertigkeit" Angabe ist speziell. Jede Münze hat ihren eigenen
- # Wechselkurs. Ein Wechselkurs von 1 entspricht dem normalen Gold, welches
- # ohne dieses Script existieren würde. Ein Wechselkurs von 2 würde bedeuten,
- # das eine Münze mit dem Wert 2 so viel Wert ist, wie 2 Münzen vom Wert 1.
- # Auch die Itempreise werden so größer und kleiner; Je nachdem mit welcher
- # Währung der jeweilige Händler derzeit handelt.
- # Muster zur Währungserstellung :
- # ID => ["Name", "Abkürzung", Wertigkeit]
- :gold => ["Gold", "G", 2],
- :silber => ["Silber", "Sv", 1],
- :med => ["Medizin", "Md", 5],
- :klumpen => ["Klumpen", "Kl", 0.5]
- #═────────────────────────────────────────────────────────────────────────────═#
- } # Nicht anfassen
- #═────────────────────────────────────────────────────────────────────────────═#
- # Definiere die Währung die dem Spieler von Beginn an bekannt sein soll
- START_CURRENCY = :silber
- #╔═───────────────────────────────────────────────────────────────────────────═#
- #║ █ ** ENDE DER EINSTELLUNGSMÖGLICHKEITEN ** █
- #║ █ ** Die folgenden Zeilen betreffen das Script selbst ** █
- #╚═───────────────────────────────────────────────────────────────────────────═#
- end # TMC
- #═=═=═════════════════════════════════════════════════════════════════════════=#
- end # TINY
- #╔═=══════════════════════════════════════════════════════════════════════════=═
- #║ █ OLD Module Vocab
- #╚═=═=════════════════════════════════════════════════════════════════════════=═
- module Vocab
- #╔────────────────────────────────────────────────────────────────────────────
- #║ ■ Return Shortcut By Currency
- #╚────────────────────────────────────────────────────────────────────────────
- def self.currency_unit(currency = $game_party.currency)
- $game_party.currency_shortcut(currency)
- end
- end # Vocab
- #╔═=══════════════════════════════════════════════════════════════════════════=═
- #║ █ OLD Class Game_Interpreter
- #╚═=═=════════════════════════════════════════════════════════════════════════=═
- class Game_Interpreter
- #╔────────────────────────────────────────────────────────────────────────────
- #║ ■ Gets Gold Amount Of Type
- #╚────────────────────────────────────────────────────────────────────────────
- def gold?(type = $game_party.currency)
- return 0 unless currency_known?(type)
- $game_party.gold(type)
- end
- #╔────────────────────────────────────────────────────────────────────────────
- #║ ■ Adds/Removes Gold
- #╚────────────────────────────────────────────────────────────────────────────
- def change_gold(amount, type = $game_party.currency)
- $game_party.gain_gold(amount, type)
- end
- #╔────────────────────────────────────────────────────────────────────────────
- #║ ■ Changes Currency
- #╚────────────────────────────────────────────────────────────────────────────
- def change_currency(type)
- $game_party.currency = type
- end
- #╔────────────────────────────────────────────────────────────────────────────
- #║ ■ Exchange Currency
- #╚────────────────────────────────────────────────────────────────────────────
- def exchange_gold(from, to, from_amount, penalty = 100)
- $game_party.exchange(from, to, from_amount, penalty)
- end
- #╔────────────────────────────────────────────────────────────────────────────
- #║ ■ Is Currency Known?
- #╚────────────────────────────────────────────────────────────────────────────
- def currency_known?(type)
- $game_party.gold_hash.keys.include?(type)
- end
- end # Game_Interpreter
- #╔═=══════════════════════════════════════════════════════════════════════════=═
- #║ █ OLD Class Game_Party
- #╚═=═=════════════════════════════════════════════════════════════════════════=═
- class Game_Party
- #╔────────────────────────────────────────────────────────────────────────────
- #║ ■ Sets New Instances : @gold, @currency
- #╚────────────────────────────────────────────────────────────────────────────
- alias_method :initialize_tmc_23829 ,:initialize
- def initialize
- initialize_tmc_23829
- @gold = {}
- @currency = TINY::TMC::START_CURRENCY
- set_currency
- end
- #╔────────────────────────────────────────────────────────────────────────────
- #║ ■ Sets Currency In @gold Hash
- #╚────────────────────────────────────────────────────────────────────────────
- def set_currency(type = @currency, reset = false)
- return unless @gold[type].nil? || reset
- @gold[type] = 0
- end
- #╔────────────────────────────────────────────────────────────────────────────
- #║ ■ Empties A Value Of @gold Hash
- #╚────────────────────────────────────────────────────────────────────────────
- def clear_currency(type = @currency)
- @gold[type] = 0
- end
- #╔────────────────────────────────────────────────────────────────────────────
- #║ ■ Deletes A Key Of @gold Hash
- #╚────────────────────────────────────────────────────────────────────────────
- def delete_currency(type = @currency)
- @gold.delete(type)
- end
- #╔────────────────────────────────────────────────────────────────────────────
- #║ ■ New Argument For Old Method : type
- #╚────────────────────────────────────────────────────────────────────────────
- def gain_gold(amount, type = @currency)
- @gold[type].nil? ? base = 0 : base = @gold[type]
- @gold[type] = [[base + amount, 0].max, max_gold].min
- end
- #╔────────────────────────────────────────────────────────────────────────────
- #║ ■ New Argument For Old Method : type
- #╚────────────────────────────────────────────────────────────────────────────
- def lose_gold(amount, type = @currency)
- gain_gold(-amount, type)
- end
- #╔────────────────────────────────────────────────────────────────────────────
- #║ ■ New Argument For Old Method : type
- #╚────────────────────────────────────────────────────────────────────────────
- def gold(type = @currency)
- return @gold[type]
- end
- #╔────────────────────────────────────────────────────────────────────────────
- #║ ■ Gets @gold Hash instead of single value
- #╚────────────────────────────────────────────────────────────────────────────
- def gold_hash
- return @gold
- end
- #╔────────────────────────────────────────────────────────────────────────────
- #║ ■ Sets @currency By Type; Return Default If Type Is Not Existent
- #╚────────────────────────────────────────────────────────────────────────────
- def currency=(type)
- @currency = type
- set_currency
- end
- #╔────────────────────────────────────────────────────────────────────────────
- #║ ■ Gets @currency
- #╚────────────────────────────────────────────────────────────────────────────
- def currency
- return @currency
- end
- #╔────────────────────────────────────────────────────────────────────────────
- #║ ■ Ask If Player Has Enough Money
- #╚────────────────────────────────────────────────────────────────────────────
- def exchangeable?(type, amount)
- @gold[type] >= amount
- end
- #╔────────────────────────────────────────────────────────────────────────────
- #║ ■ Gets Currency Name
- #╚────────────────────────────────────────────────────────────────────────────
- def currency_name(currency)
- TINY::TMC::CURRENCIES[currency][0]
- end
- #╔────────────────────────────────────────────────────────────────────────────
- #║ ■ Gets Currency Shortcut
- #╚────────────────────────────────────────────────────────────────────────────
- def currency_shortcut(currency)
- TINY::TMC::CURRENCIES[currency][1]
- end
- #╔────────────────────────────────────────────────────────────────────────────
- #║ ■ Gets Currency Value
- #╚────────────────────────────────────────────────────────────────────────────
- def currency_value(currency)
- TINY::TMC::CURRENCIES[currency][2]
- end
- #╔────────────────────────────────────────────────────────────────────────────
- #║ ■ Gets Exchange Result
- #╚────────────────────────────────────────────────────────────────────────────
- def exchange_result(player, other, amount, penalty = 100)
- return currency_value(player) * amount if player == other
- result = ((currency_value(player) * amount) / currency_value(other) * (penalty/100.0)).to_i
- result
- end
- #╔────────────────────────────────────────────────────────────────────────────
- #║ ■ Exchanging A Currency To Another
- #╚────────────────────────────────────────────────────────────────────────────
- def exchange(player, other, amount, penalty = 100)
- return unless exchangeable?(player, amount)
- set_currency(player)
- set_currency(other)
- @gold[player] -= amount
- @gold[other] += exchange_result(player, other, amount, penalty)
- end
- end # Game_Party
- #╔═=══════════════════════════════════════════════════════════════════════════=═
- #║ █ OLD Class RPG::Enemy
- #╚═=═=════════════════════════════════════════════════════════════════════════=═
- class RPG::Enemy
- #╔────────────────────────────────────────────────────────────────────────────
- #║ ■ Multiply Bounty By Current Currency
- #╚────────────────────────────────────────────────────────────────────────────
- def gold
- (@gold / $game_party.currency_value($game_party.currency)).to_i
- end
- end # RPG::Enemy
- #╔═=══════════════════════════════════════════════════════════════════════════=═
- #║ █ OLD Class RPG::Item
- #╚═=═=════════════════════════════════════════════════════════════════════════=═
- class RPG::Item
- #╔────────────────────────────────────────────────────────────────────────────
- #║ ■ Multiply Price By Current Currency
- #╚────────────────────────────────────────────────────────────────────────────
- def price
- (@price / $game_party.currency_value($game_party.currency)).to_i
- end
- end # RPG::Item
- #╔═=══════════════════════════════════════════════════════════════════════════=═
- #║ █ OLD Class RPG::EquipItem
- #╚═=═=════════════════════════════════════════════════════════════════════════=═
- class RPG::EquipItem
- #╔────────────────────────────────────────────────────────────────────────────
- #║ ■ Multiply Price By Current Currency
- #╚────────────────────────────────────────────────────────────────────────────
- def price
- (@price / $game_party.currency_value($game_party.currency)).to_i
- end
- end # RPG::EquipItem
- #╔═───────────────────────────────────────────────────────────────────────────═╗
- #╠══════════════════════════════▲ END OF SCRIPT ▲══════════════════════════════╣
- #╚═───────────────────────────────────────────────────────────────────────────═╝
AddOns:
Inhalt:
- Erweitert das TMC Script, um einen Währungshändler, der bestimmte Währungen
in die vom Spieler bekannten Währungen tauschen kann.
- #╔═───────────────────────────────────────────────────────────────────────────═#
- #║ TMC Exchanger
- #║ By TinyMine
- #║
- #║ First Published/Erstveröffentlicht 12.04.2014
- #║
- #║ Visit : http://rpgmaker-vx-ace.de/ for further Information
- #║
- #║ Suggestions? Support? Bugs? Contact me in http://rpgmaker-vx-ace.de/
- #║
- #║ Credits required : TinyMine
- #║ Commercial Use? : Contact me in http://rpgmaker-vx-ace.de/
- #║ Editable? : Only by original editor TinyMine
- #║
- #║
- #║ Version : 1.2 // 04.09.2014
- #╚═───────────────────────────────────────────────────────────────────────────═#
- #╔═───────────────────────────────────────────────────────────────────────────═#
- #║ █ Inhalt
- #║
- #║ - Erweitert das TMC Script, um einen Währungshändler, der bestimmte Währungen
- #║ in die vom Spieler bekannten Währungen tauschen kann.
- #║
- #╚═───────────────────────────────────────────────────────────────────────────═#
- #╔═───────────────────────────────────────────────────────────────────────────═#
- #║ █ Updates
- #║
- #║ ■ 1.2
- #║ - Währungen, die der Spieler nicht kennt, werden nicht mehr angezeigt,
- #║ wenn sich die Exchange Scene öffnet
- #║
- #║ ■ 1.1
- #║ - Ein Malus ist nun für eine Wechselstube einzustellen
- #║ - Der Wechselkurs für eine Währung in eine andere wird beim Tausch nun
- #║ vor Abschluss in einem Fenster eingeblendet
- #║
- #║ ■ 1.01
- #║ - Versionssupport ergänzt
- #║
- #║ ■ 1.0
- #║ - Erschienen
- #║
- #╚═───────────────────────────────────────────────────────────────────────────═#
- #╔═───────────────────────────────────────────────────────────────────────────═#
- #║ █ Verwendung im Spiel
- #║
- #║ folgende Scriptcommands werden verwendet
- #║
- #║ ■ Um die die Wechselstube zu öffnen:
- #║
- #║ open_exchange(IDs, Malus)
- #║
- #║ Der Wechselhändler tauscht dabei nur IDs, die durch IDs eingegeben wurden.
- #║ Der Malus ist optional. Und wird als Zahl in Prozent angegeben.
- #║ z.B.: open_exchange(:gold, :silber, 50)
- #║ Würde bedeuten, dass der Händler nur Silber und Gold zum Wechsel anbietet.
- #║ Außerdem würde er all seine Währungen nur zu 50% ihres normalen Wertes
- #║ wechseln.
- #║
- #╚═───────────────────────────────────────────────────────────────────────────═#
- if $imported[:TINY_TMC] >= 1.2
- $imported[:TINY_TMC_Exch] = 1.2
- module TINY
- module TMC
- #╔═───────────────────────────────────────────────────────────────────────────═#
- #║ █ Editierbare Region ** EINSTELLUNGEN ** Editierbare Reion █
- #╚═───────────────────────────────────────────────────────────────────────────═#
- # Ändere hier das Vokabular für die einzelnen Fenster
- # ■ Spieler Liste
- VOCAB_PLAYER = "Welche Währung möchtest du wechseln?"
- # ■ Anzahl Fenster
- VOCAB_AMOUNT = "Menge?"
- VOCAB_NUMBER = "Wieviel möchtest du tauschen?"
- # ■ Händler Liste
- VOCAB_EXCHANGE = "Gegen welche Währung möchtest du tauschen?"
- # ■ Abschluss Fenster
- VOCAB_QUESTION = "Möchtest du Handeln?"
- VOCAB_TO = "in"
- VOCAB_TRADE = "umtauschen?"
- # ■ Kurs Fenster
- VOCAB_RATE = "Kurs"
- #╔═───────────────────────────────────────────────────────────────────────────═#
- #║ █ ** ENDE DER EINSTELLUNGSMÖGLICHKEITEN ** █
- #║ █ ** Die folgenden Zeilen betreffen das Script selbst ** █
- #╚═───────────────────────────────────────────────────────────────────────────═#
- end # TMC
- end # TINY
- #╔═=══════════════════════════════════════════════════════════════════════════=═
- #║ █ OLD Module SceneManager
- #╚═=═=════════════════════════════════════════════════════════════════════════=═
- module SceneManager
- #╔────────────────────────────────────────────────────────────────────────────
- #║ ■ Call A Scene With Arguments
- #╚────────────────────────────────────────────────────────────────────────────
- def self.call_args(scene_class, *args)
- @stack.push(@scene)
- @scene = scene_class.new(*args)
- end
- end # SceneManager
- #╔═=══════════════════════════════════════════════════════════════════════════=═
- #║ █ OLD Class Game_Interpreter
- #╚═=═=════════════════════════════════════════════════════════════════════════=═
- class Game_Interpreter
- #╔────────────────────────────────────────────────────────────────────────────
- #║ ■ Open Scene_Exchange
- #╚────────────────────────────────────────────────────────────────────────────
- def open_exchange(*currencies)
- SceneManager.call_args(Scene_Exchange, *currencies)
- end
- end # Game_Interpreter
- #╔═=══════════════════════════════════════════════════════════════════════════=═
- #║ █ NEW Class Window_More_Gold_Selectable
- #╚═=═=════════════════════════════════════════════════════════════════════════=═
- class Window_More_Gold_Selectable < Window_Selectable
- #╔────────────────────────────────────────────────────────────────────────────
- #║ ■ Initializing Window
- #╚────────────────────────────────────────────────────────────────────────────
- def initialize(currencies, version = :player)
- @currencies = currencies
- @version = version
- super(0, 0, window_width, fitting_height(currencies.size))
- refresh
- end
- #╔────────────────────────────────────────────────────────────────────────────
- #║ ■ Get Width
- #╚────────────────────────────────────────────────────────────────────────────
- def window_width
- return 160
- end
- #╔────────────────────────────────────────────────────────────────────────────
- #║ ■ Get Selectable Items
- #╚────────────────────────────────────────────────────────────────────────────
- def item_max
- return @currencies.size
- end
- #╔────────────────────────────────────────────────────────────────────────────
- #║ ■ Get Key Of Contents By Index
- #╚────────────────────────────────────────────────────────────────────────────
- def content_index
- return @currencies[@index]
- end
- #╔────────────────────────────────────────────────────────────────────────────
- #║ ■ Refresh Contents
- #╚────────────────────────────────────────────────────────────────────────────
- def refresh
- contents.clear
- i = 0
- @currencies.each { |cur|
- next if TINY::TMC::CURRENCIES[cur].nil?
- info = TINY::TMC::CURRENCIES[cur]
- part = @version == :player ? $game_party.gold(cur) : info[0]
- draw_currency_value(part, " #{info[1]}", 4, 24 * i, contents.width - 8)
- i += 1
- }
- end
- #╔────────────────────────────────────────────────────────────────────────────
- #║ ■ Open Window
- #╚────────────────────────────────────────────────────────────────────────────
- def open
- refresh
- super
- end
- end # Window_More_Gold_Selectable
- #╔═=══════════════════════════════════════════════════════════════════════════=═
- #║ █ NEW Class Window_Gold_Number
- #╚═=═=════════════════════════════════════════════════════════════════════════=═
- class Window_Gold_Number < Window_Selectable
- #╔────────────────────────────────────────────────────────────────────────────
- #║ ■ Initializes Window
- #╚────────────────────────────────────────────────────────────────────────────
- def initialize(x, y)
- super(x, y, window_width, fitting_height(2))
- @number = 0
- @index = 1
- end
- #╔────────────────────────────────────────────────────────────────────────────
- #║ ■ Gets Width
- #╚────────────────────────────────────────────────────────────────────────────
- def window_width
- return 224
- end
- #╔────────────────────────────────────────────────────────────────────────────
- #║ ■ Gets Selectable Items
- #╚────────────────────────────────────────────────────────────────────────────
- def item_max
- return 1
- end
- #╔────────────────────────────────────────────────────────────────────────────
- #║ ■ Sets Used Items
- #╚────────────────────────────────────────────────────────────────────────────
- def set_item(cur)
- @item = cur
- @number = 0
- refresh
- end
- #╔────────────────────────────────────────────────────────────────────────────
- #║ ■ Gets Chosen Amount
- #╚────────────────────────────────────────────────────────────────────────────
- def number
- return @number
- end
- #╔────────────────────────────────────────────────────────────────────────────
- #║ ■ Gets Modulator
- #╚────────────────────────────────────────────────────────────────────────────
- def max_exchange
- $game_party.gold(@item) + 1
- end
- #╔────────────────────────────────────────────────────────────────────────────
- #║ ■ Handle Movement
- #╚────────────────────────────────────────────────────────────────────────────
- def process_cursor_move
- return unless active
- if Input.repeat?(:UP) || Input.repeat?(:DOWN) || Input.repeat?(:RIGHT) || Input.repeat?(:LEFT)
- return if @item_max == 0
- @number = (@number + 1) % max_exchange if Input.repeat?(:UP)
- @number = (@number - 1) % max_exchange if Input.repeat?(:DOWN)
- @number = (@number + 10) % max_exchange if Input.repeat?(:RIGHT)
- @number = (@number - 10) % max_exchange if Input.repeat?(:LEFT)
- refresh
- end
- end
- #╔────────────────────────────────────────────────────────────────────────────
- #║ ■ Refresh Content
- #╚────────────────────────────────────────────────────────────────────────────
- def refresh
- contents.clear
- draw_text(0, 0, contents_width, contents_height/2, TINY::TMC::VOCAB_AMOUNT, 1)
- draw_text(0, contents_height/2, contents_width, contents_height/2, "#{@number}", 1)
- end
- end # Window_Gold_Number
- #╔═=══════════════════════════════════════════════════════════════════════════=═
- #║ █ NEW Class Window_Conclude
- #╚═=═=════════════════════════════════════════════════════════════════════════=═
- class Window_Conclude < Window_Selectable
- #╔────────────────────────────────────────────────────────────────────────────
- #║ ■ Initializes Window
- #╚────────────────────────────────────────────────────────────────────────────
- def initialize(x, y, w)
- super(x, y, w, fitting_height(5))
- end
- #╔────────────────────────────────────────────────────────────────────────────
- #║ ■ Sets Used Items
- #╚────────────────────────────────────────────────────────────────────────────
- def set_item(from, to, amount, penalty)
- @from = from
- @to = to
- @amount = amount
- @penalty = penalty
- refresh
- end
- #╔────────────────────────────────────────────────────────────────────────────
- #║ ■ Refreshes Conclude Window
- #╚────────────────────────────────────────────────────────────────────────────
- def refresh
- contents.clear
- text = TINY::TMC::VOCAB_QUESTION
- draw_text(0, 0, contents.width, 24, text, 1)
- calc = "#{@amount} #{$game_party.currency_name(@from)}"
- contents.font.color = system_color
- draw_text(0, 24, contents.width, 24, calc, 1)
- contents.font.color = normal_color
- calc = TINY::TMC::VOCAB_TO
- draw_text(0, 48, contents.width, 24, calc, 1)
- calc = "#{exchange_result} #{$game_party.currency_name(@to)}"
- contents.font.color = system_color
- draw_text(0, 72, contents.width, 24, calc, 1)
- contents.font.color = normal_color
- calc = TINY::TMC::VOCAB_TRADE
- draw_text(0, 96, contents.width, 24, calc, 1)
- end
- #╔────────────────────────────────────────────────────────────────────────────
- #║ ■ Get Exchange Result
- #╚────────────────────────────────────────────────────────────────────────────
- def exchange_result
- $game_party.exchange_result(@from, @to, @amount, @penalty)
- end
- end # Window_Conclude
- #╔═=══════════════════════════════════════════════════════════════════════════=═
- #║ █ NEW Class Scene_Exchange
- #╚═=═=════════════════════════════════════════════════════════════════════════=═
- class Scene_Exchange < Scene_MenuBase
- #╔────────────────────────────────────────────────────────────────────────────
- #║ ■ Initializes Scene
- #╚────────────────────────────────────────────────────────────────────────────
- def initialize(*args)
- @currencies = *args
- @penalty = 100
- set_vendor_properties
- end
- #╔────────────────────────────────────────────────────────────────────────────
- #║ ■ Sets the config as traded currencies or penalty of the vendor
- #╚────────────────────────────────────────────────────────────────────────────
- def set_vendor_properties
- @currencies.sort.each { |e|
- set_penalty(amount) if e.is_a?(Integer)
- @currencies.delete(e) if e.is_a?(Symbol) && !$game_party.gold_hash.keys.include?(e)
- }
- end
- #╔────────────────────────────────────────────────────────────────────────────
- #║ ■ Stes penalty if given in *args to scene
- #╚────────────────────────────────────────────────────────────────────────────
- def set_penalty(amount)
- @penalty = e
- @currencies.delete(e)
- end
- #╔────────────────────────────────────────────────────────────────────────────
- #║ ■ Starts Scene
- #╚────────────────────────────────────────────────────────────────────────────
- def start
- super
- create_windows
- create_handler
- select_window
- end
- #╔────────────────────────────────────────────────────────────────────────────
- #║ ■ Create All Windows
- #╚────────────────────────────────────────────────────────────────────────────
- def create_windows
- @player_window = Window_More_Gold_Selectable.new($game_party.gold_hash.keys)
- @player_window.x = 0
- @player_window.y = 0
- #--
- @exchanger_window = Window_More_Gold_Selectable.new(@currencies, :other)
- @exchanger_window.x = Graphics.width - @exchanger_window.width
- @exchanger_window.y = 0
- #--
- @number_window = Window_Gold_Number.new(160, 0)
- @number_window.hide
- @number_window.close
- #--
- @text_window = Window_Base.new(0, Graphics.height-72, Graphics.width, 72)
- refresh_text_window(TINY::TMC::VOCAB_PLAYER)
- #--
- @rate_window = Window_Base.new(160, 72, 224, 48)
- @rate_window.hide
- @rate_window.close
- #--
- @conclude_window = Window_Conclude.new(160, 120, 224)
- @conclude_window.hide
- @conclude_window.close
- end
- #╔────────────────────────────────────────────────────────────────────────────
- #║ ■ Set All Window Handler
- #╚────────────────────────────────────────────────────────────────────────────
- def create_handler
- @player_window.set_handler(:ok, method(:activate_number))
- @exchanger_window.set_handler(:ok, method(:activate_conclude))
- @number_window.set_handler(:ok, method(:activate_exchange))
- @conclude_window.set_handler(:ok, method(:exchange))
- @player_window.set_handler(:cancel, method(:return_scene))
- @exchanger_window.set_handler(:cancel,method(:activate_number))
- @number_window.set_handler(:cancel, method(:activate_player))
- @conclude_window.set_handler(:cancel, method(:activate_exchange))
- end
- #╔────────────────────────────────────────────────────────────────────────────
- #║ ■ Refreshes Text Window
- #╚────────────────────────────────────────────────────────────────────────────
- def refresh_text_window(text)
- @text_window.contents.clear
- @text_window.draw_text_ex(0, 0, text)
- end
- #╔────────────────────────────────────────────────────────────────────────────
- #║ ■ Refreshes Rate Window
- #╚────────────────────────────────────────────────────────────────────────────
- def refresh_rate_window
- @rate_window.contents.clear
- from = @player_window.content_index
- to = @exchanger_window.content_index
- @rate_window.draw_text_ex(0, 0, get_rate_text(from, to))
- end
- #╔────────────────────────────────────────────────────────────────────────────
- #║ ■ Gets Exchange Rate In A String
- #╚────────────────────────────────────────────────────────────────────────────
- def get_rate_text(from, to)
- from == to ? pen = 1 : pen = penalty
- "#{TINY::TMC::VOCAB_RATE}:\\C[16] #{(exchange_value(to) * 100).to_i} #{$game_party.currency_shortcut(from)} \\C[0]-\\C[16] #{(exchange_value(from) * pen * 100).to_i} #{$game_party.currency_shortcut(to)}"
- end
- #╔────────────────────────────────────────────────────────────────────────────
- #║ ■ Gets Penalty For Calculation
- #╚────────────────────────────────────────────────────────────────────────────
- def penalty
- @penalty/100.0
- end
- #╔────────────────────────────────────────────────────────────────────────────
- #║ ■ Gets Currency Value
- #╚────────────────────────────────────────────────────────────────────────────
- def exchange_value(currency)
- $game_party.currency_value(currency)
- end
- #╔────────────────────────────────────────────────────────────────────────────
- #║ ■ Select At Start
- #╚────────────────────────────────────────────────────────────────────────────
- def select_window
- @player_window.activate
- @player_window.select(0)
- end
- #╔────────────────────────────────────────────────────────────────────────────
- #║ ■ Activate Player List
- #╚────────────────────────────────────────────────────────────────────────────
- def activate_player
- refresh_text_window(TINY::TMC::VOCAB_PLAYER)
- @number_window.close
- @exchanger_window.unselect
- @player_window.activate
- end
- #╔────────────────────────────────────────────────────────────────────────────
- #║ ■ Activate Exchange List
- #╚────────────────────────────────────────────────────────────────────────────
- def activate_exchange
- refresh_text_window(TINY::TMC::VOCAB_EXCHANGE)
- @conclude_window.close
- @rate_window.close
- @exchanger_window.activate
- @exchanger_window.select(0)
- end
- #╔────────────────────────────────────────────────────────────────────────────
- #║ ■ Activate Conclude Window
- #╚────────────────────────────────────────────────────────────────────────────
- def activate_conclude
- @conclude_window.set_item(@player_window.content_index, @exchanger_window.content_index,
- @number_window.number, @penalty)
- refresh_rate_window
- @rate_window.show
- @rate_window.open
- @conclude_window.refresh
- @conclude_window.show
- @conclude_window.open
- @conclude_window.activate
- end
- #╔────────────────────────────────────────────────────────────────────────────
- #║ ■ Activate Number Window
- #╚────────────────────────────────────────────────────────────────────────────
- def activate_number
- refresh_text_window(TINY::TMC::VOCAB_NUMBER)
- @exchanger_window.unselect
- @number_window.set_item(@player_window.content_index)
- @number_window.show
- @number_window.open
- @number_window.activate
- end
- #╔────────────────────────────────────────────────────────────────────────────
- #║ ■ Exchange Chosen Values
- #╚────────────────────────────────────────────────────────────────────────────
- def exchange
- $game_party.exchange(@player_window.content_index, @exchanger_window.content_index,
- @number_window.number, @penalty)
- @player_window.refresh
- @conclude_window.close
- @rate_window.close
- activate_player
- end
- end # Scene_Exchange
- else
- msgbox_p("TMC Menu will not run without TMC Mainscript 1.2 or higher")
- end
- #╔═───────────────────────────────────────────────────────────────────────────═╗
- #╠══════════════════════════════▲ END OF SCRIPT ▲══════════════════════════════╣
- #╚═───────────────────────────────────────────────────────────────────────────═╝
Inhalt:
- Erweitert das TMC Script, damit alle bekannten Währungen bereits im
gewohnten Goldfenster im Hauptmenü angezeigt werden.
- #╔═───────────────────────────────────────────────────────────────────────────═#
- #║ TMC Menu
- #║ By TinyMine
- #║
- #║ First Published/Erstveröffentlicht 12.04.2014
- #║
- #║ Visit : http://rpgmaker-vx-ace.de/ for further Information
- #║
- #║ Suggestions? Support? Bugs? Contact me in http://rpgmaker-vx-ace.de/
- #║
- #║ Credits required : TinyMine
- #║ Commercial Use? : Contact me in http://rpgmaker-vx-ace.de/
- #║ Editable? : Only by original editor TinyMine
- #║
- #║
- #║ Version : 1.01 // 12.04.2014
- #╚═───────────────────────────────────────────────────────────────────────────═#
- #╔═───────────────────────────────────────────────────────────────────────────═#
- #║ █ Inhalt
- #║
- #║ - Erweitert das TMC Script, damit alle bekannten Währungen bereits im
- #║ gewohnten Goldfenster im Hauptmenü angezeigt werden.
- #║
- #╚═───────────────────────────────────────────────────────────────────────────═#
- #╔═───────────────────────────────────────────────────────────────────────────═#
- #║ █ Updates
- #║
- #║ ■ 1.01
- #║ - Versionssupport ergänzt
- #║
- #║ ■ 1.0
- #║ - Erschienen
- #║
- #╚═───────────────────────────────────────────────────────────────────────────═#
- if $imported[:TINY_TMC] >= 1.0
- $imported[:TINY_TMC_Menu] = 1.01
- #╔═=══════════════════════════════════════════════════════════════════════════=═
- #║ █ NEW Class Window_More_Gold
- #╚═=═=════════════════════════════════════════════════════════════════════════=═
- class Window_More_Gold < Window_Base
- #╔────────────────────────────────────────────────────────────────────────────
- #║ ■ Initializing Window
- #╚────────────────────────────────────────────────────────────────────────────
- def initialize
- super(0, 0, window_width, fitting_height($game_party.gold_hash.keys.size))
- refresh
- end
- #╔────────────────────────────────────────────────────────────────────────────
- #║ ■ Get Width
- #╚────────────────────────────────────────────────────────────────────────────
- def window_width
- return 160
- end
- #╔────────────────────────────────────────────────────────────────────────────
- #║ ■ Refresh Contents
- #╚────────────────────────────────────────────────────────────────────────────
- def refresh
- contents.clear
- i = 0
- $game_party.gold_hash.each { |key, val|
- info = TINY::TMC::CURRENCIES[key]
- draw_currency_value(val, info[1], 4, 24 * i, contents.width - 8)
- i += 1
- }
- end
- #╔────────────────────────────────────────────────────────────────────────────
- #║ ■ Open Window
- #╚────────────────────────────────────────────────────────────────────────────
- def open
- refresh
- super
- end
- end # Window_More_Gold
- #╔═=══════════════════════════════════════════════════════════════════════════=═
- #║ █ OLD Class Scene_Menu
- #╚═=═=════════════════════════════════════════════════════════════════════════=═
- class Scene_Menu
- #╔────────────────────────────────────────────────────────────────────────────
- #║ ■ New Gold Window
- #╚────────────────────────────────────────────────────────────────────────────
- def create_gold_window
- @gold_window = Window_More_Gold.new
- @gold_window.x = 0
- @gold_window.y = Graphics.height - @gold_window.height
- end
- end # Scene_Menu
- else
- msgbox_p("TMC Menu will not run without TMC Mainscript 1.0 or higher")
- end
- #╔═───────────────────────────────────────────────────────────────────────────═╗
- #╠══════════════════════════════▲ END OF SCRIPT ▲══════════════════════════════╣
- #╚═───────────────────────────────────────────────────────────────────────────═╝
Inhalt:
- Erweitert das TMC Script und seine Addons um weitere
Einstellungsmöglichkeiten, wie Icons und deren Darstellung.
- #╔═───────────────────────────────────────────────────────────────────────────═#
- #║ TMC Enhance
- #║ By TinyMine
- #║
- #║ First Published/Erstveröffentlicht 12.04.2014
- #║
- #║ Visit : http://rpgmaker-vx-ace.de/ for further Information
- #║
- #║ Suggestions? Support? Bugs? Contact me in http://rpgmaker-vx-ace.de/
- #║
- #║ Credits required : TinyMine
- #║ Commercial Use? : Contact me in http://rpgmaker-vx-ace.de/
- #║ Editable? : Only by original editor TinyMine
- #║
- #║
- #║ Version : 1.01 // 13.04.2014
- #╚═───────────────────────────────────────────────────────────────────────────═#
- #╔═───────────────────────────────────────────────────────────────────────────═#
- #║ █ Inhalt
- #║
- #║ - Erweitert das TMC Script und seine Addons um weitere
- #║ Einstellungsmöglichkeiten, wie Icons und deren Darstellung.
- #║
- #╚═───────────────────────────────────────────────────────────────────────────═#
- #╔═───────────────────────────────────────────────────────────────────────────═#
- #║ █ Updates
- #║
- #║ ■ 1.01
- #║ - Versionsfehler behoben
- #║
- #║ ■ 1.0
- #║ - Erschienen
- #║
- #╚═───────────────────────────────────────────────────────────────────────────═#
- #╔═───────────────────────────────────────────────────────────────────────────═#
- #║ █ Installation
- #║
- #║ ■ Es ist sehr wichtig, das TMC Enhance unter alle anderen TMC Scripts
- #║ eingefügt wird.
- #║
- #╚═───────────────────────────────────────────────────────────────────────────═#
- if $imported[:TINY_TMC] >= 1.0
- module TINY
- module TMC
- CUR_GRAPHICS = {
- #╔═───────────────────────────────────────────────────────────────────────────═#
- #║ █ Editierbare Region ** EINSTELLUNGEN ** Editierbare Reion █
- #╚═───────────────────────────────────────────────────────────────────────────═#
- # Muster zur Iconbelegung :
- # ID => [Icon Index]
- :gold => 361,
- :silber => 359,
- :klumpen => 350
- #═────────────────────────────────────────────────────────────────────────────═#
- } # Nicht anfassen
- #═────────────────────────────────────────────────────────────────────────────═#
- # █ Icon Einstellungen
- # Welches Icon soll genutzt werden, wenn einer ID kein Icon speziell
- # zugewiesen wurde?
- DEFAULT_ICON = 262
- # In welchen Addons sollen Icons benutzt werden?
- # ■ Im Menu Addon?
- ICON_MENU = true
- # ■ Im Exchanger Addon?
- ICON_EXCH = true
- #╔═───────────────────────────────────────────────────────────────────────────═#
- #║ █ ** ENDE DER EINSTELLUNGSMÖGLICHKEITEN ** █
- #║ █ ** Die folgenden Zeilen betreffen das Script selbst ** █
- #╚═───────────────────────────────────────────────────────────────────────────═#
- end # TMC
- #═=═=═════════════════════════════════════════════════════════════════════════=#
- end # TINY
- if TINY::TMC::ICON_MENU && !$imported[:TINY_TMC_Menu].nil?
- #╔═=══════════════════════════════════════════════════════════════════════════=═
- #║ █ OLD Class Window_More_Gold
- #╚═=═=════════════════════════════════════════════════════════════════════════=═
- class Window_More_Gold
- #╔────────────────────────────────────────────────────────────────────────────
- #║ ■ Refresh Contents
- #╚────────────────────────────────────────────────────────────────────────────
- def refresh
- contents.clear
- i = 0
- $game_party.gold_hash.each { |key, val|
- info = TINY::TMC::CURRENCIES[key]
- icon = TINY::TMC::CUR_GRAPHICS[key].nil? ? TINY::TMC::DEFAULT_ICON : TINY::TMC::CUR_GRAPHICS[key]
- draw_icon(icon, contents.width - 24, 24 * i)
- draw_currency_value(val, info[1], 4 - 24, 24 * i, contents.width - 8)
- i += 1
- }
- end
- end # Window_More_Gold
- end # if ICON_MENU
- if TINY::TMC::ICON_EXCH && !$imported[:TINY_TMC_Exch].nil?
- #╔═=══════════════════════════════════════════════════════════════════════════=═
- #║ █ OLD Class Window_More_Gold_Selectable
- #╚═=═=════════════════════════════════════════════════════════════════════════=═
- class Window_More_Gold_Selectable
- #╔────────────────────────────────────────────────────────────────────────────
- #║ ■ Refresh Contents
- #╚────────────────────────────────────────────────────────────────────────────
- def refresh
- contents.clear
- i = 0
- @currencies.each { |cur|
- next if TINY::TMC::CURRENCIES[cur].nil?
- info = TINY::TMC::CURRENCIES[cur]
- icon = TINY::TMC::CUR_GRAPHICS[cur].nil? ? TINY::TMC::DEFAULT_ICON : TINY::TMC::CUR_GRAPHICS[cur]
- part = @version == :player ? $game_party.gold(cur) : info[0]
- draw_icon(icon, contents.width - 24, 24 * i)
- draw_currency_value(part, " #{info[1]}", 4 - 24, 24 * i, contents.width - 8)
- i += 1
- }
- end
- end # Window_More_Gold_Selectable
- end # if ICON_EXCH
- else
- msgbox_p("TMC Menu will not run without TMC Mainscript 1.0 or higher")
- end # if version
- #╔═───────────────────────────────────────────────────────────────────────────═╗
- #╠══════════════════════════════▲ END OF SCRIPT ▲══════════════════════════════╣
- #╚═───────────────────────────────────────────────────────────────────────────═╝