Project1

标题: 怎么修改伤害显示部分? [打印本页]

作者: h7693781    时间: 2007-12-16 20:39
标题: 怎么修改伤害显示部分?
我找到那个地方了,可是怎么改定义?谁帮我下,我要改成伤害只要数字往上飘2帧就消失,然后立刻进入下回合,怎么弄? [LINE]1,#dddddd[/LINE]版务信息:本贴由楼主自主结贴~
作者: h7693781    时间: 2007-12-16 20:39
标题: 怎么修改伤害显示部分?
我找到那个地方了,可是怎么改定义?谁帮我下,我要改成伤害只要数字往上飘2帧就消失,然后立刻进入下回合,怎么弄? [LINE]1,#dddddd[/LINE]版务信息:本贴由楼主自主结贴~
作者: 漆黑之牙二世    时间: 2007-12-16 20:45
提示: 作者被禁止或删除 内容自动屏蔽
作者: 黑撒旦    时间: 2007-12-17 20:27
脚本如下:

  1. module RPG
  2.   class Sprite < ::Sprite  
  3.     def update
  4.       super
  5.       if @_whiten_duration > 0
  6.         @_whiten_duration -= 1
  7.         self.color.alpha = 128 - (16 - @_whiten_duration) * 10
  8.       end
  9.       if @_appear_duration > 0
  10.         @_appear_duration -= 1
  11.         self.opacity = (16 - @_appear_duration) * 16
  12.       end
  13.       if @_escape_duration > 0
  14.         @_escape_duration -= 1
  15.         self.opacity = 256 - (32 - @_escape_duration) * 10
  16.       end
  17.       if @_collapse_duration > 0
  18.         @_collapse_duration -= 1
  19.         self.opacity = 256 - (48 - @_collapse_duration) * 6
  20.       end
  21.       if @_damage_duration > 0
  22.         @_damage_duration -= 10
  23.         case @_damage_duration
  24.         when 38..39
  25.           @_damage_sprite.y -= 50
  26.         when 36..37
  27.           @_damage_sprite.y -= 50
  28.         when 34..35
  29.           @_damage_sprite.y -= 50
  30.         when 28..33
  31.           @_damage_sprite.y -= 50
  32.         end
  33.         @_damage_sprite.opacity = 256 - (12 - @_damage_duration) * 32
  34.         if @_damage_duration <= 0
  35.            @_damage_duration = 0
  36.           dispose_damage
  37.         end
  38.       end
  39.       if @_animation != nil and (Graphics.frame_count % 2 == 0)
  40.         @_animation_duration -= 1
  41.         update_animation
  42.       end
  43.       if @_loop_animation != nil and (Graphics.frame_count % 2 == 0)
  44.         update_loop_animation
  45.         @_loop_animation_index += 1
  46.         @_loop_animation_index %= @_loop_animation.frame_max
  47.       end
  48.       if @_blink
  49.         @_blink_count = (@_blink_count + 1) % 32
  50.         if @_blink_count < 16
  51.           alpha = (16 - @_blink_count) * 6
  52.         else
  53.           alpha = (@_blink_count - 16) * 6
  54.         end
  55.         self.color.set(255, 255, 255, alpha)
  56.       end
  57.       @@_animations.clear
  58.     end
  59.   end  
  60. end
复制代码
[LINE]1,#dddddd[/LINE]系统信息:本贴由楼主认可为正确答案,66RPG感谢您的热情解答~




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