| 赞 | 22 |
| VIP | |
| 好人卡 | |
| 积分 | 48 |
| 经验 | |
| 最后登录 | 2026-9-27 |
| 在线时间 | 389 小时 |
- 梦石
- 0
- 星屑
- 4756
- 在线时间
- 389 小时
- 注册时间
- 2012-11-8
- 回帖
- 235
|
加入我们,或者,欢迎回来。
您需要 登录 才可以下载或查看,没有账号?注册会员
×
第一次写,轻喷。。
首先,特别感谢后知后觉,物品分类很大一部分均参考了后知后觉的装备栏拓展脚本
坛子里虽然有国外yanfly的,但是那长度。。。。还有945127391的脚本,但是有个BUG,无法手动更换装备,只能用最强装备换。
步入正题,VA默认物品2个分类,普通物品和贵重物品,而很多时候游戏中物品的分类远不止2种。我们可以把普通物品和贵重物品作为两类,这个可以在数据库直接设置,修改用语可以把其改为所需的分类。
接下来就是要拓展分类了。
[pre lang="ruby" line="1"]# 使用说明:
# 2.在数据库-物品-备注 里写入 @itype[分类编号]
# 默认系统一共有2个分类.
# 所以扩展出来分类编号是从 3 开始.比如 @itype[3] @itype[4]
class RPG::Item < RPG::UsableItem
def itype_id
#正则表达式不懂。。下面的If完全取自后知后觉的脚本
if /@itype\[(.+?)\]/ =~ @note
return $1.to_i
else
return @itype_id
end
end
#判断是否为分类3,有更多分类可以仿照下面的def添加
def itype3?
self.itype_id=3
end
end[/pre]
在物品窗口也需要做相应修改,Window_ItemCategory在第41行
[pre lang="ruby" line="1"] def make_command_list
add_command(Vocab::item, :item)
add_command(Vocab::weapon, :weapon)
add_command(Vocab::armor, :armor)
add_command(Vocab::key_item, :key_item)
add_command("分类名字", :itype3)
end[/pre]
Window_ItemList也需要修改,53行,在用when的时候,下面的条件要增加
[pre lang="ruby" line="1"] def include?(item)
case @category
when :itype3
item.is_a?(RPG::Item) && item.itype3?
when :item
item.is_a?(RPG::Item) && !item.key_item? && !item.itype3
when :weapon
item.is_a?(RPG::Weapon)
when :armor
item.is_a?(RPG::Armor)
when :key_item
item.is_a?(RPG::Item) && item.key_item? && !item.itype3
else
false
end
end[/pre]
至于窗口的一些坐标,请自行计算并修改。。 |
|