查看: 2317|回复: 2

[已经过期] 想问一下状态剩余回合脚本和状态滚动脚本如何共用?

[复制链接]
梦石
0
星屑
738
在线时间
75 小时
注册时间
2018-1-19
回帖
16
发表于 2021-9-20 16:45:50 | 显示全部楼层 |阅读模式

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

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

×
rt,这两个脚本好像不能一起用......萌新想知道怎么把这两个效果都用上呢?
这个是状态剩余回合脚本
  1. #==============================================================================
  2. # ■状态剩余回合数显示 for RGSS3 Ver1.01-β
  3. # □作成者 kure
  4. #==============================================================================
  5. #
  6. # 状态备注:  <不显示剩余回合数>   则不会显示剩余回合数
  7. #

  8. #==============================================================================
  9. # ■ RPG::State(追加定義)
  10. #==============================================================================
  11. class RPG::State < RPG::BaseItem
  12.   #--------------------------------------------------------------------------
  13.   # ☆残りターン非表示の定義(追加定義)
  14.   #--------------------------------------------------------------------------  
  15.   def view_turns?
  16.     return true unless @note
  17.     return false if @note.include?("<不显示剩余回合数>")
  18.     return true
  19.   end
  20. end

  21. #==============================================================================
  22. # ■ Window_Base
  23. #==============================================================================
  24. class Window_Base < Window
  25.   #--------------------------------------------------------------------------
  26.   # ● ステートおよび強化/弱体のアイコンを描画(再定義)
  27.   #--------------------------------------------------------------------------
  28.   def draw_actor_icons(actor, x, y, width = 96)
  29.     icons = (actor.state_icons_adv + actor.buff_icons_adv)[0, width / 24]
  30.    
  31.     last = contents.font.size
  32.     contents.font.size = 18
  33.     change_color(crisis_color)
  34.     icons.each_with_index {|n, i| draw_state_icon_turns(n, x + 24 * i, y) }
  35.     change_color(normal_color)
  36.     contents.font.size = last
  37.    
  38.   end
  39.   #--------------------------------------------------------------------------
  40.   # ● 残りのターンを加えたアイコンの描画(追加定義)
  41.   #--------------------------------------------------------------------------
  42.   def draw_state_icon_turns(data, x, y)
  43.     draw_icon(data[0], x, y)
  44.     if data[2] and $data_states[data[2]] and $data_states[data[2]].auto_removal_timing == 0
  45.       return
  46.     end
  47.     draw_text(x + 12, y + 8, 12, 18, data[1],2)
  48.   end
  49. end

  50. #==============================================================================
  51. # ■ Game_BattlerBase
  52. #==============================================================================
  53. class Game_BattlerBase
  54.   #--------------------------------------------------------------------------
  55.   # ● 現在のステートをアイコンINDEX、残りターン、ステートIDで取得(追加定義)
  56.   #--------------------------------------------------------------------------
  57.   def state_icons_adv
  58.     icons = states.collect {|state| [state.icon_index, @state_turns[state.id], state.id] }
  59.     for i in 0..icons.size - 1
  60.       if icons[i][0] == 0
  61.         icons[i] = nil
  62.       else
  63.         icons[i][1] = "" if $data_states[icons[i][2]].auto_removal_timing == 0
  64.         icons[i][1] = "" unless $data_states[icons[i][2]].view_turns?
  65.       end
  66.     end
  67.     icons.compact!
  68.     return icons
  69.   end
  70.   #--------------------------------------------------------------------------
  71.   # ● 現在の強化/弱体をアイコンINDEX、残りターンで取得(追加定義)
  72.   #--------------------------------------------------------------------------
  73.   def buff_icons_adv
  74.     icons = []
  75.     @buffs.each_with_index {|lv, i| [icons.push(buff_icon_index(lv, i)),@buff_turns[i]] }
  76.     for i in 0..icons.size - 1
  77.       icons[i] = nil if icons[i][0] == 0
  78.     end
  79.     icons.compact!
  80.     return icons
  81.   end
  82. end

复制代码


