Make armor elixirs optional.

This commit is contained in:
Duane 2016-06-21 07:01:48 -05:00
parent abffeb54d9
commit c5357b51fc
4 changed files with 34 additions and 28 deletions

View file

@ -125,7 +125,7 @@ minetest.register_globalstep(function(dtime)
player:set_hp(20)
return
else
if fun_caves.armor_expire and fun_caves.armor_expire[player_name] and fun_caves.armor_expire[player_name] < time then
if fun_caves.elixir_armor and fun_caves.armor_expire and fun_caves.armor_expire[player_name] and fun_caves.armor_expire[player_name] < time then
player:set_armor_groups({fleshy=100})
minetest.chat_send_player(player_name, minetest.colorize('#FF0000', 'Your skin feels softer...'))
fun_caves.armor_expire[player_name] = nil

View file

@ -23,7 +23,8 @@ local descs = {
--{'adamant', 0.1, 'fun_caves:adamant'},
}
for _, desc in pairs(descs) do
if fun_caves.elixir_armor then
for _, desc in pairs(descs) do
local name = desc[1]
local value = desc[2]
local cap = name:gsub('^%l', string.upper)
@ -51,4 +52,5 @@ for _, desc in pairs(descs) do
"vessels:glass_bottle",
},
})
end
end

View file

@ -5,6 +5,7 @@ fun_caves.light_max = 8 -- light intensity for mushroom growth
fun_caves.path = minetest.get_modpath(minetest.get_current_modname())
fun_caves.world = minetest.get_worldpath()
fun_caves.DEBUG = false -- for maintenance only
fun_caves.elixir_armor = minetest.setting_getbool('fun_caves_use_armor_elixirs')

3
settingtypes.txt Normal file
View file

@ -0,0 +1,3 @@
# New players are randomely spawned by the mod
# disable it to spawn the player another way.
fun_caves_use_armor_elixirs (Use Armor Elixirs) bool false