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

Project1

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

[已经解决] 求助,想要某件装备,装备之后普通攻击为全体攻击怎么...

[复制链接]

Lv1.梦旅人

梦石
0
星屑
65
在线时间
16 小时
注册时间
2016-8-14
帖子
5
跳转到指定楼层
1
发表于 2016-8-18 00:09:43 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式

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

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

x
求助,想要某件装备,装备之后普通攻击为全体攻击怎么设置?
完全搞不懂。下载了个全体攻击范本脚本也看不懂,那个范本里面没有注释,
不知道作者是怎样达到全体化的效果的,所以请教各位大神,到底要怎么做,
才能达到如题的效果?

Lv1.梦旅人

梦石
0
星屑
125
在线时间
171 小时
注册时间
2014-4-14
帖子
151
2
发表于 2016-8-18 07:42:53 | 只看该作者
#说明:添加一个属性叫 全体化 ,然后想要全体化的武器就把该属性打上勾。
RUBY 代码复制
  1. #==============================================================================
  2. # ■ Scene_Battle (分割定义 3)
  3. #------------------------------------------------------------------------------
  4. #  处理战斗画面的类。
  5. #==============================================================================
  6.  
  7. class Scene_Battle
  8.   #--------------------------------------------------------------------------
  9.   # ● 开始角色命令回合
  10.   #--------------------------------------------------------------------------
  11.   def start_phase3
  12.     # 转移到回合 3
  13.     @phase = 3
  14.     # 设置觉得为非选择状态
  15.     @actor_index = -1
  16.     @active_battler = nil
  17.     # 输入下一个角色的命令
  18.     phase3_next_actor
  19.   end
  20.   ########################################################
  21.   def scope_id
  22.    scope = 0
  23.    for i in 1..$data_system.elements.size
  24.      if $data_system.elements[i] =~ /全体化/
  25.        scope = i
  26.        break
  27.      end
  28.    end
  29.    return scope
  30. end
  31. ##############################################################
  32.   #--------------------------------------------------------------------------
  33.   # ● 转到输入下一个角色的命令
  34.   #--------------------------------------------------------------------------
  35.   def phase3_next_actor
  36.     # 循环
  37.     begin
  38.       # 角色的明灭效果 OFF
  39.       if @active_battler != nil
  40.         @active_battler.blink = false
  41.       end
  42.       # 最后的角色的情况
  43.       if @actor_index == $game_party.actors.size-1
  44.         # 开始主回合
  45.         start_phase4
  46.         return
  47.       end
  48.       # 推进角色索引
  49.       @actor_index += 1
  50.       @active_battler = $game_party.actors[@actor_index]
  51.       @active_battler.blink = true
  52.     # 如果角色是在无法接受指令的状态就再试
  53.     end until @active_battler.inputable?
  54.     # 设置角色的命令窗口
  55.     phase3_setup_command_window
  56.   end
  57.   #--------------------------------------------------------------------------
  58.   # ● 转向前一个角色的命令输入
  59.   #--------------------------------------------------------------------------
  60.   def phase3_prior_actor
  61.     # 循环
  62.     begin
  63.       # 角色的明灭效果 OFF
  64.       if @active_battler != nil
  65.         @active_battler.blink = false
  66.       end
  67.       # 最初的角色的情况下
  68.       if @actor_index == 0
  69.         # 开始同伴指令回合
  70.         start_phase2
  71.         return
  72.       end
  73.       # 返回角色索引
  74.       @actor_index -= 1
  75.       @active_battler = $game_party.actors[@actor_index]
  76.       @active_battler.blink = true
  77.     # 如果角色是在无法接受指令的状态就再试
  78.     end until @active_battler.inputable?
  79.     # 设置角色的命令窗口
  80.     phase3_setup_command_window
  81.   end
  82.   #--------------------------------------------------------------------------
  83.   # ● 设置角色指令窗口
  84.   #--------------------------------------------------------------------------
  85.   def phase3_setup_command_window
  86.     # 同伴指令窗口无效化
  87.     @party_command_window.active = false
  88.     @party_command_window.visible = false
  89.     # 角色指令窗口无效化
  90.     @actor_command_window.active = true
  91.     @actor_command_window.visible = true
  92.     # 设置角色指令窗口的位置
  93.     @actor_command_window.x = @actor_index * 160
  94.     # 设置索引为 0
  95.     @actor_command_window.index = 0
  96.   end
  97.   #--------------------------------------------------------------------------
  98.   # ● 刷新画面 (角色命令回合)
  99.   #--------------------------------------------------------------------------
  100.   def update_phase3
  101.     # 敌人光标有效的情况下
  102.     if @enemy_arrow != nil
  103.       update_phase3_enemy_select
  104.     # 角色光标有效的情况下
  105.     elsif @actor_arrow != nil
  106.       update_phase3_actor_select
  107.     # 特技窗口有效的情况下
  108.     elsif @skill_window != nil
  109.       update_phase3_skill_select
  110.     # 物品窗口有效的情况下
  111.     elsif @item_window != nil
  112.       update_phase3_item_select
  113.     # 角色指令窗口有效的情况下
  114.     elsif @actor_command_window.active
  115.       update_phase3_basic_command
  116.     end
  117.   end
  118.   #--------------------------------------------------------------------------
  119.   # ● 刷新画面 (角色命令回合 : 基本命令)
  120.   #--------------------------------------------------------------------------
  121.   def update_phase3_basic_command
  122.     # 按下 B 键的情况下
  123.     if Input.trigger?(Input::B)
  124.       # 演奏取消 SE
  125.       $game_system.se_play($data_system.cancel_se)
  126.       # 转向前一个角色的指令输入
  127.       phase3_prior_actor
  128.       return
  129.     end
  130.     # 按下 C 键的情况下
  131.     if Input.trigger?(Input::C)
  132.       # 角色指令窗口光标位置分之
  133.       case @actor_command_window.index
  134.       when 0  # 攻击
  135.         # 演奏确定 SE
  136.         $game_system.se_play($data_system.decision_se)
  137.         # 设置行动
  138.         @active_battler.current_action.kind = 0
  139.         @active_battler.current_action.basic = 0
  140.         # 开始选择敌人
  141.     ###############这段可要可不要#############################
  142.          if @active_battler.weapon_id > 0 and
  143.          $data_weapons[@active_battler.weapon_id].element_set.include?(scope_id)
  144.          phase3_next_actor
  145.        else
  146.         start_enemy_select
  147.       end
  148.       ##################################################
  149.       when 1  # 特技
  150.         # 演奏确定 SE
  151.         $game_system.se_play($data_system.decision_se)
  152.         # 设置行动
  153.         @active_battler.current_action.kind = 1
  154.         # 开始选择特技
  155.         start_skill_select
  156.       when 2  # 防御
  157.         # 演奏确定 SE
  158.         $game_system.se_play($data_system.decision_se)
  159.         # 设置行动
  160.         @active_battler.current_action.kind = 0
  161.         @active_battler.current_action.basic = 1
  162.         # 转向下一位角色的指令输入
  163.         phase3_next_actor
  164.       when 3  # 物品
  165.         # 演奏确定 SE
  166.         $game_system.se_play($data_system.decision_se)
  167.         # 设置行动
  168.         @active_battler.current_action.kind = 2
  169.         # 开始选择物品
  170.         start_item_select
  171.       end
  172.       return
  173.     end
  174.   end
  175.   #--------------------------------------------------------------------------
  176.   # ● 刷新画面 (角色命令回合 : 选择特技)
  177.   #--------------------------------------------------------------------------
  178.   def update_phase3_skill_select
  179.     # 设置特技窗口为可视状态
  180.     @skill_window.visible = true
  181.     # 刷新特技窗口
  182.     @skill_window.update
  183.     # 按下 B 键的情况下
  184.     if Input.trigger?(Input::B)
  185.       # 演奏取消 SE
  186.       $game_system.se_play($data_system.cancel_se)
  187.       # 结束特技选择
  188.       end_skill_select
  189.       return
  190.     end
  191.     # 按下 C 键的情况下
  192.     if Input.trigger?(Input::C)
  193.       # 获取特技选择窗口现在选择的特技的数据
  194.       [url=home.php?mod=space&uid=260100]@skill[/url] = @skill_window.skill
  195.       # 无法使用的情况下
  196.       if @skill == nil or not @active_battler.skill_can_use?(@skill.id)
  197.         # 演奏冻结 SE
  198.         $game_system.se_play($data_system.buzzer_se)
  199.         return
  200.       end
  201.       # 演奏确定 SE
  202.       $game_system.se_play($data_system.decision_se)
  203.       # 设置行动
  204.       @active_battler.current_action.skill_id = @skill.id
  205.       # 设置特技窗口为不可见状态
  206.       @skill_window.visible = false
  207.       # 效果范围是敌单体的情况下
  208.       if @skill.scope == 1
  209.         # 开始选择敌人
  210.         start_enemy_select
  211.       # 效果范围是我方单体的情况下
  212.       elsif @skill.scope == 3 or @skill.scope == 5
  213.         # 开始选择角色
  214.         start_actor_select
  215.       # 效果范围不是单体的情况下
  216.       else
  217.         # 选择特技结束
  218.         end_skill_select
  219.         # 转到下一位角色的指令输入
  220.         phase3_next_actor
  221.       end
  222.       return
  223.     end
  224.   end
  225.   #--------------------------------------------------------------------------
  226.   # ● 刷新画面 (角色命令回合 : 选择物品)
  227.   #--------------------------------------------------------------------------
  228.   def update_phase3_item_select
  229.     # 设置物品窗口为可视状态
  230.     @item_window.visible = true
  231.     # 刷新物品窗口
  232.     @item_window.update
  233.     # 按下 B 键的情况下
  234.     if Input.trigger?(Input::B)
  235.       # 演奏取消 SE
  236.       $game_system.se_play($data_system.cancel_se)
  237.       # 选择物品结束
  238.       end_item_select
  239.       return
  240.     end
  241.     # 按下 C 键的情况下
  242.     if Input.trigger?(Input::C)
  243.       # 获取物品窗口现在选择的物品资料
  244.       @item = @item_window.item
  245.       # 无法使用的情况下
  246.       unless $game_party.item_can_use?(@item.id)
  247.         # 演奏冻结 SE
  248.         $game_system.se_play($data_system.buzzer_se)
  249.         return
  250.       end
  251.       # 演奏确定 SE
  252.       $game_system.se_play($data_system.decision_se)
  253.       # 设置行动
  254.       @active_battler.current_action.item_id = @item.id
  255.       # 设置物品窗口为不可见状态
  256.       @item_window.visible = false
  257.       # 效果范围是敌单体的情况下
  258.       if @item.scope == 1
  259.         # 开始选择敌人
  260.         start_enemy_select
  261.       # 效果范围是我方单体的情况下
  262.       elsif @item.scope == 3 or @item.scope == 5
  263.         # 开始选择角色
  264.         start_actor_select
  265.       # 效果范围不是单体的情况下
  266.       else
  267.         # 物品选择结束
  268.         end_item_select
  269.         # 转到下一位角色的指令输入
  270.         phase3_next_actor
  271.       end
  272.       return
  273.     end
  274.   end
  275.   #--------------------------------------------------------------------------
  276.   # ● 刷新画面画面 (角色命令回合 : 选择敌人)
  277.   #--------------------------------------------------------------------------
  278.   def update_phase3_enemy_select
  279.     # 刷新敌人箭头
  280.     @enemy_arrow.update
  281.     # 按下 B 键的情况下
  282.     if Input.trigger?(Input::B)
  283.       # 演奏取消 SE
  284.       $game_system.se_play($data_system.cancel_se)
  285.       # 选择敌人结束
  286.       end_enemy_select
  287.       return
  288.     end
  289.     # 按下 C 键的情况下
  290.     if Input.trigger?(Input::C)
  291.       # 演奏确定 SE
  292.       $game_system.se_play($data_system.decision_se)
  293.       # 设置行动
  294.       @active_battler.current_action.target_index = @enemy_arrow.index
  295.       # 选择敌人结束
  296.       end_enemy_select
  297.       # 显示特技窗口中的情况下
  298.       if @skill_window != nil
  299.         # 结束特技选择
  300.         end_skill_select
  301.       end
  302.       # 显示物品窗口的情况下
  303.       if @item_window != nil
  304.         # 结束物品选择
  305.         end_item_select
  306.       end
  307.       # 转到下一位角色的指令输入
  308.       phase3_next_actor
  309.     end
  310.   end
  311.   #--------------------------------------------------------------------------
  312.   # ● 画面更新 (角色指令回合 : 选择角色)
  313.   #--------------------------------------------------------------------------
  314.   def update_phase3_actor_select
  315.     # 刷新角色箭头
  316.     @actor_arrow.update
  317.     # 按下 B 键的情况下
  318.     if Input.trigger?(Input::B)
  319.       # 演奏取消 SE
  320.       $game_system.se_play($data_system.cancel_se)
  321.       # 选择角色结束
  322.       end_actor_select
  323.       return
  324.     end
  325.     # 按下 C 键的情况下
  326.     if Input.trigger?(Input::C)
  327.       # 演奏确定 SE
  328.       $game_system.se_play($data_system.decision_se)
  329.       # 设置行动
  330.       @active_battler.current_action.target_index = @actor_arrow.index
  331.       # 选择角色结束
  332.       end_actor_select
  333.       # 显示特技窗口中的情况下
  334.       if @skill_window != nil
  335.         # 结束特技选择
  336.         end_skill_select
  337.       end
  338.       # 显示物品窗口的情况下
  339.       if @item_window != nil
  340.         # 结束物品选择
  341.         end_item_select
  342.       end
  343.       # 转到下一位角色的指令输入
  344.       phase3_next_actor
  345.     end
  346.   end
  347.   #--------------------------------------------------------------------------
  348.   # ● 开始选择敌人
  349.   #--------------------------------------------------------------------------
  350.   def start_enemy_select
  351.     # 生成敌人箭头
  352.     @enemy_arrow = Arrow_Enemy.new(@spriteset.viewport1)
  353.     # 关联帮助窗口
  354.     @enemy_arrow.help_window = @help_window
  355.     # 无效化角色指令窗口
  356.     @actor_command_window.active = false
  357.     @actor_command_window.visible = false
  358.   end
  359.   #--------------------------------------------------------------------------
  360.   # ● 结束选择敌人
  361.   #--------------------------------------------------------------------------
  362.   def end_enemy_select
  363.     # 释放敌人箭头
  364.     @enemy_arrow.dispose
  365.     @enemy_arrow = nil
  366.     # 指令为 [战斗] 的情况下
  367.     if @actor_command_window.index == 0
  368.       # 有效化角色指令窗口
  369.       @actor_command_window.active = true
  370.       @actor_command_window.visible = true
  371.       # 隐藏帮助窗口
  372.       @help_window.visible = false
  373.     end
  374.   end
  375.   #--------------------------------------------------------------------------
  376.   # ● 开始选择角色
  377.   #--------------------------------------------------------------------------
  378.   def start_actor_select
  379.     # 生成角色箭头
  380.     @actor_arrow = Arrow_Actor.new(@spriteset.viewport2)
  381.     @actor_arrow.index = @actor_index
  382.     # 关联帮助窗口
  383.     @actor_arrow.help_window = @help_window
  384.     # 无效化角色指令窗口
  385.     @actor_command_window.active = false
  386.     @actor_command_window.visible = false
  387.   end
  388.   #--------------------------------------------------------------------------
  389.   # ● 结束选择角色
  390.   #--------------------------------------------------------------------------
  391.   def end_actor_select
  392.     # 释放角色箭头
  393.     @actor_arrow.dispose
  394.     @actor_arrow = nil
  395.   end
  396.   #--------------------------------------------------------------------------
  397.   # ● 开始选择特技
  398.   #--------------------------------------------------------------------------
  399.   def start_skill_select
  400.     # 生成特技窗口
  401.     @skill_window = Window_Skill.new(@active_battler)
  402.     # 关联帮助窗口
  403.     @skill_window.help_window = @help_window
  404.     # 无效化角色指令窗口
  405.     @actor_command_window.active = false
  406.     @actor_command_window.visible = false
  407.   end
  408.   #--------------------------------------------------------------------------
  409.   # ● 选择特技结束
  410.   #--------------------------------------------------------------------------
  411.   def end_skill_select
  412.     # 释放特技窗口
  413.     @skill_window.dispose
  414.     @skill_window = nil
  415.     # 隐藏帮助窗口
  416.     @help_window.visible = false
  417.     # 有效化角色指令窗口
  418.     @actor_command_window.active = true
  419.     @actor_command_window.visible = true
  420.   end
  421.   #--------------------------------------------------------------------------
  422.   # ● 开始选择物品
  423.   #--------------------------------------------------------------------------
  424.   def start_item_select
  425.     # 生成物品窗口
  426.     @item_window = Window_Item.new
  427.     # 关联帮助窗口
  428.     @item_window.help_window = @help_window
  429.     # 无效化角色指令窗口
  430.     @actor_command_window.active = false
  431.     @actor_command_window.visible = false
  432.   end
  433.   #--------------------------------------------------------------------------
  434.   # ● 结束选择物品
  435.   #--------------------------------------------------------------------------
  436.   def end_item_select
  437.     # 释放物品窗口
  438.     @item_window.dispose
  439.     @item_window = nil
  440.     # 隐藏帮助窗口
  441.     @help_window.visible = false
  442.     # 有效化角色指令窗口
  443.     @actor_command_window.active = true
  444.     @actor_command_window.visible = true
  445.   end
  446. end

