[Mod] Sunburn [sunburn]

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

[Mod] Sunburn [sunburn]

by Ben » Tue Sep 08, 2015 21:25

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:

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 » Tue Sep 08, 2015 21:26

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: 1642
Joined: Sat May 17, 2014 18:40
GitHub: DonBatman
IRC: Batman
In-game: Batman

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

by Don » Tue Sep 08, 2015 22:11

+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: 2683
Joined: Thu Nov 01, 2012 12:46

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

by Hybrid Dog » Thu Sep 10, 2015 17:22

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 » Thu Sep 10, 2015 19:12

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: 2683
Joined: Thu Nov 01, 2012 12:46

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

by Hybrid Dog » Thu Sep 10, 2015 21:38

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 » Fri Sep 11, 2015 20:12

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
 

User avatar
Minetestforfun
Member
 
Posts: 936
Joined: Tue Aug 05, 2014 14:09
Location: On earth
GitHub: Darcidride
IRC: Darcidride + MinetestForFun
In-game: Darcidride + MinetestForFun

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

by Minetestforfun » Mon Sep 14, 2015 13:27

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 » Mon Sep 14, 2015 18:44

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 » Wed Sep 16, 2015 23:10

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 » Fri Sep 18, 2015 19:46

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 » Fri Sep 18, 2015 19:51

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 » Wed Oct 21, 2015 21:02

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: 91
Joined: Sun Dec 28, 2014 10:35
Location: Germany
In-game: gerald7

Re: [Mod] Sunburn [sunburn]

by Gerald » Thu Apr 14, 2016 20:32

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

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

Re: [Mod] Sunburn [sunburn]

by twoelk » Thu Apr 14, 2016 21:16

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: 7460
Joined: Wed Oct 29, 2014 20:05
Location: OMICRON
GitHub: azekillDIABLO
In-game: azekill_DIABLO
 

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

Re: [Mod] Sunburn [sunburn]

by Gerald » Mon Apr 18, 2016 22:38

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: 2683
Joined: Thu Nov 01, 2012 12:46

Re: [Mod] Sunburn [sunburn]

by Hybrid Dog » Sun Mar 11, 2018 17:59

The download link doesn't work

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

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

Re: [Mod] Sunburn [sunburn]

by dawgdoc » Mon Mar 12, 2018 05:24

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.
 

User avatar
Hybrid Dog
Member
 
Posts: 2683
Joined: Thu Nov 01, 2012 12:46

Re: [Mod] Sunburn [sunburn]

by Hybrid Dog » Mon Mar 12, 2018 11:45

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

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

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

Re: [Mod] Sunburn [sunburn]

by dawgdoc » Tue Mar 13, 2018 03:22

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. :-}
 

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

Re: [Mod] Sunburn [sunburn]

by PorygonZRocks » Sat Jun 23, 2018 18:44

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


Return to Mod Releases



Who is online

Users browsing this forum: No registered users and 5 guests