3 from go_to_adjacent_systems
import go_to_adjacent_systems
4 from go_somewhere_significant
import go_somewhere_significant
18 quest.removeQuest (self.you.isPlayerStarship(),self.
var_to_set,val)
20 def __init__ (self,minnumsystemsaway, maxnumsystemsaway, creds, run_away, shipdifficulty, tempfaction,jumps=(),var_to_set=
'',dynfg=
'',dyntype=
"",displayLocation=1,greetingText=[
'It appears we have something in common, privateer.',
'My name may be on your list, but now your name is on mine.'],dockable_unit=
False):
21 Director.Mission.__init__ (self)
36 mysys=VS.getSystemFile()
37 sysfile = VS.getSystemFile()
38 self.
you=VS.getPlayer()
45 VS.IOmessage (0,
"bounty mission",self.
mplay,
"[Computer] Bounty Mission Objective: (%.2f Credits)" % self.
cred)
46 self.adjsys.Print(
"From %s system",
"Procede to %s",
"Search for target at %s, your final destination",
"bounty mission",1)
47 VS.IOmessage (1,
"bounty mission",self.
mplay,
"Target is a %s unit." % (self.
faction))
49 print "aboritng bounty constructor..."
50 VS.terminateMission (0)
56 def Win (self,un,terminate):
58 VS.IOmessage (0,
"bounty mission",self.
mplay,
"[Computer] #00ff00Bounty Mission Accomplished!")
59 un.addCredits(self.
cred)
61 print "you win bounty mission!"
62 VS.terminateMission(1)
65 VS.IOmessage(0,
"bounty mission",self.
mplay,
"[Computer] #ff0000Bounty Mission Failed.")
68 print "lose bounty mission"
69 VS.terminateMission(0)
76 if (self.you.isNull()):
80 if (
not self.runaway):
81 if (
not self.istarget):
83 curun=VS.getUnit(self.curiter)
85 if (curun==self.enemy):
86 self.enemy.SetTarget(self.you)
87 elif (curun.isNull()):
90 if (VS.GetGameTime()>self.firsttime+2.5
and self.enemy):
91 self.firsttime+=1000000
93 if (self.enemy.isNull()):
96 elif (self.arrived==1):
97 significant=self.adjsys.SignificantUnit()
98 if (significant.isNull ()):
100 VS.terminateMission(0)
103 if (self.you.getSignificantDistance(significant)<self.adjsys.distfrombase):
104 if (self.newship==
""):
110 L.type = self.newship
111 L.faction = self.faction
113 L.num=1+self.difficulty
117 L.minradius*=faction_ships.launch_distance_factor
118 L.maxradius*=faction_ships.launch_distance_factor
121 self.enemy=L.launch(significant)
122 self.enemy.SetTarget(self.you)
123 self.enemy.setFgDirective(
'B.')
124 self.you.SetTarget(self.enemy)
126 str_faction = self.faction.split(
'_')[0]
131 self.enemy.SetTarget(significant)
132 self.enemy.ActivateJumpDrive(0)
133 self.firsttime=VS.GetGameTime()
135 self.LaunchedEnemies(significant)
139 VS.terminateMission(0)
142 if (self.adjsys.Execute()):
144 if (self.newship==
"" and self.dynfg==
''):
147 if not self.displayLocation:
148 VS.addObjective(
"Search/Destroy "+self.faction.capitalize()+
" mark");
153 VS.IOmessage (3,
"bounty mission",self.mplay,
"Hunt the %s unit in the %s flightgroup in this system." % (self.newship,tmpfg))
155 VS.IOmessage (4,
"bounty mission",self.mplay,
"Target is fleeing to the jump point!")
156 VS.IOmessage (5,
"bounty mission",self.mplay,
"Target Destination appears to be %s" % (localdestination))
157 elif (self.displayLocation):
158 VS.IOmessage (4,
"bounty mission",self.mplay,
"Scanners detect bounty target!")
159 VS.IOmessage (5,
"bounty mission",self.mplay,
"Coordinates appear near %s" % (localdestination))
161 print "Location "+
str(self.displayLocation)
162 VS.IOmessage (4,
"bounty mission",self.mplay,
"[Computer] Mission description indicates bounty target may be in this system.")
165 print "ending briefing"
168 print "loop briefing"
169 Briefing.terminate();
172 print "ending briefing"
174 def initrandom (minns, maxns, credsmin, credsmax, run_away, minshipdifficulty, maxshipdifficulty,jumps=(),var_to_set=
''):
178 name = you.getFactionName ()
182 while ((name==tempfaction
or name==
"unknown")
and i<10):
186 sd =
vsrandom.random()*(maxshipdifficulty-minshipdifficulty)+minshipdifficulty
187 return bounty (minns,maxns,(1.0+(sd*0.5))*(vsrandom.random ()*(credsmax-credsmin)+credsmin),run_away,sd,tempfaction,jumps,var_to_set)
189 print "aborting bounty initrandom"
190 VS.terminateMission(0)