设为首页收藏本站|繁體中文

Project1

 找回密码
 注册会员
搜索
查看: 2062|回复: 3
打印 上一主题 下一主题

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

[复制链接]

Lv5.捕梦者

梦石
0
星屑
24272
在线时间
5044 小时
注册时间
2016-3-8
帖子
1618
跳转到指定楼层
1
发表于 2020-11-21 03:01:46 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式

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

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

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

用了以下两个脚本后, 解除状态(有备注"衝撃回数解除:n")时会显示两次解除讯息
是什么原因呢  求指点。
RUBY 代码复制
  1. =begin
  2.           RGSS3
  3.           
  4.           ★ 衝撃回数解除ステート ★
  5.  
  6.           指定回数ダメージを受けた際に解除されるステートを作ることができます。
  7.           
  8.           ● 仕様 ●==========================================================
  9.           衝撃カウントは1以上のダメージを与えた時に限り変動します。
  10.           --------------------------------------------------------------------
  11.           解除確率はいまのところ一律100%となります。
  12.           ====================================================================
  13.           
  14.           ● 使い方 ●========================================================
  15.           データベースのステートのメモ欄に
  16.           「衝撃回数解除:n」という文字列を含ませて下さい。nには整数値を。
  17.           ====================================================================
  18.           
  19.           ver1.00
  20.  
  21.           Last Update : 2011/12/17
  22.           12/17 : RGSS2からの移植
  23.           
  24.           ろかん   [url]http://kaisou-ryouiki.sakura.ne.jp/[/url]
  25. =end
  26.  
  27.     $rsi ||= {}
  28.     $rsi["衝撃回数解除ステート"] = true
  29.  
  30.     class RPG::State < RPG::BaseItem
  31.       def get_remove_shockcount
  32.         self.note.each_line{|line|
  33.           return $1.to_i if line =~ /衝撃回数解除:(\d+)/i
  34.         }
  35.         0
  36.       end
  37.     end
  38.  
  39.     class Game_BattlerBase
  40.       #--------------------------------------------------------------------------
  41.       # ● ステート情報をクリア
  42.       #--------------------------------------------------------------------------
  43.       alias remove_shockcount_state_clear clear_states
  44.       def clear_states
  45.         remove_shockcount_state_clear
  46.         @shockcount_states = {}
  47.       end
  48.     end
  49.  
  50.     class Game_Battler
  51.       #--------------------------------------------------------------------------
  52.       # ● 新しいステートの付加
  53.       #--------------------------------------------------------------------------
  54.       alias add_shockcount_state add_new_state
  55.       def add_new_state(state_id)
  56.         add_shockcount_state(state_id)
  57.         set_count_state(state_id)
  58.       end
  59.       #--------------------------------------------------------------------------
  60.       # ● ステートの解除
  61.       #--------------------------------------------------------------------------
  62.       alias remove_shockcount_state remove_state
  63.       def remove_state(state_id)
  64.         remove_shockcount_state(state_id)
  65.         out_count_state(state_id)
  66.       end
  67.       #--------------------------------------------------------------------------
  68.       # ● 新しく付加されたステートに解除衝撃回数がある場合、専用ハッシュに加える
  69.       #--------------------------------------------------------------------------
  70.       def set_count_state(state_id)
  71.         shock_count = $data_states[state_id].get_remove_shockcount
  72.         @shockcount_states[state_id] = shock_count unless shock_count.zero?
  73.       end
  74.       #--------------------------------------------------------------------------
  75.       # ● 解除されたステートが専用ハッシュに存在する場合に削除
  76.       #--------------------------------------------------------------------------
  77.       def out_count_state(state_id)
  78.         @shockcount_states.delete(state_id) if @shockcount_states.include?(state_id)
  79.       end
  80.       #--------------------------------------------------------------------------
  81.       # ● ダメージによるステート解除
  82.       #--------------------------------------------------------------------------
  83.       alias shockcount_state_remove_states_by_damage remove_states_by_damage
  84.       def remove_states_by_damage
  85.         shockcount_state_remove_states_by_damage
  86.         @shockcount_states.each_key{|key|
  87.           @shockcount_states[key] -= 1
  88.           if @shockcount_states[key].zero?
  89.             remove_state(key)
  90.             @result.removed_states << key
  91.           end
  92.         }
  93.       end
  94.     end

