def GenerateWingmen(self): if (self.you): if (self.you.getCredits() >= self.price): self.you.addCredits(-self.price) lead = launch.launch_wave_around_unit( self.you.getFlightgroupName(), self.you.getFactionName(), self.wingship, "default", self.numships, 500, 1000, self.you) VS.IOmessage( 0, lead.getName(), "all", "I am at your service commander. Let us succeed!") else: lead = launch.launch_wave_around_unit("ForHire", self.faction, self.wingship, "default", self.numships, 500, 1000, self.you) if (self.diff > 0): lead.SetTarget(self.you) VS.IOmessage( 0, lead.getName(), "all", "You don't have the agreed money... prepare to DIE!") else: VS.IOmessage( 0, lead.getName(), "all", "You don't have the money. A fool like you won't last long!" )
def GeneratePatrolList(self): VS.IOmessage(0, "patrol", self.mplay, "You must get within %f klicks of" % self.distance) count = self.quantity * 6 str = "" import universe self.patrolpoints = universe.significantUnits() while (len(self.patrolpoints) > self.quantity and len(self.patrolpoints)): del self.patrolpoints[vsrandom.randrange(0, len(self.patrolpoints))] for sig in self.patrolpoints: self.quantity = self.quantity - 1 fac = sig.getFactionName() nam = unit.getUnitFullName(sig) enam = unit.getUnitFullName(sig, True) sig.setMissionRelevant() if (fac != "neutral"): obj = VS.addObjective("Scan %s" % nam) VS.IOmessage(0, "patrol", self.mplay, "%s owned %s " % (fac, enam)) else: if (sig.isPlanet()): nam = unit.getUnitFullName(sig) if (sig.isJumppoint()): obj = VS.addObjective("Scan Jumppoint %s" % nam) else: obj = VS.addObjective("Scan %s" % nam) else: obj = VS.addObjective("Scan Natural Phenomenon: %s" % nam) VS.IOmessage(0, "patrol", self.mplay, "The object %s " % enam) VS.setOwner(int(obj), self.you) VS.setCompleteness(int(obj), 0.0) self.objectives += [int(obj)] self.quantity = 0
def initSuccess(self): if self.success == 2: if VS.GetGameTime() > self.tracking[0]: t = self.getJumpTo(self.directions[len(self.directions) - 2]) self.setupFriendly(t) #FIXME: open wormhole VS.IOmessage(0, "[Mission Command]", "all", "Out of our way, let us finish the job!") VS.getPlayerX(self.cp).addCredits(self.creds) VS.terminateMission(1) else: t = self.getJumpTo(self.directions[len(self.directions) - 2]) self.enemy.SetPosition( Vector.Add(Vector.Scale((1, 0, 0), 11063), t.Position())) VS.getPlayerX(self.cp).SetPosition( t.Position() ) #because self.enemy is at the jumpgate when I jump, so I get pushed off VS.setCompleteness(self.objref, 1.00) self.success = 2 VS.IOmessage(0, "[Mission Computer]", "all", "Broadcast intercepted.") for i in range(len(self.succeed1)): VS.IOmessage(i + 1, "[Mission Command]", "all", self.succeed1[i]) self.SetVar(1) self.tracking = (VS.GetGameTime() + self.DELAYTIME, VS.getPlayerX(self.cp).getDistance(self.enemy)) return
def end_destruction(self): # print "testing timer" if (self.timer1 + 12) <= VS.GetGameTime(): print("playing sounds") VS.playSound("sfx43.wav", self.playa.Position(), self.playa.GetVelocity()) VS.playSound("Flux.wav", self.playa.Position(), self.playa.GetVelocity()) VS.playSound("electricity.wav", self.playa.Position(), self.playa.GetVelocity()) print("attempting the jump") unit.TfgJumpTo(self.aera_specopp, "gemini_sector/pestilence") print("attempted the jump") self.playa.JumpTo("gemini_sector/pestilence") print("jumped playa") VS.IOmessage(0, "Aera SpecOpp", "all", "[Translate: Aernoss -> Englysh] ...id") VS.IOmessage( 5, "Aera SpecOpp", "all", "[Translate: Aernoss -> Englysh] <untranslatable> section of excretement <untranslatable> human <untranslatable> genitalia <untranslatable> fire <untranslatable> nice day." ) VS.IOmessage( 0, "Aera SpecOpp", "all", "[Translate: Aernoss -> Englysh] Flee smart to go entity/self <conditional> life value." ) print("done all but fail") self.mission_fail()
def tooDead(self): print "tail: Too dead" VS.IOmessage( 0, "[Mission Computer]", "all", "The target %s has been destroyed." % self.enemy.getFullname()) VS.IOmessage(1, "[Mission Computer]", "all", "Mission Failed.") self.fail()
def Execute(self): if (VS.getSystemFile() == self.sysfile): playa = VS.getPlayer() if (playa): if (self.shipyard): if (self.shipyard.getSignificantDistance(playa) > 1000): debug.info("shipy ret") debug.info(self.shipyard.getSignificantDistance(playa)) return 1 else: debug.info("killing") pos = self.shipyard.Position() size = 10 * self.shipyard.rSize() VS.playAnimation("explosion_orange.ani", pos, size) pos = (pos[0] + .5 * size, pos[1], pos[2]) VS.playAnimation("explosion_orange.ani", pos, size) pos = (pos[0] - size, pos[1], pos[2]) VS.playAnimation("explosion_orange.ani", pos, size) VS.playSound("explosion.wav", pos, (1, 0, 0)) self.shipyard.DealDamageToHull( (10, 0, 0), self.shipyard.GetHull() * .9) self.removeQuest() VS.IOmessage( 0, "game", "all", "[Computer] Large Explosion detected... standby...%#@*") VS.IOmessage( 0, "game", "news", "NAVAL SHIPYARDS HIT BY BOMB: Disaster struck the Confederate Naval Shipyards orbiting Alpha Centauri two days ago, when a powerful explosive device detonated, crippling a fleet carrier that was nearing completion. At least a dozen casualties were reported with an unknown number of injured, and salvage crews are still working hard to clear the area of wreckage. A team from the CSP (Confederate Security Police) arrived at the shipyards mere hours after the incident, and an investigation has been launched to determine who the perpetrators of this attack were, whether they were human terrorists or agents of an alien power." ) return 0 return 1
def start_destruction(self): if self.repeat_end2 == 2 and not self.cargo_container.isNull(): if self.timer1 == 0: self.timer1 = VS.GetGameTime() self.cargo_container.Split(75) VS.playAnimation("explosion_wave.ani",self.cargo_container.Position(),300) VS.playAnimation("explosion_wave.ani",self.cargo_container.Position(),100) VS.playAnimation("explosion_wave.ani",self.cargo_container.Position(),700) VS.playAnimation("explosion_wave.ani",self.cargo_container.Position(),1000) VS.playSound("sfx43.wav",self.cargo_container.Position(),self.cargo_container.GetVelocity()) VS.playSound("Flux.wav",self.cargo_container.Position(),self.cargo_container.GetVelocity()) VS.playSound("electricity.wav",self.cargo_container.Position(),self.cargo_container.GetVelocity()) print "adding particle" VS.addParticle(self.cargo_container.Position(),self.cargo_container.GetVelocity(),(1,.2,.2)) print "added particle" unit.setTfgDirective(self.aera_specopp,self.playa,'A') print "begin msgs" VS.IOmessage (0,"Aera SpecOpp","all","[Translate: Aernoss -> Englysh] Turn your attention <surprise> Entity/self triggered item warp core!") VS.IOmessage (5,"Aera SpecOpp","all","[Translate: Aernoss -> Englysh] <fear, anxiety, anger> Filthy human procreate entity/self!") VS.IOmessage (12,"Aera SpecOpp","all","[Translate: Aernoss -> Englysh] Group leave fast danger avo...") print "ended msgs" self.jumpout = 1 self.repeat_end2 = 0 print "ended start_destruction"
def doLose(self): VS.SetAutoStatus (0,0) self.removeQuest() VS.IOmessage (0, "game", "all", "Terrorists eliminated! Looks like we have another success to report for %s." % (self.enfaction)) VS.IOmessage (0, "game", "news", 'TERRORIST CELL DESTROYED Recently a %s wing was eliminated by %s special forces. "After learning of a recent assembly by these millitants, we had to move at once!" said SubCommander Ret in a recent interview with GNN, "It is good to see such justice served on our frontiers!" Hopefully this will reduce the recent rash of violence in the frontier sectors of our society!' % (self.faction, self.enfaction)) if (self.won==0): VS.SetAutoStatus (0,0)
def __init__ (self, minnumsystemsaway, maxnumsystemsaway, creds, run_away, shipdifficulty, tempfaction, jumps=(), var_to_set='', namefg='', 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): Director.Mission.__init__ (self) self.firsttime=VS.GetGameTime() self.newship=dyntype self.namefg=namefg self.mplay="all" self.var_to_set = var_to_set self.istarget=0 self.obj=0 self.curiter=0 self.arrived=0 self.faction = tempfaction self.difficulty = shipdifficulty self.runaway=run_away self.greetingText=greetingText self.cred=creds mysys=VS.getSystemFile() sysfile = VS.getSystemFile() self.you=VS.getPlayer() #debug.debug("VS.Unit()") self.enemy=VS.Unit() self.adjsys=go_to_adjacent_systems (self.you,vsrandom.randrange(minnumsystemsaway,maxnumsystemsaway+1),jumps) self.dockable_unit=dockable_unit self.mplay=universe.getMessagePlayer(self.you) self.displayLocation=displayLocation if (self.you): VS.IOmessage (0,"bounty mission",self.mplay,"[Computer] Bounty Mission Objective: (%.2f Credits)" % self.cred) self.adjsys.Print("From %s system","Procede to %s","Search for target at %s, your final destination","bounty mission",1) VS.IOmessage (1,"bounty mission",self.mplay,"Target is a %s unit." % (self.faction)) else: default.info("aboritng bounty constructor...") VS.terminateMission (0)
def GeneratePatrolList(self): VS.IOmessage(0, "patrol", self.mplay, "You must get within %f klicks of" % self.distance) count = self.quantity * 2 str = "" while (self.quantity > 0 and count > 0): count -= 1 sig = unit.getSignificant(vsrandom.randrange(0, 128), 0, 0) if (not sig.isNull()): if (not (sig in self.patrolpoints)): self.patrolpoints += [sig] self.quantity = self.quantity - 1 fac = sig.getFactionName() nam = sig.getName() if (fac != "neutral"): obj = VS.addObjective("Scan %s's %s" % (fac, nam)) VS.IOmessage(0, "patrol", self.mplay, "%s owned %s " % (fac, nam)) else: if (sig.isPlanet()): if (sig.isJumppoint()): obj = VS.addObjective("Scan Jumppoint %s" % nam) else: obj = VS.addObjective("Scan Planet %s" % nam) else: obj = VS.addObjective( "Scan Natural Phenomenon: %s" % nam) VS.IOmessage(0, "patrol", self.mplay, "The object %s " % nam) VS.setOwner(int(obj), VS.getPlayerX(self.cp)) VS.setCompleteness(int(obj), -1.0) self.objectives += [int(obj)] self.quantity = 0
def mission_success(self): self.confed_cruiser=launch.launch_wave_around_unit("Sonorous","confed","corvette","default",1,4000,8000,self.cargo_container) self.confed_epeels=launch.launch_wave_around_unit("Sonorous E1","confed","epeellcat","default",5,1000,1000,self.confed_cruiser) VS.IOmessage (3,"Sonorous Command","all","Attention Private Vessel!") VS.IOmessage (4,"Sonorous Command","all","Under Code 1530 of the Trade Practices Charter, we take posession of this cargo pod.") VS.IOmessage (6,"Sonorous Command","all","Please remove yourself or we will remove you.") self.jumpout = 0 self.quest_exit = 1
def FailMission (self): self.you.addCredits (-self.cred) VS.AdjustRelation(self.you.getFactionName(),self.faction,-.02,1) self.SetVarValue(-1) VS.IOmessage (0,"escort mission",self.mplay,"You Allowed the base you were to protect to be destroyed.") VS.IOmessage (0,"escort mission",self.mplay,"You are a failure to your race!") 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.") VS.terminateMission(0)
def PayMission(self): VS.AdjustRelation(self.you.getFactionName(),self.faction,.03,1) self.SetVarValue(1) if (self.cred>0): self.you.addCredits (self.cred) VS.IOmessage(0,"escort mission",self.mplay,"Excellent work pilot! Your effort has thwarted the foe!") VS.IOmessage(0,"escort mission",self.mplay,"You have been rewarded for your effort as agreed.") VS.terminateMission(1)
def __init__(self, helpship, helpfac, helpsystem, attackship, attackfac, numgood, goodfac, jumps, var_to_set='', helptext=[]): Director.Mission.__init__(self) self.firsttime = VS.GetGameTime() self.lastjump = "Gemini/Blockade_Point_Tango" if (jumps): if (len(jumps)): self.lastjump = jumps[-1] self.jumpingtime = VS.GetGameTime() self.newshiphelp = helpship self.newshipattack = attackship self.newshipgood = '' self.mplay = "all" self.var_to_set = var_to_set self.istarget = 0 self.obj = 0 self.curiter = 0 self.arrived = 0 self.helpfaction = helpfac self.helpsystem = helpsystem self.goodfaction = goodfac self.attackfaction = attackfac self.numgood = numgood self.runaway = False self.greetingText = helptext self.cred = 0 mysys = VS.getSystemFile() sysfile = VS.getSystemFile() self.you = VS.getPlayer() self.enemy = VS.Unit() self.helperpos = (0, 0, 0) self.helper = VS.Unit() self.adjsys = go_to_adjacent_systems(self.you, 0, jumps) self.mplay = universe.getMessagePlayer(self.you) self.displayLocation = True if (self.you): VS.IOmessage( 0, "defend mission", self.mplay, "[Computer] Defend Mission Objective: (%.2f Credits)" % self.cred) self.adjsys.Print( "From %s system", "Procede to %s", "Search for target at %s, your final destination", "defend mission", 1) VS.IOmessage(1, "defend mission", self.mplay, "Target is a %s unit." % (self.attackfaction)) else: debug.info("aborting defend_drone constructor...") VS.terminateMission(0)
def Lose(self): VS.IOmessage( 0, "game", "all", "[Computer] Jump signature matching Rlaan spy reported earlier detected." ) VS.IOmessage(0, "game", "all", "[Computer] unable to track.") VS.IOmessage(10, "game", "all", "[Computer] burst transmission to Rlaan space detected.") self.removeQuest()
def SuccessMission(self): self.you.addCredits(self.cred) if self.donevar != '': quest.removeQuest(self.you.isPlayerStarship(), self.donevar, 1) VS.IOmessage(0, "computer", self.mplay, "[Computer] Transmitting Data..") VS.IOmessage(0, "patrol", self.mplay, "Thank you! Patrol Complete.") VS.IOmessage(0, "patrol", self.mplay, "We have credited your account.") VS.terminateMission(1)
def player_docked(self): nam = self.docked_un.getName() VS.IOmessage(0,'game','news',self.callsign+' has docked to the '+nam) VS.IOmessage(0,'game','all',self.callsign+' has docked to the '+nam) #if self.objectives>0: # VS.eraseObjective(self.objectives-1) dynamic_mission.CreateMissions() print campaign_lib.getActiveCampaignNodes(-1)
def GenerateEnemies(self, jp, you): count = 0 VS.addObjective("Protect %s from %s" % (jp.getName(), self.faction)) self.objective = VS.addObjective("Destroy All %s Hostiles" % self.faction) VS.setCompleteness(self.objective, 0.0) debug.info("quantity " + str(self.quantity)) while (count < self.quantity): L = launch.Launch() if self.dynatkfg == "": atkfg = "Shadow" else: atkfg = self.dynatkfg L.fg = atkfg L.dynfg = "" if count == 0: L.fgappend = "" else: L.fgappend = "_" + str(count) if (self.dynatktype == ''): L.type = faction_ships.getRandomFighter(self.faction) else: L.type = self.dynatktype L.ai = "default" L.num = 1 L.minradius = 20000.0 L.maxradius = 25000.0 try: L.minradius *= faction_ships.launch_distance_factor L.maxradius *= faction_ships.launch_distance_factor except: pass L.faction = self.faction launched = L.launch(you) if (count == 0): self.you.SetTarget(launched) if (1): launched.SetTarget(jp) else: launched.SetTarget(you) if (self.dedicatedattack): launched.setFgDirective('B') self.attackers += [launched] count += 1 if (self.respawn == 0 and len(self.attackers) > 0): self.respawn = 1 import universe universe.greet(self.greetingText, self.attackers[0], you, self.dyndeffg) else: VS.IOmessage(0, "escort mission", self.mplay, "Eliminate all %s ships here" % self.faction) VS.IOmessage(0, "escort mission", self.mplay, "You must protect %s." % jp.getName()) self.quantity = 0
def Win (self,un,terminate): VS.IOmessage (0,"Passenger",self.mplay,"#00ff00Excellent work pilot.") VS.IOmessage (0,"Passenger",self.mplay,"#00ff00You have been rewarded for your effort as agreed.") VS.IOmessage (0,"Passenger",self.mplay,"#00ff00You saved my life. I owe you a drink, pal") un.addCredits(self.cred) VS.AdjustRelation(self.you.getFactionName(),self.faction,.02,1) if len(self.donevar): quest.removeQuest(self.you.isPlayerStarship(),self.donevar,1) if (terminate): VS.terminateMission(1)
def outOfRange(self): print "tail: Out of range" i = 0 for j in range(len(self.fail2)): VS.IOmessage(j, "[Mission Command]", "all", self.fail2[j]) i += 1 VS.IOmessage(i, "[Mission Computer]", "all", "You are not able to detect the target.") VS.IOmessage(i + 1, "[Mission Computer]", "all", "Mission Failed.") self.fail()
def SuccessMission(self): self.you.addCredits(self.cred) VS.AdjustRelation(self.you.getFactionName(), self.faction, .03, 1) self.SetVarValue(1) VS.IOmessage(0, "defend", self.mplay, "[Computer] Defend mission accomplished") if (self.cred > 0): VS.IOmessage( 0, "defend", self.mplay, "[Computer] Bank account has been credited as agreed.") VS.terminateMission(1)
def doWin(self): self.won = 1 if (self.NothingHere()): return VS.SetAutoStatus(0, 0) self.makeQuestPersistent() VS.IOmessage (0, "game", "all", "Thank you for saving us!") VS.IOmessage (0, "game", "all", "We owe our lives to you...") VS.IOmessage (0, "game", "all", "So therefore we will go with you and follow your orders where they may take us") VS.IOmessage (0, "game", "all", "Together we can succeed!") VS.IOmessage (0, "game", "news", 'TERRORIST FLIGHTGROUP ESCAPES Recently a long sought for %s wing confronted and destroyed %s special forces. "After learning of a recent assembly by these millitants, we had to move at once; it is sad that these militants preemtively struck our forces before retreating like cowards!" said SubCommander Ret in a recent interview with GNN, "We need to warn our citizens of the presence of roaming %s starships...Any sighting of these starships must be reported to %s authorities immediately." Will such slips in confed security cause further problems in the frontier, or will they finally meet their end after a deadly manhunt? The future remains to be seen. The SubCommanders parting words were: "But See to it I will, I can promise you that!"' % (self.faction, self.enfaction, self.faction, self.enfaction))
def Print(self, beginstr, midstr, endstr, fro, wait=0): msgply = universe.getMessagePlayer(self.you) if (len(self.jumps) > 0): VS.IOmessage(wait, fro, msgply, beginstr % (formatSystemName(VS.getSystemFile()))) for i in range(len(self.jumps) - 1): VS.IOmessage(wait, fro, msgply, midstr % (formatSystemName(self.jumps[i]))) VS.IOmessage( wait, fro, msgply, endstr % (formatSystemName(self.jumps[len(self.jumps) - 1])))
def player_undocked(self): if not self.docked_un: print 'Base for'+self.callsign+'blew up!' return dynamic_mission.eraseExtras() nam = self.docked_un.getName() campaign_lib.undock_campaigns() VS.IOmessage(0,'game','news',self.callsign+' has undocked from the '+nam) VS.IOmessage(0,'game','all',self.callsign+' has undocked from the '+nam)
def FailMission(self): self.you.addCredits(-self.cred) VS.AdjustRelation(self.you.getFactionName(), self.faction, -.02, 1) self.SetVarValue(-1) VS.IOmessage(0, "defend", self.mplay, "[Computer] Detected failure to protect mission asset.") VS.IOmessage(0, "defend", self.mplay, "[Computer] Mission failed!") VS.IOmessage( 1, "defend", self.mplay, "[Computer] Bank has been informed of failure to assist asset. They have removed a number of your credits as a penalty to help pay target insurance." ) VS.terminateMission(0)
def tooClose(self): print "tail: Too close" VS.IOmessage( 0, "[Mission Computer]", "all", "You have been detected by the target %s " % self.enemy.getFullname()) VS.IOmessage(1, "[Mission Computer]", "all", "Mission Failed.") for i in range(len(self.fail1)): VS.IOmessage(i + 2, "Target", "all", self.fail1[i]) self.enemy.SetTarget(VS.getPlayerX(self.cp)) self.enemy.setFgDirective('A') self.fail()
def Execute(self): if (VS.GetGameTime() - self.gametime > 10): self.escortee.setFgDirective('F') if self.you.isNull(): VS.IOmessage( 0, "escort", self.mplay, "#ff0000You were to protect your escort. Mission failed.") VS.terminateMission(0) return self.escortee.setFlightgroupLeader(self.you) #print 'name: '+self.escortee.getFlightgroupLeader().getName() #self.escortee.SetVelocity(self.you.GetVelocity()) if (self.escortee.isNull()): VS.IOmessage( 0, "escort", self.mplay, "#ff0000You were to protect your escort. Mission failed.") universe.punish(self.you, self.faction, self.difficulty) if (self.var_to_set != ''): quest.removeQuest(self.you.isPlayerStarship(), self.var_to_set, -1) VS.terminateMission(0) return if (not self.adjsys.Execute()): if (self.arrived): self.adjsys.SignificantUnit().setSpeed(0.0) self.adjsys.SignificantUnit().SetVelocity((0.0, 0.0, 0.0)) return if (not self.arrived): self.arrived = 1 self.adjsys = go_somewhere_significant( self.you, 1, self.distfrombase + 15 * self.escortee.rSize(), self.difficulty <= 1, self.faction) self.role = self.adjsys.SignificantUnit().getCombatRole() self.adjsys.SignificantUnit().setCombatRole("INERT") self.adjsys.Print("You must escort your starship to the %s", "defend", "docked around the %s", 0) elif (self.you.getDistance(self.escortee) < 2000): self.you.addCredits(self.creds) VS.AdjustRelation(self.you.getFactionName(), self.faction, self.difficulty * .01, 1) VS.IOmessage( 0, "escort", self.mplay, "#00ff00Excellent work! You have completed this mission!") self.escortee.setFgDirective('b') self.escortee.setFlightgroupLeader(self.escortee) self.escortee.performDockingOperations( self.adjsys.SignificantUnit(), 0) self.adjsys.SignificantUnit().setCombatRole(self.role) if (self.var_to_set != ''): quest.removeQuest(self.you.isPlayerStarship(), self.var_to_set, 1) VS.terminateMission(1)
def Intro(self): VS.IOmessage( 0, "game", "all", "[%s Enforcers] Under edict 502419 We hereby command" % self.enfaction) VS.IOmessage( 0, "game", "all", "[%s Enforcers] All %s terrorists to power down and prepare to be boarded." % (self.enfaction, self.faction)) VS.IOmessage( 3, "game", "all", "[%s Enforcers] You are in violation of anti-terrorist laws." % self.enfaction) VS.IOmessage( 4, "game", "all", "[%s Enforcers] And are conspiring against the legitimate Star Confederacy." % self.enfaction) VS.IOmessage( 5, "game", "all", "[%s Wing] We have nothing to do with your alleged terrorists" % self.faction) VS.IOmessage( 5, "game", "all", "[%s Wing] and are only exercising our freedom of assembly." % self.faction) VS.IOmessage( 8, "game", "all", "[%s Wing] This is a %s wing requesting assistance from any nearby craft! We are being arrested unfairly!" % (self.faction, self.faction)) VS.IOmessage( 8, "game", "all", "[%s Wing] Should anyone honor our request for help we would be severely in debt!" % self.faction)
def GenerateEnemies(self, jp, you): VS.IOmessage(0, "escort mission", self.mplay, "You must protect %s." % unit.getUnitFullName(jp, True)) count = 0 jp.setMissionRelevant() VS.addObjective("Protect %s from the %s" % (unit.getUnitFullName(jp), self.faction.capitalize().replace("_", " "))) self.objective = VS.addObjective("Destroy All %s Hostiles" % self.faction) VS.setCompleteness(self.objective, 0.0) print("quantity " + str(self.quantity)) while (count < self.quantity): L = launch.Launch() L.fg = "Shadow" L.dynfg = self.dynatkfg if (self.dynatktype == ''): L.type = faction_ships.getRandomFighter(self.faction) else: L.type = self.dynatktype L.ai = "default" L.num = 1 L.minradius = 2000.0 L.maxradius = 4500.0 try: L.minradius *= faction_ships.launch_distance_factor L.maxradius *= faction_ships.launch_distance_factor except: pass L.faction = self.faction launched = L.launch(you) if (count == 0): self.you.SetTarget(launched) if (self.defend): launched.SetTarget(jp) else: launched.SetTarget(you) if (self.dedicatedattack): launched.setFgDirective('B') self.attackers += [launched] count += 1 if (self.respawn == 0 and len(self.attackers) > 0): self.respawn = 1 import universe universe.greet(self.greetingText, self.attackers[0], you) else: VS.IOmessage(0, "escort mission", self.mplay, "Eliminate all %s ships here" % self.faction) self.quantity = 0
def __init__(self, price, factionname, numships, difficulty): Director.Mission.__init__(self) self.price = price self.faction = factionname self.you = VS.getPlayer() self.numships = numships self.diff = difficulty self.adjsys = go_somewhere_significant(self.you, 0, 5000, 0) self.wingship = faction_ships.getRandomFighter(factionname) nam = "[%s]" % self.wingship self.adjsys.Print("Hello I'm waiting for your arrival at %s", self.wingship) VS.IOmessage(1, self.wingship, "all", "Once you meet me") VS.IOmessage(2, self.wingship, "all", "I will obey your commands until our contracts expire.")