def gain_item(item_id, n)
return if item_id > 0
case item_id
when 6, 7, 8
@items[item_id] = [[item_number(item_id) + n, 0].max, 20].min
else
@items[item_id] = [[item_number(item_id) + n, 0].max, 99].min
end
end
class Game_Party
$aaaaa_max_item_num = {1 => 30,2 => 40}
alias old_gain_item gain_item
#--------------------------------------------------------------------------
# ● 增加物品 (减少)
# item_id : 物品 ID
# n : 个数
#--------------------------------------------------------------------------
def gain_item(item_id, n)
max_num = $aaaaa_max_item_num[item_id]
if max_num != nil
got = @items[item_id]
if got == nil
got = 0
end
if got + n > max_num
@items[item_id] = max_num
return
end
end
old_gain_item(item_id, n)
end
end