赞 | 0 |
VIP | 0 |
好人卡 | 0 |
积分 | 1 |
经验 | 17880 |
最后登录 | 2012-12-15 |
在线时间 | 1 小时 |
Lv1.梦旅人
- 梦石
- 0
- 星屑
- 50
- 在线时间
- 1 小时
- 注册时间
- 2005-10-24
- 帖子
- 135
|
加入我们,或者,欢迎回来。
您需要 登录 才可以下载或查看,没有帐号?注册会员
x
- class Scene_Battle_CP
- include SetCP
- attr_accessor :stop
- attr_accessor :ttbar
- attr_accessor :refresh
- BATTLE_SPEED = 0.8
- def initialize
- # 刷新标志
- @refresh = Hash.new(false)
- @stop = false
- @all_agi = 0
- @v = Viewport.new(150-64, 32, 14, 172)
- @v.z = 60
- @cpbar = Sprite.new(@v)
- @cpbar.bitmap = RPG::Cache.system("atb")
- @ttbar = {}
- for battler in $game_party.actors + $game_troop.enemies
- @all_agi += battler.agi
- @ttbar[battler] = CPSprite.new
- if battler.is_a?(Game_Actor)
- @ttbar[battler].bitmap = RPG::Cache.system("actor").dup
- bitmap = RPG::Cache.system(Bar[battler.type][0])
- @ttbar[battler].bitmap.blt(0,2,bitmap,bitmap.rect)
- @ttbar[battler].x = 150-64-27
- else
- @ttbar[battler].bitmap = RPG::Cache.system("enemy").dup
- bitmap = RPG::Cache.system(Bar[battler.type][0])
- @ttbar[battler].bitmap.blt(12,0,bitmap,bitmap.rect)
- @ttbar[battler].x = 150 - 63
- end
- @ttbar[battler].z = 101
- @ttbar[battler].visible = false
- end
- end
- def update
- @ttbar.each{|key, value|
- if value.disposed?
- @ttbar.delete(key)
- next
- end
- value.update}
- return if @stop
- for battler in $game_party.actors + $game_troop.enemies
- if battler.dead?
- if @ttbar.include?(battler)
- @ttbar[battler].collapse
- #@ttbar[battler].dispose
- #@ttbar.delete(battler)
- end
- battler.cp = 0
- next
- end
- battler.cp = [[battler.cp + BATTLE_SPEED * 10 * battler.agi / @all_agi, 0].max,100].min
- if battler.cp == battler.maxcp
- @refresh[battler] = false
- case battler
- when Game_Actor
- @ttbar[battler].bitmap = RPG::Cache.system("actor_active").dup
- bitmap = RPG::Cache.system(Bar[battler.type][1])
- @ttbar[battler].bitmap.blt(0,2,bitmap,bitmap.rect)
- when Game_Enemy
- @ttbar[battler].bitmap = RPG::Cache.system("enemy_active").dup
- bitmap = RPG::Cache.system(Bar[battler.type][1])
- @ttbar[battler].bitmap.blt(12,0,bitmap,bitmap.rect)
- end
- @ttbar[battler].z = 200
- elsif battler.cp != battler.maxcp and @refresh[battler] == true
- @refresh[battler] = false
- case battler
- when Game_Actor
- @ttbar[battler].bitmap = RPG::Cache.system("actor").dup
- bitmap = RPG::Cache.system(Bar[battler.type][0])
- @ttbar[battler].bitmap.blt(0,2,bitmap,bitmap.rect)
- when Game_Enemy
- @ttbar[battler].bitmap = RPG::Cache.system("enemy").dup
- bitmap = RPG::Cache.system(Bar[battler.type][0])
- @ttbar[battler].bitmap.blt(12,0,bitmap,bitmap.rect)
- end
- @ttbar[battler].z = 100
- end
- @ttbar[battler].visible = true if @ttbar[battler].visible == false
- @ttbar[battler].y = (142 - (battler.cp * 135 / battler.maxcp)) + 32-7
- end
- end
- def dispose
- @v.dispose
- @cpbar.dispose
- for v in @ttbar.values
- v.dispose
- end
- end
- class CPSprite < ::Sprite
- def initialize(v=nil)
- super
- @_collapse_duration = 0
- end
- def collapse
- self.blend_type = 1
- self.color.set(255, 64, 64, 255)
- self.opacity = 255
- @_collapse_duration = 30
- end
- def update
- super
- if @_collapse_duration > 0
- @_collapse_duration -= 1
- self.opacity = 256 - (30 - @_collapse_duration) * 9
- end
- if self.opacity == 0
- self.dispose
- end
- end
- end
- end
复制代码
这个是从战斗真位移里面弄下来的。我想把Y调大点。可是修改了好多地方都是错的。
会变成攻击打到后Y先下降再上升(图标先升上去又掉下来。。。)
本来应该是打到后图标直接下降。实在是改不出来这个效果。。。
会的或作者进来帮忙下。。。 |
|