Index: mods/starlit-electronics/init.lua ================================================================== --- mods/starlit-electronics/init.lua +++ mods/starlit-electronics/init.lua @@ -304,83 +304,89 @@ -- commune ("snooty sophisticates"): limited power, high quality, expensive -- usukwinya ("value engineering"): high power, mid quality, affordable -- eluthrai ("uncompromising"): high power, high quality, wildly expensive -- firstborn ("god-tier"): exceptional + print(dump(starlit.world.tier.fabsum('commune', 'battery'))) local batteryTiers = { makeshift = { name = 'Makeshift'; capacity = .5, decay = 3, leak = 2, dischargeRate = 1, - fab = starlit.type.fab { - element = {copper=10}; - cost = {power = 0.3}; - time = {print = .25}; - }; +-- fab = starlit.type.fab { +-- element = {copper=10}; +-- cost = {power = 0.3}; +-- time = {print = .25}; +-- }; + fab = starlit.world.tier.fabsum('makeshift', 'battery'); desc = "Every attosecond this electrical abomination doesn't explode in your face is but the unearned grace of the Wild Gods."; complexity = 1; sw = {rarity = 1}; }; imperial = { name = 'Imperial'; capacity = 2, decay = 2, leak = 2, dischargeRate = 2; - fab = starlit.type.fab { - element = {copper=15, iron = 20}; - size = { print = 0.1 }; - cost = {power = 2}; - time = {print = .5}; - }; +-- fab = starlit.type.fab { +-- element = {iron = 20}; +-- size = { print = 0.1 }; +-- cost = {power = 2}; +-- time = {print = .5}; +-- }; + fab = starlit.world.tier.fabsum('imperial', 'battery'); desc = "The Empire's native technology is a lumbering titan: bulky, inefficient, unreliable, ugly, and awesomely powerful. Their batteries are no exception, with raw capacity and throughput that exceed even Usukinwya designs."; drm = 1; complexity = 2; sw = {rarity = 2}; }; commune = { name = 'Commune'; capacity = 1, decay = .5, leak = .2, dischargeRate = 1; - fab = starlit.type.fab { - element = {vanadium = 50}; - metal = {steel=10}; - size = { print = 0.05 }; - cost = {power = 1}; - }; + fab = starlit.world.tier.fabsum('commune', 'battery'); +-- fab = starlit.type.fab { +-- element = {vanadium=10}; +-- metal = {aluminum=10}; +-- size = { print = 0.05 }; +-- cost = {power = 1}; +-- }; desc = "The Commune's proprietary battery designs prioritize reliability, compactness, and maintenance concerns above raw throughput, with an elegance of engineering and design that would make a Su'ikuri cry."; complexity = 5; sw = {rarity = 3}; }; usukwinya = { name = 'Usukwinya'; capacity = 2, decay = 1, leak = 1, dischargeRate = 1.5, - fab = starlit.type.fab { - element = {argon=10}; - metal = {vanadium=30}; - size = { print = 0.07 }; - cost = {power = .8}; - }; + fab = starlit.world.tier.fabsum('usukwinya', 'battery'); +-- fab = starlit.type.fab { +-- element = {argon=10, vanadium=10}; +-- size = { print = 0.07 }; +-- cost = {power = .8}; +-- }; desc = "A race of consummate value engineers, the Usukwinya have spent thousands of years refining their tech to be as cheap to build as possible, without compromising much on quality. The Tradebirds drive an infamously hard bargain, but their batteries are more than worth their meagre cost."; drm = 2; sw = {rarity = 10}; complexity = 15; }; eluthrai = { name = 'Eluthrai'; capacity = 3, decay = .4, leak = .1, dischargeRate = 1.5, - fab = starlit.type.fab { - element = {beryllium=20, platinum=20, technetium = 1}; - metal = {cinderstone = 10}; - size = { print = 0.03 }; - cost = {power = 10}; - time = {print = 2}; - }; + fab = starlit.world.tier.fabsum('eluthrai', 'battery'); +-- fab = starlit.type.fab { +-- element = {beryllium=20, platinum=20, technetium = 1}; +-- metal = {cinderstone = 10}; +-- size = { print = 0.03 }; +-- cost = {power = 10}; +-- time = {print = 2}; +-- }; desc = "The uncompromising Eluthrai are never satisfied until every quantifiable characteristic of their tech is maximally optimised down to the picoscale. Their batteries are some of the best in the Reach, and unquestionably the most expensive -- especially for those lesser races trying to copy the designs without the benefit of the sublime autofabricator ecosystem of the Eluthrai themselves."; complexity = 200; sw = {rarity = 0}; -- you think you're gonna buy eluthran schematics on SuperDiscountNanoWare.space?? }; firstborn = { name = 'Firstborn'; capacity = 5, decay = 0.1, leak = 0, dischargeRate = 3; - fab = starlit.type.fab { - element = {neodymium=20, xenon=150, technetium=5}; - metal = {sunsteel = 10}; - crystal = {astrite = 1}; - size = { print = 0.05 }; - cost = {power = 50}; - time = {print = 4}; - }; + fab = starlit.world.tier.fabsum('firstborn', 'battery'); +-- fab = starlit.type.fab { +-- element = {neodymium=20, xenon=150, technetium=5}; +-- metal = {sunsteel = 10}; +-- crystal = {astrite = 1}; +-- size = { print = 0.05 }; +-- cost = {power = 50}; +-- time = {print = 4}; +-- }; desc = "Firstborn engineering seamlessly merges psionic effects with a mastery of the physical universe unattained by even the greatest of the living Starsouls. Their batteries reach levels of performance that strongly imply Quantum Gravity Theory -- and several major holy books -- need to be rewritten. From the ground up."; complexity = 1000; sw = {rarity = 0}; -- lol no }; } @@ -397,11 +403,11 @@ } local batteryTypes = { supercapacitor = { name = 'Supercapacitor'; - desc = 'Room-temperature superconductors make for very reliable, high-dischargeRate, but low-capacity batteries.'; + desc = 'Room-temperature superconductors make for very reliable, high-discharge rate, but low-capacity batteries.'; fab = starlit.type.fab { metal = { enodium = 5 }; size = {print=0.8}; cost = {power = 1e3}; }; @@ -501,11 +507,11 @@ -- elemath(elementCost, bType.fab.element or {}, bSize.matMult) -- elemath(elementCost, bTier.fab.element or {}, bSize.matMult) -- elemath(metalCost, bType.fab.metal or {}, bSize.matMult) -- elemath(metalCost, bTier.fab.metal or {}, bSize.matMult) local fab = bType.fab + bTier.fab + bSize.fab + starlit.type.fab { - element = {copper = 10, silicon = 5}; + element = {copper = 10}; } local baseID = string.format('battery_%s_%s_%s', bTypeName, bTierName, bSizeName) local id = 'starlit_electronics:'..baseID local name = string.format('%s %s Battery', bTier.name, bType.name) Index: mods/starlit/terrain.lua ================================================================== --- mods/starlit/terrain.lua +++ mods/starlit/terrain.lua @@ -1,7 +1,14 @@ local T = starlit.translator local lib = starlit.mod.lib + +local soilRec = starlit.type.fab { + element = { + carbon = 25; + }; + time = { shred = 2.5; }; +}; starlit.terrain = {} local soilSounds = { footstep = 'default-dirt-footstep'; dug = 'default-dug-node'; @@ -34,10 +41,11 @@ drop = soilDrop; sounds = soilSounds; _starlit = { kind = 'block'; elements = {}; + recover = soilRec; }; }) minetest.register_node('starlit:sand', { @@ -58,11 +66,11 @@ groups = {looseClump = 1, lifesilt = 1, falling_node = 1}; drop = ''; sounds = sandSounds; _starlit = { kind = 'block'; - fab = starlit.type.fab { element = { carbon = 8, silicon = 4 } }; + recover = starlit.type.fab { element = { carbon = 16, silicon = 16, rubidium = 4 } }; }; }) minetest.register_craftitem('starlit:soil_clump', { short_description = T 'Soil'; @@ -79,11 +87,11 @@ me:take_item(3) end return me end; _starlit = { - fab = starlit.type.fab { element = { carbon = 12 / 4 } }; + recover = starlit.type.fab { element = { carbon = 25 / 4 } }; }; }) function starlit.terrain.createGrass(def) local drop = { @@ -107,11 +115,10 @@ }; groups = {looseClump = 2, grass = 1, soil = 1, sub_walk = 1}; drop = soilDrop; sounds = grassSounds; _starlit = { - fab = def.fab; recover = def.recover; recover_vary = def.recover_vary; }; }) end @@ -119,47 +126,41 @@ starlit.terrain.createGrass { name = 'starlit:greengraze'; desc = T 'Greengraze'; img = 'starlit-terrain-greengraze'; - fab = starlit.type.fab { - element = { carbon = 12; }; - time = { shred = 2.5; }; - }; + recover = soilRec; } starlit.terrain.createGrass { name = 'starlit:undergloam'; desc = T 'Undergloam'; -- fungal carpet img = 'starlit-terrain-undergloam'; - fab = starlit.type.fab { - element = { - carbon = 12; - }; - time = { shred = 2.5; }; - }; + recover = soilRec; } for _, w in pairs {false,true} do minetest.register_node('starlit:liquid_water' .. (w and '_flowing' or ''), { description = T 'Water'; drawtype = 'liquid'; waving = 3; tiles = { { - name = "default_water_source_animated.png"; +-- name = "default_water_source_animated.png"; + name = "starlit-water.png"; backface_culling = false; animation = { type = "vertical_frames"; aspect_w = 16; aspect_h = 16; length = 2.0; }; }; { - name = "default_water_source_animated.png"; +-- name = "default_water_source_animated.png"; + name = "starlit-water.png"; backface_culling = true; animation = { type = "vertical_frames"; aspect_w = 16; aspect_h = 16; Index: mods/starlit/tiers.lua ================================================================== --- mods/starlit/tiers.lua +++ mods/starlit/tiers.lua @@ -9,12 +9,12 @@ local t = starlit.world.tier.db[name] assert(t, 'reference to nonexisting tier '..name) if t.super then dest = dest+starlit.world.tier.fabsum(t.super, ty)*(t.cost or 1) end - if t.fabclasses and t.fabclasses[ty] then - dest = dest + t.fabclasses[ty] + if t.fabclass and (t.fabclass[ty] or t.fabclass.basis) then + dest = dest + (t.fabclass[ty] or t.fabclass.basis) end return dest end function starlit.world.tier.tech(name, tech) @@ -39,38 +39,38 @@ ------------------ lesser = { name = 'Lesser', adj = 'Lesser'; super = 'base'; - fabclasses = { + fabclass = { basis = fab { - metal = {aluminum=4}; + element = {aluminum=4}; }; }; }; greater = { name = 'Greater', adj = 'Greater'; super = 'base'; - fabclasses = { + fabclass = { basis = fab { - metal = {vanadium=2}; + element = {vanadium=2}; }; }; }; starlit = { - name = 'Starsoul', adj = 'Starsoul'; + name = 'Starlit', adj = 'Starlit'; super = 'base'; - fabclasses = { + fabclass = { basis = fab { - metal = {osmiridium=1}; + element = {iridium=1}; }; }; }; forevanished = { name = 'Forevanished One', adj = 'Forevanished'; super = 'base'; - fabclasses = { + fabclass = { basis = fab { metal = {elusium=1}; }; }; }; @@ -85,13 +85,13 @@ techs = {tool = true, prim = true, electric = true}; power = 0.5; efficiency = 0.3; reliability = 0.2; cost = 0.3; - fabclasses = { -- characteristic materials + fabclass = { -- characteristic materials basis = fab { -- fallback - metal = {iron=3}; + element = {aluminum=4}; }; }; }; imperial = { --powerful trash @@ -100,13 +100,13 @@ techs = {tool = true, electric = true, electronic = true, suit = true, combatSuit = true, weapon = true, hover='ion'}; power = 2.0; efficiency = 0.5; reliability = 0.5; cost = 1.0; - fabclasses = { + fabclass = { basis = fab { - metal = {steel=2}; + element = {iron=2}; }; }; }; commune = { --reliability @@ -115,13 +115,13 @@ techs = {tool = true, electric = true, electronic = true, suit = true, combatSuit = true, weapon = true, gravitic = true, hover='grav'}; power = 1.0; efficiency = 2.0; reliability = 3.0; cost = 1.5; - fabclasses = { + fabclass = { basis = fab { - metal = {titanium=1}; + element = {titanium=1}; time = {print = 1.2}; -- commune stuff is intricate }; }; }; @@ -140,25 +140,25 @@ techs = {psi = true, prim = true, bioSuit = true, psiSuit = true}; power = 1.5; efficiency = 1.0; reliability = 3.0; cost = 2.0; - fabclasses = { + fabclass = { psi = fab { - metal = {numinium = 2.0}; - crystal = {beryllium = 1.0}; + element = {numinium = 2.0}; }; bio = fab { - crystal = {beryllium = 1.0}; + element = {beryllium = 1.0}; }; }; }; usukwinya = { --value for 'money'; no weapons; no hovertech (they are birds) -- NOTA BENE: the ususkwinya *do* have weapons of their own; however, -- they are extremely restricted and never made available except to a - -- very select number of that species. consequently, usuk players + -- very select number of that species, those members who need stronger + -- defenses than their native psionics can provide. consequently, usuk players -- of a certain scenario may have usuk starting weapons, but these must -- be manually encoded to avoid injecting them into the overall crafting -- /loot system. because there are so few of these weapons in existence, -- all so tightly controlled, the odds of the weapons or plans winding -- up on Farthest Shadow are basically zero unless you bring them yourself @@ -167,13 +167,13 @@ techs = lib.tbl.set('tool', 'electric', 'electronic', 'suit', 'gravitic'); power = 2.0; efficiency = 2.0; reliability = 2.0; cost = 0.5; - fabclasses = { + fabclass = { basis = fab { - crystal = {aluminum = 5}; -- ruby + element = {cobalt=2}; }; }; }; eluthrai = { --super-tier @@ -182,16 +182,19 @@ techs = {tool = true, electric = true, electronic = true, weapon = true, gravitic = true, gravweapon = true, suit = true, combatSuit = true, hover = 'grav'}; power = 4.0; efficiency = 4.0; reliability = 4.0; cost = 4.0; - fabclasses = { + fabclass = { basis = fab { - crystal = {carbon = 5}; -- diamond + element = {scandium = 1}; + }; + weapon = { + metal = {cinderstone = 1}; }; special = fab { - metal = {technetium=1, cinderstone=1} + element = {technetium=1}; }; }; }; ----------------------- @@ -204,14 +207,15 @@ techs = {tool = true, electric = true, electronic = true, suit = true, psi = true, combatSuit = true, weapon = true, gravitic = true, gravweapon = true}; power = 10.0; efficiency = 5.0; reliability = 3.0; cost = 10.0; - fabclasses = { + fabclass = { basis = fab { - metal = {technetium=2, neodymium=3, sunsteel=1}; - crystal = {astrite=1}; + element = {technetium=2, neodymium=3}; +-- metal = {sunsteel=1}; +-- crystal = {astrite=1}; }; }; }; forevanisher = { --godslayer-tier @@ -220,14 +224,13 @@ techs = {tool = true, electric = true, electronic = true, suit = true, psi = true, combatSuit = true, weapon = true, gravitic = true, gravweapon = true}; power = 20.0; efficiency = 1.0; reliability = 2.0; cost = 100.0; - fabclasses = { + fabclass = { basis = fab { metal = {}; - crystal = {}; }; }; }; } Index: mods/starlit/user.lua ================================================================== --- mods/starlit/user.lua +++ mods/starlit/user.lua @@ -160,10 +160,11 @@ ----------- -- stats -- ----------- statDelta = function(self, stat, d, cause, abs) + if self.entity:get_hp() == 0 then return end local dt = self.persona.statDeltas local min, max, base = self:statRange(stat) if abs then if d == true then d = max elseif d == false then d = min end @@ -716,11 +717,11 @@ self:updateSuit() end; onRespawn = function(self) local meta = self.entity:get_meta() self.entity:set_pos(vector.from_string(meta:get_string'starlit_spawn')) - self:statDelta('psi', 0, 'death', true) + self:statDelta('numina', 0, 'death', true) self:statDelta('nutrition', 1500, 'death', true) self:statDelta('hydration', 2, 'death', true) self:statDelta('fatigue', 0, 'death', true) self:statDelta('stamina', 0, 'death', true) self:updateSuit() Index: mods/vtlib/math.lua ================================================================== --- mods/vtlib/math.lua +++ mods/vtlib/math.lua @@ -91,11 +91,11 @@ local n = #grad if n == 1 then return grad[1] end local op = pos*(n-1) local idx = math.floor(op) local t = op-idx - return fn.lerp(t, grad[1 + idx], grad[2 + idx]) + return fn.lerp(t, grad[1 + idx] or grad[n], grad[2 + idx] or grad[n]) end function fn.trim(fl, prec) local fac = 10^prec return math.floor(fl * fac) / fac Index: starlit.ct ================================================================== --- starlit.ct +++ starlit.ct @@ -26,10 +26,27 @@ are there other survivors? have they been similarly changed? what was that artifact and who were those terrorists? important questions, all, but they pale in comparison with the most important one: how the fuck are you going to survive the next 24 hours? +## usage +the ideal way to install [`starlit] on your system is to simply clone the repository with [`fossil]. this way, you can easily update the game whenever it's updated. +~~~ +$ cd ~/.minetest/games +$ fossil clone https://c.hale.su/starlit +~~~ +game assets are not versioned. to update these, run the following command [*in the root of the open starlit repository] (otherwise the archiver will shit all over your everything). +~~~ +$ fossil uv cat asset.cpxz | xzcat | cpio -i +~~~ +if, for some unaccountable reason, you don't want to use fossil, you can download a tarball. +~~~ +$ curl https://c.hale.su/starlit/tarball/starlit.tar.gz | tar x +$ curl https://c.hale.su/starlit/uv/asset.cpxz | xzcat | cpio -i +~~~ +eventually i might make proper release tarballs available that bundle the game and assets together, but the game isn't stable enough to do that yet. + ## engine starlit is developed against a bleeding-edge version of minetest. it definitely won't work with anything older than v5.7, and ideally you should build directly from master. starlit is best used with a patched version of minetest, though it is compatible with vanilla. the recommended patches are: