133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
...
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
...
188
189
190
191
192
193
194
195
196
197
198
199
200
201
...
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
|
cost = {
cycles = 100e6;
ram = 500e6;
};
run = shredder{range=3, powerDraw=200};
})
starlit.item.sw.link('starlit_electronics:compile_commune', {
name = 'Compile Matter';
kind = 'suitPower', powerKind = 'direct';
desc = "A basic suit matter compiler program. It's rather slow, but it's been ruthlessly optimized for size- and memory-efficiency by some of the Commune's most fanatic coders, to the point where every Commune nanosuit can come with the program preinstalled.";
size = 700e3;
cost = {
cycles = 4e9;
ram = .3e9;
};
ui = 'starlit:compile-matter-component';
run = function(user, ctx)
end;
})
starlit.item.sw.link('starlit_electronics:compile_block_commune', {
name = 'Compile Block';
kind = 'suitPower', powerKind = 'active';
desc = "An advanced suit matter compiler program, capable of printing complete devices and structure parts directly into the world.";
size = 5e6;
................................................................................
ram = 1e9;
};
ui = 'starlit:compile-matter-block';
run = function(user, ctx)
end;
})
starlit.item.sw.link('starlit_electronics:compile_imperial', {
name = 'Genesis Deluxe';
kind = 'suitPower', powerKind = 'direct';
desc = "House Bascundir has long dominated the matter compiler market in the Crystal Sea. Their firmware is excessively complex due to mountains of specialized edge-case handling, but the end result is certainly speedier than the competitors'.";
size = 2e4;
cost = {
cycles = 100e6;
ram = 1.5e9;
};
ui = 'starlit:compile-matter-component';
run = function(user, ctx)
end;
})
do local J = starlit.store.compilerJob
starlit.item.sw.link('starlit_electronics:driver_compiler_commune', {
name = 'Matter Compiler';
kind = 'driver';
desc = "A driver for a standalone matter compiler, suitable for building larger components than your suit alone can handle.";
................................................................................
cost = {
cycles = 400e6;
ram = .2e9;
};
ui = 'starlit:device-compile-matter-component';
run = function(user, ctx)
end;
bgProc = function(user, ctx, interval, runState)
if runState.flags.compiled == true then return false end
-- only so many nanides to go around
runState.flags.compiled = true
local time = minetest.get_gametime()
local cyclesLeft = ctx.comp.cycles * interval
................................................................................
else
e.value = J.enc(t)
end
if not cyclesLeft > 0 then break end
end
end
ctx.saveConf()
end;
})
end
local function pasv_heal(effect, energy, lvl, pgmId)
return function(user, ctx, interval, runState)
if runState.flags.healed == true then return false end
-- competing nanosurgical programs?? VERY bad idea
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
<
<
<
<
|
<
<
<
<
>
|
|
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
...
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
...
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
...
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
|
cost = {
cycles = 100e6;
ram = 500e6;
};
run = shredder{range=3, powerDraw=200};
})
local function matterCompiler(desc)
return {
name = desc.name;
kind = 'suitPower', powerKind = 'direct';
desc = desc.desc;
size = desc.size;
cost = desc.cost;
ui = 'starlit:compile-matter-component';
bgProc = function(user, ctx, interval, runState)
if runState.flags.compiled == true then return false end
-- only so many nanides to go around
runState.flags.compiled = true
local conf = ctx.file.body.conf
local job_t = starlit.store.compilerJob
local job, jobSlot
for i, v in ipairs(conf) do
if v.key == 'job' then
job = job_t.dec(v.value)
jobSlot = i
goto found
end
end
::notfound:: do
return
end
::found::
local scm = starlit.item.sw.db[job.schematic]
job.cyclesLeft = math.max(0, job.cyclesLeft - ctx.comp.cycles)
if job.cyclesLeft == 0 then
job.timeLeft = math.max(0, job.timeLeft - interval)
end
if job.timeLeft == 0 and job.cyclesLeft == 0 then
table.remove(conf, jobSlot)
user:give(scm.output)
else
conf[jobSlot].value = job_t.enc(job)
end
ctx.saveConf()
end;
}
end
starlit.item.sw.link('starlit_electronics:compile_commune', matterCompiler {
name = 'Compile Matter';
desc = "A basic suit matter compiler program. It's rather slow, but it's been ruthlessly optimized for size- and memory-efficiency by some of the Commune's most fanatic coders, to the point where every Commune nanosuit can come with the program preinstalled.";
size = 700e3;
cost = {
cycles = 4e9;
ram = .3e9;
};
})
starlit.item.sw.link('starlit_electronics:compile_block_commune', {
name = 'Compile Block';
kind = 'suitPower', powerKind = 'active';
desc = "An advanced suit matter compiler program, capable of printing complete devices and structure parts directly into the world.";
size = 5e6;
................................................................................
ram = 1e9;
};
ui = 'starlit:compile-matter-block';
run = function(user, ctx)
end;
})
starlit.item.sw.link('starlit_electronics:compile_imperial', matterCompiler {
name = 'Genesis Deluxe';
desc = "House Bascundir has long dominated the matter compiler market in the Crystal Sea. Their firmware is excessively complex due to mountains of specialized edge-case handling, but the end result is certainly speedier than the competitors'.";
size = 2e4;
cost = {
cycles = 100e6;
ram = 1.5e9;
};
})
do local J = starlit.store.compilerJob
starlit.item.sw.link('starlit_electronics:driver_compiler_commune', {
name = 'Matter Compiler';
kind = 'driver';
desc = "A driver for a standalone matter compiler, suitable for building larger components than your suit alone can handle.";
................................................................................
cost = {
cycles = 400e6;
ram = .2e9;
};
ui = 'starlit:device-compile-matter-component';
run = function(user, ctx)
end;
--[[
bgProc = function(user, ctx, interval, runState)
if runState.flags.compiled == true then return false end
-- only so many nanides to go around
runState.flags.compiled = true
local time = minetest.get_gametime()
local cyclesLeft = ctx.comp.cycles * interval
................................................................................
else
e.value = J.enc(t)
end
if not cyclesLeft > 0 then break end
end
end
ctx.saveConf()
end;]]
})
end
local function pasv_heal(effect, energy, lvl, pgmId)
return function(user, ctx, interval, runState)
if runState.flags.healed == true then return false end
-- competing nanosurgical programs?? VERY bad idea
|