赞 | 0 |
VIP | 0 |
好人卡 | 0 |
积分 | 16 |
经验 | 0 |
最后登录 | 2019-6-9 |
在线时间 | 4 小时 |
Lv3.寻梦者
- 梦石
- 1
- 星屑
- 555
- 在线时间
- 4 小时
- 注册时间
- 2010-10-1
- 帖子
- 1
|
在装备说明的最后附加一个LV等级(如10级装备则加LV10)然后脚本。
不过用这个脚本在装备栏只看得到等级够的装备
module RPG
class Weapon
def level
return 1 if @description.split(/LV/)[1] == nil
return @description.split(/LV/)[1]
end
def str
return 1 if @description.split(/STR/)[1] == nil
return @description.split(/STR/)[1]
end
def dex
return 1 if @description.split(/DEX/)[1] == nil
return @description.split(/DEX/)[1]
end
def agi
return 1 if @description.split(/AGI/)[1] == nil
return @description.split(/AGI/)[1]
end
def int
return 1 if @description.split(/INT/)[1] == nil
return @description.split(/INT/)[1]
end
# def description
# return @description.split(/LV/)[0] + "{装备等级" + level + "}"
# end
end
class Armor
def level
return 1 if @description.split(/LV/)[1] == nil
return @description.split(/LV/)[1]
end
def str
return 1 if @description.split(/STR/)[1] == nil
return @description.split(/STR/)[1]
end
def dex
return 1 if @description.split(/DEX/)[1] == nil
return @description.split(/DEX/)[1]
end
def agi
return 1 if @description.split(/AGI/)[1] == nil
return @description.split(/AGI/)[1]
end
def int
return 1 if @description.split(/INT/)[1] == nil
return @description.split(/INT/)[1]
end
# def description
# return @description.split(/LV/)[0] + "{装备等级" + level + "}"
# end
end
end
class Game_Actor < Game_Battler
#--------------------------------------------------------------------------
# ● 可以装备判定
# item : 物品
#--------------------------------------------------------------------------
def equipable?(item)
# 武器的情况
if item.is_a?(RPG::Weapon)
# 包含当前的职业可以装备武器的场合
if $data_classes[@class_id].weapon_set.include?(item.id) and item.level.to_i<=@level
if item.str.to_i<= str and item.dex.to_i<= dex and item.agi.to_i<= agi and item.int.to_i<= int
return true
end
end
end
# 防具的情况
if item.is_a?(RPG::Armor)
# 不包含当前的职业可以装备武器的场合
if $data_classes[@class_id].armor_set.include?(item.id) and item.level.to_i<=@level
if item.str.to_i<= str and item.dex.to_i<= dex and item.agi.to_i<= agi and item.int.to_i<= int
return true
end
end
end
return false
end
end
#==============================================================================
# ■ Window_EquipItem
#------------------------------------------------------------------------------
# 装备画面、显示浏览变更装备的候补物品的窗口。
#==============================================================================
class Window_EquipItem < Window_Selectable
#--------------------------------------------------------------------------
# ● 刷新
#--------------------------------------------------------------------------
def refresh
if self.contents != nil
self.contents.dispose
self.contents = nil
end
@data = []
# 添加可以装备的武器
if @equip_type == 0
weapon_set = $data_classes[@actor.class_id].weapon_set
for i in 1...$data_weapons.size
if $game_party.weapon_number(i) > 0 and weapon_set.include?(i) and @actor.equipable?($data_weapons[i])
@data.push($data_weapons[i])
end
end
end
# 添加可以装备的防具
if @equip_type != 0
armor_set = $data_classes[@actor.class_id].armor_set
for i in 1...$data_armors.size
if $game_party.armor_number(i) > 0 and armor_set.include?(i) and @actor.equipable?($data_armors[i])
if $data_armors[i].kind == @equip_type-1
@data.push($data_armors[i])
end
end
end
end
# 添加空白
@data.push(nil)
# 生成位图、描绘全部项目
@item_max = @data.size
self.contents = Bitmap.new(width - 32, row_max * 32)
for i in 0...@item_max-1
draw_item(i)
end
end
end
|
|