查看: 1995|回复: 0

[已经过期] 关于RTAB等待动画开关的问题

[复制链接]
梦石
0
星屑
606
在线时间
797 小时
注册时间
2014-7-1
回帖
501

开拓者

发表于 2017-7-12 21:02:45 | 显示全部楼层 |阅读模式

加入我们,或者,欢迎回来。

您需要 登录 才可以下载或查看,没有账号?注册会员

×
先上脚本,这是部分的
[pre lang="ruby"]
class Scene_Battle
  #--------------------------------------------------------------------------
  # ● 公開インスタンス変数
  #--------------------------------------------------------------------------
  attr_reader   :status_window            # ステータスウィンドウ
  attr_reader   :spriteset                # バトルスプライト
  attr_reader   :scroll_time              # スクリーン移動基本時間
  attr_reader   :zoom_rate                # 敵バトラー基本位置
  attr_reader   :drive                    # カメラ駆動
  attr_accessor :force                    # アクション強制度
  attr_accessor :camera                   # 現在のカメラ所持者
  #--------------------------------------------------------------------------
  # ● ATB基礎セットアップ
  #--------------------------------------------------------------------------
  def atb_setup
    # ATB初期化
    # speed   : バトルスピード決定。値が小さいほど早い
    # @active : アクティブ度設定
    #           3 : 常にアクティブ状態
    #           2 : スキル・アイテム選択中のみアクティブゲージが止まる
    #           1 : 2の状態に加え、ターゲット選択時もウェイトが掛かる
    #           0 : 1の状態に加え、コマンド入力時にもウェイトが掛かる
    # @action : 他人が行動中に自分も行動を起こすことを許すか
    #           3 : 自分が行動不能でない限り限り許す
    #           2 : 自分がダメージを受けていない限り許す
    #           1 : 2の状態に加え、ターゲットが行動していない限り許す
    #           0 : 行動を許さない。順番に行動し終えるまで待つ
    # @anime_wait : trueにするとバトルアニメ・ダメージ表示中はウェイトが掛かる
    # @damage_wait : ダメージ表示待ち時間(単位はフレーム)
    # @enemy_speed : 敵の思考速度。1なら即時行動。
    #                1フレーム毎に、1/@enemy_speedの確率で行動を起こす
    # @force : 強制アクションでスキル使用時の強制具合
    #          2:スキルは全て詠唱せず、必ず即時実行
    #          1:単独スキルは詠唱し、連携スキルのみ即時実行
    #          0:全スキル詠唱を行うだけ
    # ($scene.force = x とすることにより、通常イベントのスクリプトから変更可能)
    # @DRIVE : カメラ駆動ON/OFF。trueで駆動ON、falseで駆動OFF
    # @scroll_time : スクリーン移動に要する基本時間
    # @zoom_rate = [i, j] : エネミーのズーム率
    #                       i が画面最上部に配置した時の拡大率
    #                       j が画面最下部に配置した時の拡大率
    #                       1 倍としたいときも、1.0 と必ず小数で設定すること
    speed = 100
    @active = 3
    @action = 3
    @anime_wait = false#true#false
    @damage_wait = 10
    @enemy_speed = 10
    @force = 2
    @drive = false
    @scroll_time = 15
    @zoom_rate = [0.2, 1.0]
    @help_time = 40
    @escape == false
    @camera = nil
    @Max = 0
    @turn_cnt = 0
    @help_wait = 0
    @action_battlers = []
    @synthe = []
    @spell_p = {}
    @spell_e = {}
    @command_a = false
    @command = []
    @party = false
    for battler in $game_party.actors + $game_troop.enemies
      spell_reset(battler)
      battler.at = battler.agi * rand(speed / 2)
      battler.damage_pop = {}
      battler.damage = {}
      battler.damage_sp = {}
      battler.critical = {}
      battler.recover_hp = {}
      battler.recover_sp = {}
      battler.state_p = {}
      battler.state_m = {}
      battler.animation = []
      if battler.is_a?(Game_Actor)
        @max += battler.agi
      end
    end
    @max *= speed
    @max /= $game_party.actors.size
    for battler in $game_party.actors + $game_troop.enemies
      battler.atp = 100 * battler.at / @max
    end
  end
  #--------------------------------------------------------------------------
  # ● ATゲージMax時SE
  #--------------------------------------------------------------------------
  def fullat_se
    Audio.se_play("Audio/SE/033-switch02", 80, 100)
  end
  #--------------------------------------------------------------------------
  # ● レベルアップSE
  #--------------------------------------------------------------------------
  def levelup_se
    Audio.se_play("Audio/SE/056-Right02", 80, 100)
  end
  #--------------------------------------------------------------------------
  # ● スキル習得SE
  #--------------------------------------------------------------------------
  def skill_se
    Audio.se_play("Audio/SE/056-Right02", 80, 150)
  end
end

