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

Project1

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

[已经解决] 分类的敌人图鉴脚本出错……

[复制链接]

Lv1.梦旅人

梦石
0
星屑
48
在线时间
331 小时
注册时间
2012-5-4
帖子
158
跳转到指定楼层
1
发表于 2012-11-25 12:11:46 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式

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

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

x
本帖最后由 wshzya 于 2012-11-25 21:21 编辑

就是那个有“异兽”“杂兵”分类的图鉴
窗口305行
draw_gauge(x+96, y, width - 96, @percentage.to_f/100,
class Window_EnemyType < Window_HorzCommand
  include Snstar::EnemyList
  #--------------------------------------------------------------------------
  # ● 初始化
  #--------------------------------------------------------------------------
  def initialize(x, y, min_height=48)
    super(x, y)
    @min_height = min_height
    @max_height = window_height
  end
  #--------------------------------------------------------------------------
  # ● 定义窗口宽度
  #--------------------------------------------------------------------------
  def window_width
    Graphics.width
  end
  #--------------------------------------------------------------------------
  # ● 定义栏数
  #--------------------------------------------------------------------------
  def col_max
    return 6
  end
  #--------------------------------------------------------------------------
  # ● 窗口更新
  #--------------------------------------------------------------------------
  def update
    super
    @item_window.category = current_symbol if @item_window
  end
  #--------------------------------------------------------------------------
  # ● 绘制敌人类型列表
  #--------------------------------------------------------------------------
  def make_command_list
    add_command(ALL_CATEGORY_TEXT, :all) if INCLUDE_ALL_CATEGORY
    ENEMY_TYPE.each{ |type|
      add_command(type, type.to_sym)
    }
  end
  #--------------------------------------------------------------------------
  # ● 设置敌人列表窗口
  #--------------------------------------------------------------------------
  def item_window=(item_window)
    @item_window = item_window
    update
  end
  #--------------------------------------------------------------------------
  # ● 窗口有效化
  #--------------------------------------------------------------------------
  def activate
    super
    return unless @max_height
    self.height = @max_height
  end
  #--------------------------------------------------------------------------
  # ● 窗口失效
  #--------------------------------------------------------------------------
  def deactivate
    super
    return unless @min_height
    self.height = @min_height
    @item_window.select_last_index
  end
end
class Window_EnemyList < Window_ItemList
  include Snstar::EnemyList
  #--------------------------------------------------------------------------
  # ● 初始化
  #--------------------------------------------------------------------------
  def initialize(x, y, width, height)
    super(x, y, width, height)
    @last_index = {}
  end
  #--------------------------------------------------------------------------
  # ● 选择上次索引
  #--------------------------------------------------------------------------
  def select_last_index
    select(@last_index[@category])
  end
  def select(index)
    super(index)
    @info_window.enemy = @data[@index]
  end
  #--------------------------------------------------------------------------
  # ● 窗口失效
  #--------------------------------------------------------------------------
  def deactivate
    super
    return unless @last_index
    @last_index[@category] = @index # 纪录当前敌人类型的索引
  end
  #--------------------------------------------------------------------------
  # ● 最大栏数
  #--------------------------------------------------------------------------
  def col_max
    return 1
  end
  #--------------------------------------------------------------------------
  # ● 生成敌人列表
  #--------------------------------------------------------------------------
  def make_item_list
    @data = []
    @last_index[@category] = 0 if @last_index[@category].nil?
    selected_type = ENEMY_TYPE.index(@category.to_s)
    $data_enemies.each{ |enemy|
      next if enemy.nil?
      next if enemy.name == "" # 名字为空的敌人跳过
      next if enemy.no_list? # 指定不列入的敌人跳过
      if @category == :all or (enemy.list_type == selected_type)
        @data.push(enemy)
      end
    }
  end
  #--------------------------------------------------------------------------
  # ● 绘制敌人项目
  #--------------------------------------------------------------------------
  def draw_item(index)
    item = @data[index]
    if item
      rect = item_rect(index)
      rect.width -= 4
      draw_item_name(item, rect.x, rect.y)
    end
  end
  #--------------------------------------------------------------------------
  # ● 绘制敌人名称
  #--------------------------------------------------------------------------
  def draw_item_name(item, x, y, enabled = true, width = 172)
    return unless item
    if DRAW_ENEMY_ICON
      draw_icon(item.icon_index, x, y, enabled)
      x += 24
    end
    change_color(normal_color, enabled)
    per = $game_party.enemy_percent(item.id)
    if  per >= NAME_DISPLAY_PERC
      text = item.name
    else
      text = NO_DISPLAY_MASK
    end
    draw_text(x, y, width, line_height, text)
  end
  #--------------------------------------------------------------------------
  # ● 资讯窗口更新
  #--------------------------------------------------------------------------
  def update_info
    @info_window.set_item(item)
  end
  #--------------------------------------------------------------------------
  # ● 设置资讯窗口
  #--------------------------------------------------------------------------
  def info_window=(info_window)
    @info_window = info_window
    #call_update_info
  end
end
class Window_EnemyDetail < Window_Base
  include Snstar::EnemyList
  attr_reader :enemy
  #--------------------------------------------------------------------------
  # ● 初始化
  #--------------------------------------------------------------------------
  def initialize
    super(160, 48, Graphics.width-160, Graphics.height-48)
    @enemy = nil
  end
  #--------------------------------------------------------------------------
  # ● 设置当前敌人
  #--------------------------------------------------------------------------
  def enemy=(e)
    @enemy = e
    if enemy
      @percentage = $game_party.enemy_percent(e.id) # 获取当前敌人辨识度
    else
      @percentage = 0
    end
    refresh
  end
  #--------------------------------------------------------------------------
  # ● 检查当前辨识度百分比
  #--------------------------------------------------------------------------
  def checkPercent?(per)
    return @percentage >= per
  end
  #--------------------------------------------------------------------------
  # ● 窗口刷新
  #--------------------------------------------------------------------------
  def refresh
    contents.clear
    return unless @enemy # 无敌人时返回
    return unless checkPercent?(NAME_DISPLAY_PERC) # 不显示名称时返回
    @partial = false
    draw_enemy_image(0, 0) # 绘制敌人图像
    draw_enemy_name(0, ENEMY_IMAGE_MAX_HEIGHT) # 绘制敌人名称
    draw_enemy_features(0, ENEMY_IMAGE_MAX_HEIGHT+line_height)
    draw_enemy_percentage(0, ENEMY_IMAGE_MAX_HEIGHT+line_height*5) # 绘制敌人辨识度
    partial_refresh
  end
  #--------------------------------------------------------------------------
  # ● 窗口半刷新
  #--------------------------------------------------------------------------
  def partial_refresh
    return unless @enemy # 无敌人时返回
    rect = Rect.new(ENEMY_IMAGE_MAX_WIDTH+8, 0,
      contents.width-(ENEMY_IMAGE_MAX_WIDTH+8), contents.height-line_height)
    contents.clear_rect(rect)
    if ENEMY_MORE_INFO && @partial
      Sound.play_cursor
      draw_other_info
      @partial = false
    else
      draw_enemy_hp(ENEMY_IMAGE_MAX_WIDTH+8, 0) # 绘制敌人体力
      draw_enemy_mp(ENEMY_IMAGE_MAX_WIDTH+8, line_height) # 绘制敌人魔力
      2.upto(7){ |n|
        draw_enemy_param(ENEMY_IMAGE_MAX_WIDTH+8, line_height*n, n) # 绘制敌人能力
      }
      draw_enemy_gold(ENEMY_IMAGE_MAX_WIDTH+8, line_height*8) # 绘制敌人掉落金
      draw_enemy_item(ENEMY_IMAGE_MAX_WIDTH+8, line_height*9) # 绘制敌人掉落物
      @partial = true
    end
  end
  #--------------------------------------------------------------------------
  # ● 绘制敌人特征
  #--------------------------------------------------------------------------
  def draw_enemy_features(x, y)
    fy = y
    for i in 0..4 do
      feature = @enemy.features
      next unless feature
      label, value = get_feature(feature)
      next if label==""
      change_color(system_color)
      draw_text(x, fy, text_width(label), line_height, label)
      change_color(normal_color)
      draw_text(x+72, fy, text_width(value), line_height, value)
      fy+=line_height
    end
  end
  #--------------------------------------------------------------------------
  # ● 获取敌人特征
  #--------------------------------------------------------------------------
  def get_feature(feature)
    code = feature.code
    id = feature.data_id
    value = feature.value
    return "", 0 unless [11, 31].include?(code)
    if code == 11
      if value < 1.0
        label = FEA_RES_ELE_RATE
      elsif value > 1.0
        label = FEA_WEAK_ELE_RATE
      else
        return "", 0
      end
      element = $data_system.elements[id]
      return_value = element + " #{value.truncate}倍"
    elsif code == 31
      label = FEA_ATK_ELEMENT
      return_value = $data_system.elements[id]
    end
    return label, return_value
  end
  #--------------------------------------------------------------------------
  # ● 绘制敌人图像
  #--------------------------------------------------------------------------
  def draw_enemy_image(x, y)
    image_name = @enemy.list_image # 获取指定图像
    if image_name.nil? # 指定图像为空时
      image = Cache.battler(@enemy.battler_name, @enemy.battler_hue) # 获取战斗图
    else
      hue = ENEMY_HUE_SYNC_DB ? @enemy.battler_hue : 0
      image = Cache.load_bitmap(ENEMY_IMAGE_FOLDER, image_name, hue) # 获取战斗图
    end
   
    ix = (image.width/2-ENEMY_IMAGE_MAX_WIDTH/2).abs  # 获取中心点
    # 敌人图像宽度在显示范围外
    if image.width > ENEMY_IMAGE_MAX_WIDTH
      # 居中对齐
      rx = ix
      cx = x
    # 敌人图像宽度在显示范围外
    else
      # 居中对齐
      rx = 0
      cx = ix
    end
    # 敌人图像高度在显示范围外
    if image.height > ENEMY_IMAGE_MAX_HEIGHT
      cy = y
    # 敌人图像高度在显示范围内
    else
      cy = ENEMY_IMAGE_MAX_HEIGHT - image.height - 8 # 向下对齐
    end
    rect = Rect.new(rx, 0, ENEMY_IMAGE_MAX_WIDTH, ENEMY_IMAGE_MAX_HEIGHT)
    contents.blt(cx, cy, image, rect, 255)
  end
  #--------------------------------------------------------------------------
  # ● 绘制敌人辨识度
  #--------------------------------------------------------------------------
  def draw_enemy_percentage(x, y)
    width = contents.width
    change_color(system_color)
    text = ENEMY_PERCENT_VOCAB
    draw_text(x, y, text_width(text), line_height, text)
    # 绘制辨识度进度槽
    draw_gauge(x+96, y, width - 96, @percentage.to_f/100,
      ENEMY_PERCENT_BASE_COLOR, ENEMY_PERCENT_FILL_COLOR)
    # 绘制百分比
    change_color(normal_color)
    text = "#{@percentage}%"
    draw_text(x+96, y, text_width(text), line_height, text)
  end
  #--------------------------------------------------------------------------
  # ● 绘制敌人名称
  #--------------------------------------------------------------------------
  def draw_enemy_name(x, y)
    change_color(system_color)
    text = "名称"
    draw_text(x, y, text_width(text), line_height, text)
    # 绘制名称
    change_color(normal_color)
    text = @enemy.name
    draw_text(x+72, y, text_width(text), line_height, text)
  end
  #--------------------------------------------------------------------------
  # ● 绘制敌人体力
  #--------------------------------------------------------------------------
  def draw_enemy_hp(x, y)
    change_color(system_color)
    text = Vocab::hp
    draw_text(x, y, 108, line_height, text)
    change_color(normal_color)
    hp = @enemy.params[0]
    # 判断显示百分比
    if checkPercent?(HP_DISPLAY_PERC)
      text = hp
    elsif checkPercent?(HP_EST_DISPLAY_PERC)
      # 计算体力约值
      ahp = [(hp/10) * 10 - @enemy.params[3], 10].max
      text = sprintf(EST_DISPLAY_MASK, ahp)
    else
      text = NO_DISPLAY_MASK
    end
    draw_text(x+72, y, text_width(text), line_height, text)
  end
  #--------------------------------------------------------------------------
  # ● 绘制敌人魔力
  #--------------------------------------------------------------------------
  def draw_enemy_mp(x, y)
    change_color(system_color)
    text = Vocab::mp
    draw_text(x, y, 108, line_height, text)
    change_color(normal_color)
    mp = @enemy.params[1]
    # 判断显示百分比
    if checkPercent?(MP_DISPLAY_PERC)
      text = mp
    elsif checkPercent?(MP_EST_DISPLAY_PERC)
      # 计算魔力约值
      amp = [(mp/10) * 10 - @enemy.params[5], @enemy.params[4], 5].max
      text = sprintf(EST_DISPLAY_MASK, amp)
    else
      text = NO_DISPLAY_MASK
    end
    draw_text(x+72, y, text_width(text), line_height, text)
  end
  #--------------------------------------------------------------------------
  # ● 绘制敌人能力值
  #--------------------------------------------------------------------------
  def draw_enemy_param(x, y, param_id)
    # 能力值ID为1或2时,调用绘制体力/魔力方法
    draw_enemy_hp(x, y) if param_id==0
    draw_enemy_mp(x, y) if param_id==1
    return if param_id < 2
    change_color(system_color)
    # 绘制能力值名称
    draw_text(x, y, 108, line_height, Vocab::param(param_id))
    change_color(normal_color)
    # 获取能力值百分比
    param_percent = [ATK_DISPLAY_PERC, DEF_DISPLAY_PERC, MAT_DISPLAY_PERC,
                     MDF_DISPLAY_PERC, AGI_DISPLAY_PERC, LUK_DISPLAY_PERC ]
    # 判断显示百分比
    if checkPercent?(param_percent[param_id-2])
      text = @enemy.params[param_id]
    else
      text = NO_DISPLAY_MASK
    end
    draw_text(x+72, y, text_width(text), line_height, text)
  end
  #--------------------------------------------------------------------------
  # ● 绘制敌人掉落金钱
  #--------------------------------------------------------------------------
  def draw_enemy_gold(x, y)
    change_color(system_color)
    draw_text(x, y, 96, line_height, DROP_GOLD_VOCAB)
    change_color(normal_color)
    # 判断显示百分比
    if checkPercent?(GOLD_DISPLAY_PERC)
      draw_currency_value(@enemy.gold, Vocab.currency_unit, x+12, y, 108)
    else
      draw_text(x+72, y, 96, line_height, NO_DISPLAY_MASK)
    end
  end
  #--------------------------------------------------------------------------
  # ● 绘制敌人掉落物
  #--------------------------------------------------------------------------
  def draw_enemy_item(x, y)
    change_color(system_color)
    draw_text(x, y, 96, line_height, DROP_ITEM_VOCAB)
    change_color(normal_color)
    # 判断显示百分比
    if checkPercent?(ITEM_DISPLAY_PERC)
      nn_di = 0
      for i in 0..2 do
        di = item_object(@enemy.drop_items) # 获取掉落物物件
        if di
          ly = y+line_height*(nn_di+1) # 计算绘制高度
          draw_item_name(di, x+24, ly)
          nn_di += 1 # 计数器+1
        end
      end
      return if nn_di > 0 # 计数器大于0时返回
      draw_text(x+80, y, 96, line_height, "无")
    else
      draw_text(x+24, y+line_height, 96, line_height, NO_DISPLAY_MASK)
    end
  end
  #--------------------------------------------------------------------------
  # ● 计算敌人掉落物
  #--------------------------------------------------------------------------
  def item_object(drop_item)
    kind = drop_item.kind
    data_id = drop_item.data_id
    return $data_items  [data_id] if kind == 1
    return $data_weapons[data_id] if kind == 2
    return $data_armors [data_id] if kind == 3
    return nil
  end
  #--------------------------------------------------------------------------
  # ● 绘制其他资讯
  #--------------------------------------------------------------------------
  def draw_other_info
   
  end
  #--------------------------------------------------------------------------
  # ● 获得文字宽度
  #--------------------------------------------------------------------------
  def text_width(text)
    return text_size(text).width + 5
  end
end
出现 ArgumentError.
wroung number for arguments (6 for 8)
求指教~~

Lv1.梦旅人

梦石
0
星屑
50
在线时间
270 小时
注册时间
2010-2-4
帖子
1305
2
发表于 2012-11-25 14:16:14 | 只看该作者
- -b目测是脚本冲突,你搜索下有没有含有def draw_gauge字样的脚本,有的话把那个删掉就ok了...

点评

就是介个鸟……  发表于 2012-11-25 21:22
咋没最佳答案了…………  发表于 2012-11-25 21:22
好歹当年也当过大魔王过,orz
回复 支持 反对

使用道具 举报

Lv1.梦旅人

梦石
0
星屑
48
在线时间
331 小时
注册时间
2012-5-4
帖子
158
3
 楼主| 发表于 2012-11-25 21:20:24 | 只看该作者
本帖最后由 wshzya 于 2012-11-25 21:26 编辑
  1. #_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/
  2. #_/    ◆ 汎用ゲージ描画 - KMS_GenericGauge ◆ VX Ace ◆
  3. #_/    ◇ Last update : 2012/01/22 (TOMY@Kamesoft) ◇
  4. #_/----------------------------------------------------------------------------
  5. #_/  汎用的なゲージ描画機能を提供します。
  6. #_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/

  7. #==============================================================================
  8. # ★ 設定項目 - BEGIN Setting ★
  9. #==============================================================================

  10. module KMS_GenericGauge
  11.   # ◆ ゲージ画像
  12.   #  "Graphics/System" から読み込む。
  13.   HP_IMAGE  = "GaugeHP"   # HP
  14.   MP_IMAGE  = "GaugeMP"   # MP
  15.   TP_IMAGE  = "GaugeTP"   # TP
  16.   EXP_IMAGE = "GaugeEXP"  # EXP

  17.   # ◆ ゲージ位置補正 [x, y]
  18.   HP_OFFSET  = [-23, -2]  # HP
  19.   MP_OFFSET  = [-23, -2]  # MP
  20.   TP_OFFSET  = [-23, -2]  # TP
  21.   EXP_OFFSET = [-23, -2]  # EXP

  22.   # ◆ ゲージ長補正
  23.   HP_LENGTH  = -4  # HP
  24.   MP_LENGTH  = -4  # MP
  25.   TP_LENGTH  = -4  # TP
  26.   EXP_LENGTH = -4  # EXP

  27.   # ◆ ゲージの傾き角度
  28.   #  -89 ~ 89 で指定。
  29.   HP_SLOPE  = 0  # HP
  30.   MP_SLOPE  = 0  # MP
  31.   TP_SLOPE  = 0  # TP
  32.   EXP_SLOPE = 0  # EXPe
  33. end

  34. #==============================================================================
  35. # ☆ 設定ここまで - END Setting ☆
  36. #==============================================================================

  37. $kms_imported = {} if $kms_imported == nil
  38. $kms_imported["GenericGauge"] = true

  39. # *****************************************************************************

  40. #==============================================================================
  41. # ■ Bitmap
  42. #==============================================================================

  43. class Bitmap
  44.   #--------------------------------------------------------------------------
  45.   # ○ 平行四辺形転送
  46.   #--------------------------------------------------------------------------
  47.   def skew_blt(x, y, src_bitmap, src_rect, slope, opacity = 255)
  48.     slope = [[slope, -90].max, 90].min
  49.     sh    = src_rect.height
  50.     off  = sh / Math.tan(Math::PI * (90 - slope.abs) / 180.0)
  51.     if slope >= 0
  52.       dx   = x + off.round
  53.       diff = -off / sh
  54.     else
  55.       dx   = x
  56.       diff = off / sh
  57.     end
  58.     rect = Rect.new(src_rect.x, src_rect.y, src_rect.width, 1)

  59.     sh.times { |i|
  60.       blt(dx + (diff * i).round, y + i, src_bitmap, rect, opacity)
  61.       rect.y += 1
  62.     }
  63.   end
  64. end unless $kms_imported["BitmapExtension"]  # ビットマップ拡張未導入時のみ

  65. #==============================================================================
  66. # ■ Game_Actor
  67. #==============================================================================

  68. class Game_Actor < Game_Battler
  69.   #--------------------------------------------------------------------------
  70.   # ○ 現在のレベルから次のレベルまでの全必要経験値取得
  71.   #--------------------------------------------------------------------------
  72.   def next_level_exp_full
  73.     return next_level_exp - current_level_exp
  74.   end
  75.   #--------------------------------------------------------------------------
  76.   # ○ 次のレベルまでの残り経験値取得
  77.   #--------------------------------------------------------------------------
  78.   def next_level_exp_rest
  79.     return next_level_exp - exp
  80.   end
  81.   #--------------------------------------------------------------------------
  82.   # ○ 次のレベルまでの経験値取得率取得
  83.   #--------------------------------------------------------------------------
  84.   def exp_rate
  85.     diff = [next_level_exp_full, 1].max
  86.     rest = [next_level_exp_rest, 1].max
  87.     return (diff - rest) * 1.0 / diff
  88.   end
  89. end

  90. #==============================================================================
  91. # ■ Window_Base
  92. #==============================================================================

  93. class Window_Base < Window
  94.   #--------------------------------------------------------------------------
  95.   # ○ 定数
  96.   #--------------------------------------------------------------------------
  97.   # ゲージ転送元座標 [x, y]
  98.   GAUGE_SRC_POS = {
  99.     :normal   => [ 0, 24],
  100.     :decrease => [ 0, 48],
  101.     :increase => [72, 48],
  102.   }
  103.   #--------------------------------------------------------------------------
  104.   # ○ クラス変数
  105.   #--------------------------------------------------------------------------
  106.   @@__gauge_buf = Bitmap.new(320, 24)
  107.   #--------------------------------------------------------------------------
  108.   # ● オブジェクト初期化
  109.   #     x       : ウィンドウの X 座標
  110.   #     y       : ウィンドウの Y 座標
  111.   #     width   : ウィンドウの幅
  112.   #     height  : ウィンドウの高さ
  113.   #--------------------------------------------------------------------------
  114.   alias initialize_KMS_GenericGauge initialize
  115.   def initialize(x, y, width, height)
  116.     initialize_KMS_GenericGauge(x, y, width, height)

  117.     @@__gauge_buf = Bitmap.new(320, 24) if @@__gauge_buf.disposed?
  118.   end
  119.   #--------------------------------------------------------------------------
  120.   # ○ ゲージ描画
  121.   #     file       : ゲージ画像ファイル名
  122.   #     x, y       : 描画先 X, Y 座標
  123.   #     width      : 幅
  124.   #     ratio      : 割合
  125.   #     offset     : 座標調整 [x, y]
  126.   #     len_offset : 長さ調整
  127.   #     slope      : 傾き
  128.   #     gauge_type : ゲージタイプ
  129.   #--------------------------------------------------------------------------
  130.   def draw_gauge(file, x, y, width, ratio, offset, len_offset, slope,
  131.                  gauge_type = :normal)
  132.     img    = Cache.system(file)
  133.     x     += offset[0]
  134.     y     += offset[1]
  135.     width += len_offset
  136.     draw_gauge_base(img, x, y, width, slope)
  137.     gw = (width * ratio).to_i
  138.     draw_gauge_bar(img, x, y, width, gw, slope, GAUGE_SRC_POS[gauge_type])
  139.   end
  140.   #--------------------------------------------------------------------------
  141.   # ○ ゲージベース描画
  142.   #     img   : ゲージ画像
  143.   #     x, y  : 描画先 X, Y 座標
  144.   #     width : 幅
  145.   #     slope : 傾き
  146.   #--------------------------------------------------------------------------
  147.   def draw_gauge_base(img, x, y, width, slope)
  148.     rect = Rect.new(0, 0, 24, 24)
  149.     if slope != 0
  150.       contents.skew_blt(x, y, img, rect, slope)
  151.       rect.x = 96
  152.       contents.skew_blt(x + width + 24, y, img, rect, slope)

  153.       rect.x     = 24
  154.       rect.width = 72
  155.       dest_rect = Rect.new(0, 0, width, 24)
  156.       @@__gauge_buf.clear
  157.       @@__gauge_buf.stretch_blt(dest_rect, img, rect)
  158.       contents.skew_blt(x + 24, y, @@__gauge_buf, dest_rect, slope)
  159.     else
  160.       contents.blt(x, y, img, rect)
  161.       rect.x = 96
  162.       contents.blt(x + width + 24, y, img, rect)
  163.       rect.x     = 24
  164.       rect.width = 72
  165.       dest_rect = Rect.new(x + 24, y, width, 24)
  166.       contents.stretch_blt(dest_rect, img, rect)
  167.     end
  168.   end
  169.   #--------------------------------------------------------------------------
  170.   # ○ ゲージ内部描画
  171.   #     img     : ゲージ画像
  172.   #     x, y    : 描画先 X, Y 座標
  173.   #     width   : 全体幅
  174.   #     gw      : 内部幅
  175.   #     slope   : 傾き
  176.   #     src_pos : 転送元座標 [x, y]
  177.   #     start   : 開始位置
  178.   #--------------------------------------------------------------------------
  179.   def draw_gauge_bar(img, x, y, width, gw, slope, src_pos, start = 0)
  180.     rect = Rect.new(src_pos[0], src_pos[1], 72, 24)
  181.     dest_rect = Rect.new(0, 0, width, 24)
  182.     @@__gauge_buf.clear
  183.     @@__gauge_buf.stretch_blt(dest_rect, img, rect)
  184.     dest_rect.x     = start
  185.     dest_rect.width = gw
  186.     x += start
  187.     if slope != 0
  188.       contents.skew_blt(x + 24, y, @@__gauge_buf, dest_rect, slope)
  189.     else
  190.       contents.blt(x + 24, y, @@__gauge_buf, dest_rect)
  191.     end
  192.   end
  193.   #--------------------------------------------------------------------------
  194.   # ● HP の描画
  195.   #--------------------------------------------------------------------------
  196.   def draw_actor_hp(actor, x, y, width = 124)
  197.     draw_actor_hp_gauge(actor, x, y, width)
  198.     change_color(system_color)
  199.     draw_text(x, y, 30, line_height, Vocab::hp_a)
  200.     draw_current_and_max_values(x, y, width, actor.hp, actor.mhp,
  201.       hp_color(actor), normal_color)
  202.   end
  203.   #--------------------------------------------------------------------------
  204.   # ● MP の描画
  205.   #--------------------------------------------------------------------------
  206.   def draw_actor_mp(actor, x, y, width = 124)
  207.     draw_actor_mp_gauge(actor, x, y, width)
  208.     change_color(system_color)
  209.     draw_text(x, y, 30, line_height, Vocab::mp_a)
  210.     draw_current_and_max_values(x, y, width, actor.mp, actor.mmp,
  211.       mp_color(actor), normal_color)
  212.   end
  213.   #--------------------------------------------------------------------------
  214.   # ● TP の描画
  215.   #--------------------------------------------------------------------------
  216.   def draw_actor_tp(actor, x, y, width = 124)
  217.     draw_actor_tp_gauge(actor, x, y, width)
  218.     change_color(system_color)
  219.     draw_text(x, y, 30, line_height, Vocab::tp_a)
  220.     change_color(tp_color(actor))
  221.     draw_text(x + width - 42, y, 42, line_height, actor.tp.to_i, 2)
  222.   end
  223.   #--------------------------------------------------------------------------
  224.   # ○ HP ゲージの描画
  225.   #     actor : アクター
  226.   #     x, y  : 描画先 X, Y 座標
  227.   #     width : 幅
  228.   #--------------------------------------------------------------------------
  229.   def draw_actor_hp_gauge(actor, x, y, width = 120)
  230.     draw_gauge(KMS_GenericGauge::HP_IMAGE,
  231.       x, y, width, actor.hp_rate,
  232.       KMS_GenericGauge::HP_OFFSET,
  233.       KMS_GenericGauge::HP_LENGTH,
  234.       KMS_GenericGauge::HP_SLOPE
  235.     )
  236.   end
  237.   #--------------------------------------------------------------------------
  238.   # ○ MP ゲージの描画
  239.   #     actor : アクター
  240.   #     x, y  : 描画先 X, Y 座標
  241.   #     width : 幅
  242.   #--------------------------------------------------------------------------
  243.   def draw_actor_mp_gauge(actor, x, y, width = 120)
  244.     draw_gauge(KMS_GenericGauge::MP_IMAGE,
  245.       x, y, width, actor.mp_rate,
  246.       KMS_GenericGauge::MP_OFFSET,
  247.       KMS_GenericGauge::MP_LENGTH,
  248.       KMS_GenericGauge::MP_SLOPE
  249.     )
  250.   end
  251.   #--------------------------------------------------------------------------
  252.   # ○ TP ゲージの描画
  253.   #     actor : アクター
  254.   #     x, y  : 描画先 X, Y 座標
  255.   #     width : 幅
  256.   #--------------------------------------------------------------------------
  257.   def draw_actor_tp_gauge(actor, x, y, width = 120)
  258.     draw_gauge(KMS_GenericGauge::TP_IMAGE,
  259.       x, y, width, actor.tp_rate,
  260.       KMS_GenericGauge::TP_OFFSET,
  261.       KMS_GenericGauge::TP_LENGTH,
  262.       KMS_GenericGauge::TP_SLOPE
  263.     )
  264.   end
  265.   #--------------------------------------------------------------------------
  266.   # ○ Exp の描画
  267.   #     actor : アクター
  268.   #     x, y  : 描画先 X, Y 座標
  269.   #     width : 幅
  270.   #--------------------------------------------------------------------------
  271.   def draw_actor_exp(actor, x, y, width = 180)
  272.     str = actor.max_level? ? "-------" : actor.exp
  273.     change_color(normal_color)
  274.     draw_text(x, y, width, line_height, str, 2)
  275.   end
  276.   #--------------------------------------------------------------------------
  277.   # ○ NextExp の描画
  278.   #     actor : アクター
  279.   #     x, y  : 描画先 X, Y 座標
  280.   #     width : 幅
  281.   #--------------------------------------------------------------------------
  282.   def draw_actor_next_exp(actor, x, y, width = 180)
  283.     draw_actor_exp_gauge(actor, x, y, width)

  284.     str = actor.max_level? ? "-------" : actor.next_level_exp_rest
  285.     change_color(normal_color)
  286.     draw_text(x, y, width, line_height, str, 2)
  287.   end
  288.   #--------------------------------------------------------------------------
  289.   # ○ Exp ゲージの描画
  290.   #     actor : アクター
  291.   #     x, y  : 描画先 X, Y 座標
  292.   #     width : 幅
  293.   #--------------------------------------------------------------------------
  294.   def draw_actor_exp_gauge(actor, x, y, width = 180)
  295.     draw_gauge(KMS_GenericGauge::EXP_IMAGE,
  296.       x, y, width, actor.exp_rate,
  297.       KMS_GenericGauge::EXP_OFFSET,
  298.       KMS_GenericGauge::EXP_LENGTH,
  299.       KMS_GenericGauge::EXP_SLOPE
  300.     )
  301.   end
  302. end

  303. #==============================================================================
  304. # ■ Window_Status
  305. #==============================================================================

  306. class Window_Status < Window_Selectable
  307.   #--------------------------------------------------------------------------
  308.   # ● 経験値情報の描画
  309.   #--------------------------------------------------------------------------
  310.   def draw_exp_info(x, y)
  311.     s_next = sprintf(Vocab::ExpNext, Vocab::level)
  312.     change_color(system_color)
  313.     draw_text(x, y + line_height * 0, 180, line_height, Vocab::ExpTotal)
  314.     draw_text(x, y + line_height * 2, 180, line_height, s_next)
  315.     change_color(normal_color)
  316.     draw_actor_exp(     @actor, x, y + line_height * 1)
  317.     draw_actor_next_exp(@actor, x, y + line_height * 3)
  318.   end
  319. end
复制代码
zhangbanxian 发表于 2012-11-25 14:16
- -b目测是脚本冲突,你搜索下有没有含有def draw_gauge字样的脚本,有的话把那个删掉就ok了... ...


的确是一个血条脚本…………嗯嗯,成了!
不过挺想要这个血条的效果……老大麻烦你看看能不能改脚本解决冲突?把图鉴的那个条子换成这种图片形式行么?
回复 支持 反对

使用道具 举报

Lv1.梦旅人

梦石
0
星屑
50
在线时间
270 小时
注册时间
2010-2-4
帖子
1305
4
发表于 2012-11-26 10:31:04 | 只看该作者
wshzya 发表于 2012-11-25 21:20
的确是一个血条脚本…………嗯嗯,成了!
不过挺想要这个血条的效果……老大麻烦你看看能不能改脚本解决冲 ...

图鉴脚本里搜索所有"draw_gauge(" 在括号后面加上"KMS_GenericGauge::HP_IMAGE,"
好歹当年也当过大魔王过,orz
回复 支持 反对

使用道具 举报

Lv1.梦旅人

梦石
0
星屑
48
在线时间
331 小时
注册时间
2012-5-4
帖子
158
5
 楼主| 发表于 2012-11-26 23:04:10 | 只看该作者
zhangbanxian 发表于 2012-11-26 10:31
图鉴脚本里搜索所有"draw_gauge(" 在括号后面加上"KMS_GenericGauge::HP_IMAGE,"

不行啊啦,成了wroung number for arguments (7 for 8)。
回复 支持 反对

使用道具 举报

Lv1.梦旅人

梦石
0
星屑
50
在线时间
270 小时
注册时间
2010-2-4
帖子
1305
6
发表于 2012-11-27 08:44:55 | 只看该作者
wshzya 发表于 2012-11-26 23:04
不行啊啦,成了wroung number for arguments (7 for 8)。

仔细看了下,只有一句要改就你出错那句,改成
  1.     draw_gauge(KMS_GenericGauge::HP_IMAGE,

  2.       x+96, y, width - 96, @percentage.to_f/100,


  3.       KMS_GenericGauge::HP_OFFSET,

  4.       KMS_GenericGauge::HP_LENGTH,

  5.       KMS_GenericGauge::HP_SLOPE)
复制代码
就好了,目测...
好歹当年也当过大魔王过,orz
回复 支持 反对

使用道具 举报

Lv1.梦旅人

梦石
0
星屑
48
在线时间
331 小时
注册时间
2012-5-4
帖子
158
7
 楼主| 发表于 2012-11-27 11:55:59 | 只看该作者
zhangbanxian 发表于 2012-11-27 08:44
仔细看了下,只有一句要改就你出错那句,改成就好了,目测...

哦哦!原来如此,是条子的颜色木弄掉啊!OK啦!太感激了~~~{:2_42:}
回复 支持 反对

使用道具 举报

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

本版积分规则

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

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

GMT+8, 2024-4-28 08:39

Powered by Discuz! X3.1

© 2001-2013 Comsenz Inc.

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