class Spriteset_Battle #-------------------------------------------------------------------------- # ● 初始化变量 #-------------------------------------------------------------------------- def initialize # 生成显示端口 @viewport1 = Viewport.new(0, 0, 640, 320) @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 @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) @enemy_names[i].opacity = 0 if i != nil end def appear_name(i) #貌似翻了应该是name appear @enemy_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 if @active_battler.is_a?(Game_Enemy) @spriteset.hide_name(@active_battler.member_index) end u end alias u4 update_phase4_step4 def update_phase4_step4 for i in @target_battlers if i.is_a?(Game_Enemy) @spriteset.hide_name(i.member_index) end end u4 end alias up update def update if @wait_count == 1 @spriteset.appear_name(@active_battler.member_index) if @active_battler.is_a?(Game_Enemy) for i in @target_battlers @spriteset.appear_name(i.member_index) if i.is_a?(Game_Enemy) end end up end end
188.2 KB, 下载次数: 33
工程文件
欢迎光临 Project1 (https://rpg.blue/) | Powered by Discuz! X3.1 |