查看: 3109|回复: 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版的能不能传给我。[pre lang="ruby" line="1"]#==============================================================================
# +++ MOG - BATTLER MOTION (v1.3) +++
#==============================================================================
# By Moghunter
# http://www.atelier-rgss.com/
#==============================================================================
# Adiciona efeitos de animações nos sprites dos battlers.
# ● Animação inicial (entrada)de batalha.
# ● Animação de espera.
# ● Animação de ação.
# ● Animação de dano.
# ● Animação de collapso.
#==============================================================================

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


#==============================================================================
# ● CONFIGURAÇÃO
#==============================================================================
# ■ Animação inicial de entrada ao começar a batalha. 出现效果
#==============================================================================
# Coloque as seguintes Tags na caixa de notas dos inimigos ou personagens.
#
# <Motion Appear = X>
#
# X = 0
# Battler desliza horizontalmente.从左右过来。
#
# X = 1
# Battler desliza verticalmente.从上边飞下来
#
# X = 2
# Battler rola (Cambalhota O_o) pela tela.旋转上了
#
# X = 3
# Zoom IN放大到缩小
#
# X = 4
# Zoom Out 缩小到放大
#
# X = 5
# Efeito de emergir do solo. 从下边跳上来
#
#==============================================================================
# ■ Animações dos battlers em modo espera. 备用效果
#==============================================================================
# Coloque as seguintes Tags na caixa de notas dos inimigos ou personagens.
#
# <Motion Standby = X>
#
# X = 0
# Ativa o efeito do battler respirando.悬浮呼吸
#
# X = 1
# Ativa o efeito do battler levitando. 渐慢的呼吸
#
# X = 2
# Ativa o efeito do battler movimentando para os lados.左右晃动
#
#==============================================================================
# ■ Animações dos battlers em modo de ação. 敌人使用特技时攻击效果
#==============================================================================
# Coloque as seguintes Tags na caixa de notas de itens ou habilidades.
#
# <Motion Action = X>
#
# X = 0
# Ativa o efeito de ação de zoom.放大攻击
#
# X = 1
# Ativa o efeito de ação de pular.旋转攻击
#
# X = 2
# Ativa o efeito de girar para a esquerda.向左滑动一个三角形攻击
#
# X = 3
# Ativa o efeito de girar para a direita.向右滑动一个三角形攻击
#
# X = 4
# Ativa o efeito de tremer.身体晃动攻击
#
# X = 5
# Ativa o efeito de ação frontal.向前跳跃攻击
#
# X = 6
# Ativa o efeito de dar um passo para esquerda.左移动攻击
#
# X = 7
# Ativa o efeito de de dar um passo para direita.右移动攻击
#
#==============================================================================
# ■ Animações dos battlers em Colapso. 死亡效果
#==============================================================================
# Coloque as seguintes Tags na caixa de notas dos inimigos ou personagens.
#
# <Motion Collapse = X>
#
# X = 0
# Ativa colapso na vertical.变瘦往上消失
#
# X = 1
# Ativa o colapso na horizontal.死后变成扁的消失
#
# X = 2
# Ativa o colapso em Zoom OUT.放大消失
#
# X = 3
# Ativa o colapso em Zoom IN.缩小消失
#
# X = 4
# Ativa o colapso em Zoom IN e Zoom OUT.先放大后缩小消息
#
# X = 5
# Ativa o colapso em Modo Boss.boss消失
#
# X = 6
# Não ativa colapso.(Do nothing)不消失
#
#==============================================================================
# ■ Ativar animação de dano em condições maléficas.
#==============================================================================
# Coloque a seguinte Tag na caixa de notas de condições para ativar o efeito
# de dano.
#
# <Bad State>
#
#==============================================================================


#==============================================================================
# ■ Game_Battler
#==============================================================================
class Game_Battler < Game_BattlerBase

   attr_accessor :motion_start
   attr_accessor :motion_stand
   attr_accessor :motion_action
   attr_accessor :motion_damage
   attr_accessor :motion_collapse

  #--------------------------------------------------------------------------
  # ● Initialize
  #--------------------------------------------------------------------------      
   alias mog_motion_animation_initialize initialize
   def initialize
       mog_motion_animation_initialize
       @motion_start = -1
       @motion_stand = [-1,0]
       @motion_action = [-1,0]
       @motion_collapse = [7,0]
       @motion_damage = [0,0]
   end     

  #--------------------------------------------------------------------------
  # ● Added New State
  #--------------------------------------------------------------------------  
  alias mog_motion_animation_add_new_state add_new_state
  def add_new_state(state_id)
      mog_motion_animation_add_new_state(state_id)
      self.motion_damage[0] = 1 if $data_states[state_id].note =~ /<Bad State>/
  end   

