forked from mtcontrib/bitchange
Money converting updates
This commit is contained in:
parent
78f27c4bd9
commit
c0f291ecf3
@ -11,7 +11,9 @@
|
||||
-> Enable something: Open 'config.txt' with your editor and modify it
|
||||
-> See crafts: get an extention for your inventory or browse through the codes
|
||||
-> Power the tool repair: insert damaged tool in the first box and someminecoins intothe 2nd, then wait.
|
||||
|
||||
-> Set up the bank: use [E + right click] to see the reserve of the current bank, then put some MineCoins in there
|
||||
and if you are using the curreny mod, then also put 1-MineGelt notes inside.
|
||||
|
||||
==> Add special access to nodes, how?
|
||||
-> Exchange shop: open 'shop.lua' and edit the function 'has_exchange_shop_privilege',
|
||||
return 'true' to grant access to the contents, return 'false' to disallow
|
||||
|
@ -3,7 +3,7 @@
|
||||
--License: WTFPL
|
||||
|
||||
local file_path = minetest.get_worldpath() .. "/bitchange_bank_currency"
|
||||
local exchange_worth = 15 -- default worth in "money" for one MineCoin, change if not okay
|
||||
local exchange_worth = 8 -- default worth in "money" for 10 MineCoins, change if not okay
|
||||
local bank = {}
|
||||
local changes_made = false
|
||||
|
||||
@ -84,7 +84,7 @@ minetest.register_on_player_receive_fields(function(sender, formname, fields)
|
||||
local geld_stack = "currency:minegeld "
|
||||
local err_msg = ""
|
||||
if(fields.buy10) then
|
||||
geld_stack = geld_stack..(round(exchange_worth * 0.995, 1) * 10)
|
||||
geld_stack = geld_stack..(round(exchange_worth * 0.995, 1))
|
||||
if(not player_inv:contains_item("main", coin_stack)) then
|
||||
err_msg = "You do not have the needed MineCoins."
|
||||
end
|
||||
@ -105,7 +105,7 @@ minetest.register_on_player_receive_fields(function(sender, formname, fields)
|
||||
end
|
||||
if(err_msg == "") then
|
||||
exchange_worth = exchange_worth * 0.995
|
||||
local price = round(exchange_worth - 0.01, 1) * 10
|
||||
local price = round(exchange_worth - 0.01, 1)
|
||||
bank_inv:remove_item("coins", geld_stack)
|
||||
player_inv:add_item("main", geld_stack)
|
||||
player_inv:remove_item("main", coin_stack)
|
||||
@ -114,8 +114,8 @@ minetest.register_on_player_receive_fields(function(sender, formname, fields)
|
||||
err_msg = "Sold 10 MineCoins for "..price.." MineGeld"
|
||||
end
|
||||
elseif(fields.sell10) then
|
||||
local price = round(exchange_worth, 1) * 10
|
||||
geld_stack = geld_stack..(round(exchange_worth, 1) * 10)
|
||||
local price = round(exchange_worth, 1)
|
||||
geld_stack = geld_stack..price)
|
||||
if(not player_inv:contains_item("main", geld_stack)) then
|
||||
err_msg = "You do not have the required money. ("..price.." x 1 MineGeld pieces)"
|
||||
end
|
||||
|
@ -3,7 +3,7 @@
|
||||
--License: WTFPL
|
||||
|
||||
local file_path = minetest.get_worldpath() .. "/bitchange_bank_money"
|
||||
local exchange_worth = 100.0 -- default worth in "money" for one MineCoin, change if not okay
|
||||
local exchange_worth = 70.0 -- default worth in "money" for one MineCoin, change if not okay
|
||||
local bank = {}
|
||||
local changes_made = false
|
||||
|
||||
|
@ -3,7 +3,7 @@
|
||||
--License: WTFPL
|
||||
|
||||
local file_path = minetest.get_worldpath() .. "/bitchange_bank_money2"
|
||||
local exchange_worth = 100.0 -- default worth in "cr" for one MineCoin, change if not okay
|
||||
local exchange_worth = 70.0 -- default worth in "cr" for one MineCoin, change if not okay
|
||||
local bank = {}
|
||||
local changes_made = false
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user