| 
 
| 赞 | 0 |  
| VIP | 0 |  
| 好人卡 | 0 |  
| 积分 | 0 |  
| 经验 | 0 |  
| 最后登录 | 2010-11-12 |  
| 在线时间 | 8 小时 |  
 Lv1.梦旅人 
	梦石0 星屑285 在线时间8 小时注册时间2010-10-26帖子2 | 
| 
本帖最后由 sherui520 于 2010-10-29 14:33 编辑
x
加入我们,或者,欢迎回来。您需要 登录 才可以下载或查看,没有帐号?注册会员  
 
       
 
 应该如何更改错误代码,对脚本不是很熟悉。
 复制代码# ▽△▽ XRXS_BS 1. Full-Move BattleSystem 新クラス ▽△▽ built 033011
# by 桜雅 在土
#------------------------------------------------------------------------------
#
#
# ▽ 新規
#
#
#==============================================================================
# ◇ 定数設定
#------------------------------------------------------------------------------
#  数値をわかりやすくするために設定された固定の数です。
#==============================================================================
module XRXS_BS1
  #--------------------------------------------------------------------------
  # ○ アクション定数
  #--------------------------------------------------------------------------
  ACT_JUMP     = 2001
  ACT_DASHJUMP = 2002
  ACT_LAND     = 2003
  ACT_RETURN   = 2004
  #--------------------------------------------------------------------------
  # ○ ボイス定数
  #--------------------------------------------------------------------------
  VOICE_ID_ATTACK    = 1001
  VOICE_ID_ATTACK2   = 1002
  VOICE_ID_DAMAGE    = 1006
  VOICE_ID_BURST     = 1003
  VOICE_ID_ESCAPE    = 1096 # 逃走
  VOICE_ID_WON_CRY   = 1099 # 通常勝利
  VOICE_ID_PINCH_WIN = 1098 # 自分のHPが1/4未満での勝利
  VOICE_ID_DEAD      = 1004
  #--------------------------------------------------------------------------
  # 基本的に変更する意味のない固定された数値ですが、
  # 「同じ数値」にすることによって同じボイスを利用することができます。
  #
  # (例:VOICE_ID_PINCH_WINを1099に → ピンチでも通常勝利ボイス)
  #
  #--------------------------------------------------------------------------
end
#==============================================================================
# □ Game_Voice
#------------------------------------------------------------------------------
#  ボイス (戦闘中の行動の声) を扱うクラスです。
# このクラスは Game_Battler クラスの内部で使用されます。
#==============================================================================
class Game_Voice
  #--------------------------------------------------------------------------
  # ○ オブジェクト初期化
  #--------------------------------------------------------------------------
  def initialize(me)
    @me = me
  end
  #--------------------------------------------------------------------------
  # ○ 再生
  #--------------------------------------------------------------------------
  def play(id)
    return if id == 0
    #
    # ファイル名の作成
    #
    name = "Audio/SE/" + @me.battler_name_basic_form + "_"
    case id
    when XRXS_BS1::VOICE_ID_ATTACK
      name += "attack"
    when XRXS_BS1::VOICE_ID_ATTACK2
      name += "attack2"
    when XRXS_BS1::VOICE_ID_DAMAGE
      name += "damage"
    when XRXS_BS1::VOICE_ID_BURST
      name += "burst"
    when XRXS_BS1::VOICE_ID_ESCAPE
      name += "escape"
    when XRXS_BS1::VOICE_ID_WON_CRY
      name += "win"
    when XRXS_BS1::VOICE_ID_PINCH_WIN
      name += "win_pinch"
    when XRXS_BS1::VOICE_ID_DEAD
      name += "dead"
    else
      name += "0" if id < 10
      name += "0" if id < 100
      name += id.to_s
    end
    name += ".wav"
    #
    # 再生
    #
    if FileTest.exist?(name)
      Audio.se_play(name)
    end
  end
end
#==============================================================================
# □ Game_BattleShield
#------------------------------------------------------------------------------
#  バトル中のシールドを扱うクラスです
#==============================================================================
class Game_BattleShield
  #--------------------------------------------------------------------------
  # ○ 公開インスタンス変数
  #--------------------------------------------------------------------------
  attr_reader   :rect              # 範囲、盾の受け判定(Rect)
  attr_reader   :id                # 盾ID.
  attr_reader   :direction         # 向き (1 : 前方からの攻撃のみ、0全方位)
