| 赞 | 168 |
| VIP | |
| 好人卡 | |
| 积分 | 229 |
| 经验 | |
| 最后登录 | 2025-4-1 |
| 在线时间 | 8598 小时 |
- 梦石
- 0
- 星屑
- 22879
- 在线时间
- 8598 小时
- 注册时间
- 2011-12-31
- 回帖
- 3270
|
发表于 2015-5-18 10:17:27
|
显示全部楼层
本帖最后由 tseyik 于 2015-5-18 16:28 编辑
有.
焼きノリ1- =begin
- #==============================================================================
- [名前] YakiNoriBaseScripts
- [作者] 焼きノリ
- [配布元] まったりツクール雑貨 http://mata-tuku.ldblog.jp/
- #------------------------------------------------------------------------------
- [更新履歴]
- ・2012/08/26 公開
- ・2012/09/09 Window_Selectableにメソッド追加
- ・2014/04/20 利用者にとってあまり意味のないメソッドの削除
- ・2015/03/25 method_defined?をエイリアスして機能の拡張
- ・2015/04/01 RGSS3用にメソッドをいくつか追加
- #==============================================================================
- #------------------------------------------------------------------------------
- [対応]
- ・RGSS2、RGSS3両方可能
- #------------------------------------------------------------------------------
- #------------------------------------------------------------------------------
- [機能]
- ・焼きノリが制作したスクリプトを使う際に必要になります。
- ・RGSS3のみ、TPの割合を取得するメソッドを正しい処理に再定義しています。
- #------------------------------------------------------------------------------
- #------------------------------------------------------------------------------
- [使用方法]
- ・必ず、拙作の他のスクリプトの一番上に配置してください。
- #------------------------------------------------------------------------------
- [再定義箇所]
- ・RGSS3のみ Game_BattlerBase の tp_rate
- #------------------------------------------------------------------------------
- [○ : 新規定義, ◎ : エイリアス定義, ● : 再定義]
- #------------------------------------------------------------------------------
- =end
- $YkNr_Scripts ||= {}
- $YkNr_Scripts[:YakiNoriBaseScripts] = true
- #※このスクリプトを使用しない場合は、↑を false にすること
- if $YkNr_Scripts[:YakiNoriBaseScripts]
- #==============================================================================
- # ■ YakiNori
- #------------------------------------------------------------------------------
- # 拙作の各自作スクリプトで使用するメソッドの集まりです。
- #==============================================================================
- module YakiNori
- #--------------------------------------------------------------------------
- # ○ 定数用モジュールに定義されている定数をフリーズ
- # このメソッドのみ、定数モジュールより先に定義する
- #--------------------------------------------------------------------------
- def self.freeze_all_constants(mod)
- _const_modules = "#{mod.name}::Const"
- eval("#{_const_modules}.constants").each do |const|
- _constant = "#{_const_modules}::#{const}"
- eval("#{_constant}.freeze") if !eval("#{_constant}.frozen?")
- end
- end
- #==============================================================================
- # ■ 定数用モジュール
- #==============================================================================
- module Const
- end
- freeze_all_constants(self) # 定数をフリーズ
- #==============================================================================
- # ■ インスタンスメソッド用モジュール
- #------------------------------------------------------------------------------
- # このモジュールをインクルードすることで、ここで定義したメソッドが使用可能。
- #==============================================================================
- module Instance
- end
- #==============================================================================
- # ■ 拡張モジュール用モジュール
- #------------------------------------------------------------------------------
- # このモジュールに自作スクリプトで使用するモジュールを集結させます
- #==============================================================================
- module BaseExModules
- # オブジェクトクラスにインクルード
- Object.__send__ :include, self
- end
- #==============================================================================
- # ■ 特異メソッド
- #==============================================================================
- #--------------------------------------------------------------------------
- # ○ 拡張モジュール用モジュールに定義されているか取得
- # 引数は、RGSS,RGSS2では文字列に、RGSS3はシンボル値を渡してください
- #--------------------------------------------------------------------------
- def self.include_module?(module_name_sym)
- BaseExModules.constants.include?(module_name_sym)
- end
- end
- #==============================================================================
- # ■ Kernel
- #==============================================================================
- module Kernel
- #--------------------------------------------------------------------------
- # ○ RPGVXAce かどうか
- #--------------------------------------------------------------------------
- def vxace?
- # Ruby 1.9 以降とそれ以前では、実行結果が違う
- return false if public_methods.all? {|item| item.is_a?(String)}
- return false if !defined?(Graphics.play_movie)
- return defined?(BasicObject)
- end
- #--------------------------------------------------------------------------
- # ○ RGSSのバージョンを取得
- #--------------------------------------------------------------------------
- def rgss_version
- _version = {2 => false, 3 => false}
- _version[vxace? ? 3 : 2] = true
- return _version
- end
- #--------------------------------------------------------------------------
- # ○ 定数
- #--------------------------------------------------------------------------
- RGSS = rgss_version; RGSS.freeze
- end
- #==============================================================================
- # ■ Module
- #==============================================================================
- class Module < Object
- #--------------------------------------------------------------------------
- # ◎ インスタンスメソッドが定義されているか判定
- #--------------------------------------------------------------------------
- alias method_defined_from_all? :method_defined?
- def method_defined?(method_name, all = true)
- if all
- method_defined_from_all?(method_name)
- else
- method_name = RGSS[3] ? method_name.to_sym : method_name.to_s
- instance_methods(false).include?(method_name)
- end
- end
- end
- #==============================================================================
- # ■ Game_CharacterBase
- #==============================================================================
- class Game_CharacterBase
- #--------------------------------------------------------------------------
- # ○ 正面にイベントが存在するか取得
- #--------------------------------------------------------------------------
- def exist_event_front?
- x2 = $game_map.round_x_with_direction(@x, @direction)
- y2 = $game_map.round_y_with_direction(@y, @direction)
- return !$game_map.events_xy(x2, y2).empty?
- end
- end
- #==============================================================================
- # ■ Game_Map
- #==============================================================================
- class Game_Map
- #--------------------------------------------------------------------------
- # ○ エディター上のマップ名を取得
- #--------------------------------------------------------------------------
- def editor_name
- $data_mapinfos[map_id].name
- end
- end
- #==============================================================================
- # ■ Game_Event
- #==============================================================================
- class Game_Event < Game_Character
- #--------------------------------------------------------------------------
- # ○ イベント名の取得
- #--------------------------------------------------------------------------
- def name
- @event.name
- end
- end
- #==============================================================================
- # ■ Window_Base
- #==============================================================================
- class Window_Base < Window
- #--------------------------------------------------------------------------
- # ○ ゲージの描画 (外枠付)
- # rate : 割合(1.0 で満タン)
- # color1 : グラデーション 左端
- # color2 : グラデーション 右端
- #--------------------------------------------------------------------------
- def draw_gauge_ex(x, y, width, rate, color1, color2)
- fill_w = ((width-2) * rate).to_i
- gauge_y = y + line_height - 8
- contents.fill_rect(x, gauge_y, width, 8, gauge_back_color)
- contents.gradient_fill_rect(x+1, gauge_y+1, fill_w, 6, color1, color2)
- end
- end
- #==============================================================================
- # ■ Window_Selectable
- #==============================================================================
- class Window_Selectable < Window_Base
- #--------------------------------------------------------------------------
- # ○ 現在の列の取得
- #--------------------------------------------------------------------------
- def column
- index % col_max
- end
- #--------------------------------------------------------------------------
- # ○ 行と列から項目の位置を取得
- #--------------------------------------------------------------------------
- def index_pos(row, column)
- row * col_max + (column - 1)
- end
- end
- #==============================================================================
- # □ ここから VX Ace のみ
- #==============================================================================
- if RGSS[3]
- #==============================================================================
- # ■ Game_BattlerBase
- #==============================================================================
- class Game_BattlerBase
- #--------------------------------------------------------------------------
- # ● TP の割合を取得
- #--------------------------------------------------------------------------
- def tp_rate
- @tp.to_f / max_tp
- end
- end
- #==============================================================================
- # ■ Game_Unit
- #==============================================================================
- class Game_Unit
- #--------------------------------------------------------------------------
- # ○ 合計値を計算
- #--------------------------------------------------------------------------
- def hp_sum; members.inject(0) {|r, m| r += m.hp }; end # HP
- def mp_sum; members.inject(0) {|r, m| r += m.mp }; end # MP
- def tp_sum; members.inject(0) {|r, m| r += m.tp }; end # TP
- def mhp_sum; members.inject(0) {|r, m| r += m.mhp }; end # 最大HP
- def mmp_sum; members.inject(0) {|r, m| r += m.mmp }; end # 最大MP
- def mtp_sum; members.inject(0) {|r, m| r += m.max_tp }; end # 最大TP
- #--------------------------------------------------------------------------
- # ○ 割合を計算
- #--------------------------------------------------------------------------
- def hp_rate; members.size == 0 ? 1 : hp_sum.to_f / mhp_sum; end # HP
- def mp_rate; members.size == 0 ? 1 : mp_sum.to_f / mmp_sum; end # MP
- def tp_rate; members.size == 0 ? 1 : tp_sum.to_f / mtp_sum; end # TP
- #--------------------------------------------------------------------------
- # ○ 攻撃力の平均値を計算
- #--------------------------------------------------------------------------
- def atk
- return 1 if members.size == 0
- members.inject(0) {|r, member| r += member.atk } / members.size
- end
- #--------------------------------------------------------------------------
- # ○ 防御力の平均値を計算
- #--------------------------------------------------------------------------
- def def
- return 1 if members.size == 0
- members.inject(0) {|r, member| r += member.def } / members.size
- end
- #--------------------------------------------------------------------------
- # ○ 魔法力の平均値を計算
- #--------------------------------------------------------------------------
- def mat
- return 1 if members.size == 0
- members.inject(0) {|r, member| r += member.mat } / members.size
- end
- #--------------------------------------------------------------------------
- # ○ 魔法防御の平均値を計算
- #--------------------------------------------------------------------------
- def mdf
- return 1 if members.size == 0
- members.inject(0) {|r, member| r += member.mdf } / members.size
- end
- #--------------------------------------------------------------------------
- # ○ 運の平均値を計算
- #--------------------------------------------------------------------------
- def luk
- return 1 if members.size == 0
- members.inject(0) {|r, member| r += member.luk } / members.size
- end
- end
- #==============================================================================
- # □ ここまで VX Ace のみ / ここから VX のみ
- #==============================================================================
- elsif !RGSS[3]
- #--------------------------------------------------------------------------
- # ○ $data_mapinfos のロード
- #--------------------------------------------------------------------------
- $data_mapinfos ||= load_data("Data/MapInfos.rvdata")
- #==============================================================================
- # ■ Game_Map
- #==============================================================================
- class Game_Map
- #--------------------------------------------------------------------------
- # ◎ マップ名を取得
- #--------------------------------------------------------------------------
- alias name editor_name
- end
- #==============================================================================
- # ■ Window_Base
- #==============================================================================
- class Window_Base < Window
- #--------------------------------------------------------------------------
- # ○ テキスト描画色の変更
- # enabled : 有効フラグ。false のとき半透明で描画
- #--------------------------------------------------------------------------
- def change_color(color, enabled = true)
- contents.font.color.set(color)
- contents.font.color.alpha = translucent_alpha unless enabled
- end
- #--------------------------------------------------------------------------
- # ○ テキストの描画
- # args : Bitmap#draw_text と同じ
- #--------------------------------------------------------------------------
- def draw_text(*args)
- contents.draw_text(*args)
- end
- end
- #==============================================================================
- # ■ Game_Temp
- #==============================================================================
- class Game_Temp
- #--------------------------------------------------------------------------
- # ○ 公開インスタンス変数
- #--------------------------------------------------------------------------
- attr_accessor :previous_scene # 現在のひとつ前の画面(文字列)
- #--------------------------------------------------------------------------
- # ◎ オブジェクト初期化
- #--------------------------------------------------------------------------
- alias yknr_LogDisable_initialize initialize
- def initialize
- yknr_LogDisable_initialize
- @previous_scene = ""
- end
- end
- #==============================================================================
- # ■ Scene_Base
- #==============================================================================
- class Scene_Base
- #--------------------------------------------------------------------------
- # ○ 終了処理
- #--------------------------------------------------------------------------
- def terminate
- # 現在の画面を保存
- $game_temp.previous_scene = self.class.name
- end
- end
- end # !RGSS[3]
- end # $YkNr_Scripts
复制代码
焼きノリ2- =begin
- #==============================================================================
- [名前] 拡張デバッグ機能_本体
- [作者] 焼きノリ
- [配布元] まったりツクール雑貨 http://mata-tuku.ldblog.jp/
- #------------------------------------------------------------------------------
- [更新履歴]
- ・2012/09/10 公開
- ・2014/06/07 デバッグシーンからバトルシーンに戻ってくると TP が初期化されるバグの修正
- ・2014/06/07 その他, 各処理の改善
- #==============================================================================
- #------------------------------------------------------------------------------
- [対応]
- ・RGSS3のみ可能
- #------------------------------------------------------------------------------
- #------------------------------------------------------------------------------
- [機能]
- ・デフォルトのデバッグ機能を拡張し、
- 変数、スイッチ以外にもデバッグの対象にすることができるようになります。
- ・戦闘中でもデバッグメニューを開けるようになります。
- 戦闘中に開いた場合、そのターンに選択した戦闘行動はキャンセルされ、
- パーティの先頭から選択し直しになります。
- #------------------------------------------------------------------------------
- #------------------------------------------------------------------------------
- [使用方法]
- ・テストモード時に「F9」を押せば、そのまま使えます。
- ・このスクリプトはただの本体ですので、これだけでは使えません。
- 別途で「拡張デバッグ機能_カスタマイズ」が必要です。
- ・このスクリプトのカスタマイズ項目で、
- 指定キーを押下中の、値の増減値を設定できます。
- #------------------------------------------------------------------------------
- #------------------------------------------------------------------------------
- [再定義箇所]
- ・Scene_Debug の start, help_text
- ・Window_DebugLeft の initialize, window_height, mode, top_id, refresh, draw_item
- ・Window_DebugRight の initialize, update, draw_item
- #------------------------------------------------------------------------------
- [○ : 新規定義, ◎ : エイリアス定義, ● : 再定義]
- #------------------------------------------------------------------------------
- =end
- $YkNr_Scripts ||= {}
- $YkNr_Scripts[:ExDebugScene] = true
- #※このスクリプトを使用しない場合は、↑を false にすること
- if $YkNr_Scripts[:ExDebugScene] && $TEST
- #==============================================================================
- # ■ ExDebugData
- #------------------------------------------------------------------------------
- # デバッグメニューのカテゴリ名とヘルプテキストを設定するモジュールです。
- #==============================================================================
- module YakiNori::BaseExModules::ExDebugData
- #==============================================================================
- # ■ 定数モジュール
- #==============================================================================
- module Const
- #==============================================================================
- # ▼ カスタマイズ
- #==============================================================================
- # 値の増減値のレート(例:50 #=> 50倍)
- MultiplyRateNum = 50
- # 増減値レートを判定するボタンのシンボル値
- MultiplyRateInput = :A
- #==============================================================================
- # ▲ カスタマイズここまで
- #==============================================================================
- SwitchString = {true => "[O N]", false => "[OFF]"}
- CommandSymbol = []
- CommandName = {}
- HelpDescription = {}
- end
- end
- #==============================================================================
- # ■ BattleManager
- #==============================================================================
- module BattleManager
- #--------------------------------------------------------------------------
- # ○ コマンド入力中判定
- #--------------------------------------------------------------------------
- def self.inputting?
- @phase == :input
- end
- end
- #==============================================================================
- # ■ Game_Battler
- #==============================================================================
- class Game_Battler < Game_BattlerBase
- #--------------------------------------------------------------------------
- # ◎ 戦闘開始処理
- #--------------------------------------------------------------------------
- alias yknr_Game_BattlerExDebugScene_on_battle_start :on_battle_start
- def on_battle_start
- if SceneManager.scene_is?(Scene_Battle)
- if !SceneManager.scene.returned_from_scene_debug?
- yknr_Game_BattlerExDebugScene_on_battle_start
- end
- end
- end
- end
- #==============================================================================
- # ■ Window_DebugCategory
- #------------------------------------------------------------------------------
- # デバッグメニューのメイン項目を表示します。
- #==============================================================================
- class Window_DebugCategory < Window_Command
- #--------------------------------------------------------------------------
- # ○ インクルード
- #--------------------------------------------------------------------------
- include YakiNori::BaseExModules::ExDebugData::Const
- #--------------------------------------------------------------------------
- # ○ オブジェクト初期化
- #--------------------------------------------------------------------------
- def initialize
- super(0, 0)
- end
- #--------------------------------------------------------------------------
- # ○ ウィンドウ幅の取得
- #--------------------------------------------------------------------------
- def window_width
- Graphics.width
- end
- #--------------------------------------------------------------------------
- # ○ 表示行数の取得
- #--------------------------------------------------------------------------
- def visible_line_number
- return 5
- end
- #--------------------------------------------------------------------------
- # ○ 桁数の取得
- #--------------------------------------------------------------------------
- def col_max
- return 2
- end
- #--------------------------------------------------------------------------
- # ○ 横に項目が並ぶときの空白の幅を取得
- #--------------------------------------------------------------------------
- def spacing
- return 8
- end
- #--------------------------------------------------------------------------
- # ○ ウィンドウ内容の幅を計算
- #--------------------------------------------------------------------------
- def contents_width
- (item_width + spacing) * col_max - spacing
- end
- #--------------------------------------------------------------------------
- # ○ コマンドリストの作成
- #--------------------------------------------------------------------------
- def make_command_list
- CommandSymbol.each do |sym|
- add_command(CommandName[sym], sym, enabled_command(sym)) if !sym.nil?
- end
- end
- #--------------------------------------------------------------------------
- # ○ コマンドが有効状態か判定
- #--------------------------------------------------------------------------
- def enabled_command(symbol)
- true
- end
- #--------------------------------------------------------------------------
- # ○ カーソルを 1 ページ後ろに移動
- #--------------------------------------------------------------------------
- def cursor_pagedown
- end
- #--------------------------------------------------------------------------
- # ○ カーソルを 1 ページ前に移動
- #--------------------------------------------------------------------------
- def cursor_pageup
- end
- end
- #==============================================================================
- # ■ Window_DebugLeft
- #==============================================================================
- class Window_DebugLeft < Window_Selectable
- #--------------------------------------------------------------------------
- # ○ インクルード
- #--------------------------------------------------------------------------
- include YakiNori::BaseExModules::ExDebugData::Const
- #--------------------------------------------------------------------------
- # ○ 公開インスタンス変数
- #--------------------------------------------------------------------------
- attr_accessor :mode # モード
- #--------------------------------------------------------------------------
- # ● オブジェクト初期化
- #--------------------------------------------------------------------------
- def initialize(x, y)
- super(x, y, window_width, window_height)
- @mode = nil
- @item_max = 0
- refresh
- end
- #--------------------------------------------------------------------------
- # ● ウィンドウ高さの取得
- #--------------------------------------------------------------------------
- def window_height
- fitting_height(10)
- end
- #--------------------------------------------------------------------------
- # ● 先頭に表示する ID の取得
- #--------------------------------------------------------------------------
- def top_id
- index * 10 + 1
- end
- #--------------------------------------------------------------------------
- # ● リフレッシュ
- #--------------------------------------------------------------------------
- def refresh
- @item_max = ex_item_max
- create_contents
- draw_all_items
- end
- #--------------------------------------------------------------------------
- # ● 項目の描画
- #--------------------------------------------------------------------------
- def draw_item(index)
- return if @mode.nil?
- draw_text(item_rect_for_text(index), ex_draw_item(index))
- end
- #--------------------------------------------------------------------------
- # ○ 拡張用:項目数の取得
- #--------------------------------------------------------------------------
- def ex_item_max
- return 0
- end
- #--------------------------------------------------------------------------
- # ○ 拡張用:項目の描画の内容を取得
- #--------------------------------------------------------------------------
- def ex_draw_item(index)
- return ""
- end
- end
- #==============================================================================
- # ■ Window_DebugRight
- #==============================================================================
- class Window_DebugRight < Window_Selectable
- #--------------------------------------------------------------------------
- # ○ インクルード
- #--------------------------------------------------------------------------
- include YakiNori::BaseExModules::ExDebugData::Const
- #--------------------------------------------------------------------------
- # ● オブジェクト初期化
- #--------------------------------------------------------------------------
- def initialize(x, y, width)
- super(x, y, width, fitting_height(item_max))
- @mode = nil
- @top_id = 1
- refresh
- end
- #--------------------------------------------------------------------------
- # ● 項目の描画
- #--------------------------------------------------------------------------
- def draw_item(index)
- return if @mode.nil? || @top_id < 0
-
- data_id = @top_id + index
- text = ex_draw_item(index, data_id)
- text[:name] = "[!] 未使用項目---------" if text[:name].nil?
-
- id_text = sprintf("%04d:", data_id)
- id_width = text_size(id_text).width
- rect = item_rect_for_text(index)
- change_color(normal_color)
- draw_text(rect, id_text)
- rect.x += id_width
- rect.width -= id_width + 60
- draw_text(rect, text[:name])
- rect.width += 60
- draw_text(rect, text[:status], 2)
- end
- #--------------------------------------------------------------------------
- # ● フレーム更新
- #--------------------------------------------------------------------------
- def update
- super
- ex_update_debug if active
- end
- #--------------------------------------------------------------------------
- # ○ 拡張用:項目の描画の内容を取得
- #--------------------------------------------------------------------------
- def ex_draw_item(index, data_id)
- return {:name => nil, :status => ""}
- end
- #--------------------------------------------------------------------------
- # ○ 拡張用:モード別にフレーム更新
- #--------------------------------------------------------------------------
- def ex_update_debug
- end
- #--------------------------------------------------------------------------
- # ○ 方向キーによる値の更新
- #--------------------------------------------------------------------------
- def update_value_input(value)
- rate = Input.press?(MultiplyRateInput) ? MultiplyRateNum : 1
- value += 1 * rate if Input.repeat?(:RIGHT)
- value -= 1 * rate if Input.repeat?(:LEFT)
- value += 10 * rate if Input.repeat?(:R)
- value -= 10 * rate if Input.repeat?(:L)
- value
- end
- #--------------------------------------------------------------------------
- # ○ 指定キー押下時にブザー音の再生
- #--------------------------------------------------------------------------
- def trigger_buzzer(input_symbol)
- trigger = false
- case input_symbol
- when :enter
- trigger = Input.trigger?(:C)
- when :direction
- trigger = [:RIGHT, :LEFT, :R, :L].any? {|key| Input.trigger?(key)}
- end
- Sound.play_buzzer if trigger
- end
- end
- #==============================================================================
- # ■ Scene_Battle
- #==============================================================================
- class Scene_Battle < Scene_Base
- @@called_debug = false # デバッグシーンから戻ってきたか
- #--------------------------------------------------------------------------
- # ○ デバッグシーンから戻ってきたか判定
- #--------------------------------------------------------------------------
- def returned_from_scene_debug?
- @@called_debug
- end
- #--------------------------------------------------------------------------
- # ◎ フレーム更新
- #--------------------------------------------------------------------------
- alias yknr_Scene_BattleExDebugScene_update :update
- def update
- yknr_Scene_BattleExDebugScene_update
- update_call_debug
- end
- #--------------------------------------------------------------------------
- # ◎ 戦闘開始
- #--------------------------------------------------------------------------
- alias yknr_Scene_BattleExDebugScene_battle_start :battle_start
- def battle_start
- if @@called_debug
- battle_start_from_debug
- else
- yknr_Scene_BattleExDebugScene_battle_start
- end
- end
- #--------------------------------------------------------------------------
- # ○ デバッグシーンから戻ってきたときの戦闘開始
- #--------------------------------------------------------------------------
- def battle_start_from_debug
- $game_party.on_battle_start
- $game_troop.on_battle_start
- start_party_command_selection
- @@called_debug = false
- end
- #--------------------------------------------------------------------------
- # ○ F9 キーによるデバッグ呼び出し判定
- #--------------------------------------------------------------------------
- def update_call_debug
- if enabled_call_scene_debug? && Input.press?(:F9)
- SceneManager.call(Scene_Debug)
- @@called_debug = true
- end
- end
- #--------------------------------------------------------------------------
- # ○ デバッグシーンが呼び出し可能か判定
- #--------------------------------------------------------------------------
- def enabled_call_scene_debug?
- return false if !$TEST
- return false if $game_troop.interpreter.running?
- return false if $game_message.visible
- return false if !BattleManager.inputting?
- return false if @skill_window.visible
- return false if @item_window.visible
- return false if @actor_window.visible
- return false if @enemy_window.visible
- return true
- end
- end
- #==============================================================================
- # ■ Scene_Debug
- #==============================================================================
- class Scene_Debug < Scene_MenuBase
- #--------------------------------------------------------------------------
- # ○ インクルード
- #--------------------------------------------------------------------------
- include YakiNori::BaseExModules::ExDebugData::Const
- #--------------------------------------------------------------------------
- # ● 開始処理
- #--------------------------------------------------------------------------
- def start
- super
- create_all_window
- end
- #--------------------------------------------------------------------------
- # ○ 全ウィンドウの作成
- #--------------------------------------------------------------------------
- def create_all_window
- create_category_window
- create_left_window
- create_right_window
- create_debug_help_window
- end
- #--------------------------------------------------------------------------
- # ○ カテゴリーウィンドウの作成
- #--------------------------------------------------------------------------
- def create_category_window
- @category_window = Window_DebugCategory.new
- @category_window.y = Graphics.height - @category_window.height
- @category_window.set_handler(:ok, method(:on_category_ok))
- @category_window.set_handler(:cancel, method(:return_scene))
- end
- #--------------------------------------------------------------------------
- # ◎ 左ウィンドウの作成
- #--------------------------------------------------------------------------
- alias yknr_Scene_DebugExDebugScene_create_left_window :create_left_window
- def create_left_window
- yknr_Scene_DebugExDebugScene_create_left_window
- @left_window.set_handler(:cancel, method(:on_left_cancel))
- @left_window.height = @category_window.y
- end
- #--------------------------------------------------------------------------
- # ◎ 右ウィンドウの作成
- #--------------------------------------------------------------------------
- alias yknr_Scene_DebugExDebugScene_create_right_window :create_right_window
- def create_right_window
- yknr_Scene_DebugExDebugScene_create_right_window
- @right_window.height = @category_window.y
- end
- #--------------------------------------------------------------------------
- # ◎ ヘルプウィンドウの作成
- #--------------------------------------------------------------------------
- alias yknr_Scene_DebugExDebugScene_c_d_h_w :create_debug_help_window
- def create_debug_help_window
- yknr_Scene_DebugExDebugScene_c_d_h_w
- cw = @category_window
- @debug_help_window.move(0, cw.y, cw.width, cw.height)
- @debug_help_window.create_contents
- @debug_help_window.hide
- end
- #--------------------------------------------------------------------------
- # ○ カテゴリー[決定]
- #--------------------------------------------------------------------------
- def on_category_ok
- @left_window.mode = @category_window.current_symbol
- @left_window.refresh
- @left_window.activate.select(0)
- @debug_help_window.show
- @category_window.hide
- end
- #--------------------------------------------------------------------------
- # ○ 左[キャンセル]
- #--------------------------------------------------------------------------
- def on_left_cancel
- @left_window.mode = nil
- @left_window.unselect
- @left_window.refresh
- @right_window.refresh
- @category_window.show.activate
- @debug_help_window.hide
- end
- #--------------------------------------------------------------------------
- # ● ヘルプ文字列の取得
- #--------------------------------------------------------------------------
- def help_text
- text = HelpDescription[@left_window.mode]
- text.nil? ? "not text" : text
- end
- #--------------------------------------------------------------------------
- # ○ 背景の作成
- #--------------------------------------------------------------------------
- def create_background
- end
- #--------------------------------------------------------------------------
- # ○ 背景の解放
- #--------------------------------------------------------------------------
- def dispose_background
- end
- end
- end # $YkNr_Scripts
复制代码
焼きノリ3- =begin
- #==============================================================================
- [名前] 拡張デバッグ機能_カスタマイズ
- [作者] 焼きノリ
- [配布元] まったりツクール雑貨 http://mata-tuku.ldblog.jp/
- #------------------------------------------------------------------------------
- [更新履歴]
- ・2012/09/10 公開
- ・2012/09/16 パーティ並び替えメソッド名に不備があり、エラーが出ていたので修正
- ・2012/09/19 レベル、経験値が変更できずエラーになっていたので修正
- ・2012/09/23 スキルの習得設定でエラーが出ていたので修正
- ・2014/06/07 各処理の改善
- #==============================================================================
- #------------------------------------------------------------------------------
- [対応]
- ・RGSS3のみ可能
- #------------------------------------------------------------------------------
- #------------------------------------------------------------------------------
- [機能]
- ・デバッグの項目の入れ替えなどのカスタマイズが可能できます。
- ・以下をデバッグで操作できるようにします。
- [マップ、変数、スイッチ、セルフスイッチ、
- アクター、トループ、アイテム、武器、防具、システム]
- #------------------------------------------------------------------------------
- #------------------------------------------------------------------------------
- [使用方法]
- ・拙作のスクリプト「拡張デバッグ機能_本体」が無いと動作しません。
- ・「拡張デバッグ機能_本体」のすぐ下に導入してください。
- #------------------------------------------------------------------------------
- #------------------------------------------------------------------------------
- [再定義箇所]
- ・Window_DebugRight の ex_draw_item, ex_update_debug, update_variable_mode
- #------------------------------------------------------------------------------
- [○ : 新規定義, ◎ : エイリアス定義, ● : 再定義]
- #------------------------------------------------------------------------------
- =end
- if $YkNr_Scripts[:ExDebugScene] && $TEST
- #==============================================================================
- # ■ ExDebugData
- #------------------------------------------------------------------------------
- # デバッグメニューのカテゴリ名とヘルプテキストを設定するモジュールです。
- #==============================================================================
- module YakiNori::BaseExModules::ExDebugData
- #==============================================================================
- # ■ 定数モジュール
- #==============================================================================
- module Const
- #==============================================================================
- # ▼ カスタマイズ
- #==============================================================================
- # 項目のシンボル値
- # ここのシンボル値を並び替えることで、
- # デバッグメニューの項目を並び替えることができます。
- CommandSymbol = [
- :map,
- :variable,
- :switch,
- :self_switch,
- :actor,
- :troop,
- :gold,
- :items,
- :weapons,
- :armors,
- :system,
- ]
- # 項目の名前
- CommandName = {
- :map => "マップ移動",
- :variable => "変数操作",
- :switch => "スイッチ操作",
- :self_switch => "セルフスイッチ操作",
- :actor => "アクター操作",
- :troop => "エネミー操作",
- :gold => "所持金操作",
- :items => "アイテム所持数操作",
- :weapons => "武器所持数操作",
- :armors => "防具所持数操作",
- :system => "システム操作",
- }
-
- # 値の設定のヘルプテキスト
- help_variable = "左右キー: 1 ずつ増減\n" + "LRキー: 10 ずつ増減\n" +
- "#{MultiplyRateInput}キー押下中:" + "それぞれの増加量を #{MultiplyRateNum} 倍"
- # [スイッチ / フラグ]の設定のヘルプテキスト
- help_switch = "決定キー: [ON / OFF] 切り替え"
- # 項目のヘルプテキスト
- HelpDescription = {
- :map => "行きたいマップを選択してください。\n" +
- "移動後の座標は、「イベントID:1」の上です。\n" +
- "イベントが存在しない場合は、マップの左上に移動します。",
- :variable => help_variable,
- :switch => help_switch,
- :self_switch => help_switch + "\n" +
- "左右キー: セルフスイッチの切り替え",
- :actor => help_variable + "\n" +
- "決定キー: 設定のオン/オフ(一部項目の選択時のみ)",
- :troop => help_variable + "\n" +
- "決定キー: 設定のオン/オフ(一部項目の選択時のみ)",
- :gold => "",
- :items => help_variable,
- :weapons => help_variable,
- :armors => help_variable,
- :system => help_switch,
- }
- # 職業変更時に経験値を引き継ぐか
- TransferEXP = true
- # パーティ参加時に自動的に並び替えを行うか
- AddPartyAutoSort = true
- # マップ移動後にシーンを終了するか
- ReturnSceneMovedMap = true
- #==============================================================================
- # ▲ カスタマイズここまで
- #==============================================================================
- # Actorクラスから呼び出すメソッド名のシンボル値
- ActorStatusSymbol = [
- :index, # 0
- :level, # 1
- :exp, # 2
- :hp, # 3
- :mp, # 4
- :tp, # 5
- :param_plus, # 6
- :class_id, # 7
- :states, # 8
- :skills, # 9
- ]
- # 表示する文字列
- ActorStatusString = {
- ActorStatusSymbol[0] => "PartyMember",
- ActorStatusSymbol[1] => "Level",
- ActorStatusSymbol[2] => "EXP",
- ActorStatusSymbol[3] => "HP",
- ActorStatusSymbol[4] => "MP",
- ActorStatusSymbol[5] => "TP",
- ActorStatusSymbol[6] => "AddParams",
- ActorStatusSymbol[7] => "Class",
- ActorStatusSymbol[8] => "States",
- ActorStatusSymbol[9] => "Skills",
- }
- # Enemyクラスから呼び出すメソッド名のシンボル値
- EnemyStatusSymbol = [
- :hp, # 0
- :mp, # 1
- :tp, # 2
- :states, # 3
- ]
- # 表示する文字列
- EnemyStatusString = {
- EnemyStatusSymbol[0] => "HP",
- EnemyStatusSymbol[1] => "MP",
- EnemyStatusSymbol[2] => "TP",
- EnemyStatusSymbol[3] => "States",
- }
- # Game_Systemクラスから呼び出すメソッド名のシンボル値
- SystemStatusSymbol = [
- :save_disabled, # 0
- :menu_disabled, # 1
- :encounter_disabled, # 2
- :formation_disabled, # 3
- ]
- # 表示する文字列
- SystemStatusString = {
- SystemStatusSymbol[0] => "セーブ禁止",
- SystemStatusSymbol[1] => "メニュー禁止",
- SystemStatusSymbol[2] => "エンカウント禁止",
- SystemStatusSymbol[3] => "並び替え禁止",
- }
- end
- YakiNori.freeze_all_constants(self) # 定数をフリーズ
- #==============================================================================
- # ■ 特異メソッド
- #==============================================================================
- #--------------------------------------------------------------------------
- # ○ 全マップのIDの配列を取得
- #--------------------------------------------------------------------------
- def self.all_map_id
- _result = [0]
- _tgt_id = 1
- _hit_data_cnt = 0
- while _hit_data_cnt < $data_mapinfos.size
- map_path = sprintf("Data/Map%03d.rvdata2", _tgt_id)
- # テスト用なので、ファイルの存在さえ取得できればよい
- if FileTest.exist?(map_path) && FileTest.file?(map_path)
- _result.push(_tgt_id)
- _hit_data_cnt += 1 # ヒットカウントの加算
- end
- _tgt_id += 1 # 次のマップID
- end
- _result.compact!
- _result.sort! { |a, b| a <=> b }
- _result
- end
- #--------------------------------------------------------------------------
- # ○ マップ移動処理
- #--------------------------------------------------------------------------
- def self.execute_move_map(map_id)
- new_x = 0
- new_y = 0
- map_data = load_data(sprintf("Data/Map%03d.rvdata2", map_id))
- event = map_data.events[1]
- if !event.nil?
- new_x = event.x
- new_y = event.y
- end
- $game_player.reserve_transfer(map_id, new_x, new_y)
- $game_player.perform_transfer
- SceneManager.return if Const::ReturnSceneMovedMap
- end
- #--------------------------------------------------------------------------
- # ○ パーティの並び替え(アクターID順)
- #--------------------------------------------------------------------------
- def self.sort_party_by_id
- if $game_party.members.size > 1
- swaped = true
- while swaped
- swaped = false
- $game_party.members.each_index do |this_idx|
- next_idx = this_idx + 1
- this_actor = $game_party.members[this_idx]
- next_actor = $game_party.members[next_idx]
- if this_actor.id > next_actor.id
- $game_party.swap_order(this_idx, next_idx)
- swaped = true
- end
- break if next_idx == $game_party.members.size - 1
- end
- end
- end
- end
- #--------------------------------------------------------------------------
- # ○ アクターモード時のレベル項目の更新
- #--------------------------------------------------------------------------
- def self.update_status_mode_level(actor, value)
- actor.change_level(value, false)
- actor.init_exp
- actor.class.learnings.each do |learning|
- if learning.level <= actor.level
- actor.learn_skill(learning.skill_id)
- elsif learning.level > actor.level
- actor.forget_skill(learning.skill_id)
- end
- end
- end
- #--------------------------------------------------------------------------
- # ○ アクターモード時の経験値項目の更新
- #--------------------------------------------------------------------------
- def self.update_status_mode_exp(actor, value)
- actor.change_exp(value, false)
- end
- end
- #==============================================================================
- # ■ Window_DebugCategory
- #==============================================================================
- class Window_DebugCategory < Window_Command
- #--------------------------------------------------------------------------
- # ● コマンドが有効状態か判定
- #--------------------------------------------------------------------------
- def enabled_command(symbol)
- case symbol
- when :map
- return !$game_party.in_battle
- when :self_switch
- return !$game_party.in_battle && !$game_map.events.empty?
- when :troop
- return $game_party.in_battle
- else
- return true
- end
- end
- end
- #==============================================================================
- # ■ Window_DebugLeft
- #==============================================================================
- class Window_DebugLeft < Window_Selectable
- #--------------------------------------------------------------------------
- # ◎ 拡張用:項目数の取得
- #--------------------------------------------------------------------------
- alias yknr_Window_DebugLeftExDebugCstmScene_ex_item_max :ex_item_max
- def ex_item_max
- case @mode
- when :map
- return $BTEST ? 1 : ($data_mapinfos.size + 9) / 10
- when :variable
- return ($data_system.variables.size - 1 + 9) / 10
- when :switch
- return ($data_system.switches.size - 1 + 9) / 10
- when :self_switch
- return ($game_map.events.size + 9) / 10
- when :actor
- return $data_actors.size - 1
- when :troop
- return $game_troop.members.size
- when :items
- return ($data_items.size - 1 + 9) / 10
- when :weapons
- return ($data_weapons.size - 1 + 9) / 10
- when :armors
- return ($data_armors.size - 1 + 9) / 10
- when :system
- return 1
- else
- yknr_Window_DebugLeftExDebugCstmScene_ex_item_max
- end
- end
- #--------------------------------------------------------------------------
- # ◎ 拡張用:項目の描画の内容を取得
- #--------------------------------------------------------------------------
- alias yknr_Window_DebugLeftExDebugCstmScene_ex_draw_item :ex_draw_item
- def ex_draw_item(index)
- n = index * 10
- case @mode
- when :map
- return sprintf("[%04d-%04d]", n+1, n+10)
- when :variable
- return sprintf("[%04d-%04d]", n+1, n+10)
- when :switch
- return sprintf("[%04d-%04d]", n+1, n+10)
- when :self_switch
- return sprintf("[%04d-%04d]", n+1, n+10)
- when :actor
- return sprintf("[%02d]#{$game_actors[index + 1].name}", index + 1)
- when :troop
- return sprintf("[%02d]#{$game_troop.members[index].name}", index+ 1)
- when :items
- return sprintf("[%04d-%04d]", n+1, n+10)
- when :weapons
- return sprintf("[%04d-%04d]", n+1, n+10)
- when :armors
- return sprintf("[%04d-%04d]", n+1, n+10)
- when :system
- return "Systems"
- else
- yknr_Window_DebugLeftExDebugCstmScene_ex_draw_item
- end
- end
- end
- #==============================================================================
- # ■ Window_DebugRight
- #==============================================================================
- class Window_DebugRight < Window_Selectable
- #--------------------------------------------------------------------------
- # ◎ オブジェクト初期化
- #--------------------------------------------------------------------------
- alias yknr_Window_DebugRightExDebugCstmScene_initialize :initialize
- def initialize(x, y, width)
- @self_index = "A"
- @all_maps_id = $BTEST ? [] : ExDebugData.all_map_id
- @details_window = nil
- yknr_Window_DebugRightExDebugCstmScene_initialize(x, y, width)
- end
- #--------------------------------------------------------------------------
- # ● 拡張用:項目の描画の内容を取得
- #--------------------------------------------------------------------------
- def ex_draw_item(index, data_id)
- name = nil
- status = ""
- case @mode
- when :map
- map_id = @all_maps_id[data_id]
- name = map_id.nil? ? nil :
- $data_mapinfos[map_id].nil? ? nil : $data_mapinfos[map_id].name
- status = map_id.nil? ? "" :
- $data_mapinfos[map_id].nil? ? "" : sprintf("ID[%03d]", map_id)
- when :variable
- name = $data_system.variables[data_id]
- status = $game_variables[data_id]
- when :switch
- name = $data_system.switches[data_id]
- status = SwitchString[$game_switches[data_id]]
- when :self_switch
- event = $game_map.events[data_id]
- params = [$game_map.map_id, data_id, @self_index]
- name = event.nil? ? nil : event.name
- status = @self_index + SwitchString[$game_self_switches[params]]
- when :actor
- symbol = ActorStatusSymbol[index]
- name = ActorStatusString[symbol]
- actor = $game_actors[(data_id - index) / 10 + 1]
- if !actor.nil? && !name.nil?
- if [:exp].include?(symbol)
- status = (actor.exp - actor.current_level_exp).to_s + " / "
- status += (actor.next_level_exp - actor.current_level_exp).to_s
- elsif [:class_id, :states, :skills, :param_plus].include?(symbol)
- status = "Enter to Details"
- elsif [:index].include?(symbol)
- status = SwitchString[$game_party.members.include?(actor)]
- elsif [:hp, :mp, :tp, :level].include?(symbol)
- status = actor.send(symbol).to_s + " / "
- status += actor.send("m" + symbol.to_s).to_s if [:hp, :mp].include?(symbol)
- status += "100" if symbol == :tp
- status += actor.max_level.to_s if symbol == :level
- end
- end
- when :troop
- symbol = EnemyStatusSymbol[index]
- name = EnemyStatusString[symbol]
- enemy = $game_troop.members[(data_id - index) / 10]
- if !enemy.nil? && !name.nil?
- if [:states].include?(symbol)
- status = "Enter to Details"
- elsif [:hp, :mp, :tp].include?(symbol)
- status = enemy.send(symbol).to_s + " / "
- status += enemy.send("m" + symbol.to_s).to_s if [:hp, :mp].include?(symbol)
- status += "100" if symbol == :tp
- end
- end
- when :items
- name = $data_items[data_id].nil? ? nil : $data_items[data_id].name
- status = $game_party.item_number($data_items[data_id])
- when :weapons
- name = $data_weapons[data_id].nil? ? nil : $data_weapons[data_id].name
- status = $game_party.item_number($data_weapons[data_id])
- when :armors
- name = $data_armors[data_id].nil? ? nil : $data_armors[data_id].name
- status = $game_party.item_number($data_armors[data_id])
- when :system
- symbol = SystemStatusSymbol[data_id]
- name = SystemStatusString[symbol]
- status = symbol.nil? ? "" : SwitchString[$game_system.send(symbol)]
- end
- return {:name => name, :status => status}
- end
- #--------------------------------------------------------------------------
- # ● 拡張用:モード別にフレーム更新
- #--------------------------------------------------------------------------
- def ex_update_debug
- case @mode
- when :map
- update_map_mode
- when :variable
- update_variable_mode
- when :switch
- update_switch_mode
- when :self_switch
- update_self_switch_mode
- when :actor
- update_actor_mode
- when :troop
- update_troop_mode
- when :items
- update_items_mode($data_items)
- when :weapons
- update_items_mode($data_weapons)
- when :armors
- update_items_mode($data_armors)
- when :system
- update_system_mode
- end
- end
- #--------------------------------------------------------------------------
- # ◎ スイッチモード時の更新
- #--------------------------------------------------------------------------
- alias yknr_Window_DebugRightExDebugCstmScene_u_s_m :update_switch_mode
- def update_switch_mode
- if current_id >= $data_system.switches.size
- trigger_buzzer(:enter)
- else
- yknr_Window_DebugRightExDebugCstmScene_u_s_m
- end
- end
- #--------------------------------------------------------------------------
- # ● 変数モード時の更新
- #--------------------------------------------------------------------------
- def update_variable_mode
- return unless $game_variables[current_id].is_a?(Numeric)
- if current_id >= $data_system.variables.size
- trigger_buzzer(:direction)
- else
- value = update_value_input($game_variables[current_id])
- if $game_variables[current_id] != value
- $game_variables[current_id] = value
- Sound.play_cursor
- redraw_current_item
- end
- end
- end
- #--------------------------------------------------------------------------
- # ○ セルフスイッチモード時の更新
- #--------------------------------------------------------------------------
- def update_self_switch_mode
- if current_id > $game_map.events.size
- trigger_buzzer(:enter)
- else
- params = [$game_map.map_id, current_id, @self_index]
- next_self_switch = {"A" => "B", "B" => "C", "C" => "D", "D" => "A"}
- if Input.trigger?(:C)
- Sound.play_ok
- $game_self_switches[params] = !$game_self_switches[params]
- redraw_current_item
- else
- value = @self_index
- value = next_self_switch[value] if Input.repeat?(:RIGHT)
- value = next_self_switch.index(value) if Input.repeat?(:LEFT)
- if @self_index != value
- @self_index = value
- Sound.play_cursor
- refresh
- end
- end
- end
- end
- #--------------------------------------------------------------------------
- # ○ マップモード時の更新
- #--------------------------------------------------------------------------
- def update_map_mode
- if current_id > ($BTEST ? 0 : $data_mapinfos.size)
- trigger_buzzer(:enter)
- else
- if Input.trigger?(:C)
- Sound.play_load
- map_id = @all_maps_id[current_id]
- ExDebugData.execute_move_map(map_id)
- end
- end
- end
- #--------------------------------------------------------------------------
- # ○ アクターモード時の更新
- #--------------------------------------------------------------------------
- def update_actor_mode
- actor_id = current_id / 10 + 1
- if index >= ActorStatusString.size
- trigger_buzzer(:enter)
- else
- actor = $game_actors[actor_id]
- symbol = ActorStatusSymbol[index]
- if actor.respond_to?(symbol)
- if [:class_id, :states, :skills,:param_plus].include?(symbol)
- update_battler_setup_details(actor, symbol)
- elsif [:index].include?(symbol)
- if Input.trigger?(:C)
- Sound.play_ok
- if $game_party.members.include?(actor)
- $game_party.remove_actor(actor_id)
- else
- $game_party.add_actor(actor_id)
- ExDebugData.sort_party_by_id if AddPartyAutoSort
- end
- redraw_current_item
- end
- else
- update_battler_value(actor, symbol)
- end
- end
- end
- end
- #--------------------------------------------------------------------------
- # ○ トループモード時の更新
- #--------------------------------------------------------------------------
- def update_troop_mode
- enemy_index = current_id / 10
- if index >= EnemyStatusString.size
- trigger_buzzer(:enter)
- else
- enemy = $game_troop.members[enemy_index]
- symbol = EnemyStatusSymbol[index]
- if enemy.respond_to?(symbol)
- if [:states].include?(symbol)
- update_battler_setup_details(enemy, symbol)
- else
- update_battler_value(enemy, symbol)
- end
- end
- end
- end
- #--------------------------------------------------------------------------
- # ○ アイテムモード時の更新
- #--------------------------------------------------------------------------
- def update_items_mode(data)
- if current_id >= data.size
- trigger_buzzer(:direction)
- else
- last_num = $game_party.item_number(data[current_id])
- value = update_value_input(last_num)
- if last_num != value
- $game_party.gain_item(data[current_id], value - last_num)
- Sound.play_cursor
- redraw_current_item
- end
- end
- end
- #--------------------------------------------------------------------------
- # ○ システムモード時の更新
- #--------------------------------------------------------------------------
- def update_system_mode
- if current_id >= SystemStatusSymbol.size
- trigger_buzzer(:enter)
- else
- if Input.trigger?(:C)
- Sound.play_ok
- symbol = SystemStatusSymbol[current_id]
- $game_system.send(symbol.to_s + "=", !$game_system.send(symbol))
- redraw_current_item
- end
- end
- end
- #--------------------------------------------------------------------------
- # ○ アクター,トループモード時の共通処理:値の更新
- #--------------------------------------------------------------------------
- def update_battler_value(battler, symbol)
- value = update_value_input(battler.send(symbol))
- if battler.send(symbol) != value
- if [:level, :exp].include?(symbol)
- ExDebugData.send("update_status_mode_#{symbol}", battler, value)
- Sound.play_cursor
- refresh
- else
- battler.send(symbol.to_s + "=", value)
- Sound.play_cursor
- redraw_current_item
- end
- end
- end
- #--------------------------------------------------------------------------
- # ○ アクター,トループモード時の共通処理:詳細ウィンドウのセットアップ
- #--------------------------------------------------------------------------
- def update_battler_setup_details(battler, symbol)
- if Input.trigger?(:C)
- Sound.play_ok
- @details_window.setup(symbol, battler)
- deactivate
- end
- end
- #--------------------------------------------------------------------------
- # ○ 詳細ウィンドウの設定
- #-------------------------------------------------------------------------
- def details_window=(details_window)
- @details_window = details_window
- end
- end
- #==============================================================================
- # ■ Window_DebugDetails
- #------------------------------------------------------------------------------
- # デバッグメニューのパラメータの詳細を表示します。
- # アクター項目、トループ項目で使用されます。
- #==============================================================================
- class Window_DebugDetails < Window_Selectable
- #--------------------------------------------------------------------------
- # ○ インクルード
- #--------------------------------------------------------------------------
- include YakiNori::BaseExModules::ExDebugData::Const
- #--------------------------------------------------------------------------
- # ○ オブジェクト初期化
- #-------------------------------------------------------------------------
- def initialize
- super(0, 0, Graphics.width, fitting_height(visible_line_number))
- deactivate
- self.openness = 0
- self.back_opacity += 32 if RGSS[3]
- @mode = nil
- @battler = nil
- @data_class_id = 0
- @data_add_params = []
- @data_states_id = []
- @data_skills_id = []
- select(0)
- refresh
- end
- #--------------------------------------------------------------------------
- # ○ 表示行数の取得
- #--------------------------------------------------------------------------
- def visible_line_number
- [(item_max / col_max.to_f).ceil, 10.35].min
- end
- #--------------------------------------------------------------------------
- # ○ 項目数の取得
- #--------------------------------------------------------------------------
- def item_max
- case @mode
- when :class_id
- $data_classes.size - 1
- when :states
- $data_states.size - 1
- when :skills
- $data_skills.size - 1
- when :param_plus
- $data_system.terms.params.size
- else
- return 1
- end
- end
- #--------------------------------------------------------------------------
- # ○ 桁数の取得
- #--------------------------------------------------------------------------
- def col_max
- return @mode == :param_plus ? 1 : 3
- end
- #--------------------------------------------------------------------------
- # ○ 横に項目が並ぶときの空白の幅を取得
- #--------------------------------------------------------------------------
- def spacing
- return 8
- end
- #--------------------------------------------------------------------------
- # ○ 決定処理の有効状態を取得
- #--------------------------------------------------------------------------
- def ok_enabled?
- @mode != :param_plus && !@mode.nil?
- end
- #--------------------------------------------------------------------------
- # ○ 決定ボタンが押されたときの処理
- #--------------------------------------------------------------------------
- def process_ok
- case @mode
- when :class_id
- if @data_class_id != current_class_id
- last_class_id = @data_class_id
- @data_class_id = current_class_id
- redraw_item(last_class_id - 1)
- end
- when :states
- if @data_states_id.include?(current_state_id)
- @data_states_id.delete(current_state_id)
- else
- @data_states_id.push(current_state_id)
- end
- when :skills
- if @data_skills_id.include?(current_skill_id)
- @data_skills_id.delete(current_skill_id)
- else
- @data_skills_id.push(current_skill_id)
- end
- end
- redraw_item(index)
-
- Sound.play_ok
- Input.update
- call_ok_handler
- end
- #--------------------------------------------------------------------------
- # ○ キャンセルボタンが押されたときの処理
- #--------------------------------------------------------------------------
- def process_cancel
- case @mode
- when :class_id
- if @battler.class_id != @data_class_id
- @battler.change_class(@data_class_id, TransferEXP)
- end
- when :states
- states_id = @battler.states.collect {|state| state.id}
- if states_id.sort != @data_states_id.sort
- @battler.clear_states
- @data_states_id.each {|state_id| @battler.add_state(state_id)}
- end
- when :skills
- skills_id = @battler.skills.collect {|skill| skill.id}
- if skills_id.sort != @data_skills_id.sort
- @battler.skills.each {|skill| @battler.forget_skill(skill.id)}
- @data_skills_id.each {|skill_id| @battler.learn_skill(skill_id)}
- end
- when :param_plus
- params = get_add_params_data(@battler)
- if params != @data_add_params
- @data_add_params.each_with_index do |value, id|
- @battler.add_param(id, value - params[id])
- end
- end
- end
- super
- end
- #--------------------------------------------------------------------------
- # ○ 項目の描画
- #--------------------------------------------------------------------------
- def draw_item(index)
- return if @mode.nil?
- rect = item_rect_for_text(index)
- data_index = index + 1
- text = ""
- enabled = true
- case @mode
- when :class_id
- enabled = @data_class_id == data_index
- text = $data_classes[data_index].name
- when :states
- enabled = @data_states_id.include?(data_index)
- draw_icon($data_states[data_index].icon_index, rect.x, rect.y, enabled)
- rect.x += 24
- rect.width -= 24
- text = $data_states[data_index].name
- when :skills
- enabled = @data_skills_id.include?(data_index)
- draw_icon($data_skills[data_index].icon_index, rect.x, rect.y, enabled)
- rect.x += 24
- rect.width -= 24
- text = $data_skills[data_index].name
- when :param_plus
- return if @battler.nil?
-
- text = $data_system.terms.params[index]
- text += " " while text.size < 6
- base = @battler.param_base(index)
- equip = @battler.equips.compact.inject(0) {|r, v| r += v.params[index] }
- add = @data_add_params[index]
- total = [base + equip + add, @battler.param_min(index)].max
- total = [total, @battler.param_max(index)].min
- text += total.to_s
- text += " = base:" + base.to_s
- text += " + equip:" + equip.to_s
- text += " + grow:" + add.to_s
- end
- change_color(normal_color, enabled)
- draw_text(rect, text)
- end
- #--------------------------------------------------------------------------
- # ○ 選択中 ID の取得
- #--------------------------------------------------------------------------
- def current_id
- index + 1
- end
- #--------------------------------------------------------------------------
- # ○ 選択中 ステートID の取得
- #--------------------------------------------------------------------------
- def current_state_id
- $data_states[current_id].id
- end
- #--------------------------------------------------------------------------
- # ○ 選択中 職業ID の取得
- #--------------------------------------------------------------------------
- def current_class_id
- $data_classes[current_id].id
- end
- #--------------------------------------------------------------------------
- # ○ 選択中スキルID の取得
- #--------------------------------------------------------------------------
- def current_skill_id
- $data_skills[current_id].id
- end
- #--------------------------------------------------------------------------
- # ○ フレーム更新
- #--------------------------------------------------------------------------
- def update
- super
- update_input_reset
- update_input_param if @mode == :param_plus
- end
- #--------------------------------------------------------------------------
- # ○ 加算能力値の更新
- #--------------------------------------------------------------------------
- def update_input_reset
- if Input.trigger?(:X)
- Sound.play_cancel
- reset_data(@battler)
- end
- end
- #--------------------------------------------------------------------------
- # ○ 加算能力値の更新
- #--------------------------------------------------------------------------
- def update_input_param
- add = 0
- rate = Input.press?(MultiplyRateInput) ? MultiplyRateNum : 1
- add += 1 * rate if Input.repeat?(:RIGHT)
- add -= 1 * rate if Input.repeat?(:LEFT)
- add += 10 * rate if Input.repeat?(:R)
- add -= 10 * rate if Input.repeat?(:L)
- if !add.zero?
- Sound.play_cursor
- @data_add_params[index] += add
- redraw_item(index)
- end
- end
- #--------------------------------------------------------------------------
- # ○ セットアップ
- #--------------------------------------------------------------------------
- def setup(mode, battler)
- @mode = mode
- self.height = fitting_height(visible_line_number)
- create_contents
- reset_data(battler)
- select(0)
- show.activate.open
- end
- #--------------------------------------------------------------------------
- # ○ 編集データのリセット
- #--------------------------------------------------------------------------
- def reset_data(battler)
- actor_data(battler) if battler.is_a?(Game_Actor)
- enemy_data(battler) if battler.is_a?(Game_Enemy)
- refresh
- end
- #--------------------------------------------------------------------------
- # ○ アクターの設定
- #--------------------------------------------------------------------------
- def actor_data(actor)
- @battler = actor
- @data_class_id = actor ? actor.class_id : 0
- @data_states_id = actor ? actor.states.collect {|state| state.id} : []
- @data_skills_id = actor ? actor.skills.collect {|skill| skill.id} : []
- @data_add_params = get_add_params_data(actor) if actor
- end
- #--------------------------------------------------------------------------
- # ○ エネミーの設定
- #--------------------------------------------------------------------------
- def enemy_data(enemy)
- @battler = enemy
- @data_class_id = 0
- @data_states_id = enemy ? enemy.states.collect {|state| state.id} : []
- @data_skills_id = []
- @data_add_params = get_add_params_data(enemy) if enemy
- end
- #--------------------------------------------------------------------------
- # ○ 通常能力値の加算値の取得
- #--------------------------------------------------------------------------
- def get_add_params_data(battler)
- prms = $data_system.terms.params
- equips = battler.equips.compact
- prms.collect do |prm|
- param_id = prms.index(prm)
- equip_param = equips.inject(0) {|r, item| r += item.params[param_id] }
- battler.param_plus(param_id) - equip_param
- end
- end
- end
- #==============================================================================
- # ■ Window_DebugNumber
- #------------------------------------------------------------------------------
- # デバッグメニューでの値の表示,設定をします。
- #==============================================================================
- class Window_DebugNumber < Window_NumberInput
- #--------------------------------------------------------------------------
- # ○ オブジェクト初期化
- #--------------------------------------------------------------------------
- def initialize
- super(nil)
- @category_window = nil
- @process_ok_method = nil
- @process_cancel_method = nil
- end
- #--------------------------------------------------------------------------
- # ○ 入力処理の開始
- #--------------------------------------------------------------------------
- def start(number, max_number)
- @digits_max = max_number.to_s.size
- @number = number
- @number = [[@number, 0].max, 10 ** @digits_max - 1].min
- @index = 0
- update_placement
- create_contents
- refresh
- activate.open
- end
- #--------------------------------------------------------------------------
- # ○ ウィンドウ位置の更新
- #--------------------------------------------------------------------------
- def update_placement
- self.width = @digits_max * 20 + padding * 2
- self.height = fitting_height(1)
- self.x = Graphics.width - width
- self.y = @category_window.y - height
- end
- #--------------------------------------------------------------------------
- # ○ 決定ボタンが押されたときの処理
- #--------------------------------------------------------------------------
- def process_ok
- Sound.play_ok
- @process_ok_method.call(@number) if @process_ok_method
- end
- #--------------------------------------------------------------------------
- # ○ キャンセルボタンが押されたときの処理
- #--------------------------------------------------------------------------
- def process_cancel
- Sound.play_cancel
- @process_cancel_method.call(@number) if @process_ok_method
- end
- #--------------------------------------------------------------------------
- # ○ カテゴリーウィンドウの設定
- #--------------------------------------------------------------------------
- def category_window=(window)
- @category_window = window
- end
- #--------------------------------------------------------------------------
- # ○ 決定ボタンが押されたときに実行するメソッドの設定
- #--------------------------------------------------------------------------
- def set_process_ok_method=(method)
- @process_ok_method = method
- end
- #--------------------------------------------------------------------------
- # ○ キャンセルボタンが押されたときに実行するメソッドの設定
- #--------------------------------------------------------------------------
- def set_process_cancel_method=(method)
- @process_cancel_method = method
- end
- end
- #==============================================================================
- # ■ Scene_Debug
- #==============================================================================
- class Scene_Debug < Scene_MenuBase
- #--------------------------------------------------------------------------
- # ◎ 全ウィンドウの作成
- #--------------------------------------------------------------------------
- alias yknr_Scene_DebugExDebugCstmScene_create_all_window :create_all_window
- def create_all_window
- yknr_Scene_DebugExDebugCstmScene_create_all_window
- create_details_window
- create_number_window
- end
- #--------------------------------------------------------------------------
- # ○ 詳細ウィンドウの作成
- #--------------------------------------------------------------------------
- def create_details_window
- @details_window = Window_DebugDetails.new
- @details_window.set_handler(:cancel, method(:on_states_cancel))
- @right_window.details_window = @details_window
- end
- #--------------------------------------------------------------------------
- # ○ 値操作ウィンドウの作成
- #--------------------------------------------------------------------------
- def create_number_window
- @number_window = Window_DebugNumber.new
- @number_window.set_process_ok_method = method(:on_number_ok)
- @number_window.set_process_cancel_method = method(:on_number_cancel)
- @number_window.category_window = @category_window
- end
- #--------------------------------------------------------------------------
- # ○ 詳細[キャンセル]
- #--------------------------------------------------------------------------
- def on_states_cancel
- @details_window.deactivate.close
- @right_window.refresh
- @right_window.activate
- end
- #--------------------------------------------------------------------------
- # ○ 値操作[決定]
- #--------------------------------------------------------------------------
- def on_number_ok(number)
- case @category_window.current_symbol
- when :gold
- $game_party.gain_gold(number - $game_party.gold)
- end
- @category_window.activate
- @number_window.deactivate.close
- end
- #--------------------------------------------------------------------------
- # ○ 値操作[キャンセル]
- #--------------------------------------------------------------------------
- def on_number_cancel(number)
- @category_window.activate
- @number_window.deactivate.close
- end
- #--------------------------------------------------------------------------
- # ◎ カテゴリー[決定]
- #--------------------------------------------------------------------------
- alias yknr_Scene_DebugExDebugCstmScene_on_category_ok :on_category_ok
- def on_category_ok
- case @category_window.current_symbol
- when :gold
- @category_window.deactivate
- @number_window.start($game_party.gold, $game_party.max_gold)
- else
- yknr_Scene_DebugExDebugCstmScene_on_category_ok
- end
- end
- end
- end # $YkNr_Scripts
复制代码
Code Crush- #==============================================================================
- # ■ VXAce-RGSS-44 デバッグ++ [Ver.1.1.0] by Claimh
- #------------------------------------------------------------------------------
- =begin
- デバッグ画面の機能拡張をします。
- [追加機能]
- ・セルフスイッチの操作(現在マップ上の全イベント)
- ・アイテム/武器/防具の所持数変更
- ・パーティー変更
- ・アクター編集
- - ステータス編集
- - スキルの習得・忘却
- ・マップ移動(移動地点の指定も可能)
- ・音楽再生(BGM/BGS/ME/SE)
- ・その他情報操作
- - 所持金、セーブ回数、戦闘回数の変更
- - セーブ禁止、メニュー禁止、エンカウント禁止、並び替え禁止の操作
- - 天候の操作
- - 解像度の変更
- [他スクリプトとの連動機能]
- ・熟練度システム
- - 熟練度レベル変更、得意属性・不得意属性の操作
- ・用語辞典
- - 全初期化、表示設定変更
- ・ワールドマップ
- - 全初期化、表示設定変更
- ・クエストシステム
- - 全初期化、クエスト状態変更、クエストランク変更
- ・精霊システム
- - 精霊の加入状態の変更、精霊のステータス編集
- =end
- #==============================================================================
- module DebugPP
- # 項目有効/無効
- SPEC = {
- "スイッチ" => true,
- "変数" => true,
- "セルフSW" => true,
- "アイテム" => true,
- "武器" => true,
- "防具" => true,
- "パーティー" => true,
- "ステータス" => true,
- "スキル" => true,
- "MAP移動" => true,
- "ミュージック" => true,
- "システム" => true,
- "熟練度" => true, # 「熟練度システム」未導入時は無効化される
- "用語辞典" => true, # 「用語辞典」未導入時は無効化される
- "WorldMap" => true, # 「ワールドマップ」未導入時は無効化される
- "クエスト" => true, # 「クエストシステム」未導入時は無効化される
- "精霊" => true, # 「精霊システム」未導入時は無効化される
- }
- # MAP移動時の位置(設定無し時は中央)
- MAP = {
- # マップID => [x座標, y座標]
- 1 => [5, 5],
- 3 => [10, 5]
- }
- # ミュージックでRTPも含む
- RTP_MUSIC = true
- end
- module DebugPP
- # DebugPP.spec(n)
- def self.spec(n)
- return false if SPEC[n].nil?
- SPEC[n]
- end
- end
- class Game_System
- #--------------------------------------------------------------------------
- # ● 公開インスタンス変数
- #--------------------------------------------------------------------------
- attr_writer :save_count # セーブ回数
- end
- #==============================================================================
- # ■ Window_DebugCommand
- #==============================================================================
- class Window_DebugCommand < Window_Command
- #--------------------------------------------------------------------------
- # ● オブジェクト初期化
- #--------------------------------------------------------------------------
- def initialize(height)
- @window_height = height
- super(0, 0)
- end
- #--------------------------------------------------------------------------
- # ● ウィンドウ高さの取得
- #--------------------------------------------------------------------------
- def window_height
- h = super
- h > @window_height ? @window_height : h
- end
- #--------------------------------------------------------------------------
- # ● 表示行数の取得
- #--------------------------------------------------------------------------
- def visible_line_number
- n = (@window_height - standard_padding * 2) / item_height
- n > item_max ? item_max : n
- end
- #--------------------------------------------------------------------------
- # ● コマンドリストの作成
- #--------------------------------------------------------------------------
- def make_command_list
- add_main_commands
- add_original_commands
- add_command("システム", :ok, true, system_text) if DebugPP.spec("システム")
- end
- #--------------------------------------------------------------------------
- # ● 主要コマンドをリストに追加
- # ハンドラは全て:okで登録する
- #--------------------------------------------------------------------------
- def add_main_commands
- add_command("スイッチ", :ok, true, switch_text) if DebugPP.spec("スイッチ")
- add_command("変数", :ok, true, variable_text) if DebugPP.spec("変数")
- add_command("セルフSW", :ok, true, self_sw_text) if DebugPP.spec("セルフSW")
- add_command(Vocab::item, :ok, true, item_text) if DebugPP.spec("アイテム")
- add_command(Vocab::weapon, :ok, true, weapon_text) if DebugPP.spec("武器")
- add_command(Vocab::armor, :ok, true, armor_text) if DebugPP.spec("防具")
- add_command("パーティー", :ok, true, party_text) if DebugPP.spec("パーティー")
- add_command(Vocab::status, :ok, true, actor_text) if DebugPP.spec("ステータス")
- add_command(Vocab::skill, :ok, true, skill_text) if DebugPP.spec("スキル")
- add_command("MAP移動", :ok, true, map_text) if DebugPP.spec("MAP移動")
- add_command("ミュージック", :ok, true, music_text) if DebugPP.spec("ミュージック")
- end
- #--------------------------------------------------------------------------
- # ● 独自コマンドの追加用
- #--------------------------------------------------------------------------
- def add_original_commands
- add_command("熟練度", :ok, true, expert_text) if defined?(SysUpdate) and DebugPP.spec("熟練度")
- add_command("用語辞典", :ok, true, dictionary_text) if defined?(Dictionary) and DebugPP.spec("用語辞典")
- add_command("World Map", :ok, true, world_map_text) if defined?(WorldMap) and DebugPP.spec("WorldMap")
- add_command("クエスト", :ok, true, quest_text) if defined?(Quest) and DebugPP.spec("クエスト")
- add_command("精霊", :ok, true, spirit_text) if defined?(Spirits) and DebugPP.spec("精霊")
- end
- #--------------------------------------------------------------------------
- # ● 説明文
- #--------------------------------------------------------------------------
- def switch_text
- ["スイッチの状態を変更します。", "C (Enter) : ON / OFF"]
- end
- def variable_text
- ["変数の値を変更します。", "↑ : +1 / ↓ : +1 / ⇔ 桁移動"]
- end
- def self_sw_text
- ["セルフスイッチの状態を変更します。", "C (Enter) : ON / OFF"]
- end
- def item_text
- ["アイテムの所持数を変更します。", "↑ : +1 / ↓ : +1 / ⇔ 桁移動"]
- end
- def weapon_text
- ["武器の所持数を変更します。", "↑ : +1 / ↓ : +1 / ⇔ 桁移動"]
- end
- def armor_text
- ["防具の所持数を変更します。", "↑ : +1 / ↓ : +1 / ⇔ 桁移動"]
- end
- def party_text
- ["加入メンバーを変更します。", "C (Enter) : 加入 / 脱退"]
- end
- def actor_text
- ["アクターのステータスを変更します。", "↑ : +1 / ↓ : +1 / ⇔ 桁移動"]
- end
- def skill_text
- ["アクターの習得スキルを変更します。", "C (Enter) : 習得 / 忘却"]
- end
- def map_text
- ["マップを移動します。", "C (Enter) : 移動"]
- end
- def music_text
- ["音楽を変更します。", "C (Enter) : 再生 / Y : 停止 / X : MAP音復帰"]
- end
- def system_text
- ["その他、色々変更します。", "C (Enter) : 変更"]
- end
- #--------------------------------------------------------------------------
- # ● 説明文(拡張)
- #--------------------------------------------------------------------------
- def expert_text
- ["アクターの熟練度を変更します。", "↑ : +1 / ↓ : +1 / ⇔ 桁移動 / X : 好み変更"]
- end
- def dictionary_text
- ["用語の表示状態を変更します。", "C (Enter) : ON / OFF"]
- end
- def world_map_text
- ["場所の表示状態を変更します。", "X : Region / C (Enter) : Town --> ON / OFF"]
- end
- def quest_text
- ["クエストの状態を変更します。", "C (Enter) : 変更"]
- end
- def spirit_text
- ["精霊の加入状態を変更します。", "C (Enter) : 加入 / 脱退"]
- end
- #--------------------------------------------------------------------------
- # ● ヘルプウィンドウの更新
- #--------------------------------------------------------------------------
- def update_help
- call_handler(:update)
- ext = current_ext
- text = ext.nil? ? "" : (ext[0] + "\n" + ext[1])
- @help_window.set_text(text)
- end
- end
- #==============================================================================
- # ■ Window_DebugInputNum
- #==============================================================================
- class Window_DebugInputNum < Window_HorzCommand
- #--------------------------------------------------------------------------
- # ● 公開インスタンス変数
- #--------------------------------------------------------------------------
- attr_reader :item_window
- attr_accessor :max
- attr_accessor :min
- attr_accessor :sign
- #--------------------------------------------------------------------------
- # ● オブジェクト初期化
- #--------------------------------------------------------------------------
- def initialize(rect, num=0)
- @num_max = 8
- @num = []
- @max = 99999999
- @sign = false
- @pm_sign = true
- @min = 0
- super(rect.x, rect.y)
- area(rect)
- self.num = num
- deactivate.hide
- end
- #--------------------------------------------------------------------------
- # ● エリア変更
- #--------------------------------------------------------------------------
- def area(rect)
- @area = rect
- self.x = @area.x + (@area.width - window_width ) / 2
- self.y = @area.y + (@area.height - window_height) / 2
- self
- end
- #--------------------------------------------------------------------------
- # ● 項目数変更(Windowサイズ更新)
- #--------------------------------------------------------------------------
- def num_max=(n)
- return if n == @num_max or n == 0
- @num_max = n
- self.x = @area.x + (@area.width - window_width ) / 2
- self.width = window_width
- create_contents
- clac_maxmin
- self.num = 0
- unselect
- end
- #--------------------------------------------------------------------------
- # ● 数字更新
- #--------------------------------------------------------------------------
- def num=(n)
- @num.clear
- @pm_sign = (n >= 0) if @sign
- n = n.abs
- @num_max.times do |i|
- @num[@num_max-1-i] = n % 10
- n = (n / 10).truncate
- end
- refresh
- end
- #--------------------------------------------------------------------------
- # ● 最大値計算
- #--------------------------------------------------------------------------
- def clac_maxmin
- @max = @min = 0
- @num_max.times {|i| @max += 9 * exp(i)}
- end
- #--------------------------------------------------------------------------
- # ● 10のべき乗計算
- #--------------------------------------------------------------------------
- def exp(n)
- r = 1
- n.times {|i| r *= 10}
- r
- end
- #--------------------------------------------------------------------------
- # ● 数字
- #--------------------------------------------------------------------------
- def num
- r = 0
- @num_max.times {|i| r += @num[@num_max-1-i] * exp(i)}
- r *= -1 if @sign and !@pm_sign
- r
- end
- #--------------------------------------------------------------------------
- # ● 項目の幅を取得
- #--------------------------------------------------------------------------
- def item_width
- 15
- end
- #--------------------------------------------------------------------------
- # ● ウィンドウ幅の取得
- #--------------------------------------------------------------------------
- def window_width
- (item_width + spacing) * col_max + standard_padding * 2
- end
- #--------------------------------------------------------------------------
- # ● 桁数の取得
- #--------------------------------------------------------------------------
- def col_max
- @sign ? (@num_max + 1) : @num_max
- end
- #--------------------------------------------------------------------------
- # ● 符号除くindex
- #--------------------------------------------------------------------------
- def s_index(index = @index)
- @sign ? (index-1) : index
- end
- #--------------------------------------------------------------------------
- # ● 横に項目が並ぶときの空白の幅を取得
- #--------------------------------------------------------------------------
- def spacing
- 2
- end
- #--------------------------------------------------------------------------
- # ● 終端選択
- #--------------------------------------------------------------------------
- def select_last
- select(col_max - 1)
- self
- end
- #--------------------------------------------------------------------------
- # ● カーソルを下に移動
- #--------------------------------------------------------------------------
- def cursor_down(wrap = false)
- if @sign and @index == 0
- @pm_sign = !@pm_sign
- else
- @num[s_index] = (@num[s_index] + 10 - 1) % 10
- end
- redraw_current_item
- Sound.play_cursor
- end
- #--------------------------------------------------------------------------
- # ● カーソルを上に移動
- #--------------------------------------------------------------------------
- def cursor_up(wrap = false)
- if @sign and @index == 0
- @pm_sign = !@pm_sign
- else
- @num[s_index] = (@num[s_index] + 1) % 10
- end
- redraw_current_item
- Sound.play_cursor
- end
- #--------------------------------------------------------------------------
- # ● コマンドリストの作成
- #--------------------------------------------------------------------------
- def make_command_list
- add_command(0, :sign) if @sign
- @num_max.times {|i| add_command(0, :num)}
- end
- #--------------------------------------------------------------------------
- # ● 選択項目の有効状態を取得
- #--------------------------------------------------------------------------
- def current_item_enabled?
- n = self.num
- n >= @min and n <= @max
- end
- #--------------------------------------------------------------------------
- # ● 背景色 1 の取得
- #--------------------------------------------------------------------------
- def back_color
- Color.new(0, 0, 0, 64)
- end
- #--------------------------------------------------------------------------
- # ● 背景の描画
- #--------------------------------------------------------------------------
- def draw_back(rect)
- contents.fill_rect(rect, back_color)
- end
- #--------------------------------------------------------------------------
- # ● 項目の描画
- #--------------------------------------------------------------------------
- def draw_item(index)
- rect = item_rect(index)
- draw_back(rect)
- change_color(normal_color, command_enabled?(index))
- if @sign and index == 0
- draw_text(rect, (@pm_sign ? " " : "-"), 2)
- else
- draw_text(rect, @num[s_index(index)], 2)
- end
- end
- #--------------------------------------------------------------------------
- # ● アイテムウィンドウの設定
- #--------------------------------------------------------------------------
- def item_window=(item_window)
- @item_window = item_window
- n = item_window.nil? ? 0 : item_window.num_max
- s = item_window.nil? ? false : item_window.sign
- if @sign != s
- @num_max = 0
- @sign = s
- end
- self.num_max = n
- update
- end
- end
- #==============================================================================
- # ■ Window_DebugBase
- #==============================================================================
- class Window_DebugBase < Window_Selectable
- #--------------------------------------------------------------------------
- # ● オブジェクト初期化
- #--------------------------------------------------------------------------
- def initialize(rect)
- @max_n = max_n
- super(rect.x, rect.y, rect.width, rect.height)
- refresh
- deactivate.hide
- end
- #--------------------------------------------------------------------------
- # ● 決定やキャンセルなどのハンドリング処理
- #--------------------------------------------------------------------------
- def process_handling
- return unless open? && active
- return process_ok if ok_enabled? && Input.trigger?(:C)
- return process_cancel if cancel_enabled? && Input.trigger?(:B)
- return process_pagedown if handle?(:pagedown) && Input.trigger?(:R)
- return process_pageup if handle?(:pageup) && Input.trigger?(:L)
- return process_a if handle?(:a) && Input.trigger?(:A)
- return process_x if handle?(:x) && Input.trigger?(:X)
- end
- def process_a
- Sound.play_ok
- call_handler(:a)
- end
- def process_x
- Sound.play_ok
- call_handler(:x)
- end
- #--------------------------------------------------------------------------
- # ● カーソルを右に移動
- #--------------------------------------------------------------------------
- def cursor_right(wrap = false)
- if col_max >= 2 && (index < item_max - 1 || (wrap && horizontal?))
- select((index + 1) % item_max)
- elsif col_max == 1 && index >= 0
- if (index + 100) > (item_max - 1)
- select(item_max - 1)
- else
- select((index + 100) % item_max)
- end
- end
- end
- #--------------------------------------------------------------------------
- # ● カーソルを左に移動
- #--------------------------------------------------------------------------
- def cursor_left(wrap = false)
- if col_max >= 2 && (index > 0 || (wrap && horizontal?))
- select((index - 1 + item_max) % item_max)
- elsif col_max == 1 && index >= 0
- if (index - 100) < 0
- select(0)
- else
- select((index - 100 + item_max) % item_max)
- end
- end
- end
- #--------------------------------------------------------------------------
- # ● 項目数の取得
- #--------------------------------------------------------------------------
- def item_max
- 0
- end
- #--------------------------------------------------------------------------
- # ● 選択項目の有効状態を取得
- #--------------------------------------------------------------------------
- def current_item_enabled?
- !citem.nil?
- end
- #--------------------------------------------------------------------------
- # ● IDの取得
- #--------------------------------------------------------------------------
- def id(i)
- i + 1
- end
- def cid; id(@index); end
- #--------------------------------------------------------------------------
- # ● アイテムの取得
- #--------------------------------------------------------------------------
- def item(i)
- nil
- end
- def citem; item(@index); end
- #--------------------------------------------------------------------------
- # ● アイテム名の取得
- #--------------------------------------------------------------------------
- def name(i)
- ""
- end
- def cname; name(@index); end
- #--------------------------------------------------------------------------
- # ● アイテム状態の取得
- #--------------------------------------------------------------------------
- def status(i)
- item(i)
- end
- def cstatus; status(@index); end
- #--------------------------------------------------------------------------
- # ● ステータステキスト
- #--------------------------------------------------------------------------
- def status_text(i)
- status(i) ? "[ON]" : "[OFF]"
- end
- #--------------------------------------------------------------------------
- # ● 名前の描画
- #--------------------------------------------------------------------------
- def draw_index_name(rect, index)
- draw_text(rect, name(index))
- end
- #--------------------------------------------------------------------------
- # ● ステータスの描画
- #--------------------------------------------------------------------------
- def draw_index_status(rect, index)
- draw_text(rect, status_text(index), 2)
- end
- #--------------------------------------------------------------------------
- # ● 項目の描画 id : name
- #--------------------------------------------------------------------------
- def draw_item_id_name(index)
- id_text = sprintf("%04d:", id(index))
- id_width = text_size(id_text).width
- rect = item_rect_for_text(index)
-
- change_color(normal_color)
- draw_text(rect, id_text)
-
- rect.x += id_width
- rect.width -= id_width + 60
- draw_index_name(rect, index)
- end
- #--------------------------------------------------------------------------
- # ● 項目の描画 id : name [ON/OFF]
- #--------------------------------------------------------------------------
- def draw_item_id_name_sw(index)
- id_text = sprintf("%04d:", id(index))
- id_width = text_size(id_text).width
- rect = item_rect_for_text(index)
-
- change_color(normal_color)
- draw_text(rect, id_text)
-
- rect.x += id_width
- rect.width -= id_width + 60
- draw_index_name(rect, index)
-
- rect.width += 60
- draw_index_status(rect, index)
- end
- #--------------------------------------------------------------------------
- # ● 項目の描画 id : name num
- #--------------------------------------------------------------------------
- def draw_item_id_name_num(index)
- id_text = sprintf("%04d:", id(index))
- id_width = text_size(id_text).width
- rect = item_rect_for_text(index)
-
- change_color(normal_color)
- draw_text(rect, id_text)
-
- rect.x += id_width
- rect.width -= id_width + 60
- draw_index_name(rect, index)
-
- rect.width += 60
- draw_text(rect, number(index), 2)
- end
- #--------------------------------------------------------------------------
- # ● 数値の最大桁数取得
- #--------------------------------------------------------------------------
- def num_max
- 8
- end
- def max_n
- num_max
- end
- #--------------------------------------------------------------------------
- # ● 数値の符号
- #--------------------------------------------------------------------------
- def sign
- false
- end
- #--------------------------------------------------------------------------
- # ● アイテムの変更
- #--------------------------------------------------------------------------
- def change(n=0)
- end
- #--------------------------------------------------------------------------
- # ● OK時の処理
- #--------------------------------------------------------------------------
- def ok
- change
- redraw_current_item
- end
- #--------------------------------------------------------------------------
- # ● 数値の取得/設定
- #--------------------------------------------------------------------------
- def number(i=@index)
- item(i)
- end
- def number=(n)
- change(n)
- redraw_current_item
- end
- end
- #==============================================================================
- # ■ Window_DebugBaseCommand
- #==============================================================================
- class Window_DebugBaseCommand < Window_Command
- #--------------------------------------------------------------------------
- # ● オブジェクト初期化
- #--------------------------------------------------------------------------
- def initialize(rect)
- @area = rect
- super(rect.x, rect.y)
- refresh
- deactivate.hide.unselect
- end
- #--------------------------------------------------------------------------
- # ● ウィンドウ幅の取得
- #--------------------------------------------------------------------------
- def window_width
- @area.width
- end
- #--------------------------------------------------------------------------
- # ● ウィンドウ高さの取得
- #--------------------------------------------------------------------------
- def window_height
- @area.height
- end
- #--------------------------------------------------------------------------
- # ● 決定やキャンセルなどのハンドリング処理
- #--------------------------------------------------------------------------
- def process_handling
- return unless open? && active
- return process_ok if ok_enabled? && Input.trigger?(:C)
- return process_cancel if cancel_enabled? && Input.trigger?(:B)
- return process_pagedown if handle?(:pagedown) && Input.trigger?(:R)
- return process_pageup if handle?(:pageup) && Input.trigger?(:L)
- return process_a if handle?(:a) && Input.trigger?(:A)
- return process_x if handle?(:x) && Input.trigger?(:X)
- end
- def process_a
- Sound.play_ok
- call_handler(:a)
- end
- def process_x
- Sound.play_ok
- call_handler(:x)
- end
- #--------------------------------------------------------------------------
- # ● カーソルを右に移動
- #--------------------------------------------------------------------------
- def cursor_right(wrap = false)
- if col_max >= 2 && (index < item_max - 1 || (wrap && horizontal?))
- select((index + 1) % item_max)
- elsif col_max == 1 && index >= 0
- if (index + 100) > (item_max - 1)
- select(item_max - 1)
- else
- select((index + 100) % item_max)
- end
- end
- end
- #--------------------------------------------------------------------------
- # ● カーソルを左に移動
- #--------------------------------------------------------------------------
- def cursor_left(wrap = false)
- if col_max >= 2 && (index > 0 || (wrap && horizontal?))
- select((index - 1 + item_max) % item_max)
- elsif col_max == 1 && index >= 0
- if (index - 100) < 0
- select(0)
- else
- select((index - 100 + item_max) % item_max)
- end
- end
- end
- #--------------------------------------------------------------------------
- # ● 数値の最大桁数取得
- #--------------------------------------------------------------------------
- def num_max
- 0
- end
- #--------------------------------------------------------------------------
- # ● 数値の符号
- #--------------------------------------------------------------------------
- def sign
- false
- end
- #--------------------------------------------------------------------------
- # ● OK時の処理
- #--------------------------------------------------------------------------
- def ok
- change
- redraw_current_item
- end
- end
- #==============================================================================
- # ■ Window_DebugBaseHorzCommand
- #==============================================================================
- class Window_DebugBaseHorzCommand < Window_HorzCommand
- #--------------------------------------------------------------------------
- # ● オブジェクト初期化
- #--------------------------------------------------------------------------
- def initialize(rect)
- @window_width = rect.width
- super(rect.x, rect.y)
- refresh
- deactivate.hide.unselect
- end
- #--------------------------------------------------------------------------
- # ● 桁数の取得
- #--------------------------------------------------------------------------
- def col_max
- item_max
- end
- #--------------------------------------------------------------------------
- # ● ウィンドウ幅の取得
- #--------------------------------------------------------------------------
- def window_width
- @window_width
- end
- #--------------------------------------------------------------------------
- # ● 数値の最大桁数取得
- #--------------------------------------------------------------------------
- def num_max
- 0
- end
- #--------------------------------------------------------------------------
- # ● 数値の符号
- #--------------------------------------------------------------------------
- def sign
- false
- end
- #--------------------------------------------------------------------------
- # ● OK時の処理
- #--------------------------------------------------------------------------
- def ok
- change
- redraw_current_item
- end
- end
- #==============================================================================
- # ■ Window_DebugSwitch
- #==============================================================================
- class Window_DebugSwitch < Window_DebugBase
- #--------------------------------------------------------------------------
- # ● 項目数の取得
- #--------------------------------------------------------------------------
- def item_max
- $data_system.switches.size-1
- end
- #--------------------------------------------------------------------------
- # ● アイテムの取得
- #--------------------------------------------------------------------------
- def item(i)
- $game_switches[id(i)]
- end
- #--------------------------------------------------------------------------
- # ● アイテム名の取得
- #--------------------------------------------------------------------------
- def name(i)
- $data_system.switches[id(i)]
- end
- #--------------------------------------------------------------------------
- # ● 項目の描画
- #--------------------------------------------------------------------------
- def draw_item(index)
- draw_item_id_name_sw(index)
- end
- #--------------------------------------------------------------------------
- # ● アイテムの変更
- #--------------------------------------------------------------------------
- def change
- $game_switches[cid] = !$game_switches[cid]
- end
- end
- #==============================================================================
- # ■ Window_DebugVariable
- #==============================================================================
- class Window_DebugVariable < Window_DebugBase
- #--------------------------------------------------------------------------
- # ● 項目数の取得
- #--------------------------------------------------------------------------
- def item_max
- $data_system.variables.size-1
- end
- #--------------------------------------------------------------------------
- # ● アイテムの取得
- #--------------------------------------------------------------------------
- def item(i)
- $game_variables[id(i)]
- end
- #--------------------------------------------------------------------------
- # ● アイテム名の取得
- #--------------------------------------------------------------------------
- def name(i)
- $data_system.variables[id(i)]
- end
- #--------------------------------------------------------------------------
- # ● 項目の描画
- #--------------------------------------------------------------------------
- def draw_item(index)
- draw_item_id_name_num(index)
- end
- #--------------------------------------------------------------------------
- # ● アイテムの変更
- #--------------------------------------------------------------------------
- def change(n)
- $game_variables[cid] = n
- end
- #--------------------------------------------------------------------------
- # ● 数値のmaxmin値取得
- #--------------------------------------------------------------------------
- def min
- -99999999
- end
- def max
- 99999999
- end
- #--------------------------------------------------------------------------
- # ● 数値の符号
- #--------------------------------------------------------------------------
- def sign
- min < 0
- end
- #--------------------------------------------------------------------------
- # ● 数値の符号
- #--------------------------------------------------------------------------
- def sign
- true
- end
- end
- #==============================================================================
- # ■ Window_DebugMapSelfSw
- #==============================================================================
- class Window_DebugMapSelfSw < Window_DebugBase
- #--------------------------------------------------------------------------
- # ● オブジェクト初期化
- #--------------------------------------------------------------------------
- def initialize(rect, map_id=$game_map.map_id)
- @map_id = map_id
- @map = load_data(sprintf("Data/Map%03d.rvdata2", @map_id))
- super(rect)
- end
- #--------------------------------------------------------------------------
- # ● 項目数の取得
- #--------------------------------------------------------------------------
- def item_max
- @map.events.size
- end
- #--------------------------------------------------------------------------
- # ● イベントID
- #--------------------------------------------------------------------------
- def id(i)
- @map.events.keys[i]
- end
- #--------------------------------------------------------------------------
- # ● アイテムの取得
- #--------------------------------------------------------------------------
- def item(i)
- @map.events[id(i)]
- end
- #--------------------------------------------------------------------------
- # ● アイテムの取得
- #--------------------------------------------------------------------------
- def name(i)
- @map.events[id(i)].name
- end
- #--------------------------------------------------------------------------
- # ● 項目の描画
- #--------------------------------------------------------------------------
- def draw_item(index)
- draw_item_id_name(index)
- end
- #--------------------------------------------------------------------------
- # ● ヘルプウィンドウの更新
- #--------------------------------------------------------------------------
- def update_help
- @help_window.set_event(@map_id, cid)
- end
- end
- #==============================================================================
- # ■ Window_DebugSelfSwitch
- #==============================================================================
- class Window_DebugSelfSwitch < Window_DebugBaseHorzCommand
- KEY = ["A", "B", "C", "D"]
- #--------------------------------------------------------------------------
- # ● オブジェクト初期化
- #--------------------------------------------------------------------------
- def initialize(rect, map_id=$game_map.map_id, ev_id=1)
- @map_id = map_id
- @ev_id = ev_id
- super(rect)
- end
- #--------------------------------------------------------------------------
- # ● 項目数の取得
- #--------------------------------------------------------------------------
- def item_max
- KEY.size
- end
- #--------------------------------------------------------------------------
- # ● ハッシュキー
- #--------------------------------------------------------------------------
- def key(i)
- [@map_id, @ev_id, KEY[i]]
- end
- #--------------------------------------------------------------------------
- # ● アイテムの取得
- #--------------------------------------------------------------------------
- def item(i)
- $game_self_switches[key(i)]
- end
- #--------------------------------------------------------------------------
- # ● アイテムの変更
- #--------------------------------------------------------------------------
- def change
- k = key(@index)
- $game_self_switches[k] = !$game_self_switches[k]
- end
- #--------------------------------------------------------------------------
- # ● アイテム名の取得
- #--------------------------------------------------------------------------
- def name(i)
- KEY[i]
- end
- #--------------------------------------------------------------------------
- # ● コマンド名の取得
- #--------------------------------------------------------------------------
- def command_name(index)
- @list[index][:name] + (item(index) ? "[ON]" : "[OFF]")
- end
- #--------------------------------------------------------------------------
- # ● コマンドの有効状態を取得
- #--------------------------------------------------------------------------
- def command_enabled?(index)
- item(index)
- end
- #--------------------------------------------------------------------------
- # ● コマンドリストの作成
- #--------------------------------------------------------------------------
- def make_command_list
- item_max.times {|i| add_command(name(i), :ok) }
- end
- #--------------------------------------------------------------------------
- # ● イベントの設定
- #--------------------------------------------------------------------------
- def set_event(map_id, ev_id)
- @map_id = map_id
- @ev_id = ev_id
- refresh
- end
- end
- #==============================================================================
- # ■ Window_DebugItem
- #==============================================================================
- class Window_DebugItem < Window_DebugBase
- #--------------------------------------------------------------------------
- # ● 項目数の取得
- #--------------------------------------------------------------------------
- def item_max
- $data_items.size-1
- end
- #--------------------------------------------------------------------------
- # ● アイテムの取得
- #--------------------------------------------------------------------------
- def item(i)
- $data_items[id(i)]
- end
- #--------------------------------------------------------------------------
- # ● アイテムの変更
- #--------------------------------------------------------------------------
- def change(n)
- d = citem
- n -= $game_party.item_number(d)
- $game_party.gain_item(d, n)
- end
- #--------------------------------------------------------------------------
- # ● 名前の描画
- #--------------------------------------------------------------------------
- def draw_index_name(rect, index)
- draw_item_name(item(index), rect.x, rect.y)
- end
- #--------------------------------------------------------------------------
- # ● 項目の描画
- #--------------------------------------------------------------------------
- def draw_item(index)
- draw_item_id_name(index)
- draw_item_number(item_rect_for_text(index), item(index))
- end
- #--------------------------------------------------------------------------
- # ● アイテム個数を描画
- #--------------------------------------------------------------------------
- def draw_item_number(rect, item)
- draw_text(rect, sprintf(":%#{@max_n}d", $game_party.item_number(item)), 2)
- end
- #--------------------------------------------------------------------------
- # ● 数値の最大桁数取得
- #--------------------------------------------------------------------------
- def num_max
- Math.log10(max).to_i + 1
- end
- #--------------------------------------------------------------------------
- # ● 数値のmaxmin値取得
- #--------------------------------------------------------------------------
- def min
- 0
- end
- def max
- $game_party.max_item_number(citem)
- end
- def max_n
- m = []
- 0..item_max.times {|i| m.push(Math.log10($game_party.max_item_number(item(i))).to_i + 1)}
- m.max
- end
- #--------------------------------------------------------------------------
- # ● 数値の取得/設定
- #--------------------------------------------------------------------------
- def number
- $game_party.item_number(citem)
- end
- def number=(n)
- change(n)
- redraw_current_item
- end
- end
- #==============================================================================
- # ■ Window_DebugWeapon
- #==============================================================================
- class Window_DebugWeapon < Window_DebugItem
- #--------------------------------------------------------------------------
- # ● 項目数の取得
- #--------------------------------------------------------------------------
- def item_max
- $data_weapons.size-1
- end
- #--------------------------------------------------------------------------
- # ● アイテムの取得
- #--------------------------------------------------------------------------
- def item(i)
- $data_weapons[id(i)]
- end
- end
- #==============================================================================
- # ■ Window_DebugArmor
- #==============================================================================
- class Window_DebugArmor < Window_DebugItem
- #--------------------------------------------------------------------------
- # ● 項目数の取得
- #--------------------------------------------------------------------------
- def item_max
- $data_armors.size-1
- end
- #--------------------------------------------------------------------------
- # ● アイテムの取得
- #--------------------------------------------------------------------------
- def item(i)
- $data_armors[id(i)]
- end
- end
- #==============================================================================
- # ■ Window_DebugParty
- #==============================================================================
- class Window_DebugParty < Window_DebugBase
- #--------------------------------------------------------------------------
- # ● 歩行グラフィックの描画
- #--------------------------------------------------------------------------
- def draw_line_character(character_name, character_index, x, y, enabled=true)
- return unless character_name
- bitmap = Cache.character(character_name)
- sign = character_name[/^[\!\$]./]
- if sign && sign.include?('[/fold] )
- cw = bitmap.width / 3
- ch = bitmap.height / 4
- else
- cw = bitmap.width / 12
- ch = bitmap.height / 8
- end
- y += (line_height - ch) / 2 if ch < line_height
- n = character_index
- src_rect = Rect.new((n%4*3+1)*cw, (n/4*4)*ch, cw, [ch, line_height].min)
- contents.blt(x, y, bitmap, src_rect, enabled ? 255 : translucent_alpha)
- cw
- end
- #--------------------------------------------------------------------------
- # ● アクターの歩行グラフィック描画
- #--------------------------------------------------------------------------
- def draw_actor_line_graphic(actor, x, y, enabled=true)
- draw_line_character(actor.character_name, actor.character_index, x, y, enabled)
- end
- #--------------------------------------------------------------------------
- # ● 項目数の取得<精霊システムあり用>
- #--------------------------------------------------------------------------
- def item_max_actors
- $data_actors.inject(0) {|r, a| r + (a.nil? ? 0 : (Spirits.spirit?(a.id) ? 0 : 1)) }
- end
- #--------------------------------------------------------------------------
- # ● 項目数の取得
- #--------------------------------------------------------------------------
- def item_max
- return item_max_actors if defined?(Spirits)
- $data_actors.size - 1
- end
- #--------------------------------------------------------------------------
- # ● アクターIDの取得<精霊システムあり用>
- #--------------------------------------------------------------------------
- def aid(i)
- $data_actors.select {|a| !a.nil? and !Spirits.spirit?(a.id)}[i].id
- end
- #--------------------------------------------------------------------------
- # ● アクターIDの取得
- #--------------------------------------------------------------------------
- def id(i)
- return aid(i) if defined?(Spirits)
- i + 1
- end
- #--------------------------------------------------------------------------
- # ● アイテムの取得
- #--------------------------------------------------------------------------
- def item(i)
- $game_actors[id(i)]
- end
- #--------------------------------------------------------------------------
- # ● アイテムの変更
- #--------------------------------------------------------------------------
- def change
- if status(@index)
- $game_party.remove_actor(cid)
- else
- $game_party.add_actor(cid)
- end
- end
- #--------------------------------------------------------------------------
- # ● アイテム状態の取得
- #--------------------------------------------------------------------------
- def status(i)
- $game_party.members.include?(item(i))
- end
- def cstate; status(@index); end
- #--------------------------------------------------------------------------
- # ● ステータステキスト
- #--------------------------------------------------------------------------
- def status_text(index)
- status(index) ? "[加入]" : "[未加入]"
- end
- #--------------------------------------------------------------------------
- # ● 名前の描画
- #--------------------------------------------------------------------------
- def draw_index_name(rect, index)
- draw_actor_line_graphic(item(index), rect.x, rect.y)
- draw_actor_name(item(index), rect.x + 34, rect.y, rect.width)
- end
- #--------------------------------------------------------------------------
- # ● 項目の描画
- #--------------------------------------------------------------------------
- def draw_item(index)
- draw_item_id_name_sw(index)
- end
- end
- #==============================================================================
- # ■ Window_DebugActor
- #==============================================================================
- class Window_DebugActor < Window_DebugBase
- #--------------------------------------------------------------------------
- # ● オブジェクト初期化
- #--------------------------------------------------------------------------
- def initialize(rect)
- r = rect.dup
- r.width = 160
- super(r)
- end
- #--------------------------------------------------------------------------
- # ● 項目数の取得
- #--------------------------------------------------------------------------
- def item_max
- $data_actors.size - 1
- end
- #--------------------------------------------------------------------------
- # ● アイテムの取得
- #--------------------------------------------------------------------------
- def item(i)
- $game_actors[i+1]
- end
- #--------------------------------------------------------------------------
- # ● 項目の描画
- #--------------------------------------------------------------------------
- def draw_item(index)
- actor = item(index)
- rect = item_rect_for_text(index)
- if defined?(Spirits) and actor.spirit?
- draw_spirit_name(actor, rect.x, rect.y, rect.width)
- else
- draw_actor_name(actor, rect.x, rect.y, rect.width)
- end
- end
- #--------------------------------------------------------------------------
- # ● ヘルプウィンドウの更新
- #--------------------------------------------------------------------------
- def update_help
- @help_window.set_actor(citem) unless @index < 0
- end
- end
- #==============================================================================
- # ■ Window_DebugActorStatus
- #==============================================================================
- class Window_DebugActorStatus < Window_DebugBaseCommand
- #--------------------------------------------------------------------------
- # ● オブジェクト初期化
- #--------------------------------------------------------------------------
- def initialize(rect)
- @actor = $game_actors[1]
- super(rect)
- end
- #--------------------------------------------------------------------------
- # ● アクター設定
- #--------------------------------------------------------------------------
- def set_actor(actor)
- return if @actor == actor
- @actor = actor
- refresh
- end
- #--------------------------------------------------------------------------
- # ● コマンドリストの作成
- #--------------------------------------------------------------------------
- def make_command_list
- add_command(Vocab::level, :ok, true, 2) # レベル
- add_command(Vocab::param(0), :ok, true, 4) # 最大HP
- add_command(Vocab::param(1), :ok, true, 4) # 最大MP
- add_command(Vocab::param(2), :ok, true, 3) # 攻撃力
- add_command(Vocab::param(3), :ok, true, 3) # 防御力
- add_command(Vocab::param(4), :ok, true, 3) # 魔法力
- add_command(Vocab::param(5), :ok, true, 3) # 魔法防御
- add_command(Vocab::param(6), :ok, true, 3) # 敏捷性
- add_command(Vocab::param(7), :ok, true, 3) # 運
- end
- #--------------------------------------------------------------------------
- # ● 項目の描画
- #--------------------------------------------------------------------------
- def draw_item(index)
- super
- draw_text(item_rect_for_text(index), status_val(index), 2)
- end
- def status_val(index)
- return 0 if @actor.nil?
- case index
- when 0; return @actor.level
- else; return @actor.param(index-1)
- end
- end
- #--------------------------------------------------------------------------
- # ● 数値の最大桁数取得
- #--------------------------------------------------------------------------
- def num_max
- current_ext
- end
- #--------------------------------------------------------------------------
- # ● アイテムの変更
- #--------------------------------------------------------------------------
- def change(n=0)
- case index
- when 0; @actor.change_level(n, false)
- else; @actor.add_param(index-1, n - status_val(index))
- end
- end
- #--------------------------------------------------------------------------
- # ● 数値の取得/設定
- #--------------------------------------------------------------------------
- def number
- status_val(@index)
- end
- def number=(n)
- change(n)
- if @index == 0
- contents.clear
- draw_all_items
- else
- redraw_current_item
- end
- end
- end
- #==============================================================================
- # ■ Window_DebugActorSkill
- #==============================================================================
- class Window_DebugActorSkill < Window_DebugActorStatus
- #--------------------------------------------------------------------------
- # ● アクター設定
- #--------------------------------------------------------------------------
- def set_actor(actor)
- return if @actor == actor
- @actor = actor
- refresh_enabled
- end
- #--------------------------------------------------------------------------
- # ● 半透明描画用のアルファ値を取得
- #--------------------------------------------------------------------------
- def translucent_alpha
- return 80
- end
- #--------------------------------------------------------------------------
- # ● 許可状態だけ変更
- #--------------------------------------------------------------------------
- def refresh_enabled
- item_max.times do |i|
- next if @actor.nil?
- enabled = @actor.skill_learn?(item(i))
- if @list[i][:enabled] != enabled
- @list[i][:enabled] = enabled
- redraw_item(i)
- end
- end
- end
- #--------------------------------------------------------------------------
- # ● 選択項目の有効状態を取得
- #--------------------------------------------------------------------------
- def current_item_enabled?
- !citem.nil?
- end
- #--------------------------------------------------------------------------
- # ● アイテム取得
- #--------------------------------------------------------------------------
- def item(i)
- $data_skills[i+1]
- end
- def citem; item(@index); end
- #--------------------------------------------------------------------------
- # ● コマンドリストの作成
- #--------------------------------------------------------------------------
- def make_command_list
- n = ($data_skills.size - 1)
- n.times {|i| add_command(item(i).id, :ok, @actor.skill_learn?(item(i)))}
- end
- #--------------------------------------------------------------------------
- # ● 項目の描画
- #--------------------------------------------------------------------------
- def draw_item(index)
- enabled = command_enabled?(index)
- change_color(normal_color, enabled)
- rect = item_rect_for_text(index)
- draw_item_name(item(index), rect.x, rect.y, enabled, rect.width-24)
- end
- #--------------------------------------------------------------------------
- # ● アイテムの変更
- #--------------------------------------------------------------------------
- def change
- if command_enabled?(@index)
- @actor.forget_skill(citem.id)
- else
- @actor.learn_skill(citem.id)
- end
- @list[@index][:enabled] = @actor.skill_learn?(citem)
- end
- #--------------------------------------------------------------------------
- # ● OK時の処理
- #--------------------------------------------------------------------------
- def ok
- change
- redraw_current_item
- end
- end
- #==============================================================================
- # ■ Window_DebugMap
- #==============================================================================
- class Window_DebugMap < Window_DebugBase
- #--------------------------------------------------------------------------
- # ● オブジェクト初期化
- #--------------------------------------------------------------------------
- def initialize(rect)
- @map = $data_mapinfos.sort {|a,b| a[1].order - b[1].order}
- super(rect)
- end
- #--------------------------------------------------------------------------
- # ● 項目数の取得
- #--------------------------------------------------------------------------
- def item_max
- @map.size
- end
- #--------------------------------------------------------------------------
- # ● マップIDの取得
- #--------------------------------------------------------------------------
- def id(i)
- @map[i][0]
- end
- #--------------------------------------------------------------------------
- # ● アイテムの取得
- #--------------------------------------------------------------------------
- def item(i)
- @map[i][1]
- end
- #--------------------------------------------------------------------------
- # ● アイテム名の取得
- #--------------------------------------------------------------------------
- def name(i)
- item(i).name
- end
- #--------------------------------------------------------------------------
- # ● 項目の描画
- #--------------------------------------------------------------------------
- def draw_item(index)
- draw_item_id_name(index)
- end
- #--------------------------------------------------------------------------
- # ● 決定ハンドラの呼び出し
- #--------------------------------------------------------------------------
- def call_ok_handler
- ok
- super
- end
- #--------------------------------------------------------------------------
- # ● 移動位置
- #--------------------------------------------------------------------------
- def move_point(i)
- pos = DebugPP::MAP[id(i)]
- return pos unless pos.nil?
- data = load_data(sprintf("Data/Map%03d.rvdata2", id(i)))
- [(data.width / 2).truncate, (data.height / 2).truncate]
- end
- #--------------------------------------------------------------------------
- # ● OK時の処理
- #--------------------------------------------------------------------------
- def ok
- pos = move_point(@index)
- $game_player.reserve_transfer(cid, pos[0], pos[1], $game_player.direction)
- $game_temp.fade_type = 1 # 白
- end
- end
- #==============================================================================
- # ■ Window_DebugMusicCtg
- #==============================================================================
- class Window_DebugMusicCtg < Window_DebugBaseHorzCommand
- #--------------------------------------------------------------------------
- # ● コマンドリストの作成
- #--------------------------------------------------------------------------
- def make_command_list
- ["BGM", "BGS", "ME", "SE"].each {|n| add_command(n, :ok) }
- end
- #--------------------------------------------------------------------------
- # ● ヘルプウィンドウの更新
- #--------------------------------------------------------------------------
- def update_help
- @help_window.set_ctg(@index)
- end
- end
- #==============================================================================
- # ■ Window_DebugMusic
- #==============================================================================
- class Window_DebugMusic < Window_DebugBase
- BGM=0;BGS=1;ME=2;SE=3
- #--------------------------------------------------------------------------
- # ● オブジェクト初期化
- #--------------------------------------------------------------------------
- def initialize(rect)
- @ctg = BGM
- data_refresh
- super(rect)
- end
- #--------------------------------------------------------------------------
- # ● データ初期化
- #--------------------------------------------------------------------------
- def data_refresh
- @list = []
- 4.times do |i|
- @list[i] = rtp_audio(i) + audio_grep(i)
- end
- end
- #--------------------------------------------------------------------------
- # ● データ初期化
- #--------------------------------------------------------------------------
- def set_ctg(ctg)
- return if @ctg == ctg
- @ctg = ctg
- create_contents
- draw_all_items
- self.top_row = 0
- unselect
- end
- #--------------------------------------------------------------------------
- # ● RTP-Audio
- #--------------------------------------------------------------------------
- def rtp_audio(i)
- return [] unless DebugPP::RTP_MUSIC
- case i
- when BGM
- return ["Airship.ogg","Battle1.ogg","Battle2.ogg","Battle3.ogg",
- "Battle4.ogg","Battle5.ogg","Battle6.ogg","Battle7.ogg",
- "Battle8.ogg","Battle9.ogg",
- "Dungeon1.ogg","Dungeon2.ogg","Dungeon3.ogg","Dungeon4.ogg",
- "Dungeon5.ogg","Dungeon6.ogg","Dungeon7.ogg","Dungeon8.ogg",
- "Dungeon9.ogg",
- "Field1.ogg","Field2.ogg","Field3.ogg","Field4.ogg",
- "Scene1.ogg","Scene2.ogg","Scene3.ogg","Scene4.ogg",
- "Scene5.ogg","Scene6.ogg","Ship.ogg",
- "Theme1.ogg","Theme2.ogg","Theme3.ogg","Theme4.ogg","Theme5.ogg",
- "Town1.ogg","Town2.ogg","Town3.ogg","Town4.ogg","Town5.ogg",
- "Town6.ogg","Town7.ogg"]
- when BGS
- return ["Clock.ogg","Darkness.ogg","Drips.ogg","Fire.ogg","Quake.ogg",
- "Rain.ogg","River.ogg","Sea.ogg","Storm.ogg","Wind.ogg"]
- when ME
- return ["Fanfare1.ogg","Fanfare2.ogg","Fanfare3.ogg","Gag.ogg",
- "Gameover1.ogg","Gameover2.ogg","Inn.ogg","Item.ogg","Mystery.ogg",
- "Organ.ogg","Shock.ogg","Victory1.ogg","Victory2.ogg"]
- when SE
- return ["Absorb1.ogg","Absorb2.ogg","Applause1.ogg","Applause2.ogg",
- "Attack1.ogg","Attack2.ogg","Attack3.ogg","Autodoor.ogg",
- "Barrier.ogg","Battle1.ogg","Battle2.ogg","Battle3.ogg",
- "Bell1.ogg","Bell2.ogg","Bell3.ogg","Bite.ogg","Blind.ogg",
- "Blow1.ogg","Blow2.ogg","Blow3.ogg","Blow4.ogg","Blow5.ogg",
- "Blow6.ogg","Blow7.ogg","Blow8.ogg","Book1.ogg","Book2.ogg",
- "Bow1.ogg","Bow2.ogg","Bow3.ogg","Bow4.ogg","Break.ogg",
- "Breath.ogg","Buzzer1.ogg","Buzzer2.ogg",
- "Cancel1.ogg","Cancel2.ogg","Cat.ogg","Chest.ogg",
- "Chicken.ogg","Chime1.ogg","Chime2.ogg",
- "Close1.ogg","Close2.ogg","Close3.ogg","Coin.ogg",
- "Collapse1.ogg","Collapse2.ogg","Collapse3.ogg","Collapse4.ogg",
- "Confuse.ogg","Cow.ogg","Crash.ogg","Crossbow.ogg","Crow.ogg",
- "Cry1.ogg","Cry2.ogg","Cursor1.ogg","Cursor2.ogg",
- "Damage1.ogg","Damage2.ogg","Damage3.ogg","Damage4.ogg","Damage5.ogg",
- "Darkness1.ogg","Darkness2.ogg","Darkness3.ogg","Darkness4.ogg",
- "Darkness5.ogg","Darkness6.ogg","Darkness7.ogg","Darkness8.ogg",
- "Decision1.ogg","Decision2.ogg","Decision3.ogg",
- "Devil1.ogg","Devil2.ogg","Devil3.ogg","Disappointment.ogg",
- "Dive.ogg","Dog.ogg","Down1.ogg","Down2.ogg","Down3.ogg","Down4.ogg",
- "Earth1.ogg","Earth2.ogg","Earth3.ogg","Earth4.ogg","Earth5.ogg",
- "Earth6.ogg","Earth7.ogg","Earth8.ogg", "Earth9.ogg",
- "Equip1.ogg","Equip2.ogg","Equip3.ogg","Evasion1.ogg","Evasion2.ogg",
- "Explosion1.ogg","Explosion2.ogg","Explosion3.ogg","Explosion4.ogg",
- "Explosion5.ogg","Explosion6.ogg","Explosion7.ogg","Fall.ogg",
- "Fire1.ogg","Fire2.ogg","Fire3.ogg","Fire4.ogg","Fire5.ogg",
- "Fire6.ogg","Fire7.ogg","Fire8.ogg","Fire9.ogg",
- "Flash1.ogg","Flash2.ogg","Flash3.ogg","Fog1.ogg","Fog2.ogg",
- "Frog.ogg","Gun1.ogg","Gun2.ogg",
- "Hammer.ogg","Heal1.ogg","Heal2.ogg","Heal3.ogg","Heal4.ogg",
- "Heal5.ogg","Heal6.ogg","Heal7.ogg","Horse.ogg",
- "Ice1.ogg","Ice2.ogg","Ice3.ogg","Ice4.ogg","Ice5.ogg","Ice6.ogg",
- "Ice7.ogg","Ice8.ogg","Ice9.ogg","Ice10.ogg","Ice11.ogg",
- "Item1.ogg","Item2.ogg","Item3.ogg","Jump1.ogg","Jump2.ogg",
- "Key.ogg","Knock.ogg","Laser.ogg","Load.ogg",
- "Machine.ogg","Magic1.ogg","Magic2.ogg","Magic3.ogg",
- "Magic4.ogg","Magic5.ogg","Magic6.ogg","Magic7.ogg","Miss.ogg",
- "Monster1.ogg","Monster2.ogg","Monster3.ogg","Monster4.ogg",
- "Monster5.ogg","Monster6.ogg","Monster7.ogg","Move.ogg",
- "Noise.ogg","Open1.ogg","Open2.ogg","Open3.ogg","Open4.ogg","Open5.ogg",
- "Paralyze1.ogg","Paralyze2.ogg","Paralyze3.ogg","Parry.ogg",
- "Phone.ogg","Poison.ogg","Pollen.ogg","Powerup.ogg","Push.ogg",
- "Raise1.ogg","Raise2.ogg","Raise3.ogg","Recovery.ogg",
- "Reflection.ogg","Resonance.ogg","Run.ogg",
- "Saint1.ogg","Saint2.ogg","Saint3.ogg","Saint4.ogg","Saint5.ogg",
- "Saint6.ogg","Saint7.ogg","Saint8.ogg","Saint9.ogg","Sand.ogg",
- "Save.ogg","Scream.ogg","Sheep.ogg","Shop.ogg",
- "Shot1.ogg","Shot2.ogg","Shot3.ogg","Silence.ogg",
- "Skill1.ogg","Skill2.ogg","Skill3.ogg",
- "Slash1.ogg","Slash2.ogg","Slash3.ogg","Slash4.ogg","Slash5.ogg",
- "Slash6.ogg","Slash7.ogg","Slash8.ogg","Slash9.ogg",
- "Slash10.ogg","Slash11.ogg","Slash12.ogg","Sleep.ogg",
- "Sound1.ogg","Sound2.ogg","Sound3.ogg","Stare.ogg","Starlight.ogg",
- "Switch1.ogg","Switch2.ogg","Switch3.ogg",
- "Sword1.ogg","Sword2.ogg","Sword3.ogg","Sword4.ogg","Sword5.ogg",
- "Teleport.ogg","Thunder1.ogg","Thunder2.ogg","Thunder3.ogg",
- "Thunder4.ogg","Thunder5.ogg","Thunder6.ogg","Thunder7.ogg",
- "Thunder8.ogg","Thunder9.ogg","Thunder10.ogg",
- "Thunder11.ogg","Thunder12.ogg","Twine.ogg",
- "Up1.ogg","Up2.ogg","Up3.ogg","Up4.ogg",
- "Water1.ogg","Water2.ogg","Water3.ogg","Water4.ogg",
- "Water5.ogg","Water6.ogg",
- "Wind1.ogg","Wind2.ogg","Wind3.ogg","Wind4.ogg","Wind5.ogg",
- "Wind6.ogg","Wind7.ogg","Wind8.ogg","Wind9.ogg","Wind10.ogg",
- "Wind11.ogg","Wolf.ogg"]
- end
- return []
- end
- #--------------------------------------------------------------------------
- # ● Audioフォルダのパス
- #--------------------------------------------------------------------------
- def path(i)
- case i
- when BGM; return "Audio/BGM/"
- when BGS; return "Audio/BGS/"
- when ME; return "Audio/ME/"
- when SE; return "Audio/SE/"
- end
- end
- def filter(i)
- case i
- when BGM; return "*.{ogg,wma,mp3,wav,mid}"
- when BGS; return "*.{ogg,wma,mp3,wav}"
- when ME; return "*.{ogg,wma,mp3,wav,mid}"
- when SE; return "*.{ogg,wma,mp3,wav}"
- end
- end
- #--------------------------------------------------------------------------
- # ● AudioフォルダのGrep
- #--------------------------------------------------------------------------
- def audio_grep(i)
- list = Dir.glob(path(i)+filter(i))
- file_list = []
- list.select {|l| !FileTest.directory?(l)}.collect {|l| File.basename(l)}
- end
- #--------------------------------------------------------------------------
- # ● 項目数の取得
- #--------------------------------------------------------------------------
- def item_max
- @list[@ctg].size
- end
- #--------------------------------------------------------------------------
- # ● アイテムの取得
- #--------------------------------------------------------------------------
- def item(i)
- @list[@ctg][i]
- end
- def citem; item(@index); end
- #--------------------------------------------------------------------------
- # ● 項目の描画
- #--------------------------------------------------------------------------
- def draw_item(index)
- draw_text(item_rect_for_text(index), item(index))
- end
- #--------------------------------------------------------------------------
- # ● 決定やキャンセルなどのハンドリング処理
- #--------------------------------------------------------------------------
- def process_handling
- return unless open? && active
- super
- return stop if Input.trigger?(:Y)
- return replay if Input.trigger?(:X)
- end
- #--------------------------------------------------------------------------
- # ● 決定ボタンが押されたときの処理
- #--------------------------------------------------------------------------
- def process_ok
- if current_item_enabled?
- #~ Sound.play_ok # Musicでは鳴らさない
- Input.update
- deactivate
- call_ok_handler
- else
- Sound.play_buzzer
- end
- end
- #--------------------------------------------------------------------------
- # ● OK時の処理
- #--------------------------------------------------------------------------
- def ok
- return if citem.nil?
- pth = path(@ctg)+citem
- case @ctg
- when BGM; Audio.bgm_play(pth)
- when BGS; Audio.bgs_play(pth)
- when ME; Audio.me_play(pth)
- when SE; Audio.se_play(pth)
- end
- end
- def stop(i=@ctg)
- case i
- when BGM; Audio.bgm_stop
- when BGS; Audio.bgs_stop
- when ME; Audio.me_stop
- when SE; Audio.se_stop
- end
- end
- def replay
- RPG::BGM.last.replay
- RPG::BGS.last.replay
- end
- end
- #==============================================================================
- # ■ Window_DebugSystem
- #==============================================================================
- class Window_DebugSystem < Window_DebugBaseCommand
- #--------------------------------------------------------------------------
- # ● コマンドリストの作成
- #--------------------------------------------------------------------------
- def make_command_list
- add_main_commands
- add_original_commands
- end
- #--------------------------------------------------------------------------
- # ● 主要コマンドをリストに追加
- #--------------------------------------------------------------------------
- def add_main_commands
- add_command("お金", :input)
- add_command("セーブ回数", :input)
- add_command("戦闘回数", :input)
- add_command("セーブ禁止", :ok)
- add_command("メニュー禁止", :ok)
- add_command("エンカウント禁止", :ok)
- add_command("並び替え禁止", :ok)
- add_command("全アイテム入手", :ok)
- add_command("解像度", :ok)
- end
- #--------------------------------------------------------------------------
- # ● 独自コマンドの追加用
- #--------------------------------------------------------------------------
- def add_original_commands
- add_command("用語辞典初期化", :ok, true, :dictionary) if defined?(Dictionary)
- add_command("ワールドマップ初期化", :ok, true, :worldmap) if defined?(WorldMap)
- add_command("クエストランク", :input, true, :quest_rank) if defined?(Quest)
- add_command("クエスト初期化", :ok, true, :quest) if defined?(Quest)
- end
- #--------------------------------------------------------------------------
- # ● 数取得
- #--------------------------------------------------------------------------
- def item(index)
- case index
- when 0; return $game_party.gold
- when 1; return $game_system.save_count
- when 2; return $game_system.battle_count
- when 3; return $game_system.save_disabled
- when 4; return $game_system.menu_disabled
- when 5; return $game_system.encounter_disabled
- when 6; return $game_system.formation_disabled
- else
- case @list[index][:ext]
- when :quest_rank; return $game_party.quest_rank
- end
- end
- return 0
- end
- #--------------------------------------------------------------------------
- # ● テキスト
- #--------------------------------------------------------------------------
- def text(index)
- case index
- when 0,1,2; return item(index)
- when 3,4,5,6; return item(index) ? "[禁止]" : "[許可]"
- when 8; return Graphics.width == 640 ? "640×480" : "544×416"
- else
- case @list[index][:ext]
- when :quest_rank; return Quest::RANK[item(index)] + "(#{item(index)})"
- end
- end
- return ""
- end
- #--------------------------------------------------------------------------
- # ● 項目の描画
- #--------------------------------------------------------------------------
- def draw_item(index)
- super(index)
- draw_text(item_rect_for_text(index), text(index), 2)
- end
- #--------------------------------------------------------------------------
- # ● 数値の最大桁数取得
- #--------------------------------------------------------------------------
- def num_max
- Math.log10(max).to_i + 1
- end
- #--------------------------------------------------------------------------
- # ● 数値の符号
- #--------------------------------------------------------------------------
- def sign
- false
- end
- #--------------------------------------------------------------------------
- # ● 数値のmaxmin値取得
- #--------------------------------------------------------------------------
- def min
- case @list[@index][:ext]
- when :quest_rank; return 1
- end
- 0
- end
- def max
- case @index
- when 0
- return $game_party.max_gold
- else
- case @list[@index][:ext]
- when :quest_rank; return 10
- end
- end
- 99999999
- end
- #--------------------------------------------------------------------------
- # ● アイテムの変更
- #--------------------------------------------------------------------------
- def change(n=0)
- case @index
- when 0; $game_party.gain_gold(n - $game_party.gold)
- when 1; $game_system.save_count = n
- when 2; $game_system.battle_count = n
- when 3; $game_system.save_disabled = n
- when 4; $game_system.menu_disabled = n
- when 5; $game_system.encounter_disabled = n
- when 6; $game_system.formation_disabled = n
- when 7; all_item
- when 8; resize_screen
- else
- case @list[@index][:ext]
- when :dictionary; $game_system.dictionary.reset
- when :worldmap; $game_system.worldmap.reset
- when :quest_rank; $game_party.quest_rank = n
- when :quest; $game_system.quest.reset
- end
- end
- end
- #--------------------------------------------------------------------------
- # ● OK時の処理
- #--------------------------------------------------------------------------
- def ok
- change(!number)
- redraw_current_item
- end
- #--------------------------------------------------------------------------
- # ● 数値の取得/設定
- #--------------------------------------------------------------------------
- def number
- item(@index)
- end
- def number=(n)
- change(n)
- redraw_current_item
- end
- #--------------------------------------------------------------------------
- # ● OK時の処理 : all item
- #--------------------------------------------------------------------------
- def all_item
- n = $data_items.size - 1
- n.times {|i| $game_party.gain_item($data_items[i+1], 1)}
- n = $data_weapons.size - 1
- n.times {|i| $game_party.gain_item($data_weapons[i+1], 1)}
- n = $data_armors.size - 1
- n.times {|i| $game_party.gain_item($data_armors[i+1], 1)}
- end
- #--------------------------------------------------------------------------
- # ● OK時の処理 : win_resize
- #--------------------------------------------------------------------------
- def resize_screen
- if Graphics.width == 640
- Graphics.resize_screen(544, 416)
- else
- Graphics.resize_screen(640, 480)
- end
- call_handler(:exit)
- end
- end
- #==============================================================================
- # ■ Window_DebugActorExpert
- #==============================================================================
- class Window_DebugActorExpert < Window_DebugActorStatus
- #--------------------------------------------------------------------------
- # ● コマンドリストの作成
- #--------------------------------------------------------------------------
- def make_command_list
- SysUpdate::ELEMENTS.each {|e| add_command(e, :ok, true, 2)}
- end
- #--------------------------------------------------------------------------
- # ● 項目の描画
- #--------------------------------------------------------------------------
- def draw_item(index)
- element_id = command_name(index)
- rect = item_rect_for_text(index)
- draw_attr_icon_pm(@actor, element_id, rect.x, rect.y)
- rect.x += 26
- rect.width -= 26
- draw_text(rect, SysUpdate.attr_name(element_id))
- attr = @actor.attr[element_id]
- draw_text(rect, attr.lv_limit, 2)
- rect.width -= 30
- draw_text(rect, "/", 2)
- rect.width -= 20
- draw_text(rect, attr.level, 2)
- end
- #--------------------------------------------------------------------------
- # ● 数値の最大桁数取得
- #--------------------------------------------------------------------------
- def num_max
- 2
- end
- #--------------------------------------------------------------------------
- # ● 数値の最大値取得
- #--------------------------------------------------------------------------
- def min
- 1
- end
- def max
- @actor.attr[command_name(@index)].lv_limit
- end
- #--------------------------------------------------------------------------
- # ● アイテムの変更
- #--------------------------------------------------------------------------
- def change(n)
- @actor.attr[command_name(@index)].level = n
- end
- #--------------------------------------------------------------------------
- # ● 数値の取得/設定
- #--------------------------------------------------------------------------
- def number
- @actor.attr[command_name(@index)].level
- end
- def number=(n)
- change(n)
- redraw_current_item
- end
- #--------------------------------------------------------------------------
- # ● 得意状態変更
- #--------------------------------------------------------------------------
- def change_taste
- attr = @actor.attr[command_name(@index)]
- attr.taste = (attr.taste + 1) % 3
- redraw_current_item
- end
- end
- #==============================================================================
- # ■ Window_DebugDictCtg
- #==============================================================================
- class Window_DebugDictCtg < Window_DebugBase
- #--------------------------------------------------------------------------
- # ● オブジェクト初期化
- #--------------------------------------------------------------------------
- def initialize(rect)
- r = rect.dup
- r.width = 120
- super(r)
- end
- #--------------------------------------------------------------------------
- # ● 項目数の取得
- #--------------------------------------------------------------------------
- def item_max
- $game_system.dictionary.size
- end
- #--------------------------------------------------------------------------
- # ● 用語カテゴリIDの取得
- #--------------------------------------------------------------------------
- def id(i)
- $game_system.dictionary.keys[i]
- end
- #--------------------------------------------------------------------------
- # ● アイテムの取得
- #--------------------------------------------------------------------------
- def item(i)
- $game_system.dictionary[id(i)]
- end
- #--------------------------------------------------------------------------
- # ● 項目の描画
- #--------------------------------------------------------------------------
- def draw_item(index)
- draw_text(item_rect_for_text(index), item(index).name)
- end
- #--------------------------------------------------------------------------
- # ● ヘルプウィンドウの更新
- #--------------------------------------------------------------------------
- def update_help
- @help_window.set_ctg(cid)
- end
- end
- #==============================================================================
- # ■ Window_DebugDictionary
- #==============================================================================
- class Window_DebugDictionary < Window_DebugBase
- #--------------------------------------------------------------------------
- # ● オブジェクト初期化
- #--------------------------------------------------------------------------
- def initialize(rect)
- @ctg = $game_system.dictionary.keys[0]
- super
- end
- #--------------------------------------------------------------------------
- # ● カテゴリ設定
- #--------------------------------------------------------------------------
- def set_ctg(ctg)
- return if @ctg == ctg
- @ctg = ctg
- create_contents
- refresh
- self.top_row = 0
- unselect
- end
- #--------------------------------------------------------------------------
- # ● 項目数の取得
- #--------------------------------------------------------------------------
- def item_max
- $game_system.dictionary[@ctg].size
- end
- #--------------------------------------------------------------------------
- # ● 用語IDの取得
- #--------------------------------------------------------------------------
- def id(i)
- $game_system.dictionary[@ctg].keys[i]
- end
- #--------------------------------------------------------------------------
- # ● アイテムの取得
- #--------------------------------------------------------------------------
- def item(i)
- $game_system.dictionary[@ctg][id(i)]
- end
- #--------------------------------------------------------------------------
- # ● アイテム名の取得
- #--------------------------------------------------------------------------
- def name(i)
- item(i).name.split(/\\n/)[0]
- end
- #--------------------------------------------------------------------------
- # ● アイテム状態の取得
- #--------------------------------------------------------------------------
- def status(i)
- item(i).show_flg
- end
- #--------------------------------------------------------------------------
- # ● 項目の描画
- #--------------------------------------------------------------------------
- def draw_item(index)
- draw_item_id_name_sw(index)
- end
- #--------------------------------------------------------------------------
- # ● アイテムの変更
- #--------------------------------------------------------------------------
- def change(n=0)
- $game_system.dictionary[@ctg][cid].show_flg = !citem.show_flg
- end
- end
- #==============================================================================
- # ■ Window_DebugWorldRegion
- #==============================================================================
- class Window_DebugWorldRegion < Window_DebugBase
- #--------------------------------------------------------------------------
- # ● オブジェクト初期化
- #--------------------------------------------------------------------------
- def initialize(rect)
- r = rect.dup
- r.height /= 2
- super(r)
- end
- #--------------------------------------------------------------------------
- # ● 項目数の取得
- #--------------------------------------------------------------------------
- def item_max
- WorldMap::REGION.size
- end
- #--------------------------------------------------------------------------
- # ● 用語カテゴリIDの取得
- #--------------------------------------------------------------------------
- def id(i)
- $game_system.worldmap.ids[i]
- end
- #--------------------------------------------------------------------------
- # ● アイテムの取得
- #--------------------------------------------------------------------------
- def item(i)
- $game_system.worldmap[id(i)]
- end
- #--------------------------------------------------------------------------
- # ● アイテム名の取得
- #--------------------------------------------------------------------------
- def name(i)
- item(i).region_name
- end
- #--------------------------------------------------------------------------
- # ● アイテム状態の取得
- #--------------------------------------------------------------------------
- def status(i)
- item(i).visible
- end
- #--------------------------------------------------------------------------
- # ● 項目の描画
- #--------------------------------------------------------------------------
- def draw_item(index)
- draw_item_id_name_sw(index)
- end
- #--------------------------------------------------------------------------
- # ● ヘルプウィンドウの更新
- #--------------------------------------------------------------------------
- def update_help
- @help_window.set_ctg(cid) unless @index < 0
- end
- #--------------------------------------------------------------------------
- # ● アイテムの変更
- #--------------------------------------------------------------------------
- def change(n=0)
- $game_system.worldmap[cid].visible = !cstatus
- end
- end
- #==============================================================================
- # ■ Window_DebugWorldTown
- #==============================================================================
- class Window_DebugWorldTown < Window_DebugBase
- #--------------------------------------------------------------------------
- # ● オブジェクト初期化
- #--------------------------------------------------------------------------
- def initialize(rect)
- @ctg = $game_system.worldmap.ids[0]
- super(rect)
- end
- #--------------------------------------------------------------------------
- # ● カテゴリ設定
- #--------------------------------------------------------------------------
- def set_ctg(ctg)
- return if @ctg == ctg
- @ctg = ctg
- create_contents
- refresh
- self.top_row = 0
- unselect
- end
- #--------------------------------------------------------------------------
- # ● 項目数の取得
- #--------------------------------------------------------------------------
- def item_max
- $game_system.worldmap[@ctg].ids.size
- end
- #--------------------------------------------------------------------------
- # ● タウンIDの取得
- #--------------------------------------------------------------------------
- def id(i)
- $game_system.worldmap[@ctg].ids[i]
- end
- #--------------------------------------------------------------------------
- # ● アイテムの取得
- #--------------------------------------------------------------------------
- def item(i)
- $game_system.worldmap[@ctg][id(i)]
- end
- #--------------------------------------------------------------------------
- # ● アイテム名の取得
- #--------------------------------------------------------------------------
- def name(i)
- item(i).town_name
- end
- #--------------------------------------------------------------------------
- # ● アイテム状態の取得
- #--------------------------------------------------------------------------
- def status(i)
- item(i).visible
- end
- #--------------------------------------------------------------------------
- # ● 項目の描画
- #--------------------------------------------------------------------------
- def draw_item(index)
- draw_item_id_name_sw(index)
- end
- #--------------------------------------------------------------------------
- # ● アイテムの変更
- #--------------------------------------------------------------------------
- def change(n=0)
- $game_system.worldmap[@ctg][cid].visible = !cstatus
- end
- end
- #==============================================================================
- # ■ Window_DebugQuestCtg
- #==============================================================================
- class Window_DebugQuestCtg < Window_DebugBaseHorzCommand
- #--------------------------------------------------------------------------
- # ● コマンドリストの作成
- #--------------------------------------------------------------------------
- def make_command_list
- ["イベントクエスト", "ギルドクエスト"].each {|n| add_command(n, :ok) }
- end
- #--------------------------------------------------------------------------
- # ● ヘルプウィンドウの更新
- #--------------------------------------------------------------------------
- def update_help
- @help_window.set_ctg(@index)
- end
- end
- #==============================================================================
- # ■ Window_DebugQuest
- #==============================================================================
- class Window_DebugQuest < Window_DebugBase
- #--------------------------------------------------------------------------
- # ● オブジェクト初期化
- #--------------------------------------------------------------------------
- def initialize(rect)
- @ctg = 0
- data_refresh
- super(rect)
- end
- #--------------------------------------------------------------------------
- # ● カテゴリデータ集計
- #--------------------------------------------------------------------------
- def data_refresh
- @commands = []
- $game_system.quest.ids.each do |id|
- data = $game_system.quest[id]
- case @ctg
- when 0; @commands.push(data) if !data.enable
- when 1; @commands.push(data) if data.enable
- end
- end
- end
- #--------------------------------------------------------------------------
- # ● カテゴリ設定
- #--------------------------------------------------------------------------
- def set_ctg(ctg)
- return if @ctg == ctg
- @ctg = ctg
- data_refresh
- create_contents
- refresh
- self.top_row = 0
- unselect
- end
- #--------------------------------------------------------------------------
- # ● 項目数の取得
- #--------------------------------------------------------------------------
- def item_max
- @commands.size
- end
- #--------------------------------------------------------------------------
- # ● クエストIDの取得
- #--------------------------------------------------------------------------
- def id(i)
- @commands[i].id
- end
- #--------------------------------------------------------------------------
- # ● アイテムの取得
- #--------------------------------------------------------------------------
- def item(i)
- @commands[i]
- end
- #--------------------------------------------------------------------------
- # ● アイテム名の取得
- #--------------------------------------------------------------------------
- def name(i)
- Quest.conv_text(item(i).name)
- end
- #--------------------------------------------------------------------------
- # ● ステータステキスト
- #--------------------------------------------------------------------------
- def status_text(index)
- quest = item(index)
- quest.playing ? "[進行中(開始)]" :
- quest.clear ? "[クリア済み]" :
- quest.fail ? "[失敗]": "[未開始]"
- end
- #--------------------------------------------------------------------------
- # ● 項目の描画
- #--------------------------------------------------------------------------
- def draw_item(index)
- draw_item_id_name_sw(index)
- end
- #--------------------------------------------------------------------------
- # ● ヘルプウィンドウの更新
- #--------------------------------------------------------------------------
- def update_help
- @help_window.set_id(cid)
- end
- #--------------------------------------------------------------------------
- # ● OK時の処理
- #--------------------------------------------------------------------------
- def ok
- redraw_current_item
- @help_window.refresh
- end
- end
- #==============================================================================
- # ■ Window_DebugQuestStatus
- #==============================================================================
- class Window_DebugQuestStatus < Window_DebugBaseHorzCommand
- #--------------------------------------------------------------------------
- # ● オブジェクト初期化
- #--------------------------------------------------------------------------
- def initialize(rect)
- @id = nil
- super(rect)
- end
- #--------------------------------------------------------------------------
- # ● クエストID設定
- #--------------------------------------------------------------------------
- def set_id(id)
- return if @id == id
- @id = id
- return contents.clear if id.nil?
- refresh
- end
- #--------------------------------------------------------------------------
- # ● コマンド名の取得
- #--------------------------------------------------------------------------
- def command_name(index)
- super + (command_enabled?(index) ? "[ON]" : "[OFF]")
- end
- #--------------------------------------------------------------------------
- # ● コマンドの有効状態を取得
- #--------------------------------------------------------------------------
- def command_enabled?(index)
- return false if @id.nil?
- case index
- when 0; return $game_system.quest[@id].visible
- when 1; return $game_system.quest[@id].view_res
- when 2; return $game_system.quest[@id].view_cond
- end
- end
- #--------------------------------------------------------------------------
- # ● コマンドリストの作成
- #--------------------------------------------------------------------------
- def make_command_list
- add_command("一覧", :ok)
- add_command("報酬", :ok)
- add_command("進捗", :ok)
- end
- end
- #==============================================================================
- # ■ Window_DebugQuestCmd
- #==============================================================================
- class Window_DebugQuestCmd < Window_DebugBase
- #--------------------------------------------------------------------------
- # ● オブジェクト初期化
- #--------------------------------------------------------------------------
- def initialize(rect)
- @commands = [
- "進捗中(開始)", "クリア済み", "失敗",
- "表示切替", "報酬表示切替", "進捗表示切替",
- "リセット"
- ]
- rect.width = 160
- rect.x = Graphics.width - rect.width
- super(rect)
- end
- #--------------------------------------------------------------------------
- # ● ウィンドウの表示
- #--------------------------------------------------------------------------
- def show
- #~ self.visible = true
- self
- end
- #--------------------------------------------------------------------------
- # ● ウィンドウの非表示
- #--------------------------------------------------------------------------
- def hide
- #~ self.visible = false
- self
- end
- #--------------------------------------------------------------------------
- # ● ウィンドウのアクティブ化
- #--------------------------------------------------------------------------
- def activate
- self.visible = true
- self.active = true
- self
- end
- #--------------------------------------------------------------------------
- # ● ウィンドウの非アクティブ化
- #--------------------------------------------------------------------------
- def deactivate
- self.visible = false
- self.active = false
- self
- end
- #--------------------------------------------------------------------------
- # ● 項目数の取得
- #--------------------------------------------------------------------------
- def item_max
- @commands.size
- end
- #--------------------------------------------------------------------------
- # ● アイテムの取得
- #--------------------------------------------------------------------------
- def item(i)
- @commands[i]
- end
- #--------------------------------------------------------------------------
- # ● 項目の描画
- #--------------------------------------------------------------------------
- def draw_item(index)
- draw_text(item_rect_for_text(index), item(index))
- end
- #--------------------------------------------------------------------------
- # ● ヘルプウィンドウの更新
- #--------------------------------------------------------------------------
- def update_help
- # 何もしない
- end
- #--------------------------------------------------------------------------
- # ● OK時の処理
- #--------------------------------------------------------------------------
- def ok
- case @index
- when 0; @help_window.citem.quest_start
- when 1; @help_window.citem.quest_clear(true, false) # 強制
- when 2; @help_window.citem.quest_fail(true, false) # 強制
- when 3; @help_window.citem.visible = !@help_window.citem.visible
- when 4; @help_window.citem.view_res = !@help_window.citem.view_res
- when 5; @help_window.citem.view_cond = !@help_window.citem.view_cond
- when 6; @help_window.citem.reset
- end
- hide
- @help_window.activate.ok
- end
- end
- #==============================================================================
- # ■ Window_DebugSpirit
- #==============================================================================
- class Window_DebugSpirit < Window_DebugBase
- #--------------------------------------------------------------------------
- # ● 項目数の取得
- #--------------------------------------------------------------------------
- def item_max
- Spirits::SPIRIT_ACTOR.size
- end
- #--------------------------------------------------------------------------
- # ● 精霊IDの取得
- #--------------------------------------------------------------------------
- def id(i)
- Spirits::SPIRIT_ACTOR.keys[i]
- end
- #--------------------------------------------------------------------------
- # ● アクターIDの取得
- #--------------------------------------------------------------------------
- def aid(i)
- Spirits.actor_id(id(i))
- end
- #--------------------------------------------------------------------------
- # ● アイテムの取得
- #--------------------------------------------------------------------------
- def item(i)
- $game_actors[aid(i)]
- end
- #--------------------------------------------------------------------------
- # ● アイテムの変更
- #--------------------------------------------------------------------------
- def change
- if status(@index)
- $game_party.remove_spirit(cid)
- else
- $game_party.add_spirit(cid)
- end
- end
- #--------------------------------------------------------------------------
- # ● アイテム状態の取得
- #--------------------------------------------------------------------------
- def status(i)
- $game_party.include_spirit?(id(i))
- end
- #--------------------------------------------------------------------------
- # ● ステータステキスト
- #--------------------------------------------------------------------------
- def status_text(i)
- status(i) ? "[加入]" : "[未加入]"
- end
- #--------------------------------------------------------------------------
- # ● 名前の描画
- #--------------------------------------------------------------------------
- def draw_index_name(rect, index)
- draw_actor_line_graphic(item(index), rect.x, rect.y)
- draw_spirit_name(item(index), rect.x + 34, rect.y)
- end
- #--------------------------------------------------------------------------
- # ● 項目の描画
- #--------------------------------------------------------------------------
- def draw_item(index)
- draw_item_id_name_sw(index)
- end
- end
- #==============================================================================
- # ■ Scene_Debug
- #------------------------------------------------------------------------------
- # デバッグ画面の処理を行うクラスです。
- #==============================================================================
- class Scene_Debug < Scene_MenuBase
- #--------------------------------------------------------------------------
- # ● 開始処理
- #--------------------------------------------------------------------------
- def start
- super
- init_sub_windows
- create_help_window
- create_cmd_window
- create_number_window
- create_main_windows
- create_original_windows
- create_system_window if DebugPP.spec("システム")
- @sub[@cmd_window.index].each {|w| w.show}
- end
- #--------------------------------------------------------------------------
- # ● 主要コマンド用ウィンドウを生成
- #--------------------------------------------------------------------------
- def create_main_windows
- create_switch_window if DebugPP.spec("スイッチ")
- create_variable_window if DebugPP.spec("変数")
- create_selfsw_window if DebugPP.spec("セルフSW")
- create_item_window if DebugPP.spec("アイテム")
- create_weapon_window if DebugPP.spec("武器")
- create_armor_window if DebugPP.spec("防具")
- create_party_window if DebugPP.spec("パーティー")
- create_actor_window if DebugPP.spec("ステータス")
- create_skill_window if DebugPP.spec("スキル")
- create_map_window if DebugPP.spec("MAP移動")
- create_music_window if DebugPP.spec("ミュージック")
- end
- #--------------------------------------------------------------------------
- # ● オリジナルコマンド用ウィンドウを生成
- #--------------------------------------------------------------------------
- def create_original_windows
- create_expert_window if defined?(SysUpdate) and DebugPP.spec("熟練度")
- create_dict_window if defined?(Dictionary) and DebugPP.spec("用語辞典")
- create_worldmap_window if defined?(WorldMap) and DebugPP.spec("WorldMap")
- create_quest_window if defined?(Quest) and DebugPP.spec("クエスト")
- create_spirit_window if defined?(Spirits) and DebugPP.spec("精霊")
- end
- #--------------------------------------------------------------------------
- # ● 終了処理
- #--------------------------------------------------------------------------
- def terminate
- super
- #$game_map.refresh
- end
- #--------------------------------------------------------------------------
- # ● 子Window情報の初期化
- #--------------------------------------------------------------------------
- def init_sub_windows
- @sub = []
- @sub_i = 0
- end
- #--------------------------------------------------------------------------
- # ● ヘルプウィンドウの作成
- #--------------------------------------------------------------------------
- def create_help_window
- @help_window = Window_Help.new
- @help_window.y = Graphics.height - @help_window.height
- end
- #--------------------------------------------------------------------------
- # ● コマンドウィンドウの作成
- #--------------------------------------------------------------------------
- def create_cmd_window
- @cmd_window = Window_DebugCommand.new(@help_window.y)
- @cmd_window.set_handler(:ok, method(:enable_sub_window))
- @cmd_window.set_handler(:cancel, method(:return_scene))
- @cmd_window.set_handler(:update, method(:change_sub_window))
- @cmd_window.help_window = @help_window
- end
- #--------------------------------------------------------------------------
- # ● コマンド・ヘルプ以外のエリア
- #--------------------------------------------------------------------------
- def area
- Rect.new(@cmd_window.width, 0, Graphics.width - @cmd_window.width, @help_window.y)
- end
- #--------------------------------------------------------------------------
- # ● 子Window参照
- #--------------------------------------------------------------------------
- def sub
- @sub[@cmd_window.index][@sub_i]
- end
- #--------------------------------------------------------------------------
- # ● 子Window領域
- #--------------------------------------------------------------------------
- def sub_area
- w = sub
- Rect.new(w.x, w.y, w.width, w.height)
- end
- #--------------------------------------------------------------------------
- # ● 子Window差し替え
- #--------------------------------------------------------------------------
- def change_sub_window
- @sub.size.times do |i|
- i == @cmd_window.index ? @sub[i].each {|w| w.show} :
- @sub[i].each {|w| w.hide}
- end
- end
- #--------------------------------------------------------------------------
- # ● 子Window有効化
- #--------------------------------------------------------------------------
- def enable_sub_window
- sub.activate.select(0)
- @num_window.item_window = sub
- end
- #--------------------------------------------------------------------------
- # ● 子Window無効化(all)
- #--------------------------------------------------------------------------
- def disable_sub_window
- @sub[@cmd_window.index].each {|w| w.deactivate.unselect}
- @num_window.item_window = nil
- end
- #--------------------------------------------------------------------------
- # ● 子WindowのOK処理
- #--------------------------------------------------------------------------
- def ok_sub_window
- sub.activate.ok
- end
- #--------------------------------------------------------------------------
- # ● 子WindowのOK処理(前の子Windowへ)
- #--------------------------------------------------------------------------
- def ok_prev_sub_window
- sub.ok
- prev_sub_window
- end
- #--------------------------------------------------------------------------
- # ● 子WindowのOK処理(次の子Windowへ)
- #--------------------------------------------------------------------------
- def next_sub_window
- sub.deactivate
- @sub_i += 1
- sub.activate
- sub.select(0) if sub.index < 0
- end
- #--------------------------------------------------------------------------
- # ● 子WindowのOK処理(前の子Windowへ)
- #--------------------------------------------------------------------------
- def prev_sub_window
- sub.deactivate
- @sub_i -= 1
- sub.activate
- sub.select(0) if sub.index < 0
- end
- #--------------------------------------------------------------------------
- # ● 子WindowのCancel処理
- #--------------------------------------------------------------------------
- def cancel_sub_window
- disable_sub_window
- @cmd_window.activate
- end
- #--------------------------------------------------------------------------
- # ● 数値ウィンドウの作成
- #--------------------------------------------------------------------------
- def create_number_window
- @num_window = Window_DebugInputNum.new(area)
- @num_window.z = 1000
- @num_window.set_handler(:ok, method(:ok_num_window))
- @num_window.set_handler(:cancel, method(:cancel_num_window))
- end
- #--------------------------------------------------------------------------
- # ● 数値Windowの有効化
- #--------------------------------------------------------------------------
- def enable_num_window
- @num_window.show.activate.select_last.num = sub.number
- end
- #--------------------------------------------------------------------------
- # ● 数値Windowの有効化<resize>
- #--------------------------------------------------------------------------
- def enable_num_window_resize
- @num_window.show.activate.area(sub_area).sign = sub.sign
- @num_window.show.activate.area(sub_area).num_max = sub.num_max
- @num_window.select_last.num = sub.number
- end
- #--------------------------------------------------------------------------
- # ● 数値Windowの有効化<resize & maxmin>
- #--------------------------------------------------------------------------
- def enable_num_window_resize_maxmin
- @num_window.show.activate.area(sub_area).sign = sub.sign
- @num_window.show.activate.area(sub_area).num_max = sub.num_max
- @num_window.select_last.max = sub.max
- @num_window.select_last.min = sub.min
- @num_window.select_last.num = sub.number
- end
- #--------------------------------------------------------------------------
- # ● 数値Window無効化
- #--------------------------------------------------------------------------
- def disable_num_window
- @num_window.hide.deactivate.area(area)
- end
- #--------------------------------------------------------------------------
- # ● 数値WindowのOK処理
- #--------------------------------------------------------------------------
- def ok_num_window
- sub.number = @num_window.num
- sub.activate
- disable_num_window
- end
- #--------------------------------------------------------------------------
- # ● 数値WindowのCancel処理
- #--------------------------------------------------------------------------
- def cancel_num_window
- disable_num_window
- sub.activate
- end
- #--------------------------------------------------------------------------
- # ● スイッチWindow作成
- #--------------------------------------------------------------------------
- def create_switch_window
- @switch_window = Window_DebugSwitch.new(area)
- @switch_window.set_handler(:ok, method(:ok_sub_window))
- @switch_window.set_handler(:cancel, method(:cancel_sub_window))
- @sub.push([@switch_window])
- end
- #--------------------------------------------------------------------------
- # ● 変数Window作成
- #--------------------------------------------------------------------------
- def create_variable_window
- @variable_window = Window_DebugVariable.new(area)
- @variable_window.set_handler(:ok, method(:enable_num_window_resize_maxmin))
- @variable_window.set_handler(:cancel, method(:cancel_sub_window))
- @sub.push([@variable_window])
- end
- #--------------------------------------------------------------------------
- # ● セルフスイッチWindow作成
- #--------------------------------------------------------------------------
- def create_selfsw_window
- rect = area
- @selfsw_window = Window_DebugSelfSwitch.new(rect)
- rect.height = rect.height - @selfsw_window.height
- @selfsw_window.y = rect.height
- @selfsw_window.set_handler(:ok, method(:ok_sub_window))
- @selfsw_window.set_handler(:cancel, method(:prev_sub_window))
- @ss_map_window = Window_DebugMapSelfSw.new(rect)
- @ss_map_window.set_handler(:ok, method(:next_sub_window))
- @ss_map_window.set_handler(:cancel, method(:cancel_sub_window))
- @ss_map_window.help_window = @selfsw_window
- @sub.push([@ss_map_window, @selfsw_window])
- end
- #--------------------------------------------------------------------------
- # ● アイテムWindow作成
- #--------------------------------------------------------------------------
- def create_item_window
- @item_window = Window_DebugItem.new(area)
- @item_window.set_handler(:ok, method(:enable_num_window_resize_maxmin))
- @item_window.set_handler(:cancel, method(:cancel_sub_window))
- @sub.push([@item_window])
- end
- #--------------------------------------------------------------------------
- # ● 武器Window作成
- #--------------------------------------------------------------------------
- def create_weapon_window
- @weapon_window = Window_DebugWeapon.new(area)
- @weapon_window.set_handler(:ok, method(:enable_num_window_resize_maxmin))
- @weapon_window.set_handler(:cancel, method(:cancel_sub_window))
- @sub.push([@weapon_window])
- end
- #--------------------------------------------------------------------------
- # ● 防具Window作成
- #--------------------------------------------------------------------------
- def create_armor_window
- @armor_window = Window_DebugArmor.new(area)
- @armor_window.set_handler(:ok, method(:enable_num_window_resize_maxmin))
- @armor_window.set_handler(:cancel, method(:cancel_sub_window))
- @sub.push([@armor_window])
- end
- #--------------------------------------------------------------------------
- # ● パーティーWindow作成
- #--------------------------------------------------------------------------
- def create_party_window
- @party_window = Window_DebugParty.new(area)
- @party_window.set_handler(:ok, method(:ok_sub_window))
- @party_window.set_handler(:cancel, method(:cancel_sub_window))
- @sub.push([@party_window])
- end
- #--------------------------------------------------------------------------
- # ● アクターステータスWindow作成
- #--------------------------------------------------------------------------
- def create_actor_window
- rect = area
- @actor_window = Window_DebugActor.new(rect)
- @actor_window.set_handler(:ok, method(:next_sub_window))
- @actor_window.set_handler(:cancel, method(:cancel_sub_window))
- rect.x += @actor_window.width
- rect.width -= @actor_window.width
- @actor_st_window = Window_DebugActorStatus.new(rect)
- @actor_st_window.set_handler(:ok, method(:enable_num_window_resize))
- @actor_st_window.set_handler(:cancel, method(:prev_sub_window))
- @actor_window.help_window = @actor_st_window
- @sub.push([@actor_window, @actor_st_window])
- end
- #--------------------------------------------------------------------------
- # ● スキルWindow作成
- #--------------------------------------------------------------------------
- def create_skill_window
- rect = area
- @skill_window = Window_DebugActor.new(rect)
- @skill_window.set_handler(:ok, method(:next_sub_window))
- @skill_window.set_handler(:cancel, method(:cancel_sub_window))
- rect.x += @skill_window.width
- rect.width -= @skill_window.width
- @skills_window = Window_DebugActorSkill.new(rect)
- @skills_window.set_handler(:ok, method(:ok_sub_window))
- @skills_window.set_handler(:cancel, method(:prev_sub_window))
- @skill_window.help_window = @skills_window
- @sub.push([@skill_window, @skills_window])
- end
- #--------------------------------------------------------------------------
- # ● MapWindow作成
- #--------------------------------------------------------------------------
- def create_map_window
- @map_window = Window_DebugMap.new(area)
- @map_window.set_handler(:ok, method(:return_scene))
- @map_window.set_handler(:cancel, method(:cancel_sub_window))
- @sub.push([@map_window])
- end
- #--------------------------------------------------------------------------
- # ● ミュージックWindow作成
- #--------------------------------------------------------------------------
- def create_music_window
- rect = area
- @music_ctg_window = Window_DebugMusicCtg.new(rect)
- rect.y += @music_ctg_window.height
- rect.height -= @music_ctg_window.height
- @music_ctg_window.set_handler(:ok, method(:next_sub_window))
- @music_ctg_window.set_handler(:cancel, method(:cancel_sub_window))
- @mugic_window = Window_DebugMusic.new(rect)
- @mugic_window.set_handler(:ok, method(:ok_sub_window))
- @mugic_window.set_handler(:cancel, method(:prev_sub_window))
- @music_ctg_window.help_window = @mugic_window
- @sub.push([@music_ctg_window, @mugic_window])
- end
- #--------------------------------------------------------------------------
- # ● システムWindow作成
- #--------------------------------------------------------------------------
- def create_system_window
- @system_window = Window_DebugSystem.new(area)
- @system_window.set_handler(:ok, method(:ok_sub_window))
- @system_window.set_handler(:input, method(:enable_num_window_resize_maxmin))
- @system_window.set_handler(:cancel, method(:cancel_sub_window))
- @system_window.set_handler(:exit, method(:return_scene))
- @sub.push([@system_window])
- end
- #--------------------------------------------------------------------------
- # ● 熟練度Window作成
- #--------------------------------------------------------------------------
- def create_expert_window
- rect = area
- @exp_act_window = Window_DebugActor.new(rect)
- @exp_act_window.set_handler(:ok, method(:next_sub_window))
- @exp_act_window.set_handler(:cancel, method(:cancel_sub_window))
- rect.x += @exp_act_window.width
- rect.width -= @exp_act_window.width
- @expert_window = Window_DebugActorExpert.new(rect)
- @expert_window.set_handler(:ok, method(:enable_num_window_resize_maxmin))
- @expert_window.set_handler(:cancel, method(:prev_sub_window))
- @expert_window.set_handler(:x, method(:change_taste))
- @exp_act_window.help_window = @expert_window
- @sub.push([@exp_act_window, @expert_window])
- end
- def change_taste
- sub.change_taste
- end
- #--------------------------------------------------------------------------
- # ● 用語辞典Window作成
- #--------------------------------------------------------------------------
- def create_dict_window
- rect = area
- @dict_ctg_window = Window_DebugDictCtg.new(rect)
- @dict_ctg_window.set_handler(:ok, method(:next_sub_window))
- @dict_ctg_window.set_handler(:cancel, method(:cancel_sub_window))
- rect.x += @dict_ctg_window.width
- rect.width -= @dict_ctg_window.width
- @dictionary_window = Window_DebugDictionary.new(rect)
- @dictionary_window.set_handler(:ok, method(:ok_sub_window))
- @dictionary_window.set_handler(:cancel, method(:prev_sub_window))
- @dict_ctg_window.help_window = @dictionary_window
- @sub.push([@dict_ctg_window, @dictionary_window])
- end
- #--------------------------------------------------------------------------
- # ● ワールドマップWindow作成
- #--------------------------------------------------------------------------
- def create_worldmap_window
- rect = area
- @wd_region_window = Window_DebugWorldRegion.new(rect)
- @wd_region_window.set_handler(:ok, method(:next_sub_window))
- @wd_region_window.set_handler(:cancel, method(:cancel_sub_window))
- @wd_region_window.set_handler(:x, method(:ok_sub_window))
- rect.y += @wd_region_window.height
- rect.height -= @wd_region_window.height
- @wd_town_window = Window_DebugWorldTown.new(rect)
- @wd_town_window.set_handler(:ok, method(:ok_sub_window))
- @wd_town_window.set_handler(:cancel, method(:prev_sub_window))
- @wd_region_window.help_window = @wd_town_window
- @sub.push([@wd_region_window, @wd_town_window])
- end
- #--------------------------------------------------------------------------
- # ● クエストWindow作成
- #--------------------------------------------------------------------------
- def create_quest_window
- rect = area
- @qt_ctg_window = Window_DebugQuestCtg.new(rect)
- @qt_ctg_window.set_handler(:ok, method(:next_sub_window))
- @qt_ctg_window.set_handler(:cancel, method(:cancel_sub_window))
-
- rect.y += @qt_ctg_window.height
- rect.height -= @qt_ctg_window.height
- @qt_st_window = Window_DebugQuestStatus.new(rect)
- @qt_st_window.y = rect.y + rect.height - @qt_st_window.height
-
- rect.height -= @qt_st_window.height
- @quest_window = Window_DebugQuest.new(rect)
- @quest_window.set_handler(:ok, method(:next_sub_window))
- @quest_window.set_handler(:cancel, method(:prev_sub_window))
- @qt_cmd_window = Window_DebugQuestCmd.new(rect)
- @qt_cmd_window.set_handler(:ok, method(:ok_prev_sub_window))
- @qt_cmd_window.set_handler(:cancel, method(:prev_sub_window))
- @qt_ctg_window.help_window = @quest_window
- @quest_window.help_window = @qt_st_window
- @qt_cmd_window.help_window = @quest_window
- @sub.push([@qt_ctg_window, @quest_window, @qt_cmd_window, @qt_st_window])
- end
- #--------------------------------------------------------------------------
- # ● 精霊Window作成
- #--------------------------------------------------------------------------
- def create_spirit_window
- @spirit_window = Window_DebugSpirit.new(area)
- @spirit_window.set_handler(:ok, method(:ok_sub_window))
- @spirit_window.set_handler(:cancel, method(:cancel_sub_window))
- @sub.push([@spirit_window])
- end
- end
复制代码 |
评分
-
查看全部评分
|