【解決済み】戦闘中にステートの詳細を確認

TOMO
記事: 343
登録日時: 2015年11月16日(月) 20:12
連絡を取る:

Re: 【解決済み】戦闘中にステートの詳細を確認

投稿記事by TOMO » 2017年5月07日(日) 22:03

掲示板の方にバグ(?)の報告がきたので、修正しました

・一覧に表示させないステートを指定できるように変更
ヘルプウィンドウにスキル等の情報が残るバグを修正

コード: 全て選択

module TOMO
  module StateHelp
    # 説明文の設定
    # ステートID => 説明文
    #
    # 説明文に制御文字が使えます
    Text = {
      1 => "HPが0になり、死亡した状態。", # 戦闘不能
      2 => "\\C[2]テスト\\C[0]", # 毒
    }
   
    # 一覧に表示させないステートID
    HideState = [9]
  end
end

class Window_StateList < Window_Command
  def make_command_list
    states = []
    ($game_party.members + $game_troop.members).each do |battler|
      states |= battler.states.collect{|s| s.id }
    end
    states.sort!
    states.each do |state_id|
      next if TOMO::StateHelp::HideState.include?(state_id)
      state = $data_states[state_id]
      add_command(state.name, :state_list, true, state)
    end
  end
 
  def window_width
    Graphics.width
  end
 
  def window_height
    Graphics.height - fitting_height(2)
  end
 
  def process_ok
  end
 
  def draw_item(index)
    change_color(normal_color, command_enabled?(index))
    rect = item_rect_for_text(index)
    draw_item_name(@list[index][:ext], rect.x, rect.y)
  end
 
  def update_help
    if @help_window && current_ext
      text = TOMO::StateHelp::Text[current_ext.id]
      text = "" if TOMO::StateHelp::Text[current_ext.id].nil?
      text += "\r\n\\}"
      ($game_party.members + $game_troop.members).each do |battler|
        text += battler.name + " " if battler.state?(current_ext.id)
      end
      @help_window.set_text(text)
    end
  end
 
  def show
    refresh
    select(0)
    @help_window.show if @help_window
    super
  end
 
  def hide
    @help_window.hide if @help_window
    super
  end
end

class Window_PartyCommand < Window_Command
  alias tomo_state_help_make_command_list make_command_list
  def make_command_list
    tomo_state_help_make_command_list
    add_command("ステート確認", :state)
  end
end

class Scene_Battle < Scene_Base
  alias tomo_state_help_create_party_command_window create_party_command_window
  def create_party_command_window
    tomo_state_help_create_party_command_window
    @party_command_window.set_handler(:state, method(:command_state))
    @party_command_window.unselect
  end
 
  alias tomo_state_help_create_all_windows create_all_windows
  def create_all_windows
    tomo_state_help_create_all_windows
    @state_window = Window_StateList.new(0, @help_window.height)
    @state_window.set_handler(:cancel, method(:on_state_cancel))
    @state_window.help_window = @help_window
    @state_window.hide
  end
 
  def command_state
    @party_command_window.deactivate
    @help_window.set_text("")
    @state_window.show.activate
  end
 
  def on_state_cancel
    @state_window.hide.deactivate
    @party_command_window.activate
  end
end

アロエ
記事: 9
登録日時: 2017年4月11日(火) 22:51

Re: 【解決済み】戦闘中にステートの詳細を確認

投稿記事by アロエ » 2017年10月03日(火) 23:23

TOMOさんへ
何らかのステートにかかった状態で戦闘が開始されると
スキルやアイテムの説明欄にステートの詳細説明が表示されてしまいます

この状態は
・スキルかアイテムが一つの場合は方向キーの入力
・複数ある場合は別のものを選択しようとする
この二つの条件で発生することと、パーティコマンド選択時にキャンセルキーを押すと解除できることを確認しています

もし修正が可能であればよろしくお願いします
TOMO
記事: 343
登録日時: 2015年11月16日(月) 20:12
連絡を取る:

Re: 【解決済み】戦闘中にステートの詳細を確認

投稿記事by TOMO » 2017年10月04日(水) 01:30

スクリプト中の

コード: 全て選択

@state_window.hide

コード: 全て選択

@state_window.hide.deactivate
に置き換えれば直るはずです
アロエ
記事: 9
登録日時: 2017年4月11日(火) 22:51

Re: 【解決済み】戦闘中にステートの詳細を確認

投稿記事by アロエ » 2017年10月04日(水) 22:27

ありがとうございます

“VX / Ace:スクリプト素材のリクエスト” へ戻る