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

Project1

 找回密码
 注册会员
搜索

怎么才可以看到野怪的血条

查看数: 1625 | 评论数: 6 | 收藏 0
关灯 | 提示:支持键盘翻页<-左 右->
    组图打开中,请稍候......
发布时间: 2013-9-20 17:39

正文摘要:

如题,要可以看到怪的血量,并且会随着伤害减少的

回复

蓝冰紫魄 发表于 2013-9-21 10:56:58
y967 发表于 2013-9-21 10:19
#==============================================================================
# 本脚本来自www.66R ...

在哪里改呢,真的不会编程

点评

高度是在开头 5*20那里 80也可以改  发表于 2013-9-21 11:04
复制啊,然后插入到main前面,再取个名字,显示怪物血条  发表于 2013-9-21 11:03
y967 发表于 2013-9-21 10:19:57
#==============================================================================
# 本脚本来自www.66RPG.com,使用和转载请保留此信息
#==============================================================================
# ■ エネミーHP&SP(ver 0.98)
# □ カスタマイズポイント
#==============================================================================
module PLAN_HPSP_DRAW
FONT_NAME         = ["黑体", "楷体", "宋体"]    # フォント
FONT_SIZE         =  14                               # フォントサイズ
FONT_BOLD         = true                              # 太字
FONT_ITALIC       = true                              # 斜体
DRAW_NAME         = false                             # 名前の描画
DRAW_HP           = true                              # HP の描画
DRAW_SP           = false                              # SP の描画
DRAW_WIDTH        =  80                               # 描画幅
DRAW_HEIGHT       = 5 * 20                            # 描画高さ
DRAW_SPACE        =   0                               # 行間
DRAW_Y            =  1                               # Y 座標修正値
end

#==============================================================================
# ■ Sprite_Battler
#==============================================================================
class Sprite_Battler < RPG::Sprite
#--------------------------------------------------------------------------
# ● オブジェクト初期化
#--------------------------------------------------------------------------
alias plan_enemy_hpsp_draw_initialize initialize
def initialize(viewport, battler = nil)
  # 元のメソッドに戻す
  plan_enemy_hpsp_draw_initialize(viewport, battler)
  # エネミーの場合
  if @battler.is_a?(Game_Enemy)
    width = PLAN_HPSP_DRAW::DRAW_WIDTH + 32
    height = PLAN_HPSP_DRAW::DRAW_HEIGHT + 32
    x = @battler.screen_x - width / 2
    y = @battler.screen_y - height + 32 + PLAN_HPSP_DRAW::DRAW_Y
    @enemy_hpsp_window = Window_Base.new(x, y, width, height)
    @enemy_hpsp_window.contents = Bitmap.new(width - 32, height - 32)
    @enemy_hpsp_window.contents.font.name = PLAN_HPSP_DRAW::FONT_NAME
    @enemy_hpsp_window.contents.font.size = PLAN_HPSP_DRAW::FONT_SIZE
    @enemy_hpsp_window.contents.font.bold = PLAN_HPSP_DRAW::FONT_BOLD
    @enemy_hpsp_window.contents.font.italic = PLAN_HPSP_DRAW::FONT_ITALIC
    y = 0
    @old_enemy_hpsp = []
    one_line = ((PLAN_HPSP_DRAW::FONT_SIZE * 100 / 28) * 32) / 100
    if PLAN_HPSP_DRAW::DRAW_NAME
      @enemy_hpsp_window.draw_actor_name(@battler, 0, y, width - 32)
      y += one_line + PLAN_HPSP_DRAW::DRAW_SPACE
      @old_enemy_hpsp.push(@battler.name)
    end
    if PLAN_HPSP_DRAW::DRAW_HP
      @enemy_hpsp_window.draw_actor_hp2222(@battler, 0, y, width - 32)
      y += one_line + PLAN_HPSP_DRAW::DRAW_SPACE
      @old_enemy_hpsp.push(@battler.hp)
    end
    if PLAN_HPSP_DRAW::DRAW_SP
      @enemy_hpsp_window.draw_actor_sp2222(@battler, 0, y, width - 32)
      @old_enemy_hpsp.push(@battler.sp)
    end
    @enemy_hpsp_window.opacity = 0
    @enemy_hpsp_window.contents_opacity = 0
    @enemy_hpsp_window.z = -2
  end
