[已解决]普通攻击动画和连击动画,如何用脚本改?

查看数: 3765 | 评论数: 2 | 收藏 0
关灯 | 提示:支持键盘翻页<-左 右->
    组图打开中,请稍候......
发布时间: 2019-7-6 15:06

正文摘要:

本帖最后由 miantouchi 于 2019-7-16 14:34 编辑 打个比方,我方人物普通攻击的情况下有4个动作总共25帧,但是有一定几率是连击,就是6个动作总共50帧,如何通过脚本改下。 比如武器设置动画地方只能选择一个动画 ...

回复

soulsaga 发表于 2019-7-6 15:25:47
本帖最后由 soulsaga 于 2019-7-6 16:00 编辑

[pre lang="ruby"]#--------------------------------------------------------------------------
  # ● 生成基本行动结果
  #--------------------------------------------------------------------------
  def make_basic_action_result
    # 攻击的情况下
    if @active_battler.current_action.basic == 0
      # 设置攻击 ID
      @animation1_id = @active_battler.animation1_id
      @animation2_id = @active_battler.animation2_id
      # 行动方的战斗者是敌人的情况下
      if @active_battler.is_a?(Game_Enemy)
        if @active_battler.restriction == 3
          target = $game_troop.random_target_enemy
        elsif @active_battler.restriction == 2
          target = $game_party.random_target_actor
        else
          index = @active_battler.current_action.target_index
          target = $game_party.smooth_target_actor(index)
        end
      end
      # 行动方的战斗者是角色的情况下
      if @active_battler.is_a?(Game_Actor)
        if @active_battler.restriction == 3
          target = $game_party.random_target_actor
        elsif @active_battler.restriction == 2
          target = $game_troop.random_target_enemy
        else
          index = @active_battler.current_action.target_index
          target = $game_troop.smooth_target_enemy(index)
        end
      end
      # 设置对像方的战斗者序列
      @target_battlers = [target]
      # 应用通常攻击效果
      for target in @target_battlers
        target.attack_effect(@active_battler)
      end
      return
    end
    # 防御的情况下
    if @active_battler.current_action.basic == 1
      # 帮助窗口显示"防御"
      @help_window.set_text($data_system.words.guard, 1)
      return
    end
    # 逃跑的情况下
    if @active_battler.is_a?(Game_Enemy) and
       @active_battler.current_action.basic == 2
      #  帮助窗口显示"逃跑"
      @help_window.set_text("逃跑", 1)
      # 逃跑
      @active_battler.escape
      return
    end
    # 什么也不做的情况下
    if @active_battler.current_action.basic == 3
      # 清除强制行动对像的战斗者
      $game_temp.forcing_battler = nil
      # 移至步骤 1
      @phase4_step = 1
      return
    end
  end[/pre]

想怎么改..你自己决定..

点评

不过只要把设置动画ID放在会心判断后面就可以了..  发表于 2019-7-13 16:48
判断会心是在动画 后的..  发表于 2019-7-13 16:45
地方是找到了,初步想法是,这个地方怎么加上判单? return 会心一击 ? @animation1_id = @active_battler.(animation1_id+1) : @animation1_id = @active_battler.animation_id  发表于 2019-7-13 16:08
更正了,普通攻击  发表于 2019-7-6 18:08
好像有说啊..算了..  发表于 2019-7-6 16:02

评分

参与人数 1星屑 +50 收起 理由
RyanBern + 50 精品文章

查看全部评分

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

在本版发帖返回顶部