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

Project1

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

[已经解决] 血條腳本內加入能力值的血條

[复制链接]

Lv1.梦旅人

梦石
0
星屑
50
在线时间
113 小时
注册时间
2008-3-25
帖子
204
跳转到指定楼层
1
发表于 2012-1-6 20:58:37 | 只看该作者 |只看大图 回帖奖励 |倒序浏览 |阅读模式
1星屑
本帖最后由 銀藍色的零 于 2012-1-10 22:21 编辑

我使用此戰鬥血條腳本
我想把能力值也出現血條(例:力量)


能改的出來嗎?
狀態欄那邊一樣顯示數字



PS:我知道這是戰鬥血條
我就是要在戰場上同時也出現能力值血條~~~^^

本人稍微亂改過
改不成功

#==============================================================================
# 本脚本来自www.66RPG.com,使用和转载请保留此信息
#==============================================================================


# ————————————————————————————————————

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

#==============================================================================
# ■ Window_BattleStatus
#==============================================================================
class Window_BattleStatus < Window_Base
  #--------------------------------------------------------------------------
  # ● 公開インスタンス変数
  #--------------------------------------------------------------------------
  attr_accessor :update_cp_only # CPメーターのみの更新
  #--------------------------------------------------------------------------
  # ● オブジェクト初期化
  #--------------------------------------------------------------------------
  alias xrxs_bp7_initialize initialize
  def initialize
    # 初期化
    @previous_hp = []
    @previous_sp = []
    @previous_str = []
    # 呼び戻す
    xrxs_bp7_initialize
    # ↓Full-Viewの場合は下二行の # を消してください。
    #self.opacity = 0
    #self.back_opacity = 0
  end
  #--------------------------------------------------------------------------
  # ● リフレッシュ
  #--------------------------------------------------------------------------
  alias xrxs_bp7_refresh refresh
  def refresh
    # CPメーターの更新のみ の場合
    if @update_cp_only
      xrxs_bp7_refresh
      return
    end
    # 変更するものがない場合、飛ばす
    @item_max = $game_party.actors.size
    bool = false
    for i in 0...@item_max
      actor = $game_party.actors
      if (@previous_hp != actor.hp) or (@previous_sp != actor.sp) or (@previous_str != actor.str)
        bool = true
      end
    end
    return if bool == false
    # 描写を開始
    self.contents.clear
    for i in 0...@item_max
      actor = $game_party.actors
      actor_x = i * 160 + 82 #修改hp&mp血條的x座標位置
      # 歩行キャラグラフィックの描写 - 修改臉圖位置
      #draw_actor_face(actor, actor_x - 9, 60)
      # HP/SPメーターの描写 - 修改hp&mp血條位置
      draw_actor_hp_meter_line(actor, actor_x, 66, 46, 8)
      draw_actor_sp_meter_line(actor, actor_x, 85, 46, 8)
      draw_actor_str_meter_line(actor, actor_x, 94, 46, 8)
      # HP数値の描写
      self.contents.font.size = 15 # HP/SP数値の文字の大きさ
      self.contents.font.color = Color.new(0,0,0,192)
      self.contents.draw_text(actor_x-51, 65, 96, 24, actor.hp.to_s, 2)
      self.contents.font.color = actor.hp == 0 ? knockout_color :
      actor.hp <= actor.maxhp / 4 ? crisis_color : normal_color
      self.contents.draw_text(actor_x-50, 64, 96, 24, actor.hp.to_s, 2)
      # SP数値の描写
      self.contents.font.color = Color.new(0,0,0,192)
      self.contents.draw_text(actor_x-49, 88, 96, 24, actor.sp.to_s, 2)
      self.contents.font.color = actor.sp == 0 ? knockout_color :
      actor.sp <= actor.maxsp / 4 ? crisis_color : normal_color
      self.contents.draw_text(actor_x-50, 87, 96, 24, actor.sp.to_s,
      # str数値の描写
      self.contents.font.color = Color.new(0,0,0,192)
      self.contents.draw_text(actor_x-49, 88, 96, 24, actor.str_plus.to_s, 2)
      self.contents.font.color = actor.str == 0 ? knockout_color :
      actor.str <= actor.str_plus / 4 ? crisis_color : normal_color
      self.contents.draw_text(actor_x-50, 87, 96, 24, actor.str.to_s,2)

     # 用語「HP」と用語「SP」の描写
#      self.contents.font.size = 10 # 用語「HP/SP」の文字の大きさ
#      self.contents.font.color = Color.new(100,50,50,192)
#      self.contents.draw_text(actor_x-8, 77, 196, 24, $data_system.words.hp)
#      self.contents.draw_text(actor_x-8, 91, 196, 24, $data_system.words.sp)
#      self.contents.font.color = system_color # 用語「HP/SP」の文字の色
#      self.contents.draw_text(actor_x-10, 89, 196, 24, $data_system.words.hp)
#      self.contents.draw_text(actor_x-10, 93, 196, 24, $data_system.words.sp)
      # ステートの描写
      draw_actor_state(actor, actor_x, 100)
      # 値を更新
      @previous_hp = actor.hp
      @previous_hp = actor.hp
      @previous_hp = actor.hp
    end
  end
end
#==============================================================================
# ■ Window_Base
#==============================================================================
class Window_Base < Window
  #--------------------------------------------------------------------------
  # ● HPメーター の描画
  #--------------------------------------------------------------------------
  def draw_actor_hp_meter_line(actor, x, y, width = 156, height = 4)
    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+0, y+0, 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+0, y+0, 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+0, y+0, 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+0, y+0, 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)
  end
  #--------------------------------------------------------------------------
  # ● SPメーター の描画
  #--------------------------------------------------------------------------
  def draw_actor_sp_meter_line(actor, x, y, width = 156, height = 4)
    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+0, y+0, 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+0, y+0, 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+0, y+0, 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+0, y+0, 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)
  end
  #--------------------------------------------------------------------------
  # ● 名前の描画
  #--------------------------------------------------------------------------
  alias xrxs_bp7_draw_actor_name draw_actor_name
  def draw_actor_name(actor, x, y)
    xrxs_bp7_draw_actor_name(actor, x, y) if @draw_ban != true
  end
  #--------------------------------------------------------------------------
  # ● ステートの描画
  #--------------------------------------------------------------------------
  alias xrxs_bp7_draw_actor_state draw_actor_state
  def draw_actor_state(actor, x, y, width = 120)
    xrxs_bp7_draw_actor_state(actor, x, y, width) if @draw_ban != true
  end
  #--------------------------------------------------------------------------
  # ● HP の描画
  #--------------------------------------------------------------------------
  alias xrxs_bp7_draw_actor_hp draw_actor_hp
  def draw_actor_hp(actor, x, y, width = 144)
    xrxs_bp7_draw_actor_hp(actor, x, y, width) if @draw_ban != true
  end
  #--------------------------------------------------------------------------
  # ● SP の描画
  #--------------------------------------------------------------------------
  alias xrxs_bp7_draw_actor_sp draw_actor_sp
  def draw_actor_sp(actor, x, y, width = 144)
    xrxs_bp7_draw_actor_sp(actor, x, y, width) if @draw_ban != true
  end
