Project1

标题: 求一个脚本 [打印本页]

作者: 星语心の梦    时间: 2008-8-16 20:31
提示: 作者被禁止或删除 内容自动屏蔽
作者: ★_茄孓    时间: 2008-8-16 20:58
  1. class Window_BattleStatus < Window_Base
  2.   def draw_actor_hp(actor, x, y, width = 144)
  3.     self.contents.font.color = system_color
  4.     self.contents.draw_text(x, y, 32, 32, $data_system.words.hp)
  5.     if width - 32 >= 108
  6.       hp_x = x + width - 108
  7.       flag = true
  8.     elsif width - 32 >= 48
  9.       hp_x = x + width - 48
  10.       flag = false
  11.     end
  12.     self.contents.font.color = actor.hp == 0 ? knockout_color :
  13.       actor.hp <= actor.maxhp / 4 ? crisis_color : normal_color
  14.     self.contents.draw_text(hp_x-50, y, 48, 32, actor.hp.to_s, 2)
  15.     self.contents.draw_text(hp_x-35, y, 48, 32, "/", 2)
  16.     self.contents.draw_text(hp_x, y, 48, 32, actor.maxhp.to_s, 2)
  17.     if flag
  18.       self.contents.font.color = normal_color
  19.       self.contents.draw_text(hp_x + 48, y, 12, 32, "/", 1)
  20.       self.contents.draw_text(hp_x + 60, y, 48, 32, actor.maxhp.to_s)
  21.     end
  22.   end
  23.   def draw_actor_sp(actor, x, y, width = 144)
  24.     self.contents.font.color = system_color
  25.     self.contents.draw_text(x, y, 32, 32, $data_system.words.sp)
  26.     if width - 32 >= 108
  27.       sp_x = x + width - 108
  28.       flag = true
  29.     elsif width - 32 >= 48
  30.       sp_x = x + width - 48
  31.       flag = false
  32.     end
  33.     self.contents.font.color = actor.sp == 0 ? knockout_color :
  34.       actor.sp <= actor.maxsp / 4 ? crisis_color : normal_color
  35.     self.contents.draw_text(sp_x-50, y, 48, 32, actor.sp.to_s, 2)
  36.     self.contents.draw_text(sp_x-35, y, 48, 32, "/", 2)
  37.     self.contents.draw_text(sp_x, y, 48, 32, actor.maxsp.to_s, 2)
  38.     if flag
  39.       self.contents.font.color = normal_color
  40.       self.contents.draw_text(sp_x + 48, y, 12, 32, "/", 1)
  41.       self.contents.draw_text(sp_x + 60, y, 48, 32, actor.maxsp.to_s)
  42.     end
  43.   end
  44. end
复制代码

放main前即可生效 [LINE]1,#dddddd[/LINE]系统信息:本贴由本区版主认可为正确答案,66RPG感谢您的热情解答~
作者: IamI    时间: 2008-8-16 21:05
ORZ这是在干什么
RGSS已经内置了这个功能
BattleStatus,找到
      draw_actor_hp(actor, actor_x, 32, 120)
最后一个数字直接改140,sp也一样

作者: 冰城飞狐    时间: 2008-8-16 21:19
SS党的……
汗……




欢迎光临 Project1 (https://rpg.blue/) Powered by Discuz! X3.1