Project1

标题: 怎么设置特技的效果范围为一部分敌人? [打印本页]

作者: 兔毛鹿    时间: 2014-7-21 08:54
标题: 怎么设置特技的效果范围为一部分敌人?
比如设置10号特技的效果范围是对方敌人队伍中的两个,11号特技的效果范围是对方敌人队伍中的三个
作者: VIPArcher    时间: 2014-7-21 09:37
本帖最后由 VIPArcher 于 2014-7-21 09:40 编辑

DQ那种技能范围

请无视这里,我错了。这是VA的。
作者: 冰水金刚    时间: 2014-7-21 10:32
把10,11号特技设为敌单体
Scene_Battle 1 10行main前加入attr_accessor :a
Scene_Battle 4 351行设置对像侧战斗者下加入
if @skill.id == 10
@a = 2
end
if @skill.id == 11
@a = 3
end
然后set_target_battlers(@skill.scope)改成set_target_battlers(@skill.scope,@a)
接着在上面找到设置物品或特技对像方的战斗者
def set_target_battlers(scope)改为def set_target_battlers(scope,a = 0)
下面when 3
@target_battlers.push($game_troop.smooth_target_enemy(index))下加入
for enemy in $game_troop.enemies
          if enemy.exist?
            if enemy  != $game_troop.smooth_target_enemy(index)
            if @target_battlers.size < a
            @target_battlers.push(enemy)
            end
            end
          end
        end
作者: 兔毛鹿    时间: 2014-7-21 12:53
冰水金刚 发表于 2014-7-21 10:32
把10,11号特技设为敌单体
Scene_Battle 1 10行main前加入attr_accessor :a
Scene_Battle 4 351行设置对像 ...

我照这样修改了,但是发动特技时攻击的敌人还是单体
作者: qdqlloxe    时间: 2014-7-21 15:50
我记得  RM大师天干宝典  里面中的一部里面有一个 仿梦幻西游的范围攻击特效,秒1 秒2 秒x(随机)符合lz的要求,如果lz懒得找的话可以等我周末回家发代码。.
作者: 冰水金刚    时间: 2014-7-21 16:11
本帖最后由 hys111111 于 2014-7-24 17:25 编辑
兔毛鹿 发表于 2014-7-21 12:53
我照这样修改了,但是发动特技时攻击的敌人还是单体


是我错了
  1. for enemy in $game_troop.enemies
  2.           if enemy.exist?
  3.             if enemy  != $game_troop.smooth_target_enemy(index)
  4.             if @target_battlers.size < a
  5.             @target_battlers.push(enemy)
  6.             end
  7.             end
  8.           end
  9.         end
复制代码
这一段加在# 行动方的战斗者是角色的情况下,When 1下的@target_battlers.push($game_troop.smooth_target_enemy(index))后(其他不变)
作者: 兔毛鹿    时间: 2014-7-22 12:25
冰水金刚 发表于 2014-7-21 16:11
是我错了
for enemy in $game_troop.enemies
          if enemy.exist?


