Vega strike Python Modules doc
0.5.1
Documentation of the " Modules " folder of Vega strike
Main Page
Namespaces
Data Structures
Files
File List
All
Data Structures
Namespaces
Files
Functions
Variables
patrol_enemies.py
Go to the documentation of this file.
1
import
patrol
2
class
patrol_enemies
(
patrol.patrol
):
3
def
__init__
(self,numsystemsaway, num_points,distance,creds,jumps,donevar,minships,maxships,encounterprob,capshipprob,faction,forceattack):
4
patrol.patrol.__init__
(self,numsystemsaway,num_points,distance,creds,jumps,donevar)
5
self.
minships
=minships
6
self.
maxships
=maxships
7
self.
encounterprob
=encounterprob
8
self.
capshipprob
=capshipprob
9
self.
faction
=faction
10
self.
forceattack
=forceattack
11
def
Track
(self,shiptype):
12
pass
13
def
SuccessMission
(self):
14
patrol.patrol.SuccessMission
(self)
15
def
DeletePatrolPoint
(self,num,nam):
16
import
vsrandom
17
if
(
vsrandom.random
()<self.
encounterprob
):
18
import
faction_ships
19
fac=self.
faction
20
if
(type(fac)
is
list
or
type(fac)
is
tuple):
21
fac = fac[
vsrandom.randrange
(0,len(fac))]
22
dynfg=
""
23
import
fg_util
24
import
VS
25
allfg=
fg_util.AllFGsInSystem
(fac,VS.getSystemFile())
26
if
(len(allfg)):
27
dynfg = allfg[
vsrandom.randrange
(0,len(allfg))]
28
for
i
in
range(
vsrandom.randrange
(self.
minships
,self.
maxships
+1)):
29
import
launch
30
L=
launch.Launch
()
31
L.fg=
"Shadow"
32
33
L.dynfg=dynfg
34
if
(
vsrandom.random
()<self.
capshipprob
):
35
L.type=
faction_ships.getRandomCapitol
(fac)
36
else
:
37
L.type=
faction_ships.getRandomFighter
(fac)
38
L.ai=
"default"
39
L.faction=fac
40
L.num=1
41
L.minradius=3000.0
42
L.maxradius=4000.0
43
L.fgappend=
"_Patrol"
44
try
:
45
L.minradius*=faction_ships.launch_distance_factor
46
L.maxradius*=faction_ships.launch_distance_factor
47
except
:
48
pass
49
if
(self.
patrolpoints
[num]):
50
newun=L.launch(self.
patrolpoints
[num])
51
if
(self.
forceattack
):
52
lead=newun.getFlightgroupLeader()
53
if
(lead):
54
lead.SetTarget(self.
you
)
55
else
:
56
newun.setFlightgroupLeader(newun)
57
newun.SetTarget(self.
you
)
58
newun.setFgDirective(
"A."
)
59
self.
Track
(newun)
60
patrol.patrol.DeletePatrolPoint
(self,num,nam)
missions
patrol_enemies.py
Generated on Mon Feb 17 2014 12:38:44 for Vega strike Python Modules doc by
1.8.4