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

Project1

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

[已经过期] 如何显示血条???

[复制链接]

Lv1.梦旅人

梦石
0
星屑
50
在线时间
246 小时
注册时间
2013-8-15
帖子
106
跳转到指定楼层
1
发表于 2014-1-22 09:08:45 | 只看该作者 |只看大图 回帖奖励 |倒序浏览 |阅读模式

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

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

x
如何在怪物的头上显示血条???求打神帮忙
.

Lv3.寻梦者

梦石
0
星屑
3841
在线时间
1966 小时
注册时间
2013-1-3
帖子
9536
2
发表于 2014-1-22 10:09:00 | 只看该作者
《宿愿·寻剑篇》正式版已经发布!快去看看!点击进入论坛发布贴
回复 支持 反对

使用道具 举报

Lv1.梦旅人

梦石
0
星屑
50
在线时间
246 小时
注册时间
2013-8-15
帖子
106
3
 楼主| 发表于 2014-1-22 10:21:14 | 只看该作者
紫英晓狼1130 发表于 2014-1-22 10:09
搜索一下有很多啦
http://www.66rpg.com/articles/3127
http://www.66rpg.com/articles/3065


谢谢啦,可是我不会怎样改啊,我是个脚本盲
.
回复 支持 反对

使用道具 举报

Lv1.梦旅人

梦石
0
星屑
50
在线时间
246 小时
注册时间
2013-8-15
帖子
106
4
 楼主| 发表于 2014-1-22 10:26:54 | 只看该作者
星星人 发表于 2014-1-22 10:21
谢谢啦,可是我不会怎样改啊,我是个脚本盲


这个怎样改???在哪里改??
#==============================================================================
# 本脚本来自www.66RPG.com,使用和转载请保留此信息
#==============================================================================  
#==============================================================================
# ■ Window_Help
#------------------------------------------------------------------------------
# 重新定义的内容,可以显示敌人的HP\MP百分比
# 你可以改脚本的开头部分定义生命、精神描述词。只和敌人描述有关,可随意修改
#==============================================================================
class Window_Help < Window_Base
  def set_enemy(actor)   
    #--------------------------------------------------------------------
    # 在这里修改描述文字,比如@生命描述词="敌人生命"
    #--------------------------------------------------------------------
     
    @生命描述词 = $data_system.words.hp
    @精神描述词 = $data_system.words.sp
     
    #--------------------------------------------------------------------
    #--------------------------------------------------------------------
    self.contents.clear
    draw_actor_name(actor, 4, 0)
    draw_actor_state(actor, 140, 0)
    carol3_draw_hp_bar(actor, 284, 12)
    carol3_draw_sp_bar(actor, 460, 12)
    @text = nil
    self.visible = true
  end  
  def carol3_draw_hp_bar(actor, x, y, width = 128, height = 14) #宽度可调
    w = width * actor.hp / [actor.maxhp,1].max
    hp_color_1 = Color.new(255, 0, 0, 192)  
    hp_color_2 = Color.new(255, 255, 0, 192)  
    self.contents.fill_rect(x+8, y+4, width, (height/4).floor, Color.new(0, 0, 0, 128))  
    draw_line(x, y, x + w, y, hp_color_1, (height/4).floor, hp_color_2)  
    x -= 1  
    y += (height/4).floor  
    self.contents.fill_rect(x+8, y+4, width, (height/4).ceil , Color.new(0, 0, 0, 128))  
    draw_line(x, y, x + w, y, hp_color_1, (height/4).ceil , hp_color_2)  
    x -= 1  
    y += (height/4).ceil  
    self.contents.fill_rect(x+8, y+4, width, (height/4).ceil , Color.new(0, 0, 0, 128))  
    draw_line(x, y, x + w, y, hp_color_1, (height/4).ceil , hp_color_2)  
    x -= 1  
    y += (height/4).ceil  
    self.contents.fill_rect(x+8, y+4, width, (height/4).floor, Color.new(0, 0, 0, 128))  
    draw_line(x, y, x + w, y, hp_color_1, (height/4).floor, hp_color_2)  
    self.contents.font.color = Color.new(0,0,0,255)
    self.contents.draw_text(x+2,-3,128,32,@生命描述词,1)
    self.contents.font.color = Color.new(255,255,255,255)
    self.contents.draw_text(x,-4,128,32,@生命描述词,1)
  end  
  def carol3_draw_sp_bar(actor, x, y, width = 128, height=14)
    w = width * actor.sp / [actor.maxsp,1].max  
    hp_color_1 = Color.new( 0, 0, 255, 192)  
    hp_color_2 = Color.new( 0, 255, 255, 192)  
    self.contents.fill_rect(x+8, y+4, width, (height/4).floor, Color.new(0, 0, 0, 128))  
    draw_line(x, y, x + w, y, hp_color_1, (height/4).floor, hp_color_2)  
    x -= 1  
    y += (height/4).floor  
    self.contents.fill_rect(x+8, y+4, width, (height/4).ceil , Color.new(0, 0, 0, 128))  
    draw_line(x, y, x + w, y, hp_color_1, (height/4).ceil , hp_color_2)  
    x -= 1  
    y += (height/4).ceil  
    self.contents.fill_rect(x+8, y+4, width, (height/4).ceil , Color.new(0, 0, 0, 128))  
    draw_line(x, y, x + w, y, hp_color_1, (height/4).ceil , hp_color_2)  
    x -= 1  
    y += (height/4).ceil  
    self.contents.fill_rect(x+8, y+4, width, (height/4).floor, Color.new(0, 0, 0, 128))  
    draw_line(x, y, x + w, y, hp_color_1, (height/4).floor, hp_color_2)  
    self.contents.font.color = Color.new(0,0,0,255)
    self.contents.draw_text(x+2,-3,128,32,@精神描述词,1)
    self.contents.font.color = Color.new(255,255,255,255)
    self.contents.draw_text(x,-4,128,32,@精神描述词,1)
  end
  #--------------------------------------------------------------------------  
  # ● ライン描画 by 桜雅 在土  
  #--------------------------------------------------------------------------  
  def draw_line(start_x, start_y, end_x, end_y, start_color, width = 1, end_color = start_color)  
    # 描写距離の計算。大きめに直角時の長さ。  
    distance = (start_x - end_x).abs + (start_y - end_y).abs  
    # 描写開始  
    if end_color == start_color  
      for i in 1..distance  
        x = (start_x + 1.0 * (end_x - start_x) * i / distance).to_i  
        y = (start_y + 1.0 * (end_y - start_y) * i / distance).to_i  
        if width == 1  
          self.contents.set_pixel(x, y, start_color)  
        else  
          self.contents.fill_rect(x, y, width, width, start_color)  
        end  
      end  
    else  
      for i in 1..distance  
        x = (start_x + 1.0 * (end_x - start_x) * i / distance).to_i  
        y = (start_y + 1.0 * (end_y - start_y) * i / distance).to_i  
        r = start_color.red * (distance-i)/distance + end_color.red * i/distance  
        g = start_color.green * (distance-i)/distance + end_color.green * i/distance  
        b = start_color.blue * (distance-i)/distance + end_color.blue * i/distance  
        a = start_color.alpha * (distance-i)/distance + end_color.alpha * i/distance  
        if width == 1  
          self.contents.set_pixel(x, y, Color.new(r, g, b, a))  
        else  
          self.contents.fill_rect(x, y, width, width, Color.new(r, g, b, a))  
        end  
      end  
    end  
  end  
