#==============================================================================
# ミニゲーム用共通処理モジュール By 貪藻矢射妥←
#------------------------------------------------------------------------------
#
# ミニゲームなどで使用する共通処理関数をモジュール化したもの。
# これで、スクリプトの行数削減ができるんるん♪
#
# ※・・・ちなみに、これだけ導入しても意味がないので気をつけてください。
#
#==============================================================================
# 変更履歴
#
# 2008:11:16
# ・ちょろっと修正
#
# 2008:11:23
# ・clear関数の高さを絶対値から相対値へ変更
#
# 2012:01:21
# ・共通メッセージをこちらで設定
#
# 2012:03:03
# ・一部の共通モジュールのクラス化
#
# 2013:06:01
# ・一部の共通モジュールのクラス化 part2
# ・SE/MEの設定をファイル名のみからRPG::AudioFile.newに変更
#
# 2024:06:01
# ・スクリプト中で使用されてる文字列の定義化追加
#
# 2025:02:01
# ・ミニゲーム中で使用する文字定義の修正
module MINI_GAME
# 入力金額最高桁数
MAX_DIG = 7
# 所持金
HAVE_GOLD = Vocab::HAVE_GOLD
# 賭け金
BET_GOLD = "賭け金"
# 警告時のSE
ERROR_SE = RPG::AudioFile.new("WWL 警告3", 90, 100)
# ファンファーレ1
JACK_POT_ME1 = RPG::AudioFile.new("002-Victory02", 100, 100)
# ファンファーレ2
JACK_POT_ME2 = RPG::AudioFile.new("009-Fanfare03", 100, 100)
# ファンファーレ3
JACK_POT_ME3 = RPG::AudioFile.new("008-Fanfare02", 100, 100)
# ファンファーレ4
JACK_POT_ME4 = RPG::AudioFile.new("007-Fanfare01", 100, 100)
# ファンファーレ5
JACK_POT_ME5 = RPG::AudioFile.new("011-Item02", 100, 100)
# ファンファーレ6
JACK_POT_ME6 = RPG::AudioFile.new("010-Item01", 100, 100)
# ハズレのME
LOOSE_ME = RPG::AudioFile.new("WWL あかん!", 90, 100)
RECT_MINI = [4, 0, 160 + 10 - 32 - 8, 32]
# メッセージ定義
# 獲得時の文章
MG_NML_GET_GOLD = "Get Gold!! %d"
# 消失時の文章
MG_NML_LOST_GOLD = "Lost Gold! %d"
# 賭け金が所持金を上回る場合
MG_ERR_BET_UPPER = sprintf("%sが%sを上回ってます!!", BET_GOLD, HAVE_GOLD)
# 賭け金未設定
MG_ERR_BET_ZERO = sprintf("%sを設定してください!!", BET_GOLD)
end
module TITLE_BM
include BM
DRAW_COLOR = Color.new(200, 200, 220, MAX8BIT)
#--------------------------------------------------------------------------
# ● クリアー
#--------------------------------------------------------------------------
def clear
if self.contents != nil
self.contents.dispose
self.contents = nil
end
self.contents = Bitmap.new(width - 32, height - 32)
end
end
class Window_Info_Gold < Window_Base
include RUBY_SYS
include MINI_GAME
include TITLE_BM
#--------------------------------------------------------------------------
# ● オブジェクト初期化
#--------------------------------------------------------------------------
def initialize
super(480 - 10, 64, 160 + 10, 64)
refresh
end
#--------------------------------------------------------------------------
# ● リフレッシュ
#--------------------------------------------------------------------------
def refresh
clear
draw_shadow_text(RECT_MINI, HAVE_GOLD, system_color, 1)
end
end
class Window_Info_Bet < Window_Base
include RUBY_SYS
include MINI_GAME
include TITLE_BM
#--------------------------------------------------------------------------
# ● オブジェクト初期化
#--------------------------------------------------------------------------
def initialize
super(480 - 10, 192, 160 + 10, 64)
refresh
end
#--------------------------------------------------------------------------
# ● リフレッシュ
#--------------------------------------------------------------------------
def refresh
clear
draw_shadow_text(RECT_MINI, BET_GOLD, system_color, 1)
end
end
class Window_Bet_Gold < Window_Base
include RUBY_SYS
include MINI_GAME
include TITLE_BM
#--------------------------------------------------------------------------
# ● オブジェクト初期化
#--------------------------------------------------------------------------
def initialize
super(480 - 10, 256, 160 + 10, 64)
end
#--------------------------------------------------------------------------
# ● リフレッシュ
#--------------------------------------------------------------------------
def refresh(bet)
clear
draw_shadow_text(RECT_MINI, bet.to_s)
end
end
class Window_Info_Space < Window_Base
include RUBY_SYS
include TITLE_BM
#--------------------------------------------------------------------------
# ● オブジェクト初期化
#--------------------------------------------------------------------------
def initialize
super(0, 380, 480 - 10, 64)
end
#--------------------------------------------------------------------------
# ● リフレッシュ
#--------------------------------------------------------------------------
def refresh(text)
clear
draw_shadow_text([4, 0, 430, 32], text)
end
end
class Window_Info_Space2 < Window_Base
include RUBY_SYS
include TITLE_BM
#--------------------------------------------------------------------------
# ● オブジェクト初期化
#--------------------------------------------------------------------------
def initialize
super(0, 380 - 64, 480 - 10, 64)
refresh(@cnt, @max)
end
#--------------------------------------------------------------------------
# ● リフレッシュ
#--------------------------------------------------------------------------
def refresh(cnt, max)
clear
if max != nil
curr = max.to_i - cnt.to_i
if curr != 0
text = sprintf("あと %d 枚交換可能です。", curr)
else
text = Vocab::BLANK_WORD
end
else
text = cnt
end
rectr = [4, 0, 300, 32]
draw_shadow_text(rectr, text)
end
end
class Window_Title_Root < Window_Base
include RUBY_SYS
include BM
include TITLE_BM
#--------------------------------------------------------------------------
# ● オブジェクト初期化
#--------------------------------------------------------------------------
def initialize
super(0, 0, 640, 64)
end
#--------------------------------------------------------------------------
# ● リフレッシュ1
#--------------------------------------------------------------------------
def refresh(text)
clear
draw_shadow_text([4, 0, 640 - 32 - 10, 32], text, DRAW_COLOR)
end
#--------------------------------------------------------------------------
# ● リフレッシュ2
#--------------------------------------------------------------------------
def refresh_ex(text)
clear
draw_shadow_text([4, 0], transfer(text), DRAW_COLOR)
end
end
|