查看: 2367|回复: 16

[有事请教] 请教一下关于普通攻击二次连击目标的问题

[复制链接]
梦石
0
星屑
518
在线时间
113 小时
注册时间
2021-8-1
回帖
21
发表于 2023-11-18 19:13:35 | 显示全部楼层 |阅读模式

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

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

×
本帖最后由 dp1989 于 2023-11-20 19:13 编辑

多谢各位的指教

点评

顶  发表于 2023-11-18 21:32
梦石
0
星屑
39236
在线时间
11155 小时
注册时间
2009-3-15
回帖
4768
发表于 2023-11-19 00:40:12 | 显示全部楼层
本帖最后由 soulsaga 于 2023-11-19 16:44 编辑

[pre lang="ruby"]
@连攻=0;@连打=0
    # 添加角色到 @action_battlers 序列
    for actor in $game_party.actors
      @action_battlers.push(actor)
    if actor.name =="阿尔西斯"
     @action_battlers.push(actor)
     @连攻=2;@连打=2
     end
    end[/pre]


[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
         #以下是添加的脚本
          x=(0...$game_troop.enemies.size).to_a
          x.delete_at(@active_battler.current_action.target_index)
          if @连攻>0 and @连攻<@连打 and @active_battler.name=="阿尔西斯"
          index=@active_battler.current_action.target_index=x[rand(x.size)]
          end
          target = $game_troop.smooth_target_enemy(index)
          @连攻-=1 if @连攻>0
        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]

技能需要也照抄一次
回复

使用道具 举报

梦石
0
星屑
518
在线时间
113 小时
注册时间
2021-8-1
回帖
21
 楼主| 发表于 2023-11-19 06:38:55 | 显示全部楼层
本帖最后由 dp1989 于 2023-11-19 06:40 编辑
soulsaga 发表于 2023-11-19 00:40
actor.current_action.target_index=rand($game_troop.enemies.size)[/pre]


感谢soulsaga 大大
回复

使用道具 举报

梦石
0
星屑
518
在线时间
113 小时
注册时间
2021-8-1
回帖
21
 楼主| 发表于 2023-11-19 08:11:24 | 显示全部楼层
本帖最后由 dp1989 于 2023-11-20 19:20 编辑

点评

已更新脚本..我不知用DUP行不行..如果不行再找一下  发表于 2023-11-19 12:12
回复

使用道具 举报

梦石
0
星屑
518
在线时间
113 小时
注册时间
2021-8-1
回帖
21
 楼主| 发表于 2023-11-19 11:25:05 | 显示全部楼层
请教一下各位脚本高手 有可以达到二次行动目标改变的脚本吗? 尝试使用站内 芯☆淡茹水大大的 二次行动脚本https://rpg.blue/thread-378714-1-1.html 脚本很好用,但是只能攻击同一个人。
回复

使用道具 举报

梦石
0
星屑
518
在线时间
113 小时
注册时间
2021-8-1
回帖
21
 楼主| 发表于 2023-11-19 12:19:55 | 显示全部楼层
soulsaga 发表于 2023-11-19 00:40
a=actor.dup
a.current_action.target_index=rand($game_troop.enemies.size)[/pre]

虽然还是一样。但还是感谢 soulsaga大大 的热心帮助。
回复

使用道具 举报

梦石
0
星屑
518
在线时间
113 小时
注册时间
2021-8-1
回帖
21
 楼主| 发表于 2023-11-19 13:07:39 | 显示全部楼层
本帖最后由 dp1989 于 2023-11-20 19:21 编辑

点评

已更新脚本这次亲测有效  发表于 2023-11-19 14:16
回复

使用道具 举报

梦石
0
星屑
39236
在线时间
11155 小时
注册时间
2009-3-15
回帖
4768
发表于 2023-11-19 13:41:06 | 显示全部楼层
本帖最后由 soulsaga 于 2023-11-19 14:02 编辑
dp1989 发表于 2023-11-19 13:07
#####################   
# 添加角色到 @action_battlers 序列
    for actor in $game_party.actors


这方法行不通呢..一般只能打同一目标
回复

使用道具 举报

梦石
0
星屑
518
在线时间
113 小时
注册时间
2021-8-1
回帖
21
 楼主| 发表于 2023-11-19 16:01:25 | 显示全部楼层
soulsaga 发表于 2023-11-19 00:40
@连攻=0
# 添加角色到 @action_battlers 序列
    for actor in $game_party.actors

确实可以 厉害
感谢soulsaga大大 大佬的思路清晰,学习了。

点评

已更新脚本..这次才对  发表于 2023-11-19 16:44
回复

使用道具 举报

梦石
0
星屑
39236
在线时间
11155 小时
注册时间
2009-3-15
回帖
4768
发表于 2023-11-19 16:17:00 | 显示全部楼层
dp1989 发表于 2023-11-19 16:01
确实可以 厉害
感谢soulsaga大大 大佬的思路清晰,学习了。

好像不行,有些问题,再研究一下
回复

使用道具 举报

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

本版积分规则

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

在本版发帖返回顶部