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

Project1

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

[已经解决] 求个敌方显示血条的脚本

[复制链接]

Lv1.梦旅人

梦石
0
星屑
110
在线时间
0 小时
注册时间
2013-1-29
帖子
1
跳转到指定楼层
1
 楼主| 发表于 2013-1-29 16:04:10 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式

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

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

x
本人{:2_272:} 是新手,不会弄,所以求高手给个

Lv3.寻梦者

唯一的信徒

梦石
0
星屑
1665
在线时间
1357 小时
注册时间
2013-1-29
帖子
1637
2
发表于 2013-1-30 06:54:00 | 只看该作者
我记得 扶雷亚 有一个。。自己去技术发布区找一下 扶雷亚脚本合集(有关扶雷亚名字打错问题本人概不负责。)
『我只是一个正在潜心修炼的渣乐师罢了』
Dear Time\(^o^)/~


假如上面的图片挂了的话麻烦各位去发个帖 @ 一下 orzFly 让他修复 deartime
回复 支持 反对

使用道具 举报

Lv3.寻梦者

梦石
0
星屑
3841
在线时间
1966 小时
注册时间
2013-1-3
帖子
9536
3
发表于 2013-1-30 08:41:55 | 只看该作者
这是主站上的脚本
  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. #==============================================================================
复制代码
《宿愿·寻剑篇》正式版已经发布!快去看看!点击进入论坛发布贴
回复 支持 反对

使用道具 举报

Lv1.梦旅人