end
#==============================================================================
# ■ Scene_Battle
#==============================================================================
class Scene_Battle
  #--------------------------------------------------------------------------
  # ● フレーム更新
  #--------------------------------------------------------------------------
  alias xrxs_bp7_update update
  def update
    xrxs_bp7_update
    # メッセージウィンドウ表示中の場合
    if $game_temp.message_window_showing
      @status_window.update_cp_only = true      
    else
      @status_window.update_cp_only = false
    end
  end
end
#==============================================================================
# ◇ 外部ライブラリ
#==============================================================================
class Window_Base
  #--------------------------------------------------------------------------
  # ● ライン描画 軽量版 by 桜雅 在土
  #--------------------------------------------------------------------------
  def draw_lineght(start_x, start_y, end_x, end_y, start_color)
    # 描写距離の計算。大きめに直角時の長さ。
    distance = (start_x - end_x).abs + (start_y - end_y).abs
    # 描写開始
    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
      self.contents.set_pixel(x, y, start_color)
    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. #==============================================================================
  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 + 82 #修改hp&mp血條的x座標位置
  54.       # 歩行キャラグラフィックの描写 - 修改臉圖位置
  55.       #draw_actor_face(actor, actor_x - 9, 60)
  56.       # HP/SPメーターの描写 - 修改hp&mp血條位置
  57.       draw_actor_hp_meter_line(actor, actor_x, 76, 46, 8)
  58.       draw_actor_sp_meter_line(actor, actor_x, 99, 46, 8)
  59.       # HP数値の描写
  60.       self.contents.font.size = 15 # HP/SP数値の文字の大きさ
  61.       self.contents.font.color = Color.new(0,0,0,192)
  62.       self.contents.draw_text(actor_x-51, 65, 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-50, 64, 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-49, 88, 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-50, 87, 96, 24, actor.sp.to_s, 2)
  72.       # 用語「HP」と用語「SP」の描写
  73. #      self.contents.font.size = 10 # 用語「HP/SP」の文字の大きさ
  74. #      self.contents.font.color = Color.new(100,50,50,192)
  75. #      self.contents.draw_text(actor_x-8, 77, 196, 24, $data_system.words.hp)
  76. #      self.contents.draw_text(actor_x-8, 91, 196, 24, $data_system.words.sp)
  77. #      self.contents.font.color = system_color # 用語「HP/SP」の文字の色
  78. #      self.contents.draw_text(actor_x-10, 89, 196, 24, $data_system.words.hp)
  79. #      self.contents.draw_text(actor_x-10, 93, 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+0, y+0, 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+0, y+0, 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+0, y+0, 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+0, y+0, 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+0, y+0, 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+0, y+0, 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+0, y+0, 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+0, y+0, 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. #==============================================================================
