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

Project1

 找回密码
 注册会员
搜索
查看: 11503|回复: 12

[RMVX发布] 战斗中按R键重复上次动作

 关闭 [复制链接]

Lv2.观梦者

天仙

梦石
0
星屑
610
在线时间
184 小时
注册时间
2008-4-15
帖子
5023

贵宾

发表于 2008-10-27 14:30:34 | 显示全部楼层 |阅读模式

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

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

x
在战斗中按 Z 键,重复上次动作,包括上次选择目标

  1. #重複的按鍵
  2. $repeat_button = Input::Z


  3. class Scene_Battle < Scene_Base
  4.   alias repeat_start start
  5.   alias repeat_update update
  6.   alias repeat_update_actor_command_selection update_actor_command_selection
  7.   alias repeat_update_target_enemy_selection update_target_enemy_selection
  8.   alias repeat_update_target_actor_selection update_target_actor_selection
  9.   alias repeat_determine_skill determine_skill
  10.   alias repeat_determine_item determine_item
  11.   def start
  12.     @actor_last_action = {}
  13.     repeat_start
  14.   end
  15.   def update
  16.     unless $game_message.visible
  17.       if Input.trigger?($repeat_button)
  18.         return unless @actor_command_window.active
  19.       end
  20.     end
  21.     repeat_update
  22.   end
  23.   def update_actor_command_selection
  24.     if Input.trigger?(Input::C)
  25.       case @actor_command_window.index
  26.       when 0  # 攻擊
  27.         @actor_last_action[@active_battler] = [0]
  28.       when 2  # 防禦
  29.         @actor_last_action[@active_battler] = [2]
  30.       end
  31.     elsif Input.trigger?($repeat_button)
  32.       determine_last_action
  33.     end
  34.     repeat_update_actor_command_selection
  35.   end
  36.   def update_target_enemy_selection
  37.     if Input.trigger?(Input::C)
  38.       if @active_battler.action.attack?
  39.         @actor_last_action[@active_battler] = [0, @target_enemy_window.enemy.index]
  40.       elsif @active_battler.action.skill?
  41.         @actor_last_action[@active_battler] = [1, @skill, @target_enemy_window.enemy.index]
  42.       elsif @active_battler.action.item?
  43.         @actor_last_action[@active_battler] = [3, @item, @target_enemy_window.enemy.index]
  44.       end
  45.     end
  46.     repeat_update_target_enemy_selection
  47.   end
  48.   def update_target_actor_selection
  49.     if Input.trigger?(Input::C)
  50.       if @active_battler.action.attack?
  51.         @actor_last_action[@active_battler] = [0, @target_actor_window.index]
  52.       elsif @active_battler.action.skill?
  53.         @actor_last_action[@active_battler] = [1, @skill, @target_actor_window.index]
  54.       elsif @active_battler.action.item?
  55.         @actor_last_action[@active_battler] = [3, @item, @target_actor_window.index]
  56.       end
  57.     end
  58.     repeat_update_target_actor_selection
  59.   end
  60.   def determine_item
  61.     @actor_last_action[@active_battler] = [1, @item]
  62.     repeat_determine_item
  63.   end
  64.   def determine_skill
  65.     @actor_last_action[@active_battler] = [1, @skill]
  66.     repeat_determine_skill
  67.   end
  68.   def determine_last_action
  69.     return if @actor_last_action[@active_battler].nil?
  70.     case @actor_last_action[@active_battler][0]
  71.     when 0
  72.       @active_battler.action.set_attack
  73.       @active_battler.action.target_index = @actor_last_action[@active_battler][1]
  74.     when 1
  75.       @skill = @actor_last_action[@active_battler][1]
  76.       @active_battler.action.set_skill(@skill.id)
  77.       if @skill.need_selection?
  78.         @active_battler.action.target_index = @actor_last_action[@active_battler][2]
  79.       else
  80.         determine_skill
  81.       end
  82.     when 2
  83.       @actor_last_action[@active_battler] = [2]
  84.       @active_battler.action.set_guard
  85.     when 3
  86.       @item = @actor_last_action[@active_battler][1]
  87.       @active_battler.action.set_item(@item.id)
  88.       if @item.need_selection?
  89.         @active_battler.action.target_index = @actor_last_action[@active_battler][2]
  90.       else
  91.         determine_item
  92.       end
  93.     else; return
  94.     end
  95.     @actor_command_window.active = true
  96.     next_actor
  97.   end
  98. end
复制代码


