查看: 2038|回复: 3

[已经解决] 战斗界面下如何查看敌方身上的BUFF?

[复制链接]
梦石
1
星屑
472
在线时间
120 小时
注册时间
2016-3-6
回帖
63
发表于 2016-3-20 16:31:06 | 显示全部楼层 |阅读模式

加入我们,或者,欢迎回来。

您需要 登录 才可以下载或查看,没有账号?注册会员

×
战斗的时候我方给敌方施加了一个减益Buff,或者敌方给自己施加了一个增益Buff。
问题是我看不到敌方身上有哪些增益或减益BUFF啊!

这个能不能进行设置的?

比如:

QQ图片20160320162528.png

在选择目标的时候,敌人名字旁边添加一些BUFF图标,表示对方目前身上有哪些BUFF。

这个的话,需要改动脚本还是只要设置一下就行了?
R
梦石
0
星屑
2920
在线时间
713 小时
注册时间
2010-7-25
回帖
659

开拓者

发表于 2016-3-21 13:50:14 | 显示全部楼层

  1. #==============================================================================
  2. #  ■エネミーの状態を表示 for RGSS3 Ver0.90-α
  3. # □作成者 kure
  4. #==============================================================================
  5. # 怪物备注   <情報表示幅 150>  血条变成150%长度,状态显示额外增加2个
  6. #           <情報非表示> 敌人的HP和状态不会显示

  7. $kure_base_script = {} if $kure_base_script == nil
  8. $kure_base_script[:InfoBar] = 100
  9. p "エネミーの情報表示"
  10. module KURE
  11.   module InfoBar
  12.     #初期設定(変更しない事)-----------------------------------------------------
  13.     COLOR = []
  14.    
  15.     #表示色(IDによって割り当てが決まっています。)
  16.       #バーの背景色(ID0)
  17.       COLOR[0] = Color.new(32 ,32, 64, 255)
  18.       
  19.       #HPバーの色(ID1,ID2)
  20.       COLOR[1] = Color.new(224 ,128, 64, 255)
  21.       COLOR[2] = Color.new(240 ,192, 64, 255)
  22.    
  23.   end
  24. end

  25. #==============================================================================
  26. # ■ RPG::Enemy(追加定義)
  27. #==============================================================================
  28. class RPG::Enemy < RPG::BaseItem
  29.   #--------------------------------------------------------------------------
  30.   # ☆ バーの表示幅の定義(追加定義)
  31.   #--------------------------------------------------------------------------  
  32.   def infobar_width
  33.     @note.match(/<情報表示幅\s?(\d+)\s?>/)
  34.     return 100 unless $1
  35.     return $1.to_i
  36.   end
  37.   #--------------------------------------------------------------------------
  38.   # ☆ バーの表示幅の定義(追加定義)
  39.   #--------------------------------------------------------------------------  
  40.   def infobar_visible?
  41.     return false if @note.include?("<情報非表示>")
  42.     return true
  43.   end
  44. end

  45. #==============================================================================
  46. # ■ Game_Enemy
  47. #==============================================================================
  48. class Game_Enemy < Game_Battler
  49.   #--------------------------------------------------------------------------
  50.   # ☆ バーの表示幅の定義(追加定義)
  51.   #--------------------------------------------------------------------------  
  52.   def infobar_width
  53.     return enemy.infobar_width
  54.   end
  55.   #--------------------------------------------------------------------------
  56.   # ☆ バーの表示幅の定義(追加定義)
  57.   #--------------------------------------------------------------------------  
  58.   def infobar_visible?
  59.     return enemy.infobar_visible?
  60.   end
  61. end

  62. #==============================================================================
  63. # ■ Spriteset_Battle
  64. #==============================================================================
  65. class Spriteset_Battle
  66.   #--------------------------------------------------------------------------
  67.   # ● 敵キャラスプライトの作成(エイリアス再定義)
  68.   #--------------------------------------------------------------------------
  69.   alias k_basescript_before_create_enemies create_enemies
  70.   def create_enemies
  71.     k_basescript_before_create_enemies
  72.     @enemy_info_bar = $game_troop.members.reverse.collect do |enemy|
  73.       Sprite_Infobar.new(@viewport1, enemy)
  74.     end
  75.   end
  76.   #--------------------------------------------------------------------------
  77.   # ● 敵キャラスプライトの更新(エイリアス再定義)
  78.   #--------------------------------------------------------------------------
  79.   alias k_basescript_before_update_enemies update_enemies
  80.   def update_enemies
  81.     k_basescript_before_update_enemies
  82.     @enemy_info_bar.each {|sprite| sprite.update }
  83.   end
  84.   #--------------------------------------------------------------------------
  85.   # ● 敵キャラスプライトの解放(エイリアス再定義)
  86.   #--------------------------------------------------------------------------
  87.   alias k_basescript_before_dispose_enemies dispose_enemies
  88.   def dispose_enemies
  89.     k_basescript_before_dispose_enemies
  90.     @enemy_info_bar.each {|sprite| sprite.dispose }
  91.   end
  92. end

  93. #==============================================================================
  94. # ■ Sprite_Infobar
  95. #==============================================================================
  96. class Sprite_Infobar < Sprite_Base
  97.   #--------------------------------------------------------------------------
  98.   # ● 公開インスタンス変数
  99.   #--------------------------------------------------------------------------
  100.   attr_accessor :battler
  101.   #--------------------------------------------------------------------------
  102.   # ● オブジェクト初期化
  103.   #--------------------------------------------------------------------------
  104.   def initialize(viewport, battler = nil)
  105.     super(viewport)
  106.     @battler = battler
  107.     @fill_w = nil
  108.     @bitmap_data = Cache.battler(battler.battler_name, battler.battler_hue)
  109.     @state = battler.states
  110.     @icon_set = Cache.system("Iconset")
  111.   end
  112.   #--------------------------------------------------------------------------
  113.   # ● フレーム更新
  114.   #--------------------------------------------------------------------------
  115.   def update
  116.     super
  117.     if @battler && !@battler.hidden?
  118.       @use_sprite = @battler.use_sprite?
  119.       if @use_sprite
  120.         update_bitmap
  121.         update_origin
  122.         update_position
  123.       end
  124.     else
  125.       self.bitmap = nil
  126.     end
  127.   end
  128.   #--------------------------------------------------------------------------
  129.   # ● 解放
  130.   #--------------------------------------------------------------------------
  131.   def dispose
  132.     bitmap.dispose if bitmap
  133.     super
  134.   end
  135.   #--------------------------------------------------------------------------
  136.   # ● 転送元ビットマップの更新
  137.   #--------------------------------------------------------------------------
  138.   def update_bitmap
  139.     fill_w = @battler.infobar_width * (@battler.hp.to_f / @battler.mhp)
  140.     state = battler.states
  141.     if @fill_w != fill_w or @state != state
  142.       @fill_w = fill_w
  143.       @state = state
  144.       
  145.       width = @battler.infobar_width + 4
  146.       
  147.       new_bitmap = Bitmap.new(width, 35)
  148.       @state.each_with_index {|state, index|
  149.         next if 24 * (index + 1) > new_bitmap.width
  150.         rect = Rect.new(state.icon_index % 16 * 24, state.icon_index / 16 * 24, 24, 24)
  151.         new_bitmap.blt(24 * index, 0, @icon_set, rect, 255)
  152.       }
  153.       new_bitmap.fill_rect(0, 25, width, 10, color(0))
  154.       new_bitmap.gradient_fill_rect(2, 27, fill_w, 6, color(1), color(2))
  155.    
  156.       self.bitmap = new_bitmap
  157.       init_visibility
  158.       
  159.       self.opacity = 0 unless @battler.infobar_visible?
  160.     end
  161.   end
  162.   #--------------------------------------------------------------------------
  163.   # ● 可視状態の初期化
  164.   #--------------------------------------------------------------------------
  165.   def init_visibility
  166.     @battler_visible = @battler.alive?
  167.     self.opacity = 0 unless @battler_visible
  168.   end
  169.   #--------------------------------------------------------------------------
  170.   # ● 文字色取得
  171.   #--------------------------------------------------------------------------
  172.   def color(num)
  173.     return KURE::InfoBar::COLOR[num]
  174.   end
  175.   #--------------------------------------------------------------------------
  176.   # ● 原点の更新
  177.   #--------------------------------------------------------------------------
  178.   def update_origin
  179.     if bitmap
  180.       self.ox = bitmap.width / 2
  181.       self.oy = bitmap.height
  182.     end
  183.   end
  184.   #--------------------------------------------------------------------------
  185.   # ● 位置の更新
  186.   #--------------------------------------------------------------------------
  187.   def update_position
  188.     self.x = @battler.screen_x
  189.     self.y = @battler.screen_y - @bitmap_data.height
  190.     self.z = @battler.screen_z + 10
  191.   end
  192. end
