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

Project1

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

[已经解决] 不懂就问,如何让强制战斗指令不再占用额外出手次数?

[复制链接]

Lv1.梦旅人

梦石
0
星屑
104
在线时间
22 小时
注册时间
2015-8-10
帖子
4
跳转到指定楼层
1
发表于 2017-11-9 17:00:01 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式

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

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

x
有时候想做出一些追击性的技能,但是发现所触发的其他技能会占用一次额外出手机会,即便你选择了其他动作但是一旦触发技能就等于无效了。怎么修改脚本可以做到不占用出手次数呢?

Lv3.寻梦者

梦石
0
星屑
2512
在线时间
215 小时
注册时间
2017-9-27
帖子
613
2
发表于 2017-11-12 19:51:04 | 只看该作者
复杂繁琐且不一定能用的土办法(不建议使用):首先,每个角色发动技能后(普攻、防御和技能实际都是技能,每个角色的普攻技能设置不一样的)公共事件开关打开X(X对应角色编号),每回合开始时各开关重置,强制战斗指令后加入条件分歧:当开关X(X对应角色编号)未打开时增加强制战斗指令角色一次额外行动次数。
好办法:用连招脚本或老鹰的回合结束后发动技能脚本。
  1. =begin
  2. #~ #==============================================================================
  3. #~ # ■ 装备/敌人战斗中回合结束时自动释放技能  by 老鹰
  4. #~ #------------------------------------------------------------------------------
  5. #~ #   - 新增在战斗中回合结束时,装备携带者/敌人的自动释放敌人
  6. #     (依旧会进行消耗,但不考虑是否足够)
  7. #   - 在装备/敌人栏备注内填入下式(可用空格或逗号分隔内部各项)(可重复填入多行)
  8. #      <Auto Skill: 技能id, 概率分子,概率分母, 条件>
  9. #        技能id :需要释放的技能的id号
  10. #        概率分子、概率分母(可选):释放的概率为 分子/分母,默认不填则为 1
  11. #        条件(可选):被eval后如果返回真,则可以释放,默认不填则为真
  12. #         注: 可用 s 代表 $game_switches, v 代表 $game_variables
  13. #   - 举例:
  14. #      在1号武器的备注栏里填入 <Auto Skill: 1, 1,2>,1号角色装备
  15. #        作用:1号角色在每个回合结束时,有1/2的概率对随机目标使用1号技能
  16. #      在2号敌人的备注栏里填入 <Auto Skill: 5, 1,5, $game_variables[1] > 5>
  17. #        作用:当1号变量大于5,2号敌人在每个回合结束时,有1/5的概率对随机目标使用5号技能
  18. #   - 实质:在战斗者回合结束时,处理装备备注中的指定技能的强制战斗行动
  19. #==============================================================================
  20. class Game_Battler < Game_BattlerBase
  21.   #--------------------------------------------------------------------------
  22.   # ● 获取需要提取自动技能的对象的数组
  23.   #--------------------------------------------------------------------------
  24.   def get_battler_auto_skill_notes_array
  25.     return equips if actor?
  26.     return [self] if enemy?
  27.     return []
  28.   end
  29.   #--------------------------------------------------------------------------
  30.   # ● 处理自动技能的释放
  31.   #--------------------------------------------------------------------------
  32.   def eagle_check_auto_skill
  33.     array = get_battler_auto_skill_notes_array
  34.     s = $game_switches
  35.     v = $game_variables
  36.     array.each do |a|
  37.       next if a == nil
  38.       a.note.split(/[\r\n]+/).each do |line|
  39.         line =~ /<Auto Skill:[ ,]*(\d+)[ ,]*(\d*)[ ,]*(\d*)[ ,]*(.*)>/
  40.         # $1 - 技能id  $2$3 - 概率  $4 - eval
  41.         next if $1 == nil
  42.         next if $4 != "" && eval($4) == false
  43.         p1 = $2 == "" ? 1 : $2.to_i
  44.         p2 = $3 == "" ? 1 : $3.to_i
  45.         next if rand > (p1 * 1.0 / p2)
  46.         force_action($1.to_i, -1)
  47.         BattleManager.force_action(self)
  48.       end
  49.     end
  50.   end
  51.   #--------------------------------------------------------------------------
  52.   # ● 战斗行动结束时的处理
  53.   #--------------------------------------------------------------------------
  54.   alias eagle_battler_auto_skill_on_action_end on_action_end
  55.   def on_action_end
  56.     eagle_battler_auto_skill_on_action_end
  57.     eagle_check_auto_skill
  58.   end
  59.   #--------------------------------------------------------------------------
  60.   # ● 回合结束处理
  61.   #--------------------------------------------------------------------------
  62.   alias eagle_battler_auto_skill_on_turn_end on_turn_end
  63.   def on_turn_end
  64.     eagle_battler_auto_skill_on_turn_end
  65.     eagle_check_auto_skill if OrderManager.top_unit.battler == self # 此处和轨迹行动条有问题
  66.     # 实际测试时变成每个行动(回合)结束时都会触发 而非自己回合结束时触发
  67.     # 可能原因:每一次一个人行动结束,所有人的回合结束处理都被调用?
  68.   end

  69. end
  70. =end
