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

Project1

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

[已经解决] 关于MOG战斗输入挑战脚本的使用问题(已解决)

[复制链接]

Lv3.寻梦者

梦石
0
星屑
1014
在线时间
120 小时
注册时间
2018-4-7
帖子
17
跳转到指定楼层
1
发表于 2019-1-19 16:43:33 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式

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

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

x
本帖最后由 2573881970 于 2019-4-20 23:51 编辑

想用这个脚本。明明已经对技能备注了,但战斗测试的时候却没有效果,求解。
RUBY 代码复制
  1. #==============================================================================
  2. # +++ MOG - 战斗输入挑战 (v3.3) +++
  3. #==============================================================================
  4. # By Moghunter
  5. # [url]https://atelierrgss.wordpress.com/[/url]
  6. #==============================================================================
  7. # 在技能发动之前可以设定一个输入挑战,全部输入正确后才能施放技能.
  8. #==============================================================================
  9. # 需要以下图片,放在 Graphics/System/
  10. #
  11. # Chain_Command.png
  12. # Chain_Battle_Layout.png
  13. # Chain_Battle_Meter.png
  14. #
  15. #==============================================================================
  16. # 使用方法
  17. #==============================================================================
  18. # 技能备注:
  19. #
  20. # <Chain Action = X>
  21. #
  22. # X - 技能ID
  23. #==============================================================================
  24.  
  25. #==============================================================================
  26. # ● Histórico (Version History)
  27. #==============================================================================
  28. # v3.3 - Melhoria na compatibilidade com MOG Battle Camera
  29. # v3.2 - Compatibilidade com MOG Sprite Actor.
  30. # v3.1 - Compatibilidade com MOG Battle Camera.
  31. # v3.0 - Adição de comandos aleatórios.
  32. # v2.9 - Correção do bug de não ocultar a janela com MOG ATB.
  33. # v2.8 - Melhoria na codificação.
  34. #==============================================================================
  35.  
  36. $imported = {} if $imported.nil?
  37. $imported[:mog_active_chain] = true
  38.  
  39. module MOG_CHAIN_ACTIONS
  40. #=============================================================================
  41. # CHAIN_ACTIONS = { 技能ID => [按键顺序] }
  42. #
  43. # 技能ID = 数据库中的技能ID.
  44. # 按键顺序 = 设定按键顺序
  45. #        (以下为全部可用按键)   
  46. #  
  47. # "Down" ,"Up" ,"Left" ,"Right" ,"Shift" ,"D" ,"S" ,"A" ,"Z" ,"X" ,"Q" ,"W",
  48. # "Random"
  49. #
  50. # 例子:
  51. #
  52. # CHAIN_ACTIONS = {
  53. # 25=>["Down","D","S","Right"],
  54. # 59=>["Down","Up","Left","Right","Shift","D","S","A","Z","X","Q","W"],
  55. # 80=>["Shift","D"]
  56. # }
  57. #==============================================================================  
  58. CHAIN_ACTIONS = {
  59. 29=>["Random","Random","Random","Random"],
  60. 52=>["Up","Down","Left","Right","Z"],
  61. 70=>["X","Right","Left","Z","Z"],
  62. 138=>["Random"],
  63. 139=>["Random","Random"],
  64. 140=>["Random","Random","Random"],
  65. #138=>["X"],
  66. #139=>["A","S"],
  67. #140=>["Z","D","X"],
  68. 141=>["Up","Down"],
  69. 142=>["Left","Right","Z"],
  70. 999=>["Left","Right","Left","Right","Left","Right","Q","Z","Up","A","S",
  71.       "Down","D","Z","Right","Up","Up","Z","W","Left","Down","D","A","W"]
  72. }  
  73. #设置随机指令.
  74. RANDOM_KEYS = ["Left","Right","Up","Down","D","S","A","Z","X"]
  75. #默认按键的等待时间(玩家需要正确按下的时间).
  76. CHAIN_DEFAULT_INPUT_DURATION = 60 #60帧 = 1s
  77. #指定按键的等待时间
  78. CHAIN_INPUT_DURATION = {
  79. 138=>60,
  80. 139=>40,
  81. 140=>30
  82. #141=>160,
  83. #240=>2000
  84. }
  85.  
  86. #正确点击时的音效.
  87. CHAIN_RIGHT_SE = "Chime1"
  88. #错误点击时的音效.
  89. CHAIN_WRONG_SE = "Buzzer1"
  90. #输入挑战开始时播放的音效.
  91. CHAIN_START_SE = "Open1"
  92. #输入挑战精灵的位置.
  93. CHAIN_SPRITE_POSITION = [0,-15]
  94. #输入挑战图片的位置
  95. CHAIN_LAYOUT_POSITION = [1,-7]
  96. #进度条图片的位置
  97. CHAIN_METER_POSITION = [0,-6]
  98. #图标的位置
  99. CHAIN_ICON_POSITION = [0,-32]
  100. #输入挑战开始时显示的文字.
  101. CHAIN_COMMAND_WORD = "输入挑战!"
  102. #未命中和时间结束的文字
  103. CHAIN_MISSED_WORDS = ["未命中!", "时间结束"]
  104. #文字位置
  105. CHAIN_COMMAND_WORD_POSITION = [0,0]
  106. #文字大小
  107. CHAIN_WORD_FONT_SIZE = 20
  108. #文字颜色
  109. CHAIN_WORD_FONT_COLOR = Color.new(255,255,255)
  110. #文字Z坐标
  111. CHAIN_SPRITE_Z = 150
  112. end
  113.  
  114. #==============================================================================
  115. # ■ Game Temp
  116. #==============================================================================
  117. class Game_Temp
  118.   attr_accessor :chain_actions
  119.   attr_accessor :active_chain
  120.   attr_accessor :chain_ot
  121.   attr_accessor :chain_action_phase
  122.   #--------------------------------------------------------------------------
  123.   # ● Initialize
  124.   #--------------------------------------------------------------------------      
  125.   alias mog_chain_actions_initialize initialize
  126.   def initialize
  127.       @chain_actions = [0,0,0,false] ; @active_chain = false
  128.       @chain_action_phase = false
  129.       mog_chain_actions_initialize
  130.   end
  131.  
  132. end
  133.  
  134. #==============================================================================
  135. # ■ Scene_Battle
  136. #==============================================================================
  137. class Scene_Battle < Scene_Base
  138.  
  139.   #--------------------------------------------------------------------------
  140.   # ● Use Item
  141.   #--------------------------------------------------------------------------  
  142.   alias mog_chain_actions_use_item use_item
  143.   def use_item
  144.       prepare_chain_command if can_use_chain_commands?
  145.       mog_chain_actions_use_item
  146.       execute_chain_actions if can_use_chain_commands?
  147.   end  
  148.  
  149.   #--------------------------------------------------------------------------
  150.   # ● Can Use Chain Commands
  151.   #--------------------------------------------------------------------------  
  152.   def can_use_chain_commands?
  153.       return false if @subject == nil
  154.       return false if !@subject.is_a?(Game_Actor)
  155.       return false if @subject.restriction != 0
  156.       return true
  157.   end
  158.  
  159.   #--------------------------------------------------------------------------
  160.   # ● Prepare Chain Commands
  161.   #--------------------------------------------------------------------------  
  162.   def prepare_chain_command
  163.       @chain_skill_original = @subject.current_action.item rescue nil
  164.       if $game_temp.chain_ot == nil and @subject.is_a?(Game_Actor)
  165.          targets = @subject.current_action.make_targets.compact
  166.          $game_temp.chain_ot = targets[0]
  167.       end
  168.       check_chain_targets  
  169.   end
  170.  
  171.   #--------------------------------------------------------------------------
  172.   # ● Check Chain Command Position
  173.   #--------------------------------------------------------------------------      
  174.   def check_chain_command_position
  175.       scx = $game_temp.chain_ot.screen_x rescue nil
  176.       return if scx == nil
  177.       if $game_temp.chain_ot != nil and !$game_temp.chain_ot.dead?
  178.          $game_temp.chain_actions = [$game_temp.chain_ot.screen_x,$game_temp.chain_ot.screen_y,true]
  179.       end   
  180.   end
  181.  
  182.   #--------------------------------------------------------------------------
  183.   # ● Check Chain Targets
  184.   #--------------------------------------------------------------------------   
  185.   def check_chain_targets
  186.       return if @subject == nil or $game_temp.chain_ot == nil
  187.       if [1,7,9,10,11].include?(@subject.current_action.item.scope)
  188.          @pre_target = $game_temp.chain_ot ; @pre_target_hp = $game_temp.chain_ot.hp
  189.       else   
  190.          @pre_target = nil ; @pre_target_hp = nil
  191.       end  
  192.   end
  193.  
  194.   #--------------------------------------------------------------------------
  195.   # ● Execute Chain Actions
  196.   #--------------------------------------------------------------------------  
  197.   def execute_chain_actions
  198.       $game_temp.active_chain = false
  199.       return if !can_execute_chain_actions_base?
  200.       check_chain_command_position
  201.       skill = @subject.current_action.item rescue nil
  202.       skill = @chain_skill_original rescue nil
  203.       action_id = skill.note =~ /<Chain Action = (\d+)>/i ? $1.to_i : nil rescue nil
  204.       return if action_id == nil or action_id < 1      
  205.       chain_command_sequence = MOG_CHAIN_ACTIONS::CHAIN_ACTIONS[action_id].dup rescue nil
  206.       $game_temp.chain_actions[2] = action_id   
  207.       if can_execute_chain_sequence?(chain_command_sequence,action_id)
  208.          chain_act_before_action if @chain_command == nil
  209.          chain_sq = Chain_Actions.new(chain_command_sequence,$game_temp.chain_actions)
  210.          loop do
  211.               $game_temp.chain_action_phase = true
  212.               (chain_sq.update($game_temp.chain_ot) ; Input.update) unless @spriteset.animation?
  213.               $game_temp.active_chain = true ; chain_sq.update_skill_name
  214.               @spriteset.update ; Graphics.update ; update_info_viewport
  215.               break if chain_sq.phase == 9
  216.          end
  217.          @subject.wp_animation = [true,chain_sq.success] if $imported[:mog_sprite_actor]
  218.          action_id = nil if !chain_sq.success or $game_temp.chain_ot.dead?
  219.          chain_sq.dispose ; set_chain_skill(action_id) if action_id != nil         
  220.       end
  221.       $game_temp.active_chain = false ; $game_temp.chain_ot = nil
  222.       $game_temp.chain_action_phase = false
  223.   end
  224.  
  225.   #--------------------------------------------------------------------------
  226.   # ● Chain Act Before Action
  227.   #--------------------------------------------------------------------------  
  228.   def chain_act_before_action
  229.       @chain_command = true ; @bb_cursor
  230.       if $imported[:mog_battle_cursor]
  231.          @bb_cursor =  $game_temp.battle_cursor[2]
  232.          $game_temp.battle_cursor[2] = false
  233.       end
  234.       if $imported[:mog_menu_cursor]   
  235.          @chain_curor_x = $game_temp.menu_cursor[2]
  236.          $game_temp.menu_cursor[2] = -999
  237.          force_cursor_visible(false)
  238.       end
  239.       if $imported[:mog_atb_system]
  240.          record_window_data if @wd_rec.nil?
  241.          hide_base_window
  242.          @wd_rec = true
  243.       end      
  244.   end     
  245.  
  246.   #--------------------------------------------------------------------------
  247.   # ● Turn End
  248.   #--------------------------------------------------------------------------  
  249.   alias mog_chain_command_process_action_end process_action_end
  250.   def process_action_end
  251.       mog_chain_command_process_action_end
  252.       chain_act_after_action
  253.   end
  254.  
  255.   #--------------------------------------------------------------------------
  256.   # ● Chain Act After ACtion
  257.   #--------------------------------------------------------------------------  
  258.   def chain_act_after_action
  259.       @chain_skill_original = nil
  260.       $game_temp.chain_ot = nil
  261.       return if @chain_command == nil
  262.       restore_window_data if $imported[:mog_atb_system]
  263.       $game_temp.menu_cursor[2] = @chain_curor_x if $imported[:mog_menu_cursor]
  264.       $game_temp.battle_cursor[2] = @bb_cursor if @bb_cursor != nil
  265.       @chain_command = nil      
  266.   end   
  267.  
  268.   #--------------------------------------------------------------------------
  269.   # ● Set Chain Skill
  270.   #--------------------------------------------------------------------------  
  271.   def set_chain_skill(action_id)
  272.       return if action_id == nil
  273.       @subject.input.set_skill(action_id)
  274.       $game_temp.chain_actions = [0,0,0,false] ; execute_action   
  275.   end
  276.  
  277.   #--------------------------------------------------------------------------
  278.   # ● Can Execute Chain Sequence?
  279.   #--------------------------------------------------------------------------  
  280.   def can_execute_chain_sequence?(chain_command_sequence = nil,action_id = nil)
  281.       return false if chain_command_sequence == nil
  282.       skill = $data_skills[action_id] rescue nil
  283.       return false if skill == nil
  284.       return false if $game_temp.chain_ot == nil or $game_temp.chain_ot.dead?
  285.       if [9,10].include?(skill.scope)
  286.          $game_party.battle_members.each do |i| return true if i.dead? end
  287.          return false
  288.       end
  289.       return true
  290.   end
  291.  
  292.   #--------------------------------------------------------------------------
  293.   # ● Can Execute Chain Actions Base
  294.   #--------------------------------------------------------------------------   
  295.   def can_execute_chain_actions_base?
  296.       return false if @subject == nil or @subject.dead?
  297.       return false if $game_temp.chain_ot == nil or $game_temp.chain_ot.dead?
  298.       return false if @subject.is_a?(Game_Enemy)
  299.       return false if @subject.current_action == nil
  300.       @subject.states.each do |i| return false if i.restriction > 0 end
  301.       return false if $game_party.members.empty?
  302.       return false if $game_party.all_dead?
  303.       return false if $game_troop.all_dead?
  304.       if @pre_target != nil and $game_temp.chain_ot.hp == @pre_target_hp
  305.          return false if $game_temp.chain_ot.result.missed
  306.          return false if $game_temp.chain_ot.result.evaded
  307.       end
  308.       return true
  309.   end
  310.  
  311.   #--------------------------------------------------------------------------
  312.   # ● Turn End
  313.   #--------------------------------------------------------------------------   
  314.   alias mog_chain_command_turn_end turn_end
  315.   def turn_end
  316.       mog_chain_command_turn_end
  317.       @wd_rec = nil
  318.   end
  319.  
  320. end
  321.  
  322. #==============================================================================
  323. # ■ Game Temp
  324. #==============================================================================
  325. class Game_Temp
  326.  
  327.   attr_accessor :cache_active_chain
  328.  
  329.   #--------------------------------------------------------------------------
  330.   # ● Initialize
  331.   #--------------------------------------------------------------------------   
  332.   alias mog_active_chain_initialize initialize
  333.   def initialize
  334.       mog_active_chain_initialize
  335.       cache_act_chain
  336.   end  
  337.  
  338.   #--------------------------------------------------------------------------
  339.   # ● Cache Act Chain
  340.   #--------------------------------------------------------------------------      
  341.   def cache_act_chain
  342.       @cache_active_chain = []
  343.       @cache_active_chain.push(Cache.system("IconSet"))
  344.       @cache_active_chain.push(Cache.system("Chain_Battle_Layout"))
  345.       @cache_active_chain.push(Cache.system("Chain_Battle_Meter"))
  346.       @cache_active_chain.push(Cache.system("Chain_Battle_Command"))
  347.   end
  348.  
  349. end
  350.  
  351. #==============================================================================
  352. # ■ Spriteset Battle
  353. #==============================================================================
  354. class Spriteset_Battle
  355.  
  356.   #--------------------------------------------------------------------------
  357.   # ● Initialize
  358.   #--------------------------------------------------------------------------   
  359.   alias mog_active_chain_commands_initialize initialize
  360.   def initialize
  361.       $game_temp.cache_act_chain ; $game_temp.active_chain = false
  362.       $game_temp.chain_ot = nil
  363.       mog_active_chain_commands_initialize      
  364.   end
  365. end   
  366.  
  367. #==============================================================================
  368. # ■ Chain Actions
  369. #==============================================================================
  370. class Chain_Actions
  371.  
  372.   include MOG_CHAIN_ACTIONS
  373.  
  374.   attr_accessor :phase
  375.   attr_accessor :success
  376.  
  377.   #--------------------------------------------------------------------------
  378.   # ● Initialize
  379.   #--------------------------------------------------------------------------   
  380.   def initialize(sequence,chain_temp)
  381.       $game_temp.chain_actions[3] = true
  382.       @chain_command_original = sequence.dup
  383.       @chain_command = sequence
  384.       random_sequence
  385.       @x = chain_temp[0] + CHAIN_SPRITE_POSITION[0]
  386.       @y = chain_temp[1] + CHAIN_SPRITE_POSITION[1]
  387.       @y = (Graphics.height - 36) if @y > (Graphics.height - 36)
  388.       @y = 0 if @y < 0
  389.       @skill = $data_skills[chain_temp[2]]
  390.       @skillname = @skill.name
  391.  
  392.       if CHAIN_INPUT_DURATION[chain_temp[2]] != nil
  393.          @duration = [CHAIN_INPUT_DURATION[chain_temp[2]],CHAIN_INPUT_DURATION[chain_temp[2]]]
  394.       else   
  395.          @duration = [CHAIN_DEFAULT_INPUT_DURATION, CHAIN_DEFAULT_INPUT_DURATION]
  396.       end  
  397.       @phase = 0 ; @success = false ; @com = 0 ; @com_index = 0
  398.       @initial_wait = 1 ; @wrong_commnad = [false,0,0]
  399.       Audio.se_play("Audio/SE/" + CHAIN_START_SE, 100, 100) rescue nil
  400.       create_button_sprite ; create_skill_name ; create_icon ; create_meter
  401.       set_opacity(0)
  402.   end
  403.  
  404.   #--------------------------------------------------------------------------
  405.   # ● Random Sequence
  406.   #--------------------------------------------------------------------------   
  407.   def random_sequence
  408.       @chain_command_original.each_with_index do |c, i|
  409.       next if c != "Random"
  410.       k = rand(RANDOM_KEYS.size) ; @chain_command[i] = RANDOM_KEYS[k]
  411.       end
  412.   end
  413.  
  414.   #--------------------------------------------------------------------------
  415.   # ● Create Icon
  416.   #--------------------------------------------------------------------------      
  417.   def create_icon
  418.       @icon_image = $game_temp.cache_active_chain[0]
  419.       @icon_sprite = Sprite.new ; @icon_sprite.bitmap = Bitmap.new(24,24)
  420.       @icon_sprite.z = CHAIN_SPRITE_Z + 1
  421.       @org_x2 = @x - 12 +  CHAIN_ICON_POSITION[0] - @center
  422.       @icon_sprite.x = @org_x2 - 50
  423.       @icon_sprite.y = @y +  CHAIN_ICON_POSITION[1]     
  424.       icon_rect = Rect.new(@skill.icon_index % 16 * 24, @skill.icon_index / 16 * 24, 24, 24)
  425.       @icon_sprite.bitmap.blt(0,0, @icon_image, icon_rect)
  426.   end
  427.  
  428.   #--------------------------------------------------------------------------
  429.   # ● Create Meter
  430.   #--------------------------------------------------------------------------        
  431.   def create_meter
  432.       @meter_layout = Sprite.new
  433.       @meter_layout.bitmap = $game_temp.cache_active_chain[1]
  434.       @meter_layout.z = CHAIN_SPRITE_Z
  435.       @meter_layout.x = @x - (@meter_layout.width / 2) + CHAIN_LAYOUT_POSITION[0]
  436.       @meter_layout.y = @y + CHAIN_LAYOUT_POSITION[1]
  437.       @meter_image = $game_temp.cache_active_chain[2]
  438.       @meter_cw = @meter_image.width ; @meter_ch = @meter_image.height
  439.       @meter = Sprite.new
  440.       @meter.bitmap = Bitmap.new(@meter_image.width, @meter_image.height)
  441.       @meter.z = CHAIN_SPRITE_Z + 1
  442.       @meter.x = @x - (@meter_image.width / 2) + CHAIN_METER_POSITION[0]
  443.       @meter.y = @y + CHAIN_METER_POSITION[1]
  444.       @meter.visible = false ; @meter_layout.visible = false ; update_meter
  445.   end
  446.  
  447.   #--------------------------------------------------------------------------
  448.   # ● Update Meter
  449.   #--------------------------------------------------------------------------         
  450.   def update_meter
  451.       return if @meter == nil
  452.       @meter.bitmap.clear ; range = @meter_cw * @duration[0] / @duration[1]
  453.       m_scr = Rect.new(0,0,range,@meter_ch )
  454.       @meter.bitmap.blt(0,0, @meter_image ,m_scr)
  455.   end
  456.  
  457.   #--------------------------------------------------------------------------
  458.   # ● Initialize
  459.   #--------------------------------------------------------------------------      
  460.   def create_skill_name
  461.       @skill_name = Sprite.new ; @skill_name.bitmap = Bitmap.new(200,32)
  462.       @skill_name.bitmap.font.size = CHAIN_WORD_FONT_SIZE
  463.       @skill_name.bitmap.font.color = CHAIN_WORD_FONT_COLOR
  464.       @skill_name.z = CHAIN_SPRITE_Z
  465.       @skill_name.y = @y - 32 + CHAIN_COMMAND_WORD_POSITION[1]
  466.       refresh_skill_name
  467.   end
  468.  
  469.   #--------------------------------------------------------------------------
  470.   # ● Refresh Skill Name
  471.   #--------------------------------------------------------------------------        
  472.   def refresh_skill_name
  473.       cm = @skillname.to_s.split(//).size
  474.       @center = ((200 / @skill_name.bitmap.font.size) * cm / 2) + 5
  475.       @org_x = @x - (@button_cw / 2) - 85 + CHAIN_COMMAND_WORD_POSITION[0]
  476.       @skill_name.x = @org_x - 50
  477.       @skill_name.bitmap.draw_text(0,0,200,32,@skillname.to_s,1)  
  478.   end
  479.  
  480.   #--------------------------------------------------------------------------
  481.   # ● Create Button Sprite
  482.   #--------------------------------------------------------------------------      
  483.   def create_button_sprite
  484.       @button_image = $game_temp.cache_active_chain[3]
  485.       @button_cw = @button_image.width / 13 ; @button_ch = @button_image.height
  486.       @button_sprite = Sprite.new
  487.       @button_sprite.bitmap = Bitmap.new(@button_cw,@button_ch)
  488.       @button_sprite.z = CHAIN_SPRITE_Z + 1
  489.       @button_sprite.ox = @button_cw / 2 ; @button_sprite.oy = @button_ch / 2
  490.       @button_sprite_oxy = [@button_sprite.ox,@button_sprite.oy]
  491.       @button_sprite.x = @x + @button_sprite.ox - (@button_cw / 2)
  492.       @button_sprite.y = @y + @button_sprite.oy      
  493.   end
  494.  
  495.   #--------------------------------------------------------------------------
  496.   # ● Refresh Button Command
  497.   #--------------------------------------------------------------------------        
  498.   def refresh_button_command
  499.       return if @button_sprite == nil
  500.       @duration[0] = @duration[1]
  501.       command_list_check(@chain_command[@com_index])  
  502.       @button_sprite.bitmap.clear
  503.       button_scr = Rect.new(@com * @button_cw , 0,@button_cw,@button_ch)
  504.       @button_sprite.bitmap.blt(0,0,@button_image,button_scr)
  505.       @button_sprite.zoom_x = 1.3 ; @button_sprite.zoom_y = 1.3   
  506.       @button_sprite.opacity = 255
  507.   end
  508.  
  509.   #--------------------------------------------------------------------------
  510.   # ● Dispose
  511.   #--------------------------------------------------------------------------      
  512.   def dispose
  513.       dispose_button ; dispose_meter ; dispose_name ; dispose_icon_sprite
  514.       $game_temp.chain_actions[3] = false ; $game_temp.active_chain = false
  515.   end
  516.  
  517.   #--------------------------------------------------------------------------
  518.   # ● Dispose Icon Sprite
  519.   #--------------------------------------------------------------------------        
  520.   def dispose_icon_sprite
  521.       return if @icon_sprite == nil
  522.       @icon_sprite.bitmap.dispose ; @icon_sprite.dispose ; @icon_sprite = nil
  523.   end  
  524.  
  525.   #--------------------------------------------------------------------------
  526.   # ● Dispose Name
  527.   #--------------------------------------------------------------------------        
  528.   def dispose_name
  529.       return if @skill_name == nil
  530.       @skill_name.bitmap.dispose ; @skill_name.dispose ; @skill_name = nil
  531.   end
  532.  
  533.   #--------------------------------------------------------------------------
  534.   # ● Dispose Button
  535.   #--------------------------------------------------------------------------        
  536.   def dispose_button
  537.       return if @button_sprite == nil
  538.       @button_sprite.bitmap.dispose ; @button_sprite.dispose ; @button_sprite = nil
  539.   end
  540.  
  541.   #--------------------------------------------------------------------------
  542.   # ● Dispose Meter
  543.   #--------------------------------------------------------------------------         
  544.   def dispose_meter
  545.       return if @meter_layout == nil
  546.       @meter_layout.dispose ; @meter_layout = nil
  547.       @meter.bitmap.dispose ; @meter.dispose
  548.   end  
  549.  
  550.   #--------------------------------------------------------------------------
  551.   # ● Update
  552.   #--------------------------------------------------------------------------      
  553.   def update(battler)
  554.       if @initial_wait > 0
  555.          @initial_wait -= 1
  556.          if @initial_wait == 0
  557.             refresh_button_command ; @meter.visible = true
  558.             @meter_layout.visible = true        
  559.             set_opacity(0)
  560.          end
  561.          return  
  562.       end
  563.       if @wrong_commnad[0]
  564.          update_fade_command
  565.          return
  566.       else   
  567.          update_opacity         
  568.       end      
  569.       update_command ; update_sprite_button ; update_time ; update_meter
  570.       update_battle_camera if oxy_camera?(battler)
  571.   end
  572.  
  573.   #--------------------------------------------------------------------------
  574.   # ● OXY_CAMERA
  575.   #--------------------------------------------------------------------------               
  576.   def oxy_camera?(battler)
  577.       return false if battler == nil
  578.       return false if $imported[:mog_battle_camera] == nil
  579.       if battler.is_a?(Game_Actor)
  580.          return false if $imported[:mog_battle_hud_ex] and SceneManager.face_battler?
  581.       end
  582.       return true
  583.   end  
  584.  
  585.   #--------------------------------------------------------------------------
  586.   # ● Update Battle Camera
  587.   #--------------------------------------------------------------------------               
  588.   def update_battle_camera
  589.       @meter_layout.ox = $game_temp.viewport_oxy[0]
  590.       @meter_layout.oy = $game_temp.viewport_oxy[1]
  591.       @meter.ox = $game_temp.viewport_oxy[0]
  592.       @meter.oy = $game_temp.viewport_oxy[1]
  593.       @skill_name.ox = $game_temp.viewport_oxy[0]
  594.       @skill_name.oy = $game_temp.viewport_oxy[1]
  595.       @button_sprite.ox = $game_temp.viewport_oxy[0] + @button_sprite_oxy[0]
  596.       @button_sprite.oy = $game_temp.viewport_oxy[1] + @button_sprite_oxy[1]
  597.       @icon_sprite.ox = $game_temp.viewport_oxy[0]
  598.       @icon_sprite.oy = $game_temp.viewport_oxy[1]
  599.   end  
  600.  
  601.   #--------------------------------------------------------------------------
  602.   # ● Set Opacity
  603.   #--------------------------------------------------------------------------         
  604.   def set_opacity(opc)
  605.       @meter_layout.opacity = opc
  606.       @meter.opacity = opc
  607.       @skill_name.opacity = opc
  608.       @button_sprite.opacity = opc
  609.       @icon_sprite.opacity = opc
  610.   end      
  611.  
  612.   #--------------------------------------------------------------------------
  613.   # ● Update Opacity
  614.   #--------------------------------------------------------------------------         
  615.   def update_opacity
  616.       @meter_layout.opacity += 75
  617.       @meter.opacity += 75
  618.       @skill_name.opacity += 75
  619.       @button_sprite.opacity += 75
  620.       @icon_sprite.opacity += 75
  621.   end   
  622.  
  623.  
  624.   #--------------------------------------------------------------------------
  625.   # ● Update Skill Name
  626.   #--------------------------------------------------------------------------         
  627.   def update_fade_command
  628.       fade_speed = 6
  629.       @skill_name.opacity -= fade_speed ; @meter.opacity -= fade_speed
  630.       @meter_layout.opacity -= fade_speed ; @icon_sprite.opacity -= fade_speed
  631.       @button_sprite.opacity -= fade_speed * 2 ; missed if @meter.opacity == 0
  632.   end
  633.  
  634.   #--------------------------------------------------------------------------
  635.   # ● Update Skill Name
  636.   #--------------------------------------------------------------------------        
  637.   def update_skill_name
  638.       return if @skill_name == nil
  639.       if @skill_name.x < @org_x
  640.          @skill_name.x += 3 ; @icon_sprite.x += 3
  641.          if @skill_name.x > @org_x
  642.             @skill_name.x = @org_x ; @icon_sprite.x = @org_x2
  643.          end   
  644.       end
  645.   end
  646.  
  647.   #--------------------------------------------------------------------------
  648.   # ● Update Time
  649.   #--------------------------------------------------------------------------
  650.   def update_time
  651.       return if @button_sprite == nil
  652.       @duration[0] -= 1 if @duration[0] > 0
  653.       wrong_command(1) if @duration[0] == 0
  654.   end
  655.  
  656.   #--------------------------------------------------------------------------
  657.   # ● Update Sprite Button
  658.   #--------------------------------------------------------------------------        
  659.   def update_sprite_button
  660.       return if @button_sprite == nil
  661.       if @button_sprite.zoom_x > 1.00
  662.          @button_sprite.zoom_x -= 0.05
  663.          @button_sprite.zoom_x = 1.00 if @button_sprite.zoom_x < 1.00
  664.       end
  665.       @button_sprite.zoom_y = @button_sprite.zoom_x
  666.   end  
  667.  
  668. #--------------------------------------------------------------------------
  669. # ● Update Command
  670. #--------------------------------------------------------------------------      
  671. def update_command
  672.      if Input.trigger?(:X) ; check_command(0)
  673.      elsif Input.trigger?(:Z) ; check_command(1)
  674.      elsif Input.trigger?(:Y) ; check_command(2)
  675.      elsif Input.trigger?(:A) ; check_command(3)
  676.      elsif Input.trigger?(:C) ; check_command(4)
  677.      elsif Input.trigger?(:B) ; check_command(5)
  678.      elsif Input.trigger?(:L) ; check_command(6)
  679.      elsif Input.trigger?(:R) ; check_command(7)        
  680.      elsif Input.trigger?(:RIGHT) ; check_command(8)
  681.      elsif Input.trigger?(:LEFT) ; check_command(9)
  682.      elsif Input.trigger?(:DOWN) ; check_command(10)
  683.      elsif Input.trigger?(:UP) ; check_command(11)
  684.      end   
  685. end  
  686.  
  687. #--------------------------------------------------------------------------
  688. # ● command_list_check
  689. #--------------------------------------------------------------------------      
  690. def command_list_check(command)
  691.      case command
  692.          when "A" ; @com = 0  
  693.          when "D" ; @com = 1  
  694.          when "S" ; @com = 2
  695.          when "Shift" ; @com = 3
  696.          when "Z" ; @com = 4
  697.          when "X" ; @com = 5
  698.          when "Q" ; @com = 6
  699.          when "W" ; @com = 7            
  700.          when "Right" ; @com = 8
  701.          when "Left" ;  @com = 9
  702.          when "Down" ;  @com = 10
  703.          when "Up"  ;   @com = 11         
  704.          else ; @com = 12           
  705.      end
  706. end   
  707.  
  708. #--------------------------------------------------------------------------
  709. # ● check_command
  710. #--------------------------------------------------------------------------            
  711. def check_command(com)
  712.      if com != -1
  713.         right_input = false
  714.         @chain_command.each_with_index do |i, index|
  715.            if index == @com_index
  716.               command_list_check(i) ; right_input = true if @com == com
  717.            end         
  718.         end
  719.      else  
  720.        command_list_check(@com_index) ; right_input = true
  721.      end  
  722.      if right_input
  723.         next_command
  724.      else  
  725.         wrong_command(0)
  726.      end  
  727. end  
  728.  
  729. #--------------------------------------------------------------------------
  730. # ● Next Command
  731. #--------------------------------------------------------------------------            
  732. def next_command
  733.      @com_index += 1   
  734.      Audio.se_play("Audio/SE/" + CHAIN_RIGHT_SE, 100, 100)
  735.      if @com_index == @chain_command.size
  736.         @phase = 9 ; @success = true
  737.         return
  738.      end  
  739.      refresh_button_command
  740. end     
  741.  
  742. #--------------------------------------------------------------------------
  743. # ● wrong_command
  744. #--------------------------------------------------------------------------              
  745. def wrong_command(type = 0)
  746.      @wrong_commnad[0] = true ; @wrong_commnad[1] = type
  747.      @skill_name.bitmap.clear
  748.      Audio.se_play("Audio/SE/" + CHAIN_WRONG_SE, 100, 100)        
  749.      wname = type == 0 ? CHAIN_MISSED_WORDS[0] : CHAIN_MISSED_WORDS[1]
  750.      @skill_name.bitmap.draw_text(0,0,200,32,wname.to_s,1)
  751. end     
  752.  
  753. #--------------------------------------------------------------------------
  754. # ● missed
  755. #--------------------------------------------------------------------------               
  756. def missed
  757.      @success = false  ; @phase = 9  
  758. end
  759.  
  760. end

Lv3.寻梦者

梦石
0
星屑
1656
在线时间
755 小时
注册时间
2013-9-23
帖子
211

开拓者

2
发表于 2019-1-20 05:32:04 | 只看该作者
仅仅备注了还不够,脚本内也需要设置。
技能ID => [上下左右之类的按键],
具体参考脚本中类似的部分,比如59至71行。
设置请在58行的 CHAIN_ACTIONS = {  和72行的  } 之间进行,技能id别重复了。
回复 支持 反对

使用道具 举报

Lv5.捕梦者

梦石
10
星屑
39440
在线时间
1914 小时
注册时间
2010-11-14
帖子
3315

R考场第七期纪念奖

3
发表于 2019-1-20 11:35:57 | 只看该作者
Chain Action看英文就知道是技能一招连一招,所以技能中要设置好下一招是什么
除此之外,还要在脚本中设置某一招被连上时要求的输入。

上面的中文解释应该是和MOG的另一个脚本Blitz_Command弄混了。

评分

参与人数 1星屑 +20 收起 理由
VIPArcher + 20 认可答案

查看全部评分

用头画头像,用脚写脚本
回复 支持 1 反对 0

使用道具 举报

Lv3.寻梦者

梦石
0
星屑
1014
在线时间
120 小时
注册时间
2018-4-7
帖子
17
4
 楼主| 发表于 2019-1-22 19:59:20 | 只看该作者
KB.Driver 发表于 2019-1-20 11:35
Chain Action看英文就知道是技能一招连一招,所以技能中要设置好下一招是什么
除此之外,还要在脚本中设置 ...

啊,感谢大大,怪不得我用另一个出现的是这个脚本的效果。
回复 支持 反对

使用道具 举报

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

本版积分规则

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

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

GMT+8, 2024-4-20 17:17

Powered by Discuz! X3.1

© 2001-2013 Comsenz Inc.

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