Minetest Game - A lightweight and well-maintained base for Luanti, intended for modding https://content.luanti.org/packages/Minetest/minetest_game/
Find a file Use this template
Auke Kok d905f66d30 ~~~Hunger.~~~ Stamina
This code adds ~~~hunger~~~ stamina to minetest_game.

This code is entirely derived from Blockmen's hunger+hud mod.  Credits
and copyright are preserved as they are compatible with minetest_game.

gameplay:

The player stat 'stamina' is added. The higher the value, the better. A
value of 5 or higher causes the player to slowly get healed over time,
at the cost of stamina. One can only be healed if the stamina value is
higher than, or equal to the health value.

Eating food causes 'stamina' to increase. The visual range of stamina
is 0-20, but one can eat slightly over that. If the stamina is at max,
items are not eaten anymore.

At stamina 2 or lower, the player is damaged periodically, and will
die if the stamina value isn't increased due to eating.

If eating a food that has a negative hp_change value, such as red
mushrooms, the player takes periodical damage to the amount of the
hp_change value. During this time, the player is "poisoned". This
poison damage can not kill the player.

Added by me is code to add exhaustion on crafting, and on player
combat. I also added extra exhaustion when the player is jumping

code:

This mod started as BlockMen's hunger+hud mod. I trimmed the entire
hud mod away and placed the stamina bar on top of the hp hud element,
which will make the relation between stamina and hp a bit more clear,
and doesn't require moving the air hud element.

The stamina mod was reduced to fit a single file. I trimmed some
legacy code, revised all local/global usage. Renamed most internal
variables, and generally did a lot of removals of needlessly complex
code favoring simplicity.

The food registration code is entirely removed. Instead we assume food
just adds stamina or ticks damage as poison. Food eating callbacks are
still called. Subsequently, this mod will likely not properly work
with BlockMen's hud code anymore, nor is that intended to work. Food
mods just have to call item_eat().

I've moved and credited authors for the used textures. I replaced
the food sound of this mod with 3 different sounds.

The code points out several issues with core: There's no decent
place to store player stats. This mod solves it by creating a per
player inventory purely for storing an integer value. Intercepting
core.do_item_eat() also isn't the nicest way to make this work.
2016-02-17 07:16:02 -08:00
menu New header image 'Minetest Game' 2015-10-10 16:28:40 +01:00
mods ~~~Hunger.~~~ Stamina 2016-02-17 07:16:02 -08:00
.gitignore Add patch files to gitignore 2015-06-09 22:01:25 +02:00
game.conf Rename to Minetest Game 2015-09-30 23:33:12 +01:00
game_api.txt New mesh door models, and extensive door API 2016-02-13 03:47:28 +00:00
minetest.conf Minetest.conf: Move mapgen flags to engine .conf 2015-04-14 02:32:06 +01:00
minetest.conf.example Fire: Add 'permanent flame' node 2015-10-28 03:08:09 +00:00
README.txt New header image 'Minetest Game' 2015-10-10 16:28:40 +01:00

Minetest Game [minetest_game]
=============================
The main subgame for the Minetest engine
========================================

To use this subgame with the Minetest engine, insert this repository as
	/games/minetest_game

The Minetest engine can be found in:
	https://github.com/minetest/minetest/

Compatibility
--------------
The Minetest Game github master HEAD is generally compatible with the github
master HEAD of the Minetest engine.

Additionally, when the Minetest engine is tagged to be a certain version (eg.
0.4.10), Minetest Game is tagged with the version too.

When stable releases are made, Minetest Game is packaged and made available in
	http://minetest.net/download
and in case the repository has grown too much, it may be reset. In that sense,
this is not a "real" git repository. (Package maintainers please note!)

License of source code
----------------------
Copyright (C) 2010-2012 celeron55, Perttu Ahola <celeron55@gmail.com>
See README.txt in each mod directory for information about other authors.

This program is free software; you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as published by
the Free Software Foundation; either version 2.1 of the License, or
(at your option) any later version.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU Lesser General Public License for more details.

You should have received a copy of the GNU Lesser General Public License along
with this program; if not, write to the Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.

License of media (textures and sounds)
--------------------------------------
Copyright (C) 2010-2012 celeron55, Perttu Ahola <celeron55@gmail.com>
See README.txt in each mod directory for information about other authors.

Attribution-ShareAlike 3.0 Unported (CC BY-SA 3.0)
http://creativecommons.org/licenses/by-sa/3.0/

License of menu/header.png
Copyright (C) 2015 paramat CC BY-SA 3.0