查看: 3142|回复: 6

[已经解决] 如何更改默认战斗敌人攻击我方时的屏幕晃动效果。

[复制链接]
梦石
0
星屑
52
在线时间
509 小时
注册时间
2012-6-18
回帖
519

短篇七萝莉正太组亚军

发表于 2013-5-6 14:30:27 | 显示全部楼层 |阅读模式

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

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

×
本帖最后由 Sion 于 2013-5-25 17:52 编辑

最近一直在研究va的默认战斗,我觉得默认战斗其实还是很不错的(找VX的默认战斗真是进化了不知多少啊)但总觉的不够,总觉得打击感稍差了些,我方攻击敌方时可以通过动画和音效的配合实现好的打击感,加上一个稍好的蹦血脚本就很完美了,但是敌方攻击我方时的攻击效果不怎么理想,敌人只是闪烁一下屏幕一震,显示个受伤的音效,就结束了总感觉不够,想加点什么。于是就试着想更改游戏的默认战斗,但是又想起来自己是个脚本盲。。。只能看懂几个非常非常简单的脚本。弄了一天也没弄明白咋搞。



我就是想让敌方攻击我方时,敌方图片跳动一下,(看着敌人在那呆着不动很不真实)着屏幕震动的频率加大,让屏幕晃动更剧烈,再加以一个红色画面闪烁。但是就是不知道在哪改,怎么改,求会脚本大神帮帮忙呗。。。
找工作中。。。。。。
个人的最新画作:
照片头像写生,抖森一枚
梦石
0
星屑
50
在线时间
687 小时
注册时间
2012-10-29
回帖
1526
发表于 2013-5-6 17:14:27 | 显示全部楼层
建议您去下面这个网址去找 MOG - Battler Motion (v1.4) 脚本,它的功能就是处理战斗时敌人与玩家角色的各种动作,包含:

1. 进入战斗画面时的动作,玩家角色是翻筋斗进来,还是从左边移进来,上面掉下来,地下钻上来,从远到近,从大到小
2. 等待动画,没攻击前待机动作,会飞的飘浮上下,不会飞的左右晃动,或前后移动,上下伸缩
3. 使用特技或物品时的动作,向上伸展,翻筋斗,左向右或右向左绕圈并水平翻转,左右震动,放大拉近,左移闪,右移闪
4. 死亡动画,垂直崩溃,水平崩溃,缩小,放大,变焦

目前来说,是我见过纵版战斗动作最精彩的。

点评

但是我想实现的那种敌人攻击我方,屏幕震动程度加大的问题还是没解决  发表于 2013-5-6 19:46
基本已经会用了,谢谢  发表于 2013-5-6 19:22

评分

参与人数 1星屑 +20 收起 理由
小强无敌 + 20 认可答案

查看全部评分

修改劇本中,仔細審查原來的劇情大綱,覺得有點不太滿意,嘗試編寫不同主角不同主線的劇情,希望能寫得出來。
回复

使用道具 举报

梦石
0
星屑
52
在线时间
509 小时
注册时间
2012-6-18
回帖
519

短篇七萝莉正太组亚军

 楼主| 发表于 2013-5-6 18:46:51 | 显示全部楼层
j433463 发表于 2013-5-6 17:14
建议您去下面这个网址去找 MOG - Battler Motion (v1.4) 脚本,它的功能就是处理战斗时敌人与玩家角色的各 ...

找到这个脚本了,可惜并不会用,目前只是实现了攻击敌人敌人会晃动的效果(好像是原本就自带的)。有没有什么教程啥的或者是具体的使用方法,不会用。
找工作中。。。。。。
个人的最新画作:
照片头像写生,抖森一枚
回复

使用道具 举报

梦石
0
星屑
50
在线时间
687 小时
注册时间
2012-10-29
回帖
1526
发表于 2013-5-7 06:46:35 | 显示全部楼层
本帖最后由 j433463 于 2013-5-7 06:48 编辑

屏幕震动这很简单,它是 Game_Screen 中 def start_shake 控制的,它有三个参数,其中第一个是震动强度,第二个是震动速度,第三个就是震动期间

而攻击时画面震动的效果在 Game_Actor 的 def Perform_damage_dffect 执行伤害效果这儿,改 start_shake(5, 5 , 10) 的值就可以了,改数字而已。


至于震动后加上色调变化,可以在 Sound.plsy_actor_damage 的前面加上 $game_troop.screen.start_flash(Color.new(255,0,0,128), 8) 就有红光闪烁了。


不过,震动强度改太大,震动时会出现黑边,其实不太好看的。

点评

