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

Project1

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

[已经过期] ace上的一个连击系统的问题!

[复制链接]

Lv1.梦旅人

梦石
0
星屑
53
在线时间
572 小时
注册时间
2011-4-1
帖子
749
跳转到指定楼层
1
发表于 2013-4-24 09:47:32 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式

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

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

x
本帖最后由 hcm 于 2013-5-10 12:51 编辑

是Yanfly的连击脚本:(我不会贴脚本)
不过放脚本之前先说明白——
因为想到了这样一个系统,就是通过连击脚本实现“剑法(或枪法、弓法、棍法,最少五式,最多十式)”从一式到五式的转变,但是,想到十式剑法时,不知道如何添加,所以特来问一下!
好的,放脚本!
  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. $imported = {} if $imported.nil?
  10. $imported["YEA-InputComboSkills"] = true

  11. #==============================================================================
  12. # ▼ Updates
  13. # =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  14. # 2011.12.26 - Bug Fix: Crash when no action is performed.
  15. # 2011.12.22 - Started Script and Finished.
  16. #
  17. #==============================================================================
  18. # ▼ Introduction
  19. # =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  20. # This script enables the usage of Input Combo Skills. When an Input Combo
  21. # Skill is activated by an actor, a list of the potential input attacks appears
  22. # on the side of the screen. The player then presses the various buttons listed
  23. # in the window and attacks will occur in a combo fashion. If a particular
  24. # attack combination is met, a special attack will occur.
  25. #
  26. #==============================================================================
  27. # ▼ Instructions
  28. # =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  29. # To install this script, open up your script editor and copy/paste this script
  30. # to an open slot below ▼ Materials/素材 but above ▼ Main. Remember to save.
  31. #
  32. # -----------------------------------------------------------------------------
  33. # Skill Notetags - These notetags go in the skill notebox in the database.
  34. # -----------------------------------------------------------------------------
  35. # <combo skill L: x>
  36. # <combo skill R: x>
  37. # <combo skill X: x>
  38. # <combo skill Y: x>
  39. # <combo skill Z: x>
  40. # Makes the skill with these notetags to become potentially comboable. Replace
  41. # x with the ID of the skill you want the button to cause the skill to combo.
  42. # The combo skill will be usable even if the user has not learned the skill.
  43. # However, if the user is unable to use the skill due to a lack of resources,
  44. # then the skill will be greyed out. The skill can be inputted, but if the user
  45. # lacks the resources, it will not perform and the skill combo will break.
  46. #
  47. # <combo max: x>
  48. # Sets the maximum number of inputs the player can use for this skill. If this
  49. # tag is not present, it will use the default number of maximum inputs that's
  50. # pre-defined by the module.
  51. #
  52. # <combo special string: x>
  53. # If the player inputs a sequence that matches the string (any combination of
  54. # L, R, X, Y, Z), then the special skill x will be performed. If a combination
  55. # is met, then the combo chain will end prematurely even if there are more
  56. # inputs left. If the user does not know skill x, then the special combo skill
  57. # x will not be performed.
  58. #
  59. # <combo only>
  60. # This makes a skill only usable in a combo and cannot be directly used from a
  61. # skill menu. This effect does not affect monsters. Combo skills will still be
  62. # unusable if the user does not meet the skill's other requirements (such as a
  63. # lack of MP or TP).
  64. #
  65. #==============================================================================
  66. # ▼ Compatibility
  67. # =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  68. # This script is made strictly for RPG Maker VX Ace. It is highly unlikely that
  69. # it will run with RPG Maker VX without adjusting.
  70. #
  71. # While this script doesn't interfere with Active Chain Skills, it will most
  72. # likely be unable to used in conjunction with Active Chain Skills. I will not
  73. # provide support for any errors that may occur from this, nor will I be
  74. # responsible for any damage doing this may cause your game.
  75. #
  76. #==============================================================================

  77. module YEA
  78.   module INPUT_COMBO
  79.    
  80.     #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  81.     # - Combo Skill Settings -
  82.     #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  83.     # These settings adjust the sound effect played when a skill is selected,
  84.     # what the minimum time windows are.
  85.     #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  86.     # This will be the sound effect played whenever an active combo skill has
  87.     # been selected for comboing.
  88.     INPUT_COMBO_SOUND = RPG::SE.new("Skill2", 80, 100)
  89.    
  90.     # This will be the sound effect played when an input combo matches and
  91.     # activates a specialized combo.
  92.     ACHIEVED_COMBO_SOUND = RPG::SE.new("Skill3", 90, 100)
  93.    
  94.     # How many frames minimum for combo allowance. Sometimes the battlelog
  95.     # window will move too fast for the player to be able to combo. This sets
  96.     # a minimum timer for how long the combo window will stay open.
  97.     MINIMUM_TIME = 90
  98.    
  99.     # This is the bonus number of frames of leeway that the player gets for
  100.     # a larger input sequence. This is because the battlelog window may move
  101.     # too fast for the player to be able to combo. This adds to the minimum
  102.     # timer for how long the combo window will stay open.
  103.     TIME_PER_INPUT = 30
  104.    
  105.     # This sets the default number of inputs that a combo skill can have at
  106.     # maximum. If you wish to exceed this amount or to have lower than this
  107.     # amount, use a notetag to change the skill's max combo amount.
  108.     DEFAULT_MAX_INPUT = 5
  109.    
  110.     # This will be the "Window" colour used for a special skill in the display.
  111.     SPECIAL_SKILL_COLOUR = 17
  112.    
  113.     #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  114.     # - Combo Skill Text -
  115.     #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  116.     # This section adjusts the text that appears for the combo skills. Adjust
  117.     # the text to appear as you see fit. Note that the vocab other than the
  118.     # title can use text codes.
  119.     #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  120.     COMBO_TITLE   = "Input Combo Attacks"
  121.     TITLE_SIZE    = 20
  122.     L_SKILL_ON  = "\eC[17]Q\eC[0]: "
  123.     L_SKILL_OFF = "\eC[7]Q: "
  124.     R_SKILL_ON  = "\eC[17]W\eC[0]: "
  125.     R_SKILL_OFF = "\eC[7]W: "
  126.     X_SKILL_ON  = "\eC[17]A\eC[0]: "
  127.     X_SKILL_OFF = "\eC[7]A: "
  128.     Y_SKILL_ON  = "\eC[17]S\eC[0]: "
  129.     Y_SKILL_OFF = "\eC[7]S: "
  130.     Z_SKILL_ON  = "\eC[17]D\eC[0]: "
  131.     Z_SKILL_OFF = "\eC[7]D: "
  132.    
  133.   end # INPUT_COMBO
  134. end # YEA

  135. #==============================================================================
  136. # ▼ Editting anything past this point may potentially result in causing
  137. # computer damage, incontinence, explosion of user's head, coma, death, and/or
  138. # halitosis so edit at your own risk.
  139. #==============================================================================

  140. module YEA
  141.   module REGEXP
  142.   module SKILL
  143.    
  144.     COMBO_MAX     = /<(?:COMBO_MAX|combo max):[ ](\d+)>/i
  145.     COMBO_ONLY    = /<(?:COMBO_ONLY|combo only)>/i
  146.     COMBO_SKILL   = /<(?:COMBO_SKILL|combo skill)[ ]([LRXYZ]):[ ](\d+)>/i
  147.     COMBO_SPECIAL = /<(?:COMBO_SPECIAL|combo special)[ ](.*):[ ](\d+)>/i
  148.    
  149.   end # SKILL
  150.   end # REGEXP
  151. end # YEA

  152. #==============================================================================
  153. # ■ DataManager
  154. #==============================================================================

  155. module DataManager
  156.   
  157.   #--------------------------------------------------------------------------
  158.   # alias method: load_database
  159.   #--------------------------------------------------------------------------
  160.   class <<self; alias load_database_ics load_database; end
  161.   def self.load_database
  162.     load_database_ics
  163.     load_notetags_ics
  164.   end
  165.   
  166.   #--------------------------------------------------------------------------
  167.   # new method: load_notetags_ics
  168.   #--------------------------------------------------------------------------
  169.   def self.load_notetags_ics
  170.     for skill in $data_skills
  171.       next if skill.nil?
  172.       skill.load_notetags_ics
  173.     end
  174.   end
  175.   
  176. end # DataManager

  177. #==============================================================================
  178. # ■ RPG::Skill
  179. #==============================================================================

  180. class RPG::Skill < RPG::UsableItem
  181.   
  182.   #--------------------------------------------------------------------------
  183.   # public instance variables
  184.   #--------------------------------------------------------------------------
  185.   attr_accessor :combo_only
  186.   attr_accessor :combo_skill
  187.   attr_accessor :combo_max
  188.   attr_accessor :combo_special
  189.   
  190.   #--------------------------------------------------------------------------
  191.   # common cache: load_notetags_ics
  192.   #--------------------------------------------------------------------------
  193.   def load_notetags_ics
  194.     @combo_only = false
  195.     @combo_skill = {}
  196.     @combo_special = {}
  197.     @combo_max = YEA::INPUT_COMBO::DEFAULT_MAX_INPUT
  198.     #---
  199.     self.note.split(/[\r\n]+/).each { |line|
  200.       case line
  201.       #---
  202.       when YEA::REGEXP::SKILL::COMBO_ONLY
  203.         @combo_only = true
  204.       when YEA::REGEXP::SKILL::COMBO_SKILL
  205.         case $1.upcase
  206.         when "L"; @combo_skill[:L] = $2.to_i
  207.         when "R"; @combo_skill[:R] = $2.to_i
  208.         when "X"; @combo_skill[:X] = $2.to_i
  209.         when "Y"; @combo_skill[:Y] = $2.to_i
  210.         when "Z"; @combo_skill[:Z] = $2.to_i
  211.         else; next
  212.         end
  213.       when YEA::REGEXP::SKILL::COMBO_MAX
  214.         @combo_max = $1.to_i
  215.       when YEA::REGEXP::SKILL::COMBO_SPECIAL
  216.         @combo_special[$1.to_s.upcase] = $2.to_i
  217.       #---
  218.       end
  219.     } # self.note.split
  220.     #---
  221.   end
  222.   
  223. end # RPG::UsableItem

  224. #==============================================================================
  225. # ■ Game_Action
  226. #==============================================================================

  227. class Game_Action
  228.   
  229.   #--------------------------------------------------------------------------
  230.   # new method: set_input_combo_skill
  231.   #--------------------------------------------------------------------------
  232.   def set_input_combo_skill(skill_id)
  233.     set_skill(skill_id)
  234.     @target_index = subject.current_action.target_index
  235.     @input_combo_skill = true
  236.   end
  237.   
  238.   #--------------------------------------------------------------------------
  239.   # alias method: valid?
  240.   #--------------------------------------------------------------------------
  241.   alias game_action_valid_ics valid?
  242.   def valid?
  243.     subject.enable_input_combo(true) if @input_combo_skill
  244.     result = game_action_valid_ics
  245.     subject.enable_input_combo(false) if @input_combo_skill
  246.     return result
  247.   end
  248.   
  249. end # Game_Action

  250. #==============================================================================
  251. # ■ Game_BattlerBase
  252. #==============================================================================

  253. class Game_BattlerBase
  254.   
  255.   #--------------------------------------------------------------------------
  256.   # alias method: skill_conditions_met?
  257.   #--------------------------------------------------------------------------
  258.   alias game_battlerbase_skill_conditions_met_ics skill_conditions_met?
  259.   def skill_conditions_met?(skill)
  260.     return false if combo_skill_restriction?(skill)
  261.     return game_battlerbase_skill_conditions_met_ics(skill)
  262.   end
  263.   
  264.   #--------------------------------------------------------------------------
  265.   # new method: combo_skill_restriction?
  266.   #--------------------------------------------------------------------------
  267.   def combo_skill_restriction?(skill)
  268.     return false unless actor?
  269.     return false unless $game_party.in_battle
  270.     return false unless skill.combo_only
  271.     return !@input_combo_enabled
  272.   end
  273.   
  274.   #--------------------------------------------------------------------------
  275.   # alias method: hp=
  276.   #--------------------------------------------------------------------------
  277.   alias game_battlerbase_hpequals_ics hp=
  278.   def hp=(value)
  279.     game_battlerbase_hpequals_ics(value)
  280.     return unless SceneManager.scene_is?(Scene_Battle)
  281.     return unless actor?
  282.     return if value == 0
  283.     SceneManager.scene.refresh_input_combo_skill_window(self)
  284.   end
  285.   
  286.   #--------------------------------------------------------------------------
  287.   # alias method: mp=
  288.   #--------------------------------------------------------------------------
  289.   alias game_battlerbase_mpequals_ics mp=
  290.   def mp=(value)
  291.     game_battlerbase_mpequals_ics(value)
  292.     return unless SceneManager.scene_is?(Scene_Battle)
  293.     return unless actor?
  294.     return if value == 0
  295.     SceneManager.scene.refresh_input_combo_skill_window(self)
  296.   end
  297.   
  298.   #--------------------------------------------------------------------------
  299.   # alias method: tp=
  300.   #--------------------------------------------------------------------------
  301.   alias game_battlerbase_tpequals_ics tp=
  302.   def tp=(value)
  303.     game_battlerbase_tpequals_ics(value)
  304.     return unless SceneManager.scene_is?(Scene_Battle)
  305.     return unless actor?
  306.     return if value == 0
  307.     SceneManager.scene.refresh_input_combo_skill_window(self)
  308.   end
  309.   
  310. end # Game_BattlerBase

  311. #==============================================================================
  312. # ■ Game_Battler
  313. #==============================================================================

  314. class Game_Battler < Game_BattlerBase
  315.   
  316.   #--------------------------------------------------------------------------
  317.   # alias method: on_battle_start
  318.   #--------------------------------------------------------------------------
  319.   alias game_battler_on_battle_start_ics on_battle_start
  320.   def on_battle_start
  321.     game_battler_on_battle_start_ics
  322.     @input_combo_enabled = false
  323.   end
  324.   
  325.   #--------------------------------------------------------------------------
  326.   # alias method: on_battle_end
  327.   #--------------------------------------------------------------------------
  328.   alias game_battler_on_battle_end_ics on_battle_end
  329.   def on_battle_end
  330.     game_battler_on_battle_end_ics
  331.     @input_combo_enabled = false
  332.   end
  333.   
  334.   #--------------------------------------------------------------------------
  335.   # new method: enable_input_combo
  336.   #--------------------------------------------------------------------------
  337.   def enable_input_combo(active)
  338.     return unless actor?
  339.     @input_combo_enabled = active
  340.   end
  341.   
  342. end # Game_Battler

  343. #==============================================================================
  344. # ■ Window_ComboSkillList
  345. #==============================================================================

  346. class Window_ComboSkillList < Window_Base
  347.   
  348.   #--------------------------------------------------------------------------
  349.   # initialize
  350.   #--------------------------------------------------------------------------
  351.   def initialize
  352.     dw = [Graphics.width/2, 320].max
  353.     super(-12, 0, dw, fitting_height(7))
  354.     self.z = 200
  355.     self.opacity = 0
  356.     hide
  357.   end
  358.   
  359.   #--------------------------------------------------------------------------
  360.   # reveal
  361.   #--------------------------------------------------------------------------
  362.   def reveal(battler, skill)
  363.     [url=home.php?mod=space&uid=133701]@battler[/url] = battler
  364.     [url=home.php?mod=space&uid=260100]@skill[/url] = skill
  365.     @combo_skills = []
  366.     for key in skill.combo_skill
  367.       next if key[1].nil?
  368.       next if $data_skills[key[1]].nil?
  369.       @combo_skills.push($data_skills[key[1]])
  370.     end
  371.     return if @combo_skills == []
  372.     self.y = Graphics.height - fitting_height(4)
  373.     self.y -= fitting_height(@combo_skills.size + 2)
  374.     show
  375.     activate
  376.     refresh
  377.   end
  378.   
  379.   #--------------------------------------------------------------------------
  380.   # refresh_check
  381.   #--------------------------------------------------------------------------
  382.   def refresh_check(battler)
  383.     return if [url=home.php?mod=space&uid=133701]@battler[/url] != battler
  384.     refresh
  385.   end
  386.   
  387.   #--------------------------------------------------------------------------
  388.   # refresh
  389.   #--------------------------------------------------------------------------
  390.   def refresh
  391.     contents.clear
  392.     draw_background_colour
  393.     draw_horz_line(0)
  394.     draw_combo_title
  395.     draw_horz_line(@combo_skills.size * line_height)
  396.     draw_combo_skills
  397.   end
  398.   
  399.   #--------------------------------------------------------------------------
  400.   # draw_background_colour
  401.   #--------------------------------------------------------------------------
  402.   def draw_background_colour
  403.     dh = line_height * (@combo_skills.size + 2)
  404.     rect = Rect.new(0, 0, contents.width, dh)
  405.     back_colour1 = Color.new(0, 0, 0, 192)
  406.     back_colour2 = Color.new(0, 0, 0, 0)
  407.     contents.gradient_fill_rect(rect, back_colour1, back_colour2)
  408.   end
  409.   
  410.   #--------------------------------------------------------------------------
  411.   # draw_horz_line
  412.   #--------------------------------------------------------------------------
  413.   def draw_horz_line(dy)
  414.     line_y = dy + line_height - 2
  415.     line_colour = normal_color
  416.     line_colour.alpha = 48
  417.     contents.fill_rect(0, line_y, contents.width, 2, line_colour)
  418.   end
  419.   
  420.   #--------------------------------------------------------------------------
  421.   # draw_combo_title
  422.   #--------------------------------------------------------------------------
  423.   def draw_combo_title
  424.     reset_font_settings
  425.     text = YEA::INPUT_COMBO::COMBO_TITLE
  426.     contents.font.size = YEA::INPUT_COMBO::TITLE_SIZE
  427.     contents.font.bold = true
  428.     contents.font.italic = true
  429.     draw_text(12, 0, contents.width - 12, line_height, text)
  430.     reset_font_settings
  431.   end
  432.   
  433.   #--------------------------------------------------------------------------
  434.   # draw_combo_skills
  435.   #--------------------------------------------------------------------------
  436.   def draw_combo_skills
  437.     button_array = [:L, :R, :X, :Y, :Z]
  438.     dx = 24
  439.     dy = line_height
  440.     for button in button_array
  441.       next if @skill.combo_skill[button].nil?
  442.       combo_skill = $data_skills[@skill.combo_skill[button]]
  443.       text = text_setting(button, combo_skill)
  444.       text += sprintf("\eI[%d]", combo_skill.icon_index)
  445.       text += combo_skill.name
  446.       draw_text_ex(dx, dy, text)
  447.       dy += line_height
  448.     end
  449.   end
  450.   
  451.   #--------------------------------------------------------------------------
  452.   # text_setting
  453.   #--------------------------------------------------------------------------
  454.   def text_setting(button, skill)
  455.     text = ""
  456.     case button
  457.     when :L
  458.       if @battler.usable?(skill)
  459.         text = YEA::INPUT_COMBO::L_SKILL_ON
  460.       else
  461.         text = YEA::INPUT_COMBO::L_SKILL_OFF
  462.       end
  463.     when :R
  464.       if @battler.usable?(skill)
  465.         text = YEA::INPUT_COMBO::R_SKILL_ON
  466.       else
  467.         text = YEA::INPUT_COMBO::R_SKILL_OFF
  468.       end
  469.     when :X
  470.       if @battler.usable?(skill)
  471.         text = YEA::INPUT_COMBO::X_SKILL_ON
  472.       else
  473.         text = YEA::INPUT_COMBO::X_SKILL_OFF
  474.       end
  475.     when :Y
  476.       if @battler.usable?(skill)
  477.         text = YEA::INPUT_COMBO::Y_SKILL_ON
  478.       else
  479.         text = YEA::INPUT_COMBO::Y_SKILL_OFF
  480.       end
  481.     when :Z
  482.       if @battler.usable?(skill)
  483.         text = YEA::INPUT_COMBO::Z_SKILL_ON
  484.       else
  485.         text = YEA::INPUT_COMBO::Z_SKILL_OFF
  486.       end
  487.     end
  488.     return text
  489.   end
  490.   
  491. end # Window_ComboSkillList

  492. #==============================================================================
  493. # ■ Window_ComboInfo
  494. #==============================================================================

  495. class Window_ComboInfo < Window_Base
  496.   
  497.   #--------------------------------------------------------------------------
  498.   # initialize
  499.   #--------------------------------------------------------------------------
  500.   def initialize
  501.     super(0, 0, Graphics.width, fitting_height(1))
  502.     self.y = Graphics.height - fitting_height(4) - fitting_height(1)
  503.     self.opacity = 0
  504.     self.z = 200
  505.     @combos = []
  506.     @special = nil
  507.     hide
  508.   end
  509.   
  510.   #--------------------------------------------------------------------------
  511.   # reveal
  512.   #--------------------------------------------------------------------------
  513.   def reveal
  514.     @combos = []
  515.     @special = nil
  516.     refresh
  517.     show
  518.   end
  519.   
  520.   #--------------------------------------------------------------------------
  521.   # refresh
  522.   #--------------------------------------------------------------------------
  523.   def refresh
  524.     contents.clear
  525.     dx = draw_combo_icons
  526.     draw_special(dx)
  527.   end
  528.   
  529.   #--------------------------------------------------------------------------
  530.   # add_combo
  531.   #--------------------------------------------------------------------------
  532.   def add_combo(icon, special = nil)
  533.     @combos.push(icon)
  534.     @special = special
  535.     refresh
  536.   end
  537.   
  538.   #--------------------------------------------------------------------------
  539.   # draw_combo_icons
  540.   #--------------------------------------------------------------------------
  541.   def draw_combo_icons
  542.     dx = 0
  543.     for icon in @combos
  544.       draw_icon(icon, dx, 0)
  545.       dx += 24
  546.     end
  547.     return dx
  548.   end
  549.   
  550.   #--------------------------------------------------------------------------
  551.   # draw_special
  552.   #--------------------------------------------------------------------------
  553.   def draw_special(dx)
  554.     return if @special.nil?
  555.     draw_icon(@special.icon_index, dx + 12, 0)
  556.     colour = text_color(YEA::INPUT_COMBO::SPECIAL_SKILL_COLOUR)
  557.     change_color(colour)
  558.     draw_text(dx + 36, 0, contents.width, line_height, @special.name)
  559.   end
  560.   
  561. end # Window_ComboInfo

  562. #==============================================================================
  563. # ■ Scene_Battle
  564. #==============================================================================

  565. class Scene_Battle < Scene_Base
  566.   
  567.   #--------------------------------------------------------------------------
  568.   # alias method: create_all_windows
  569.   #--------------------------------------------------------------------------
  570.   alias scene_battle_create_all_windows_ics create_all_windows
  571.   def create_all_windows
  572.     scene_battle_create_all_windows_ics
  573.     create_combo_skill_window
  574.   end
  575.   
  576.   #--------------------------------------------------------------------------
  577.   # new method: create_combo_skill_window
  578.   #--------------------------------------------------------------------------
  579.   def create_combo_skill_window
  580.     @input_combo_skill_window = Window_ComboSkillList.new
  581.     @input_combo_info_window = Window_ComboInfo.new
  582.     @input_combo_skill_counter = 0
  583.   end
  584.   
  585.   #--------------------------------------------------------------------------
  586.   # alias method: use_item
  587.   #--------------------------------------------------------------------------
  588.   alias scene_battle_use_item_ics use_item
  589.   def use_item
  590.     @subject.enable_input_combo(true)
  591.     item = @subject.current_action.item
  592.     combo_skill_list_appear(true, item)
  593.     start_input_combo_skill_counter(item)
  594.     scene_battle_use_item_ics
  595.     loop do
  596.       break if break_input_combo?(item)
  597.       update_basic
  598.       update_combo_skill_queue
  599.     end
  600.     combo_skill_list_appear(false, item)
  601.     @subject.enable_input_combo(false)
  602.   end
  603.   
  604.   #--------------------------------------------------------------------------
  605.   # new method: combo_skill_list_appear
  606.   #--------------------------------------------------------------------------
  607.   def combo_skill_list_appear(visible, skill)
  608.     return if @subject.nil?
  609.     return unless @subject.actor?
  610.     return unless skill.is_a?(RPG::Skill)
  611.     return if visible && @input_combo_skill_window.visible
  612.     if visible
  613.       @break_combo = false
  614.       @current_combo_skill = skill
  615.       @total_combo_skills = 0
  616.       @combo_skill_queue = []
  617.       @combo_skill_string = ""
  618.       @input_combo_skill_window.reveal(@subject, skill)
  619.       @input_combo_info_window.reveal
  620.     else
  621.       @input_combo_skill_window.hide
  622.       @input_combo_info_window.hide
  623.       return if @subject.current_action.nil?
  624.       @subject.current_action.set_skill(@current_combo_skill.id)
  625.     end
  626.   end
  627.   
  628.   #--------------------------------------------------------------------------
  629.   # new method: refresh_input_combo_skill_window
  630.   #--------------------------------------------------------------------------
  631.   def refresh_input_combo_skill_window(battler)
  632.     return unless @input_combo_skill_window.visible
  633.     @input_combo_skill_window.refresh_check(battler)
  634.   end
  635.   
  636.   #--------------------------------------------------------------------------
  637.   # new method: start_input_combo_skill_counter
  638.   #--------------------------------------------------------------------------
  639.   def start_input_combo_skill_counter(skill)
  640.     return unless @input_combo_skill_window.visible
  641.     @input_combo_skill_counter = YEA::INPUT_COMBO::MINIMUM_TIME
  642.     bonus_time = skill.combo_max * YEA::INPUT_COMBO::TIME_PER_INPUT
  643.     @input_combo_skill_counter += bonus_time
  644.   end
  645.   
  646.   #--------------------------------------------------------------------------
  647.   # new method: break_input_combo?
  648.   #--------------------------------------------------------------------------
  649.   def break_input_combo?(item)
  650.     return true if @break_combo
  651.     return true if @current_combo_skill.nil?
  652.     return true if @current_combo_skill.combo_skill == {}
  653.     return false if @combo_skill_queue != []
  654.     return true if @total_combo_skills == @current_combo_skill.combo_max
  655.     return @input_combo_skill_counter <= 0
  656.   end
  657.   
  658.   #--------------------------------------------------------------------------
  659.   # new method: update_combo_skill_queue
  660.   #--------------------------------------------------------------------------
  661.   def update_combo_skill_queue
  662.     return if @combo_skill_queue == []
  663.     action = @combo_skill_queue.shift
  664.     if [email protected]?(action)
  665.       @break_combo = true
  666.       return
  667.     end
  668.     @subject.current_action.set_input_combo_skill(action.id)
  669.     @log_window.clear
  670.     execute_action
  671.   end
  672.   
  673.   #--------------------------------------------------------------------------
  674.   # alias method: update_basic
  675.   #--------------------------------------------------------------------------
  676.   alias scene_battle_update_basic_ics update_basic
  677.   def update_basic
  678.     scene_battle_update_basic_ics
  679.     update_input_combo_skill_counter
  680.     update_input_combo_skill_select
  681.   end
  682.   
  683.   #--------------------------------------------------------------------------
  684.   # new method: update_input_combo_skill_counter
  685.   #--------------------------------------------------------------------------
  686.   def update_input_combo_skill_counter
  687.     return if @input_combo_skill_counter == 0
  688.     @input_combo_skill_counter -= 1
  689.   end
  690.   
  691.   #--------------------------------------------------------------------------
  692.   # new method: update_input_combo_skill_select
  693.   #--------------------------------------------------------------------------
  694.   def update_input_combo_skill_select
  695.     return unless @input_combo_skill_window.visible
  696.     return if @total_combo_skills >= @current_combo_skill.combo_max
  697.     if Input.trigger?(:L)
  698.       check_input_combo_skill(:L)
  699.     elsif Input.trigger?(:R)
  700.       check_input_combo_skill(:R)
  701.     elsif Input.trigger?(:X)
  702.       check_input_combo_skill(:X)
  703.     elsif Input.trigger?(:Y)
  704.       check_input_combo_skill(:Y)
  705.     elsif Input.trigger?(:Z)
  706.       check_input_combo_skill(:Z)
  707.     end
  708.   end
  709.   
  710.   #--------------------------------------------------------------------------
  711.   # new method: check_input_combo_skill
  712.   #--------------------------------------------------------------------------
  713.   def check_input_combo_skill(button)
  714.     skill_id = @current_combo_skill.combo_skill[button]
  715.     return if skill_id.nil?
  716.     return if $data_skills[skill_id].nil?
  717.     case button
  718.     when :L; @combo_skill_string += "L"
  719.     when :R; @combo_skill_string += "R"
  720.     when :X; @combo_skill_string += "X"
  721.     when :Y; @combo_skill_string += "Y"
  722.     when :Z; @combo_skill_string += "Z"
  723.     end
  724.     if special_input_combo?
  725.       icon = $data_skills[skill_id].icon_index
  726.       @combo_skill_queue.push($data_skills[skill_id])
  727.       skill_id = @current_combo_skill.combo_special[@combo_skill_string]
  728.       combo_skill = $data_skills[skill_id]
  729.       @input_combo_info_window.add_combo(icon, combo_skill)
  730.       YEA::INPUT_COMBO::ACHIEVED_COMBO_SOUND.play
  731.       @total_combo_skills = @current_combo_skill.combo_max
  732.     else
  733.       YEA::INPUT_COMBO::INPUT_COMBO_SOUND.play
  734.       combo_skill = $data_skills[skill_id]
  735.       @input_combo_info_window.add_combo(combo_skill.icon_index)
  736.       @total_combo_skills += 1
  737.     end
  738.     @combo_skill_queue.push(combo_skill)
  739.     return unless @total_combo_skills == @current_combo_skill.combo_max
  740.     @input_combo_skill_counter = 0
  741.   end
  742.   
  743.   #--------------------------------------------------------------------------
  744.   # new method: special_input_combo?
  745.   #--------------------------------------------------------------------------
  746.   def special_input_combo?
  747.     combo_hash = @current_combo_skill.combo_special
  748.     return false unless combo_hash.include?(@combo_skill_string)
  749.     skill = $data_skills[combo_hash[@combo_skill_string]]
  750.     return @subject.skills.include?(skill)
  751.   end
  752.   
  753. end # Scene_Battle

  754. #==============================================================================
  755. #
  756. # ▼ End of File
  757. #
  758. #==============================================================================
