From e5129c412e7ce7d5f6a838030af1ad0e78ac23f0 Mon Sep 17 00:00:00 2001 From: Jordan Irwin Date: Sat, 12 Aug 2017 07:22:03 -0700 Subject: [PATCH] [hbsprint] Update to Git patch f406038: https://github.com/AntumMT/mod-hbsprint/tree/f406038 --- README.md | 2 +- minetest.conf.example | 76 ++++++++++++++++++ mods/player/action/hbsprint/README.md | 9 ++- mods/player/action/hbsprint/init.lua | 9 ++- mods/player/action/hbsprint/settingtypes.txt | 4 + .../textures/sprint_stamina_bgicon.png | Bin 91 -> 171 bytes .../hbsprint/textures/sprint_stamina_icon.png | Bin 180 -> 245 bytes settingtypes.txt | 28 ++++--- 8 files changed, 111 insertions(+), 17 deletions(-) diff --git a/README.md b/README.md index 63444bcb..28a21461 100644 --- a/README.md +++ b/README.md @@ -548,7 +548,7 @@ The game includes the mods from the default [minetest_game](https://github.com/m [patch.gems_encrustable]: https://github.com/AntumMT/mod-gems_encrustable/tree/a043b9c [patch.gems_tools]: https://github.com/AntumMT/mod-gems_tools/tree/cc86c61 [patch.hbarmor]: https://github.com/AntumMT/mod-hbarmor/tree/587dae9 -[patch.hbsprint]: https://github.com/AntumMT/mod-hbsprint/tree/4961941 +[patch.hbsprint]: https://github.com/AntumMT/mod-hbsprint/tree/f406038 [patch.helicopter]: https://github.com/AntumMT/mod-helicopter/tree/9ffee1f [patch.home_gui]: https://github.com/AntumMT/mod-home_gui/tree/588e78f [patch.homedecor]: https://github.com/AntumMT/mp-homedecor/tree/d0d79dc diff --git a/minetest.conf.example b/minetest.conf.example index 877cee2c..b1db0a24 100644 --- a/minetest.conf.example +++ b/minetest.conf.example @@ -1945,6 +1945,82 @@ mobs_animal:sheep_white = 0 +################### +## PLAYER ACTION ## +################### + +# *** hbsprint *** + +## If enabled (default), the stamina indicators in the HUD +# will be automatically hidden shortly after stamina has +# filled up. Otherwise, stamina will always be displayed. +# type: bool +# default: true +#hudbars_autohide_stamina = true + +## Sprint speed multiplier. +# type: float +# default: 1.5 +#sprint_speed = 1.5 + +## Sprint jump multiplier. +# type: float +# default: 1.3 +#sprint_jump = 1.3 + +## Which key to use for sprint. +# type: enum +# values: Use +# default: Use ("E" key by default) +#sprint_key = Use + +## Require player to move forward only to be able to sprint. +# type: bool +# default: true +#sprint_forward_only = true + +## The amount of particles to spawn behind a sprinting player. +# type: float +# default: 2 +#sprint_particles = 2 + +## Drain stamina while sprinting +# type: bool +# default: true +#sprint_stamina = true + +## The amount of stamina to drain while sprinting +# type: float +# default: 2 +#sprint_stamina_drain = 2 + +## The amount of seconds before starting to replenish stamina. +# type: float +# default: 2 +#sprint_stamina_replenish = 2 + +## Drain satiation while sprinting. +# type: bool +# default: true +#sprint_starve = true + +## The amount of satiation to drain while sprinting. +# type: float +# default: 0.5 +#sprint_starve_drain = 0.5 + +## Drain air while sprinting under water. +# type: bool +# default: true +#sprint_breath = true + +## The amount of air to drain while sprinting under water. +# type: float +# default: 1 +#sprint_breath_drain = 1 + + + #################### ## PLAYER VISUALS ## #################### diff --git a/mods/player/action/hbsprint/README.md b/mods/player/action/hbsprint/README.md index e2b912a9..c080bd7d 100644 --- a/mods/player/action/hbsprint/README.md +++ b/mods/player/action/hbsprint/README.md @@ -1,9 +1,15 @@ # hbSprint -License: LGPLv2.1/CC BY-SA 3.0. Particle code: copyright (c) 2017 Elijah Duffy. ## Description A flexible sprint mod supporting stamina, hunger and coexistance with other physics altering mods. +## Licensing +- LGPLv2.1/CC BY-SA 3.0. Particle code: copyright (c) 2017 Elijah Duffy. +- sprint_stamina_\*icon textures: + - CC0 + - Created by Jordan Irwin (AntumDeluge) + - Based on [Running man icon by manio1](https://openclipart.org/detail/254287) + ## Notes hbSprint can be played with Minetest 0.4.16 or above. It has no dependencies, but it supports on [hudbars](http://repo.or.cz/w/minetest_hudbars.git), [hbhunger](http://repo.or.cz/w/minetest_hbhunger.git) and [player_monoids](https://github.com/minetest-mods/player_monoids). @@ -18,6 +24,7 @@ It has no dependencies, but it supports on [hudbars](http://repo.or.cz/w/minetes - Particle spawning based on ground type (Thanks to [octacian](https://github.com/octacian/sprint/)) - All variables customizable in Advanced settings or directly in minetest.conf + ## Known issues - Forward double tap support not implemented diff --git a/mods/player/action/hbsprint/init.lua b/mods/player/action/hbsprint/init.lua index 20929018..5ba1494c 100644 --- a/mods/player/action/hbsprint/init.lua +++ b/mods/player/action/hbsprint/init.lua @@ -12,6 +12,7 @@ local starve = minetest.settings:get_bool("sprint_starve") local starve_drain = tonumber(minetest.settings:get("sprint_starve_drain")) or 0.5 local breath = minetest.settings:get_bool("sprint_breath") local breath_drain = tonumber(minetest.settings:get("sprint_breath_drain")) or 1 +local autohide = minetest.settings:get_bool("hudbars_autohide_stamina") ~= false if dir ~= false then dir = true end if stamina ~= false then stamina = true end if starve ~= false then starve = true end @@ -61,7 +62,7 @@ local function drain_stamina(player) player:set_attribute("stamina", player_stamina - stamina_drain) end if hudbars then - if player_stamina < 20 then hb.unhide_hudbar(player, "stamina") end + if autohide and player_stamina < 20 then hb.unhide_hudbar(player, "stamina") end hb.change_hudbar(player, "stamina", player_stamina) end end @@ -73,7 +74,7 @@ local function replenish_stamina(player) end if hudbars then hb.change_hudbar(player, "stamina", player_stamina) - if player_stamina == 20 then hb.hide_hudbar(player, "stamina") end + if autohide and player_stamina == 20 then hb.hide_hudbar(player, "stamina") end end end @@ -124,7 +125,9 @@ if minetest.get_modpath("hudbars") ~= nil and stamina then player_stamina, player_stamina, false, "%s: %.1f/%.1f") hudbars = true - hb.hide_hudbar(player, "stamina") + if autohide then + hb.hide_hudbar(nil, "stamina") + end end minetest.register_on_joinplayer(function(player) diff --git a/mods/player/action/hbsprint/settingtypes.txt b/mods/player/action/hbsprint/settingtypes.txt index 885b8099..affe8f78 100644 --- a/mods/player/action/hbsprint/settingtypes.txt +++ b/mods/player/action/hbsprint/settingtypes.txt @@ -33,3 +33,7 @@ sprint_breath (Breath) bool true #The amount of air to drain while sprinting under water sprint_breath_drain (Breath drain) float 1 + +#If enabled (default), the stamina indicators in the HUD will be automatically hidden shortly +#after stamina has filled up. Otherwise, stamina will always be displayed. +hudbars_autohide_stamina (Automatically hide staminal indicator) bool true diff --git a/mods/player/action/hbsprint/textures/sprint_stamina_bgicon.png b/mods/player/action/hbsprint/textures/sprint_stamina_bgicon.png index baade32543b44c47357c0aa17e228110e10fbe96..8e56295150d6e03b4b3d21c6b6143eba5fe7d2e2 100644 GIT binary patch delta 142 zcma!E%{W1&p0mIsvY3H^_c{nOI%&+VU|?WiFY)wsWq-)Q!^gz5_sotcppciRi(`n! z`KkVnTnq*rt6n^`t8G8nQRFJ8_ZNZB_X- t=|Pb9v!h3w=ebo_DRGC#n>h0Fb!YQRe->}F0-DOe;pyt@_hGa&!~ delta 61 zcmZ3@7(GG7T*=eLF{FYqSwYr>K~a)RVA2z<1u^Dj9svg(ezhE`P!MHc`20bEvE|4d QZ3ZClboFyt=akR{07+pJtN;K2 diff --git a/mods/player/action/hbsprint/textures/sprint_stamina_icon.png b/mods/player/action/hbsprint/textures/sprint_stamina_icon.png index f37fd30062bd2b1d5fade0f41c1ec35cc333d3e7..89fce3b041235d9540e412a768c4e7a1b62489c3 100644 GIT binary patch delta 229 zcmdnO_?2;jL_G^L0|Ud`yN`l^ltF+`h-*CqgHpGs+GGih>5>|=BsFJC>a379TBm5a zQNwDhro(0fr!B^=Tg^PSTY7G{^4@3tNB!JepkBt3AirP+hi5m^fE>;OkH}&M2Hxu+ z%;=;sy8!L2+zn_hgQu&X%Q~loCIBT5OBetE delta 164 zcmV;V09*g{0ki>-7=H)`0000V^Z#K0004VQL_t(|+P%!r3P3;*$8nEgIk~XpAWD&g zl;Zg)MJYEYjP^h=^T&AlrOE z$;wH%Sj3-A;!Or|$H)J`+v7b0PfW# diff --git a/settingtypes.txt b/settingtypes.txt index 9fd75979..3ed6b618 100644 --- a/settingtypes.txt +++ b/settingtypes.txt @@ -93,40 +93,44 @@ hbarmor_tick (Armor HUD bar update frequency) float 0.1 0.0 4.0 [*hbsprint] -#Sprint speed multiplier +# If enabled (default), the stamina indicators in the HUD will be automatically hidden shortly +# after stamina has filled up. Otherwise, stamina will always be displayed. +hudbars_autohide_stamina (Automatically hide staminal indicator) bool true + +# Sprint speed multiplier. sprint_speed (Sprint speed multiplier) float 1.5 -#Sprint jump multiplier +# Sprint jump multiplier. sprint_jump (Sprint jump multiplier) float 1.3 -#Use a key to sprint +# Which key to use for sprint. Default: "Use" ("E" key by default). sprint_key (Sprint key) enum Use Use -#Require player to move forward only to be able to sprint +# Require player to move forward only to be able to sprint. sprint_forward_only (Sprint forward only) bool true -#The amount of particles to spawn behind a sprinting player +# The amount of particles to spawn behind a sprinting player. sprint_particles (Particles) float 2 -#Drain stamina while sprinting +# Drain stamina while sprinting. sprint_stamina (Stamina) bool true -#The amount of stamina to drain while sprinting +# The amount of stamina to drain while sprinting. sprint_stamina_drain (Stamina drain) float 2 -#The amount of seconds before starting to replenish stamina +# The amount of seconds before starting to replenish stamina. sprint_stamina_replenish (Stamina replenish) float 2 -#Drain satiation while sprinting +# Drain satiation while sprinting. sprint_starve (Starve) bool true -#The amount of satiation to drain while sprinting +# The amount of satiation to drain while sprinting. sprint_starve_drain (Starve drain) float 0.5 -#Drain air while sprinting under water +# Drain air while sprinting under water. sprint_breath (Breath) bool true -#The amount of air to drain while sprinting under water +# The amount of air to drain while sprinting under water. sprint_breath_drain (Breath drain) float 1