谢谢了!能不能把对敌的目标箭头也整上去啊?几个目标就有几个箭头指着。只有一个箭头的话看不清是哪三个目标啊
作者: 楼主是我的女仆    时间: 2014-7-23 10:15
这个或许更适合,但是还是有一些局限性而且可能和你正在用的其他脚本冲突
  1. #==============================================================================
  2. #☆ 特技多体对象选择(随机 + 选定)
  3. #------------------------------------------------------------------------------
  4. # by -> 芯☆淡如水  
  5. #==============================================================================
  6. # ● 介绍:
  7. #
  8. #     该特技多体攻击可实现特技对象的多体选择(介于单体和全体之间)。选择多体的
  9. #方式有随机选择和手动指定选择。
  10. #
  11. #     该多体攻击,理论上可以随机或选定 1~无限 个攻击对象。但由于数据库敌人队伍
  12. #的敌人数量最多只能设置 8 个,所以只可以 1~7 个攻击对象。如果 数据库-特技 设置
  13. #的对象个数超过 7 个,效果等于是全体攻击。
  14. #==============================================================================
  15. # ● 使用方法:1,复制该脚本,插入到 main 前。
  16. #
  17. #              2,数据库 - 特技 设置:先将需要多体的特技的 效果范围 设为 无。
  18. #                                     然后在特技名后写上分隔符号半角逗号“,”
  19. #                                     接着写该特技的对象个数。其他设置与
  20. #                                     一般特技相同。(详见范例特技设置)
  21. #
  22. #              3,随机多体特技只需完成上面的设置即可,选定多体对象特技再在下面
  23. #                 的设置项里照格式添加特技 ID 。
  24. #==============================================================================
  25. # ● 设置
  26. #------------------------------------------------------------------------------
  27. # 选定多体对象的特技 ID 。
  28. N_TARGET_SKILLS = [2, 8, 17, 37, 39, 82, 83]
  29. #-----------------------------------------------------------------------------
  30. # 选中的敌人播放的循环动画 ID
  31. BE_ANIMATION_ID = 101
  32. #----------------------------------------------------------------------------
  33. # 增益状态的特技 ID
  34. UP_STATE_SKILL = [82, 83]
  35. #----------------------------------------------------------------------------
  36. # 不良状态的特技 ID
  37. DOWN_STATE_SKILL = [37, 39]
  38. #==============================================================================
  39. ###############################################################################
  40. # 选中提示
  41. #==============================================================================
  42. module RPG
  43.   class Sprite < ::Sprite
  44.     def dispose
  45.       dispose_damage
  46.       dispose_animation
  47.       dispose_loop_animation
  48.       dispose_be_animation
  49.       super
  50.     end
  51.     def be_animation(animation)
  52.       return if animation == @_be_animation
  53.       dispose_be_animation
  54.       @_be_animation = animation
  55.       return if @_be_animation == nil
  56.       @_be_animation_index = 0
  57.       animation_name = @_be_animation.animation_name
  58.       animation_hue = @_be_animation.animation_hue
  59.       bitmap = RPG::Cache.animation(animation_name, animation_hue)
  60.       if @@_reference_count.include?(bitmap)
  61.         @@_reference_count[bitmap] += 1
  62.       else
  63.         @@_reference_count[bitmap] = 1
  64.       end
  65.       @_be_animation_sprites = []
  66.       for i in 0..15
  67.         sprite = ::Sprite.new(self.viewport)
  68.         sprite.bitmap = bitmap
  69.         sprite.visible = false
  70.         @_be_animation_sprites.push(sprite)
  71.       end
  72.       update_be_animation
  73.     end
  74.     def dispose_be_animation
  75.       if @_be_animation_sprites != nil
  76.         sprite = @_be_animation_sprites[0]
  77.         if sprite != nil
  78.           @@_reference_count[sprite.bitmap] -= 1
  79.           if @@_reference_count[sprite.bitmap] == 0
  80.             sprite.bitmap.dispose
  81.           end
  82.         end
  83.         for sprite in @_be_animation_sprites
  84.           sprite.dispose
  85.         end
  86.         @_be_animation_sprites = nil
  87.         @_be_animation = nil
  88.       end
  89.     end
  90.     alias xdrs update
  91.     def update
  92.       if @_be_animation != nil and (Graphics.frame_count % 2 == 0)
  93.         update_be_animation
  94.         @_be_animation_index += 1
  95.         @_be_animation_index %= @_be_animation.frame_max
  96.       end
  97.       xdrs
  98.     end
  99.     def update_be_animation
  100.       frame_index = @_be_animation_index
  101.       cell_data = @_be_animation.frames[frame_index].cell_data
  102.       position = @_be_animation.position
  103.       animation_set_sprites(@_be_animation_sprites, cell_data, position)
  104.       for timing in @_be_animation.timings
  105.         if timing.frame == frame_index
  106.           animation_process_timing(timing, true)
  107.         end
  108.       end
  109.     end
  110.   end
  111. end
  112. ###############################################################################
  113. #==============================================================================
  114. class Game_Battler
  115.   #--------------------------------------------------------------------------
  116.   attr_accessor :target_n
  117.   attr_accessor :command_on
  118.   #--------------------------------------------------------------------------
  119.   alias add_initialize_xdrs initialize
  120.   def initialize
  121.     @target_n = []
  122.     @command_on = false
  123.     add_initialize_xdrs
  124.   end
  125. end
  126. ###############################################################################
  127. class Game_Actor < Game_Battler
  128.   #---------------------------------------------------------------------------
  129.   def set_skills(skill_id)
  130.     @skills.delete(skill_id)
  131.     @skills.unshift(skill_id)
  132.   end
  133. end
  134. ###############################################################################
  135. # 定义特技名和对象数量
  136. #==============================================================================
  137. class Game_Party
  138.   #--------------------------------------------------------------------------
  139.   def skill_name(skill_id)
  140.     return $data_skills[skill_id].name.split(/,/)[0]
  141.   end
  142.   #--------------------------------------------------------------------------
  143.   def skill_tn(skill_id)
  144.     n = $data_skills[skill_id].name.split(/,/)[1].to_i
  145.     return n != nil ? n : 0
  146.   end
  147. end
  148. ###############################################################################
  149. #==============================================================================
  150. class Sprite_Battler < RPG::Sprite
  151.   #--------------------------------------------------------------------------
  152.   def update
  153.     super
  154.     # 战斗者为 nil 的情况下
  155.     if [url=home.php?mod=space&uid=133701]@battler[/url] == nil
  156.       self.bitmap = nil
  157.       loop_animation(nil)
  158.       return
  159.     end
  160.     # 文件名和色相与当前情况有差异的情况下
  161.     if @battler.battler_name != @battler_name or
  162.        @battler.battler_hue != @battler_hue
  163.       # 获取、设置位图
  164.       @battler_name = @battler.battler_name
  165.       @battler_hue = @battler.battler_hue
  166.       self.bitmap = RPG::Cache.battler(@battler_name, @battler_hue)
  167.       @width = bitmap.width
  168.       [url=home.php?mod=space&uid=291977]@height[/url] = bitmap.height
  169.       self.ox = @width / 2
  170.       self.oy = @height
  171.       # 如果是战斗不能或者是隐藏状态就把透明度设置成 0
  172.       if @battler.dead? or @battler.hidden
  173.         self.opacity = 0
  174.       end
  175.     end
  176.     # 动画 ID 与当前的情况有差异的情况下
  177.     if @battler.damage == nil and
  178.        @battler.state_animation_id != @state_animation_id
  179.       @state_animation_id = @battler.state_animation_id
  180.       loop_animation($data_animations[@state_animation_id])
  181.     end
  182.     # 应该被显示的角色的情况下
  183.     if @battler.is_a?(Game_Actor) and @battler_visible
  184.       # 不是主状态的时候稍稍降低点透明度
  185.       if $game_temp.battle_main_phase
  186.         self.opacity += 3 if self.opacity < 255
  187.       else
  188.         self.opacity -= 3 if self.opacity > 207
  189.       end
  190.     end
  191.     # 明灭
  192.     if @battler.blink
  193.       blink_on
  194.     else
  195.       blink_off
  196.     end
  197.     # 不可见的情况下
  198.     unless @battler_visible
  199.       # 出现
  200.       if not @battler.hidden and not @battler.dead? and
  201.          (@battler.damage == nil or @battler.damage_pop)
  202.         appear
  203.         @battler_visible = true
  204.       end
  205.     end
  206.     # 可见的情况下
  207.     if @battler_visible
  208.       # 选中提示
  209.       if @battler.command_on
  210.         be_animation($data_animations[BE_ANIMATION_ID])
  211.       else
  212.         be_animation(nil)
  213.       end
  214.       # 逃跑
  215.       if @battler.hidden
  216.         $game_system.se_play($data_system.escape_se)
  217.         escape
  218.         @battler_visible = false
  219.       end
  220.       # 白色闪烁
  221.       if @battler.white_flash
  222.         whiten
  223.         @battler.white_flash = false
  224.       end
  225.       # 动画
  226.       if @battler.animation_id != 0
  227.         animation = $data_animations[@battler.animation_id]
  228.         animation(animation, @battler.animation_hit)
  229.         @battler.animation_id = 0
  230.       end
  231.       # 伤害
  232.       if @battler.damage_pop
  233.         damage(@battler.damage, @battler.critical)
  234.         @battler.damage = nil
  235.         @battler.critical = false
  236.         @battler.damage_pop = false
  237.       end
  238.       # korapusu
  239.       if @battler.damage == nil and @battler.dead?
  240.         if @battler.is_a?(Game_Enemy)
  241.           $game_system.se_play($data_system.enemy_collapse_se)
  242.         else
  243.           $game_system.se_play($data_system.actor_collapse_se)
  244.         end
  245.         collapse
  246.         @battler_visible = false
  247.       end
  248.     end
  249.     # 设置活动块的坐标
  250.     self.x = @battler.screen_x
  251.     self.y = @battler.screen_y
  252.     self.z = @battler.screen_z
  253.   end
  254. end
  255. #==============================================================================
  256. class Scene_Battle
  257.   #--------------------------------------------------------------------------
  258.   def phase3_next_actor
  259.     # 循环
  260.     begin
  261.       # 角色的明灭效果 OFF
  262.       if @active_battler != nil
  263.         @active_battler.blink = false
  264.       end
  265.       # 最后的角色的情况
  266.       if @actor_index == $game_party.actors.size-1
  267.         # 开始主回合
  268.         start_phase4
  269.         return
  270.       end
  271.       # 推进角色索引
  272.       @actor_index += 1
  273.       @active_battler = $game_party.actors[@actor_index]
  274.       @active_battler.blink = true
  275.       @active_battler.target_n.clear
  276.     # 如果角色是在无法接受指令的状态就再试
  277.     end until @active_battler.inputable?
  278.     # 设置角色的命令窗口
  279.     phase3_setup_command_window
  280.   end
  281.   #--------------------------------------------------------------------------
  282.   def phase3_prior_actor
  283.     # 循环
  284.     begin
  285.       # 角色的明灭效果 OFF
  286.       if @active_battler != nil
  287.         @active_battler.blink = false
  288.       end
  289.       # 最初的角色的情况下
  290.       if @actor_index == 0
  291.         # 开始同伴指令回合
  292.         start_phase2
  293.         return
  294.       end
  295.       # 返回角色索引
  296.       @actor_index -= 1
  297.       @active_battler = $game_party.actors[@actor_index]
  298.       @active_battler.blink = true
  299.       @active_battler.target_n.clear
  300.     # 如果角色是在无法接受指令的状态就再试
  301.     end until @active_battler.inputable?
  302.     # 设置角色的命令窗口
  303.     phase3_setup_command_window
  304.   end
  305.   #--------------------------------------------------------------------------
  306.   def update_phase3_skill_select
  307.     # 设置特技窗口为可视状态
  308.     @skill_window.visible = true
  309.     # 刷新特技窗口
  310.     @skill_window.update
  311.     # 按下 B 键的情况下
  312.     if Input.trigger?(Input::B)
  313.       # 演奏取消 SE
  314.       $game_system.se_play($data_system.cancel_se)
  315.       # 结束特技选择
  316.       end_skill_select
  317.       return
  318.     end
  319.     # 按下 C 键的情况下
  320.     if Input.trigger?(Input::C)
  321.       # 获取特技选择窗口现在选择的特技的数据
  322.       [url=home.php?mod=space&uid=260100]@skill[/url] = @skill_window.skill
  323.       # 无法使用的情况下
  324.       if @skill == nil or not @active_battler.skill_can_use?(@skill.id)
  325.         # 演奏冻结 SE
  326.         $game_system.se_play($data_system.buzzer_se)
  327.         return
  328.       end
  329.       # 演奏确定 SE
  330.       $game_system.se_play($data_system.decision_se)
  331.       @active_battler.set_skills(@skill.id)
  332.       # 设置行动
  333.       @active_battler.current_action.skill_id = @skill.id
  334.       # 设置特技窗口为不可见状态
  335.       @skill_window.visible = false
  336.       if @skill.scope == 0
  337.         skill_select
  338.         # 效果范围是敌单体的情况下
  339.       elsif @skill.scope == 1
  340.         # 开始选择敌人
  341.         start_enemy_select
  342.       # 效果范围是我方单体的情况下
  343.       elsif @skill.scope == 3 or @skill.scope == 5
  344.         # 开始选择角色
  345.         start_actor_select
  346.       # 效果范围不是单体的情况下
  347.       else
  348.         # 选择特技结束
  349.         end_skill_select
  350.         # 转到下一位角色的指令输入
  351.         phase3_next_actor
  352.       end
  353.       return
  354.     end
  355.   end
  356.   #--------------------------------------------------------------------------
  357.   def skill_select
  358.     if UP_STATE_SKILL.include?(@skill.id)
  359.       start_actor_select
  360.     elsif DOWN_STATE_SKILL.include?(@skill.id)
  361.       start_enemy_select
  362.     elsif ! N_TARGET_SKILLS.include?(@skill.id)
  363.       end_skill_select
  364.       phase3_next_actor
  365.     elsif @skill.power < 0
  366.       start_actor_select
  367.     elsif @skill.power > 0
  368.       start_enemy_select
  369.     else
  370.       phase3_next_actor
  371.     end
  372.   end
  373.   #--------------------------------------------------------------------------
  374.   alias add_update_phase3_enemy_select_xdrs update_phase3_enemy_select
  375.   def update_phase3_enemy_select
  376.     if @active_battler.current_action.kind == 1
  377.       if $data_skills[@active_battler.current_action.skill_id].scope == 0
  378.         update_phase3_enemy_select_opt
  379.         return
  380.       end
  381.     end
  382.     add_update_phase3_enemy_select_xdrs
  383.   end
  384.   #--------------------------------------------------------------------------
  385.   alias add_update_phase3_actor_select_xdrs update_phase3_actor_select
  386.   def update_phase3_actor_select
  387.     if @active_battler.current_action.kind == 1
  388.       if $data_skills[@active_battler.current_action.skill_id].scope == 0
  389.         update_phase3_actor_select_opt
  390.         return
  391.       end
  392.     end
  393.     add_update_phase3_actor_select_xdrs
  394.   end
  395.   #--------------------------------------------------------------------------
  396.   def update_phase3_enemy_select_opt
  397.     @enemy_arrow.update
  398.     if Input.trigger?(Input::B)
  399.       $game_system.se_play($data_system.cancel_se)
  400.       if not @active_battler.target_n.empty?
  401.         for enemy in @active_battler.target_n
  402.           enemy.command_on = false
  403.         end
  404.         @active_battler.target_n.clear
  405.       end
  406.       end_enemy_select
  407.       return
  408.     end
  409.     if Input.trigger?(Input::A)
  410.       if @active_battler.target_n.empty?
  411.         $game_system.se_play($data_system.buzzer_se)
  412.       else
  413.         $game_system.se_play($data_system.decision_se)
  414.         for enemy in @active_battler.target_n
  415.           enemy.command_on = false
  416.         end
  417.         end_skill_select
  418.         end_enemy_select
  419.         phase3_next_actor
  420.         return
  421.       end
  422.     end
  423.     if Input.trigger?(Input::C)
  424.       skill = $data_skills[@active_battler.current_action.skill_id]
  425.       enemy = $game_troop.enemies[@enemy_arrow.index]
  426.       date = []
  427.       for n in $game_troop.enemies
  428.         date.push(n) if n.exist?
  429.       end
  430.       if $game_party.skill_tn(skill.id) > date.size
  431.         target_n = date.size
  432.       else
  433.         target_n = $game_party.skill_tn(skill.id)
  434.       end
  435.       if @active_battler.target_n.include?(enemy)
  436.         $game_system.se_play($data_system.cancel_se)
  437.         @active_battler.target_n.delete(enemy)
  438.         enemy.command_on = false
  439.       else
  440.         if @active_battler.target_n.size < target_n
  441.           $game_system.se_play($data_system.decision_se)
  442.           @active_battler.target_n.push(enemy)
  443.           enemy.command_on = true
  444.           if @active_battler.target_n.size == target_n
  445.             for enemy in @active_battler.target_n
  446.               enemy.command_on = false
  447.             end
  448.             end_skill_select
  449.             end_enemy_select
  450.             phase3_next_actor
  451.           end
  452.         end
  453.       end
  454.     end
  455.   end
  456.   #--------------------------------------------------------------------------
  457.   def update_phase3_actor_select_opt
  458.     @actor_arrow.update
  459.     if Input.trigger?(Input::B)
  460.       $game_system.se_play($data_system.cancel_se)
  461.       if not @active_battler.target_n.empty?
  462.         for actor in @active_battler.target_n
  463.           actor.command_on = false
  464.         end
  465.         @active_battler.target_n.clear
  466.       end
  467.       end_actor_select
  468.       return
  469.     end
  470.     if Input.trigger?(Input::A)
  471.       if @active_battler.target_n.empty?
  472.         $game_system.se_play($data_system.buzzer_se)
  473.       else
  474.         $game_system.se_play($data_system.decision_se)
  475.         for actor in @active_battler.target_n
  476.           actor.command_on = false
  477.         end
  478.         end_skill_select
  479.         end_actor_select
  480.         phase3_next_actor
  481.         return
  482.       end
  483.     end
  484.     if Input.trigger?(Input::C)
  485.       skill = $data_skills[@active_battler.current_action.skill_id]
  486.       actor = $game_party.actors[@actor_arrow.index]
  487.       unless [5, 6].include?(skill.scope) and actor.exist?
  488.         $game_system.se_play($data_system.buzzer_se)
  489.         return
  490.       end
  491.       date = []
  492.       for n in $game_party.actors
  493.         date.push(n) if n.exist?
  494.       end
  495.       if $game_party.skill_tn(skill.id) > date.size
  496.         target_n = date.size
  497.       else
  498.         target_n = $game_party.skill_tn(skill.id)
  499.       end
  500.       if @active_battler.target_n.include?(actor)
  501.         $game_system.se_play($data_system.cancel_se)
  502.         @active_battler.target_n.delete(actor)
  503.         actor.command_on = false
  504.       else
  505.         if @active_battler.target_n.size < target_n
  506.           $game_system.se_play($data_system.decision_se)
  507.           @active_battler.target_n.push(actor)
  508.           actor.command_on = true
  509.           if @active_battler.target_n.size == target_n
  510.             for actor in @active_battler.target_n
  511.               actor.command_on = false
  512.             end
  513.             end_skill_select
  514.             end_actor_select
  515.             phase3_next_actor
  516.           end
  517.         end
  518.       end
  519.     end
  520.   end
  521.   #===========================================================================
  522.   def set_n_targets
  523.     if $game_party.skill_tn(@skill.id) > 0
  524.       data = []
  525.       if @active_battler.is_a?(Game_Actor)
  526.         for enemy in $game_troop.enemies
  527.           data.push(enemy) if enemy.exist?
  528.         end
  529.       else
  530.         for actor in $game_party.actors
  531.           data.push(actor) if actor.exist?
  532.         end
  533.       end
  534.       if $game_party.skill_tn(@skill.id) >= data.size
  535.         @target_battlers = data
  536.       else
  537.         loop do
  538.           break if @target_battlers.size >= $game_party.skill_tn(@skill.id)
  539.           target = data[rand (data.size)]
  540.           if not @target_battlers.include?(target)
  541.             @target_battlers.push(target)
  542.           end
  543.         end
  544.       end
  545.     end
  546.   end
  547.   #############################################################################
  548.   #--------------------------------------------------------------------------
  549.   # ● 生成特技行动结果
  550.   #--------------------------------------------------------------------------
  551.   def make_skill_action_result
  552.     # 获取特技
  553.     @skill = $data_skills[@active_battler.current_action.skill_id]
  554.     # 如果不是强制行动
  555.     unless @active_battler.current_action.forcing
  556.       # 因为 SP 耗尽而无法使用的情况下
  557.       unless @active_battler.skill_can_use?(@skill.id)
  558.         # 清除强制行动对像的战斗者
  559.         $game_temp.forcing_battler = nil
  560.         # 移至步骤 1
  561.         @phase4_step = 1
  562.         return
  563.       end
  564.     end
  565.     # 消耗 SP
  566.     @active_battler.sp -= @skill.sp_cost
  567.     # 刷新状态窗口
  568.     @status_window.refresh
  569.     # 在帮助窗口显示特技名
  570.     @help_window.set_text($game_party.skill_name(@skill.id), 1)
  571.     # 设置动画 ID
  572.     @animation1_id = @skill.animation1_id
  573.     @animation2_id = @skill.animation2_id
  574.     # 设置公共事件 ID
  575.     @common_event_id = @skill.common_event_id
  576.     # 设置对像侧战斗者
  577.     ###########################################################################
  578.     # 更改特技对象的选择
  579.     #==========================================================================
  580.     if N_TARGET_SKILLS.include?(@skill.id)
  581.       if @active_battler.is_a?(Game_Actor)
  582.         @target_battlers = @active_battler.target_n
  583.         @active_battler.target_n = []
  584.       else
  585.         set_n_targets
  586.       end
  587.     else
  588.       if @skill.scope == 0
  589.         set_n_targets
  590.       else
  591.         set_target_battlers(@skill.scope)
  592.       end
  593.     end
  594.     ###########################################################################
  595.     # 应用特技效果
  596.     for target in @target_battlers
  597.       target.skill_effect(@active_battler, @skill)
  598.     end
  599.   end
  600. end
  601. ###############################################################################
  602. # 重新描绘特技名
  603. #==============================================================================
  604. class Window_Skill < Window_Selectable
  605.   #--------------------------------------------------------------------------
  606.   def draw_item(index)
  607.     skill = @data[index]
  608.     if @actor.skill_can_use?(skill.id)
  609.       self.contents.font.color = normal_color
  610.     else
  611.       self.contents.font.color = disabled_color
  612.     end
  613.     x = 4 + index % 2 * (288 + 32)
  614.     y = index / 2 * 32
  615.     rect = Rect.new(x, y, self.width / @column_max - 32, 32)
  616.     self.contents.fill_rect(rect, Color.new(0, 0, 0, 0))
  617.     bitmap = RPG::Cache.icon(skill.icon_name)
  618.     opacity = self.contents.font.color == normal_color ? 255 : 128
  619.     self.contents.blt(x, y + 4, bitmap, Rect.new(0, 0, 24, 24), opacity)
  620.     name = $game_party.skill_name(skill.id)
  621.     self.contents.draw_text(x + 28, y, 204, 32, name, 0)
  622.     self.contents.draw_text(x + 232, y, 48, 32, skill.sp_cost.to_s, 2)
  623.   end
  624. end
  625. #==============================================================================
  626. ###############################################################################
复制代码
特技多体rmxp.rar (280.94 KB, 下载次数: 432)

里面有随机2体、随机3体、选择2体、选择3体之类的攻击目标




欢迎光临 Project1 (https://rpg.blue/) Powered by Discuz! X3.1