设为首页收藏本站|繁體中文

Project1

 找回密码
 注册会员
搜索
查看: 725|回复: 16
打印 上一主题 下一主题

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

[复制链接]

Lv2.观梦者

梦石
0
星屑
385
在线时间
98 小时
注册时间
2021-8-1
帖子
21
跳转到指定楼层
1
发表于 2023-11-18 19:13:35 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式

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

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

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

多谢各位的指教

点评

顶  发表于 2023-11-18 21:32

Lv5.捕梦者

梦石
0
星屑
33198
在线时间
10491 小时
注册时间
2009-3-15
帖子
4756
2
发表于 2023-11-19 00:40:12 | 只看该作者
本帖最后由 soulsaga 于 2023-11-19 16:44 编辑

RUBY 代码复制
  1. @连攻=0;@连打=0
  2.     # 添加角色到 @action_battlers 序列
  3.     for actor in $game_party.actors
  4.       @action_battlers.push(actor)
  5.     if actor.name =="阿尔西斯"
  6.      @action_battlers.push(actor)
  7.      @连攻=2;@连打=2
  8.      end
  9.     end



RUBY 代码复制
  1. #--------------------------------------------------------------------------
  2.   # ● 生成基本行动结果
  3.   #--------------------------------------------------------------------------
  4.   def make_basic_action_result
  5.     # 攻击的情况下
  6.     if @active_battler.current_action.basic == 0
  7.       # 设置攻击 ID
  8.       @animation1_id = @active_battler.animation1_id
  9.       @animation2_id = @active_battler.animation2_id
  10.       # 行动方的战斗者是敌人的情况下
  11.       if @active_battler.is_a?(Game_Enemy)
  12.         if @active_battler.restriction == 3
  13.           target = $game_troop.random_target_enemy
  14.         elsif @active_battler.restriction == 2
  15.           target = $game_party.random_target_actor
  16.         else
  17.           index = @active_battler.current_action.target_index
  18.           target = $game_party.smooth_target_actor(index)
  19.         end
  20.       end
  21.       # 行动方的战斗者是角色的情况下
  22.       if @active_battler.is_a?(Game_Actor)
  23.         if @active_battler.restriction == 3
  24.           target = $game_party.random_target_actor
  25.         elsif @active_battler.restriction == 2
  26.           target = $game_troop.random_target_enemy
  27.         else
  28.           index = @active_battler.current_action.target_index
  29.          #以下是添加的脚本
  30.           x=(0...$game_troop.enemies.size).to_a
  31.           x.delete_at(@active_battler.current_action.target_index)
  32.           if @连攻>0 and @连攻<@连打 and @active_battler.name=="阿尔西斯"
  33.           index=@active_battler.current_action.target_index=x[rand(x.size)]
  34.           end
  35.           target = $game_troop.smooth_target_enemy(index)
  36.           @连攻-=1 if @连攻>0
  37.         end
  38.       end
  39.       # 设置对像方的战斗者序列
  40.       @target_battlers = [target]
  41.       # 应用通常攻击效果
  42.       for target in @target_battlers
  43.         target.attack_effect(@active_battler)
  44.       end
  45.       return
  46.     end
  47.     # 防御的情况下
  48.     if @active_battler.current_action.basic == 1
  49.       # 帮助窗口显示"防御"
  50.       @help_window.set_text($data_system.words.guard, 1)
  51.       return
  52.     end
  53.     # 逃跑的情况下
  54.     if @active_battler.is_a?(Game_Enemy) and
  55.        @active_battler.current_action.basic == 2
  56.       #  帮助窗口显示"逃跑"
  57.       @help_window.set_text("逃跑", 1)
  58.       # 逃跑
  59.       @active_battler.escape
  60.       return
  61.     end
  62.     # 什么也不做的情况下
  63.     if @active_battler.current_action.basic == 3
  64.       # 清除强制行动对像的战斗者
  65.       $game_temp.forcing_battler = nil
  66.       # 移至步骤 1
  67.       @phase4_step = 1
  68.       return
  69.     end
  70.   end


技能需要也照抄一次
回复 支持 反对

使用道具 举报

Lv2.观梦者

梦石
0
星屑
385
在线时间
98 小时
注册时间
2021-8-1
帖子
21
3
 楼主| 发表于 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 大大
回复 支持 反对

使用道具 举报

Lv2.观梦者

梦石
0
星屑
385
在线时间
98 小时
注册时间
2021-8-1
帖子
21
4
 楼主| 发表于 2023-11-19 08:11:24 | 只看该作者
本帖最后由 dp1989 于 2023-11-20 19:20 编辑

点评

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

使用道具 举报

Lv2.观梦者

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

使用道具 举报

Lv2.观梦者

梦石
0
星屑
385
在线时间
98 小时
注册时间
2021-8-1
帖子
21
6
 楼主| 发表于 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大大 的热心帮助。
回复 支持 反对

使用道具 举报

Lv2.观梦者

梦石
0
星屑
385
在线时间
98 小时
注册时间
2021-8-1
帖子
21
7
 楼主| 发表于 2023-11-19 13:07:39 | 只看该作者
本帖最后由 dp1989 于 2023-11-20 19:21 编辑

点评

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

使用道具 举报

Lv5.捕梦者

梦石
0
星屑
33198
在线时间
10491 小时
注册时间
2009-3-15
帖子
4756
8
发表于 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


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

使用道具 举报

Lv2.观梦者

梦石
0
星屑
385
在线时间
98 小时
注册时间
2021-8-1
帖子
21
9
 楼主| 发表于 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
回复 支持 反对

使用道具 举报

Lv5.捕梦者

梦石
0
星屑
33198
在线时间
10491 小时
注册时间
2009-3-15
帖子
4756
10
发表于 2023-11-19 16:17:00 | 只看该作者
dp1989 发表于 2023-11-19 16:01
确实可以 厉害
感谢soulsaga大大 大佬的思路清晰,学习了。

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

使用道具 举报

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

本版积分规则

拿上你的纸笔,建造一个属于你的梦想世界,加入吧。
 注册会员
找回密码

站长信箱:[email protected]|手机版|小黑屋|无图版|Project1游戏制作

GMT+8, 2024-4-30 09:51

Powered by Discuz! X3.1

© 2001-2013 Comsenz Inc.

快速回复 返回顶部 返回列表