-- Reviewed policy, not executable Wikipedia prose. No network, scheduler or map writes. return function(hearth, api) local E = {} local B = assert(hearth.botany, "species effects require botany") local articles=hearth.wiki_articles if not articles and api.get_modpath then articles=dofile(api.get_modpath("hearth").."/wiki_articles.lua") end local function copy(t) if type(t)~="table" then return t end local out={}; for k,v in pairs(t) do out[k]=copy(v) end; return out end local function finite(n) return type(n)=="number" and n==n and math.abs(n)0 then if finite(h.moisture) then out.moisture=math.max(0,math.min(1,h.moisture+mats*0.1)) end if finite(h.ph) then out.ph=math.max(3.5,math.min(8.5,h.ph-mats*0.2)) end end elseif h.freshwater==true and h.aquatic=="submerged" and finite(h.light) then out.light=h.light-math.min(count(seen.duckweed,4)*1.5,math.max(0,h.light-2)) end return out end return E end