[go: up one dir, main page]

Menu

[r11]: / modules / total_war.py  Maximize  Restore  History

Download this file

63 lines (61 with data), 2.3 kB

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
import vsrandom
import launch
import faction_ships
import VS
import Briefing
import universe
import unit
import Director
class total_war (Director.Mission):
def __init__(self):
print "init1INITNITNITNTINTINTINTINTITNINTINTINTINTINT\nININTINTINTITNITNITNTINTINTINTINTITNITNITNITNITNITNITNITNITNIT"
VS.SetDifficulty(.9)
Director.Mission.__init__(self)
self.lasttime=-1000
self.waittime=10.0
def launch_new_wave(self):
un = VS.getPlayer()
if (vsrandom.randrange(0,4)==0):
if (un):
currentsystem = VS.getSystemFile()
numadj=VS.GetNumAdjacentSystems(currentsystem)
if (numadj):
cursys=VS.GetAdjacentSystem(currentsystem,vsrandom.randrange(0,numadj))
else:
cursys = 'enigma_sector/heavens_gate'
print "TJ: jumping to "+cursys
un.JumpTo(cursys)
else:
print "TJ: jumping to [ERROR: you are null]"
side = vsrandom.randrange(0,2)
faction="confed"
ai = vsrandom.randrange(0,6)
if (0 and ai==0):
ai = "printhello.py"
else:
ai = "default"
if (side==0):
faction=faction_ships.get_enemy_of("confed")
else:
faction=faction_ships.get_friend_of("confed")
launched = launch.launch_wave_around_unit ("Shadow",faction,faction_ships.getRandomFighter(faction),ai,vsrandom.randrange(1,10),100.0,2000.0,VS.getPlayer(),'')
if (vsrandom.randrange(0,10)==0):
launch.launch_wave_around_unit ("ShadowCap",faction,faction_ships.getRandomCapitol(faction),ai,1,2000.0,4000.0,VS.getPlayer(),'')
def Execute (self):
un=VS.getUnit(0);
i=0
while (un):
i+=1
un= VS.getUnit(i)
time = VS.GetGameTime()
if (time-self.lasttime>self.waittime):
self.launch_new_wave()
self.waittime=vsrandom.randrange(4.0,20.0)
self.lasttime=time
def initbriefing(self):
print "ending briefing"
def loopbriefing(self):
print "loop briefing"
Briefing.terminate();
def endbriefing(self):
print "ending briefing"