幻想森林

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

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

[复制链接]

15

主题

88

帖子

794

积分

⑤进阶

积分
794
QQ
发表于 2010-1-13 18:28:59 | 显示全部楼层 |阅读模式
战斗中 如何才能看到怪物血量? 高手帮我一下
回复

使用道具 举报

15

主题

88

帖子

794

积分

⑤进阶

积分
794
QQ
 楼主| 发表于 2010-1-13 20:15:36 | 显示全部楼层
   求救额
回复 支持 反对

使用道具 举报

38

主题

129

帖子

1151

积分

⑥精研

无既空,空既色

积分
1151
发表于 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
回复 支持 反对

使用道具 举报

0

主题

19

帖子

152

积分

③业余

积分
152
发表于 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
回复 支持 反对

使用道具 举报

15

主题

88

帖子

794

积分

⑤进阶

积分
794
QQ
 楼主| 发表于 2010-1-14 13:06:06 | 显示全部楼层
谢谢 十分感谢   
回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

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

GMT+8, 2024-5-16 10:22 , Processed in 0.037645 second(s), 21 queries .

Powered by Discuz! X3.4

© 2001-2017 Comsenz Inc.

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