Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- =begin
- Bank Script by TheUnproPro
- =end
- $txt="Chào Mừng Tới Ngân Hàng Ba Con Sói "
- class Bank_Window_Gold < Window_Base
- def initialize
- super(0, 96, window_width, fitting_height(1))
- if $game_variables[10001] == nil
- $game_variables[10001]=0
- end
- refresh
- end
- def window_width
- return 260
- end
- def refresh
- contents.clear
- text=sprintf("Số Tiền Đã Gửi: %d", $game_variables[10001])
- draw_text(0, 0, window_width, line_height, text)
- end
- def open
- refresh
- super
- end
- def update
- super
- refresh
- end
- end
- class TextWindow < Window_Base
- def initialize
- super(0, Graphics.height-160, Graphics.width, 160)
- refresh
- end
- def refresh
- contents.clear
- text=$txt
- draw_text(0, 0, Graphics.width, line_height, text)
- end
- def update
- super
- refresh
- end
- end
- class InfoDisplay < Window_Base
- def initialize
- super(0, 48, Graphics.width, 48)
- refresh
- end
- def refresh
- contents.clear
- draw_text(0, 0, Graphics.width, line_height, "Số Tiền ?")
- end
- end
- class SelectAmount < Window_Base
- def initialize
- super(0, Graphics.height-200, 300, 48)
- refresh
- end
- def refresh
- contents.clear
- text=sprintf("%d")
- end
- end
- class Choices_For_Bank < Window_HorzCommand
- def window_width
- return Graphics.width
- end
- def make_command_list
- add_command("Gửi Tiền", :deposite)
- add_command("Rút Tiền", :withdraw)
- add_command("Trở Về", :back)
- end
- end
- class Scene_Bank < Scene_MenuBase
- def start
- super
- make_gold_windows
- make_display_window
- make_command_windows
- make_info_window
- end
- def make_gold_windows
- @gold=Window_Gold.new
- @gold2=Bank_Window_Gold.new
- @gold2.x=160
- @gold2.y=0
- end
- def make_command_windows
- @command_window=Choices_For_Bank.new(0, Graphics.height-64)
- @command_window.opacity=0
- @command_window.set_handler(:deposite, method(:deposite))
- @command_window.set_handler(:withdraw, method(:withdraw))
- @command_window.set_handler(:back, method(:back))
- @num_win = Window_NumberInput.new(@txt_window)
- $game_message.num_input_digits_max=5
- $game_message.num_input_variable_id=10000
- end
- def make_display_window
- @txt_window = TextWindow.new
- end
- def make_info_window
- @info_window = InfoDisplay.new
- @info_window.hide
- end
- def deposite
- $TYPE=0
- @info_window.show
- @num_win.start
- end
- def withdraw
- $TYPE=1
- @info_window.show
- @num_win.start
- end
- def update
- super
- if $reactivate==1
- @command_window.activate
- @gold.refresh
- $reactivate=0
- @info_window.hide
- $game_variables[10001]
- end
- end
- def back
- @txt_window.dispose
- return_scene
- end
- end
- class Window_NumberInput < Window_Base
- alias do_ok process_ok
- def process_ok
- do_ok
- $reactivate=1
- case $TYPE
- when 0
- if $game_variables[10000] <= $game_party.gold
- $game_variables[10001]+=$game_variables[10000]
- $game_party.lose_gold($game_variables[10000])
- end
- when 1
- if $game_variables[10000] <= $game_variables[10001]
- $game_variables[10001]-=$game_variables[10000]
- $game_party.gain_gold($game_variables[10000])
- end
- end
- end
- end
Add Comment
Please, Sign In to add comment