梦石
0
星屑
50
在线时间
687 小时
注册时间
2012-10-29
帖子
1543
4
发表于 2013-1-30 09:30:32 | 只看该作者
LBQ 发表于 2013-1-30 06:54
我记得 扶雷亚 有一个。。自己去技术发布区找一下 扶雷亚脚本合集(有关扶雷亚名字打错问题本人概不负责。 ...

芙蕾婭的戰鬥敵人顯示血條腳本:

RUBY 代码复制
  1. #==============================================================================
  2. # F08 - 战斗敌人显示血条 - By芙蕾娅
  3. #------------------------------------------------------------------------------
  4. #  ★ - 新增  ☆ - 修改  ■ - 删除 ● - 无变更
  5. #==============================================================================
  6. module Freya
  7.   # 隐藏HP的文本
  8.   HideGaugeText = "Hide_Gauge"
  9.   # 血条颜色
  10.   EnemyHPGaugeColor1 = Color.new(64,128,96)
  11.   EnemyHPGaugeColor2 = Color.new(96,192,160)
  12. end
  13. #==============================================================================
  14. # ■ Sprite_Battler_HP
  15. #------------------------------------------------------------------------------
  16. #  显示战斗者的生命在战斗者的精灵下面。
  17. #==============================================================================
  18. class Sprite_Battler_HP < Sprite
  19.   #--------------------------------------------------------------------------
  20.   # ● 初始化对象
  21.   #--------------------------------------------------------------------------
  22.   def initialize(viewport,battler)
  23.     super(viewport)
  24.     [url=home.php?mod=space&uid=133701]@battler[/url] = battler
  25.     @last_hp = 0
  26.     create_bitmap
  27.     update
  28.   end
  29.   #--------------------------------------------------------------------------
  30.   # ● 释放
  31.   #--------------------------------------------------------------------------
  32.   def dispose
  33.     self.bitmap.dispose
  34.     super
  35.   end
  36.   #--------------------------------------------------------------------------
  37.   # ● 生成位图
  38.   #--------------------------------------------------------------------------
  39.   def create_bitmap
  40.     @last_hp = @battler.hp
  41.     bw = 96
  42.     bh = 16
  43.     self.bitmap = Bitmap.new(bw, bh)
  44.     self.bitmap.fill_rect(0, 0, bw, bh, Color.new(32,32,64))
  45.     if Freya::Gauge_Type.nil? or Freya::Gauge_Type == 0
  46.       hp = ((bw) * @battler.hp_rate).to_i
  47.       self.bitmap.gradient_fill_rect(0, 0, hp, bh, Freya::EnemyHPGaugeColor1, Freya::EnemyHPGaugeColor2)
  48.     elsif Freya::Gauge_Type == 1
  49.       hp = ((width - 2) * @battler.hp_rate).to_i
  50.       self.bitmap.gradient_fill_rect(1, 1, hp, bh - 2, Freya::EnemyHPGaugeColor1, Freya::EnemyHPGaugeColor2)
  51.     elsif Freya::Gauge_Type == 2
  52.       hp = ((width) * @battler.hp_rate).to_i
  53.       self.bitmap.gradient_fill_rect(0, 0, hp / 2, bh, Freya::EnemyHPGaugeColor1, Freya::EnemyHPGaugeColor2)
  54.       self.bitmap.gradient_fill_rect(hp / 2, 0, hp / 2, bh, Freya::EnemyHPGaugeColor2, Freya::EnemyHPGaugeColor1)
  55.     elsif Freya::Gauge_Type == 3
  56.       hp = ((width - 2) * @battler.hp_rate).to_i
  57.       self.bitmap.gradient_fill_rect(1, 1, hp / 2, bh - 2, Freya::EnemyHPGaugeColor1, Freya::EnemyHPGaugeColor2)
  58.       self.bitmap.gradient_fill_rect((hp / 2) + 1, 1, hp / 2, bh - 2, Freya::EnemyHPGaugeColor2, Freya::EnemyHPGaugeColor1)
  59.     end
  60.   end
  61.   #--------------------------------------------------------------------------
  62.   # ● 更新画面
  63.   #--------------------------------------------------------------------------
  64.   def update
  65.     super
  66.     unless self.bitmap.nil?
  67.       self.x = @battler.screen_x - self.width / 2
  68.       self.y = @battler.screen_y
  69.       create_bitmap if @last_hp != @battler.hp
  70.       hide = $data_enemies[@battler.enemy_id].note.include?(Freya::HideGaugeText)
  71.       self.opacity = 0 if @battler.hp == 0 or hide
  72.     end
  73.   end
  74. end
  75.  
  76. #==============================================================================
  77. # ■ Sprite_Battler
  78. #------------------------------------------------------------------------------
  79. #  显示战斗者的精灵。根据 Game_Battler 类的实例自动变化。
  80. #==============================================================================
  81. class Sprite_Battler < Sprite_Base
  82.   #--------------------------------------------------------------------------
  83.   # ☆ 初始化对象
  84.   #--------------------------------------------------------------------------
  85.   alias initialize_freya_enemy_hp initialize
  86.   def initialize(viewport, battler = nil)
  87.     initialize_freya_enemy_hp(viewport, battler)
  88.     if @battler.is_a?(Game_Enemy)
  89.       @hp_gauge = Sprite_Battler_HP.new(viewport, battler)
  90.     end
  91.   end
  92.   #--------------------------------------------------------------------------
  93.   # ☆ 释放
  94.   #--------------------------------------------------------------------------
  95.   alias dispose_freya_enemy_hp dispose
  96.   def dispose
  97.     dispose_freya_enemy_hp
  98.     unless @hp_gauge.nil?
  99.       @hp_gauge.dispose
  100.     end
  101.   end
  102.   #--------------------------------------------------------------------------
  103.   # ☆ 更新画面
  104.   #--------------------------------------------------------------------------
  105.   alias update_freya_enemy_hp update
  106.   def update
  107.     update_freya_enemy_hp
  108.     @hp_gauge.update unless @hp_gauge.nil?
  109.   end
  110. end

评分

参与人数 1梦石 +1 收起 理由
迷糊的安安 + 1 认可答案 附赠66RPG提供的精美好人卡一张^^.

查看全部评分

修改劇本中,仔細審查原來的劇情大綱,覺得有點不太滿意,嘗試編寫不同主角不同主線的劇情,希望能寫得出來。
回复 支持 反对

使用道具 举报

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

本版积分规则

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

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

GMT+8, 2024-4-30 03:00

Powered by Discuz! X3.1

© 2001-2013 Comsenz Inc.

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