刚试了新工程也这样,只打上脚本后点保存工程再进战斗,左上角的扣血信息就只显示1.  发表于 2013-5-7 20:21
很奇怪啊,我再新的工程里也没有问题,但是在我那游戏里就有问题,然后换了我之前的作品里,也有问题。  发表于 2013-5-7 20:15
我建了工程测试,左上角的战斗日志讯息很正常啊!是否与您某个脚本冲突了?您新建个工程放上动作脚本试试看有没有同样情形?  发表于 2013-5-7 14:50
呃?那个脚本只是设置角色动作,好像没有与 BattleLog 内容有关的地方吧?  发表于 2013-5-7 14:46
好像又出问题了,用了那个动作脚本之后,左上角的信息显示出BUG伤害不管是多少都只显示为1,如果删除脚本,信息才回复正常。  发表于 2013-5-7 14:03

评分

参与人数 1星屑 +20 收起 理由
小强无敌 + 20 认可答案

查看全部评分

修改劇本中,仔細審查原來的劇情大綱,覺得有點不太滿意,嘗試編寫不同主角不同主線的劇情,希望能寫得出來。
回复

使用道具 举报

梦石
0
星屑
52
在线时间
509 小时
注册时间
2012-6-18
回帖
519

短篇七萝莉正太组亚军

 楼主| 发表于 2013-5-7 12:44:41 | 显示全部楼层
j433463 发表于 2013-5-7 06:46
屏幕震动这很简单,它是 Game_Screen 中 def start_shake 控制的,它有三个参数,其中第一个是震动强度,第 ...

哎呀,非常感谢你,真是帮了我大忙了,谢谢。
找工作中。。。。。。
个人的最新画作:
照片头像写生,抖森一枚
回复

使用道具 举报

梦石
0
星屑
52
在线时间
509 小时
注册时间
2012-6-18
回帖
519

短篇七萝莉正太组亚军

 楼主| 发表于 2013-5-7 20:33:16 | 显示全部楼层
j433463 发表于 2013-5-7 06:46
屏幕震动这很简单,它是 Game_Screen 中 def start_shake 控制的,它有三个参数,其中第一个是震动强度,第 ...

