starlit  Diff

Differences From Artifact [1f09b99871]:

To Artifact [6f8dfbcd79]:


45
46
47
48
49
50
51

52
53
54
55
56
57
58
..
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
...
248
249
250
251
252
253
254

255
256
257
258
259
260
261
...
356
357
358
359
360
361
362

363
364
365
366
367
368
369





















370
371
372
373
374
375
376
	};
	liveUI = {
		-- cached subset of activeUI containing those UIs needing live updates
	};

	interface = lib.registry.mk 'starlit:interface';
	item = {

	};

	region = {
		radiator = {
			store = AreaStore();
			emitters = {}
		};
................................................................................
		fact = lib.registry.mk 'starlit:fact';
		time = {
			calendar = {
				empire  = {
					name = 'Imperial Regnal Calendar';
					year = function(t, long)
						local reigns = {
							-- if anyone actually makes it to his Honor & Glory Unfailing Persigan I i will be
							-- exceptionally flattered
							{4, 'Emperor', 'Atavarka', 'the Bold'}; -- died at war
							{9, 'Emperor', 'Vatikserka', 'the Unconquered'}; -- died at war
							{22, 'Emperor', 'Rusifend', 'the Wise'}; -- poisoned at diplomacy
							{61, 'Empress', 'Tafseshendi', 'the Great'}; -- died of an 'insurrection of the innards' after a celebrated reign
							{291, 'Emperor', 'Treptebaska', 'the Unwise'}; -- murdered by his wife in short order
							{292, 'Empress', 'Vilintalti', 'the Impious'}; -- removed by the praetorian elite
							{298, 'Emperor', 'Radavan', 'the Reckless'}; -- died at war
							{316, 'Emperor', 'Suldibrand', 'the Forsaken of Men'}; -- fucked around. found out.
							{320, 'Emperor', 'Persigan', 'the Deathless'};
						}
						local year, r = math.floor(t / 414)
						for i=1, #reigns do if reigns[i+1][1] < year then r = reigns[i+1] end end
						local reignBegin, title, name, epithet = lib.tbl.unpack(r)
						local ry = 1 + (year - reignBegin)
						return long and string.format('Year %s of the Reign of HH&GU %s %s %s',
							ry, title, name, epithet) or string.format('Y. %s %s', name, ry)
................................................................................
		end)
	end
	start()
end

starlit.include 'stats'
starlit.include 'world'

starlit.include 'fab'
starlit.include 'tiers'
starlit.include 'species'

starlit.include 'store'

starlit.include 'ui'
................................................................................
		user.action.bits = bit.bor(user.action.bits, 0x100)
		--return user:trigger('secondary', {state = 'prog', delta = 0})
	elseif pointChanged(oldTgt, point) then
		user:trigger('retarget', {oldTgt = oldTgt})
	end
end
-- sigh

core.noneitemdef_default.on_place = function(...)
	if not triggerPower(...) then
		minetest.item_place(...)
	end
end
core.noneitemdef_default.on_use           = function(...) triggerPower(...) end
core.noneitemdef_default.on_secondary_use = function(...) triggerPower(...) end






















minetest.register_on_player_inventory_action(function(luser, act, inv, p)
	local name = luser:get_player_name()
	local user = starlit.activeUsers[name]
	-- allow UIs to update on UI changes
	local state = starlit.activeUI[name]
	if state then







>







 







|









|







 







>







 







>







>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>







45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
..
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
...
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
...
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
	};
	liveUI = {
		-- cached subset of activeUI containing those UIs needing live updates
	};

	interface = lib.registry.mk 'starlit:interface';
	item = {
		food = lib.registry.mk 'starlit:food';
	};

	region = {
		radiator = {
			store = AreaStore();
			emitters = {}
		};
................................................................................
		fact = lib.registry.mk 'starlit:fact';
		time = {
			calendar = {
				empire  = {
					name = 'Imperial Regnal Calendar';
					year = function(t, long)
						local reigns = {
							-- if anyone actually makes it to his Honor & Glory Unfailing Persivan I i will be
							-- exceptionally flattered
							{4, 'Emperor', 'Atavarka', 'the Bold'}; -- died at war
							{9, 'Emperor', 'Vatikserka', 'the Unconquered'}; -- died at war
							{22, 'Emperor', 'Rusifend', 'the Wise'}; -- poisoned at diplomacy
							{61, 'Empress', 'Tafseshendi', 'the Great'}; -- died of an 'insurrection of the innards' after a celebrated reign
							{291, 'Emperor', 'Treptebaska', 'the Unwise'}; -- murdered by his wife in short order
							{292, 'Empress', 'Vilintalti', 'the Impious'}; -- removed by the praetorian elite
							{298, 'Emperor', 'Radavan', 'the Reckless'}; -- died at war
							{316, 'Emperor', 'Suldibrand', 'the Forsaken of Men'}; -- fucked around. found out.
							{350, 'Emperor', 'Persivan', 'the Deathless'};
						}
						local year, r = math.floor(t / 414)
						for i=1, #reigns do if reigns[i+1][1] < year then r = reigns[i+1] end end
						local reignBegin, title, name, epithet = lib.tbl.unpack(r)
						local ry = 1 + (year - reignBegin)
						return long and string.format('Year %s of the Reign of HH&GU %s %s %s',
							ry, title, name, epithet) or string.format('Y. %s %s', name, ry)
................................................................................
		end)
	end
	start()
end

starlit.include 'stats'
starlit.include 'world'
starlit.include 'food'
starlit.include 'fab'
starlit.include 'tiers'
starlit.include 'species'

starlit.include 'store'

starlit.include 'ui'
................................................................................
		user.action.bits = bit.bor(user.action.bits, 0x100)
		--return user:trigger('secondary', {state = 'prog', delta = 0})
	elseif pointChanged(oldTgt, point) then
		user:trigger('retarget', {oldTgt = oldTgt})
	end
end
-- sigh
--[[
core.noneitemdef_default.on_place = function(...)
	if not triggerPower(...) then
		minetest.item_place(...)
	end
end
core.noneitemdef_default.on_use           = function(...) triggerPower(...) end
core.noneitemdef_default.on_secondary_use = function(...) triggerPower(...) end
]]
print(dump(core.noneitemdef_default))
minetest.register_item(":", {
	type = "none",
	wield_image = "wieldhand.png",
	wield_scale = {x=1,y=1,z=2.5},
	on_secondary_use = function(...) triggerPower(...) end;
-- 	on_use = function(...) print'base' end;
	after_use = function(...) triggerPower(...) end;
})
minetest.register_item("starlit:_hand_dig", {
	type = "none",
	wield_image = "wieldhand.png",
	wield_scale = {x=1,y=1,z=2.5},
	tool_capabilities = {
		groupcaps = {
			plant = {maxlevel=1, times = {.50,.5,.5}};
			dirt = {maxlevel=1, times = {2.5,1,1}};
		};
	}
})

minetest.register_on_player_inventory_action(function(luser, act, inv, p)
	local name = luser:get_player_name()
	local user = starlit.activeUsers[name]
	-- allow UIs to update on UI changes
	local state = starlit.activeUI[name]
	if state then