查看: 2762|回复: 3

[已经过期] 解除状态时显示了两次解除讯息

[复制链接]
梦石
0
星屑
30103
在线时间
5741 小时
注册时间
2016-3-8
回帖
1662
发表于 2020-11-21 03:01:46 | 显示全部楼层 |阅读模式

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

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

×
本帖最后由 alexncf125 于 2020-11-21 10:10 编辑

用了以下两个脚本后, 解除状态(有备注"衝撃回数解除:n")时会显示两次解除讯息
是什么原因呢  求指点。
  1. =begin
  2.           RGSS3
  3.          
  4.           ★ 衝撃回数解除ステート ★

  5.           指定回数ダメージを受けた際に解除されるステートを作ることができます。
  6.          
  7.           ● 仕様 ●==========================================================
  8.           衝撃カウントは1以上のダメージを与えた時に限り変動します。
  9.           --------------------------------------------------------------------
  10.           解除確率はいまのところ一律100%となります。
  11.           ====================================================================
  12.          
  13.           ● 使い方 ●========================================================
  14.           データベースのステートのメモ欄に
  15.           「衝撃回数解除:n」という文字列を含ませて下さい。nには整数値を。
  16.           ====================================================================
  17.          
  18.           ver1.00

  19.           Last Update : 2011/12/17
  20.           12/17 : RGSS2からの移植
  21.          
  22.           ろかん   [url]http://kaisou-ryouiki.sakura.ne.jp/[/url]
  23. =end

  24.     $rsi ||= {}
  25.     $rsi["衝撃回数解除ステート"] = true

  26.     class RPG::State < RPG::BaseItem
  27.       def get_remove_shockcount
  28.         self.note.each_line{|line|
  29.           return $1.to_i if line =~ /衝撃回数解除:(\d+)/i
  30.         }
  31.         0
  32.       end
  33.     end

  34.     class Game_BattlerBase
  35.       #--------------------------------------------------------------------------
  36.       # ● ステート情報をクリア
  37.       #--------------------------------------------------------------------------
  38.       alias remove_shockcount_state_clear clear_states
  39.       def clear_states
  40.         remove_shockcount_state_clear
  41.         @shockcount_states = {}
  42.       end
  43.     end

  44.     class Game_Battler
  45.       #--------------------------------------------------------------------------
  46.       # ● 新しいステートの付加
  47.       #--------------------------------------------------------------------------
  48.       alias add_shockcount_state add_new_state
  49.       def add_new_state(state_id)
  50.         add_shockcount_state(state_id)
  51.         set_count_state(state_id)
  52.       end
  53.       #--------------------------------------------------------------------------
  54.       # ● ステートの解除
  55.       #--------------------------------------------------------------------------
  56.       alias remove_shockcount_state remove_state
  57.       def remove_state(state_id)
  58.         remove_shockcount_state(state_id)
  59.         out_count_state(state_id)
  60.       end
  61.       #--------------------------------------------------------------------------
  62.       # ● 新しく付加されたステートに解除衝撃回数がある場合、専用ハッシュに加える
  63.       #--------------------------------------------------------------------------
  64.       def set_count_state(state_id)
  65.         shock_count = $data_states[state_id].get_remove_shockcount
  66.         @shockcount_states[state_id] = shock_count unless shock_count.zero?
  67.       end
  68.       #--------------------------------------------------------------------------
  69.       # ● 解除されたステートが専用ハッシュに存在する場合に削除
  70.       #--------------------------------------------------------------------------
  71.       def out_count_state(state_id)
  72.         @shockcount_states.delete(state_id) if @shockcount_states.include?(state_id)
  73.       end
  74.       #--------------------------------------------------------------------------
  75.       # ● ダメージによるステート解除
  76.       #--------------------------------------------------------------------------
  77.       alias shockcount_state_remove_states_by_damage remove_states_by_damage
  78.       def remove_states_by_damage
  79.         shockcount_state_remove_states_by_damage
  80.         @shockcount_states.each_key{|key|
  81.           @shockcount_states[key] -= 1
  82.           if @shockcount_states[key].zero?
  83.             remove_state(key)
  84.             @result.removed_states << key
  85.           end
  86.         }
  87.       end
  88.     end
