mirror of
https://github.com/MinetestForFun/minercantile.git
synced 2024-12-23 08:10:22 +01:00
Update shop.lua
This commit is contained in:
parent
f9e969d7f3
commit
55d73c330e
4
shop.lua
4
shop.lua
@ -176,7 +176,7 @@ function minercantile.shop.get_buy_price(itname)
|
|||||||
if minercantile.stock.items[itname].price ~= nil then -- if defined price
|
if minercantile.stock.items[itname].price ~= nil then -- if defined price
|
||||||
price = math.ceil(minercantile.stock.items[itname].price)
|
price = math.ceil(minercantile.stock.items[itname].price)
|
||||||
else
|
else
|
||||||
price = math.ceil((money/10)/(math.log(nb+2000-99)*10)*1000000/(math.pow((nb+2000-99),(2.01))))
|
price = math.ceil((money/1000)/(math.log(nb+2000-99)*10)*1000000/(math.pow((nb+2000-99),(2.01))))
|
||||||
end
|
end
|
||||||
if price and price < 1 then price = 1 end
|
if price and price < 1 then price = 1 end
|
||||||
return price
|
return price
|
||||||
@ -196,7 +196,7 @@ function minercantile.shop.get_sell_price(itname, wear)
|
|||||||
if minercantile.stock.items[itname].price ~= nil then -- if defined price
|
if minercantile.stock.items[itname].price ~= nil then -- if defined price
|
||||||
price = math.floor(minercantile.stock.items[itname].price)
|
price = math.floor(minercantile.stock.items[itname].price)
|
||||||
else
|
else
|
||||||
price = math.floor(((money/10)/(math.log(nb+2000+99)*10)*1000000/(math.pow((nb+2000+99),(2.01))))+0.5)
|
price = math.floor(((money/1000)/(math.log(nb+2000+99)*10)*1000000/(math.pow((nb+2000+99),(2.01))))+0.5)
|
||||||
end
|
end
|
||||||
|
|
||||||
if wear and wear > 0 then --calcul price with % wear, (0-65535)
|
if wear and wear > 0 then --calcul price with % wear, (0-65535)
|
||||||
|
Loading…
Reference in New Issue
Block a user