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

Project1

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

能不能添加自动战斗。

 关闭 [复制链接]

Lv1.梦旅人

梦石
0
星屑
55
在线时间
1 小时
注册时间
2007-12-24
帖子
182
跳转到指定楼层
1
发表于 2007-12-29 20:37:09 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式

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

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

x
如题。
版务信息:本贴由楼主自主结贴~

Lv1.梦旅人

梦石
0
星屑
55
在线时间
1 小时
注册时间
2007-12-24
帖子
182
2
 楼主| 发表于 2007-12-29 20:37:09 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式

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

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

x
如题。
版务信息:本贴由楼主自主结贴~

Lv1.梦旅人

沈黙栤冷

梦石
0
星屑
55
在线时间
5 小时
注册时间
2007-12-15
帖子
3048
3
发表于 2007-12-29 21:02:29 | 只看该作者
有一个是按键重复上回合操作的……
  1. #==============================================================================
  2. # 本脚本来自www.66rpg.com,转载和使用请保留此信息
  3. #重复上回合动作  v1.1
  4. #by 叶子       Date: 12-12-2005
  5. #QQ:121058265
  6. #本脚本根据66rpg的站长柳柳提出的思路制作
  7. #如发现有bug请与作者联系或上66rpg发贴说明
  8. #==============================================================================
  9. #当战斗时按下T键,
  10. #当前角色就会重复上回合的动作(包括攻击,特技,防御,物品)。
  11. #当战斗时按下R键,
  12. #所有角色就会重复上回合的动作。
  13. #当战斗时按下F键,
  14. #所有角色就会普通攻击同一个敌人。
  15. #脚本占用了第一号开关。
  16. #当第一号开关打开时,重复上回合动作功能关闭。
  17. #如果想用其他开关,改第130,263,323行中相应内容。
  18. #--------------------------------------------------------------------------
  19. class Game_Battler
  20. #--------------------------------------------------------------------------
  21. # ● 初始化对像
  22. #--------------------------------------------------------------------------
  23. def initialize
  24.    @battler_name = ""
  25.    @battler_hue = 0
  26.    @hp = 0
  27.    @sp = 0
  28.    @states = []
  29.    @states_turn = {}
  30.    @maxhp_plus = 0
  31.    @maxsp_plus = 0
  32.    @str_plus = 0
  33.    @dex_plus = 0
  34.    @agi_plus = 0
  35.    @int_plus = 0
  36.    @hidden = false
  37.    @immortal = false
  38.    @damage_pop = false
  39.    @damage = nil
  40.    @critical = false
  41.    @animation_id = 0
  42.    @animation_hit = false
  43.    @white_flash = false
  44.    @blink = false
  45.    @current_action = Game_BattleAction.new
  46.    @last_action = Game_BattleAction.new
  47. end
  48. #--------------------------------------------------------------------------
  49. # ● 获取前一回合的动作
  50. #--------------------------------------------------------------------------
  51. def last_action
  52.    return @last_action
  53. end
  54. end




  55. class Game_Party
  56. def last_actions
  57.    for actor in @actors
  58.      actor.last_action.kind = actor.current_action.kind
  59.      actor.last_action.basic = actor.current_action.basic
  60.      actor.last_action.forcing = actor.current_action.forcing
  61.      actor.last_action.target_index = actor.current_action.target_index
  62.      actor.last_action.skill_id = actor.current_action.skill_id
  63.      actor.last_action.item_id = actor.current_action.item_id
  64.    end
  65. end
  66. end


  67. class Scene_Battle
  68. #--------------------------------------------------------------------------
  69. # ● 开始同伴命令回合
  70. #--------------------------------------------------------------------------
  71. def start_phase2
  72.    # 转移到回合 2
  73.    @phase = 2
  74.    # 设置角色为非选择状态
  75.    @actor_index = -1
  76.    @active_battler = nil
  77.    # 有效化同伴指令窗口
  78.    @party_command_window.active = true
  79.    @party_command_window.visible = true
  80.    # 无效化角色指令窗口
  81.    @actor_command_window.active = false
  82.    @actor_command_window.visible = false
  83.    # 清除主回合标志
  84.    $game_temp.battle_main_phase = false
  85.    # 记录行动
  86.    $game_party.last_actions
  87.    # 清除全体同伴的行动
  88.    $game_party.clear_actions
  89.    # 不能输入命令的情况下
  90.    unless $game_party.inputable?
  91.      # 开始主回合
  92.      start_phase4
  93.    end
  94. end
  95. #--------------------------------------------------------------------------
  96. # ● 刷新画面 (同伴命令回合)
  97. #--------------------------------------------------------------------------
  98. def update_phase2
  99.    # 按下 C 键的情况下
  100.    if Input.trigger?(Input::C)
  101.      # 同伴指令窗口光标位置分支
  102.      case @party_command_window.index
  103.      when 0  # 战斗
  104.        # 演奏确定 SE
  105.        $game_system.se_play($data_system.decision_se)
  106.        # 开始角色的命令回合
  107.        start_phase3
  108.      when 1  # 逃跑
  109.        # 不能逃跑的情况下
  110.        if $game_temp.battle_can_escape == false
  111.          # 演奏冻结 SE
  112.          $game_system.se_play($data_system.buzzer_se)
  113.          return
  114.        end
  115.        # 演奏确定 SE
  116.        $game_system.se_play($data_system.decision_se)
  117.        # 逃走处理
  118.        update_phase2_escape
  119.      end
  120.      return
  121.    end
  122.    #------------------------------
  123.    # 按下 R 键的情况下
  124.    #------------------------------
  125.    if Kboard.keyboard($R_Key_R)
  126.      #如果一号开关打开就禁止重复上回合动作
  127.      if $game_switches[1] == true #开关号可以改,把那个1改成你要的开关号
  128.        # 演奏冻结 SE
  129.        $game_system.se_play($data_system.buzzer_se)
  130.        return
  131.      end
  132.      for a in $game_party.actors
  133.        if a.inputable?
  134.          case a.last_action.kind
  135.          when 0  # 攻击,防御
  136.            #防御
  137.            if a.last_action.basic == 1
  138.              # 设置行动
  139.              a.current_action.kind = 0
  140.              a.current_action.basic = 1
  141.              #攻击
  142.              else
  143.              # 设置行动
  144.              a.current_action.kind = 0
  145.              a.current_action.basic = 0
  146.              a.current_action.target_index = a.last_action.target_index
  147.            end
  148.          when 1  # 特技
  149.          skill_id = a.last_action.skill_id
  150.          if a.skill_learn?(skill_id) and            a.skill_can_use?(skill_id)
  151.            # 设置行动
  152.            a.current_action.kind = 1
  153.            a.current_action.skill_id = a.last_action.skill_id
  154.            a.current_action.target_index = a.last_action.target_index
  155.          else
  156.            # 不能使用就攻击
  157.            if $data_skills[skill_id].scope < 3
  158.              a.current_action.kind = 0
  159.              a.current_action.basic = 0
  160.              a.current_action.target_index = a.last_action.target_index
  161.            else
  162.              a.current_action.kind = 0
  163.              a.current_action.basic = 0
  164.              a.current_action.target_index = 0
  165.            end
  166.          end
  167.          when 2  # 物品
  168.            item_id = a.last_action.item_id
  169.            if $game_party.item_can_use?(item_id)
  170.              # 设置行动
  171.              a.current_action.kind = 2
  172.              a.current_action.item_id = a.last_action.item_id
  173.              a.current_action.target_index = a.last_action.target_index
  174.            else
  175.              # 不能使用就攻击
  176.              a.current_action.kind = 0
  177.              a.current_action.basic = 0
  178.              a.current_action.target_index = 0
  179.            end
  180.          end
  181.        end
  182.      end
  183.      # 演奏确定 SE
  184.      $game_system.se_play($data_system.decision_se)
  185.      start_phase4
  186.      return
  187.    end
  188.    #------------------------------
  189.    # 按下 F 键的情况下
  190.    #------------------------------
  191.    if Kboard.keyboard($R_Key_T)
  192.      for a in $game_party.actors
  193.        if a.inputable?
  194.          a.current_action.kind = 0
  195.          a.current_action.basic = 0
  196.          a.current_action.target_index = 0
  197.        end
  198.      end
  199.      # 演奏确定 SE
  200.      $game_system.se_play($data_system.decision_se)
  201.      start_phase4
  202.      return
  203.    end
  204. end
  205. #--------------------------------------------------------------------------
  206. # ● 刷新画面 (角色命令回合 : 基本命令)
  207. #--------------------------------------------------------------------------
  208. def update_phase3_basic_command
  209.    # 按下 B 键的情况下
  210.    if Input.trigger?(Input::B)
  211.      # 演奏取消 SE
  212.      $game_system.se_play($data_system.cancel_se)
  213.      # 转向前一个角色的指令输入
  214.      phase3_prior_actor
  215.      return
  216.    end
  217.    # 按下 C 键的情况下
  218.    if Input.trigger?(Input::C)
  219.      # 角色指令窗口光标位置分之
  220.      case @actor_command_window.index
  221.      when 0  # 攻击
  222.        # 演奏确定 SE
  223.        $game_system.se_play($data_system.decision_se)
  224.        # 设置行动
  225.        @active_battler.current_action.kind = 0
  226.        @active_battler.current_action.basic = 0
  227.        # 开始选择敌人
  228.        start_enemy_select
  229.      when 1  # 特技
  230.        # 演奏确定 SE
  231.        $game_system.se_play($data_system.decision_se)
  232.        # 设置行动
  233.        @active_battler.current_action.kind = 1
  234.        # 开始选择特技
  235.        start_skill_select
  236.      when 2  # 防御
  237.        # 演奏确定 SE
  238.        $game_system.se_play($data_system.decision_se)
  239.        # 设置行动
  240.        @active_battler.current_action.kind = 0
  241.        @active_battler.current_action.basic = 1
  242.        # 转向下一位角色的指令输入
  243.        phase3_next_actor
  244.      when 3  # 物品
  245.        # 演奏确定 SE
  246.        $game_system.se_play($data_system.decision_se)
  247.        # 设置行动
  248.        @active_battler.current_action.kind = 2
  249.        # 开始选择物品
  250.        start_item_select
  251.      end
  252.      return
  253.    end
  254.    #------------------------------
  255.    # 按下 T 建的情况下
  256.    #------------------------------
  257.    if Kboard.keyboard($R_Key_T)
  258.      #如果一号开关打开就禁止重复上回合动作
  259.      if $game_switches[1] == true #开关号可以改,把那个1改成你要的开关号
  260.        # 演奏冻结 SE
  261.        $game_system.se_play($data_system.buzzer_se)
  262.        return
  263.      end
  264.      case @active_battler.last_action.kind
  265.      when 0  # 攻击,防御
  266.        #防御
  267.        if @active_battler.last_action.basic == 1
  268.          # 设置行动
  269.          @active_battler.current_action.kind = 0
  270.          @active_battler.current_action.basic = 1
  271.          # 演奏确定 SE
  272.          $game_system.se_play($data_system.decision_se)
  273.          phase3_next_actor
  274.          #攻击
  275.          else
  276.          # 演奏确定 SE
  277.          $game_system.se_play($data_system.decision_se)
  278.          # 设置行动
  279.          @active_battler.current_action.kind = 0
  280.          @active_battler.current_action.basic = 0
  281.          @active_battler.current_action.target_index = @active_battler.last_action.target_index
  282.          phase3_next_actor
  283.        end
  284.      when 1  # 特技
  285.        skill_id = @active_battler.last_action.skill_id
  286.        if @active_battler.skill_learn?(skill_id) and          @active_battler.skill_can_use?(skill_id)
  287.          # 设置行动
  288.          @active_battler.current_action.kind = 1
  289.          @active_battler.current_action.skill_id = @active_battler.last_action.skill_id
  290.          @active_battler.current_action.target_index = @active_battler.last_action.target_index
  291.          phase3_next_actor
  292.        else
  293.          # 演奏冻结 SE
  294.          $game_system.se_play($data_system.buzzer_se)
  295.        end
  296.      when 2  # 物品
  297.        item_id = @active_battler.last_action.item_id
  298.        if $game_party.item_can_use?(item_id)
  299.          # 设置行动
  300.          @active_battler.current_action.kind = 2
  301.          @active_battler.current_action.item_id = @active_battler.last_action.item_id
  302.          @active_battler.current_action.target_index = @active_battler.last_action.target_index
  303.          # 演奏确定 SE
  304.          $game_system.se_play($data_system.decision_se)
  305.          phase3_next_actor
  306.        else
  307.          # 演奏冻结 SE
  308.          $game_system.se_play($data_system.buzzer_se)
  309.        end
  310.      end
  311.      return
  312.    end
  313.    #------------------------------
  314.    # 按下 R 键的情况下
  315.    #------------------------------
  316.    if Kboard.keyboard($R_Key_R)
  317.      #如果一号开关打开就禁止重复上回合动作
  318.      if $game_switches[1] == true #开关号可以改,把那个1改成你要的开关号
  319.        # 演奏冻结 SE
  320.        $game_system.se_play($data_system.buzzer_se)
  321.        return
  322.      end
  323.      for a in $game_party.actors
  324.        if a.inputable?
  325.          case a.last_action.kind
  326.          when 0  # 攻击,防御
  327.            #防御
  328.            if a.last_action.basic == 1
  329.              # 设置行动
  330.              a.current_action.kind = 0
  331.              a.current_action.basic = 1
  332.              #攻击
  333.              else
  334.              # 设置行动
  335.              a.current_action.kind = 0
  336.              a.current_action.basic = 0
  337.              a.current_action.target_index = a.last_action.target_index
  338.            end
  339.          when 1  # 特技
  340.          skill_id = a.last_action.skill_id
  341.          if a.skill_learn?(skill_id) and            a.skill_can_use?(skill_id)
  342.            # 设置行动
  343.            a.current_action.kind = 1
  344.            a.current_action.skill_id = a.last_action.skill_id
  345.            a.current_action.target_index = a.last_action.target_index
  346.          elsif
  347.            # 不能使用就攻击
  348.            if $data_skills[skill_id].scope < 3
  349.              a.current_action.kind = 0
  350.              a.current_action.basic = 0
  351.              a.current_action.target_index = a.last_action.target_index
  352.            else
  353.              a.current_action.kind = 0
  354.              a.current_action.basic = 0
  355.              a.current_action.target_index = 0
  356.            end
  357.          end
  358.          when 2  # 物品
  359.            item_id = a.last_action.item_id
  360.            if $game_party.item_can_use?(item_id)
  361.              # 设置行动
  362.              a.current_action.kind = 2
  363.              a.current_action.item_id = a.last_action.item_id
  364.              a.current_action.target_index = a.last_action.target_index
  365.            else
  366.              # 不能使用就攻击
  367.              a.current_action.kind = 0
  368.              a.current_action.basic = 0
  369.              a.current_action.target_index = 0
  370.            end
  371.          end
  372.        end
  373.        # 角色的明灭效果 OFF
  374.        if a != nil
  375.          a.blink = false
  376.        end
  377.      end
  378.      # 演奏确定 SE
  379.      $game_system.se_play($data_system.decision_se)
  380.      start_phase4
  381.      return
  382.    end
  383.    #------------------------------
  384.    # 按下 F 键的情况下
  385.    #------------------------------
  386.    if Kboard.keyboard($R_Key_F)
  387.      for a in $game_party.actors
  388.        if a.inputable?
  389.          a.current_action.kind = 0
  390.          a.current_action.basic = 0
  391.          a.current_action.target_index = 0
  392.        end
  393.        # 角色的明灭效果 OFF
  394.        if a != nil
  395.          a.blink = false
  396.        end
  397.      end
  398.      # 演奏确定 SE
  399.      $game_system.se_play($data_system.decision_se)
  400.      start_phase4
  401.      return
  402.    end
  403. end
  404. end
  405. #==============================================================================
  406. # 本脚本来自www.66rpg.com,转载和使用请保留此信息
  407. #==============================================================================