复制代码
  1. #==============================================================================
  2. # ■ 滑动(In/Out)战斗信息 (VX Ace用)
  3. #------------------------------------------------------------------------------
  4. # 制作者     : CanariAlternate
  5. # 主页名   : カルトの鳥篭
  6. # 主页URL  : [url]http://canarialt.blog.fc2.com[/url]
  7. #------------------------------------------------------------------------------
  8. # ■ 概要 : 战斗信息滑动进入和退出。
  9. #
  10. # ■ 需要脚本 : 无
  11. #
  12. # ■ 位置 : 「Scene_Battle」之下。
  13. #------------------------------------------------------------------------------
  14. # 更新履歴 : 2012/10/02 Ver1.00 基礎部分の製作が完了する。
  15. #            2012/10/05 Ver1.01 バトルログをこのスクリプトで表示する機能を実装
  16. #            2013/02/19 Ver1.02 説明文の表記方法などを他と統一した。
  17. #==============================================================================

  18. $imported ||= {}
  19. $imported[:CanariAlternate_Window_BattleMessageLog] = true

  20. #==============================================================================
  21. # ■ Calt
  22. #------------------------------------------------------------------------------
  23. #  CanariAlternateが製作したスクリプト用のモジュールです。
  24. #==============================================================================
  25. module Calt
  26.   #-----------------------------------------------------------------------------
  27.   # ★このスクリプトでバトルログを表示させる。
  28.   Alternate_Window_BattleLog = true
  29.   #-----------------------------------------------------------------------------
  30. end

  31. if Calt::Alternate_Window_BattleLog
  32.   $imported[:CanariAlternate_Window_BattleLog] = true
  33.   #==============================================================================
  34.   # ■ Scene_Battle
  35.   #------------------------------------------------------------------------------
  36.   #  バトル画面の処理を行うクラスです。
  37.   #==============================================================================
  38.   class Scene_Battle < Scene_Base
  39.     #--------------------------------------------------------------------------
  40.     # ● フレーム更新(基本)[追加]
  41.     #--------------------------------------------------------------------------
  42.     alias _update_basic_alter_battle_log update_basic
  43.     def update_basic
  44.       _update_basic_alter_battle_log
  45.       @log_window.update  # バトルログを更新
  46.     end
  47.   end
  48.   Window_BattleMessageLog = Window_BattleLog        # 別名(変更を共有)
  49. else
  50.   Window_BattleMessageLog = Window_BattleLog.clone  # クローン
  51. end

  52. #==============================================================================
  53. # ■ Window_BattleMessageLog
  54. #------------------------------------------------------------------------------
  55. #  ログを表示する機能の設定を定義しています。
  56. #==============================================================================
  57. class Window_BattleMessageLog
  58.   #--------------------------------------------------------------------------
  59.   # ● ラインを移動する速度(行をつめる速度)         ※縦にスライドする速度
  60.   def now_speed           ; return 3                                    ; end
  61.   #--------------------------------------------------------------------------
  62.   # ● ラインを消去する速度(画面外へのスライド速度) ※縦にスライドする速度
  63.   def del_speed           ; return 4                                    ; end
  64.   #--------------------------------------------------------------------------
  65.   # ● ラインを追加する速度(画面内へのスライド速度) ※横にスライドする速度
  66.   def add_speed           ; return 96                                   ; end
  67.   #--------------------------------------------------------------------------
  68.   # ● 追加するラインの始点(x座標)
  69.   def add_line_start_x    ; return contents_width                       ; end
  70.   #--------------------------------------------------------------------------
  71.   # ● 消去するラインの終点(y座標)
  72.   def del_line_end_y      ; return -line_height                         ; end
  73.   #--------------------------------------------------------------------------
  74.   # ● 最大行数の取得
  75.   def max_line_number     ; return 6                                    ; end
  76.   #--------------------------------------------------------------------------
  77.   # ● 消去中のラインの不透明度  (透明) 0 ~ 255 (不透明)
  78.   def del_opacity         ; return 64                                   ; end
  79.   #--------------------------------------------------------------------------
  80.   # ● 背景ビットマップの取得
  81.   def get_back_bitmap(line_rect)
  82.     ##back_bitmap = Bitmap.new("Graphics/System/" + "画像名") # 画像を読み込み
  83.     ##return back_bitmap
  84.    
  85.     back_bitmap = Bitmap.new(line_rect.width, line_rect.height) # ビットマップを生成
  86.     color_l = left_color  # ラインの左端の色を取得
  87.     color_r = right_color # ラインの右端の色を取得
  88.     # 左から右へグラデーションさせながら塗りつぶし
  89.     back_bitmap.gradient_fill_rect(line_rect, color_l, color_r)
  90.    
  91.     # これだけだと寂しいので少し装飾(枠をつける)
  92.     color_l.alpha += 64
  93.     color_r.alpha += 64
  94.     frame_rect = Rect.new(0, 0, line_rect.width, 1)
  95.     back_bitmap.gradient_fill_rect(frame_rect, color_l, color_r) # 上の枠を描画
  96.     frame_rect.y = line_rect.height - 1
  97.     back_bitmap.gradient_fill_rect(frame_rect, color_l, color_r) # 下の枠を描画
  98.     frame_rect = Rect.new(0, 0, 1, line_rect.height)
  99.     back_bitmap.fill_rect(frame_rect, color_l)                   # 左の枠を描画
  100.     frame_rect.x = line_rect.width - 1
  101.     back_bitmap.fill_rect(frame_rect, color_r)                   # 右の枠を描画
  102.    
  103.     return back_bitmap
  104.   end
  105.   #--------------------------------------------------------------------------
  106.   # ● ラインの左端の色     (red, green, blue, alpha)
  107.   def left_color          ; return Color.new(255, 128, 64, 128)         ; end
  108.   #--------------------------------------------------------------------------
  109.   # ● ラインの右端の色     (red, green, blue, alpha)
  110.   def right_color         ; return Color.new(255, 255, 255, 32)         ; end
  111.   #--------------------------------------------------------------------------
  112.   # ● ラインの幅を取得
  113.   def line_width          ; return contents_width - 16                  ; end
  114.   #--------------------------------------------------------------------------
  115.   # ● ラインの高さを取得
  116.   def line_height         ; return 24                                   ; end
  117.   #--------------------------------------------------------------------------
  118.   # ● ウィンドウ幅の初期値を取得
  119.   def window_width        ; return Graphics.width                       ; end
  120.   #--------------------------------------------------------------------------
  121.   # ● ウィンドウ高さの初期値を取得
  122.   def window_height       ; return fitting_height(max_line_number)      ; end
  123.   #--------------------------------------------------------------------------
  124.   # ● ウィンドウの初期設定
  125.   def window_parameter
  126.     ##self.windowskin = Cache.system("Window")  # ウィンドウスキンの変更
  127.     self.z              = 100   # Z座標
  128.     self.opacity        = 0     # 透明度
  129.     self.arrows_visible = false # カーソルは表示しない
  130.   end
  131.   #--------------------------------------------------------------------------
  132.   # ● 標準パディングサイズの取得
  133.   def standard_padding    ; return 0                                    ; end
  134.   #--------------------------------------------------------------------------
  135.   # ● ウィンドウ内容の幅を計算
  136.   def contents_width      ; return width  - standard_padding * 2        ; end
  137.   #--------------------------------------------------------------------------
  138.   # ● ウィンドウ内容の高さを計算
  139.   def contents_height     ; return height - standard_padding * 2        ; end
  140.   #--------------------------------------------------------------------------
  141.   # ● 余白(x座標)
  142.   def padding_x           ; return 0                                    ; end
  143.   #--------------------------------------------------------------------------
  144.   # ● 余白(y座標)
  145.   def padding_y           ; return 8                                    ; end
  146.   #--------------------------------------------------------------------------
  147.   # ● ラインのテキストの余白(x座標)
  148.   def text_padding_x      ; return 16                                   ; end
  149.   #--------------------------------------------------------------------------
  150.   # ● ラインのテキストの余白(y座標)
  151.   def text_padding_y      ; return 0                                    ; end
  152.   #--------------------------------------------------------------------------
  153.   # ● ラインとラインの間隔
  154.   def line_spacing        ; return 4                                    ; end
  155.   #--------------------------------------------------------------------------
  156. end

  157. #==============================================================================
  158. # ■ Window_BattleMessageLog
  159. #------------------------------------------------------------------------------
  160. #  ログを表示する機能を制御するメソッドを定義しています。
  161. #==============================================================================
  162. class Window_BattleMessageLog
  163.   #--------------------------------------------------------------------------
  164.   # ● 最下行の文章の取得
  165.   def last_text           ; return line_text(@exist_lines[-1])          ; end
  166.   #--------------------------------------------------------------------------
  167.   # ● データ行数の取得
  168.   def line_number         ; return @exist_lines.size                    ; end
  169.   #--------------------------------------------------------------------------
  170.   # ● 一行戻る
  171.   def back_one            ; del_line(@exist_lines.pop)                  ; end
  172.   #--------------------------------------------------------------------------
  173.   # ● 指定した行を消去
  174.   def del_text(gyou)      ; del_line(@exist_lines.delete_at(gyou - 1))  ; end
  175.   #--------------------------------------------------------------------------
  176.   # ● 指定した行に戻る
  177.   def back_to(line_index) ; back_one while line_number > line_index     ; end
  178.   #--------------------------------------------------------------------------
  179.   # ● 一行シフト
  180.   def shift_one
  181.     @shift_lines[@exist_lines.shift] = del_line_end_y
  182.     @change_lines = true
  183.   end
  184.   #--------------------------------------------------------------------------
  185.   # ● クリア
  186.   def clear
  187.     @num_wait = 0
  188.     @dying_lines += @exist_lines
  189.     @exist_lines.clear
  190.     @entry_lines.clear
  191.   end
  192.   #--------------------------------------------------------------------------
  193.   # ● 文章の追加(行を指定するとその行に追加)
  194.   def add_text(text, line_index = line_number)
  195.     shift_one unless line_number < max_line_number # 行数が上限以上
  196.     add_line(text, line_index)
  197.   end
  198.   #--------------------------------------------------------------------------
  199.   # ● 文章の置き換え
  200.   def replace_text(text)
  201.     back_one
  202.     add_text(text)
  203.   end
  204.   #--------------------------------------------------------------------------
  205. end

  206. #==============================================================================
  207. # ■ Window_BattleMessageLog
  208. #------------------------------------------------------------------------------
  209. #  ログを表示する機能の処理で使用する変数の操作・取得を定義しています。
  210. #==============================================================================
  211. class Window_BattleMessageLog
  212.   #--------------------------------------------------------------------------
  213.   # ● 定数
  214.   #--------------------------------------------------------------------------
  215.   Text   = 0  # テキストのインデックス
  216.   Back   = 1  # 背景のスプライトのインデクッス
  217.   Window = 2  # 文章のウィンドウのインデックス
  218.   #--------------------------------------------------------------------------
  219.   # ● 指定行数に適合するウィンドウの高さを計算
  220.   #--------------------------------------------------------------------------
  221.   def fitting_height(line_index)
  222.     return line_position_y(line_index) + standard_padding * 2
  223.   end
  224.   #--------------------------------------------------------------------------
  225.   # ● 指定行数に適合するラインの高さを計算
  226.   #--------------------------------------------------------------------------
  227.   def line_position_y(line_index)
  228.     return padding_y + (line_height + line_spacing) * line_index
  229.   end
  230.   #--------------------------------------------------------------------------
  231.   # ● ラインの背景スプライトを取得
  232.   #--------------------------------------------------------------------------
  233.   def line_text(window_index)
  234.     return @line_windows[window_index][Text]
  235.   end
  236.   #--------------------------------------------------------------------------
  237.   # ● ラインの背景スプライトを取得
  238.   #--------------------------------------------------------------------------
  239.   def line_back(window_index)
  240.     return @line_windows[window_index][Back]
  241.   end
  242.   #--------------------------------------------------------------------------
  243.   # ● ラインの文章ウィンドウを取得
  244.   #--------------------------------------------------------------------------
  245.   def line_window(window_index)
  246.     return @line_windows[window_index][Window]
  247.   end
  248.   #--------------------------------------------------------------------------
  249.   # ● ラインのx座標を設定
  250.   #--------------------------------------------------------------------------
  251.   def set_line_window_x(window_index, new_x)
  252.     @line_windows[window_index][Back].x   = new_x
  253.     @line_windows[window_index][Window].x = new_x
  254.   end
  255.   #--------------------------------------------------------------------------
  256.   # ● ラインのy座標を設定
  257.   #--------------------------------------------------------------------------
  258.   def set_line_window_y(window_index, new_y)
  259.     @line_windows[window_index][Back].y   = new_y
  260.     @line_windows[window_index][Window].y = new_y
  261.   end
  262.   #--------------------------------------------------------------------------
  263.   # ● ラインのx座標に加算
  264.   #--------------------------------------------------------------------------
  265.   def add_line_window_x(window_index, add_x)
  266.     @line_windows[window_index][Back].x   += add_x
  267.     @line_windows[window_index][Window].x += add_x
  268.   end
  269.   #--------------------------------------------------------------------------
  270.   # ● ラインのy座標に加算
  271.   #--------------------------------------------------------------------------
  272.   def add_line_window_y(window_index, add_y)
  273.     @line_windows[window_index][Back].y   += add_y
  274.     @line_windows[window_index][Window].y += add_y
  275.   end
  276.   #--------------------------------------------------------------------------
  277.   # ● ラインのx座標を取得
  278.   #--------------------------------------------------------------------------
  279.   def line_window_x(window_index)
  280.     return @line_windows[window_index][Window].x
  281.   end
  282.   #--------------------------------------------------------------------------
  283.   # ● ラインのy座標を取得
  284.   #--------------------------------------------------------------------------
  285.   def line_window_y(window_index)
  286.     return @line_windows[window_index][Window].y
  287.   end
  288. end

  289. #==============================================================================
  290. # ■ Window_BattleMessageLog
  291. #------------------------------------------------------------------------------
  292. #  ログを表示する機能の処理を定義しています。
  293. #==============================================================================
  294. class Window_BattleMessageLog
  295.   #--------------------------------------------------------------------------
  296.   # ● オブジェクト初期化
  297.   #--------------------------------------------------------------------------
  298.   def initialize(x = 0, y = 0, width = window_width, height = window_height)
  299.     super(x, y, width, height)
  300.     window_parameter      # このウィンドウの初期値を設定
  301.     create_lines_viewport # ラインが枠内から出ないようにするビューポートを生成
  302.     create_back_bitmap    # ラインの背景Bitmapを生成
  303.    
  304.     @death_sentence = []  # 消去中に状態を変更するウィンドウを記憶する変数
  305.     @change_lines = false # ライン状態の変更を記憶する変数
  306.     @num_wait = 0         # バトルログのウェイトで使用する変数
  307.    
  308.     # ラインの状態リスト
  309.     @exist_lines = [] # 表示中(空文含む)
  310.     @entry_lines = [] # 追加中
  311.     @dying_lines = [] # 消去中
  312.     @shift_lines = {} # 移動中(ハッシュ)
  313.    
  314.     # ラインを描画する為のウィンドウとスプライトのセットの配列を準備
  315.     @line_windows = Array.new(max_line_number * 3) do |i|
  316.       @shift_lines[i] = false # ハッシュにKeyを登録する
  317.       create_line_window_set
  318.     end
  319.   end
  320.   #--------------------------------------------------------------------------
  321.   # ● 解放
  322.   #--------------------------------------------------------------------------
  323.   def dispose
  324.     super
  325.     dispose_back_bitmap
  326.     dispose_line_windows
  327.     dispose_lines_viewport
  328.   end
  329.   #--------------------------------------------------------------------------
  330.   # ● ラインのビューポートを生成
  331.   #--------------------------------------------------------------------------
  332.   def create_lines_viewport
  333.     @lines_viewport = Viewport.new(0, 0, contents_width, contents_height)
  334.     @lines_viewport.rect.x = self.x + standard_padding
  335.     @lines_viewport.rect.y = self.y + standard_padding
  336.     @lines_viewport.z      = self.z
  337.   end
  338.   #--------------------------------------------------------------------------
  339.   # ● ラインの背景になるビットマップを生成
  340.   #--------------------------------------------------------------------------
  341.   def create_back_bitmap
  342.     line_rect = Rect.new(0, 0, line_width, line_height) # ラインの矩形
  343.     @back_bitmap = get_back_bitmap(line_rect)           # Bitmapの取得
  344.   end
  345.   #--------------------------------------------------------------------------
  346.   # ● ラインの背景になるスプライトの生成
  347.   #--------------------------------------------------------------------------
  348.   def create_back_sprite
  349.     back_sprite = Sprite.new(@lines_viewport)
  350.     back_sprite.bitmap  = @back_bitmap
  351.     back_sprite.visible = false
  352.     back_sprite.z       = 150
  353.     return back_sprite
  354.   end
  355.   #--------------------------------------------------------------------------
  356.   # ● テキストを表示するウィンドウの生成
  357.   #--------------------------------------------------------------------------
  358.   def create_line_window
  359.     line_window = Window_MessageLine.new(0, 0, line_width, line_height)
  360.     line_window.viewport = @lines_viewport
  361.     line_window.visible  = false
  362.     line_window.z        = 200
  363.     return line_window
  364.   end
  365.   #--------------------------------------------------------------------------
  366.   # ● テキストとウィンドウと背景の配列を生成
  367.   #--------------------------------------------------------------------------
  368.   def create_line_window_set
  369.     return [nil, create_back_sprite, create_line_window]
  370.   end
  371.   #--------------------------------------------------------------------------
  372.   # ● 背景ビットマップの解放
  373.   #--------------------------------------------------------------------------
  374.   def dispose_back_bitmap
  375.     @back_bitmap.dispose
  376.   end
  377.   #--------------------------------------------------------------------------
  378.   # ● ウィンドウと背景の解放
  379.   #--------------------------------------------------------------------------
  380.   def dispose_line_windows
  381.     @line_windows.each do |window_set|
  382.       window_set[Back].dispose   # 背景のスプライトを解放
  383.       window_set[Window].dispose # 文章のウィンドウを解放
  384.     end
  385.   end
  386.   #--------------------------------------------------------------------------
  387.   # ● ラインのビューポートの解放
  388.   #--------------------------------------------------------------------------
  389.   def dispose_lines_viewport
  390.     @lines_viewport.dispose
  391.   end
  392.   #--------------------------------------------------------------------------
  393.   # ● ラインのビューポートの同期と更新
  394.   #--------------------------------------------------------------------------
  395.   def update_lines_viewport
  396.     # 移動しない場合は更新不要。それに同期させるより移動する際に更新する方が良い。
  397.     @lines_viewport.rect.x = self.x + standard_padding
  398.     @lines_viewport.rect.y = self.y + standard_padding
  399.     @lines_viewport.z      = self.z
  400.     @lines_viewport.rect.width  = contents_width
  401.     @lines_viewport.rect.height = contents_height
  402.     @lines_viewport.visible     = self.visible
  403.     ##@lines_viewport.update  # フラッシュは使用しないので更新はしない
  404.   end
  405.   #--------------------------------------------------------------------------
  406.   # ● 更新処理
  407.   #--------------------------------------------------------------------------
  408.   def update
  409.     super
  410.     check_shift_line if @change_lines # ライン状態が操作されている
  411.     @death_sentence.reject! { |window_index| execution(window_index) }
  412.     ##update_lines_viewport # ラインのビューポートの同期と更新
  413.     @dying_lines.each_index { |index| dying_line_process(index) }
  414.     @entry_lines.each_index { |index| entry_line_process(index) }
  415.     @shift_lines.each { |key, value| shift_line_process(key, value) if value }
  416.    
  417.     ##@line_windows.each do |window_set|  # 波形描画などはしないので更新しない
  418.     ##  window_set[Back].update   # 背景のスプライトを更新
  419.     ##  window_set[Window].update # 文章のウィンドウを更新
  420.     ##end
  421.   end
  422.   #--------------------------------------------------------------------------
  423.   # ● ラインを追加する処理
  424.   #--------------------------------------------------------------------------
  425.   def add_line(text, line_index)
  426.     window_index = nil
  427.     @line_windows.each_index do |i| # 待機中のウィンドウを探索
  428.       break window_index = i unless @line_windows[i][Text]
  429.     end
  430.     unless window_index # 待機中のウィンドウが存在しない場合
  431.       @shift_lines[@line_windows.size] = false  # ハッシュにKeyを登録する
  432.       @line_windows.push create_line_window_set # 新たにウィンドウを生成して追加
  433.       window_index = @line_windows.size
  434.     end
  435.    
  436.     # 表示中のリストに登録
  437.     if line_index < line_number
  438.       @exist_lines.insert(line_index, window_index) # 途中に挿入
  439.     else
  440.       line_index = line_number
  441.       @exist_lines.push window_index                # 末尾に追加
  442.     end
  443.    
  444.     # ラインの位置を設定
  445.     set_line_window_x(window_index, add_line_start_x)
  446.     set_line_window_y(window_index, line_position_y(line_index))
  447.    
  448.     # ラインの可視化と文章の描画
  449.     @line_windows[window_index][Text] = text  # 描画する文章を記憶
  450.     line_back(window_index).opacity   = 255   # 背景の透明度を初期化
  451.     line_back(window_index).z         = 150   # z座標を初期化
  452.     line_window(window_index).z       = 200   # z座標を初期化
  453.     line_window(window_index).draw_text_ex(text_padding_x, text_padding_y, text) # 文章を描画
  454.     line_window(window_index).contents_opacity = 255  # 文章の透明度を初期化
  455.    
  456.     # ラインの表示
  457.     unless text.empty?  # 空文は表示しない
  458.       line_back(window_index).visible   = true
  459.       line_window(window_index).visible = true
  460.       @entry_lines.push window_index  # 追加中のリストに登録
  461.     end
  462.    
  463.     @change_lines = true  # ライン状態の変更を記憶
  464.   end
  465.   #--------------------------------------------------------------------------
  466.   # ● ラインの消去を予約する処理
  467.   #--------------------------------------------------------------------------
  468.   def del_line(window_index)
  469.     @death_sentence.push window_index # 消去を予約
  470.     @change_lines = true  # ライン状態の変更を記憶
  471.   end
  472.   #--------------------------------------------------------------------------
  473.   # ● ラインを消去中にする処理
  474.   #--------------------------------------------------------------------------
  475.   def execution(window_index)
  476.     line_back(window_index).opacity            = del_opacity # 背景を半透明に
  477.     line_window(window_index).contents_opacity = del_opacity # 文章を半透明に
  478.     line_back(window_index).z   = 50  # 表示位置を奥に設定
  479.     line_window(window_index).z = 100 # 表示位置を奥に設定
  480.     @dying_lines.push window_index  # 消去中のリストに登録
  481.     return true
  482.   end
  483.   #--------------------------------------------------------------------------
  484.   # ● ラインを消去する処理
  485.   #--------------------------------------------------------------------------
  486.   def dead_line(window_index)
  487.     @line_windows[window_index][Text] = nil   # 文章の記憶を初期化
  488.     line_back(window_index).visible   = false # ラインの背景を非表示
  489.     line_window(window_index).visible = false # ラインの文章を非表示
  490.     line_window(window_index).contents.clear  # 文章のBitmapを初期化
  491.   end
  492.   #--------------------------------------------------------------------------
  493.   # ● シフトするラインを探索
  494.   #--------------------------------------------------------------------------
  495.   def check_shift_line
  496.     @change_lines = false # ライン状態の変更の記憶を初期化
  497.     @exist_lines.each_index do |line_index|
  498.       window_index = @exist_lines[line_index] # ウィンドウのインデックスを取得
  499.       position_y   = line_position_y(line_index)    # 移動先を取得
  500.       if position_y != line_window_y(window_index)  # 移動先が現在地以外
  501.         @shift_lines[window_index] = position_y # 移動中のリストに登録
  502.       elsif value = @shift_lines[window_index]  # 既に移動先が登録済
  503.         @shift_lines[window_index] = false unless value == del_line_end_y # 消去シフト以外は解除
  504.       end
  505.     end
  506.   end
  507.   #--------------------------------------------------------------------------
  508.   # ● ラインを行数に従って定位置へ移動する処理
  509.   #--------------------------------------------------------------------------
  510.   def shift_line_process(window_index, position_y)
  511.     line_y = line_window_y(window_index)
  512.     if (line_y - position_y).abs >= now_speed
  513.       slide_y = line_y < position_y ? now_speed : -now_speed
  514.       add_line_window_y(window_index, slide_y)    # ウィンドウを移動
  515.     else
  516.       set_line_window_y(window_index, position_y) # ウィンドウの位置を設定
  517.       @shift_lines[window_index] = false
  518.       if position_y == del_line_end_y # 消去シフト移動の場合
  519.         dead_line(window_index)           # ラインを消去
  520.         @dying_lines.delete(window_index) # 消去中のリストから消去
  521.         @entry_lines.delete(window_index) # 追加中のリストから消去
  522.       end
  523.     end
  524.   end
  525.   #--------------------------------------------------------------------------
  526.   # ● 追加されたラインを画面内へ移動する処理
  527.   #--------------------------------------------------------------------------
  528.   def entry_line_process(index)
  529.     window_index = @entry_lines[index]  # ウィンドウのインデックスを取得
  530.     line_x = line_window_x(window_index)  # ラインのx座標を取得
  531.     if (line_x - padding_x).abs >= add_speed
  532.       slide_x = line_x < padding_x ? add_speed : -add_speed
  533.       add_line_window_x(window_index, slide_x)    # ウィンドウを移動
  534.     else
  535.       set_line_window_x(window_index, padding_x)  # ウィンドウの位置を設定
  536.       @entry_lines.delete_at(index) # 追加中のリストから消去
  537.     end
  538.   end
  539.   #--------------------------------------------------------------------------
  540.   # ● ラインを画面外へ移動させて消去する処理
  541.   #--------------------------------------------------------------------------
  542.   def dying_line_process(index)
  543.     window_index = @dying_lines[index] # ウィンドウのインデックスを取得
  544.     line_y = line_window_y(window_index)
  545.     if (line_y - del_line_end_y).abs >= del_speed
  546.       slide_y = line_y < del_line_end_y ? now_speed : -now_speed
  547.       add_line_window_y(window_index, slide_y)  # ウィンドウを移動
  548.     else
  549.       dead_line(window_index)             # ラインを消去
  550.       @dying_lines.delete_at(index)       # 消去中のリストから消去
  551.       @entry_lines.delete(window_index)   # 追加中のリストから消去
  552.       @shift_lines[window_index] = false  # 移動中のリストから消去
  553.     end
  554.   end
  555. end

  556. #==============================================================================
  557. # ■ Window_MessageLine
  558. #------------------------------------------------------------------------------
  559. #  テキストを表示するスプライトのクラスです。スプライトもどき。
  560. #==============================================================================
  561. class Window_MessageLine < Window_Base
  562.   #--------------------------------------------------------------------------
  563.   # ● オブジェクト初期化
  564.   #--------------------------------------------------------------------------
  565.   def initialize(x, y, width, height)
  566.     super
  567.     self.arrows_visible = false # カーソルは表示しない
  568.     self.opacity        = 0     # 文字の描画以外は不要
  569.   end
  570.   #--------------------------------------------------------------------------
  571.   # ● 標準パディングサイズの取得
  572.   #--------------------------------------------------------------------------
  573.   def standard_padding
  574.     return 0                    # 余白を確保する必要はなし
  575.   end
  576. end