end

#==============================================================================
# ■ Game_Enemy
#==============================================================================
class Game_Enemy < Game_Battler

  #--------------------------------------------------------------------------
  # ● Initialize
  #--------------------------------------------------------------------------
  alias mog_motion_animation_enemy_initialize initialize
  def initialize(index, enemy_id)
      mog_motion_animation_enemy_initialize(index, enemy_id)
      setup_motion_animation(enemy_id)
  end

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

#==============================================================================
# ■ Game Actor
#==============================================================================
class Game_Actor < Game_Battler

  #--------------------------------------------------------------------------
  # ● Setup
  #--------------------------------------------------------------------------
  alias mog_motion_animation_actor_setup setup
  def setup(actor_id)
      mog_motion_animation_actor_setup(actor_id)
      self.motion_stand[0] = $1.to_i if  actor.note =~ /<Motion Standby = (\d+)>/i
      self.motion_collapse[0] = $1.to_i if  actor.note =~ /<Motion Collapse = (\d+)>/i      
      self.motion_start =  $1.to_i if  actor.note =~ /<Motion Appear = (\d+)>/i  
  end

end

#==============================================================================
# ■ Game_ActionResult
#==============================================================================
class Game_ActionResult

  #--------------------------------------------------------------------------
  # ● HP Damage Text
  #--------------------------------------------------------------------------
  alias mog_motion_animation_hp_damage_text hp_damage_text
  def hp_damage_text
      mog_motion_animation_hp_damage_text
      @battler.motion_damage[0] = 1 if @hp_damage > 0
  end  
end   

