赞 | 0 |
VIP | 1 |
好人卡 | 5 |
积分 | 1 |
经验 | 3155 |
最后登录 | 2012-6-13 |
在线时间 | 67 小时 |
Lv1.梦旅人
- 梦石
- 0
- 星屑
- 50
- 在线时间
- 67 小时
- 注册时间
- 2009-11-30
- 帖子
- 159
|
- #==============================================================================
- # ■ Sprite_Battler
- #==============================================================================
- class Sprite_Battler < Sprite_Base
- # 条子底色[框子颜色, 框中颜色]
- CTBGAUGE_BC = [Color.new(0,0,0), Color.new(32,48,64)]
- #条子渐变色 [左, 右]
- CTBGAUGE_GC = [Color.new(160,128,40), Color.new(255,242,80)]
- # 咏唱时条子的渐变色 [左, 右]
- CTBGAUGE_AW = [Color.new(206,88,136), Color.new(255,190,234)]
- #
- CTBGAUGE_Y = 3 # Y坐标位置修正
- CTBGAUGE_Z = 0 # Z坐标位置修正(v1.0)
- CTBGAUGE_W = 96 # 条子宽
- CTBGAUGE_H = 6 # 条子高
- #--------------------------------------------------------------------------
- # ★ alias
- #--------------------------------------------------------------------------
- alias initialize_str33g2 initialize
- def initialize(viewport, battler = nil)
- initialize_str33g2(viewport, battler)
- if @battler != nil and @battler.is_a?(Game_Enemy)
- b = CTBGAUGE_BC
- c = CTBGAUGE_GC
- a = CTBGAUGE_AW
- # 条子描画
- bitmap = Bitmap.new(CTBGAUGE_W, CTBGAUGE_H * 3)
- bitmap.fill_rect(0, 0, CTBGAUGE_W, CTBGAUGE_H, b[0])
- bitmap.fill_rect(1, 1, CTBGAUGE_W - 2, CTBGAUGE_H - 2, b[1])
- bitmap.gradient_fill_rect(1, CTBGAUGE_H + 1, CTBGAUGE_W - 2, CTBGAUGE_H - 2, c[0], c[1])
- bitmap.gradient_fill_rect(1, (CTBGAUGE_H*2) + 1, CTBGAUGE_W - 2, CTBGAUGE_H - 2, a[0], a[1])
- # 条子精灵作成
- @ctb_gauge_a = Sprite.new
- s = @ctb_gauge_a
- s.bitmap = bitmap
- s.src_rect.set(0, 0, CTBGAUGE_W, CTBGAUGE_H)
- s.viewport = self.viewport
- s.x = @battler.screen_x
- s.y = @battler.screen_y - 16 + CTBGAUGE_Y
- s.z += 200 + CTBGAUGE_Z
- s.ox = CTBGAUGE_W / 2
- s.oy = CTBGAUGE_H / 2
- s.opacity = 0
- @ctb_gauge_b = Sprite.new
- s = @ctb_gauge_b
- s.bitmap = bitmap
- s.src_rect.set(0, CTBGAUGE_H, CTBGAUGE_W, CTBGAUGE_H)
- s.viewport = self.viewport
- s.x = @battler.screen_x
- s.y = @battler.screen_y - 16 + CTBGAUGE_Y
- s.z += 220 + CTBGAUGE_Z
- s.ox = CTBGAUGE_W / 2
- s.oy = CTBGAUGE_H / 2
- s.opacity = 0
- @ctb = @battler.ctb_gauge
- @ctb_gauge_w = CTBGAUGE_W + 1
- @ctb_gauge_o = 0
- end
- end
- alias dispose_str33g2 dispose
- def dispose
- # 条子释放
- if @battler != nil and @battler.is_a?(Game_Enemy)
- @ctb_gauge_a.bitmap.dispose
- @ctb_gauge_a.dispose
- @ctb_gauge_b.dispose
- end
- dispose_str33g2
- end
- alias update_str33g2 update
- def update
- update_str33g2
- # 条子更新
- if @battler != nil and @battler.is_a?(Game_Enemy)
- # 色変更
- gauge = @battler.ctb_gauge
- if @battler.aw_gauge > 0
- gauge = @battler.aw_gauge
- @ctb_gauge_b.src_rect.y = @ctb_gauge_b.src_rect.height * 2
- else
- @ctb_gauge_b.src_rect.y = @ctb_gauge_b.src_rect.height
- end
- if @ctb != gauge
- @ctb_gauge_w = ((CTBGAUGE_W * (gauge / (@battler.max_ctb_gauge * 1.0))) + 1).truncate
- @ctb = gauge
- @ctb_gauge_b.src_rect.width = @ctb_gauge_w
- end
- # 透明度
- if @battler.exist?
- @ctb_gauge_o += 16 if 255 > @ctb_gauge_o
- else
- @ctb_gauge_o -= 16 if 0 < @ctb_gauge_o
- end
- @ctb_gauge_a.opacity = @ctb_gauge_o
- @ctb_gauge_b.opacity = @ctb_gauge_o
- end
- end
- end
复制代码 因为有了这么个东西,所以会变色咯
需要配合33a,g2使用
或者重新定义ctb调用 |
|