1 from go_to_adjacent_systems
import *
13 def __init__ (self, num_significants_to_patrol, distance_from_base, creds, savevar,systems,delay,faction,numenemies,dyntype='',dynfg='',greetingText=["Hello there, smuggler. Prepare to die!", "The price on your head is big enough that I missed my lunch"],directions=[],destination=''):
14 ambush.ambush.__init__(self,savevar,systems,delay,faction,numenemies,dyntype,dynfg,greetingText,directions,destination)
31 VS.getPlayerX(self.
cp).addCredits (self.
cred)
32 VS.terminateMission(0)
35 VS.IOmessage (0,
"patrol",self.
mplay,
"You must get within %f klicks of" % self.
distance)
38 while (self.
quantity>0
and count > 0):
40 sig = unit.getSignificant (vsrandom.randrange (0,128),0,0)
41 if (
not sig.isNull()):
45 fac =sig.getFactionName()
48 obj=VS.addObjective (
"Scan %s's %s"% (fac,nam))
49 VS.IOmessage (0,
"patrol",self.
mplay,
"%s owned %s " % (fac,nam))
52 if (sig.isJumppoint()):
53 obj=VS.addObjective (
"Scan Jumppoint %s" % nam)
55 obj=VS.addObjective (
"Scan Planet %s" % nam)
57 obj=VS.addObjective (
"Scan Natural Phenomenon: %s" % nam)
58 VS.IOmessage (0,
"patrol",self.
mplay,
"The object %s " % nam)
59 VS.setOwner(int(obj),VS.getPlayerX(self.
cp))
60 VS.setCompleteness(int(obj),-1.0)
66 VS.IOmessage (0,
"patrol",self.
mplay,
"[Computer] %s scanned, data saved..."%nam)
77 if (playa.getSignificantDistance (jpoint)<self.
distance):
86 playa=VS.getPlayerX(self.
cp)
96 if (
not self.enemy.isNull()):
97 if (self.enemy.getUnitSystemFile()==playa.getUnitSystemFile()):
98 self.enemy.SetTarget(playa)