查看: 5089|回复: 2

[RMVA发布] 【狂晓霸道】装备品质1.0(物品颜色描绘)

[复制链接]
梦石
0
星屑
400
在线时间
602 小时
注册时间
2014-5-8
回帖
602
发表于 2016-11-10 14:44:00 | 显示全部楼层 |阅读模式

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

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

×
本帖最后由 布罗利 于 2016-11-10 14:49 编辑

首先附上本来的物品颜色描绘:https://rpg.blue/thread-217113-1-1.html
感觉这个描绘的太朴素了,于是自己写了个华丽点的(个人认为而已)
先附上所需素材(素材放到Graphics/System里): 品质颜色.png
然后再附上范例: 装备品质.zip (1.44 MB, 下载次数: 811)
[pre lang="ruby"]#==============================================================================
# ■ 装备品质1.0   By 狂晓霸道丶 QQ1711044261  2016/11/10
#------------------------------------------------------------------------------
# ★ 使用说明
#  - 在物品/武器/护甲的注释处,写入:品质[颜色]  例如:品质[橙]
#  - 颜色分别有:白、绿、蓝、紫、橙、红
#  - 素材放在(Graphics/System)的文件夹里,名字为:品质颜色 
#==============================================================================
class RPG::BaseItem
  attr_accessor :quality
  def quality
    a = ["白","绿","蓝","紫","橙","红"]
    note =~ /品质\[(.+?)\]/
    return a.index($1) if $1 != nil
    return 0 if @Quality == nil
    @quality
  end
end
#==============================================================================
# ■ Window_Base
#------------------------------------------------------------------------------
#  游戏中所有窗口的父类
#==============================================================================
class Window_Base
  #--------------------------------------------------------------------------
  # ● 绘制物品名称
  #     enabled : 有效的标志。false 的时候使用半透明效果绘制
  #--------------------------------------------------------------------------
  def draw_item_name(item, x, y, enabled = true, width = 172)
    return unless item
    bitmap = Cache.system("品质颜色")
    rect = Rect.new(32*item.quality,0, 32, 32)
    contents.blt(x, y, bitmap, rect)
    draw_icon(item.icon_index, x+4, y+4)
    change_color(normal_color, enabled)
    draw_text(x + 24+10, y+4, width, line_height, item.name)
  end
end
#==============================================================================
# ■ Window_ItemList
#------------------------------------------------------------------------------
#  物品画面中,显示持有物品的窗口。
#==============================================================================
class Window_ItemList
  #--------------------------------------------------------------------------
  # ● 获取项目的高度
  #--------------------------------------------------------------------------
  def item_height
    line_height + 12
  end
  #--------------------------------------------------------------------------
  # ● 绘制项目
  #--------------------------------------------------------------------------
  def draw_item(index)
    item = @data[index]
    if item
      rect = item_rect(index)
      rect.width -= 4
      draw_item_name(item, rect.x+2, rect.y+2, enable?(item))
      draw_item_number(rect, item)
    end
  end
end
#==============================================================================
# ■ Window_ShopBuy
#------------------------------------------------------------------------------
#  商店画面中,买入时显示所有商品的窗口。
#==============================================================================
class Window_ShopBuy
  #--------------------------------------------------------------------------
  # ● 获取项目的高度
  #--------------------------------------------------------------------------
  def item_height
    line_height + 12
  end
  #--------------------------------------------------------------------------
  # ● 绘制项目
  #--------------------------------------------------------------------------
  def draw_item(index)
    item = @data[index]
    rect = item_rect(index)
    draw_item_name(item, rect.x+2, rect.y+2, enable?(item))
    rect.width -= 4
    draw_text(rect, price(item), 2)
  end
end
#==============================================================================
# ■ Window_EquipSlot
#------------------------------------------------------------------------------
#  装备画面中,显示角色当前装备的窗口。
#==============================================================================
class Window_EquipSlot
  #--------------------------------------------------------------------------
  # ● 获取项目的高度
  #--------------------------------------------------------------------------
  def item_height
    line_height + 12
  end
  #--------------------------------------------------------------------------
  # ● 绘制项目
  #--------------------------------------------------------------------------
  def draw_item(index)
    return unless @actor
    rect = item_rect(index)
    change_color(system_color, enable?(index))
    draw_text(rect.x+2, rect.y+6, 92, line_height, slot_name(index))
    draw_item_name(@actor.equips[index], rect.x + 92+2, rect.y+2, enable?(index))
  end
  #--------------------------------------------------------------------------
  # ● 刷新
  #--------------------------------------------------------------------------
  def refresh
    create_contents
    draw_all_items
  end
end
#==============================================================================
# ■ Window_Status
#------------------------------------------------------------------------------
#  状态画面中,显示角色基本信息的窗口。
#==============================================================================
class Window_Status
  #--------------------------------------------------------------------------
  # ● 绘制装备
  #--------------------------------------------------------------------------
  def draw_equipments(x, y)
    @actor.equips.each_with_index do |item, i|
      draw_item_name(item, x + 2, y + (line_height+8) * i-8)
    end
  end
end
[/pre]
)%XUWEPXK~)]REC@R9_2O9B.png {GR7G${6~Y6_U_4MQ$KT6SI.png LQUJC2R5WJ}7N%J%@F53.png RY6(OKHR491VA[Q57L@SC`A.png
梦石
0
星屑
50
在线时间
43 小时
注册时间
2017-1-9
回帖
9
发表于 2017-2-27 10:48:00 | 显示全部楼层
那怎么给想要的物品弄上想要的品质

点评

在物品备注,写入:品质[颜色],例如:品质[紫]  发表于 2017-2-28 11:49
回复

使用道具 举报

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

本版积分规则

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

在本版发帖返回顶部