질문과 답변

Extra Form

=begin ************************************************************************
 ▼ WGB Battle Layout (Layout part) ver1.01
   By ziifee ( http://neomemo.web.fc2.com/ )
   Localization Team: Mr. Bubble and TakamiDaisuke
      Script that creates the wait gauge accumulation system.
     
      <Table of Contents : Please use the search feature (Ctrl+F)>
      >>> Super Class base
        > Wait Gauge command creation
        > Status Indicator Display
        > Battle Help + Message Rewrite

      <Required Scripts>
        > State Animation Ver 2.0
        > Damage Pop Script Ver2.0
       
      < Required Images : Graphics/System/ >
        Cursor Image    : TargetCursor
        Command Image   : Spin40
        Wait Gauge Bar  : (See Wait Gauge Plugin)
        Wait Gauge Back : (See Wait Gauge Plugin)
       
      <Notes to Scripters>
      - In Battle, text is displayed in the help window using the following
        method: set_battle_help("Displayed Text")
          set_battle_help("Secret Artes") # Secret Artes Text is displayed
      - Battle Messages are disabled, but will still show up if called through
        an event command.

=end # ************************************************************************

module ZiiN7
# ▼ Setting ( true / false )
  HelpOn = true  # Display Skill/Item description in a help window.
 
  # ▼ Spin Command/Icon Index Number
  ATTACK = 2713                                # Attack (Default)
  GUARD = 2721                                # Guard
  SKILL = 2736                              # Skill
  ITEM = 2724                                # Item
  ESCAPE = 2756                              # Escape

  # ▼ Spin Command/Direction of Rotation ( "normal" or "reverse" )
  #   Determines how Spin Command rotates according to left/right key press.
  TURN = "normal"
 
  # ▼ WP Gauge Settings (Images in Graphics/System folder)
  WPGauge   = ""                            # Body Gauge Image
  WPMax     = ""                            # Max Gauge Image
  WPBack    = ""                            # Background Gauge Image
  WPFore    = ""                            # Foreground Gauge Image
  WPX , WPY = -12 , -90                     # Gauge coordinate x,y
  WPOffX    = 0                             # Shift Meter X
  WPOffY    = 0                             # Shift Meter Y

  #--------------------------------------------------------------------------
  # ● 通常回転 の判定 (スピンコマンド)
  #--------------------------------------------------------------------------
  def self.turn_normal?
    return false if TURN == "reverse"
    return true
  end
end

=begin ----------#
# ▼ Related Stuff ▼ #                                         Ver.SpinCommand
#-MyMemo-------------------------------------------------===================---
    - Party Command window is disabled and will instead start from Actor Command.
    - @active_battler has been changed to @select_battler in certain cases.
    - Window relation, without moving info!
    - Relation between Spin Command and Background has been deleted.
=end # ------------------------------------------------------------------------

=begin ************************************************************************
  ◆ ベース用スーパークラス作成
=end # ************************************************************************

#==============================================================================
# ■ Window_SpinCommand
#------------------------------------------------------------------------------
#  回転用コマンド選択を行うウィンドウです。
#==============================================================================

class Window_SpinCommand < Window_Base
  #--------------------------------------------------------------------------
  # ● 公開インスタンス変数
  #--------------------------------------------------------------------------
  attr_reader   :index                    # カーソル位置
  attr_reader   :help_window              # ヘルプウィンドウ
  #--------------------------------------------------------------------------
  # ● Object Initialization
  #     cx / cy  : Center Coordinates
  #     commands : Command Arrangement ([name, kind, pull, enabled?])
  #     setting  : Hash Settings ("R"=>radius "S"=>speed "G"=>graphic "L"=>text)
  #--------------------------------------------------------------------------
  def initialize(cx, cy, commands, setting = {})
    @radius    = setting.has_key?("R") ? setting["R"] : 40  # Drawn Radius
    @speed     = setting.has_key?("S") ? setting["S"] : 36  # Rotate Speed
    @spin_back = setting.has_key?("G") ? setting["G"] : ""  # Background Image
    @spin_line = setting.has_key?("L") ? setting["L"] : nil # Text Position(?)
    x, y = cx - @radius - 28, cy - @radius - 28
    width = height = @radius * 2 + 56
    super(x, y, width, height)
    self.opacity = 0
    @index = 0
    @commands = commands                                    # コマンド
    @spin_right = true
    @spin_count = 0
    update_cursor
  end
  #--------------------------------------------------------------------------
  # ▽ スピン画像を描画する (描画内容 強化用)
  #     i  : インデックス
  #     cx : 表示 中心位置 X座標
  #     cy : 表示 中心位置 Y座標
  #--------------------------------------------------------------------------
  def draw_spin_graphic(i, cx, cy)
    case command_kind(i)
    when "icon"
      draw_icon(command_pull(i), cx - 12, cy - 12, command_enabled?(i))
    end
  end
  #--------------------------------------------------------------------------
  # ★ リフレッシュ バグ回避用
  #--------------------------------------------------------------------------
  def refresh
    set_spin
  end
  #--------------------------------------------------------------------------
  # ★ 項目の描画 バグ回避用
  #--------------------------------------------------------------------------
  def draw_item(index, enabled = true)
    @commands[index][3] = enabled
    set_spin
  end
  #--------------------------------------------------------------------------
  # ● 現在のコマンド名を取得する
  #--------------------------------------------------------------------------
  def command_name(index = @index)
    return "" if index < 0
    name = @commands[index][0]
    return name != nil ? name : ""
  end
  #--------------------------------------------------------------------------
  # ● コマンドの種類を取得
  #--------------------------------------------------------------------------
  def command_kind(index)
    result = @commands[index][1]
    return result != nil ? result : ""
  end
  #--------------------------------------------------------------------------
  # ● コマンドの引数 を取得
  #--------------------------------------------------------------------------
  def command_pull(index)
    result = @commands[index][2]
    return result != nil ? result : ""
  end
  #--------------------------------------------------------------------------
  # ● コマンドの有効フラグを取得
  #--------------------------------------------------------------------------
  def command_enabled?(index)
    result = @commands[index][3]
    return result != nil ? result : true
  end
  #--------------------------------------------------------------------------
  # ● 名前の位置に index を設定する
  #--------------------------------------------------------------------------
  def set_index(name)
    n = -1
    for i in 0...@commands.size
      n = i if @commands[i][0] == name
    end
    @index = n if n >= 0
    update_cursor
    call_update_help
    set_spin
  end
  #--------------------------------------------------------------------------
  # ● カーソル位置の設定
  #     index : 新しいカーソル位置
  #--------------------------------------------------------------------------
  def index=(index)
    @index = index
    update_cursor
    call_update_help
    set_spin
  end
  #--------------------------------------------------------------------------
  # ● 中心のX座標を取得
  #--------------------------------------------------------------------------
  def center_x
    return contents.width / 2
  end
  #--------------------------------------------------------------------------
  # ● 中心のY座標を取得
  #--------------------------------------------------------------------------
  def center_y
    return contents.height / 2
  end
  #--------------------------------------------------------------------------
  # ● 項目数の取得
  #--------------------------------------------------------------------------
  def item_max
    return @commands.size
  end
  #--------------------------------------------------------------------------
  # ● 背景の設定 (再定義 向き)
  #--------------------------------------------------------------------------
  def set_background
    return if @spin_back == ""
    bitmap = Cache.system(@spin_back)
    rect = Rect.new(0, 0, bitmap.width, bitmap.height)
    self.contents.blt(12, 12, bitmap, rect)
  end
  #--------------------------------------------------------------------------
  # ● 文章の設定 (再定義 向き)
  #--------------------------------------------------------------------------
  def set_text
    return if @spin_line == nil
    y = center_y - WLH / 2 + @spin_line
    self.contents.draw_text(center_x - 48, y, 96, WLH, command_name, 1)
  end
  #--------------------------------------------------------------------------
  # ● スピンアイコンの角度の差を取得する
  #--------------------------------------------------------------------------
  def angle_size
    return (Math::PI * 2 / item_max)
  end
  #--------------------------------------------------------------------------
  # ● スピンアイコン回転時のカウント を設定する
  #--------------------------------------------------------------------------
  def set_spin_count
    @spin_count = angle_size * 360 / @speed
    set_spin(true)
  end
  #--------------------------------------------------------------------------
  # ● スピン設定 の実行
  #     spin : 回転フラグ (true の時回転中)
  #--------------------------------------------------------------------------
  def set_spin(spin = false)
    self.contents.clear
    set_background
    angle = spin ? @speed * @spin_count / 360 : 0
    angle = @spin_right ? angle : -angle
    for i in 0...item_max
      n = (i - @index) * angle_size + angle
      cx = @radius * Math.sin(n) + center_x
      cy = - @radius * Math.cos(n) + center_y
      draw_spin_graphic(i, cx, cy)
    end
    set_text
  end
  #--------------------------------------------------------------------------
  # ● フレーム更新
  #--------------------------------------------------------------------------
  def update
    super
    update_cursor
    if @spin_count > 0
      @spin_count -= 1
      set_spin(@spin_count >= 1)
      return
    end
    update_command
  end
  #--------------------------------------------------------------------------
  # ● コマンドの移動可能判定
  #--------------------------------------------------------------------------
  def command_movable?
    return false if @spin_count > 0
    return false if (not visible or not active)
    return false if (index < 0 or index > item_max or item_max == 0)
    return false if (@opening or @closing)
    return true
  end
  #--------------------------------------------------------------------------
  # ● コマンドを右に移動
  #--------------------------------------------------------------------------
  def command_right
    @index = (@index + 1) % item_max
    @spin_right = true
    set_spin_count
  end
  #--------------------------------------------------------------------------
  # ● コマンドを左に移動
  #--------------------------------------------------------------------------
  def command_left
    @index = (@index - 1 + item_max) % item_max
    @spin_right = false
    set_spin_count
  end
  #--------------------------------------------------------------------------
  # ● コマンド選択の更新
  #--------------------------------------------------------------------------
  def update_command
    if command_movable?
      if Input.press?(Input::RIGHT)
        Sound.play_cursor
        ZiiN7.turn_normal? ? command_right : command_left
      end
      if Input.press?(Input::LEFT)
        Sound.play_cursor
        ZiiN7.turn_normal? ? command_left : command_right
      end
    end
    call_update_help
  end
  #--------------------------------------------------------------------------
  # ● カーソルの更新
  #--------------------------------------------------------------------------
  def update_cursor
    if @index < 0
      self.cursor_rect.empty
    else
      rect = Rect.new(0, 0, 24, 24)
      rect.x = center_x - rect.width / 2
      rect.y = center_y - rect.height / 2 - @radius
      self.cursor_rect = rect
    end
  end
  #--------------------------------------------------------------------------
  # ● ヘルプウィンドウの設定
  #     help_window : 新しいヘルプウィンドウ
  #--------------------------------------------------------------------------
  def help_window=(help_window)
    @help_window = help_window
    call_update_help
  end
  #--------------------------------------------------------------------------
  # ● ヘルプウィンドウ更新メソッドの呼び出し
  #--------------------------------------------------------------------------
  def call_update_help
    if self.active and @help_window != nil
       update_help
    end
  end
  #--------------------------------------------------------------------------
  # ● ヘルプウィンドウの更新 (内容は継承先で定義する)
  #--------------------------------------------------------------------------
  def update_help
  end
end

#==============================================================================
# ■ Gauge_Base
#------------------------------------------------------------------------------
#  ゲージの表示をするスプライトセットのクラスです。
#==============================================================================

class Gauge_Base
  #--------------------------------------------------------------------------
  # ● 公開インスタンス変数
  #--------------------------------------------------------------------------
  attr_accessor :offset_x                 # ゲージオフセット X 座標
  attr_accessor :offset_y                 # ゲージオフセット Y 座標
  attr_reader   :gauge_rate               # ゲージ 割合 (確認用)
  #--------------------------------------------------------------------------
  # ● オブジェクト初期化
  #     bitmap1 : ビットマップ ゲージ本体
  #     bitmap2 : ビットマップ ゲージ背景
  #     bitmap3 : ビットマップ ゲージ前景
  #--------------------------------------------------------------------------
  def initialize(bitmap1, bitmap2 = nil, bitmap3 = nil)
   create_gauge(bitmap1)
   create_ground_gauge(bitmap2, bitmap3)
   set_offset(0, 0)
   self.x , self.y , self.z = 0 , 0 , 1
    @gauge_rate = 100
    gauge_setting(@gauge_rate)
  end
  #--------------------------------------------------------------------------
  # ● ゲージ本体の作成
  #--------------------------------------------------------------------------
  def create_gauge(bitmap1)
   @gauge = Sprite.new
   @gauge.bitmap = bitmap1
   @gauge.viewport = Viewport.new(0, 0, bitmap1.width, bitmap1.height)
  end
  #--------------------------------------------------------------------------
  # ● ゲージ背景・前景の作成
  #--------------------------------------------------------------------------
  def create_ground_gauge(bitmap2 = nil, bitmap3 = nil)
   @back = Sprite.new
   @back.bitmap = bitmap2 unless bitmap2.nil?
    @fore = Sprite.new
   @fore.bitmap = bitmap3 unless bitmap3.nil?
  end
  #--------------------------------------------------------------------------
  # ● 解放
  #--------------------------------------------------------------------------
  def dispose
   @gauge.viewport.dispose
   @gauge.dispose
   @back.dispose
    @fore.dispose
  end
  #--------------------------------------------------------------------------
  # ● 計算用ゲージ最大値の取得
  #--------------------------------------------------------------------------
  def gauge_max
   return @gauge.width
  end
  #--------------------------------------------------------------------------
  # ● 計算用ゲージ現在値の取得
  #--------------------------------------------------------------------------
  def gauge_width
   return @gauge.viewport.rect.width
  end
  #--------------------------------------------------------------------------
  # ● ゲージオフセットの設定
  #--------------------------------------------------------------------------
  def set_offset(x, y)
   @offset_x , @offset_y = x , y
  end
  #--------------------------------------------------------------------------
  # ● X 座標の取得
  #--------------------------------------------------------------------------
  def x
   return @back.x
  end
  #--------------------------------------------------------------------------
  # ● Y 座標の取得
  #--------------------------------------------------------------------------
  def y
   return @back.y
  end
  #--------------------------------------------------------------------------
  # ● Z 座標の取得
  #--------------------------------------------------------------------------
  def z
   return @back.z
  end
  #--------------------------------------------------------------------------
  # ● X 座標の設定
  #--------------------------------------------------------------------------
  def x=(x)
   @gauge.viewport.rect.x = x + @offset_x
   @back.x = x
   @fore.x = x
  end
  #--------------------------------------------------------------------------
  # ● Y 座標の設定
  #--------------------------------------------------------------------------
  def y=(y)
   @gauge.viewport.rect.y = y + @offset_y
   @back.y = y
   @fore.y = y
  end
  #--------------------------------------------------------------------------
  # ● Z 座標の設定
  #--------------------------------------------------------------------------
  def z=(z)
   @gauge.viewport.z = z
   @back.z = z - 1
    @fore.z = z + 1
  end
  #--------------------------------------------------------------------------
  # ● ゲージの範囲を設定
  #     rate : ゲージの割合 (%)
  #--------------------------------------------------------------------------
  def gauge_setting(rate)
    rate   = [[rate, 0].max, 100].min
    return if @gauge == rate
    @gauge.viewport.rect.width = (gauge_max * rate / 100.0).ceil
    gauge_rate_setting(rate)
    @gauge_rate = rate
  end
  #--------------------------------------------------------------------------
  # ● ゲージの変動処理
  #--------------------------------------------------------------------------
  def gauge_rate_setting(rate)
  end
  #--------------------------------------------------------------------------
  # ● フレーム更新
  #--------------------------------------------------------------------------
  def update
   @gauge.viewport.update
   @gauge.update
   @back.update
    @fore.update
  end
end

=begin ************************************************************************
  ★ ウェイトゲージでのコマンド作成
=end # ************************************************************************

#==============================================================================
# ■ Sprite_ZiiTarget
#------------------------------------------------------------------------------
#  バトル画面で、行動対象のキャラを選択する画像です。
#==============================================================================

class Sprite_ZiiTarget < Sprite
  #--------------------------------------------------------------------------
  # ● 公開インスタンス変数
  #--------------------------------------------------------------------------
  attr_accessor :active                   # 選択状態
  attr_reader   :item_max                 # 項目数
  attr_reader   :index                    # カーソル位置
  #--------------------------------------------------------------------------
  # ● オブジェクト初期化
  #--------------------------------------------------------------------------
  def initialize(targets, exist_on)
    super(nil)
    self.bitmap = Cache.system("TargetCursor")
    self.ox = self.width / 2
    self.oy = self.height / 2
    self.z = 500
    @targets = []
    for battler in targets
      next unless exist_on or battler.exist?
      @targets.push(battler)
    end
    @active = true
    @item_max = @targets.size
    self.index = 0
  end
  #--------------------------------------------------------------------------
  # ● ターゲットオブジェクト取得
  #--------------------------------------------------------------------------
  def target
    return @targets[@index]
  end
  #--------------------------------------------------------------------------
  # ★ 敵キャラオブジェクト取得 (互換性用)
  #--------------------------------------------------------------------------
  def enemy
    return @targets[@index]
  end
  #--------------------------------------------------------------------------
  # ● カーソル位置の設定
  #     index : 新しいカーソル位置
  #--------------------------------------------------------------------------
  def index=(index)
    @index = index
    unless self.target.nil?
      self.x = self.target.screen_x
      self.y = self.target.screen_y
    else
      self.visible = false
    end
  end
  #--------------------------------------------------------------------------
  # ● カーソルの移動可能判定
  #--------------------------------------------------------------------------
  def cursor_movable?
    return false if (not self.visible or not self.active)
    return false if (@index < 0 or @index > @item_max)
    return true
  end
  #--------------------------------------------------------------------------
  # ● カーソルを右に移動
  #--------------------------------------------------------------------------
  def cursor_right
    self.index = (@index + 1) % @item_max
  end
  #--------------------------------------------------------------------------
  # ● カーソルを左に移動
  #--------------------------------------------------------------------------
  def cursor_left
    self.index = (@index - 1 + @item_max) % @item_max
  end
  #--------------------------------------------------------------------------
  # ● フレーム更新
  #--------------------------------------------------------------------------
  def update
    super
    if cursor_movable?
      last_index = @index
      if Input.trigger?(Input::RIGHT)
        cursor_right
      end
      if Input.trigger?(Input::LEFT)
        cursor_left
      end
      if @index != last_index
        Sound.play_cursor
      end
    end
  end
end

#==============================================================================
# ■ Window_ActorCommand
#==============================================================================

class Window_ActorCommand < Window_SpinCommand
  #--------------------------------------------------------------------------
  # ● オブジェクト初期化
  #--------------------------------------------------------------------------
  def initialize
    set = []
    set.push([Vocab::attack, "icon", ZiiN7::ATTACK, true])
    set.push([Vocab::skill,  "icon", ZiiN7::SKILL,  true])
    set.push([Vocab::guard,  "icon", ZiiN7::GUARD,  true])
    set.push([Vocab::item,   "icon", ZiiN7::ITEM,   true])
    if $game_troop.can_escape # 逃げれる場合
      set.push([Vocab::escape, "icon", ZiiN7::ESCAPE, true])
    end
    super(72, 356, set, {"R"=>40, "S"=>52, "L"=>-12})
    self.active = false
    set_spin
  end
  #--------------------------------------------------------------------------
  # ● セットアップ
  #     actor : アクター
  #--------------------------------------------------------------------------
  def setup(actor)
    @commands[0][2] = ZiiN7::ATTACK
    @commands[1][0] = Vocab::skill
    if actor.weapons[0] != nil
      n = actor.weapons[0].icon_index
      @commands[0][2] = n if n > 0
    end
    @commands[1][0] = actor.class.skill_name if actor.class.skill_name_valid
    self.index = 0
    set_spin
  end
end

#==============================================================================
# ■ Scene_Battle
#==============================================================================

class Scene_Battle
  #--------------------------------------------------------------------------
  # ● ウェイトゲージを動かすかどうか? (コマンド系ウィンドウから判別)
  #--------------------------------------------------------------------------
  def wait_point_update?
    # イベント時は動かす設定に!!(ゲージは増えない)
    return true if $game_troop.interpreter.running? # イベント中(特殊)
    return false unless @target_enemy_window.nil?   # エネミー 選択中(Wait)
    return false unless @target_actor_window.nil?   # アクター 選択中(Wait)
    return false unless @skill_window.nil?          # スキル   選択中(Wait)
    return false unless @item_window.nil?           # アイテム 選択中(Wait)
    return true # (Active)
  end
  #--------------------------------------------------------------------------
  # ● コマンド選択の排除
  #--------------------------------------------------------------------------
  def clear_command_setting
    unless @target_enemy_window.nil?
      @target_enemy_window.dispose
      @target_enemy_window = nil
    end
    unless @target_actor_window.nil?
      @target_actor_window.dispose
      @target_actor_window = nil
    end
    unless @skill_window.nil?
      @skill_window.dispose
      @skill_window = nil
    end
    unless @item_window.nil?
      @item_window.dispose
      @item_window = nil
    end
    unless @help_window.nil?
      @help_window.dispose
      @help_window = nil
    end
    @actor_command_window.active = false
    @actor_command_window.visible = false
    @status_window.index = -1
    @select_battler = nil # コマンド状態削除 (忘れないでね^^)
  end
  #--------------------------------------------------------------------------
  # ● フレーム更新 (コマンドセレクト)
  #--------------------------------------------------------------------------
  def command_update
    if @target_enemy_window != nil
      update_target_enemy_selection     # 対象敵キャラ選択
    elsif @target_actor_window != nil
      update_target_actor_selection     # 対象アクター選択
    elsif @skill_window != nil
      update_skill_selection            # スキル選択
    elsif @item_window != nil
      update_item_selection             # アイテム選択
    elsif @actor_command_window.active
      update_actor_command_selection    # アクターコマンド選択
    end
  end
  #--------------------------------------------------------------------------
  # ☆ 情報表示ビューポートの作成
  #--------------------------------------------------------------------------
  def create_info_viewport
    # メモ : 全体的に値変更
    @info_viewport = Viewport.new(0, 0, 544, 416)
    @info_viewport.z = 70
    @status_window = Window_BattleStatus.new
    @status_window.z = 80
    @party_command_window = Window_PartyCommand.new
    @actor_command_window = Window_ActorCommand.new
    # <(ステータスはビューポートからはずす)
    @party_command_window.viewport = @info_viewport
    @actor_command_window.viewport = @info_viewport
    @status_window.x = 128
    @actor_command_window.x = 4
    @party_command_window.visible = false
    @actor_command_window.visible = false
    create_spin_command_back # <(スピンコマンドの背景はここで別に作成)
  end
  #--------------------------------------------------------------------------
  # ● スピンコマンド背景の作成
  #--------------------------------------------------------------------------
  def create_spin_command_back
    @spin_command_back = Sprite.new
    @spin_command_back.bitmap = Cache.system("Spin40")
    @spin_command_back.ox = @spin_command_back.width
    @spin_command_back.oy = @spin_command_back.height
    @spin_command_back.x = 112
    @spin_command_back.y = 396
  end
  #--------------------------------------------------------------------------
  # ● 情報表示ビューポートの解放
  #--------------------------------------------------------------------------
  alias :ziin7b_scene_dispose_info_viewport :dispose_info_viewport
  def dispose_info_viewport
    @spin_command_back.dispose
    ziin7b_scene_dispose_info_viewport
  end
  #--------------------------------------------------------------------------
  # ☆ 情報表示ビューポートの更新 (info系修正)
  #--------------------------------------------------------------------------
  def update_info_viewport
    @status_window.update # ステータスウィンドウのみの更新
  end
  #--------------------------------------------------------------------------
  # ● コマンド系ウィンドウの表示
  #--------------------------------------------------------------------------
  def battle_command_window_visible(visible)
    unless @skill_window.nil?
      @skill_window.visible = visible
    end
    unless @item_window.nil?
      @item_window.visible = visible
    end
    unless @help_window.nil?
      @help_window.visible = visible if ZiiN7::HelpOn
    end
  end
  #--------------------------------------------------------------------------
  # ☆ アクターコマンド選択の開始
  #--------------------------------------------------------------------------
  def start_actor_command_selection
    # <(@party_command_window の処理なし!)
    @actor_command_window.setup(@select_battler)
    @actor_command_window.active = true
    @actor_command_window.visible = true
    @actor_command_window.index = 0
  end
  #--------------------------------------------------------------------------
  # ☆ アクターコマンド選択の更新
  #--------------------------------------------------------------------------
  def update_actor_command_selection
    @actor_command_window.update
    return unless @actor_command_window.command_movable? # コマンド回転中
    if Input.trigger?(Input::B)
      prior_actor
    elsif Input.trigger?(Input::C)
      case @actor_command_window.command_name # コマンド名取得
      when Vocab::attack  # 攻撃
        Sound.play_decision
        @select_battler.action.set_attack
        start_target_enemy_selection
      when Vocab::skill, @select_battler.class.skill_name   # スキル
        Sound.play_decision
        start_skill_selection
      when Vocab::guard   # 防御
        Sound.play_decision
        @select_battler.action.set_guard
        next_actor
      when Vocab::item    # アイテム
        Sound.play_decision
        start_item_selection
      when Vocab::escape  # 逃げる
        Sound.play_decision
        @select_battler.action.set_escape
        next_actor
      end
    end
  end
  #--------------------------------------------------------------------------
  # ☆ 対象敵キャラ選択の開始 (info系修正)
  #--------------------------------------------------------------------------
  def start_target_enemy_selection
    @target_enemy_window = Sprite_ZiiTarget.new($game_troop.members, false)
    @actor_command_window.active = false
    battle_command_window_visible(false)
  end
  #--------------------------------------------------------------------------
  # ☆ 対象敵キャラ選択の終了 (info系修正)
  #--------------------------------------------------------------------------
  def end_target_enemy_selection
    @target_enemy_window.dispose
    @target_enemy_window = nil
    if @actor_command_window.index == 0
      @actor_command_window.active = true
    end
    battle_command_window_visible(true)
  end
  #--------------------------------------------------------------------------
  # ☆ 対象敵キャラ選択の更新
  #--------------------------------------------------------------------------
  def update_target_enemy_selection
    @target_enemy_window.update
    if Input.trigger?(Input::B)
      Sound.play_cancel
      end_target_enemy_selection
    elsif Input.trigger?(Input::C)
      if @target_enemy_window.enemy.nil?
        Sound.play_buzzer
        return
      end
      Sound.play_decision
      @select_battler.action.target_index = @target_enemy_window.enemy.index
      end_target_enemy_selection
      end_skill_selection
      end_item_selection
      next_actor
    end
  end
  #--------------------------------------------------------------------------
  # ☆ 対象アクター対象選択の開始 (info系修正)
  #--------------------------------------------------------------------------
  def start_target_actor_selection
    @target_actor_window = Sprite_ZiiTarget.new($game_party.members, true)
    @target_actor_window.active = true
    @actor_command_window.active = false
    battle_command_window_visible(false)
  end
  #--------------------------------------------------------------------------
  # ☆ 対象アクター選択の終了 (info系修正)
  #--------------------------------------------------------------------------
  def end_target_actor_selection
    @target_actor_window.dispose
    @target_actor_window = nil
    battle_command_window_visible(true)
  end
  #--------------------------------------------------------------------------
  # ☆ 対象アクター選択の更新
  #--------------------------------------------------------------------------
  def update_target_actor_selection
    @target_actor_window.update
    if Input.trigger?(Input::B)
      Sound.play_cancel
      end_target_actor_selection
    elsif Input.trigger?(Input::C)
      Sound.play_decision
      @select_battler.action.target_index = @target_actor_window.index
      end_target_actor_selection
      end_skill_selection
      end_item_selection
      next_actor
    end
  end
  #--------------------------------------------------------------------------
  # ☆ スキル選択の開始
  #--------------------------------------------------------------------------
  def start_skill_selection
    @help_window = Window_Help.new
    @help_window.y = 232
    @help_window.visible = ZiiN7::HelpOn
    @skill_window = Window_Skill.new(0, 288, 544, 128, @select_battler)
    @skill_window.help_window = @help_window
    @actor_command_window.active = false
  end
  #--------------------------------------------------------------------------
  # ● スキル選択の終了 (変更なし)
  #--------------------------------------------------------------------------
  #--------------------------------------------------------------------------
  # ☆ スキル選択の更新
  #--------------------------------------------------------------------------
  def update_skill_selection
    @skill_window.active = true
    @skill_window.update
    @help_window.update
    if Input.trigger?(Input::B)
      Sound.play_cancel
      end_skill_selection
    elsif Input.trigger?(Input::C)
      @skill = @skill_window.skill
      if @skill != nil
        @select_battler.last_skill_id = @skill.id
      end
      if @select_battler.skill_can_use?(@skill)
        Sound.play_decision
        determine_skill
      else
        Sound.play_buzzer
      end
    end
  end
  #--------------------------------------------------------------------------
  # ☆ スキルの決定
  #--------------------------------------------------------------------------
  def determine_skill
    @select_battler.action.set_skill(@skill.id)
    @skill_window.active = false
    if @skill.need_selection?
      if @skill.for_opponent?
        start_target_enemy_selection
      else
        start_target_actor_selection
      end
    else
      end_skill_selection
      next_actor
    end
  end
  #--------------------------------------------------------------------------
  # ☆ アイテム選択の開始
  #--------------------------------------------------------------------------
  def start_item_selection
    @help_window = Window_Help.new
    @help_window.y = 232
    @help_window.visible = ZiiN7::HelpOn
    @item_window = Window_Item.new(0, 288, 544, 128)
    @item_window.help_window = @help_window
    @actor_command_window.active = false
  end
  #--------------------------------------------------------------------------
  # ● アイテム選択の終了 (変更なし)
  #--------------------------------------------------------------------------
  #--------------------------------------------------------------------------
  # ● アイテム選択の更新 (変更なし)
  #--------------------------------------------------------------------------
  #--------------------------------------------------------------------------
  # ☆ アイテムの決定
  #--------------------------------------------------------------------------
  def determine_item
    @select_battler.action.set_item(@item.id)
    @item_window.active = false
    if @item.need_selection?
      if @item.for_opponent?
        start_target_enemy_selection
      else
        start_target_actor_selection
      end
    else
      end_item_selection
      next_actor
    end
  end
  #--------------------------------------------------------------------------
  # ☆ 戦闘行動の実行 (コマンド自体の変更にあわせる)
  #--------------------------------------------------------------------------
  def execute_action
    case @active_battler.action.kind
    when 0  # 基本
      case @active_battler.action.basic
      when 0  # 攻撃
        execute_action_attack
      when 1  # 防御
        execute_action_guard
      when 2  # 逃走
        if @active_battler.actor?
          execute_party_escape  # アクター
        else
          execute_action_escape # エネミー
        end
      when 3  # 待機
        execute_action_wait
      end
    when 1  # スキル
      execute_action_skill
    when 2  # アイテム
      execute_action_item
    end
  end
  #--------------------------------------------------------------------------
  # ▲ パーティの逃走 (逃走コマンドの作成+メッセージ取り消し)
  #--------------------------------------------------------------------------
  def execute_party_escape
    set_battle_help(Vocab.escape)
    if $game_troop.preemptive
      success = true
    else
      success = (rand(100) < @escape_ratio)
    end
    Sound.play_escape
    wait(40)
    if success
      process_escape
    else
      @escape_ratio += 10
      set_battle_help(Vocab::EscapeFailure)
      wait(40)
    end
  end
end

=begin ************************************************************************
  ★ ステータス表示の作成
=end # ************************************************************************

#==============================================================================
# ■ Game_Actor
#==============================================================================

class Game_Actor
  #--------------------------------------------------------------------------
  # ● バトル画面 X 座標
  #--------------------------------------------------------------------------
  def screen_x
    i = self.index
    return 0 if i == nil
    return (i * 96 + 192)
  end
  #--------------------------------------------------------------------------
  # ● バトル画面 Y 座標
  #--------------------------------------------------------------------------
  def screen_y
    return 398
  end
  #--------------------------------------------------------------------------
  # ● バトル画面 Z 座標の取得
  #--------------------------------------------------------------------------
  def screen_z
    return 100
  end
  #--------------------------------------------------------------------------
  # ● スプライトを使うか? (表示するに変更)
  #--------------------------------------------------------------------------
  def use_sprite?
    return true
  end
end

#==============================================================================
# ■ Gauge_Wp
#------------------------------------------------------------------------------
#  バトル時にWPゲージの表示をします
#==============================================================================

class Gauge_Wp < Gauge_Base
  #--------------------------------------------------------------------------
  # ● オブジェクト初期化
  #--------------------------------------------------------------------------
  def initialize(x, y)
    gauge = Cache.system(ZiiN7::WPGauge)
    back  = Cache.system(ZiiN7::WPBack)
    fore  = Cache.system(ZiiN7::WPFore)
    super(gauge, back, fore)
    @offset_x = ZiiN7::WPOffX
    @offset_y = ZiiN7::WPOffY
    self.x , self.y = x , y
  end
  #--------------------------------------------------------------------------
  # ● ゲージの変動処理
  #--------------------------------------------------------------------------
  def gauge_rate_setting(rate)
    if @gauge_rate < 100 and @gauge.bitmap != Cache.system(ZiiN7::WPGauge)
      @gauge.bitmap = Cache.system(ZiiN7::WPGauge) # 通常ゲージに変更
    elsif @gauge_rate == 100 and @gauge.bitmap != Cache.system(ZiiN7::WPMax)
      @gauge.bitmap = Cache.system(ZiiN7::WPMax)   # 最大ゲージに変更
    end
  end
end

#==============================================================================
# ■ Sprite_Battler
#==============================================================================

class Sprite_Battler
  #--------------------------------------------------------------------------
  # ● オブジェクト初期化
  #--------------------------------------------------------------------------
  alias :ziin7b_sbattler_initialize :initialize
  def initialize(viewport, battler = nil)
    ziin7b_sbattler_initialize(viewport, battler)
    create_wait_gauge
  end
  #--------------------------------------------------------------------------
  # ● 解放
  #--------------------------------------------------------------------------
  alias :ziin7b_sbattler_dispose :dispose
  def dispose
    dispose_wait_gauge
    ziin7b_sbattler_dispose
  end
  #--------------------------------------------------------------------------
  # ● ウェイトゲージの解放
  #--------------------------------------------------------------------------
  def dispose_wait_gauge
    if @wp_gauge != nil
      @wp_gauge.dispose
      @wp_gauge = nil
    end
  end
  #--------------------------------------------------------------------------
  # ● ウェイトゲージの作成
  #--------------------------------------------------------------------------
  def create_wait_gauge(flag = false)
    if flag or (@wp_gauge != nil and (@battler.nil? or not @battler.actor?))
      dispose_wait_gauge
    end
    if @battler != nil and (@wp_gauge.nil? and @battler.actor?)
      x, y = @battler.screen_x + ZiiN7::WPX, @battler.screen_y + ZiiN7::WPY
      @wp_gauge = Gauge_Wp.new(x, y)
      @wp_gauge.z = 90
      @wp_gauge.gauge_setting(@battler.wp * 100.0 / ZiiWP::MaxWP)
    end
  end
  #--------------------------------------------------------------------------
  # ☆ バトラーの設定 (再定義)
  #--------------------------------------------------------------------------
  def battler=(battler)
    flag = (@battler != battler)
    @battler = battler
    set_wp_another_battler(flag)
  end
  #--------------------------------------------------------------------------
  # ● 他のバトラーが設定された場合
  #--------------------------------------------------------------------------
  def set_wp_another_battler(flag)
    create_wait_gauge(flag)
    return unless flag
    return if @battler == nil
    if @battler.dead? # 戦闘不能時
      @effect_type = COLLAPSE
      @effect_duration = 0
      @battler_visible = false
    end
  end
  #--------------------------------------------------------------------------
  # ● 転送元ビットマップの更新 (アクターは顔グラ)
  #--------------------------------------------------------------------------
  alias :ziin7b_sbattler_update_battler_bitmap :update_battler_bitmap
  def update_battler_bitmap
    if @battler.actor?
      # ゲージ設定
      unless @wp_gauge.nil?
        @wp_gauge.gauge_setting(@battler.wp * 100.0 / ZiiWP::MaxWP)
      end
      # 顔グラ設定
      if @battler.face_name != @face_name or
         @battler.face_index != @face_index
        @face_name = @battler.face_name
        @face_index = @battler.face_index
        if self.bitmap != nil
          self.bitmap.dispose
        end
        self.bitmap = Bitmap.new(92, 92)
        face = Cache.face(@face_name)
        rect = Rect.new(0, 0, 92, 92)
        rect.x = @face_index % 4 * 96 + 2
        rect.y = @face_index / 4 * 96 + 2
        self.bitmap.blt(0, 0, face, rect)
        @width = bitmap.width
        @height = bitmap.height
        self.ox = @width / 2
        self.oy = @height
        if @battler.dead? or @battler.hidden
          self.opacity = 0
        end
      end
    else
      ziin7b_sbattler_update_battler_bitmap
    end
  end
end

#==============================================================================
# ■ Window_BattleStatus
#==============================================================================

class Window_BattleStatus
  #--------------------------------------------------------------------------
  # ● オブジェクト初期化 改
  #--------------------------------------------------------------------------
  def initialize
    super(128, 288, 416, 128)
    @column_max = 4
    refresh
    self.active = false
    self.opacity = 0
  end
  #--------------------------------------------------------------------------
  # ● 項目の描画 改
  #--------------------------------------------------------------------------
  def draw_item(index)
    x = index * 96
    rect = Rect.new(x, 0, 96, 96)
    self.contents.clear_rect(rect)
    self.contents.font.color = normal_color
    actor = $game_party.members[index]
    draw_actor_state(actor, x + 72, WLH * 3)
    self.contents.font.color = hp_color(actor)
    size = 14
    self.contents.font.size = size
    self.contents.draw_text(x, WLH * 1 + 20 - size, 80, WLH, actor.name)
    self.contents.font.size = 20
    draw_actor_hp(actor, x, WLH * 2, 80)
    draw_actor_mp(actor, x, WLH * 3, 70)
  end
  #--------------------------------------------------------------------------
  # ● カーソルの更新
  #--------------------------------------------------------------------------
  def update_cursor
    if @index < 0                   # カーソル位置が 0 未満の場合
      self.cursor_rect.empty        # カーソルを無効とする
    else                            # カーソル位置が 0 以上の場合
      rect = Rect.new(index * 96, 0, 96, 96)
      self.cursor_rect = rect       # カーソルの矩形を更新
    end
  end
end

=begin ************************************************************************
  ★ バトルヘルプ+メッセージ修正 (ポップアップ必須/ポップアップのみ使用)
=end # ************************************************************************

#==============================================================================
# ■ RPG::Skill
#==============================================================================

module RPG
  class Skill
    #----------------------------------------------------------------------
    # ☆ 使用時メッセージ2 (空に)
    #----------------------------------------------------------------------
    def message2
      return ""
    end
  end
end

#==============================================================================
# ■ Window_LineHelp
#------------------------------------------------------------------------------
#  スキルやアイテムの説明、アクターのステータスなどを表示するウィンドウです。
#==============================================================================

class Window_LineHelp < Window_Base
  #--------------------------------------------------------------------------
  # ● オブジェクト初期化
  #--------------------------------------------------------------------------
  def initialize
    super(-16, 0, 576, WLH + 32)
    self.opacity = 0
  end
  #--------------------------------------------------------------------------
  # ● テキスト設定
  #     text  : ウィンドウに表示する文字列
  #     align : アラインメント (0..左揃え、1..中央揃え、2..右揃え)
  #--------------------------------------------------------------------------
  def set_text(text, align = 0)
    if text != @text or align != @align
      self.contents.clear
      back_color = Color.new(0, 0, 0, 80)
      self.contents.fill_rect(0, y = 12, contents.width, WLH - y, back_color)
      self.contents.font.color = normal_color
      self.contents.draw_text(20, 0, self.width - 72, WLH, text, align)
      @text = text
      @align = align
    end
  end
end

#==============================================================================
# ■ Scene_Battle
#==============================================================================

class Scene_Battle
  #--------------------------------------------------------------------------
  # ● 開始処理
  #--------------------------------------------------------------------------
  alias :ziin7b_scene_start :start
  def start
    ziin7b_scene_start
    @battle_help_window = Window_LineHelp.new
    @battle_help_window.visible = false
    @message_window.y = 0
  end
  #--------------------------------------------------------------------------
  # ● 終了処理
  #--------------------------------------------------------------------------
  alias :ziin7b_scene_terminate :terminate
  def terminate
    ziin7b_scene_terminate
    @battle_help_window.dispose
  end
  #--------------------------------------------------------------------------
  # ● 基本更新処理
  #--------------------------------------------------------------------------
  alias :ziin7b_scene_update_basic :update_basic
  def update_basic(main = false)
    ziin7b_scene_update_basic(main)
    @battle_help_window.update
    set_message_window_visible
  end
  #--------------------------------------------------------------------------
  # ● メッセージウィンドウの表示
  #--------------------------------------------------------------------------
  def set_message_window_visible
    return unless $game_temp.zii_wait_battle
    if $game_temp.process_action_doing
      @message_window.visible = false
    else
      @message_window.visible = $game_message.visible
    end
  end
  #--------------------------------------------------------------------------
  # ● 勝利の処理
  #--------------------------------------------------------------------------
  alias :ziin7b_scene_process_victory :process_victory
  def process_victory
    @battle_help_window.visible = false
    ziin7b_scene_process_victory
  end
  #--------------------------------------------------------------------------
  # ● 敗北の処理
  #--------------------------------------------------------------------------
  alias :ziin7b_scene_process_defeat :process_defeat
  def process_defeat
    @battle_help_window.visible = false
    ziin7b_scene_process_defeat
  end
  #--------------------------------------------------------------------------
  # ● 画面切り替えの実行
  #--------------------------------------------------------------------------
  alias :ziin7b_scene_update_scene_change :update_scene_change
  def update_scene_change
    @battle_help_window.visible = false if $game_temp.next_scene != nil
    ziin7b_scene_update_scene_change
  end
  #--------------------------------------------------------------------------
  # ● 行動後処理への追加
  #--------------------------------------------------------------------------
  def after_action_sub
    @battle_help_window.visible = false       # バトルヘルプを非表示に
  end
  #--------------------------------------------------------------------------
  # ● バトルヘルプの表示
  #--------------------------------------------------------------------------
  def set_battle_help(text = "")
    @battle_help_window.set_text(text, 1)
    @battle_help_window.visible = (not text.empty?)
  end
  #--------------------------------------------------------------------------
  # ☆ 現在のステートの表示 (行動終了後使用/表示なし)
  #--------------------------------------------------------------------------
  def display_current_state
  end
  #--------------------------------------------------------------------------
  # ● 戦闘行動の実行 : 防御
  #--------------------------------------------------------------------------
  alias :ziin7b_scene_execute_action_guard :execute_action_guard
  def execute_action_guard
    set_battle_help(Vocab.guard)
    ziin7b_scene_execute_action_guard
  end
  #--------------------------------------------------------------------------
  # ● 戦闘行動の実行 : 逃走
  #--------------------------------------------------------------------------
  alias :ziin7b_scene_execute_action_escape :execute_action_escape
  def execute_action_escape
    set_battle_help(Vocab.escape)
    ziin7b_scene_execute_action_escape
  end
  #--------------------------------------------------------------------------
  # ● 戦闘行動の実行 : 待機
  #--------------------------------------------------------------------------
  alias :ziin7b_scene_execute_action_wait :execute_action_wait
  def execute_action_wait
    text = sprintf(Vocab::DoWait, @active_battler.name)
    set_battle_help(text)
    ziin7b_scene_execute_action_wait
  end
  #--------------------------------------------------------------------------
  # ● 戦闘行動の実行 : スキル
  #--------------------------------------------------------------------------
  alias :ziin7b_scene_execute_action_skill :execute_action_skill
  def execute_action_skill
    set_battle_help(@active_battler.action.skill.name)
    ziin7b_scene_execute_action_skill
  end
  #--------------------------------------------------------------------------
  # ● 戦闘行動の実行 : アイテム
  #--------------------------------------------------------------------------
  alias :ziin7b_scene_execute_action_item :execute_action_item
  def execute_action_item
    set_battle_help(@active_battler.action.item.name)
    ziin7b_scene_execute_action_item
  end
  #--------------------------------------------------------------------------
  # ☆ 行動結果の表示
  #--------------------------------------------------------------------------
  def display_action_effects(target, obj = nil)
    unless target.skipped
      line_number = @message_window.line_number
      wait(5)
      @status_window.refresh
      display_critical(target, obj)
      display_damage(target, obj)
      display_state_changes(target, obj)
      if line_number == @message_window.line_number
        display_failure(target, obj) unless target.states_active?
      end
      # <(Waitをなしに変更!)
      @message_window.back_to(line_number)
    end
  end
end

 

-------------------------------------------

WGB layout 스크립트의 37번째 줄의 icon 이미지 설정하는거에서 보면

attack 가 default 값이라고 되어있는데..

그래서 그런지 수치를 바꿔줘도 그림이 안바뀌네요..

다른건 다 변경이 되는걸 확인했는데...

그림을 바꾸려면 어떻게 해야 할까요.. 도와주세요.. ㅠㅠ

(숫자를 어떻게 바꾸던지 2번[아마 디폴트 값인듯] 아이콘이 표시되네요..)

Comment '1'
  • ?
    이클립스 2010.12.15 16:23

    해결봤습니다..

    착용하고있는 무기 그림이 뜨는 것이더군요..


List of Articles
종류 분류 제목 글쓴이 날짜 조회 수
공지 묻고 답하기 가이드 습작 2014.06.14 13174
RMVX 게임 시작처음에 캐릭터를 모 할지 제가 선택할수 잇어요.??? 4 준짱돌이 2010.12.15 787
RMXP 이벤트 이름을 바꾸려면 어떻게 해야 하나요? 질문 추가 비터스틸 2010.12.15 615
RMXP ABS 5.5 공격모션에대해서알려주세요 Outsider2 2010.12.14 652
RMXP 알려주세요!!! 3 우왊 2010.12.14 665
기타 vx가 좋을까요? xp가 좋을까요? 4 몽실년 2010.12.14 988
RMVX 액션알피지 스크립트 좀 알려주세요~ 1 전학생 2010.12.14 765
RMXP XAS에서 몬스터 수정법 올려주세요. 4 아방스타르 2010.12.14 746
RMVX 알려주슈. 3 똥현석 2010.12.14 652
RMXP RPG XP 기본 전투때 무기를 안끼면 공격력이 0이에요. 1 아미상 2010.12.14 741
RMXP xas 키관련 2 Outsider2 2010.12.14 967
RMXP RPGXP 1.03 (0.2)설치 버젼 오류 3 제작boy 2010.12.14 987
RMVX 윈도우 비스타에서 RPG만들기VX테스트 플레이 가 않되는데 어떻게 해야되나여? 4 정인호 2010.12.14 1064
RMVX 윈도우 비스타에서 RPG만들기VX테스트 플레이 가 않되는데 어떻게 해야되나여? 정인호 2010.12.14 637
RMVX 하루에 질문을 2개나 올리네요.. 이클립스 2010.12.13 903
RMVX VX에서 WGB를 사용하고있는데요..[스크립트 관련] 1 이클립스 2010.12.13 490
사이트 이용 저 마야(maya) 라는 게임 만들기 파일은 어디서 다운?? 1 귀요비 2010.12.13 1263
RMXP 여기에 질문해도 될지? 스크립트 관한거요! 몽실년 2010.12.13 479
RMXP 에너미 능력치 제한해제 Outsider2 2010.12.13 662
RMXP 이벤트 이름을 바꾸려면 어떻게 해야 하나요? 2 비터스틸 2010.12.13 694
RMXP ABP 액알에서 스킬 문제 Hsik 2010.12.12 712
Board Pagination Prev 1 ... 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 ... 517 Next
/ 517