def Execute(self): VS.PythonAI.Execute(self) if quest_contraband_truck.truck_exit == 1: if self.got_target == 0: self.GetParent().SetTarget(universe.getRandomJumppoint()) self.trucktarget = (self.GetParent()).GetTarget() self.XMLScript("++afterburn-turntowards.xml") self.AddReplaceLastOrder(1) self.got_target = 1 # starts him afterburning to target if self.timer == 0: self.timer = VS.GetGameTime() print "Timer Set" elif self.timer + 30 < VS.GetGameTime() and self.autoed == 0: self.GetParent().ActivateJumpDrive(1) self.GetParent().AutoPilotTo(self.trucktarget, 1) self.autoed = 1 elif self.timer + 5 < VS.GetGameTime(): self.MoveTo(self.trucktarget.Position(), 1) self.AddReplaceLastOrder(1) # elif self.timer + 60 < VS.GetGameTime(): # gets him to auto to the jump and jump out # self.GetParent().ActivateJumpDrive(1) print self.GetParent().getMinDis(self.trucktarget.Position()) return 1
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 Execute(self): if (VS.getPlayer()): iter = 0 for base in self.fac: if (base.getDistance(VS.getPlayer()) < 0): if (VS.GetGameTime() - self.delay > 4): self.delay = VS.GetGameTime() facname = self.facnames[iter] if (facname == "random"): facname = self.facnames[vsrandom.randrange( 0, len(self.facnames))] type = faction_ships.getRandomFighter(facname) if (iter >= len(self.facnames) / 2): type = faction_ships.getRandomCapitol(facname) tmp = launch.launch_wave_around_unit( "Shadow_" + facname, facname, type, "default", 1, 200, 250, VS.getPlayer(), '', 0) # tmp.upgrade("basic_armor",0,0,1,0) # tmp.upgrade("shield_4_Level1",0,0,1,0) # tmp.upgrade("reactor_level_2",0,0,1,0) # tmp.upgrade("add_ablative_hull_coating",0,0,1,0) # tmp.upgrade("add_sublimative_hull_coating",0,0,1,0) VS.getPlayer().upgrade("tungsten", 0, 0, 1, 0) VS.getPlayer().upgrade("tungsten_hull", 0, 0, 1, 0) else: VS.IOmessage( 0, "spawner", "all", "Going to spawn " + self.facnames[iter] + "starships in %d seconds at." % (10 - (VS.GetGameTime() - self.delay))) iter += 1
def Execute(self): if (VS.getPlayer()): iter = 0 for base in self.fac: if (base.getDistance(VS.getPlayer()) < 0): if (VS.GetGameTime() - self.delay > 10): self.delay = VS.GetGameTime() type = faction_ships.getRandomFighter( self.facnames[iter]) if (iter >= len(self.facnames) / 2): type = faction_ships.getRandomCapitol( self.facnames[iter]) launch.launch_wave_around_unit( "Shadow_" + self.facnames[iter], self.facnames[iter], type, "default", 1, 200, 250, VS.getPlayer(), '', 0) VS.getPlayer().upgrade("tungsten", 0, 0, 1, 0) VS.getPlayer().upgrade("tungsten_hull", 0, 0, 1, 0) else: VS.IOmessage( 0, "spawner", "all", "Going to spawn " + self.facnames[iter] + "starships in %d seconds at." % (10 - (VS.GetGameTime() - self.delay))) iter += 1
def Execute (self): if (VS.getSystemName()==self.system and self.player and self.shipyard): if (self.stage==1 and VS.GetGameTime()>=self.timer): if (self.shipyard.getSignificantDistance(self.player) > 20000): print('shipy ret') print("distance" + str(self.shipyard.getSignificantDistance(self.player))) return 1 else: print('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.timer = VS.GetGameTime()+10 self.stage = 2 if (self.stage==2 and VS.GetGameTime()>=self.timer): VS.IOmessage(0,unit.getUnitFullName(self.shipyard),"all",self.msgColor[0]+"Large Explosion detected... standby...%#@*") text = "NAVAL SHIPYARDS HIT BY BOMB\\\Disaster struck the Confederate Naval Shipyards orbiting Alpha Centauri hours ago, when a powerful explosive device detonated, crippling a fleet carrier that was nearing completion. " text += "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. " text += "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." news.publishNews(text) self.stage = 99 if (self.stage==99 and not VS.getSystemName()==self.system): self.stage += 1 # don't enter this loop anymore self.playernum = -1 self.name = "quest_shipyardbomb" self.removeQuest() return 0 return 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 Execute(self): if (self.successdelay): if (self.defendee.getUnitSystemFile() != self.you.getUnitSystemFile() or VS.GetGameTime() - self.successdelay > 120): if (self.defendee): self.PayMission() else: self.FailMission() return # nothing more happens inside this control if (self.you.isNull() or (self.launchedfriend and self.defendee.isNull())): VS.IOmessage( 0, "escort mission", self.mplay, "#ff0000You were unable to arrive in time to help. Mission failed." ) self.SetVarValue(-1) VS.terminateMission(0) return if (not self.adjsys.Execute()): return if (not self.arrived): self.arrived = 1 if (self.launchedfriend == 0 and not self.incoming): self.defendee = self.GenerateDefendee() self.launchedfriend = 1 self.adjsys = go_somewhere_significant(self.you, 0, self.distance_from_base, 0) self.adjsys.Print("You must visit the %s", "escort mission", "docked around the %s", 0) self.jp = self.adjsys.SignificantUnit() else: if (self.launchedfriend == 0): self.defendee = self.GenerateDefendee() self.launchedfriend = 1 if (self.defendee.isNull()): self.FailMission(you) return else: self.defendee.setFlightgroupLeader(self.you) if (VS.GetGameTime() - self.gametime > 10): self.defendee.setFgDirective('F') if (self.quantity > 0): self.GenerateEnemies(self.defendee, self.you) if (self.ship_check_count == 0 and self.dedicatedattack): if (self.targetiter >= len(self.attackers)): self.targetiter = 0 else: un = self.attackers[self.targetiter] if (not un.isNull()): un.SetTarget(self.defendee) self.targetiter = self.targetiter + 1 if (self.NoEnemiesInArea(self.defendee)): if (self.waves > 0): self.quantity = self.savedquantity self.waves -= 1 else: self.SuccessMission()
def loopbriefing(self): brief_you = self.adjsys.loopbriefing() if (brief_you != -1): VS.IOmessage( 0, "cargo mission", "briefing", "Once there, you must drop the cargo off at a specified unit") if (self.briefgametime == 0): self.briefgametime = VS.GetGameTime() elif ((VS.GetGameTime() - self.briefgametime) > 5): Briefing.terminate()
def Execute (self): #if (not self.player.isNull() and self.playerIsUndocked()): if ( not self.player.isNull() ): # execute every N seconds if (VS.GetGameTime()>self.timer): # print something on the stdout console #print "startime: ", VS.getStarTime(), VS.getStarDate(), stardate.formatStarDate("confed",VS.getStarTime()) # print something to the ingame messages VS.IOmessage (0, self.msgColor+"debug"+"#FFFFFF", "Privateer", self.msgColor+"stardate: " + stardate.formatStarDate("confed",VS.getStarTime()) ) self.timer = VS.GetGameTime()+20 # keep the script alive for execution return 1
def __init__ (self): self.player = VS.getPlayer() self.stage = 1 self.timer = VS.GetGameTime() self.talktime = VS.GetGameTime() self.anitime = VS.GetGameTime() self.merColor = "#99FFFF" self.socColor = "#FF9999" # This will get an agricultural station from the system, and assign it to 'station' # this station is the only one that has only one docking port, thus fits perfectly # into this quest theme self.station = unit.getUnitByName('Agricultural_Station')
def Execute(self): import VS if (self.wastingtimestart!=0 and self.wastingtimestart<VS.GetGameTime() and self.utdw!=self.enemy): self.wastingtimestart=0 self.enemy.performDockingOperations(self.utdw,True) bounty_leader.bounty_leader.Execute(self) if (self.troopdidlaunch and self.inevitabletime ==0): if self.enemy.getDistance(self.utdw)<0: self.inevitabletime=VS.GetGameTime() if self.inevitabletime !=0 and VS.GetGameTime()-self.inevitabletime>self.trooptime: self.utdw.setFactionName(self.enemy.getFactionName()) self.Lose(1)
def Execute(self): you = VS.getPlayerX(self.cp) if you.isNull(): print 'you is null' self.fail() elif self.success: self.initSuccess() elif self.setupEnemy(): if self.enemy.isNull(): self.tooDead() if self.waiting: if self.tracking[0] < VS.GetGameTime(): self.outOfRange() elif VS.getPlayerX(self.cp).getUnitSystemFile( ) == self.enemy.getUnitSystemFile(): self.waiting = False t = self.updateEnemyObjective() VS.IOmessage( 0, "[Mission Computer]", "all", "Target %s detected in this system." % self.enemy.getFullname()) VS.setObjective( self.objref, "Follow the %s until it broadcasts the signal" % self.enemy.getFullname()) if t is not None: self.doPlacement(t) else: self.success = True elif VS.getPlayerX(self.cp).getUnitSystemFile( ) != self.enemy.getUnitSystemFile(): self.enemy.DeactivateJumpDrive() self.waiting = True self.tracking = (VS.GetGameTime() + self.WAITTIME, VS.getPlayerX(self.cp).getDistance( self.enemy)) VS.IOmessage( 0, "[Mission Computer]", "all", "Target %s detected entering %s" % (self.enemy.getFullname(), self.nextSystem(VS.getPlayerX(self.cp)))) VS.setObjective( self.objref, "Follow the %s into %s" % (self.enemy.getFullname(), self.nextSystem(VS.getPlayerX(self.cp)))) elif VS.getPlayerX(self.cp).getDistance( self.enemy) < self.mindist or self.enemyThreatened(): self.tooClose()
def __init__ (self): self.sysfile = VS.getSystemFile() self.drone=VS.Unit() self.significants=1 self.timer = VS.GetGameTime(); VS.cacheAnimation ("explosion_wave.ani"); self.playlist=VS.musicAddList("galacticbattle.m3u")
def getPlacementVectors(self, target): relpos = Vector.Sub(target.Position(), VS.getPlayerX(self.cp).Position()) unitrel = Vector.Scale(relpos, 1.0 / Vector.Mag(relpos)) approx = list() approx.append(Vector.Scale(unitrel, self.tracking[1])) approx.append( Vector.Scale( relpos, (VS.GetGameTime() - self.tracking[0] + self.WAITTIME) / self.WAITTIME)) for i in range(len(approx)): if approx[i] < self.mindist or approx[i] > Vector.Mag(relpos): approx[i] = False biggest = (0, 0, 0) for i in range(len(approx)): if approx[i]: if Vector.Mag(approx[i]) > Vector.Mag(biggest): biggest = approx[i] if Vector.Mag( biggest ) < 1: #arbitrary check to see if we've got a valid result # raise RuntimeError("Could not find a suitable approximation for unit placement.") # Runtime errors are ... less than optimal. Lets pick a vector and hope. print 'tail: Pick a vector and hope' unitrel = (1, 0, 0) biggest = (self.startdist, 0, 0) return unitrel, biggest
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 __init__ (self): self.player = VS.getPlayer() self.stage = 1 self.timer = VS.GetGameTime() self.msgColor = ("#FF9999","#FF99FF") self.system = VS.getSystemName() self.shipyard = unit.getUnitByName('Shipyard')
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 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 LaunchedEnemies(self, significant): import VS bounty_leader.bounty_leader.LaunchedEnemies(self, significant) self.troopdidlaunch = True import unit self.istarget = 1 capship_only = 1 self.utdw = self.adjsys.SignificantUnit( ) #unit.getSignificant(0,1,capship_only) self.wastingtimestart = VS.GetGameTime() + self.wastingtime self.wastingtime = 0 if (self.utdw == self.enemy): self.utdw = unit.getSignificant(1, 1, capship_only) if (self.utdw == self.enemy): self.utdw = unit.getSignificant(2, 1, capship_only) if (self.utdw == self.enemy): self.utdw = unit.getSignificant(3, 1, capship_only) pos = self.utdw.Position() if self.dockingdist > 0: import Vector diff = Vector.Sub(self.you.Position(), pos) ndiff = Vector.Norm(diff) self.enemy.SetPosition( Vector.Add( Vector.Scale( ndiff, self.dockingdist + self.enemy.rSize() + self.utdw.rSize()), pos))
def init(self, un): self.timer = VS.GetGameTime() self.target = self.GetParent().GetTarget() self.GetParent().setSpeed(100) # calculate required thrust factor as an approximate relation of mass to reference mass # found empirically, since thrust values are not read from the model self.thrustfactor = self.GetParent().GetMass() / 50
def Execute(self): ambush.ambush.Execute(self) if (self.inescapable): you = VS.getPlayerX(self.cp) if you.getUnitSystemFile() == self.systems[0]: self.timer = VS.GetGameTime() if you.GetCargo(self.cargotype).GetQuantity() == 0: self.inescapable = 0 un = VS.getUnit(self.counter) if (un): if un.getName() == self.cargotype or un.getName( ) == "Mission_Cargo": self.counter = 0 un = VS.getUnit(0) while (un): self.counter += 1 un = VS.getUnit(self.counter) while (self.counter > 0): self.counter -= 1 un = VS.getUnit(self.counter) if (un): if un.getName() == self.cargotype or un.getName( ) == "Mission_Cargo": un.Kill() if not self.havelaunched: self.FriendlyLaunch() else: #print self.cargotype +" not matched with "+un.getName() self.counter += 1 else: self.counter = 0
def Execute (self): if (VS.getSystemFile()==self.sysfile): mytime = VS.GetGameTime(); if (mytime-self.timer>10): self.timer=mytime if (vsrandom.randrange(0,5)==0): self.DestroyUnit() return 1
def Execute(self): time = VS.GetGameTime() if (time - self.lasttime > self.waittime): #self.launch_new_wave() VS.IOmessage( 0, "game", "all", "[Confed] This is a test of the emergency broadcast system.") self.lasttime = time
def stageDockingDispute(self): # the comm interchange between the two ships VS.IOmessage( 0, "[VulCorp Transport A-5]", "all", self.merColor + "VulCorp Transport alpha five requesting priority docking.") VS.IOmessage( 5, "[VulCorp Transport A-5]", "all", self.merColor + "We have a load of spare parts that needs to be delivered within the next half hour, or else we don't get paid." ) VS.IOmessage( 15, "[Lenin's Mercy]", "all", self.socColor + "Negative, transport Lenin's Mercy requesting emergency docking. We have thirteen critically injured passengers." ) VS.IOmessage( 25, "[Lenin's Mercy]", "all", self.socColor + "We picked them up after a squadron of pirates attacked their ship. They need immediate medical attention!" ) VS.IOmessage( 35, "[VulCorp Transport A-5]", "all", self.merColor + "Station control, might we remind you that we have a contract with your base? We demand priority in the docking queue so we can complete our transaction." ) VS.IOmessage( 45, "[Lenin's Mercy]", "all", self.socColor + "You capitalist pigs! We have dying men and women on board, and all you can think about is your filthy money!" ) VS.IOmessage( 55, "[VulCorp Transport A-5]", "all", self.merColor + "Socialist vessel: Stay out of the docking queue or you will be fired upon. We will not let a bunch of bleeding communists turn this major deal sour!" ) VS.IOmessage( 65, "[Lenin's Mercy]", "all", self.socColor + "Negative, VulCorp Transport. The lives of our passengers are worth more than your profits!" ) VS.IOmessage(75, "[VulCorp Transport A-5]", "all", self.merColor + "All batteries! Open fire!!") # initialize the animation parameters # the animations to be alternated - animation file and animation duration self.animations = [["com_dispute_merchant.ani", 2], ["com_dispute_socialist.ani", 2]] # states the beginning, duration, and animation number to be played self.sequence = [[0, 10, 0], [15, 15, 1], [35, 5, 0], [45, 5, 1], [55, 5, 0], [65, 5, 1], [75, 4, 0]] # set the beginning of the talk sequence self.talktime = VS.GetGameTime() self.timer = VS.GetGameTime() + 80
def __init__(self): self.sysfile = VS.getSystemFile() self.newsys = self.sysfile self.timer = VS.GetGameTime() self.notcreatedyet = 0 self.you = VS.getPlayer() self.playernum = self.you.isPlayerStarship() self.navpoint = VS.Unit() self.jumppoint = VS.Unit()
def initbriefing (self): self.mytime = VS.GetGameTime(); faction=self.you.getFactionName(); name=self.you.getName() self.brief_you=Briefing.addShip(name,faction,(40.0,0.0,80.0)) faction=self.significantun.getFactionName() name = self.significantun.getName() self.brief_sig=Briefing.addShip(name,faction,(-40,0.0,8000.0)) Briefing.enqueueOrder (self.brief_you,(-30,0.0,7900.0),5.0)
def __init__(self): self.stage = 1 self.player = VS.getPlayer() self.timer = VS.GetGameTime() self.system = VS.getSystemName() self.object = unit.getUnitByName('Jump_To_Nethuuleil') self.groups = 2 #vsrandom.randrange(4,8) self.capital = [] self.fighter = [] self.msgColor = ("#FFFF99", "#FF99FF")
def DeletePatrolPoint(self,num,nam): tmp=self.encounterprob if (self.engreetedyet!=1 or VS.GetGameTime()>self.enemygreetingtime+10): self.enemygreetingtime=VS.GetGameTime() self.engreetedyet+=1 if (len(self.patrolpoints)==1 and self.launchedyet): if (self.ally): pos= self.you.Position() pos=(pos[0],pos[1]+2*self.ally.rSize(),pos[2]+self.you.rSize()*2+2*self.ally.rSize()) self.ally.SetPosition(pos)#move him nearby to last nav point self.encounterprob=1.0 self.minships=self.lastnum self.maxships=self.lastnum elif(self.engreetedyet==2): import universe universe.greet(self.enemygreetingtext,None,self.you) self.encounterprob=1.0 cleansweep.cleansweep.DeletePatrolPoint(self,num,nam) self.encounterprob=tmp
def Execute(self): playa = VS.getPlayer() if (playa.isNull()): return 1 if (self.stage == 0): if (len(self.aera) == 0): if (VS.getSystemFile() != self.sysfile): return 0 if (len(self.aera) == 0): VS.IOmessage( 0, "game", "all", "[Aera Burst Transmission] No targets detected--resistance encountered ca--&$&(*!@^6" ) self.gametime = VS.GetGameTime() self.removeQuest() self.stage = 1 else: if (self.aera[0].isNull()): del self.aera[0] else: if (VS.GetGameTime() - self.gametime > 100): if (not self.devil.isNull()): self.devil.DealDamageToHull((10, 0, 0), self.devil.GetHull() * 100) VS.IOmessage(0, "game", "all", "[Computer] Large energy release detected...") VS.IOmessage(0, "game", "all", "[Computer] Aera Starbase destroyed!") VS.IOmessage( 0, "game", "all", "[Computer] Star Confederacy Starships detected on far side of planet!" ) VS.IOmessage(5, "game", "all", "[Computer] Message from Rescue Fleet") VS.IOmessage( 6, "RescueFleet", "all", "Thank you for your help, privateer...we owe our victory to your cunning kill of those scouts. We offer you 24,000 credits for this critical act!" ) playa.addCredits(24000) self.removeQuest() return 0 return 1
def Execute(self): self.explorequest.Execute() if (VS.getSystemFile() == self.sysfile): mytime = VS.GetGameTime() if (mytime - self.timer > 10): self.timer = mytime numunits = VS.getNumUnits() if (numunits > 0): self.teleportUnit( VS.getUnit(vsrandom.randrange(0, numunits))) return 1