-
Notifications
You must be signed in to change notification settings - Fork 9
context
selfsame edited this page Jan 18, 2015
·
2 revisions
mud.core.context
is home to the understood
singleton, which is mutable/rewindable data store for context. It provides the information needed bu report
templating, and is useful for general purpose game systems.
data can be retrieved by calling:
understood.subject()
understood.verb()
understood.scope()
understood.objects()
and set with:
understood.subject(e)
understood.verb("look")
understood.scope([])
understood.objects([z, y])
understood.previous()
undoes the last alteration, and understood.reset()
clears all data
#player commands have proper context.understood,
#but this can be changed and reverted incrementally if needed
understood.subject(e)
#dispatches "print_for(a, b)" for subject, observer,
#and "print_object_for(a, b)" for object, observer
report("[Subject] introduce[s] [itself] to [object].")
#undoes the previous subject change
understood.previous()
report
template currently supports the following tags:
[subject]
#prints "you" when subject is the observer of report
#resolved with
call("print_for", entity, observer)
[verb] #prints verb
[s][es] #prints s/es when subject is not the observer of report
[object]
[second object]
[third object]
[fourth object]
#resolved with
call("print_object_for", entity, observer)
[itself][himself][herself][theirself]
#indicates an object is same as subject (token version has no meaning)
call("print_reflexive_for", subject, observer)
#capitalizing the first letter of a tag will capitalize the resolved string!
[Subject]