end
#--------------------------------------------------------------------------
# ● 解放
#--------------------------------------------------------------------------
alias plan_enemy_hpsp_draw_dispose dispose
def dispose
  # エネミーの場合
  if @battler.is_a?(Game_Enemy)
    @enemy_hpsp_window.dispose
  end
  # 元のメソッドに戻す
  plan_enemy_hpsp_draw_dispose
end
#--------------------------------------------------------------------------
# ● フレーム更新
#--------------------------------------------------------------------------
alias plan_enemy_hpsp_draw_update update
def update
  # 元のメソッドに戻す
  plan_enemy_hpsp_draw_update
  # エネミーの場合
  if @battler.is_a?(Game_Enemy)
    @enemy_hpsp_window.visible = @battler_visible
  # スプライトの座標を設定
    width = PLAN_HPSP_DRAW::DRAW_WIDTH + 32
    @enemy_hpsp_window.x = self.x - width / 2
    @now_enemy_hpsp = []
    if PLAN_HPSP_DRAW::DRAW_NAME
      @now_enemy_hpsp.push(@battler.name)
    end
    if PLAN_HPSP_DRAW::DRAW_HP
      @now_enemy_hpsp.push(@battler.hp)
    end
    if PLAN_HPSP_DRAW::DRAW_SP
      @now_enemy_hpsp.push(@battler.sp)
    end
    if @old_enemy_hpsp != @now_enemy_hpsp and $game_temp.enemy_hpsp_refresh
      @old_enemy_hpsp = @now_enemy_hpsp
      @enemy_hpsp_window.contents.clear
      y = 0
      width = PLAN_HPSP_DRAW::DRAW_WIDTH + 32
      one_line = ((PLAN_HPSP_DRAW::FONT_SIZE * 100 / 28) * 32) / 100
      if PLAN_HPSP_DRAW::DRAW_NAME
        @enemy_hpsp_window.draw_actor_name(@battler, 0, y, width - 32)
        y += one_line + PLAN_HPSP_DRAW::DRAW_SPACE
      end
      if PLAN_HPSP_DRAW::DRAW_HP
        @enemy_hpsp_window.draw_actor_hp2222(@battler, 0, y, width - 32)
        y += one_line + PLAN_HPSP_DRAW::DRAW_SPACE
      end
      if PLAN_HPSP_DRAW::DRAW_SP
        @enemy_hpsp_window.draw_actor_sp2222(@battler, 0, y, width - 32)
      end
      Graphics.frame_reset
    end
  end
end
#--------------------------------------------------------------------------
# ● visible の設定
#--------------------------------------------------------------------------
if !method_defined?("plan_enemy_hpsp_draw_visible=")
  alias plan_enemy_hpsp_draw_visible= visible=
end
def visible=(bool)
  # エネミーの場合
  if @battler.is_a?(Game_Enemy)
    @enemy_hpsp_window.visible = bool
  end
  # 元のメソッドに戻す
  self.plan_enemy_hpsp_draw_visible=(bool)
end
#--------------------------------------------------------------------------
# ● 不透明度の設定
#--------------------------------------------------------------------------
if !method_defined?("plan_enemy_hpsp_draw_opacity=")
  alias plan_enemy_hpsp_draw_opacity= opacity=
end
def opacity=(n)
  # 元のメソッドに戻す
  self.plan_enemy_hpsp_draw_opacity=(n)
  # エネミーの場合
  if @battler.is_a?(Game_Enemy)
    @enemy_hpsp_window.contents_opacity = n
  end
end
end
  
  
#==============================================================================
# ■ Game_Temp
#==============================================================================
class Game_Temp
#--------------------------------------------------------------------------
# ● 公開インスタンス変数
#--------------------------------------------------------------------------
attr_accessor :enemy_hpsp_refresh
#--------------------------------------------------------------------------
# ● オブジェクト初期化
#--------------------------------------------------------------------------
alias plan_enemy_hpsp_draw_initialize initialize
def initialize
  # 元のメソッドに戻す
  plan_enemy_hpsp_draw_initialize
  @enemy_hpsp_refresh = false
