Project1

标题: 技能动画叠加 [打印本页]

作者: V5洛    时间: 2018-2-27 10:48
标题: 技能动画叠加
当释放1号技能动画时 能不能接连叠加2号技能动画
作者: chd114    时间: 2018-2-27 17:21
是1號技能動畫結束後播放2號技能動畫還是2個一起釋放?
作者: 刹那铃音    时间: 2018-2-27 19:05
问题描述不是很清晰,如果一起释放的话做一个不就好了吗,如果是结束后的话,连续技脚本设置一个花费0MP的技能可以伪实现这功能。
  1. #==============================================================================
  2. #
  3. # ▼ Yanfly Engine Ace - Follow-Up Skill v1.01
  4. # -- Last Updated: 2012.02.12
  5. # -- Level: Normal
  6. # -- Requires: n/a
  7. #
  8. #==============================================================================

  9. $imported = {} if $imported.nil?
  10. $imported["YEA-FollowUpSkill"] = true

  11. #==============================================================================
  12. # ▼ Updates
  13. # =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  14. # 2012.02.12 - Bug Fixed: Follow Up skills do not stack with multi-hits.
  15. # 2012.02.05 - Started Script and Finished.
  16. #
  17. #==============================================================================
  18. # ▼ Introduction
  19. # =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  20. # This script allows for follow-up skills when the skill lands a successful hit
  21. # (ie. no misses or evades). The script provides a chance to proceed with a
  22. # follow-up skill or a guaranteed follow-up skill provided that the prior skill
  23. # has successfully connected.
  24. #
  25. #==============================================================================
  26. # ▼ Instructions
  27. # =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  28. # To install this script, open up your script editor and copy/paste this script
  29. # to an open slot below ▼ Materials/素材 but above ▼ Main. Remember to save.
  30. #
  31. # -----------------------------------------------------------------------------
  32. # 技能备注栏填写:
  33. # -----------------------------------------------------------------------------
  34. # <follow up x>
  35. # 100%在指定技能释放后使用x技能.
  36. #
  37. # <follow up x: y%>
  38. #  y%在指定技能释放后使用x技能.
  39. #
  40. # <follow up state: x>
  41. # 指定技能需要x状态来触发连续技。
  42. # <follow up all states: x, y>
  43. # 指定技能需要x和y状态来触发连续技,少一个都不行。
  44. #
  45. # <follow up any states: x, y>
  46. # 指定技能需要x和y状态来触发连续技,有其中任意一个即可触发连续技。
  47. #
  48. # <follow up switch: x>
  49. # 指定技能需要开启开关x来触发连续技。
  50. # <follow up all switch: x, y>
  51. # 指定技能需要开启开关x和y来触发连续技,少一个都不行。
  52. #
  53. # <follow up any switch: x, y>
  54. # 指定技能需要开启x和y开关来触发连续技,有其中任意一个即可触发连续技。
  55. #
  56. # <follow up eval>
  57. #  string
  58. #  string
  59. # </follow up eval>
  60. # 提供给高级使用者的操作, 将 string 替换为自己需要设定的内容来确定连续技能的
  61. # 触发条件. 如果使用多行, 他们都会被视为一行.
  62. #
  63. #==============================================================================
  64. # ▼ Compatibility
  65. # =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  66. # This script is made strictly for RPG Maker VX Ace. It is highly unlikely that
  67. # it will run with RPG Maker VX without adjusting.
  68. #
  69. #==============================================================================
  70. # ▼ Editting anything past this point may potentially result in causing
  71. # computer damage, incontinence, explosion of user's head, coma, death, and/or
  72. # halitosis so edit at your own risk.
  73. #==============================================================================

  74. module YEA
  75.   module REGEXP
  76.   module SKILL
  77.    
  78.     FOLLOWUP = /<(?:FOLLOW_UP|follow up)[ ](\d+)>/i
  79.     FOLLOWUP_CHANCE = /<(?:FOLLOW_UP|follow up)[ ](\d+):[ ](\d+)([%%])>/i
  80.     FOLLOWUP_STATES =
  81.       /<(?:FOLLOW_UP_STATE|follow up state):[ ](\d+(?:\s*,\s*\d+)*)>/i
  82.     FOLLOWUP_ALL_STATES =
  83.       /<(?:FOLLOW_UP_ALL_STATES|follow up all states):[ ](\d+(?:\s*,\s*\d+)*)>/i
  84.     FOLLOWUP_ANY_STATES =
  85.       /<(?:FOLLOW_UP_ANY_STATES|follow up any states):[ ](\d+(?:\s*,\s*\d+)*)>/i
  86.     FOLLOWUP_SWITCH =
  87.       /<(?:FOLLOW_UP_SWITCH|follow up switch):[ ](\d+(?:\s*,\s*\d+)*)>/i
  88.     FOLLOWUP_ALL_SWITCH =
  89.       /<(?:FOLLOW_UP_ALL_SWITCH|follow up all switch):[ ](\d+(?:\s*,\s*\d+)*)>/i
  90.     FOLLOWUP_ANY_SWITCH =
  91.       /<(?:FOLLOW_UP_ANY_SWITCH|follow up any switch):[ ](\d+(?:\s*,\s*\d+)*)>/i
  92.     FOLLOWUP_EVAL_ON = /<(?:FOLLOW_UP_EVAL|follow up eval)>/i
  93.     FOLLOWUP_EVAL_OFF = /<\/(?:FOLLOW_UP_EVAL|follow up eval)>/i
  94.    
  95.   end # SKILL
  96.   end # REGEXP
  97. end # YEA

  98. #==============================================================================
  99. # ■ DataManager
  100. #==============================================================================

  101. module DataManager
  102.   
  103.   #--------------------------------------------------------------------------
  104.   # alias method: load_database
  105.   #--------------------------------------------------------------------------
  106.   class <<self; alias load_database_fus load_database; end
  107.   def self.load_database
  108.     load_database_fus
  109.     load_notetags_fus
  110.   end
  111.   
  112.   #--------------------------------------------------------------------------
  113.   # new method: load_notetags_fus
  114.   #--------------------------------------------------------------------------
  115.   def self.load_notetags_fus
  116.     for obj in $data_skills
  117.       next if obj.nil?
  118.       obj.load_notetags_fus
  119.     end
  120.   end
  121.   
  122. end # DataManager

  123. #==============================================================================
  124. # ■ RPG::BaseItem
  125. #==============================================================================

  126. class RPG::Skill < RPG::UsableItem
  127.   
  128.   #--------------------------------------------------------------------------
  129.   # public instance variables
  130.   #--------------------------------------------------------------------------
  131.   attr_accessor :follow_up
  132.   attr_accessor :follow_chance
  133.   attr_accessor :follow_states_all
  134.   attr_accessor :follow_states_any
  135.   attr_accessor :follow_switch_all
  136.   attr_accessor :follow_switch_any
  137.   attr_accessor :follow_eval
  138.   
  139.   #--------------------------------------------------------------------------
  140.   # common cache: load_notetags_fus
  141.   #--------------------------------------------------------------------------
  142.   def load_notetags_fus
  143.     @follow_up = 0
  144.     @follow_chance = 1.0
  145.     @follow_states_all = []
  146.     @follow_states_any = []
  147.     @follow_switch_all = []
  148.     @follow_switch_any = []
  149.     @follow_eval = ""
  150.     @follow_eval_on = false
  151.     #---
  152.     self.note.split(/[\r\n]+/).each { |line|
  153.       case line
  154.       #---
  155.       when YEA::REGEXP::SKILL::FOLLOWUP
  156.         @follow_up = $1.to_i
  157.         @follow_chance = 1.0
  158.       when YEA::REGEXP::SKILL::FOLLOWUP_CHANCE
  159.         @follow_up = $1.to_i
  160.         @follow_chance = $2.to_i * 0.01
  161.       #---
  162.       when YEA::REGEXP::SKILL::FOLLOWUP_STATES
  163.         $1.scan(/\d+/).each { |num|
  164.         @follow_states_all.push(num.to_i) if num.to_i > 0 }
  165.       when YEA::REGEXP::SKILL::FOLLOWUP_ALL_STATES
  166.         $1.scan(/\d+/).each { |num|
  167.         @follow_states_all.push(num.to_i) if num.to_i > 0 }
  168.       when YEA::REGEXP::SKILL::FOLLOWUP_ANY_STATES
  169.         $1.scan(/\d+/).each { |num|
  170.         @follow_states_any.push(num.to_i) if num.to_i > 0 }
  171.       #---
  172.       when YEA::REGEXP::SKILL::FOLLOWUP_SWITCH
  173.         $1.scan(/\d+/).each { |num|
  174.         @follow_switch_all.push(num.to_i) if num.to_i > 0 }
  175.       when YEA::REGEXP::SKILL::FOLLOWUP_ALL_SWITCH
  176.         $1.scan(/\d+/).each { |num|
  177.         @follow_switch_all.push(num.to_i) if num.to_i > 0 }
  178.       when YEA::REGEXP::SKILL::FOLLOWUP_ANY_SWITCH
  179.         $1.scan(/\d+/).each { |num|
  180.         @follow_switch_any.push(num.to_i) if num.to_i > 0 }
  181.       #---
  182.       when YEA::REGEXP::SKILL::FOLLOWUP_EVAL_ON
  183.         @follow_eval_on = true
  184.       when YEA::REGEXP::SKILL::FOLLOWUP_EVAL_OFF
  185.         @follow_eval_off = false
  186.       #---
  187.       else
  188.         @follow_eval += line.to_s if @follow_eval_on
  189.       end
  190.     } # self.note.split
  191.     #---
  192.   end
  193.   
  194. end # RPG::Skill

  195. #==============================================================================
  196. # ■ Game_Action
  197. #==============================================================================

  198. class Game_Action
  199.   
  200.   #--------------------------------------------------------------------------
  201.   # public instance variables
  202.   #--------------------------------------------------------------------------
  203.   attr_accessor :follow_up
  204.   
  205. end # Game_Action

  206. #==============================================================================
  207. # ■ Game_Battler
  208. #==============================================================================

  209. class Game_Battler < Game_BattlerBase
  210.   
  211.   #--------------------------------------------------------------------------
  212.   # alias method: item_user_effect
  213.   #--------------------------------------------------------------------------
  214.   alias game_battler_item_user_effect_fus item_user_effect
  215.   def item_user_effect(user, item)
  216.     game_battler_item_user_effect_fus(user, item)
  217.     user.process_follow_up_skill(item)
  218.   end
  219.   
  220.   #--------------------------------------------------------------------------
  221.   # new method: process_follow_up_skill
  222.   #--------------------------------------------------------------------------
  223.   def process_follow_up_skill(item)
  224.     return unless meet_follow_up_requirements?(item)
  225.     action = Game_Action.new(self)
  226.     action.set_skill(item.follow_up)
  227.     if current_action.nil?
  228.       action.decide_random_target
  229.     else
  230.       action.target_index = current_action.target_index
  231.     end
  232.     @actions.insert(1, action)
  233.     @actions[1].follow_up = true
  234.   end
  235.   
  236.   #--------------------------------------------------------------------------
  237.   # new method: meet_follow_up_requirements?
  238.   #--------------------------------------------------------------------------
  239.   def meet_follow_up_requirements?(item)
  240.     return false if item.nil?
  241.     return false unless item.is_a?(RPG::Skill)
  242.     return false if @actions[1] != nil && @actions[1].follow_up
  243.     return false if $data_skills[item.follow_up].nil?
  244.     return false unless follow_up_all_states?(item)
  245.     return false unless follow_up_any_states?(item)
  246.     return false unless follow_up_all_switch?(item)
  247.     return false unless follow_up_any_switch?(item)
  248.     return false unless follow_up_eval?(item)
  249.     return rand < item.follow_chance
  250.   end
  251.   
  252.   #--------------------------------------------------------------------------
  253.   # new method: follow_up_all_states?
  254.   #--------------------------------------------------------------------------
  255.   def follow_up_all_states?(item)
  256.     for state_id in item.follow_states_all
  257.       next if $data_states[state_id].nil?
  258.       return false unless state?(state_id)
  259.     end
  260.     return true
  261.   end
  262.   
  263.   #--------------------------------------------------------------------------
  264.   # new method: follow_up_any_states?
  265.   #--------------------------------------------------------------------------
  266.   def follow_up_any_states?(item)
  267.     return true if item.follow_states_any == []
  268.     for state_id in item.follow_states_any
  269.       next if $data_states[state_id].nil?
  270.       return true if state?(state_id)
  271.     end
  272.     return false
  273.   end
  274.   
  275.   #--------------------------------------------------------------------------
  276.   # new method: follow_up_all_switch?
  277.   #--------------------------------------------------------------------------
  278.   def follow_up_all_switch?(item)
  279.     for switch_id in item.follow_switch_all
  280.       return false unless $game_switches[switch_id]
  281.     end
  282.     return true
  283.   end
  284.   
  285.   #--------------------------------------------------------------------------
  286.   # new method: follow_up_any_switch?
  287.   #--------------------------------------------------------------------------
  288.   def follow_up_any_switch?(item)
  289.     return true if item.follow_switch_all == []
  290.     for switch_id in item.follow_switch_all
  291.       return true if $game_switches[switch_id]
  292.     end
  293.     return false
  294.   end
  295.   
  296.   #--------------------------------------------------------------------------
  297.   # new method: follow_up_eval?
  298.   #--------------------------------------------------------------------------
  299.   def follow_up_eval?(item)
  300.     return true if item.follow_eval == ""
  301.     return eval(item.follow_eval)
  302.   end
  303.   
  304. end # Game_Battler

  305. #==============================================================================
  306. #
  307. # ▼ End of File
  308. #
  309. #==============================================================================
复制代码

作者: V5洛    时间: 2018-2-28 09:52
刹那铃音 发表于 2018-2-27 19:05
问题描述不是很清晰,如果一起释放的话做一个不就好了吗,如果是结束后的话,连续技脚本设置一个花费0MP的 ...

谢谢  可以达到效果




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