复制代码
梦石
0
星屑
6375
在线时间
1473 小时
注册时间
2015-7-25
回帖
609

极短25参与开拓者

发表于 2020-11-22 14:59:43 | 显示全部楼层
目测是因为这里使用了alias
  1. alias remove_shockcount_state remove_state
  2.       def remove_state(state_id)
  3.         remove_shockcount_state(state_id)
  4.         out_count_state(state_id)
  5.       end
复制代码

原方法执行了一次解除状态,新方法out_count_state(state_id)又执行了一次解除状态
所以可以尝试一下在原方法中加入条件判断,应该就没有问题了
  1. class Game_Battler
  2.   def remove_state(state_id)
  3.     if state?(state_id) && !@shockcount_states.include?(state_id)
  4.       revive if state_id == death_state_id
  5.       erase_state(state_id)
  6.       refresh
  7.       @result.removed_states.push(state_id).uniq!
  8.     end
  9.     out_count_state(state_id)
  10.   end
  11. end
复制代码

点评

应该可以注释掉,不确定的话测试一下就可以了w  发表于 2020-11-22 20:39
不对喔...好像是有两句@result.removed_states的关係...能注释掉第一个脚本第90行那句么?  发表于 2020-11-22 19:36
笨肉包的游戏讨论群932812135 (实时更新) 喜欢的话欢迎加入~
目前的坑
??? #像素风OC游戏 准备中 短篇-约5小时
花城梦之心 #像素风OC游戏 系统开发+素材绘制中
【不可思议的迷宫】幽灵契约外传:歌莉娅 v0.4 游戏文件已更新
同时更新中~ (沉迷摸鱼中~更新速度较慢请见谅w)
这是属于笨肉包一个人的旅行~(这只肉包又在摸鱼!
旅途的最终目标~ ???(保密~
回复

使用道具 举报

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

本版积分规则

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

在本版发帖返回顶部