复制代码


这是看怪物血和血条下显示状态的脚本

  1. #==============================================================================
  2. # ■ RGSS3 状況確認コマンド Ver1.05 by 星潟
  3. #------------------------------------------------------------------------------
  4. # RPGツクールVXAceでは、現在のステートや強化/弱体の表示数が
  5. # 著しく制限されており、非常に確認し辛いです。
  6. #
  7. # しかし、状況確認コマンドではステートを22個、強化/弱体も全て表示されます。
  8. #
  9. # パーティコマンドに、敵味方の現在能力値やステート/強化/弱体の状態を
  10. # 確認する為の新規コマンドを追加します。
  11. # 最初はアクターを表示し、LボタンかRボタンを押すことで
  12. # エネミーに表示を切り替えます。
  13. # アクターかエネミーを指定して決定キーを押すことで詳細表示を行います。
  14. # 詳細表示中に更に決定キーを押すと、属性耐性とステート耐性が表示されます。
  15. #
  16. # エネミーを表示しない機能や、詳細を表示せず
  17. # ステート/強化/弱体の確認に留めさせる設定も可能です。
  18. #
  19. # テストモードでの利用に限定する事も可能です。
  20. #------------------------------------------------------------------------------
  21. # Ver1.01 %表示に関する設定や、属性/ステート耐性の表示機能が追加されました。
  22. # Ver1.02 操作性を向上させました。
  23. # Ver1.03 隠れている敵を表示しないようにする機能を追加しました。
  24. # Ver1.04 詳細モードで敵のHPが表示限界でも見えてしまう不具合を修正しました。
  25. #         また、表示限界の適用を敵のみにする機能を追加しました。
  26. # Ver1.05 システム側のTP表示設定が無効化されていてもTPが表示される不具合を修正。
  27. #==============================================================================
  28. module B_CONFIRM
  29.   
  30.   #テストモード限定化するか否かを設定します。
  31.   #(trueで限定化/falseで常時使用可)
  32.   
  33.   TONLY = false
  34.   
  35.   #状況確認コマンドの名称を取得します。
  36.   
  37.   WORD1 = "情报确认"
  38.   
  39.   #ステート表示用の項目名を取得します。
  40.   
  41.   WORD2 = "状态"
  42.   
  43.   #強化/弱体表示用の項目名を取得します。
  44.   
  45.   WORD3 = "強化/弱化"
  46.   
  47.   #背景透過度を設定します。
  48.   
  49.   BOPAC = 255
  50.   
  51.   #控えメンバーも表示するかどうかを設定します。
  52.   #(trueで表示/falseで非表示)
  53.   
  54.   PTMT = true
  55.   
  56.   #メンバーの詳細情報を表示するかどうかを設定します。
  57.   #(trueで表示/falseで非表示)
  58.   
  59.   PTDT = true
  60.   
  61.   #ページ切り替えで敵も表示するかどうかを設定します。
  62.   #(trueで表示/falseで非表示)
  63.   
  64.   TROK = true
  65.   
  66.   #敵の詳細情報を表示するかどうかを設定します。
  67.   #(trueで表示/falseで非表示)
  68.   
  69.   TRDT = true
  70.   
  71.   #隠れている敵も表示するかどうかを指定します。
  72.   
  73.   HIDE = false
  74.   
  75.   #HP/MP/TPの表示限界値を設定します。
  76.   #この値を以上の値となった時はTEXTの文字列を表示します。
  77.   
  78.   OVER = 10000
  79.   
  80.   #HP/MP/TPが表示限界値に達した際に、代わりに表示する文字列を設定します。
  81.   
  82.   TEXT = "?????"
  83.   
  84.   #表示限界に達した際に代わりに表示するのは敵のみにするかを設定します。
  85.   #trueで敵のみ、falseで双方となります。
  86.   
  87.   EN_O = true
  88.   
  89.   #2ページ目を有効にするか否かを設定します。
  90.   #(trueで有効/falseで無効)
  91.   
  92.   P2   = true
  93.   
  94.   #詳細情報での追加能力値の表示設定を行います。
  95.   #[追加能力値ID(0~9の数字), 追加能力値名称(文字列), 敵も表示するか否か(true/false)]で
  96.   #1セットとなっています。
  97.   
  98.   XPRM = [
  99.   [0, "命中率", true],
  100.   [1, "物理回避率", true],
  101.   [2, "暴击率", true],
  102.   [3, "暴击回避率", true],
  103.   [4, "魔法回避率", true],
  104.   [5, "魔法反射率", true],
  105.   [6, "反击率", true],
  106.   [7, "HP再生率", true],
  107.   [8, "MP再生率", true],
  108.   [9, "TP再生率", true]
  109.   ]
  110.   
  111.   #追加能力値の後に%の文字を付けるか否かを設定します。
  112.   #(trueで有効/falseで無効)
  113.   
  114.   ADP  = false
  115.   
  116.   #詳細情報での特殊能力値の表示設定を行います。
  117.   #[特殊能力値ID(0~9の数字), 特殊能力値名称(文字列), 敵も表示するか否か(true/false)]で
  118.   #1セットとなっています。
  119.   
  120.   SPRM = [
  121.   [0, "仇恨", false],
  122.   [1, "防御効果比例", false],
  123.   [2, "回復効果比例", false],
  124.   [3, "药的知识", false],
  125.   [4, "MP消耗率", false],
  126.   [5, "TP补充率", false],
  127.   [6, "受物伤比例", false],
  128.   [7, "受法伤比例", false],
  129.   [9, "经验加成比例", false]
  130.   ]
  131.   
  132.   #特殊能力値の後に%の文字を付けるか否かを設定します。
  133.   #(trueで有効/falseで無効)
  134.   
  135.   SPP  = false
  136.   
  137.   #詳細情報での属性有効度の表示設定を行います。
  138.   #[属性ID, 属性名の後に付ける文字(文字列),
  139.   #敵も表示するか否か(true/false),
  140.   #100から該当の値を引いた数で表示するかを否か,
  141.   #数字の後に付ける文字(文字列)]で
  142.   #1セットとなっています。
  143.   
  144.   ELEM = [
  145.   [1, "耐性", true, true],
  146.   [2, "耐性", true, true],
  147.   [3, "耐性", true, true],
  148.   [4, "耐性", true, true],
  149.   [5, "耐性", true, true],
  150.   [6, "耐性", true, true],
  151.   [7, "耐性", true, true],
  152.   [8, "耐性", true, true],
  153.   [9, "耐性", true, true],
  154.   [12, "耐性", true, true],
  155.   [13, "效果", true, true],
  156.   ]
  157.   
  158.   #属性有効度の後に%の文字を付けるか否かを設定します。
  159.   #(trueで有効/falseで無効)
  160.   
  161.   ELP  = false
  162.   
  163.   #1行目に表示するステートの最大数を指定します。
  164.   #(2行目までしか想定していません)
  165.   
  166.   MAX  = 11
  167.   
  168.   #詳細情報でのステート有効度の表示設定を行います。
  169.   #[ステートID(0~-7で指定した場合は、絶対数の値の弱体有効度ID),
  170.   #ステート名の後に付ける文字(文字列), 敵も表示するか否か(true/false),
  171.   #100から該当の値を引いた数で表示するかを否か]で
  172.   #1セットとなっています。
  173.   
  174.   STAT = [
  175.   [1, "耐性", true, true],
  176.   [2, "耐性", true, true],
  177.   [3, "耐性", true, true],
  178.   [4, "耐性", true, true],
  179.   [5, "耐性", true, true],
  180.   [6, "耐性", true, true],
  181.   [7, "耐性", true, true],
  182.   [8, "耐性", true, true],
  183.   [10, "耐性", true, true],
  184.   [12, "耐性", true, true],
  185.   [13, "耐性", true, true],
  186.   [14, "耐性", true, true],
  187.   [17, "耐性", true, true],
  188.   [21, "耐性", true, true],
  189.   [22, "耐性", true, true],
  190.   [23, "耐性", true, true],
  191.   ]
  192.   
  193.   #ステート有効度の後に%の文字を付けるか否かを設定します。
  194.   #(trueで有効/falseで無効)
  195.   
  196.   STP  = false
  197.   
  198. end

  199. #テストモード限定化されており、なおかつテストモードの場合か
  200. #テストモード限定化されていない場合は処理を行う。

  201. if (B_CONFIRM::TONLY && ($TEST or $BTEST)) or !B_CONFIRM::TONLY

  202. class Game_Troop < Game_Unit
  203.   def unhidden_members
  204.     B_CONFIRM::HIDE ? members : members.select {|e| !e.hidden?}
  205.   end
  206. end
  207. class Game_Temp
  208.   attr_accessor :b_confirm_limit_flag
  209. end
  210. class Window_Base < Window
  211.   alias draw_current_and_max_values_overnumber draw_current_and_max_values
  212.   def draw_current_and_max_values(x, y, width, current, max, color1, color2)
  213.    
  214.     #状況確認ウィンドウである場合のみ
  215.     #現在値と最大値を必要に応じて読み替える。
  216.    
  217.     if (self.is_a?(Window_B_Confirm) or self.is_a?(Window_B_Confirm_Detail)) && $game_temp.b_confirm_limit_flag
  218.       current = B_CONFIRM::TEXT if current >= B_CONFIRM::OVER
  219.       max = B_CONFIRM::TEXT if max >= B_CONFIRM::OVER
  220.     end
  221.    
  222.     #本来の処理を実行する。
  223.    
  224.     draw_current_and_max_values_overnumber(x, y, width, current, max, color1, color2)
  225.   end
  226. end
  227. class Window_PartyCommand < Window_Command
  228.   #--------------------------------------------------------------------------
  229.   # コマンドリストの作成
  230.   #--------------------------------------------------------------------------
  231.   alias make_command_list_b_confirm make_command_list
  232.   def make_command_list
  233.    
  234.     #本来の処理を実行する。
  235.    
  236.     make_command_list_b_confirm
  237.    
  238.     #状況確認コマンドを追加する。
  239.    
  240.     add_command(B_CONFIRM::WORD1,  :b_confirm)
  241.   end
  242. end
  243. class Window_B_Confirm < Window_Selectable
  244.   attr_accessor :end_flag
  245.   attr_accessor :display_mode
  246.   attr_accessor :last_actor
  247.   def initialize(x, y, type, actor = nil)
  248.    
  249.     #各種データを取得する。
  250.    
  251.     @display_mode = type
  252.     @last_actor = actor
  253.     @end_flag = false
  254.    
  255.     #ウィンドウを作成する。
  256.    
  257.     super(x, y, window_width, window_height)
  258.    
  259.     #背景透過度を設定する。
  260.    
  261.     self.back_opacity = B_CONFIRM::BOPAC
  262.    
  263.     activate
  264.    
  265.     self.index = 0
  266.    
  267.     #描写を行う。
  268.    
  269.     refresh
  270.    
  271.   end
  272.   #--------------------------------------------------------------------------
  273.   # フレーム更新
  274.   #--------------------------------------------------------------------------
  275.   def update
  276.    
  277.     #ウィンドウを閉じている最中は何もしない。
  278.    
  279.     return if @end_flag
  280.    
  281.     super
  282.    
  283.     return if !self.active
  284.    
  285.     if Input.trigger?(:B)#キャンセルキーを押した場合
  286.       
  287.       #キャンセルのSEを鳴らす。
  288.       
  289.       Sound.play_cancel
  290.       
  291.       @end_flag = true
  292.       @last_actor = nil
  293.       @display_mode = 2
  294.       
  295.     elsif Input.trigger?(:C)#決定キーを押した場合
  296.       
  297.       #バトラーが指定されていない場合はウィンドウを閉じる。
  298.       #バトラーが指定されている場合はウィンドウを切り替える。
  299.       case @display_mode
  300.       when 0
  301.         actor = B_CONFIRM::PTMT ? $game_party.all_members[index] : $game_party.members[index]
  302.       when 1
  303.         actor = $game_troop.unhidden_members[index]
  304.       end
  305.       
  306.       #バトラーがアクターであり、なおかつアクターの詳細表示が可能な場合
  307.       #あるいはバトラーがエネミーであり、なおかつエネミーの詳細表示が可能な場合続行。
  308.       
  309.       return if actor.actor? && !B_CONFIRM::PTDT
  310.       return if !actor.actor? && !B_CONFIRM::TRDT
  311.       
  312.       #OKのSEを鳴らす。
  313.       
  314.       Sound.play_ok
  315.       
  316.       @end_flag = true
  317.       @last_actor = actor
  318.         
  319.     elsif (Input.trigger?(:L) or Input.trigger?(:R)) && B_CONFIRM::TROK
  320.       
  321.       #カーソルのSEを鳴らす。
  322.       
  323.       Sound.play_cursor
  324.       
  325.       #ウィンドウを作り直す準備を行う。
  326.       
  327.       @end_flag = true
  328.       @last_actor = nil
  329.       @display_mode = @display_mode == 0 ? 1 : 0
  330.       
  331.     end
  332.   end
  333.   #--------------------------------------------------------------------------
  334.   # ウィンドウ幅の取得
  335.   #--------------------------------------------------------------------------
  336.   def window_width
  337.     Graphics.width
  338.   end
  339.   #--------------------------------------------------------------------------
  340.   # ウィンドウ高さの取得
  341.   #--------------------------------------------------------------------------
  342.   def window_height
  343.     Graphics.height
  344.   end
  345.   #--------------------------------------------------------------------------
  346.   # 項目数の取得
  347.   #--------------------------------------------------------------------------
  348.   def item_max
  349.    
  350.     #バトラーが指定されていない場合は項目数は1個にする。
  351.    
  352.     return 1 if @last_actor != nil
  353.    
  354.     #アクターかエネミーのどちらを表示するかで処理を分岐し
  355.     #それぞれ設定に適した値を返す。
  356.    
  357.     case @display_mode
  358.     when 0
  359.       B_CONFIRM::PTMT ? $game_party.all_members.size : $game_party.members.size
  360.     when 1
  361.       $game_troop.unhidden_members.size
  362.     end
  363.   end
  364.   #--------------------------------------------------------------------------
  365.   # 項目の高さを取得
  366.   #--------------------------------------------------------------------------
  367.   def item_height
  368.     (height - standard_padding * 2) / 4
  369.   end
  370.   #--------------------------------------------------------------------------
  371.   # 項目の描画
  372.   #--------------------------------------------------------------------------
  373.   def draw_item(index)
  374.    
  375.     #バトラーが指定されているか否かで処理を分岐。
  376.    
  377.     if @last_actor == nil
  378.       
  379.       #アクターかエネミーのどちらを表示するかで設定に応じて処理を分岐。
  380.       
  381.       case @display_mode
  382.       when 0
  383.         actor = B_CONFIRM::PTMT ? $game_party.all_members[index] : $game_party.members[index]
  384.       when 1
  385.         actor = $game_troop.unhidden_members[index]
  386.       end
  387.       
  388.       #項目の矩形を取得。
  389.       
  390.       rect = item_rect(index)
  391.       
  392.       #項目内のデータを描写していく。
  393.       
  394.       $game_temp.b_confirm_limit_flag = (!B_CONFIRM::EN_O or (B_CONFIRM::EN_O && @display_mode == 1))
  395.       draw_actor_name(actor, rect.x, rect.y)
  396.       draw_actor_hp(actor, rect.x + 4, rect.y + line_height * 1)
  397.       draw_actor_mp(actor, rect.x + 4, rect.y + line_height * 2)
  398.       draw_actor_tp(actor, rect.x + 4, rect.y + line_height * 3) if $data_system.opt_display_tp
  399.       self.contents.font.color = system_color
  400.       draw_text(rect.x + 150, rect.y + line_height * 1, 96, line_height, B_CONFIRM::WORD2)
  401.       draw_text(rect.x + 150, rect.y + line_height * 3, 96, line_height, B_CONFIRM::WORD3)
  402.       self.contents.font.color = normal_color
  403.       icons_width = (rect.width - rect.x - 150 - 96) / 24
  404.       icons = (actor.state_icons)[0, icons_width]
  405.       icons.each_with_index {|n, i| draw_icon(n, rect.x + 246 + 24 * i, rect.y + line_height * 1) }
  406.       icons = (actor.state_icons)[icons_width, icons_width * 2]
  407.       icons.each_with_index {|n, i| draw_icon(n, rect.x + 246 + 24 * i, rect.y + line_height * 2) } if icons != nil
  408.       icons = (actor.buff_icons)[0, icons_width]
  409.       icons.each_with_index {|n, i| draw_icon(n, rect.x + 246 + 24 * i, rect.y + line_height * 3) }
  410.       
  411.     end
  412.   end
  413.   #--------------------------------------------------------------------------
  414.   # 決定ボタンが押されたときの処理(邪魔なので消す)
  415.   #--------------------------------------------------------------------------
  416.   def process_ok
  417.   end
  418.   #--------------------------------------------------------------------------
  419.   # キャンセルボタンが押されたときの処理(邪魔なので消す)
  420.   #--------------------------------------------------------------------------
  421.   def process_cancel
  422.   end
  423.   #--------------------------------------------------------------------------
  424.   # Lボタンが押されたときの処理(邪魔なので消す)
  425.   #--------------------------------------------------------------------------
  426.   def process_pageup
  427.   end
  428.   #--------------------------------------------------------------------------
  429.   # Rボタンが押されたときの処理(邪魔なので消す)
  430.   #--------------------------------------------------------------------------
  431.   def process_pagedown
  432.   end
  433. end

  434. class Window_B_Confirm_Detail < Window_Base
  435.   attr_accessor :window_b_confirm
  436.   attr_accessor :end_flag
  437.   #--------------------------------------------------------------------------
  438.   # 初期化
  439.   #--------------------------------------------------------------------------
  440.   def initialize(window_b_confirm)
  441.     @page_data = 0
  442.     @window_b_confirm = window_b_confirm
  443.     @end_flag = false
  444.     super(0, 0, window_width, window_height)
  445.    
  446.     #背景透過度を設定する。
  447.    
  448.     self.back_opacity = B_CONFIRM::BOPAC
  449.    
  450.     refresh
  451.   end
  452.   #--------------------------------------------------------------------------
  453.   # ウィンドウ幅の取得
  454.   #--------------------------------------------------------------------------
  455.   def window_width
  456.     Graphics.width
  457.   end
  458.   #--------------------------------------------------------------------------
  459.   # ウィンドウ高さの取得
  460.   #--------------------------------------------------------------------------
  461.   def window_height
  462.     Graphics.height
  463.   end
  464.   #--------------------------------------------------------------------------
  465.   # フレーム更新
  466.   #--------------------------------------------------------------------------
  467.   def update
  468.     super
  469.     if Input.trigger?(:B)#キャンセルキーを押した場合
  470.       
  471.       #キャンセルのSEを鳴らす。
  472.       
  473.       Sound.play_cancel
  474.       @end_flag = true
  475.       
  476.     elsif page_change?   #決定キー、左右キー、LRボタンを押した場合
  477.       
  478.       Sound.play_cursor
  479.       @page_data = @page_data == 0 ? 1 : 0
  480.       contents.clear
  481.       refresh
  482.       
  483.     end
  484.   end
  485.   #--------------------------------------------------------------------------
  486.   # ページ切り替えを行うか?
  487.   #--------------------------------------------------------------------------
  488.   def page_change?
  489.     flag = false
  490.     [:C, :L, :R, :LEFT, :RIGHT].each {|k|flag = true if Input.trigger?(k)}
  491.     flag
  492.   end
  493.   #--------------------------------------------------------------------------
  494.   # リフレッシュ
  495.   #--------------------------------------------------------------------------
  496.   def refresh
  497.     #バトラーを取得。
  498.    
  499.     actor = @window_b_confirm.last_actor
  500.    
  501.     #項目内のデータを描写していく。
  502.    
  503.     draw_actor_name(actor, x, y)
  504.     $game_temp.b_confirm_limit_flag = (!B_CONFIRM::EN_O or (B_CONFIRM::EN_O && !actor.actor?))
  505.     draw_actor_hp(actor, x + 4, y + line_height * 1)
  506.     draw_actor_mp(actor, x + 4, y + line_height * 2)
  507.     draw_actor_tp(actor, x + 4, y + line_height * 3) if $data_system.opt_display_tp
  508.     self.contents.font.color = system_color
  509.     draw_text(x + 150, y + line_height * 1, 96, line_height, B_CONFIRM::WORD2)
  510.     draw_text(x + 150, y + line_height * 3, 96, line_height, B_CONFIRM::WORD3)
  511.     self.contents.font.color = normal_color
  512.     icons_width = (width - x - 162 - 96) / 24
  513.     icons = (actor.state_icons)[0, icons_width]
  514.     icons.each_with_index {|n, i| draw_icon(n, x + 246 + 24 * i, y + line_height * 1) }
  515.     icons = (actor.state_icons)[icons_width, icons_width * 2]
  516.     icons.each_with_index {|n, i| draw_icon(n, x + 246 + 24 * i, y + line_height * 2) } if icons != nil
  517.     icons = (actor.buff_icons)[0, icons_width]
  518.     icons.each_with_index {|n, i| draw_icon(n, x + 246 + 24 * i, y + line_height * 3) }
  519.     draw_horz_line(line_height * 4)
  520.    
  521.     if @page_data == 0
  522.    
  523.       6.times {|i|draw_actor_param(actor, x, y + line_height * (5 + i), (i + 2))}
  524.       ex_xprms_draw(actor, x, y)
  525.       ex_sprms_draw(actor, x, y)
  526.       
  527.     else
  528.       
  529.       ex_elem_draw(actor, x, y)
  530.       ex_state_draw(actor, x, y)
  531.       
  532.     end
  533.   end
  534.   #--------------------------------------------------------------------------
  535.   # 水平線の色を取得(Window_Statusからそのままコピー)
  536.   #--------------------------------------------------------------------------
  537.   def line_color
  538.     color = normal_color
  539.     color.alpha = 48
  540.     color
  541.   end
  542.   #--------------------------------------------------------------------------
  543.   # 水平線の描画(Window_Statusからそのままコピー)
  544.   #--------------------------------------------------------------------------
  545.   def draw_horz_line(y)
  546.     line_y = y + line_height / 2 - 1
  547.     contents.fill_rect(0, line_y, contents_width, 2, line_color)
  548.   end
  549.   #--------------------------------------------------------------------------
  550.   # 追加能力値
  551.   #--------------------------------------------------------------------------
  552.   def ex_xprms_draw(actor, x, y)
  553.    
  554.     #追加能力値の描写対象がない場合は飛ばす。
  555.    
  556.     return if B_CONFIRM::XPRM.empty?
  557.    
  558.     #追加能力値を描写する。
  559.    
  560.     B_CONFIRM::XPRM.each_with_index do |xp, i|
  561.       next if !actor.actor? && !xp[2]
  562.       change_color(system_color)
  563.       draw_text(x + 170, y + line_height * (5 + i), 120, line_height, xp[1])
  564.       change_color(normal_color)
  565.       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)
  566.     end
  567.   end
  568.   #--------------------------------------------------------------------------
  569.   # 特殊能力値
  570.   #--------------------------------------------------------------------------
  571.   def ex_sprms_draw(actor, x, y)
  572.    
  573.     #特殊能力値の描写対象がない場合は飛ばす。
  574.    
  575.     return if B_CONFIRM::SPRM.empty?
  576.    
  577.     #特殊能力値を描写する。
  578.    
  579.     B_CONFIRM::SPRM.each_with_index do |sp, i|
  580.       next if !actor.actor? && !sp[2]
  581.       change_color(system_color)
  582.       draw_text(x + 344, y + line_height * (5 + i), 120, line_height, sp[1])
  583.       change_color(normal_color)
  584.       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)
  585.     end
  586.   end
  587.   #--------------------------------------------------------------------------
  588.   # 属性有効度
  589.   #--------------------------------------------------------------------------
  590.   def ex_elem_draw(actor, x, y)
  591.    
  592.     #属性有効度の描写対象がない場合は飛ばす。
  593.    
  594.     return if B_CONFIRM::ELEM.empty?
  595.    
  596.     #属性有効度を描写する。
  597.    
  598.     B_CONFIRM::ELEM.each_with_index do |elem, i|
  599.       next if !actor.actor? && !elem[2]
  600.       change_color(system_color)
  601.       name = $data_system.elements[elem[0]]
  602.       data = (actor.element_rate(elem[0]) * 100).to_i
  603.       data = (elem[3] ? (100 - data) : data).to_s
  604.       draw_text(x, y + line_height * (5 + i), 120, line_height, name + elem[1])
  605.       change_color(normal_color)
  606.       draw_text(x + 110, y + line_height * (5 + i), 56, line_height, data + (B_CONFIRM::ELP ? "%" : ""), 2)
  607.     end
  608.   end
  609.   #--------------------------------------------------------------------------
  610.   # ステート有効度
  611.   #--------------------------------------------------------------------------
  612.   def ex_state_draw(actor, x, y)
  613.    
  614.     #ステート有効度の描写対象がない場合は飛ばす。
  615.    
  616.     return if B_CONFIRM::STAT.empty?
  617.    
  618.     #ステート有効度を描写する。
  619.    
  620.     B_CONFIRM::STAT.each_with_index do |state, i|
  621.       next if !actor.actor? && !state[2]
  622.       change_color(system_color)
  623.       x_data = i < B_CONFIRM::MAX ? 170 : 344
  624.       if state[0] > 0
  625.         name = $data_states[state[0]].name
  626.         data = (actor.state_rate(state[0]) * 100).to_i
  627.         data = (state[3] ? (100 - data) : data).to_s
  628.       else
  629.         state_id = state[0].abs
  630.         name = Vocab.param(state_id)
  631.         data = (actor.debuff_rate(state_id) * 100).to_i
  632.         data = (state[3] ? (100 - data) : data).to_s
  633.       end
  634.       draw_text(x + x_data, y + line_height * (5 + i - (i < B_CONFIRM::MAX ? 0 : B_CONFIRM::MAX)), 120, line_height, name + state[1])
  635.       change_color(normal_color)
  636.       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)
  637.     end
  638.   end
  639. end
  640. class Scene_Battle < Scene_Base
  641.   #--------------------------------------------------------------------------
  642.   # パーティコマンドウィンドウの作成
  643.   #--------------------------------------------------------------------------
  644.   alias create_party_command_window_b_confirm create_party_command_window
  645.   def create_party_command_window
  646.    
  647.     #本来の処理を実行。
  648.    
  649.     create_party_command_window_b_confirm
  650.    
  651.     #状況確認コマンド用のハンドラを追加。
  652.    
  653.     @party_command_window.set_handler(:b_confirm,  method(:command_b_confirm))
  654.   end
  655.   #--------------------------------------------------------------------------
  656.   # コマンド[状況確認]
  657.   #--------------------------------------------------------------------------
  658.   def command_b_confirm
  659.    
  660.     #状況確認コマンドの処理内容を実行。
  661.    
  662.     b_confirm_execute
  663.   end
  664.   #--------------------------------------------------------------------------
  665.   # 状況確認開始
  666.   #--------------------------------------------------------------------------
  667.   def b_confirm_execute
  668.    
  669.     #状況確認ウィンドウを作成。
  670.    
  671.     @b_confirm_window = Window_B_Confirm.new(0, 0, 0)
  672.    
  673.     #処理をループで処理。
  674.    
  675.     loop do
  676.       
  677.       #とりあえずアップデートは行う。
  678.       
  679.       update
  680.       
  681.       #状況確認ウィンドウがアクティブであり
  682.       #なおかつ操作終了フラグが有効な場合は分岐。
  683.       
  684.       if @b_confirm_window.active && @b_confirm_window.end_flag
  685.         
  686.         #表示モードが2の時、ループを終了する。
  687.         
  688.         break if @b_confirm_window.display_mode == 2
  689.         
  690.         #操作終了フラグをfalseにする。
  691.         
  692.         @b_confirm_window.end_flag = false
  693.         
  694.         #最後にキャラクターを選択している場合
  695.         
  696.         if @b_confirm_window.last_actor != nil
  697.          
  698.           #状況確認ウィンドウのアクティブ状態を解除し
  699.           #詳細ウィンドウを作成する。
  700.         
  701.           @b_confirm_window.deactivate
  702.           @b_confirm_detail_window = Window_B_Confirm_Detail.new(@b_confirm_window)
  703.         
  704.         #最後にキャラクターを選択していない場合
  705.          
  706.         else
  707.          
  708.           #状況確認ウィンドウを解放する。
  709.          
  710.           @b_confirm_window.dispose
  711.          
  712.           #状況確認ウィンドウを作り直す。
  713.          
  714.           @b_confirm_window = Window_B_Confirm.new(0, 0, (@b_confirm_window.display_mode == 0 ? 0 : 1))
  715.          
  716.         end
  717.         
  718.       #詳細ウィンドウが存在し、なおかつ終了フラグが有効な場合。
  719.       
  720.       elsif @b_confirm_detail_window != nil && @b_confirm_detail_window.end_flag
  721.         
  722.         #詳細ウィンドウを解放し、nil扱いとする。
  723.         
  724.         @b_confirm_detail_window.dispose
  725.         @b_confirm_detail_window = nil
  726.         
  727.         #最後に選択したアクターをnilとする。
  728.         
  729.         @b_confirm_window.last_actor = nil
  730.         
  731.         #状況確認ウィンドウをアクティブ化する。
  732.         
  733.         @b_confirm_window.activate
  734.       end
  735.     end
  736.    
  737.     #状況確認ウィンドウを解放する。
  738.    
  739.     @b_confirm_window.dispose
  740.    
  741.     #パーティコマンドウィンドウをアクティブにする。
  742.    
  743.     @party_command_window.activate
  744.   end
  745. end
  746. end
