赞 | 153 |
VIP | 10 |
好人卡 | 39 |
积分 | 93 |
经验 | 146191 |
最后登录 | 2024-5-6 |
在线时间 | 2504 小时 |
Lv4.逐梦者
- 梦石
- 0
- 星屑
- 9280
- 在线时间
- 2504 小时
- 注册时间
- 2011-5-20
- 帖子
- 15389
|
3楼
楼主 |
发表于 2012-5-20 15:28:24
|
只看该作者
tommay 发表于 2012-5-20 15:22
楼主贴出另一个脚本吧
伤害显示就不是一个脚本了···伤害显示改了好几个地方,除了加新东西还改掉了RM默认的东西
‘‘──chd114于2012-5-20 15:29补充以下内容
- 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
- ###########################################################################
- @_word_duration = 0 #(和上面保持阵形 = =|||)
- ###########################################################################
- end
- def dispose
- dispose_damage
- dispose_animation
- dispose_loop_animation
- ###########################################################################
- dispose_word
- ###########################################################################
- super
- end
- def word(value) #本脚本63行 = =||| 众:“太恶劣了!太恶劣了!”
- dispose_word #= =b 64行
- bitmap = Bitmap.new(250, 48) #.....65
- bitmap.font.name = "黑体" #注意字体
- bitmap.font.size = 22 #字体大小
- #bitmap.font.italic = true #这个是斜体 一般可以不用
- bitmap.font.color.set(0, 0, 0) #R G B
- bitmap.draw_text(-1, 12-1, 250, 36, value, 1)
- bitmap.draw_text(+1, 12-1, 250, 36, value, 1)
- bitmap.draw_text(-1, 12+1, 250, 36, value, 1)
- bitmap.draw_text(+1, 12+1, 250, 36, value, 1)
- #颜色 当然可以加很多 只要你记得住 = =|||
- case $word_color
- when 0 #==
- bitmap.font.color.set(255, 255, 255)
- when 1 #==
- bitmap.font.color.set(255, 0, 0)
- when 2 #==
- bitmap.font.color.set(0, 255, 0)
- when 3 #==
- bitmap.font.color.set(0, 0, 255)
- when 4 # = =
- bitmap.font.color.set(255, 255, 0)
- when 5 #==
- bitmap.font.color.set(255, 255, 255, 255)
- when 6 #==
- bitmap.font.color.set(128, 128, 255, 255)
- when 7 #==
- bitmap.font.color.set(255, 128, 128, 255)
- when 8 #==
- bitmap.font.color.set(128, 255, 128, 255)
- when 9 #==
- bitmap.font.color.set(128, 255, 255, 255)
- when 10#==
- bitmap.font.color.set(255, 128, 255, 255)
- when 11#==
- bitmap.font.color.set(255, 255, 128, 255)
- when 12#==
- bitmap.font.color.set(192, 192, 192, 255)
- when 13#==
- bitmap.font.color.set(0, 0, 0, 255)
- when 14#==
- bitmap.font.color.set(255, 50, 50, 255)
- when 15#==
- bitmap.font.color.set(128, 255, 128, 255)
- when 16#==
- bitmap.font.color.set(140, 140, 140, 255)
- when 17#==
- bitmap.font.color.set(255, 255, 0, 200)
- when 18#==
- bitmap.font.color.set(0, 255, 255, 255)
- when 19#==
- bitmap.font.color.set(119, 0, 255, 255)
- when 20#==
- bitmap.font.color.set(255, 255, 255, 255)
- when 21#==
- bitmap.font.color.set(128, 128, 255, 255)
- when 22#==
- bitmap.font.color.set(255, 128, 128, 255)
- when 23#==
- bitmap.font.color.set(128, 255, 128, 255)
- when 24#==
- bitmap.font.color.set(128, 255, 255, 255)
- when 25#==
- bitmap.font.color.set(255, 128, 255, 255)
- when 26#==
- bitmap.font.color.set(255, 255, 128, 255)
- when 27#==
- bitmap.font.color.set(192, 192, 192, 255)
- end
- bitmap.draw_text(0, 12, 250, 36, value, 1)
- #那啥 = = 呃....94行
- @_word_sprite = ::Sprite.new(self.viewport)
- @_word_sprite.bitmap = bitmap
- @_word_sprite.ox = 105
- @_word_sprite.oy = 15
- @_word_sprite.x = self.x - self.ox
- @_word_sprite.y = self.y - self.oy
- #Z坐标 约等于层次 值越大越在前
- @_word_sprite.z = 3001
- @_word_duration = 40
- end
- def dispose_word #善后工作 = =||| 收尸......
- if @_word_sprite != nil
- @_word_sprite.bitmap.dispose
- @_word_sprite.dispose
- @_word_sprite = nil
- @_word_duration = 0
- 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
- ###########################################################################
- #众:"你小子要抄到什么时候?"
- #众人使出了必杀:语法错误!
- #Zapper充满恐惧的想要转身逃跑!
- if @_word_duration > 0
- @_word_duration -= 1
- case @_word_duration
- when 38..39
- @_word_sprite.y -= 4
- when 36..37
- @_word_sprite.y -= 3
- when 34..35
- @_word_sprite.y -= 2
- when 28..33
- @_word_sprite.y -= 1
- end
- @_word_sprite.opacity = 256 - (12 - @_word_duration) * 32
- if @_word_duration == 0
- dispose_word #还记得那个善后工作么?
- end
- end
- ###########################################################################
- if @_animation != nil and (Graphics.frame_count % 2 == 0)
- @_animation_duration -= 1
- update_animation
- 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
复制代码 上面这个只是添加的,下面还有修改的
’’
‘‘──chd114于2012-5-20 15:29补充以下内容
- #==============================================================================
- # ■ Sprite_Character
- #------------------------------------------------------------------------------
- # 角色显示用脚本。监视 Game_Character 类的实例、
- # 自动变化脚本状态。
- #==============================================================================
- class Sprite_Character < RPG::Sprite
- #--------------------------------------------------------------------------
- # ● 定义实例变量
- #--------------------------------------------------------------------------
- attr_accessor :character # 角色
- #--------------------------------------------------------------------------
- # ● 初始化对像
- # viewport : 查看端口
- # character : 角色 (Game_Character)
- #--------------------------------------------------------------------------
- def initialize(viewport, character = nil)
- super(viewport)
- @character = character
- update
- end
- #--------------------------------------------------------------------------
- # ● 更新画面
- #--------------------------------------------------------------------------
- def update
- super
- # RP魔塔伤害提示
- if @character.talk == true
- word(@character.word)
- @character.word = ""
- @character.talk = false
- end
- # 元件 ID、文件名、色相与现在的情况存在差异的情况下
- if @tile_id != @character.tile_id or
- @character_name != @character.character_name or
- @character_hue != @character.character_hue
- # 记忆元件 ID 与文件名、色相
- @tile_id = @character.tile_id
- @character_name = @character.character_name
- @character_hue = @character.character_hue
- # 元件 ID 为有效值的情况下
- if @tile_id >= 384
- self.bitmap = RPG::Cache.tile($game_map.tileset_name,
- @tile_id, @character.character_hue)
- self.src_rect.set(0, 0, 32, 32)
- self.ox = 16
- self.oy = 32
- # 元件 ID 为无效值的情况下
- else
- self.bitmap = RPG::Cache.character(@character.character_name,
- @character.character_hue)
- @cw = bitmap.width / 4
- @ch = bitmap.height / 4
- self.ox = @cw / 2
- self.oy = @ch
- end
- end
- # 设置可视状态
- self.visible = (not @character.transparent)
- # 图形是角色的情况下
- if @tile_id == 0
- # 设置传送目标的矩形
- sx = @character.pattern * @cw
- sy = (@character.direction - 2) / 2 * @ch
- self.src_rect.set(sx, sy, @cw, @ch)
- end
- # 设置脚本的坐标
- self.x = @character.screen_x
- self.y = @character.screen_y
- self.z = @character.screen_z(@ch)
- # 设置不透明度、合成方式、茂密
- self.opacity = @character.opacity
- self.blend_type = @character.blend_type
- self.bush_depth = @character.bush_depth
- # 动画
- if @character.animation_id != 0
- animation = $data_animations[@character.animation_id]
- animation(animation, true)
- @character.animation_id = 0
- end
- end
- end
复制代码
’’ |
|