mirror of
https://github.com/luanti-org/minetest_game.git
synced 2025-06-06 22:04:25 -04:00
Minetest Game - A lightweight and well-maintained base for Luanti, intended for modding
https://content.luanti.org/packages/Minetest/minetest_game/
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. |
||
---|---|---|
menu | ||
mods | ||
.gitignore | ||
game.conf | ||
game_api.txt | ||
minetest.conf | ||
minetest.conf.example | ||
README.txt |
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