end
#==============================================================================
# □ Game_BattlerWeapon
#------------------------------------------------------------------------------
#  バトル中の装備武器を扱うクラスです
#==============================================================================
class Game_BattlerWeapon < Game_Battler
  #--------------------------------------------------------------------------
  # ○ 公開インスタンス変数
  #--------------------------------------------------------------------------
  attr_accessor :user           # 武器の装備者
  attr_accessor :relative_x_pos # 相対 X 位置
  attr_accessor :relative_y_pos # 相対 Y 位置
  attr_accessor :relative_z_pos # 相対 Z 位置
  attr_reader   :set_id         # 現在セットされている武器ID
  attr_reader   :shade          # 現在の武器の影    (Game_BattlerWeaponShade)
  #--------------------------------------------------------------------------
  # ○ オブジェクト初期化
  #     user : 武器の装備者
  #--------------------------------------------------------------------------
  def initialize(user)
    super()
    setup(user)
  end
  #--------------------------------------------------------------------------
  # ○ セットアップ
  #--------------------------------------------------------------------------
  def setup(user)
    @current_action = nil
    @user           = user
    @relative_x_pos = 0
    @relative_y_pos = 0
    @relative_z_pos = 1
    @set_id         = @user.weapon_id
    @battler_name   = weapon_to_battlergraphic_database(@set_id)
    @battler_name_basic_form = @battler_name
    @shade  = Game_BattlerWeaponShade.new(user, self)
  end
  #--------------------------------------------------------------------------
  # ○ 武器→バトラーグラフィック データベース
  #--------------------------------------------------------------------------
  def weapon_to_battlergraphic_database(weapon_id)
    # 種別の取得
    n = get(weapon_id)
    # 文字列作成
    if n == 0
      return ""
    else
      form_name = "Weapon_"
      if n < 10
        form_name += "00"
      elsif n < 100
        form_name += "0"
      end
      form_name += n.to_s
      return form_name
    end
  end
  #--------------------------------------------------------------------------
  # ● 戦闘不能判定
  #--------------------------------------------------------------------------
  def dead?
    return false
  end
  #--------------------------------------------------------------------------
  # ○ 向き
  #--------------------------------------------------------------------------
  def direction
    d = @user.direction
    d = 1 if d.nil?
    return d
  end
  #--------------------------------------------------------------------------
  # ● バトル画面 X 座標の取得
  #--------------------------------------------------------------------------
  def screen_x
    $xcam_x = 0 if $xcam_x == nil
    return 320 + (@user.x_pos.to_i + direction * relative_x_pos - $xcam_x) * @user.zoom
  end
  #--------------------------------------------------------------------------
  # ● バトル画面 Y 座標の取得
  #--------------------------------------------------------------------------
  def screen_y
    $xcam_y = 0 if $xcam_y == nil
    return 240 + ([email protected]_pos.to_i - relative_y_pos + 64 + $xcam_y + @user.z_pos) * @user.zoom
  end
  #--------------------------------------------------------------------------
  # ● バトル画面 Z 座標の取得
  #--------------------------------------------------------------------------
  def screen_z
    return @user.screen_z + @relative_z_pos
  end
end
#==============================================================================
# □ Game_BattlerWeaponShade
#------------------------------------------------------------------------------
#  バトル中の装備武器の影を扱うクラスです
#==============================================================================
class Game_BattlerWeaponShade < Game_BattlerWeapon
  #--------------------------------------------------------------------------
  # ○ 公開インスタンス変数
  #--------------------------------------------------------------------------
  attr_accessor :battler_name             # バトラー ファイル名
  attr_accessor :battler_name_next        # [一時保管用]
  attr_reader   :weapon                   # 影の元となる武器
  #--------------------------------------------------------------------------
  # ○ オブジェクト初期化
  #--------------------------------------------------------------------------
  def initialize(user, weapon)
    super(user)
    setup(user, weapon)
  end
  #--------------------------------------------------------------------------
  # ○ セットアップ
  #--------------------------------------------------------------------------
  def setup(user, weapon = nil)
    @current_action = nil
    @user           = user
    @weapon         = weapon
    @battler_name   = ""
    @battler_name_next = ""
  end
  #--------------------------------------------------------------------------
  # ○ 相対 X 位置
  #--------------------------------------------------------------------------
  def relative_x_pos
    rx = @weapon.relative_x_pos
    return rx == nil ? 0 : rx
  end
  #--------------------------------------------------------------------------
  # ○ 相対 Y 位置
  #--------------------------------------------------------------------------
  def relative_y_pos
    ry = @weapon.relative_y_pos
    return ry == nil ? 0 : ry
  end
  #--------------------------------------------------------------------------
  # ● バトル画面 Z 座標の取得
  #--------------------------------------------------------------------------
  def screen_z
    return @user.screen_z - 2
  end
end
#==============================================================================
# □ Game_BattleBullet
#------------------------------------------------------------------------------
#  バトル中の飛び道具を扱うクラスです
#==============================================================================
class Game_BattleBullet < Game_Battler
  #--------------------------------------------------------------------------
  # ○ 公開インスタンス変数
  #--------------------------------------------------------------------------  
  attr_accessor :user                     # 飛び道具の使用者
  attr_accessor :remain_duration          # 寿命
  attr_accessor :done                     # 終了判定
  attr_reader   :gravity_effect           # 重量影響
  attr_reader   :piercing                 # 貫通性能
  attr_accessor :sprite_index             # 飛び道具スプライトに登録された番号
  #--------------------------------------------------------------------------
  # ○ オブジェクト初期化
  #--------------------------------------------------------------------------
  def initialize(skill_id)
    # バトラーとして初期化
    super()
    # 設定
    @sprite_index = 0
    @skill_id  = skill_id
    @x_pos     = 0
    @y_pos     = 0
    @done = false
    database(skill_id)
    @motion.do_act(skill_id)
    #@motion.skill_attachment(Database_Motion.new(skill_id, false))
  end
  #--------------------------------------------------------------------------
  # ○ 使用者をセット
  #--------------------------------------------------------------------------
  def set_user(user)
    # バトラーから値を取得
    @maxhp     = 1
    @hp        = 1
    @user      = user
    @x_pos     = user.x_pos
    @y_pos     = user.y_pos
    @z_pos     = user.z_pos
    @zoom      = user.zoom
    @direction = user.direction
  end
  #--------------------------------------------------------------------------
  # ● バトル画面 X 座標の取得
  #--------------------------------------------------------------------------
  def screen_x
    $xcam_x = 0 if $xcam_x == nil
    return 320 + (@x_pos.to_i - $xcam_x) * @zoom
  end
  #--------------------------------------------------------------------------
  # ● バトル画面 Y 座標の取得
  #--------------------------------------------------------------------------
  def screen_y
    $xcam_y = 0 if $xcam_y == nil
    return 240 + (-@y_pos.to_i + 64 + $xcam_y + @z_pos) * @zoom
  end
  #--------------------------------------------------------------------------
  # ● バトル画面 Z 座標の取得
  #--------------------------------------------------------------------------
  def screen_z
    return @z_pos
  end
