设为首页收藏本站|繁體中文

Project1

 找回密码
 注册会员
搜索
查看: 1356|回复: 1
打印 上一主题 下一主题

敌人HP、SP数值未知显示

 关闭 [复制链接]

Lv1.梦旅人

龙皇

梦石
0
星屑
50
在线时间
83 小时
注册时间
2007-8-8
帖子
2956
跳转到指定楼层
1
发表于 2008-1-30 05:06:53 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式

加入我们,或者,欢迎回来。

您需要 登录 才可以下载或查看,没有帐号?注册会员

x
敌人HP、SP槽 随血量改变颜色:
http://rpg.blue/web/htm/news432.htm
  1. #==============================================================================
  2. # 本脚本来自www.66RPG.com,使用和转载请保留此信息
  3. #==============================================================================


  4. class Window_Help < Window_Base
  5.   def set_enemy(actor)
  6.     self.contents.clear
  7.     draw_actor_name(actor, 4, 0)
  8.     draw_actor_state(actor, 140, 0)
  9.     carol3_draw_hp_bar(actor, 284, 0)
  10.     carol3_draw_sp_bar(actor, 460, 0)
  11.     @text = nil
  12.     self.visible = true
  13.   end
  14.   def carol3_draw_hp_bar(actor, x, y, width = 128) #宽度可调
  15.     self.contents.font.color = system_color
  16.     w = width * actor.hp / [actor.maxhp,1].max
  17.     if actor.maxhp != 0
  18.       rate = actor.hp.to_f / actor.maxhp
  19.     else
  20.       rate = 0
  21.     end
  22.     color1 = Color.new(240 - 72 * rate, 240 * rate, 62 * rate, 150)
  23.     self.contents.fill_rect(x+1, y+15, width+2,1, Color.new(0, 0, 0, 255))
  24.     self.contents.fill_rect(x+1, y+16, width+2,1, Color.new(255, 255, 192, 192))
  25.     self.contents.fill_rect(x+1, y+17, w,6,color1)
  26.     self.contents.fill_rect(x+1, y+23, width+2,1, Color.new(255, 255, 192, 192))
  27.     self.contents.fill_rect(x+1, y+24, width+2,1, Color.new(0, 0, 0, 255))
  28.     self.contents.fill_rect(x, y+16, 1,8, Color.new(255, 255, 192, 192))
  29.     self.contents.fill_rect(x-1, y+15, 1,10, Color.new(0, 0, 0, 255))
  30.     self.contents.fill_rect(x+129, y+16, 1,8, Color.new(255, 255, 192, 192))
  31.     self.contents.fill_rect(x+130, y+15, 1,10, Color.new(0, 0, 0, 255))
  32.     self.contents.draw_text(x-53,y,128,32,$data_system.words.hp,1)
  33.     if actor.hp>actor.maxhp/3
  34.       self.contents.font.color = Color.new(255, 255, 255, 250)
  35.     end
  36.     if actor.hp>=actor.maxhp/6 and actor.maxhp/3>actor.hp
  37.       self.contents.font.color = Color.new(200, 200, 0, 255)
  38.     end
  39.     if actor.maxhp/6>actor.hp
  40.       self.contents.font.color = Color.new(200, 0, 0, 255)
  41.     end
  42.     self.contents.draw_text(x+47,y,128,32,actor.hp.to_s,1)
  43.   end
  44.   def carol3_draw_sp_bar(actor, x, y, width = 128)
  45.     self.contents.font.color = system_color
  46.     if actor.maxsp != 0
  47.       rate = actor.sp.to_f / actor.maxsp
  48.     else
  49.       rate = 0
  50.     end
  51.     color2 = Color.new(62 * rate, 240 - 72 * rate, 240 * rate, 192)
  52.     w = width * actor.sp / [actor.maxsp,1].max
  53.     self.contents.fill_rect(x+1, y+15, width+2,1, Color.new(0, 0, 0, 255))
  54.     self.contents.fill_rect(x+1, y+16, width+2,1, Color.new(255, 255, 192, 192))
  55.     self.contents.fill_rect(x+1, y+17, w,6,color2)
  56.     self.contents.fill_rect(x+1, y+23, width+2,1, Color.new(255, 255, 192, 192))
  57.     self.contents.fill_rect(x+1, y+24, width+2,1, Color.new(0, 0, 0, 255))
  58.     self.contents.fill_rect(x, y+16, 1,8, Color.new(255, 255, 192, 192))
  59.     self.contents.fill_rect(x-1, y+15, 1,10, Color.new(0, 0, 0, 255))
  60.     self.contents.fill_rect(x+129, y+16, 1,8, Color.new(255, 255, 192, 192))
  61.     self.contents.fill_rect(x+130, y+15, 1,10, Color.new(0, 0, 0, 255))
  62.     self.contents.draw_text(x-53,y,128,32,$data_system.words.sp,1)
  63.     if actor.hp>actor.maxsp/3
  64.       self.contents.font.color = Color.new(255, 255, 255, 250)
  65.     end
  66.     if actor.hp>=actor.maxsp/6 and actor.maxsp/3>actor.sp
  67.       self.contents.font.color = Color.new(200, 200, 0, 255)
  68.     end
  69.     if actor.maxsp/6>actor.sp
  70.       self.contents.font.color = Color.new(200, 0, 0, 255)
  71.     end
  72.     self.contents.draw_text(x+47,y,128,32,actor.sp.to_s,1)
  73.   end
  74. end
  75. #==============================================================================
  76. # 本脚本来自www.66RPG.com,使用和转载请保留此信息
  77. #==============================================================================
