Expire elixirs on death option.
This commit is contained in:
parent
48847cc7e0
commit
f438090899
4 changed files with 15 additions and 0 deletions
|
@ -115,6 +115,7 @@ mobs:register_mob("fun_caves:snow_demon", {
|
||||||
type = "monster",
|
type = "monster",
|
||||||
passive = false,
|
passive = false,
|
||||||
damage = 3,
|
damage = 3,
|
||||||
|
-- change to dogshoot?
|
||||||
attack_type = "dogfight",
|
attack_type = "dogfight",
|
||||||
attacks_monsters = true,
|
attacks_monsters = true,
|
||||||
hp_min = 10,
|
hp_min = 10,
|
||||||
|
|
10
elixir.lua
10
elixir.lua
|
@ -1,5 +1,15 @@
|
||||||
fun_caves.armor_expire = {}
|
fun_caves.armor_expire = {}
|
||||||
|
|
||||||
|
if fun_caves.expire_elixir_on_death then
|
||||||
|
minetest.register_on_dieplayer(function(player)
|
||||||
|
local name = player:get_player_name()
|
||||||
|
if fun_caves.armor_expire[name] then
|
||||||
|
player:set_armor_groups({fleshy = 100})
|
||||||
|
fun_caves.armor_expire[name] = nil
|
||||||
|
end
|
||||||
|
end)
|
||||||
|
end
|
||||||
|
|
||||||
local function armor(user, factor)
|
local function armor(user, factor)
|
||||||
local player_name = user:get_player_name()
|
local player_name = user:get_player_name()
|
||||||
local armor = user:get_armor_groups()
|
local armor = user:get_armor_groups()
|
||||||
|
|
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.elixir_armor = minetest.setting_getbool('fun_caves_use_armor_elixirs')
|
fun_caves.elixir_armor = minetest.setting_getbool('fun_caves_use_armor_elixirs')
|
||||||
|
fun_caves.expire_elixir_on_death = minetest.setting_getbool('fun_caves_expire_elixir_on_death')
|
||||||
fun_caves.DEBUG = false -- for maintenance only
|
fun_caves.DEBUG = false -- for maintenance only
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -1,2 +1,5 @@
|
||||||
# Set to false if you're using an armor mod.
|
# Set to false if you're using an armor mod.
|
||||||
fun_caves_use_armor_elixirs (Use Armor Elixirs) bool true
|
fun_caves_use_armor_elixirs (Use Armor Elixirs) bool true
|
||||||
|
|
||||||
|
# If set, you will lose the effects of elixirs when you die.
|
||||||
|
fun_caves_expire_elixir_on_death (Elixirs Expire On Death) bool true
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue