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

Project1

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

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

[复制链接]

Lv1.梦旅人

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

短篇七萝莉正太组亚军

跳转到指定楼层
1
发表于 2013-5-6 14:30:27 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式

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

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

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

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



我就是想让敌方攻击我方时,敌方图片跳动一下,(看着敌人在那呆着不动很不真实)着屏幕震动的频率加大,让屏幕晃动更剧烈,再加以一个红色画面闪烁。但是就是不知道在哪改,怎么改,求会脚本大神帮帮忙呗。。。
找工作中。。。。。。
个人的最新画作:
照片头像写生,抖森一枚

Lv1.梦旅人

梦石
0
星屑
50
在线时间
687 小时
注册时间
2012-10-29
帖子
1543
2
发表于 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 认可答案

查看全部评分

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

使用道具 举报

Lv1.梦旅人

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

短篇七萝莉正太组亚军

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

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

使用道具 举报

Lv1.梦旅人

梦石
0
星屑
50
在线时间
687 小时
注册时间
2012-10-29
帖子
1543
4
发表于 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 认可答案

查看全部评分

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

使用道具 举报

Lv1.梦旅人

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

短篇七萝莉正太组亚军

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

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

使用道具 举报

Lv1.梦旅人

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

短篇七萝莉正太组亚军

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

