From a12a9e21492ab8d28ad74e0afa9d2e6aac6075ed Mon Sep 17 00:00:00 2001 From: Wuzzy Date: Tue, 21 Sep 2021 15:29:50 +0200 Subject: [PATCH] Add WIP mod hades_atmos --- mods/hades_atmos/README.md | 52 ++++++++++++++++++++++++++++++++++++++ mods/hades_atmos/init.lua | 35 +++++++++++++++++++++++++ mods/hades_atmos/mod.conf | 2 ++ 3 files changed, 89 insertions(+) create mode 100644 mods/hades_atmos/README.md create mode 100644 mods/hades_atmos/init.lua create mode 100644 mods/hades_atmos/mod.conf diff --git a/mods/hades_atmos/README.md b/mods/hades_atmos/README.md new file mode 100644 index 0000000..b69dac2 --- /dev/null +++ b/mods/hades_atmos/README.md @@ -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 ... diff --git a/mods/hades_atmos/init.lua b/mods/hades_atmos/init.lua new file mode 100644 index 0000000..f4b6350 --- /dev/null +++ b/mods/hades_atmos/init.lua @@ -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 diff --git a/mods/hades_atmos/mod.conf b/mods/hades_atmos/mod.conf new file mode 100644 index 0000000..09e8eb2 --- /dev/null +++ b/mods/hades_atmos/mod.conf @@ -0,0 +1,2 @@ +name = hades_atmos +description = Adds an atmosphere system