class Window_Base < Window
  #--------------------------------------------------------------------------
  # ● ATG の描画
  #     actor : アクター
  #     x     : 描画先 X 座標
  #     y     : 描画先 Y 座標
  #     width : 描画先の幅
  #--------------------------------------------------------------------------
  def draw_actor_atg(actor, x, y, width = 144)
    if @at_gauge == nil
      # plus_x:X座標の位置補正 rate_x:X座標の位置補正(%) plus_y:Y座標の位置補正
      # plus_width:幅の補正 rate_width:幅の補正(%) height:縦幅
      # align1:描画タイプ1 0:左詰め 1:中央揃え 2:右詰め
      # align2:描画タイプ2 0:上詰め 1:中央揃え 2:下詰め
      # align3:ゲージタイプ 0:左詰め 1:右詰め
      @plus_x = 0
      @rate_x = 0
      @plus_y = 16
      @plus_width = 0
      @rate_width = 100
      @width = @plus_width + width * @rate_width / 100
      @height = 16
      @align1 = 0
      @align2 = 1
      @align3 = 0
      # グラデーション設定 grade1:空ゲージ grade2:実ゲージ
      # (0:横にグラデーション 1:縦にグラデーション 2:斜めにグラデーション)
      grade1 = 1
      grade2 = 0
      # 色設定。color1:最外枠,color2:中枠
      # color3:空枠ダークカラー,color4:空枠ライトカラー
      color1 = Color.new(0, 0, 0)
      color2 = Color.new(255, 255, 192)
      color3 = Color.new(0, 0, 0, 192)
      color4 = Color.new(0, 0, 64, 192)
      # ゲージの色設定
      # 通常時の色設定
      color5 = Color.new(0, 64, 80)
      color6 = Color.new(0, 128, 160)
      # ゲージがMAXの時の色設定
      color7 = Color.new(80, 0, 0)
      color8 = Color.new(240, 0, 0)
      # 連携スキル使用時の色設定
      color9 = Color.new(80, 64, 32)
      color10 = Color.new(240, 192, 96)
      # スキル詠唱時の色設定
      color11 = Color.new(80, 0, 64)
      color12 = Color.new(240, 0, 192)
      # ゲージの描画
      gauge_rect_at(@width, @height, @align3, color1, color2,
                  color3, color4, color5, color6, color7, color8,
                  color9, color10, color11, color12, grade1, grade2)
    end
    # 変数atに描画するゲージの幅を代入
    if actor.rtp == 0
      at = (width + @plus_width) * actor.atp * @rate_width / 10000
    else
      at = (width + @plus_width) * actor.rt * @rate_width / actor.rtp / 100
    end
    if at > width
      at = width
    end
    # ゲージの左詰・中央構え等の補正
    case @align1
    when 1
      x += (@rect_width - width) / 2
    when 2
      x += @rect_width - width
    end
    case @align2
    when 1
      y -= @height / 2
    when 2
      y -= @height
    end
    self.contents.blt(x + @plus_x + width * @rate_x / 100, y + @plus_y,
                      @at_gauge, Rect.new(0, 0, @width, @height))
    if @align3 == 0
      rect_x = 0
    else
      x += @width - at - 1
      rect_x = @width - at - 1
    end
    # ゲージの色設定
    if at == width
        # MAX時のゲージ描画
      self.contents.blt(x + @plus_x + @width * @rate_x / 100, y + @plus_y,
                        @at_gauge, Rect.new(rect_x, @height * 2, at, @height))
    else
      if actor.rtp == 0
        # 通常時のゲージ描画
        self.contents.blt(x + @plus_x + @width * @rate_x / 100, y + @plus_y,
                          @at_gauge, Rect.new(rect_x, @height, at, @height))
      else
        if actor.spell == true
          # 連携スキル使用時のゲージ描画
          self.contents.blt(x + @plus_x + @width * @rate_x / 100, y + @plus_y,
                        @at_gauge, Rect.new(rect_x, @height * 3, at, @height))
        else
          # スキル詠唱時のゲージ描画
          self.contents.blt(x + @plus_x + @width * @rate_x / 100, y + @plus_y,
                        @at_gauge, Rect.new(rect_x, @height * 4, at, @height))
        end
      end
    end
  end
end
[/pre]

这上面有个 @anime_wait =
是控制技能释放时候是否等待动画结束的
但是不能临时更改,我就想在使用某些ID技能的时候进行等待
其他技能不等待!

下面是RTAB定义这个地方
[pre lang="ruby"]
def anime_wait_return
    if (@action_battlers.empty? or @anime_wait == false) and
        not $game_system.battle_interpreter.running? and not fin?
      # エネミーアローが有効の場合
      if @enemy_arrow != nil
        return [@active - 2, 0].min == 0
      # アクターアローが有効の場合
      elsif @actor_arrow != nil
        return [@active - 2, 0].min == 0
      # スキルウィンドウが有効の場合
      elsif @skill_window != nil
        return [@active - 3, 0].min == 0
      # アイテムウィンドウが有効の場合
      elsif @item_window != nil
        return [@active - 3, 0].min == 0
      # アクターコマンドウィンドウが有効の場合
      elsif @actor_command_window.active
        return [@active - 1, 0].min == 0
      else
        return true
      end
    else
      return false
    end
  end
[/pre]

我用的是图书馆那个以前很老版本的RTAB!

知道的大神求告知一下··!!!!!

不想用豪华版本的!
学习使我疲劳,打工使我疲惫,恋爱使我伤身,吸烟伤我肺腑,饮酒损我形象,旅游使我破费,月底不见铜板,只有在论坛里面看看各种大佬才能使我进去
您需要登录后才可以回帖 登录 | 注册会员

本版积分规则

Powered by Discuz! X5.0 © 2001-2026 Discuz! Team.

在本版发帖返回顶部