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

Project1

 找回密码
 注册会员
搜索
12
返回列表 发新帖
楼主: youxi
打印 上一主题 下一主题

[已经过期] VX有没有自动攻击的脚本?

 关闭 [复制链接]

Lv1.梦旅人

风雪夜不归人

梦石
0
星屑
50
在线时间
276 小时
注册时间
2006-3-7
帖子
6721

贵宾

11
发表于 2009-9-27 09:40:59 | 只看该作者
具体位置找不到了,直接在此放出吧。
  1. #
  2. #    オートバトル(RGSS2)
  3. #  (C)2008 TYPE74RX-T
  4. #

  5. # ※:カスタマイズポイント…15行目

  6. #==============================================================================
  7. # ★ RX_T
  8. #------------------------------------------------------------------------------
  9. #  設定用
  10. #==============================================================================

  11. module RX_T
  12.   AutoBattleCommandName = "自动"  # オートバトル用パーティコマンド名
  13. end

  14. #==============================================================================
  15. # ■ Game_Actor
  16. #------------------------------------------------------------------------------
  17. #  アクターを扱うクラスです。このクラスは Game_Actors クラス ($game_actors)
  18. # の内部で使用され、Game_Party クラス ($game_party) からも参照されます。
  19. #==============================================================================

  20. class Game_Actor < Game_Battler
  21.   #--------------------------------------------------------------------------
  22.   # ● セットアップ
  23.   #     actor_id : アクター ID
  24.   #--------------------------------------------------------------------------
  25.   alias rgss2b3_setup setup
  26.   def setup(actor_id)
  27.     # メソッドを呼び戻す
  28.     rgss2b3_setup(actor_id)
  29.     # オートバトルフラグ(コピー用)
  30.     @rx_auto_battle = false
  31.   end
  32.   #--------------------------------------------------------------------------
  33.   # ★ オートバトルフラグ(コピー用)
  34.   #--------------------------------------------------------------------------
  35.   def rx_auto_battle
  36.     return @rx_auto_battle
  37.   end
  38.   #--------------------------------------------------------------------------
  39.   # ★ アクターのオートバトルフラグをコピー
  40.   #--------------------------------------------------------------------------
  41.   def rx_auto_battle_copy
  42.     @rx_auto_battle = actor.auto_battle
  43.   end
  44.   #--------------------------------------------------------------------------
  45.   # ★ アクターのオートバトルフラグをオン
  46.   #--------------------------------------------------------------------------
  47.   def rx_auto_battle_on
  48.     actor.auto_battle = true
  49.   end
  50.   #--------------------------------------------------------------------------
  51.   # ★ アクターのオートバトルフラグを修復
  52.   #--------------------------------------------------------------------------
  53.   def rx_auto_battle_recover
  54.     actor.auto_battle = @rx_auto_battle
  55.   end
  56. end

  57. #==============================================================================
  58. # ■ Window_PartyCommand
  59. #------------------------------------------------------------------------------
  60. #  バトル画面で、戦うか逃げるかを選択するウィンドウです。
  61. #==============================================================================

  62. class Window_PartyCommand < Window_Command
  63.   #--------------------------------------------------------------------------
  64.   # ● オブジェクト初期化
  65.   #--------------------------------------------------------------------------
  66.   def initialize
  67.     s1 = Vocab::fight
  68.     s2 = Vocab::escape
  69.     s3 = RX_T::AutoBattleCommandName
  70.     super(128, [s1, s2, s3], 1, 4)
  71.     draw_item(0, true)
  72.     draw_item(1, $game_troop.can_escape)
  73.     self.active = false
  74.   end
  75. end

  76. #==============================================================================
  77. # ■ Scene_Battle
  78. #------------------------------------------------------------------------------
  79. #  バトル画面の処理を行うクラスです。
  80. #==============================================================================

  81. class Scene_Battle < Scene_Base
  82.   #--------------------------------------------------------------------------
  83.   # ● 戦闘終了
  84.   #     result : 結果 (0:勝利 1:逃走 2:敗北)
  85.   #--------------------------------------------------------------------------
  86.   alias rgss2b3_battle_end battle_end
  87.   def battle_end(result)
  88.     # ★ パーティ全員の自動戦闘フラグを復元
  89.     for actor in $game_party.members
  90.       actor.rx_auto_battle_recover
  91.     end
  92.     # ★ メソッドを呼び戻す
  93.     rgss2b3_battle_end(result)
  94.   end
  95.   #--------------------------------------------------------------------------
  96.   # ● パーティコマンド選択の更新
  97.   #--------------------------------------------------------------------------
  98.   def update_party_command_selection
  99.     if Input.trigger?(Input::C)
  100.       case @party_command_window.index
  101.       when 0  # 戦う
  102.         # ★ 自動戦闘フラグを待避
  103.         for actor in $game_party.members
  104.           actor.rx_auto_battle_copy
  105.         end
  106.         Sound.play_decision
  107.         @status_window.index = @actor_index = -1
  108.         next_actor
  109.       when 1  # 逃げる
  110.         # ★ 自動戦闘フラグを待避
  111.         for actor in $game_party.members
  112.           actor.rx_auto_battle_copy
  113.         end
  114.         if $game_troop.can_escape == false
  115.           Sound.play_buzzer
  116.           return
  117.         end
  118.         Sound.play_decision
  119.         process_escape
  120.       when 2  # 逃げる
  121.         Sound.play_decision
  122.         @status_window.index = @actor_index = -1
  123.         # ★ 自動戦闘フラグを待避した後、パーティ全員の自動戦闘フラグをON
  124.         for actor in $game_party.members
  125.           actor.rx_auto_battle_copy
  126.           actor.rx_auto_battle_on
  127.         end
  128.         next_actor
  129.       end
  130.     end
  131.   end
  132.   #--------------------------------------------------------------------------
  133.   # ● ターン終了
  134.   #--------------------------------------------------------------------------
  135.   alias rgss2b3_turn_end turn_end
  136.   def turn_end
  137.     # ★ パーティ全員の自動戦闘フラグを復元
  138.     for actor in $game_party.members
  139.       actor.rx_auto_battle_recover
  140.     end
  141.     # メソッドを呼び戻す
  142.     rgss2b3_turn_end
  143.   end
  144. end
