Chapter 1 - Listing Quips
A quip can be listed or unlisted.
A plausibility rule for an unlisted quip (this is the don't suggest unlisted quips rule):
it is implausible.
[First plausibility rule for a quip (called target) when the current quip is dead-ended (this is the limit top-level suggestions rule):
if the target mentions something which is mentioned by the current quip:
make no decision;
it is dubious.] [1]
A plausibility rule for a shallowly-buried quip (called target) (this is the pruning mid-level suggestions rule):
if a quip indirectly-follows the current quip:
it is dubious;
if at least three quips indirectly-follow the previous quip:
it is dubious;
unless the current quip is dead-ended and the target mentions something which is mentioned by the current quip:
it is dubious.[2]
Rule for listing plausible quips when the current quip is dead-ended:
prepare a list of plausible quips;
if the number of filled rows in the Table of Scored Listing is 0:
rule succeeds;
if the number of filled rows in the Table of Scored Listing is greater than 4:
prepare a list of flagged-ready quips which mention every subject-relevant thing;
if the number of filled rows in the Table of Scored Listing is greater than 4 or the number of filled rows in the Table of Scored Listing is less than 1:
repeat with item running through listed flagged-ready quips in the quip-repository:
now every thing which is mentioned by the item is flagged-topical;
if a flagged-topical thing is subject-relevant:
prepare a list of subject-relevant flagged-topical things;
say "[one of]You could discuss[or]The conversation could turn to[at random] [the prepared list delimited in disjunctive style].";
now every thing is flagged-untopical; [3]
rule succeeds;
repeat through the Table of Scored Listing:
carry out the quip-introducing activity with the output entry;
[This could have blanked some rows out, so we want to check again:]
if the number of filled rows in the Table of Scored Listing is greater than 0,
say "[quip-suggestion-phrase][the prepared list delimited in disjunctive style].";
Notes
[1]. This kind of sort of worked, but was scattershot and (worse) slow.
[2]. These determine what options are listed to the player. As people create increasingly "bushy" conversation trees, sometimes these suggestions are becoming a bit long-winded, so I want to reduce the diversity of the suggestions for this particular game.
[3]. This will significantly reduce and tidy lists of ideas when there are a large number of plausible related quips; it's like the changing the subject action, but narrower.