Chapter - Processing
Every turn when the number of filled rows in episode schedule is at least 1 and current episode is no-episode (this is the check episodes rule):
[can we modify this to prefer urgent episodes if time for excitement?]
let casting be false;
if scene-daemon is true or time for excitement:
if drama manager is being debugged, say "// Drama manager: [if scene-daemon is true]scene daemon goes off[otherwise]time for excitement[end if], so checking episode schedule carefully.";
now casting is true;
now scene-daemon is false;
the daemon wakes in one hour from now;
repeat through episode schedule:
unless episodic status of eptitle entry is unaired or episodic status of eptitle entry is running or eptitle entry is rerunnable:
blank out the whole row;
otherwise if eptitle entry is triggered or casting is true:
if drama manager is being debugged, say "**considering [eptitle entry]: [run paragraph on]";
consider the condition rules for eptitle entry;
if the rule succeeded:
begin eptitle entry;
break.
Every turn when an episode is playing (this is the watch for finish conditions rule):
if drama manager is being debugged, say "// Drama manager: watch for finish conditions rule ([current episode]).";
consider the finishing rules for current episode;
if the rule succeeded:
complete current episode.