home *** CD-ROM | disk | FTP | other *** search
- -- Demonstrate the Fan/Poison combo
- function CorneredCinematic()
-
-
- local CinemaInvader = G.CreateAt( "Spiker", Vector3( 124, 0, 130 ) );
- local CinemaInvader2 = G.CreateAt( "Basic", Vector3( 130, 0, 130 ) );
- local CinemaInvader3 = G.CreateAt( "Basic", Vector3( 124, 0, 124 ) );
- local CinemaInvader4 = G.CreateAt( "Miner", Vector3( 130, 0, 124 ) );
-
- CinemaInvader.TurnOffAI()
- CinemaInvader2.TurnOffAI()
- CinemaInvader3.TurnOffAI()
- CinemaInvader4.TurnOffAI()
-
- CinemaInvader.SetDirection( Vector3( 1,0,-1) )
- CinemaInvader2.SetDirection( Vector3(-1,0,-1) )
- CinemaInvader3.SetDirection( Vector3( 1,0, 1) )
- CinemaInvader4.SetDirection( Vector3(-1,0, 1) )
-
- TrapPlace( "wall", Vector3(140,0,130), Vector3(0,0,-1))
- TrapPlace( "wall", Vector3(140,0,126), Vector3(0,0,-1))
- TrapPlace( "wall", Vector3(140,0,122), Vector3(0,0,-1))
- TrapPlace( "wall", Vector3(140,0,134), Vector3(0,0,-1))
- TrapPlace( "wall", Vector3(140,0,138), Vector3(0,0,-1))
- TrapPlace( "wall", Vector3(140,0,118), Vector3(0,0,-1))
- TrapPlace( "wall", Vector3(140,0,142), Vector3(0,0,-1))
- TrapPlace( "wall", Vector3(136,0,118), Vector3(0,0,-1))
- TrapPlace( "wall", Vector3(136,0,142), Vector3(0,0,-1))
- TrapPlace( "wall", Vector3(132,0,118), Vector3(0,0,-1))
- TrapPlace( "wall", Vector3(132,0,142), Vector3(0,0,-1))
- TrapPlace( "wall", Vector3(132,0,118), Vector3(0,0,-1))
- TrapPlace( "wall", Vector3(132,0,142), Vector3(0,0,-1))
- TrapPlace( "wall", Vector3(128,0,118), Vector3(0,0,-1))
- TrapPlace( "wall", Vector3(128,0,142), Vector3(0,0,-1))
-
-
- -- Look at the traps:
- TrapPlace( "poison", Vector3(170,0,134), Vector3(0,0,-1));
-
- TraitorTalk( "Hey! I've been playing with the new poison trap." );
- Camera.CinemaMove( Vector3(170,15,170), Vector3(170,0,134), 4 );
- GameWait(4)
-
- TraitorTalk( "It creates poison mist clouds that makes invaders sick." );
- GameWait(4)
-
- TraitorTalk( "Oh look a group of invaders!" );
- Camera.CinemaMove( Vector3(170,35,170), Vector3(120,0,120), 0.5 );
- GameWait(2)
-
- G.SayPhraseScript( "We need\n more troops!" , CinemaInvader );
- GameWait(1)
-
- -- G.EndCurrentPhrase( CinemaInvader )
- G.SayPhraseScript( "Quit Stalling!" , CinemaInvader2 );
- GameWait(1)
-
- TraitorTalk( "Watch this:" );
- GameWait(1)
-
- TrapPlace( "fan", Vector3(178,0,130), Vector3(-1,0,0));
- TrapPlace( "fan", Vector3(178,0,126), Vector3(-1,0,0));
- Camera.CinemaMove( Vector3(170,35,170), Vector3(174,0,130), 0.5 );
- GameWait(0.5)
-
- G.CreateAt( "MobilePoisonMist", Vector3( 174, 0, 130 ) );
- G.CreateAt( "MobilePoisonMist", Vector3( 174, 0, 126 ) );
- -- Camera.CinemaLookAt( CinemaPoison );
- Camera.CinemaMove( Vector3(170,35,170), Vector3(120,0,120), 3 );
-
- GameWait(3)
- G.SayPhraseScript( "I feel sick!" , CinemaInvader3 );
- GameWait(1)
- G.SayPhraseScript( "My tummy hurts!" , CinemaInvader2 );
- GameWait(1)
- G.SayPhraseScript( "I hate this!" , CinemaInvader4 );
- GameWait(3)
-
- TraitorTalk( "The Fans blow the Poison Mist, and you can even grab it!" );
- GameWait(7)
-
- G.KillAllInvaders();
-
- -- CinemaInvader.TurnOnAI()
- -- CinemaInvader2.TurnOnAI()
- -- CinemaInvader3.TurnOnAI()
- -- CinemaInvader4.TurnOnAI()
-
- end
-
- --Common Level Start Code
- function LevelStartup()
-
- G.Create( "MenuData/HudCog.xml" );
- G.Create( "Data/GameCamera.xml" );
- G.Create( "Data/CursorCog.xml" );
-
- MainLevel = G.Create( "Data/Levels/Campaign6.xml" );
- MainLevel.CreateLevel();
-
- G.SetInvSpeed( 20 );
- HUD.EnterLevel();
- G.SetGameState( InLevel );
- G.SetPoints(0)
-
- G.SetLightTime( 4 );
- G.PostP( "None" );
- --TraitorTalk(" ");
-
- -- gameStartTime = 10000000;
-
- HUD.Message( "VictoryCondition" , "SetText", "Control the Invasion while Cornered!" );
- HUD.Message( "LossCondition" , "SetText", "If the Tower falls you lose." );
-
- TraitorCanBeHidden = true
- end
-
- LevelStartup()
-
- function LevelIntro()
-
- local tempPos = Tower.GetPosition()
- Camera.LookAtPosition( tempPos )
-
- gameStartTime = GameTime;
-
- ColorTextPopup( "Level 6: Poison Fields", Color(1,1,1,1) )
-
- G.DisableTrapAll()
-
- G.EnableTrap("wall");
- G.EnableTrap("bomb");
-
- G.EnableTrap("axe");
- G.EnableTrap("hammer");
- --G.EnableTrap("spring");
- G.EnableTrap("fan");
- --G.EnableTrap("poison");
- --G.EnableTrap("laser");
-
- DisableTraitor()
- GameWait(1.5)
-
-
- StartCinematic()
- CorneredCinematic()
- EndCinematic()
-
- end
-
- SpawnPoints = {}
-
- function LevelSequence()
-
- -- 1st Have a tower and some walls and let the Basic guys attack.
- Traitor.SetGuiPosition( "TraitorWindow" , Vector3(0.6, -0.5, 1) );
-
- -- Set the spawn points
-
- SpawnPoints.NumPoints = 10
- SpawnPoints[1] = Vector3(240, 0, 150) -- zone 2
- SpawnPoints[2] = Vector3(225, 0, 130)
- SpawnPoints[3] = Vector3(250, 0, 121)
- SpawnPoints[4] = Vector3(320, 0, 153)
- SpawnPoints[5] = Vector3(260, 0, 110)
- SpawnPoints[6] = Vector3(280, 0, 194)
-
- SpawnPoints[7] = Vector3(224, 0, 24) -- zone 1
- SpawnPoints[8] = Vector3(231, 0, 31)
- SpawnPoints[9] = Vector3(204, 0, 54)
- SpawnPoints[10] = Vector3(193, 0, 49)
-
- SpawnPoints[7] = Vector3(324, 0, 184) -- zone 3
- SpawnPoints[8] = Vector3(331, 0, 181)
- SpawnPoints[9] = Vector3(354, 0, 174)
- SpawnPoints[10] = Vector3(349, 0, 199)
-
-
- -- Start Spawning the guys
- BasicWave = createSpawnStruct()
-
- BasicWave.Prob.Basic = 2.0;
- BasicWave.Prob.Miner = 1.0;
- BasicWave.Prob.Driller = 1.0;
- BasicWave.Prob.Spiker = 1.0;
-
- BasicWave.SpawnSpeed = 2.0;
- BasicWave.MaxSpawn = 15;
- BasicWave.TotalSpawn = 21;
- BasicWave.GroupPercent = 0.15;
- BasicWave.GroupSize = 1;
- BasicWave.WhereToSpawn = HardCodedSpawnPoints
-
-
- GameWait(4)
- --TraitorTalk("This terrain is unbearable!")
- --GameWait(6)
- --TraitorTalk("Do you see the rocky ground on top of all those hills?")
- --GameWait(4)
- --TraitorTalk("That type of terrain is unbuildable. You can only build traps on grass and dirt.")
- --GameWait(6)
- --TraitorTalk("The only suitable spot is this cozy little nook nestled up against the hills.")
- --GameWait(6)
- --TraitorTalk("Unfortunately that means we're trapped.")
- --GameWait(3)
- --TraitorTalk("But not to worry, I have some things that will help.")
- --GameWait(3)
-
-
- TraitorTalk("Oh, I almost forgot. Here are the blueprints...")
- GameWait(3)
-
- TrapTextPopup("Poison Mist")
- G.EnableTrap("poison");
- GameWait(3)
-
- -- TraitorTalk("This will generate poison clouds that roam around and kill invaders over time.")
- -- GameWait(6)
- --TraitorTalk("If they're placed near fans, the poison clouds will be blown around.")
- --GameWait(7)
- -- TraitorTalk("You can even pick up the clouds with your hand!")
- -- GameWait(5)
-
- G.EarnPoints( 300 )
-
- TraitorTalk("These should allow us to survive long enough.")
- GameWait(7)
- TraitorTalk("Why don't you place down some additional fortifications before the Invaders get here?");
- GameWaitOrMoney(30)
-
- TraitorTalk("Whoa, here they come!");
- GameWait(3)
- AddWave( "BasicAttack", BasicWave )
- G.SetMaxKills(25);
- GameWait(3)
-
- InvadersKilledWait(25)
- -- TraitorTalk("All these Poison Traps give me an idea!")
- -- TraitorTalk("If you can hold out, I think I can create a virus to take out ALL the invaders.")
- -- TraitorTalk("It worked! But I don't think it will last long.")
- -- TraitorTalk("The invaders a resilient bunch, I'm sure they'll develop a resistance!")
-
- TraitorTalk("Don't get too cozy, I see more of them coming!")
- GameWait(4)
- TraitorTalk("Beef up the base while you still can!!")
- GameWaitOrMoney(30)
-
- BasicWave.Prob.Kamikaze = 1.0;
- BasicWave.TotalSpawn = 50
- G.SetMaxKills(75)
-
- TraitorTalk("Here they come!!")
- GameWait(5)
-
- InvadersKilledWait(75)
-
- TraitorTalk("Ack! They're still coming! Is there no end to this?")
- GameWait(6)
- TraitorTalk("I'm sure this is the last wave. ... If it's not, we're in trouble...")
- GameWait(7)
-
- --BasicWave.MaxSpawn = 50
- BasicWave.TotalSpawn = 75
- G.SetMaxKills(150)
- AddWave( "BasicAttack", BasicWave )
-
- InvadersKilledWait(100)
- BasicWave.MaxSpawn = 50
- BasicWave.SpawnSpeed = 4.0;
- BasicWave.Prob.Spiker = 3.0;
- InvadersKilledWait(150)
-
- StopWave( "BasicAttack" )
-
- TraitorTalk("Whew, it ended! Looks like the base held.")
- GameWait(7)
-
- G.SetGameState( Victory );
-
- TraitorTalk("We should relocate before more of them arrive. Let's move out!")
- GameWait(6)
-
- -- G.SetGameState( Victory );
-
- end
-
-
-
- levelRoutine = coroutine.create(LevelIntro);
-
- GMain["LevelUpdate"] = LevelUpdate;
-