复制代码
算了,不想那些不开心的事了!因为喜欢,所以才会去做,以后就不要再想“一步登天”了!Let it go!^_^

Lv1.梦旅人

梦石
0
星屑
53
在线时间
572 小时
注册时间
2011-4-1
帖子
749
2
 楼主| 发表于 2013-4-25 07:58:56 | 只看该作者
不要看了不说话!
哪怕吱一声也行啊!
算了,不想那些不开心的事了!因为喜欢,所以才会去做,以后就不要再想“一步登天”了!Let it go!^_^
回复 支持 反对

使用道具 举报

Lv5.捕梦者 (版主)

梦石
20
星屑
1840
在线时间
6925 小时
注册时间
2012-12-14
帖子
11485

短篇十战斗者组别冠军开拓者贵宾短篇九勇士组亚军

3
发表于 2013-4-25 11:12:56 | 只看该作者
这个是VA脚本吗
大家好,这里是晨露的说。请多多指教。
刚入门RM软件制作,请大家多多帮助我哦。
落雪君的欢乐像素教程,欢迎查阅。

回复 支持 反对

使用道具 举报

Lv1.梦旅人

梦石
0
星屑
50
在线时间
91 小时
注册时间
2008-7-27
帖子
165
4
发表于 2013-4-25 13:26:11 | 只看该作者
反正應該不是XP的……
……
欢迎光临百度——龙骑士鸣泣之时
http://tieba.baidu.com/f?kw=%C1% ... 9%C6%FC%D6%AE%CA%B1
回复 支持 反对

使用道具 举报

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

本版积分规则

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

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

GMT+8, 2024-12-25 14:46

Powered by Discuz! X3.1

© 2001-2013 Comsenz Inc.

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