栗子:
#--------------------------------------------------------------------------
# ● 增加物品 (减少)
# item_id : 物品 ID
# n : 个数
#--------------------------------------------------------------------------
def gain_item(item_id, n)
# 更新 hash 的个数数据
if item_id > 0
max("#{$data_items[item_id].name}已满")if item_number(item_id) + n >= 10
@items[item_id] = [[item_number(item_id) + n, 0].max,10].min
end
end
def max(str)
a = Window_Base.new(220,208,200,64)
a.contents = Bitmap.new(168,32)
a.contents.draw_text(0,0,168,32,str,1)
w = 510
loop do
a.opacity = w
a.contents_opacity = w
w -= 12
if w <= 0
a.dispose
break
end
Graphics.update
end
end