end
#==============================================================================
# □ Game_ShootingTarget
#------------------------------------------------------------------------------
#  バトル中の飛び道具を扱うクラスです
#==============================================================================
class Game_ShootingTarget < Game_BattleBullet
  #--------------------------------------------------------------------------
  # ○ 使用者をセット
  #--------------------------------------------------------------------------
  def set_user(user)
    super
    @y_pos     = user.y_min
    @battler_name = graphic_name_from_skill_id(@skill_id)
  end
  #--------------------------------------------------------------------------
  # ● バトル画面 Y 座標の取得
  #--------------------------------------------------------------------------
  def screen_y
    $xcam_y = 0 if $xcam_y == nil
    return 240 + (-@y_pos.to_i + 64 + $xcam_y + 32) * @zoom
  end
  #--------------------------------------------------------------------------
  # ● バトル画面 Z 座標の取得
  #--------------------------------------------------------------------------
  def screen_z
    return @user.screen_z - 16
  end
end
#==============================================================================
# □ Game_Motion
#------------------------------------------------------------------------------
#  モーション (戦闘中の行動のフォーム) を扱うクラスです。
# このクラスは Game_Battler クラスの内部で使用されます。
#==============================================================================
class Game_Motion
  #--------------------------------------------------------------------------
  # ○ 公開インスタンス変数
  #--------------------------------------------------------------------------  
  attr_reader   :handling_priority        # 現在の行動の操作に対する優先度
  attr_accessor :action_duration          # 行動  残りフレーム数
  attr_reader   :jub_attack_connect_f     # 小コンボ接続フレーム
  attr_accessor :knock_back_duration      # のけぞり残りフレーム数   (Numeric)
  attr_accessor :hit_stop_duration        # ヒットストップフレーム数 (Numeric)
  attr_accessor :act_derive               # 行動派生予定             (String)
  attr_reader   :landing_duration         # 着地隙 使用フレーム数
  attr_reader   :attack_rect              # 攻撃範囲                 (Rect)
  attr_reader   :attack_skl_id            # 攻撃スキルID             (Numeric)
  attr_accessor :attack_hit_targets       # 攻撃ヒット済みバトラー配列
  attr_accessor :attack_motion_plan       # モーション予約
  attr_accessor :battle_bullet            # 飛び道具
  attr_accessor :battle_bullet_plan       # 飛び道具予約
  attr_accessor :now_attackcancelation    # 現在キャンセル回数 (Numeric)
  attr_reader   :uncancelable_duration    # キャンセル出来ない 持続時間
  attr_accessor :remain_to_hit_duration   # ヒット待ち 持続時間
  attr_reader   :presshold_key            # 押し続け停止キー
  attr_accessor :boardthrough_duration    # 板すり抜け落下 持続時間
  attr_accessor :ukemi_duration           # 受け身受け付け 持続時間
  attr_accessor :hit_invincible_duration  # 当たりあり無敵 持続時間
  attr_accessor :eva_invincible_duration  # 当たりなし無敵 持続時間
  attr_accessor :disappear_duration       # 消滅 持続時間
  attr_accessor :unfrictbreak_duration    # 摩擦/空気抵抗無効 持続時間
  attr_accessor :now_jumps                # 現在ジャンプ回数 (Numeric)
  attr_reader   :bullet_controllable      # 飛び道具操作可能
                                          #
                                          # --- フラグ系(true/false) ---
                                          #
  attr_accessor :blowning                 # 飛ばされ空中
  attr_accessor :downing                  # ダウン中
  attr_accessor :dashing                  # ダッシュ中
  attr_accessor :guarded                  # 攻撃をガードした
  attr_reader   :shaking                  # シェイク中
  attr_accessor :pressholding             # キー押し続け中
  attr_accessor :shooting_controling      # シューティングターゲット操作中
  #--------------------------------------------------------------------------
  # ○ オブジェクト初期化
  #--------------------------------------------------------------------------
  def initialize(me)
    @me = me
    # 完全クリア
    full_clear
  end
  #--------------------------------------------------------------------------
  # ○ 完全クリア
  #--------------------------------------------------------------------------
  def full_clear
    @me.now_x_speed = 0
    @me.now_y_speed = 0
    # 通常クリアされない値の初期化
    @knock_back_duration = 0
    @now_jumps           = 0
    # 通常クリア
    clear
  end
  #--------------------------------------------------------------------------
  # ○ クリア
  #--------------------------------------------------------------------------
  def clear
    @attack_rect         = Rect.new(0,0,0,0)
    # 予約
    @selfanimation_plan = []
    @shotanimation_plan = []
    @attack_motion_plan = []
    @attack_rectan_plan = []
    @attack_skl_id_plan = []
    @attack_hit_targets = []
    @active_xspeed_plan = []
    @active_move_x_plan = [] 
    @active_move_y_plan = []
    @active_move_z_plan = []
    @mybody_rectan_plan = []
    @shootintarget_plan = []
    @battle_shield_plan = []
    @battle_bullet_plan = []
    @cast_duration_plan = []
    @remian_to_hit_plan = []
    @presshold_key_plan = []
    @pressholdtime_plan = []
    @voice_playing_plan = []
    @handling_priority   = 0
    @boardthrough_duration = 0
    @now_attackcancelation = 0
    @jub_attack_connect_f  = 0
    @uncancelable_duration = 0
    @ukemi_duration = 0
    @hit_stop_duration   = 0
    @action_duration     = 0
    @cast_duration       = 0
    @remain_to_hit_duration  = 0
    @hit_invincible_duration = 0
    @eva_invincible_duration = 0
    @disappear_duration      = 0
    @unfrictbreak_duration   = 0
    @act_derive          = 0
    @battle_bullet       = nil
    @attack_skl_id       = 0
    @bullet_controllable = false
    @cancellation_switch = false
    @battle_bullet       = nil
    # 
    #if @me.shooting_target != nil
    #  @me.shooting_target.remain_duration = 0
    #end
    # フラグ
    @blowning            = false
    @downing             = false
    @dashing             = false
    @guarding            = false
    @shaking             = false
    @shooting_controling = false
    # キー押し続け
    @pressholding  = false
    @presshold_key = nil
    @pressholdtime = 0
    # ランディングフォース
    @landing_duration    = 0
    @landing_force_plan = []
    @landingmotion_plan = []
  end
  #--------------------------------------------------------------------------
  # ○ フレーム更新
  #--------------------------------------------------------------------------
  def update
    # 毎フレームのカウントダウン1
    @eva_invincible_duration -= 1 if @eva_invincible_duration > 0
    @hit_invincible_duration -= 1 if @hit_invincible_duration > 0
    @boardthrough_duration   -= 1 if @boardthrough_duration > 0
    @ukemi_duration          -= 1 if @ukemi_duration > 0
    # 消滅時間
    if @disappear_duration >= 0
      @disappear_duration -= 1
      if @disappear_duration == 0
        @action_duration = 1
      elsif @disappear_duration > 0
        @action_duration = 2
      end
    end
    # ヒットストップの残りフレーム数更新    
    if @hit_stop_duration > 0
      @hit_stop_duration -= 1
      return
    end
    # キー押し続け更新
    if @pressholding
      @pressholding   = false
      return
    elsif (!@pressholding and @presshold_key != nil)
      @pressholding  = false
      @presshold_key = nil
      @pressholdtime = 0
      return
    end
    # 詠唱時間
    if @cast_duration > 0
      @cast_duration -= @me.cnt
      return
    end
    # ヒット待ち
    if @remain_to_hit_duration > 0
      @remain_to_hit_duration -= 1
      if @remain_to_hit_duration == 0
        @bullet_controllable = false
      end
      return
    end
    # 初期化
    @me.relative_y_destination = 0
    @me.relative_x_destination = 0
    @battle_bullet = nil
    
    # 詠唱時間予約の更新
    if @cast_duration_plan.size > 0
      n = @cast_duration_plan.shift
      if n != nil
        @cast_duration = n
      end
    end
    # ヒット待ち予約の更新
    unless @remian_to_hit_plan.empty?
      n = @remian_to_hit_plan.shift
      if n != nil
        @remain_to_hit_duration = n
      end
    end
    # キー押し続け停止予約の更新
    unless @presshold_key_plan.empty?
      @presshold_key = @presshold_key_plan.shift
      @pressholdtime = @pressholdtime_plan.shift.to_i
    else
      @presshold_key = nil
      @pressholdtime = 0
    end
    # X 速度予約の更新
    unless @active_xspeed_plan.empty?
      n = @active_xspeed_plan.shift
      if n != nil
        @me.now_x_speed += n * @me.direction
      end
    end
    # X 移動予約の更新
    unless @active_move_x_plan.empty?
      n = @active_move_x_plan.shift
      if n != nil
        @me.relative_x_destination = n * @me.direction
      end
      if n == 0
        @me.now_x_speed = 0
        @me.now_y_speed = 0
      end
    end
    # Y 移動予約の更新
    unless @active_move_y_plan.empty?
      n = @active_move_y_plan.shift
      if n != nil
        @me.relative_y_destination = n
        @me.now_y_speed = 0
      end
    end
    # セルフアニメーション予約の更新
    if @selfanimation_plan.size > 0
      n = @selfanimation_plan.shift
      if n != nil
        @me.animation_id = n
        @me.animation1_id
        @me.animation_hit = true
      end
    end
    # シューティングターゲットアニメーションID予約の更新
    if @shotanimation_plan.size > 0
      n = @shotanimation_plan.shift
      if n != nil and @me.shooting_target != nil
        @me.shooting_target.animation_id = n
        @me.shooting_target.animation_hit = true
      end
    end
    # ボディRect予約の更新
    if @mybody_rectan_plan.size > 0
      r = @mybody_rectan_plan.shift
      if r.is_a?(Rect)
        @me.body_rect = r
      end
    end
    # バトラーモーション予約の更新
    unless @attack_motion_plan.empty?
      n = @attack_motion_plan.shift
      if !n.nil? #and @me.now_form_id/10 != n/10
        @me.transgraphic(n)
      end
    end
    # 攻撃予約の更新
    unless @attack_skl_id_plan.empty?
      n = @attack_skl_id_plan.shift
      unless n.nil?
        # 攻撃スキルを変更
        @attack_skl_id = n
        # それに伴って「既に命中した相手」配列をクリア
        @attack_hit_targets.clear
        # スキルIDが0なら攻撃範囲をしまう
        if n == 0
          @attack_rect = Rect.new(0,0,0,0)
        end
      end
    end
    # 攻撃範囲予約の更新
    unless @attack_rectan_plan.empty?
      r = @attack_rectan_plan.shift
      unless r.nil?
        @attack_rect = r
      end
    end
    # シューティングターゲット予約の更新
    unless @shootintarget_plan.empty?
      n = @shootintarget_plan.shift
      if n == nil
        #
      elsif n == 0 and @me.shooting_target != nil
        @me.shooting_target.done = true
      elsif n == -1
        @shooting_controling = false
      else
        @me.shooting_target = Game_ShootingTarget.new(n)
        @battle_bullet = @me.shooting_target # 飛び道具で管理
        @shooting_controling = true
      end
    end
    # 飛び道具予約の更新
    if @battle_bullet_plan.size > 0
      @battle_bullet = @battle_bullet_plan.shift
    end
    # シールド予約の更新
    if @battle_shield_plan.size > 0
      shield = @battle_shield_plan.shift
      if shield.is_a?(Numeric)
        @me.shield = nil
      elsif shield != nil
        @me.shield = shield
      end
    elsif [email protected]?
      @me.shield = nil
    end
    # ボイス再生予約の更新
    if @voice_playing_plan.size > 0
      n = @voice_playing_plan.shift
      unless n.nil?
        @me.voice.play(n)
      end
    end
    # のけぞり
    if @knock_back_duration >= 0
      @knock_back_duration   -= 1
      return
    end
    # 毎フレームのカウントダウン2
    @action_duration         -= 1 if @action_duration >= 0
    @jub_attack_connect_f    -= 1 if @jub_attack_connect_f > 0
    @uncancelable_duration   -= 1 if @uncancelable_duration > 0
    @unfrictbreak_duration   -= 1 if @unfrictbreak_duration > 0
    # アクションが終了した場合
    if @action_duration == 0
      # 行動派生
      case @act_derive
      when XRXS_BS1::ACT_JUMP
        do_jump(0)
      when XRXS_BS1::ACT_DASHJUMP
        do_jump(1)
      when XRXS_BS1::ACT_LAND
        do_landing_step
      when XRXS_BS1::ACT_RETURN
        do_return
      else
        # 姿勢復帰
        do_straighten
      end
      @act_derive = 0
    end
  end
  #--------------------------------------------------------------------------
  # ○ フレーム更新 (武器)
  #--------------------------------------------------------------------------
  def update_weapon
    return if @me.weapon_sprite.nil?
    value = @me.weapon_form_hash[@me.now_form_id]
    return if value.nil?
    @me.weapon_sprite.battler.transgraphic(value[0])
    @me.weapon_sprite.battler.relative_x_pos = value[1]
    @me.weapon_sprite.battler.relative_y_pos = value[2]
    @me.weapon_sprite.battler.relative_z_pos = value[3]
  end
  #--------------------------------------------------------------------------
  # ◇ ダメージのけぞり
  #--------------------------------------------------------------------------
  def do_damage
    clear # まずはクリア
    @downing = false # 叩き起こす
    @shaking = true
    # AIをリセット
    @me.ai.clear
    @me.ai.do_next
    # ボイス
    @me.voice.play(XRXS_BS1::VOICE_ID_DAMAGE)
    #
    @handling_priority = 5
    @action_duration   = 1
    #
    @attack_motion_plan = [71,nil,nil,72,nil,nil,73,nil,nil,74,nil,nil,74,nil,nil,74,nil,nil,73,nil,nil,72,nil,nil,71]
    @mybody_rectan_plan = [@me.stand_body_rect]
  end
  #--------------------------------------------------------------------------
  # ◇ ガード硬直
  #--------------------------------------------------------------------------
  def do_guard_shock
    clear # まずはクリア
    @shaking = true
    @handling_priority =  5
    @action_duration   =  1
  end
  #--------------------------------------------------------------------------
  # ◇ 指示可能?(戦闘終了時などに使用)
  #--------------------------------------------------------------------------
  def directable?
    return (not @me.dead?)
  end
  #--------------------------------------------------------------------------
  # ◇ 操作可能?
  #--------------------------------------------------------------------------
  def controllable?
    return (!(@blowning and @downing) and
            @knock_back_duration <= 0 )
  end
  #--------------------------------------------------------------------------
  # ◇ ガード可能?
  #--------------------------------------------------------------------------
  def guardable?
    return (@handling_priority < GUARD_PRIORITY)
  end
  #--------------------------------------------------------------------------
  # ◇ ガード中?(シールド展開中かどうか)
  #--------------------------------------------------------------------------
  def guarding?
    return [email protected]?
  end
  #--------------------------------------------------------------------------
  # ◇ メテオされる
  #--------------------------------------------------------------------------
  def do_meteor
    # 完全クリア
    full_clear
    # メテオスマッシュによる一定時間消滅
    @me.motion.do_down
    # 行動設定
    @handling_priority =  5
    @me.motion.action_duration = DISAPPEAR_DURATION
    # 「復帰」行動を予約
    @me.motion.act_derive = XRXS_BS1::ACT_RETURN
    # アニメーションを表示
    @me.animation_id = METEOR_ANIMATION_ID
    @me.animation_hit = true
  end
  #--------------------------------------------------------------------------
  # ◇ 復帰
  #--------------------------------------------------------------------------
  def do_return
    # 位置を中央にして
    @me.x_pos = 0
    @me.y_pos = 0
    # 受け身不可能で
    @ukemi_duration = 0
    # 倒れる
    do_down
    # 一定時間当たりあり無敵
    @hit_invincible_duration = 120
    # 行動設定
    @handling_priority =  1
    @action_duration   = 28 
    # アニメ設定
    @me.animation_id = RETURN_ANIMATION_ID
    @me.animation_hit = true
  end
  #--------------------------------------------------------------------------
  # ◇ 空中横移動
  #--------------------------------------------------------------------------
  def do_airwalk(direction)
    if direction == 1
      if @me.now_x_speed <= @me.air_x_maximum
        @me.now_x_speed += @me.air_x_velocity
        @me.now_x_speed  = [@me.now_x_speed, @me.air_x_maximum].min
      end
    else
      if @me.now_x_speed >= [email protected]_x_maximum
        @me.now_x_speed -= @me.air_x_velocity
        @me.now_x_speed  = [@me.now_x_speed, [email protected]_x_maximum].max
      end
    end
    @me.motion.unfrictbreak_duration = 2
  end
  #--------------------------------------------------------------------------
  # ◇ 姿勢復帰
  #--------------------------------------------------------------------------
  def do_straighten
    # ハンドリングプライオリティを 0 に(操作可能化)
    @handling_priority   = 0
    @cancellation_switch = false
    @shaking             = false
    @battle_bullet       = 0
    # コンボ数を初期化
    @now_damage_combo    = 0
    # 
    if @me.shooting_target != nil
      @me.shooting_target.done = true
    end
    if @me.is_a?(Game_BattleBullet)
      @me.done = true
    end
    # 状況に応じた姿勢立てなおし
    if @me.dead? or @downing
      #
    elsif @blowning
      @attack_motion_plan = [101]
    elsif @now_jumps == 0
      do_stand
    elsif @now_jumps > 0
      @attack_motion_plan = [41]
    end
    # キャンセル回数の復帰
    @now_attackcancelation = @me.maximum_attackcancelation
  end
  #--------------------------------------------------------------------------
  # ◇ 着地隙
  #--------------------------------------------------------------------------
  def do_landing_step
    if @knock_back_duration > 0
      return
    end
    @handling_priority = LANDING_PRIORITY
    if @landing_duration == 0 and @action_duration <= 0
      # 通常の着地
      @action_duration = 4
      @attack_motion_plan = [31]
      @mybody_rectan_plan = [@me.sit_body_rect,nil,nil,@me.stand_body_rect]
      @downing = false
      @attack_skl_id_plan.clear
      @attack_rectan_plan.clear
      @attack_hit_targets.clear
      @attack_rect = Rect.new(0,0,0,0)
    elsif @landing_duration > 0
      # 空中攻撃中の着地
      @action_duration = @landing_duration
      @attack_motion_plan = @landingmotion_plan.dup
      @attack_skl_id_plan = @landing_force_plan.dup
      @attack_rect = @me.sit_body_rect
      # 手動クリア
      @landing_duration = 0
      @landingmotion_plan.clear
      @landing_force_plan.clear
    end
  end
  #--------------------------------------------------------------------------
  # ◇ ジャンプ前の隙
  #--------------------------------------------------------------------------
  def do_crouch_to_jump
    # ハンドリングプライオリティ判定       or ジャンプ回数が足りない
    if @handling_priority >= JUMP_PRIORITY or @now_jumps >= @me.max_jumps
      @act_derive = 0
      return
    end
    # 実行
    @handling_priority = JUMP_PRIORITY
    if @now_jumps <= 0
      @action_duration = @me.crouch_to_jump
      # しゃがむ
      do_crouch
    else
      @action_duration = 1
    end
    @blowning = false
  end
  #--------------------------------------------------------------------------
  # ◇ ジャンプ
  #--------------------------------------------------------------------------
  def do_jump(type = 0)
    @blowning = false
    @handling_priority   = 0
    if @now_jumps == 0
      do_jump_motion
      @me.now_y_speed = @me.jump_y_init_velocity
    else
      @attack_motion_plan = [101]
      @me.now_y_speed = @me.airjump_y_init_velocity
    end
    case type
    when 0
      @me.now_x_speed = 0
    when 1
      @me.now_x_speed = @me.dash_x_speed * @me.direction
    end
    @now_jumps  += 1
  end
  #--------------------------------------------------------------------------
  # ◇ バックステップ
  #--------------------------------------------------------------------------
  def do_backstep
    return if @handling_priority >= GUARD_PRIORITY
    clear
    do_jump_motion
    @handling_priority = GUARD_PRIORITY
    @action_duration = 22
    @attack_motion_plan[ 8] = 51
    @attack_motion_plan[16] = 31
    @me.now_x_speed = @me.dash_x_speed * @me.direction * -1
    @me.now_y_speed = @me.jump_y_init_velocity/2
    @now_jumps += 1
  end
  #--------------------------------------------------------------------------
  # ◇ 板すりぬけ へ
  #--------------------------------------------------------------------------
  def do_boardthrough
    @boardthrough_duration = 3
    @attack_motion_plan.push(51)
  end
  #--------------------------------------------------------------------------
  # ◇ 逃走
  #--------------------------------------------------------------------------
  def do_escape
    @attack_motion_plan   = [11]
    @voice_playing_plan[16] = XRXS_BS1::VOICE_ID_ESCAPE
  end
  #--------------------------------------------------------------------------
  # ◇ 「ヒットまで待つ」キャンセル
  #--------------------------------------------------------------------------
  def remaining_cancel
    @action_duration -= @remain_to_hit_duration
    @remain_to_hit_duration = 0
    @bullet_controllable = false
  end
  #--------------------------------------------------------------------------
  # ◇ 「弱攻撃3」が使用可能かどうか
  #--------------------------------------------------------------------------
  def can_jub_attack3?
    if @handling_priority >= 2
      return true
    end
    return false
  end
  #--------------------------------------------------------------------------
  # ◇ 待機
  #--------------------------------------------------------------------------
  def do_stand
    return if @me.now_form_id/10 == 0 and !@attack_motion_plan.empty?
    @dashing = false
    @attack_motion_plan = [1,nil,nil,2,nil,nil,3,nil,nil,4,nil,nil,5,nil,nil,6,nil,nil,7,nil,nil,8,nil,nil,9,nil,nil,10,nil,nil,9,nil,nil,8,nil,nil,7,nil,nil,6,nil,nil,5,nil,nil,4,nil,nil,3,nil,nil,2,nil,nil,1]
  end
  #--------------------------------------------------------------------------
  # ◇ しゃがむ
  #--------------------------------------------------------------------------
  def do_crouch
    @dashing = false
    @attack_motion_plan = [31]
    @mybody_rectan_plan = [@me.sit_body_rect, @me.stand_body_rect]
  end
  #--------------------------------------------------------------------------
  # ◇ ダッシュブレーキ
  #--------------------------------------------------------------------------
  def do_dashbreak
    @dashing = false
    @handling_priority =  4
    @action_duration = 8
    @attack_motion_plan = [ 29]
  end
  #--------------------------------------------------------------------------
  # ◇ 起き上がり
  #--------------------------------------------------------------------------
  def do_stand_up
    # まずしゃずむ
    do_crouch
    #
    @handling_priority = 5
    @action_duration   = 8
    @eva_invincible_duration = 12
    @mybody_rectan_plan = [@me.sit_body_rect,nil,nil,nil,nil,@me.stand_body_rect]
    @downing = false
  end
  #--------------------------------------------------------------------------
  # ◇ 受け身
  #--------------------------------------------------------------------------
  def do_ukemi
    clear # まずはクリア
    @eva_invincible_duration = 12
    @blowning = false
    @downing = false
    @handling_priority  = 5
    @action_duration     = 6
    @me.now_x_speed = 0
    @me.now_y_speed = 6
    @attack_motion_plan = [51]
    @now_jumps   = @me.max_jumps
  end
  #--------------------------------------------------------------------------
  # ◇ ダウン
  #--------------------------------------------------------------------------
  def do_down
    @knock_back_duration = 0
    if @ukemi_duration > 0
      do_ukemi
      return
    end
    clear # まずはクリア
    @handling_priority  = 5
    @action_duration    = 6
    @attack_motion_plan = [ 91]
    @mybody_rectan_plan = [@me.down_body_rect]
    @downing = true
    #if @me.dead?
      #@me.voice.play(XRXS_BS1::VOICE_ID_DEAD)
    #end  
  end
  #--------------------------------------------------------------------------
  # ◇ 歩く/走る
  #--------------------------------------------------------------------------
  def do_walk(direction)
    if @now_jumps >= 1
      do_airwalk(direction)
      return
    end
    @me.direction = direction
    @unfrictbreak_duration = 1
    if @dashing
      # 走行中
      @me.now_x_speed = direction * @me.dash_x_speed
      return if @me.now_form_id/10 == 2 and !@attack_motion_plan.empty?
      @attack_motion_plan = [21,nil,nil,nil,22,nil,nil,nil,23,nil,nil,nil,24,nil,nil,nil,25,nil,nil,nil,26,nil,nil,nil,21,nil,nil,nil,22,nil,nil,nil,23,nil,nil,nil,24,nil,nil,nil,25,nil,nil,nil,26]
    else
      # 歩行中
      @me.now_x_speed = direction * @me.walk_x_speed
      return if !@attack_motion_plan.empty? and !@attack_motion_plan.include?(8)
      @attack_motion_plan = [11,nil,nil,nil,nil,12,nil,nil,nil,nil,13,nil,nil,nil,nil,14,nil,nil,nil,nil,15,nil,nil,nil,nil,16,nil,nil,nil,nil,17,nil,nil,nil,nil,18,nil,nil,nil,nil,19,nil,nil,nil,nil,20]
    end
  end
  #--------------------------------------------------------------------------
  # ◇ ジャンプ(モーション部分)
  #--------------------------------------------------------------------------
  def do_jump_motion
    @attack_motion_plan = [ 41]
  end
  #--------------------------------------------------------------------------
  # ◇ ジャンプ落下モーションに切り替え
  #--------------------------------------------------------------------------
  def do_jumping_fall
    @attack_motion_plan = [ 51]
  end
  #--------------------------------------------------------------------------
  # ◇ アイテム使用硬直
  #--------------------------------------------------------------------------
  def do_use_item
    @handling_priority  =  4
    @action_duration    = 36
    @selfanimation_plan[ 1] = 25
    #@attack_motion_plan = [341,nil,342,nil,343,nil,344,nil,345,nil,346,nil,347,nil,348,nil,349,nil,350,nil,351,nil,352,nil,353,nil,354,nil,355,nil,356]
  end
  #--------------------------------------------------------------------------
  # ◇ アイテム受け硬直
  #--------------------------------------------------------------------------
  def do_receive_item
    @handling_priority  =  4
    @action_duration    = 36
    @selfanimation_plan[ 1] = 25
    #@attack_motion_plan = [341,nil,342,nil,343,nil,344,nil,345,nil,346,nil,347,nil,348,nil,349,nil,350,nil,351,nil,352,nil,353,nil,354,nil,355,nil,356]
  end
  #--------------------------------------------------------------------------
  # ◇ 勝利ポーズ
  #--------------------------------------------------------------------------
  def do_won_cry
    if @me.hp * 3 < @me.maxhp
      @attack_motion_plan = [801,nil,nil,802,nil,nil,803,nil,nil,804,nil,nil,805,nil,nil,806,nil,nil,807,nil,nil,808,nil,nil,809,nil,nil,810,nil,nil,811,nil,nil,812,nil,nil,813,nil,nil,814,nil,nil,815,nil,nil,816,nil,nil,817,nil,nil,818,nil,nil,819,nil,nil,820,nil,nil,821,nil,nil,822]
      @me.voice.play(XRXS_BS1::VOICE_ID_PINCH_WIN)
    else
      @attack_motion_plan = [901,nil,nil,902,nil,nil,903,nil,nil,904,nil,nil,905,nil,nil,906,nil,nil,907,nil,nil,908,nil,nil,909,nil,nil,910,nil,nil,911,nil,nil,912,nil,nil,913,nil,nil,914,nil,nil,915,nil,nil,916,nil,nil,917,nil,nil,918,nil,nil,919,nil,nil,920,nil,nil,921,nil,nil,922,nil,nil,923,nil,nil,924,nil,nil,925,nil,nil,926,nil,nil,927,nil,nil,928,nil,nil,929,nil,nil,930,nil,nil,931,nil,nil,932,nil,nil,933,nil,nil,934,nil,nil,935,nil,nil,936,nil,nil,937,nil,nil,938,nil,nil,939,nil,nil,940,nil,nil,941,nil,nil,942,nil,nil,943,nil,nil,944,nil,nil,945,nil,nil,946,nil,nil,947,nil,nil,948,nil,nil,949,nil,nil,950,nil,nil,951,nil,nil,952,nil,nil,953,nil,nil,954,nil,nil,955,nil,nil,956,nil,nil,957,nil,nil,958,nil,nil,959]
      @me.voice.play(XRXS_BS1::VOICE_ID_WON_CRY)
    end
  end
  #--------------------------------------------------------------------------
  # ◇ アクション
  #--------------------------------------------------------------------------
  def do_act(skill_id)
    # スキルIDのチェック
    @skill_id = skill_id
    if @skill_id == nil or @skill_id == 0
      return
    end
    # キャンセル不可能持続時間中の場合
    if @uncancelable_duration > 0
      return 
    end
    #
    # --- スキルデータベースにて設定 ---
    #
    if skill_attachment(Database_Motion.new(@skill_id, @cancellation_switch))
      # ボイス
      if @handling_priority == 1
        id = 0
        if  @now_attackcancelation == @me.maximum_attackcancelation
          id = XRXS_BS1::VOICE_ID_ATTACK
        else
          id = XRXS_BS1::VOICE_ID_ATTACK2
        end
        @me.voice.play(id)
      else
        @me.voice.play(XRXS_BS1::VOICE_ID_BURST) 
      end
      # ダッシュ解除
      @dashing = false
      # 体勢復帰
      @blowning = false
      # キャンセル回数-1
      @now_attackcancelation -= 1
      # キャンセレーションスイッチを切り替え
      @cancellation_switch = !@cancellation_switch
    end
    # AI.次へ
    if @me.is_a?(Game_Actor) or @me.is_a?(Game_Enemy)
      @me.ai.do_next
    end
  end
  #--------------------------------------------------------------------------
  # ◇ スキル実行・変数の設定
  #--------------------------------------------------------------------------
  def skill_attachment(motion)
    # ハンドリングプライオリティ判定
    if @handling_priority >= motion.handling_priority
      return false
    end
    # ダウン判定
    if @downing
      return false
    end
    #
    if @skill_id == nil
      return false
    end
    # SP判定
    if @skill_id < 1000
      # スキルを取得
      @skill = $data_skills[@skill_id]
      #
      # 「SP 消費」
      #
      # 計算
      cost = @skill.sp_cost
      # 残りSPチェック
      if @me.sp < cost
        # SPxx
        return false
      end
      # SP 消費
      @me.sp -= cost
      # 「使用側アニメーション」自動予約
      n = $data_skills[@skill_id].animation1_id
      
      if n > 0
        @selfanimation_plan = [n]
      end
    end
    # 全てのデータを設定
    @handling_priority     = motion.handling_priority
    @action_duration       = motion.action_duration
    @jub_attack_connect_f  = motion.jub_attack_connect_f
    @uncancelable_duration = motion.uncancelable_duration
    @selfanimation_plan    = motion.selfanimation_plan
    @shotanimation_plan    = motion.shotanimation_plan
    @attack_motion_plan    = motion.attack_motion_plan
    @attack_rectan_plan    = motion.attack_rectan_plan
    @attack_skl_id_plan    = motion.attack_skl_id_plan
    @landing_duration      = motion.landing_duration
    @landing_force_plan    = motion.landing_force_plan
    @landingmotion_plan    = motion.landingmotion_plan
    @active_xspeed_plan    = motion.active_xspeed_plan
    @active_move_x_plan    = motion.active_move_x_plan
    @active_move_y_plan    = motion.active_move_y_plan
    @shootintarget_plan    = motion.shootintarget_plan
    @battle_shield_plan    = motion.battle_shield_plan
    @battle_bullet_plan    = motion.battle_bullet_plan
    @cast_duration_plan    = motion.cast_duration_plan
    @remian_to_hit_plan    = motion.remian_to_hit_plan
    @presshold_key_plan    = motion.presshold_key_plan
    @pressholdtime_plan    = motion.pressholdtime_plan
    @voice_playing_plan    = motion.voice_playing_plan
    @bullet_controllable   = motion.bullet_controllable
    #gaojie
    @eva_invincible_duration = motion.eva_invincible_duration
    #gaojie
    # 実行
    # 飛び道具
    if @me.is_a?(Game_BattleBullet)
      return false
    end
    return true
  end
