不好意思,又发现了一个问题。
【商店基础】脚本里写的是:
#-----------------------------------------------------------------------------
# Returns a good, given a shop and an item. If the shop already has that good
# just return it. Otherwise, make a new good. If the price is negative, then
# the price is the default price. Otherwise, it is the specified price.
#-----------------------------------------------------------------------------
def self.get_good(shop, item, price=-1)
good = shop.shop_goods.detect {|good| good.item == item}
return good if good
good_id = shop.shop_goods.size + 1
type = item_type(item)
if price < 0
price_type = price = 0
else
price_type = 1
end
return Game_ShopGood.new(good_id, type, item.id, price_type, price)
end