Accuse

An interactive fiction by David A. Wheeler (2007) - the Inform 7 source text

Home page

Contents
Previous
Next

Complete text
Chapter 3 - Handling Accusations

The murderer and last accused suspect are people that vary.
The murder location and last accused location are rooms that vary.
The murder weapon and last accused weapon are weapons that vary.
The number of accusations is a number that varies.
The solution time is a number that varies.
The warning about giving up is a number that varies.

Accusing is an action applying to two things. Understand "accuse [someone] using [something]", "accuse [someone] of using [something]", "accuse [someone] with [something]", "accuse [someone] with using [something]" and "accuse [someone] [something]" as accusing.

Check accusing: if noun is not a suspect, say "You can only accuse suspects." instead.
Check accusing: if second noun is not a weapon then say "You can only accuse suspects of using a weapon." instead.
Check accusing: if noun is not visible then say "You can only accuse suspects that you can see." instead.
Check accusing: if second noun is not visible then say "You can only accuse suspects of using weapons that you can see." instead.
Check accusing: if number of accusations > 0 and noun is the last accused suspect then say "Pick on somebody else first!" instead.
Check accusing: if number of accusations > 0 and second noun is the last accused weapon then say "Pick on another weapon first!" instead.
Check accusing: if number of accusations > 0 and location is the last accused location then say "Try a different room first!" instead.

Carry out accusing:
increase number of accusations by 1;
increase solution time by 9; [1 more from the turn itself]
change last accused suspect to noun;
change last accused weapon to second noun;
change last accused location to location.

Report accusing:
if noun is murderer and second noun is murder weapon and location is murder location begin;
say "You solved it in [solution time] minutes!";
end the game in victory;
otherwise;
[say "[if noun is male]He[end if][if noun is female]She[end if] says, 'No, it's not true!'";]
say "'What!? Me, [noun], with the [second noun] in the [location]?'

";
if noun is murderer or second noun is murder weapon or location is murder location begin;
say "You sense that something about your accusation is true.";
otherwise; say "You sense that your accusation is COMPLETELY wrong.";
end if;
end if.