#==============================================================================
# ■ Sprite Battler
#==============================================================================
class Sprite_Battler < Sprite_Base

  #--------------------------------------------------------------------------
  # ● Update Position
  #--------------------------------------------------------------------------  
  alias mog_motion_animation_update_position update_position
  def update_position
      if @battler.use_sprite?
         update_motion_animation
         return
      end   
      mog_motion_animation_update_position
  end  

  #--------------------------------------------------------------------------
  # ● Update Motion Animation
  #--------------------------------------------------------------------------   
  def update_motion_animation
      setup_initial_motion
      execute_start_animation
      return if @wait_motion_start
      if can_execute_collapse?
         execute_motion_collapse
      else  
         execute_motion_damage
         execute_motion_animation
         execute_motion_action
      end
  end

  #--------------------------------------------------------------------------
  # ● Setup Initial Motion
  #--------------------------------------------------------------------------      
  def setup_initial_motion
      return if @motion_initial != nil
      @motion_initial = true
      @collapse_done = false
      @motion_speed = 0
      @start_speed = [0,0]
      @battler.motion_collapse[1] = 0
      self.x = @battler.screen_x rescue 0
      self.y = @battler.screen_y rescue 0
      self.z = @battler.screen_z rescue 100
      setup_motion_stand
      @original_set = [self.x, self.y, self.zoom_x,self.zoom_y,self.mirror,self.angle,self.opacity]      
      setup_motion_start
      setup_motion_damage            
      setup_motion_action
  end  

  #--------------------------------------------------------------------------
  # ● Return Set
  #--------------------------------------------------------------------------         
  def return_set(value)
      self.x = value[0]
      self.y = value[1]
      self.zoom_x = value[2]
      self.zoom_y = value[3]
      self.mirror = value[4]
      self.angle = value[5]
      self.opacity = value[6]
  end  

  #--------------------------------------------------------------------------
  # ● setup_motion_start
  #--------------------------------------------------------------------------            
  def setup_motion_start
      @wait_motion_start = true
      @scr_rect_speed = 1
      case @battler.motion_start
         when 0  
            self.x = 0 - (self.bitmap.width + rand(100))
         when 1
            self.y = 0 - (self.bitmap.height + rand(100))
         when 2   
            self.angle = 360
            self.x = 0 - self.bitmap.width
         when 3   
            self.zoom_x = 1.5 + (rand(10) / 100.0)
            self.zoom_y = self.zoom_x
            self.opacity = 0
         when 4
            self.zoom_x = 0.2 + (rand(10) / 100.0)
            self.zoom_y = self.zoom_x
            self.opacity = 0
         when 5   
            self.src_rect.y = -self.bitmap.height
            @scr_rect_speed = self.bitmap.height / 40
            @scr_rect_speed = 1 if @scr_rect_speed <= 0
         else   
           @wait_motion_start = false
      end   
  end  

  #--------------------------------------------------------------------------
  # ● Setup Motion Damage
  #--------------------------------------------------------------------------        
  def setup_motion_damage
      @battler.motion_damage = [0,0]
      @damage_pre_set = [self.x, self.y, self.zoom_x,self.zoom_y,self.mirror,self.angle,self.opacity]
  end

  #--------------------------------------------------------------------------
  # ● Execute Start Animation
  #--------------------------------------------------------------------------         
  def execute_start_animation
      return if !@wait_motion_start
      s_x = 1 + ((self.x - @original_set[0]).abs / (20 + @start_speed[0]))
      s_y = 1 + ((self.y - @original_set[1]).abs / (20 + @start_speed[1]))      
      if self.x < @original_set[0]
         self.x += s_x
         self.x = @original_set[0] if self.x >= @original_set[0]
      elsif self.x > @original_set[0]
         self.x -= s_x
         self.x = @original_set[0] if self.x <= @original_set[0]
      end
      if self.y < @original_set[1]
         self.y += s_y
         self.y = @original_set[1] if self.y > @original_set[1]
      elsif self.y > @original_set[1]
         self.y -= s_y
         self.y = @original_set[1] if self.y < @original_set[1]
      end
      if self.zoom_x != @original_set[2]
         if self.zoom_x > @original_set[2]
            self.zoom_x -= 0.01
            self.zoom_x = @original_set[2] if self.zoom_x < @original_set[2]
         elsif self.zoom_x < @original_set[2]
            self.zoom_x += 0.01
            self.zoom_x = @original_set[2] if self.zoom_x > @original_set[2]
         end         
      end  
      if self.zoom_y != @original_set[3]
         if self.zoom_y > @original_set[3]
            self.zoom_y -= 0.01
            self.zoom_y = @original_set[3] if self.zoom_y < @original_set[3]
         elsif self.zoom_y < @original_set[3]
            self.zoom_y += 0.01
            self.zoom_y = @original_set[3] if self.zoom_y > @original_set[3]
         end         
      end        
      self.opacity += 10
      if self.angle > 0
         self.angle -= 5
         self.angle = @original_set[5] if self.angle < @original_set[5]
      end
      if self.src_rect.y != 0
         self.src_rect.y += @scr_rect_speed
         self.src_rect.y = 0 if self.src_rect.y > 0
      end
      if sprite_original_set?  
         @wait_motion_start = false
         self.src_rect.y = 0
      end   
  end  

  #--------------------------------------------------------------------------
  # ● Sprite original Set?
  #--------------------------------------------------------------------------         
  def sprite_original_set?
      return false if self.x != @original_set[0]
      return false if self.y != @original_set[1]
      return false if self.zoom_x != @original_set[2]
      return false if self.zoom_y != @original_set[3]      
      return false if self.mirror != @original_set[4]
      return false if self.angle != @original_set[5]
      return false if self.opacity != @original_set[6]
      return false if self.src_rect.y != 0
      return true
  end  

  #--------------------------------------------------------------------------
  # ● Setup Initial Motion
  #--------------------------------------------------------------------------        
  def execute_motion_damage
      damage_refresh
      update_motion_damage
  end

  #--------------------------------------------------------------------------
  # ● Damage Refresh
  #--------------------------------------------------------------------------         
  def damage_refresh
      return if @battler.motion_damage[0] == 0
      if @battler.motion_damage[1] == 0
         @damage_pre_set = [self.x, self.y, self.zoom_x,self.zoom_y,self.mirror,self.angle,self.opacity]
      end
      @battler.motion_damage[0] = 0
      @battler.motion_damage[1] = 45
  end

  #--------------------------------------------------------------------------
  # ● Update Motion Damage
  #--------------------------------------------------------------------------            
  def update_motion_damage
      return if @battler.motion_damage[1] == 0
      self.x = @damage_pre_set[0] + rand(@battler.motion_damage[1])
      @battler.motion_damage[1] -= 1
      if @battler.motion_damage[1] == 0
         if $mog_rgss3_battle_hud != nil and @battler.is_a?(Game_Actor)
            return_set(@original_set)
         else  
            return_set(@damage_pre_set)
         end   
      end  
  end  

  #--------------------------------------------------------------------------
  # ● Setup Motion Stand
  #--------------------------------------------------------------------------        
  def setup_motion_stand      
      @breath_range = [0.9, 1.0]
      @float_range = [@battler.screen_y - 10, @battler.screen_y + 10]
      @side_range = [@battler.screen_x - 10, @battler.screen_x + 10]
      @battler.motion_stand[1] = 0
      case @battler.motion_stand[0]
         when 0
             self.zoom_y = @breath_range[0] + (rand(10) / 100.0)
             @battler.motion_stand[1] = rand(2)
         when 1
             self.y += 10 - rand(20)
             @battler.motion_stand[1] = rand(2)
         when 2
             self.x += 10 - rand(20)
             @battler.motion_stand[1] = rand(2)            
      end   
  end

  #--------------------------------------------------------------------------
  # ● Execute Motion Animation
  #--------------------------------------------------------------------------        
  def execute_motion_animation
      return if @old_motion_action != -1
      return if @battler.motion_damage[1] > 0
      case @battler.motion_stand[0]
         when 0
             update_motion_breath
         when 1  
             update_motion_float
         when 2
             update_motion_side
      end        
  end  

  #--------------------------------------------------------------------------
  # ● Update Motion Breath
  #--------------------------------------------------------------------------         
  def update_motion_breath  
      case @battler.motion_stand[1]
         when 0
           self.zoom_y -= 0.002
           if self.zoom_y <= @breath_range[0]
              @battler.motion_stand[1] = 1
              self.zoom_y = @breath_range[0]
           end   
         when 1  
           self.zoom_y += 0.002
           if self.zoom_y >= @breath_range[1]
              @battler.motion_stand[1] = 0
              self.zoom_y = @breath_range[1]
           end   
      end
  end  

  #--------------------------------------------------------------------------
  # ● Update Motion Float
  #--------------------------------------------------------------------------         
  def update_motion_float
      @motion_speed += 1
      return if @motion_speed < 5
      @motion_speed = 0
      case @battler.motion_stand[1]
           when 0
                self.y -= 1
                if self.y < @float_range[0]
                   self.y = @float_range[0]
                   @battler.motion_stand[1] = 1
                end   
           when 1  
                self.y += 1
                if self.y > @float_range[1]
                   self.y = @float_range[1]
                   @battler.motion_stand[1] = 0
                end                  
      end
  end   

  #--------------------------------------------------------------------------
  # ● Update Motion Side
  #--------------------------------------------------------------------------         
  def update_motion_side
      @motion_speed += 1
      return if @motion_speed < 5
      @motion_speed = 0
      case @battler.motion_stand[1]
           when 0
                self.x -= 1
                if self.x < @side_range[0]
                   self.x = @side_range[0]
                   @battler.motion_stand[1] = 1
                end   
           when 1  
                self.x += 1
                if self.x > @side_range[1]
                   self.x = @side_range[1]
                   @battler.motion_stand[1] = 0
                end                  
      end
  end     

