diff --git a/abms.lua b/abms.lua index 0ba1aa0..c484f05 100644 --- a/abms.lua +++ b/abms.lua @@ -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 diff --git a/elixir.lua b/elixir.lua index d131221..05a8dc7 100644 --- a/elixir.lua +++ b/elixir.lua @@ -23,32 +23,34 @@ local descs = { --{'adamant', 0.1, 'fun_caves:adamant'}, } -for _, desc in pairs(descs) do - local name = desc[1] - local value = desc[2] - local cap = name:gsub('^%l', string.upper) - minetest.register_craftitem("fun_caves:liquid_"..name, { - description = 'Dr Robertson\'s Patented Liquid '..cap..' Elixir', - drawtype = "plantlike", - paramtype = "light", - tiles = {'fun_caves_liquid_'..name..'.png'}, - inventory_image = 'fun_caves_liquid_'..name..'.png', - groups = {dig_immediate = 3, vessel = 1}, - sounds = default.node_sound_glass_defaults(), - on_use = function(itemstack, user, pointed_thing) - armor(user, value) - itemstack:take_item() - return itemstack - end, - }) +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) + minetest.register_craftitem("fun_caves:liquid_"..name, { + description = 'Dr Robertson\'s Patented Liquid '..cap..' Elixir', + drawtype = "plantlike", + paramtype = "light", + tiles = {'fun_caves_liquid_'..name..'.png'}, + inventory_image = 'fun_caves_liquid_'..name..'.png', + groups = {dig_immediate = 3, vessel = 1}, + sounds = default.node_sound_glass_defaults(), + on_use = function(itemstack, user, pointed_thing) + armor(user, value) + itemstack:take_item() + return itemstack + end, + }) - minetest.register_craft({ - type = "shapeless", - output = 'fun_caves:liquid_'..name, - recipe = { - "mobs_slimes:green_slimeball", - desc[3], - "vessels:glass_bottle", - }, - }) + minetest.register_craft({ + type = "shapeless", + output = 'fun_caves:liquid_'..name, + recipe = { + "mobs_slimes:green_slimeball", + desc[3], + "vessels:glass_bottle", + }, + }) + end end diff --git a/init.lua b/init.lua index e7734c0..bc0e391 100644 --- a/init.lua +++ b/init.lua @@ -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') diff --git a/settingtypes.txt b/settingtypes.txt new file mode 100644 index 0000000..909f2c7 --- /dev/null +++ b/settingtypes.txt @@ -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