Browse Source

Add a configurable income amount.

master
luk3yx 4 weeks ago
parent
commit
f9d5edf7fe
4 changed files with 14 additions and 6 deletions
  1. 6
    4
      README.md
  2. 1
    0
      config.lua
  3. 3
    2
      income.lua
  4. 4
    0
      settingtypes.txt

+ 6
- 4
README.md View File

@@ -12,12 +12,14 @@ again).
- `money3.initial_amount`: The amount of money new players get. Default: `0`.
- `money3.currency_name`: The text appended to the currency when displaying it.
Default: `cr`.
- `money3.enable_income`: Pays players 10cr every in-game day.
Default: `true` if creative mode is disabled, otherwise `false`. If you are
using the [currency](https://gitlab.com/VanessaE/currency) mod, it is
probably a good idea to set `currency.income_enabled` to `false`. If you
- `money3.enable_income`: Pays players money (by default 10cr) every in-game
day. Default: `true` if creative mode is disabled, otherwise `false`. If
you are using the [currency](https://gitlab.com/VanessaE/currency) mod, it
is probably a good idea to set `currency.income_enabled` to `false`. If you
use an outdated version of the currency mod where this setting does not
exist, the automatic income system is automatically disabled.
- `money3.income_amount`: Changes the amount of income players get paid. If
income is not enabled, this does nothing.
- `money3.convert_items`: A lua table (that can also be `nil` to disable)
similar to the following (default) one:


+ 1
- 0
config.lua View File

@@ -58,6 +58,7 @@ end

setting("initial_amount", 0)
setting("currency_name", "cr")
setting("income_amount", 10)

setting("convert_items", {
gold = { item = "default:gold_ingot", dig_block="default:stone_with_gold", desc='Gold', amount=75, minval=25 },

+ 3
- 2
income.lua View File

@@ -29,10 +29,11 @@ function money3.earn_income(name)
end
if income[name] then
income[name] = nil
money3.add(name, 10)
local amount = money3.income_amount
money3.add(name, amount)

-- Tell the player
local msg = "[money3] You have earned " .. money3.format(10) ..
local msg = "[money3] You have earned " .. money3.format(amount) ..
". Your balance is now " .. money3.format(money3.get(name)) .. "."

if minetest.colorize then msg = minetest.colorize("#CCCCCC", msg) end

+ 4
- 0
settingtypes.txt View File

@@ -11,3 +11,7 @@ money3.convert_items (A lua table with a list of money3 items) string
# Automatically give active players 10cr every 12 minutes. If the currency
# mod is installed and this is enabled, its income will be disabled.
money3.enable_income (Enable money3 income) bool true

# Changes the amount of income players get paid. If income is not enabled,
# this does nothing.
money3.income_amount (Amount to pay players in money3 income) int 10 0

Loading…
Cancel
Save