查看: 3724|回复: 11

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

[复制链接]
梦石
0
星屑
15041
在线时间
2230 小时
注册时间
2019-1-24
回帖
964

R考场第七期纪念奖

发表于 2019-7-6 15:06:37 | 显示全部楼层 |阅读模式

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

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

×
本帖最后由 miantouchi 于 2019-7-16 14:34 编辑

打个比方,我方人物普通攻击的情况下有4个动作总共25帧,但是有一定几率是连击,就是6个动作总共50帧,如何通过脚本改下。
比如武器设置动画地方只能选择一个动画,如何让系统判定下,可以使用系统的会心一击,或者熟练度判断都行。
普通攻击播放123/124动画。
连击情况播放125/126动画。
1.png
2.png
3.png
梦石
0
星屑
39236
在线时间
11155 小时
注册时间
2009-3-15
回帖
4768
发表于 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 精品文章

查看全部评分

回复

使用道具 举报

梦石
0
星屑
15041
在线时间
2230 小时
注册时间
2019-1-24
回帖
964

R考场第七期纪念奖

 楼主| 发表于 2019-7-16 14:07:26 | 显示全部楼层
我这么做怎么都是灰心一击都是false
11.png

点评

哦,多谢提醒,好用了  发表于 2019-7-16 14:25
因为会心一击的标志是在"对象方身上" 也就是上面的 target  发表于 2019-7-16 14:17
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 注册会员

本版积分规则

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

在本版发帖返回顶部