end
#==============================================================================
# 本脚本来自www.66RPG.com,使用和转载请保留此信息
#==============================================================================
.
回复 支持 反对

使用道具 举报

Lv3.寻梦者

○赛

梦石
0
星屑
1249
在线时间
1276 小时
注册时间
2013-1-22
帖子
2246

贵宾

5
发表于 2014-1-22 19:05:06 | 只看该作者
星星人 发表于 2014-1-22 10:26
这个怎样改???在哪里改??
#==================================================================== ...

0.0
插入到脚本编辑器 Main前,感觉LZ伸手过大了。
回复 支持 反对

使用道具 举报

Lv1.梦旅人

梦石
0
星屑
50
在线时间
246 小时
注册时间
2013-8-15
帖子
106
6
 楼主| 发表于 2014-1-22 19:23:06 | 只看该作者
天地有正气 发表于 2014-1-22 19:05
0.0
插入到脚本编辑器 Main前,感觉LZ伸手过大了。

我把脚本插入编辑器Main前了进行游戏还是以样没反应

点评

你战斗测试了吗?  发表于 2014-1-22 19:26
.
回复 支持 反对

使用道具 举报

Lv1.梦旅人

梦石
0
星屑
50
在线时间
246 小时
注册时间
2013-8-15
帖子
106
7
 楼主| 发表于 2014-1-22 19:36:30 | 只看该作者
星星人 发表于 2014-1-22 19:23
我把脚本插入编辑器Main前了进行游戏还是以样没反应


行了,可是我要的是在地图上打架的,血条是在怪物的下方的。。。。。如图

QQ图片20140122193558.jpg (41.88 KB, 下载次数: 1)

QQ图片20140122193558.jpg

点评

@yangjunyin2002 我觉得这是TD塔防...  发表于 2014-1-27 11:59
什么act?xas啊,我不会这是什么  发表于 2014-1-23 13:22
汗,你用的是什么act系统?XAS还是什么?  发表于 2014-1-23 13:20
.
回复 支持 反对

使用道具 举报

Lv1.梦旅人

幻想天神

梦石
0
星屑
55
在线时间
166 小时
注册时间
2012-3-24
帖子
404
8
发表于 2014-1-23 13:58:24 | 只看该作者
这个也不好说了,需要根据你的战斗系统改写。
回复 支持 反对

使用道具 举报

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

本版积分规则

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

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

GMT+8, 2024-5-3 04:36

Powered by Discuz! X3.1

© 2001-2013 Comsenz Inc.

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