end
end
#==============================================================================
# ■ Scene_Battle
#==============================================================================
class Scene_Battle
#--------------------------------------------------------------------------
# ● プレバトルフェーズ開始 (エネミー名+アルファベット用)
#--------------------------------------------------------------------------
alias plan_enemy_hpsp_draw_start_phase1 start_phase1
def start_phase1
  $game_temp.enemy_hpsp_refresh = true
  # 元のメソッドに戻す
  plan_enemy_hpsp_draw_start_phase1
end
#--------------------------------------------------------------------------
# ● パーティコマンドフェーズ開始 (エネミー名+アルファベット用)
#--------------------------------------------------------------------------
alias plan_enemy_hpsp_draw_start_phase2 start_phase2
def start_phase2
  $game_temp.enemy_hpsp_refresh = false
  # 元のメソッドに戻す
  plan_enemy_hpsp_draw_start_phase2
end
#--------------------------------------------------------------------------
# ● フレーム更新 (メインフェーズ ステップ 5 : ダメージ表示)
#--------------------------------------------------------------------------
alias plan_enemy_hpsp_draw_update_phase4_step5 update_phase4_step5
def update_phase4_step5
  # 元のメソッドに戻す
  plan_enemy_hpsp_draw_update_phase4_step5
  $game_temp.enemy_hpsp_refresh = true
end
#--------------------------------------------------------------------------
# ● フレーム更新 (メインフェーズ ステップ 6 : リフレッシュ)
#--------------------------------------------------------------------------
alias plan_enemy_hpsp_draw_update_phase4_step6 update_phase4_step6
def update_phase4_step6
  # 元のメソッドに戻す
  plan_enemy_hpsp_draw_update_phase4_step6
  $game_temp.enemy_hpsp_refresh = false
end
end

#==============================================================================
# ■ Window_Base
#==============================================================================
class Window_Base < Window
#--------------------------------------------------------------------------
# ● 名前の描画
#--------------------------------------------------------------------------
def draw_actor_name(actor, x, y, width = 120, align = 0)
  self.contents.font.color = normal_color
  align = 1 if $scene.is_a?(Scene_Battle)
  self.contents.draw_text(x, y, width, 32, actor.name, align)
end
#--------------------------------------------------------------------------
# ● ステートの描画
#--------------------------------------------------------------------------
def draw_actor_state(actor, x, y, width = 120)
  # 元のメソッドに戻す
  text = make_battler_state_text(actor, width, true)
  self.contents.draw_text(x, y, width, 32, text, 1)
end
end

#==============================================================================
# 本脚本来自www.66RPG.com,使用和转载请保留此信息
#==============================================================================
class Window_Base < Window
def draw_actor_hp2222(actor, x, y, width = 100, height=5)
   y+=3
   olx = x
   oly = y
   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)  
   x = olx
   y = oly-14   
   # 描绘字符串 "HP"
   self.contents.font.color = system_color
   self.contents.draw_text(x, y, 32, 32, $data_system.words.hp)
   # 计算描绘 MaxHP 所需的空间  
   if width - 32 >= 108
     hp_x = x + width - 108
     flag = true
   elsif width - 32 >= 48
     hp_x = x + width - 48
     flag = false
   end
   # 描绘 HP
   self.contents.font.color = actor.hp == 0 ? knockout_color :
     actor.hp <= actor.maxhp / 4 ? crisis_color : normal_color
   self.contents.draw_text(hp_x, y, 48, 32, actor.hp.to_s, 2)
   # 描绘 MaxHP
   if flag
     self.contents.font.color = normal_color
     self.contents.draw_text(hp_x + 48, y, 12, 32, "/", 1)
     self.contents.draw_text(hp_x + 60, y, 48, 32, actor.maxhp.to_s)
   end     
