Project1

标题: 有没有一次性在动画前插入多贞的方法? [打印本页]

作者: 薄荷冰水    时间: 2008-8-1 23:46
标题: 有没有一次性在动画前插入多贞的方法?
我用的是齐时战斗....但是用法术的时候
人一师法
怪物就有动画..不是很好
所以我想在技能面前+些空白贞..
就是1~25是没有东西
26以后才有东西...
一个一个插入太久了
有没有快捷的办法....

- = 我这有200个技能动画... [LINE]1,#dddddd[/LINE]版务信息:本贴由楼主自主结贴~
作者: 劍之飛龍☆    时间: 2008-8-1 23:54
MS只有一个一个的加了……
就算是批量处理好象也是只能在同一个动画上动刀……
作者: 薄荷冰水    时间: 2008-8-2 00:15
同一个动画上就可以了
起码不用每次都一个一个地插入25次
作者: dbshy    时间: 2008-8-2 01:21
module RPG
  class Sprite < ::Sprite
   
   
    def initialize(viewport = nil)
      super(viewport)
      @_whiten_duration = 0
      @_appear_duration = 0
      @_escape_duration = 0
      @_collapse_duration = 0
      @_damage_duration = 0
      @_animation_duration = 0
      @_blink = false
      
      @_animation_wait = 0
      
      
    end

   
    def animation(animation, hit)
      dispose_animation

      @_animation_wait = 300
      
      @_animation = animation
      return if @_animation == nil
      @_animation_hit = hit
      @_animation_duration = @_animation.frame_max
      animation_name = @_animation.animation_name
      animation_hue = @_animation.animation_hue
      bitmap = RPG::Cache.animation(animation_name, animation_hue)
      if @@_reference_count.include?(bitmap)
        @@_reference_count[bitmap] += 1
      else
        @@_reference_count[bitmap] = 1
      end
      @_animation_sprites = []
      if @_animation.position != 3 or not @@_animations.include?(animation)
        for i in 0..15
          sprite = ::Sprite.new(self.viewport)
          sprite.bitmap = bitmap
          sprite.visible = false
          @_animation_sprites.push(sprite)
        end
        unless @@_animations.include?(animation)
          @@_animations.push(animation)
        end
      end
      
      
      if @_animation_wait == 0 then
       update_animation
      end
     
      
    end

   
     def update
      super
      if @_whiten_duration > 0
        @_whiten_duration -= 1
        self.color.alpha = 128 - (16 - @_whiten_duration) * 10
      end
      if @_appear_duration > 0
        @_appear_duration -= 1
        self.opacity = (16 - @_appear_duration) * 16
      end
      if @_escape_duration > 0
        @_escape_duration -= 1
        self.opacity = 256 - (32 - @_escape_duration) * 10
      end
      if @_collapse_duration > 0
        @_collapse_duration -= 1
        self.opacity = 256 - (48 - @_collapse_duration) * 6
      end
      if @_damage_duration > 0
        @_damage_duration -= 1
        case @_damage_duration
        when 38..39
          @_damage_sprite.y -= 4
        when 36..37
          @_damage_sprite.y -= 2
        when 34..35
          @_damage_sprite.y += 2
        when 28..33
          @_damage_sprite.y += 4
        end
        @_damage_sprite.opacity = 256 - (12 - @_damage_duration) * 32
        if @_damage_duration == 0
          dispose_damage
        end
      end
      
      
      if @_animation_wait > 0 then
      @_animation_wait -= 1
      end
   
      if @_animation_wait == 0 then
      if @_animation != nil and (Graphics.frame_count % 2 == 0)
        @_animation_duration -= 1
        update_animation
      end
      end
   
   
      
      if @_loop_animation != nil and (Graphics.frame_count % 2 == 0)
        update_loop_animation
        @_loop_animation_index += 1
        @_loop_animation_index %= @_loop_animation.frame_max
      end
      if @_blink
        @_blink_count = (@_blink_count + 1) % 32
        if @_blink_count < 16
          alpha = (16 - @_blink_count) * 6
        else
          alpha = (@_blink_count - 16) * 6
        end
        self.color.set(255, 255, 255, alpha)
      end
      @@_animations.clear
    end
   
   
  end
end

把上面的脚本加入MAIN前
其中@_animation_wait 为我加的
你只需该数值即可

另外如果是判断技能的话,家个IF,或在数据库中排好位置 [LINE]1,#dddddd[/LINE]系统信息:本贴由楼主认可为正确答案,66RPG感谢您的热情解答~
作者: 薄荷冰水    时间: 2008-8-2 02:17
感谢````试下..
作者: zl90349166    时间: 2008-8-2 02:35
提示: 作者被禁止或删除 内容自动屏蔽
作者: 薄荷冰水    时间: 2008-8-2 02:44
{/gg}最后我还是放弃用脚本了...
我又不善用脚本...
等下把我200个动画都搞乱了,我哭着找谁去啊  - =

实在感谢LS的LS的LS
作者: 灯笼菜刀王    时间: 2008-8-2 03:50
不用点25次,可以先增加最大桢,然后复制所有桢到25的位置,检查看看最后一桢是不是正好到新加的最后一桢,然后清除1-25桢就行了。




欢迎光临 Project1 (https://rpg.blue/) Powered by Discuz! X3.1