1 from go_to_adjacent_systems
import *
2 from go_somewhere_significant
import *
13 def __init__ (self,factionname,numsystemsaway, enemyquantity, waves, distance_from_base, creds, incoming, protectivefactionname='',jumps=(),var_to_set=
'',dynamic_flightgroup=
'',dynamic_type=
'', dynamic_defend_fg=
'',dynamic_defend_type=
'',greetingText=[
'Escort: give up while you still can...',
'If you let us ravage our target then we grant you passage today.']):
14 Director.Mission.__init__(self)
17 if (VS.GetRelation(factionname,protectivefactionname)>=0.0):
45 self.
you=VS.getPlayer()
47 name = self.you.getName ()
52 VS.IOmessage (0,
"escort mission",self.
mplay,
"Your mission is as follows:")
53 self.adjsys.Print(
"You are in the %s system,",
"Proceed swiftly to %s.",
"Your arrival point is %s.",
"escort mission",1)
57 quest.removeQuest (self.you.isPlayerStarship(),self.
var_to_set,value)
59 self.defendee.setFgDirective(
'b')
60 self.defendee.setFlightgroupLeader(self.
defendee)
64 if (un.getName()==self.defendee.getName()):
66 if (un.getName()==self.defendee.getName()):
68 if (un.getName()==self.defendee.getName()):
70 if (un.getName()==self.defendee.getName()):
72 if (un.getName()!=self.defendee.getName()):
73 self.defendee.performDockingOperations(un,0)
78 self.defendee.ActivateJumpDrive(0)
79 self.defendee.SetTarget(self.adjsys.SignificantUnit())
83 VS.AdjustRelation(self.you.getFactionName(),self.
faction,.03,1)
86 self.you.addCredits (self.
cred)
87 VS.IOmessage(0,
"escort mission",self.
mplay,
"Excellent work pilot! Your effort has thwarted the foe!")
88 VS.IOmessage(0,
"escort mission",self.
mplay,
"You have been rewarded for your effort as agreed.")
89 VS.terminateMission(1)
91 self.you.addCredits (-self.
cred)
92 VS.AdjustRelation(self.you.getFactionName(),self.
faction,-.02,1)
94 VS.IOmessage (0,
"escort mission",self.
mplay,
"You Allowed the base you were to protect to be destroyed.")
95 VS.IOmessage (0,
"escort mission",self.
mplay,
"You are a failure to your race!")
96 VS.IOmessage (1,
"escort mission",self.
mplay,
"We have contacted your bank and informed them of your failure to deliver on credit. They have removed a number of your credits for this inconvenience. Let this serve as a lesson.")
97 VS.terminateMission(0)
99 if (self.adjsys.DestinationSystem()!=VS.getSystemFile()):
106 if (un.isNull()
or (un.GetHullPercent()<.7
and self.defendee.getDistance(un)>7000)):
121 L.fg=
"Shadow";L.dynfg=self.
dynatkfg;
126 L.ai=
"default";L.num=1;L.minradius=20000.0;L.maxradius=25000.0
128 L.minradius*=faction_ships.launch_distance_factor
129 L.maxradius*=faction_ships.launch_distance_factor
133 launched=L.launch(you)
135 self.you.SetTarget(launched)
138 launched.SetTarget (jp)
140 launched.SetTarget (you)
142 launched.setFgDirective(
'B')
150 VS.IOmessage (0,
"escort mission",self.
mplay,
"Eliminate all %s ships here" % self.
faction)
163 import escort_mission
164 escort_mission.escort_num+=1
165 L.fgappend =
str(escort_mission.escort_num)
168 L.minradius = 2.0*self.you.rSize()
169 L.maxradius = 3.0*self.you.rSize()
171 escortee=L.launch(self.
you)
172 escortee.upgrade(
"jump_drive",0,0,0,1)
173 escortee.setFlightgroupLeader(self.
you)
174 escortee.setFgDirective(
'F')
175 escortee.setMissionRelevant()
180 if (self.defendee.getUnitSystemFile()!=self.you.getUnitSystemFile()
or VS.GetGameTime()-self.
successdelay>120
or (self.
incoming and self.todock.isNull()==
False and self.you.isNull()==
False and self.you.getDistance(self.
todock)<330)):
186 if (self.you.isNull()
or (self.
launchedfriend and self.defendee.isNull())):
187 VS.IOmessage (0,
"escort mission",self.
mplay,
"#ff0000You were unable to arrive in time to help. Mission failed.")
189 VS.terminateMission(0)
191 if (
not self.adjsys.Execute()):
199 self.adjsys.Print (
"You must visit the %s",
"escort mission",
"docked around the %s", 0)
200 self.
jp=self.adjsys.SignificantUnit()
205 if (self.defendee.isNull ()):
209 self.defendee.setFlightgroupLeader(self.
you)
210 if (VS.GetGameTime()-self.
gametime>10):
211 self.defendee.setFgDirective(
'F')
219 if (
not un.isNull()):
229 print "ending briefing"
231 print "loop briefing"
232 Briefing.terminate();
234 print "ending briefing"