复制代码
有些人,到了七八月份就会诈尸。
宫斗,是女生永远的爱。
冷门,是本人不变的欲。
作弊,是玩家自由的痛。
练级,是橙光割舍的情。
回复 支持 反对

使用道具 举报

头像被屏蔽

Lv1.梦旅人 (禁止发言)

梦石
0
星屑
50
在线时间
0 小时
注册时间
2009-9-22
帖子
62
12
发表于 2009-9-27 11:09:23 | 只看该作者
提示: 作者被禁止或删除 内容自动屏蔽
回复 支持 反对

使用道具 举报

Lv3.寻梦者

梦石
0
星屑
4049
在线时间
1078 小时
注册时间
2008-5-17
帖子
218

开拓者

13
发表于 2009-9-27 11:21:27 | 只看该作者
:Q 楼上说对了 是只能战斗一次。。。。啊啊啊啊
回复 支持 反对

使用道具 举报

Lv2.观梦者

梦石
0
星屑
624
在线时间
281 小时
注册时间
2006-4-9
帖子
203
14
发表于 2009-9-27 14:29:08 | 只看该作者
class Game_Actor
   
  alias :eds_pre_auto_initialize :initialize
  def initialize(id)
    eds_pre_auto_initialize(id)
    @default_autobattle = actor.auto_battle  
  end
  
  def default_autobattle?
    return @default_autobattle
  end
  
  def auto_battle=(value)
    actor.auto_battle = value
  end   
  
end

class Window_PartyCommand < Window_Command
  
  def initialize
    s1 = Vocab::fight
    s2 = Vocab::escape
    s3 = "Auto"
    super(128, [s1, s2, s3], 1, 4)
    draw_item(0, true)
    draw_item(1, $game_troop.can_escape)
    draw_item(2, true)
    self.active = false
  end
  
end


class Scene_Battle
  
  alias :eds_pre_auto_update_party_command_selection :update_party_command_selection
  def update_party_command_selection
    if Input.trigger?(Input::C)
      if @party_command_window.index == 2
        $game_party.members.each { |actor| actor.auto_battle = true }
        next_actor
      end
    end
    eds_pre_auto_update_party_command_selection
  end
  
  alias :eds_pre_auto_start_party_command_selection :start_party_command_selection
  def start_party_command_selection
    for actor in $game_party.members
      actor.auto_battle = false unless actor.default_autobattle?
    end
    eds_pre_auto_start_party_command_selection
  end
      
end



#转自其它网站
#在战斗画面命令选择菜单中加入了Auto, 但只进行一个回合的自动战斗,如果你使用比较复杂的战斗脚本例如SBS,那么需要修改脚本

Tks.
Edward.C
回复 支持 反对

使用道具 举报

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

本版积分规则

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

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

GMT+8, 2024-5-26 20:15

Powered by Discuz! X3.1

© 2001-2013 Comsenz Inc.

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