复制代码
選擇是隨時都在進行的~不同的選擇造就了不同的未來~即使在微小的事~也能產生改變未來漣漪~~~

Lv1.梦旅人

梦石
0
星屑
50
在线时间
28 小时
注册时间
2011-1-14
帖子
262
2
发表于 2012-1-6 20:58:38 | 只看该作者
本帖最后由 赤夜玄魔 于 2012-1-11 22:46 编辑
銀藍色的零 发表于 2012-1-11 21:26
已成功
不過還有一點問題
str顯示的數值要比實際數值少1
  1.        # STR数値の描写
  2.       self.contents.font.color = Color.new(0,0,0,192)
  3.       self.contents.draw_text(actor_x-49, 111, 96, 24, actor.str-1.to_s, 2)
  4.       self.contents.font.color = normal_color
  5.       self.contents.draw_text(actor_x-50, 110, 96, 24, actor.str-1.to_s, 2)

  6. 你这脚本的意思呢,是这样的 actor.str 这个是整数型,而 - 1.to_s 这个是 文本型,整数型-文本型,你让RMXP怎么计算呢?
  7. 你该这么写

  8.    str = actor.str - 1
  9.     self.contents.font.color = Color.new(0,0,0,192)
  10.       self.contents.draw_text(actor_x-49, 111, 96, 24, str.to_s, 2)
  11.       self.contents.font.color = normal_color
  12.       self.contents.draw_text(actor_x-50, 110, 96, 24, str.to_s, 2)
复制代码
话说,熟人变少了,还是马甲变多了?
我将乘风而去,万丈深渊。新生命阻止我的冲动……好吧,我再活一年,但是……这是最后的一年……
……强烈支持国产游戏……