与SideView2.7相容补丁:

  1. =begin
  2.   将以下这段插在主角本的最後一个end前面
  3.   然後全局搜索 def select_member 在里面找到
  4.   
  5.      elsif Input.trigger?(Input::C)
  6.        Sound.play_decision
  7.        @active_battler.action.target_index = @index
  8.       
  9.    插入
  10.    set_selected_target(@index)
  11. =end
  12.   def set_selected_target(i)
  13.     if @active_battler.action.attack?
  14.       @actor_last_action[@active_battler] = [0, i]
  15.     elsif @active_battler.action.skill?
  16.       @actor_last_action[@active_battler] = [1, @skill, i]
  17.     elsif @active_battler.action.item?
  18.       @actor_last_action[@active_battler] = [3, @item, i]
  19.     end
  20.   end
复制代码


要用 "R" 键的话
需要全按键脚本
VA脚本开工中...
偷窃脚本1.0 - 已完成

Lv1.梦旅人

kissye的宠物<

梦石
0
星屑
61
在线时间
1563 小时
注册时间
2008-8-11
帖子
6174

贵宾

发表于 2008-10-27 14:59:11 | 显示全部楼层
嘛……是个实用的脚本……
回复 支持 反对

使用道具 举报

Lv1.梦旅人

梦石
0
星屑
60
在线时间
1 小时
注册时间
2008-10-21
帖子
32
发表于 2008-10-27 18:24:11 | 显示全部楼层
谢谢- -太强大了,我犹如浩瀚大海里面的一条小鱼- -终于让我找到了我的归宿,让我慢慢喝光大海吧
回复 支持 反对

使用道具 举报

Lv1.梦旅人

欠扁头像持有者

梦石
0
星屑
114
在线时间
16 小时
注册时间
2005-10-22
帖子
423
发表于 2008-10-30 09:16:58 | 显示全部楼层
发现了--NO用!按Z的话,只是进行普通攻击而已~
水兵土星--死亡之星!
回复 支持 反对

使用道具 举报

Lv3.寻梦者 (暗夜天使)

精灵族の天使

梦石
0
星屑
1697
在线时间
3038 小时
注册时间
2007-3-16
帖子
33731

开拓者贵宾

发表于 2008-10-30 18:33:20 | 显示全部楼层
与sideview脚本冲突么?如果不冲突的话我肯定会用这个(P.S.魔神战记里面就用了这个的XP版本)
回复 支持 反对

使用道具 举报

Lv2.观梦者

天仙

梦石
0
星屑
610
在线时间
184 小时
注册时间
2008-4-15
帖子
5023

贵宾

 楼主| 发表于 2008-10-30 19:10:18 | 显示全部楼层
以下引用宾少于2008-10-30 1:16:58的发言:
发现了--NO用!按Z的话,只是进行普通攻击而已~

是不是你按错了
我是指RM里面的A、B、C、X、Y、Z那些按键设定的「Z」键
而不是键盘上的那个Z键
键盘上的Z键默认是对应C(确定键)的
也就是说,你按的是确定键

以下引用精灵使者于2008-10-30 10:33:20的发言:
与sideview脚本冲突么?如果不冲突的话我肯定会用这个(P.S.魔神战记里面就用了这个的XP版本)

不知道,要试试看
脚本里面全部适用alias的
如果有冲突就尽量往下放


经测试,有冲突
原因来自横版战斗选择目标方式与默认战斗不同
正在制作能够使用的版本中...
VA脚本开工中...
偷窃脚本1.0 - 已完成
回复 支持 反对

使用道具 举报

Lv1.梦旅人

kissye的宠物<

梦石
0
星屑
61
在线时间
1563 小时
注册时间
2008-8-11
帖子
6174

贵宾

发表于 2008-10-30 19:22:22 | 显示全部楼层
嗯……
就这样慢慢地追赶上XP吧……
回复 支持 反对

使用道具 举报

Lv2.观梦者

天仙

梦石
0
星屑
610
在线时间
184 小时
注册时间
2008-4-15
帖子
5023

贵宾

 楼主| 发表于 2008-10-30 20:26:32 | 显示全部楼层
横版相容补丁已经完称
精灵测试吧
VA脚本开工中...
偷窃脚本1.0 - 已完成
回复 支持 反对

使用道具 举报

Lv3.寻梦者 (暗夜天使)

精灵族の天使

梦石
0
星屑
1697
在线时间
3038 小时
注册时间
2007-3-16
帖子
33731

开拓者贵宾

发表于 2008-10-30 23:05:00 | 显示全部楼层
恩恩,有机会测试
回复 支持 反对

使用道具 举报

头像被屏蔽

Lv1.梦旅人 (禁止发言)

梦石
0
星屑
50
在线时间
1 小时
注册时间
2008-9-7
帖子
114
发表于 2008-11-2 12:24:32 | 显示全部楼层
提示: 作者被禁止或删除 内容自动屏蔽
签名被屏蔽
回复 支持 反对

使用道具 举报

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

本版积分规则

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

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

GMT+8, 2024-3-29 08:38

Powered by Discuz! X3.1

© 2001-2013 Comsenz Inc.

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