starlit  Diff

Differences From Artifact [c766e87490]:

To Artifact [523263fc9a]:


1
2
3

4
5

6
7
8
9
10

11
12
13
14
15
16
17
18
19
..
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
local lib = starlit.mod.lib

local function U(unit, prec, fixed)

	if fixed then
		return function(amt, excludeUnit)

			if excludeUnit then return tostring(amt/prec) end
			return string.format("%s %s", amt/prec, unit)
		end
	else
		return function(amt, excludeUnit)

			if excludeUnit then return tostring(amt/prec) end
			return lib.math.si(unit, amt/prec)
		end
	end
end

local function C(h, s, l)
	return lib.color {hue = h, sat = s or 1, lum = l or .7}
end
................................................................................
	-- numina is measured in daψ
	warmth     = {min = -1000, max = 1000, base = 0, desc = U('°C', 10, true), color = C(5), name = 'Warmth'};
	-- warmth in measured in °C×10
	fatigue    = {min = 0, max = 76 * 60, base = 0, desc = U('hr', 60, true), color = C(288,.3,.5), name = 'Fatigue'};
	-- fatigue is measured in minutes one needs to sleep to cure it
	stamina    = {min = 0, max = 20 * 100, base = true, desc = U('m', 100), color = C(88), name = 'Stamina'};
	-- stamina is measured in how many 10th-nodes (== cm) one can sprint
	hunger     = {min = 0, max = 20000, base = 0, desc = U('Cal', 1), color = C(43,.5,.4), name = 'Hunger'};
	-- hunger is measured in calories one must consume to cure it
	thirst     = {min = 0, max = 1600, base = 0, desc = U('l', 100), color = C(217, .25,.4), name = 'Thirst'};
	-- thirst is measured in centiliters of H²O required to cure it
	morale     = {min = 0, max = 24 * 60 * 10, base = true, desc = U('hr', 60, true), color = C(0,0,.8), name = 'Morale'};
	-- morale is measured in minutes. e.g. at base rate morale degrades by
	-- 60 points every hour. morale can last up to 10 days
	irradiation = {min = 0, max = 20000, base = 0, desc = U('Gy', 1000), color = C(141,1,.5), name = 'Irradiation'};
	-- irrad is measured is milligreys
	-- 1Gy counters natural healing
	-- ~3Gy counters basic nanomedicine



>


>
|
|



>
|
|







 







|
|
|
|







1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
..
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
local lib = starlit.mod.lib

local function U(unit, prec, fixed)
	local trunc = 2
	if fixed then
		return function(amt, excludeUnit)
			local ta = lib.math.trim(amt/prec, trunc)
			if excludeUnit then return tostring(ta) end
			return string.format("%s %s", ta, unit)
		end
	else
		return function(amt, excludeUnit)
			local ta = lib.math.trim(amt/prec, trunc)
			if excludeUnit then return tostring(ta) end
			return lib.math.si(unit, amt/prec, nil, nil, trunc)
		end
	end
end

local function C(h, s, l)
	return lib.color {hue = h, sat = s or 1, lum = l or .7}
end
................................................................................
	-- numina is measured in daψ
	warmth     = {min = -1000, max = 1000, base = 0, desc = U('°C', 10, true), color = C(5), name = 'Warmth'};
	-- warmth in measured in °C×10
	fatigue    = {min = 0, max = 76 * 60, base = 0, desc = U('hr', 60, true), color = C(288,.3,.5), name = 'Fatigue'};
	-- fatigue is measured in minutes one needs to sleep to cure it
	stamina    = {min = 0, max = 20 * 100, base = true, desc = U('m', 100), color = C(88), name = 'Stamina'};
	-- stamina is measured in how many 10th-nodes (== cm) one can sprint
	hunger     = {min = 0, max = 2000e3, base = 0, desc = U('kCal', 1000, true), color = C(43,.5,.4), name = 'Hunger'};
	-- hunger is measured in calories one must consume to cure it. at a 2kCal deficit, you start dying
	thirst     = {min = 0, max = 4e3, base = 0, desc = U('L', 1e3), color = C(217, .25,.4), name = 'Thirst'};
	-- thirst is measured in mL of H²O required to cure it
	morale     = {min = 0, max = 24 * 60 * 10, base = true, desc = U('hr', 60, true), color = C(0,0,.8), name = 'Morale'};
	-- morale is measured in minutes. e.g. at base rate morale degrades by
	-- 60 points every hour. morale can last up to 10 days
	irradiation = {min = 0, max = 20000, base = 0, desc = U('Gy', 1000), color = C(141,1,.5), name = 'Irradiation'};
	-- irrad is measured is milligreys
	-- 1Gy counters natural healing
	-- ~3Gy counters basic nanomedicine