From c0f291ecf38ad3fa6e04516ce90c4a26afd88d5b Mon Sep 17 00:00:00 2001 From: SmallJoker Date: Thu, 23 Jan 2014 18:59:45 +0100 Subject: [PATCH] Money converting updates --- HELP_ME.txt | 4 +++- bank_currency.lua | 10 +++++----- bank_money.lua | 2 +- bank_money2.lua | 2 +- 4 files changed, 10 insertions(+), 8 deletions(-) diff --git a/HELP_ME.txt b/HELP_ME.txt index ef9e1ca..703ba32 100644 --- a/HELP_ME.txt +++ b/HELP_ME.txt @@ -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 diff --git a/bank_currency.lua b/bank_currency.lua index e363422..bd302c1 100644 --- a/bank_currency.lua +++ b/bank_currency.lua @@ -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 diff --git a/bank_money.lua b/bank_money.lua index acdd249..400fbbb 100644 --- a/bank_money.lua +++ b/bank_money.lua @@ -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 diff --git a/bank_money2.lua b/bank_money2.lua index 6c39320..262de16 100644 --- a/bank_money2.lua +++ b/bank_money2.lua @@ -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