复制代码

利用上面的脚本,要怎么制作
如果当敌人的HP、SP数值超过100000时显示???
小于100000时HP、SP数值正常显示。
版务信息:本贴由楼主自主结贴~

                签名图来自:無限のファンタジア
                 我的RMXP专题空间--龙使传说

Lv1.梦旅人

B

梦石
0
星屑
50
在线时间
26 小时
注册时间
2007-8-26
帖子
3693
2
发表于 2008-1-30 05:16:05 | 只看该作者
  1. #==============================================================================
  2. # 本脚本来自www.66RPG.com,使用和转载请保留此信息
  3. #==============================================================================


  4. class Window_Help < Window_Base
  5.   def set_enemy(actor)
  6.     self.contents.clear
  7.     draw_actor_name(actor, 4, 0)
  8.     draw_actor_state(actor, 140, 0)
  9.     carol3_draw_hp_bar(actor, 284, 0)
  10.     carol3_draw_sp_bar(actor, 460, 0)
  11.     @text = nil
  12.     self.visible = true
  13.   end
  14.   def carol3_draw_hp_bar(actor, x, y, width = 128) #宽度可调
  15.     self.contents.font.color = system_color
  16.     w = width * actor.hp / [actor.maxhp,1].max
  17.     if actor.maxhp != 0
  18.       rate = actor.hp.to_f / actor.maxhp
  19.     else
  20.       rate = 0
  21.     end
  22.     color1 = Color.new(240 - 72 * rate, 240 * rate, 62 * rate, 150)
  23.     self.contents.fill_rect(x+1, y+15, width+2,1, Color.new(0, 0, 0, 255))
  24.     self.contents.fill_rect(x+1, y+16, width+2,1, Color.new(255, 255, 192, 192))
  25.     self.contents.fill_rect(x+1, y+17, w,6,color1)
  26.     self.contents.fill_rect(x+1, y+23, width+2,1, Color.new(255, 255, 192, 192))
  27.     self.contents.fill_rect(x+1, y+24, width+2,1, Color.new(0, 0, 0, 255))
  28.     self.contents.fill_rect(x, y+16, 1,8, Color.new(255, 255, 192, 192))
  29.     self.contents.fill_rect(x-1, y+15, 1,10, Color.new(0, 0, 0, 255))
  30.     self.contents.fill_rect(x+129, y+16, 1,8, Color.new(255, 255, 192, 192))
  31.     self.contents.fill_rect(x+130, y+15, 1,10, Color.new(0, 0, 0, 255))
  32.     self.contents.draw_text(x-53,y,128,32,$data_system.words.hp,1)
  33.     if actor.hp>actor.maxhp/3
  34.       self.contents.font.color = Color.new(255, 255, 255, 250)
  35.     end
  36.     if actor.hp>=actor.maxhp/6 and actor.maxhp/3>actor.hp
  37.       self.contents.font.color = Color.new(200, 200, 0, 255)
  38.     end
  39.     if actor.maxhp/6>actor.hp
  40.       self.contents.font.color = Color.new(200, 0, 0, 255)
  41.     end
  42.     ####################################################################
  43.     if actor.hp >= 100000
  44.        self.contents.draw_text(x+47,y,128,32,"???",1)
  45.     else
  46.        self.contents.draw_text(x+47,y,128,32,actor.hp.to_s,1)
  47.      end
  48.      ######################################################################
  49.   end
  50.   def carol3_draw_sp_bar(actor, x, y, width = 128)
  51.     self.contents.font.color = system_color
  52.     if actor.maxsp != 0
  53.       rate = actor.sp.to_f / actor.maxsp
  54.     else
  55.       rate = 0
  56.     end
  57.     color2 = Color.new(62 * rate, 240 - 72 * rate, 240 * rate, 192)
  58.     w = width * actor.sp / [actor.maxsp,1].max
  59.     self.contents.fill_rect(x+1, y+15, width+2,1, Color.new(0, 0, 0, 255))
  60.     self.contents.fill_rect(x+1, y+16, width+2,1, Color.new(255, 255, 192, 192))
  61.     self.contents.fill_rect(x+1, y+17, w,6,color2)
  62.     self.contents.fill_rect(x+1, y+23, width+2,1, Color.new(255, 255, 192, 192))
  63.     self.contents.fill_rect(x+1, y+24, width+2,1, Color.new(0, 0, 0, 255))
  64.     self.contents.fill_rect(x, y+16, 1,8, Color.new(255, 255, 192, 192))
  65.     self.contents.fill_rect(x-1, y+15, 1,10, Color.new(0, 0, 0, 255))
  66.     self.contents.fill_rect(x+129, y+16, 1,8, Color.new(255, 255, 192, 192))
  67.     self.contents.fill_rect(x+130, y+15, 1,10, Color.new(0, 0, 0, 255))
  68.     self.contents.draw_text(x-53,y,128,32,$data_system.words.sp,1)
  69.     if actor.hp>actor.maxsp/3
  70.       self.contents.font.color = Color.new(255, 255, 255, 250)
  71.     end
  72.     if actor.hp>=actor.maxsp/6 and actor.maxsp/3>actor.sp
  73.       self.contents.font.color = Color.new(200, 200, 0, 255)
  74.     end
  75.     if actor.maxsp/6>actor.sp
  76.       self.contents.font.color = Color.new(200, 0, 0, 255)
  77.     end
  78.     ###############################################################
  79.     if actor.sp >= 100000
  80.       self.contents.draw_text(x+47,y,128,32,"???",1)
  81.     else
  82.       self.contents.draw_text(x+47,y,128,32,actor.sp.to_s,1)
  83.     end
  84.     ###############################################################
  85.   end
  86. end
  87. #==============================================================================
  88. # 本脚本来自www.66RPG.com,使用和转载请保留此信息
  89. #==============================================================================
复制代码

系统信息:本贴由楼主认可为正确答案,66RPG感谢您的热情解答~
回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 登录 | 注册会员

本版积分规则

拿上你的纸笔,建造一个属于你的梦想世界,加入吧。
 注册会员
找回密码

站长信箱:[email protected]|手机版|小黑屋|无图版|Project1游戏制作

GMT+8, 2024-12-12 10:13

Powered by Discuz! X3.1

© 2001-2013 Comsenz Inc.

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