end

#==============================================================================
# ■ Game Action
#==============================================================================
class Game_Action

  #--------------------------------------------------------------------------
  # ● Prepare
  #--------------------------------------------------------------------------                  
  alias mog_motion_action_prepare prepare
  def prepare
      mog_motion_action_prepare   
      set_motion_action
  end

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

end

#==============================================================================
# ■ Sprite Battler
#==============================================================================
class Sprite_Battler < Sprite_Base

  #--------------------------------------------------------------------------
  # ● Setup Motion Action
  #--------------------------------------------------------------------------        
  def setup_motion_action
      @battler.motion_action = [-1,0]
      @old_motion_action = @battler.motion_action[0]
      @pre_set = [self.x, self.y, self.zoom_x,self.zoom_y,self.mirror,self.angle,self.opacity]
  end

  #--------------------------------------------------------------------------
  # ● Refresh Action
  #--------------------------------------------------------------------------         
  def refresh_action
      return if @old_motion_action == @battler.motion_action[0]
      if @old_motion_action == -1
         @pre_set = [self.x, self.y, self.zoom_x,self.zoom_y,self.mirror,self.angle,self.opacity]
      end
      @battler.motion_action[1] = 0  
      return_set(@pre_set)
      @old_motion_action = @battler.motion_action[0]
      self.src_rect.y =  0
  end  

  #--------------------------------------------------------------------------
  # ● Execute Motion Action
  #--------------------------------------------------------------------------            
  def execute_motion_action
      return if @battler.motion_damage[1] > 0
      refresh_action
      update_motion_action
  end  

  #--------------------------------------------------------------------------
  # ● Update Motion Action
  #--------------------------------------------------------------------------              
  def update_motion_action
      return if @battler.motion_action[0] == -1
      @battler.motion_action[1] += 1
      case @battler.motion_action[0]
           when 0
              update_motion_zoom
           when 1
              update_motion_jump
           when 2  
              update_motion_round_right
           when 3
              update_motion_round_left
           when 4
              update_motion_shake
           when 5
              update_motion_front
           when 6   
              update_motion_step_left
           when 7
              update_motion_step_right              
      end
  end

  #--------------------------------------------------------------------------
  # ● Update Motion Step Left
  #--------------------------------------------------------------------------                  
  def update_motion_step_left
      case @battler.motion_action[1]
           when 1..20
                self.x -= 2
           when 21..40  
                self.x += 2           
           else
           end_action
      end   

  end  

  #--------------------------------------------------------------------------
  # ● Update Motion Step Right
  #--------------------------------------------------------------------------                  
  def update_motion_step_right
      case @battler.motion_action[1]
           when 1..20
                self.x += 2
           when 21..40  
                self.x -= 2           
           else
        end_action   
      end   
  end   

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

  #--------------------------------------------------------------------------
  # ● Update Motion Zoom
  #--------------------------------------------------------------------------               
  def update_motion_zoom
      case @battler.motion_action[1]
        when 1..20
           self.zoom_x += 0.01
           self.zoom_y += 0.01
        when 21..40
           self.zoom_x -= 0.01
           self.zoom_y -= 0.01         
        else  
        end_action   
      end
  end

  #--------------------------------------------------------------------------
  # ● Update Motion Jump
  #--------------------------------------------------------------------------                  
  def update_motion_jump
      case @battler.motion_action[1]
        when 1..20
            self.y -= 9
            self.zoom_x += 0.01
            self.zoom_y += 0.01
            self.mirror = true
            self.angle += 9
        when 21..40
            self.y += 9
            self.zoom_x -= 0.01
            self.zoom_y -= 0.01            
            self.mirror = false
            self.angle += 9
        else  
        self.angle = 0
        end_action   
      end      
  end

  #--------------------------------------------------------------------------
  # ● Update Motion Front
  #--------------------------------------------------------------------------                  
  def update_motion_front
      case @battler.motion_action[1]
        when 1..20
            self.y += 3
            self.zoom_x += 0.02
            self.zoom_y += 0.02
        when 21..40
            self.y -= 3
            self.zoom_x -= 0.02
            self.zoom_y -= 0.02            
        else  
        end_action   
      end      
  end

  #--------------------------------------------------------------------------
  # ● Update Motion Round Left
  #--------------------------------------------------------------------------                    
  def update_motion_round_left
      case @battler.motion_action[1]
        when 1..15
            self.y += 3
            self.x -= 3
            self.mirror = false
        when 16..30
            self.x += 6
            self.mirror = true
        when 31..45
            self.y -= 3
            self.x -= 3
            self.mirror = false
        else  
        end_action  
      end        
  end

  #--------------------------------------------------------------------------
  # ● Update Motion Round Right
  #--------------------------------------------------------------------------                    
  def update_motion_round_right
      case @battler.motion_action[1]
        when 1..15
            self.y += 3
            self.x += 3
            self.mirror = true            
        when 16..30
            self.x -= 6
             self.mirror = false
        when 31..45
            self.y -= 3
            self.x += 3
            self.mirror = true
        else  
        end_action   
      end   
  end  

  #--------------------------------------------------------------------------
  # ● End Action
  #--------------------------------------------------------------------------                     
  def end_action
      if $mog_rgss3_battle_hud != nil and @battler.is_a?(Game_Actor)
         return_set(@original_set)
      else  
         return_set(@pre_set)  
      end
      @battler.motion_action = [-1,0]
  end  