RUBY 代码复制
  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.  
  19. $imported ||= {}
  20. $imported[:CanariAlternate_Window_BattleMessageLog] = true
  21.  
  22. #==============================================================================
  23. # ■ Calt
  24. #------------------------------------------------------------------------------
  25. #  CanariAlternateが製作したスクリプト用のモジュールです。
  26. #==============================================================================
  27. module Calt
  28.   #-----------------------------------------------------------------------------
  29.   # ★このスクリプトでバトルログを表示させる。
  30.   Alternate_Window_BattleLog = true
  31.   #-----------------------------------------------------------------------------
  32. end
  33.  
  34. if Calt::Alternate_Window_BattleLog
  35.   $imported[:CanariAlternate_Window_BattleLog] = true
  36.   #==============================================================================
  37.   # ■ Scene_Battle
  38.   #------------------------------------------------------------------------------
  39.   #  バトル画面の処理を行うクラスです。
  40.   #==============================================================================
  41.   class Scene_Battle < Scene_Base
  42.     #--------------------------------------------------------------------------
  43.     # ● フレーム更新(基本)[追加]
  44.     #--------------------------------------------------------------------------
  45.     alias _update_basic_alter_battle_log update_basic
  46.     def update_basic
  47.       _update_basic_alter_battle_log
  48.       @log_window.update  # バトルログを更新
  49.     end
  50.   end
  51.   Window_BattleMessageLog = Window_BattleLog        # 別名(変更を共有)
  52. else
  53.   Window_BattleMessageLog = Window_BattleLog.clone  # クローン
  54. end
  55.  
  56. #==============================================================================
  57. # ■ Window_BattleMessageLog
  58. #------------------------------------------------------------------------------
  59. #  ログを表示する機能の設定を定義しています。
  60. #==============================================================================
  61. class Window_BattleMessageLog
  62.   #--------------------------------------------------------------------------
  63.   # ● ラインを移動する速度(行をつめる速度)         ※縦にスライドする速度
  64.   def now_speed           ; return 3                                    ; end
  65.   #--------------------------------------------------------------------------
  66.   # ● ラインを消去する速度(画面外へのスライド速度) ※縦にスライドする速度
  67.   def del_speed           ; return 4                                    ; end
  68.   #--------------------------------------------------------------------------
  69.   # ● ラインを追加する速度(画面内へのスライド速度) ※横にスライドする速度
  70.   def add_speed           ; return 96                                   ; end
  71.   #--------------------------------------------------------------------------
  72.   # ● 追加するラインの始点(x座標)
  73.   def add_line_start_x    ; return contents_width                       ; end
  74.   #--------------------------------------------------------------------------
  75.   # ● 消去するラインの終点(y座標)
  76.   def del_line_end_y      ; return -line_height                         ; end
  77.   #--------------------------------------------------------------------------
  78.   # ● 最大行数の取得
  79.   def max_line_number     ; return 6                                    ; end
  80.   #--------------------------------------------------------------------------
  81.   # ● 消去中のラインの不透明度  (透明) 0 ~ 255 (不透明)
  82.   def del_opacity         ; return 64                                   ; end
  83.   #--------------------------------------------------------------------------
  84.   # ● 背景ビットマップの取得
  85.   def get_back_bitmap(line_rect)
  86.     ##back_bitmap = Bitmap.new("Graphics/System/" + "画像名") # 画像を読み込み
  87.     ##return back_bitmap
  88.  
  89.     back_bitmap = Bitmap.new(line_rect.width, line_rect.height) # ビットマップを生成
  90.     color_l = left_color  # ラインの左端の色を取得
  91.     color_r = right_color # ラインの右端の色を取得
  92.     # 左から右へグラデーションさせながら塗りつぶし
  93.     back_bitmap.gradient_fill_rect(line_rect, color_l, color_r)
  94.  
  95.     # これだけだと寂しいので少し装飾(枠をつける)
  96.     color_l.alpha += 64
  97.     color_r.alpha += 64
  98.     frame_rect = Rect.new(0, 0, line_rect.width, 1)
  99.     back_bitmap.gradient_fill_rect(frame_rect, color_l, color_r) # 上の枠を描画
  100.     frame_rect.y = line_rect.height - 1
  101.     back_bitmap.gradient_fill_rect(frame_rect, color_l, color_r) # 下の枠を描画
  102.     frame_rect = Rect.new(0, 0, 1, line_rect.height)
  103.     back_bitmap.fill_rect(frame_rect, color_l)                   # 左の枠を描画
  104.     frame_rect.x = line_rect.width - 1
  105.     back_bitmap.fill_rect(frame_rect, color_r)                   # 右の枠を描画
  106.  
  107.     return back_bitmap
  108.   end
  109.   #--------------------------------------------------------------------------
  110.   # ● ラインの左端の色     (red, green, blue, alpha)
  111.   def left_color          ; return Color.new(255, 128, 64, 128)         ; end
  112.   #--------------------------------------------------------------------------
  113.   # ● ラインの右端の色     (red, green, blue, alpha)
  114.   def right_color         ; return Color.new(255, 255, 255, 32)         ; end
  115.   #--------------------------------------------------------------------------
  116.   # ● ラインの幅を取得
  117.   def line_width          ; return contents_width - 16                  ; end
  118.   #--------------------------------------------------------------------------
  119.   # ● ラインの高さを取得
  120.   def line_height         ; return 24                                   ; end
  121.   #--------------------------------------------------------------------------
  122.   # ● ウィンドウ幅の初期値を取得
  123.   def window_width        ; return Graphics.width                       ; end
  124.   #--------------------------------------------------------------------------
  125.   # ● ウィンドウ高さの初期値を取得
  126.   def window_height       ; return fitting_height(max_line_number)      ; end
  127.   #--------------------------------------------------------------------------
  128.   # ● ウィンドウの初期設定
  129.   def window_parameter
  130.     ##self.windowskin = Cache.system("Window")  # ウィンドウスキンの変更
  131.     self.z              = 100   # Z座標
  132.     self.opacity        = 0     # 透明度
  133.     self.arrows_visible = false # カーソルは表示しない
  134.   end
  135.   #--------------------------------------------------------------------------
  136.   # ● 標準パディングサイズの取得
  137.   def standard_padding    ; return 0                                    ; end
  138.   #--------------------------------------------------------------------------
  139.   # ● ウィンドウ内容の幅を計算
  140.   def contents_width      ; return width  - standard_padding * 2        ; end
  141.   #--------------------------------------------------------------------------
  142.   # ● ウィンドウ内容の高さを計算
  143.   def contents_height     ; return height - standard_padding * 2        ; end
  144.   #--------------------------------------------------------------------------
  145.   # ● 余白(x座標)
  146.   def padding_x           ; return 0                                    ; end
  147.   #--------------------------------------------------------------------------
  148.   # ● 余白(y座標)
  149.   def padding_y           ; return 8                                    ; end
  150.   #--------------------------------------------------------------------------
  151.   # ● ラインのテキストの余白(x座標)
  152.   def text_padding_x      ; return 16                                   ; end
  153.   #--------------------------------------------------------------------------
  154.   # ● ラインのテキストの余白(y座標)
  155.   def text_padding_y      ; return 0                                    ; end
  156.   #--------------------------------------------------------------------------
  157.   # ● ラインとラインの間隔
  158.   def line_spacing        ; return 4                                    ; end
  159.   #--------------------------------------------------------------------------
  160. end
  161.  
  162. #==============================================================================
  163. # ■ Window_BattleMessageLog
  164. #------------------------------------------------------------------------------
  165. #  ログを表示する機能を制御するメソッドを定義しています。
  166. #==============================================================================
  167. class Window_BattleMessageLog
  168.   #--------------------------------------------------------------------------
  169.   # ● 最下行の文章の取得
  170.   def last_text           ; return line_text(@exist_lines[-1])          ; end
  171.   #--------------------------------------------------------------------------
  172.   # ● データ行数の取得
  173.   def line_number         ; return @exist_lines.size                    ; end
  174.   #--------------------------------------------------------------------------
  175.   # ● 一行戻る
  176.   def back_one            ; del_line(@exist_lines.pop)                  ; end
  177.   #--------------------------------------------------------------------------
  178.   # ● 指定した行を消去
  179.   def del_text(gyou)      ; del_line(@exist_lines.delete_at(gyou - 1))  ; end
  180.   #--------------------------------------------------------------------------
  181.   # ● 指定した行に戻る
  182.   def back_to(line_index) ; back_one while line_number > line_index     ; end
  183.   #--------------------------------------------------------------------------
  184.   # ● 一行シフト
  185.   def shift_one
  186.     @shift_lines[@exist_lines.shift] = del_line_end_y
  187.     @change_lines = true
  188.   end
  189.   #--------------------------------------------------------------------------
  190.   # ● クリア
  191.   def clear
  192.     @num_wait = 0
  193.     @dying_lines += @exist_lines
  194.     @exist_lines.clear
  195.     @entry_lines.clear
  196.   end
  197.   #--------------------------------------------------------------------------
  198.   # ● 文章の追加(行を指定するとその行に追加)
  199.   def add_text(text, line_index = line_number)
  200.     shift_one unless line_number < max_line_number # 行数が上限以上
  201.     add_line(text, line_index)
  202.   end
  203.   #--------------------------------------------------------------------------
  204.   # ● 文章の置き換え
  205.   def replace_text(text)
  206.     back_one
  207.     add_text(text)
  208.   end
  209.   #--------------------------------------------------------------------------
  210. end
  211.  
  212. #==============================================================================
  213. # ■ Window_BattleMessageLog
  214. #------------------------------------------------------------------------------
  215. #  ログを表示する機能の処理で使用する変数の操作・取得を定義しています。
  216. #==============================================================================
  217. class Window_BattleMessageLog
  218.   #--------------------------------------------------------------------------
  219.   # ● 定数
  220.   #--------------------------------------------------------------------------
  221.   Text   = 0  # テキストのインデックス
  222.   Back   = 1  # 背景のスプライトのインデクッス
  223.   Window = 2  # 文章のウィンドウのインデックス
  224.   #--------------------------------------------------------------------------
  225.   # ● 指定行数に適合するウィンドウの高さを計算
  226.   #--------------------------------------------------------------------------
  227.   def fitting_height(line_index)
  228.     return line_position_y(line_index) + standard_padding * 2
  229.   end
  230.   #--------------------------------------------------------------------------
  231.   # ● 指定行数に適合するラインの高さを計算
  232.   #--------------------------------------------------------------------------
  233.   def line_position_y(line_index)
  234.     return padding_y + (line_height + line_spacing) * line_index
  235.   end
  236.   #--------------------------------------------------------------------------
  237.   # ● ラインの背景スプライトを取得
  238.   #--------------------------------------------------------------------------
  239.   def line_text(window_index)
  240.     return @line_windows[window_index][Text]
  241.   end
  242.   #--------------------------------------------------------------------------
  243.   # ● ラインの背景スプライトを取得
  244.   #--------------------------------------------------------------------------
  245.   def line_back(window_index)
  246.     return @line_windows[window_index][Back]
  247.   end
  248.   #--------------------------------------------------------------------------
  249.   # ● ラインの文章ウィンドウを取得
  250.   #--------------------------------------------------------------------------
  251.   def line_window(window_index)
  252.     return @line_windows[window_index][Window]
  253.   end
  254.   #--------------------------------------------------------------------------
  255.   # ● ラインのx座標を設定
  256.   #--------------------------------------------------------------------------
  257.   def set_line_window_x(window_index, new_x)
  258.     @line_windows[window_index][Back].x   = new_x
  259.     @line_windows[window_index][Window].x = new_x
  260.   end
  261.   #--------------------------------------------------------------------------
  262.   # ● ラインのy座標を設定
  263.   #--------------------------------------------------------------------------
  264.   def set_line_window_y(window_index, new_y)
  265.     @line_windows[window_index][Back].y   = new_y
  266.     @line_windows[window_index][Window].y = new_y
  267.   end
  268.   #--------------------------------------------------------------------------
  269.   # ● ラインのx座標に加算
  270.   #--------------------------------------------------------------------------
  271.   def add_line_window_x(window_index, add_x)
  272.     @line_windows[window_index][Back].x   += add_x
  273.     @line_windows[window_index][Window].x += add_x
  274.   end
  275.   #--------------------------------------------------------------------------
  276.   # ● ラインのy座標に加算
  277.   #--------------------------------------------------------------------------
  278.   def add_line_window_y(window_index, add_y)
  279.     @line_windows[window_index][Back].y   += add_y
  280.     @line_windows[window_index][Window].y += add_y
  281.   end
  282.   #--------------------------------------------------------------------------
  283.   # ● ラインのx座標を取得
  284.   #--------------------------------------------------------------------------
  285.   def line_window_x(window_index)
  286.     return @line_windows[window_index][Window].x
  287.   end
  288.   #--------------------------------------------------------------------------
  289.   # ● ラインのy座標を取得
  290.   #--------------------------------------------------------------------------
  291.   def line_window_y(window_index)
  292.     return @line_windows[window_index][Window].y
  293.   end
  294. end
  295.  
  296. #==============================================================================
  297. # ■ Window_BattleMessageLog
  298. #------------------------------------------------------------------------------
  299. #  ログを表示する機能の処理を定義しています。
  300. #==============================================================================
  301. class Window_BattleMessageLog
  302.   #--------------------------------------------------------------------------
  303.   # ● オブジェクト初期化
  304.   #--------------------------------------------------------------------------
  305.   def initialize(x = 0, y = 0, width = window_width, height = window_height)
  306.     super(x, y, width, height)
  307.     window_parameter      # このウィンドウの初期値を設定
  308.     create_lines_viewport # ラインが枠内から出ないようにするビューポートを生成
  309.     create_back_bitmap    # ラインの背景Bitmapを生成
  310.  
  311.     @death_sentence = []  # 消去中に状態を変更するウィンドウを記憶する変数
  312.     @change_lines = false # ライン状態の変更を記憶する変数
  313.     @num_wait = 0         # バトルログのウェイトで使用する変数
  314.  
  315.     # ラインの状態リスト
  316.     @exist_lines = [] # 表示中(空文含む)
  317.     @entry_lines = [] # 追加中
  318.     @dying_lines = [] # 消去中
  319.     @shift_lines = {} # 移動中(ハッシュ)
  320.  
  321.     # ラインを描画する為のウィンドウとスプライトのセットの配列を準備
  322.     @line_windows = Array.new(max_line_number * 3) do |i|
  323.       @shift_lines[i] = false # ハッシュにKeyを登録する
  324.       create_line_window_set
  325.     end
  326.   end
  327.   #--------------------------------------------------------------------------
  328.   # ● 解放
  329.   #--------------------------------------------------------------------------
  330.   def dispose
  331.     super
  332.     dispose_back_bitmap
  333.     dispose_line_windows
  334.     dispose_lines_viewport
  335.   end
  336.   #--------------------------------------------------------------------------
  337.   # ● ラインのビューポートを生成
  338.   #--------------------------------------------------------------------------
  339.   def create_lines_viewport
  340.     @lines_viewport = Viewport.new(0, 0, contents_width, contents_height)
  341.     @lines_viewport.rect.x = self.x + standard_padding
  342.     @lines_viewport.rect.y = self.y + standard_padding
  343.     @lines_viewport.z      = self.z
  344.   end
  345.   #--------------------------------------------------------------------------
  346.   # ● ラインの背景になるビットマップを生成
  347.   #--------------------------------------------------------------------------
  348.   def create_back_bitmap
  349.     line_rect = Rect.new(0, 0, line_width, line_height) # ラインの矩形
  350.     @back_bitmap = get_back_bitmap(line_rect)           # Bitmapの取得
  351.   end
  352.   #--------------------------------------------------------------------------
  353.   # ● ラインの背景になるスプライトの生成
  354.   #--------------------------------------------------------------------------
  355.   def create_back_sprite
  356.     back_sprite = Sprite.new(@lines_viewport)
  357.     back_sprite.bitmap  = @back_bitmap
  358.     back_sprite.visible = false
  359.     back_sprite.z       = 150
  360.     return back_sprite
  361.   end
  362.   #--------------------------------------------------------------------------
  363.   # ● テキストを表示するウィンドウの生成
  364.   #--------------------------------------------------------------------------
  365.   def create_line_window
  366.     line_window = Window_MessageLine.new(0, 0, line_width, line_height)
  367.     line_window.viewport = @lines_viewport
  368.     line_window.visible  = false
  369.     line_window.z        = 200
  370.     return line_window
  371.   end
  372.   #--------------------------------------------------------------------------
  373.   # ● テキストとウィンドウと背景の配列を生成
  374.   #--------------------------------------------------------------------------
  375.   def create_line_window_set
  376.     return [nil, create_back_sprite, create_line_window]
  377.   end
  378.   #--------------------------------------------------------------------------
  379.   # ● 背景ビットマップの解放
  380.   #--------------------------------------------------------------------------
  381.   def dispose_back_bitmap
  382.     @back_bitmap.dispose
  383.   end
  384.   #--------------------------------------------------------------------------
  385.   # ● ウィンドウと背景の解放
  386.   #--------------------------------------------------------------------------
  387.   def dispose_line_windows
  388.     @line_windows.each do |window_set|
  389.       window_set[Back].dispose   # 背景のスプライトを解放
  390.       window_set[Window].dispose # 文章のウィンドウを解放
  391.     end
  392.   end
  393.   #--------------------------------------------------------------------------
  394.   # ● ラインのビューポートの解放
  395.   #--------------------------------------------------------------------------
  396.   def dispose_lines_viewport
  397.     @lines_viewport.dispose
  398.   end
  399.   #--------------------------------------------------------------------------
  400.   # ● ラインのビューポートの同期と更新
  401.   #--------------------------------------------------------------------------
  402.   def update_lines_viewport
  403.     # 移動しない場合は更新不要。それに同期させるより移動する際に更新する方が良い。
  404.     @lines_viewport.rect.x = self.x + standard_padding
  405.     @lines_viewport.rect.y = self.y + standard_padding
  406.     @lines_viewport.z      = self.z
  407.     @lines_viewport.rect.width  = contents_width
  408.     @lines_viewport.rect.height = contents_height
  409.     @lines_viewport.visible     = self.visible
  410.     ##@lines_viewport.update  # フラッシュは使用しないので更新はしない
  411.   end
  412.   #--------------------------------------------------------------------------
  413.   # ● 更新処理
  414.   #--------------------------------------------------------------------------
  415.   def update
  416.     super
  417.     check_shift_line if @change_lines # ライン状態が操作されている
  418.     @death_sentence.reject! { |window_index| execution(window_index) }
  419.     ##update_lines_viewport # ラインのビューポートの同期と更新
  420.     @dying_lines.each_index { |index| dying_line_process(index) }
  421.     @entry_lines.each_index { |index| entry_line_process(index) }
  422.     @shift_lines.each { |key, value| shift_line_process(key, value) if value }
  423.  
  424.     ##@line_windows.each do |window_set|  # 波形描画などはしないので更新しない
  425.     ##  window_set[Back].update   # 背景のスプライトを更新
  426.     ##  window_set[Window].update # 文章のウィンドウを更新
  427.     ##end
  428.   end
  429.   #--------------------------------------------------------------------------
  430.   # ● ラインを追加する処理
  431.   #--------------------------------------------------------------------------
  432.   def add_line(text, line_index)
  433.     window_index = nil
  434.     @line_windows.each_index do |i| # 待機中のウィンドウを探索
  435.       break window_index = i unless @line_windows[i][Text]
  436.     end
  437.     unless window_index # 待機中のウィンドウが存在しない場合
  438.       @shift_lines[@line_windows.size] = false  # ハッシュにKeyを登録する
  439.       @line_windows.push create_line_window_set # 新たにウィンドウを生成して追加
  440.       window_index = @line_windows.size
  441.     end
  442.  
  443.     # 表示中のリストに登録
  444.     if line_index < line_number
  445.       @exist_lines.insert(line_index, window_index) # 途中に挿入
  446.     else
  447.       line_index = line_number
  448.       @exist_lines.push window_index                # 末尾に追加
  449.     end
  450.  
  451.     # ラインの位置を設定
  452.     set_line_window_x(window_index, add_line_start_x)
  453.     set_line_window_y(window_index, line_position_y(line_index))
  454.  
  455.     # ラインの可視化と文章の描画
  456.     @line_windows[window_index][Text] = text  # 描画する文章を記憶
  457.     line_back(window_index).opacity   = 255   # 背景の透明度を初期化
  458.     line_back(window_index).z         = 150   # z座標を初期化
  459.     line_window(window_index).z       = 200   # z座標を初期化
  460.     line_window(window_index).draw_text_ex(text_padding_x, text_padding_y, text) # 文章を描画
  461.     line_window(window_index).contents_opacity = 255  # 文章の透明度を初期化
  462.  
  463.     # ラインの表示
  464.     unless text.empty?  # 空文は表示しない
  465.       line_back(window_index).visible   = true
  466.       line_window(window_index).visible = true
  467.       @entry_lines.push window_index  # 追加中のリストに登録
  468.     end
  469.  
  470.     @change_lines = true  # ライン状態の変更を記憶
  471.   end
  472.   #--------------------------------------------------------------------------
  473.   # ● ラインの消去を予約する処理
  474.   #--------------------------------------------------------------------------
  475.   def del_line(window_index)
  476.     @death_sentence.push window_index # 消去を予約
  477.     @change_lines = true  # ライン状態の変更を記憶
  478.   end
  479.   #--------------------------------------------------------------------------
  480.   # ● ラインを消去中にする処理
  481.   #--------------------------------------------------------------------------
  482.   def execution(window_index)
  483.     line_back(window_index).opacity            = del_opacity # 背景を半透明に
  484.     line_window(window_index).contents_opacity = del_opacity # 文章を半透明に
  485.     line_back(window_index).z   = 50  # 表示位置を奥に設定
  486.     line_window(window_index).z = 100 # 表示位置を奥に設定
  487.     @dying_lines.push window_index  # 消去中のリストに登録
  488.     return true
  489.   end
  490.   #--------------------------------------------------------------------------
  491.   # ● ラインを消去する処理
  492.   #--------------------------------------------------------------------------
  493.   def dead_line(window_index)
  494.     @line_windows[window_index][Text] = nil   # 文章の記憶を初期化
  495.     line_back(window_index).visible   = false # ラインの背景を非表示
  496.     line_window(window_index).visible = false # ラインの文章を非表示
  497.     line_window(window_index).contents.clear  # 文章のBitmapを初期化
  498.   end
  499.   #--------------------------------------------------------------------------
  500.   # ● シフトするラインを探索
  501.   #--------------------------------------------------------------------------
  502.   def check_shift_line
  503.     @change_lines = false # ライン状態の変更の記憶を初期化
  504.     @exist_lines.each_index do |line_index|
  505.       window_index = @exist_lines[line_index] # ウィンドウのインデックスを取得
  506.       position_y   = line_position_y(line_index)    # 移動先を取得
  507.       if position_y != line_window_y(window_index)  # 移動先が現在地以外
  508.         @shift_lines[window_index] = position_y # 移動中のリストに登録
  509.       elsif value = @shift_lines[window_index]  # 既に移動先が登録済
  510.         @shift_lines[window_index] = false unless value == del_line_end_y # 消去シフト以外は解除
  511.       end
  512.     end
  513.   end
  514.   #--------------------------------------------------------------------------
  515.   # ● ラインを行数に従って定位置へ移動する処理
  516.   #--------------------------------------------------------------------------
  517.   def shift_line_process(window_index, position_y)
  518.     line_y = line_window_y(window_index)
  519.     if (line_y - position_y).abs >= now_speed
  520.       slide_y = line_y < position_y ? now_speed : -now_speed
  521.       add_line_window_y(window_index, slide_y)    # ウィンドウを移動
  522.     else
  523.       set_line_window_y(window_index, position_y) # ウィンドウの位置を設定
  524.       @shift_lines[window_index] = false
  525.       if position_y == del_line_end_y # 消去シフト移動の場合
  526.         dead_line(window_index)           # ラインを消去
  527.         @dying_lines.delete(window_index) # 消去中のリストから消去
  528.         @entry_lines.delete(window_index) # 追加中のリストから消去
  529.       end
  530.     end
  531.   end
  532.   #--------------------------------------------------------------------------
  533.   # ● 追加されたラインを画面内へ移動する処理
  534.   #--------------------------------------------------------------------------
  535.   def entry_line_process(index)
  536.     window_index = @entry_lines[index]  # ウィンドウのインデックスを取得
  537.     line_x = line_window_x(window_index)  # ラインのx座標を取得
  538.     if (line_x - padding_x).abs >= add_speed
  539.       slide_x = line_x < padding_x ? add_speed : -add_speed
  540.       add_line_window_x(window_index, slide_x)    # ウィンドウを移動
  541.     else
  542.       set_line_window_x(window_index, padding_x)  # ウィンドウの位置を設定
  543.       @entry_lines.delete_at(index) # 追加中のリストから消去
  544.     end
  545.   end
  546.   #--------------------------------------------------------------------------
  547.   # ● ラインを画面外へ移動させて消去する処理
  548.   #--------------------------------------------------------------------------
  549.   def dying_line_process(index)
  550.     window_index = @dying_lines[index] # ウィンドウのインデックスを取得
  551.     line_y = line_window_y(window_index)
  552.     if (line_y - del_line_end_y).abs >= del_speed
  553.       slide_y = line_y < del_line_end_y ? now_speed : -now_speed
  554.       add_line_window_y(window_index, slide_y)  # ウィンドウを移動
  555.     else
  556.       dead_line(window_index)             # ラインを消去
  557.       @dying_lines.delete_at(index)       # 消去中のリストから消去
  558.       @entry_lines.delete(window_index)   # 追加中のリストから消去
  559.       @shift_lines[window_index] = false  # 移動中のリストから消去
  560.     end
  561.   end
  562. end
  563.  
  564. #==============================================================================
  565. # ■ Window_MessageLine
  566. #------------------------------------------------------------------------------
  567. #  テキストを表示するスプライトのクラスです。スプライトもどき。
  568. #==============================================================================
  569. class Window_MessageLine < Window_Base
  570.   #--------------------------------------------------------------------------
  571.   # ● オブジェクト初期化
  572.   #--------------------------------------------------------------------------
  573.   def initialize(x, y, width, height)
  574.     super
  575.     self.arrows_visible = false # カーソルは表示しない
  576.     self.opacity        = 0     # 文字の描画以外は不要
  577.   end
  578.   #--------------------------------------------------------------------------
  579.   # ● 標準パディングサイズの取得
  580.   #--------------------------------------------------------------------------
  581.   def standard_padding
  582.     return 0                    # 余白を確保する必要はなし
  583.   end
  584. end

Lv3.寻梦者

梦石
0
星屑
4803
在线时间
1350 小时
注册时间
2015-7-25
帖子
541

开拓者

2
发表于 2020-11-22 14:59:43 | 只看该作者
目测是因为这里使用了alias
RUBY 代码复制
  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)又执行了一次解除状态
所以可以尝试一下在原方法中加入条件判断,应该就没有问题了
RUBY 代码复制
  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
目前的坑 幽灵契约外传:歌莉娅
回归持续更新中~ 进度 v0.21/v1.00
笨肉包开始学像素画啦!努力训练中XD
啊~今天也是填坑的一天呢!

看!是肉包!
只能看!不能吃!
回复 支持 反对

使用道具 举报

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

本版积分规则

拿上你的纸笔,建造一个属于你的梦想世界,加入吧。
 注册会员
找回密码

站长信箱:[email protected]|手机版|小黑屋|无图版|Project1游戏制作

GMT+8, 2024-4-25 01:34

Powered by Discuz! X3.1

© 2001-2013 Comsenz Inc.

快速回复 返回顶部 返回列表