Skip to content
Snippets Groups Projects
Commit bac259c4 authored by dg's avatar dg
Browse files

Disabled selling to the stores

Increased gold drops


git-svn-id: http://svn.net-core.org/repos/t-engine4@1579 51575b47-30f0-44d4-a5cc-537603b46e54
parent 735d206f
No related branches found
No related tags found
No related merge requests found
......@@ -27,6 +27,8 @@ local GetQuantity = require "engine.dialogs.GetQuantity"
module(..., package.seeall, class.inherit(Entity, Inventory))
function _M:init(t, no_default)
self.allow_sell = true
self.allow_buy = true
t = t or {}
t.body = {INVEN=10000}
......@@ -94,7 +96,7 @@ function _M:interact(who)
return self:descObject(who, what, o)
end, function(what, o)
return self:descObjectPrice(who, what, o)
end)
end, self.allow_sell, self.allow_buy)
game:registerDialog(d)
end
......
......@@ -26,7 +26,8 @@ local Separator = require "engine.ui.Separator"
module(..., package.seeall, class.inherit(Dialog))
function _M:init(title, store_inven, actor_inven, store_filter, actor_filter, action, desc, descprice)
function _M:init(title, store_inven, actor_inven, store_filter, actor_filter, action, desc, descprice, allow_sell, allow_buy)
self.allow_sell, self.allow_buy = allow_sell, allow_buy
self.action = action
self.desc = desc
self.descprice = descprice
......@@ -97,11 +98,13 @@ end
function _M:use(item)
if item and item.object then
if self.focus_ui and self.focus_ui.ui == self.c_store then
self.action("buy", item.object, item.item)
-- self:updateStore()
if util.getval(self.allow_buy, item.object, item.item) then
self.action("buy", item.object, item.item)
end
else
self.action("sell", item.object, item.item)
-- self:updateStore()
if util.getval(self.allow_sell, item.object, item.item) then
self.action("sell", item.object, item.item)
end
end
end
end
......
......@@ -30,6 +30,7 @@ function _M:loadStores(f)
end
function _M:init(t, no_default)
t.allow_sell = function() Dialog:simplePopup("Can not sell", "Do you really think I will buy your filthy wreckages found in the wilds? Ah!") end
t.buy_percent = t.buy_percent or 10
t.sell_percent = t.sell_percent or 100
Store.init(self, t, no_default)
......
......@@ -39,7 +39,7 @@ newEntity{ base = "BASE_MONEY", define_as = "MONEY_SMALL",
name = "gold pieces", image = "object/money_small.png",
add_name = " (#MONEY#)",
level_range = {1, 50},
money_value = resolvers.rngavg(1, 5),
money_value = resolvers.rngavg(5, 10),
}
newEntity{ base = "BASE_MONEY", define_as = "MONEY_BIG",
......@@ -48,5 +48,5 @@ newEntity{ base = "BASE_MONEY", define_as = "MONEY_BIG",
level_range = {30, 50},
color=colors.GOLD,
rarity = 15,
money_value = resolvers.rngavg(10, 30),
money_value = resolvers.rngavg(20, 30),
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment