查看: 2827|回复: 2

[已经解决] 怎样修改这段脚本让图标的显示位置正确呢?

[复制链接]
梦石
10
星屑
39550
在线时间
1919 小时
注册时间
2010-11-14
回帖
3214

R考场第七期纪念奖

发表于 2015-6-14 19:19:56 | 显示全部楼层 |阅读模式

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

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

×
问题如图所示:
QQ截图20150614191457.png
QQ截图20150614191552.png

搓招脚本
  1. #==============================================================================
  2. # +++ MOG - Blitz Commands (v1.6) +++
  3. #==============================================================================
  4. # By Moghunter
  5. # [url]https://atelierrgss.wordpress.com/[/url]
  6. #==============================================================================
  7. # Permite ativar ações através de sequência de comandos.
  8. #==============================================================================
  9. # UTILIZAÇÃO
  10. #==============================================================================
  11. # No banco de dados de habilidades ou itens, coloque o seguinte comentário na
  12. # caixa de notas.
  13. #
  14. # <Blitz Command>
  15. #
  16. # * Lembre-se de definir a sequência de botões no editor de script antes de
  17. # usar a habilidade
  18. #
  19. # Para definir uma velocidade especifica na sequência de botões use o cometário
  20. # abaixo.
  21. #
  22. # <Blitz Speed = X>
  23. #
  24. #==============================================================================
  25. # Arquivos necessários. Graphics/System/
  26. #==============================================================================
  27. #
  28. # Blitz_Background.png
  29. # Blitz_Flash.png
  30. # Blitz_Layout.png
  31. # Blitz_Meter.png
  32. # Chain_Command.png
  33. #
  34. #==============================================================================
  35. # Histórico
  36. #==============================================================================
  37. # v1.6 - Melhoria na codificação.
  38. #==============================================================================

  39. $imported = {} if $imported.nil?
  40. $imported[:mog_blitz_commands] = true

  41. module MOG_BLITZ_COMMANDS
  42.   #Definição do tempo para inserir os comandos. (tempo X quantidade de comandos)
  43.   DEFAULT_INPUT_DURATION = 30
  44. #==============================================================================
  45. # BLITZ_INPUT = { SKILL_ID => [COMMAND] }
  46. #
  47. # SKILL_ID = ID da habilidade no banco de dados.
  48. # COMMANDS = Defina aqui a sequência de botões.
  49. #            (Para fazer a sequência use os comandos abaixo)   
  50. #  
  51. # "Down" ,"Up" ,"Left" ,"Right" ,"Shift" ,"D" ,"S" ,"A" ,"Z" ,"X" ,"Q" ,"W"
  52. #
  53. # Exemplo de utilização
  54. #
  55. # BLITZ_INPUT = {
  56. # 25=>["Down","D","S","Right"],
  57. # 59=>["Down","Up","Left","Right","Shift","D","S","A","Z","X","Q","W"],
  58. # 80=>["Shift","D"]
  59. # }   
  60. #==============================================================================
  61.   BLITZ_INPUT = {
  62. 3=>["A","S","D","Q"],#连续攻击
  63. 88=>["A","A","S","Down","D","Right"],#无影脚
  64. 103=>["A","W","W","Right","S","Down"], #燕返
  65. 262=>["Down","D","Right","A","Up","Q","Left","S"], #天使之吻
  66. 264=>["W","A","S","D","Up","Left","Right","Down"], #挑衅
  67. 288=>["Left","Right","Down","Up","Q","Q","Q","A","D","Z","S"], #破除
  68. 372=>["A","S","D","Up","Right" ,"Shift"], #力符「强化」
  69. 373=>["S","D","S","A","D","W","A","D","A","S"], #两回连续攻击
  70. }  
  71. #Ativar animação da imagem de fundo.
  72. BACKGROUND_ENABLE = false
  73. #Velocidade de deslize da imagem de fundo.
  74. BACKGROUND_SCROLL_SPEED = [30,0]
  75. #Posição do layout.
  76. BLITZ_POSITION = [0,0]
  77. #Posição do botão.
  78. BUTTON_POSITION = [265,170]
  79. #Posição do medidor de tempo.
  80. METER_POSITION = [63,249]
  81. #Posição do sprite Flash.
  82. FLASH_POSITION = [0,146]
  83. #Posição do ícone.
  84. ICON_POSITION = [0,0]
  85. #Posição do nome da skill
  86. SKILL_NAME_POSITION = [180,140]
  87. #Definição das palavras usadas no sistema blitz.
  88. BLITZ_WORDS = ["Missed!", "Timeover", "Success!"]
  89. #Configuração da fonte.
  90. FONT_SIZE = 22
  91. FONT_COLOR = Color.new(255,255,255)
  92. #Prioridade dos sprites.
  93. BLITZ_Z = 10500
  94. #Som ao acertar.
  95. RIGHT_SE = "Chime1"
  96. #Som ao errar.
  97. WRONG_SE = "Buzzer1"  
  98. #Definição do som ao ativar o sistema.
  99. BLITZ_START_SE = "Saint9"
  100. end

  101. #==============================================================================
  102. # ■ Game Temp
  103. #==============================================================================
  104. class Game_Temp
  105.   attr_accessor :blitz_commands
  106.   attr_accessor :blitz_commands_phase
  107.   #--------------------------------------------------------------------------
  108.   # ● Initialize
  109.   #--------------------------------------------------------------------------      
  110.   alias mog_blits_commands_initialize initialize
  111.   def initialize
  112.       @blitz_commands = [false,0] ; @blitz_commands_phase = false
  113.       mog_blits_commands_initialize
  114.   end
  115.   
  116. end

  117. #==============================================================================
  118. # ■ Scene_Battle
  119. #==============================================================================
  120. class Scene_Battle < Scene_Base
  121.   
  122.   #--------------------------------------------------------------------------
  123.   # ● Use Item
  124.   #--------------------------------------------------------------------------  
  125.   alias mog_blitz_commands_use_item use_item
  126.   def use_item
  127.       if can_execute_blitz_input?
  128.          blitz_before_action
  129.          execute_blitz_input
  130.          blitz_after_action
  131.          unless $game_temp.blitz_commands[1] == nil
  132.              return if !$game_temp.blitz_commands[0]
  133.          end
  134.       end
  135.       mog_blitz_commands_use_item     
  136.   end
  137.   
  138.   #--------------------------------------------------------------------------
  139.   # ● Blitz Before Action
  140.   #--------------------------------------------------------------------------  
  141.   def blitz_before_action
  142.       record_window_data if $imported[:mog_atb_system]
  143.       if $imported[:mog_menu_cursor]   
  144.          @chain_curor_x = $game_temp.menu_cursor[2]
  145.          $game_temp.menu_cursor[2] = -999
  146.          force_cursor_visible(false)
  147.       end            
  148.   end      
  149.   
  150.   #--------------------------------------------------------------------------
  151.   # ● Blitz After ACtion
  152.   #--------------------------------------------------------------------------  
  153.   def blitz_after_action
  154.       restore_window_data if $imported[:mog_atb_system]
  155.       if $imported[:mog_menu_cursor] and @chain_curor_x != nil
  156.          $game_temp.menu_cursor[2] = @chain_curor_x
  157.       end
  158.   end   
  159.   
  160.   #--------------------------------------------------------------------------
  161.   # ● Can Execute Blitz Input
  162.   #--------------------------------------------------------------------------   
  163.   def can_execute_blitz_input?
  164.       return false if !@subject.is_a?(Game_Actor)
  165.       return false if @subject.restriction != 0
  166.       return true
  167.   end
  168.   
  169.   #--------------------------------------------------------------------------
  170.   # ● Execute Blitz Input
  171.   #--------------------------------------------------------------------------   
  172.   def execute_blitz_input
  173.       $game_temp.blitz_commands[0] = false
  174.       action_id = @subject.current_action.item.note =~ /<Blitz Command>/ ? @subject.current_action.item.id : nil
  175.       $game_temp.blitz_commands[1] = action_id
  176.       return if action_id == nil
  177.       blitz_command_sequence = MOG_BLITZ_COMMANDS::BLITZ_INPUT[action_id]
  178.       if $imported[:mog_menu_cursor]   
  179.          valor_x = $game_temp.menu_cursor[2] ; $game_temp.menu_cursor[2] = -999
  180.          force_cursor_visible(false)
  181.       end      
  182.       if blitz_command_sequence != nil  
  183.          blitz_sq = Blitz_Commands.new(blitz_command_sequence, @subject ,action_id)
  184.          loop do
  185.               $game_temp.blitz_commands_phase = true
  186.               (blitz_sq.update ; Input.update) unless @spriteset.animation?
  187.               @spriteset.update ; Graphics.update ; update_info_viewport
  188.               break if blitz_sq.phase == 9
  189.          end
  190.          blitz_sq.dispose
  191.       end        
  192.       $game_temp.menu_cursor[2] = valor_x if $imported[:mog_menu_cursor]
  193.       $game_temp.blitz_commands_phase = false
  194.   end
  195.   
  196. end

  197. #==============================================================================
  198. # Game Temp
  199. #==============================================================================
  200. class Game_Temp
  201.   
  202.   attr_accessor :cache_blitz_command
  203.   
  204.   #--------------------------------------------------------------------------
  205.   # ● Initialize
  206.   #--------------------------------------------------------------------------
  207.   alias mog_blitz_command_initialize initialize   
  208.   def initialize
  209.       mog_blitz_command_initialize
  210.       cache_blt_cmd
  211.   end
  212.   
  213.   #--------------------------------------------------------------------------
  214.   # ● Cache Blt Cmd
  215.   #--------------------------------------------------------------------------  
  216.   def cache_blt_cmd
  217.       @cache_blitz_command = []
  218.       @cache_blitz_command.push(Cache.system("Blitz_Background"))
  219.       @cache_blitz_command.push(Cache.system("IconSet"))
  220.       @cache_blitz_command.push(Cache.system("Blitz_Flash"))
  221.       @cache_blitz_command.push(Cache.system("Blitz_Meter"))
  222.       @cache_blitz_command.push(Cache.system("Blitz_Layout"))
  223.       @cache_blitz_command.push(Cache.system("Chain_Battle_Command"))
  224.   end
  225.   
  226. end


  227. #==============================================================================
  228. # ■ Spriteset Battle
  229. #==============================================================================
  230. class Spriteset_Battle
  231.    
  232.   #--------------------------------------------------------------------------
  233.   # ● Initialize
  234.   #--------------------------------------------------------------------------   
  235.   alias mog_blitz_commands_initialize initialize
  236.   def initialize
  237.       $game_temp.cache_blt_cmd
  238.       mog_blitz_commands_initialize     
  239.   end
  240. end  
  241. #==============================================================================
  242. # Blitz Commands
  243. #==============================================================================
  244. class Blitz_Commands
  245.   include MOG_BLITZ_COMMANDS
  246.   attr_accessor :phase
  247.   
  248.   #--------------------------------------------------------------------------
  249.   # ● Initialize
  250.   #--------------------------------------------------------------------------      
  251.   def initialize(sequence, subject,action_id)
  252.       @phase = 0 ; @actor = subject ; @skill = $data_skills[action_id]
  253.       @skillname = @skill.name ; @action_id = action_id
  254.       @chain_command = sequence ; @end = false
  255.       duration = @skill.note =~ /<Blitz Speed = (\d+)>/i ? $1.to_i : DEFAULT_INPUT_DURATION
  256.       @timer_max = duration * @chain_command.size ; @timer_max = 1 if @timer_max < 1
  257.       @timer = @timer_max ; @com = 0 ; @com_index = 0 ; @new_x = 0
  258.       Audio.se_play("Audio/SE/" + BLITZ_START_SE, 100, 100) rescue nil
  259.       create_sprites
  260.   end

  261.   #--------------------------------------------------------------------------
  262.   # ● Create Sprites
  263.   #--------------------------------------------------------------------------        
  264.   def create_sprites
  265.       create_background ; create_layout ; create_buttons ; create_meter
  266.       create_flash ; create_skill_name ; create_icon      
  267.   end
  268.   
  269.   #--------------------------------------------------------------------------
  270.   # ● Create Background
  271.   #--------------------------------------------------------------------------        
  272.   def create_background
  273.       @background = Plane.new ; @background.opacity = 0
  274.       @background.bitmap = $game_temp.cache_blitz_command[0]
  275.       @background.z = BLITZ_Z ; @background.visible = BACKGROUND_ENABLE
  276.   end
  277.   
  278.   #--------------------------------------------------------------------------
  279.   # ● Create Icon
  280.   #--------------------------------------------------------------------------      
  281.   def create_icon
  282.       @icon_image = $game_temp.cache_blitz_command[1]
  283.       @icon_sprite = Sprite.new ; @icon_sprite.bitmap = Bitmap.new(24,24)
  284.       @icon_sprite.z = BLITZ_Z + 3
  285.       @org_x2 = 80 + ICON_POSITION[0] - @center + SKILL_NAME_POSITION[0]
  286.       @icon_sprite.x = @org_x2 ; @icon_sprite.opacity = 0
  287.       @icon_sprite.y = ICON_POSITION[1] + SKILL_NAME_POSITION[1]     
  288.       icon_rect = Rect.new(@skill.icon_index % 16 * 24, @skill.icon_index / 16 * 24, 24, 24)
  289.       @icon_sprite.bitmap.blt(0,0, @icon_image, icon_rect)
  290.   end  
  291.   
  292.   #--------------------------------------------------------------------------
  293.   # ● Initialize
  294.   #--------------------------------------------------------------------------      
  295.   def create_skill_name
  296.       @skill_name = Sprite.new ; @skill_name.bitmap = Bitmap.new(200,32)
  297.       @skill_name.bitmap.font.size = FONT_SIZE
  298.       @skill_name.z = BLITZ_Z + 3 ; @skill_name.y = SKILL_NAME_POSITION[1]
  299.       @skill_name.opacity = 0 ; refresh_skill_name
  300.   end
  301.   
  302.   #--------------------------------------------------------------------------
  303.   # ● Refresh Skill Name
  304.   #--------------------------------------------------------------------------        
  305.   def refresh_skill_name
  306.       cm = @skillname.to_s.split(//).size
  307.       @center = ((200 / @skill_name.bitmap.font.size) * cm / 2) + 5
  308.       @org_x = SKILL_NAME_POSITION[0] ; @skill_name.x = @org_x  
  309.       @skill_name.bitmap.font.color = Color.new(0,0,0)
  310.       @skill_name.bitmap.draw_text(1,1,200,32,@skillname.to_s,1)  
  311.       @skill_name.bitmap.font.color = FONT_COLOR
  312.       @skill_name.bitmap.draw_text(0,0,200,32,@skillname.to_s,1)  
  313.   end  
  314.   
  315.   #--------------------------------------------------------------------------
  316.   # ● Create Flash
  317.   #--------------------------------------------------------------------------         
  318.   def create_flash
  319.       @flash_type = 0 ; @flash_image = $game_temp.cache_blitz_command[2]
  320.       @flash_cw = @flash_image.width ; @flash_ch = @flash_image.height / 2
  321.       @flash = Sprite.new ; @flash.bitmap = Bitmap.new(@flash_cw,@flash_ch)
  322.       @flash.x = FLASH_POSITION[0] ; @flash.y = FLASH_POSITION[1]
  323.       @flash.z = BLITZ_Z + 2 ; @flash.opacity = 0 ; @flash.blend_type = 1
  324.       refresh_flash
  325.   end
  326.   
  327.   #--------------------------------------------------------------------------
  328.   # ● Refresh Flash
  329.   #--------------------------------------------------------------------------            
  330.   def refresh_flash
  331.       @flash.bitmap.clear
  332.       f_scr = Rect.new(0,@flash_type * @flash_ch,@flash_cw,@flash_ch)
  333.       @flash.bitmap.blt(0,0,@flash_image,f_scr)
  334.   end

  335.   #--------------------------------------------------------------------------
  336.   # ● Create Meter
  337.   #--------------------------------------------------------------------------         
  338.   def create_meter
  339.       @meter_image = $game_temp.cache_blitz_command[3]
  340.       @meter_cw = @meter_image.width ; @meter_ch = @meter_image.height
  341.       @meter_sprite = Sprite.new
  342.       @meter_sprite.bitmap = Bitmap.new(@meter_cw,@meter_ch)
  343.       @meter_sprite.x = METER_POSITION[0] ; @meter_sprite.y = METER_POSITION[1]
  344.       @meter_sprite.z = BLITZ_Z + 2 ; @meter_sprite.opacity = 0 ; update_meter
  345.   end
  346.   
  347.   #--------------------------------------------------------------------------
  348.   # ● Update Meter
  349.   #--------------------------------------------------------------------------            
  350.   def update_meter
  351.       return if @meter_sprite == nil
  352.       @meter_sprite.bitmap.clear ; m_width = @meter_cw * @timer / @timer_max
  353.       m_scr = Rect.new(0,0,m_width,@meter_ch)
  354.       @meter_sprite.bitmap.blt(0,0,@meter_image, m_scr)
  355.   end
  356.   
  357.   #--------------------------------------------------------------------------
  358.   # ● Create Layout
  359.   #--------------------------------------------------------------------------         
  360.   def create_layout
  361.       @layout = Sprite.new ; @layout.bitmap = $game_temp.cache_blitz_command[4]
  362.       @layout.x = BLITZ_POSITION[0] ; @layout.y = BLITZ_POSITION[1]
  363.       @layout.z = BLITZ_Z + 1 ; @layout.opacity = 0
  364.   end
  365.   
  366.   #--------------------------------------------------------------------------
  367.   # ● Create Buttons
  368.   #--------------------------------------------------------------------------      
  369.   def create_buttons
  370.      @image = $game_temp.cache_blitz_command[5]  
  371.      @image_cw = @image.width / 13 ; @image_ch = @image.height  
  372.      @image_cw_max = (@image_cw + 5) * @chain_command.size
  373.      @sprite = Sprite.new ; @sprite.bitmap = Bitmap.new(@image_cw_max,@image_ch * 2)
  374.      if @chain_command.size <= 15
  375.         @sprite.x = (Graphics.width / 2) - ((@image_cw + 5) * @chain_command.size) / 2
  376.         @new_x = 0
  377.      else   
  378.         @sprite.x = (Graphics.width / 2) ; @new_x = @sprite.x
  379.      end   
  380.      @sprite.x = BUTTON_POSITION[0] ; @sprite.y = BUTTON_POSITION[1]
  381.      @sprite.z = BLITZ_Z + 1 ; @sprite.opacity = 0 ; refresh_button
  382.   end  
  383.   
  384.   #--------------------------------------------------------------------------
  385.   # ● Refresh Button
  386.   #--------------------------------------------------------------------------         
  387.   def refresh_button
  388.       return if @sprite == nil
  389.       @sprite.bitmap.clear
  390.       @chain_command.each_with_index do |i, index|
  391.          command_list_check(i)
  392.          bitmap_src_rect = Rect.new(@com * @image_cw, 0, @image_cw, @image_ch)
  393.          if @com_index == index
  394.             @sprite.bitmap.blt(index * (@image_cw + 5) , 0, @image, bitmap_src_rect)
  395.          else
  396.             @sprite.bitmap.blt(index * (@image_cw + 5) , @image_ch, @image, bitmap_src_rect)
  397.          end     
  398.       end  
  399.       @new_x = BUTTON_POSITION[0] - ((@image_cw + 5) * @com_index)
  400.   end

  401.   #--------------------------------------------------------------------------
  402.   # ● Dispose
  403.   #--------------------------------------------------------------------------        
  404.   def dispose
  405.       dispose_background ; dispose_layout ; dispose_buttons ; dispose_meter
  406.       dispose_flash ; dispose_name ; dispose_icon_sprite      
  407.   end
  408.   
  409.   #--------------------------------------------------------------------------
  410.   # ● Dispose Background
  411.   #--------------------------------------------------------------------------         
  412.   def dispose_background
  413.       return if @background == nil
  414.       @background.dispose ; @background = nil
  415.   end  
  416.   
  417.   #--------------------------------------------------------------------------
  418.   # ● Dispose Icon Sprite
  419.   #--------------------------------------------------------------------------        
  420.   def dispose_icon_sprite
  421.       return if @icon_sprite == nil
  422.       @icon_sprite.bitmap.dispose ; @icon_sprite.dispose ; @icon_sprite = nil
  423.   end  
  424.   
  425.   #--------------------------------------------------------------------------
  426.   # ● Dispose Name
  427.   #--------------------------------------------------------------------------        
  428.   def dispose_name
  429.       return if @skill_name == nil
  430.       @skill_name.bitmap.dispose ; @skill_name.dispose ; @skill_name = nil
  431.   end  
  432.   
  433.   #--------------------------------------------------------------------------
  434.   # ● Dispose Flash
  435.   #--------------------------------------------------------------------------            
  436.   def dispose_flash
  437.       return if @flash == nil
  438.       @flash.bitmap.dispose ; @flash.dispose ; @flash = nil
  439.   end   
  440.   
  441.   #--------------------------------------------------------------------------
  442.   # ● Dispose Meter
  443.   #--------------------------------------------------------------------------            
  444.   def dispose_meter
  445.       return if @meter_sprite == nil
  446.       @meter_sprite.bitmap.dispose ; @meter_sprite.dispose ; @meter_sprite = nil
  447.   end  
  448.   
  449.   #--------------------------------------------------------------------------
  450.   # ● Dispose Buttons
  451.   #--------------------------------------------------------------------------         
  452.   def dispose_buttons
  453.       return if @sprite == nil
  454.       @sprite.bitmap.dispose ; @sprite.dispose ; @sprite = nil
  455.   end  
  456.   
  457.   #--------------------------------------------------------------------------
  458.   # ● Dispose Layout
  459.   #--------------------------------------------------------------------------            
  460.   def dispose_layout
  461.       return if @layout == nil
  462.       @layout.dispose ; @layout = nil
  463.   end  
  464.   
  465.   #--------------------------------------------------------------------------
  466.   # ● Update
  467.   #--------------------------------------------------------------------------        
  468.   def update
  469.       if @end and @sprite.x == @new_x
  470.          update_flash ; update_background ; update_end
  471.          return
  472.       end
  473.       update_background ; update_timer ; update_command ; update_slide_command
  474.       update_meter ; update_flash ; update_opacity
  475.   end
  476.   
  477.   #--------------------------------------------------------------------------
  478.   # ● Update Opacity
  479.   #--------------------------------------------------------------------------         
  480.   def update_opacity
  481.       return if @sprite.opacity == nil
  482.       @sprite.opacity += 10 ; @layout.opacity += 10
  483.       @meter_sprite.opacity += 10 ; @skill_name.opacity += 10
  484.       @background.opacity += 10 ; @icon_sprite.opacity += 10   
  485.   end
  486.    
  487.   #--------------------------------------------------------------------------
  488.   # ● Update End
  489.   #--------------------------------------------------------------------------         
  490.   def update_end
  491.       fs = 6 ; @icon_sprite.opacity -= fs ; @background.opacity -= fs
  492.       @skill_name.opacity -= fs ; @sprite.opacity -= fs ; @layout.opacity -= fs
  493.       @meter_sprite.opacity -= fs ; @phase = 9 if @background.opacity == 0
  494.   end
  495.   
  496.   #--------------------------------------------------------------------------
  497.   # ● Update Background
  498.   #--------------------------------------------------------------------------         
  499.   def update_background
  500.       return if @background == nil
  501.       @background.ox += BACKGROUND_SCROLL_SPEED[0]
  502.       @background.oy += BACKGROUND_SCROLL_SPEED[1]
  503.   end   
  504.   
  505.   #--------------------------------------------------------------------------
  506.   # ● Update Flash
  507.   #--------------------------------------------------------------------------              
  508.   def update_flash
  509.       return if @flash == nil or @flash.opacity == 0
  510.       @flash.opacity -= 10
  511.   end  
  512.   
  513.   #--------------------------------------------------------------------------
  514.   # ● Update Timer
  515.   #--------------------------------------------------------------------------         
  516.   def update_timer
  517.       return if @timer == 0
  518.       @timer -= 1 ; wrong_command(1) if @timer == 0
  519.   end
  520.   
  521.   #--------------------------------------------------------------------------
  522.   # ● Update Slide Command
  523.   #--------------------------------------------------------------------------         
  524.   def update_slide_command
  525.       return if @sprite == nil or @sprite.x == @new_x
  526.       slide_speed = 5 + ((@sprite.x - @new_x).abs / 5)      
  527.       @sprite.x -= slide_speed ; @sprite.x = @new_x if @sprite.x < @new_x
  528.   end
  529.   
  530. end

  531. #==============================================================================
  532. # Blitz Commands
  533. #==============================================================================
  534. class Blitz_Commands
  535.   
  536. #--------------------------------------------------------------------------
  537. # ● Update Command
  538. #--------------------------------------------------------------------------      
  539. def update_command
  540.      return if @end
  541.      if Input.trigger?(Input::X) ; check_command(0)
  542.      elsif Input.trigger?(:Z) ; check_command(1)
  543.      elsif Input.trigger?(:Y) ; check_command(2)
  544.      elsif Input.trigger?(:A) ; check_command(3)
  545.      elsif Input.trigger?(:C) ; check_command(4)
  546.      elsif Input.trigger?(:B) ; check_command(5)
  547.      elsif Input.trigger?(:L) ; check_command(6)
  548.      elsif Input.trigger?(:R) ; check_command(7)        
  549.      elsif Input.trigger?(:RIGHT) ; check_command(8)
  550.      elsif Input.trigger?(:LEFT) ; check_command(9)
  551.      elsif Input.trigger?(:DOWN) ; check_command(10)
  552.      elsif Input.trigger?(:UP) ; check_command(11)
  553.      end   
  554. end  
  555.    
  556. #--------------------------------------------------------------------------
  557. # ● command_list_check
  558. #--------------------------------------------------------------------------      
  559. def command_list_check(command)
  560.      case command
  561.          when "A" ; @com = 0  
  562.          when "D" ; @com = 1  
  563.          when "S" ; @com = 2
  564.          when "Shift" ; @com = 3
  565.          when "Z" ; @com = 4
  566.          when "X" ; @com = 5
  567.          when "Q" ; @com = 6
  568.          when "W" ; @com = 7            
  569.          when "Right" ; @com = 8
  570.          when "Left" ; @com = 9
  571.          when "Down" ; @com = 10
  572.          when "Up" ; @com = 11
  573.          else ; @com = 12           
  574.      end
  575. end   

  576. #--------------------------------------------------------------------------
  577. # ● check_command
  578. #--------------------------------------------------------------------------            
  579. def check_command(com)
  580.      if com != -1
  581.         right_input = false
  582.         @chain_command.each_with_index do |i, index|
  583.         if index == @com_index
  584.            command_list_check(i) ; right_input = true if @com == com
  585.         end end
  586.      else  
  587.        command_list_check(@com_index) ; right_input = true
  588.      end  
  589.      if right_input
  590.         next_command
  591.      else  
  592.         wrong_command(0)
  593.      end  
  594. end  
  595.    
  596. #--------------------------------------------------------------------------
  597. # ● Next Command
  598. #--------------------------------------------------------------------------            
  599. def next_command   
  600.      @flash.opacity = 255 ; @flash_type = 0 ; @com_index += 1   
  601.      Audio.se_play("Audio/SE/" + RIGHT_SE, 100, 100)
  602.      refresh_button ; refresh_flash
  603.      if @com_index == @chain_command.size
  604.         @end = true ; @skill_name.bitmap.clear
  605.         @skill_name.bitmap.draw_text(0,0,200,32,BLITZ_WORDS[2].to_s,1)
  606.         @icon_sprite.visible = false ; $game_temp.blitz_commands[0] = true
  607.      end
  608. end     

  609. #--------------------------------------------------------------------------
  610. # ● wrong_command
  611. #--------------------------------------------------------------------------              
  612. def wrong_command(type)
  613.      Audio.se_play("Audio/SE/" + WRONG_SE, 100, 100) ; @flash.opacity = 255
  614.      @flash_type = 1 ;@skill_name.bitmap.clear ; @end = true
  615.      wname = type == 0 ? BLITZ_WORDS[0] : BLITZ_WORDS[1]
  616.      $game_temp.blitz_commands[0] = false
  617.      @skill_name.bitmap.draw_text(0,0,200,32,wname.to_s,1)
  618.      @icon_sprite.visible = false ; refresh_flash
  619. end
  620.    
  621. end
复制代码

点评

搜icon..改x座標..應該很簡單吧  发表于 2015-6-14 19:36
用头画头像,用脚写脚本

…あたしは天

梦石
0
星屑
2311
在线时间
4033 小时
注册时间
2010-10-4
回帖
10548

开拓者贵宾

发表于 2015-6-14 19:46:29 | 显示全部楼层
注释看不懂,不过第86行可能有关系

点评

恩,改了一下86行的第一个数值以后位置似乎正常了些。不过,图标的位置不会自动调整到文字的前面,不同长度的技能图标的位置差异很大啊……  发表于 2015-6-14 19:51

评分

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

查看全部评分

回复

使用道具 举报

梦石
0
星屑
30103
在线时间
5741 小时
注册时间
2016-3-8
回帖
1662
发表于 2020-1-13 10:06:09 | 显示全部楼层
本帖最后由 alexncf125 于 2020-1-13 18:26 编辑

LZ是否解決了
不过,图标的位置不会自动调整到文字的前面,不同长度的技能图标的位置差异很大啊……

以上問題

求分享方法


想到了
@center = ((200 / @skill_name.bitmap.font.size) * cm / 2) + 5
下加一句
@center += cm * 6
回复

使用道具 举报

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

本版积分规则

Powered by Discuz! X5.0 © 2001-2026 Discuz! Team.

在本版发帖返回顶部