复制代码
重来,一切将回更美好?我想不一定,因为苍天给予你的是最美好的结束……阿弥陀佛……(我了个去,关“阿弥陀佛”什么事?)
对于破解游戏,我无话可说,对于破解后宣传,我强烈鄙视,没错,我刚破解了某个正版游戏,想要吗?请自宫后,拿那个东西过来换吧。
……请用行动来支持国产游戏……
PS:谁有仙五破解版啊……(喂!PIA!)
什么情况,汽车漏胎?
回复 支持 反对

使用道具 举报

Lv1.梦旅人

梦石
0
星屑
55
在线时间
1 小时
注册时间
2007-12-24
帖子
182
4
 楼主| 发表于 2007-12-29 22:44:36 | 只看该作者
我们遇到怪的时候会出现 战斗 和逃跑

我现在需要的是  在战斗和逃跑之间 出现一个 自动战斗 标识
一旦选择自动战斗,那就会将自动战斗到底。

因该有这个的脚本吧。
回复 支持 反对

使用道具 举报

Lv1.梦旅人

梦石
0
星屑
50
在线时间
2 小时
注册时间
2007-12-16
帖子
134
5
发表于 2007-12-30 00:51:12 | 只看该作者
用论坛搜索搜“自动战斗”即可
http://rpg.blue/viewthread.php?t ... 2%2D29+16%3A34%3A53
系统信息:本贴由楼主认可为正确答案,66RPG感谢您的热情解答~
回复 支持 反对

使用道具 举报

头像被屏蔽

Lv1.梦旅人 (禁止发言)

梦石
0
星屑
50
在线时间
0 小时
注册时间
2007-12-30
帖子
52
6
发表于 2007-12-30 01:04:11 | 只看该作者
提示: 作者被禁止或删除 内容自动屏蔽
回复 支持 反对

使用道具 举报

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

本版积分规则

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

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

GMT+8, 2026-6-19 12:29

Powered by Discuz! X3.1

© 2001-2013 Comsenz Inc.

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