end
def draw_actor_sp2222(actor, x, y, width = 100, height = 8)
   y+=3
   olx = x
   oly = y
   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)  
   x = olx
   y = oly-14
   # 描绘字符串 "SP"  
   self.contents.font.color = system_color
   self.contents.draw_text(x, y, 32, 32, $data_system.words.sp)
   # 计算描绘 MaxSP 所需的空间
   if width - 32 >= 108
     sp_x = x + width - 108
     flag = true
   elsif width - 32 >= 48
     sp_x = x + width - 48
     flag = false
   end
   # 描绘 SP
   self.contents.font.color = actor.sp == 0 ? knockout_color :
     actor.sp <= actor.maxsp / 4 ? crisis_color : normal_color
   self.contents.draw_text(sp_x, y, 48, 32, actor.sp.to_s, 2)
   # 描绘 MaxSP
   if flag
     self.contents.font.color = normal_color
     self.contents.draw_text(sp_x + 48, y, 12, 32, "/", 1)
     self.contents.draw_text(sp_x + 60, y, 48, 32, actor.maxsp.to_s)
   end     
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,使用和转载请保留此信息
#==============================================================================




这个我用的  高度,颜色自己调整

评分

参与人数 1星屑 +50 收起 理由
myownroc + 50 塞糖

查看全部评分

美丽晨露 发表于 2013-9-21 00:23:24
蓝冰紫魄 发表于 2013-9-21 00:11
这么脚本要怎么用

将此段脚本插入到MAIN脚本之上。

评分

参与人数 1星屑 +30 收起 理由
myownroc + 30 塞糖

查看全部评分

