Make armor elixirs optional.
This commit is contained in:
parent
abffeb54d9
commit
c5357b51fc
4 changed files with 34 additions and 28 deletions
2
abms.lua
2
abms.lua
|
@ -125,7 +125,7 @@ minetest.register_globalstep(function(dtime)
|
||||||
player:set_hp(20)
|
player:set_hp(20)
|
||||||
return
|
return
|
||||||
else
|
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})
|
player:set_armor_groups({fleshy=100})
|
||||||
minetest.chat_send_player(player_name, minetest.colorize('#FF0000', 'Your skin feels softer...'))
|
minetest.chat_send_player(player_name, minetest.colorize('#FF0000', 'Your skin feels softer...'))
|
||||||
fun_caves.armor_expire[player_name] = nil
|
fun_caves.armor_expire[player_name] = nil
|
||||||
|
|
56
elixir.lua
56
elixir.lua
|
@ -23,32 +23,34 @@ local descs = {
|
||||||
--{'adamant', 0.1, 'fun_caves:adamant'},
|
--{'adamant', 0.1, 'fun_caves:adamant'},
|
||||||
}
|
}
|
||||||
|
|
||||||
for _, desc in pairs(descs) do
|
if fun_caves.elixir_armor then
|
||||||
local name = desc[1]
|
for _, desc in pairs(descs) do
|
||||||
local value = desc[2]
|
local name = desc[1]
|
||||||
local cap = name:gsub('^%l', string.upper)
|
local value = desc[2]
|
||||||
minetest.register_craftitem("fun_caves:liquid_"..name, {
|
local cap = name:gsub('^%l', string.upper)
|
||||||
description = 'Dr Robertson\'s Patented Liquid '..cap..' Elixir',
|
minetest.register_craftitem("fun_caves:liquid_"..name, {
|
||||||
drawtype = "plantlike",
|
description = 'Dr Robertson\'s Patented Liquid '..cap..' Elixir',
|
||||||
paramtype = "light",
|
drawtype = "plantlike",
|
||||||
tiles = {'fun_caves_liquid_'..name..'.png'},
|
paramtype = "light",
|
||||||
inventory_image = 'fun_caves_liquid_'..name..'.png',
|
tiles = {'fun_caves_liquid_'..name..'.png'},
|
||||||
groups = {dig_immediate = 3, vessel = 1},
|
inventory_image = 'fun_caves_liquid_'..name..'.png',
|
||||||
sounds = default.node_sound_glass_defaults(),
|
groups = {dig_immediate = 3, vessel = 1},
|
||||||
on_use = function(itemstack, user, pointed_thing)
|
sounds = default.node_sound_glass_defaults(),
|
||||||
armor(user, value)
|
on_use = function(itemstack, user, pointed_thing)
|
||||||
itemstack:take_item()
|
armor(user, value)
|
||||||
return itemstack
|
itemstack:take_item()
|
||||||
end,
|
return itemstack
|
||||||
})
|
end,
|
||||||
|
})
|
||||||
|
|
||||||
minetest.register_craft({
|
minetest.register_craft({
|
||||||
type = "shapeless",
|
type = "shapeless",
|
||||||
output = 'fun_caves:liquid_'..name,
|
output = 'fun_caves:liquid_'..name,
|
||||||
recipe = {
|
recipe = {
|
||||||
"mobs_slimes:green_slimeball",
|
"mobs_slimes:green_slimeball",
|
||||||
desc[3],
|
desc[3],
|
||||||
"vessels:glass_bottle",
|
"vessels:glass_bottle",
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
1
init.lua
1
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.path = minetest.get_modpath(minetest.get_current_modname())
|
||||||
fun_caves.world = minetest.get_worldpath()
|
fun_caves.world = minetest.get_worldpath()
|
||||||
fun_caves.DEBUG = false -- for maintenance only
|
fun_caves.DEBUG = false -- for maintenance only
|
||||||
|
fun_caves.elixir_armor = minetest.setting_getbool('fun_caves_use_armor_elixirs')
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
3
settingtypes.txt
Normal file
3
settingtypes.txt
Normal 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
|
Loading…
Add table
Add a link
Reference in a new issue