遵冥冥之意,然果有奇效!
我好像玩够了,该走了……

强烈反对国产脑残动画片在电视台播出……
回复

使用道具 举报

Lv1.梦旅人

梦石
0
星屑
50
在线时间
28 小时
注册时间
2011-1-14
帖子
262
3
发表于 2012-1-7 01:45:24 | 只看该作者
本帖最后由 赤夜玄魔 于 2012-1-7 02:09 编辑

你弄错了,这个是战斗的血条,不是角色菜单状态的。。

  1. 你应该到……
  2. Window_Base
  3. 里面,找到
  4. parameter_value = actor.str
  5. 然后添加:
  6.       self.contents.fill_rect(x-1, y+27, 120+2,6, Color.new(0, 0, 0, 255))
  7.       w = 120 * actor.str / 999
  8.       self.contents.fill_rect(x, y+28, w,1, Color.new(255, 255, 128, 255))
  9.       self.contents.fill_rect(x, y+29, w,1, Color.new(192, 192, 0, 255))
  10.       self.contents.fill_rect(x, y+30, w,1, Color.new(128, 128, 0, 255))
  11.       self.contents.fill_rect(x, y+31, w,1, Color.new(0, 0, 0, 255))

  12. 就可以了,999是力量的最大值,由你自己来改吧。

  13. 当然,这样加也可以……



  14.    self.contents.fill_rect(x-1, y+27, 120+2,6, Color.new(0, 0, 0, 255))
  15.       w = 120 * parameter_value / 999
  16.       self.contents.fill_rect(x, y+28, w,1, Color.new(255, 255, 128, 255))
  17.       self.contents.fill_rect(x, y+29, w,1, Color.new(192, 192, 0, 255))
  18.       self.contents.fill_rect(x, y+30, w,1, Color.new(128, 128, 0, 255))
  19.       self.contents.fill_rect(x, y+31, w,1, Color.new(0, 0, 0, 255))

  20. 因为 parameter_value 在这里分别被定义成,力量,灵巧,魔法等属性

复制代码
话说,熟人变少了,还是马甲变多了?
我将乘风而去,万丈深渊。新生命阻止我的冲动……好吧,我再活一年,但是……这是最后的一年……
……强烈支持国产游戏……

遵冥冥之意,然果有奇效!
我好像玩够了,该走了……

强烈反对国产脑残动画片在电视台播出……
回复

使用道具 举报

Lv1.梦旅人

梦石
0
星屑
50
在线时间
113 小时
注册时间
2008-3-25
帖子
204
4
 楼主| 发表于 2012-1-7 16:23:12 | 只看该作者
我就是要在戰鬥中加~~~^^
選擇是隨時都在進行的~不同的選擇造就了不同的未來~即使在微小的事~也能產生改變未來漣漪~~~
回复

使用道具 举报

Lv1.梦旅人