end
class Database_Motion < Game_Motion
  #--------------------------------------------------------------------------
  # ○ 公開インスタンス変数
  #--------------------------------------------------------------------------
  # 飛び道具
  attr_reader   :battler_name             # バトラーグラフィック
  # 通常
  attr_reader   :handling_priority        # 現在の行動の操作に対する優先度
  attr_reader   :jub_attack_connect_f     # 小コンボ接続フレーム
  attr_reader   :ai_shooting_range_x_min     # AI.判断用「射程」X
  attr_reader   :ai_shooting_range_x_max     # AI.判断用「射程」X
  attr_reader   :ai_shooting_range_y_min     # AI.判断用「射程」Y
  attr_reader   :ai_shooting_range_y_max     # AI.判断用「射程」Y
  attr_reader   :selfanimation_plan       # セルフアニメーション予約
  attr_reader   :shotanimation_plan       # シューティングターゲットアニメーション予約
  attr_reader   :attack_rectan_plan       # 攻撃範囲予約
  attr_reader   :attack_skl_id_plan       # 攻撃スキルID予約
  attr_reader   :landing_duration         # 着地隙の長さ
  attr_reader   :landing_force_plan       # ランディングフォース攻撃スキルID予約
  attr_reader   :landingmotion_plan       # ランディングフォースモーション予約
  attr_reader   :active_xspeed_plan       #  X 加速予約
  attr_reader   :active_move_x_plan       #  X 動き予約
  attr_reader   :active_move_y_plan       #  Y 動き予約
  attr_reader   :active_move_z_plan       #  Y 動き予約
  attr_reader   :shootintarget_plan       # シューティングターゲット予約
  attr_reader   :battle_shield_plan       # シールド予約
  attr_reader   :battle_bullet_plan       # 飛び道具予約
  attr_reader   :cast_duration_plan       # 詠唱時間予約
  attr_reader   :remian_to_hit_plan       # ヒット待ち予約
  attr_reader   :presshold_key_plan       # 押し続けによる停止するキー予約
  attr_reader   :pressholdtime_plan       # 押し続けて停止している最大時間予約
  attr_reader   :voice_playing_plan       # ボイス再生予約
  attr_reader   :bullet_controllable      # 飛び道具操作可能性能(飛び道具専用)
  attr_reader   :eva_invincible_duration  #gaojie 无敌
end
 | 
 评分
查看全部评分
 |