Vega strike Python Modules doc  0.5.1
Documentation of the " Modules " folder of Vega strike
 All Data Structures Namespaces Files Functions Variables
quest_slaver.py
Go to the documentation of this file.
1 #---------------------------------------------------------------------------------
2 # Vega Strike script for a quest
3 # Copyright (C) 2008 Vega Strike team
4 # Contact: hellcatv@sourceforge.net
5 # Internet: http://vegastrike.sourceforge.net/
6 #.
7 # This program is free software; you can redistribute it and/or
8 # modify it under the terms of the GNU General Public License
9 # as published by the Free Software Foundation; either version 2
10 # of the License, or (at your option) any later version.
11 #
12 # Description: SlaverGuild fight with Confed flight group
13 # adapted from original script by hellcatv
14 # Author: pyramid
15 # Version: 2008-05-12
16 #
17 #---------------------------------------------------------------------------------
18 
19 import VS
20 import quest
21 import Director
22 import Vector
23 import unit
24 import vsrandom
25 import launch
26 import faction_ships
27 
29  def __init__ (self):
30  self.system = VS.getSystemName()
31  playa = VS.getPlayer()
32  self.msgColor = ("#9999FF","#FF9999")
33  if (playa):
34  confed = faction_ships.factions[faction_ships.confed]
35  pirates = faction_ships.factions[faction_ships.pirates]
36  illustrious=launch.launch_wave_around_unit ('Illustrious',confed,faction_ships.getRandomCapitol(confed),'default',1,1000,4000,playa)
37  launch.launch_wave_around_unit ('Illustrious',confed,faction_ships.getRandomCapitol(confed),'default',2,1000,2000,illustrious)
38  launch.launch_wave_around_unit ('Illustrious',confed,faction_ships.getRandomFighter(confed),'default',4,100,200,illustrious)
39  launch.launch_wave_around_unit ('SlaverGuild',pirates,faction_ships.getRandomFighter(pirates),'default',4,100,200,illustrious)
40  launch.launch_wave_around_unit ('SlaverGuild',pirates,faction_ships.getRandomCapitol(pirates),'default',2,100,200,illustrious)
41  VS.IOmessage (3,"[Computer]","privateer",self.msgColor[0]+"Scans show the remnants of the Slaver Guild being cleaned up by Special Forces.")
42 
43  # things that could be added/improved
44  # (a) some comm chatter
45  # (b) reward for killing either one fg or the other
46  def Execute (self):
47  if (not VS.getSystemName()==self.system):
48  self.playernum = -1
49  self.name = "quest_slaver"
50  self.removeQuest()
51  return 0
52 
54  def __init__ (self):
55  quest.quest_factory.__init__ (self,"quest_slaver")
56  def precondition(self,playernum):
57  return 1
58  def create (self):
59  return quest_slaver()
60 
61 class MissionExecutor(Director.Mission):
62 # call this class from the mission file
63  def __init__(self, classesToExecute):
64  Director.Mission.__init__(self)
65  self.classes = classesToExecute
66  def Execute(self):
67  for c in self.classes:
68  c.Execute()