梦石
0
星屑
80
在线时间
1730 小时
注册时间
2009-7-12
帖子
443
5
发表于 2012-1-8 02:41:40 | 只看该作者
把他原腳本裡的描繪方法CO出來,開新腳本貼上
  1. #==============================================================================
  2. # ◇ 外部ライブラリ
  3. #==============================================================================
  4. class Window_Base
  5.   #--------------------------------------------------------------------------
  6.   # ● ライン描画 軽量版 by 桜雅 在土
  7.   #--------------------------------------------------------------------------
  8.   def draw_lineght(start_x, start_y, end_x, end_y, start_color)
  9.     # 描写距離の計算。大きめに直角時の長さ。
  10.     distance = (start_x - end_x).abs + (start_y - end_y).abs
  11.     # 描写開始
  12.     for i in 1..distance
  13.       x = (start_x + 1.0 * (end_x - start_x) * i / distance).to_i
  14.       y = (start_y + 1.0 * (end_y - start_y) * i / distance).to_i
  15.       self.contents.set_pixel(x, y, start_color)
  16.     end
  17.   end
  18.   #--------------------------------------------------------------------------
  19.   # ● ライン描画 by 桜雅 在土
  20.   #--------------------------------------------------------------------------
  21.   def draw_line(start_x, start_y, end_x, end_y, start_color, width = 1, end_color = start_color)
  22.     # 描写距離の計算。大きめに直角時の長さ。
  23.     distance = (start_x - end_x).abs + (start_y - end_y).abs
  24.     # 描写開始
  25.     if end_color == start_color
  26.       for i in 1..distance
  27.         x = (start_x + 1.0 * (end_x - start_x) * i / distance).to_i
  28.         y = (start_y + 1.0 * (end_y - start_y) * i / distance).to_i
  29.         if width == 1
  30.           self.contents.set_pixel(x, y, start_color)
  31.         else
  32.           self.contents.fill_rect(x, y, width, width, start_color)
  33.         end
  34.       end
  35.     else
  36.       for i in 1..distance
  37.         x = (start_x + 1.0 * (end_x - start_x) * i / distance).to_i
  38.         y = (start_y + 1.0 * (end_y - start_y) * i / distance).to_i
  39.         r = start_color.red * (distance-i)/distance + end_color.red * i/distance
  40.         g = start_color.green * (distance-i)/distance + end_color.green * i/distance
  41.         b = start_color.blue * (distance-i)/distance + end_color.blue * i/distance
  42.         a = start_color.alpha * (distance-i)/distance + end_color.alpha * i/distance
  43.         if width == 1
  44.           self.contents.set_pixel(x, y, Color.new(r, g, b, a))
  45.         else
  46.           self.contents.fill_rect(x, y, width, width, Color.new(r, g, b, a))
  47.         end
  48.       end
  49.     end
  50.   end
  51. end
复制代码
然後到Window_Base下新增描繪項目
比如我要新增力量的
  1.   #-----------------------------------------------------------------------
  2.   # ● STR描画
  3.   #-----------------------------------------------------------------------
  4.   
  5.   #描繪方法名
  6.   def draw_actor_str_meter_line(actor, x, y, width = 81, height = 6)
  7.     # 描繪寬度,注意內容變量,力量的代碼為str,若要改成其他的請將代碼更改,力量的最大值為999,若不是請更改
  8.     w = width * actor.str / 999
  9.     # 力量條左邊漸變的顏色
  10.     str_color_1 = Color.new(80,0,0, 192)
  11.     # 力量條右邊漸變的顏色
  12.     str_color_2 = Color.new(240, 0, 0,192)
  13.     # 描繪條狀(這裡是我遊戲的畫法,仿RTAB的行動條((個人覺得較美觀
  14.     self.contents.fill_rect(x-1, y-2, width+9, (height+4).floor, Color.new(0, 0, 0, 222))
  15.     self.contents.fill_rect(x, y-1, width+7, (height+2).floor, Color.new(255, 255, 192, 192))
  16.     self.contents.fill_rect(x+1, y, width+5, height.floor, Color.new(0, 0, 0, 222))
  17.     #注意若你要描繪的不是力量的話這裡要修改
  18.     draw_line(x, y, x + w, y, str_color_1, (height).floor, str_color_2)
  19.      
  20.   end
复制代码
注意一下注釋

然後如果要用就使用這條函式
draw_actor_str_meter_line(actor, x, y)
如果高度或寬度要更改就使用
draw_actor_str_meter_line(actor, x, y, 你要的寬度, 你要的高度)

然後各屬性的代碼為下
攻擊力stk 物理防禦pdef 魔法防禦mdef 力量str 敏捷dex 速度agi 魔力int

那啥…我以為用戶名只是通行碼…
所以我暱稱不是serena718哈,是月見斐夜
回复

使用道具 举报

Lv1.梦旅人

