赞 | 0 |
VIP | 39 |
好人卡 | 2 |
积分 | 1 |
经验 | 10295 |
最后登录 | 2017-9-1 |
在线时间 | 250 小时 |
Lv1.梦旅人
- 梦石
- 0
- 星屑
- 50
- 在线时间
- 250 小时
- 注册时间
- 2011-8-16
- 帖子
- 178
|
http://rpg.blue/forum.php?mod=vi ... &authorid=64107
清纯版
我练习改这些老半天了,还不行。
另一个版本的,杂乱东西太多了,我只想弄纵版的,结果弄另一个脚本全变了
#================================================
#★cp条处理类
#================================================
class Scene_CP
attr_accessor :stop
attr_accessor :in_battler
attr_accessor :cp_battler
BATTLE_SPEED = 0.8
def initialize
@stop = false
@all_agi = 0
@v = Viewport.new(0, 0, 544, 90)
@count = 0
@cpline = Sprite.new(@v)
@cpline.bitmap = Bitmap.new(544,416)
bitmap = Bitmap.new("Graphics/system/cp条")
@cpline.bitmap.blt(105,8,bitmap,bitmap.rect)
@cp_battler = {}
@walk_count = 0
for battler in $game_party.members + $game_troop.members
@all_agi += battler.agi
@cp_battler[battler] = Sprite_cpbattler.new
if battler.is_a?(Game_Actor)
name = battler.id.to_s + "_cp"
if FileTest.exist?("Graphics/system/#{name}.jpg") or FileTest.exist?("Graphics/system/#{name}.png") or FileTest.exist?("Graphics/system/#{name}.bmp")
bitmap = Bitmap.new("Graphics/system/#{name}")
rect = bitmap.rect
@cp_battler[battler].bitmap = bitmap
else
bitmap = Bitmap.new("Graphics/Characters/#{battler.character_name}")
sign = battler.character_name[/^[\!\$]./]
if sign != nil and sign.include?('$')
cw = bitmap.width / 3
ch = bitmap.height / 4
else
cw = bitmap.width / 12
ch = bitmap.height / 8
end
n = battler.character_index
rect = Rect.new((n%4*3+1)*cw, (n/4*4+2)*ch, cw, ch)
@cp_battler[battler].bitmap = Bitmap.new(cw,ch)
end
@cp_battler[battler].bitmap.blt(0, 0,bitmap,rect)
else
name = battler.original_name + "_敌人cp"
if FileTest.exist?("Graphics/system/#{name}.jpg") or FileTest.exist?("Graphics/system/#{name}.png") or FileTest.exist?("Graphics/system/#{name}.bmp")
@cp_battler[battler].bitmap = Bitmap.new("Graphics/system/#{name}")
else
@cp_battler[battler].bitmap = Bitmap.new("Graphics/system/敌人cp")
end
@cp_battler[battler].bitmap.blt(80,60, @cp_battler[battler].bitmap, @cp_battler[battler].bitmap.rect)
end
@cp_battler[battler].z = 101
@cp_battler[battler].visible = false
end
end
#===========================================
#===========================================
def update
return if @stop
for battler in $game_party.members + $game_troop.members
if (@cp_battler[battler].disposed? or @cp_battler[battler].opacity == 0) and battler.dead?
@cp_battler.delete(@cp_battler[battler])
next
end
if battler.dead?
if @cp_battler.include?(battler)
@cp_battler[battler].collapse = true
end
battler.cp = 0
next
end
next if @cp_battler[battler].disposed?
battler.cp = [[battler.cp + BATTLE_SPEED*10*battler.agi / @all_agi,0].max,battler.maxcp].min if battler.movable?
battler.cp_turn = [[battler.cp_turn+BATTLE_SPEED*10*battler.agi / @all_agi, 0].max,battler.maxcp].min
if battler.cp == battler.maxcp
#============================
#☆设置战斗者处于回合准备状态
#============================
battler.turn_start = 3
#============================
if battler.is_a?(Game_Actor)
name = battler.id.to_s + "_a_cp"
if FileTest.exist?("Graphics/system/#{name}.jpg") or FileTest.exist?("Graphics/system/#{name}.png") or FileTest.exist?("Graphics/system/#{name}.bmp")
bitmap = Bitmap.new("Graphics/system/#{name}")
rect = bitmap.rect
@cp_battler[battler].bitmap = bitmap
else
bitmap = Bitmap.new("Graphics/Characters/#{battler.character_name}")
sign = battler.character_name[/^[\!\$]./]
if sign != nil and sign.include?('$')
cw = bitmap.width / 3
ch = bitmap.height / 4
else
cw = bitmap.width / 12
ch = bitmap.height / 8
end
n = battler.character_index
rect = Rect.new((n%4*3+1)*cw, (n/4*4)*ch, cw, ch)
@cp_battler[battler].bitmap = Bitmap.new(cw,ch)
end
@cp_battler[battler].bitmap.blt(0,0,bitmap,rect)
else
name = battler.original_name + "_a_cp"
if FileTest.exist?("Graphics/system/#{name}.jpg") or FileTest.exist?("Graphics/system/#{name}.png") or FileTest.exist?("Graphics/system/#{name}.bmp")
@cp_battler[battler].bitmap = Bitmap.new("Graphics/system/#{name}")
else
@cp_battler[battler].bitmap = Bitmap.new("Graphics/system/a_敌人cp")
end
@cp_battler[battler].bitmap.blt(80,60, @cp_battler[battler].bitmap, @cp_battler[battler].bitmap.rect)
end
@cp_battler[battler].z = 101
battler.cp_total = true
elsif battler.cp_total == true
if battler.is_a?(Game_Actor)
name = battler.id.to_s + "_cp"
if FileTest.exist?("Graphics/system/#{name}.jpg") or FileTest.exist?("Graphics/system/#{name}.png") or FileTest.exist?("Graphics/system/#{name}.bmp")
bitmap = Bitmap.new("Graphics/system/#{name}")
rect = bitmap.rect
@cp_battler[battler].bitmap = bitmap
else
bitmap = Bitmap.new("Graphics/Characters/#{battler.character_name}")
sign = battler.character_name[/^[\!\$]./]
if sign != nil and sign.include?('$')
cw = bitmap.width / 3
ch = bitmap.height / 4
else
cw = bitmap.width / 12
ch = bitmap.height / 8
end
n = battler.character_index
rect = Rect.new((n%4*3+1)*cw, (n/4*4+2)*ch, cw, ch)
@cp_battler[battler].bitmap = Bitmap.new(cw,ch)
end
@cp_battler[battler].bitmap.blt(0,0,bitmap,rect)
elsif
name = battler.original_name + "_敌人cp"
if FileTest.exist?("Graphics/system/#{name}.jpg") or FileTest.exist?("Graphics/system/#{name}.png") or FileTest.exist?("Graphics/system/#{name}.bmp")
@cp_battler[battler].bitmap = Bitmap.new("Graphics/system/#{name}")
else
@cp_battler[battler].bitmap = Bitmap.new("Graphics/system/敌人cp")
end
@cp_battler[battler].bitmap.blt(80,60, @cp_battler[battler].bitmap, @cp_battler[battler].bitmap.rect)
end
battler.cp_total = false
@cp_battler[battler].z = 105
|
|