Add WIP mod hades_atmos

master
Wuzzy 2021-09-21 15:29:50 +02:00
parent fba7f0f853
commit a12a9e2149
3 changed files with 89 additions and 0 deletions

View File

@ -0,0 +1,52 @@
## Hades Atmos
This mod adds atmospheric data to the world. Each pos has
'atmospheric values' associated with it.
This mod is still WIP! This is still an early concept only!
## The Concept
There is a static base value that remains fixed for the
entire game and there are various dynamic modifiers put
on top of it.
The most basic modifier is time-based, i.e. a random offset
is applied depending on the world time.
The other basic modifier is position-based, e.g. heat goes
up or down depending on the raw height.
Other mods can apply custom offsets.
Atmos data can be used by various other gameplay mechanics, such as
plant growth, heat stroke, etc.
Currently, these atmos types are available:
* sulphur: How much sulphur is in the air (0.0 to 1.0)
* humidity: Relative humidity (0.0 to 1.0)
* heat: Arbitrary heat value (no upper limit)
* radiation: How radioactive the area is(0.0 to 1.0)
Sulphur is used to limit and control plant growth.
Initially, it is on a high value in the whole world with
little variation.
You need to scrub the air off sulphur to unlock more plants.
A sulphur scrubber will directly reduce the sulphur in the air.
High sulphur also changes the sky color.
Humidity and heat are broadly distributed and high and low values
occur relatively evenly distributed. Heat does increase with depth,
however.
Those are mostly additional requirements for more demanding plants.
For common plants, hitting the right values might boost growth
speed and give other minor bonuses. Very high and very low heat
can also cause heat/cold damage unless the player wears protective
clothing.
Radiation is something unique with varying effects. Under
radiation, most plants wither and die, while other plants might
actually get a strong boost.
The player might take damage without protection.
Radiation also increases spawns of specialized mobs (like mutants).
Radiation might also have beneficial effects; e.g. some unique plants
may grow ONLY in high radiation, or some item can be "charged"
in highly-radiated areas and you can then use the item to do ... stuff.
There might be other effects of radiation ...

35
mods/hades_atmos/init.lua Normal file
View File

@ -0,0 +1,35 @@
hades_atmos = {}
-- This mod is still very incomplete.
-- TODO: Complete the design, write missing functionss
-- This is a stub function, it only returns some fixed dummy values.
-- TODO: Write a proper implementation with dynamic atmos values.
-- Returns the current atmos value for the given pos and atmos type.
-- Returns nil for invalid atmos_type.
function hades_atmos.get_atmos_at_pos(pos, atmos_type)
if atmos_type == "sulphur" then
-- Always pretend we have a clean air for now
return 0.0
elseif atmos_type == "heat" then
-- Always hot
return 1.0
elseif atmos_type == "humidity" then
-- Always dry
return 0.0
elseif atmos_type == "radiation" then
-- Never radiation
return 0.0
end
end
-- This is a stub function.
-- TODO: Write proper implementation
-- Returns true if pos is above a certain threshold
function hades_atmos.is_pos_above_atmos_threshold(pos, atmos_type)
return hades_atmos.get_atmos_at_pos(pos, atmos_type) > 0.5
end

View File

@ -0,0 +1,2 @@
name = hades_atmos
description = Adds an atmosphere system