[Mod] Sunburn [sunburn]

Post Reply
User avatar
Ben
Member
Posts: 160
Joined: Tue Mar 31, 2015 20:09

[Mod] Sunburn [sunburn]

by Ben » Post

Sunburn

The goal of this mod is to make sunlight dangerous by causing "sunburn", which damages you directly. Your only chance is to burrow down when the sun comes up.

Current behavior

If you stand in a node with light level 14 or more, you slowly accumulate "sunburn", represented by a hud bar with sun symbols. The more sunburn you have, the more you get damaged per second.

The sunburn will heal in darkness, but slowly. Until it is fully healed, you'll continue to take damage even if you're no longer in the sun!

API

There are accessors for the current sunburn level (0-20), as well as three multipliers: a burn factor (how fast sunburn is gained), a heal factor (how fast sunburn is lost, does not actually heal hp), and a damage factor (how much damage is done from sunburn).

All three factors start at 1.0 and reset to 1.0 at player death. Mods wishing to change any of these factors (sun milk, wearable sombreros, curse of vampirism or similar) should set them any time they change.

Code: Select all

sunburn.get_sunburn(player)              --// returns the level, 0-20
sunburn.set_sunburn(player, value)       --// sets the level, autocapping
sunburn.add_sunburn(player, value)       --// changes the level; negatives allowed

sunburn.get_burn_factor(player)          --// get the burn factor, default 1.0
sunburn.set_burn_factor(player, value)   --// set the burn factor
sunburn.get_heal_factor(player)          --// get the heal factor, default 1.0
sunburn.set_heal_factor(player, value)   --// set the heal factor
sunburn.get_damage_factor(player)        --// get the damage factor, default 1.0
sunburn.set_damage_factor(player, value) --// set the damage factor
All accessors take a minetest player object.


Future plans

None.

Version: 0.2.2
License: Code LGPL 2, Textures CC-BY-SA

Download:
Spoiler
Dependencies:
  • hudbars by Wuzzy (optional)
  • hud by BlockMen (optional)
Last edited by Ben on Sun Nov 01, 2015 20:07, edited 6 times in total.

User avatar
Ben
Member
Posts: 160
Joined: Tue Mar 31, 2015 20:09

Re: [Mod] Sunburn [sunburn] (WIP)

by Ben » Post

This mod is basically a response to (and clone of) Beware the Dark. It has a different damage method, and it's probably not very balanced yet, but it seems to work.

Feedback welcome!

User avatar
Don
Member
Posts: 1643
Joined: Sat May 17, 2014 18:40
GitHub: DonBatman
IRC: Batman
In-game: Batman

Re: [Mod] Sunburn [sunburn] (WIP)

by Don » Post

+1
Many of my mods are now a part of Minetest-mods. A place where you know they are maintained!

A list of my mods can be found here

User avatar
Hybrid Dog
Member
Posts: 2834
Joined: Thu Nov 01, 2012 12:46
GitHub: HybridDog

Re: [Mod] Sunburn [sunburn] (WIP)

by Hybrid Dog » Post

Is it possible to use specific mushrooms for an after sun milk?

‮‪‮
‮‪‮
‮‪‮
‮‪‮
‮‪‮
‮‪‮
‮‪‮
‮‪‮
‮‪

User avatar
Ben
Member
Posts: 160
Joined: Tue Mar 31, 2015 20:09

Re: [Mod] Sunburn [sunburn] (WIP)

by Ben » Post

Hybrid Dog wrote:Is it possible to use specific mushrooms for an after sun milk?
That is technically outside the scope of this mod. However, it should not be outside the scope of this mod to allow you to create such a sun milk.

With my other mods (yes, even I can notice the trend by now :-/ ), I've added or planned an API to allow other mods to directly add or subtract the attribute in question, and to change a "factor". However, since Sunburn works a bit differently than the others (where you burn the secondary attribute before you burn health), I'll have to think about this. Probably make it two "factors".

Then you could try out various things, such as a sun milk that simply removes three "suns" on use, or a PEP effect that reduces the sunburn increase speed by some SPF for 30 seconds. How does that sound?

User avatar
Hybrid Dog
Member
Posts: 2834
Joined: Thu Nov 01, 2012 12:46
GitHub: HybridDog

