QQ截图20130430204444_副本.png (155.96 KB, 下载次数: 19)
#============================================================================== # ++ メッセージふきだし表示 ver. 2.01 ++ # Script by パラ犬 # [url=http://2d6.parasite.jp/]http://2d6.parasite.jp/[/url] #------------------------------------------------------------------------------ # ふきだし表示をするには、 # テール用画像「(スキン名)-top」「(スキン名)-under」を # 「Graphics/Windowskins」フォルダにインポートしておく必要があります。 #------------------------------------------------------------------------------ # # [ふきだし表示の使い方] # イベントコマンド「スクリプト」で「$mes_id」にイベントIDを代入することで # そのイベントにふきだしがポップするようになります。 # (記述例: $mes_id=4 ) # IDに-1を代入するとプレイヤー、0でそのイベント自身。 # nilまたは""を代入すると、通常のメッセージ表示に戻ります。 # 表示位置はイベント「文章オプション」で変更できます。 # 表示位置に「中央」を指定すると、イベントの位置に関係なく # 画面中央に表示されます。 # # [名前ウインドウの使い方] # イベントコマンド「スクリプト」で「$mes_name」に文字列を代入することで # 名前ウインドウを表示します。 # (記述例: $mes_name="アルシェス" ) # 制御文字 \N[n] を使用する場合、\は\\と記述してください。 # (記述例: $mes_name="\\N[1]" $mes_name="\\N[\\V[1]]") # ""またはnilを代入すると、非表示になります。 # # 二つの機能は独立していますので、それぞれ単体で使えます。 # $mes_id=(ID) + $mes_name="名前" :ふきだし表示 + 名前ウインドウ # $mes_id=(ID) + $mes_name="" :ふきだし表示 (名前なし) # $mes_id=nil + $mes_name="名前" :デフォルトウインドウ + 名前ウインドウ # $mes_id=nil + $mes_name="" :デフォルトウインドウ (名前なし) # # [メッセージ表示スピードの変更法] # イベントコマンド「スクリプト」で「$mes_speed」に数値を代入します。 # 0を代入すると瞬間表示になります。 # (記述例: $mes_speed = 1 ) # # [オートメッセージ送り] # イベントコマンド「スクリプト」で「$mes_auto」に数値を代入します。 # 数値はメッセージ描画終了後のウエイトのフレーム数です。 # nilを代入すると、オートモードが解除されます。 # # [追加制御文字] # \I[ファイル名] アイコンの描画 # 「Graphics/Icons」内の画像を表示します。( 記述例:\I[001-Weapon01] ) # \S[n] メッセージスピードの変更 # \size[n] フォントサイズの変更 # #============================================================================== module FUKI # スキンの設定 # ウインドウスキンと同じものを使うときは「""」 FUKI_SKIN_NAME = "001-Blue01" # ふきだし用スキン NAME_SKIN_NAME = "001-Blue01" # 名前表示用スキン # フォントサイズ MES_FONT_SIZE = 22 # ふきだし NAME_FONT_SIZE = 14 # 名前ウインドウ # 文字色 #( Color.new(0, 0, 0, 0)を指定すると、通常文字色を使用します ) FUKI_COLOR = Color.new(255, 255, 255, 255) # ふきだしウインドウ NAME_COLOR = Color.new(255, 255, 255, 255) # 名前ウインドウ # ウインドウの透明度 FUKI_OPACITY = 255 # ふきだしウインドウ MES_OPACITY = 255 # 通常のメッセージウインドウ NAME_OPACITY = 255 # 名前ウインドウ # 名前ウインドウの相対位置 NAME_SHIFT_X = 0 # 横位置 NAME_SHIFT_Y = 16 # 縦位置 # 画面上下からウインドウがはみ出す時は、 # 自動で表示位置(上下)をチェンジ( true / false ) POS_FIX = true # 画面の一番端ではふきだしを少しずらす # 角の丸いスキンを使っていて、枠の角がふきだしと重なる場合に true にする CORNER_SHIFT = false SHIFT_PIXEL = 4 # trueの時にずらすピクセル数 # キャラクターの縦のサイズ CHARACTOR_HEIGHT = 48 # ふきだしの相対位置(縦位置) POP_SHIFT_TOP = 0 # 表示位置が上のとき POP_SHIFT_UNDER = -16 # 表示位置が下のとき # メッセージ表示速度(数字が小さいほど速い。0で瞬間表示) # $mes_speedに数値を代入することで、ゲーム中に変更可。 MES_SPEED = 1 # メッセージスキップを使用するか MES_SKIP = true #( true:有効 / false:無効 ) # メッセージスキップに使うボタン(表記方法は、Input::(ボタン)) #(キーボードとの対応表はツクールのヘルプ「ゲームの操作方法」にあります) MES_SKIP_KEY = Input::A # メッセージスキップ禁止イベントスイッチID # (イベントコマンド「スイッチの操作」でこの番号のスイッチをONにしている間は # メッセージスキップを機能を無効にします) NO_MES_SKIP_SWITCH = 999 end #============================================================================== # ■ Window_Message #------------------------------------------------------------------------------ # 文章表示に使うメッセージウィンドウです。 #============================================================================== class Window_Message < Window_Selectable #-------------------------------------------------------------------------- # ● オブジェクト初期化 #-------------------------------------------------------------------------- alias alias_para_fuki_initialize initialize def initialize # エイリアスを呼び戻す alias_para_fuki_initialize # 変数をセット [url=home.php?mod=space&uid=133944]@w[/url] = 0 @h = 0 [url=home.php?mod=space&uid=36110]@Wait[/url] = 0 @dx = 0 @dy = 0 @dh = 0 $mes_speed = FUKI::MES_SPEED end #-------------------------------------------------------------------------- # ● ウィンドウの位置と不透明度の設定 #-------------------------------------------------------------------------- alias alias_para_fuki_reset_window reset_window def reset_window # エイリアスを呼び戻す alias_para_fuki_reset_window self.back_opacity = FUKI::MES_OPACITY end #-------------------------------------------------------------------------- # ● フレーム更新 #-------------------------------------------------------------------------- def update super # ふきだしモードではイベントの動きに追従 if @tale != nil pos = get_fuki_pos(self.width, self.height) self.x = pos[0] self.y = pos[1] tale_pos = get_tale_pos @tale.x = tale_pos[0] @tale.y = tale_pos[1] if @name_win != nil name_height = FUKI::NAME_FONT_SIZE @name_win.x = self.x + FUKI::NAME_SHIFT_X @name_win.y = self.y - name_height - 16 + FUKI::NAME_SHIFT_Y @name_contents.x = @name_win.x + 12 @name_contents.y = @name_win.y + 8 end end # メッセージスキップ if mes_skip? self.contents_opacity = 255 if @name_win != nil @name_win.opacity = 255 end if @tale != nil @tale.opacity = 255 end if @input_number_window != nil @input_number_window.contents_opacity = 255 end @fade_in = false end # フェードインの場合 if @fade_in self.contents_opacity += 24 if @name_win != nil @name_win.opacity += 24 end if @tale != nil @tale.opacity += 24 end if @input_number_window != nil @input_number_window.contents_opacity += 24 end if self.contents_opacity == 255 @fade_in = false end return end # メッセージ表示中の場合 if @contents_drawing # 一文字ずつ描画 refresh_drawtext return end # 数値入力中の場合 if @input_number_window != nil @input_number_window.update # 決定 if Input.trigger?(Input::C) $game_system.se_play($data_system.decision_se) $game_variables[$game_temp.num_input_variable_id] = @input_number_window.number $game_map.need_refresh = true # 数値入力ウィンドウを解放 @input_number_window.dispose @input_number_window = nil terminate_message end return end # メッセージ表示終了の場合 if @contents_showing_end # メッセージスキップ判定 if mes_skip? # 選択肢の表示中でなければメッセージウインドウを閉じる if $game_temp.choice_max == 0 terminate_message # ふきだしを破棄 del_fukidasi return end end # オートモード if @mes_auto != nil if @mes_auto <= 0 terminate_message # ふきだしを破棄 del_fukidasi @mes_auto = nil else @mes_auto -= 1 end end # 選択肢の表示中でなければポーズサインを表示 # ふきだしモードでは非表示 if $game_temp.choice_max == 0 and @tale == nil self.pause = true else self.pause = false end # キャンセル if Input.trigger?(Input::B) if $game_temp.choice_max > 0 and $game_temp.choice_cancel_type > 0 $game_system.se_play($data_system.cancel_se) $game_temp.choice_proc.call($game_temp.choice_cancel_type - 1) terminate_message end end # 決定 if Input.trigger?(Input::C) and $mes_auto == nil if $game_temp.choice_max > 0 $game_system.se_play($data_system.decision_se) $game_temp.choice_proc.call(self.index) end terminate_message # ふきだしを破棄 del_fukidasi end return end # フェードアウト中以外で表示待ちのメッセージか選択肢がある場合 if @fade_out == false and $game_temp.message_text != nil @contents_showing = true $game_temp.message_window_showing = true reset_window refresh_create if @name_win != nil @name_win.opacity = 0 end if @tale != nil @tale.opacity = 0 end Graphics.frame_reset self.visible = true self.contents_opacity = 0 if @input_number_window != nil @input_number_window.contents_opacity = 0 end @fade_in = true @mes_auto = $mes_auto return end # 表示すべきメッセージがないが、ウィンドウが可視状態の場合 if self.visible @fade_out = true self.opacity -= 48 if @name_win != nil @name_win.opacity -= 48 end if @tale != nil @tale.opacity -= 48 end if self.opacity == 0 self.visible = false @fade_out = false $game_temp.message_window_showing = false del_fukidasi end return end end #-------------------------------------------------------------------------- # ● メッセージ終了処理 #-------------------------------------------------------------------------- alias alias_para_fuki_terminate_message terminate_message def terminate_message # エイリアスを呼び戻す alias_para_fuki_terminate_message @contents_showing_end = false end #-------------------------------------------------------------------------- # ● カーソルの矩形更新 #-------------------------------------------------------------------------- def update_cursor_rect if @index >= 0 n = $game_temp.choice_start + @index font_size = self.contents.font.size self.cursor_rect.set(8, n*(font_size+10)-5, @cursor_width, (font_size+10)) else self.cursor_rect.empty end end #-------------------------------------------------------------------------- # ○ メッセージスキップ有効判定 #-------------------------------------------------------------------------- def mes_skip? if FUKI::MES_SKIP == true and Input.repeat?(FUKI::MES_SKIP_KEY) and $game_switches[FUKI::NO_MES_SKIP_SWITCH] == false return true else return false end end #-------------------------------------------------------------------------- # ○ サイズを決定してウインドウを作成 #-------------------------------------------------------------------------- def refresh_create self.contents.clear self.contents.font.color = normal_color self.contents.font.size = FUKI::MES_FONT_SIZE # ウインドウサイズを取得 get_windowsize w = [url=home.php?mod=space&uid=133944]@w[/url] + 32 + 8 h = @h + 26 # ふきだしウインドウを作成 set_fukidasi(self.x, self.y, w, h) # 名前ウインドウを作成 set_namewindow # メッセージ表示用変数の初期化 @dx = @dy = @dh = @max_font_h = 0 @cursor_width = 0 @contents_drawing = true # メッセージスピードの初期化 @mes_speed = $mes_speed # フォントサイズの初期化 self.contents.font.size = FUKI::MES_FONT_SIZE @max_font_h = self.contents.font.size # 文字描画 refresh_drawtext end #-------------------------------------------------------------------------- # ○ 一文字ずつ描画 #-------------------------------------------------------------------------- def refresh_drawtext if $game_temp.message_text != nil # メッセージスキップがオンなら if mes_skip? # 描画が終わるまで描画処理をループ while $game_temp.message_text != "" draw_massage end # メッセージスピードが0なら elsif @mes_speed == 0 # 描画が終わるかメッセージスピードが変更されるまで描画処理をループ while $game_temp.message_text != "" and @mes_speed == 0 draw_massage end else if [url=home.php?mod=space&uid=36110]@Wait[/url] > 0 @wait -= 1 elsif @wait == 0 # 描画処理 draw_massage @wait = @mes_speed end end end # 描画終了 if $game_temp.message_text == "" draw_opt_text @contents_showing_end = true @contents_drawing = false end end #-------------------------------------------------------------------------- # ○ ウインドウサイズを取得 #-------------------------------------------------------------------------- def get_windowsize x = y = 0 @h = @w = 0 max_font_h = self.contents.font.size @cursor_width = 0 # 選択肢なら字下げを行う if $game_temp.choice_start == 0 x = 16 end # 表示待ちのメッセージがある場合 if $game_temp.message_text != nil text = $game_temp.message_text.clone # 制御文字処理 begin last_text = text.clone text.gsub!(/\\[Vv]\[([0-9]+)\]/) { $game_variables[$1.to_i] } end until text == last_text text.gsub!(/\\[Nn]\[([0-9]+)\]/) do $game_actors[$1.to_i] != nil ? $game_actors[$1.to_i].name : "" end # 便宜上、"\\\\" を "\000" に変換 text.gsub!(/\\\\/) { "\000" } # "\\C" を "\001" に、"\\G" を "\002" に変換 text.gsub!(/\\[Cc]\[([0-9]+)\]/) { "\001" } text.gsub!(/\\[Gg]/) { "\002" } # "\\I" を "\003" に変換 text.gsub!(/\\[Ii]\[(.*?)\]/) { "\003[#{$1}]" } # "\\S" を "\004" に変換 text.gsub!(/\\[Ss]\[([0-9]+)\]/) { "\004[#{$1}]" } # "\\size" を "\005" に変換 text.gsub!(/\\size\[([0-9]+)\]/) { "\005[#{$1}]" } # c に 1 文字を取得 (文字が取得できなくなるまでループ) while ((c = text.slice!(/./m)) != nil) # \\ の場合 if c == "\000" # 本来の文字に戻す c = "\\" end # \C[n] または \G の場合 または \S[n] のとき if c == "\001" or c == "\002" or c == "\004" # 次の文字へ next end # 改行文字の場合 if c == "\n" # y に 1 を加算 y += 1 # 縦横サイズを取得 @h += max_font_h + 10 max_font_h = 0 @w = x > @w ? x : @w if y >= $game_temp.choice_start @w = x + 8 > @w ? x + 8 : @w end x = 0 # 選択肢なら字下げを行う if y >= $game_temp.choice_start x = 8 end # 次の文字へ next end # \I[ファイル名] の場合 if c == "\003" text.sub!(/\[(.*?)\]/, "") bitmap = RPG::Cache.icon($1) # x にアイコンの幅を加算 x += bitmap.width # 次の文字へ next end # \size[n] の場合 if c == "\005" text.sub!(/\[([0-9]+)\]/, "") # 文字サイズを変更 self.contents.font.size = $1.to_i # 最大縦幅を取得 if self.contents.font.size > max_font_h max_font_h = self.contents.font.size end end # x に文字の幅を加算 x += self.contents.text_size(c).width # 最大縦幅を取得 if self.contents.font.size > max_font_h max_font_h = self.contents.font.size end end end # 文字サイズを戻す self.contents.font.size = FUKI::MES_FONT_SIZE # 数値入力の場合 if $game_temp.num_input_variable_id > 0 digits_max = $game_temp.num_input_digits_max number = $game_variables[$game_temp.num_input_variable_id] @h += 1 x = digits_max * self.contents.font.size + 16 @w = x > @w ? x : @w end end #-------------------------------------------------------------------------- # ○ 描画処理 #-------------------------------------------------------------------------- def draw_massage # 表示待ちのメッセージがある場合 if $game_temp.message_text != nil text = $game_temp.message_text # 制御文字処理 begin last_text = text.clone text.gsub!(/\\[Vv]\[([0-9]+)\]/) { $game_variables[$1.to_i] } end until text == last_text text.gsub!(/\\[Nn]\[([0-9]+)\]/) do $game_actors[$1.to_i] != nil ? $game_actors[$1.to_i].name : "" end # 便宜上、"\\\\" を "\000" に変換 text.gsub!(/\\\\/) { "\000" } # "\\C" を "\001" に、"\\G" を "\002" に変換 text.gsub!(/\\[Cc]\[([0-9]+)\]/) { "\001[#{$1}]" } text.gsub!(/\\[Gg]/) { "\002" } # "\\I" を "\003" に変換 text.gsub!(/\\[Ii]\[(.*?)\]/) { "\003[#{$1}]" } # "\\S" を "\004" に変換 text.gsub!(/\\[Ss]\[([0-9]+)\]/) { "\004[#{$1}]" } # "\\size" を "\005" に変換 text.gsub!(/\\size\[([0-9]+)\]/) { "\005[#{$1}]" } # c に 1 文字を取得 if ((c = text.slice!(/./m)) != nil) # 選択肢の場合 if @dy >= $game_temp.choice_start # 字下げを行う @dx = 8 # 文字を描画 font_size = self.contents.font.size self.contents.draw_text(4+@dx, @dh, font_size, font_size, c) # x に描画した文字の幅を加算 @dx += self.contents.text_size(c).width # ループ while ((c = text.slice!(/./m)) != "\n") # 文字を描画 font_size = self.contents.font.size self.contents.draw_text(4+@dx, @dh, font_size, font_size, c) @max_font_h = font_size # x に描画した文字の幅を加算 @dx += self.contents.text_size(c).width end if c == "\n" # カーソルの幅を更新 @cursor_width = [@cursor_width, @dx].max # フォントの最大の高さを加算 @dh += @max_font_h + 10 @max_font_h = self.contents.font.size @dx = 0 end return end # \\ の場合 if c == "\000" # 本来の文字に戻す c = "\\" end # \C[n] の場合 if c == "\001" # 文字色を変更 text.sub!(/\[([0-9]+)\]/, "") color = $1.to_i if color >= 0 and color <= 7 self.contents.font.color = text_color(color) end return end # \G の場合 if c == "\002" # ゴールドウィンドウを作成 if @gold_window == nil @gold_window = Window_Gold.new @gold_window.x = 560 - @gold_window.width if $game_temp.in_battle @gold_window.y = 192 else @gold_window.y = self.y >= 128 ? 32 : 384 end @gold_window.opacity = self.opacity @gold_window.back_opacity = self.back_opacity end return end # 改行文字の場合 if c == "\n" # y に 1 を加算 @dy += 1 @dx = 0 # フォントの最大の高さを加算 @dh += @max_font_h + 10 @max_font_h = 0 return end # \I[ファイル名] の場合 if c == "\003" text.sub!(/\[(.*?)\]/, "") bitmap = RPG::Cache.icon($1) font_size = FUKI::MES_FONT_SIZE # アイコンを描画 self.contents.blt(4+@dx, 5+@dh, bitmap, Rect.new(0, 0, bitmap.width, bitmap.height)) # x に描画したアイコンの幅を加算 @dx += bitmap.width # 最大縦幅を取得 if self.contents.font.size > @max_font_h @max_font_h = bitmap.height end return end # \S[n] の場合 if c == "\004" text.sub!(/\[([0-9]+)\]/, "") # 描画スピードを変更 @mes_speed = $1.to_i return end # \size[n] の場合 if c == "\005" text.sub!(/\[([0-9]+)\]/, "") c = "" # 文字サイズを変更 self.contents.font.size = $1.to_i end # 文字を描画 font_size = self.contents.font.size self.contents.draw_text(4+@dx, @dh, font_size, font_size, c) # x に描画した文字の幅を加算 @dx += self.contents.text_size(c).width # 文字の最大縦幅を取得 if self.contents.font.size > @max_font_h @max_font_h = self.contents.font.size end end end end #-------------------------------------------------------------------------- # ○ 選択肢と数値入力を有効に #-------------------------------------------------------------------------- def draw_opt_text # 選択肢の場合 if $game_temp.choice_max > 0 @item_max = $game_temp.choice_max self.active = true self.index = 0 end # 数値入力の場合 if $game_temp.num_input_variable_id > 0 digits_max = $game_temp.num_input_digits_max number = $game_variables[$game_temp.num_input_variable_id] @input_number_window = Window_InputNumber.new(digits_max) @input_number_window.number = number @input_number_window.x = self.x + 8 @input_number_window.y = self.y + $game_temp.num_input_start * 32 end end #-------------------------------------------------------------------------- # ○ ふきだしを表示 #-------------------------------------------------------------------------- def set_fukidasi(x, y, width, height) # $mes_id が空のときはふきだしを表示しない if $mes_id == nil or $mes_id == "" del_fukidasi reset_window else # ポーズサインを非表示 self.pause = false # 位置を取得 pos = get_fuki_pos(width, height) x = pos[0] y = pos[1] skin = FUKI::FUKI_SKIN_NAME != "" ? FUKI::FUKI_SKIN_NAME : $game_system.windowskin_name # ふきだし用メッセージウインドウを作成 self.windowskin = RPG::Cache.windowskin(skin) self.x = x self.y = y self.height = height self.width = width self.contents.dispose self.contents = Bitmap.new(width - 32, height - 32) self.back_opacity = FUKI::FUKI_OPACITY self.contents.clear self.contents.font.color = normal_color self.contents.font.size = FUKI::MES_FONT_SIZE # ふきだしのテールを描画 if $game_system.message_frame == 0 # 位置を取得 tale_pos = get_tale_pos @tale = Sprite.new case @message_position when 0 # 上 @tale.bitmap = RPG::Cache.windowskin(skin + "-top") @tale.x = tale_pos[0] @tale.y = tale_pos[1] @tale.z = self.z + 1 when 1 # 中 @tale.dispose @tale = nil when 2 # 下 @tale.bitmap = RPG::Cache.windowskin(skin + "-under") @tale.x = tale_pos[0] @tale.y = tale_pos[1] @tale.z = self.z + 1 end end end end #-------------------------------------------------------------------------- # ○ ふきだしの位置を計算 #-------------------------------------------------------------------------- def get_fuki_pos(width, height) # キャラクターを取得 @character = get_character($mes_id) if @character == nil # キャラクターが存在しないときは通常のメッセージウインドウに del_fukidasi reset_window return end # 座標処理 x = ( @character.real_x - $game_map.display_x + 64 ) * 32 / 128 - (width / 2) # はみ出すときは画面内に収まるように移動 if x + width > 640 x = 640 - width elsif x < 0 x = 0 end # ウインドウの位置を決定 case $game_system.message_position when 0 # 上 y = ( @character.real_y - $game_map.display_y + 64) * 32 / 128 - height - FUKI::CHARACTOR_HEIGHT + FUKI::POP_SHIFT_TOP when 1 # 中 y = (480 - height) / 2 x = (640 - width) / 2 when 2 # 下 y = ( @character.real_y - $game_map.display_y + 64) * 32 / 128 + 32 + FUKI::POP_SHIFT_UNDER end #メッセージポジション一時記憶 @message_position = $game_system.message_position # 画面外にはみ出す時はウインドウの上下をチェンジ if FUKI::POS_FIX case @message_position when 0 # 上 if y <= 0 @message_position = 2 y = ( @character.real_y - $game_map.display_y + 64) * 32 / 128 + FUKI::POP_SHIFT_UNDER end when 2 # 下 if y + height >= 480 @message_position = 0 y = ( @character.real_y - $game_map.display_y + 64) * 32 / 128 - height + 32 - FUKI::CHARACTOR_HEIGHT + FUKI::POP_SHIFT_TOP end end end return [x,y] end #-------------------------------------------------------------------------- # ○ テールの位置を計算 #-------------------------------------------------------------------------- def get_tale_pos case @message_position when 0 # 上 # 座標処理 x = ( @character.real_x - $game_map.display_x + 64 ) * 32 / 128 - 16 # 画面端では位置をずらす if FUKI::CORNER_SHIFT if x == 0 x = FUKI::SHIFT_PIXEL elsif x == 640 - 32 x = 640 - 32 - FUKI::SHIFT_PIXEL end end y = self.y + self.height - 16 when 1 # 中 x = nil y = nil when 2 # 下 # 座標処理 x = ( @character.real_x - $game_map.display_x + 64 ) * 32 / 128 - 16 # 画面端では位置をずらす if FUKI::CORNER_SHIFT if x == 0 x = FUKI::SHIFT_PIXEL elsif @tale.x == 640 - 32 x = 640 - 32 - FUKI::SHIFT_PIXEL end end y = self.y - 16 end return [x,y] end #-------------------------------------------------------------------------- # ○ 名前ウインドウを表示 #-------------------------------------------------------------------------- def set_namewindow # $mes_name が空のときは名前ウインドウを表示しない if $mes_name == nil or $mes_name == "" return else # 変数をセット mes_name = $mes_name # 制御文字処理 begin last_text = mes_name.clone mes_name.gsub!(/\\[Vv]\[([0-9]+)\]/) { $game_variables[$1.to_i] } end until mes_name == last_text mes_name.gsub!(/\\[Nn]\[([0-9]+)\]/) do $game_actors[$1.to_i] != nil ? $game_actors[$1.to_i].name : "" end name_width = mes_name.size / 2 * FUKI::NAME_FONT_SIZE name_height = FUKI::NAME_FONT_SIZE name_x = self.x + FUKI::NAME_SHIFT_X name_y = self.y - name_height - 16 + FUKI::NAME_SHIFT_Y # 名前ウインドウ(枠のみ)を作成 @name_win = Window_Base.new(name_x, name_y, name_width + 16, name_height + 16) skin = FUKI::NAME_SKIN_NAME != "" ? FUKI::NAME_SKIN_NAME : $game_system.windowskin_name @name_win.windowskin = RPG::Cache.windowskin(skin) @name_win.back_opacity = FUKI::NAME_OPACITY @name_win.z = self.z + 1 # 余白をwindowクラスの限界よりも小さくするため、二重構造に @name_contents = Sprite.new @name_contents.x = name_x + 12 @name_contents.y = name_y + 8 @name_contents.bitmap = Bitmap.new(name_width, name_height) @name_contents.z = @name_win.z + 2 # 文字色の設定 nil_color = Color.new(0,0,0,0) if FUKI::NAME_COLOR != nil_color @name_contents.bitmap.font.color = FUKI::NAME_COLOR else @name_contents.bitmap.font.color = normal_color end @name_contents.bitmap.font.size = FUKI::NAME_FONT_SIZE # ウインドウサイズを調整 rect = @name_contents.bitmap.text_size(mes_name) @name_win.width = rect.width + 32 # 名前を描画 @name_contents.bitmap.draw_text(rect, mes_name) end end #-------------------------------------------------------------------------- # ○ ふきだしと名前ウインドウを破棄 #-------------------------------------------------------------------------- def del_fukidasi if @tale != nil @tale.dispose @tale = nil end if @name_win != nil @name_win.dispose @name_win = nil @name_contents.dispose @name_contents = nil end self.opacity = 0 self.x = 80 self.width = 480 self.height = 160 self.contents.dispose self.contents = Bitmap.new(width - 32, height - 32) self.pause = true end #-------------------------------------------------------------------------- # ○ キャラクターの取得 # parameter : パラメータ #-------------------------------------------------------------------------- def get_character(parameter) # パラメータで分岐 case parameter when -1 # プレイヤー return $game_player when 0 # このイベント events = $game_map.events return events == nil ? nil : events[$active_event_id] else # 特定のイベント events = $game_map.events return events == nil ? nil : events[parameter] end end #-------------------------------------------------------------------------- # ● 通常文字色の取得 #-------------------------------------------------------------------------- def normal_color # ふきだしモード時に設定を適用 if $mes_id != nil and $mes_id != "" nil_color = Color.new(0,0,0,0) if FUKI::FUKI_COLOR != nil_color color = FUKI::FUKI_COLOR else color = super end return color else # 非ふきだし時には通常文字色 return super end end end #============================================================================== # ■ Window_InputNumber #============================================================================== class Window_InputNumber < Window_Base #-------------------------------------------------------------------------- # ● オブジェクト初期化 # digits_max : 桁数 #-------------------------------------------------------------------------- def initialize(digits_max) @digits_max = digits_max [url=home.php?mod=space&uid=27178]@Number[/url] = 0 # 数字の幅からカーソルの幅を計算 (0~9 は等幅と仮定) dummy_bitmap = Bitmap.new(32, 32) dummy_bitmap.font.size = FUKI::MES_FONT_SIZE @cursor_width = dummy_bitmap.text_size("0").width + 8 dummy_bitmap.dispose super(0, 0, @cursor_width * @digits_max + 32, 64) self.contents = Bitmap.new(width - 32, height - 32) self.contents.font.size = FUKI::MES_FONT_SIZE self.z += 9999 self.opacity = 0 @index = 0 refresh update_cursor_rect end end #============================================================================== # ■ Interpreter #============================================================================== class Interpreter #-------------------------------------------------------------------------- # ● イベントのセットアップ # event_id : イベント ID #-------------------------------------------------------------------------- alias setup_fuki setup def setup(list, event_id) setup_fuki(list, event_id) # 戦闘中でなければ if !($game_temp.in_battle) # イベントIDを記録 $active_event_id = event_id end end end
001-Blue01-top.png (218 Bytes, 下载次数: 21)
001 Blue01 top.png
001-Blue01-top_b.png (209 Bytes, 下载次数: 28)
001 Blue01 top_b.png
001-Blue01-under.png (214 Bytes, 下载次数: 24)
001-Blue01-under_b.png (203 Bytes, 下载次数: 23)
fukidasi2.gif (1.34 KB, 下载次数: 21)
fukidasi3.jpg (30.57 KB, 下载次数: 20)
fukidasi.jpg (26.11 KB, 下载次数: 19)
fukidasi_tale.gif (9.55 KB, 下载次数: 20)
操作验证结束脚本 (重新发布→脚本像一家小书店像货架 ): “消息显示全面升级” 城堡的装备,如:“消息控制字符加入” KGC软件,如:“消息窗口重塑” |
#============================================================================== # +++ コラボレーション「+ふきだし表示」 ver.1.13 +++ # Script by # パラ犬 [url]http://2d6.parasite.jp/[/url] # × # 桜雅 在土 [url]http://xms.rdy.jp/[/url] # #------------------------------------------------------------------------------ # ほぼどんなメッセージウィンドウに対しても後付け可能な「ふきだし表示」です。 # また、テール部分のみの自動追尾機能を持ちます。 #============================================================================== # ふきだし表示をするには、 # テール用画像「(スキン名)-top」「(スキン名)-under」を # 「Graphics/Windowskins」フォルダにインポートしておく必要があります。 #------------------------------------------------------------------------------ # # [ふきだし表示の使い方] # イベントコマンド「スクリプト」で「$mes_id」にイベントIDを代入することで # そのイベントにふきだしがポップするようになります。 # (記述例: $mes_id=4 ) # IDに0を代入するとプレイヤー、 nil代入すると、通常のメッセージ表示に戻ります。 # 表示位置はイベント「文章オプション」で変更できます。 # 表示位置に「中央」を指定すると、イベントの位置に関係なく # 画面中央に表示されます。 # #============================================================================== #============================================================================== # □ カスタマイズポイント #============================================================================== class Window_Message < Window_Selectable #-------------------------------------------------------------------------- # ふきだしモード時のスキン設定 #-------------------------------------------------------------------------- # スキン名(元のウインドウスキンと同じものを使うときは「""」) FUKI_SKIN_NAME = "001-Blue01" # ウインドウ背景の不透明度(デフォルトは160) FUKI_OPACITY = 255 end #============================================================================== # ■ Window_Message #============================================================================== class Window_Message < Window_Selectable #-------------------------------------------------------------------------- # ● メッセージ終了処理 #-------------------------------------------------------------------------- alias parashelf_terminate_message terminate_message def terminate_message # 呼び戻す parashelf_terminate_message # ふきだしの消去 del_tail end #-------------------------------------------------------------------------- # ● リフレッシュ #-------------------------------------------------------------------------- alias parashelf_refresh refresh def refresh # 呼び戻す parashelf_refresh # ふきだしの再設定 del_tail set_tail end #-------------------------------------------------------------------------- # ● ウィンドウの位置と不透明度の設定 #-------------------------------------------------------------------------- alias parashelf_reset_window reset_window def reset_window # 呼び戻す parashelf_reset_window # テールの位置を変更 if $mes_id != nil and @tail != nil tale_pos = get_tale_pos @tail.x = tale_pos[0] @tail.y = tale_pos[1] end end #-------------------------------------------------------------------------- # ● フレーム更新 #-------------------------------------------------------------------------- alias parashelf_update update def update # 呼び戻す parashelf_update # ふきだしテールの更新 update_tail # メッセージ表示中の場合 if @contents_showing # テールがある場合はポーズサインを非表示 if @tail != nil self.pause = false end end # メッージ終了時にスキン設定が戻っていない場合 if $game_temp.message_window_showing == false and @def_skin_name != nil # スキンを戻す reset_fuki_skin end end #-------------------------------------------------------------------------- # ○ フレーム更新 (ふきだしテール) #-------------------------------------------------------------------------- def update_tail # ふきだしモードではイベントの動きに追従 if $mes_id != nil and @tail != nil tale_pos = get_tale_pos @tail.x = tale_pos[0] @tail.y = tale_pos[1] skin = $game_system.windowskin_name case @message_position when 0 # 上 @tail.bitmap = RPG::Cache.windowskin(skin + "-top") when 2 # 下 @tail.bitmap = RPG::Cache.windowskin(skin + "-under") end end end #-------------------------------------------------------------------------- # ○ ふきだしテールを表示 #-------------------------------------------------------------------------- def set_tail # $mes_id が空のときと戦闘中はふきだしを表示しない if $mes_id == nil or $game_temp.in_battle del_tail # スキンを戻す reset_fuki_skin else # スキンをセット set_fuki_skin # ふきだしのテールを描画 skin = $game_system.windowskin_name if $game_system.message_frame == 0 # 位置を取得 tale_pos = get_tale_pos @tail = Sprite.new case $game_system.message_position when 0 # 上 @tail.bitmap = RPG::Cache.windowskin(skin + "-top") @tail.x = tale_pos[0] @tail.y = tale_pos[1] @tail.z = self.z + 1 when 1 # 中 @tail.dispose @tail = nil when 2 # 下 @tail.bitmap = RPG::Cache.windowskin(skin + "-under") @tail.x = tale_pos[0] @tail.y = tale_pos[1] @tail.z = self.z + 1 end # エクストラスプライトに登録 @extra_sprites = [] if @extra_sprites.nil? @extra_sprites.push(@tail) if @tail != nil end end end #-------------------------------------------------------------------------- # ○ テールの位置を計算 #-------------------------------------------------------------------------- def get_tale_pos character = get_character($mes_id) x = [[character.screen_x - 16, self.x].max, self.x + self.width - 32].min case $game_system.message_position when 0 y = self.y + self.height - 16 else y = self.y - 16 end return [x, y] end #-------------------------------------------------------------------------- # ○ キャラクターの取得 # parameter : パラメータ #-------------------------------------------------------------------------- def get_character(parameter) # パラメータで分岐 case parameter when 0 # プレイヤー return $game_player else # 特定のイベント events = $game_map.events return events == nil ? nil : events[parameter] end end #-------------------------------------------------------------------------- # ○ ふきだしを破棄 #-------------------------------------------------------------------------- def del_tail if @tail != nil @tail.dispose @tail = nil end end #-------------------------------------------------------------------------- # ○ スキンの設定 #-------------------------------------------------------------------------- def set_fuki_skin # ウインドウスキンを変更 if FUKI_SKIN_NAME != "" and FUKI_SKIN_NAME != $game_system.windowskin_name @def_skin_name = $game_system.windowskin_name $game_system.windowskin_name = FUKI_SKIN_NAME self.windowskin = RPG::Cache.windowskin($game_system.windowskin_name) end # 不透明度を変更 if self.back_opacity != FUKI_OPACITY @def_back_opacity = self.back_opacity self.back_opacity = FUKI_OPACITY end end #-------------------------------------------------------------------------- # ○ スキンを戻す #-------------------------------------------------------------------------- def reset_fuki_skin # ウインドウスキンを戻す if @def_skin_name != nil $game_system.windowskin_name = @def_skin_name self.windowskin = RPG::Cache.windowskin($game_system.windowskin_name) @def_skin_name = nil end # 不透明度を戻す if @def_back_opacity != nil self.back_opacity = @def_back_opacity @def_back_opacity = nil end end end
fuki_plus.jpg (40.12 KB, 下载次数: 19)
#============================================================================== # ++ グラフィック変更ダッシュ ver. 1.21 ++ # Script by パラ犬 # [url=http://2d6.parasite.jp/]http://2d6.parasite.jp/[/url] #------------------------------------------------------------------------------ # 「Graphics/Characters」フォルダに # 「(先頭キャラの歩行グラフィック名)+_dash」という名前のファイルがある場合 # ダッシュ時のグラフィックとして使用します。(例:001-Fighter01_dash) #============================================================================== class Game_Player < Game_Character SPEED_DASH = 5 # ダッシュ時の移動速度 SPEED_NORMAL = 4 # 通常の移動速度 # ダッシュに使うボタン(表記方法は、Input::(ボタン)) #(キーボードとの対応表はツクールのヘルプにあります) KEY_DASH = Input::A # "_dash"グラフィックが存在しない場合ダッシュをするか( true:する / false:しない ) NO_FILE_DASH = true # 静止時はグラフィックを変更しない( true:変更しない / false:変更する ) CHANGE_IN_MOVING = false # ダッシュ禁止イベントスイッチID # (イベントコマンド「スイッチの操作」でこの番号のスイッチをONにしている間は # ダッシュを機能を無効にします) NO_DASH_SWITCH = 999 end #============================================================================== # ■ Game_Player #============================================================================== class Game_Player < Game_Character #-------------------------------------------------------------------------- # ● フレーム更新 #-------------------------------------------------------------------------- alias dash_update update def update # イベント実行中、移動ルート強制中、 # メッセージウィンドウ表示中のいずれでもない場合 unless $game_system.map_interpreter.running? or @move_route_forcing or $game_temp.message_window_showing if !($game_switches[NO_DASH_SWITCH]) # キー判定 if Input.press?(KEY_DASH) and (CHANGE_IN_MOVING == false or Input.dir8 != 0) if (dash_graphic_exist?($game_party.actors[0]) or NO_FILE_DASH) # ダッシュ中でなければダッシュ if @move_speed != SPEED_DASH @move_speed = SPEED_DASH @dash_on = true $game_player.refresh end end elsif @dash_on == nil or @dash_on @move_speed = SPEED_NORMAL @dash_on = nil $game_player.refresh end end end dash_update end #-------------------------------------------------------------------------- # ○ ダッシュグラフィックの有無をチェック #-------------------------------------------------------------------------- def dash_graphic_exist?(actor) # 読み込みテスト begin RPG::Cache.character(actor.character_name.to_s + "_dash", actor.character_hue) rescue return false end return true end #-------------------------------------------------------------------------- # ● リフレッシュ #-------------------------------------------------------------------------- alias dash_refresh refresh def refresh dash_refresh # パーティ人数が 0 人でない場合 if $game_party.actors.size != 0 actor = $game_party.actors[0] # キャラクターのファイル名と色相を設定 if @dash_on and dash_graphic_exist?(actor) fileplus = "_dash" else fileplus = "" end @character_name = actor.character_name + fileplus @character_hue = actor.character_hue end end end
dash_before.jpg (3.64 KB, 下载次数: 24)
正常运动
dash_after.jpg (3.7 KB, 下载次数: 17)
001-Fighter01_dash.png (5.67 KB, 下载次数: 24)
范例图片
#============================================================================== # ++ 武器種別スキル ver. 1.10 ++ # Script by パラ犬 #------------------------------------------------------------------------------ # 武器の種類ごとに使用可能なスキルを制限します。 #------------------------------------------------------------------------------ #[使い方] # 武器の種類ごとに「剣」「槍」などの属性を設定し # 武器とスキルの両方に付加します。 # この属性が一致しない場合、スキルを習得していても使用不可能となります。 #============================================================================== module PARA_WSKL # 素手の時のみ使用可能なスキル属性の名前 NO_WEAPON_NAME = "体術" # 武器によって制限されないスキル属性名 # (この属性が付加されているスキルは武器の影響を受けません) VARIABLE_SKILL = "魔法" # スキルを制限しない武器属性名 # (この属性が付加されている武器は全てのスキルを使うことができます) VARIABLE_WEAPON = "" # 使用不可スキルの表示/非表示 # ( 0:常に表示 / 1:戦闘中は非表示 / 2:常に非表示 ) VISIBLE_TYPE = 1 end # ↑ 設定項目ここまで #------------------------------------------------------------------------------ #============================================================================== # ■ Game_Actor #============================================================================== class Game_Actor < Game_Battler #-------------------------------------------------------------------------- # ● スキルの使用可能判定 # skill_id : スキル ID #-------------------------------------------------------------------------- def skill_can_use?(skill_id) if not skill_learn?(skill_id) return false end if not skill_w_can_use?(skill_id) return false end return super end #-------------------------------------------------------------------------- # ● 武器スキルの使用可能判定 # skill_id : スキル ID #-------------------------------------------------------------------------- def skill_w_can_use?(skill_id) if not skill_learn?(skill_id) return false end # スキルと武器の属性がひとつでも一致するか if $data_skills[skill_id].element_set & self.element_set != [] bool = true else # 武器の属性IDを名前に weapon_elements_name = [] for element_id in self.element_set weapon_elements_name.push($data_system.elements[element_id]) end # スキルの属性IDを名前に skill_elements_name = [] for element_id in $data_skills[skill_id].element_set skill_elements_name.push($data_system.elements[element_id]) end # 武器によって制限されないスキル属性 if skill_elements_name.include?(PARA_WSKL::VARIABLE_SKILL) and PARA_WSKL::VARIABLE_SKILL != "" bool = true end # スキルを制限しない武器属性 if weapon_elements_name.include?(PARA_WSKL::VARIABLE_WEAPON) and PARA_WSKL::VARIABLE_WEAPON != "" bool = true end # 素手スキル if skill_elements_name.include?(PARA_WSKL::NO_WEAPON_NAME) and @weapon_id == 0 bool = true end end bool = bool == nil ? false : bool return bool end end #============================================================================== # ■ Window_Skill #============================================================================== class Window_Skill < Window_Selectable #-------------------------------------------------------------------------- # ● リフレッシュ #-------------------------------------------------------------------------- def refresh if self.contents != nil self.contents.dispose self.contents = nil end @data = [] for i in [email]0...@actor.skills.size[/email] skill = $data_skills[@actor.skills[i]] case PARA_WSKL::VISIBLE_TYPE when 1 if skill != nil and !(!@actor.skill_w_can_use?(skill.id) and $game_temp.in_battle) @data.push(skill) end when 2 if skill != nil and @actor.skill_w_can_use?(skill.id) @data.push(skill) end else if skill != nil @data.push(skill) end end end # 項目数が 0 でなければビットマップを作成し、全項目を描画 @item_max = @data.size if @item_max > 0 self.contents = Bitmap.new(width - 32, row_max * 32) for i in 0...@item_max draw_item(i) end end end end
创建“剑”和“矛”,在数据库中的任何属性, 它被设置为两者的技能和武器,它们的属性。 如果该属性的武器的属性和技能不匹配,则 技能不能被使用。 |
weapon_skill.jpg (31.07 KB, 下载次数: 22)
#==============================================================================[/font][/color][/b]# ++ グラフィック変更8方向移動 ver. 1.01 ++ #------------------------------------------------------------------------------ # 上下キーと左右キーを同時押しすることにより斜め移動を可能にし、 # 「Graphics/Characters」フォルダに # 「(先頭キャラクター名)+_quarter」という名前のファイルがある場合 # 斜め移動時のグラフィックとして使用します。(例:001-Fighter01_quarter) #------------------------------------------------------------------------------ #[設置上の注意] # 「グラフィック変更ダッシュ」と併用する場合、このスクリプトを # ダッシュスクリプトよりも下に置いてください。 # 斜め方向ダッシュの画像ファイル名は「(先頭キャラクター名)+_dash_quarter」に # なります。 #============================================================================== #============================================================================== # ■ Game_Player #============================================================================== class Game_Player < Game_Character #-------------------------------------------------------------------------- # ● フレーム更新 #-------------------------------------------------------------------------- alias update_para_quarter update def update update_para_quarter unless moving? or $game_system.map_interpreter.running? or @move_route_forcing or $game_temp.message_window_showing # 方向ボタンが押されていれば、その方向へプレイヤーを移動 case Input.dir8 when 1 # 左下に移動 move_lower_left when 3 # 右下に移動 move_lower_right when 7 # 左上に移動 move_upper_left when 9 # 右上に移動 move_upper_right end end end end #============================================================================== # ■ Sprite_Character #============================================================================== class Sprite_Character < RPG::Sprite #-------------------------------------------------------------------------- # ● フレーム更新 #-------------------------------------------------------------------------- alias update_para_quarter update def update update_para_quarter if @tile_id == 0 if (@character.direction - 2) % 2 == 1 # 斜め画像の有無をチェック if quarter_graphic_exist?(@character) # 斜め画像をセット if character.dash_on and dash_quarter_graphic_exist?(@character) @character_name = @character.character_name + "_dash_quarter" else @character_name = @character.character_name + "_quarter" end self.bitmap = RPG::Cache.character(@character_name, @character.character_hue) # 向きを取得 case @character.direction when 1 n = 0 when 3 n = 2 when 7 n = 1 when 9 n = 3 end else @character.direction = @character.sub_direction # 斜め画像が存在しないときの向き n = (@character.direction - 2) / 2 end # 転送元の矩形を設定 sx = @character.pattern * @cw sy = n * @ch self.src_rect.set(sx, sy, @cw, @ch) else self.bitmap = RPG::Cache.character(@character.character_name, @character.character_hue) # 転送元の矩形を設定 sx = @character.pattern * @cw sy = (@character.direction - 2) / 2 * @ch self.src_rect.set(sx, sy, @cw, @ch) end end end #-------------------------------------------------------------------------- # ○ 斜め画像の有無をチェック #-------------------------------------------------------------------------- def quarter_graphic_exist?(character) # 読み込みテスト begin RPG::Cache.character(character.character_name.to_s + "_quarter", character.character_hue) rescue return false end return true end #-------------------------------------------------------------------------- # ○ 斜めダッシュ画像の有無をチェック #-------------------------------------------------------------------------- def dash_quarter_graphic_exist?(character) # 読み込みテスト begin RPG::Cache.character(character.character_name.to_s + "_dash_quarter", character.character_hue) rescue return false end return true end end #============================================================================== # ■ Game_Character #============================================================================== class Game_Character #-------------------------------------------------------------------------- # ● 公開インスタンス変数 #-------------------------------------------------------------------------- attr_accessor :direction # 向き attr_accessor :sub_direction # 斜め画像が存在しないときの向き #-------------------------------------------------------------------------- # ● 左下に移動 #-------------------------------------------------------------------------- def move_lower_left # 向き固定でない場合 unless @direction_fix @sub_direction = @direction @direction = 1 # 右向きだった場合は左を、上向きだった場合は下を向く @sub_direction = (@sub_direction == 6 ? 4 : @sub_direction == 8 ? 2 : @sub_direction) end # 下→左、左→下 のどちらかのコースが通行可能な場合 if (passable?(@x, @y, 2) and passable?(@x, @y + 1, 4)) or (passable?(@x, @y, 4) and passable?(@x - 1, @y, 2)) # 座標を更新 @x -= 1 @y += 1 # 歩数増加 increase_steps end end #-------------------------------------------------------------------------- # ● 右下に移動 #-------------------------------------------------------------------------- def move_lower_right # 向き固定でない場合 unless @direction_fix @sub_direction = @direction @direction = 3 # 左向きだった場合は右を、上向きだった場合は下を向く @sub_direction = (@sub_direction == 4 ? 6 : @sub_direction == 8 ? 2 : @sub_direction) end # 下→右、右→下 のどちらかのコースが通行可能な場合 if (passable?(@x, @y, 2) and passable?(@x, @y + 1, 6)) or (passable?(@x, @y, 6) and passable?(@x + 1, @y, 2)) # 座標を更新 @x += 1 @y += 1 # 歩数増加 increase_steps end end #-------------------------------------------------------------------------- # ● 左上に移動 #-------------------------------------------------------------------------- def move_upper_left # 向き固定でない場合 unless @direction_fix @sub_direction = @direction @direction = 7 # 右向きだった場合は左を、下向きだった場合は上を向く @sub_direction = (@sub_direction == 6 ? 4 : @sub_direction == 2 ? 8 : @sub_direction) end # 上→左、左→上 のどちらかのコースが通行可能な場合 if (passable?(@x, @y, 8) and passable?(@x, @y - 1, 4)) or (passable?(@x, @y, 4) and passable?(@x - 1, @y, 8)) # 座標を更新 @x -= 1 @y -= 1 # 歩数増加 increase_steps end end #-------------------------------------------------------------------------- # ● 右上に移動 #-------------------------------------------------------------------------- def move_upper_right # 向き固定でない場合 unless @direction_fix @sub_direction = @direction @direction = 9 # 左向きだった場合は右を、下向きだった場合は上を向く @sub_direction = (@sub_direction == 4 ? 6 : @sub_direction == 2 ? 8 : @sub_direction) end # 上→右、右→上 のどちらかのコースが通行可能な場合 if (passable?(@x, @y, 8) and passable?(@x, @y - 1, 6)) or (passable?(@x, @y, 6) and passable?(@x + 1, @y, 8)) # 座標を更新 @x += 1 @y -= 1 # 歩数増加 increase_steps end end #-------------------------------------------------------------------------- # ○ ダッシュスクリプト導入判定 #-------------------------------------------------------------------------- def dash_on if @dash_on != nil return @dash_on else return false end end end
quarter.jpg (4.07 KB, 下载次数: 18)
001-Fighter01_quarter.png (4.75 KB, 下载次数: 20)
#============================================================================== # ++ 中断セーブ ver. 1.00 ++ # Script by パラ犬 # [url]http://2d6.parasite.jp/[/url] #------------------------------------------------------------------------------ # メニューの「ゲーム終了」に中断セーブ機能を追加します。 # 中断セーブデータは一度呼び出すと消滅します。 #============================================================================== module PARA_RESTART # メニューに表示する文字 MENU_COMMAND_NAME = "中断セーブ" # タイトル画面に表示する文字 TITLE_COMMAND_NAME = "中断データから再開" # 中断時の戻り先( 0:ゲーム終了 1:タイトル画面 ) RETURN_SCENE = 1 # 確認メッセージ DIALOG1 = "一時保存して中断" # セーブして中断 DIALOG2 = "一時保存しないで中断" # セーブしないで中断 DIALOG3 = "キャンセル" # 戻る # ファイル名 FILENAME = "SaveTemp.rxdata" end #============================================================================== # ■ Scene_End #============================================================================== class Scene_End #-------------------------------------------------------------------------- # ● メイン処理 #-------------------------------------------------------------------------- def main # コマンドウィンドウを作成 s1 = PARA_RESTART::DIALOG1 s2 = PARA_RESTART::DIALOG2 s3 = PARA_RESTART::DIALOG3 @command_window = Window_Command.new(192, [s1, s2, s3]) @command_window.x = 320 - @command_window.width / 2 @command_window.y = 240 - @command_window.height / 2 # トランジション実行 Graphics.transition # メインループ loop do # ゲーム画面を更新 Graphics.update # 入力情報を更新 Input.update # フレーム更新 update # 画面が切り替わったらループを中断 if $scene != self break end end # トランジション準備 Graphics.freeze # ウィンドウを解放 @command_window.dispose # タイトル画面に切り替え中の場合 if $scene.is_a?(Scene_Title) # 画面をフェードアウト Graphics.transition Graphics.freeze end end #-------------------------------------------------------------------------- # ● フレーム更新 #-------------------------------------------------------------------------- def update # コマンドウィンドウを更新 @command_window.update # B ボタンが押された場合 if Input.trigger?(Input::B) # キャンセル SE を演奏 $game_system.se_play($data_system.cancel_se) # メニュー画面に切り替え $scene = Scene_Menu.new(5) return end # C ボタンが押された場合 if Input.trigger?(Input::C) # コマンドウィンドウのカーソル位置で分岐 case @command_window.index when 0 # セーブして中断 command_save_and_end when 1 # セーブしないで中断 command_no_save_and_end when 2 # やめる command_cancel end return end end #-------------------------------------------------------------------------- # ○ コマンド [セーブして中断] 選択時の処理 #-------------------------------------------------------------------------- def command_save_and_end # セーブデータの書き込み file = File.open(PARA_RESTART::FILENAME, "wb") write_save_data(file) file.close # 中断処理(セーブしないで中断と共通) command_no_save_and_end end #-------------------------------------------------------------------------- # ○ コマンド [セーブしないで中断] 選択時の処理 #-------------------------------------------------------------------------- def command_no_save_and_end case PARA_RESTART::RETURN_SCENE when 0 # ゲーム終了 command_shutdown when 1 # タイトル画面 command_to_title end end #-------------------------------------------------------------------------- # ○ セーブデータの書き込み # file : 書き込み用ファイルオブジェクト (オープン済み) #-------------------------------------------------------------------------- def write_save_data(file) # セーブファイル描画用のキャラクターデータを作成 characters = [] for i in 0...$game_party.actors.size actor = $game_party.actors[i] characters.push([actor.character_name, actor.character_hue]) end # セーブファイル描画用のキャラクターデータを書き込む Marshal.dump(characters, file) # プレイ時間計測用のフレームカウントを書き込む Marshal.dump(Graphics.frame_count, file) # セーブ回数を 1 増やす $game_system.save_count += 1 # マジックナンバーを保存する # (エディタで保存するたびにランダムな値に書き換えられる) $game_system.magic_number = $data_system.magic_number # 各種ゲームオブジェクトを書き込む Marshal.dump($game_system, file) Marshal.dump($game_switches, file) Marshal.dump($game_variables, file) Marshal.dump($game_self_switches, file) Marshal.dump($game_screen, file) Marshal.dump($game_actors, file) Marshal.dump($game_party, file) Marshal.dump($game_troop, file) Marshal.dump($game_map, file) Marshal.dump($game_player, file) end end #============================================================================== # ■ Scene_Menu #============================================================================== class Scene_Menu #-------------------------------------------------------------------------- # ● メイン処理 #-------------------------------------------------------------------------- def main # コマンドウィンドウを作成 s1 = $data_system.words.item s2 = $data_system.words.skill s3 = $data_system.words.equip s4 = "ステータス" s5 = "セーブ" s6 = PARA_RESTART::MENU_COMMAND_NAME @command_window = Window_Command.new(160, [s1, s2, s3, s4, s5, s6]) @command_window.index = @menu_index # パーティ人数が 0 人の場合 if $game_party.actors.size == 0 # アイテム、スキル、装備、ステータスを無効化 @command_window.disable_item(0) @command_window.disable_item(1) @command_window.disable_item(2) @command_window.disable_item(3) end # セーブ禁止の場合 if $game_system.save_disabled # セーブを無効にする @command_window.disable_item(4) end # プレイ時間ウィンドウを作成 @playtime_window = Window_PlayTime.new @playtime_window.x = 0 @playtime_window.y = 224 # 歩数ウィンドウを作成 @steps_window = Window_Steps.new @steps_window.x = 0 @steps_window.y = 320 # ゴールドウィンドウを作成 @gold_window = Window_Gold.new @gold_window.x = 0 @gold_window.y = 416 # ステータスウィンドウを作成 @status_window = Window_MenuStatus.new @status_window.x = 160 @status_window.y = 0 # トランジション実行 Graphics.transition # メインループ loop do # ゲーム画面を更新 Graphics.update # 入力情報を更新 Input.update # フレーム更新 update # 画面が切り替わったらループを中断 if $scene != self break end end # トランジション準備 Graphics.freeze # ウィンドウを解放 @command_window.dispose @playtime_window.dispose @steps_window.dispose @gold_window.dispose @status_window.dispose end end #============================================================================== # ■ Scene_Title #------------------------------------------------------------------------------ # タイトル画面の処理を行うクラスです。 #============================================================================== class Scene_Title #-------------------------------------------------------------------------- # ● メイン処理 #-------------------------------------------------------------------------- def main # 戦闘テストの場合 if $BTEST battle_test return end # データベースをロード $data_actors = load_data("Data/Actors.rxdata") $data_classes = load_data("Data/Classes.rxdata") $data_skills = load_data("Data/Skills.rxdata") $data_items = load_data("Data/Items.rxdata") $data_weapons = load_data("Data/Weapons.rxdata") $data_armors = load_data("Data/Armors.rxdata") $data_enemies = load_data("Data/Enemies.rxdata") $data_troops = load_data("Data/Troops.rxdata") $data_states = load_data("Data/States.rxdata") $data_animations = load_data("Data/Animations.rxdata") $data_tilesets = load_data("Data/Tilesets.rxdata") $data_common_events = load_data("Data/CommonEvents.rxdata") $data_system = load_data("Data/System.rxdata") # システムオブジェクトを作成 $game_system = Game_System.new # タイトルグラフィックを作成 [url=home.php?mod=space&uid=114926]@sprite[/url] = Sprite.new @sprite.bitmap = RPG::Cache.title($data_system.title_name) # コマンドウィンドウを作成 s1 = "ニューゲーム" s2 = "コンティニュー" s3 = "シャットダウン" s4 = PARA_RESTART::TITLE_COMMAND_NAME @command_window = Window_Command.new(192, [s1, s2 ,s4 ,s3]) @command_window.back_opacity = 160 @command_window.x = 320 - @command_window.width / 2 @command_window.y = 288 # コンティニュー有効判定 # セーブファイルがひとつでも存在するかどうかを調べる # 有効なら @continue_enabled を true、無効なら false にする @continue_enabled = false for i in 0..3 if FileTest.exist?("Save#{i+1}.rxdata") @continue_enabled = true end end # コンティニューが有効な場合、カーソルをコンティニューに合わせる # 無効な場合、コンティニューの文字をグレー表示にする if @continue_enabled @command_window.index = 1 else @command_window.disable_item(1) end # 中断データ有効判定 # 中断セーブファイルが存在するかどうかを調べる # 有効なら @restart_enabled を true、無効なら false にする @restart_enabled = false if FileTest.exist?(PARA_RESTART::FILENAME) @restart_enabled = true end # コンティニューが有効な場合、カーソルをコンティニューに合わせる # 無効な場合、コンティニューの文字をグレー表示にする if @restart_enabled @command_window.index = 2 else @command_window.disable_item(2) end # タイトル BGM を演奏 $game_system.bgm_play($data_system.title_bgm) # ME、BGS の演奏を停止 Audio.me_stop Audio.bgs_stop # トランジション実行 Graphics.transition # メインループ loop do # ゲーム画面を更新 Graphics.update # 入力情報を更新 Input.update # フレーム更新 update # 画面が切り替わったらループを中断 if $scene != self break end end # トランジション準備 Graphics.freeze # コマンドウィンドウを解放 @command_window.dispose # タイトルグラフィックを解放 @sprite.bitmap.dispose @sprite.dispose end #-------------------------------------------------------------------------- # ● フレーム更新 #-------------------------------------------------------------------------- def update # コマンドウィンドウを更新 @command_window.update # C ボタンが押された場合 if Input.trigger?(Input::C) # コマンドウィンドウのカーソル位置で分岐 case @command_window.index when 0 # ニューゲーム command_new_game when 1 # コンティニュー command_continue when 2 # 再開 command_restart when 3 # シャットダウン command_shutdown end end end #-------------------------------------------------------------------------- # ○ コマンド : 再開 #-------------------------------------------------------------------------- def command_restart # コンティニューが無効の場合 unless @restart_enabled # ブザー SE を演奏 $game_system.se_play($data_system.buzzer_se) return end # 決定 SE を演奏 $game_system.se_play($data_system.decision_se) # ファイルが存在しない場合 unless FileTest.exist?(PARA_RESTART::FILENAME) # ブザー SE を演奏 $game_system.se_play($data_system.buzzer_se) return end # テンポラリオブジェクトを再作成 $game_temp = Game_Temp.new # セーブデータの読み込み file = File.open(PARA_RESTART::FILENAME, "rb") read_save_data(file) file.close # ファイルの削除 File.delete(PARA_RESTART::FILENAME) # BGM、BGS を復帰 $game_system.bgm_play($game_system.playing_bgm) $game_system.bgs_play($game_system.playing_bgs) # マップを更新 (並列イベント実行) $game_map.update # マップ画面に切り替え $scene = Scene_Map.new end #-------------------------------------------------------------------------- # ○ セーブデータの読み込み # file : 読み込み用ファイルオブジェクト (オープン済み) #-------------------------------------------------------------------------- def read_save_data(file) # セーブファイル描画用のキャラクターデータを読み込む characters = Marshal.load(file) # プレイ時間計測用のフレームカウントを読み込む Graphics.frame_count = Marshal.load(file) # 各種ゲームオブジェクトを読み込む $game_system = Marshal.load(file) $game_switches = Marshal.load(file) $game_variables = Marshal.load(file) $game_self_switches = Marshal.load(file) $game_screen = Marshal.load(file) $game_actors = Marshal.load(file) $game_party = Marshal.load(file) $game_troop = Marshal.load(file) $game_map = Marshal.load(file) $game_player = Marshal.load(file) # マジックナンバーがセーブ時と異なる場合 # (エディタで編集が加えられている場合) if $game_system.magic_number != $data_system.magic_number # マップをリロード $game_map.setup($game_map.map_id) $game_player.center($game_player.x, $game_player.y) end # パーティメンバーをリフレッシュ $game_party.refresh end end
- 标题画面定制组合的补丁 - 标题画面定制,菜单命令中断保存, 我想是能够使用图像。 |
restert_2.jpg (27.5 KB, 下载次数: 18)
restert_1.jpg (12.12 KB, 下载次数: 22)
#============================================================================== # ++ ステータス表示プラス ver. 1.10 ++ # Script by パラ犬 # [url]http://2d6.parasite.jp/[/url] #------------------------------------------------------------------------------ # [機能1] ステータス画面のアクター名をフルネームで表示 # [機能2] ステータス画面のグラフィックを変更 # [機能3] クラス名を非表示 #------------------------------------------------------------------------------ # [グラフィックの種類『ピクチャー』の使い方] # 「Graphics/Pictures」フォルダに、アクターグラフィックと同名の画像ファイルを # インポートします。 # 『歩行グラフィックに依存』の場合は歩行グラフィック名が、 # 『バトラーに依存』の場合はバトラーグラフィック名が # ピクチャーのファイル名となります。 #============================================================================== module PARA_STSW # アクターのフルネーム(書式は FULLNAME[ アクターID ] = "名前") # {name}と入れると、そのアクターの名前を表示します。 FULLNAME=[]#この行は消さないでください FULLNAME[1] = "{name}=モッチャリーノ" FULLNAME[2] = "“タワシ頭のプリンス”バジル" # グラフィックの種類 #( 0:歩行グラフィック / 1:バトラーグラフィック / # 2:ピクチャー(歩行グラフィックに依存) / 3:ピクチャー(バトラーに依存) ) STATUS_GRAPHIC_TYPE = 1 # 文字位置を横にずらす # (ピクチャーのサイズが大きすぎて文字と重なるときに設定。0で初期位置) STATUS_SHIFT = 32 # クラス名を非表示にする( true / false ) DRAW_SKIP_CLASS = false end # ↑ 設定項目ここまで #------------------------------------------------------------------------------ #============================================================================== # ■ Window_Status #============================================================================== class Window_Status < Window_Base #-------------------------------------------------------------------------- # ● リフレッシュ #-------------------------------------------------------------------------- alias refresh_para_stsw refresh def refresh @draw_skip_graphic = true @draw_skip_name = true @draw_skip_class = true refresh_para_stsw # 詳細ステータスの文字位置を横にずらす if PARA_STSW::STATUS_SHIFT != 0 @status_sprite = Sprite.new @status_sprite.x = 16 + PARA_STSW::STATUS_SHIFT @status_sprite.y = 16 @status_sprite.z = self.z + 1 @status_sprite.bitmap = self.contents.dup self.contents.clear end # グラフィックを描画 @draw_skip_graphic = false case PARA_STSW::STATUS_GRAPHIC_TYPE when 0 draw_actor_graphic(@actor, 40, 112) when 1 draw_battler_graphic_para(@actor, 0, 40) when 2 draw_actor_picture_para(@actor, 0, 40) when 3 draw_battler_picture_para(@actor, 0, 40) end # アクターの名前を描画 @draw_skip_name = false @draw_skip_class = PARA_STSW::DRAW_SKIP_CLASS if PARA_STSW::FULLNAME[@actor.id] != nil text = PARA_STSW::FULLNAME[@actor.id].dup name = @actor.name begin text[/{name}/] = "#{name}" rescue end self.contents.draw_text(4, 0, 260, 32, text) draw_actor_class(@actor, 4 + 284, 0) else draw_actor_name(@actor, 4, 0) draw_actor_class(@actor, 4 + 144, 0) end end #-------------------------------------------------------------------------- # ○ 破棄 #-------------------------------------------------------------------------- alias dispose_para_stsw dispose def dispose dispose_para_stsw if @status_sprite != nil @status_sprite.dispose end end end #============================================================================== # ■ Window_Base #============================================================================== class Window_Base < Window #-------------------------------------------------------------------------- # ● オブジェクト初期化 #-------------------------------------------------------------------------- alias initialize_para_stsw initialize def initialize(x, y, width, height) initialize_para_stsw(x, y, width, height) @draw_skip_graphic = false @draw_skip_name = false @draw_skip_class = PARA_STSW::DRAW_SKIP_CLASS end #-------------------------------------------------------------------------- # ● グラフィックの描画 #-------------------------------------------------------------------------- alias draw_actor_graphic_para_stsw draw_actor_graphic def draw_actor_graphic(actor, x, y) if !(@draw_skip_graphic) draw_actor_graphic_para_stsw(actor, x, y) end end #-------------------------------------------------------------------------- # ● 名前の描画 #-------------------------------------------------------------------------- alias draw_actor_name_para_stsw draw_actor_name def draw_actor_name(actor, x, y) if !(@draw_skip_name) draw_actor_name_para_stsw(actor, x, y) end end #-------------------------------------------------------------------------- # ● クラスの描画 #-------------------------------------------------------------------------- alias draw_actor_class_para_stsw draw_actor_class def draw_actor_class(actor, x, y) if !(@draw_skip_class) draw_actor_class_para_stsw(actor, x, y) end end #-------------------------------------------------------------------------- # ○ バトラーグラフィックの描画 #-------------------------------------------------------------------------- def draw_battler_graphic_para(actor, x, y) bitmap = RPG::Cache.battler(actor.battler_name, actor.battler_hue) cw = bitmap.width ch = bitmap.height src_rect = Rect.new(0, 0, cw, ch) self.contents.blt(x, y, bitmap, src_rect) end #-------------------------------------------------------------------------- # ○ ピクチャーの描画(アクター) #-------------------------------------------------------------------------- def draw_actor_picture_para(actor, x, y) bitmap = RPG::Cache.picture(actor.character_name) cw = bitmap.width ch = bitmap.height src_rect = Rect.new(0, 0, cw, ch) self.contents.blt(x, y, bitmap, src_rect) end #-------------------------------------------------------------------------- # ○ ピクチャーの描画(バトラー) #-------------------------------------------------------------------------- def draw_battler_picture_para(actor, x, y) bitmap = RPG::Cache.picture(actor.battler_name) cw = bitmap.width ch = bitmap.height src_rect = Rect.new(0, 0, cw, ch) self.contents.blt(x, y, bitmap, src_rect) end end
status_plus.jpg (15.66 KB, 下载次数: 20)
#============================================================================== # ++ アクティブタイムバトル ver. 2.62 ++ #------------------------------------------------------------------------------ # CTゲージが溜まったバトラーから順にコマンド入力する戦闘形式。 # バトルステータス画面をサイドビューらしくする機能もあります。 # バトラーをサイドビュータイプに表示するスクリプトは、お好きなものを # 用意してください。 #------------------------------------------------------------------------------ #[設置上の注意] # 戦闘拡張系スクリプトを併用するときは、 # できるだけこのスクリプトより下に置いてください。 #------------------------------------------------------------------------------ #[操作] #・逃走 # 味方バトラーの一人以上がコマンド入力待ちのときにキャンセルボタンを押すことで # 「逃げる」コマンドが選択できます。 # 敵の数が多かったり、コマンド入力待ちのバトラーが少ないと、 # 逃走成功率が低くなります。 # #・行動順の入れ替え # 複数のバトラーが行動可能のとき、 # Rボタン(PageDownキー)で次のバトラーと順番を入れ替え、 # Lボタン(PageUpキー)で行動順をいちばん最後に回します。(ボタン変更可) #============================================================================== module PARA_CTB # コマンド入力時にCTのカウントを止めるか(true:止める / false:止めない) COMMAND_WAIT = false # アイテム、スキル、ターゲット選択時にCTのカウントを止めるか(true:止める / false:止めない) SELECT_WAIT = true # アニメーション表示時にCTのカウントを止めるか(true:止める / false:止めない) ANIMATION_WAIT = false # バトルスピード(数値が大きいほどCTの溜まりが速くなる) BATTLE_SPEED = 3 # バトルメンバーの最大数(多人数パーティスクリプトを導入している時に設定) PARTY_SIZE = 4 # 行動終了時のCT減少パーセンテージ ACT_ATTACK_CT = 100 # 通常攻撃 ACT_GUARD_CT = 100 # 防御 ACT_ESCAPE_CT = 100 # 逃走失敗 ACT_SKILL_CT = 100 # スキル ACT_ITEM_CT = 100 # アイテム # 逃走失敗時のメッセージ UNESCAPE_MES = "逃走失敗" # CT満タン時の効果音(""で音を鳴らさない) # 効果音は「Audio/SE」フォルダ内 FULL_CT_SE = "015-Jump01" # 効果音のボリューム FULL_CT_SE_VOL = 80 # CT満タン時のバトラーの色調((0,0,0)で変化なし) FULL_CT_COLOR = Tone.new(32,0,0) # HPゲージの色(グラデーション左端) HP_COLOR_LEFT = Color.new(128, 0, 0, 255) # HPゲージの色(グラデーション右端) HP_COLOR_RIGHT= Color.new(255, 0, 0, 255) # SPゲージの色(グラデーション左端) SP_COLOR_LEFT = Color.new(0, 0, 128, 255) # SPゲージの色(グラデーション右端) SP_COLOR_RIGHT= Color.new(0, 0, 255, 255) # CTゲージの色(グラデーション左端) COLOR_LEFT = Color.new(128, 128, 64, 255) # CTゲージの色(グラデーション右端) COLOR_RIGHT= Color.new(255, 255, 128, 255) # CTが満タンになったときのゲージの色 COLOR_FULL = Color.new(255, 225, 128, 255) # ゲージ枠の色 FRAME_COLOR = Color.new(192, 192, 192, 255) # ゲージ枠の太さ FRAME_BORDER = 1 # ゲージの背景色 BACK_COLOR = Color.new(128, 128, 128, 128) # 名前のフォントサイズ NAME_FONT_SIZE = 16 # HP/SPのフォントサイズ HPSP_FONT_SIZE = 18 # エネミー名のフォントサイズ ENEMY_FONT_SIZE = 16 # 最大HP/SPを描画するか( true / false ) MAX_DRAW = false # エネミー名をグループ化( true / false ) # (trueにすると「ゴースト 2」のようにまとめて表示します) ENEMY_GROUPING = false # エネミー名の下にゲージを表示( 0:なし / 1:HP / 2:CT ) # (エネミー名をグループ化している場合は無効) ENEMY_DRAWING_MATER = 0 # アクターのヘルプウインドウにHP/SPゲージを表示( true / false ) HELP_DRAWING_MATER_ACTOR = false # エネミーのヘルプウインドウにHP/SPゲージを表示( true / false ) HELP_DRAWING_MATER_ENEMY = false # コマンドウインドウの位置を強制指定( true / false ) #(他の方のサイドビュースクリプトを併用していて # コマンドウインドウの位置がどうしても不自然になるならtrueに) # ※trueにしても適用されない場合、このスクリプトを # サイドビューよりも下に置いてみてください WINDOWPOS_CHANGE = false WINDOWPOS_X = 100 # X座標 WINDOWPOS_Y = 320 # Y座標 # CTのカウント間隔。少ないほどゲージ描画がなめらかに。(最小値は0) # 処理が重い場合は、この数値を上げてください。 CT_SKIP = 1 # 行動順入れ替えボタン(表記方法は、Input::(ボタン)) #(キーボードとの対応表はツクールのヘルプにあります) CHANGE_NEXT = Input::R # 次のバトラーと順番を入れ替え CHANGE_LAST = Input::L # 行動順を最後に回す # コマンドウインドウの不透明度 WINDOW_OPACITY = 160 # バトルステータスウインドウの不透明度 WINDOW_MAIN_OPACITY = 255 # 逃走成功率補正。数値が大きいほど逃走しやすくなります。(最小値は1) # 「敵の敏捷値合計」と「コマンド入力待ちの味方の敏捷値合計」が同じとき、 # [数値]×10%の確率で逃走が成功します。 # -1にすると敏捷値にかかわらず確実に成功します。 ESCAPEABLE = 10 end # ↑ 設定項目ここまで #------------------------------------------------------------------------------ #============================================================================== # ■ Scene_Battle #============================================================================== class Scene_Battle #-------------------------------------------------------------------------- # ○ CTのカウント #-------------------------------------------------------------------------- def update_ct # カウントアップが許可されているとき if @countup for actor in $game_party.actors # 行動できるか if actor.movable? == false and actor.ct_visible and @phase4_step != 5 # 不可視状態でカウントアップ actor.ct_visible = false actor.countup = true actor.full_ct = false elsif actor.movable? and actor.ct_visible == false # 不可視カウントアップを解除 clear_ct(actor) actor.ct_visible = true end # アクターの入れ替えに対応 if actor.max_ct == 0 actor.max_ct = @max_ct end # アクターのカウントアップ if actor.countup # CTがmaxになっており、コマンド入力待ちアクターに含まれない if actor.now_ct >= @max_ct and !(@pre_action_battlers.include?(actor)) # コマンド入力待ちアクターに追加 @pre_action_battlers.push(actor) @action_count += 1 # 効果音を鳴らす if PARA_CTB::FULL_CT_SE != "" and actor.ct_visible Audio.se_play("Audio/SE/" + PARA_CTB::FULL_CT_SE,PARA_CTB::FULL_CT_SE_VOL) end # それ以上カウントアップしない actor.countup = false actor.full_ct = true else # カウントアップ actor.make_action_speed ct_skip = PARA_CTB::CT_SKIP + 1 actor.now_ct += actor.current_action.speed * PARA_CTB::BATTLE_SPEED * ct_skip end end end for enemy in $game_troop.enemies # 行動できるか if enemy.movable? == false and enemy.ct_visible and @phase4_step == 5 # 不可視状態でカウントアップ enemy.ct_visible = false enemy.countup = true enemy.full_ct = false elsif enemy.movable? and enemy.ct_visible == false # 不可視カウントアップを解除 clear_ct(enemy) enemy.ct_visible = true end # エネミーのカウントアップ if enemy.countup # CTがmaxになっており、行動待ちエネミーに含まれない if enemy.now_ct >= @max_ct and ! @pre_action_battlers.include?(enemy) # 行動待ちエネミーに追加 @pre_action_battlers.push(enemy) @action_count += 1 # それ以上カウントアップしない enemy.countup = false enemy.full_ct = true else # カウントアップ enemy.make_action_speed enemy.now_ct += enemy.current_action.speed * PARA_CTB::BATTLE_SPEED end end end # CTゲージを再描画 @status_window.refresh_ct @status_window2.refresh_ct end end #-------------------------------------------------------------------------- # ○ バトラーのCTを0に #-------------------------------------------------------------------------- def clear_ct(battler) battler.countup = true battler.now_ct = 0 battler.full_ct = false end #-------------------------------------------------------------------------- # ○ バトラーのCTを任意のパーセンテージに #-------------------------------------------------------------------------- def declease_ct(battler,percent) battler.countup = true battler.now_ct = battler.now_ct * percent / 100 battler.full_ct = false end #-------------------------------------------------------------------------- # ○ CTの初期化 #-------------------------------------------------------------------------- def initialize_ct # CTの基準値を決定 max_ct for battler in $game_party.actors + $game_troop.enemies if battler.movable? # 戦闘開始時にある程度のCTを溜めておく battler.now_ct = battler.agi * 300 battler.ct_visible = true else clear_ct(battler) battler.ct_visible = false end battler.countup = true battler.full_ct = false battler.max_ct = @max_ct end end #-------------------------------------------------------------------------- # ○ バトラー全員の素早さからCTの基準値を決定 #-------------------------------------------------------------------------- def max_ct for battler in $game_party.actors + $game_troop.enemies @max_ct += battler.agi end @max_ct = @max_ct * 500 / ($game_party.actors.size + $game_troop.enemies.size ) end #-------------------------------------------------------------------------- # ○ バトラーの行動順を変更 #-------------------------------------------------------------------------- def shift_activer(shift) # 一つシフトする時で後ろのアクターが2人以上 if @pre_action_battlers != nil if shift == 1 and @pre_action_battlers.size >= @actor_array_index + 3 # 現在のアクターを取得 act = @pre_action_battlers[@actor_array_index] # 現在のアクターを二つ後ろに挿入 @pre_action_battlers.insert(@actor_array_index+2, act) # 現在位置を消去 @pre_action_battlers.delete_at(@actor_array_index) @actor_array_index -= 1 phase3_next_actor else act = @pre_action_battlers[@actor_array_index] # 現在のアクターを一番後ろに追加 @pre_action_battlers.push(act) # 現在位置を消去 @pre_action_battlers.delete_at(@actor_array_index) @actor_array_index -= 1 phase3_next_actor end end end #-------------------------------------------------------------------------- # ● メイン処理 #-------------------------------------------------------------------------- alias main_ctb main def main # エネミー名ウインドウを作成 @status_window2 = Window_BattleStatus_enemy.new @action_battlers = [] @pre_action_battlers = [] @max_ct = 0 @countup = false @ct_wait = 0 @action_count = 0 main_ctb # エネミー名ウインドウを破棄 @status_window2.dispose end #-------------------------------------------------------------------------- # ● フレーム更新 #-------------------------------------------------------------------------- alias ctb_update update def update # バトルイベント実行中の場合 if $game_system.battle_interpreter.running? # インタプリタを更新 $game_system.battle_interpreter.update # アクションを強制されているバトラーが存在しない場合 if $game_temp.forcing_battler == nil # バトルイベントの実行が終わった場合 unless $game_system.battle_interpreter.running? # 戦闘継続の場合、バトルイベントのセットアップを再実行 unless judge setup_battle_event end end # アフターバトルフェーズでなければ if @phase != 5 # ステータスウィンドウをリフレッシュ @status_window.refresh # エネミー名リストを更新 @status_window2.refresh end end else if @ct_wait > 0 @ct_wait -= 1 else update_ct @ct_wait = PARA_CTB::CT_SKIP end end ctb_update end #-------------------------------------------------------------------------- # ● プレバトルフェーズ開始 #-------------------------------------------------------------------------- alias ctb_start_phase1 start_phase1 def start_phase1 # CTを初期化 initialize_ct # カウントアップ開始 @countup = true ctb_start_phase1 end #-------------------------------------------------------------------------- # ● フレーム更新 (プレバトルフェーズ) #-------------------------------------------------------------------------- def update_phase1 # エネミー名リストを更新 @status_window2.refresh # 勝敗判定 if judge # 勝利または敗北の場合 : メソッド終了 return end # パーティーコマンドフェーズを飛ばしてアクターコマンドフェーズ開始 start_phase3 end #-------------------------------------------------------------------------- # ● パーティコマンドフェーズ開始 #-------------------------------------------------------------------------- def start_phase2 # フェーズ 2 に移行 @phase = 2 # アクターを非選択状態に設定 @actor_index = -1 @active_battler = nil # パーティコマンドウィンドウを有効化 @party_command_window.active = true @party_command_window.visible = true # アクターコマンドウィンドウを無効化 @actor_command_window.active = false @actor_command_window.visible = false # メインフェーズフラグをクリア $game_temp.battle_main_phase = false # コマンド入力不可能な場合 unless $game_party.inputable? # メインフェーズ開始 start_phase4 end end #-------------------------------------------------------------------------- # ● フレーム更新 (パーティコマンドフェーズ : 逃げる) #-------------------------------------------------------------------------- def update_phase2_escape # エネミーの素早さ合計を計算 enemies_agi = 0 for enemy in $game_troop.enemies if enemy.exist? enemies_agi += enemy.agi end end # 行動可能アクターの素早さ合計を計算 actors_agi = 0 for actor in @pre_action_battlers if actor.is_a?(Game_Actor) and actor.exist? actors_agi += actor.agi end end # 逃走成功判定 if PARA_CTB::ESCAPEABLE < 0 success = true else success = rand(100) < PARA_CTB::ESCAPEABLE * 10 * actors_agi / enemies_agi end # 逃走成功の場合 if success # 逃走 SE を演奏 $game_system.se_play($data_system.escape_se) # バトル開始前の BGM に戻す $game_system.bgm_play($game_temp.map_bgm) # CTをクリア for battler in $game_party.actors clear_ct(battler) end # バトル終了 battle_end(1) # 逃走失敗の場合 else # ヘルプウィンドウに "逃走失敗" をセット @help_window.set_text(PARA_CTB::UNESCAPE_MES, 1) # アクターのアクションとCTをクリア pre_action_battlers = @pre_action_battlers.clone for act in pre_action_battlers if act.is_a?(Game_Actor) declease_ct(act, 100-PARA_CTB::ACT_ESCAPE_CT) act.current_action.clear @pre_action_battlers.delete(act) end end @party_command_window.visible = false # ヘルプウィンドウを表示 @help_window.visible = true @wait_count = 20 # メインフェーズ開始 start_phase4 end end #-------------------------------------------------------------------------- # ● アクターコマンドフェーズ開始 #-------------------------------------------------------------------------- def start_phase3 # フェーズ 3 に移行 @phase = 3 # アクターを非選択状態に設定 @actor_index = -1 @active_battler = nil @actor_array_index = -1 # 次のアクターのコマンド入力へ if @pre_action_battlers != [] phase3_next_actor else start_phase4 end end #-------------------------------------------------------------------------- # ● 次のアクターのコマンド入力へ #-------------------------------------------------------------------------- def phase3_next_actor # ループ begin # アクターの明滅エフェクト OFF if @active_battler != nil @active_battler.blink = false end # 最後のアクターの場合 if @actor_array_index + 1 >= @pre_action_battlers.size # メインフェーズ開始 start_phase4 return #次がエネミーの場合 elsif $game_troop.enemies.include?(@pre_action_battlers[@actor_array_index + 1]) # メインフェーズ開始 start_phase4 return end # アクターのインデックスを進める @actor_array_index += 1 @actor_index = @pre_action_battlers[@actor_array_index].index @active_battler = $game_party.actors[@actor_index] # バトルイベントが予約されている場合 if @active_battler.current_action.forcing # メインフェーズ開始 start_phase4 return end @active_battler.blink = true @active_battler.current_action.clear # アクターがコマンド入力を受け付けない状態ならもう一度 end until @active_battler.inputable? # アクターコマンドウィンドウをセットアップ phase3_setup_command_window end #-------------------------------------------------------------------------- # ● 前のアクターのコマンド入力へ #-------------------------------------------------------------------------- def phase3_prior_actor # ループ begin # アクターの明滅エフェクト OFF if @active_battler != nil @active_battler.blink = false end # 最初のアクターの場合 if @actor_array_index <= 0 # アクターコマンドフェーズ開始 start_phase2 return end # アクターのインデックスを戻す @actor_array_index -= 1 @actor_index = @pre_action_battlers[@actor_array_index].index @active_battler = $game_party.actors[@actor_index] @active_battler.blink = true @active_battler.current_action.clear # アクターがコマンド入力を受け付けない状態ならもう一度 end until @active_battler.inputable? # アクターコマンドウィンドウをセットアップ phase3_setup_command_window end #-------------------------------------------------------------------------- # ● アクターコマンドウィンドウのセットアップ #-------------------------------------------------------------------------- alias phase3_setup_command_window_ctb phase3_setup_command_window def phase3_setup_command_window @actor_command_window.back_opacity = PARA_CTB::WINDOW_OPACITY phase3_setup_command_window_ctb if PARA_CTB::WINDOWPOS_CHANGE # アクターコマンドウィンドウの位置を設定 @actor_command_window.x = PARA_CTB::WINDOWPOS_X @actor_command_window.y = PARA_CTB::WINDOWPOS_Y # ステータスウインドウに隠れないように @actor_command_window.z = 9999 end end #-------------------------------------------------------------------------- # ● フレーム更新 (アクターコマンドフェーズ) #-------------------------------------------------------------------------- def update_phase3 # エネミーアローが有効の場合 if @enemy_arrow != nil @countup = PARA_CTB::SELECT_WAIT ? false : true update_phase3_enemy_select # アクターアローが有効の場合 elsif @actor_arrow != nil @countup = PARA_CTB::SELECT_WAIT ? false : true update_phase3_actor_select # スキルウィンドウが有効の場合 elsif @skill_window != nil @countup = PARA_CTB::SELECT_WAIT ? false : true update_phase3_skill_select # アイテムウィンドウが有効の場合 elsif @item_window != nil @countup = PARA_CTB::SELECT_WAIT ? false : true update_phase3_item_select # アクターコマンドウィンドウが有効の場合 elsif @actor_command_window.active @countup = PARA_CTB::COMMAND_WAIT ? false : true update_phase3_basic_command end end #-------------------------------------------------------------------------- # ● フレーム更新 (アクターコマンドフェーズ : 基本コマンド) #-------------------------------------------------------------------------- alias ctb_update_phase3_basic_command update_phase3_basic_command def update_phase3_basic_command ctb_update_phase3_basic_command # LRボタンで行動順を変更 if Input.trigger?(PARA_CTB::CHANGE_NEXT) shift_activer(1) end if Input.trigger?(PARA_CTB::CHANGE_LAST) shift_activer(-1) end end #-------------------------------------------------------------------------- # ● メインフェーズ開始 #-------------------------------------------------------------------------- def start_phase4 # フェーズ 4 に移行 @phase = 4 battler_count = $game_party.actors.size + $game_troop.enemies.size if @action_count >= battler_count or $game_temp.battle_turn == 0 # バトルイベントの全ページを検索 for index in 0...$data_troops[@troop_id].pages.size # イベントページを取得 page = $data_troops[@troop_id].pages[index] # このページのスパンが [ターン] の場合 if page.span == 1 # 実行済みフラグをクリア $game_temp.battle_event_flags[index] = false end end # ターン数カウント $game_temp.battle_turn += 1 @action_count = 0 end # アクターを非選択状態に設定 @actor_index = -1 @active_battler = nil # パーティコマンドウィンドウを有効化 @party_command_window.active = false @party_command_window.visible = false # アクターコマンドウィンドウを無効化 @actor_command_window.active = false @actor_command_window.visible = false # メインフェーズフラグをセット $game_temp.battle_main_phase = true # エネミーアクション作成 for enemy in $game_troop.enemies unless enemy.current_action.forcing enemy.make_action end end # 行動順序作成 make_action_orders # ステップ 1 に移行 @phase4_step = 1 end #-------------------------------------------------------------------------- # ● 行動順序作成 #-------------------------------------------------------------------------- def make_action_orders # 配列 @action_battlers を初期化 @action_battlers = [] if @pre_action_battlers != [] for i in 0..@actor_array_index # アクターを配列 @action_battlers に追加 @action_battlers.push(@pre_action_battlers[0]) @pre_action_battlers.shift end if @pre_action_battlers.size != 0 loop do if $game_troop.enemies.include?(@pre_action_battlers[0]) # エネミーを配列 @action_battlers に追加 @action_battlers.push(@pre_action_battlers[0]) @pre_action_battlers.shift else break end end end end end #-------------------------------------------------------------------------- # ● フレーム更新 (メインフェーズ ステップ 1 : アクション準備) #-------------------------------------------------------------------------- alias ctb_update_phase4_step1 update_phase4_step1 def update_phase4_step1 @countup = true # ヘルプウィンドウを隠す @help_window.visible = false # 勝敗判定 if judge # 勝利または敗北の場合 : メソッド終了 return end # 未行動バトラーが存在しない場合 (全員行動した) if @action_battlers.size == 0 # アクターコマンドフェーズ開始 start_phase3 return end ctb_update_phase4_step1 end #-------------------------------------------------------------------------- # ● フレーム更新 (メインフェーズ ステップ 2 : アクション開始) #-------------------------------------------------------------------------- alias ctb_update_phase4_step2 update_phase4_step2 def update_phase4_step2 # 強制アクションでなければ unless @active_battler.current_action.forcing # 制約が [行動できない] の場合 if @active_battler.restriction == 4 # CTをクリア clear_ct(@active_battler) # アクション強制対象のバトラーをクリア $game_temp.forcing_battler = nil # ステップ 1 に移行 @phase4_step = 1 return end end # アニメーション再生中にCTをカウントするか @countup = PARA_CTB::ANIMATION_WAIT ? false : true ctb_update_phase4_step2 end #-------------------------------------------------------------------------- # ● 基本アクション 結果作成 #-------------------------------------------------------------------------- alias make_basic_action_result_ctb make_basic_action_result def make_basic_action_result # 何もしないの場合 if @active_battler.current_action.basic == 3 # CTをクリア clear_ct(@active_battler) # アクション強制対象のバトラーをクリア $game_temp.forcing_battler = nil # ステップ 1 に移行 @phase4_step = 1 return end make_basic_action_result_ctb end #-------------------------------------------------------------------------- # ● スキルアクション 結果作成 #-------------------------------------------------------------------------- def make_skill_action_result # スキルを取得 [url=home.php?mod=space&uid=260100]@skill[/url] = $data_skills[@active_battler.current_action.skill_id] # 強制アクションでなければ unless @active_battler.current_action.forcing # SP 切れなどで使用できなくなった場合 unless @active_battler.skill_can_use?(@skill.id) # アクション強制対象のバトラーをクリア $game_temp.forcing_battler = nil # CTをクリア declease_ct(@active_battler,100-PARA_CTB::ACT_SKILL_CT) # ステップ 1 に移行 @phase4_step = 1 return end end # SP 消費 @active_battler.sp -= @skill.sp_cost # ステータスウィンドウをリフレッシュ @status_window.refresh # ヘルプウィンドウにスキル名を表示 @help_window.set_text(@skill.name, 1) # アニメーション ID を設定 @animation1_id = @skill.animation1_id @animation2_id = @skill.animation2_id # コモンイベント ID を設定 @common_event_id = @skill.common_event_id # 対象側バトラーを設定 set_target_battlers(@skill.scope) # スキルの効果を適用 for target in @target_battlers target.skill_effect(@active_battler, @skill) end end #-------------------------------------------------------------------------- # ● アイテムアクション 結果作成 #-------------------------------------------------------------------------- alias ctb_make_item_action_result make_item_action_result def make_item_action_result # アイテムを取得 @item = $data_items[@active_battler.current_action.item_id] # アイテム切れなどで使用できなくなった場合 unless $game_party.item_can_use?(@item.id) # CTをクリア declease_ct(@active_battler,100-PARA_CTB::ACT_ITEM_CT) # ステップ 1 に移行 @phase4_step = 1 return end ctb_make_item_action_result end #-------------------------------------------------------------------------- # ● フレーム更新 (メインフェーズ ステップ 5 : ダメージ表示) #-------------------------------------------------------------------------- alias update_phase4_step5_ctb update_phase4_step5 def update_phase4_step5 # ダメージを記録 for target in @target_battlers if target.damage != nil target.movable_backup = target.movable? end end update_phase4_step5_ctb end #-------------------------------------------------------------------------- # ● フレーム更新 (メインフェーズ ステップ 6 : リフレッシュ) #-------------------------------------------------------------------------- alias update_phase4_step6_ctb update_phase4_step6 def update_phase4_step6 @active_battler.countup = true if @active_battler.current_action.basic == 1 # 防御 declease_ct(@active_battler,100-PARA_CTB::ACT_GUARD_CT) else case @active_battler.current_action.kind # 攻撃 when 0 declease_ct(@active_battler,100-PARA_CTB::ACT_ATTACK_CT) # スキル when 1 declease_ct(@active_battler,100-PARA_CTB::ACT_SKILL_CT) # アイテム when 2 declease_ct(@active_battler,100-PARA_CTB::ACT_ITEM_CT) else clear_ct(@active_battler) end end # ターゲットが行動不能になったらCTを0に for target in @target_battlers if target.movable? == false and target.movable_backup == true clear_ct(target) @status_window.refresh_ct end end update_phase4_step6_ctb # エネミー名リストを更新 @status_window2.refresh # アクションをクリア if @active_battler.guarding? == false @active_battler.current_action.clear end end #-------------------------------------------------------------------------- # ● アフターバトルフェーズ開始 #-------------------------------------------------------------------------- alias ctb_start_phase5 start_phase5 def start_phase5 @countup = false ctb_start_phase5 end end #============================================================================== # ■ Window_BattleStatus #============================================================================== class Window_BattleStatus < Window_Base #-------------------------------------------------------------------------- # ● オブジェクト初期化 #-------------------------------------------------------------------------- def initialize super(160, 320, 480, 160) self.contents = Bitmap.new(width - 32, height - 32) self.back_opacity = PARA_CTB::WINDOW_MAIN_OPACITY @level_up_flags = [false, false, false, false] @before_hp = [] @before_sp = [] @before_states = [] @now_hp = [] @now_sp = [] @now_states = [] refresh end #-------------------------------------------------------------------------- # ● リフレッシュ #-------------------------------------------------------------------------- def refresh @item_max = $game_party.actors.size for i in 0...$game_party.actors.size actor = $game_party.actors[i] line_height = 120 / PARA_CTB::PARTY_SIZE actor_y = i * line_height + 4 # 現在のステータスを配列に @now_hp[i] = actor.hp @now_sp[i] = actor.sp @now_states[i] = actor.states # レベルアップ if @level_up_flags[i] self.contents.fill_rect(344, actor_y+14, 100, 8, Color.new(0, 0, 0, 0)) self.contents.font.color = normal_color self.contents.draw_text(344, actor_y, 120, 32, "LEVEL UP!") end end # バトルステータスの軽量化処理 # ステータスの配列が変化したときのみ描画処理 if @before_hp == nil or @before_sp == nil or @before_states == nil or @before_hp != @now_hp or @before_sp != @now_sp or @before_states != @now_states self.contents.clear for j in 0...$game_party.actors.size actor = $game_party.actors[j] line_height = 120 / PARA_CTB::PARTY_SIZE actor_y = j * line_height + 4 self.contents.font.size = PARA_CTB::NAME_FONT_SIZE # 名前を描画 draw_actor_name(actor, 4, actor_y+16-PARA_CTB::NAME_FONT_SIZE) # HPを描画 hp_color1 = PARA_CTB::HP_COLOR_LEFT hp_color2 = PARA_CTB::HP_COLOR_RIGHT draw_meter(actor.hp, actor.maxhp, 125, actor_y+14, 80, 8, hp_color1, hp_color2) draw_actor_hp(actor, 102, actor_y+16-PARA_CTB::HPSP_FONT_SIZE, 100) # SPを描画 sp_color1 = PARA_CTB::SP_COLOR_LEFT sp_color2 = PARA_CTB::SP_COLOR_RIGHT draw_meter(actor.sp, actor.maxsp, 245, actor_y+14, 80, 8, sp_color1, sp_color2) draw_actor_sp(actor, 222, actor_y+16-PARA_CTB::HPSP_FONT_SIZE, 100) # 変化後のステータスを配列に @before_hp[j] = actor.hp @before_sp[j] = actor.sp @before_states[j] = actor.states # レベルアップ if @level_up_flags[j] self.contents.fill_rect(344, actor_y, 100, 8, Color.new(0, 0, 0, 0)) self.contents.font.color = normal_color self.contents.draw_text(344, actor_y, 120, 32, "LEVEL UP!") end end end refresh_ct end #-------------------------------------------------------------------------- # ● CTゲージのリフレッシュ #-------------------------------------------------------------------------- def refresh_ct for i in 0...$game_party.actors.size actor = $game_party.actors[i] line_height = 120 / PARA_CTB::PARTY_SIZE actor_y = i * line_height + 4 # CTが満タンになったときのゲージの色 ct_color_full = PARA_CTB::COLOR_FULL # CTゲージの色(左端) ct_color_start = actor.full_ct ? ct_color_full : PARA_CTB::COLOR_LEFT # CTゲージの色(右端) ct_color_end = actor.full_ct ? ct_color_full : PARA_CTB::COLOR_RIGHT if @level_up_flags[i] != true and actor.ct_visible draw_meter(actor.now_ct, actor.max_ct, 344, actor_y+14, 100, 8, ct_color_start, ct_color_end) elsif @level_up_flags[i] != true draw_meter(0, actor.max_ct, 344, actor_y+14, 100, 8, ct_color_start, ct_color_end) end end end #-------------------------------------------------------------------------- # ● フレーム更新 #-------------------------------------------------------------------------- def update super end #-------------------------------------------------------------------------- # ● HP の描画 # actor : アクター # x : 描画先 X 座標 # y : 描画先 Y 座標 # width : 描画先の幅 #-------------------------------------------------------------------------- def draw_actor_hp(actor, x, y, width = 144) # 文字列 "HP" を描画 self.contents.font.color = system_color self.contents.font.size = 16 self.contents.draw_text(x, y+2, 32, 32, $data_system.words.hp) self.contents.font.color = normal_color self.contents.font.size = PARA_CTB::HPSP_FONT_SIZE if PARA_CTB::MAX_DRAW # MaxHP を描画 self.contents.draw_text(x, y, width, 32, actor.maxhp.to_s, 2) text_size = self.contents.text_size(actor.maxhp.to_s) text_x = x + width - text_size.width - 12 self.contents.draw_text(text_x, y, 12, 32, "/", 1) # HP を描画 self.contents.font.color = actor.hp == 0 ? knockout_color : actor.hp <= actor.maxhp / 4 ? crisis_color : normal_color text_x = text_x - text_size.width self.contents.draw_text(text_x, y, text_size.width, 32, actor.hp.to_s, 2) else self.contents.font.color = actor.hp == 0 ? knockout_color : actor.hp <= actor.maxhp / 4 ? crisis_color : normal_color self.contents.draw_text(x, y, width, 32, actor.hp.to_s, 2) end end #-------------------------------------------------------------------------- # ● SP の描画 # actor : アクター # x : 描画先 X 座標 # y : 描画先 Y 座標 # width : 描画先の幅 #-------------------------------------------------------------------------- def draw_actor_sp(actor, x, y, width = 144) # 文字列 "SP" を描画 self.contents.font.color = system_color self.contents.font.size = 16 self.contents.draw_text(x, y+2, 32, 32, $data_system.words.sp) self.contents.font.color = normal_color self.contents.font.size = PARA_CTB::HPSP_FONT_SIZE if PARA_CTB::MAX_DRAW # MaxSP を描画 self.contents.draw_text(x, y, width, 32, actor.maxsp.to_s, 2) text_size = self.contents.text_size(actor.maxsp.to_s) text_x = x + width - text_size.width - 12 self.contents.draw_text(text_x, y, 12, 32, "/", 1) # SP を描画 self.contents.font.color = actor.sp == 0 ? knockout_color : actor.sp <= actor.maxsp / 4 ? crisis_color : normal_color text_x = text_x - text_size.width self.contents.draw_text(text_x, y, text_size.width, 32, actor.sp.to_s, 2) else self.contents.font.color = actor.sp == 0 ? knockout_color : actor.sp <= actor.maxsp / 4 ? crisis_color : normal_color self.contents.draw_text(x, y, width, 32, actor.sp.to_s, 2) end end end #============================================================================== # □ 敵の名前を表示するウインドウ #============================================================================== class Window_BattleStatus_enemy < Window_Base #-------------------------------------------------------------------------- # ○ オブジェクト初期化 #-------------------------------------------------------------------------- def initialize super(0, 320, 160, 160) self.contents = Bitmap.new(width - 32, height - 32) self.back_opacity = PARA_CTB::WINDOW_MAIN_OPACITY refresh end #-------------------------------------------------------------------------- # ○ リフレッシュ #-------------------------------------------------------------------------- def refresh self.contents.clear self.contents.font.color = normal_color self.contents.font.size = PARA_CTB::ENEMY_FONT_SIZE @exist_enemies = [] if $game_troop.enemies != nil if PARA_CTB::ENEMY_GROUPING ememy_list = [] ememy_list_index = [] # エネミーをグループ化 for i in 0...$game_troop.enemies.size enemy = $game_troop.enemies[i] if enemy.exist? if ememy_list.include?(enemy.name) ememy_list_index[ememy_list.index(enemy.name)] += 1 else # エネミー名を記録 ememy_list.push(enemy.name) ememy_list_index[ememy_list.index(enemy.name)] = 1 end end end # エネミーの名前と数を描画 enemy_index = 0 for enemy_name in ememy_list enemy_y = enemy_index * (PARA_CTB::ENEMY_FONT_SIZE+6) + 4 if ememy_list_index[enemy_index] > 1 enemy_name = enemy_name + " " + ememy_list_index[enemy_index].to_s end self.contents.draw_text(4, enemy_y, 160, 20, enemy_name) enemy_index += 1 end else # エネミーの名前を描画 enemy_index = 0 for i in 0...$game_troop.enemies.size enemy = $game_troop.enemies[i] if enemy.exist? @exist_enemies.push(enemy) line_height = PARA_CTB::ENEMY_FONT_SIZE + 6 if PARA_CTB::ENEMY_DRAWING_MATER != 0 line_height += 10 end enemy_y = enemy_index * line_height + 4 self.contents.draw_text(4, enemy_y, 160, 20, enemy.name) enemy_index += 1 if PARA_CTB::ENEMY_DRAWING_MATER == 1 hp_color1 = PARA_CTB::HP_COLOR_LEFT hp_color2 = PARA_CTB::HP_COLOR_RIGHT y = enemy_y + PARA_CTB::ENEMY_FONT_SIZE + 3 draw_meter(enemy.hp, enemy.maxhp, 4, y, 80, 8, hp_color1, hp_color2) end end end end end refresh_ct end #-------------------------------------------------------------------------- # ○ CTゲージのリフレッシュ #-------------------------------------------------------------------------- def refresh_ct if PARA_CTB::ENEMY_DRAWING_MATER == 2 and @exist_enemies != nil enemy_index = 0 for enemy in @exist_enemies line_height = PARA_CTB::ENEMY_FONT_SIZE + 16 enemy_y = enemy_index * line_height + 4 y = enemy_y + PARA_CTB::ENEMY_FONT_SIZE + 3 # CTが満タンになったときのゲージの色 ct_color_full = PARA_CTB::COLOR_FULL # CTゲージの色(左端) ct_color_start = enemy.full_ct ? ct_color_full : PARA_CTB::COLOR_LEFT # CTゲージの色(右端) ct_color_end = enemy.full_ct ? ct_color_full : PARA_CTB::COLOR_RIGHT if enemy.ct_visible draw_meter(enemy.now_ct, enemy.max_ct, 4, y, 100, 8, ct_color_start, ct_color_end) else draw_meter(0, enemy.max_ct, 4, y, 100, 8, ct_color_start, ct_color_end) end enemy_index += 1 end end end end #============================================================================== # ■ Window_Base #============================================================================== class Window_Base < Window #-------------------------------------------------------------------------- # ○ ゲージを描画 #-------------------------------------------------------------------------- def draw_meter(now, max, x, y, width, height, start_color, end_color=start_color ) self.contents.fill_rect(x, y, width, height, PARA_CTB::FRAME_COLOR) self.contents.fill_rect(x+PARA_CTB::FRAME_BORDER, y+PARA_CTB::FRAME_BORDER, width- PARA_CTB::FRAME_BORDER*2, height-PARA_CTB::FRAME_BORDER*2, PARA_CTB::BACK_COLOR) now = now > max ? max : now percentage = max != 0 ? (width-2) * now / max.to_f : 0 if start_color == end_color self.contents.fill_rect(x+1, y+1, percentage, height-2, start_color) else for i in 1..percentage r = start_color.red + (end_color.red - start_color.red) / percentage * i g = start_color.green + (end_color.green - start_color.green) / percentage * i b = start_color.blue + (end_color.blue - start_color.blue) / percentage * i a = start_color.alpha + (end_color.alpha - start_color.alpha) / percentage * i self.contents.fill_rect(x+i, y+1, 1, height-2, Color.new(r, g, b, a)) end end end end #============================================================================== # ■ Game_Battler #============================================================================== class Game_Battler #-------------------------------------------------------------------------- # ● 公開インスタンス変数 #-------------------------------------------------------------------------- attr_accessor :max_ct attr_accessor :now_ct attr_accessor :full_ct attr_accessor :countup attr_accessor :ct_visible attr_accessor :movable_backup #-------------------------------------------------------------------------- # ● オブジェクト初期化 #-------------------------------------------------------------------------- alias ctb_initialize initialize def initialize ctb_initialize @max_ct = 0 @now_ct = 0 @full_ct = false @countup = true @ct_visible = true end end #============================================================================== # ■ Sprite_Battler #============================================================================== class Sprite_Battler < RPG::Sprite #-------------------------------------------------------------------------- # ● フレーム更新 #-------------------------------------------------------------------------- alias ctb_update update def update ctb_update if @battler != nil if @battler.full_ct and @battler.ct_visible # CTが溜まったバトラーの色調を変化させる fullct_color = PARA_CTB::FULL_CT_COLOR self.tone = fullct_color else fullct_color = Tone.new(0,0,0) self.tone = fullct_color end end end end #============================================================================== # ■ Window_Help #============================================================================== class Window_Help < Window_Base #-------------------------------------------------------------------------- # ● アクター設定 # actor : ステータスを表示するアクター #-------------------------------------------------------------------------- alias set_actor_ctb set_actor def set_actor(actor) if PARA_CTB::HELP_DRAWING_MATER_ACTOR self.contents.clear draw_actor_name(actor, 4, 0) draw_actor_state(actor, 140, 0) hp_color1 = PARA_CTB::HP_COLOR_LEFT hp_color2 = PARA_CTB::HP_COLOR_RIGHT draw_meter(actor.hp, actor.maxhp, 316, 18, 112, 8, hp_color1, hp_color2) draw_actor_hp(actor, 284, 0) sp_color1 = PARA_CTB::SP_COLOR_LEFT sp_color2 = PARA_CTB::SP_COLOR_RIGHT draw_meter(actor.sp, actor.maxsp, 492, 18, 112, 8, sp_color1, sp_color2) draw_actor_sp(actor, 460, 0) @actor = actor @text = nil self.visible = true else set_actor_ctb(actor) end end #-------------------------------------------------------------------------- # ● エネミー設定 # enemy : 名前とステートを表示するエネミー #-------------------------------------------------------------------------- alias set_enemy_ctb set_enemy def set_enemy(enemy) if PARA_CTB::HELP_DRAWING_MATER_ENEMY self.contents.clear draw_actor_name(enemy, 4, 0) draw_actor_state(enemy, 140, 0) hp_color1 = PARA_CTB::HP_COLOR_LEFT hp_color2 = PARA_CTB::HP_COLOR_RIGHT draw_meter(enemy.hp, enemy.maxhp, 316, 18, 112, 8, hp_color1, hp_color2) draw_actor_hp(enemy, 284, 0) sp_color1 = PARA_CTB::SP_COLOR_LEFT sp_color2 = PARA_CTB::SP_COLOR_RIGHT draw_meter(enemy.sp, enemy.maxsp, 492, 18, 112, 8, sp_color1, sp_color2) draw_actor_sp(enemy, 460, 0) self.visible = true else set_enemy_ctb(enemy) end end end
- 活动时间战斗&ActionEX头号敌人的行动相结合的补丁, 用于组合搁板状和“ActionEX头号敌人的动作脚本时,” 我会解决这个问题,结束敌人行动无限期。 |
ctb.jpg (22.94 KB, 下载次数: 3)
#============================================================================== # ++ ウインドウベースカスタマイズ ver. 1.10 ++ # Script by パラ犬 # [url]http://2d6.parasite.jp/[/url] #------------------------------------------------------------------------------ # ウインドウの文字色や背景のタイリングを変更します。 #------------------------------------------------------------------------------ #[設置上の注意] # できるだけリストの上のほうに置いてください。(Scene_Debugよりは下) #============================================================================== module PARA_WINDOW_CUSTOM # ウインドウ背景を並べて表示( true / false ) SKIN_TILING = false # メッセージウインドウの不透明度 BACK_OPACITY = 160 # 通常文字色 COLOR_NORMAL = Color.new(255, 255, 255, 255) # 無効文字色 COLOR_DISABLED = Color.new(255, 255, 255, 128) # システム文字色 COLOR_SYSTEM = Color.new(192, 224, 255, 255) # ピンチ文字色 COLOR_CRISIS = Color.new(255, 255, 64, 255) # 戦闘不能文字色 COLOR_KNOCKOUT = Color.new(255, 64, 0, 255) # 制御文字「\C[n]」で表示する色 # (書式は「COLOR_SET[n] = Color.new(赤, 緑, 青, 不透明度)。nは0~7) COLOR_SET=[] #この行は消さないでください COLOR_SET[0] = Color.new(255, 255, 255, 255) COLOR_SET[1] = Color.new(128, 128, 255, 255) COLOR_SET[2] = Color.new(255, 128, 128, 255) COLOR_SET[3] = Color.new(128, 255, 128, 255) COLOR_SET[4] = Color.new(128, 255, 255, 255) COLOR_SET[5] = Color.new(255, 128, 255, 255) COLOR_SET[6] = Color.new(255, 255, 128, 255) COLOR_SET[7] = Color.new(192, 192, 192, 255) #フォント名(複数候補の場合は「,」で区切る。例:["HGP行書体", "MS Pゴシック"]) FONT_NAME = ["MS Pゴシック"] FONT_SIZE = 22 # デフォルトのフォントサイズ FONT_BOLD = false # 太字にするか(true/false) FONT_ITALIC = false # 斜体にするか(true/false) end # ↑ 設定項目ここまで #------------------------------------------------------------------------------ #============================================================================== # ■ Window_Base #============================================================================== class Window_Base < Window Font.default_color = PARA_WINDOW_CUSTOM::COLOR_NORMAL Font.default_name = PARA_WINDOW_CUSTOM::FONT_NAME + ["MS Pゴシック"] Font.default_size = PARA_WINDOW_CUSTOM::FONT_SIZE Font.default_bold = PARA_WINDOW_CUSTOM::FONT_BOLD Font.default_italic = PARA_WINDOW_CUSTOM::FONT_ITALIC #-------------------------------------------------------------------------- # ● オブジェクト初期化 #-------------------------------------------------------------------------- alias initialize_para_window_custom initialize def initialize(x, y, width, height) initialize_para_window_custom(x, y, width, height) self.stretch = !(PARA_WINDOW_CUSTOM::SKIN_TILING) end #-------------------------------------------------------------------------- # ● 文字色取得 #-------------------------------------------------------------------------- def text_color(n) return PARA_WINDOW_CUSTOM::COLOR_SET[n] end #-------------------------------------------------------------------------- # ● 通常文字色の取得 #-------------------------------------------------------------------------- def normal_color return PARA_WINDOW_CUSTOM::COLOR_NORMAL end #-------------------------------------------------------------------------- # ● 無効文字色の取得 #-------------------------------------------------------------------------- def disabled_color return PARA_WINDOW_CUSTOM::COLOR_DISABLED end #-------------------------------------------------------------------------- # ● システム文字色の取得 #-------------------------------------------------------------------------- def system_color return PARA_WINDOW_CUSTOM::COLOR_SYSTEM end #-------------------------------------------------------------------------- # ● ピンチ文字色の取得 #-------------------------------------------------------------------------- def crisis_color return PARA_WINDOW_CUSTOM::COLOR_CRISIS end #-------------------------------------------------------------------------- # ● 戦闘不能文字色の取得 #-------------------------------------------------------------------------- def knockout_color return PARA_WINDOW_CUSTOM::COLOR_KNOCKOUT end end #============================================================================== # ■ Window_Message #============================================================================== class Window_Message < Window_Selectable #-------------------------------------------------------------------------- # ● ウィンドウの位置と不透明度の設定 #-------------------------------------------------------------------------- alias reset_window_para_window_custom reset_window def reset_window reset_window_para_window_custom self.back_opacity = PARA_WINDOW_CUSTOM::BACK_OPACITY end end
window_custom2.jpg (23.98 KB, 下载次数: 2)
window_custom.jpg (48.55 KB, 下载次数: 2)
window_custom1.jpg (21.47 KB, 下载次数: 4)
#============================================================================== # ++ 一枚絵を背景化 ver. 1.00 ++ #------------------------------------------------------------------------------ # パノラマ画像のスクロールをマップのスクロールと同期させ # 背景画像として使えるようにします。 #============================================================================== module PARA_PANORAMA # パノラマのスクロールをマップと同期させる #( 0:しない 1:する 2:イベントスイッチで制御 ) FIX = 1 # スイッチ制御に使用するスイッチ番号 FIX_SWITCH = 999 # 画像ファイルの一括指定 #( PANORAMA[ マップID ] = ファイル名 ) PANORAMA=[]#←この行は削除しないでください PANORAMA[1] = "001-Sky01" PANORAMA[2] = "002-Sky02" end # ↑ 設定項目ここまで #------------------------------------------------------------------------------ #============================================================================== # ■ Spriteset_Map #============================================================================== class Spriteset_Map #-------------------------------------------------------------------------- # ● オブジェクト初期化 #-------------------------------------------------------------------------- alias initialize_parapano initialize def initialize initialize_parapano #パノラマ画像を設定 if PARA_PANORAMA::PANORAMA[$game_map.map_id] != nil $game_map.panorama_name = PARA_PANORAMA::PANORAMA[$game_map.map_id] @panorama_name = $game_map.panorama_name @panorama_hue = $game_map.panorama_hue @panorama.bitmap = RPG::Cache.panorama(@panorama_name, @panorama_hue) end # フレーム更新 update end #-------------------------------------------------------------------------- # ● フレーム更新 #-------------------------------------------------------------------------- alias update_parapano update def update update_parapano if PARA_PANORAMA::FIX == 1 or (PARA_PANORAMA::FIX==2 and $game_switches[PARA_PANORAMA::FIX_SWITCH]) # パノラマプレーンを更新 @panorama.ox = $game_map.display_x / 4 @panorama.oy = $game_map.display_y / 4 end end end
panorama_bg.jpg (16.97 KB, 下载次数: 25)
#============================================================================== # ++ ダメージ文字カスタマイズ ver. 1.01 ++ #------------------------------------------------------------------------------ # ダメージ表示のフォントを変更。 #============================================================================== module RPG class Sprite < ::Sprite #---------------------------------------------------------------------------- # ダメージ表示用フォント DAMAGE_FONT_NAME = ["Georgia"] # フォント名 DAMAGE_FONT_SIZE = 32 # サイズ DAMAGE_FONT_BOLD = false # 太字にするか(true/false) DAMAGE_FONT_ITALIC = false # 斜体にするか(true/false) FONT_COLOR_DAMAGE = Color.new(255, 255, 255) # ダメージ時の色 FONT_COLOR_HEAL = Color.new(176, 255, 144) # 回復時の色 FONT_COLOR_D_FRAME = Color.new(0, 0, 0) # ダメージ文字の枠の色 FONT_COLOR_H_FRAME = Color.new(0, 0, 0) # 回復文字の枠の色 CRITICAL_NAME = "CRITICAL" # クリティカルヒット時に表示する文字 CRITICAL_FONT_SIZE = 20 # クリティカルの文字サイズ #---------------------------------------------------------------------------- def damage(value, critical) dispose_damage if value.is_a?(Numeric) damage_string = value.abs.to_s else damage_string = value.to_s end bitmap = Bitmap.new(160, DAMAGE_FONT_SIZE*2) bitmap.font.name = DAMAGE_FONT_NAME + ["Arial Black", "MS Pゴシック"] bitmap.font.size = DAMAGE_FONT_SIZE bitmap.font.bold = DAMAGE_FONT_BOLD bitmap.font.italic = DAMAGE_FONT_ITALIC if value.is_a?(Numeric) and value < 0 bitmap.font.color = FONT_COLOR_H_FRAME else bitmap.font.color = FONT_COLOR_D_FRAME end bitmap.draw_text(-1, 12-1, 160, DAMAGE_FONT_SIZE*1.2, damage_string, 1) bitmap.draw_text(+1, 12-1, 160, DAMAGE_FONT_SIZE*1.2, damage_string, 1) bitmap.draw_text(-1, 12+1, 160, DAMAGE_FONT_SIZE*1.2, damage_string, 1) bitmap.draw_text(+1, 12+1, 160, DAMAGE_FONT_SIZE*1.2, damage_string, 1) if value.is_a?(Numeric) and value < 0 bitmap.font.color = FONT_COLOR_HEAL else bitmap.font.color = FONT_COLOR_DAMAGE end bitmap.draw_text(0, 12, 160, DAMAGE_FONT_SIZE*1.2, damage_string, 1) if critical bitmap.font.size = CRITICAL_FONT_SIZE bitmap.font.color = FONT_COLOR_D_FRAME bitmap.draw_text(-1, -1, 160, CRITICAL_FONT_SIZE, CRITICAL_NAME, 1) bitmap.draw_text(+1, -1, 160, CRITICAL_FONT_SIZE, CRITICAL_NAME, 1) bitmap.draw_text(-1, +1, 160, CRITICAL_FONT_SIZE, CRITICAL_NAME, 1) bitmap.draw_text(+1, +1, 160, CRITICAL_FONT_SIZE, CRITICAL_NAME, 1) bitmap.font.color = FONT_COLOR_DAMAGE bitmap.draw_text(0, 0, 160, CRITICAL_FONT_SIZE, CRITICAL_NAME, 1) end @_damage_sprite = ::Sprite.new(self.viewport) @_damage_sprite.bitmap = bitmap @_damage_sprite.ox = 80 @_damage_sprite.oy = 20 @_damage_sprite.x = self.x @_damage_sprite.y = self.y - self.oy / 2 @_damage_sprite.z = 3000 @_damage_duration = 40 end end end
damage.jpg (22.79 KB, 下载次数: 26)
#============================================================================== # ++ 縦リスト型バトルステータス ver. 1.10 ++ #------------------------------------------------------------------------------ # バトルステータス画面をサイドビューらしい縦型表示にします。 #============================================================================== module PARA_CTB # HPゲージの色(グラデーション左端) HP_COLOR_LEFT = Color.new(128, 0, 0, 255) # HPゲージの色(グラデーション右端) HP_COLOR_RIGHT= Color.new(255, 0, 0, 255) # SPゲージの色(グラデーション左端) SP_COLOR_LEFT = Color.new(0, 0, 128, 255) # SPゲージの色(グラデーション右端) SP_COLOR_RIGHT= Color.new(0, 0, 255, 255) # ゲージ枠の色 FRAME_COLOR = Color.new(192, 192, 192, 255) # ゲージ枠の太さ FRAME_BORDER = 1 # ゲージの背景色 BACK_COLOR = Color.new(128, 128, 128, 128) # 名前のフォントサイズ NAME_FONT_SIZE =16 # HP/SPのフォントサイズ HPSP_FONT_SIZE =18 # エネミー名のフォントサイズ ENEMY_FONT_SIZE =16 # 最大HP/SPを描画するか( true / false ) MAX_DRAW = false # バトルメンバーの最大数(多人数PTスクリプトを導入している時に設定) PARTY_SIZE = 4 # エネミー名をグループ化( true / false ) # (trueにすると「ゴースト 2」のようにまとめて表示します) ENEMY_GROUPING = false # エネミー名の下にゲージを表示( 0:なし / 1:HP ) # (エネミー名をグループ化している場合は無効) ENEMY_DRAWING_MATER = 0 # アクターのヘルプウインドウにHP/SPゲージを表示( true / false ) HELP_DRAWING_MATER_ACTOR = false # エネミーのヘルプウインドウにHP/SPゲージを表示( true / false ) HELP_DRAWING_MATER_ENEMY = false # コマンドウインドウの位置を強制指定( true / false ) #(他の方のサイドビュースクリプトを併用していて # コマンドウインドウの位置がどうしても不自然になるならtrueに) # ※trueにしても適用されない場合、このスクリプトを # サイドビューよりも下に置いてみてください WINDOWPOS_CHANGE = false WINDOWPOS_X = 100 # X座標 WINDOWPOS_Y = 320 # Y座標 # コマンドウインドウの不透明度 WINDOW_OPACITY = 160 end # ↑ 設定項目ここまで #------------------------------------------------------------------------------ #============================================================================== # ■ Scene_Battle #============================================================================== class Scene_Battle #-------------------------------------------------------------------------- # ● メイン処理 #-------------------------------------------------------------------------- alias main_ctb main def main # エネミー名ウインドウを作成 @status_window2 = Window_BattleStatus_enemy.new main_ctb # エネミー名ウインドウを破棄 @status_window2.dispose end #-------------------------------------------------------------------------- # ● フレーム更新 #-------------------------------------------------------------------------- alias ctb_update update def update # バトルイベント実行中の場合 if $game_system.battle_interpreter.running? # インタプリタを更新 $game_system.battle_interpreter.update # アクションを強制されているバトラーが存在しない場合 if $game_temp.forcing_battler == nil # バトルイベントの実行が終わった場合 unless $game_system.battle_interpreter.running? # 戦闘継続の場合、バトルイベントのセットアップを再実行 unless judge setup_battle_event end end # アフターバトルフェーズでなければ if @phase != 5 # エネミー名リストを更新 @status_window2.refresh end end end ctb_update end #-------------------------------------------------------------------------- # ● アクターコマンドウィンドウのセットアップ #-------------------------------------------------------------------------- alias phase3_setup_command_window_ctb phase3_setup_command_window def phase3_setup_command_window @actor_command_window.back_opacity = PARA_CTB::WINDOW_OPACITY phase3_setup_command_window_ctb if PARA_CTB::WINDOWPOS_CHANGE # アクターコマンドウィンドウの位置を設定 @actor_command_window.x = PARA_CTB::WINDOWPOS_X @actor_command_window.y = PARA_CTB::WINDOWPOS_Y # ステータスウインドウに隠れないように @actor_command_window.z = 9999 end end #-------------------------------------------------------------------------- # ● フレーム更新 (プレバトルフェーズ) #-------------------------------------------------------------------------- alias update_phase1_ctb update_phase1 def update_phase1 # エネミー名リストを更新 @status_window2.refresh update_phase1_ctb end #-------------------------------------------------------------------------- # ● フレーム更新 (メインフェーズ ステップ 6 : リフレッシュ) #-------------------------------------------------------------------------- alias update_phase4_step6_ctb update_phase4_step6 def update_phase4_step6 # エネミー名リストを更新 @status_window2.refresh update_phase4_step6_ctb end end #============================================================================== # ■ Window_BattleStatus #============================================================================== class Window_BattleStatus < Window_Base #-------------------------------------------------------------------------- # ● オブジェクト初期化 #-------------------------------------------------------------------------- def initialize super(160, 320, 480, 160) self.contents = Bitmap.new(width - 32, height - 32) @level_up_flags = [] for i in 0..$game_party.actors.size @level_up_flags.push(false) end @before_hp = [] @before_sp = [] @before_states = [] @now_hp = [] @now_sp = [] @now_states = [] refresh end #-------------------------------------------------------------------------- # ● リフレッシュ #-------------------------------------------------------------------------- def refresh @item_max = $game_party.actors.size for i in 0...$game_party.actors.size actor = $game_party.actors[i] line_height = 120 / PARA_CTB::PARTY_SIZE actor_y = i * line_height + 4 # 現在のステータスを配列に @now_hp[i] = actor.hp @now_sp[i] = actor.sp @now_states[i] = actor.states # レベルアップ if @level_up_flags[i] self.contents.fill_rect(344, actor_y, 100, 32, Color.new(0, 0, 0, 0)) self.contents.font.color = normal_color self.contents.draw_text(344, actor_y, 120, 32, "LEVEL UP!") end end # バトルステータスの軽量化処理 # ステータスの配列が変化したときのみ描画処理 if @before_hp == nil or @before_sp == nil or @before_states == nil or @before_hp != @now_hp or @before_sp != @now_sp or @before_states != @now_states self.contents.clear for i2 in 0...$game_party.actors.size actor = $game_party.actors[i2] line_height = 120 / PARA_CTB::PARTY_SIZE actor_y = i2 * line_height + 4 self.contents.font.size = PARA_CTB::NAME_FONT_SIZE # 名前を描画 draw_actor_name(actor, 4, actor_y+16-PARA_CTB::NAME_FONT_SIZE) # HPを描画 hp_color1 = PARA_CTB::HP_COLOR_LEFT hp_color2 = PARA_CTB::HP_COLOR_RIGHT draw_meter(actor.hp, actor.maxhp, 125, actor_y+14, 80, 8, hp_color1, hp_color2) draw_actor_hp(actor, 102, actor_y+16-PARA_CTB::HPSP_FONT_SIZE, 100) # SPを描画 sp_color1 = PARA_CTB::SP_COLOR_LEFT sp_color2 = PARA_CTB::SP_COLOR_RIGHT draw_meter(actor.sp, actor.maxsp, 245, actor_y+14, 80, 8, sp_color1, sp_color2) draw_actor_sp(actor, 222, actor_y+16-PARA_CTB::HPSP_FONT_SIZE, 100) # 変化後のステータスを配列に @before_hp[i2] = actor.hp @before_sp[i2] = actor.sp @before_states[i2] = actor.states # レベルアップ if @level_up_flags[i2] == false draw_actor_state(actor, 344, actor_y) end end end end #-------------------------------------------------------------------------- # ● フレーム更新 #-------------------------------------------------------------------------- def update super end #-------------------------------------------------------------------------- # ● HP の描画 # actor : アクター # x : 描画先 X 座標 # y : 描画先 Y 座標 # width : 描画先の幅 #-------------------------------------------------------------------------- def draw_actor_hp(actor, x, y, width = 144) # 文字列 "HP" を描画 self.contents.font.color = system_color self.contents.font.size = 16 self.contents.draw_text(x, y+2, 32, 32, $data_system.words.hp) self.contents.font.color = normal_color self.contents.font.size = PARA_CTB::HPSP_FONT_SIZE if PARA_CTB::MAX_DRAW # MaxHP を描画 self.contents.draw_text(x, y, width, 32, actor.maxhp.to_s, 2) text_size = self.contents.text_size(actor.maxhp.to_s) text_x = x + width - text_size.width - 12 self.contents.draw_text(text_x, y, 12, 32, "/", 1) # HP を描画 self.contents.font.color = actor.hp == 0 ? knockout_color : actor.hp <= actor.maxhp / 4 ? crisis_color : normal_color text_x = text_x - text_size.width self.contents.draw_text(text_x, y, text_size.width, 32, actor.hp.to_s, 2) else self.contents.font.color = actor.hp == 0 ? knockout_color : actor.hp <= actor.maxhp / 4 ? crisis_color : normal_color self.contents.draw_text(x, y, width, 32, actor.hp.to_s, 2) end end #-------------------------------------------------------------------------- # ● SP の描画 # actor : アクター # x : 描画先 X 座標 # y : 描画先 Y 座標 # width : 描画先の幅 #-------------------------------------------------------------------------- def draw_actor_sp(actor, x, y, width = 144) # 文字列 "SP" を描画 self.contents.font.color = system_color self.contents.font.size = 16 self.contents.draw_text(x, y+2, 32, 32, $data_system.words.sp) self.contents.font.color = normal_color self.contents.font.size = PARA_CTB::HPSP_FONT_SIZE if PARA_CTB::MAX_DRAW # MaxSP を描画 self.contents.draw_text(x, y, width, 32, actor.maxsp.to_s, 2) text_size = self.contents.text_size(actor.maxsp.to_s) text_x = x + width - text_size.width - 12 self.contents.draw_text(text_x, y, 12, 32, "/", 1) # SP を描画 self.contents.font.color = actor.sp == 0 ? knockout_color : actor.sp <= actor.maxsp / 4 ? crisis_color : normal_color text_x = text_x - text_size.width self.contents.draw_text(text_x, y, text_size.width, 32, actor.sp.to_s, 2) else self.contents.font.color = actor.sp == 0 ? knockout_color : actor.sp <= actor.maxsp / 4 ? crisis_color : normal_color self.contents.draw_text(x, y, width, 32, actor.sp.to_s, 2) end end end #============================================================================== # □ 敵の名前を表示するウインドウ #============================================================================== class Window_BattleStatus_enemy < Window_Base #-------------------------------------------------------------------------- # ○ オブジェクト初期化 #-------------------------------------------------------------------------- def initialize super(0, 320, 160, 160) self.contents = Bitmap.new(width - 32, height - 32) refresh end #-------------------------------------------------------------------------- # ○ リフレッシュ #-------------------------------------------------------------------------- def refresh self.contents.clear self.contents.font.color = normal_color self.contents.font.size = PARA_CTB::ENEMY_FONT_SIZE @exist_enemies = [] if $game_troop.enemies != nil if PARA_CTB::ENEMY_GROUPING ememy_list = [] ememy_list_index = [] # エネミーをグループ化 for i in 0...$game_troop.enemies.size enemy = $game_troop.enemies[i] if enemy.exist? if ememy_list.include?(enemy.name) ememy_list_index[ememy_list.index(enemy.name)] += 1 else # エネミー名を記録 ememy_list.push(enemy.name) ememy_list_index[ememy_list.index(enemy.name)] = 1 end end end # エネミーの名前と数を描画 enemy_index = 0 for enemy_name in ememy_list enemy_y = enemy_index * (PARA_CTB::ENEMY_FONT_SIZE+6) + 4 if ememy_list_index[enemy_index] > 1 enemy_name = enemy_name + " " + ememy_list_index[enemy_index].to_s end self.contents.draw_text(4, enemy_y, 160, 20, enemy_name) enemy_index += 1 end else # エネミーの名前を描画 enemy_index = 0 for i in 0...$game_troop.enemies.size enemy = $game_troop.enemies[i] if enemy.exist? @exist_enemies.push(enemy) line_height = PARA_CTB::ENEMY_FONT_SIZE + 6 if PARA_CTB::ENEMY_DRAWING_MATER != 0 line_height += 10 end enemy_y = enemy_index * line_height + 4 self.contents.draw_text(4, enemy_y, 160, 20, enemy.name) enemy_index += 1 # HPゲージを描画 if PARA_CTB::ENEMY_DRAWING_MATER == 1 hp_color1 = PARA_CTB::HP_COLOR_LEFT hp_color2 = PARA_CTB::HP_COLOR_RIGHT y = enemy_y + PARA_CTB::ENEMY_FONT_SIZE + 3 draw_meter(enemy.hp, enemy.maxhp, 4, y, 80, 8, hp_color1, hp_color2) end end end end end end end #============================================================================== # ■ Window_Base #============================================================================== class Window_Base < Window #-------------------------------------------------------------------------- # ○ ゲージを描画 #-------------------------------------------------------------------------- def draw_meter(now, max, x, y, width, height, start_color, end_color=start_color ) self.contents.fill_rect(x, y, width, height, PARA_CTB::FRAME_COLOR) self.contents.fill_rect(x+PARA_CTB::FRAME_BORDER, y+PARA_CTB::FRAME_BORDER, width-PARA_CTB::FRAME_BORDER*2, height-PARA_CTB::FRAME_BORDER*2, PARA_CTB::BACK_COLOR) now = now > max ? max : now percentage = max != 0 ? (width-2) * now / max.to_f : 0 if start_color == end_color self.contents.fill_rect(x+1, y+1, percentage, height-2, start_color) else for i in 1..percentage r = start_color.red + (end_color.red - start_color.red) / percentage * i g = start_color.green + (end_color.green - start_color.green) / percentage * i b = start_color.blue + (end_color.blue - start_color.blue) / percentage * i a = start_color.alpha + (end_color.alpha - start_color.alpha) / percentage * i self.contents.fill_rect(x+i, y+1, 1, height-2, Color.new(r, g, b, a)) end end end end #============================================================================== # ■ Window_Help #============================================================================== class Window_Help < Window_Base #-------------------------------------------------------------------------- # ● アクター設定 # actor : ステータスを表示するアクター #-------------------------------------------------------------------------- alias set_actor_ctb set_actor def set_actor(actor) if PARA_CTB::HELP_DRAWING_MATER_ACTOR self.contents.clear draw_actor_name(actor, 4, 0) draw_actor_state(actor, 140, 0) hp_color1 = PARA_CTB::HP_COLOR_LEFT hp_color2 = PARA_CTB::HP_COLOR_RIGHT draw_meter(actor.hp, actor.maxhp, 316, 18, 112, 8, hp_color1, hp_color2) draw_actor_hp(actor, 284, 0) sp_color1 = PARA_CTB::SP_COLOR_LEFT sp_color2 = PARA_CTB::SP_COLOR_RIGHT draw_meter(actor.sp, actor.maxsp, 492, 18, 112, 8, sp_color1, sp_color2) draw_actor_sp(actor, 460, 0) [url=home.php?mod=space&uid=95897]@actor[/url] = actor @text = nil self.visible = true else set_actor_ctb(actor) end end #-------------------------------------------------------------------------- # ● エネミー設定 # enemy : 名前とステートを表示するエネミー #-------------------------------------------------------------------------- alias set_enemy_ctb set_enemy def set_enemy(enemy) if PARA_CTB::HELP_DRAWING_MATER_ENEMY self.contents.clear draw_actor_name(enemy, 4, 0) draw_actor_state(enemy, 140, 0) hp_color1 = PARA_CTB::HP_COLOR_LEFT hp_color2 = PARA_CTB::HP_COLOR_RIGHT draw_meter(enemy.hp, enemy.maxhp, 316, 18, 112, 8, hp_color1, hp_color2) draw_actor_hp(enemy, 284, 0) sp_color1 = PARA_CTB::SP_COLOR_LEFT sp_color2 = PARA_CTB::SP_COLOR_RIGHT draw_meter(enemy.sp, enemy.maxsp, 492, 18, 112, 8, sp_color1, sp_color2) draw_actor_sp(enemy, 460, 0) self.visible = true else set_enemy_ctb(enemy) end end end
ctb_status.jpg (28.31 KB, 下载次数: 29)
上面的照片(步行图文版)侧面视图战斗 已经一起使用。
#============================================================================== # ++ タイトル画面カスタマイズ [VX] ver. 1.00 ++ #------------------------------------------------------------------------------ # タイトルメニューに画像を使用、もしくはメニューウインドウの外見を変更します。 #============================================================================== module PARA_TITLE_CUSTOM # メニューコマンドに画像を使う( true / false ) IMG_MENU = true #↓---メニューコマンドに画像を使う時の設定--- # メニューコマンドに使う画像ファイル名(「Graphics/System」にインポート ) #( 書式は [ コマンド未選択時 , コマンドが選択されたとき ] ) # ニューゲーム IMG_NEWGAME = ["newgame","newgame_active"] IMG_NEWGAME_X = 200 # 横位置 IMG_NEWGAME_Y = 300 # 縦位置 # コンティニュー IMG_CONTINUE = ["continue","continue_active"] IMG_CONTINUE_X = 200 # 横位置 IMG_CONTINUE_Y = 332 # 縦位置 # シャットダウン IMG_SHUTDOWN = ["shutdown","shutdown_active"] IMG_SHUTDOWN_X = 200 # 横位置 IMG_SHUTDOWN_Y = 364 # 縦位置 # コンティニュー無効時( 0:半透明 / 1:画像を指定 ) LOAD_DISABLED_TYPE = 0 # コンティニュー無効時の画像 IMG_CONTINUE_DISABLED = ["continue_disabled","continue_disabled_active"] # 画像の合成方法( 0:通常 / 1:加算 / 2:減算 ) BLEND_TYPE = 0 #↓---メニューコマンドに画像を使わない時の設定--- # ウィンドウ枠を非表示にする( true / false ) WINDOW_TRANS = false # ウィンドウの透明度(ウィンドウ枠を表示している時に指定) WINDOW_OPACITY = 160 # ウィンドウの横サイズ WINDOW_WIDTH = 172 # ウィンドウの横位置( 0:座標指定 / 1:左端 / 2:中央 / 3:右端 ) WINDOW_ALIGN = 2 # 「座標指定」の時のウィンドウの横座標 WINDOW_POS_X = 0 # ウィンドウの縦位置( 0:座標指定 / 1:上端 / 2:中央 / 3:下端 ) WINDOW_VALIGN = 0 # 「座標指定」の時のウィンドウの縦座標 WINDOW_POS_Y = 288 end # ↑ 設定項目ここまで #------------------------------------------------------------------------------ #============================================================================== # ■ Scene_Title #============================================================================== class Scene_Title < Scene_Base #-------------------------------------------------------------------------- # ● コマンドウィンドウの作成 #-------------------------------------------------------------------------- def create_command_window s1 = Vocab::new_game s2 = Vocab::continue s3 = Vocab::shutdown w = PARA_TITLE_CUSTOM::WINDOW_WIDTH @command_window = Window_Command.new(w, [s1, s2, s3]) @command_window.x = (544 - @command_window.width) / 2 @command_window.y = 288 if @continue_enabled # コンティニューが有効な場合 @command_window.index = 1 # カーソルを合わせる else # 無効な場合 @command_window.draw_item(1, false) # コマンドを半透明表示にする end @command_window.openness = 0 # 画像コマンドウィンドウを使うか if PARA_TITLE_CUSTOM::IMG_MENU # コマンドウィンドウを非表示に @command_window.opacity = 0 @command_window.contents_opacity = 0 create_img_command_window else change_window_visual end @command_window.open end #-------------------------------------------------------------------------- # ○ コマンドウィンドウの外見設定 #-------------------------------------------------------------------------- def change_window_visual # ウィンドウの透明度 if PARA_TITLE_CUSTOM::WINDOW_TRANS @command_window.opacity = 0 else @command_window.back_opacity = PARA_TITLE_CUSTOM::WINDOW_OPACITY end # ウィンドウの位置を指定 case PARA_TITLE_CUSTOM::WINDOW_ALIGN when 0 @command_window.x = PARA_TITLE_CUSTOM::WINDOW_POS_X when 1 @command_window.x = 0 when 2 @command_window.x = ( 544 - @command_window.width ) / 2 when 3 @command_window.x = 544 - @command_window.width end case PARA_TITLE_CUSTOM::WINDOW_VALIGN when 0 @command_window.y = PARA_TITLE_CUSTOM::WINDOW_POS_Y when 1 @command_window.y = 0 when 2 @command_window.y = ( 416 - @command_window.height ) / 2 when 3 @command_window.y = 416 - @command_window.height end end #-------------------------------------------------------------------------- # ○ 画像コマンドウィンドウの作成 #-------------------------------------------------------------------------- def create_img_command_window # スプライト生成 sprite1 = Sprite.new sprite1.x = PARA_TITLE_CUSTOM::IMG_NEWGAME_X sprite1.y = PARA_TITLE_CUSTOM::IMG_NEWGAME_Y sprite1.blend_type = PARA_TITLE_CUSTOM::BLEND_TYPE sprite2 = Sprite.new sprite2.x = PARA_TITLE_CUSTOM::IMG_CONTINUE_X sprite2.y = PARA_TITLE_CUSTOM::IMG_CONTINUE_Y sprite2.blend_type = PARA_TITLE_CUSTOM::BLEND_TYPE sprite3 = Sprite.new sprite3.x = PARA_TITLE_CUSTOM::IMG_SHUTDOWN_X sprite3.y = PARA_TITLE_CUSTOM::IMG_SHUTDOWN_Y sprite3.blend_type = PARA_TITLE_CUSTOM::BLEND_TYPE # スプライトセットで管理 @command_sprites = [sprite1, sprite2, sprite3] # ビットマップファイル名を配列で管理 @command_bitmaps = [PARA_TITLE_CUSTOM::IMG_NEWGAME, PARA_TITLE_CUSTOM::IMG_CONTINUE, PARA_TITLE_CUSTOM::IMG_SHUTDOWN] if @continue_enabled # コンティニューが有効な場合 select_img_item(1) # カーソルを合わせる else # 無効な場合 case PARA_TITLE_CUSTOM::LOAD_DISABLED_TYPE when 0 # コンティニュー無効時半透明 @command_sprites[1].opacity = 160 when 1 # コンティニュー無効時専用画像 @command_bitmaps[1] = PARA_TITLE_CUSTOM::IMG_CONTINUE_DISABLED end select_img_item(0) # カーソルを合わせる end end #-------------------------------------------------------------------------- # ● フレーム更新 #-------------------------------------------------------------------------- def update super @command_window.update if PARA_TITLE_CUSTOM::IMG_MENU if Input.repeat?(Input::UP) or Input.repeat?(Input::DOWN) # 画像切り替え select_img_item(@command_window.index) end end if Input.trigger?(Input::C) case @command_window.index when 0 # ニューゲーム command_new_game when 1 # コンティニュー command_continue when 2 # シャットダウン command_shutdown end end end #-------------------------------------------------------------------------- # ○ メニュー選択時の画像切り替え #-------------------------------------------------------------------------- def select_img_item(index) case index when 0 @command_sprites[0].bitmap = Cache.system(@command_bitmaps[0][1]) @command_sprites[1].bitmap = Cache.system(@command_bitmaps[1][0]) @command_sprites[2].bitmap = Cache.system(@command_bitmaps[2][0]) when 1 @command_sprites[0].bitmap = Cache.system(@command_bitmaps[0][0]) @command_sprites[1].bitmap = Cache.system(@command_bitmaps[1][1]) @command_sprites[2].bitmap = Cache.system(@command_bitmaps[2][0]) when 2 @command_sprites[0].bitmap = Cache.system(@command_bitmaps[0][0]) @command_sprites[1].bitmap = Cache.system(@command_bitmaps[1][0]) @command_sprites[2].bitmap = Cache.system(@command_bitmaps[2][1]) end end #-------------------------------------------------------------------------- # ● コマンドウィンドウの解放 #-------------------------------------------------------------------------- def dispose_command_window @command_window.dispose if @command_sprites != nil @command_sprites[0].dispose @command_sprites[1].dispose @command_sprites[2].dispose end end #-------------------------------------------------------------------------- # ● コマンドウィンドウを開く #-------------------------------------------------------------------------- def open_command_window # ウィンドウの背景が非表示のときは瞬間表示 if PARA_TITLE_CUSTOM::WINDOW_TRANS @command_window.openness = 255 end @command_window.open begin @command_window.update Graphics.update end until @command_window.openness == 255 end #-------------------------------------------------------------------------- # ● コマンドウィンドウを閉じる #-------------------------------------------------------------------------- def close_command_window # ウィンドウの背景が非表示のときはクローズしないようにする if not(PARA_TITLE_CUSTOM::WINDOW_TRANS) @command_window.close begin @command_window.update Graphics.update end until @command_window.openness == 0 end end end
continue.png (1.73 KB, 下载次数: 26)
continue_active.png (4.66 KB, 下载次数: 21)
newgame.png (2.04 KB, 下载次数: 19)
newgame_active.png (5.49 KB, 下载次数: 26)
shutdown.png (2.05 KB, 下载次数: 21)
shutdown_active.png (5.42 KB, 下载次数: 27)
#============================================================================== # ++ フォント変更 [VX] ver. 1.00 ++ # Script by パラ犬 # [url]http://2d6.parasite.jp/[/url] #------------------------------------------------------------------------------ # 文字表示に使用するフォントを変更します。 # システムにインストールされていないフォントを直接使用する場合は # プロジェクトのルートディレクトリ(AudioやGraphicsフォルダがある所)に # 「Fonts」という名前のフォルダを作り、フォントファイルを入れてください。 #============================================================================== module PARA_FONT_CUSTOM #フォント名(複数候補の場合は「,」で区切る。例:["HGP行書体", "MS ゴシック"]) #※ファイル名ではなく書体名を記述してください FONT_NAME = ["パラ字 梅"] FONT_SIZE = 20 # デフォルトのフォントサイズ FONT_BOLD = false # 太字にするか(true/false) FONT_ITALIC = false # 斜体にするか(true/false) end # ↑ 設定項目ここまで #------------------------------------------------------------------------------ #============================================================================== # ■ Window_Base #============================================================================== class Window_Base < Window Font.default_name = PARA_FONT_CUSTOM::FONT_NAME + ["UmePlus Gothic", "MS ゴシック", "Courier New"] Font.default_size = PARA_FONT_CUSTOM::FONT_SIZE Font.default_bold = PARA_FONT_CUSTOM::FONT_BOLD Font.default_italic = PARA_FONT_CUSTOM::FONT_ITALIC end
font_change.jpg (97.82 KB, 下载次数: 24)
上面的图片“段型梅花”
font_change_folder.jpg (20.23 KB, 下载次数: 20)
用法
欢迎光临 Project1 (https://rpg.blue/) | Powered by Discuz! X3.1 |