我再把脚本贴一下吧,可能我这个脚本的问题,这个脚本是放在哪哪的战斗信息出问题,不予任何脚本冲突就是本身脚本问题,话说你说的1.4版本没有找到,这是1.3版本的。如果您有1.4版的能不能传给我。
  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.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.    attr_accessor :motion_start
  142.    attr_accessor :motion_stand
  143.    attr_accessor :motion_action
  144.    attr_accessor :motion_damage
  145.    attr_accessor :motion_collapse

  146.   #--------------------------------------------------------------------------
  147.   # ● Initialize
  148.   #--------------------------------------------------------------------------      
  149.    alias mog_motion_animation_initialize initialize
  150.    def initialize
  151.        mog_motion_animation_initialize
  152.        @motion_start = -1
  153.        @motion_stand = [-1,0]
  154.        @motion_action = [-1,0]
  155.        @motion_collapse = [7,0]
  156.        @motion_damage = [0,0]
  157.    end     

  158.   #--------------------------------------------------------------------------
  159.   # ● Added New State
  160.   #--------------------------------------------------------------------------  
  161.   alias mog_motion_animation_add_new_state add_new_state
  162.   def add_new_state(state_id)
  163.       mog_motion_animation_add_new_state(state_id)
  164.       self.motion_damage[0] = 1 if $data_states[state_id].note =~ /<Bad State>/
  165.   end   

  166. end

  167. #==============================================================================
  168. # ■ Game_Enemy
  169. #==============================================================================
  170. class Game_Enemy < Game_Battler

  171.   #--------------------------------------------------------------------------
  172.   # ● Initialize
  173.   #--------------------------------------------------------------------------
  174.   alias mog_motion_animation_enemy_initialize initialize
  175.   def initialize(index, enemy_id)
  176.       mog_motion_animation_enemy_initialize(index, enemy_id)
  177.       setup_motion_animation(enemy_id)
  178.   end

  179.   #--------------------------------------------------------------------------
  180.   # ● Setup Motion Animation
  181.   #--------------------------------------------------------------------------  
  182.   def setup_motion_animation(enemy_id)
  183.       self.motion_stand[0] = $1.to_i if  enemy.note =~ /<Motion Standby = (\d+)>/i
  184.       self.motion_collapse[0] = $1.to_i if  enemy.note =~ /<Motion Collapse = (\d+)>/i
  185.       self.motion_start =  $1.to_i if  enemy.note =~ /<Motion Appear = (\d+)>/i
  186.   end
  187. end

  188. #==============================================================================
  189. # ■ Game Actor
  190. #==============================================================================
  191. class Game_Actor < Game_Battler

  192.   #--------------------------------------------------------------------------
  193.   # ● Setup
  194.   #--------------------------------------------------------------------------
  195.   alias mog_motion_animation_actor_setup setup
  196.   def setup(actor_id)
  197.       mog_motion_animation_actor_setup(actor_id)
  198.       self.motion_stand[0] = $1.to_i if  actor.note =~ /<Motion Standby = (\d+)>/i
  199.       self.motion_collapse[0] = $1.to_i if  actor.note =~ /<Motion Collapse = (\d+)>/i      
  200.       self.motion_start =  $1.to_i if  actor.note =~ /<Motion Appear = (\d+)>/i  
  201.   end

  202. end

  203. #==============================================================================
  204. # ■ Game_ActionResult
  205. #==============================================================================
  206. class Game_ActionResult

  207.   #--------------------------------------------------------------------------
  208.   # ● HP Damage Text
  209.   #--------------------------------------------------------------------------
  210.   alias mog_motion_animation_hp_damage_text hp_damage_text
  211.   def hp_damage_text
  212.       mog_motion_animation_hp_damage_text
  213.       @battler.motion_damage[0] = 1 if @hp_damage > 0
  214.   end  
  215. end   

  216. #==============================================================================
  217. # ■ Sprite Battler
  218. #==============================================================================
  219. class Sprite_Battler < Sprite_Base

  220.   #--------------------------------------------------------------------------
  221.   # ● Update Position
  222.   #--------------------------------------------------------------------------  
  223.   alias mog_motion_animation_update_position update_position
  224.   def update_position
  225.       if @battler.use_sprite?
  226.          update_motion_animation
  227.          return
  228.       end   
  229.       mog_motion_animation_update_position
  230.   end  

  231.   #--------------------------------------------------------------------------
  232.   # ● Update Motion Animation
  233.   #--------------------------------------------------------------------------   
  234.   def update_motion_animation
  235.       setup_initial_motion
  236.       execute_start_animation
  237.       return if @wait_motion_start
  238.       if can_execute_collapse?
  239.          execute_motion_collapse
  240.       else  
  241.          execute_motion_damage
  242.          execute_motion_animation
  243.          execute_motion_action
  244.       end
  245.   end

  246.   #--------------------------------------------------------------------------
  247.   # ● Setup Initial Motion
  248.   #--------------------------------------------------------------------------      
  249.   def setup_initial_motion
  250.       return if @motion_initial != nil
  251.       @motion_initial = true
  252.       @collapse_done = false
  253.       @motion_speed = 0
  254.       @start_speed = [0,0]
  255.       @battler.motion_collapse[1] = 0
  256.       self.x = @battler.screen_x rescue 0
  257.       self.y = @battler.screen_y rescue 0
  258.       self.z = @battler.screen_z rescue 100
  259.       setup_motion_stand
  260.       @original_set = [self.x, self.y, self.zoom_x,self.zoom_y,self.mirror,self.angle,self.opacity]      
  261.       setup_motion_start
  262.       setup_motion_damage            
  263.       setup_motion_action
  264.   end  

  265.   #--------------------------------------------------------------------------
  266.   # ● Return Set
  267.   #--------------------------------------------------------------------------         
  268.   def return_set(value)
  269.       self.x = value[0]
  270.       self.y = value[1]
  271.       self.zoom_x = value[2]
  272.       self.zoom_y = value[3]
  273.       self.mirror = value[4]
  274.       self.angle = value[5]
  275.       self.opacity = value[6]
  276.   end  

  277.   #--------------------------------------------------------------------------
  278.   # ● setup_motion_start
  279.   #--------------------------------------------------------------------------            
  280.   def setup_motion_start
  281.       @wait_motion_start = true
  282.       @scr_rect_speed = 1
  283.       case @battler.motion_start
  284.          when 0  
  285.             self.x = 0 - (self.bitmap.width + rand(100))
  286.          when 1
  287.             self.y = 0 - (self.bitmap.height + rand(100))
  288.          when 2   
  289.             self.angle = 360
  290.             self.x = 0 - self.bitmap.width
  291.          when 3   
  292.             self.zoom_x = 1.5 + (rand(10) / 100.0)
  293.             self.zoom_y = self.zoom_x
  294.             self.opacity = 0
  295.          when 4
  296.             self.zoom_x = 0.2 + (rand(10) / 100.0)
  297.             self.zoom_y = self.zoom_x
  298.             self.opacity = 0
  299.          when 5   
  300.             self.src_rect.y = -self.bitmap.height
  301.             @scr_rect_speed = self.bitmap.height / 40
  302.             @scr_rect_speed = 1 if @scr_rect_speed <= 0
  303.          else   
  304.            @wait_motion_start = false
  305.       end   
  306.   end  

  307.   #--------------------------------------------------------------------------
  308.   # ● Setup Motion Damage
  309.   #--------------------------------------------------------------------------        
  310.   def setup_motion_damage
  311.       @battler.motion_damage = [0,0]
  312.       @damage_pre_set = [self.x, self.y, self.zoom_x,self.zoom_y,self.mirror,self.angle,self.opacity]
  313.   end

  314.   #--------------------------------------------------------------------------
  315.   # ● Execute Start Animation
  316.   #--------------------------------------------------------------------------         
  317.   def execute_start_animation
  318.       return if !@wait_motion_start
  319.       s_x = 1 + ((self.x - @original_set[0]).abs / (20 + @start_speed[0]))
  320.       s_y = 1 + ((self.y - @original_set[1]).abs / (20 + @start_speed[1]))      
  321.       if self.x < @original_set[0]
  322.          self.x += s_x
  323.          self.x = @original_set[0] if self.x >= @original_set[0]
  324.       elsif self.x > @original_set[0]
  325.          self.x -= s_x
  326.          self.x = @original_set[0] if self.x <= @original_set[0]
  327.       end
  328.       if self.y < @original_set[1]
  329.          self.y += s_y
  330.          self.y = @original_set[1] if self.y > @original_set[1]
  331.       elsif self.y > @original_set[1]
  332.          self.y -= s_y
  333.          self.y = @original_set[1] if self.y < @original_set[1]
  334.       end
  335.       if self.zoom_x != @original_set[2]
  336.          if self.zoom_x > @original_set[2]
  337.             self.zoom_x -= 0.01
  338.             self.zoom_x = @original_set[2] if self.zoom_x < @original_set[2]
  339.          elsif self.zoom_x < @original_set[2]
  340.             self.zoom_x += 0.01
  341.             self.zoom_x = @original_set[2] if self.zoom_x > @original_set[2]
  342.          end         
  343.       end  
  344.       if self.zoom_y != @original_set[3]
  345.          if self.zoom_y > @original_set[3]
  346.             self.zoom_y -= 0.01
  347.             self.zoom_y = @original_set[3] if self.zoom_y < @original_set[3]
  348.          elsif self.zoom_y < @original_set[3]
  349.             self.zoom_y += 0.01
  350.             self.zoom_y = @original_set[3] if self.zoom_y > @original_set[3]
  351.          end         
  352.       end        
  353.       self.opacity += 10
  354.       if self.angle > 0
  355.          self.angle -= 5
  356.          self.angle = @original_set[5] if self.angle < @original_set[5]
  357.       end
  358.       if self.src_rect.y != 0
  359.          self.src_rect.y += @scr_rect_speed
  360.          self.src_rect.y = 0 if self.src_rect.y > 0
  361.       end
  362.       if sprite_original_set?  
  363.          @wait_motion_start = false
  364.          self.src_rect.y = 0
  365.       end   
  366.   end  

  367.   #--------------------------------------------------------------------------
  368.   # ● Sprite original Set?
  369.   #--------------------------------------------------------------------------         
  370.   def sprite_original_set?
  371.       return false if self.x != @original_set[0]
  372.       return false if self.y != @original_set[1]
  373.       return false if self.zoom_x != @original_set[2]
  374.       return false if self.zoom_y != @original_set[3]      
  375.       return false if self.mirror != @original_set[4]
  376.       return false if self.angle != @original_set[5]
  377.       return false if self.opacity != @original_set[6]
  378.       return false if self.src_rect.y != 0
  379.       return true
  380.   end  

  381.   #--------------------------------------------------------------------------
  382.   # ● Setup Initial Motion
  383.   #--------------------------------------------------------------------------        
  384.   def execute_motion_damage
  385.       damage_refresh
  386.       update_motion_damage
  387.   end

  388.   #--------------------------------------------------------------------------
  389.   # ● Damage Refresh
  390.   #--------------------------------------------------------------------------         
  391.   def damage_refresh
  392.       return if @battler.motion_damage[0] == 0
  393.       if @battler.motion_damage[1] == 0
  394.          @damage_pre_set = [self.x, self.y, self.zoom_x,self.zoom_y,self.mirror,self.angle,self.opacity]
  395.       end
  396.       @battler.motion_damage[0] = 0
  397.       @battler.motion_damage[1] = 45
  398.   end

  399.   #--------------------------------------------------------------------------
  400.   # ● Update Motion Damage
  401.   #--------------------------------------------------------------------------            
  402.   def update_motion_damage
  403.       return if @battler.motion_damage[1] == 0
  404.       self.x = @damage_pre_set[0] + rand(@battler.motion_damage[1])
  405.       @battler.motion_damage[1] -= 1
  406.       if @battler.motion_damage[1] == 0
  407.          if $mog_rgss3_battle_hud != nil and @battler.is_a?(Game_Actor)
  408.             return_set(@original_set)
  409.          else  
  410.             return_set(@damage_pre_set)
  411.          end   
  412.       end  
  413.   end  

  414.   #--------------------------------------------------------------------------
  415.   # ● Setup Motion Stand
  416.   #--------------------------------------------------------------------------        
  417.   def setup_motion_stand      
  418.       @breath_range = [0.9, 1.0]
  419.       @float_range = [@battler.screen_y - 10, @battler.screen_y + 10]
  420.       @side_range = [@battler.screen_x - 10, @battler.screen_x + 10]
  421.       @battler.motion_stand[1] = 0
  422.       case @battler.motion_stand[0]
  423.          when 0
  424.              self.zoom_y = @breath_range[0] + (rand(10) / 100.0)
  425.              @battler.motion_stand[1] = rand(2)
  426.          when 1
  427.              self.y += 10 - rand(20)
  428.              @battler.motion_stand[1] = rand(2)
  429.          when 2
  430.              self.x += 10 - rand(20)
  431.              @battler.motion_stand[1] = rand(2)            
  432.       end   
  433.   end

  434.   #--------------------------------------------------------------------------
  435.   # ● Execute Motion Animation
  436.   #--------------------------------------------------------------------------        
  437.   def execute_motion_animation
  438.       return if @old_motion_action != -1
  439.       return if @battler.motion_damage[1] > 0
  440.       case @battler.motion_stand[0]
  441.          when 0
  442.              update_motion_breath
  443.          when 1  
  444.              update_motion_float
  445.          when 2
  446.              update_motion_side
  447.       end        
  448.   end  

  449.   #--------------------------------------------------------------------------
  450.   # ● Update Motion Breath
  451.   #--------------------------------------------------------------------------         
  452.   def update_motion_breath  
  453.       case @battler.motion_stand[1]
  454.          when 0
  455.            self.zoom_y -= 0.002
  456.            if self.zoom_y <= @breath_range[0]
  457.               @battler.motion_stand[1] = 1
  458.               self.zoom_y = @breath_range[0]
  459.            end   
  460.          when 1  
  461.            self.zoom_y += 0.002
  462.            if self.zoom_y >= @breath_range[1]
  463.               @battler.motion_stand[1] = 0
  464.               self.zoom_y = @breath_range[1]
  465.            end   
  466.       end
  467.   end  

  468.   #--------------------------------------------------------------------------
  469.   # ● Update Motion Float
  470.   #--------------------------------------------------------------------------         
  471.   def update_motion_float
  472.       @motion_speed += 1
  473.       return if @motion_speed < 5
  474.       @motion_speed = 0
  475.       case @battler.motion_stand[1]
  476.            when 0
  477.                 self.y -= 1
  478.                 if self.y < @float_range[0]
  479.                    self.y = @float_range[0]
  480.                    @battler.motion_stand[1] = 1
  481.                 end   
  482.            when 1  
  483.                 self.y += 1
  484.                 if self.y > @float_range[1]
  485.                    self.y = @float_range[1]
  486.                    @battler.motion_stand[1] = 0
  487.                 end                  
  488.       end
  489.   end   

  490.   #--------------------------------------------------------------------------
  491.   # ● Update Motion Side
  492.   #--------------------------------------------------------------------------         
  493.   def update_motion_side
  494.       @motion_speed += 1
  495.       return if @motion_speed < 5
  496.       @motion_speed = 0
  497.       case @battler.motion_stand[1]
  498.            when 0
  499.                 self.x -= 1
  500.                 if self.x < @side_range[0]
  501.                    self.x = @side_range[0]
  502.                    @battler.motion_stand[1] = 1
  503.                 end   
  504.            when 1  
  505.                 self.x += 1
  506.                 if self.x > @side_range[1]
  507.                    self.x = @side_range[1]
  508.                    @battler.motion_stand[1] = 0
  509.                 end                  
  510.       end
  511.   end     

  512. end

  513. #==============================================================================
  514. # ■ Game Action
  515. #==============================================================================
  516. class Game_Action

  517.   #--------------------------------------------------------------------------
  518.   # ● Prepare
  519.   #--------------------------------------------------------------------------                  
  520.   alias mog_motion_action_prepare prepare
  521.   def prepare
  522.       mog_motion_action_prepare   
  523.       set_motion_action
  524.   end

  525.   #--------------------------------------------------------------------------
  526.   # ● Set Motion Action
  527.   #--------------------------------------------------------------------------                    
  528.   def set_motion_action
  529.       return if @item.object == nil or subject == nil      
  530.       subject.motion_action[0] = $1.to_i if @item.object.note =~ /<Motion Action = (\d+)>/i
  531.   end

  532. end

  533. #==============================================================================
  534. # ■ Sprite Battler
  535. #==============================================================================
  536. class Sprite_Battler < Sprite_Base

  537.   #--------------------------------------------------------------------------
  538.   # ● Setup Motion Action
  539.   #--------------------------------------------------------------------------        
  540.   def setup_motion_action
  541.       @battler.motion_action = [-1,0]
  542.       @old_motion_action = @battler.motion_action[0]
  543.       @pre_set = [self.x, self.y, self.zoom_x,self.zoom_y,self.mirror,self.angle,self.opacity]
  544.   end

  545.   #--------------------------------------------------------------------------
  546.   # ● Refresh Action
  547.   #--------------------------------------------------------------------------         
  548.   def refresh_action
  549.       return if @old_motion_action == @battler.motion_action[0]
  550.       if @old_motion_action == -1
  551.          @pre_set = [self.x, self.y, self.zoom_x,self.zoom_y,self.mirror,self.angle,self.opacity]
  552.       end
  553.       @battler.motion_action[1] = 0  
  554.       return_set(@pre_set)
  555.       @old_motion_action = @battler.motion_action[0]
  556.       self.src_rect.y =  0
  557.   end  

  558.   #--------------------------------------------------------------------------
  559.   # ● Execute Motion Action
  560.   #--------------------------------------------------------------------------            
  561.   def execute_motion_action
  562.       return if @battler.motion_damage[1] > 0
  563.       refresh_action
  564.       update_motion_action
  565.   end  

  566.   #--------------------------------------------------------------------------
  567.   # ● Update Motion Action
  568.   #--------------------------------------------------------------------------              
  569.   def update_motion_action
  570.       return if @battler.motion_action[0] == -1
  571.       @battler.motion_action[1] += 1
  572.       case @battler.motion_action[0]
  573.            when 0
  574.               update_motion_zoom
  575.            when 1
  576.               update_motion_jump
  577.            when 2  
  578.               update_motion_round_right
  579.            when 3
  580.               update_motion_round_left
  581.            when 4
  582.               update_motion_shake
  583.            when 5
  584.               update_motion_front
  585.            when 6   
  586.               update_motion_step_left
  587.            when 7
  588.               update_motion_step_right              
  589.       end
  590.   end

  591.   #--------------------------------------------------------------------------
  592.   # ● Update Motion Step Left
  593.   #--------------------------------------------------------------------------                  
  594.   def update_motion_step_left
  595.       case @battler.motion_action[1]
  596.            when 1..20
  597.                 self.x -= 2
  598.            when 21..40  
  599.                 self.x += 2           
  600.            else
  601.            end_action
  602.       end   

  603.   end  

  604.   #--------------------------------------------------------------------------
  605.   # ● Update Motion Step Right
  606.   #--------------------------------------------------------------------------                  
  607.   def update_motion_step_right
  608.       case @battler.motion_action[1]
  609.            when 1..20
  610.                 self.x += 2
  611.            when 21..40  
  612.                 self.x -= 2           
  613.            else
  614.         end_action   
  615.       end   
  616.   end   

  617.   #--------------------------------------------------------------------------
  618.   # ● Update Motion Shake
  619.   #--------------------------------------------------------------------------               
  620.   def update_motion_shake
  621.       self.x = @pre_set[0] + rand(@battler.motion_action[1])
  622.       end_action if @battler.motion_action[1] > 40
  623.   end   

  624.   #--------------------------------------------------------------------------
  625.   # ● Update Motion Zoom
  626.   #--------------------------------------------------------------------------               
  627.   def update_motion_zoom
  628.       case @battler.motion_action[1]
  629.         when 1..20
  630.            self.zoom_x += 0.01
  631.            self.zoom_y += 0.01
  632.         when 21..40
  633.            self.zoom_x -= 0.01
  634.            self.zoom_y -= 0.01         
  635.         else  
  636.         end_action   
  637.       end
  638.   end

  639.   #--------------------------------------------------------------------------
  640.   # ● Update Motion Jump
  641.   #--------------------------------------------------------------------------                  
  642.   def update_motion_jump
  643.       case @battler.motion_action[1]
  644.         when 1..20
  645.             self.y -= 9
  646.             self.zoom_x += 0.01
  647.             self.zoom_y += 0.01
  648.             self.mirror = true
  649.             self.angle += 9
  650.         when 21..40
  651.             self.y += 9
  652.             self.zoom_x -= 0.01
  653.             self.zoom_y -= 0.01            
  654.             self.mirror = false
  655.             self.angle += 9
  656.         else  
  657.         self.angle = 0
  658.         end_action   
  659.       end      
  660.   end

  661.   #--------------------------------------------------------------------------
  662.   # ● Update Motion Front
  663.   #--------------------------------------------------------------------------                  
  664.   def update_motion_front
  665.       case @battler.motion_action[1]
  666.         when 1..20
  667.             self.y += 3
  668.             self.zoom_x += 0.02
  669.             self.zoom_y += 0.02
  670.         when 21..40
  671.             self.y -= 3
  672.             self.zoom_x -= 0.02
  673.             self.zoom_y -= 0.02            
  674.         else  
  675.         end_action   
  676.       end      
  677.   end

  678.   #--------------------------------------------------------------------------
  679.   # ● Update Motion Round Left
  680.   #--------------------------------------------------------------------------                    
  681.   def update_motion_round_left
  682.       case @battler.motion_action[1]
  683.         when 1..15
  684.             self.y += 3
  685.             self.x -= 3
  686.             self.mirror = false
  687.         when 16..30
  688.             self.x += 6
  689.             self.mirror = true
  690.         when 31..45
  691.             self.y -= 3
  692.             self.x -= 3
  693.             self.mirror = false
  694.         else  
  695.         end_action  
  696.       end        
  697.   end

  698.   #--------------------------------------------------------------------------
  699.   # ● Update Motion Round Right
  700.   #--------------------------------------------------------------------------                    
  701.   def update_motion_round_right
  702.       case @battler.motion_action[1]
  703.         when 1..15
  704.             self.y += 3
  705.             self.x += 3
  706.             self.mirror = true            
  707.         when 16..30
  708.             self.x -= 6
  709.              self.mirror = false
  710.         when 31..45
  711.             self.y -= 3
  712.             self.x += 3
  713.             self.mirror = true
  714.         else  
  715.         end_action   
  716.       end   
  717.   end  

  718.   #--------------------------------------------------------------------------
  719.   # ● End Action
  720.   #--------------------------------------------------------------------------                     
  721.   def end_action
  722.       if $mog_rgss3_battle_hud != nil and @battler.is_a?(Game_Actor)
  723.          return_set(@original_set)
  724.       else  
  725.          return_set(@pre_set)  
  726.       end
  727.       @battler.motion_action = [-1,0]
  728.   end  

  729. end

  730. #==============================================================================
  731. # ■ Sprite Battler
  732. #==============================================================================
  733. class Sprite_Battler < Sprite_Base

  734.   #--------------------------------------------------------------------------
  735.   # ● Update Blink
  736.   #--------------------------------------------------------------------------      
  737.   alias mog_motion_animation_update_blink update_blink
  738.   def update_blink
  739.       return if @battler.dead?
  740.       mog_motion_animation_update_blink
  741.   end

  742.   #--------------------------------------------------------------------------
  743.   # ● Update Collapse
  744.   #--------------------------------------------------------------------------
  745.   def update_collapse   
  746.   end

  747.   #--------------------------------------------------------------------------
  748.   # ● Execute Motion Collapse
  749.   #--------------------------------------------------------------------------   
  750.   def execute_motion_collapse
  751.       collapse_end if self.opacity == 0
  752.       @battler.motion_collapse[1] += 1      
  753.       case @battler.motion_collapse[0]
  754.            when 0;     update_collapse_vertical
  755.            when 1;     update_collapse_horizontal
  756.            when 2;     update_collapse_zoom_out
  757.            when 3;     update_collapse_zoom_in
  758.            when 4;     update_collapse_zoom_in_out
  759.            when 5;     update_collapse_boss_2
  760.            when 6;     update_collpase_do_nothing
  761.            else ;      update_collapse_normal
  762.       end

  763.   end

  764.   #--------------------------------------------------------------------------
  765.   # ● Can Execute Collapse
  766.   #--------------------------------------------------------------------------      
  767.   def can_execute_collapse?
  768.       return false if !@battler.dead?
  769.       return false if @collapse_done
  770.       return true
  771.   end

  772.   #--------------------------------------------------------------------------
  773.   # ● Update Collapse Vertical
  774.   #--------------------------------------------------------------------------        
  775.   def update_collapse_vertical
  776.       self.zoom_y += 0.1
  777.       self.zoom_x -= 0.02         
  778.       self.opacity -= 3   
  779.   end

  780.   #--------------------------------------------------------------------------
  781.   # ● Update Collapse Horizontal
  782.   #--------------------------------------------------------------------------         
  783.   def update_collapse_horizontal
  784.       self.zoom_x += 0.1
  785.       self.zoom_y -= 0.02      
  786.       self.opacity -= 3      
  787.   end

  788.   #--------------------------------------------------------------------------
  789.   # ● Update Collapse Zoom Out
  790.   #--------------------------------------------------------------------------            
  791.   def update_collapse_zoom_out     
  792.       self.zoom_x += 0.02
  793.       self.zoom_y += 0.02     
  794.       self.opacity -= 4   
  795.   end

  796.   #--------------------------------------------------------------------------
  797.   # ● Update Collapse Zoom IN
  798.   #--------------------------------------------------------------------------              
  799.   def update_collapse_zoom_in
  800.       self.zoom_x -= 0.01
  801.       self.zoom_y -= 0.01      
  802.       self.opacity -= 4            
  803.   end

  804.   #--------------------------------------------------------------------------
  805.   # ● Update Collapse Zoom IN OUT
  806.   #--------------------------------------------------------------------------               
  807.   def update_collapse_zoom_in_out
  808.       case @battler.motion_collapse[1]
  809.            when 0..30
  810.                 self.zoom_x += 0.1
  811.                 self.zoom_y -= 0.02
  812.                 self.opacity -= 2
  813.            else  
  814.                 self.zoom_y += 0.5
  815.                 self.zoom_x -= 0.2
  816.                 self.opacity -= 10
  817.       end      
  818.   end

  819.   #--------------------------------------------------------------------------
  820.   # ● Update Collapse Boss 2
  821.   #--------------------------------------------------------------------------                  
  822.   def update_collapse_boss_2
  823.       self.x = @original_set[0] + rand(10)
  824.       self.src_rect.y -= 1
  825.       self.opacity = 0 if self.src_rect.y < -self.bitmap.height
  826.   end

  827.   #--------------------------------------------------------------------------
  828.   # ● Update Collapse do nothing
  829.   #--------------------------------------------------------------------------                    
  830.   def update_collpase_do_nothing

  831.   end  

  832.   #--------------------------------------------------------------------------
  833.   # ● Update Collapse Normal
  834.   #--------------------------------------------------------------------------                    
  835.   def update_collapse_normal
  836.       self.opacity -= 3
  837.       self.blend_type = 1
  838.   end  

  839.   #--------------------------------------------------------------------------
  840.   # ● Collapse End
  841.   #--------------------------------------------------------------------------      
  842.   def collapse_end
  843.       @collapse_done = true
  844.       return_set(@original_set)
  845.       self.src_rect.y = -self.bitmap.height unless @battler.motion_collapse[0] == 6
  846.   end  

  847.   #--------------------------------------------------------------------------
  848.   # ● Revert to Normal
  849.   #--------------------------------------------------------------------------        
  850.   alias mog_battler_motion_revert_to_normal revert_to_normal
  851.   def revert_to_normal
  852.       if @collapse_done
  853.          @collapse_done = false
  854.          return_set(@original_set)
  855.       end
  856.       mog_battler_motion_revert_to_normal
  857.   end  

  858. end

  859. $mog_rgss3_battler_motion = true
复制代码
找工作中。。。。。。
个人的最新画作:
照片头像写生,抖森一枚
回复

使用道具 举报

梦石
0
星屑
50
在线时间
687 小时
注册时间
2012-10-29
回帖
1526
发表于 2013-5-7 21:08:04 | 显示全部楼层
本帖最后由 j433463 于 2013-5-7 21:17 编辑

http://www.atelier-rgss.com/

MOG 的脚本是整合在 ACE_Master_Demo 范例档内的,它网页的最下方有个 Download (Demo) 连结,

点击它下载档案 ACE_Master_Demo.zip 回来,解压后用 RMVA 打开它,可以取得最新版本的脚本,

除了那个动作脚本之外还有很多也很不错的。

刚看了一下,官网的 Battler Motion 版本已经到 1.8 了。

点评

好的十分感谢。看看这个还会不会出错了。  发表于 2013-5-7 21:26

评分

参与人数 1梦石 +1 收起 理由
Sion + 1 感謝您的耐心解答

查看全部评分

修改劇本中,仔細審查原來的劇情大綱,覺得有點不太滿意,嘗試編寫不同主角不同主線的劇情,希望能寫得出來。
回复

使用道具 举报

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

本版积分规则

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

在本版发帖返回顶部