这个是状态滚动脚本
  1. ###--------------------------------------------------------------------------###
  2. #  CP 滚动状态 VX script                                               #
  3. #  Version 1.1                                                                 #
  4. #                                                                              #
  5. #      Credits:                                                                #
  6. #  Original code by: Neon Black                                                #
  7. #  Modified by:                                                                #
  8. #                                                                              #
  9. #  This work is licensed under the Creative Commons Attribution-NonCommercial  #
  10. #  3.0 Unported License. To view a copy of this license, visit                 #
  11. #  http://creativecommons.org/licenses/by-nc/3.0/.                             #
  12. #  Permissions beyond the scope of this license are available at               #
  13. #  http://cphouseset.wordpress.com/liscense-and-terms-of-use/.                 #
  14. #                                                                              #
  15. #      Contact:                                                                #
  16. #  NeonBlack - neonblack23@live.com (e-mail) or "neonblack23" on skype         #
  17. ###--------------------------------------------------------------------------###

  18. ###--------------------------------------------------------------------------###
  19. #      Revision information:                                                   #
  20. #  V1.1 - 11.14.2012                                                           #
  21. #   Improved state rectangle drawing                                           #
  22. #  V1.0 - 7.15.2012                                                            #
  23. #   Wrote and debugged main script                                             #
  24. ###--------------------------------------------------------------------------###

  25. ###--------------------------------------------------------------------------###
  26. #      Compatibility:                                                          #
  27. #  Alias       - Window_Base: initialize, update                               #
  28. #  Overwrites  - Window_Base: draw_actor_icons                                 #
  29. #  New Objects - Window_Base: draw_icons_area, clear_all_icons                 #
  30. #                Scroll_States: initialize, change?, update_icons,             #
  31. #                               clear_icon_area                                #
  32. ###--------------------------------------------------------------------------###

  33. ###--------------------------------------------------------------------------###
  34. #      Instructions:                                                           #
  35. #  Place this script in the "Materials" section of the scripts above main.     #
  36. #  This script is plug and play and overwrites how states, buff, and debuffs   #
  37. #  are displayed.  The only setting this script contains modifies the speed    #
  38. #  at which the states change and can be altered below.                        #
  39. ###--------------------------------------------------------------------------###

  40. ###--------------------------------------------------------------------------###
  41. #      说明:                                                                 #
  42. #  可以让玩家处于多个状态时,依次滚动显示状态图标,请在下面设定滚动前等待的时间
  43. #                                                                              #
  44. module CP            # Do not                                                  #
  45. module SCROLL_STATES #  change these.                                          #
  46. #                                                                              #
  47. ###-----                                                                -----###
  48. # 图标切换前等待的时间,单位是帧.   #
  49. TRANS = 45 # 默认 = 45                                                      #
  50. #                                                                              #
  51. ###--------------------------------------------------------------------------###


  52. ###--------------------------------------------------------------------------###
  53. #  The following lines are the actual core code of the script.  While you are  #
  54. #  certainly invited to look, modifying it may result in undesirable results.  #
  55. #  Modify at your own risk!                                                    #
  56. ###--------------------------------------------------------------------------###

  57. end
  58. end

  59. $imported = {} if $imported == nil
  60. $imported["CP_SCROLLING_STATES"] = 1.1

  61. class Scroll_States  ## This class holds the state icons for windows.
  62.   attr_reader   :x
  63.   attr_reader   :y
  64.   attr_reader   :width
  65.   attr_reader   :icons
  66.   attr_accessor :bitmap
  67.   
  68.   def initialize(x, y, width, states, level = 0)
  69.     @x = x  ## Sets up required aspects of the states class.
  70.     @y = y
  71.     @width = width
  72.     @states = states
  73.     @bitmap = Bitmap.new([width, 1].max, 24)
  74.     update_icons(level)
  75.   end
  76.   
  77.   def change?(level)  ## Determines if a refresh is required.
  78.     return false if (@width / 24 >= @states.size)
  79.     return true if (level % CP::SCROLL_STATES::TRANS == 0)
  80.     return false
  81.   end
  82.   
  83.   def update_icons(level)
  84.     return @icons = [0] if @states.empty?  ## Skip if no states.
  85.     total = @width / 24
  86.     return @icons = @states if total >= @states.size  ## No refresh needed.
  87.     start = (level / CP::SCROLL_STATES::TRANS) % @states.size
  88.     double = @states + @states  ## Doubles the states for overlap.
  89.     top = [double.size, start + total].min
  90.     @icons = []
  91.     for i in start...top  ## Create the shown states in order.
  92.       @icons.push(double[i])
  93.     end
  94.   end
  95. end

  96. class Window_Base < Window
  97.   alias cp_sswb_initialize initialize
  98.   def initialize(x, y, width, height)
  99.     cp_sswb_initialize(x, y, width, height)
  100.     @icon_areas = {}  ## Sets up an array for the states.
  101.     @icon_scroll = false
  102.     @icon_timer = 0
  103.   end
  104.   
  105.   alias cp_sswb_update update
  106.   def update
  107.     cp_sswb_update
  108.     unless @icon_areas.empty?  ## Ignore if no states were drawn.
  109.       @icon_timer += 1  ## A timer used by states.
  110.       @icon_areas.each_value do |area|
  111.         next unless area.change?(@icon_timer)
  112.         draw_icons_area(area)
  113.       end
  114.     end
  115.   end
  116.   
  117.   def draw_icons_area(area)
  118.     contents.clear_rect(area.x, area.y, area.width, 24)  ## Clears state area.
  119.     contents.blt(area.x, area.y, area.bitmap, area.bitmap.rect)
  120.     area.update_icons(@icon_timer)  ## Updates the icons.
  121.     area.icons.each_with_index {|n, i| draw_icon(n, area.x + 24 * i, area.y) }
  122.   end
  123.   
  124.   def clear_all_icons  ## Clears all icon spots for redraw.
  125.     @icon_areas.each_key {|key| clear_icon_area(key)}
  126.     @icon_areas = {}  ## Resets the array.
  127.     @icon_scroll = false  ## Do not reset this frame.
  128.   end
  129.   
  130.   def clear_icon_area(key)
  131.     return if @icon_areas[key].nil?
  132.     area = @icon_areas[key]
  133.     contents.clear_rect(area.x, area.y, area.width, 24)
  134.     contents.blt(area.x, area.y, area.bitmap, area.bitmap.rect)
  135.     @icon_areas[key] = nil
  136.   end
  137.   
  138.   def draw_actor_icons(actor, x, y, width = 96)  ## Overwrite this method.
  139.     icons = (actor.state_icons + actor.buff_icons)
  140.     key = [x, y, width]
  141.     clear_icon_area(key)
  142.     temp = Scroll_States.new(x, y, width, icons)  ## Creates an icon holder.
  143.     @icon_areas[key] = temp
  144.     rect = Rect.new(x, y, width, 24)
  145.     @icon_areas[key].bitmap.blt(0, 0, contents, rect)
  146.     draw_icons_area(@icon_areas[key])  ## Draw the newest set.
  147.   end
  148. end


  149. ###--------------------------------------------------------------------------###
  150. #  End of script.                                                              #
  151. ###--------------------------------------------------------------------------##

