----------------------------------------------------
------------- CONTROLLED INFORMATION --------------
----------------------------------------------------
-- THE INFORMATION CONTAINED IN THIS DOCUMENT IS --
-- SUBJECT TO RESTRAINT OF TRANSMISSION PER THE --
-- TERMS OF THE COMMUNE CHARTER INFOSECURITY --
-- PROVISION. IF YOU ARE NOT AUTHORIZED UNDER THE --
-- AEGIS OF THE APPROPRITE CONTROLLING AUTHORITY, --
-- CLOSE THIS DOCUMENT IMMEDIATELY AND REPORT THE --
-- SECURITY BREACH TO YOUR DESIGNATED INFORMATION --
-- HYGIENE OVERSEER OR FACE CORRECTIVE DISCIPLINE --
----------------------------------------------------
local lib = starlit.mod.lib
local sec = {}
starlit.mod.secrets = sec
sec.index = lib.registry.mk 'starlit_secrets:secret'
--[==[
a secret is a piece of information that is made available
for review once certain conditions are met. despite the name,
it doesn't necessarily have to be secret -- it could include
e.g. journal entries about a character's background. a secret
is defined in the following manner:
{
title = the string that appears in the UI
stages = {
{
prereqs = {
{kind = 'fact', id = 'starlit:terroristEmployer'}
{kind = 'item', id = 'starlit_electronic:firstbornDoomBong'}
{kind = 'background', id = 'starlit:terroristTagalong'}
}
body = {
'the firstborn smonked hella weed';
};
-- body can also be a function(user,secret)
}
}
}
TODO would it be useful to impl horn clauses and a general fact database?
is that level of flexibility meaningful? or are simply flags better
a secret can be a single piece of information predicated
on a fact, in which case the secret and fact should share
the same ID. the ID should be as non-indicative as possible
to avoid spoilers for devs of unrelated code.
a secret can also be manually unlocked e.g. by using an item
]==]--
function sec.prereqCheck(user, pr)
end