Crossfire Server, Trunk
disinfect.py
Go to the documentation of this file.
1 import Crossfire
2 
3 whoami = Crossfire.WhoAmI()
4 map = whoami.Map
5 
6 if map != None and whoami.DungeonMaster:
7  count = 0
8  map.Print('%s disinfecting %s'%(whoami.Name, map.Path))
9  for x in range(0, map.Width):
10  for y in range(0, map.Height):
11  o = map.ObjectAt(x, y)
12  while o != None:
13  a = o.Above
14  if o.Type == Crossfire.Type.DISEASE:
15  whoami.Message(' removing %s at %d,%d'%(o.Name, x, y))
16  count = count + 1
17  o.Remove()
18  o = a
19  if count == 0:
20  map.Print(' => nothing removed')
21  else:
22  map.Print(' => %d diseases removed'%count)