| 赞 | 9 |
| VIP | |
| 好人卡 | |
| 积分 | 29 |
| 经验 | |
| 最后登录 | 2023-12-28 |
| 在线时间 | 713 小时 |
- 梦石
- 0
- 星屑
- 2920
- 在线时间
- 713 小时
- 注册时间
- 2010-7-25
- 回帖
- 659

|
发表于 2016-3-21 13:50:14
|
显示全部楼层
- #==============================================================================
- # ■エネミーの状態を表示 for RGSS3 Ver0.90-α
- # □作成者 kure
- #==============================================================================
- # 怪物备注 <情報表示幅 150> 血条变成150%长度,状态显示额外增加2个
- # <情報非表示> 敌人的HP和状态不会显示
- $kure_base_script = {} if $kure_base_script == nil
- $kure_base_script[:InfoBar] = 100
- p "エネミーの情報表示"
- module KURE
- module InfoBar
- #初期設定(変更しない事)-----------------------------------------------------
- COLOR = []
-
- #表示色(IDによって割り当てが決まっています。)
- #バーの背景色(ID0)
- COLOR[0] = Color.new(32 ,32, 64, 255)
-
- #HPバーの色(ID1,ID2)
- COLOR[1] = Color.new(224 ,128, 64, 255)
- COLOR[2] = Color.new(240 ,192, 64, 255)
-
- end
- end
- #==============================================================================
- # ■ RPG::Enemy(追加定義)
- #==============================================================================
- class RPG::Enemy < RPG::BaseItem
- #--------------------------------------------------------------------------
- # ☆ バーの表示幅の定義(追加定義)
- #--------------------------------------------------------------------------
- def infobar_width
- @note.match(/<情報表示幅\s?(\d+)\s?>/)
- return 100 unless $1
- return $1.to_i
- end
- #--------------------------------------------------------------------------
- # ☆ バーの表示幅の定義(追加定義)
- #--------------------------------------------------------------------------
- def infobar_visible?
- return false if @note.include?("<情報非表示>")
- return true
- end
- end
- #==============================================================================
- # ■ Game_Enemy
- #==============================================================================
- class Game_Enemy < Game_Battler
- #--------------------------------------------------------------------------
- # ☆ バーの表示幅の定義(追加定義)
- #--------------------------------------------------------------------------
- def infobar_width
- return enemy.infobar_width
- end
- #--------------------------------------------------------------------------
- # ☆ バーの表示幅の定義(追加定義)
- #--------------------------------------------------------------------------
- def infobar_visible?
- return enemy.infobar_visible?
- end
- end
- #==============================================================================
- # ■ Spriteset_Battle
- #==============================================================================
- class Spriteset_Battle
- #--------------------------------------------------------------------------
- # ● 敵キャラスプライトの作成(エイリアス再定義)
- #--------------------------------------------------------------------------
- alias k_basescript_before_create_enemies create_enemies
- def create_enemies
- k_basescript_before_create_enemies
- @enemy_info_bar = $game_troop.members.reverse.collect do |enemy|
- Sprite_Infobar.new(@viewport1, enemy)
- end
- end
- #--------------------------------------------------------------------------
- # ● 敵キャラスプライトの更新(エイリアス再定義)
- #--------------------------------------------------------------------------
- alias k_basescript_before_update_enemies update_enemies
- def update_enemies
- k_basescript_before_update_enemies
- @enemy_info_bar.each {|sprite| sprite.update }
- end
- #--------------------------------------------------------------------------
- # ● 敵キャラスプライトの解放(エイリアス再定義)
- #--------------------------------------------------------------------------
- alias k_basescript_before_dispose_enemies dispose_enemies
- def dispose_enemies
- k_basescript_before_dispose_enemies
- @enemy_info_bar.each {|sprite| sprite.dispose }
- end
- end
- #==============================================================================
- # ■ Sprite_Infobar
- #==============================================================================
- class Sprite_Infobar < Sprite_Base
- #--------------------------------------------------------------------------
- # ● 公開インスタンス変数
- #--------------------------------------------------------------------------
- attr_accessor :battler
- #--------------------------------------------------------------------------
- # ● オブジェクト初期化
- #--------------------------------------------------------------------------
- def initialize(viewport, battler = nil)
- super(viewport)
- @battler = battler
- @fill_w = nil
- @bitmap_data = Cache.battler(battler.battler_name, battler.battler_hue)
- @state = battler.states
- @icon_set = Cache.system("Iconset")
- end
- #--------------------------------------------------------------------------
- # ● フレーム更新
- #--------------------------------------------------------------------------
- def update
- super
- if @battler && !@battler.hidden?
- @use_sprite = @battler.use_sprite?
- if @use_sprite
- update_bitmap
- update_origin
- update_position
- end
- else
- self.bitmap = nil
- end
- end
- #--------------------------------------------------------------------------
- # ● 解放
- #--------------------------------------------------------------------------
- def dispose
- bitmap.dispose if bitmap
- super
- end
- #--------------------------------------------------------------------------
- # ● 転送元ビットマップの更新
- #--------------------------------------------------------------------------
- def update_bitmap
- fill_w = @battler.infobar_width * (@battler.hp.to_f / @battler.mhp)
- state = battler.states
- if @fill_w != fill_w or @state != state
- @fill_w = fill_w
- @state = state
-
- width = @battler.infobar_width + 4
-
- new_bitmap = Bitmap.new(width, 35)
- @state.each_with_index {|state, index|
- next if 24 * (index + 1) > new_bitmap.width
- rect = Rect.new(state.icon_index % 16 * 24, state.icon_index / 16 * 24, 24, 24)
- new_bitmap.blt(24 * index, 0, @icon_set, rect, 255)
- }
- new_bitmap.fill_rect(0, 25, width, 10, color(0))
- new_bitmap.gradient_fill_rect(2, 27, fill_w, 6, color(1), color(2))
-
- self.bitmap = new_bitmap
- init_visibility
-
- self.opacity = 0 unless @battler.infobar_visible?
- end
- end
- #--------------------------------------------------------------------------
- # ● 可視状態の初期化
- #--------------------------------------------------------------------------
- def init_visibility
- @battler_visible = @battler.alive?
- self.opacity = 0 unless @battler_visible
- end
- #--------------------------------------------------------------------------
- # ● 文字色取得
- #--------------------------------------------------------------------------
- def color(num)
- return KURE::InfoBar::COLOR[num]
- end
- #--------------------------------------------------------------------------
- # ● 原点の更新
- #--------------------------------------------------------------------------
- def update_origin
- if bitmap
- self.ox = bitmap.width / 2
- self.oy = bitmap.height
- end
- end
- #--------------------------------------------------------------------------
- # ● 位置の更新
- #--------------------------------------------------------------------------
- def update_position
- self.x = @battler.screen_x
- self.y = @battler.screen_y - @bitmap_data.height
- self.z = @battler.screen_z + 10
- end
- end
复制代码
这是看怪物血和血条下显示状态的脚本
- #==============================================================================
- # ■ RGSS3 状況確認コマンド Ver1.05 by 星潟
- #------------------------------------------------------------------------------
- # RPGツクールVXAceでは、現在のステートや強化/弱体の表示数が
- # 著しく制限されており、非常に確認し辛いです。
- #
- # しかし、状況確認コマンドではステートを22個、強化/弱体も全て表示されます。
- #
- # パーティコマンドに、敵味方の現在能力値やステート/強化/弱体の状態を
- # 確認する為の新規コマンドを追加します。
- # 最初はアクターを表示し、LボタンかRボタンを押すことで
- # エネミーに表示を切り替えます。
- # アクターかエネミーを指定して決定キーを押すことで詳細表示を行います。
- # 詳細表示中に更に決定キーを押すと、属性耐性とステート耐性が表示されます。
- #
- # エネミーを表示しない機能や、詳細を表示せず
- # ステート/強化/弱体の確認に留めさせる設定も可能です。
- #
- # テストモードでの利用に限定する事も可能です。
- #------------------------------------------------------------------------------
- # Ver1.01 %表示に関する設定や、属性/ステート耐性の表示機能が追加されました。
- # Ver1.02 操作性を向上させました。
- # Ver1.03 隠れている敵を表示しないようにする機能を追加しました。
- # Ver1.04 詳細モードで敵のHPが表示限界でも見えてしまう不具合を修正しました。
- # また、表示限界の適用を敵のみにする機能を追加しました。
- # Ver1.05 システム側のTP表示設定が無効化されていてもTPが表示される不具合を修正。
- #==============================================================================
- module B_CONFIRM
-
- #テストモード限定化するか否かを設定します。
- #(trueで限定化/falseで常時使用可)
-
- TONLY = false
-
- #状況確認コマンドの名称を取得します。
-
- WORD1 = "情报确认"
-
- #ステート表示用の項目名を取得します。
-
- WORD2 = "状态"
-
- #強化/弱体表示用の項目名を取得します。
-
- WORD3 = "強化/弱化"
-
- #背景透過度を設定します。
-
- BOPAC = 255
-
- #控えメンバーも表示するかどうかを設定します。
- #(trueで表示/falseで非表示)
-
- PTMT = true
-
- #メンバーの詳細情報を表示するかどうかを設定します。
- #(trueで表示/falseで非表示)
-
- PTDT = true
-
- #ページ切り替えで敵も表示するかどうかを設定します。
- #(trueで表示/falseで非表示)
-
- TROK = true
-
- #敵の詳細情報を表示するかどうかを設定します。
- #(trueで表示/falseで非表示)
-
- TRDT = true
-
- #隠れている敵も表示するかどうかを指定します。
-
- HIDE = false
-
- #HP/MP/TPの表示限界値を設定します。
- #この値を以上の値となった時はTEXTの文字列を表示します。
-
- OVER = 10000
-
- #HP/MP/TPが表示限界値に達した際に、代わりに表示する文字列を設定します。
-
- TEXT = "?????"
-
- #表示限界に達した際に代わりに表示するのは敵のみにするかを設定します。
- #trueで敵のみ、falseで双方となります。
-
- EN_O = true
-
- #2ページ目を有効にするか否かを設定します。
- #(trueで有効/falseで無効)
-
- P2 = true
-
- #詳細情報での追加能力値の表示設定を行います。
- #[追加能力値ID(0~9の数字), 追加能力値名称(文字列), 敵も表示するか否か(true/false)]で
- #1セットとなっています。
-
- XPRM = [
- [0, "命中率", true],
- [1, "物理回避率", true],
- [2, "暴击率", true],
- [3, "暴击回避率", true],
- [4, "魔法回避率", true],
- [5, "魔法反射率", true],
- [6, "反击率", true],
- [7, "HP再生率", true],
- [8, "MP再生率", true],
- [9, "TP再生率", true]
- ]
-
- #追加能力値の後に%の文字を付けるか否かを設定します。
- #(trueで有効/falseで無効)
-
- ADP = false
-
- #詳細情報での特殊能力値の表示設定を行います。
- #[特殊能力値ID(0~9の数字), 特殊能力値名称(文字列), 敵も表示するか否か(true/false)]で
- #1セットとなっています。
-
- SPRM = [
- [0, "仇恨", false],
- [1, "防御効果比例", false],
- [2, "回復効果比例", false],
- [3, "药的知识", false],
- [4, "MP消耗率", false],
- [5, "TP补充率", false],
- [6, "受物伤比例", false],
- [7, "受法伤比例", false],
- [9, "经验加成比例", false]
- ]
-
- #特殊能力値の後に%の文字を付けるか否かを設定します。
- #(trueで有効/falseで無効)
-
- SPP = false
-
- #詳細情報での属性有効度の表示設定を行います。
- #[属性ID, 属性名の後に付ける文字(文字列),
- #敵も表示するか否か(true/false),
- #100から該当の値を引いた数で表示するかを否か,
- #数字の後に付ける文字(文字列)]で
- #1セットとなっています。
-
- ELEM = [
- [1, "耐性", true, true],
- [2, "耐性", true, true],
- [3, "耐性", true, true],
- [4, "耐性", true, true],
- [5, "耐性", true, true],
- [6, "耐性", true, true],
- [7, "耐性", true, true],
- [8, "耐性", true, true],
- [9, "耐性", true, true],
- [12, "耐性", true, true],
- [13, "效果", true, true],
- ]
-
- #属性有効度の後に%の文字を付けるか否かを設定します。
- #(trueで有効/falseで無効)
-
- ELP = false
-
- #1行目に表示するステートの最大数を指定します。
- #(2行目までしか想定していません)
-
- MAX = 11
-
- #詳細情報でのステート有効度の表示設定を行います。
- #[ステートID(0~-7で指定した場合は、絶対数の値の弱体有効度ID),
- #ステート名の後に付ける文字(文字列), 敵も表示するか否か(true/false),
- #100から該当の値を引いた数で表示するかを否か]で
- #1セットとなっています。
-
- STAT = [
- [1, "耐性", true, true],
- [2, "耐性", true, true],
- [3, "耐性", true, true],
- [4, "耐性", true, true],
- [5, "耐性", true, true],
- [6, "耐性", true, true],
- [7, "耐性", true, true],
- [8, "耐性", true, true],
- [10, "耐性", true, true],
- [12, "耐性", true, true],
- [13, "耐性", true, true],
- [14, "耐性", true, true],
- [17, "耐性", true, true],
- [21, "耐性", true, true],
- [22, "耐性", true, true],
- [23, "耐性", true, true],
- ]
-
- #ステート有効度の後に%の文字を付けるか否かを設定します。
- #(trueで有効/falseで無効)
-
- STP = false
-
- end
- #テストモード限定化されており、なおかつテストモードの場合か
- #テストモード限定化されていない場合は処理を行う。
- if (B_CONFIRM::TONLY && ($TEST or $BTEST)) or !B_CONFIRM::TONLY
- class Game_Troop < Game_Unit
- def unhidden_members
- B_CONFIRM::HIDE ? members : members.select {|e| !e.hidden?}
- end
- end
- class Game_Temp
- attr_accessor :b_confirm_limit_flag
- end
- class Window_Base < Window
- alias draw_current_and_max_values_overnumber draw_current_and_max_values
- def draw_current_and_max_values(x, y, width, current, max, color1, color2)
-
- #状況確認ウィンドウである場合のみ
- #現在値と最大値を必要に応じて読み替える。
-
- if (self.is_a?(Window_B_Confirm) or self.is_a?(Window_B_Confirm_Detail)) && $game_temp.b_confirm_limit_flag
- current = B_CONFIRM::TEXT if current >= B_CONFIRM::OVER
- max = B_CONFIRM::TEXT if max >= B_CONFIRM::OVER
- end
-
- #本来の処理を実行する。
-
- draw_current_and_max_values_overnumber(x, y, width, current, max, color1, color2)
- end
- end
- class Window_PartyCommand < Window_Command
- #--------------------------------------------------------------------------
- # コマンドリストの作成
- #--------------------------------------------------------------------------
- alias make_command_list_b_confirm make_command_list
- def make_command_list
-
- #本来の処理を実行する。
-
- make_command_list_b_confirm
-
- #状況確認コマンドを追加する。
-
- add_command(B_CONFIRM::WORD1, :b_confirm)
- end
- end
- class Window_B_Confirm < Window_Selectable
- attr_accessor :end_flag
- attr_accessor :display_mode
- attr_accessor :last_actor
- def initialize(x, y, type, actor = nil)
-
- #各種データを取得する。
-
- @display_mode = type
- @last_actor = actor
- @end_flag = false
-
- #ウィンドウを作成する。
-
- super(x, y, window_width, window_height)
-
- #背景透過度を設定する。
-
- self.back_opacity = B_CONFIRM::BOPAC
-
- activate
-
- self.index = 0
-
- #描写を行う。
-
- refresh
-
- end
- #--------------------------------------------------------------------------
- # フレーム更新
- #--------------------------------------------------------------------------
- def update
-
- #ウィンドウを閉じている最中は何もしない。
-
- return if @end_flag
-
- super
-
- return if !self.active
-
- if Input.trigger?(:B)#キャンセルキーを押した場合
-
- #キャンセルのSEを鳴らす。
-
- Sound.play_cancel
-
- @end_flag = true
- @last_actor = nil
- @display_mode = 2
-
- elsif Input.trigger?(:C)#決定キーを押した場合
-
- #バトラーが指定されていない場合はウィンドウを閉じる。
- #バトラーが指定されている場合はウィンドウを切り替える。
- case @display_mode
- when 0
- actor = B_CONFIRM::PTMT ? $game_party.all_members[index] : $game_party.members[index]
- when 1
- actor = $game_troop.unhidden_members[index]
- end
-
- #バトラーがアクターであり、なおかつアクターの詳細表示が可能な場合
- #あるいはバトラーがエネミーであり、なおかつエネミーの詳細表示が可能な場合続行。
-
- return if actor.actor? && !B_CONFIRM::PTDT
- return if !actor.actor? && !B_CONFIRM::TRDT
-
- #OKのSEを鳴らす。
-
- Sound.play_ok
-
- @end_flag = true
- @last_actor = actor
-
- elsif (Input.trigger?(:L) or Input.trigger?(:R)) && B_CONFIRM::TROK
-
- #カーソルのSEを鳴らす。
-
- Sound.play_cursor
-
- #ウィンドウを作り直す準備を行う。
-
- @end_flag = true
- @last_actor = nil
- @display_mode = @display_mode == 0 ? 1 : 0
-
- end
- end
- #--------------------------------------------------------------------------
- # ウィンドウ幅の取得
- #--------------------------------------------------------------------------
- def window_width
- Graphics.width
- end
- #--------------------------------------------------------------------------
- # ウィンドウ高さの取得
- #--------------------------------------------------------------------------
- def window_height
- Graphics.height
- end
- #--------------------------------------------------------------------------
- # 項目数の取得
- #--------------------------------------------------------------------------
- def item_max
-
- #バトラーが指定されていない場合は項目数は1個にする。
-
- return 1 if @last_actor != nil
-
- #アクターかエネミーのどちらを表示するかで処理を分岐し
- #それぞれ設定に適した値を返す。
-
- case @display_mode
- when 0
- B_CONFIRM::PTMT ? $game_party.all_members.size : $game_party.members.size
- when 1
- $game_troop.unhidden_members.size
- end
- end
- #--------------------------------------------------------------------------
- # 項目の高さを取得
- #--------------------------------------------------------------------------
- def item_height
- (height - standard_padding * 2) / 4
- end
- #--------------------------------------------------------------------------
- # 項目の描画
- #--------------------------------------------------------------------------
- def draw_item(index)
-
- #バトラーが指定されているか否かで処理を分岐。
-
- if @last_actor == nil
-
- #アクターかエネミーのどちらを表示するかで設定に応じて処理を分岐。
-
- case @display_mode
- when 0
- actor = B_CONFIRM::PTMT ? $game_party.all_members[index] : $game_party.members[index]
- when 1
- actor = $game_troop.unhidden_members[index]
- end
-
- #項目の矩形を取得。
-
- rect = item_rect(index)
-
- #項目内のデータを描写していく。
-
- $game_temp.b_confirm_limit_flag = (!B_CONFIRM::EN_O or (B_CONFIRM::EN_O && @display_mode == 1))
- draw_actor_name(actor, rect.x, rect.y)
- draw_actor_hp(actor, rect.x + 4, rect.y + line_height * 1)
- draw_actor_mp(actor, rect.x + 4, rect.y + line_height * 2)
- draw_actor_tp(actor, rect.x + 4, rect.y + line_height * 3) if $data_system.opt_display_tp
- self.contents.font.color = system_color
- draw_text(rect.x + 150, rect.y + line_height * 1, 96, line_height, B_CONFIRM::WORD2)
- draw_text(rect.x + 150, rect.y + line_height * 3, 96, line_height, B_CONFIRM::WORD3)
- self.contents.font.color = normal_color
- icons_width = (rect.width - rect.x - 150 - 96) / 24
- icons = (actor.state_icons)[0, icons_width]
- icons.each_with_index {|n, i| draw_icon(n, rect.x + 246 + 24 * i, rect.y + line_height * 1) }
- icons = (actor.state_icons)[icons_width, icons_width * 2]
- icons.each_with_index {|n, i| draw_icon(n, rect.x + 246 + 24 * i, rect.y + line_height * 2) } if icons != nil
- icons = (actor.buff_icons)[0, icons_width]
- icons.each_with_index {|n, i| draw_icon(n, rect.x + 246 + 24 * i, rect.y + line_height * 3) }
-
- end
- end
- #--------------------------------------------------------------------------
- # 決定ボタンが押されたときの処理(邪魔なので消す)
- #--------------------------------------------------------------------------
- def process_ok
- end
- #--------------------------------------------------------------------------
- # キャンセルボタンが押されたときの処理(邪魔なので消す)
- #--------------------------------------------------------------------------
- def process_cancel
- end
- #--------------------------------------------------------------------------
- # Lボタンが押されたときの処理(邪魔なので消す)
- #--------------------------------------------------------------------------
- def process_pageup
- end
- #--------------------------------------------------------------------------
- # Rボタンが押されたときの処理(邪魔なので消す)
- #--------------------------------------------------------------------------
- def process_pagedown
- end
- end
- class Window_B_Confirm_Detail < Window_Base
- attr_accessor :window_b_confirm
- attr_accessor :end_flag
- #--------------------------------------------------------------------------
- # 初期化
- #--------------------------------------------------------------------------
- def initialize(window_b_confirm)
- @page_data = 0
- @window_b_confirm = window_b_confirm
- @end_flag = false
- super(0, 0, window_width, window_height)
-
- #背景透過度を設定する。
-
- self.back_opacity = B_CONFIRM::BOPAC
-
- refresh
- end
- #--------------------------------------------------------------------------
- # ウィンドウ幅の取得
- #--------------------------------------------------------------------------
- def window_width
- Graphics.width
- end
- #--------------------------------------------------------------------------
- # ウィンドウ高さの取得
- #--------------------------------------------------------------------------
- def window_height
- Graphics.height
- end
- #--------------------------------------------------------------------------
- # フレーム更新
- #--------------------------------------------------------------------------
- def update
- super
- if Input.trigger?(:B)#キャンセルキーを押した場合
-
- #キャンセルのSEを鳴らす。
-
- Sound.play_cancel
- @end_flag = true
-
- elsif page_change? #決定キー、左右キー、LRボタンを押した場合
-
- Sound.play_cursor
- @page_data = @page_data == 0 ? 1 : 0
- contents.clear
- refresh
-
- end
- end
- #--------------------------------------------------------------------------
- # ページ切り替えを行うか?
- #--------------------------------------------------------------------------
- def page_change?
- flag = false
- [:C, :L, :R, :LEFT, :RIGHT].each {|k|flag = true if Input.trigger?(k)}
- flag
- end
- #--------------------------------------------------------------------------
- # リフレッシュ
- #--------------------------------------------------------------------------
- def refresh
- #バトラーを取得。
-
- actor = @window_b_confirm.last_actor
-
- #項目内のデータを描写していく。
-
- draw_actor_name(actor, x, y)
- $game_temp.b_confirm_limit_flag = (!B_CONFIRM::EN_O or (B_CONFIRM::EN_O && !actor.actor?))
- draw_actor_hp(actor, x + 4, y + line_height * 1)
- draw_actor_mp(actor, x + 4, y + line_height * 2)
- draw_actor_tp(actor, x + 4, y + line_height * 3) if $data_system.opt_display_tp
- self.contents.font.color = system_color
- draw_text(x + 150, y + line_height * 1, 96, line_height, B_CONFIRM::WORD2)
- draw_text(x + 150, y + line_height * 3, 96, line_height, B_CONFIRM::WORD3)
- self.contents.font.color = normal_color
- icons_width = (width - x - 162 - 96) / 24
- icons = (actor.state_icons)[0, icons_width]
- icons.each_with_index {|n, i| draw_icon(n, x + 246 + 24 * i, y + line_height * 1) }
- icons = (actor.state_icons)[icons_width, icons_width * 2]
- icons.each_with_index {|n, i| draw_icon(n, x + 246 + 24 * i, y + line_height * 2) } if icons != nil
- icons = (actor.buff_icons)[0, icons_width]
- icons.each_with_index {|n, i| draw_icon(n, x + 246 + 24 * i, y + line_height * 3) }
- draw_horz_line(line_height * 4)
-
- if @page_data == 0
-
- 6.times {|i|draw_actor_param(actor, x, y + line_height * (5 + i), (i + 2))}
- ex_xprms_draw(actor, x, y)
- ex_sprms_draw(actor, x, y)
-
- else
-
- ex_elem_draw(actor, x, y)
- ex_state_draw(actor, x, y)
-
- end
- end
- #--------------------------------------------------------------------------
- # 水平線の色を取得(Window_Statusからそのままコピー)
- #--------------------------------------------------------------------------
- def line_color
- color = normal_color
- color.alpha = 48
- color
- end
- #--------------------------------------------------------------------------
- # 水平線の描画(Window_Statusからそのままコピー)
- #--------------------------------------------------------------------------
- def draw_horz_line(y)
- line_y = y + line_height / 2 - 1
- contents.fill_rect(0, line_y, contents_width, 2, line_color)
- end
- #--------------------------------------------------------------------------
- # 追加能力値
- #--------------------------------------------------------------------------
- def ex_xprms_draw(actor, x, y)
-
- #追加能力値の描写対象がない場合は飛ばす。
-
- return if B_CONFIRM::XPRM.empty?
-
- #追加能力値を描写する。
-
- B_CONFIRM::XPRM.each_with_index do |xp, i|
- next if !actor.actor? && !xp[2]
- change_color(system_color)
- draw_text(x + 170, y + line_height * (5 + i), 120, line_height, xp[1])
- change_color(normal_color)
- draw_text(x + 280, y + line_height * (5 + i), 56, line_height, (actor.xparam(xp[0]) * 100).to_i.to_s + (B_CONFIRM::ADP ? "%" : ""), 2)
- end
- end
- #--------------------------------------------------------------------------
- # 特殊能力値
- #--------------------------------------------------------------------------
- def ex_sprms_draw(actor, x, y)
-
- #特殊能力値の描写対象がない場合は飛ばす。
-
- return if B_CONFIRM::SPRM.empty?
-
- #特殊能力値を描写する。
-
- B_CONFIRM::SPRM.each_with_index do |sp, i|
- next if !actor.actor? && !sp[2]
- change_color(system_color)
- draw_text(x + 344, y + line_height * (5 + i), 120, line_height, sp[1])
- change_color(normal_color)
- draw_text(x + 454, y + line_height * (5 + i), 56, line_height, (actor.sparam(sp[0]) * 100).to_i.to_s + (B_CONFIRM::SPP ? "%" : ""), 2)
- end
- end
- #--------------------------------------------------------------------------
- # 属性有効度
- #--------------------------------------------------------------------------
- def ex_elem_draw(actor, x, y)
-
- #属性有効度の描写対象がない場合は飛ばす。
-
- return if B_CONFIRM::ELEM.empty?
-
- #属性有効度を描写する。
-
- B_CONFIRM::ELEM.each_with_index do |elem, i|
- next if !actor.actor? && !elem[2]
- change_color(system_color)
- name = $data_system.elements[elem[0]]
- data = (actor.element_rate(elem[0]) * 100).to_i
- data = (elem[3] ? (100 - data) : data).to_s
- draw_text(x, y + line_height * (5 + i), 120, line_height, name + elem[1])
- change_color(normal_color)
- draw_text(x + 110, y + line_height * (5 + i), 56, line_height, data + (B_CONFIRM::ELP ? "%" : ""), 2)
- end
- end
- #--------------------------------------------------------------------------
- # ステート有効度
- #--------------------------------------------------------------------------
- def ex_state_draw(actor, x, y)
-
- #ステート有効度の描写対象がない場合は飛ばす。
-
- return if B_CONFIRM::STAT.empty?
-
- #ステート有効度を描写する。
-
- B_CONFIRM::STAT.each_with_index do |state, i|
- next if !actor.actor? && !state[2]
- change_color(system_color)
- x_data = i < B_CONFIRM::MAX ? 170 : 344
- if state[0] > 0
- name = $data_states[state[0]].name
- data = (actor.state_rate(state[0]) * 100).to_i
- data = (state[3] ? (100 - data) : data).to_s
- else
- state_id = state[0].abs
- name = Vocab.param(state_id)
- data = (actor.debuff_rate(state_id) * 100).to_i
- data = (state[3] ? (100 - data) : data).to_s
- end
- draw_text(x + x_data, y + line_height * (5 + i - (i < B_CONFIRM::MAX ? 0 : B_CONFIRM::MAX)), 120, line_height, name + state[1])
- change_color(normal_color)
- draw_text(x + x_data + 110, y + line_height * (5 + i - (i < B_CONFIRM::MAX ? 0 : B_CONFIRM::MAX)), 56, line_height, data + (B_CONFIRM::STP ? "%" : ""), 2)
- end
- end
- end
- class Scene_Battle < Scene_Base
- #--------------------------------------------------------------------------
- # パーティコマンドウィンドウの作成
- #--------------------------------------------------------------------------
- alias create_party_command_window_b_confirm create_party_command_window
- def create_party_command_window
-
- #本来の処理を実行。
-
- create_party_command_window_b_confirm
-
- #状況確認コマンド用のハンドラを追加。
-
- @party_command_window.set_handler(:b_confirm, method(:command_b_confirm))
- end
- #--------------------------------------------------------------------------
- # コマンド[状況確認]
- #--------------------------------------------------------------------------
- def command_b_confirm
-
- #状況確認コマンドの処理内容を実行。
-
- b_confirm_execute
- end
- #--------------------------------------------------------------------------
- # 状況確認開始
- #--------------------------------------------------------------------------
- def b_confirm_execute
-
- #状況確認ウィンドウを作成。
-
- @b_confirm_window = Window_B_Confirm.new(0, 0, 0)
-
- #処理をループで処理。
-
- loop do
-
- #とりあえずアップデートは行う。
-
- update
-
- #状況確認ウィンドウがアクティブであり
- #なおかつ操作終了フラグが有効な場合は分岐。
-
- if @b_confirm_window.active && @b_confirm_window.end_flag
-
- #表示モードが2の時、ループを終了する。
-
- break if @b_confirm_window.display_mode == 2
-
- #操作終了フラグをfalseにする。
-
- @b_confirm_window.end_flag = false
-
- #最後にキャラクターを選択している場合
-
- if @b_confirm_window.last_actor != nil
-
- #状況確認ウィンドウのアクティブ状態を解除し
- #詳細ウィンドウを作成する。
-
- @b_confirm_window.deactivate
- @b_confirm_detail_window = Window_B_Confirm_Detail.new(@b_confirm_window)
-
- #最後にキャラクターを選択していない場合
-
- else
-
- #状況確認ウィンドウを解放する。
-
- @b_confirm_window.dispose
-
- #状況確認ウィンドウを作り直す。
-
- @b_confirm_window = Window_B_Confirm.new(0, 0, (@b_confirm_window.display_mode == 0 ? 0 : 1))
-
- end
-
- #詳細ウィンドウが存在し、なおかつ終了フラグが有効な場合。
-
- elsif @b_confirm_detail_window != nil && @b_confirm_detail_window.end_flag
-
- #詳細ウィンドウを解放し、nil扱いとする。
-
- @b_confirm_detail_window.dispose
- @b_confirm_detail_window = nil
-
- #最後に選択したアクターをnilとする。
-
- @b_confirm_window.last_actor = nil
-
- #状況確認ウィンドウをアクティブ化する。
-
- @b_confirm_window.activate
- end
- end
-
- #状況確認ウィンドウを解放する。
-
- @b_confirm_window.dispose
-
- #パーティコマンドウィンドウをアクティブにする。
-
- @party_command_window.activate
- end
- end
- end
复制代码
这是在战斗选项中添加可以查看状态的一个选项,进去按Q键可以看到敌人的状态
- # ステ―ト詳細確認ウィンドウ
- #
- # 戦闘時、パーティコマンドに付与されているステートの詳細を確認するためのコマンド
- # を追加します。
- $imported_yana_scripts ||= {}
- $imported_yana_scripts["StateHelpWindow"] = true
- module StateHelp
- Buffs = {}
- States = []
-
- # 请按照下面的描写进行备注
- Buffs[[0,:up]] = "HPの強化効果\n最大10段階"
- Buffs[[1,:up]] = "MPの強化効果\n最大10段階"
- Buffs[[2,:up]] = "攻撃力の強化効果\n最大10段階"
- Buffs[[3,:up]] = "防御力の強化効果\n最大10段階"
- Buffs[[4,:up]] = "魔法力の強化効果\n最大10段階"
- Buffs[[5,:up]] = "魔法防御の強化効果\n最大10段階"
- Buffs[[6,:up]] = "敏捷の強化効果\n最大10段階"
- Buffs[[7,:up]] = "運の強化効果\n最大10段階"
-
- Buffs[[0,:down]] = "HPの弱体効果\n最大5段階"
- Buffs[[1,:down]] = "MPの弱体効果\n最大5段階"
- Buffs[[2,:down]] = "攻撃力の弱体効果\n最大5段階"
- Buffs[[3,:down]] = "防御力の弱体効果\n最大5段階"
- Buffs[[4,:down]] = "魔法力の弱体効果\n最大5段階"
- Buffs[[5,:down]] = "魔法防御の弱体効果\n最大5段階"
- Buffs[[6,:down]] = "敏捷の弱体効果\n最大5段階"
- Buffs[[7,:down]] = "運の弱体効果\n最大5段階"
- States[1] = "戦闘不能\nHPが0になり、すべての行動ができない。"
- States[2] = "毒\n毎ターン、最大HPの5%のダメージを受ける。"
- States[3] = "暗闇\n物理命中率が40%低下する。"
- States[4] = "沈黙\n魔法に属するコマンドが使用できなくなる。"
- States[5] = "混乱\n混乱し、敵味方の区別なく攻撃を繰り出す。"
- States[6] = "睡眠\n行動できない、狙われ率が上がって回避が下がる。"
- States[7] = "麻痺\n40%の確率で行動できない。回避が下がる"
- States[8] = "スタン\nスタンしてしまって行動できない状態。"
- States[9] = "防御\n被ダメージを減少する"
- States[10] = "石化\n行動できない。回避と防御、狙われ率が下がる"
-
- end
- class Game_BattlerBase
- attr_reader :buffs
- end
- class Window_State < Window_Selectable
- def initialize(help_window)
- super(0,0,32,32)
- #~ self.x = [Graphics.width / 2 - self.width / 2,0].max
- #~ self.y = [Graphics.height / 2 - self.height / 2,help_window.height].max
- self.openness = 0
- @help_window = help_window
- refresh
- end
- def all_battle_members;($game_party.battle_members + $game_troop.members).select{|m| m.exist? };end
- def row_max;all_battle_members.size;end
- def col_max
- m = all_battle_members.max_by{|a| a.state_icons.size + a.buff_icons.size }
- [m.state_icons.size + m.buff_icons.size,1].max
- end
- def item_max;row_max*col_max;end
- def item_height; line_height + 2 ; end
- def item_width; line_height + 2 ; end
-
- def fitting_window
- self.height = item_height * row_max + standard_padding*2
- self.width = 144+(col_max*item_width) + standard_padding*2
- self.x = [Graphics.width / 2 - self.width / 2,0].max
- self.y = [Graphics.height / 2 - self.height / 2,help_window.height].max
- end
- def refresh
- fitting_window
- make_data
- create_contents
- all_battle_members.each_with_index{|a,i|
- draw_actor_name(a,0,i*item_height+1)
- draw_text(128,i*item_height+1,20,line_height,":")
- draw_icons(a, 144, i*item_height+1, contents.width - 144)
- }
- end
-
- def draw_icons(subject, x, y, width = 96)
- icons = (subject.state_icons + subject.buff_icons)[0, width / item_width]
- icons.each_with_index {|n, i| draw_icon(n, x + item_width * i, y) }
- end
-
- def item_rect(index)
- rect = Rect.new
- rect.width = item_width
- rect.height = item_height
- rect.x = index % col_max * item_width + 143
- rect.y = index / col_max * item_height
- rect
- end
-
- def update_help
- @help_window.set_text(description)
- end
-
- def make_data
- @data = all_battle_members.inject([]){|r,m|
- a = []
- a += m.states.select{|st| st.icon_index != 0 }
- bf = []
- m.buffs.each_with_index{|b,i| bf.push([i,b > 0 ? :up : :down]) if b != 0}
- a += bf
- a += Array.new(col_max - a.size){nil} if col_max > a.size
- r += a
- }
- end
-
- def description
- return "" unless @data[index]
- if @data[index].is_a?(Array)
- return StateHelp::Buffs[@data[index]]
- else
- return StateHelp::States[@data[index].id]
- end
- end
- def cursor_down(wrap = false)
- return if @data.compact.empty?
- loop do
- select((index + col_max) % item_max)
- break if @data[index]
- end
- end
- def cursor_up(wrap = false)
- return if @data.compact.empty?
- loop do
- select((index - col_max + item_max) % item_max)
- break if @data[index]
- end
- end
- def cursor_right(wrap = false)
- return if @data.compact.empty?
- loop do
- select((index + 1) % item_max)
- break if @data[index]
- end
- end
- def cursor_left(wrap = false)
- return if @data.compact.empty?
- loop do
- select((index - 1 + item_max) % item_max)
- break if @data[index]
- end
- end
- def smooth_select
- return select(0) if @data.compact.empty?
- @data.each_with_index{|d,i|
- if d
- select(i)
- return
- end
- }
- end
- end
- class Window_PartyCommand < Window_Command
- alias _ex_state_make_command_list make_command_list
- def make_command_list
- _ex_state_make_command_list
- add_command("异常状态明细", :state)
- end
- end
- class Scene_Battle < Scene_Base
- alias _ex_state_create_all_windows create_all_windows
- def create_all_windows
- _ex_state_create_all_windows
- create_state_window
- end
- alias _ex_state_create_party_command_window create_party_command_window
- def create_party_command_window
- _ex_state_create_party_command_window
- @party_command_window.set_handler(:state, method(:command_state))
- end
- def create_state_window
- @state_window = Window_State.new(@help_window)
- @state_window.set_handler(:ok, method(:command_state_cancel))
- @state_window.set_handler(:cancel, method(:command_state_cancel))
- @state_window.unselect
- end
-
- def command_state
- @party_command_window.deactivate
- @state_window.refresh
- @state_window.open.activate.smooth_select
- @help_window.show
- end
-
- def command_state_cancel
- @state_window.deactivate.close.unselect
- @party_command_window.activate
- @help_window.hide
- end
- end
复制代码
这也是选项中看到状态的脚本,但这脚本不但能看到状态,还能看到状态的描述,不过需要你按状态编号每个状态进行备注 |
评分
-
查看全部评分
|