找回密码
 立即注册
搜索
热搜: 活动 交友 discuz
查看: 2389|回复: 4

[已解决] 请问一下,如何显示怪物血量?

[复制链接]
发表于 2010-1-13 18:28:59 | 显示全部楼层 |阅读模式
战斗中 如何才能看到怪物血量? 高手帮我一下
 楼主| 发表于 2010-1-13 20:15:36 | 显示全部楼层
   求救额
发表于 2010-1-13 20:23:18 | 显示全部楼层
简单加个显血脚本就OK了柳柳写的显血脚本可以看到血的百分比,如果是想看到数量的话好像是华丽的血条脚本不过那个冲突大你这个先用下如果决的不怎样我把那个传上来!


# ————————————————————————————————————
# 本脚本来自www.66rpg.com,转载请保留此信息
# ————————————————————————————————————

#==============================================================================
# ■ Window_Help
#------------------------------------------------------------------------------
# 重新定义的内容,可以显示敌人的HP\\MP百分比
# 作者:carol3_柳柳
#==============================================================================

class Window_Help < Window_Base
  def set_enemy(actor)
    self.contents.clear
    draw_actor_name(actor, 4, 0)
    draw_actor_state(actor, 140, 0)
    carol3_draw_hp_bar(actor, 284, 0)
    carol3_draw_sp_bar(actor, 460, 0)
    @text = nil
    self.visible = true
  end
  def carol3_draw_hp_bar(actor, x, y, width = 128) #宽度可调
    self.contents.font.color = system_color
    self.contents.fill_rect(x-1, y+17, width+2,6, Color.new(0, 0, 0, 255))
    w = width * actor.hp / actor.maxhp
    self.contents.fill_rect(x, y+18, w,1, Color.new(255, 96, 96, 255))
    self.contents.fill_rect(x, y+19, w,1, Color.new(255, 0, 0, 255))
    self.contents.fill_rect(x, y+20, w,1, Color.new(128, 0, 0, 255))
    self.contents.fill_rect(x, y+21, w,1, Color.new(0, 0, 0, 255))
    self.contents.draw_text(x,y,128,32,$data_system.words.hp,1)
    self.contents.font.color = normal_color
  end
  def carol3_draw_sp_bar(actor, x, y, width = 128)
    self.contents.font.color = system_color
    self.contents.fill_rect(x-1, y+17, width+2,6, Color.new(0, 0, 0, 255))
    w = width * actor.sp / actor.maxsp
    self.contents.fill_rect(x, y+18, w,1, Color.new(128, 255, 255, 255))
    self.contents.fill_rect(x, y+19, w,1, Color.new(0, 255, 255, 255))
    self.contents.fill_rect(x, y+20, w,1, Color.new(0, 192, 192, 255))
    self.contents.fill_rect(x, y+21, w,1, Color.new(0, 128, 128, 255))
    self.contents.draw_text(x,y,128,32,$data_system.words.sp,1)
    self.contents.font.color = normal_color
  end
end
发表于 2010-1-14 08:59:57 | 显示全部楼层
自己弄得:
class Window_Help < Window_Base
  def set_enemy(actor)
    self.contents.clear
    self.contents.font.size = 15
    draw_actor_name(actor, 4, -5)
    draw_actor_state(actor, 120, -5)
    draw_slant_bar(actor, 320, -5)
    @text = nil
    self.visible = true
  end
  def draw_slant_bar(actor, x, y, width = 280)
    self.contents.font.color = normal_color
    self.contents.font.size = 15
    self.contents.fill_rect(x-1, y+3, width+2,22, Color.new(0, 0, 0, 255))
    w = width * actor.hp / actor.maxhp
    case w
    when 84..280
      self.contents.fill_rect(x, y+5, w,20, Color.new(0, 255, 0, 255))
      self.contents.fill_rect(x, y+6, w,16, Color.new(30, 255, 30, 255))
      self.contents.fill_rect(x, y+8, w,12, Color.new(60, 255, 60, 255))
      self.contents.fill_rect(x, y+10, w,8, Color.new(90, 255, 90, 255))
      self.contents.fill_rect(x, y+12, w,4, Color.new(120, 255, 120, 255))
      self.contents.fill_rect(x, y+12.5, w,2, Color.new(150, 255, 150, 255))
    when 28..84
      self.contents.fill_rect(x, y+5, w,20, Color.new(255, 255, 0, 255))
      self.contents.fill_rect(x, y+6, w,16, Color.new(255, 255, 30, 255))
      self.contents.fill_rect(x, y+8, w,12, Color.new(255, 255, 60, 255))
      self.contents.fill_rect(x, y+10, w,8, Color.new(255, 255, 90, 255))
      self.contents.fill_rect(x, y+12, w,4, Color.new(255, 255, 120, 255))
      self.contents.fill_rect(x, y+12.5, w,2, Color.new(255, 255, 150, 255))
    when 0..28
      self.contents.fill_rect(x, y+5, w,20, Color.new(255, 0, 0, 255))
      self.contents.fill_rect(x, y+6, w,16, Color.new(255, 30, 30, 255))
      self.contents.fill_rect(x, y+8, w,12, Color.new(255, 60, 60, 255))
      self.contents.fill_rect(x, y+10, w,8, Color.new(255, 90, 90, 255))
      self.contents.fill_rect(x, y+12, w,4, Color.new(255, 120, 120, 255))
      self.contents.fill_rect(x, y+12.5, w,2, Color.new(255, 150, 150, 255))
    end
    self.contents.draw_text(x + 70, y-2, 65, 32, actor.hp.to_s, 2)
    self.contents.draw_text(x + 135, y-2, 10, 32, "/", 1)
    self.contents.draw_text(x + 145, y-2, 65, 32, actor.maxhp.to_s)
    self.contents.font.color = normal_color
  end
end
 楼主| 发表于 2010-1-14 13:06:06 | 显示全部楼层
谢谢 十分感谢   
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

小黑屋|手机版|Archiver|幻想森林

GMT+8, 2026-10-31 15:26 , Processed in 0.011478 second(s), 16 queries .

Powered by Discuz! X3.5

© 2001-2026 Discuz! Team.

快速回复 返回顶部 返回列表