Scorekeepers are the objects that manage scoring, winning, and losing. A game design need not define any scorekeepers, and none are created by default. A scorekeeper may either maintain a numeric score that is used at the end of the game to decide rankings, or simply declare a side to have won or lost.
scorekeeper name properties...
This form creates or modifies a scorekeeper with the given name, with the given properties.
This property is a string that identifies the scorekeeper to the
players. Defaults to
when (type [ exp ])
This property is when the scorekeeper will be checked or updated.
This indicates that the scorekeeper will run at the start of each turn matching exp, or after every turn if exp is not given.
This indicates that the scorekeeper will run at the end of each turn matching exp, or after every turn if exp is not given.
This indicates that the scorekeeper will run after every event matching exp, or after every event if exp is not given.
This indicates that the scorekeeper will run at the end of each action matching exp, or after every action if exp is not given.
This property is the set of sides or side classes to which the
scorekeeper applies. Scorekeepers apply only to sides that are in the
game. Defaults to
This property is the list of sides that know about this scorekeeper, and
can see the value of the score for each side that it applies to.
This property is an expression that is true when it is time to start
checking the scorekeeper's main test. Once a scorekeeper is triggered,
it remains active. Defaults to
This property is true if the scorekeeper is currently triggered.
This property is a list of forms to execute in order each time the
scorekeeper runs. Defaults to
This property is the value of the score upon game startup. If this
-9999, the scorekeeper does not maintain a numeric
score. Defaults to
The forms in the body (the
do property) of the scorekeeper may be
any of the forms listed here.
If supplied as the only symbol in the body, then the scorekeeper implements the usual "last side left in the game wins" behavior.
If supplied as the only symbol in the body, then the scorekeeper implements the "last alliance left in the game wins" behavior. For the purposes of this scorekeeper, an alliance means that the sides in the alliance all trust each other.
if test action
If the test evaluates to
true or any nonzero number, then the
action will be done.
cond (test actions...) ...
This is like Lisp's cond.
win [ sides ] [ own-message ] [ other-message ]
This scorekeeper action causes the side to win immediately.
lose [ sides ] [ own-message ] [ other-message ]
This scorekeeper action causes the side to lose immediately.
end [ message ]
This scorekeeper action ends the game immediately, with a draw for all remaining sides.
add exp [ side ]
This adds the result of evaluating exp to the score of the given side. The value may be a negative number.
The result is true if all the operands are true.
The result is true if any of the operands are true.
= exp1 exp2
/= exp1 exp2
> exp1 exp2
>= exp1 exp2
< exp1 exp2
<= exp1 exp2
sum types property [ test ]
The result is the sum of the property values for all units of the given type(s). The optional test filters the set of units being tested.
This variable supplies the name of the file to be used for recording
scores of people playing the game. The default value is
which disables the recording of scores.