| 赞 | 91 |
| VIP | |
| 好人卡 | |
| 积分 | 104 |
| 经验 | |
| 最后登录 | 2024-6-24 |
| 在线时间 | 5019 小时 |
无限の剣制
- 梦石
- 0
- 星屑
- 10445
- 在线时间
- 5019 小时
- 注册时间
- 2013-2-28
- 回帖
- 4942
 
|
加入我们,或者,欢迎回来。
您需要 登录 才可以下载或查看,没有账号?注册会员
×
本帖最后由 VIPArcher 于 2015-9-15 16:21 编辑
之前帮《Dreamerland》这个坑写的脚本。
在上面的游戏里由于要添加一只装备风格,写的时候没去弄扩展性。然后昨天突然觉得这个可能还是蛮有用的,
于是就改了一下发布出来了,不知道能不能帮到大家呢。
VA自带的装备风格只有普通和双持武器。你可以用这个脚本进行扩充。使用方法看注释。
2014.10.10 简单更新了一下,改成@taroxd 教的用特性来读取,支持了装备可以影响装备风格。不过感觉上可能会照成其他的不兼容。如果会出问题请使用旧版本。
更新的目的是为了这个脚本好玩点。
2014.11.19 大更新了一下,因为收到消息说和后知后觉大触的装备栏扩展并不是那么地兼容,于是就重写了一下。现在该脚本也包括了追加装备类型的功能了,于是就多了很多可以备注的东西,具体的大家直接看脚本的注释吧,如有BUG可以直接回帖提出(因为懒,我也没认真测试过这个脚本)
2015.09.15 bug更新,初始装备无法添加额外的装备。https://rpg.blue/thread-383382-1-1.html 感谢@XVI 的汇报
[fold=新版本][pre lang="ruby" line="1"]#==============================================================================
# +++ 装备栏风格扩展 +++
# by:VIPArcher [email: VIPArcher@sina.com]
# -- 本脚本来自 https://rpg.blue 使用或转载请保留以上信息。
#==============================================================================
# ■ 新增装备风格
# 使用说明:在角色备注栏/职业备注栏里备注 <slot_type:x> 则角色变为x号装备风格,
# 一个角色有多个风格同时存在时,最终返回风格编号x最大的那个风格。
# 在防具上备注<etype_id:x>则把该防具设置为第x种类型,默认占用了0-4,追加的由5开始
# 在任何有备注框的地方备注 <fix_equips:x> 固定该位置的装备,固定多个则换行再写
# 在任何有备注框的地方备注 <seal_equips:x> 禁用该位置的装备,禁用多个则换行再写
# 在角色备注栏备注<ini_equips:[a,b,c...n]> 初始化初始装备(此备注将使数据库的初
# 始装备设置失效,并且请把装备对应好位置和确认装备该位置可以装备该装备。)
# 在角色备注栏备注<add_equips:[h,i,j...n]> 追加初始装备(和上面是一样的意思,
# 但是这种不会让数据库的设置无效,只会在后面追加上初始装备。)具体请自己摸索吧
#==============================================================================
$VIPArcherScript ||= {};$VIPArcherScript[:slot_type] = __FILE__ #20150915
#==============================================================================
# ★ 设定部分 ★
#==============================================================================
module VIPArcher
ETYPE_ADD_NAME = ["腰带", "鞋子"] #设置要增加的装备位置的名字
SLOT_TYPE = {
0 => [0,1,2,3,4], # 普通
1 => [0,0,2,3,4], # 双持武器 (这两个是默认的风格)
# 从这里开始添加装备风格
2 => [0,0,0,1,2,3,4], # 看我索爷三刀流
3 => [4], # 窝只是个需要保护的NPC装备只要首饰就够了吧。
4 => [0,2,3,3], # 233
5 => [0,1,2,3,4,5,6], # 这里的5,6对应的类型就是上面追加的类型
# 在这里继续添加类型。编号越大,优先级越高。
} # <= 这个大括号不能删
#--------------------------------------------------------------------------
# ● 追加装备位置用语
#--------------------------------------------------------------------------
def Vocab.etype(etype_id)
etype_name = $data_system.terms.etypes + ETYPE_ADD_NAME
etype_name[etype_id]
end
end
#==============================================================================
# ☆ 设定结束 ☆
#==============================================================================
class RPG::Actor < RPG::BaseItem
#--------------------------------------------------------------------------
# ● 初始装备数组
#--------------------------------------------------------------------------
alias vip_20141119_equips equips
def equips
add_equips = []
if @note =~ /<(?:ini_equips|初始装备)[:]\[(.+?)\]>/i
$1.split(",").each {|item|add_equips.push item.to_i}
return add_equips
elsif @note =~ /<(?:ini_equips|初始装备)[:]\[(.+?)\]>/i
$1.split(",").each {|item|add_equips.push item.to_i}
end
vip_20141119_equips.clone + add_equips
end
end
#-------------------------------------------------------------------------------
class RPG::Armor < RPG::EquipItem
#--------------------------------------------------------------------------
# ● 装备类型
#--------------------------------------------------------------------------
def etype_id
@note =~ /<(?:etype_id|装备类型)[:]\s*(.*)>/i ? $1.to_i : @etype_id
end
end
#-------------------------------------------------------------------------------
class Game_BattlerBase
#--------------------------------------------------------------------------
# ● 获取装备风格
#--------------------------------------------------------------------------
def slot_type
slot =[]
feature_objects.each {|obj| slot.push $1.to_i if
obj.note =~ /<(?:slot_type|装备风格)[:]\s*(.*)>/i }
return slot.max || 0
end
#--------------------------------------------------------------------------
# ● 判定是否固定装备
#--------------------------------------------------------------------------
alias vip_20141119_equip_type_fixed? equip_type_fixed?
def equip_type_fixed?(etype_id)
fixed_type = []
feature_objects.each {|obj| obj.note.split(/[\r\n]+/).each {|line|
fixed_type.push $1.to_i if line =~ /<(?:fix_equips|固定装备)[:]\s*(.*)>/i}}
fixed_type.include?(etype_id) || vip_20141119_equip_type_fixed?(etype_id)
end
#--------------------------------------------------------------------------
# ● 判定装备是否被禁用
#--------------------------------------------------------------------------
alias vip_20141119_equip_type_sealed? equip_type_sealed?
def equip_type_sealed?(etype_id)
sealed_type = []
feature_objects.each {|obj| obj.note.split(/[\r\n]+/).each {|line|
sealed_type.push $1.to_i if line =~ /<(?:seal_equips|禁用装备)[:]\s*(.*)>/i}}
sealed_type.include?(etype_id) || vip_20141119_equip_type_sealed?(etype_id)
end
end
#-------------------------------------------------------------------------------
class Game_Actor < Game_Battler
include VIPArcher
#--------------------------------------------------------------------------
# ● 初始化装备
# # 方法覆盖,可能引起冲突
#--------------------------------------------------------------------------
def init_equips(equips)
type_size = SLOT_TYPE.values.max_by{|type|type.size}.size
@equips = Array.new(type_size) { Game_BaseItem.new }
equips.each_with_index do |item_id, i|
etype_id = equip_slots
slot_id = empty_slot(etype_id)
@equips[slot_id].set_equip(etype_id == 0, item_id) if slot_id
end
refresh
end
#--------------------------------------------------------------------------
# ● 获取装备栏的数组
#--------------------------------------------------------------------------
alias vip_20140803_es equip_slots
def equip_slots
return SLOT_TYPE[slot_type] unless SLOT_TYPE[slot_type].nil?
vip_20140803_es
end
end
#-------------------------------------------------------------------------------
class Window_EquipSlot; def refresh; create_contents; super end end
[/pre][/fold]
[fold=旧版本][pre lang="ruby" line="1"]#==============================================================================
# 此脚本来自 rpg.blue
#------------------------------------------------------------------------------
# ■ 新增装备风格
# by:VIPArcher
# 使用说明:在角色备注栏/职业备注栏里备注 <slot_type:x> 则角色变为x号装备风格
# 优先读取职业栏的风格备注。
#------------------------------------------------------------------------------
# ◆ 搭配后知后觉的装备栏扩充脚本风味更佳(需要把他的脚本放在脚本这个上面)
#==============================================================================
module VIPArcher
SLOT_TYPE = {
0 => [0,1,2,3,4], # 普通
1 => [0,0,2,3,4], # 双持武器 (这两个是默认的东西最好别改)
# 从这里开始添加装备风格
2 => [0,0,0,2,3,4], # 看我索爷三刀流
3 => [4], # 窝只是个需要保护的NPC装备只要首饰就够了吧。
4 => [2,3,3] # 233
# 在这里继续添加类型。
} # <= 这个大括号不能删
end
class Game_BattlerBase
#--------------------------------------------------------------------------
# ● 获取装备风格
#--------------------------------------------------------------------------
def slot_type
classes = $data_classes[@class_id]
classes.note =~ /<slot_type\s*:(.*)>/i
return $1.to_i if $1!= nil
actor.note =~ /<slot_type\s*:(.*)>/i
return $1.to_i if $1!= nil
features_set(FEATURE_SLOT_TYPE).max || 0
end
end
class Game_Actor < Game_Battler
alias vip_20140803_es equip_slots
#--------------------------------------------------------------------------
# ● 获取装备栏的数组
#--------------------------------------------------------------------------
def equip_slots
return VIPArcher::SLOT_TYPE[slot_type] if
VIPArcher::SLOT_TYPE[slot_type] != nil
vip_20140803_es
end
end
class Window_EquipSlot < Window_Selectable
def actor=(actor)
return if @actor == actor
@actor = actor
create_contents
refresh
end
end[/pre][/fold] |
|