Re: [Mod] Sunburn [sunburn] (WIP)

by Hybrid Dog » Post

Ben wrote:
Hybrid Dog wrote:Is it possible to use specific mushrooms for an after sun milk?
That is technically outside the scope of this mod. However, it should not be outside the scope of this mod to allow you to create such a sun milk.

With my other mods (yes, even I can notice the trend by now :-/ ), I've added or planned an API to allow other mods to directly add or subtract the attribute in question, and to change a "factor". However, since Sunburn works a bit differently than the others (where you burn the secondary attribute before you burn health), I'll have to think about this. Probably make it two "factors".

Then you could try out various things, such as a sun milk that simply removes three "suns" on use, or a PEP effect that reduces the sunburn increase speed by some SPF for 30 seconds. How does that sound?
Changing the sunburn increase speed sounds good.

‮‪‮
‮‪‮
‮‪‮
‮‪‮
‮‪‮
‮‪‮
‮‪‮
‮‪‮
‮‪

User avatar
Ben
Member
Posts: 160
Joined: Tue Mar 31, 2015 20:09

Re: [Mod] Sunburn [sunburn] (WIP)

by Ben » Post

Hybrid Dog wrote:Changing the sunburn increase speed sounds good.
I still need to test this, but I've got code lined up that handles this. You can change the factor for burning, for damage and for "healing" (i.e. the sunburn decreases again). How does that sound?

User avatar
Ben
Member
Posts: 160
Joined: Tue Mar 31, 2015 20:09

Re: [Mod] Sunburn [sunburn] (WIP)

by Ben » Post

Version 0.2.0 released

Here's the API ;-)

Minetestforfun
Member
Posts: 940
Joined: Tue Aug 05, 2014 14:09
GitHub: MinetestForFun
IRC: MinetestForFun
In-game: MinetestForFun
Location: On earth
Contact:

Re: [Mod] Sunburn [sunburn] (WIP)

by Minetestforfun » Post

Great idea and work :)

Just an idea :
if sunburn is activated (increased) only when players are in desert + sun, maybe it will be more real and add a different gameplay ? It can be a different mod idea or a feature of this mod :p

User avatar
Ben
Member
Posts: 160
Joined: Tue Mar 31, 2015 20:09

Re: [Mod] Sunburn [sunburn] (WIP)

by Ben » Post

Minetestforfun wrote:if sunburn is activated (increased) only when players are in desert + sun, maybe it will be more real and add a different gameplay ? It can be a different mod idea or a feature of this mod :p
Hi there! FaceDeer had asked for a mod like this (in the Beware the Dark thread) as part of a post-apocalyptic game idea, so there's at least that use case as well. And HybridDog asked above about a mushroom-based sun milk.

My take is that those additions, like your desert+sun idea, are great, but outside the scope of this mod. But with the recent API, these should be easy to implement in a game (or another mod): simply test periodically whether the player is in such a dangerous biome, and adjust sunburn.set_burn_factor accordingly: 1.0 for danger, 0.0 for safe biomes.

Try it, and let us know how it went!

User avatar
eduardomezencio
Member
Posts: 73
Joined: Tue Sep 08, 2015 17:48
GitHub: eduardomezencio

Re: [Mod] Sunburn [sunburn] (WIP)

by eduardomezencio » Post

Minetest hardcore mode: game with both Sunburn and Beware the Dark

User avatar
Ben
Member
Posts: 160
Joined: Tue Mar 31, 2015 20:09

Re: [Mod] Sunburn [sunburn] (WIP)

by Ben » Post

eduardomezencio wrote:Minetest hardcore mode: game with both Sunburn and Beware the Dark
Interestingly, that's actually perfectly possible. Both mods are "safe" at light levels between 8 and 13 (inclusive). And with the current "torch loophole", you can regenerate sanity (from Beware the Dark) while standing in a torch and not get burnt.

So if you try it, I'd recommend tweaking Beware the Dark to disallow this; then you must get sunburnt to stay sane.

Please do try it, and let us know how it went :-D

User avatar
Ben
Member
Posts: 160
Joined: Tue Mar 31, 2015 20:09

