#--------------------------------------------------------------------------
# ● 初始化变量
#--------------------------------------------------------------------------
def initialize
# 生成显示端口
@viewport1 = Viewport.new(0, 0, 640, 480)
@viewport2 = Viewport.new(0, 0, 640, 480)
@viewport3 = Viewport.new(0, 0, 640, 480)
@viewport4 = Viewport.new(0, 0, 640, 480)
@viewport2.z = 101
@viewport3.z = 200
@viewport4.z = 5000
# 生成战斗背景活动块
@battleback_sprite = Sprite.new(@viewport1)
# 生成敌人活动块
@enemy_sprites = []
for enemy in $game_troop.enemies.reverse
@enemy_sprites.push(Sprite_Battler.new(@viewport1, enemy))
end
#bearrpg 原来是获取敌人名字,改成获取角色名
@actor_names = []
for actor in $game_party.actors#循环角色队伍
#默认显示角色信息的视窗是高于战斗背景的活动块的视窗,
#所以不管你怎么改Z值,对无法将这里的名字显示在角色状态窗口之上,
#只能修改视窗决口
@actor_names.push(Sprite.new(@viewport3))#默认是1
@actor_names[-1].bitmap = Bitmap.new(128,32)
@actor_names[-1].bitmap.font.color = Color.new(255,255,255,200)#这里是描绘颜色
@actor_names[-1].bitmap.draw_text(0,0,128,20,actor.name)
@actor_names[-1].x = actor.screen_x - 20#这里是定位名字的X坐标
@actor_names[-1].y = actor.screen_y - 115#这里是定位名字的Y坐标
@actor_names[-1].z = 999
end
#bearrpg
# @enemy_names = []
# for enemy in $game_troop.enemies
# @enemy_names.push(Sprite.new(@viewport1))
# @enemy_names[-1].bitmap = Bitmap.new(128,32)
# @enemy_names[-1].bitmap.font.color = Color.new(125,0,125,255)
# @enemy_names[-1].bitmap.draw_text(0,0,128,32,enemy.name)
# @enemy_names[-1].x = enemy.screen_x - 20
# @enemy_names[-1].y = enemy.screen_y - 30
# @enemy_names[-1].z = 999
# end
# 生成敌人活动块
@actor_sprites = []
@actor_sprites.push(Sprite_Battler.new(@viewport2))
@actor_sprites.push(Sprite_Battler.new(@viewport2))
@actor_sprites.push(Sprite_Battler.new(@viewport2))
@actor_sprites.push(Sprite_Battler.new(@viewport2))
# 生成天候
@weather = RPG::Weather.new(@viewport1)
# 生成图片活动块
@picture_sprites = []
for i in 51..100
@picture_sprites.push(Sprite_Picture.new(@viewport3,
$game_screen.pictures[i]))
end
# 生成计时器块
@timer_sprite = Sprite_Timer.new
# 刷新画面
update
end
def hide_name(i)
#bearrpg 因为数组名成了@actor_names所以这里也要进行修改
@actor_names[i].opacity = 0 if i != nil
end
def appear_name(i) #貌似翻了应该是name appear
#bearrpg 因为数组名成了@actor_names所以这里也要进行修改
@actor_names[i].opacity = 255 if i != nil
end
end
class Game_Enemy
attr_reader :member_index
end
class Scene_Battle
alias u update_phase4_step3
def update_phase4_step3
#bearrpg 下面所以对敌人进行的判断都改成角色就可以了。
if @active_battler.is_a?(Game_Actor)
#bearrpg member_index是敌人的序列,
#角色的系列是index,所以下面所有的member_index也要进行相应的修改
@spriteset.hide_name(@active_battler.index)
end
u
end
alias u4 update_phase4_step4
def update_phase4_step4
for i in @target_battlers
if i.is_a?(Game_Actor)
@spriteset.hide_name(i.index)
end
end
u4
end
alias up update
def update
if @wait_count == 1
@spriteset.appear_name(@active_battler.index) if @active_battler.is_a?(Game_Actor)
for i in @target_battlers
@spriteset.appear_name(i.index) if i.is_a?(Game_Actor)
end
end
up
end