class Sprite_Character < RPG::Sprite #-------------------------------------------------------------------------- # ● 参数设置 正太君改 #-------------------------------------------------------------------------- # 设置图片文件名.不想要底图就让底图完全透明或设置为 "" # 图片放在 Graphics/Pictures/ 文件夹下 TeamTagFileName = "wodeshib" # 设置显示友军标记的开关号 TeamTagBar = 10 #-------------------------------------------------------------------------- # ● 初始化对像 #-------------------------------------------------------------------------- alias hzhj_old_init_make_tag initialize def initialize(*args) @team_tag_sprite = Sprite.new(args[0]) @tags_sprites = [] @tags_sprites << @team_tag_sprite @team_tag_sprite.bitmap = RPG::Cache.picture(TeamTagFileName) @team_flag_sprite = Sprite.new(args[0]) @team_flag_sprite.bitmap = RPG::Cache.picture("test-flag") @tags_sprites << @team_flag_sprite @count = 0 @wait_count = 0 hzhj_old_init_make_tag(*args) end #-------------------------------------------------------------------------- # ● 释放 #-------------------------------------------------------------------------- alias hzhj_old_dispose_make_tag dispose unless $@ def dispose @tags_sprites.each{|sprite|sprite.dispose} hzhj_old_dispose_make_tag end #-------------------------------------------------------------------------- # ● 获取事件 HP # 正太君改 #-------------------------------------------------------------------------- def event_hp return 0 if @character.nil? return 0 if @character.is_a?(Game_Player) return @character.hp end =begin #-------------------------------------------------------------------------- # ● 判断是否显示队友标记 #-------------------------------------------------------------------------- def show_team_tag? #under construct return false if @character.is_a?(Game_Player) return false if $scene.group_lisenter == nil selected = $scene.group_lisenter.include?(@character.group) if event_hp > 0 and @character.team == 1 and selected and [email protected] return $game_switches[TeamTagBar] else return false end end =end #-------------------------------------------------------------------------- # ● 判断是否显示队长旗子 #-------------------------------------------------------------------------- def show_team_flag? return false if @character.is_a?(Game_Player) return false if @character.is_a?(EFS_Hero) return false if $scene.group_lisenter == nil selected = $scene.group_lisenter.include?(@character.group) cp = $scene.team_groups[@character.group-1].captain if cp == @character return $game_switches[TeamTagBar] else return false end end #-------------------------------------------------------------------------- # ● 判断是否显示队友标记 #-------------------------------------------------------------------------- def show_team_tag? #under construct return false if @character.is_a?(Game_Player) return false if $scene.group_lisenter == nil @selected = $scene.group_lisenter.include?(@character.group) if event_hp > 0 and @character.team == 1 and !@character.removed # and selected return $game_switches[TeamTagBar] else return false end end #-------------------------------------------------------------------------- # ● 更新画面 #-------------------------------------------------------------------------- alias hzhj_old_update_make_tag update def update hzhj_old_update_make_tag if !@character.is_a?(EFS_Battler) and !@character.is_a?(Game_Player) @tags_sprites.each{|sprite|sprite.visible = false} else if show_team_flag? @team_flag_sprite.visible = true else @team_flag_sprite.visible = false end # 刷新 标记 可见状态 if show_team_tag? @team_tag_sprite.visible = true if @selected @tags_sprites.each do |sprite| sprite.ox = sprite.bitmap.width / 2 sprite.oy = sprite.bitmap.height sprite.z = z sprite.x = @character.screen_x #blink_on shif = @character.is_cal if @character.ammo>0 sprite.y = shif ? @character.screen_y-92 : @character.screen_y-60 else sprite.y = shif ? @character.screen_y-82 : @character.screen_y-50 end sprite.opacity = 255 end#loop else # 刷新坐标 @tags_sprites.each do |sprite| #sprite.zoom_y = 1 sprite.ox = sprite.bitmap.width / 2 sprite.oy = sprite.bitmap.height sprite.z = z sprite.x = @character.screen_x #blink_on shif = @character.is_cal if @character.ammo>0 sprite.y = shif ? @character.screen_y-92 : @character.screen_y-60 else sprite.y = shif ? @character.screen_y-82 : @character.screen_y-50 end sprite.opacity = 125 end#loop end #if include else @tags_sprites.each{|sprite|sprite.visible = false} end end end end
谜题以解开.png (1.16 MB, 下载次数: 15)
欢迎光临 Project1 (https://rpg.blue/) | Powered by Discuz! X3.1 |