#==============================================================================
# 背包可容纳最大的物品种类数。(包括物品,武器,防具)
ITEMS_MAX = 5
# 背包满后,如果再增加物品所提示的信息。
TOP_MESSAGE = "背包已满!"
#==============================================================================
class Game_Party
#---------------------------------------------------------------------
def items
return @items
end
#---------------------------------------------------------------------
def weapons
return @weapons
end
#---------------------------------------------------------------------
def armors
return @armors
end
end
#==============================================================================
class Interpreter
#--------------------------------------------------------------------
def full_judge?(id, n, type)
mn = 0
mn += $game_party.items.keys.size
mn += $game_party.weapons.keys.size
mn += $game_party.armors.keys.size
return false if mn < ITEMS_MAX
case type
when 0
if $game_party.items.keys.include?(id)
return false if $game_party.item_number(id) + n <= 99
end
when 1
if $game_party.weapons.keys.include?(id)
return false if $game_party.weapon_number(id) + n <= 99
end
when 2
if $game_party.armors.keys.include?(id)
return false if $game_party.armor_number(id) + n <= 99
end
end
return true
end
#---------------------------------------------------------------------
def full_top
$game_system.se_play($data_system.buzzer_se)
top = Window_Base.new(200, 100, 240, 64)
top.contents = Bitmap.new(top.width - 32, top.height - 32)
top.contents.draw_text(0, 0, 200, 32, TOP_MESSAGE, 1)
for i in 1..30
Graphics.update
end
for i in 1..20
top.opacity -= 13
top.contents_opacity -= 13
Graphics.update
end
top.dispose
end
#--------------------------------------------------------------------------
# ● 增减物品
#--------------------------------------------------------------------------
def command_126
# 获取要操作的值
value = operate_value(@parameters[1], @parameters[2], @parameters[3])
if full_judge?(@parameters[0], value, 0)
full_top
command_115
return
end
# 增减物品
$game_party.gain_item(@parameters[0], value)
# 继续
return true
end
#--------------------------------------------------------------------------
# ● 增减武器
#--------------------------------------------------------------------------
def command_127
# 获取要操作的值
value = operate_value(@parameters[1], @parameters[2], @parameters[3])
if full_judge?(@parameters[0], value, 1)
full_top
command_115
return
end
# 增减武器
$game_party.gain_weapon(@parameters[0], value)
# 继续
return true
end
#--------------------------------------------------------------------------
# ● 增减防具
#--------------------------------------------------------------------------
def command_128
# 获取要操作的值
value = operate_value(@parameters[1], @parameters[2], @parameters[3])
if full_judge?(@parameters[0], value, 2)
full_top
command_115
return
end
# 增减防具
$game_party.gain_armor(@parameters[0], value)
# 继续
return true
end
end
#==============================================================================