1 from difficulty
import usingDifficulty
10 def launch (fgname, faction, type,ai, nr_ships, nr_waves, vec, logo='',useani=1,skipdj=0):
15 if (
not diff
or (type.find(
".blank")==-1
and -1==type.find(
".stock"))):
16 for i
in range(nr_ships):
17 ret = VS.launch (fgname,type,faction,
"unit",ai,1,nr_waves,VS.SafeEntrancePoint (vec,40),logo)
23 diffic = VS.GetDifficulty()
25 for i
in range(nr_ships):
26 mynew=VS.launch(fgname,type,faction,
"unit",ai,1,nr_waves,VS.SafeEntrancePoint (vec,40),logo)
30 rsize =mynew.rSize ()*1.75
31 ship_upgrades.upgradeUnit ( mynew,diffic)
39 def launch_waves_around_area(fgname,faction,type,ai,nr_ships,nr_waves,r1,r2,pos,logo='',useani=1,skipdj=0):
43 return launch(fgname,faction,type,ai,nr_ships,nr_waves,pos,logo,useani,skipdj)
45 def launch_wave_around_area(fgname,faction,type,ai,nr_ships,r1,r2,pos,logo='',useani=1,skipdj=0):
47 return launch_waves_around_area (fgname,faction,type,ai,nr_ships,1,r1,r2,pos,logo,useani,skipdj)
51 if(station_unit.isNull()):
52 sys.stderr.write(
"launch.py:launch_around_station did not find unit %s\n" % (station_name))
54 station_pos = station_unit.Position()
55 rsize = station_unit.rSize()
56 launched =
launch_waves_around_area(fgname,faction,type,ai,nr_ships,nr_waves,rsize,rsize*2.0,station_pos,logo,useani,skipdj)
59 launch_around_unit=launch_around_station
61 def launch_waves_in_area(fgname,faction,type,ai,nr_ships,nr_waves,radius,pos,logo='',useani=1,skipdj=0):
65 un =
launch(fgname,faction,type,ai,nr_ships,nr_waves,pos,logo,useani,skipdj)
68 launch_waves_in_area(fgname,faction,type,ai,nr_ships,1,radius,pos,logo,useani,skipdj)
75 launch(outstr,faction,type,ainame,nr,1,wp,logo,useani,(skipdj
or (i==c)))
78 def launch_wave_around_unit (fgname, faction, type, ai, nr_ships, minradius, maxradius, my_unit,logo='',useani=1,skipdj=0):
81 if (my_unit.isNull()):
82 un=launch_wave_around_area (fgname,faction,type,ai,nr_ships,minradius,maxradius,myvec,logo,useani,skipdj)
84 myvec=my_unit.LocalPosition()
87 if (maxradius > faction_ships.max_radius):
88 maxradius=faction_ships.max_radius
89 if (minradius > faction_ships.max_radius):
90 minradius=faction_ships.max_radius
91 un=launch_wave_around_area (fgname,faction,type,ai,nr_ships,rsiz+minradius,rsiz+maxradius,myvec,logo,useani,skipdj)
94 def launch_wave_around_significant (fgname,faction,type,ai,nr_ships,minradius, maxradius,significant_number,logo='',useani=1,skipdj=0):
96 if (significant_unit.isNull()):
97 significant_unit = VS.getPlayer()
98 launched =
launch_wave_around_unit(fgname,faction,type,ai,nr_ships,minradius,maxradius,significant_unit,logo,useani,skipdj)
130 if (tn!=[]
and self.
type!=
''):
131 for i
in range (len(tn)):
132 if (tn[i][0]==self.
type):
144 debug.error(
"Dyn-Launch: tn==[], dynfg==\'\' Error 47")
155 if (i[1]>self.num-knum):
156 i = (i[0],self.num-knum)
157 self._dyn_nr_ships+=[i]
159 self._nr_ships=self.num-knum
164 if (self._nr_ships>0):
167 lame= launch_wave_around_area (self.dynfg+self.fgappend,self.faction,self.type,self.ai,self._nr_ships, self.minradius,self.maxradius,self.pos,self.logo,self.useani,skipdj)
170 lame= launch_wave_around_unit (self.dynfg+self.fgappend,self.faction,self.type,self.ai,self._nr_ships,self.minradius,self.maxradius,myunit,self.logo,self.useani,skipdj)
171 import launch_recycle
172 ret= launch_recycle.launch_types_around (self.dynfg,self.faction,self._dyn_nr_ships,self.ai,self.minradius*.5+self.maxradius*.5,myunit,100000+self.maxradius,self.logo,self.fgappend,skipdj)
173 if (len(self._dyn_nr_ships)
or self._nr_ships==0):
178 if ((
not myunit)
and self._nr_ships>0):
180 return launch_wave_around_area (self.fg+self.fgappend,self.faction,self.type,self.ai,self._nr_ships, self.minradius,self.maxradius,self.pos,self.logo,self.useani,skipdj)
181 elif (self._nr_ships>0):
183 return launch_wave_around_unit (self.fg+self.fgappend,self.faction,self.type,self.ai,self._nr_ships,self.minradius,self.maxradius,myunit,self.logo,self.useani,skipdj)
186 return launch_wave_around_unit (self.fg+self.fgappend,self.faction,self.type,self.ai,1,self.minradius,self.maxradius,myunit,self.logo,self.useani,skipdj)