| 1 |
# -*- coding: utf-8 -*- |
| 2 |
#token.py |
| 3 |
# This is one of the files that can be called by an npc_dialog, |
| 4 |
# The following code runs when a dialog has a pre rule of 'token' |
| 5 |
# The syntax is |
| 6 |
# ["token", "tokenname", "possiblevalue1", "possiblevalue2", etc] |
| 7 |
# To deliver a True verdict, the token tokenname must be set to one of the |
| 8 |
# 'possiblevalue' arguments. This will normally have been done |
| 9 |
# with a previous use of settoken |
| 10 |
# The token is be kept with the player's data, and survive the reset |
| 11 |
# of the map containing the NPC. |
| 12 |
## DIALOGCHECK |
| 13 |
## MINARGS 2 |
| 14 |
## MAXARGS 0 |
| 15 |
## .* |
| 16 |
## .* |
| 17 |
## ENDDIALOGCHECK |
| 18 |
|
| 19 |
verdict = False |
| 20 |
status = self.getStatus(args[0]) |
| 21 |
for value in args[1:]: |
| 22 |
if (status == value) or (value == "*"): |
| 23 |
verdict = True |
| 24 |
break |
| 25 |
else: |
| 26 |
pass |