查看: 4892|回复: 3

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

[复制链接]
梦石
0
星屑
110
在线时间
0 小时
注册时间
2013-1-29
回帖
0
发表于 2013-1-29 16:04:10 | 显示全部楼层 |阅读模式

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

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

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

唯一的信徒

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


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

使用道具 举报

梦石
0
星屑
3905
在线时间
1972 小时
注册时间
2013-1-3
回帖
9146
发表于 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. #==============================================================================
复制代码
《宿愿·寻剑篇》正式版已经发布!快去看看!点击进入论坛发布贴
回复

使用道具 举报

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

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

[pre lang="ruby" line="1"]#==============================================================================
# F08 - 战斗敌人显示血条 - By芙蕾娅
#------------------------------------------------------------------------------
#  ★ - 新增  ☆ - 修改  ■ - 删除 ● - 无变更
#==============================================================================
module Freya
  # 隐藏HP的文本
  HideGaugeText = "Hide_Gauge"
  # 血条颜色
  EnemyHPGaugeColor1 = Color.new(64,128,96)
  EnemyHPGaugeColor2 = Color.new(96,192,160)
end
#==============================================================================
# ■ Sprite_Battler_HP
#------------------------------------------------------------------------------
#  显示战斗者的生命在战斗者的精灵下面。
#==============================================================================
class Sprite_Battler_HP < Sprite
  #--------------------------------------------------------------------------
  # ● 初始化对象
  #--------------------------------------------------------------------------
  def initialize(viewport,battler)
    super(viewport)
    @battler = battler
    @last_hp = 0
    create_bitmap
    update
  end
  #--------------------------------------------------------------------------
  # ● 释放
  #--------------------------------------------------------------------------
  def dispose
    self.bitmap.dispose
    super
  end
  #--------------------------------------------------------------------------
  # ● 生成位图
  #--------------------------------------------------------------------------
  def create_bitmap
    @last_hp = @battler.hp
    bw = 96
    bh = 16
    self.bitmap = Bitmap.new(bw, bh)
    self.bitmap.fill_rect(0, 0, bw, bh, Color.new(32,32,64))
    if Freya::Gauge_Type.nil? or Freya::Gauge_Type == 0
      hp = ((bw) * @battler.hp_rate).to_i
      self.bitmap.gradient_fill_rect(0, 0, hp, bh, Freya::EnemyHPGaugeColor1, Freya::EnemyHPGaugeColor2)
    elsif Freya::Gauge_Type == 1
      hp = ((width - 2) * @battler.hp_rate).to_i
      self.bitmap.gradient_fill_rect(1, 1, hp, bh - 2, Freya::EnemyHPGaugeColor1, Freya::EnemyHPGaugeColor2)
    elsif Freya::Gauge_Type == 2
      hp = ((width) * @battler.hp_rate).to_i
      self.bitmap.gradient_fill_rect(0, 0, hp / 2, bh, Freya::EnemyHPGaugeColor1, Freya::EnemyHPGaugeColor2)
      self.bitmap.gradient_fill_rect(hp / 2, 0, hp / 2, bh, Freya::EnemyHPGaugeColor2, Freya::EnemyHPGaugeColor1)
    elsif Freya::Gauge_Type == 3
      hp = ((width - 2) * @battler.hp_rate).to_i
      self.bitmap.gradient_fill_rect(1, 1, hp / 2, bh - 2, Freya::EnemyHPGaugeColor1, Freya::EnemyHPGaugeColor2)
      self.bitmap.gradient_fill_rect((hp / 2) + 1, 1, hp / 2, bh - 2, Freya::EnemyHPGaugeColor2, Freya::EnemyHPGaugeColor1)
    end
  end
  #--------------------------------------------------------------------------
  # ● 更新画面
  #--------------------------------------------------------------------------
  def update
    super
    unless self.bitmap.nil?
      self.x = @battler.screen_x - self.width / 2
      self.y = @battler.screen_y
      create_bitmap if @last_hp != @battler.hp
      hide = $data_enemies[@battler.enemy_id].note.include?(Freya::HideGaugeText)
      self.opacity = 0 if @battler.hp == 0 or hide
    end
  end
end

#==============================================================================
# ■ Sprite_Battler
#------------------------------------------------------------------------------
#  显示战斗者的精灵。根据 Game_Battler 类的实例自动变化。
#==============================================================================
class Sprite_Battler < Sprite_Base
  #--------------------------------------------------------------------------
  # ☆ 初始化对象
  #--------------------------------------------------------------------------
  alias initialize_freya_enemy_hp initialize
  def initialize(viewport, battler = nil)
    initialize_freya_enemy_hp(viewport, battler)
    if @battler.is_a?(Game_Enemy)
      @hp_gauge = Sprite_Battler_HP.new(viewport, battler)
    end
  end
  #--------------------------------------------------------------------------
  # ☆ 释放
  #--------------------------------------------------------------------------
  alias dispose_freya_enemy_hp dispose
  def dispose
    dispose_freya_enemy_hp
    unless @hp_gauge.nil?
      @hp_gauge.dispose
    end
  end
  #--------------------------------------------------------------------------
  # ☆ 更新画面
  #--------------------------------------------------------------------------
  alias update_freya_enemy_hp update
  def update
    update_freya_enemy_hp
    @hp_gauge.update unless @hp_gauge.nil?
  end
end[/pre]

评分

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

查看全部评分

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

使用道具 举报

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

本版积分规则

Powered by Discuz! X5.0 © 2001-2026 Discuz! Team.

在本版发帖返回顶部