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

Project1

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

[已经过期] 关于连击系统的BUG,求大大们帮忙修复破解

[复制链接]

Lv2.观梦者

梦石
0
星屑
870
在线时间
291 小时
注册时间
2010-9-9
帖子
64
跳转到指定楼层
1
发表于 2014-2-15 13:06:02 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式

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

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

x
最近使用了这个连击系统,但是问题出来了,就是在连击的时候,如果前面的技能打死了所有的怪物,后面还有技能的话,剩余技能不会自动停止,而是继续使用,然后目标变成使用者本人。
请问各位大大,这个怎么破?测试的时候,用了史莱姆测试,结果第一个技能就挂掉全部史莱姆,剩下的4个技能全招呼到自己身上,然后就自杀了。。

RUBY 代码复制
  1. #==============================================================================
  2. #
  3. # ▼ Yanfly Engine Ace - Input Combo Skills v1.01
  4. # -- Last Updated: 2011.12.26
  5. # -- Level: Hard
  6. # -- Requires: n/a
  7. #
  8. #==============================================================================
  9.  
  10. $imported = {} if $imported.nil?
  11. $imported["YEA-InputComboSkills"] = true
  12.  
  13. #==============================================================================
  14. # ▼ Updates
  15. # =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  16. # 2011.12.26 - Bug Fix: Crash when no action is performed.
  17. # 2011.12.22 - Started Script and Finished.
  18. #
  19. #==============================================================================
  20. # ▼ Introduction
  21. # =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  22. # This script enables the usage of Input Combo Skills. When an Input Combo
  23. # Skill is activated by an actor, a list of the potential input attacks appears
  24. # on the side of the screen. The player then presses the various buttons listed
  25. # in the window and attacks will occur in a combo fashion. If a particular
  26. # attack combination is met, a special attack will occur.
  27. #
  28. #==============================================================================
  29. # ▼ Instructions
  30. # =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  31. # To install this script, open up your script editor and copy/paste this script
  32. # to an open slot below ▼ Materials/素材 but above ▼ Main. Remember to save.
  33. #
  34. # -----------------------------------------------------------------------------
  35. # Skill Notetags - These notetags go in the skill notebox in the database.
  36. # -----------------------------------------------------------------------------
  37. # <combo skill L: x>
  38. # <combo skill R: x>
  39. # <combo skill X: x>
  40. # <combo skill Y: x>
  41. # <combo skill Z: x>
  42. # Makes the skill with these notetags to become potentially comboable. Replace
  43. # x with the ID of the skill you want the button to cause the skill to combo.
  44. # The combo skill will be usable even if the user has not learned the skill.
  45. # However, if the user is unable to use the skill due to a lack of resources,
  46. # then the skill will be greyed out. The skill can be inputted, but if the user
  47. # lacks the resources, it will not perform and the skill combo will break.
  48. #
  49. # <combo max: x>
  50. # Sets the maximum number of inputs the player can use for this skill. If this
  51. # tag is not present, it will use the default number of maximum inputs that's
  52. # pre-defined by the module.
  53. #
  54. # <combo special string: x>
  55. # If the player inputs a sequence that matches the string (any combination of
  56. # L, R, X, Y, Z), then the special skill x will be performed. If a combination
  57. # is met, then the combo chain will end prematurely even if there are more
  58. # inputs left. If the user does not know skill x, then the special combo skill
  59. # x will not be performed.
  60. #
  61. # <combo only>
  62. # This makes a skill only usable in a combo and cannot be directly used from a
  63. # skill menu. This effect does not affect monsters. Combo skills will still be
  64. # unusable if the user does not meet the skill's other requirements (such as a
  65. # lack of MP or TP).
  66. #
  67. #==============================================================================
  68. # ▼ Compatibility
  69. # =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  70. # This script is made strictly for RPG Maker VX Ace. It is highly unlikely that
  71. # it will run with RPG Maker VX without adjusting.
  72. #
  73. # While this script doesn't interfere with Active Chain Skills, it will most
  74. # likely be unable to used in conjunction with Active Chain Skills. I will not
  75. # provide support for any errors that may occur from this, nor will I be
  76. # responsible for any damage doing this may cause your game.
  77. #
  78. #==============================================================================
  79.  
  80. module YEA
  81.   module INPUT_COMBO
  82.  
  83.     #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  84.     # - Combo Skill Settings -
  85.     #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  86.     # These settings adjust the sound effect played when a skill is selected,
  87.     # what the minimum time windows are.
  88.     #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  89.     # This will be the sound effect played whenever an active combo skill has
  90.     # been selected for comboing.
  91.     INPUT_COMBO_SOUND = RPG::SE.new("Skill2", 80, 100)
  92.  
  93.     # This will be the sound effect played when an input combo matches and
  94.     # activates a specialized combo.
  95.     ACHIEVED_COMBO_SOUND = RPG::SE.new("Skill3", 90, 100)
  96.  
  97.     # How many frames minimum for combo allowance. Sometimes the battlelog
  98.     # window will move too fast for the player to be able to combo. This sets
  99.     # a minimum timer for how long the combo window will stay open.
  100.     MINIMUM_TIME = 90
  101.  
  102.     # This is the bonus number of frames of leeway that the player gets for
  103.     # a larger input sequence. This is because the battlelog window may move
  104.     # too fast for the player to be able to combo. This adds to the minimum
  105.     # timer for how long the combo window will stay open.
  106.     TIME_PER_INPUT = 30
  107.  
  108.     # This sets the default number of inputs that a combo skill can have at
  109.     # maximum. If you wish to exceed this amount or to have lower than this
  110.     # amount, use a notetag to change the skill's max combo amount.
  111.     DEFAULT_MAX_INPUT = 5
  112.  
  113.     # This will be the "Window" colour used for a special skill in the display.
  114.     SPECIAL_SKILL_COLOUR = 17
  115.  
  116.     #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  117.     # - Combo Skill Text -
  118.     #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  119.     # This section adjusts the text that appears for the combo skills. Adjust
  120.     # the text to appear as you see fit. Note that the vocab other than the
  121.     # title can use text codes.
  122.     #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  123.     COMBO_TITLE   = "Input Combo Attacks"
  124.     TITLE_SIZE    = 20
  125.     L_SKILL_ON  = "\eC[17]Q\eC[0]: "
  126.     L_SKILL_OFF = "\eC[7]Q: "
  127.     R_SKILL_ON  = "\eC[17]W\eC[0]: "
  128.     R_SKILL_OFF = "\eC[7]W: "
  129.     X_SKILL_ON  = "\eC[17]A\eC[0]: "
  130.     X_SKILL_OFF = "\eC[7]A: "
  131.     Y_SKILL_ON  = "\eC[17]S\eC[0]: "
  132.     Y_SKILL_OFF = "\eC[7]S: "
  133.     Z_SKILL_ON  = "\eC[17]D\eC[0]: "
  134.     Z_SKILL_OFF = "\eC[7]D: "
  135.  
  136.   end # INPUT_COMBO
  137. end # YEA
  138.  
  139. #==============================================================================
  140. # ▼ Editting anything past this point may potentially result in causing
  141. # computer damage, incontinence, explosion of user's head, coma, death, and/or
  142. # halitosis so edit at your own risk.
  143. #==============================================================================
  144.  
  145. module YEA
  146.   module REGEXP
  147.   module SKILL
  148.  
  149.     COMBO_MAX     = /<(?:COMBO_MAX|combo max):[ ](\d+)>/i
  150.     COMBO_ONLY    = /<(?:COMBO_ONLY|combo only)>/i
  151.     COMBO_SKILL   = /<(?:COMBO_SKILL|combo skill)[ ]([LRXYZ]):[ ](\d+)>/i
  152.     COMBO_SPECIAL = /<(?:COMBO_SPECIAL|combo special)[ ](.*):[ ](\d+)>/i
  153.  
  154.   end # SKILL
  155.   end # REGEXP
  156. end # YEA
  157.  
  158. #==============================================================================
  159. # ■ DataManager
  160. #==============================================================================
  161.  
  162. module DataManager
  163.  
  164.   #--------------------------------------------------------------------------
  165.   # alias method: load_database
  166.   #--------------------------------------------------------------------------
  167.   class <<self; alias load_database_ics load_database; end
  168.   def self.load_database
  169.     load_database_ics
  170.     load_notetags_ics
  171.   end
  172.  
  173.   #--------------------------------------------------------------------------
  174.   # new method: load_notetags_ics
  175.   #--------------------------------------------------------------------------
  176.   def self.load_notetags_ics
  177.     for skill in $data_skills
  178.       next if skill.nil?
  179.       skill.load_notetags_ics
  180.     end
  181.   end
  182.  
  183. end # DataManager
  184.  
  185. #==============================================================================
  186. # ■ RPG::Skill
  187. #==============================================================================
  188.  
  189. class RPG::Skill < RPG::UsableItem
  190.  
  191.   #--------------------------------------------------------------------------
  192.   # public instance variables
  193.   #--------------------------------------------------------------------------
  194.   attr_accessor :combo_only
  195.   attr_accessor :combo_skill
  196.   attr_accessor :combo_max
  197.   attr_accessor :combo_special
  198.  
  199.   #--------------------------------------------------------------------------
  200.   # common cache: load_notetags_ics
  201.   #--------------------------------------------------------------------------
  202.   def load_notetags_ics
  203.     @combo_only = false
  204.     @combo_skill = {}
  205.     @combo_special = {}
  206.     @combo_max = YEA::INPUT_COMBO::DEFAULT_MAX_INPUT
  207.     #---
  208.     self.note.split(/[\r\n]+/).each { |line|
  209.       case line
  210.       #---
  211.       when YEA::REGEXP::SKILL::COMBO_ONLY
  212.         @combo_only = true
  213.       when YEA::REGEXP::SKILL::COMBO_SKILL
  214.         case $1.upcase
  215.         when "L"; @combo_skill[:L] = $2.to_i
  216.         when "R"; @combo_skill[:R] = $2.to_i
  217.         when "X"; @combo_skill[:X] = $2.to_i
  218.         when "Y"; @combo_skill[:Y] = $2.to_i
  219.         when "Z"; @combo_skill[:Z] = $2.to_i
  220.         else; next
  221.         end
  222.       when YEA::REGEXP::SKILL::COMBO_MAX
  223.         @combo_max = $1.to_i
  224.       when YEA::REGEXP::SKILL::COMBO_SPECIAL
  225.         @combo_special[$1.to_s.upcase] = $2.to_i
  226.       #---
  227.       end
  228.     } # self.note.split
  229.     #---
  230.   end
  231.  
  232. end # RPG::UsableItem
  233.  
  234. #==============================================================================
  235. # ■ Game_Action
  236. #==============================================================================
  237.  
  238. class Game_Action
  239.  
  240.   #--------------------------------------------------------------------------
  241.   # new method: set_input_combo_skill
  242.   #--------------------------------------------------------------------------
  243.   def set_input_combo_skill(skill_id)
  244.     set_skill(skill_id)
  245.     @target_index = subject.current_action.target_index
  246.     @input_combo_skill = true
  247.   end
  248.  
  249.   #--------------------------------------------------------------------------
  250.   # alias method: valid?
  251.   #--------------------------------------------------------------------------
  252.   alias game_action_valid_ics valid?
  253.   def valid?
  254.     subject.enable_input_combo(true) if @input_combo_skill
  255.     result = game_action_valid_ics
  256.     subject.enable_input_combo(false) if @input_combo_skill
  257.     return result
  258.   end
  259.  
  260. end # Game_Action
  261.  
  262. #==============================================================================
  263. # ■ Game_BattlerBase
  264. #==============================================================================
  265.  
  266. class Game_BattlerBase
  267.  
  268.   #--------------------------------------------------------------------------
  269.   # alias method: skill_conditions_met?
  270.   #--------------------------------------------------------------------------
  271.   alias game_battlerbase_skill_conditions_met_ics skill_conditions_met?
  272.   def skill_conditions_met?(skill)
  273.     return false if combo_skill_restriction?(skill)
  274.     return game_battlerbase_skill_conditions_met_ics(skill)
  275.   end
  276.  
  277.   #--------------------------------------------------------------------------
  278.   # new method: combo_skill_restriction?
  279.   #--------------------------------------------------------------------------
  280.   def combo_skill_restriction?(skill)
  281.     return false unless actor?
  282.     return false unless $game_party.in_battle
  283.     return false unless skill.combo_only
  284.     return !@input_combo_enabled
  285.   end
  286.  
  287.   #--------------------------------------------------------------------------
  288.   # alias method: hp=
  289.   #--------------------------------------------------------------------------
  290.   alias game_battlerbase_hpequals_ics hp=
  291.   def hp=(value)
  292.     game_battlerbase_hpequals_ics(value)
  293.     return unless SceneManager.scene_is?(Scene_Battle)
  294.     return unless actor?
  295.     return if value == 0
  296.     SceneManager.scene.refresh_input_combo_skill_window(self)
  297.   end
  298.  
  299.   #--------------------------------------------------------------------------
  300.   # alias method: mp=
  301.   #--------------------------------------------------------------------------
  302.   alias game_battlerbase_mpequals_ics mp=
  303.   def mp=(value)
  304.     game_battlerbase_mpequals_ics(value)
  305.     return unless SceneManager.scene_is?(Scene_Battle)
  306.     return unless actor?
  307.     return if value == 0
  308.     SceneManager.scene.refresh_input_combo_skill_window(self)
  309.   end
  310.  
  311.   #--------------------------------------------------------------------------
  312.   # alias method: tp=
  313.   #--------------------------------------------------------------------------
  314.   alias game_battlerbase_tpequals_ics tp=
  315.   def tp=(value)
  316.     game_battlerbase_tpequals_ics(value)
  317.     return unless SceneManager.scene_is?(Scene_Battle)
  318.     return unless actor?
  319.     return if value == 0
  320.     SceneManager.scene.refresh_input_combo_skill_window(self)
  321.   end
  322.  
  323. end # Game_BattlerBase
  324.  
  325. #==============================================================================
  326. # ■ Game_Battler
  327. #==============================================================================
  328.  
  329. class Game_Battler < Game_BattlerBase
  330.  
  331.   #--------------------------------------------------------------------------
  332.   # alias method: on_battle_start
  333.   #--------------------------------------------------------------------------
  334.   alias game_battler_on_battle_start_ics on_battle_start
  335.   def on_battle_start
  336.     game_battler_on_battle_start_ics
  337.     @input_combo_enabled = false
  338.   end
  339.  
  340.   #--------------------------------------------------------------------------
  341.   # alias method: on_battle_end
  342.   #--------------------------------------------------------------------------
  343.   alias game_battler_on_battle_end_ics on_battle_end
  344.   def on_battle_end
  345.     game_battler_on_battle_end_ics
  346.     @input_combo_enabled = false
  347.   end
  348.  
  349.   #--------------------------------------------------------------------------
  350.   # new method: enable_input_combo
  351.   #--------------------------------------------------------------------------
  352.   def enable_input_combo(active)
  353.     return unless actor?
  354.     @input_combo_enabled = active
  355.   end
  356.  
  357. end # Game_Battler
  358.  
  359. #==============================================================================
  360. # ■ Window_ComboSkillList
  361. #==============================================================================
  362.  
  363. class Window_ComboSkillList < Window_Base
  364.  
  365.   #--------------------------------------------------------------------------
  366.   # initialize
  367.   #--------------------------------------------------------------------------
  368.   def initialize
  369.     dw = [Graphics.width/2, 320].max
  370.     super(-12, 0, dw, fitting_height(7))
  371.     self.z = 200
  372.     self.opacity = 0
  373.     hide
  374.   end
  375.  
  376.   #--------------------------------------------------------------------------
  377.   # reveal
  378.   #--------------------------------------------------------------------------
  379.   def reveal(battler, skill)
  380.     [url=home.php?mod=space&uid=133701]@battler[/url] = battler
  381.     [url=home.php?mod=space&uid=260100]@skill[/url] = skill
  382.     @combo_skills = []
  383.     for key in skill.combo_skill
  384.       next if key[1].nil?
  385.       next if $data_skills[key[1]].nil?
  386.       @combo_skills.push($data_skills[key[1]])
  387.     end
  388.     return if @combo_skills == []
  389.     self.y = Graphics.height - fitting_height(4)
  390.     self.y -= fitting_height(@combo_skills.size + 2)
  391.     show
  392.     activate
  393.     refresh
  394.   end
  395.  
  396.   #--------------------------------------------------------------------------
  397.   # refresh_check
  398.   #--------------------------------------------------------------------------
  399.   def refresh_check(battler)
  400.     return if @battler != battler
  401.     refresh
  402.   end
  403.  
  404.   #--------------------------------------------------------------------------
  405.   # refresh
  406.   #--------------------------------------------------------------------------
  407.   def refresh
  408.     contents.clear
  409.     draw_background_colour
  410.     draw_horz_line(0)
  411.     draw_combo_title
  412.     draw_horz_line(@combo_skills.size * line_height)
  413.     draw_combo_skills
  414.   end
  415.  
  416.   #--------------------------------------------------------------------------
  417.   # draw_background_colour
  418.   #--------------------------------------------------------------------------
  419.   def draw_background_colour
  420.     dh = line_height * (@combo_skills.size + 2)
  421.     rect = Rect.new(0, 0, contents.width, dh)
  422.     back_colour1 = Color.new(0, 0, 0, 192)
  423.     back_colour2 = Color.new(0, 0, 0, 0)
  424.     contents.gradient_fill_rect(rect, back_colour1, back_colour2)
  425.   end
  426.  
  427.   #--------------------------------------------------------------------------
  428.   # draw_horz_line
  429.   #--------------------------------------------------------------------------
  430.   def draw_horz_line(dy)
  431.     line_y = dy + line_height - 2
  432.     line_colour = normal_color
  433.     line_colour.alpha = 48
  434.     contents.fill_rect(0, line_y, contents.width, 2, line_colour)
  435.   end
  436.  
  437.   #--------------------------------------------------------------------------
  438.   # draw_combo_title
  439.   #--------------------------------------------------------------------------
  440.   def draw_combo_title
  441.     reset_font_settings
  442.     text = YEA::INPUT_COMBO::COMBO_TITLE
  443.     contents.font.size = YEA::INPUT_COMBO::TITLE_SIZE
  444.     contents.font.bold = true
  445.     contents.font.italic = true
  446.     draw_text(12, 0, contents.width - 12, line_height, text)
  447.     reset_font_settings
  448.   end
  449.  
  450.   #--------------------------------------------------------------------------
  451.   # draw_combo_skills
  452.   #--------------------------------------------------------------------------
  453.   def draw_combo_skills
  454.     button_array = [:L, :R, :X, :Y, :Z]
  455.     dx = 24
  456.     dy = line_height
  457.     for button in button_array
  458.       next if @skill.combo_skill[button].nil?
  459.       combo_skill = $data_skills[@skill.combo_skill[button]]
  460.       text = text_setting(button, combo_skill)
  461.       text += sprintf("\eI[%d]", combo_skill.icon_index)
  462.       text += combo_skill.name
  463.       draw_text_ex(dx, dy, text)
  464.       dy += line_height
  465.     end
  466.   end
  467.  
  468.   #--------------------------------------------------------------------------
  469.   # text_setting
  470.   #--------------------------------------------------------------------------
  471.   def text_setting(button, skill)
  472.     text = ""
  473.     case button
  474.     when :L
  475.       if @battler.usable?(skill)
  476.         text = YEA::INPUT_COMBO::L_SKILL_ON
  477.       else
  478.         text = YEA::INPUT_COMBO::L_SKILL_OFF
  479.       end
  480.     when :R
  481.       if @battler.usable?(skill)
  482.         text = YEA::INPUT_COMBO::R_SKILL_ON
  483.       else
  484.         text = YEA::INPUT_COMBO::R_SKILL_OFF
  485.       end
  486.     when :X
  487.       if @battler.usable?(skill)
  488.         text = YEA::INPUT_COMBO::X_SKILL_ON
  489.       else
  490.         text = YEA::INPUT_COMBO::X_SKILL_OFF
  491.       end
  492.     when :Y
  493.       if @battler.usable?(skill)
  494.         text = YEA::INPUT_COMBO::Y_SKILL_ON
  495.       else
  496.         text = YEA::INPUT_COMBO::Y_SKILL_OFF
  497.       end
  498.     when :Z
  499.       if @battler.usable?(skill)
  500.         text = YEA::INPUT_COMBO::Z_SKILL_ON
  501.       else
  502.         text = YEA::INPUT_COMBO::Z_SKILL_OFF
  503.       end
  504.     end
  505.     return text
  506.   end
  507.  
  508. end # Window_ComboSkillList
  509.  
  510. #==============================================================================
  511. # ■ Window_ComboInfo
  512. #==============================================================================
  513.  
  514. class Window_ComboInfo < Window_Base
  515.  
  516.   #--------------------------------------------------------------------------
  517.   # initialize
  518.   #--------------------------------------------------------------------------
  519.   def initialize
  520.     super(0, 0, Graphics.width, fitting_height(1))
  521.     self.y = Graphics.height - fitting_height(4) - fitting_height(1)
  522.     self.opacity = 0
  523.     self.z = 200
  524.     @combos = []
  525.     @special = nil
  526.     hide
  527.   end
  528.  
  529.   #--------------------------------------------------------------------------
  530.   # reveal
  531.   #--------------------------------------------------------------------------
  532.   def reveal
  533.     @combos = []
  534.     @special = nil
  535.     refresh
  536.     show
  537.   end
  538.  
  539.   #--------------------------------------------------------------------------
  540.   # refresh
  541.   #--------------------------------------------------------------------------
  542.   def refresh
  543.     contents.clear
  544.     dx = draw_combo_icons
  545.     draw_special(dx)
  546.   end
  547.  
  548.   #--------------------------------------------------------------------------
  549.   # add_combo
  550.   #--------------------------------------------------------------------------
  551.   def add_combo(icon, special = nil)
  552.     @combos.push(icon)
  553.     @special = special
  554.     refresh
  555.   end
  556.  
  557.   #--------------------------------------------------------------------------
  558.   # draw_combo_icons
  559.   #--------------------------------------------------------------------------
  560.   def draw_combo_icons
  561.     dx = 0
  562.     for icon in @combos
  563.       draw_icon(icon, dx, 0)
  564.       dx += 24
  565.     end
  566.     return dx
  567.   end
  568.  
  569.   #--------------------------------------------------------------------------
  570.   # draw_special
  571.   #--------------------------------------------------------------------------
  572.   def draw_special(dx)
  573.     return if @special.nil?
  574.     draw_icon(@special.icon_index, dx + 12, 0)
  575.     colour = text_color(YEA::INPUT_COMBO::SPECIAL_SKILL_COLOUR)
  576.     change_color(colour)
  577.     draw_text(dx + 36, 0, contents.width, line_height, @special.name)
  578.   end
  579.  
  580. end # Window_ComboInfo
  581.  
  582. #==============================================================================
  583. # ■ Scene_Battle
  584. #==============================================================================
  585.  
  586. class Scene_Battle < Scene_Base
  587.  
  588.   #--------------------------------------------------------------------------
  589.   # alias method: create_all_windows
  590.   #--------------------------------------------------------------------------
  591.   alias scene_battle_create_all_windows_ics create_all_windows
  592.   def create_all_windows
  593.     scene_battle_create_all_windows_ics
  594.     create_combo_skill_window
  595.   end
  596.  
  597.   #--------------------------------------------------------------------------
  598.   # new method: create_combo_skill_window
  599.   #--------------------------------------------------------------------------
  600.   def create_combo_skill_window
  601.     @input_combo_skill_window = Window_ComboSkillList.new
  602.     @input_combo_info_window = Window_ComboInfo.new
  603.     @input_combo_skill_counter = 0
  604.   end
  605.  
  606.   #--------------------------------------------------------------------------
  607.   # alias method: use_item
  608.   #--------------------------------------------------------------------------
  609.   alias scene_battle_use_item_ics use_item
  610.   def use_item
  611.     @subject.enable_input_combo(true)
  612.     item = @subject.current_action.item
  613.     combo_skill_list_appear(true, item)
  614.     start_input_combo_skill_counter(item)
  615.     scene_battle_use_item_ics
  616.     loop do
  617.       break if break_input_combo?(item)
  618.       update_basic
  619.       update_combo_skill_queue
  620.     end
  621.     combo_skill_list_appear(false, item)
  622.     @subject.enable_input_combo(false)
  623.   end
  624.  
  625.   #--------------------------------------------------------------------------
  626.   # new method: combo_skill_list_appear
  627.   #--------------------------------------------------------------------------
  628.   def combo_skill_list_appear(visible, skill)
  629.     return if @subject.nil?
  630.     return unless @subject.actor?
  631.     return unless skill.is_a?(RPG::Skill)
  632.     return if visible && @input_combo_skill_window.visible
  633.     if visible
  634.       @break_combo = false
  635.       @current_combo_skill = skill
  636.       @total_combo_skills = 0
  637.       @combo_skill_queue = []
  638.       @combo_skill_string = ""
  639.       @input_combo_skill_window.reveal(@subject, skill)
  640.       @input_combo_info_window.reveal
  641.     else
  642.       @input_combo_skill_window.hide
  643.       @input_combo_info_window.hide
  644.       return if @subject.current_action.nil?
  645.       @subject.current_action.set_skill(@current_combo_skill.id)
  646.     end
  647.   end
  648.  
  649.   #--------------------------------------------------------------------------
  650.   # new method: refresh_input_combo_skill_window
  651.   #--------------------------------------------------------------------------
  652.   def refresh_input_combo_skill_window(battler)
  653.     return unless @input_combo_skill_window.visible
  654.     @input_combo_skill_window.refresh_check(battler)
  655.   end
  656.  
  657.   #--------------------------------------------------------------------------
  658.   # new method: start_input_combo_skill_counter
  659.   #--------------------------------------------------------------------------
  660.   def start_input_combo_skill_counter(skill)
  661.     return unless @input_combo_skill_window.visible
  662.     @input_combo_skill_counter = YEA::INPUT_COMBO::MINIMUM_TIME
  663.     bonus_time = skill.combo_max * YEA::INPUT_COMBO::TIME_PER_INPUT
  664.     @input_combo_skill_counter += bonus_time
  665.   end
  666.  
  667.   #--------------------------------------------------------------------------
  668.   # new method: break_input_combo?
  669.   #--------------------------------------------------------------------------
  670.   def break_input_combo?(item)
  671.     return true if @break_combo
  672.     return true if @current_combo_skill.nil?
  673.     return true if @current_combo_skill.combo_skill == {}
  674.     return false if @combo_skill_queue != []
  675.     return true if @total_combo_skills == @current_combo_skill.combo_max
  676.     return @input_combo_skill_counter <= 0
  677.   end
  678.  
  679.   #--------------------------------------------------------------------------
  680.   # new method: update_combo_skill_queue
  681.   #--------------------------------------------------------------------------
  682.   def update_combo_skill_queue
  683.     return if @combo_skill_queue == []
  684.     action = @combo_skill_queue.shift
  685.     if !@subject.usable?(action)
  686.       @break_combo = true
  687.       return
  688.     end
  689.     @subject.current_action.set_input_combo_skill(action.id)
  690.     @log_window.clear
  691.     execute_action
  692.   end
  693.  
  694.   #--------------------------------------------------------------------------
  695.   # alias method: update_basic
  696.   #--------------------------------------------------------------------------
  697.   alias scene_battle_update_basic_ics update_basic
  698.   def update_basic
  699.     scene_battle_update_basic_ics
  700.     update_input_combo_skill_counter
  701.     update_input_combo_skill_select
  702.   end
  703.  
  704.   #--------------------------------------------------------------------------
  705.   # new method: update_input_combo_skill_counter
  706.   #--------------------------------------------------------------------------
  707.   def update_input_combo_skill_counter
  708.     return if @input_combo_skill_counter == 0
  709.     @input_combo_skill_counter -= 1
  710.   end
  711.  
  712.   #--------------------------------------------------------------------------
  713.   # new method: update_input_combo_skill_select
  714.   #--------------------------------------------------------------------------
  715.   def update_input_combo_skill_select
  716.     return unless @input_combo_skill_window.visible
  717.     return if @total_combo_skills >= @current_combo_skill.combo_max
  718.     if Input.trigger?(:L)
  719.       check_input_combo_skill(:L)
  720.     elsif Input.trigger?(:R)
  721.       check_input_combo_skill(:R)
  722.     elsif Input.trigger?(:X)
  723.       check_input_combo_skill(:X)
  724.     elsif Input.trigger?(:Y)
  725.       check_input_combo_skill(:Y)
  726.     elsif Input.trigger?(:Z)
  727.       check_input_combo_skill(:Z)
  728.     end
  729.   end
  730.  
  731.   #--------------------------------------------------------------------------
  732.   # new method: check_input_combo_skill
  733.   #--------------------------------------------------------------------------
  734.   def check_input_combo_skill(button)
  735.     skill_id = @current_combo_skill.combo_skill[button]
  736.     return if skill_id.nil?
  737.     return if $data_skills[skill_id].nil?
  738.     case button
  739.     when :L; @combo_skill_string += "L"
  740.     when :R; @combo_skill_string += "R"
  741.     when :X; @combo_skill_string += "X"
  742.     when :Y; @combo_skill_string += "Y"
  743.     when :Z; @combo_skill_string += "Z"
  744.     end
  745.     if special_input_combo?
  746.       icon = $data_skills[skill_id].icon_index
  747.       @combo_skill_queue.push($data_skills[skill_id])
  748.       skill_id = @current_combo_skill.combo_special[@combo_skill_string]
  749.       combo_skill = $data_skills[skill_id]
  750.       @input_combo_info_window.add_combo(icon, combo_skill)
  751.       YEA::INPUT_COMBO::ACHIEVED_COMBO_SOUND.play
  752.       @total_combo_skills = @current_combo_skill.combo_max
  753.     else
  754.       YEA::INPUT_COMBO::INPUT_COMBO_SOUND.play
  755.       combo_skill = $data_skills[skill_id]
  756.       @input_combo_info_window.add_combo(combo_skill.icon_index)
  757.       @total_combo_skills += 1
  758.     end
  759.     @combo_skill_queue.push(combo_skill)
  760.     return unless @total_combo_skills == @current_combo_skill.combo_max
  761.     @input_combo_skill_counter = 0
  762.   end
  763.  
  764.   #--------------------------------------------------------------------------
  765.   # new method: special_input_combo?
  766.   #--------------------------------------------------------------------------
  767.   def special_input_combo?
  768.     combo_hash = @current_combo_skill.combo_special
  769.     return false unless combo_hash.include?(@combo_skill_string)
  770.     skill = $data_skills[combo_hash[@combo_skill_string]]
  771.     return @subject.skills.include?(skill)
  772.   end
  773.  
  774. end # Scene_Battle
  775.  
  776. #==============================================================================
  777. #
  778. # ▼ End of File
  779. #
  780. #==============================================================================

Lv1.梦旅人

梦石
0
星屑
50
在线时间
466 小时
注册时间
2013-2-8
帖子
424
2
发表于 2014-2-16 02:14:15 手机端发表。 | 只看该作者
冤有头债有主啊,谁写的找谁去。

点评

哈哈哈,我也想啊,可是我也是冲别的地方copy下来的啊。  发表于 2014-2-16 10:41
回复 支持 反对

使用道具 举报

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

本版积分规则

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

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

GMT+8, 2024-11-16 10:10

Powered by Discuz! X3.1

© 2001-2013 Comsenz Inc.

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