1 from go_somewhere_significant
import go_somewhere_significant
10 import go_to_adjacent_systems
11 import go_somewhere_significant
14 def __init__ (self, creds,numsysaway, fac,numenemy,enfac,enfg='', jumps=(),var_when_done=
''):
15 Director.Mission.__init__ (self)
22 self.
you = VS.getPlayer()
32 VS.terminateMission(0)
34 if (
not self.adjsys.Execute()):
38 sys = VS.getSystemFile()
40 if sys
in dynamic_battle.rescuelist:
41 del dynamic_battle.rescuelist[sys]
52 self.eject.setMissionRelevant()
54 self.eject.setName(
"Pilot")
55 self.eject.SetHull(25);
63 L.minradius=float(VS.vsConfig(
"dynamic_universe",
"missions.rescue.enemy.minradius",
"5000"))
64 L.maxradius=float(VS.vsConfig(
"dynamic_universe",
"missions.rescue.enemy.maxradius",
"15000"))
66 L.minradius*=faction_ships.launch_distance_factor
67 L.maxradius*=faction_ships.launch_distance_factor
70 self.
enemy=L.launch(self.adjsys.SignificantUnit())
71 self.enemy.SetTarget(self.
eject)
72 self.enemy.setFgDirective(
"A.")
73 self.you.SetTarget(self.
eject)
74 VS.IOmessage(0,
"eject",self.
mplay,
"This is ejector pod 0x4032 requesting immediate rescue and pickup")
75 self.
obj=VS.addObjective(
"Tractor Ejected Pilot")
79 self.enemy.SetTarget(self.
eject)
80 self.
numejectors=self.you.GetCargo(
"Pilot").GetQuantity()
83 self.enemy.SetTarget(self.
you)
84 self.enemy.setFgDirective(
"A.")
86 if (self.
numejectors<self.you.GetCargo(
"Pilot").GetQuantity()):
87 self.you.removeCargo(
"Pilot",1,1)
88 carg=VS.getRandCargo(1,
"Passengers/Economy")
89 carg.SetMissionFlag(1)
90 VS.setCompleteness(self.
obj,1)
91 if (
not self.you.addCargo(carg)):
98 VS.IOmessage(0,
"Passenger",self.
mplay,
"Please take me to my home base: %s so I may begin to recover. Thank you!"%self.adjsys.SignificantUnit().getName())
100 VS.IOmessage(0,
"rescue_mission",self.
mplay,
"#ff0000You Lost the Pilot before you could drop the Pilot at the base. The Pilot's oxygen is currently empty. You fail.")
104 if (self.you.GetCargo(self.
cargname).GetQuantity()==0):
106 elif (self.adjsys.SignificantUnit().isDocked(self.
you)
or self.you.isDocked(self.adjsys.SignificantUnit())
or self.adjsys.SignificantUnit().getDistance(self.
you)<10):
107 if (self.you.removeCargo(self.
cargname,1,1)):
111 def Win (self,un,terminate):
112 VS.IOmessage (0,
"Passenger",self.
mplay,
"#00ff00Excellent work pilot.")
113 VS.IOmessage (0,
"Passenger",self.
mplay,
"#00ff00You have been rewarded for your effort as agreed.")
114 VS.IOmessage (0,
"Passenger",self.
mplay,
"#00ff00You saved my life. I owe you a drink, pal")
115 un.addCredits(self.
cred)
116 VS.AdjustRelation(self.you.getFactionName(),self.
faction,.02,1)
120 VS.terminateMission(1)
123 VS.AdjustRelation(self.you.getFactionName(),self.
faction,-.02,1)
124 VS.IOmessage(0,
"rescue_mission",self.
mplay,
"#ff0000Credit agency reports that you have failed the mission.")
128 print "lose plunder mission"
129 VS.terminateMission(0)
131 print "ending briefing"
133 print "loop briefing"
134 Briefing.terminate();
137 print "ending briefing"