starlit  Diff

Differences From Artifact [1f09b99871]:

To Artifact [6f8dfbcd79]:


    45     45   	};
    46     46   	liveUI = {
    47     47   		-- cached subset of activeUI containing those UIs needing live updates
    48     48   	};
    49     49   
    50     50   	interface = lib.registry.mk 'starlit:interface';
    51     51   	item = {
           52  +		food = lib.registry.mk 'starlit:food';
    52     53   	};
    53     54   
    54     55   	region = {
    55     56   		radiator = {
    56     57   			store = AreaStore();
    57     58   			emitters = {}
    58     59   		};
................................................................................
    91     92   		fact = lib.registry.mk 'starlit:fact';
    92     93   		time = {
    93     94   			calendar = {
    94     95   				empire  = {
    95     96   					name = 'Imperial Regnal Calendar';
    96     97   					year = function(t, long)
    97     98   						local reigns = {
    98         -							-- if anyone actually makes it to his Honor & Glory Unfailing Persigan I i will be
           99  +							-- if anyone actually makes it to his Honor & Glory Unfailing Persivan I i will be
    99    100   							-- exceptionally flattered
   100    101   							{4, 'Emperor', 'Atavarka', 'the Bold'}; -- died at war
   101    102   							{9, 'Emperor', 'Vatikserka', 'the Unconquered'}; -- died at war
   102    103   							{22, 'Emperor', 'Rusifend', 'the Wise'}; -- poisoned at diplomacy
   103    104   							{61, 'Empress', 'Tafseshendi', 'the Great'}; -- died of an 'insurrection of the innards' after a celebrated reign
   104    105   							{291, 'Emperor', 'Treptebaska', 'the Unwise'}; -- murdered by his wife in short order
   105    106   							{292, 'Empress', 'Vilintalti', 'the Impious'}; -- removed by the praetorian elite
   106    107   							{298, 'Emperor', 'Radavan', 'the Reckless'}; -- died at war
   107    108   							{316, 'Emperor', 'Suldibrand', 'the Forsaken of Men'}; -- fucked around. found out.
   108         -							{320, 'Emperor', 'Persigan', 'the Deathless'};
          109  +							{350, 'Emperor', 'Persivan', 'the Deathless'};
   109    110   						}
   110    111   						local year, r = math.floor(t / 414)
   111    112   						for i=1, #reigns do if reigns[i+1][1] < year then r = reigns[i+1] end end
   112    113   						local reignBegin, title, name, epithet = lib.tbl.unpack(r)
   113    114   						local ry = 1 + (year - reignBegin)
   114    115   						return long and string.format('Year %s of the Reign of HH&GU %s %s %s',
   115    116   							ry, title, name, epithet) or string.format('Y. %s %s', name, ry)
................................................................................
   248    249   		end)
   249    250   	end
   250    251   	start()
   251    252   end
   252    253   
   253    254   starlit.include 'stats'
   254    255   starlit.include 'world'
          256  +starlit.include 'food'
   255    257   starlit.include 'fab'
   256    258   starlit.include 'tiers'
   257    259   starlit.include 'species'
   258    260   
   259    261   starlit.include 'store'
   260    262   
   261    263   starlit.include 'ui'
................................................................................
   356    358   		user.action.bits = bit.bor(user.action.bits, 0x100)
   357    359   		--return user:trigger('secondary', {state = 'prog', delta = 0})
   358    360   	elseif pointChanged(oldTgt, point) then
   359    361   		user:trigger('retarget', {oldTgt = oldTgt})
   360    362   	end
   361    363   end
   362    364   -- sigh
          365  +--[[
   363    366   core.noneitemdef_default.on_place = function(...)
   364    367   	if not triggerPower(...) then
   365    368   		minetest.item_place(...)
   366    369   	end
   367    370   end
   368    371   core.noneitemdef_default.on_use           = function(...) triggerPower(...) end
   369    372   core.noneitemdef_default.on_secondary_use = function(...) triggerPower(...) end
          373  +]]
          374  +print(dump(core.noneitemdef_default))
          375  +minetest.register_item(":", {
          376  +	type = "none",
          377  +	wield_image = "wieldhand.png",
          378  +	wield_scale = {x=1,y=1,z=2.5},
          379  +	on_secondary_use = function(...) triggerPower(...) end;
          380  +-- 	on_use = function(...) print'base' end;
          381  +	after_use = function(...) triggerPower(...) end;
          382  +})
          383  +minetest.register_item("starlit:_hand_dig", {
          384  +	type = "none",
          385  +	wield_image = "wieldhand.png",
          386  +	wield_scale = {x=1,y=1,z=2.5},
          387  +	tool_capabilities = {
          388  +		groupcaps = {
          389  +			plant = {maxlevel=1, times = {.50,.5,.5}};
          390  +			dirt = {maxlevel=1, times = {2.5,1,1}};
          391  +		};
          392  +	}
          393  +})
   370    394   
   371    395   minetest.register_on_player_inventory_action(function(luser, act, inv, p)
   372    396   	local name = luser:get_player_name()
   373    397   	local user = starlit.activeUsers[name]
   374    398   	-- allow UIs to update on UI changes
   375    399   	local state = starlit.activeUI[name]
   376    400   	if state then