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

Project1

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

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

[复制链接]

Lv1.梦旅人

梦石
0
星屑
55
在线时间
59 小时
注册时间
2007-7-31
帖子
711
跳转到指定楼层
1
发表于 2010-7-25 08:56:46 | 只看该作者 回帖奖励 |正序浏览 |阅读模式

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

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

x

恳请大家先看一副这幅图片,我想在左面,也就是我所画的地方添加上敌人战斗图以及敌人血槽,位置就在我所画的地方,请问一下,通过脚本如何就能够实现?
急招打字员、游戏评测员、淘宝客服、拍单客服、手机兼职员等职位,有想赚钱的亲们,加QQ:960296464

Lv1.梦旅人

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

使用道具 举报

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

使用道具 举报

Lv3.寻梦者

宛若

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

极短24参与开拓者

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


这不可以么……
[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
10
 楼主| 发表于 2010-7-26 12:54:16 | 只看该作者
呵呵,就是因为我不懂这些,所以才……
急招打字员、游戏评测员、淘宝客服、拍单客服、手机兼职员等职位,有想赚钱的亲们,加QQ:960296464
回复 支持 反对

使用道具 举报

Lv1.梦旅人

梦石
0
星屑
50
在线时间
3 小时
注册时间
2009-8-4
帖子
73
9
发表于 2010-7-26 12:50:24 | 只看该作者
本帖最后由 wuliao1997 于 2010-7-26 13:42 编辑

LZ你不是已经整合好了吗....
只要再调一下XY的值:(基本上是这个大小)super(90,390,140,90)
再加上这句以免被战斗框挡住self.z = 9999
再修改血条位置和大小就可以了...
(PS:LZ你想再做一个上古神器2么...还有啊……妮可99级佩戴那剑每次打幽灵都是失误...你是咋设置的...每次都请重新再来...)
----------------------------------------------------------------------------
更改后的范例:http://u.115.com/file/f21006ecc5

点评

编辑完毕。自己下载吧。  发表于 2010-7-26 13:43
呵呵,那是瞎设置的,不用,你能上个范例么?  发表于 2010-7-26 12:53
很不错的横版,先收下了  发表于 2010-7-26 12:51
此人遗失...
回复 支持 反对

使用道具 举报

Lv1.梦旅人

梦石
0
星屑
55
在线时间
59 小时
注册时间
2007-7-31
帖子
711
8
 楼主| 发表于 2010-7-26 12:16:04 | 只看该作者
急招打字员、游戏评测员、淘宝客服、拍单客服、手机兼职员等职位,有想赚钱的亲们,加QQ:960296464
回复 支持 反对

使用道具 举报

Lv3.寻梦者

宛若

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

极短24参与开拓者

7
发表于 2010-7-25 21:36:04 | 只看该作者
这个貌似跟RMXP的版本无关吧= =|||
怀疑是脚本冲突,提供工程
[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
6
 楼主| 发表于 2010-7-25 21:14:55 | 只看该作者
感谢,但是在RMXP1.03中显示不出来,我用的是1.03版的,能请求修改一下么
急招打字员、游戏评测员、淘宝客服、拍单客服、手机兼职员等职位,有想赚钱的亲们,加QQ:960296464
回复 支持 反对

使用道具 举报

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

本版积分规则

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

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

GMT+8, 2024-5-6 16:44

Powered by Discuz! X3.1

© 2001-2013 Comsenz Inc.

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