1 from go_to_adjacent_systems
import *
2 from go_somewhere_significant
import *
19 def __init__ (self,factionname, missiondifficulty, our_dist_from_jump, dist_from_jump, distance_from_base, creds, enemy_time, numsysaway,jumps=(),var_to_set=
'',dynfg=
'', dyntype=
''):
20 Director.Mission.__init__(self);
21 self.
you = VS.getPlayer();
27 self.adjsys.Print(
"You should start in the system named %s",
"Then jump to %s",
"Finally, jump to %s, your final destination",
"escort mission",1)
44 L.fgappend =
str(escort_num)
47 if (dynfg==
'' and dyntype==
''):
55 L.minradius = 2.0*self.you.rSize()
56 L.maxradius = 3.0*self.you.rSize()
58 self.escortee.setMissionRelevant()
59 self.escortee.upgrade(
"jump_drive",0,0,0,1)
62 self.escortee.setFlightgroupLeader(self.
you)
67 print "ending briefing"
72 print "ending briefing"
74 if (VS.GetGameTime()-self.
gametime>10):
75 self.escortee.setFgDirective(
'F')
77 VS.IOmessage (0,
"escort",self.
mplay,
"#ff0000You were to protect your escort. Mission failed.")
78 VS.terminateMission(0)
80 self.escortee.setFlightgroupLeader(self.
you)
83 if (self.escortee.isNull()):
84 VS.IOmessage (0,
"escort",self.
mplay,
"#ff0000You were to protect your escort. Mission failed.")
87 quest.removeQuest (self.you.isPlayerStarship(),self.
var_to_set,-1)
88 VS.terminateMission(0)
90 if (
not self.adjsys.Execute()):
92 self.adjsys.SignificantUnit().setSpeed(0.0)
93 self.adjsys.SignificantUnit().SetVelocity((0.0,0.0,0.0))
98 self.
role = self.adjsys.SignificantUnit().getCombatRole()
99 self.adjsys.SignificantUnit().setCombatRole(
"INERT");
100 self.adjsys.Print (
"You must escort your starship to the %s",
"defend",
"docked around the %s", 0)
101 elif (self.you.getDistance(self.
escortee)<2000):
102 self.you.addCredits(self.
creds)
104 VS.IOmessage (0,
"escort",self.
mplay,
"#00ff00Excellent work! You have completed this mission!")
105 self.escortee.setFgDirective(
'b')
106 self.escortee.setFlightgroupLeader(self.
escortee)
107 self.escortee.performDockingOperations(self.adjsys.SignificantUnit(),0)
108 self.adjsys.SignificantUnit().setCombatRole(self.
role);
110 quest.removeQuest (self.you.isPlayerStarship(),self.
var_to_set,1)
111 VS.terminateMission(1)
112 def initrandom (factionname,difficulty,creds,entime,numsysaway,jumps=(),var_to_set=
'',dynfg=
'',dyntype=
''):
113 return escort_mission(factionname,difficulty,20000,
vsrandom.randrange(5000,7000),
vsrandom.randrange(10,300),creds,entime,numsysaway,jumps,var_to_set,dynfg,dyntype)