=begin ◆概要 特定の文字列を含むイベントの数を取得します。 ◆機能 ・名前もしくは注釈に特定の文字列を書き込んであるイベントを検索できます。 ・イベントコマンドで「check_event_text("文字列", id)」と記入すれば、idの変数に 文字列を含むイベントの数を代入します。 ・名前もしくは注釈に「"検索無効"」と記入すると、そのイベントをカウントしません。 ◆仕様 ・特になし。 ◆使用上の注意 ・新規定義のみ。 =end #============================================================================== # ■ Game_Interpreter #============================================================================== class Game_Interpreter def check_event_text(string, id = 0) num = $game_map.events.values.select{|e| event = e.instance_variable_get(:@event) list = (e.list ? e.list.select{|l|l.code == 108 || l.code == 408} : []) (event.name.include?(string) || list.any?{|l| l.parameters[0].include?(string)}) && !list.any?{|l| l.parameters[0].include?("検索無効")} }.size $game_variables[id] = num if $game_variables[id] end end