1. For issues you find with the Switch and Console releases, please follow this link and give as much detail as possible. This is the speediest way to get info to Pipeworks and get a hotfix in the works.
    Dismiss Notice

tModLoader Stamina

Discussion in 'Released' started by hamstar, Dec 8, 2016.

  1. hamstar

    hamstar Steampunker

    [​IMG]
    Stamina
    v2.0.7.1



    Note: Requires Mod Helpers


    This mod gives your player a stamina bar. Running, jumping, dashing, grappling, and item use all draw stamina, and will leave you briefly exhausted if over done. Exhaustion increases fatigue, which temporarily lowers max stamina. Gain enough fatigue, and you'll exercise your stamina (read: permanently increase your max stamina), but only after your fatigue wears off.

    Also, consuming Fallen Stars recovers stamina, and a craftable Energy Potion is also available to temporary regenerate stamina quickly. Drinking Water Bottles recovers fatigue.

    You can adjust mod settings in the configuration file found in 'Documents/My games/Terraria/ModLoader/Mod Configs/Stamina Config.json'.

    Source code now available. API now available (now featuring Mod.Call() bindings).

    • [​IMG] Energy Potion (potion) - Increases stamina regeneration for a short while. Crafted at a bottle/alchemy station with:
      • 1 Bottled Honey
      • 1 Swiftness Potion
      • 1 Daybloom
      • 1 Fallen Star
      • 1 Purification Powder
    • [​IMG] Athlete Potion (potion) - Increases max stamina by 100 for some time. Crafted at a bottle/alchemy station with:
      • 1 Bottled Water
      • 1 Bone
      • 1 Strange Plants
    • [​IMG] Rage Headband (accessory) - Trades exhaustion for damage. Crafted at a tinkerer's workshop with:
      • 1 Magma Stone
      • 4 Hook
      • 5 Silk
    • [​IMG] Exercise Supplements (accessory) - Increases gains from exercising. Crafted at a tinkerer's workshop with:
      • 1 Vitamins
      • 15 Pink Gel
      • 15 Stinger
      • 5 Pumpkin Pie
    • [​IMG] Champion Belt (accessory) - Reduces stamina drain from item use. Crafted at a tinkerer's workshop with:
      • 1 Titan Glove
      • 1 Avenger Emblem
      • 10 Leather
    • [​IMG] Joint Bracer (accessory) - Reduces stamina drain from non-jump movement. Also gives knockback resistance. Crafted at a tinkerer's workshop with:
      • 1 Dual Hook
      • 25 Cogs
      • 1 Basic knockback resist shield (Cobalt Shield, Obsidian Shield)
      • 4 Weighted Pressure Plates (any)
    • [​IMG] Leg Springs (accessory) - Reduces stamina drain from jumping. Also gives fall resistance. Crafted at a tinkerer's workshop with:
      • 1 Ninja Item (tabi or black belt)
      • 1 Frog Legs
      • 10 Iron Bars
    • [​IMG] Powered Exoskeleton Frame (accessory) - Reduces general stamina drain. Also gives fall and knockback resistance. Crafted at a tinkerer's workshop with:
      • 1 Champion Belt
      • 1 Joint Bracer
      • 1 Leg Springs
      • 2 Lihzahrd Power Cell
      • 50 Conveyor Belts


    Installation

    Requires tModLoader (0.10). Copy the above .tmod file to your 'Documents/My Games/Terraria/ModLoader/Mods' folder to play.


    v2.0.7.1
    • Fixed incorrect adding with AddMaxStamina(...)
    v2.0.7
    • Restructured StaminaLogic code files to better separate exercise and stat-only stuff
    • Added StaminaLogic.AddMaxStamina(Player, int)
    • Added StaminaAPI.AddMaxStamina(Player, int)
    • Added AddMaxStamina clamping against negative/low values
    • Fixed trying to display on-player stamina bar displaying while dead
    • Minor internal changes
    v2.0.6
    • Updated to MH v4.2.3 (including conventions)
    • Changed snake case to camel case
    v2.0.5
    • Updated to Mod Helpers v2.0.2
    • Assorted config updates
    • Fixed occasional draw error
    • Restructured player code
    • Added MP player load bug failsafe
    v2.0.4.9
    • Fixed possible crash on load
    • Removed stamina drains from re-jumping (non-responsive mid-air jumps)
    v2.0.3
    • Minor internal refactoring
    • Added API Mod.Call() bindings
    • Fixed config field CustomItemUseRate default values
    • Nerfed stamina accessory drain reduction (70% -> 80%)
    v2.0.2
    • Changed Joint Bracer recipe
    • Recolored Athlete Potion
    • Fixed (hopefully) player stamina bar overlay
    • Slightly buffed Energy Potion
    v2.0.1.4
    • (Hopefully) fixed a crash/rendering issue
    v2.0.1.2
    • Fixed 'ExhaustionBlocksItems' config setting
    v2.0.1.1
    • Rage headband now gives more correct damage
    • Exhaustion effect glitching fixed
    v2.0.0
    • Added mini stamina bar beneath player (can be repositioned)
    • Tweaked stamina use default settings
    • Nerfed Energy Potion
    • Added Athlete Potion (adds max stamina)
    • Added 5 new accessories
    • Improved API
    • Assorted internal refactoring
    v1.5.0.1
    • Added mod icon
    • Added support for Hamstar Helpers v1.2.0 issue report
    • Refactored net protocol
    • Assorted refactoring
    • Added a basic API class
    v1.4.12
    • Exercise increases max stamina by +3 (was +2)
    • Reduced stamina drain from magic items doesn't apply for Space Gun and Laser Rifle while wearing Meteor Armor
    • Minor refactoring
    v1.4.11
    • Updated for TML 0.10
    • Offloaded utility/helper code to Hamstar's Helpers mod (now a dependency)
    • Numerous fixes and tweaks
    v1.4.10
    • Added config setting 'Enabled' (allows disabling mod without unload)
    v1.4.9
    • Tweaked item use rate
    • Removed deathweed from Energy Potion recipe
    v1.4.8
    • Toned down drain from item use slightly
    • Removed Jungle Grass Seeds from Energy Potion recipe
    • Removed old config ("Stamina 1.2.0.json")
    v1.4.7
    • Greatly reduced gravitation potion drain rate + added config setting.
    v1.4.6
    • Changed default config settings for exercise growth and magic item use rate.
    v1.4.5
    • Changed some default config settings.
    • Added new config settings.
    • Config file relocated to Mod Configs.
    • Minor code improvements.
    v1.4.4
    • Fixed config reloading between game sessions.
    v1.4.3
    • Lowered exercise threshold percent and added config settings.
    v1.4.2
    • Added config settings for exercising.
    • Lowered threshold before fatigue produces exercise.
    • Added sound + new visuals for exercise.
    v1.4.1
    • Fixed popup number failing to display for exercised stamina increase.
    • Set water bottles to remove 50 fatigue.
    • Set exercise to occur when fatigue 25 away from max.
    • Increased default fatigue gain.
    v1.4.0
    • Added config option to override stamina bar position.
    • Expending stamina increases fatigue (temporarily lowers max stamina).
    • Maxing fatigue and then recovering it to full exercises stamina (increases max stamina).
    • Drinking water bottles recovers fatigue.
    • Altered Energy Potion recipe (uses Jungle Grass Seeds instead of Fireflies).
    • Gravitation Potion reduces stamina recovery by half.
    • Taking damage gives small bursts of stamina.
    • Various stamina settings tweaks (see config).
    • Magic weapons use half stamina.
    v1.3.4
    • Fixed star eat fail.
    v1.3.0-2
    • Nerfed Energy Potion and changed its recipe: Bottled Honey, Daybloom, Deathweed, Fallen Star, Firefly, Purification Powder
    • Tweaked stamina drain settings.
    • Added various code improvements.
    v1.2.0
    • Added visual indicator of low stamina (sweat drops).
    • Added stamina bar color change when < 33%.
    • Wing floating no longer draws stamina.
    v1.1.5
    • Added proper multiplayer support. Just 'cause.
    v1.1.4
    • Exposed classes for DLL reference use. No gameplay changes.
    v1.1.1-3
    • (Hopefully) fixed a crash bug.
    v1.1.0
    • Added a craftable Energy Potion for stamina recovery (Bottled Water, Pink Gel, Fallen Star, Purification Powder)
    • Lots of improvements and fixes to stamina draining.
    • Fallen Stars can be consumed raw for small stamina boosts.

    [​IMG]

     
    Last edited: Apr 11, 2019
  2. Zynvire

    Zynvire Terrarian

    Cool mod, and idea. Best of luck with more!
     
  3. Willexwun

    Willexwun Terrarian

    It would be nice to be able to drink water to restore stamina
     
    Hedgen and hamstar like this.
  4. rel00p

    rel00p Terrarian

    What's next? Needs? Diseases? Aging?
     
  5. hamstar

    hamstar Steampunker

    An NPC dating sim mod!

    But for real, just a wormholes mod. Complete with town portal scrolls.
     
    Lunatic Lobbyist and Cyanogynist like this.
  6. Cyanogynist

    Cyanogynist Cultist

    That's cool and all, going on a modding adventure to make Terraria more realistic again, but we actually want the dating sim mod.
     
  7. hamstar

    hamstar Steampunker

    v1.1.0 for the new tModLoader update. Added a craftable Energy Potion for stamina recovery, and heavily tweaked the stamina system.
     

    Attached Files:

  8. Aspartam

    Aspartam Terrarian

    hi, I created a new character and a new world, I used this with some other mods. When I try to enter world, game crashed. I disabled Stamina and tried to load again , it was succesfull. But I didn't try to progress yet so not sure it was a one time error and sth will happen again. I hope I posted in right place.
    http://steamcommunity.com/sharedfiles/filedetails/?id=817279400
     
    hamstar likes this.
  9. hamstar

    hamstar Steampunker

    Tell me if this solves the problem:
     

    Attached Files:

    000 likes this.
  10. Aspartam

    Aspartam Terrarian

    Attached Files:

  11. hamstar

    hamstar Steampunker

    Sorry about that. Try this:
     

    Attached Files:

    Aspartam and 000 like this.
  12. Aspartam

    Aspartam Terrarian

    thank you, and there is nothing to apologize, it is only normal , these things happen while creating sth new and awesome like your mod. And about durability, it is nicely brutal, I wasn't paying attention and didn't dig enough ores. Now I am like a fish out of ocean, time to find some bombs :p I dare not use Lives yet :D
    Edit: Opps, about durability; seems like I boxed myself with wood blocks at my spawn with out those bombs so I am stuck , lol. I can spawn a pickaxe or load world with another character, but do think there can be a solution within the mod (like a wooden pickaxe with terrible durability)? or do you think this is the point/importance of the mod and I should just create new character/world?
     
    Last edited: Dec 13, 2016
  13. hamstar

    hamstar Steampunker

    It's sorta the point. Albeit it's not super obvious up front that you can get a merchant for a renewable supply of pickaxes, axes, and shuriken and a demoman for grenades and such. I don't have a really good solution for that.

    Edit: New version exposes classes for DLL reference use. No gameplay changes.

    Edit Edit: Added proper multiplayer support. Just 'cause.
     

    Attached Files:

    Last edited: Dec 19, 2016
  14. Aspartam

    Aspartam Terrarian

    ok. I will create new character/world. (Since it was the very beginning of world (like first 2 days), I also died and dropped money , so I only have 5 silver 14 copper coins, merchant npc wouldn't spawn)
     
  15. hamstar

    hamstar Steampunker

    v1.2.0
    • Added visual indicator of low stamina (sweat drops).
    • Added stamina bar color change when < 33%.
    • Wing floating no longer draws stamina.
     

    Attached Files:

  16. Iara

    Iara Official Terrarian

    It's me! Your self-proclaimed biggest fan!
    First off- Before you added the stamina bar color change, I WAS gonna suggest just that! I am so glad you added it.

    Something I think this mod needs tho: Auto-Stamina button. Could there be a way to bound a button, so that said button automatically uses Fallen Stars in the inventory to recover stamina?
    You really need stamina to jump around and dodge enemies and the like (If you don't want to spend Energy potions), so being able of using Fallen Stars quickly would help.
     
    hamstar likes this.
  17. Sapharan

    Sapharan Golem

    I would love some stamina buffs (more stamina, stamina used slower) potions and accesories.
     
    hamstar likes this.
  18. hamstar

    hamstar Steampunker

    That'll come in a later version. There is an Energy Potion available now, though (and you can eat Fallen Stars for brief spurts). Meanwhile:

    New to v1.3.0
    • Nerfed Energy Potion and changed its recipe: Bottled Honey, Daybloom, Deathweed, Fallen Star, Firefly, Purification Powder
    • Tweaked stamina drain settings.
    • Added various code improvements.
    New to 1.3.2:
    • More tweaks to formula.
    1.3.4:
    • Fixed star eat fail.
     

    Attached Files:

    Last edited: Jan 21, 2017
  19. Le tromp du Jawa

    Le tromp du Jawa Eye of Cthulhu

    Could you maybe make a UI element for stamina in the same fashion as health and magica ? (take a look at the custom bars mod)

    Also you could make it that after so many actions you gain more stamina ?
     
    hamstar likes this.
  20. Ariannae

    Ariannae Terrarian

    This mod is great. Adds a really cool new dynamic to the game that makes it a lot harder to just cheese certain aspects of the game (Digging a shaft directly into Hell, for one).

    One thing I would really like to see is a consumable that actually increases your maximum Stamina, exactly like how Life Crystals and Mana Crystals improve their respective resources. I consider Stamina a resource in a similar vein, and believe that it should also have something that increases the maximum amount of Stamina that is not simply an accessory. Having accessories to complement Stamina (Similarly to how there are accessories that complement Life and Mana, but you are able to increase it without reliance on an accessory) would be awesome though. However, to compensate, I would like to see the beginning Stamina lowered a decent bit, as it would feel like your character gains greater endurance over the course of the game.

    Having some way to utilize Stamina in different ways would be awesome too; maybe holding the Space bar would let you jump higher for a large expense of Stamina. Or maybe pressing a key would allow you to Sprint, giving you a speed boost (A la Skyrim). I think this would add a lot of depth to the Stamina system and also make it feel like a true resource that you can actively use.

    Another note; I don't think that Spells should necessarily use Stamina. Those are already restricted by Mana, and it doesn't really feel right to have casting a spell drain your Stamina as well.
     
    hamstar likes this.