蓝冰紫魄 发表于 2013-9-21 00:11:29
这么脚本要怎么用
紫英晓狼1130 发表于 2013-9-20 19:07:27
请善用搜索!
  1. #==============================================================================
  2. # 本脚本来自www.66RPG.com,使用和转载请保留此信息
  3. #==============================================================================


  4. # ————————————————————————————————————

  5. # ▼▲▼ XRXS_BP 7. バトルステータス?クリアデザイン ver.1.03 ▼▲▼
  6. # by 桜雅 在土

  7. #==============================================================================
  8. # ■ Window_BattleStatus
  9. #==============================================================================
  10. class Window_BattleStatus < Window_Base
  11.   #--------------------------------------------------------------------------
  12.   # ● 公開インスタンス変数
  13.   #--------------------------------------------------------------------------
  14.   attr_accessor :update_cp_only # CPメーターのみの更新
  15.   #--------------------------------------------------------------------------
  16.   # ● オブジェクト初期化
  17.   #--------------------------------------------------------------------------
  18.   alias xrxs_bp7_initialize initialize
  19.   def initialize
  20.     # 初期化
  21.     @previous_hp = []
  22.     @previous_sp = []
  23.     # 呼び戻す
  24.     xrxs_bp7_initialize
  25.     # ↓Full-Viewの場合は下二行の # を消してください。
  26.     #self.opacity = 0
  27.     #self.back_opacity = 0
  28.   end
  29.   #--------------------------------------------------------------------------
  30.   # ● リフレッシュ
  31.   #--------------------------------------------------------------------------
  32.   alias xrxs_bp7_refresh refresh
  33.   def refresh
  34.     # CPメーターの更新のみ の場合
  35.     if @update_cp_only
  36.       xrxs_bp7_refresh
  37.       return
  38.     end
  39.     # 変更するものがない場合、飛ばす
  40.     @item_max = $game_party.actors.size
  41.     bool = false
  42.     for i in 0...@item_max
  43.       actor = $game_party.actors[i]
  44.       if (@previous_hp[i] != actor.hp) or (@previous_sp[i] != actor.sp)
  45.         bool = true
  46.       end
  47.     end
  48.     return if bool == false
  49.     # 描写を開始
  50.     self.contents.clear
  51.     for i in 0...@item_max
  52.       actor = $game_party.actors[i]
  53.       actor_x = i * 160 + 21
  54.       # 歩行キャラグラフィックの描写
  55.       draw_actor_graphic(actor, actor_x - 9, 116)
  56.       # HP/SPメーターの描写
  57.       draw_actor_hp_meter_line(actor, actor_x, 52, 96, 12)
  58.       draw_actor_sp_meter_line(actor, actor_x, 84, 96, 12)
  59.       # HP数値の描写
  60.       self.contents.font.size = 24 # HP/SP数値の文字の大きさ
  61.       self.contents.font.color = Color.new(0,0,0,192)
  62.       self.contents.draw_text(actor_x, 40, 96, 24, actor.hp.to_s, 2)
  63.       self.contents.font.color = actor.hp == 0 ? knockout_color :
  64.       actor.hp <= actor.maxhp / 4 ? crisis_color : normal_color
  65.       self.contents.draw_text(actor_x-2, 38, 96, 24, actor.hp.to_s, 2)
  66.       # SP数値の描写
  67.       self.contents.font.color = Color.new(0,0,0,192)
  68.       self.contents.draw_text(actor_x, 72, 96, 24, actor.sp.to_s, 2)
  69.       self.contents.font.color = actor.sp == 0 ? knockout_color :
  70.       actor.sp <= actor.maxsp / 4 ? crisis_color : normal_color
  71.       self.contents.draw_text(actor_x-2, 70, 96, 24, actor.sp.to_s, 2)
  72.       # 用語「HP」と用語「SP」の描写
  73.       self.contents.font.size = 18 # 用語「HP/SP」の文字の大きさ
  74.       self.contents.font.color = Color.new(0,0,0,192)
  75.       self.contents.draw_text(actor_x+2, 32, 196, 24, $data_system.words.hp)
  76.       self.contents.draw_text(actor_x+2, 64, 196, 24, $data_system.words.sp)
  77.       self.contents.font.color = system_color # 用語「HP/SP」の文字の色
  78.       self.contents.draw_text(actor_x, 30, 196, 24, $data_system.words.hp)
  79.       self.contents.draw_text(actor_x, 62, 196, 24, $data_system.words.sp)
  80.       # ステートの描写
  81.       draw_actor_state(actor, actor_x, 100)
  82.       # 値を更新
  83.       @previous_hp[i] = actor.hp
  84.       @previous_hp[i] = actor.hp
  85.     end
  86.   end
  87. end
  88. #==============================================================================
  89. # ■ Window_Base
  90. #==============================================================================
  91. class Window_Base < Window
  92.   #--------------------------------------------------------------------------
  93.   # ● HPメーター の描画
  94.   #--------------------------------------------------------------------------
  95.   def draw_actor_hp_meter_line(actor, x, y, width = 156, height = 4)
  96.     w = width * actor.hp / [actor.maxhp,1].max
  97.     hp_color_1 = Color.new(255, 0, 0, 192)
  98.     hp_color_2 = Color.new(255, 255, 0, 192)
  99.     self.contents.fill_rect(x+8, y+4, width, (height/4).floor, Color.new(0, 0, 0, 128))
  100.     draw_line(x, y, x + w, y, hp_color_1, (height/4).floor, hp_color_2)
  101.     x -= 1
  102.     y += (height/4).floor
  103.     self.contents.fill_rect(x+8, y+4, width, (height/4).ceil , Color.new(0, 0, 0, 128))
  104.     draw_line(x, y, x + w, y, hp_color_1, (height/4).ceil , hp_color_2)
  105.     x -= 1
  106.     y += (height/4).ceil
  107.     self.contents.fill_rect(x+8, y+4, width, (height/4).ceil , Color.new(0, 0, 0, 128))
  108.     draw_line(x, y, x + w, y, hp_color_1, (height/4).ceil , hp_color_2)
  109.     x -= 1
  110.     y += (height/4).ceil
  111.     self.contents.fill_rect(x+8, y+4, width, (height/4).floor, Color.new(0, 0, 0, 128))
  112.     draw_line(x, y, x + w, y, hp_color_1, (height/4).floor, hp_color_2)
  113.   end
  114.   #--------------------------------------------------------------------------
  115.   # ● SPメーター の描画
  116.   #--------------------------------------------------------------------------
  117.   def draw_actor_sp_meter_line(actor, x, y, width = 156, height = 4)
  118.     w = width * actor.sp / [actor.maxsp,1].max
  119.     hp_color_1 = Color.new( 0, 0, 255, 192)
  120.     hp_color_2 = Color.new( 0, 255, 255, 192)
  121.     self.contents.fill_rect(x+8, y+4, width, (height/4).floor, Color.new(0, 0, 0, 128))
  122.     draw_line(x, y, x + w, y, hp_color_1, (height/4).floor, hp_color_2)
  123.     x -= 1
  124.     y += (height/4).floor
  125.     self.contents.fill_rect(x+8, y+4, width, (height/4).ceil , Color.new(0, 0, 0, 128))
  126.     draw_line(x, y, x + w, y, hp_color_1, (height/4).ceil , hp_color_2)
  127.     x -= 1
  128.     y += (height/4).ceil
  129.     self.contents.fill_rect(x+8, y+4, width, (height/4).ceil , Color.new(0, 0, 0, 128))
  130.     draw_line(x, y, x + w, y, hp_color_1, (height/4).ceil , hp_color_2)
  131.     x -= 1
  132.     y += (height/4).ceil
  133.     self.contents.fill_rect(x+8, y+4, width, (height/4).floor, Color.new(0, 0, 0, 128))
  134.     draw_line(x, y, x + w, y, hp_color_1, (height/4).floor, hp_color_2)
  135.   end
  136.   #--------------------------------------------------------------------------
  137.   # ● 名前の描画
  138.   #--------------------------------------------------------------------------
  139.   alias xrxs_bp7_draw_actor_name draw_actor_name
  140.   def draw_actor_name(actor, x, y)
  141.     xrxs_bp7_draw_actor_name(actor, x, y) if @draw_ban != true
  142.   end
  143.   #--------------------------------------------------------------------------
  144.   # ● ステートの描画
  145.   #--------------------------------------------------------------------------
  146.   alias xrxs_bp7_draw_actor_state draw_actor_state
  147.   def draw_actor_state(actor, x, y, width = 120)
  148.     xrxs_bp7_draw_actor_state(actor, x, y, width) if @draw_ban != true
  149.   end
  150.   #--------------------------------------------------------------------------
  151.   # ● HP の描画
  152.   #--------------------------------------------------------------------------
  153.   alias xrxs_bp7_draw_actor_hp draw_actor_hp
  154.   def draw_actor_hp(actor, x, y, width = 144)
  155.     xrxs_bp7_draw_actor_hp(actor, x, y, width) if @draw_ban != true
  156.   end
  157.   #--------------------------------------------------------------------------
  158.   # ● SP の描画
  159.   #--------------------------------------------------------------------------
  160.   alias xrxs_bp7_draw_actor_sp draw_actor_sp
  161.   def draw_actor_sp(actor, x, y, width = 144)
  162.     xrxs_bp7_draw_actor_sp(actor, x, y, width) if @draw_ban != true
  163.   end
  164. end
  165. #==============================================================================
  166. # ■ Scene_Battle
  167. #==============================================================================
  168. class Scene_Battle
  169.   #--------------------------------------------------------------------------
  170.   # ● フレーム更新
  171.   #--------------------------------------------------------------------------
  172.   alias xrxs_bp7_update update
  173.   def update
  174.     xrxs_bp7_update
  175.     # メッセージウィンドウ表示中の場合
  176.     if $game_temp.message_window_showing
  177.       @status_window.update_cp_only = true      
  178.     else
  179.       @status_window.update_cp_only = false
  180.     end
  181.   end
  182. end
  183. #==============================================================================
  184. # ◇ 外部ライブラリ
  185. #==============================================================================
  186. class Window_Base
  187.   #--------------------------------------------------------------------------
  188.   # ● ライン描画 軽量版 by 桜雅 在土
  189.   #--------------------------------------------------------------------------
  190.   def draw_lineght(start_x, start_y, end_x, end_y, start_color)
  191.     # 描写距離の計算。大きめに直角時の長さ。
  192.     distance = (start_x - end_x).abs + (start_y - end_y).abs
  193.     # 描写開始
  194.     for i in 1..distance
  195.       x = (start_x + 1.0 * (end_x - start_x) * i / distance).to_i
  196.       y = (start_y + 1.0 * (end_y - start_y) * i / distance).to_i
  197.       self.contents.set_pixel(x, y, start_color)
  198.     end
  199.   end
  200.   #--------------------------------------------------------------------------
  201.   # ● ライン描画 by 桜雅 在土
  202.   #--------------------------------------------------------------------------
  203.   def draw_line(start_x, start_y, end_x, end_y, start_color, width = 1, end_color = start_color)
  204.     # 描写距離の計算。大きめに直角時の長さ。
  205.     distance = (start_x - end_x).abs + (start_y - end_y).abs
  206.     # 描写開始
  207.     if end_color == start_color
  208.       for i in 1..distance
  209.         x = (start_x + 1.0 * (end_x - start_x) * i / distance).to_i
  210.         y = (start_y + 1.0 * (end_y - start_y) * i / distance).to_i
  211.         if width == 1
  212.           self.contents.set_pixel(x, y, start_color)
  213.         else
  214.           self.contents.fill_rect(x, y, width, width, start_color)
  215.         end
  216.       end
  217.     else
  218.       for i in 1..distance
  219.         x = (start_x + 1.0 * (end_x - start_x) * i / distance).to_i
  220.         y = (start_y + 1.0 * (end_y - start_y) * i / distance).to_i
  221.         r = start_color.red * (distance-i)/distance + end_color.red * i/distance
  222.         g = start_color.green * (distance-i)/distance + end_color.green * i/distance
  223.         b = start_color.blue * (distance-i)/distance + end_color.blue * i/distance
  224.         a = start_color.alpha * (distance-i)/distance + end_color.alpha * i/distance
  225.         if width == 1
  226.           self.contents.set_pixel(x, y, Color.new(r, g, b, a))
  227.         else
  228.           self.contents.fill_rect(x, y, width, width, Color.new(r, g, b, a))
  229.         end
  230.       end
  231.     end
  232.   end
  233. end


  234. #==============================================================================
  235. # 本脚本来自www.66RPG.com,使用和转载请保留此信息
  236. #==============================================================================
  237. 敌方:
  238. [code]#==============================================================================
  239. # 本脚本来自www.66RPG.com,使用和转载请保留此信息
  240. #==============================================================================

  241. #==============================================================================
  242. # ■ Window_Help
  243. #------------------------------------------------------------------------------
  244. # 重新定义的内容,可以显示敌人的HP\MP百分比
  245. # 你可以改脚本的开头部分定义生命、精神描述词。只和敌人描述有关,可随意修改
  246. #==============================================================================

  247. class Window_Help < Window_Base
  248.   def set_enemy(actor)  
  249.     #--------------------------------------------------------------------
  250.     # 在这里修改描述文字,比如@生命描述词="敌人生命"
  251.     #--------------------------------------------------------------------
  252.    
  253.     @生命描述词 = $data_system.words.hp
  254.     @精神描述词 = $data_system.words.sp
  255.    
  256.     #--------------------------------------------------------------------
  257.     #--------------------------------------------------------------------
  258.     self.contents.clear
  259.     draw_actor_name(actor, 4, 0)
  260.     draw_actor_state(actor, 140, 0)
  261.     carol3_draw_hp_bar(actor, 284, 12)
  262.     carol3_draw_sp_bar(actor, 460, 12)
  263.     @text = nil
  264.     self.visible = true
  265.   end
  266.   def carol3_draw_hp_bar(actor, x, y, width = 128, height = 12) #宽度可调
  267.     w = width * actor.hp / [actor.maxhp,1].max
  268.     hp_color_1 = Color.new(255, 0, 0, 192)
  269.     hp_color_2 = Color.new(255, 255, 0, 192)
  270.     self.contents.fill_rect(x+8, y+4, width, (height/4).floor, Color.new(0, 0, 0, 128))
  271.     draw_line(x, y, x + w, y, hp_color_1, (height/4).floor, hp_color_2)
  272.     x -= 1
  273.     y += (height/4).floor
  274.     self.contents.fill_rect(x+8, y+4, width, (height/4).ceil , Color.new(0, 0, 0, 128))
  275.     draw_line(x, y, x + w, y, hp_color_1, (height/4).ceil , hp_color_2)
  276.     x -= 1
  277.     y += (height/4).ceil
  278.     self.contents.fill_rect(x+8, y+4, width, (height/4).ceil , Color.new(0, 0, 0, 128))
  279.     draw_line(x, y, x + w, y, hp_color_1, (height/4).ceil , hp_color_2)
  280.     x -= 1
  281.     y += (height/4).ceil
  282.     self.contents.fill_rect(x+8, y+4, width, (height/4).floor, Color.new(0, 0, 0, 128))
  283.     draw_line(x, y, x + w, y, hp_color_1, (height/4).floor, hp_color_2)
  284.     self.contents.font.color = Color.new(0,0,0,255)
  285.     self.contents.draw_text(x+2,-3,25,32,@生命描述词,1)
  286.     self.contents.font.color = Color.new(255,255,255,255)
  287.     self.contents.draw_text(x,-4,25,32,@生命描述词,1)
  288.   end
  289.   def carol3_draw_sp_bar(actor, x, y, width = 128, height=12)
  290.     w = width * actor.sp / [actor.maxsp,1].max
  291.     hp_color_1 = Color.new( 0, 0, 255, 192)
  292.     hp_color_2 = Color.new( 0, 255, 255, 192)
  293.     self.contents.fill_rect(x+8, y+4, width, (height/4).floor, Color.new(0, 0, 0, 128))
  294.     draw_line(x, y, x + w, y, hp_color_1, (height/4).floor, hp_color_2)
  295.     x -= 1
  296.     y += (height/4).floor
  297.     self.contents.fill_rect(x+8, y+4, width, (height/4).ceil , Color.new(0, 0, 0, 128))
  298.     draw_line(x, y, x + w, y, hp_color_1, (height/4).ceil , hp_color_2)
  299.     x -= 1
  300.     y += (height/4).ceil
  301.     self.contents.fill_rect(x+8, y+4, width, (height/4).ceil , Color.new(0, 0, 0, 128))
  302.     draw_line(x, y, x + w, y, hp_color_1, (height/4).ceil , hp_color_2)
  303.     x -= 1
  304.     y += (height/4).ceil
  305.     self.contents.fill_rect(x+8, y+4, width, (height/4).floor, Color.new(0, 0, 0, 128))
  306.     draw_line(x, y, x + w, y, hp_color_1, (height/4).floor, hp_color_2)
  307.     self.contents.font.color = Color.new(0,0,0,255)
  308.     self.contents.draw_text(x+2,-3,25,32,@精神描述词,1)
  309.     self.contents.font.color = Color.new(255,255,255,255)
  310.     self.contents.draw_text(x,-4,25,32,@精神描述词,1)
  311.   end
  312.   #--------------------------------------------------------------------------
  313.   # ● ライン描画 by 桜雅 在土
  314.   #--------------------------------------------------------------------------
  315.   def draw_line(start_x, start_y, end_x, end_y, start_color, width = 1, end_color = start_color)
  316.     # 描写距離の計算。大きめに直角時の長さ。
  317.     distance = (start_x - end_x).abs + (start_y - end_y).abs
  318.     # 描写開始
  319.     if end_color == start_color
  320.       for i in 1..distance
  321.         x = (start_x + 1.0 * (end_x - start_x) * i / distance).to_i
  322.         y = (start_y + 1.0 * (end_y - start_y) * i / distance).to_i
  323.         if width == 1
  324.           self.contents.set_pixel(x, y, start_color)
  325.         else
  326.           self.contents.fill_rect(x, y, width, width, start_color)
  327.         end
  328.       end
  329.     else
  330.       for i in 1..distance
  331.         x = (start_x + 1.0 * (end_x - start_x) * i / distance).to_i
  332.         y = (start_y + 1.0 * (end_y - start_y) * i / distance).to_i
  333.         r = start_color.red * (distance-i)/distance + end_color.red * i/distance
  334.         g = start_color.green * (distance-i)/distance + end_color.green * i/distance
  335.         b = start_color.blue * (distance-i)/distance + end_color.blue * i/distance
  336.         a = start_color.alpha * (distance-i)/distance + end_color.alpha * i/distance
  337.         if width == 1
  338.           self.contents.set_pixel(x, y, Color.new(r, g, b, a))
  339.         else
  340.           self.contents.fill_rect(x, y, width, width, Color.new(r, g, b, a))
  341.         end
  342.       end
  343.     end
  344.   end
  345. end

  346. #==============================================================================
  347. # 本脚本来自www.66RPG.com,使用和转载请保留此信息
  348. #==============================================================================
复制代码

评分

参与人数 1星屑 +50 收起 理由
myownroc + 50 我很赞同

查看全部评分

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

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

GMT+8, 2024-9-30 01:40

Powered by Discuz! X3.1

© 2001-2013 Comsenz Inc.

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