Page 1 of 1

[Mod] Sunburn [sunburn]

PostPosted: Tue Sep 08, 2015 21:25
by Ben
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.

Your phone or window isn't wide enough to display the code box. If it's a phone, try rotating it to landscape mode.
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)

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

PostPosted: Tue Sep 08, 2015 21:26
by Ben
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!

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

PostPosted: Tue Sep 08, 2015 22:11
by Don
+1

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

PostPosted: Thu Sep 10, 2015 17:22
by Hybrid Dog
Is it possible to use specific mushrooms for an after sun milk?

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

PostPosted: Thu Sep 10, 2015 19:12
by Ben
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?

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

PostPosted: Thu Sep 10, 2015 21:38
by Hybrid Dog
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.

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

PostPosted: Fri Sep 11, 2015 20:12
by Ben
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?

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

PostPosted: Sat Sep 12, 2015 20:25
by Ben
Version 0.2.0 released

Here's the API ;-)

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

PostPosted: Mon Sep 14, 2015 13:27
by Minetestforfun
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

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

PostPosted: Mon Sep 14, 2015 18:44
by Ben
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!

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

PostPosted: Wed Sep 16, 2015 23:10
by eduardomezencio
Minetest hardcore mode: game with both Sunburn and Beware the Dark

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

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

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

PostPosted: Fri Sep 18, 2015 19:51
by Ben
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 :-/

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

PostPosted: Wed Oct 21, 2015 21:02
by Ben
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.

Re: [Mod] Sunburn [sunburn]

PostPosted: Thu Apr 14, 2016 20:32
by Gerald
There is a problem with the download link of version 2.2.

Re: [Mod] Sunburn [sunburn]

PostPosted: Thu Apr 14, 2016 21:16
by twoelk
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

Re: [Mod] Sunburn [sunburn]

PostPosted: Sat Apr 16, 2016 11:43
by azekill_DIABLO
put that mod and Beware the dark and you get an impossible survival :)

Re: [Mod] Sunburn [sunburn]

PostPosted: Mon Apr 18, 2016 22:38
by Gerald
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.