复制代码


这是在战斗选项中添加可以查看状态的一个选项,进去按Q键可以看到敌人的状态

  1. # ステ―ト詳細確認ウィンドウ
  2. #
  3. # 戦闘時、パーティコマンドに付与されているステートの詳細を確認するためのコマンド
  4. # を追加します。

  5. $imported_yana_scripts ||= {}
  6. $imported_yana_scripts["StateHelpWindow"] = true

  7. module StateHelp
  8.   Buffs = {}
  9.   States = []
  10.   
  11. # 请按照下面的描写进行备注

  12.   Buffs[[0,:up]] = "HPの強化効果\n最大10段階"
  13.   Buffs[[1,:up]] = "MPの強化効果\n最大10段階"
  14.   Buffs[[2,:up]] = "攻撃力の強化効果\n最大10段階"
  15.   Buffs[[3,:up]] = "防御力の強化効果\n最大10段階"
  16.   Buffs[[4,:up]] = "魔法力の強化効果\n最大10段階"
  17.   Buffs[[5,:up]] = "魔法防御の強化効果\n最大10段階"
  18.   Buffs[[6,:up]] = "敏捷の強化効果\n最大10段階"
  19.   Buffs[[7,:up]] = "運の強化効果\n最大10段階"
  20.   
  21.   Buffs[[0,:down]] = "HPの弱体効果\n最大5段階"
  22.   Buffs[[1,:down]] = "MPの弱体効果\n最大5段階"
  23.   Buffs[[2,:down]] = "攻撃力の弱体効果\n最大5段階"
  24.   Buffs[[3,:down]] = "防御力の弱体効果\n最大5段階"
  25.   Buffs[[4,:down]] = "魔法力の弱体効果\n最大5段階"
  26.   Buffs[[5,:down]] = "魔法防御の弱体効果\n最大5段階"
  27.   Buffs[[6,:down]] = "敏捷の弱体効果\n最大5段階"
  28.   Buffs[[7,:down]] = "運の弱体効果\n最大5段階"

  29.   States[1]  = "戦闘不能\nHPが0になり、すべての行動ができない。"
  30.   States[2]  = "毒\n毎ターン、最大HPの5%のダメージを受ける。"
  31.   States[3]  = "暗闇\n物理命中率が40%低下する。"
  32.   States[4]  = "沈黙\n魔法に属するコマンドが使用できなくなる。"
  33.   States[5]  = "混乱\n混乱し、敵味方の区別なく攻撃を繰り出す。"
  34.   States[6]  = "睡眠\n行動できない、狙われ率が上がって回避が下がる。"
  35.   States[7]  = "麻痺\n40%の確率で行動できない。回避が下がる"
  36.   States[8]  = "スタン\nスタンしてしまって行動できない状態。"
  37.   States[9]  = "防御\n被ダメージを減少する"
  38.   States[10] = "石化\n行動できない。回避と防御、狙われ率が下がる"
  39.   
  40. end

  41. class Game_BattlerBase
  42.   attr_reader :buffs
  43. end

  44. class Window_State < Window_Selectable
  45.   def initialize(help_window)
  46.     super(0,0,32,32)
  47. #~     self.x = [Graphics.width / 2 - self.width / 2,0].max
  48. #~     self.y = [Graphics.height / 2 - self.height / 2,help_window.height].max
  49.     self.openness = 0
  50.     @help_window = help_window
  51.     refresh
  52.   end
  53.   def all_battle_members;($game_party.battle_members + $game_troop.members).select{|m| m.exist? };end
  54.   def row_max;all_battle_members.size;end
  55.   def col_max
  56.     m = all_battle_members.max_by{|a| a.state_icons.size + a.buff_icons.size }
  57.     [m.state_icons.size + m.buff_icons.size,1].max
  58.   end
  59.   def item_max;row_max*col_max;end
  60.   def item_height; line_height + 2 ; end
  61.   def item_width; line_height + 2 ; end
  62.    
  63.   def fitting_window
  64.     self.height = item_height * row_max + standard_padding*2
  65.     self.width = 144+(col_max*item_width) + standard_padding*2
  66.     self.x = [Graphics.width / 2 - self.width / 2,0].max
  67.     self.y = [Graphics.height / 2 - self.height / 2,help_window.height].max
  68.   end
  69.   def refresh
  70.     fitting_window
  71.     make_data
  72.     create_contents
  73.     all_battle_members.each_with_index{|a,i|
  74.       draw_actor_name(a,0,i*item_height+1)
  75.       draw_text(128,i*item_height+1,20,line_height,":")
  76.       draw_icons(a, 144, i*item_height+1, contents.width - 144)
  77.     }
  78.   end
  79.   
  80.   def draw_icons(subject, x, y, width = 96)
  81.     icons = (subject.state_icons + subject.buff_icons)[0, width / item_width]
  82.     icons.each_with_index {|n, i| draw_icon(n, x + item_width * i, y) }
  83.   end
  84.   
  85.   def item_rect(index)
  86.     rect = Rect.new
  87.     rect.width = item_width
  88.     rect.height = item_height
  89.     rect.x = index % col_max * item_width + 143
  90.     rect.y = index / col_max * item_height
  91.     rect
  92.   end
  93.   
  94.   def update_help
  95.     @help_window.set_text(description)
  96.   end
  97.   
  98.   def make_data
  99.     @data = all_battle_members.inject([]){|r,m|
  100.       a = []
  101.       a += m.states.select{|st| st.icon_index != 0 }
  102.       bf = []
  103.       m.buffs.each_with_index{|b,i| bf.push([i,b > 0 ? :up : :down]) if b != 0}
  104.       a += bf
  105.       a += Array.new(col_max - a.size){nil} if col_max > a.size
  106.       r += a
  107.     }
  108.   end
  109.   
  110.   def description
  111.     return "" unless @data[index]
  112.     if @data[index].is_a?(Array)
  113.       return StateHelp::Buffs[@data[index]]
  114.     else
  115.       return StateHelp::States[@data[index].id]
  116.     end
  117.   end
  118.   def cursor_down(wrap = false)
  119.     return if @data.compact.empty?
  120.     loop do
  121.       select((index + col_max) % item_max)
  122.       break if @data[index]
  123.     end
  124.   end
  125.   def cursor_up(wrap = false)
  126.     return if @data.compact.empty?
  127.     loop do
  128.       select((index - col_max + item_max) % item_max)
  129.       break if @data[index]
  130.     end
  131.   end
  132.   def cursor_right(wrap = false)
  133.     return if @data.compact.empty?
  134.     loop do
  135.       select((index + 1) % item_max)
  136.       break if @data[index]
  137.     end
  138.   end
  139.   def cursor_left(wrap = false)
  140.     return if @data.compact.empty?
  141.     loop do
  142.       select((index - 1 + item_max) % item_max)
  143.       break if @data[index]
  144.     end
  145.   end
  146.   def smooth_select
  147.     return select(0) if @data.compact.empty?
  148.     @data.each_with_index{|d,i|
  149.       if d
  150.         select(i)
  151.         return
  152.       end
  153.     }
  154.   end
  155. end

  156. class Window_PartyCommand < Window_Command
  157.   alias _ex_state_make_command_list make_command_list
  158.   def make_command_list
  159.     _ex_state_make_command_list
  160.     add_command("异常状态明细",  :state)
  161.   end
  162. end

  163. class Scene_Battle < Scene_Base
  164.   alias _ex_state_create_all_windows create_all_windows
  165.   def create_all_windows
  166.     _ex_state_create_all_windows
  167.     create_state_window
  168.   end
  169.   alias _ex_state_create_party_command_window create_party_command_window
  170.   def create_party_command_window
  171.     _ex_state_create_party_command_window
  172.     @party_command_window.set_handler(:state, method(:command_state))
  173.   end

  174.   def create_state_window
  175.     @state_window = Window_State.new(@help_window)
  176.     @state_window.set_handler(:ok,  method(:command_state_cancel))
  177.     @state_window.set_handler(:cancel, method(:command_state_cancel))
  178.     @state_window.unselect
  179.   end
  180.   
  181.   def command_state
  182.     @party_command_window.deactivate
  183.     @state_window.refresh
  184.     @state_window.open.activate.smooth_select
  185.     @help_window.show
  186.   end
  187.   
  188.   def command_state_cancel
  189.     @state_window.deactivate.close.unselect
  190.     @party_command_window.activate
  191.     @help_window.hide
  192.   end
  193. end