梦石
0
星屑
50
在线时间
113 小时
注册时间
2008-3-25
帖子
204
6
 楼主| 发表于 2012-1-8 13:44:51 | 只看该作者
恩~以試驗
不過在戰鬥中並沒有出現耶?
選擇是隨時都在進行的~不同的選擇造就了不同的未來~即使在微小的事~也能產生改變未來漣漪~~~
回复

使用道具 举报

Lv1.梦旅人

梦石
0
星屑
50
在线时间
28 小时
注册时间
2011-1-14
帖子
262
7
发表于 2012-1-8 14:20:38 | 只看该作者
本帖最后由 赤夜玄魔 于 2012-1-11 00:22 编辑
銀藍色的零 发表于 2012-1-7 16:23
我就是要在戰鬥中加~~~^^


那你这脚本也不对啊,改得乱七八糟,我连进去都进不了。
你提取的时候就提取错了吧。
  1. #========================================================================
  2. # ■ Window_BattleStatus
  3. #========================================================================
  4. class Window_BattleStatus < Window_Base
  5.   #-----------------------------------------------------------------------
  6.   # ● 初始化
  7.   #-----------------------------------------------------------------------
  8.   alias xrxs_bp2_refresh refresh
  9.   def refresh
  10.     xrxs_bp2_refresh
  11.     @item_max = $game_party.actors.size
  12.     for i in 0...$game_party.actors.size
  13.       actor = $game_party.actors[i]
  14.       actor_x = i * 160 + 4
  15.       draw_actor_hp_meter(actor, actor_x, 32, 120)
  16.       draw_actor_sp_meter(actor, actor_x, 64, 120)
  17.       draw_actor_str(actor, actor_x, 96, 120)
  18.     end
  19.   end
  20. end
  21. #========================================================================
  22. # ■ Window_Base
  23. #========================================================================
  24. class Window_Base < Window
  25.   #-----------------------------------------------------------------------
  26.   # ● HP描画
  27.   #-----------------------------------------------------------------------
  28.   def draw_actor_hp_meter(actor, x, y, width = 156, type = 0)
  29.     if type == 1 and actor.hp == 0
  30.       return
  31.     end
  32.     self.contents.font.color = system_color
  33.     self.contents.fill_rect(x-1, y+27, width+2,6, Color.new(0, 0, 0, 255))
  34.     w = width * actor.hp / [actor.maxhp,1].max
  35.     self.contents.fill_rect(x, y+28, w,1, Color.new(255, 96, 96, 255))
  36.     self.contents.fill_rect(x, y+29, w,1, Color.new(255, 0, 0, 255))
  37.     self.contents.fill_rect(x, y+30, w,1, Color.new(128, 0, 0, 255))
  38.     self.contents.fill_rect(x, y+31, w,1, Color.new(0, 0, 0, 255))
  39.   end
  40.   #-----------------------------------------------------------------------
  41.   # ● SP描画
  42.   #-----------------------------------------------------------------------
  43.   def draw_actor_sp_meter(actor, x, y, width = 156, type = 0)
  44.     if type == 1 and actor.hp == 0
  45.       return
  46.     end
  47.     self.contents.font.color = system_color
  48.     self.contents.fill_rect(x-1, y+27, width+2,6, Color.new(0, 0, 0, 255))
  49.     w = width * actor.sp / [actor.maxsp,1].max
  50.     self.contents.fill_rect(x, y+28, w,1, Color.new(128, 255, 255, 255))
  51.     self.contents.fill_rect(x, y+29, w,1, Color.new(0, 255, 255, 255))
  52.     self.contents.fill_rect(x, y+30, w,1, Color.new(0, 192, 192, 255))
  53.     self.contents.fill_rect(x, y+31, w,1, Color.new(0, 128, 128, 255))
  54.   end
  55.   #-----------------------------------------------------------------------
  56.   # ● 力量描画
  57.   #-----------------------------------------------------------------------
  58.   def draw_actor_str(actor, x, y, width = 156, type = 0)
  59.     if type == 1 and actor.hp == 0
  60.       return
  61.     end
  62.     self.contents.font.color = system_color
  63.     self.contents.fill_rect(x-1, y+27, width+2,6, Color.new(0, 0, 0, 255))
  64.     w = width * actor.str/ [999,1].max
  65.     self.contents.fill_rect(x, y+28, w,1, Color.new(255, 255, 128, 255))
  66.     self.contents.fill_rect(x, y+29, w,1, Color.new(192, 192, 0, 255))
  67.     self.contents.fill_rect(x, y+30, w,1, Color.new(128, 128, 0, 255))
  68.     self.contents.fill_rect(x, y+31, w,1, Color.new(0, 0, 0, 255))
  69.   end
  70. end
  71. #========================================================================
  72. # 本脚本来自www.66RPG.com,使用和转载请保留此信息
  73. #========================================================================