我再把脚本贴一下吧,可能我这个脚本的问题,这个脚本是放在哪哪的战斗信息出问题,不予任何脚本冲突就是本身脚本问题,话说你说的1.4版本没有找到,这是1.3版本的。如果您有1.4版的能不能传给我。
RUBY 代码复制
  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. #==============================================================================
  16. # ● Histórico (Version History)
  17. #==============================================================================
  18. # v 1.3 - Correção na posição do battler após receber o dano. (Actor)
  19. # v 1.2 - Melhoria na codificação do script. (Melhor compatibilidade.)
  20. #       - Adição do colapso tipo 6.
  21. #       - Adição do efeito de ação tipo 6 e 7.
  22. #       - Adição do efeito de animação inicial tipo 5.
  23. # v 1.1 - Ativar animação em battler abatidos. (Ex - Animações de Reviver.)
  24. #       - Opção de ativar ou não efeito de colapso para os personagens.
  25. # v 1.0 - Primeiro lançamento.
  26. #==============================================================================
  27.  
  28.  
  29. #==============================================================================
  30. # ● CONFIGURAÇÃO
  31. #==============================================================================
  32. # ■ Animação inicial de entrada ao começar a batalha. 出现效果
  33. #==============================================================================
  34. # Coloque as seguintes Tags na caixa de notas dos inimigos ou personagens.
  35. #
  36. # <Motion Appear = X>
  37. #
  38. # X = 0
  39. # Battler desliza horizontalmente.从左右过来。
  40. #
  41. # X = 1
  42. # Battler desliza verticalmente.从上边飞下来
  43. #
  44. # X = 2
  45. # Battler rola (Cambalhota O_o) pela tela.旋转上了
  46. #
  47. # X = 3
  48. # Zoom IN放大到缩小
  49. #
  50. # X = 4
  51. # Zoom Out 缩小到放大
  52. #
  53. # X = 5
  54. # Efeito de emergir do solo. 从下边跳上来
  55. #
  56. #==============================================================================
  57. # ■ Animações dos battlers em modo espera. 备用效果
  58. #==============================================================================
  59. # Coloque as seguintes Tags na caixa de notas dos inimigos ou personagens.
  60. #
  61. # <Motion Standby = X>
  62. #
  63. # X = 0
  64. # Ativa o efeito do battler respirando.悬浮呼吸
  65. #
  66. # X = 1
  67. # Ativa o efeito do battler levitando. 渐慢的呼吸
  68. #
  69. # X = 2
  70. # Ativa o efeito do battler movimentando para os lados.左右晃动
  71. #
  72. #==============================================================================
  73. # ■ Animações dos battlers em modo de ação. 敌人使用特技时攻击效果
  74. #==============================================================================
  75. # Coloque as seguintes Tags na caixa de notas de itens ou habilidades.
  76. #
  77. # <Motion Action = X>
  78. #
  79. # X = 0
  80. # Ativa o efeito de ação de zoom.放大攻击
  81. #
  82. # X = 1
  83. # Ativa o efeito de ação de pular.旋转攻击
  84. #
  85. # X = 2
  86. # Ativa o efeito de girar para a esquerda.向左滑动一个三角形攻击
  87. #
  88. # X = 3
  89. # Ativa o efeito de girar para a direita.向右滑动一个三角形攻击
  90. #
  91. # X = 4
  92. # Ativa o efeito de tremer.身体晃动攻击
  93. #
  94. # X = 5
  95. # Ativa o efeito de ação frontal.向前跳跃攻击
  96. #
  97. # X = 6
  98. # Ativa o efeito de dar um passo para esquerda.左移动攻击
  99. #
  100. # X = 7
  101. # Ativa o efeito de de dar um passo para direita.右移动攻击
  102. #
  103. #==============================================================================
  104. # ■ Animações dos battlers em Colapso. 死亡效果
  105. #==============================================================================
  106. # Coloque as seguintes Tags na caixa de notas dos inimigos ou personagens.
  107. #
  108. # <Motion Collapse = X>
  109. #
  110. # X = 0
  111. # Ativa colapso na vertical.变瘦往上消失
  112. #
  113. # X = 1
  114. # Ativa o colapso na horizontal.死后变成扁的消失
  115. #
  116. # X = 2
  117. # Ativa o colapso em Zoom OUT.放大消失
  118. #
  119. # X = 3
  120. # Ativa o colapso em Zoom IN.缩小消失
  121. #
  122. # X = 4
  123. # Ativa o colapso em Zoom IN e Zoom OUT.先放大后缩小消息
  124. #
  125. # X = 5
  126. # Ativa o colapso em Modo Boss.boss消失
  127. #
  128. # X = 6
  129. # Não ativa colapso.(Do nothing)不消失
  130. #
  131. #==============================================================================
  132. # ■ Ativar animação de dano em condições maléficas.
  133. #==============================================================================
  134. # Coloque a seguinte Tag na caixa de notas de condições para ativar o efeito
  135. # de dano.
  136. #
  137. # <Bad State>
  138. #
  139. #==============================================================================
  140.  
  141.  
  142. #==============================================================================
  143. # ■ Game_Battler
  144. #==============================================================================
  145. class Game_Battler < Game_BattlerBase
  146.  
  147.    attr_accessor :motion_start
  148.    attr_accessor :motion_stand
  149.    attr_accessor :motion_action
  150.    attr_accessor :motion_damage
  151.    attr_accessor :motion_collapse
  152.  
  153.   #--------------------------------------------------------------------------
  154.   # ● Initialize
  155.   #--------------------------------------------------------------------------      
  156.    alias mog_motion_animation_initialize initialize
  157.    def initialize
  158.        mog_motion_animation_initialize
  159.        @motion_start = -1
  160.        @motion_stand = [-1,0]
  161.        @motion_action = [-1,0]
  162.        @motion_collapse = [7,0]
  163.        @motion_damage = [0,0]
  164.    end     
  165.  
  166.   #--------------------------------------------------------------------------
  167.   # ● Added New State
  168.   #--------------------------------------------------------------------------  
  169.   alias mog_motion_animation_add_new_state add_new_state
  170.   def add_new_state(state_id)
  171.       mog_motion_animation_add_new_state(state_id)
  172.       self.motion_damage[0] = 1 if $data_states[state_id].note =~ /<Bad State>/
  173.   end   
  174.  
  175. end
  176.  
  177. #==============================================================================
  178. # ■ Game_Enemy
  179. #==============================================================================
  180. class Game_Enemy < Game_Battler
  181.  
  182.   #--------------------------------------------------------------------------
  183.   # ● Initialize
  184.   #--------------------------------------------------------------------------
  185.   alias mog_motion_animation_enemy_initialize initialize
  186.   def initialize(index, enemy_id)
  187.       mog_motion_animation_enemy_initialize(index, enemy_id)
  188.       setup_motion_animation(enemy_id)
  189.   end
  190.  
  191.   #--------------------------------------------------------------------------
  192.   # ● Setup Motion Animation
  193.   #--------------------------------------------------------------------------  
  194.   def setup_motion_animation(enemy_id)
  195.       self.motion_stand[0] = $1.to_i if  enemy.note =~ /<Motion Standby = (\d+)>/i
  196.       self.motion_collapse[0] = $1.to_i if  enemy.note =~ /<Motion Collapse = (\d+)>/i
  197.       self.motion_start =  $1.to_i if  enemy.note =~ /<Motion Appear = (\d+)>/i
  198.   end
  199. end
  200.  
  201. #==============================================================================
  202. # ■ Game Actor
  203. #==============================================================================
  204. class Game_Actor < Game_Battler
  205.  
  206.   #--------------------------------------------------------------------------
  207.   # ● Setup
  208.   #--------------------------------------------------------------------------
  209.   alias mog_motion_animation_actor_setup setup
  210.   def setup(actor_id)
  211.       mog_motion_animation_actor_setup(actor_id)
  212.       self.motion_stand[0] = $1.to_i if  actor.note =~ /<Motion Standby = (\d+)>/i
  213.       self.motion_collapse[0] = $1.to_i if  actor.note =~ /<Motion Collapse = (\d+)>/i      
  214.       self.motion_start =  $1.to_i if  actor.note =~ /<Motion Appear = (\d+)>/i  
  215.   end
  216.  
  217. end
  218.  
  219. #==============================================================================
  220. # ■ Game_ActionResult
  221. #==============================================================================
  222. class Game_ActionResult
  223.  
  224.   #--------------------------------------------------------------------------
  225.   # ● HP Damage Text
  226.   #--------------------------------------------------------------------------
  227.   alias mog_motion_animation_hp_damage_text hp_damage_text
  228.   def hp_damage_text
  229.       mog_motion_animation_hp_damage_text
  230.       @battler.motion_damage[0] = 1 if @hp_damage > 0
  231.   end  
  232. end   
  233.  
  234. #==============================================================================
  235. # ■ Sprite Battler
  236. #==============================================================================
  237. class Sprite_Battler < Sprite_Base
  238.  
  239.   #--------------------------------------------------------------------------
  240.   # ● Update Position
  241.   #--------------------------------------------------------------------------  
  242.   alias mog_motion_animation_update_position update_position
  243.   def update_position
  244.       if @battler.use_sprite?
  245.          update_motion_animation
  246.          return
  247.       end   
  248.       mog_motion_animation_update_position
  249.   end  
  250.  
  251.   #--------------------------------------------------------------------------
  252.   # ● Update Motion Animation
  253.   #--------------------------------------------------------------------------   
  254.   def update_motion_animation
  255.       setup_initial_motion
  256.       execute_start_animation
  257.       return if @wait_motion_start
  258.       if can_execute_collapse?
  259.          execute_motion_collapse
  260.       else  
  261.          execute_motion_damage
  262.          execute_motion_animation
  263.          execute_motion_action
  264.       end
  265.   end
  266.  
  267.   #--------------------------------------------------------------------------
  268.   # ● Setup Initial Motion
  269.   #--------------------------------------------------------------------------      
  270.   def setup_initial_motion
  271.       return if @motion_initial != nil
  272.       @motion_initial = true
  273.       @collapse_done = false
  274.       @motion_speed = 0
  275.       @start_speed = [0,0]
  276.       @battler.motion_collapse[1] = 0
  277.       self.x = @battler.screen_x rescue 0
  278.       self.y = @battler.screen_y rescue 0
  279.       self.z = @battler.screen_z rescue 100
  280.       setup_motion_stand
  281.       @original_set = [self.x, self.y, self.zoom_x,self.zoom_y,self.mirror,self.angle,self.opacity]      
  282.       setup_motion_start
  283.       setup_motion_damage            
  284.       setup_motion_action
  285.   end  
  286.  
  287.   #--------------------------------------------------------------------------
  288.   # ● Return Set
  289.   #--------------------------------------------------------------------------         
  290.   def return_set(value)
  291.       self.x = value[0]
  292.       self.y = value[1]
  293.       self.zoom_x = value[2]
  294.       self.zoom_y = value[3]
  295.       self.mirror = value[4]
  296.       self.angle = value[5]
  297.       self.opacity = value[6]
  298.   end  
  299.  
  300.   #--------------------------------------------------------------------------
  301.   # ● setup_motion_start
  302.   #--------------------------------------------------------------------------            
  303.   def setup_motion_start
  304.       @wait_motion_start = true
  305.       @scr_rect_speed = 1
  306.       case @battler.motion_start
  307.          when 0  
  308.             self.x = 0 - (self.bitmap.width + rand(100))
  309.          when 1
  310.             self.y = 0 - (self.bitmap.height + rand(100))
  311.          when 2   
  312.             self.angle = 360
  313.             self.x = 0 - self.bitmap.width
  314.          when 3   
  315.             self.zoom_x = 1.5 + (rand(10) / 100.0)
  316.             self.zoom_y = self.zoom_x
  317.             self.opacity = 0
  318.          when 4
  319.             self.zoom_x = 0.2 + (rand(10) / 100.0)
  320.             self.zoom_y = self.zoom_x
  321.             self.opacity = 0
  322.          when 5   
  323.             self.src_rect.y = -self.bitmap.height
  324.             @scr_rect_speed = self.bitmap.height / 40
  325.             @scr_rect_speed = 1 if @scr_rect_speed <= 0
  326.          else   
  327.            @wait_motion_start = false
  328.       end   
  329.   end  
  330.  
  331.   #--------------------------------------------------------------------------
  332.   # ● Setup Motion Damage
  333.   #--------------------------------------------------------------------------        
  334.   def setup_motion_damage
  335.       @battler.motion_damage = [0,0]
  336.       @damage_pre_set = [self.x, self.y, self.zoom_x,self.zoom_y,self.mirror,self.angle,self.opacity]
  337.   end
  338.  
  339.   #--------------------------------------------------------------------------
  340.   # ● Execute Start Animation
  341.   #--------------------------------------------------------------------------         
  342.   def execute_start_animation
  343.       return if !@wait_motion_start
  344.       s_x = 1 + ((self.x - @original_set[0]).abs / (20 + @start_speed[0]))
  345.       s_y = 1 + ((self.y - @original_set[1]).abs / (20 + @start_speed[1]))      
  346.       if self.x < @original_set[0]
  347.          self.x += s_x
  348.          self.x = @original_set[0] if self.x >= @original_set[0]
  349.       elsif self.x > @original_set[0]
  350.          self.x -= s_x
  351.          self.x = @original_set[0] if self.x <= @original_set[0]
  352.       end
  353.       if self.y < @original_set[1]
  354.          self.y += s_y
  355.          self.y = @original_set[1] if self.y > @original_set[1]
  356.       elsif self.y > @original_set[1]
  357.          self.y -= s_y
  358.          self.y = @original_set[1] if self.y < @original_set[1]
  359.       end
  360.       if self.zoom_x != @original_set[2]
  361.          if self.zoom_x > @original_set[2]
  362.             self.zoom_x -= 0.01
  363.             self.zoom_x = @original_set[2] if self.zoom_x < @original_set[2]
  364.          elsif self.zoom_x < @original_set[2]
  365.             self.zoom_x += 0.01
  366.             self.zoom_x = @original_set[2] if self.zoom_x > @original_set[2]
  367.          end         
  368.       end  
  369.       if self.zoom_y != @original_set[3]
  370.          if self.zoom_y > @original_set[3]
  371.             self.zoom_y -= 0.01
  372.             self.zoom_y = @original_set[3] if self.zoom_y < @original_set[3]
  373.          elsif self.zoom_y < @original_set[3]
  374.             self.zoom_y += 0.01
  375.             self.zoom_y = @original_set[3] if self.zoom_y > @original_set[3]
  376.          end         
  377.       end        
  378.       self.opacity += 10
  379.       if self.angle > 0
  380.          self.angle -= 5
  381.          self.angle = @original_set[5] if self.angle < @original_set[5]
  382.       end
  383.       if self.src_rect.y != 0
  384.          self.src_rect.y += @scr_rect_speed
  385.          self.src_rect.y = 0 if self.src_rect.y > 0
  386.       end
  387.       if sprite_original_set?  
  388.          @wait_motion_start = false
  389.          self.src_rect.y = 0
  390.       end   
  391.   end  
  392.  
  393.   #--------------------------------------------------------------------------
  394.   # ● Sprite original Set?
  395.   #--------------------------------------------------------------------------         
  396.   def sprite_original_set?
  397.       return false if self.x != @original_set[0]
  398.       return false if self.y != @original_set[1]
  399.       return false if self.zoom_x != @original_set[2]
  400.       return false if self.zoom_y != @original_set[3]      
  401.       return false if self.mirror != @original_set[4]
  402.       return false if self.angle != @original_set[5]
  403.       return false if self.opacity != @original_set[6]
  404.       return false if self.src_rect.y != 0
  405.       return true
  406.   end  
  407.  
  408.   #--------------------------------------------------------------------------
  409.   # ● Setup Initial Motion
  410.   #--------------------------------------------------------------------------        
  411.   def execute_motion_damage
  412.       damage_refresh
  413.       update_motion_damage
  414.   end
  415.  
  416.   #--------------------------------------------------------------------------
  417.   # ● Damage Refresh
  418.   #--------------------------------------------------------------------------         
  419.   def damage_refresh
  420.       return if @battler.motion_damage[0] == 0
  421.       if @battler.motion_damage[1] == 0
  422.          @damage_pre_set = [self.x, self.y, self.zoom_x,self.zoom_y,self.mirror,self.angle,self.opacity]
  423.       end
  424.       @battler.motion_damage[0] = 0
  425.       @battler.motion_damage[1] = 45
  426.   end
  427.  
  428.   #--------------------------------------------------------------------------
  429.   # ● Update Motion Damage
  430.   #--------------------------------------------------------------------------            
  431.   def update_motion_damage
  432.       return if @battler.motion_damage[1] == 0
  433.       self.x = @damage_pre_set[0] + rand(@battler.motion_damage[1])
  434.       @battler.motion_damage[1] -= 1
  435.       if @battler.motion_damage[1] == 0
  436.          if $mog_rgss3_battle_hud != nil and @battler.is_a?(Game_Actor)
  437.             return_set(@original_set)
  438.          else  
  439.             return_set(@damage_pre_set)
  440.          end   
  441.       end  
  442.   end  
  443.  
  444.   #--------------------------------------------------------------------------
  445.   # ● Setup Motion Stand
  446.   #--------------------------------------------------------------------------        
  447.   def setup_motion_stand      
  448.       @breath_range = [0.9, 1.0]
  449.       @float_range = [@battler.screen_y - 10, @battler.screen_y + 10]
  450.       @side_range = [@battler.screen_x - 10, @battler.screen_x + 10]
  451.       @battler.motion_stand[1] = 0
  452.       case @battler.motion_stand[0]
  453.          when 0
  454.              self.zoom_y = @breath_range[0] + (rand(10) / 100.0)
  455.              @battler.motion_stand[1] = rand(2)
  456.          when 1
  457.              self.y += 10 - rand(20)
  458.              @battler.motion_stand[1] = rand(2)
  459.          when 2
  460.              self.x += 10 - rand(20)
  461.              @battler.motion_stand[1] = rand(2)            
  462.       end   
  463.   end
  464.  
  465.   #--------------------------------------------------------------------------
  466.   # ● Execute Motion Animation
  467.   #--------------------------------------------------------------------------        
  468.   def execute_motion_animation
  469.       return if @old_motion_action != -1
  470.       return if @battler.motion_damage[1] > 0
  471.       case @battler.motion_stand[0]
  472.          when 0
  473.              update_motion_breath
  474.          when 1  
  475.              update_motion_float
  476.          when 2
  477.              update_motion_side
  478.       end        
  479.   end  
  480.  
  481.   #--------------------------------------------------------------------------
  482.   # ● Update Motion Breath
  483.   #--------------------------------------------------------------------------         
  484.   def update_motion_breath  
  485.       case @battler.motion_stand[1]
  486.          when 0
  487.            self.zoom_y -= 0.002
  488.            if self.zoom_y <= @breath_range[0]
  489.               @battler.motion_stand[1] = 1
  490.               self.zoom_y = @breath_range[0]
  491.            end   
  492.          when 1  
  493.            self.zoom_y += 0.002
  494.            if self.zoom_y >= @breath_range[1]
  495.               @battler.motion_stand[1] = 0
  496.               self.zoom_y = @breath_range[1]
  497.            end   
  498.       end
  499.   end  
  500.  
  501.   #--------------------------------------------------------------------------
  502.   # ● Update Motion Float
  503.   #--------------------------------------------------------------------------         
  504.   def update_motion_float
  505.       @motion_speed += 1
  506.       return if @motion_speed < 5
  507.       @motion_speed = 0
  508.       case @battler.motion_stand[1]
  509.            when 0
  510.                 self.y -= 1
  511.                 if self.y < @float_range[0]
  512.                    self.y = @float_range[0]
  513.                    @battler.motion_stand[1] = 1
  514.                 end   
  515.            when 1  
  516.                 self.y += 1
  517.                 if self.y > @float_range[1]
  518.                    self.y = @float_range[1]
  519.                    @battler.motion_stand[1] = 0
  520.                 end                  
  521.       end
  522.   end   
  523.  
  524.   #--------------------------------------------------------------------------
  525.   # ● Update Motion Side
  526.   #--------------------------------------------------------------------------         
  527.   def update_motion_side
  528.       @motion_speed += 1
  529.       return if @motion_speed < 5
  530.       @motion_speed = 0
  531.       case @battler.motion_stand[1]
  532.            when 0
  533.                 self.x -= 1
  534.                 if self.x < @side_range[0]
  535.                    self.x = @side_range[0]
  536.                    @battler.motion_stand[1] = 1
  537.                 end   
  538.            when 1  
  539.                 self.x += 1
  540.                 if self.x > @side_range[1]
  541.                    self.x = @side_range[1]
  542.                    @battler.motion_stand[1] = 0
  543.                 end                  
  544.       end
  545.   end     
  546.  
  547. end
  548.  
  549. #==============================================================================
  550. # ■ Game Action
  551. #==============================================================================
  552. class Game_Action
  553.  
  554.   #--------------------------------------------------------------------------
  555.   # ● Prepare
  556.   #--------------------------------------------------------------------------                  
  557.   alias mog_motion_action_prepare prepare
  558.   def prepare
  559.       mog_motion_action_prepare   
  560.       set_motion_action
  561.   end
  562.  
  563.   #--------------------------------------------------------------------------
  564.   # ● Set Motion Action
  565.   #--------------------------------------------------------------------------                    
  566.   def set_motion_action
  567.       return if @item.object == nil or subject == nil      
  568.       subject.motion_action[0] = $1.to_i if @item.object.note =~ /<Motion Action = (\d+)>/i
  569.   end
  570.  
  571. end
  572.  
  573. #==============================================================================
  574. # ■ Sprite Battler
  575. #==============================================================================
  576. class Sprite_Battler < Sprite_Base
  577.  
  578.   #--------------------------------------------------------------------------
  579.   # ● Setup Motion Action
  580.   #--------------------------------------------------------------------------        
  581.   def setup_motion_action
  582.       @battler.motion_action = [-1,0]
  583.       @old_motion_action = @battler.motion_action[0]
  584.       @pre_set = [self.x, self.y, self.zoom_x,self.zoom_y,self.mirror,self.angle,self.opacity]
  585.   end
  586.  
  587.   #--------------------------------------------------------------------------
  588.   # ● Refresh Action
  589.   #--------------------------------------------------------------------------         
  590.   def refresh_action
  591.       return if @old_motion_action == @battler.motion_action[0]
  592.       if @old_motion_action == -1
  593.          @pre_set = [self.x, self.y, self.zoom_x,self.zoom_y,self.mirror,self.angle,self.opacity]
  594.       end
  595.       @battler.motion_action[1] = 0  
  596.       return_set(@pre_set)
  597.       @old_motion_action = @battler.motion_action[0]
  598.       self.src_rect.y =  0
  599.   end  
  600.  
  601.   #--------------------------------------------------------------------------
  602.   # ● Execute Motion Action
  603.   #--------------------------------------------------------------------------            
  604.   def execute_motion_action
  605.       return if @battler.motion_damage[1] > 0
  606.       refresh_action
  607.       update_motion_action
  608.   end  
  609.  
  610.   #--------------------------------------------------------------------------
  611.   # ● Update Motion Action
  612.   #--------------------------------------------------------------------------              
  613.   def update_motion_action
  614.       return if @battler.motion_action[0] == -1
  615.       @battler.motion_action[1] += 1
  616.       case @battler.motion_action[0]
  617.            when 0
  618.               update_motion_zoom
  619.            when 1
  620.               update_motion_jump
  621.            when 2  
  622.               update_motion_round_right
  623.            when 3
  624.               update_motion_round_left
  625.            when 4
  626.               update_motion_shake
  627.            when 5
  628.               update_motion_front
  629.            when 6   
  630.               update_motion_step_left
  631.            when 7
  632.               update_motion_step_right              
  633.       end
  634.   end
  635.  
  636.   #--------------------------------------------------------------------------
  637.   # ● Update Motion Step Left
  638.   #--------------------------------------------------------------------------                  
  639.   def update_motion_step_left
  640.       case @battler.motion_action[1]
  641.            when 1..20
  642.                 self.x -= 2
  643.            when 21..40  
  644.                 self.x += 2           
  645.            else
  646.            end_action
  647.       end   
  648.  
  649.   end  
  650.  
  651.   #--------------------------------------------------------------------------
  652.   # ● Update Motion Step Right
  653.   #--------------------------------------------------------------------------                  
  654.   def update_motion_step_right
  655.       case @battler.motion_action[1]
  656.            when 1..20
  657.                 self.x += 2
  658.            when 21..40  
  659.                 self.x -= 2           
  660.            else
  661.         end_action   
  662.       end   
  663.   end   
  664.  
  665.   #--------------------------------------------------------------------------
  666.   # ● Update Motion Shake
  667.   #--------------------------------------------------------------------------               
  668.   def update_motion_shake
  669.       self.x = @pre_set[0] + rand(@battler.motion_action[1])
  670.       end_action if @battler.motion_action[1] > 40
  671.   end   
  672.  
  673.   #--------------------------------------------------------------------------
  674.   # ● Update Motion Zoom
  675.   #--------------------------------------------------------------------------               
  676.   def update_motion_zoom
  677.       case @battler.motion_action[1]
  678.         when 1..20
  679.            self.zoom_x += 0.01
  680.            self.zoom_y += 0.01
  681.         when 21..40
  682.            self.zoom_x -= 0.01
  683.            self.zoom_y -= 0.01         
  684.         else  
  685.         end_action   
  686.       end
  687.   end
  688.  
  689.   #--------------------------------------------------------------------------
  690.   # ● Update Motion Jump
  691.   #--------------------------------------------------------------------------                  
  692.   def update_motion_jump
  693.       case @battler.motion_action[1]
  694.         when 1..20
  695.             self.y -= 9
  696.             self.zoom_x += 0.01
  697.             self.zoom_y += 0.01
  698.             self.mirror = true
  699.             self.angle += 9
  700.         when 21..40
  701.             self.y += 9
  702.             self.zoom_x -= 0.01
  703.             self.zoom_y -= 0.01            
  704.             self.mirror = false
  705.             self.angle += 9
  706.         else  
  707.         self.angle = 0
  708.         end_action   
  709.       end      
  710.   end
  711.  
  712.   #--------------------------------------------------------------------------
  713.   # ● Update Motion Front
  714.   #--------------------------------------------------------------------------                  
  715.   def update_motion_front
  716.       case @battler.motion_action[1]
  717.         when 1..20
  718.             self.y += 3
  719.             self.zoom_x += 0.02
  720.             self.zoom_y += 0.02
  721.         when 21..40
  722.             self.y -= 3
  723.             self.zoom_x -= 0.02
  724.             self.zoom_y -= 0.02            
  725.         else  
  726.         end_action   
  727.       end      
  728.   end
  729.  
  730.   #--------------------------------------------------------------------------
  731.   # ● Update Motion Round Left
  732.   #--------------------------------------------------------------------------                    
  733.   def update_motion_round_left
  734.       case @battler.motion_action[1]
  735.         when 1..15
  736.             self.y += 3
  737.             self.x -= 3
  738.             self.mirror = false
  739.         when 16..30
  740.             self.x += 6
  741.             self.mirror = true
  742.         when 31..45
  743.             self.y -= 3
  744.             self.x -= 3
  745.             self.mirror = false
  746.         else  
  747.         end_action  
  748.       end        
  749.   end
  750.  
  751.   #--------------------------------------------------------------------------
  752.   # ● Update Motion Round Right
  753.   #--------------------------------------------------------------------------                    
  754.   def update_motion_round_right
  755.       case @battler.motion_action[1]
  756.         when 1..15
  757.             self.y += 3
  758.             self.x += 3
  759.             self.mirror = true            
  760.         when 16..30
  761.             self.x -= 6
  762.              self.mirror = false
  763.         when 31..45
  764.             self.y -= 3
  765.             self.x += 3
  766.             self.mirror = true
  767.         else  
  768.         end_action   
  769.       end   
  770.   end  
  771.  
  772.   #--------------------------------------------------------------------------
  773.   # ● End Action
  774.   #--------------------------------------------------------------------------                     
  775.   def end_action
  776.       if $mog_rgss3_battle_hud != nil and @battler.is_a?(Game_Actor)
  777.          return_set(@original_set)
  778.       else  
  779.          return_set(@pre_set)  
  780.       end
  781.       @battler.motion_action = [-1,0]
  782.   end  
  783.  
  784. end
  785.  
  786. #==============================================================================
  787. # ■ Sprite Battler
  788. #==============================================================================
  789. class Sprite_Battler < Sprite_Base
  790.  
  791.   #--------------------------------------------------------------------------
  792.   # ● Update Blink
  793.   #--------------------------------------------------------------------------      
  794.   alias mog_motion_animation_update_blink update_blink
  795.   def update_blink
  796.       return if @battler.dead?
  797.       mog_motion_animation_update_blink
  798.   end
  799.  
  800.   #--------------------------------------------------------------------------
  801.   # ● Update Collapse
  802.   #--------------------------------------------------------------------------
  803.   def update_collapse   
  804.   end
  805.  
  806.   #--------------------------------------------------------------------------
  807.   # ● Execute Motion Collapse
  808.   #--------------------------------------------------------------------------   
  809.   def execute_motion_collapse
  810.       collapse_end if self.opacity == 0
  811.       @battler.motion_collapse[1] += 1      
  812.       case @battler.motion_collapse[0]
  813.            when 0;     update_collapse_vertical
  814.            when 1;     update_collapse_horizontal
  815.            when 2;     update_collapse_zoom_out
  816.            when 3;     update_collapse_zoom_in
  817.            when 4;     update_collapse_zoom_in_out
  818.            when 5;     update_collapse_boss_2
  819.            when 6;     update_collpase_do_nothing
  820.            else ;      update_collapse_normal
  821.       end
  822.  
  823.   end
  824.  
  825.   #--------------------------------------------------------------------------
  826.   # ● Can Execute Collapse
  827.   #--------------------------------------------------------------------------      
  828.   def can_execute_collapse?
  829.       return false if !@battler.dead?
  830.       return false if @collapse_done
  831.       return true
  832.   end
  833.  
  834.   #--------------------------------------------------------------------------
  835.   # ● Update Collapse Vertical
  836.   #--------------------------------------------------------------------------        
  837.   def update_collapse_vertical
  838.       self.zoom_y += 0.1
  839.       self.zoom_x -= 0.02         
  840.       self.opacity -= 3   
  841.   end
  842.  
  843.   #--------------------------------------------------------------------------
  844.   # ● Update Collapse Horizontal
  845.   #--------------------------------------------------------------------------         
  846.   def update_collapse_horizontal
  847.       self.zoom_x += 0.1
  848.       self.zoom_y -= 0.02      
  849.       self.opacity -= 3      
  850.   end
  851.  
  852.   #--------------------------------------------------------------------------
  853.   # ● Update Collapse Zoom Out
  854.   #--------------------------------------------------------------------------            
  855.   def update_collapse_zoom_out     
  856.       self.zoom_x += 0.02
  857.       self.zoom_y += 0.02     
  858.       self.opacity -= 4   
  859.   end
  860.  
  861.   #--------------------------------------------------------------------------
  862.   # ● Update Collapse Zoom IN
  863.   #--------------------------------------------------------------------------              
  864.   def update_collapse_zoom_in
  865.       self.zoom_x -= 0.01
  866.       self.zoom_y -= 0.01      
  867.       self.opacity -= 4            
  868.   end
  869.  
  870.   #--------------------------------------------------------------------------
  871.   # ● Update Collapse Zoom IN OUT
  872.   #--------------------------------------------------------------------------               
  873.   def update_collapse_zoom_in_out
  874.       case @battler.motion_collapse[1]
  875.            when 0..30
  876.                 self.zoom_x += 0.1
  877.                 self.zoom_y -= 0.02
  878.                 self.opacity -= 2
  879.            else  
  880.                 self.zoom_y += 0.5
  881.                 self.zoom_x -= 0.2
  882.                 self.opacity -= 10
  883.       end      
  884.   end
  885.  
  886.   #--------------------------------------------------------------------------
  887.   # ● Update Collapse Boss 2
  888.   #--------------------------------------------------------------------------                  
  889.   def update_collapse_boss_2
  890.       self.x = @original_set[0] + rand(10)
  891.       self.src_rect.y -= 1
  892.       self.opacity = 0 if self.src_rect.y < -self.bitmap.height
  893.   end
  894.  
  895.   #--------------------------------------------------------------------------
  896.   # ● Update Collapse do nothing
  897.   #--------------------------------------------------------------------------                    
  898.   def update_collpase_do_nothing
  899.  
  900.   end  
  901.  
  902.   #--------------------------------------------------------------------------
  903.   # ● Update Collapse Normal
  904.   #--------------------------------------------------------------------------                    
  905.   def update_collapse_normal
  906.       self.opacity -= 3
  907.       self.blend_type = 1
  908.   end  
  909.  
  910.   #--------------------------------------------------------------------------
  911.   # ● Collapse End
  912.   #--------------------------------------------------------------------------      
  913.   def collapse_end
  914.       @collapse_done = true
  915.       return_set(@original_set)
  916.       self.src_rect.y = -self.bitmap.height unless @battler.motion_collapse[0] == 6
  917.   end  
  918.  
  919.   #--------------------------------------------------------------------------
  920.   # ● Revert to Normal
  921.   #--------------------------------------------------------------------------        
  922.   alias mog_battler_motion_revert_to_normal revert_to_normal
  923.   def revert_to_normal
  924.       if @collapse_done
  925.          @collapse_done = false
  926.          return_set(@original_set)
  927.       end
  928.       mog_battler_motion_revert_to_normal
  929.   end  
  930.  
  931. end
  932.  
  933. $mog_rgss3_battler_motion = true
找工作中。。。。。。
个人的最新画作:
照片头像写生,抖森一枚
回复 支持 反对

使用道具 举报

Lv1.梦旅人

梦石
0
星屑
50
在线时间
687 小时
注册时间
2012-10-29
帖子
1543
7
发表于 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 感謝您的耐心解答

查看全部评分

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

使用道具 举报

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

本版积分规则

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

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

GMT+8, 2024-5-6 23:15

Powered by Discuz! X3.1

© 2001-2013 Comsenz Inc.

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