复制代码
  1. #==============================================================================
  2. #
  3. # ▼ Yanfly Engine Ace - Active Chain Skills v1.01
  4. # -- Last Updated: 2011.12.22
  5. # -- Level: Hard
  6. # -- Requires: n/a
  7. #
  8. #==============================================================================

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

  11. #==============================================================================
  12. # ▼ Updates
  13. # =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  14. # 2011.12.22 - Better updating speed for window.
  15. # 2011.12.18 - Started Script and Finished.
  16. #
  17. #==============================================================================
  18. # ▼ Introduction
  19. # =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  20. # 這腳本實現了主動連技的可能性,當帶有連技屬性的技能發動時,畫面左下方會出現
  21. # 可以連甚麼技的訊息列表,透過簡單QTE,能立刻發動下一招連技。理論上,只要有足夠
  22. # 的資源(MP, TP) 和連技屬性的設定,是可以無限連技的。
  23. #==============================================================================
  24. # ▼ Instructions
  25. # =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  26. # To install this script, open up your script editor and copy/paste this script
  27. # to an open slot below ▼ Materials/素材 but above ▼ Main. Remember to save.
  28. #
  29. # -----------------------------------------------------------------------------
  30. # 以下是要放進[技能][註]的東東
  31. # -----------------------------------------------------------------------------
  32. # <chain skill L: x>
  33. # <chain skill R: x>
  34. # <chain skill X: x>
  35. # <chain skill Y: x>
  36. # <chain skill Z: x>
  37. # 這個是給予可連技屬性的東東,X 是技能的編號, 013,102 之類的。放了進去就是代表
  38. # 此技能能連去編號XXX 的技能。當沒有設定時,如只設定了Skill X,Y,Z ,L和R 是不
  39. # 會在連技訊息列表中出現。而不夠資源如MP,TP 時,連技訊息列表中該技能就會黑掉。
  40. # <chain only>
  41. # 這個東東是令該技能在正常技能表中不能選擇,只能透過連技去發動。
  42. #==============================================================================
  43. # ▼ Compatibility
  44. # =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  45. # This script is made strictly for RPG Maker VX Ace. It is highly unlikely that
  46. # it will run with RPG Maker VX without adjusting.
  47. #
  48. # While this script doesn't interfere with Input Combo Skills, it will most
  49. # likely be unable to used in conjunction with Input Combo Skills. I will not
  50. # provide support for any errors that may occur from this, nor will I be
  51. # responsible for any damage doing this may cause your game.
  52. #
  53. #==============================================================================

  54. module YEA
  55.   module ACTIVE_CHAIN

  56.     #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  57.     # - Chain Skill Settings -
  58.     #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  59.     # Adjust general settings here. These settings adjust the sound effect
  60.     # played when an active skill is selected and what the minimum time window
  61.     # is for an active chain skill.
  62.     #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  63.     # 下面是連技成功時的音效,可改。
  64.     ACTIVE_SKILL_SOUND = RPG::SE.new("Raise2", 80, 100)

  65.     # 下面是設定連技訊息列表出現的時間長度,也就是QTE 的限時。
  66.     MINIMUM_TIME = 60

  67.     #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  68.     # - Chain Skill Text -
  69.     #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  70.     # 這裡是設定連技訊息列表內容的地方,除了Title 外,都可用text codes.
  71.     #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  72.     CHAIN_TITLE  = "追打技 "
  73.     TITLE_SIZE   = 25
  74.     L_SKILL_ON   = "\eC[17]击退\eC[0]: "
  75.     L_SKILL_OFF  = "\eC[7]击退: "
  76.     L_SKILL_ACT  = "\eC[17]击退: "
  77.     R_SKILL_ON   = "\eC[17]浮空\eC[0]: "
  78.     R_SKILL_OFF  = "\eC[7]浮空: "
  79.     R_SKILL_ACT  = "\eC[17]浮空: "
  80.     X_SKILL_ON   = "\eC[17]倒地\eC[0]: "
  81.     X_SKILL_OFF  = "\eC[7]倒地: "
  82.     X_SKILL_ACT  = "\eC[17]倒地: "
  83.     Y_SKILL_ON   = "\eC[17]恢复\eC[0]: "
  84.     Y_SKILL_OFF  = "\eC[7]恢复: "
  85.     Y_SKILL_ACT  = "\eC[17]恢复: "
  86.     Z_SKILL_ON   = "\eC[17]辅助\eC[0]: "
  87.     Z_SKILL_OFF  = "\eC[7]辅助: "
  88.     Z_SKILL_ACT  = "\eC[17]辅助: "

  89.   end # ACTIVE_CHAIN
  90. end # YEA

  91. #==============================================================================
  92. # ▼ Editting anything past this point may potentially result in causing
  93. # computer damage, incontinence, explosion of user's head, coma, death, and/or
  94. # halitosis so edit at your own risk.
  95. #==============================================================================

  96. module YEA
  97.   module REGEXP
  98.   module SKILL

  99.     CHAIN_ONLY  = /<(?:CHAIN_ONLY|chain only)>/i
  100.     CHAIN_SKILL = /<(?:CHAIN_SKILL|chain skill)[ ]([LRXYZ]):[ ](\d+)>/i

  101.   end # SKILL
  102.   end # REGEXP
  103. end # YEA

  104. #==============================================================================
  105. # ■ DataManager
  106. #==============================================================================

  107. module DataManager

  108.   #--------------------------------------------------------------------------
  109.   # alias method: load_database
  110.   #--------------------------------------------------------------------------
  111.   class <<self; alias load_database_acs load_database; end
  112.   def self.load_database
  113.     load_database_acs
  114.     load_notetags_acs
  115.   end

  116.   #--------------------------------------------------------------------------
  117.   # new method: load_notetags_acs
  118.   #--------------------------------------------------------------------------
  119.   def self.load_notetags_acs
  120.     for skill in $data_skills
  121.       next if skill.nil?
  122.       skill.load_notetags_acs
  123.     end
  124.   end

  125. end # DataManager

  126. #==============================================================================
  127. # ■ RPG::Skill
  128. #==============================================================================

  129. class RPG::Skill < RPG::UsableItem

  130.   #--------------------------------------------------------------------------
  131.   # public instance variables
  132.   #--------------------------------------------------------------------------
  133.   attr_accessor :chain_only
  134.   attr_accessor :chain_skill

  135.   #--------------------------------------------------------------------------
  136.   # common cache: load_notetags_acs
  137.   #--------------------------------------------------------------------------
  138.   def load_notetags_acs
  139.     @chain_only = false
  140.     @chain_skill = {}
  141.     #---
  142.     self.note.split(/[\r\n]+/).each { |line|
  143.       case line
  144.       #---
  145.       when YEA::REGEXP::SKILL::CHAIN_ONLY
  146.         @chain_only = true
  147.       when YEA::REGEXP::SKILL::CHAIN_SKILL
  148.         case $1.upcase
  149.         when "L"; @chain_skill[:L] = $2.to_i
  150.         when "R"; @chain_skill[:R] = $2.to_i
  151.         when "X"; @chain_skill[:X] = $2.to_i
  152.         when "Y"; @chain_skill[:Y] = $2.to_i
  153.         when "Z"; @chain_skill[:Z] = $2.to_i
  154.         else; next
  155.         end
  156.       #---
  157.       end
  158.     } # self.note.split
  159.     #---
  160.   end

  161. end # RPG::UsableItem

  162. #==============================================================================
  163. # ■ Game_Action
  164. #==============================================================================

  165. class Game_Action

  166.   #--------------------------------------------------------------------------
  167.   # new method: set_active_chain_skill
  168.   #--------------------------------------------------------------------------
  169.   def set_active_chain_skill(skill_id)
  170.     set_skill(skill_id)
  171.     @target_index = subject.current_action.target_index
  172.     @active_chain_skill = true
  173.   end

  174.   #--------------------------------------------------------------------------
  175.   # alias method: valid?
  176.   #--------------------------------------------------------------------------
  177.   alias game_action_valid_acs valid?
  178.   def valid?
  179.     subject.enable_active_chain(true) if @active_chain_skill
  180.     result = game_action_valid_acs
  181.     subject.enable_active_chain(false) if @active_chain_skill
  182.     return result
  183.   end

  184. end # Game_Action

  185. #==============================================================================
  186. # ■ Game_BattlerBase
  187. #==============================================================================

  188. class Game_BattlerBase

  189.   #--------------------------------------------------------------------------
  190.   # alias method: skill_conditions_met?
  191.   #--------------------------------------------------------------------------
  192.   alias game_battlerbase_skill_conditions_met_acs skill_conditions_met?
  193.   def skill_conditions_met?(skill)
  194.     return false if chain_skill_restriction?(skill)
  195.     return game_battlerbase_skill_conditions_met_acs(skill)
  196.   end

  197.   #--------------------------------------------------------------------------
  198.   # new method: chain_skill_restriction?
  199.   #--------------------------------------------------------------------------
  200.   def chain_skill_restriction?(skill)
  201.     return false unless actor?
  202.     return false unless $game_party.in_battle
  203.     return false unless skill.chain_only
  204.     return !@active_chain_enabled
  205.   end

  206.   #--------------------------------------------------------------------------
  207.   # alias method: hp=
  208.   #--------------------------------------------------------------------------
  209.   alias game_battlerbase_hpequals_acs hp=
  210.   def hp=(value)
  211.     game_battlerbase_hpequals_acs(value)
  212.     return unless SceneManager.scene_is?(Scene_Battle)
  213.     return unless actor?
  214.     return if value == 0
  215.     SceneManager.scene.refresh_active_chain_skill_window(self)
  216.   end

  217.   #--------------------------------------------------------------------------
  218.   # alias method: mp=
  219.   #--------------------------------------------------------------------------
  220.   alias game_battlerbase_mpequals_acs mp=
  221.   def mp=(value)
  222.     game_battlerbase_mpequals_acs(value)
  223.     return unless SceneManager.scene_is?(Scene_Battle)
  224.     return unless actor?
  225.     return if value == 0
  226.     SceneManager.scene.refresh_active_chain_skill_window(self)
  227.   end

  228.   #--------------------------------------------------------------------------
  229.   # alias method: tp=
  230.   #--------------------------------------------------------------------------
  231.   alias game_battlerbase_tpequals_acs tp=
  232.   def tp=(value)
  233.     game_battlerbase_tpequals_acs(value)
  234.     return unless SceneManager.scene_is?(Scene_Battle)
  235.     return unless actor?
  236.     return if value == 0
  237.     SceneManager.scene.refresh_active_chain_skill_window(self)
  238.   end

  239. end # Game_BattlerBase

  240. #==============================================================================
  241. # ■ Game_Battler
  242. #==============================================================================

  243. class Game_Battler < Game_BattlerBase

  244.   #--------------------------------------------------------------------------
  245.   # alias method: on_battle_start
  246.   #--------------------------------------------------------------------------
  247.   alias game_battler_on_battle_start_acs on_battle_start
  248.   def on_battle_start
  249.     game_battler_on_battle_start_acs
  250.     @active_chain_enabled = false
  251.   end

  252.   #--------------------------------------------------------------------------
  253.   # alias method: on_battle_end
  254.   #--------------------------------------------------------------------------
  255.   alias game_battler_on_battle_end_acs on_battle_end
  256.   def on_battle_end
  257.     game_battler_on_battle_end_acs
  258.     @active_chain_enabled = false
  259.   end

  260.   #--------------------------------------------------------------------------
  261.   # new method: enable_active_chain
  262.   #--------------------------------------------------------------------------
  263.   def enable_active_chain(active)
  264.     return unless actor?
  265.     @active_chain_enabled = active
  266.   end

  267.   #--------------------------------------------------------------------------
  268.   # new method: add_active_skill_chain
  269.   #--------------------------------------------------------------------------
  270.   def add_active_skill_chain(skill_id)
  271.     chain_skill = Game_Action.new(self)
  272.     chain_skill.set_active_chain_skill(skill_id)
  273.     @actions.insert(1, chain_skill)
  274.   end

  275. end # Game_Battler

  276. #==============================================================================
  277. # ■ Window_ChainSkillList
  278. #==============================================================================

  279. class Window_ChainSkillList < Window_Base

  280.   #--------------------------------------------------------------------------
  281.   # initialize
  282.   #--------------------------------------------------------------------------
  283.   def initialize
  284.     dw = [Graphics.width/2, 320].max
  285.     super(-standard_padding, 0, dw, fitting_height(6))
  286.     self.z = 200
  287.     self.opacity = 0
  288.     hide
  289.   end

  290.   #--------------------------------------------------------------------------
  291.   # reveal
  292.   #--------------------------------------------------------------------------
  293.   def reveal(battler, skill)
  294.     @battler = battler
  295.     @skill = skill
  296.     @chain_skills = []
  297.     for key in skill.chain_skill
  298.       next if key[1].nil?
  299.       next if $data_skills[key[1]].nil?
  300.       next unless @battler.skills.include?($data_skills[key[1]])
  301.       @chain_skills.push($data_skills[key[1]])
  302.     end
  303.     return if @chain_skills == []
  304.     self.y = Graphics.height - fitting_height(4)
  305.     self.y -= fitting_height(@chain_skills.size + 1)
  306.     show
  307.     activate
  308.     @enabled = true
  309.     refresh
  310.   end

  311.   #--------------------------------------------------------------------------
  312.   # button=
  313.   #--------------------------------------------------------------------------
  314.   def button=(button)
  315.     @button = button
  316.     @enabled = false
  317.     refresh unless @button.nil?
  318.   end

  319.   #--------------------------------------------------------------------------
  320.   # refresh_check
  321.   #--------------------------------------------------------------------------
  322.   def refresh_check(battler)
  323.     return if @battler != battler
  324.     refresh
  325.   end

  326.   #--------------------------------------------------------------------------
  327.   # refresh
  328.   #--------------------------------------------------------------------------
  329.   def refresh
  330.     @button = nil if @enabled
  331.     contents.clear
  332.     draw_background_colour
  333.     draw_horz_line(0)
  334.     draw_combo_title
  335.     draw_chain_skills
  336.   end

  337.   #--------------------------------------------------------------------------
  338.   # draw_background_colour
  339.   #--------------------------------------------------------------------------
  340.   def draw_background_colour
  341.     dh = line_height * (@chain_skills.size + 1)
  342.     rect = Rect.new(0, 0, contents.width, dh)
  343.     back_colour1 = Color.new(0, 0, 0, 192)
  344.     back_colour2 = Color.new(0, 0, 0, 0)
  345.     contents.gradient_fill_rect(rect, back_colour1, back_colour2)
  346.   end

  347.   #--------------------------------------------------------------------------
  348.   # draw_horz_line
  349.   #--------------------------------------------------------------------------
  350.   def draw_horz_line(dy)
  351.     line_y = dy + line_height - 2
  352.     line_colour = normal_color
  353.     line_colour.alpha = 48
  354.     contents.fill_rect(0, line_y, contents.width, 2, line_colour)
  355.   end

  356.   #--------------------------------------------------------------------------
  357.   # draw_combo_title
  358.   #--------------------------------------------------------------------------
  359.   def draw_combo_title
  360.     reset_font_settings
  361.     text = YEA::ACTIVE_CHAIN::CHAIN_TITLE
  362.     contents.font.size = YEA::ACTIVE_CHAIN::TITLE_SIZE
  363.     contents.font.bold = true
  364.     contents.font.italic = true
  365.     draw_text(12, 0, contents.width - 12, line_height, text)
  366.     reset_font_settings
  367.   end

  368.   #--------------------------------------------------------------------------
  369.   # draw_chain_skills
  370.   #--------------------------------------------------------------------------
  371.   def draw_chain_skills
  372.     button_array = [:L, :R, :X, :Y, :Z]
  373.     dx = 24
  374.     dy = line_height
  375.     for button in button_array
  376.       next if @skill.chain_skill[button].nil?
  377.       chain_skill = $data_skills[@skill.chain_skill[button]]
  378.       next unless @battler.skills.include?(chain_skill)
  379.       text = text_setting(button, chain_skill)
  380.       text += sprintf("\eI[%d]", chain_skill.icon_index)
  381.       text += chain_skill.name
  382.       draw_text_ex(dx, dy, text)
  383.       dy += line_height
  384.     end
  385.   end

  386.   #--------------------------------------------------------------------------
  387.   # text_setting
  388.   #--------------------------------------------------------------------------
  389.   def text_setting(button, skill)
  390.     active = button == @button
  391.     text = ""
  392.     case button
  393.     when :L
  394.       if @enabled && @battler.usable?(skill)
  395.         text = YEA::ACTIVE_CHAIN::L_SKILL_ON
  396.       elsif !@enabled && active
  397.         text = YEA::ACTIVE_CHAIN::L_SKILL_ACT
  398.       else
  399.         text = YEA::ACTIVE_CHAIN::L_SKILL_OFF
  400.       end
  401.     when :R
  402.       if @enabled && @battler.usable?(skill)
  403.         text = YEA::ACTIVE_CHAIN::R_SKILL_ON
  404.       elsif !@enabled && active
  405.         text = YEA::ACTIVE_CHAIN::R_SKILL_ACT
  406.       else
  407.         text = YEA::ACTIVE_CHAIN::R_SKILL_OFF
  408.       end
  409.     when :X
  410.       if @enabled && @battler.usable?(skill)
  411.         text = YEA::ACTIVE_CHAIN::X_SKILL_ON
  412.       elsif !@enabled && active
  413.         text = YEA::ACTIVE_CHAIN::X_SKILL_ACT
  414.       else
  415.         text = YEA::ACTIVE_CHAIN::X_SKILL_OFF
  416.       end
  417.     when :Y
  418.       if @enabled && @battler.usable?(skill)
  419.         text = YEA::ACTIVE_CHAIN::Y_SKILL_ON
  420.       elsif !@enabled && active
  421.         text = YEA::ACTIVE_CHAIN::Y_SKILL_ACT
  422.       else
  423.         text = YEA::ACTIVE_CHAIN::Y_SKILL_OFF
  424.       end
  425.     when :Z
  426.       if @enabled && @battler.usable?(skill)
  427.         text = YEA::ACTIVE_CHAIN::Z_SKILL_ON
  428.       elsif !@enabled && active
  429.         text = YEA::ACTIVE_CHAIN::Z_SKILL_ACT
  430.       else
  431.         text = YEA::ACTIVE_CHAIN::Z_SKILL_OFF
  432.       end
  433.     end
  434.     return text
  435.   end

  436. end # Window_ChainSkillList

  437. #==============================================================================
  438. # ■ Scene_Battle
  439. #==============================================================================

  440. class Scene_Battle < Scene_Base

  441.   #--------------------------------------------------------------------------
  442.   # alias method: create_all_windows
  443.   #--------------------------------------------------------------------------
  444.   alias scene_battle_create_all_windows_acs create_all_windows
  445.   def create_all_windows
  446.     scene_battle_create_all_windows_acs
  447.     create_chain_skill_window
  448.   end

  449.   #--------------------------------------------------------------------------
  450.   # new method: create_chain_skill_window
  451.   #--------------------------------------------------------------------------
  452.   def create_chain_skill_window
  453.     @active_chain_skill_window = Window_ChainSkillList.new
  454.     @active_chain_skill_counter = 0
  455.   end

  456.   #--------------------------------------------------------------------------
  457.   # alias method: use_item
  458.   #--------------------------------------------------------------------------
  459.   alias scene_battle_use_item_acs use_item
  460.   def use_item
  461.     @subject.enable_active_chain(true)
  462.     item = @subject.current_action.item
  463.     chain_skill_list_appear(true, item)
  464.     start_active_skill_counter(item)
  465.     scene_battle_use_item_acs
  466.     wait_active_skill_counter
  467.     chain_skill_list_appear(false, item)
  468.     @subject.enable_active_chain(false)
  469.   end

  470.   #--------------------------------------------------------------------------
  471.   # new method: chain_skill_list_appear
  472.   #--------------------------------------------------------------------------
  473.   def chain_skill_list_appear(visible, skill)
  474.     return if @subject.nil?
  475.     return unless @subject.actor?
  476.     return unless skill.is_a?(RPG::Skill)
  477.     @active_chain_skill = 0
  478.     @current_chain_skill = skill
  479.     @active_chain_skill_window.reveal(@subject, skill) if visible
  480.     @active_chain_skill_window.hide unless visible
  481.   end

  482.   #--------------------------------------------------------------------------
  483.   # new method: refresh_active_chain_skill_window
  484.   #--------------------------------------------------------------------------
  485.   def refresh_active_chain_skill_window(battler)
  486.     return unless @active_chain_skill_window.visible
  487.     @active_chain_skill_window.refresh_check(battler)
  488.   end

  489.   #--------------------------------------------------------------------------
  490.   # new method: start_active_skill_counter
  491.   #--------------------------------------------------------------------------
  492.   def start_active_skill_counter(skill)
  493.     return unless @active_chain_skill_window.visible
  494.     @active_chain_skill_counter = YEA::ACTIVE_CHAIN::MINIMUM_TIME
  495.   end

  496.   #--------------------------------------------------------------------------
  497.   # new method: wait_active_skill_counter
  498.   #--------------------------------------------------------------------------
  499.   def wait_active_skill_counter
  500.     return unless @active_chain_skill_window.visible
  501.     wait(@active_chain_skill_counter)
  502.   end

  503.   #--------------------------------------------------------------------------
  504.   # new method: update_active_chain_skill_counter
  505.   #--------------------------------------------------------------------------
  506.   def update_active_chain_skill_counter
  507.     return if @active_chain_skill_counter == 0
  508.     @active_chain_skill_counter -= 1
  509.   end

  510.   #--------------------------------------------------------------------------
  511.   # alias method: update_basic
  512.   #--------------------------------------------------------------------------
  513.   alias scene_battle_update_basic_acs update_basic
  514.   def update_basic
  515.     scene_battle_update_basic_acs
  516.     update_active_chain_skill_counter
  517.     update_active_chain_skill_select
  518.   end

  519.   #--------------------------------------------------------------------------
  520.   # new method: update_active_chain_skill_select
  521.   #--------------------------------------------------------------------------
  522.   def update_active_chain_skill_select
  523.     return unless @active_chain_skill_window.visible
  524.     return if @active_chain_skill > 0
  525.     if Input.press?(:L)
  526.       check_active_chain_skill(:L)
  527.     elsif Input.press?(:R)
  528.       check_active_chain_skill(:R)
  529.     elsif Input.press?(:X)
  530.       check_active_chain_skill(:X)
  531.     elsif Input.press?(:Y)
  532.       check_active_chain_skill(:Y)
  533.     elsif Input.press?(:Z)
  534.       check_active_chain_skill(:Z)
  535.     end
  536.   end

  537.   #--------------------------------------------------------------------------
  538.   # new method: check_active_chain_skill
  539.   #--------------------------------------------------------------------------
  540.   def check_active_chain_skill(button)
  541.     skill_id = @current_chain_skill.chain_skill[button]
  542.     return if skill_id.nil?
  543.     return if $data_skills[skill_id].nil?
  544.     chain_skill = $data_skills[skill_id]
  545.     return unless @subject.usable?(chain_skill)
  546.     return unless @subject.skills.include?(chain_skill)
  547.     @active_chain_skill_counter = 12
  548.     @active_chain_skill = skill_id
  549.     @active_chain_skill_window.button = button
  550.     YEA::ACTIVE_CHAIN::ACTIVE_SKILL_SOUND.play
  551.     @subject.add_active_skill_chain(skill_id)
  552.   end

  553. end # Scene_Battle

  554. #==============================================================================
  555. #
  556. # ▼ End of File
  557. #
  558. #==============================================================================
复制代码
浅尝辄止,宜乎众矣。
回复 支持 1 反对 0

使用道具 举报

Lv1.梦旅人

梦石
0
星屑
104
在线时间
22 小时
注册时间
2015-8-10
帖子
4
3
 楼主| 发表于 2017-11-22 16:44:04 | 只看该作者
刹那铃音 发表于 2017-11-12 19:51
复杂繁琐且不一定能用的土办法(不建议使用):首先,每个角色发动技能后(普攻、防御和技能实际都是技能, ...

今天才登陆看到回复,感谢提供思路和脚本!不胜感谢!

点评

互相勉励  发表于 2017-11-25 20:57
回复 支持 反对

使用道具 举报

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

本版积分规则

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

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

GMT+8, 2024-11-16 08:34

Powered by Discuz! X3.1

© 2001-2013 Comsenz Inc.

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