复制代码
话说,熟人变少了,还是马甲变多了?
我将乘风而去,万丈深渊。新生命阻止我的冲动……好吧,我再活一年,但是……这是最后的一年……
……强烈支持国产游戏……

遵冥冥之意,然果有奇效!
我好像玩够了,该走了……

强烈反对国产脑残动画片在电视台播出……
回复

使用道具 举报

Lv1.梦旅人

梦石
0
星屑
50
在线时间
113 小时
注册时间
2008-3-25
帖子
204
8
 楼主| 发表于 2012-1-8 14:48:54 | 只看该作者
呵呵呵~
紅色的部份就是我加的
就是亂加才改不出來
所以我才開懸賞呀!
選擇是隨時都在進行的~不同的選擇造就了不同的未來~即使在微小的事~也能產生改變未來漣漪~~~
回复

使用道具 举报

Lv1.梦旅人

梦石
0
星屑
50
在线时间
28 小时
注册时间
2011-1-14
帖子
262
9
发表于 2012-1-8 23:01:39 | 只看该作者
銀藍色的零 发表于 2012-1-8 14:48
呵呵呵~
紅色的部份就是我加的
就是亂加才改不出來

晕,那你也该把原来的脚本发过来,让我们提取然后加上力量条不就行了吗。
话说,熟人变少了,还是马甲变多了?
我将乘风而去,万丈深渊。新生命阻止我的冲动……好吧,我再活一年,但是……这是最后的一年……
……强烈支持国产游戏……

遵冥冥之意,然果有奇效!
我好像玩够了,该走了……

强烈反对国产脑残动画片在电视台播出……
回复

使用道具 举报

Lv1.梦旅人

梦石
0
星屑
50
在线时间
33 小时
注册时间
2011-1-18
帖子
16
10
发表于 2012-1-9 20:17:29 | 只看该作者
首先你没有定义draw_actor_str_meter_line,但是开头又用了,这样条子当然出不来。把draw_actor_hp_meter_line的定义复制了改名成str的话这里应该没问题。
  1. # str数値の描写
  2.       self.contents.font.color = Color.new(0,0,0,192)
  3.       self.contents.draw_text(actor_x-49, 88, 96, 24, actor.str_plus.to_s, 2)
  4.       self.contents.font.color = actor.str == 0 ? knockout_color :
  5.       actor.str <= actor.str_plus / 4 ? crisis_color : normal_color
  6.       self.contents.draw_text(actor_x-50, 87, 96, 24, actor.dex.to_s,2)
复制代码
然后这里我看不出你想表达什么,因为上下的Draw_text是为了描绘带阴影的文字的所以两个都显示同一个字段,但是LZ却一个显示str_plus,一个显示dex,这样当然不行。还有坐标也要改否则会叠在一起。
回复

使用道具 举报

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

本版积分规则

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

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

GMT+8, 2024-4-30 04:22

Powered by Discuz! X3.1

© 2001-2013 Comsenz Inc.

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