Individual components can be enabled / disabled via configuration

master
Ben Deutsch 2015-07-05 14:52:47 +02:00
parent 234880964f
commit d5b2817c88
4 changed files with 209 additions and 163 deletions

View File

@ -22,13 +22,14 @@ on use.
]]
if (minetest.get_modpath("vessels")) then
if minetest.get_modpath("vessels") and thirsty.config.register_vessels then
-- add "drinking" to vessels
thirsty.augment_item_for_drinking('vessels:drinking_glass', 22)
thirsty.augment_item_for_drinking('vessels:glass_bottle', 24)
thirsty.augment_item_for_drinking('vessels:steel_bottle', 26)
end
if minetest.get_modpath("default") and thirsty.config.register_bowl then
-- our own simple wooden bowl
minetest.register_craftitem('thirsty:wooden_bowl', {
description = "Wooden bowl",
@ -44,6 +45,7 @@ minetest.register_craft({
{"", "group:wood", ""}
}
})
end
--[[
@ -60,6 +62,8 @@ Wear corresponds to hydro level as follows:
]]
if minetest.get_modpath("default") and thirsty.config.register_canteens then
minetest.register_tool('thirsty:steel_canteen', {
description = 'Steel canteen',
inventory_image = "thirsty_steel_canteen_16.png",
@ -93,12 +97,16 @@ minetest.register_craft({
}
})
end
--[[
Tier 3
]]
if minetest.get_modpath("default") and minetest.get_modpath("bucket") and thirsty.config.register_drinking_fountain then
minetest.register_node('thirsty:drinking_fountain', {
description = 'Drinking fountain',
drawtype = 'nodebox',
@ -142,12 +150,16 @@ minetest.register_craft({
}
})
end
--[[
Tier 4+: the water fountains, plus extenders
]]
if minetest.get_modpath("default") and minetest.get_modpath("bucket") and thirsty.config.register_fountains then
minetest.register_node('thirsty:water_fountain', {
description = 'Water fountain',
tiles = {
@ -202,6 +214,7 @@ minetest.register_abm({
action = thirsty.fountain_abm,
})
end
--[[
@ -212,6 +225,8 @@ they are searched for in player's inventories
]]
if minetest.get_modpath("default") and minetest.get_modpath("bucket") and thirsty.config.register_amulets then
minetest.register_craftitem('thirsty:injector', {
description = 'Water injector',
inventory_image = 'thirsty_injector.png',
@ -237,3 +252,5 @@ minetest.register_craft({
{ "default:mese_crystal", "default:diamond", "default:mese_crystal"}
}
})
end

View File

@ -75,6 +75,13 @@ thirsty.config = {
['thirsty:injector'] = 0.5,
},
register_vessels = true,
register_bowl = true,
register_canteens = true,
register_drinking_fountain = true,
register_fountains = true,
register_amulets = true,
}
-- read more configuration from thirsty.conf

View File

@ -1,5 +1,5 @@
default
bucket
default?
bucket?
hud?
hudbars?
vessels?

View File

@ -23,10 +23,10 @@ thirsty.config.thirst_per_second = 1.0 / 20.0
thirsty.config.damage_per_second = 1.0 / 10.0
-- How long in seconds you have to remain still to drink from standing
-- in water
thirsty.config.stand_still_for_drink = 1.0,
thirsty.config.stand_still_for_drink = 1.0
-- How long in seconds of not moving before a player is deemed AFK
-- (away from keyboard), such players no longer get thirsty or damaged
thirsty.config.stand_still_for_afk = 120.0, -- 2 Minutes
thirsty.config.stand_still_for_afk = 120.0 -- 2 Minutes
-- regen_from_node is a table defining, for each node type, the
-- amount of hydro per second a player drinks by standing in it.
@ -79,3 +79,25 @@ thirsty.config.fountain_distance_per_level = 5
thirsty.config.extraction_for_item['thirsty:extractor'] = 0.6
-- How much hydration does a given item *inject* (fill you up with)
thirsty.config.injection_for_item['thirsty:injector'] = 0.5
-- Registration of individual components
-- These flags enable or disable the predefined components included
-- in this mod. They do *not* enable or disable the functionality.
-- Should we augment the vessels from the "vessels" mod?
thirsty.config.register_vessels = true
-- Add the wooden bowl and crafting recipe?
thirsty.config.register_bowl = true
-- Add the canteens and crafting recipes?
thirsty.config.register_canteens = true
-- Add the drinking fountain and crafting recipes?
thirsty.config.register_drinking_fountain = true
-- Add the fountain and extenders and crafting recipes?
thirsty.config.register_fountains = true
-- Add the amulets (extractor / injector) and crafting recipes?
thirsty.config.register_amulets = true