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

Project1

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

[已经解决] 请教如何实现第五个角色强制使用某技能

[复制链接]

Lv3.寻梦者

梦石
0
星屑
1232
在线时间
1017 小时
注册时间
2011-4-30
帖子
1516
1
发表于 2014-11-2 10:22:36 | 显示全部楼层
本帖最后由 汪汪 于 2014-11-2 10:28 编辑

默认的强制行动是这个,大概就是给@parameters值进行处理,修改的话大概就是修改这几个值
  1.   def command_339
  2.     # 忽视是否在战斗中
  3.     unless $game_temp.in_battle
  4.       return true
  5.     end
  6.     # 忽视回合数为 0
  7.     if $game_temp.battle_turn == 0
  8.       return true
  9.     end
  10.     # 处理循环 (为了方便、不需要存在复数)
  11.     iterate_battler(@parameters[0], @parameters[1]) do |battler|
  12.       # 战斗者存在的情况下
  13.       if battler.exist?
  14.         # 设置行动
  15.         battler.current_action.kind = @parameters[2]
  16.         if battler.current_action.kind == 0
  17.           battler.current_action.basic = @parameters[3]
  18.         else
  19.           battler.current_action.skill_id = @parameters[3]
  20.         end
  21.         # 设置行动对像
  22.         if @parameters[4] == -2
  23.           if battler.is_a?(Game_Enemy)
  24.             battler.current_action.decide_last_target_for_enemy
  25.           else
  26.             battler.current_action.decide_last_target_for_actor
  27.           end
  28.         elsif @parameters[4] == -1
  29.           if battler.is_a?(Game_Enemy)
  30.             battler.current_action.decide_random_target_for_enemy
  31.           else
  32.             battler.current_action.decide_random_target_for_actor
  33.           end
  34.         elsif @parameters[4] >= 0
  35.           battler.current_action.target_index = @parameters[4]
  36.         end
  37.         # 设置强制标志
  38.         battler.current_action.forcing = true
  39.         # 行动有效并且是 [立即执行] 的情况下
  40.         if battler.current_action.valid? and @parameters[5] == 1
  41.           # 设置强制对像的战斗者
  42.           $game_temp.forcing_battler = battler
  43.           # 推进索引
  44.           @index += 1
  45.           # 结束
  46.           return false
  47.         end
  48.       end
  49.     end
  50.     # 继续
  51.     return true
  52.   end
复制代码
因为不清楚你的五人制是哪一种,所以只是做了一个对原来的简单修改
额……我也不太清楚这几个值到底是什么,大概 i1 应该是处理 第几个 角色强制行动的,比如 xingdong(1,2,1,28,-1,0) 就是让第三个角色使用黑暗。
在原来的 强制行动里 加上 p @parameters 试试看这几个值是什么意思吧。
  1.   

  2. class Interpreter
  3. def xingdong(i0=0,i1=0,i2=0,i3=0,i4=0,i5=0,i6=0)
  4.       # 忽视是否在战斗中
  5.     unless $game_temp.in_battle
  6.       return true
  7.     end
  8.     # 忽视回合数为 0
  9.     if $game_temp.battle_turn == 0
  10.       return true
  11.     end
  12.     # 处理循环 (为了方便、不需要存在复数)
  13.     iterate_battler(i0, i1) do |battler|
  14.       # 战斗者存在的情况下
  15.       if battler.exist?
  16.         # 设置行动
  17.         battler.current_action.kind = i2
  18.         if battler.current_action.kind == 0
  19.           battler.current_action.basic = i3
  20.         else
  21.           battler.current_action.skill_id = i3
  22.         end
  23.         # 设置行动对像
  24.         if i4 == -2
  25.           if battler.is_a?(Game_Enemy)
  26.             battler.current_action.decide_last_target_for_enemy
  27.           else
  28.             battler.current_action.decide_last_target_for_actor
  29.           end
  30.         elsif i4 == -1
  31.           if battler.is_a?(Game_Enemy)
  32.             battler.current_action.decide_random_target_for_enemy
  33.           else
  34.             battler.current_action.decide_random_target_for_actor
  35.           end
  36.         elsif i4 >= 0
  37.           battler.current_action.target_index = i4
  38.         end
  39.         # 设置强制标志
  40.         battler.current_action.forcing = true
  41.         # 行动有效并且是 [立即执行] 的情况下
  42.         if battler.current_action.valid? and i5 == 1
  43.           # 设置强制对像的战斗者
  44.           $game_temp.forcing_battler = battler
  45.           # 推进索引
  46.           @index += 1
  47.           # 结束
  48.           return false
  49.         end
  50.       end
  51.     end
  52.     # 继续
  53.     return true
  54.   end
  55. end

复制代码
额,调用的话直接在事件的脚本里输入  xingdong(1,2,1,28,-1,0)  这样的代码
你的五人制大概应该是用  xingdong(1,4,1,28,-1,0)  可以让第五人强制行动吧。

评分

参与人数 2星屑 +110 收起 理由
RyanBern + 100 塞糖
woshinide951 + 10 先谢过了~

查看全部评分

回复 支持 反对

使用道具 举报

Lv3.寻梦者

梦石
0
星屑
1232
在线时间
1017 小时
注册时间
2011-4-30
帖子
1516
2
发表于 2014-11-5 12:37:27 | 显示全部楼层
woshinide951 发表于 2014-11-4 22:46
好像不能 强制 普通攻击......

先问一下,其他应该可以吧……
  1.   

  2. class Interpreter
  3. def xingdong(i0=0,i1=0,i2=0,i3=0,i4=0,i5=0)
  4.       # 忽视是否在战斗中
  5.     unless $game_temp.in_battle
  6.       return true
  7.     end
  8.     # 忽视回合数为 0
  9.     if $game_temp.battle_turn == 0
  10.       return true
  11.     end
  12.     # 处理循环 (为了方便、不需要存在复数)
  13.     iterate_battler(i0, i1) do |battler|
  14.       # 战斗者存在的情况下
  15.       if battler.exist?
  16.         # 设置行动
  17.         battler.current_action.kind = i2
  18.         if battler.current_action.kind == 0
  19.           battler.current_action.basic = i3
  20.         else
  21.           battler.current_action.skill_id = i3
  22.         end
  23.         # 设置行动对像
  24.         if i4 == -2
  25.           if battler.is_a?(Game_Enemy)
  26.             battler.current_action.decide_last_target_for_enemy
  27.           else
  28.             battler.current_action.decide_last_target_for_actor
  29.           end
  30.         elsif i4 == -1
  31.           if battler.is_a?(Game_Enemy)
  32.             battler.current_action.decide_random_target_for_enemy
  33.           else
  34.             battler.current_action.decide_random_target_for_actor
  35.           end
  36.         elsif i4 >= 0
  37.           battler.current_action.target_index = i4
  38.         end
  39.         # 设置强制标志
  40.         battler.current_action.forcing = true
  41.         # 行动有效并且是 [立即执行] 的情况下
  42.         if battler.current_action.valid? and i5 == 1
  43.           # 设置强制对像的战斗者
  44.           $game_temp.forcing_battler = battler
  45.           # 推进索引
  46.           @index += 1
  47.           # 结束
  48.           return false
  49.         end
  50.       end
  51.     end
  52.     # 继续
  53.     return true
  54.   end
  55. end
复制代码
修改了一下,原来多了个i6   ̄□ ̄||

新建位图图像.png (11.15 KB, 下载次数: 6)

强制行动的解释

强制行动的解释
回复 支持 反对

使用道具 举报

Lv3.寻梦者

梦石
0
星屑
1232
在线时间
1017 小时
注册时间
2011-4-30
帖子
1516
3
发表于 2014-11-6 06:41:16 | 显示全部楼层
woshinide951 发表于 2014-11-6 00:57
没有作用?难道我的设置出问题了吗  是不是在事件脚本里 直接写 xingdong(1,4,1,67,-1,1) 哪里有错? ...

……可能是我水平不够,写错了吧。如果可以把你那个5人制的脚本发过来,我想仔细研究一下。
回复 支持 反对

使用道具 举报

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

本版积分规则

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

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

GMT+8, 2024-5-19 17:56

Powered by Discuz! X3.1

© 2001-2013 Comsenz Inc.

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