1 from go_to_adjacent_systems
import *
12 def __init__ (self,numsystemsaway, num_significants_to_patrol, distance_from_base, creds, jumps=(), donevar=
''):
13 Director.Mission.__init__(self)
20 self.
you = VS.getPlayer()
22 name = self.you.getName ()
24 VS.IOmessage (0,
"patrol",self.
mplay,
"You must patrol a system for us :")
26 self.adjsys.Print(
"From the %s system,",
"Carefully go to %s.",
"You should shortly arrive in the %s: patrol it.",
"patrol",1)
29 self.you.addCredits (self.
cred)
32 VS.IOmessage (0,
"computer",self.
mplay,
"[Computer] Transmitting Data..")
33 VS.IOmessage (0,
"patrol",self.
mplay,
"Thank you! Patrol Complete.")
34 VS.IOmessage (0,
"patrol",self.
mplay,
"We have credited your account.")
35 VS.terminateMission(1)
37 self.you.addCredits (self.
cred)
40 VS.IOmessage (0,
"patrol",self.
mplay,
"Mission a failure!")
41 VS.terminateMission(0)
44 VS.IOmessage (0,
"patrol",self.
mplay,
"You must get within %f klicks of" % self.
distance)
53 fac =sig.getFactionName()
56 sig.setMissionRelevant()
58 obj=VS.addObjective (
"Scan %s"%nam)
59 VS.IOmessage (0,
"patrol",self.
mplay,
"%s owned %s " % (fac,enam))
63 if (sig.isJumppoint()):
64 obj=VS.addObjective (
"Scan Jumppoint %s" % nam)
66 obj=VS.addObjective (
"Scan %s" % nam)
68 obj=VS.addObjective (
"Scan Natural Phenomenon: %s" % nam)
69 VS.IOmessage (0,
"patrol",self.
mplay,
"The object %s " % enam)
70 VS.setOwner(int(obj),self.
you)
71 VS.setCompleteness(int(obj),0.0)
76 VS.IOmessage (0,
"patrol",self.
mplay,
"[Computer] %s scanned, data saved..."%nam)
78 self.you.commAnimation(
"scan_complete.ani")
87 if (self.you.getSignificantDistance (jpoint)<self.
distance):
95 if (self.you.isNull()):
96 VS.terminateMission(0)
98 if (self.adjsys.Execute()):
106 print "ending briefing"
108 print "loop briefing"
109 Briefing.terminate();
111 print "ending briefing"
112 def initrandom (minsysaway,maxsysaway,minsigtopatrol,maxsigtopatrol,mincred,maxcred):
113 nsys = vsrandom.randrange (minsysaway, maxsysaway)
114 nsig = vsrandom.randrange (minsigtopatrol, maxsigtopatrol)
115 return patrol (nsys, nsig,
vsrandom.randrange(100.0,300.0),(1+nsys*0.5)*nsig*vsrandom.randrange (mincred,maxcred))