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

Project1

 找回密码
 注册会员
搜索
12
返回列表 发新帖
楼主: 包拯
打印 上一主题 下一主题

[已经解决] 向各位前辈请教一下关于战斗中的一些小东西

[复制链接]

Lv3.寻梦者

宛若

梦石
0
星屑
1558
在线时间
526 小时
注册时间
2007-8-19
帖子
1493

极短24参与开拓者

11
发表于 2010-7-26 14:04:10 | 只看该作者
本帖最后由 逸豫 于 2010-7-26 14:05 编辑


这不可以么……

点评

总觉得……用我滴RMXP也是这个效果……有甚么看不见的...  发表于 2010-7-26 14:07
[url=http://rpg.blue/thread-219730-1-1.html]http://unhero.sinaapp.com/wi.php[/url]
[color=Red]如你所见这是个死坑,没错这就是打我的脸用的[/color]
回复 支持 反对

使用道具 举报

Lv1.梦旅人

梦石
0
星屑
55
在线时间
59 小时
注册时间
2007-7-31
帖子
711
12
 楼主| 发表于 2010-7-26 14:10:55 | 只看该作者
那啥,位置,在说了,为什么只有选中时才显示?继续补充:敌人我只设一个,所以嘛……
急招打字员、游戏评测员、淘宝客服、拍单客服、手机兼职员等职位,有想赚钱的亲们,加QQ:960296464
回复 支持 反对

使用道具 举报

Lv3.寻梦者

宛若

梦石
0
星屑
1558
在线时间
526 小时
注册时间
2007-8-19
帖子
1493

极短24参与开拓者

13
发表于 2010-7-26 14:46:55 | 只看该作者
  1. class Window_BattleEnemy < Window_Base
  2.   def initialize(enemy = nil)
  3.     @enemy = $game_troop.enemies[0]
  4.     @hp_memory = @enemy.hp
  5.     super(0,64,160,120)
  6.     self.contents = Bitmap.new(width - 32, height - 32)
  7.     self.opacity = 160
  8.     refresh
  9.   end
  10.   def refresh
  11.     self.contents.clear
  12.     draw_actor_battler(@enemy, 0, 0) if @enemy != nil
  13.     carol3_draw_hp_bar(@enemy , 160 - 32 - 128 , 0) if @enemy != nil
  14.   end
  15.   def enemy=(e)
  16.     @enemy = e
  17.     refresh
  18.   end
  19.   def update
  20.     if @hp_memory != @enemy.hp
  21.       @hp_memory = @enemy.hp
  22.       refresh
  23.     end
  24.   end
  25.   def draw_actor_battler(actor, x, y)
  26.     bitmap = RPG::Cache.battler(actor.battler_name, actor.battler_hue)
  27.     cw = bitmap.width
  28.     ch = bitmap.height
  29.     src_rect = Rect.new(0, 0, cw, ch)
  30.     self.contents.blt(x, y, bitmap, src_rect)
  31.   end
  32.   def carol3_draw_hp_bar(actor, x, y, width = 128) #宽度可调
  33.    self.contents.font.color = system_color
  34.    w = width * actor.hp / [actor.maxhp,1].max
  35.    if actor.maxhp != 0
  36.      rate = actor.hp.to_f / actor.maxhp
  37.    else
  38.      rate = 0
  39.    end
  40.    color1 = Color.new(240 - 72 * rate, 240 * rate, 62 * rate, 150)
  41.    self.contents.fill_rect(x+1, y+15, width+2,1, Color.new(0, 0, 0, 255))
  42.    self.contents.fill_rect(x+1, y+16, width+2,1, Color.new(255, 255, 192, 192))
  43.    self.contents.fill_rect(x+1, y+17, w,6,color1)
  44.    self.contents.fill_rect(x+1, y+23, width+2,1, Color.new(255, 255, 192, 192))
  45.    self.contents.fill_rect(x+1, y+24, width+2,1, Color.new(0, 0, 0, 255))
  46.    self.contents.fill_rect(x, y+16, 1,8, Color.new(255, 255, 192, 192))
  47.    self.contents.fill_rect(x-1, y+15, 1,10, Color.new(0, 0, 0, 255))
  48.    self.contents.fill_rect(x+129, y+16, 1,8, Color.new(255, 255, 192, 192))
  49.    self.contents.fill_rect(x+130, y+15, 1,10, Color.new(0, 0, 0, 255))
  50.    self.contents.draw_text(x-53,y,128,32,$data_system.words.hp,1)
  51.    if actor.hp>actor.maxhp/3
  52.      self.contents.font.color = Color.new(255, 255, 255, 250)
  53.    end
  54.    if actor.hp>=actor.maxhp/6 and actor.maxhp/3>actor.hp
  55.      self.contents.font.color = Color.new(200, 200, 0, 255)
  56.    end
  57.    if actor.maxhp/6>actor.hp
  58.      self.contents.font.color = Color.new(200, 0, 0, 255)
  59.    end
  60.    self.contents.draw_text(x+47,y,128,32,actor.hp.to_s,1)
  61.   end
  62.   def carol3_draw_sp_bar(actor, x, y, width = 128)
  63.    self.contents.font.color = system_color
  64.    if actor.maxsp != 0
  65.      rate = actor.sp.to_f / actor.maxsp
  66.    else
  67.      rate = 0
  68.    end
  69.    color2 = Color.new(62 * rate, 240 - 72 * rate, 240 * rate, 192)
  70.    w = width * actor.sp / [actor.maxsp,1].max
  71.    self.contents.fill_rect(x+1, y+15, width+2,1, Color.new(0, 0, 0, 255))
  72.    self.contents.fill_rect(x+1, y+16, width+2,1, Color.new(255, 255, 192, 192))
  73.    self.contents.fill_rect(x+1, y+17, w,6,color2)
  74.    self.contents.fill_rect(x+1, y+23, width+2,1, Color.new(255, 255, 192, 192))
  75.    self.contents.fill_rect(x+1, y+24, width+2,1, Color.new(0, 0, 0, 255))
  76.    self.contents.fill_rect(x, y+16, 1,8, Color.new(255, 255, 192, 192))
  77.    self.contents.fill_rect(x-1, y+15, 1,10, Color.new(0, 0, 0, 255))
  78.    self.contents.fill_rect(x+129, y+16, 1,8, Color.new(255, 255, 192, 192))
  79.    self.contents.fill_rect(x+130, y+15, 1,10, Color.new(0, 0, 0, 255))
  80.    self.contents.draw_text(x-53,y,128,32,$data_system.words.sp,1)
  81.    if actor.hp>actor.maxsp/3
  82.      self.contents.font.color = Color.new(255, 255, 255, 250)
  83.    end
  84.    if actor.hp>=actor.maxsp/6 and actor.maxsp/3>actor.sp
  85.      self.contents.font.color = Color.new(200, 200, 0, 255)
  86.    end
  87.    if actor.maxsp/6>actor.sp
  88.      self.contents.font.color = Color.new(200, 0, 0, 255)
  89.    end
  90.    self.contents.draw_text(x+47,y,128,32,actor.sp.to_s,1)
  91.   end
  92. end
  93. class Scene_Battle
  94.   alias update_bz update
  95.   def update
  96.     @be_window.update
  97.     update_bz
  98.   end
  99. end
复制代码
★Scene_Battle 1 25行下添加
    @be_window = Window_BattleEnemy.new
82行下添加
    @be_window.dispose

大小&位置在脚本第五行调整
四个参数分别为x,y,宽度,高度

评分

参与人数 1星屑 +800 收起 理由
「旅」 + 800 认可答案

查看全部评分

[url=http://rpg.blue/thread-219730-1-1.html]http://unhero.sinaapp.com/wi.php[/url]
[color=Red]如你所见这是个死坑,没错这就是打我的脸用的[/color]
回复 支持 反对

使用道具 举报

Lv1.梦旅人

梦石
0
星屑
55
在线时间
59 小时
注册时间
2007-7-31
帖子
711
14
 楼主| 发表于 2010-7-26 14:51:30 | 只看该作者
我试试
回复 支持 反对

使用道具 举报

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

本版积分规则

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

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

GMT+8, 2024-5-1 22:24

Powered by Discuz! X3.1

© 2001-2013 Comsenz Inc.

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