复制代码
梦石
1
星屑
14389
在线时间
2110 小时
注册时间
2017-9-28
回帖
607
发表于 2021-9-20 18:43:51 | 显示全部楼层
可以两个功能都用星潟的

剩余回合数显示
  1. #==============================================================================
  2. # ■ RGSS3 ステート・強化・弱体カウント表示 Ver1.04 by 星潟
  3. #------------------------------------------------------------------------------
  4. # ステート・強化・弱体について、アイコンと共に
  5. # 残り持続ターン数の値を表示します。
  6. # 非戦闘時の表示形式も選択できます。
  7. # (ステートはターン数・歩数・表示なし。
  8. #   強化・弱体はターン数・表示なしからの選択となります)
  9. #
  10. # また、当方の状況確認コマンドとの併用時に
  11. # 状況確認ウィンドウ中のステート・強化・弱体にも
  12. # カウント表示を行わせるか否かを指定できます。
  13. #==============================================================================
  14. # ステートのメモ欄に指定
  15. #------------------------------------------------------------------------------
  16. # <ステートカウント非表示>
  17. #
  18. # ステートカウントを表示する設定にしていても
  19. # このステートについてはステートカウントが表示されなくなる。
  20. #==============================================================================
  21. module ST_B_REST
  22.   
  23.   #ステートカウント非表示の設定用キーワードを指定。
  24.   
  25.   Word   = "ステートカウント非表示"
  26.   
  27.   #非戦闘時のステートの描写タイプを指定します。
  28.   #0で残りターン、1で残り歩数、2で何も表示しません。
  29.   
  30.   STYPE  = 0
  31.   
  32.   #非戦闘時の強化の描写タイプを指定します。
  33.   #0で残りターン、1で何も表示しません。
  34.   
  35.   BTYPE  = 0
  36.   
  37.   #X座標の調整値を指定します。
  38.   
  39.   X_POS  = 0
  40.   
  41.   #Y座標の調整値を指定します。
  42.   
  43.   Y_POS  = -4
  44.   
  45.   #文字色を配列で指定します。
  46.   #赤、緑、青、アルファの順に指定します。
  47.   
  48.   COLOR  = [255,255,255,255]
  49.   
  50.   #縁の文字色を配列で指定します。
  51.   #赤、緑、青、アルファの順に指定します。
  52.   
  53.   O_CLR  = [0,0,0,255]
  54.   
  55.   #文字の影の有無を指定します。
  56.   #trueで有り、falseで無しとなります。
  57.   
  58.   SHADOW = true
  59.   
  60.   #フォントサイズを指定します。
  61.   
  62.   FSIZE  = 18
  63.   
  64.   #状況確認コマンドスクリプトを導入しているか否かを指定します。
  65.   #trueで導入、falseで導入していない前提で処理を行います。
  66.   #(導入している状態で、ウィンドウにカウントを表示させたくない場合は
  67.   #  falseにして下さい)
  68.   
  69.   CONF   = false
  70.   
  71.   #XPスタイルバトルスクリプトを導入しているか否かを指定します。
  72.   #trueで導入、falseで導入していない前提で処理を行います。
  73.   
  74.   XPST   = false
  75.   
  76.   #XPスタイルバトルリフォームバトルステータスを導入しているか否かを指定します。
  77.   #trueで導入、falseで導入していない前提で処理を行います。
  78.   
  79.   XPRB   = false
  80.   
  81. end
  82. class Game_BattlerBase
  83.   #--------------------------------------------------------------------------
  84.   # リフレッシュ
  85.   #--------------------------------------------------------------------------
  86.   alias refresh_buff_rank refresh
  87.   def refresh
  88.    
  89.     #ターン数を整数化。
  90.    
  91.     @buff_turns.keys.each {|i| @buff_turns[i] = @buff_turns[i].to_i}
  92.    
  93.     #本来の処理を実行。
  94.    
  95.     refresh_buff_rank
  96.    
  97.   end
  98.   #--------------------------------------------------------------------------
  99.   # ステートの残時間を描写
  100.   #--------------------------------------------------------------------------
  101.   def state_rest_array
  102.    
  103.     #配列を作成。
  104.    
  105.     array = []
  106.    
  107.     #描写タイプを取得。戦闘中はタイプ0固定。
  108.    
  109.     type = $game_party.in_battle ? 0 : ST_B_REST::STYPE
  110.    
  111.     #タイプ2の場合は空の配列を返す。
  112.    
  113.     return array if type == 2
  114.    
  115.     #現在のステート別に判定。
  116.    
  117.     states.each {|state|
  118.    
  119.     #ステートアイコンIDの場合は飛ばす。
  120.    
  121.     next if state.icon_index == 0
  122.    
  123.     #タイプ別に判定する。
  124.    
  125.     if state.state_count_invisible
  126.       
  127.       array.push("")
  128.       
  129.     else
  130.       case type
  131.       
  132.       #タイプ0の場合、自動解除される場合は残りターン数、
  133.       #自動解除されない場合は空の文字列を配列に入れる。
  134.       
  135.       when 0;array.push(state.auto_removal_timing != 0 ? @state_turns[state.id] : "")
  136.       
  137.       #タイプ1の場合、歩数で解除される場合は残り歩数、
  138.       #解除されない場合は空の文字列を配列に入れる。
  139.       
  140.       when 1;array.push(state.remove_by_walking ? @state_steps[state.id] : "")
  141.         
  142.       end
  143.     end
  144.     }
  145.    
  146.     #配列を返す。
  147.    
  148.     array
  149.    
  150.   end
  151.   #--------------------------------------------------------------------------
  152.   # 強化・弱体の残時間を描写
  153.   #--------------------------------------------------------------------------
  154.   def buff_rest_array
  155.    
  156.     #配列を作成。
  157.    
  158.     array = []
  159.    
  160.     #描写タイプを取得。戦闘中はタイプ0固定。
  161.    
  162.     type = $game_party.in_battle ? 0 : ST_B_REST::BTYPE
  163.    
  164.     #タイプ1の場合は空の配列を返す。
  165.    
  166.     return array if type == 1
  167.    
  168.     #能力別に強化・弱体が発生しているかどうかを判定し
  169.     #配列に残りターンを入れる。
  170.    
  171.     @buffs.each_with_index {|lv, i| next if buff_icon_index(lv, i) == 0
  172.     array.push(@buff_turns[i])
  173.     }
  174.    
  175.     #配列を返す。
  176.    
  177.     array
  178.    
  179.   end
  180. end
  181. class Window_Base < Window
  182.   #--------------------------------------------------------------------------
  183.   # ステートおよび強化/弱体のアイコンを描画
  184.   #--------------------------------------------------------------------------
  185.   alias draw_actor_icons_rest_draw draw_actor_icons
  186.   def draw_actor_icons(actor, x, y, width = 96)
  187.    
  188.     #本来の処理を実行。
  189.    
  190.     draw_actor_icons_rest_draw(actor, x, y, width)
  191.    
  192.     #フォントデータを保存。
  193.    
  194.     font_data = contents.font.clone
  195.    
  196.     #指定したフォントに変更。
  197.    
  198.     contents.font.size = ST_B_REST::FSIZE
  199.     ca1 = ST_B_REST::COLOR
  200.     contents.font.color = Color.new(ca1[0],ca1[1],ca1[2],ca1[3])
  201.     ca2 = ST_B_REST::O_CLR
  202.     contents.font.out_color = Color.new(ca2[0],ca2[1],ca2[2],ca2[3])
  203.     contents.font.shadow = ST_B_REST::SHADOW
  204.    
  205.     #残カウントの配列を準備。
  206.    
  207.     array = actor.state_rest_array + actor.buff_rest_array
  208.    
  209.     #長さに応じて配列を削る。
  210.    
  211.     array = array[0, width / 24]
  212.    
  213.     #配列の値を描写。
  214.    
  215.     array.each_with_index {|n, i| draw_text(
  216.     x + 24 * i + ST_B_REST::X_POS, y + ST_B_REST::Y_POS, 24, 24, n, 2) }
  217.    
  218.     #保存したフォントデータを復帰。
  219.    
  220.     contents.font = font_data
  221.   end
  222. end
  223. if ST_B_REST::CONF
  224. class Window_B_Confirm < Window_Selectable
  225.   #--------------------------------------------------------------------------
  226.   # 項目の描画
  227.   #--------------------------------------------------------------------------
  228.   alias draw_item_rest_draw draw_item
  229.   def draw_item(index)
  230.    
  231.     #本来の処理を実行。
  232.    
  233.     draw_item_rest_draw(index)
  234.    
  235.     #フォントデータを保存。
  236.    
  237.     font_data = contents.font.clone
  238.    
  239.     #指定したフォントに変更。
  240.    
  241.     contents.font.size = ST_B_REST::FSIZE
  242.     ca1 = ST_B_REST::COLOR
  243.     contents.font.color = Color.new(ca1[0],ca1[1],ca1[2],ca1[3])
  244.     ca2 = ST_B_REST::O_CLR
  245.     contents.font.out_color = Color.new(ca2[0],ca2[1],ca2[2],ca2[3])
  246.     contents.font.shadow = ST_B_REST::SHADOW
  247.    
  248.     if @last_actor == nil
  249.       
  250.       case @display_mode
  251.       when 0
  252.         actor = B_CONFIRM::PTMT ? $game_party.all_members[index] : $game_party.members[index]
  253.       when 1
  254.         actor = $game_troop.unhidden_members[index]
  255.       end
  256.       
  257.       rect = item_rect(index)
  258.       
  259.       icons_width = (rect.width - rect.x - 150 - 96) / 24
  260.       
  261.       #ステートの残カウントの配列を準備。
  262.       
  263.       array = actor.state_rest_array
  264.       
  265.       #長さに応じて配列を削る。
  266.       
  267.       sub_array = array[0, icons_width]
  268.       
  269.       #配列の値を描写。
  270.       
  271.       sub_array.each_with_index {|n, i| draw_text(x + 24 * i + ST_B_REST::X_POS + 246, rect.y + y + ST_B_REST::Y_POS + line_height * 1, 24, 24, n, 2) }
  272.       
  273.       #長さに応じて配列を削る。
  274.       
  275.       sub_array = array[icons_width, icons_width * 2]
  276.       
  277.       #配列の値を描写。
  278.       
  279.       sub_array.each_with_index {|n, i| draw_text(x + 24 * i + ST_B_REST::X_POS + 246, rect.y + y + ST_B_REST::Y_POS + line_height * 2, 24, 24, n, 2) } if sub_array != nil
  280.       
  281.       #強化・弱体の残カウントの配列を準備。
  282.       
  283.       array = actor.buff_rest_array
  284.       
  285.       #長さに応じて配列を削る。
  286.       
  287.       sub_array = array[0, icons_width]
  288.       
  289.       #配列の値を描写。
  290.       
  291.       sub_array.each_with_index {|n, i| draw_text(x + 24 * i + ST_B_REST::X_POS + 246, rect.y + y + ST_B_REST::Y_POS + line_height * 3, 24, 24, n, 2) }
  292.       
  293.     end
  294.    
  295.     #保存したフォントデータを復帰。
  296.    
  297.     contents.font = font_data
  298.    
  299.   end
  300. end
  301. class Window_B_Confirm_Detail < Window_Base
  302.   #--------------------------------------------------------------------------
  303.   # リフレッシュ
  304.   #--------------------------------------------------------------------------
  305.   alias refresh_rest_draw refresh
  306.   def refresh
  307.    
  308.     #バトラーを取得。
  309.    
  310.     actor = @window_b_confirm.last_actor
  311.    
  312.     #本来の処理を実行。
  313.    
  314.     refresh_rest_draw
  315.    
  316.     #フォントデータを保存。
  317.    
  318.     font_data = contents.font.clone
  319.    
  320.     #指定したフォントに変更。
  321.    
  322.     contents.font.size = ST_B_REST::FSIZE
  323.     ca1 = ST_B_REST::COLOR
  324.     contents.font.color = Color.new(ca1[0],ca1[1],ca1[2],ca1[3])
  325.     ca2 = ST_B_REST::O_CLR
  326.     contents.font.out_color = Color.new(ca2[0],ca2[1],ca2[2],ca2[3])
  327.     contents.font.shadow = ST_B_REST::SHADOW
  328.    
  329.     #項目内のデータを描写していく。
  330.    
  331.     icons_width = (width - x - 162 - 96) / 24
  332.    
  333.     #ステートの残カウントの配列を準備。
  334.    
  335.     array = actor.state_rest_array
  336.    
  337.     #長さに応じて配列を削る。
  338.    
  339.     sub_array = array[0, icons_width]
  340.       
  341.     #配列の値を描写。
  342.       
  343.     sub_array.each_with_index {|n, i| draw_text(x + 24 * i + ST_B_REST::X_POS + 246, y + ST_B_REST::Y_POS + line_height * 1, 24, 24, n, 2) }
  344.    
  345.     #長さに応じて配列を削る。
  346.    
  347.     sub_array = array[icons_width, icons_width * 2]
  348.       
  349.     #配列の値を描写。
  350.       
  351.     sub_array.each_with_index {|n, i| draw_text(x + 24 * i + ST_B_REST::X_POS + 246, y + ST_B_REST::Y_POS + line_height * 2, 24, 24, n, 2) } if sub_array != nil
  352.    
  353.     #強化・弱体の残カウントの配列を準備。
  354.    
  355.     array = actor.buff_rest_array
  356.    
  357.     #長さに応じて配列を削る。
  358.    
  359.     sub_array = array[0, icons_width]
  360.       
  361.     #配列の値を描写。
  362.       
  363.     sub_array.each_with_index {|n, i| draw_text(x + 24 * i + ST_B_REST::X_POS + 246, y + ST_B_REST::Y_POS + line_height * 3, 24, 24, n, 2) }
  364.    
  365.     #保存したフォントデータを復帰。
  366.    
  367.     contents.font = font_data
  368.    
  369.   end
  370. end
  371. end
  372. class RPG::State < RPG::BaseItem
  373.   #--------------------------------------------------------------------------
  374.   # ステートカウント非表示フラグ
  375.   #--------------------------------------------------------------------------
  376.   def state_count_invisible
  377.     (@state_count_invisible ||= /<#{ST_B_REST::Word}>/ =~ note ? 1 : 0) == 1
  378.   end
  379. end
  380. if ST_B_REST::XPST
  381. class Game_Battler < Game_BattlerBase
  382.   #--------------------------------------------------------------------------
  383.   # ステートカウントの取得。念の為別定義
  384.   #--------------------------------------------------------------------------
  385.   def state_turns_for_xp_style_battle
  386.     @state_turns
  387.   end
  388.   #--------------------------------------------------------------------------
  389.   # ステートカウントの取得。念の為別定義
  390.   #--------------------------------------------------------------------------
  391.   def buff_turns_for_xp_style_battle
  392.     @buff_turns
  393.   end
  394. end
  395. class Window_BattleStatus < Window_Selectable
  396.   #--------------------------------------------------------------------------
  397.   # アクターのステータス配列にステートカウントを追加
  398.   #--------------------------------------------------------------------------
  399.   alias status_state_turns_for_xp_style_battle status
  400.   def status(actor)
  401.     status_state_turns_for_xp_style_battle(actor) +
  402.     [actor.state_turns_for_xp_style_battle.clone] +
  403.     [actor.buff_turns_for_xp_style_battle.clone]
  404.   end
  405. end
  406. end
  407. if ST_B_REST::XPRB
  408. class Sprite_StateIcon < Sprite_BattleStatus
  409.   #--------------------------------------------------------------------------
  410.   # ステートアイコン配列の取得
  411.   #--------------------------------------------------------------------------
  412.   alias icons_turns icons
  413.   def icons
  414.     {:icons => icons_turns,
  415.     :state_turns => @battler.state_turns_for_xp_style_battle.clone,
  416.     :buff_turns => @battler.buff_turns_for_xp_style_battle.clone}
  417.   end
  418. end
  419. end
复制代码


状态滚动

  1. #==============================================================================
  2. # ■ RGSS3 滚动状态 Ver1.00 by 星潟
  3. #------------------------------------------------------------------------------
  4. # 默认战斗中显示状态数量有限,状态数量很多时玩家无法知道全部状态。
  5. # 此脚本让所有状态滚动显示。
  6. #
  7. # 此外,会在强化能力、弱化能力中显示数字,表示等级数。
  8. #
  9. # 对于非默认战斗系统兼容性可能较差。
  10. #==============================================================================
  11. module BattleStateScroll
  12.   
  13.   #附加/解除状态时
  14.   #设定不透明度变化的数值。
  15.   #数值越大,不透明度变化越快。
  16.   #数值建议在1~255之间。
  17.   
  18.   FadeIn = 16
  19.   
  20. end
  21. class Window_BattleStatus < Window_Selectable
  22.   #--------------------------------------------------------------------------
  23.   # オブジェクト初期化
  24.   #--------------------------------------------------------------------------
  25.   alias initialize_actor_icons_sprites initialize
  26.   def initialize
  27.     @icons_sprites = []
  28.     initialize_actor_icons_sprites
  29.   end
  30.   #--------------------------------------------------------------------------
  31.   # リフレッシュ
  32.   #--------------------------------------------------------------------------
  33.   alias refresh_actor_icons_sprites refresh
  34.   def refresh
  35.     i1 = $game_party.battle_members.size
  36.     if i1 > 0
  37.       @icons_sprites.each_with_index {|s,i2|
  38.       s.dispose if i2 >= i1}
  39.       @icons_sprites.delete_if {|s| s.disposed?}
  40.     else
  41.       @icons_sprites.each {|s,i2| s.dispose}
  42.       @icons_sprites = []
  43.     end
  44.     refresh_actor_icons_sprites
  45.   end
  46.   #--------------------------------------------------------------------------
  47.   # ステートおよび強化/弱体のアイコンを描画
  48.   #--------------------------------------------------------------------------
  49.   def draw_actor_icons(actor, x, y, width = 96)
  50.     i = actor.index
  51.     @icons_sprites[i] ||= Sprite_StatesIcons.new(self,i,width / 24,self.viewport)
  52.     icons = (actor.state_icons + actor.buff_icons)
  53.     ib = Cache.system("IconSet")
  54.     if width / 24 < icons.size
  55.       ic = icons.clone
  56.       (width / 24).times {icons.push(ic.shift)}
  57.     end
  58.     data_hash = {:icons => icons}
  59.     flag1 = defined? draw_actor_icons_rest_draw
  60.     if flag1
  61.       rest_array = actor.state_rest_array + actor.buff_rest_array
  62.       if width / 24 < icons.size
  63.         rac = rest_array.clone
  64.         (width / 24).times {rest_array.push(rac.shift)}
  65.       end
  66.       data_hash[:rest] = rest_array
  67.     end
  68.     flag2 = defined? draw_actor_icons_level_draw
  69.     if flag2
  70.       level_array = actor.state_level_array
  71.       if width / 24 < level_array.size
  72.         lac = level_array.clone
  73.         (width / 24).times {level_array.push(lac.shift)}
  74.       end
  75.       data_hash[:level] = level_array
  76.     end
  77.     if @icons_sprites[i].data_hash != data_hash
  78.       @icons_sprites[i].bitmap.dispose if @icons_sprites[i].bitmap && !@icons_sprites[i].bitmap.disposed?
  79.       all_reset = (!@icons_sprites[i].data_hash or (@icons_sprites[i].data_hash[:icons] != data_hash[:icons]))
  80.       @icons_sprites[i].data_hash = data_hash
  81.       is = icons.size
  82.       b = Bitmap.new((is > 0 ? is : 1) * 24,24)
  83.       icons.each_with_index {|n, i|
  84.       rect = Rect.new(n % 16 * 24, n / 16 * 24, 24, 24)
  85.       b.blt(i * 24, 0, ib, rect)}
  86.       
  87.       if flag1
  88.         font_data = b.font.clone
  89.         b.font.size = ST_B_REST::FSIZE
  90.         ca1 = ST_B_REST::COLOR
  91.         b.font.color = Color.new(ca1[0],ca1[1],ca1[2],ca1[3])
  92.         ca2 = ST_B_REST::O_CLR
  93.         b.font.out_color = Color.new(ca2[0],ca2[1],ca2[2],ca2[3])
  94.         b.font.shadow = ST_B_REST::SHADOW
  95.         rest_array.each_with_index {|n, i| b.draw_text(24 * i + ST_B_REST::X_POS, ST_B_REST::Y_POS, 24, 24, n, 2) }
  96.         b.font = font_data
  97.       end
  98.       
  99.       if flag2
  100.         font_data = b.font.clone
  101.         b.font.size = StateLevel::FSIZE
  102.         ca1 = StateLevel::COLOR
  103.         b.font.color = Color.new(ca1[0],ca1[1],ca1[2],ca1[3])
  104.         ca2 = StateLevel::O_CLR
  105.         b.font.out_color = Color.new(ca2[0],ca2[1],ca2[2],ca2[3])
  106.         b.font.shadow = StateLevel::SHADOW
  107.         level_array.each_with_index {|n, i| b.draw_text(24 * i + StateLevel::X_POS, StateLevel::Y_POS, 24, 24, n, 2) }
  108.         b.font = font_data
  109.       end
  110.       
  111.       if all_reset
  112.         @icons_sprites[i].bitmap = b
  113.         @icons_sprites[i].opacity = 0
  114.         @icons_sprites[i].src_rect = Rect.new(0,0,width,96)
  115.       else
  116.         src_rect = @icons_sprites[i].src_rect.clone
  117.         @icons_sprites[i].bitmap = b
  118.         @icons_sprites[i].src_rect = src_rect
  119.       end
  120.     end
  121.     @icons_sprites[i].add_x = x
  122.     @icons_sprites[i].add_y = y
  123.   end
  124.   #--------------------------------------------------------------------------
  125.   # 更新
  126.   #--------------------------------------------------------------------------
  127.   unless method_defined?(:update_actor_icons_sprites)
  128.     alias update_actor_icons_sprites update
  129.     def update
  130.       update_actor_icons_sprites
  131.       @icons_sprites.each {|s| s.update}
  132.     end
  133.   end
  134.   #--------------------------------------------------------------------------
  135.   # 解放
  136.   #--------------------------------------------------------------------------
  137.   unless method_defined?(:dispose_actor_icons_sprites)
  138.     alias dispose_actor_icons_sprites dispose
  139.     def dispose
  140.       @icons_sprites.each {|s| s.dispose}
  141.       @icons_sprites.clear
  142.       dispose_actor_icons_sprites
  143.     end
  144.   end
  145. end
  146. class Sprite_StatesIcons < Sprite
  147.   attr_accessor :add_x
  148.   attr_accessor :add_y
  149.   attr_accessor :data_hash
  150.   #--------------------------------------------------------------------------
  151.   # 初期化
  152.   #--------------------------------------------------------------------------
  153.   def initialize(window,index,max_width,viewport = nil)
  154.     @window = window
  155.     @index = index
  156.     @max_width = max_width
  157.     @add_x = 0
  158.     @add_y = 0
  159.     super(viewport)
  160.   end
  161.   #--------------------------------------------------------------------------
  162.   # 更新
  163.   #--------------------------------------------------------------------------
  164.   def update
  165.     super
  166.     self.viewport = @window.viewport if self.viewport != @window.viewport
  167.     self.x = @window.x + @window.standard_padding + add_x
  168.     self.y = @window.y + @window.standard_padding + add_y
  169.     self.z = @window.z
  170.     if @window.close? or !@window.visible
  171.       self.visible = false
  172.       return
  173.     else
  174.       self.visible = true
  175.     end
  176.     self.opacity += BattleStateScroll::FadeIn if self.opacity < 255
  177.     if self.bitmap
  178.       self.src_rect.x += 1 if self.bitmap.width / 24 > @max_width
  179.       self.src_rect.x = 0 if (self.bitmap.width - self.src_rect.x) / 24 - @max_width < 0
  180.     end
  181.   end
  182.   #--------------------------------------------------------------------------
  183.   # 解放
  184.   #--------------------------------------------------------------------------
  185.   def dispose
  186.     self.bitmap.dispose if self.bitmap && !self.bitmap.disposed?
  187.     super
  188.   end
  189. end
复制代码

评分

参与人数 1星屑 +20 收起 理由
alexncf125 + 20 搬动费~

查看全部评分

VA外站脚本汉化群:226308173   |    部分远古文件备份:https://wwzv.lanzoue.com/b02rac5pc  密码:acgm
回复

使用道具 举报

梦石
0
星屑
738
在线时间
75 小时
注册时间
2018-1-19
回帖
16
 楼主| 发表于 2021-9-20 19:20:55 | 显示全部楼层
Nil2018 发表于 2021-9-20 18:43
可以两个功能都用星潟的

...

星潟的好像不太能和非原版战斗系统兼容,我战斗系统用的是SRPGconNEXT,然后现在只能显示回合数,滚动不了了
回复

使用道具 举报

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

本版积分规则

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

在本版发帖返回顶部