53 m = Crossfire.CreateObjectByName(
"force")
67 o = Crossfire.WhoAmI()
73 if (
not isinstance (criteria,list)):
75 for x
in range (self.
cfmap.Width):
76 for y
in range (self.
cfmap.Height):
77 top = self.
cfmap.ObjectAt(x,y)
81 if (set([top.Name]) & set (criteria) ):
84 if isinstance(whatTo,list):
85 ob = Crossfire.CreateObjectByName(whatTo[random.randint(0,len(whatTo)-1)])
87 ob = Crossfire.CreateObjectByName(whatTo)
92 self.
cfmap.Insert(ob,x,y)
94 force.WriteKey(
"inside_speed",
"%f" %top.Speed,1)
99 for x
in range(self.
cfmap.Width):
100 for y
in range(self.
cfmap.Height):
101 top = self.
cfmap.ObjectAt(x,y)
110 if (inv.Type == Crossfire.Type.FORCE)
and (inv.Name == self.
key):
111 oldspeed = float(inv.ReadKey(
"inside_speed"))
114 elif (inv.Type != Crossfire.Type.EVENT_CONNECTOR):
118 if match
and (torestore !=
None):
120 torestore.Speed = oldspeed
121 self.
cfmap.Insert(torestore,x,y)