RUBY 代码复制
  1. #==============================================================================
  2. # ■ Scene_Battle (分割定义 4)
  3. #------------------------------------------------------------------------------
  4. #  处理战斗画面的类。
  5. #==============================================================================
  6.  
  7. class Scene_Battle
  8.   #--------------------------------------------------------------------------
  9.   # ● 开始主回合
  10.   #--------------------------------------------------------------------------
  11.   def start_phase4
  12.     # 转移到回合 4
  13.     @phase = 4
  14.     # 回合数计数
  15.     $game_temp.battle_turn += 1
  16.     # 搜索全页的战斗事件
  17.     for index in 0...$data_troops[@troop_id].pages.size
  18.       # 获取事件页
  19.       page = $data_troops[@troop_id].pages[index]
  20.       # 本页的范围是 [回合] 的情况下
  21.       if page.span == 1
  22.         # 设置已经执行标志
  23.         $game_temp.battle_event_flags[index] = false
  24.       end
  25.     end
  26.     # 设置角色为非选择状态
  27.     @actor_index = -1
  28.     @active_battler = nil
  29.     # 有效化同伴指令窗口
  30.     @party_command_window.active = false
  31.     @party_command_window.visible = false
  32.     # 无效化角色指令窗口
  33.     @actor_command_window.active = false
  34.     @actor_command_window.visible = false
  35.     # 设置主回合标志
  36.     $game_temp.battle_main_phase = true
  37.     # 生成敌人行动
  38.     for enemy in $game_troop.enemies
  39.       enemy.make_action
  40.     end
  41.     # 生成行动顺序
  42.     make_action_orders
  43.     # 移动到步骤 1
  44.     @phase4_step = 1
  45.   end
  46.   #--------------------------------------------------------------------------
  47.   # ● 生成行动循序
  48.   #--------------------------------------------------------------------------
  49.   def make_action_orders
  50.     # 初始化序列 @action_battlers
  51.     @action_battlers = []
  52.     # 添加敌人到 @action_battlers 序列
  53.     for enemy in $game_troop.enemies
  54.       @action_battlers.push(enemy)
  55.     end
  56.     # 添加角色到 @action_battlers 序列
  57.     for actor in $game_party.actors
  58.       @action_battlers.push(actor)
  59.     end
  60.     # 确定全体的行动速度
  61.     for battler in @action_battlers
  62.       battler.make_action_speed
  63.     end
  64.     # 按照行动速度从大到小排列
  65.     @action_battlers.sort! {|a,b|
  66.       b.current_action.speed - a.current_action.speed }
  67.   end
  68.   #--------------------------------------------------------------------------
  69.   # ● 刷新画面 (主回合)
  70.   #--------------------------------------------------------------------------
  71.   def update_phase4
  72.     case @phase4_step
  73.     when 1
  74.       update_phase4_step1
  75.     when 2
  76.       update_phase4_step2
  77.     when 3
  78.       update_phase4_step3
  79.     when 4
  80.       update_phase4_step4
  81.     when 5
  82.       update_phase4_step5
  83.     when 6
  84.       update_phase4_step6
  85.     end
  86.   end
  87.   #--------------------------------------------------------------------------
  88.   # ● 刷新画面 (主回合步骤 1 : 准备行动)
  89.   #--------------------------------------------------------------------------
  90.   def update_phase4_step1
  91.     # 隐藏帮助窗口
  92.     @help_window.visible = false
  93.     # 判定胜败
  94.     if judge
  95.       # 胜利或者失败的情况下 : 过程结束
  96.       return
  97.     end
  98.     # 强制行动的战斗者不存在的情况下
  99.     if $game_temp.forcing_battler == nil
  100.       # 设置战斗事件
  101.       setup_battle_event
  102.       # 执行战斗事件中的情况下
  103.       if $game_system.battle_interpreter.running?
  104.         return
  105.       end
  106.     end
  107.     # 强制行动的战斗者存在的情况下
  108.     if $game_temp.forcing_battler != nil
  109.       # 在头部添加后移动
  110.       @action_battlers.delete($game_temp.forcing_battler)
  111.       @action_battlers.unshift($game_temp.forcing_battler)
  112.     end
  113.     # 未行动的战斗者不存在的情况下 (全员已经行动)
  114.     if @action_battlers.size == 0
  115.       # 开始同伴命令回合
  116.       start_phase2
  117.       return
  118.     end
  119.     # 初始化动画 ID 和公共事件 ID
  120.     @animation1_id = 0
  121.     @animation2_id = 0
  122.     @common_event_id = 0
  123.     # 未行动的战斗者移动到序列的头部
  124.     @active_battler = @action_battlers.shift
  125.     # 如果已经在战斗之外的情况下
  126.     if @active_battler.index == nil
  127.       return
  128.     end
  129.     # 连续伤害
  130.     if @active_battler.hp > 0 and @active_battler.slip_damage?
  131.       @active_battler.slip_damage_effect
  132.       @active_battler.damage_pop = true
  133.     end
  134.     # 自然解除状态
  135.     @active_battler.remove_states_auto
  136.     # 刷新状态窗口
  137.     @status_window.refresh
  138.     # 移至步骤 2
  139.     @phase4_step = 2
  140.   end
  141.   #--------------------------------------------------------------------------
  142.   # ● 刷新画面 (主回合步骤 2 : 开始行动)
  143.   #--------------------------------------------------------------------------
  144.   def update_phase4_step2
  145.     # 如果不是强制行动
  146.     unless @active_battler.current_action.forcing
  147.       # 限制为 [敌人为普通攻击] 或 [我方为普通攻击] 的情况下
  148.       if @active_battler.restriction == 2 or @active_battler.restriction == 3
  149.         # 设置行动为攻击
  150.         @active_battler.current_action.kind = 0
  151.         @active_battler.current_action.basic = 0
  152.       end
  153.       # 限制为 [不能行动] 的情况下
  154.       if @active_battler.restriction == 4
  155.         # 清除行动强制对像的战斗者
  156.         $game_temp.forcing_battler = nil
  157.         # 移至步骤 1
  158.         @phase4_step = 1
  159.         return
  160.       end
  161.     end
  162.     # 清除对像战斗者
  163.     @target_battlers = []
  164.     # 行动种类分支
  165.     case @active_battler.current_action.kind
  166.     when 0  # 基本
  167.       make_basic_action_result
  168.     when 1  # 特技
  169.       make_skill_action_result
  170.     when 2  # 物品
  171.       make_item_action_result
  172.     end
  173.     # 移至步骤 3
  174.     if @phase4_step == 2
  175.       @phase4_step = 3
  176.     end
  177.   end
  178.   #--------------------------------------------------------------------------
  179.   # ● 生成基本行动结果
  180.   #--------------------------------------------------------------------------
  181.   def make_basic_action_result
  182.     # 攻击的情况下
  183.     if @active_battler.current_action.basic == 0
  184.       # 设置攻击 ID
  185.       @animation1_id = @active_battler.animation1_id
  186.       @animation2_id = @active_battler.animation2_id
  187.       # 行动方的战斗者是敌人的情况下
  188.       if @active_battler.is_a?(Game_Enemy)
  189.         if @active_battler.restriction == 3
  190.           target = $game_troop.random_target_enemy
  191.         elsif @active_battler.restriction == 2
  192.           target = $game_party.random_target_actor
  193.         else
  194.           index = @active_battler.current_action.target_index
  195.           target = $game_party.smooth_target_actor(index)
  196.         end
  197.       end
  198.       # 行动方的战斗者是角色的情况下
  199.       if @active_battler.is_a?(Game_Actor)
  200.         if @active_battler.restriction == 3
  201.           target = $game_party.random_target_actor
  202.         elsif @active_battler.restriction == 2
  203.           target = $game_troop.random_target_enemy
  204.         else
  205.         ##########################################
  206.          if @active_battler.weapon_id > 0 and $data_weapons[@active_battler.weapon_id].element_set.include?(scope_id)
  207.            for enemy in $game_troop.enemies
  208.              if enemy.exist?
  209.                @target_battlers.push(enemy)
  210.              end
  211.            end
  212.          end
  213.          ########################################
  214.           index = @active_battler.current_action.target_index
  215.           target = $game_troop.smooth_target_enemy(index)
  216.         end
  217.       end
  218.       # 设置对像方的战斗者序列
  219.      if @target_battlers == []
  220.       # 设置对像方的战斗者序列
  221.       @target_battlers = [target]
  222.      end
  223.       # 应用通常攻击效果
  224.       for target in @target_battlers
  225.         target.attack_effect(@active_battler)
  226.       end
  227.       return
  228.     end
  229.     # 防御的情况下
  230.     if @active_battler.current_action.basic == 1
  231.       # 帮助窗口显示"防御"
  232.       @help_window.set_text($data_system.words.guard, 1)
  233.       return
  234.     end
  235.     # 逃跑的情况下
  236.     if @active_battler.is_a?(Game_Enemy) and
  237.        @active_battler.current_action.basic == 2
  238.       #  帮助窗口显示"逃跑"
  239.       @help_window.set_text("逃跑", 1)
  240.       # 逃跑
  241.       @active_battler.escape
  242.       return
  243.     end
  244.     # 什么也不做的情况下
  245.     if @active_battler.current_action.basic == 3
  246.       # 清除强制行动对像的战斗者
  247.       $game_temp.forcing_battler = nil
  248.       # 移至步骤 1
  249.       @phase4_step = 1
  250.       return
  251.     end
  252.   end
  253.   #--------------------------------------------------------------------------
  254.   # ● 设置物品或特技对像方的战斗者
  255.   #     scope : 特技或者是物品的范围
  256.   #--------------------------------------------------------------------------
  257.   def set_target_battlers(scope)
  258.     # 行动方的战斗者是敌人的情况下
  259.     if @active_battler.is_a?(Game_Enemy)
  260.       # 效果范围分支
  261.       case scope
  262.       when 1  # 敌单体
  263.         index = @active_battler.current_action.target_index
  264.         @target_battlers.push($game_party.smooth_target_actor(index))
  265.       when 2  # 敌全体
  266.         for actor in $game_party.actors
  267.           if actor.exist?
  268.             @target_battlers.push(actor)
  269.           end
  270.         end
  271.       when 3  # 我方单体
  272.         index = @active_battler.current_action.target_index
  273.         @target_battlers.push($game_troop.smooth_target_enemy(index))
  274.       when 4  # 我方全体
  275.         for enemy in $game_troop.enemies
  276.           if enemy.exist?
  277.             @target_battlers.push(enemy)
  278.           end
  279.         end
  280.       when 5  # 我方单体 (HP 0)
  281.         index = @active_battler.current_action.target_index
  282.         enemy = $game_troop.enemies[index]
  283.         if enemy != nil and enemy.hp0?
  284.           @target_battlers.push(enemy)
  285.         end
  286.       when 6  # 我方全体 (HP 0)
  287.         for enemy in $game_troop.enemies
  288.           if enemy != nil and enemy.hp0?
  289.             @target_battlers.push(enemy)
  290.           end
  291.         end
  292.       when 7  # 使用者
  293.         @target_battlers.push(@active_battler)
  294.       end
  295.     end
  296.     # 行动方的战斗者是角色的情况下
  297.     if @active_battler.is_a?(Game_Actor)
  298.       # 效果范围分支
  299.       case scope
  300.       when 1  # 敌单体
  301.         index = @active_battler.current_action.target_index
  302.         @target_battlers.push($game_troop.smooth_target_enemy(index))
  303.       when 2  # 敌全体
  304.         for enemy in $game_troop.enemies
  305.           if enemy.exist?
  306.             @target_battlers.push(enemy)
  307.           end
  308.         end
  309.       when 3  # 我方单体
  310.         index = @active_battler.current_action.target_index
  311.         @target_battlers.push($game_party.smooth_target_actor(index))
  312.       when 4  # 我方全体
  313.         for actor in $game_party.actors
  314.           if actor.exist?
  315.             @target_battlers.push(actor)
  316.           end
  317.         end
  318.       when 5  # 我方单体 (HP 0)
  319.         index = @active_battler.current_action.target_index
  320.         actor = $game_party.actors[index]
  321.         if actor != nil and actor.hp0?
  322.           @target_battlers.push(actor)
  323.         end
  324.       when 6  # 我方全体 (HP 0)
  325.         for actor in $game_party.actors
  326.           if actor != nil and actor.hp0?
  327.             @target_battlers.push(actor)
  328.           end
  329.         end
  330.       when 7  # 使用者
  331.         @target_battlers.push(@active_battler)
  332.       end
  333.     end
  334.   end
  335.   #--------------------------------------------------------------------------
  336.   # ● 生成特技行动结果
  337.   #--------------------------------------------------------------------------
  338.   def make_skill_action_result
  339.     # 获取特技
  340.     @skill = $data_skills[@active_battler.current_action.skill_id]
  341.     # 如果不是强制行动
  342.     unless @active_battler.current_action.forcing
  343.       # 因为 SP 耗尽而无法使用的情况下
  344.       unless @active_battler.skill_can_use?(@skill.id)
  345.         # 清除强制行动对像的战斗者
  346.         $game_temp.forcing_battler = nil
  347.         # 移至步骤 1
  348.         @phase4_step = 1
  349.         return
  350.       end
  351.     end
  352.     # 消耗 SP
  353.     @active_battler.sp -= @skill.sp_cost
  354.     # 刷新状态窗口
  355.     @status_window.refresh
  356.     # 在帮助窗口显示特技名
  357.     @help_window.set_text(@skill.name, 1)
  358.     # 设置动画 ID
  359.     @animation1_id = @skill.animation1_id
  360.     @animation2_id = @skill.animation2_id
  361.     # 设置公共事件 ID
  362.     @common_event_id = @skill.common_event_id
  363.     # 设置对像侧战斗者
  364.     set_target_battlers(@skill.scope)
  365.     # 应用特技效果
  366.     for target in @target_battlers
  367.       target.skill_effect(@active_battler, @skill)
  368.     end
  369.   end
  370.   #--------------------------------------------------------------------------
  371.   # ● 生成物品行动结果
  372.   #--------------------------------------------------------------------------
  373.   def make_item_action_result
  374.     # 获取物品
  375.     @item = $data_items[@active_battler.current_action.item_id]
  376.     # 因为物品耗尽而无法使用的情况下
  377.     unless $game_party.item_can_use?(@item.id)
  378.       # 移至步骤 1
  379.       @phase4_step = 1
  380.       return
  381.     end
  382.     # 消耗品的情况下
  383.     if @item.consumable
  384.       # 使用的物品减 1
  385.       $game_party.lose_item(@item.id, 1)
  386.     end
  387.     # 在帮助窗口显示物品名
  388.     @help_window.set_text(@item.name, 1)
  389.     # 设置动画 ID
  390.     @animation1_id = @item.animation1_id
  391.     @animation2_id = @item.animation2_id
  392.     # 设置公共事件 ID
  393.     @common_event_id = @item.common_event_id
  394.     # 确定对像
  395.     index = @active_battler.current_action.target_index
  396.     target = $game_party.smooth_target_actor(index)
  397.     # 设置对像侧战斗者
  398.     set_target_battlers(@item.scope)
  399.     # 应用物品效果
  400.     for target in @target_battlers
  401.       target.item_effect(@item)
  402.     end
  403.   end
  404.   #--------------------------------------------------------------------------
  405.   # ● 刷新画面 (主回合步骤 3 : 行动方动画)
  406.   #--------------------------------------------------------------------------
  407.   def update_phase4_step3
  408.     # 行动方动画 (ID 为 0 的情况下是白色闪烁)
  409.     if @animation1_id == 0
  410.       @active_battler.white_flash = true
  411.     else
  412.       @active_battler.animation_id = @animation1_id
  413.       @active_battler.animation_hit = true
  414.     end
  415.     # 移至步骤 4
  416.     @phase4_step = 4
  417.   end
  418.   #--------------------------------------------------------------------------
  419.   # ● 刷新画面 (主回合步骤 4 : 对像方动画)
  420.   #--------------------------------------------------------------------------
  421.   def update_phase4_step4
  422.     # 对像方动画
  423.     for target in @target_battlers
  424.       target.animation_id = @animation2_id
  425.       target.animation_hit = (target.damage != "Miss")
  426.     end
  427.     # 限制动画长度、最低 8 帧
  428.     @wait_count = 8
  429.     # 移至步骤 5
  430.     @phase4_step = 5
  431.   end
  432.   #--------------------------------------------------------------------------
  433.   # ● 刷新画面 (主回合步骤 5 : 显示伤害)
  434.   #--------------------------------------------------------------------------
  435.   def update_phase4_step5
  436.     # 隐藏帮助窗口
  437.     @help_window.visible = false
  438.     # 刷新状态窗口
  439.     @status_window.refresh
  440.     # 显示伤害
  441.     for target in @target_battlers
  442.       if target.damage != nil
  443.         target.damage_pop = true
  444.       end
  445.     end
  446.     # 移至步骤 6
  447.     @phase4_step = 6
  448.   end
  449.   #--------------------------------------------------------------------------
  450.   # ● 刷新画面 (主回合步骤 6 : 刷新)
  451.   #--------------------------------------------------------------------------
  452.   def update_phase4_step6
  453.     # 清除强制行动对像的战斗者
  454.     $game_temp.forcing_battler = nil
  455.     # 公共事件 ID 有效的情况下
  456.     if @common_event_id > 0
  457.       # 设置事件
  458.       common_event = $data_common_events[@common_event_id]
  459.       $game_system.battle_interpreter.setup(common_event.list, 0)
  460.     end
  461.     # 移至步骤 1
  462.     @phase4_step = 1
  463.   end
  464. end

评分

参与人数 1梦石 +1 收起 理由
RyanBern + 1 认可答案

查看全部评分

Vanyogin
回复 支持 反对

使用道具 举报

Lv1.梦旅人

梦石
0
星屑
65
在线时间
16 小时
注册时间
2016-8-14
帖子
5
3
 楼主| 发表于 2016-8-18 09:11:14 手机端发表。 | 只看该作者
谢谢,我先试试看。非常感谢!
回复 支持 反对

使用道具 举报

Lv2.观梦者

梦石
0
星屑
386
在线时间
63 小时
注册时间
2023-7-5
帖子
15
4
发表于 2023-7-18 21:09:15 | 只看该作者
2357691704 发表于 2016-8-18 07:42
#说明:添加一个属性叫 全体化 ,然后想要全体化的武器就把该属性打上勾。
#============================= ...

我想增加某个防具也有这种全攻属性,该怎么加
回复 支持 反对

使用道具 举报

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

本版积分规则

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

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

GMT+8, 2024-4-29 22:44

Powered by Discuz! X3.1

© 2001-2013 Comsenz Inc.

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