Re: [Mod] Sunburn [sunburn] (WIP)

by Ben » Post

Oh, a silly mistake caused a bump to version 0.2.1, by the way: I had included the wrong license file. The code is identical otherwise :-/

User avatar
Ben
Member
Posts: 160
Joined: Tue Mar 31, 2015 20:09

Re: [Mod] Sunburn [sunburn] (WIP)

by Ben » Post

Version 0.2.2 released

No new features, just externalized the configuration, and added two example configurations for the Better Hud mod.

I now consider this feature complete, and am preparing to have it moved to "released" status.

Gerald
Member
Posts: 93
Joined: Sun Dec 28, 2014 10:35
In-game: gerald7
Location: Germany

Re: [Mod] Sunburn [sunburn]

by Gerald » Post

There is a problem with the download link of version 2.2.

twoelk
Member
Posts: 1482
Joined: Fri Apr 19, 2013 16:19
GitHub: twoelk
IRC: twoelk
In-game: twoelk
Location: northern Germany

Re: [Mod] Sunburn [sunburn]

by twoelk » Post

try here https://github.com/bendeutsch/minetest-sunburn

I wonder something like snow blindness might be possible. Maybe with a white overlay slowly blocking the view - or simply the fog increasing

User avatar
azekill_DIABLO
Member
Posts: 7507
Joined: Wed Oct 29, 2014 20:05
GitHub: azekillDIABLO
In-game: azekill_DIABLO
Location: OMICRON
Contact:

Re: [Mod] Sunburn [sunburn]

by azekill_DIABLO » Post

put that mod and Beware the dark and you get an impossible survival :)
Gone, but not dead. Contact me on discord: azekill_DIABLO#6565
DMs are always open if you want to get in touch!

Gerald
Member
Posts: 93
Joined: Sun Dec 28, 2014 10:35
In-game: gerald7
Location: Germany

Re: [Mod] Sunburn [sunburn]

by Gerald » Post

azekill_DIABLO wrote:put that mod and Beware the dark and you get an impossible survival :)
I am working on a subgame using both but I reduce speed and damage. I add items which will make sunburn worse and bewarethedark more easy (and vice versa). I think it works.

User avatar
Hybrid Dog
Member
Posts: 2834
Joined: Thu Nov 01, 2012 12:46
GitHub: HybridDog

Re: [Mod] Sunburn [sunburn]

by Hybrid Dog » Post

The download link doesn't work

‮‪‮
‮‪‮
‮‪‮
‮‪‮
‮‪‮
‮‪‮
‮‪‮
‮‪‮
‮‪

dawgdoc
Member
Posts: 260
Joined: Mon Feb 27, 2017 01:10
GitHub: dawgdoc

Re: [Mod] Sunburn [sunburn]

by dawgdoc » Post

Hybrid Dog wrote:The download link doesn't work
Did you try the github link provided by Twoelk three posts above yours? It was still active when I clicked on it.
Give a man a fish, feed him for a day. Give a kid a fish, it's going to die.

User avatar
Hybrid Dog
Member
Posts: 2834
Joined: Thu Nov 01, 2012 12:46
GitHub: HybridDog

Re: [Mod] Sunburn [sunburn]

by Hybrid Dog » Post

Sorry, l accidentally didn't read the latest posts.

‮‪‮
‮‪‮
‮‪‮
‮‪‮
‮‪‮
‮‪‮
‮‪‮
‮‪‮
‮‪

dawgdoc
Member
Posts: 260
Joined: Mon Feb 27, 2017 01:10
GitHub: dawgdoc

Re: [Mod] Sunburn [sunburn]

by dawgdoc » Post

Hybrid Dog wrote:Sorry, l accidentally didn't read the latest posts.
No worries, and it could have easily been down. That is a two year old post. :-}
Give a man a fish, feed him for a day. Give a kid a fish, it's going to die.

PorygonZRocks
New member
Posts: 5
Joined: Sun Jun 25, 2017 00:35
GitHub: BeeeWall

Re: [Mod] Sunburn [sunburn]

by PorygonZRocks » Post

Is there a way to change the burn speed in settings, or do you have to edit the mod?

Post Reply

Who is online

Users browsing this forum: No registered users and 13 guests