复制代码

这也是选项中看到状态的脚本,但这脚本不但能看到状态,还能看到状态的描述,不过需要你按状态编号每个状态进行备注

评分

参与人数 1梦石 +1 收起 理由
丿梁丶小柒 + 1 认可答案

查看全部评分

回复

使用道具 举报

梦石
1
星屑
472
在线时间
120 小时
注册时间
2016-3-6
回帖
63
 楼主| 发表于 2016-3-21 17:52:58 | 显示全部楼层
jianyulei 发表于 2016-3-21 13:50
#==============================================================================
#  ■エネミーの状態 ...

膜拜!
大神请收下我的膝盖吧!
R
回复

使用道具 举报

梦石
0
星屑
1461
在线时间
815 小时
注册时间
2013-8-3
回帖
355
发表于 2016-3-22 12:48:22 | 显示全部楼层
jianyulei 发表于 2016-3-21 13:50
#==============================================================================
#  ■エネミーの状態 ...

好家伙!不客气拿走,话说如果是中文介绍就更好了{:2_282:}

【同人游戏】勇者斗恶龙TG
欢迎加入游戏测试群333599798
如有需私聊请加QQ:516425000
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 注册会员

本版积分规则

Powered by Discuz! X5.0 © 2001-2026 Discuz! Team.

在本版发帖返回顶部