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

Project1

 找回密码
 注册会员
搜索
查看: 3554|回复: 4

[转载] 【VA】自动战斗

[复制链接]

Lv1.梦旅人

梦石
0
星屑
88
在线时间
308 小时
注册时间
2010-8-10
帖子
794
发表于 2014-1-24 21:37:36 | 显示全部楼层 |阅读模式

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

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

x
本帖最后由 不是马甲 于 2014-1-24 21:57 编辑

来自http://hikimoki.sakura.ne.jp/rgss3/script_battle/tmatbtl.rb


战斗选择指令已经汉化(来自百度翻译


直接插入即可


RUBY 代码复制
  1. #==============================================================================
  2. # ★ RGSS3_自動戦闘 Ver1.01
  3. #==============================================================================
  4. =begin
  5.  
  6. 作者:tomoaky
  7. webサイト:ひきも記 ([url]http://hikimoki.sakura.ne.jp/[/url])
  8.  
  9. 增加命令“自动”和“重复”,两种指令追加。
  10. 自动全体演员这回合只自动战斗的状态,
  11. 重复的全体演员前面的回合采取的行动自动选择。
  12. 附加功能全自动战斗开关(初期设定在7号)开了间
  13. 遇敌从地图场面回到为止都是自动化。
  14. ===注意点===
  15. ・前的回合一样行动成本不足等不能实行的场合攻击
  16. 、1回合中重复选择的情况全演员的行动,攻击
  17. ・前回合开始时被选择的行动重复的对象,
  18. 成本不足重复的内容发生变化时,下一次的回合以后也变化了
  19. 使用游戏(初期设定)开关
  20. 0007,0008
  21. 2012.01.17版本1.01
  22. ・逃跑指令失败后重复的命令不正确动作极化
  23. 2011.12.15版本1.0
  24. 公开
  25.  
  26. =end
  27.  
  28. #==============================================================================
  29. # □ 設定項目
  30. #==============================================================================
  31. module TMATBTL
  32.   SW_FULLAUTO = 7     # 完全自動戦闘フラグとして扱うゲームスイッチ番号
  33.   SW_FULLFAST = 8     # 完全自動戦闘の早送りフラグとして扱うゲームスイッチ番号
  34. end
  35.  
  36. #==============================================================================
  37. # ■ Vocab
  38. #==============================================================================
  39. module Vocab
  40.   AutoBattle    = "自动"         # 自動戦闘コマンド名
  41.   RepeatBattle  = "重复"       # 繰り返し戦闘コマンド名
  42. end
  43.  
  44. #==============================================================================
  45. # ■ Game_Temp
  46. #==============================================================================
  47. class Game_Temp
  48.   #--------------------------------------------------------------------------
  49.   # ● 公開インスタンス変数
  50.   #--------------------------------------------------------------------------
  51.   attr_accessor :repeat_commands          # 前ターンの行動内容
  52.   #--------------------------------------------------------------------------
  53.   # ● オブジェクト初期化
  54.   #--------------------------------------------------------------------------
  55.   alias tmatbtl_game_temp_initialize initialize
  56.   def initialize
  57.     tmatbtl_game_temp_initialize
  58.     @repeat_commands = []
  59.   end
  60. end
  61.  
  62. #==============================================================================
  63. # ■ Window_Message
  64. #==============================================================================
  65. class Window_Message
  66.   #--------------------------------------------------------------------------
  67.   # ● 入力待ち処理
  68.   #--------------------------------------------------------------------------
  69.   alias tmatbtl_window_message_input_pause input_pause
  70.   def input_pause
  71.     if $game_party.in_battle && $game_switches[TMATBTL::SW_FULLAUTO]
  72.       wait($game_switches[TMATBTL::SW_FULLFAST] ? 30 : 60)
  73.     else
  74.       tmatbtl_window_message_input_pause
  75.     end
  76.   end
  77. end
  78.  
  79. #==============================================================================
  80. # ■ Window_PartyCommand
  81. #==============================================================================
  82. class Window_PartyCommand
  83.   #--------------------------------------------------------------------------
  84.   # ● コマンドリストの作成
  85.   #--------------------------------------------------------------------------
  86.   alias tmatbtl_window_partycommand_make_command_list make_command_list
  87.   def make_command_list
  88.     tmatbtl_window_partycommand_make_command_list
  89.     add_command(Vocab::AutoBattle,   :auto)
  90.     add_command(Vocab::RepeatBattle, :repeat)
  91.   end
  92. end
  93.  
  94. #==============================================================================
  95. # ■ Scene_Battle
  96. #==============================================================================
  97. class Scene_Battle
  98.   #--------------------------------------------------------------------------
  99.   # ● 早送り判定
  100.   #--------------------------------------------------------------------------
  101.   alias tmatbtl_scene_battle_show_fast? show_fast?
  102.   def show_fast?
  103.     tmatbtl_scene_battle_show_fast? || ($game_switches[TMATBTL::SW_FULLAUTO] &&
  104.       $game_switches[TMATBTL::SW_FULLFAST])
  105.   end
  106.   #--------------------------------------------------------------------------
  107.   # ● パーティコマンドウィンドウの作成
  108.   #--------------------------------------------------------------------------
  109.   alias tmatbtl_scene_battle_create_party_command_window create_party_command_window
  110.   def create_party_command_window
  111.     tmatbtl_scene_battle_create_party_command_window
  112.     @party_command_window.set_handler(:auto,   method(:command_auto))
  113.     @party_command_window.set_handler(:repeat, method(:command_repeat))
  114.   end
  115.   #--------------------------------------------------------------------------
  116.   # ● パーティコマンド選択の開始
  117.   #--------------------------------------------------------------------------
  118.   alias tmatbtl_scene_battle_start_party_command_selection start_party_command_selection
  119.   def start_party_command_selection
  120.     tmatbtl_scene_battle_start_party_command_selection
  121.     if $game_switches[TMATBTL::SW_FULLAUTO]
  122.       command_auto unless scene_changing?
  123.     end
  124.   end
  125.   #--------------------------------------------------------------------------
  126.   # ● 戦闘開始
  127.   #--------------------------------------------------------------------------
  128.   alias tmatbtl_scene_battle_battle_start battle_start
  129.   def battle_start
  130.     tmatbtl_scene_battle_battle_start
  131.     $game_temp.repeat_commands = []
  132.   end
  133.   #--------------------------------------------------------------------------
  134.   # ● ターン開始
  135.   #--------------------------------------------------------------------------
  136.   alias tmatbtl_scene_battle_turn_start turn_start
  137.   def turn_start
  138.     $game_party.members.each_with_index do |actor, i|
  139.       next unless actor.inputable?
  140.       $game_temp.repeat_commands[i] = []
  141.       actor.actions.each do |action|
  142.         $game_temp.repeat_commands[i].push(action.clone)
  143.       end
  144.     end
  145.     tmatbtl_scene_battle_turn_start
  146.   end
  147.   #--------------------------------------------------------------------------
  148.   # ○ コマンド[オート]
  149.   #--------------------------------------------------------------------------
  150.   def command_auto
  151.     $game_party.members.each do |actor|
  152.       actor.make_auto_battle_actions if actor.inputable?
  153.     end
  154.     @party_command_window.deactivate
  155.     turn_start
  156.   end
  157.   #--------------------------------------------------------------------------
  158.   # ○ コマンド[リピート]
  159.   #--------------------------------------------------------------------------
  160.   def command_repeat
  161.     $game_party.members.each_with_index do |actor, i|
  162.       next unless actor.inputable?
  163.       actor.actions.clear
  164.       if !$game_temp.repeat_commands[i] || $game_temp.repeat_commands[i].empty?
  165.         $game_temp.repeat_commands[i] =
  166.           [Game_Action.new(actor).set_attack.evaluate]
  167.       end
  168.       $game_temp.repeat_commands[i].each do |action|
  169.         actor.actions.push(action.clone)
  170.         actor.actions[actor.actions.size - 1].set_attack unless action.valid?
  171.       end
  172.     end
  173.     @party_command_window.deactivate
  174.     turn_start
  175.   end
  176. end

评分

参与人数 1星屑 +15 收起 理由
T君的暴走 + 15 塞糖

查看全部评分

Lv1.梦旅人

梦石
0
星屑
50
在线时间
66 小时
注册时间
2009-7-16
帖子
164
发表于 2015-4-29 17:43:36 | 显示全部楼层
没人顶么?我觉得这个很实用。
敌人多的时候战斗过程很冗长无趣
回复 支持 反对

使用道具 举报

Lv1.梦旅人

梦石
0
星屑
97
在线时间
308 小时
注册时间
2014-1-16
帖子
467
发表于 2015-4-29 18:21:47 | 显示全部楼层
这个以前好像见到过,不过确实是好东西
回复 支持 反对

使用道具 举报

Lv1.梦旅人

梦石
0
星屑
50
在线时间
229 小时
注册时间
2012-1-21
帖子
24
发表于 2015-5-12 17:48:34 | 显示全部楼层
好顶赞~以前掌机游戏曾经遇到这个系统 非常方便
回复 支持 反对

使用道具 举报

Lv2.观梦者

梦石
0
星屑
265
在线时间
64 小时
注册时间
2012-1-22
帖子
64
发表于 2015-6-30 17:28:27 | 显示全部楼层
但是重复上次指令那个选项没出来啊- -

点评

有点啊,我以前试过,可以用的  发表于 2015-7-8 21:16
回复 支持 反对

使用道具 举报

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

本版积分规则

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

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

GMT+8, 2024-3-28 21:23

Powered by Discuz! X3.1

© 2001-2013 Comsenz Inc.

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