查看: 2121|回复: 1

[已经过期] 关于 MOG_Battler_Motion 让敌人动起来这个脚本的

[复制链接]
梦石
0
星屑
50
在线时间
366 小时
注册时间
2009-7-14
回帖
102
发表于 2012-12-6 21:22:56 | 显示全部楼层 |阅读模式

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

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

×
战斗的时候让敌人动起来,效果挺多的,不过Collapse折叠这一项,垂直拉伸的幅度有点大,所以我就把@breath_range = [0.9, 1.0]的0.9改成了0.95,不过改完之后发觉动的速度有点快,看起来略鬼畜,想慢一点,应该改哪里?
  1. #==============================================================================
  2. # +++ MOG - BATTLER MOTION (v1.3) +++
  3. #==============================================================================
  4. # By Moghunter
  5. # [url]http://www.atelier-rgss.com/[/url]
  6. #==============================================================================
  7. # Adiciona efeitos de animações nos sprites dos battlers.
  8. # ● Animação inicial (entrada)de batalha.
  9. # ● Animação de espera.
  10. # ● Animação de ação.
  11. # ● Animação de dano.
  12. # ● Animação de collapso.
  13. #==============================================================================

  14. #==============================================================================
  15. # ● Histórico (Version History)
  16. #==============================================================================
  17. # v 1.3 - Correção na posição do battler após receber o dano. (Actor)
  18. # v 1.2 - Melhoria na codificação do script. (Melhor compatibilidade.)
  19. #       - Adição do colapso tipo 6.
  20. #       - Adição do efeito de ação tipo 6 e 7.
  21. #       - Adição do efeito de animação inicial tipo 5.
  22. # v 1.1 - Ativar animação em battler abatidos. (Ex - Animações de Reviver.)
  23. #       - Opção de ativar ou não efeito de colapso para os personagens.
  24. # v 1.0 - Primeiro lançamento.
  25. #==============================================================================


  26. #==============================================================================
  27. # ● CONFIGURAÇÃO
  28. #==============================================================================
  29. # ■ Animação inicial de entrada ao começar a batalha.
  30. #==============================================================================
  31. # Coloque as seguintes Tags na caixa de notas dos inimigos ou personagens.
  32. #
  33. # <Motion Appear = X>
  34. #
  35. # X = 0
  36. # Battler desliza horizontalmente.
  37. #
  38. # X = 1
  39. # Battler desliza verticalmente.
  40. #
  41. # X = 2
  42. # Battler rola (Cambalhota O_o) pela tela.
  43. #
  44. # X = 3
  45. # Zoom IN
  46. #
  47. # X = 4
  48. # Zoom Out
  49. #
  50. # X = 5
  51. # Efeito de emergir do solo.
  52. #
  53. #==============================================================================
  54. # ■ Animações dos battlers em modo espera.
  55. #==============================================================================
  56. # Coloque as seguintes Tags na caixa de notas dos inimigos ou personagens.
  57. #
  58. # <Motion Standby = X>
  59. #
  60. # X = 0
  61. # Ativa o efeito do battler respirando.
  62. #
  63. # X = 1
  64. # Ativa o efeito do battler levitando.
  65. #
  66. # X = 2
  67. # Ativa o efeito do battler movimentando para os lados.
  68. #
  69. #==============================================================================
  70. # ■ Animações dos battlers em modo de ação.
  71. #==============================================================================
  72. # Coloque as seguintes Tags na caixa de notas de itens ou habilidades.
  73. #
  74. # <Motion Action = X>
  75. #
  76. # X = 0
  77. # Ativa o efeito de ação de zoom.
  78. #
  79. # X = 1
  80. # Ativa o efeito de ação de pular.
  81. #
  82. # X = 2
  83. # Ativa o efeito de girar para a esquerda.
  84. #
  85. # X = 3
  86. # Ativa o efeito de girar para a direita.
  87. #
  88. # X = 4
  89. # Ativa o efeito de tremer.
  90. #
  91. # X = 5
  92. # Ativa o efeito de ação frontal.
  93. #
  94. # X = 6
  95. # Ativa o efeito de dar um passo para esquerda.
  96. #
  97. # X = 7
  98. # Ativa o efeito de de dar um passo para direita.
  99. #
  100. #==============================================================================
  101. # ■ Animações dos battlers em Colapso.
  102. #==============================================================================
  103. # Coloque as seguintes Tags na caixa de notas dos inimigos ou personagens.
  104. #
  105. # <Motion Collapse = X>
  106. #
  107. # X = 0
  108. # Ativa colapso na vertical.
  109. #
  110. # X = 1
  111. # Ativa o colapso na horizontal.
  112. #
  113. # X = 2
  114. # Ativa o colapso em Zoom OUT.
  115. #
  116. # X = 3
  117. # Ativa o colapso em Zoom IN.
  118. #
  119. # X = 4
  120. # Ativa o colapso em Zoom IN e Zoom OUT.
  121. #
  122. # X = 5
  123. # Ativa o colapso em Modo Boss.
  124. #
  125. # X = 6
  126. # Não ativa colapso.(Do nothing)
  127. #
  128. #==============================================================================
  129. # ■ Ativar animação de dano em condições maléficas.
  130. #==============================================================================
  131. # Coloque a seguinte Tag na caixa de notas de condições para ativar o efeito
  132. # de dano.
  133. #
  134. # <Bad State>
  135. #
  136. #==============================================================================


  137. #==============================================================================
  138. # ■ Game_Battler
  139. #==============================================================================
  140. class Game_Battler < Game_BattlerBase
  141.   
  142.    attr_accessor :motion_start
  143.    attr_accessor :motion_stand
  144.    attr_accessor :motion_action
  145.    attr_accessor :motion_damage
  146.    attr_accessor :motion_collapse
  147.    
  148.   #--------------------------------------------------------------------------
  149.   # ● Initialize
  150.   #--------------------------------------------------------------------------      
  151.    alias mog_motion_animation_initialize initialize
  152.    def initialize
  153.        mog_motion_animation_initialize
  154.        @motion_start = -1
  155.        @motion_stand = [-1,0]
  156.        @motion_action = [-1,0]
  157.        @motion_collapse = [7,0]
  158.        @motion_damage = [0,0]
  159.    end     
  160.    
  161.   #--------------------------------------------------------------------------
  162.   # ● Added New State
  163.   #--------------------------------------------------------------------------  
  164.   alias mog_motion_animation_add_new_state add_new_state
  165.   def add_new_state(state_id)
  166.       mog_motion_animation_add_new_state(state_id)
  167.       self.motion_damage[0] = 1 if $data_states[state_id].note =~ /<Bad State>/
  168.   end   
  169.    
  170. end

  171. #==============================================================================
  172. # ■ Game_Enemy
  173. #==============================================================================
  174. class Game_Enemy < Game_Battler

  175.   #--------------------------------------------------------------------------
  176.   # ● Initialize
  177.   #--------------------------------------------------------------------------
  178.   alias mog_motion_animation_enemy_initialize initialize
  179.   def initialize(index, enemy_id)
  180.       mog_motion_animation_enemy_initialize(index, enemy_id)
  181.       setup_motion_animation(enemy_id)
  182.   end
  183.   
  184.   #--------------------------------------------------------------------------
  185.   # ● Setup Motion Animation
  186.   #--------------------------------------------------------------------------  
  187.   def setup_motion_animation(enemy_id)
  188.       self.motion_stand[0] = $1.to_i if  enemy.note =~ /<Motion Standby = (\d+)>/i
  189.       self.motion_collapse[0] = $1.to_i if  enemy.note =~ /<Motion Collapse = (\d+)>/i
  190.       self.motion_start =  $1.to_i if  enemy.note =~ /<Motion Appear = (\d+)>/i
  191.   end
  192. end

  193. #==============================================================================
  194. # ■ Game Actor
  195. #==============================================================================
  196. class Game_Actor < Game_Battler

  197.   #--------------------------------------------------------------------------
  198.   # ● Setup
  199.   #--------------------------------------------------------------------------
  200.   alias mog_motion_animation_actor_setup setup
  201.   def setup(actor_id)
  202.       mog_motion_animation_actor_setup(actor_id)
  203.       self.motion_stand[0] = $1.to_i if  actor.note =~ /<Motion Standby = (\d+)>/i
  204.       self.motion_collapse[0] = $1.to_i if  actor.note =~ /<Motion Collapse = (\d+)>/i      
  205.       self.motion_start =  $1.to_i if  actor.note =~ /<Motion Appear = (\d+)>/i  
  206.   end
  207.    
  208. end

  209. #==============================================================================
  210. # ■ Game_ActionResult
  211. #==============================================================================
  212. class Game_ActionResult

  213.   #--------------------------------------------------------------------------
  214.   # ● HP Damage Text
  215.   #--------------------------------------------------------------------------
  216.   alias mog_motion_animation_hp_damage_text hp_damage_text
  217.   def hp_damage_text
  218.       mog_motion_animation_hp_damage_text
  219.       @battler.motion_damage[0] = 1 if @hp_damage > 0
  220.   end  
  221. end   

  222. #==============================================================================
  223. # ■ Sprite Battler
  224. #==============================================================================
  225. class Sprite_Battler < Sprite_Base

  226.   #--------------------------------------------------------------------------
  227.   # ● Update Position
  228.   #--------------------------------------------------------------------------  
  229.   alias mog_motion_animation_update_position update_position
  230.   def update_position
  231.       if @battler.use_sprite?
  232.          update_motion_animation
  233.          return
  234.       end   
  235.       mog_motion_animation_update_position
  236.   end  
  237.   
  238.   #--------------------------------------------------------------------------
  239.   # ● Update Motion Animation
  240.   #--------------------------------------------------------------------------   
  241.   def update_motion_animation
  242.       setup_initial_motion
  243.       execute_start_animation
  244.       return if @wait_motion_start
  245.       if can_execute_collapse?
  246.          execute_motion_collapse
  247.       else  
  248.          execute_motion_damage
  249.          execute_motion_animation
  250.          execute_motion_action
  251.       end
  252.   end
  253.   
  254.   #--------------------------------------------------------------------------
  255.   # ● Setup Initial Motion
  256.   #--------------------------------------------------------------------------      
  257.   def setup_initial_motion
  258.       return if @motion_initial != nil
  259.       @motion_initial = true
  260.       @collapse_done = false
  261.       @motion_speed = 0
  262.       @start_speed = [0,0]
  263.       @battler.motion_collapse[1] = 0
  264.       self.x = @battler.screen_x rescue 0
  265.       self.y = @battler.screen_y rescue 0
  266.       self.z = @battler.screen_z rescue 100
  267.       setup_motion_stand
  268.       @original_set = [self.x, self.y, self.zoom_x,self.zoom_y,self.mirror,self.angle,self.opacity]      
  269.       setup_motion_start
  270.       setup_motion_damage            
  271.       setup_motion_action
  272.   end  

  273.   #--------------------------------------------------------------------------
  274.   # ● Return Set
  275.   #--------------------------------------------------------------------------         
  276.   def return_set(value)
  277.       self.x = value[0]
  278.       self.y = value[1]
  279.       self.zoom_x = value[2]
  280.       self.zoom_y = value[3]
  281.       self.mirror = value[4]
  282.       self.angle = value[5]
  283.       self.opacity = value[6]
  284.   end  

  285.   #--------------------------------------------------------------------------
  286.   # ● setup_motion_start
  287.   #--------------------------------------------------------------------------            
  288.   def setup_motion_start
  289.       @wait_motion_start = true
  290.       @scr_rect_speed = 1
  291.       case @battler.motion_start
  292.          when 0  
  293.             self.x = 0 - (self.bitmap.width + rand(100))
  294.          when 1
  295.             self.y = 0 - (self.bitmap.height + rand(100))
  296.          when 2   
  297.             self.angle = 360
  298.             self.x = 0 - self.bitmap.width
  299.          when 3   
  300.             self.zoom_x = 1.5 + (rand(10) / 100.0)
  301.             self.zoom_y = self.zoom_x
  302.             self.opacity = 0
  303.          when 4
  304.             self.zoom_x = 0.2 + (rand(10) / 100.0)
  305.             self.zoom_y = self.zoom_x
  306.             self.opacity = 0
  307.          when 5   
  308.             self.src_rect.y = -self.bitmap.height
  309.             @scr_rect_speed = self.bitmap.height / 40
  310.             @scr_rect_speed = 1 if @scr_rect_speed <= 0
  311.          else   
  312.            @wait_motion_start = false
  313.       end   
  314.   end  
  315.   
  316.   #--------------------------------------------------------------------------
  317.   # ● Setup Motion Damage
  318.   #--------------------------------------------------------------------------        
  319.   def setup_motion_damage
  320.       @battler.motion_damage = [0,0]
  321.       @damage_pre_set = [self.x, self.y, self.zoom_x,self.zoom_y,self.mirror,self.angle,self.opacity]
  322.   end
  323.    
  324.   #--------------------------------------------------------------------------
  325.   # ● Execute Start Animation
  326.   #--------------------------------------------------------------------------         
  327.   def execute_start_animation
  328.       return if !@wait_motion_start
  329.       s_x = 1 + ((self.x - @original_set[0]).abs / (20 + @start_speed[0]))
  330.       s_y = 1 + ((self.y - @original_set[1]).abs / (20 + @start_speed[1]))      
  331.       if self.x < @original_set[0]
  332.          self.x += s_x
  333.          self.x = @original_set[0] if self.x >= @original_set[0]
  334.       elsif self.x > @original_set[0]
  335.          self.x -= s_x
  336.          self.x = @original_set[0] if self.x <= @original_set[0]
  337.       end
  338.       if self.y < @original_set[1]
  339.          self.y += s_y
  340.          self.y = @original_set[1] if self.y > @original_set[1]
  341.       elsif self.y > @original_set[1]
  342.          self.y -= s_y
  343.          self.y = @original_set[1] if self.y < @original_set[1]
  344.       end
  345.       if self.zoom_x != @original_set[2]
  346.          if self.zoom_x > @original_set[2]
  347.             self.zoom_x -= 0.01
  348.             self.zoom_x = @original_set[2] if self.zoom_x < @original_set[2]
  349.          elsif self.zoom_x < @original_set[2]
  350.             self.zoom_x += 0.01
  351.             self.zoom_x = @original_set[2] if self.zoom_x > @original_set[2]
  352.          end         
  353.       end  
  354.       if self.zoom_y != @original_set[3]
  355.          if self.zoom_y > @original_set[3]
  356.             self.zoom_y -= 0.01
  357.             self.zoom_y = @original_set[3] if self.zoom_y < @original_set[3]
  358.          elsif self.zoom_y < @original_set[3]
  359.             self.zoom_y += 0.01
  360.             self.zoom_y = @original_set[3] if self.zoom_y > @original_set[3]
  361.          end         
  362.       end        
  363.       self.opacity += 10
  364.       if self.angle > 0
  365.          self.angle -= 5
  366.          self.angle = @original_set[5] if self.angle < @original_set[5]
  367.       end
  368.       if self.src_rect.y != 0
  369.          self.src_rect.y += @scr_rect_speed
  370.          self.src_rect.y = 0 if self.src_rect.y > 0
  371.       end
  372.       if sprite_original_set?  
  373.          @wait_motion_start = false
  374.          self.src_rect.y = 0
  375.       end   
  376.   end  
  377.   
  378.   #--------------------------------------------------------------------------
  379.   # ● Sprite original Set?
  380.   #--------------------------------------------------------------------------         
  381.   def sprite_original_set?
  382.       return false if self.x != @original_set[0]
  383.       return false if self.y != @original_set[1]
  384.       return false if self.zoom_x != @original_set[2]
  385.       return false if self.zoom_y != @original_set[3]      
  386.       return false if self.mirror != @original_set[4]
  387.       return false if self.angle != @original_set[5]
  388.       return false if self.opacity != @original_set[6]
  389.       return false if self.src_rect.y != 0
  390.       return true
  391.   end  
  392.   
  393.   #--------------------------------------------------------------------------
  394.   # ● Setup Initial Motion
  395.   #--------------------------------------------------------------------------        
  396.   def execute_motion_damage
  397.       damage_refresh
  398.       update_motion_damage
  399.   end
  400.   
  401.   #--------------------------------------------------------------------------
  402.   # ● Damage Refresh
  403.   #--------------------------------------------------------------------------         
  404.   def damage_refresh
  405.       return if @battler.motion_damage[0] == 0
  406.       if @battler.motion_damage[1] == 0
  407.          @damage_pre_set = [self.x, self.y, self.zoom_x,self.zoom_y,self.mirror,self.angle,self.opacity]
  408.       end
  409.       @battler.motion_damage[0] = 0
  410.       @battler.motion_damage[1] = 45
  411.   end
  412.   
  413.   #--------------------------------------------------------------------------
  414.   # ● Update Motion Damage
  415.   #--------------------------------------------------------------------------            
  416.   def update_motion_damage
  417.       return if @battler.motion_damage[1] == 0
  418.       self.x = @damage_pre_set[0] + rand(@battler.motion_damage[1])
  419.       @battler.motion_damage[1] -= 1
  420.       if @battler.motion_damage[1] == 0
  421.          if $mog_rgss3_battle_hud != nil and @battler.is_a?(Game_Actor)
  422.             return_set(@original_set)
  423.          else  
  424.             return_set(@damage_pre_set)
  425.          end   
  426.       end  
  427.   end  
  428.   
  429.   #--------------------------------------------------------------------------
  430.   # ● Setup Motion Stand
  431.   #--------------------------------------------------------------------------        
  432.   def setup_motion_stand      
  433.       @breath_range = [0.9, 1.0]
  434.       @float_range = [@battler.screen_y - 10, @battler.screen_y + 10]
  435.       @side_range = [@battler.screen_x - 10, @battler.screen_x + 10]
  436.       @battler.motion_stand[1] = 0
  437.       case @battler.motion_stand[0]
  438.          when 0
  439.              self.zoom_y = @breath_range[0] + (rand(10) / 100.0)
  440.              @battler.motion_stand[1] = rand(2)
  441.          when 1
  442.              self.y += 10 - rand(20)
  443.              @battler.motion_stand[1] = rand(2)
  444.          when 2
  445.              self.x += 10 - rand(20)
  446.              @battler.motion_stand[1] = rand(2)            
  447.       end   
  448.   end
  449.    
  450.   #--------------------------------------------------------------------------
  451.   # ● Execute Motion Animation
  452.   #--------------------------------------------------------------------------        
  453.   def execute_motion_animation
  454.       return if @old_motion_action != -1
  455.       return if @battler.motion_damage[1] > 0
  456.       case @battler.motion_stand[0]
  457.          when 0
  458.              update_motion_breath
  459.          when 1  
  460.              update_motion_float
  461.          when 2
  462.              update_motion_side
  463.       end        
  464.   end  
  465.   
  466.   #--------------------------------------------------------------------------
  467.   # ● Update Motion Breath
  468.   #--------------------------------------------------------------------------         
  469.   def update_motion_breath  
  470.       case @battler.motion_stand[1]
  471.          when 0
  472.            self.zoom_y -= 0.002
  473.            if self.zoom_y <= @breath_range[0]
  474.               @battler.motion_stand[1] = 1
  475.               self.zoom_y = @breath_range[0]
  476.            end   
  477.          when 1  
  478.            self.zoom_y += 0.002
  479.            if self.zoom_y >= @breath_range[1]
  480.               @battler.motion_stand[1] = 0
  481.               self.zoom_y = @breath_range[1]
  482.            end   
  483.       end
  484.   end  
  485.   
  486.   #--------------------------------------------------------------------------
  487.   # ● Update Motion Float
  488.   #--------------------------------------------------------------------------         
  489.   def update_motion_float
  490.       @motion_speed += 1
  491.       return if @motion_speed < 5
  492.       @motion_speed = 0
  493.       case @battler.motion_stand[1]
  494.            when 0
  495.                 self.y -= 1
  496.                 if self.y < @float_range[0]
  497.                    self.y = @float_range[0]
  498.                    @battler.motion_stand[1] = 1
  499.                 end   
  500.            when 1  
  501.                 self.y += 1
  502.                 if self.y > @float_range[1]
  503.                    self.y = @float_range[1]
  504.                    @battler.motion_stand[1] = 0
  505.                 end                  
  506.       end
  507.   end   
  508.   
  509.   #--------------------------------------------------------------------------
  510.   # ● Update Motion Side
  511.   #--------------------------------------------------------------------------         
  512.   def update_motion_side
  513.       @motion_speed += 1
  514.       return if @motion_speed < 5
  515.       @motion_speed = 0
  516.       case @battler.motion_stand[1]
  517.            when 0
  518.                 self.x -= 1
  519.                 if self.x < @side_range[0]
  520.                    self.x = @side_range[0]
  521.                    @battler.motion_stand[1] = 1
  522.                 end   
  523.            when 1  
  524.                 self.x += 1
  525.                 if self.x > @side_range[1]
  526.                    self.x = @side_range[1]
  527.                    @battler.motion_stand[1] = 0
  528.                 end                  
  529.       end
  530.   end     
  531.   
  532. end

  533. #==============================================================================
  534. # ■ Game Action
  535. #==============================================================================
  536. class Game_Action
  537.   
  538.   #--------------------------------------------------------------------------
  539.   # ● Prepare
  540.   #--------------------------------------------------------------------------                  
  541.   alias mog_motion_action_prepare prepare
  542.   def prepare
  543.       mog_motion_action_prepare   
  544.       set_motion_action
  545.   end
  546.    
  547.   #--------------------------------------------------------------------------
  548.   # ● Set Motion Action
  549.   #--------------------------------------------------------------------------                    
  550.   def set_motion_action
  551.       return if @item.object == nil or subject == nil      
  552.       subject.motion_action[0] = $1.to_i if @item.object.note =~ /<Motion Action = (\d+)>/i
  553.   end
  554.   
  555. end

  556. #==============================================================================
  557. # ■ Sprite Battler
  558. #==============================================================================
  559. class Sprite_Battler < Sprite_Base
  560.   
  561.   #--------------------------------------------------------------------------
  562.   # ● Setup Motion Action
  563.   #--------------------------------------------------------------------------        
  564.   def setup_motion_action
  565.       @battler.motion_action = [-1,0]
  566.       @old_motion_action = @battler.motion_action[0]
  567.       @pre_set = [self.x, self.y, self.zoom_x,self.zoom_y,self.mirror,self.angle,self.opacity]
  568.   end
  569.   
  570.   #--------------------------------------------------------------------------
  571.   # ● Refresh Action
  572.   #--------------------------------------------------------------------------         
  573.   def refresh_action
  574.       return if @old_motion_action == @battler.motion_action[0]
  575.       if @old_motion_action == -1
  576.          @pre_set = [self.x, self.y, self.zoom_x,self.zoom_y,self.mirror,self.angle,self.opacity]
  577.       end
  578.       @battler.motion_action[1] = 0  
  579.       return_set(@pre_set)
  580.       @old_motion_action = @battler.motion_action[0]
  581.       self.src_rect.y =  0
  582.   end  
  583.   
  584.   #--------------------------------------------------------------------------
  585.   # ● Execute Motion Action
  586.   #--------------------------------------------------------------------------            
  587.   def execute_motion_action
  588.       return if @battler.motion_damage[1] > 0
  589.       refresh_action
  590.       update_motion_action
  591.   end  
  592.   
  593.   #--------------------------------------------------------------------------
  594.   # ● Update Motion Action
  595.   #--------------------------------------------------------------------------              
  596.   def update_motion_action
  597.       return if @battler.motion_action[0] == -1
  598.       @battler.motion_action[1] += 1
  599.       case @battler.motion_action[0]
  600.            when 0
  601.               update_motion_zoom
  602.            when 1
  603.               update_motion_jump
  604.            when 2  
  605.               update_motion_round_right
  606.            when 3
  607.               update_motion_round_left
  608.            when 4
  609.               update_motion_shake
  610.            when 5
  611.               update_motion_front
  612.            when 6   
  613.               update_motion_step_left
  614.            when 7
  615.               update_motion_step_right              
  616.       end
  617.   end
  618.   
  619.   #--------------------------------------------------------------------------
  620.   # ● Update Motion Step Left
  621.   #--------------------------------------------------------------------------                  
  622.   def update_motion_step_left
  623.       case @battler.motion_action[1]
  624.            when 1..20
  625.                 self.x -= 2
  626.            when 21..40  
  627.                 self.x += 2           
  628.            else
  629.            end_action
  630.       end   
  631.    
  632.   end  
  633.   
  634.   #--------------------------------------------------------------------------
  635.   # ● Update Motion Step Right
  636.   #--------------------------------------------------------------------------                  
  637.   def update_motion_step_right
  638.       case @battler.motion_action[1]
  639.            when 1..20
  640.                 self.x += 2
  641.            when 21..40  
  642.                 self.x -= 2           
  643.            else
  644.         end_action   
  645.       end   
  646.   end   
  647.   
  648.   #--------------------------------------------------------------------------
  649.   # ● Update Motion Shake
  650.   #--------------------------------------------------------------------------               
  651.   def update_motion_shake
  652.       self.x = @pre_set[0] + rand(@battler.motion_action[1])
  653.       end_action if @battler.motion_action[1] > 40
  654.   end   
  655.   
  656.   #--------------------------------------------------------------------------
  657.   # ● Update Motion Zoom
  658.   #--------------------------------------------------------------------------               
  659.   def update_motion_zoom
  660.       case @battler.motion_action[1]
  661.         when 1..20
  662.            self.zoom_x += 0.01
  663.            self.zoom_y += 0.01
  664.         when 21..40
  665.            self.zoom_x -= 0.01
  666.            self.zoom_y -= 0.01         
  667.         else  
  668.         end_action   
  669.       end
  670.   end
  671.   
  672.   #--------------------------------------------------------------------------
  673.   # ● Update Motion Jump
  674.   #--------------------------------------------------------------------------                  
  675.   def update_motion_jump
  676.       case @battler.motion_action[1]
  677.         when 1..20
  678.             self.y -= 9
  679.             self.zoom_x += 0.01
  680.             self.zoom_y += 0.01
  681.             self.mirror = true
  682.             self.angle += 9
  683.         when 21..40
  684.             self.y += 9
  685.             self.zoom_x -= 0.01
  686.             self.zoom_y -= 0.01            
  687.             self.mirror = false
  688.             self.angle += 9
  689.         else  
  690.         self.angle = 0
  691.         end_action   
  692.       end      
  693.   end
  694.   
  695.   #--------------------------------------------------------------------------
  696.   # ● Update Motion Front
  697.   #--------------------------------------------------------------------------                  
  698.   def update_motion_front
  699.       case @battler.motion_action[1]
  700.         when 1..20
  701.             self.y += 3
  702.             self.zoom_x += 0.02
  703.             self.zoom_y += 0.02
  704.         when 21..40
  705.             self.y -= 3
  706.             self.zoom_x -= 0.02
  707.             self.zoom_y -= 0.02            
  708.         else  
  709.         end_action   
  710.       end      
  711.   end
  712.   
  713.   #--------------------------------------------------------------------------
  714.   # ● Update Motion Round Left
  715.   #--------------------------------------------------------------------------                    
  716.   def update_motion_round_left
  717.       case @battler.motion_action[1]
  718.         when 1..15
  719.             self.y += 3
  720.             self.x -= 3
  721.             self.mirror = false
  722.         when 16..30
  723.             self.x += 6
  724.             self.mirror = true
  725.         when 31..45
  726.             self.y -= 3
  727.             self.x -= 3
  728.             self.mirror = false
  729.         else  
  730.         end_action  
  731.       end        
  732.   end
  733.   
  734.   #--------------------------------------------------------------------------
  735.   # ● Update Motion Round Right
  736.   #--------------------------------------------------------------------------                    
  737.   def update_motion_round_right
  738.       case @battler.motion_action[1]
  739.         when 1..15
  740.             self.y += 3
  741.             self.x += 3
  742.             self.mirror = true            
  743.         when 16..30
  744.             self.x -= 6
  745.              self.mirror = false
  746.         when 31..45
  747.             self.y -= 3
  748.             self.x += 3
  749.             self.mirror = true
  750.         else  
  751.         end_action   
  752.       end   
  753.   end  
  754.   
  755.   #--------------------------------------------------------------------------
  756.   # ● End Action
  757.   #--------------------------------------------------------------------------                     
  758.   def end_action
  759.       if $mog_rgss3_battle_hud != nil and @battler.is_a?(Game_Actor)
  760.          return_set(@original_set)
  761.       else  
  762.          return_set(@pre_set)  
  763.       end
  764.       @battler.motion_action = [-1,0]
  765.   end  
  766.   
  767. end

  768. #==============================================================================
  769. # ■ Sprite Battler
  770. #==============================================================================
  771. class Sprite_Battler < Sprite_Base

  772.   #--------------------------------------------------------------------------
  773.   # ● Update Blink
  774.   #--------------------------------------------------------------------------      
  775.   alias mog_motion_animation_update_blink update_blink
  776.   def update_blink
  777.       return if @battler.dead?
  778.       mog_motion_animation_update_blink
  779.   end
  780.   
  781.   #--------------------------------------------------------------------------
  782.   # ● Update Collapse
  783.   #--------------------------------------------------------------------------
  784.   def update_collapse   
  785.   end
  786.   
  787.   #--------------------------------------------------------------------------
  788.   # ● Execute Motion Collapse
  789.   #--------------------------------------------------------------------------   
  790.   def execute_motion_collapse
  791.       collapse_end if self.opacity == 0
  792.       @battler.motion_collapse[1] += 1      
  793.       case @battler.motion_collapse[0]
  794.            when 0;     update_collapse_vertical
  795.            when 1;     update_collapse_horizontal
  796.            when 2;     update_collapse_zoom_out
  797.            when 3;     update_collapse_zoom_in
  798.            when 4;     update_collapse_zoom_in_out
  799.            when 5;     update_collapse_boss_2
  800.            when 6;     update_collpase_do_nothing
  801.            else ;      update_collapse_normal
  802.       end
  803.         
  804.   end

  805.   #--------------------------------------------------------------------------
  806.   # ● Can Execute Collapse
  807.   #--------------------------------------------------------------------------      
  808.   def can_execute_collapse?
  809.       return false if !@battler.dead?
  810.       return false if @collapse_done
  811.       return true
  812.   end
  813.   
  814.   #--------------------------------------------------------------------------
  815.   # ● Update Collapse Vertical
  816.   #--------------------------------------------------------------------------        
  817.   def update_collapse_vertical
  818.       self.zoom_y += 0.1
  819.       self.zoom_x -= 0.02         
  820.       self.opacity -= 3   
  821.   end
  822.   
  823.   #--------------------------------------------------------------------------
  824.   # ● Update Collapse Horizontal
  825.   #--------------------------------------------------------------------------         
  826.   def update_collapse_horizontal
  827.       self.zoom_x += 0.1
  828.       self.zoom_y -= 0.02      
  829.       self.opacity -= 3      
  830.   end
  831.      
  832.   #--------------------------------------------------------------------------
  833.   # ● Update Collapse Zoom Out
  834.   #--------------------------------------------------------------------------            
  835.   def update_collapse_zoom_out     
  836.       self.zoom_x += 0.02
  837.       self.zoom_y += 0.02     
  838.       self.opacity -= 4   
  839.   end
  840.       
  841.   #--------------------------------------------------------------------------
  842.   # ● Update Collapse Zoom IN
  843.   #--------------------------------------------------------------------------              
  844.   def update_collapse_zoom_in
  845.       self.zoom_x -= 0.01
  846.       self.zoom_y -= 0.01      
  847.       self.opacity -= 4            
  848.   end
  849.   
  850.   #--------------------------------------------------------------------------
  851.   # ● Update Collapse Zoom IN OUT
  852.   #--------------------------------------------------------------------------               
  853.   def update_collapse_zoom_in_out
  854.       case @battler.motion_collapse[1]
  855.            when 0..30
  856.                 self.zoom_x += 0.1
  857.                 self.zoom_y -= 0.02
  858.                 self.opacity -= 2
  859.            else  
  860.                 self.zoom_y += 0.5
  861.                 self.zoom_x -= 0.2
  862.                 self.opacity -= 10
  863.       end      
  864.   end
  865.      
  866.   #--------------------------------------------------------------------------
  867.   # ● Update Collapse Boss 2
  868.   #--------------------------------------------------------------------------                  
  869.   def update_collapse_boss_2
  870.       self.x = @original_set[0] + rand(10)
  871.       self.src_rect.y -= 1
  872.       self.opacity = 0 if self.src_rect.y < -self.bitmap.height
  873.   end
  874.       
  875.   #--------------------------------------------------------------------------
  876.   # ● Update Collapse do nothing
  877.   #--------------------------------------------------------------------------                    
  878.   def update_collpase_do_nothing
  879.    
  880.   end  
  881.   
  882.   #--------------------------------------------------------------------------
  883.   # ● Update Collapse Normal
  884.   #--------------------------------------------------------------------------                    
  885.   def update_collapse_normal
  886.       self.opacity -= 3
  887.       self.blend_type = 1
  888.   end  
  889.   
  890.   #--------------------------------------------------------------------------
  891.   # ● Collapse End
  892.   #--------------------------------------------------------------------------      
  893.   def collapse_end
  894.       @collapse_done = true
  895.       return_set(@original_set)
  896.       self.src_rect.y = -self.bitmap.height unless @battler.motion_collapse[0] == 6
  897.   end  

  898.   #--------------------------------------------------------------------------
  899.   # ● Revert to Normal
  900.   #--------------------------------------------------------------------------        
  901.   alias mog_battler_motion_revert_to_normal revert_to_normal
  902.   def revert_to_normal
  903.       if @collapse_done
  904.          @collapse_done = false
  905.          return_set(@original_set)
  906.       end
  907.       mog_battler_motion_revert_to_normal
  908.   end  
  909.   
  910. end

  911. $mog_rgss3_battler_motion = true
复制代码
梦石
0
星屑
50
在线时间
212 小时
注册时间
2012-3-5
回帖
206
发表于 2012-12-18 22:26:58 | 显示全部楼层
问下,设置<Motion Action = X>攻击时的动作貌似没反应,是不是还要其他脚本配合呢?

点评

搞错了~原来是要放技能备注里~嘿~自问自答了~  发表于 2012-12-18 22:30
回复

使用道具 举报

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

本版积分规则

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

在本版发帖返回顶部