File: npctoken.py

package info (click to toggle)
crossfire-maps 1.75.0%2Bdfsg1-1
  • links: PTS
  • area: main
  • in suites: bookworm, bullseye, forky, sid, trixie
  • size: 275,656 kB
  • sloc: python: 7,711; sql: 92; sh: 73; makefile: 7
file content (27 lines) | stat: -rw-r--r-- 769 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
# -*- coding: utf-8 -*-
#npctoken.py
# This is one of the files that can be called by an npc_dialog,
# The following code runs when a dialog has a pre rule of 'token'
# The syntax is
# ["token", "tokenname", "possiblevalue1", "possiblevalue2", etc]
# To deliver a True verdict, the token tokenname must be set to one of the
# 'possiblevalue' arguments. This will normally have been done
# with a previous use of settoken
# The token is kept in the NPC's data, and will be lost if the
# map containing the NPC resets.
## DIALOGCHECK
## MINARGS 2
## MAXARGS 0
## .*
## .*
## ENDDIALOGCHECK

verdict = False
status = self.getNPCStatus(args[0])
for value in args[1:]:
    if (status == value) or (value == "*"):
        verdict = True
        break
    else:
        pass