end

#==============================================================================
# ■ Sprite Battler
#==============================================================================
class Sprite_Battler < Sprite_Base

  #--------------------------------------------------------------------------
  # ● Update Blink
  #--------------------------------------------------------------------------      
  alias mog_motion_animation_update_blink update_blink
  def update_blink
      return if @battler.dead?
      mog_motion_animation_update_blink
  end

  #--------------------------------------------------------------------------
  # ● Update Collapse
  #--------------------------------------------------------------------------
  def update_collapse   
  end

  #--------------------------------------------------------------------------
  # ● Execute Motion Collapse
  #--------------------------------------------------------------------------   
  def execute_motion_collapse
      collapse_end if self.opacity == 0
      @battler.motion_collapse[1] += 1      
      case @battler.motion_collapse[0]
           when 0;     update_collapse_vertical
           when 1;     update_collapse_horizontal
           when 2;     update_collapse_zoom_out
           when 3;     update_collapse_zoom_in
           when 4;     update_collapse_zoom_in_out
           when 5;     update_collapse_boss_2
           when 6;     update_collpase_do_nothing
           else ;      update_collapse_normal
      end

  end

  #--------------------------------------------------------------------------
  # ● Can Execute Collapse
  #--------------------------------------------------------------------------      
  def can_execute_collapse?
      return false if !@battler.dead?
      return false if @collapse_done
      return true
  end

  #--------------------------------------------------------------------------
  # ● Update Collapse Vertical
  #--------------------------------------------------------------------------        
  def update_collapse_vertical
      self.zoom_y += 0.1
      self.zoom_x -= 0.02         
      self.opacity -= 3   
  end

  #--------------------------------------------------------------------------
  # ● Update Collapse Horizontal
  #--------------------------------------------------------------------------         
  def update_collapse_horizontal
      self.zoom_x += 0.1
      self.zoom_y -= 0.02      
      self.opacity -= 3      
  end

  #--------------------------------------------------------------------------
  # ● Update Collapse Zoom Out
  #--------------------------------------------------------------------------            
  def update_collapse_zoom_out     
      self.zoom_x += 0.02
      self.zoom_y += 0.02     
      self.opacity -= 4   
  end

  #--------------------------------------------------------------------------
  # ● Update Collapse Zoom IN
  #--------------------------------------------------------------------------              
  def update_collapse_zoom_in
      self.zoom_x -= 0.01
      self.zoom_y -= 0.01      
      self.opacity -= 4            
  end

  #--------------------------------------------------------------------------
  # ● Update Collapse Zoom IN OUT
  #--------------------------------------------------------------------------               
  def update_collapse_zoom_in_out
      case @battler.motion_collapse[1]
           when 0..30
                self.zoom_x += 0.1
                self.zoom_y -= 0.02
                self.opacity -= 2
           else  
                self.zoom_y += 0.5
                self.zoom_x -= 0.2
                self.opacity -= 10
      end      
  end

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

  #--------------------------------------------------------------------------
  # ● Update Collapse do nothing
  #--------------------------------------------------------------------------                    
  def update_collpase_do_nothing

  end  

  #--------------------------------------------------------------------------
  # ● Update Collapse Normal
  #--------------------------------------------------------------------------                    
  def update_collapse_normal
      self.opacity -= 3
      self.blend_type = 1
  end  

  #--------------------------------------------------------------------------
  # ● Collapse End
  #--------------------------------------------------------------------------      
  def collapse_end
      @collapse_done = true
      return_set(@original_set)
      self.src_rect.y = -self.bitmap.height unless @battler.motion_collapse[0] == 6
  end  

  #--------------------------------------------------------------------------
  # ● Revert to Normal
  #--------------------------------------------------------------------------        
  alias mog_battler_motion_revert_to_normal revert_to_normal
  def revert_to_normal
      if @collapse_done
         @collapse_done = false
         return_set(@original_set)
      end
      mog_battler_motion_revert_to_normal
  end  

end

$mog_rgss3_battler_motion = true[/pre]
找工作中。。。。。。
个人的最新画作:
照片头像写生,抖森一枚
回复

使用道具 举报

梦石
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.

在本版发帖返回顶部