home *** CD-ROM | disk | FTP | other *** search
-
- function DrillerCinematic()
-
- local CinemaInvader = G.CreateAt( "Driller", Vector3( 125, 0, 125 ) );
- CinemaInvader.TurnOffAI()
-
- Camera.CinemaMove( Vector3(150,15,150), Vector3(126,10,130), 2 );
- Camera.CinemaLookAt( CinemaInvader );
-
- -- Driller appears:
- G.SayPhraseScript( "Traitor! \nWe'll get you" , CinemaInvader );
-
- TraitorTalk( "Drillers! They'll dig under our defenses, and attack the tower directly! " );
- GameWait(4)
-
- G.SayPhraseScript( "Let's Get them!" , CinemaInvader );
- G.CreateAt( "Driller", Vector3( 130, 0, 125 ) );
- G.CreateAt( "Driller", Vector3( 125, 0, 130 ) );
- GameWait(3)
-
- CinemaInvader.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/Campaign4.xml" );
- MainLevel.CreateLevel();
-
- G.SetInvSpeed( 20 );
- HUD.EnterLevel();
- G.SetGameState( InLevel );
- G.SetPoints(0);
- G.SetMaxKills(0)
-
- G.SetLightTime( 5 );
- G.PostP( "None" );
-
- -- gameStartTime = 10000000;
-
- HUD.Message( "VictoryCondition" , "SetText", "Defy the Driller Invasion!" );
- HUD.Message( "LossCondition" , "SetText", "If the Tower falls you lose." );
-
- TraitorCanBeHidden = true
- --TraitorTalk(" ");
- end
-
- LevelStartup()
-
- function LevelIntro()
-
- local tempPos = Tower.GetPosition()
- Camera.LookAtPosition( tempPos )
-
-
- gameStartTime = GameTime;
-
- ColorTextPopup( "Level 4: Barricade", Color(1,1,1,1) )
-
- G.DisableTrapAll()
-
- G.EnableTrap("wall");
- G.EnableTrap("bomb");
- G.EnableTrap("axe");
- G.EnableTrap("hammer");
-
-
- DisableTraitor()
- GameWait(1.5)
-
- TraitorTalk("Look what we have here! Lasers! Now we're talkin'.");
- GameWait(6)
- TraitorTalk("These lasers are good for hitting invaders at a distance, even from behind walls.");
- GameWait(8)
- TraitorTalk("Here are the blueprints...");
- GameWait(2)
- TrapTextPopup("Laser Turret")
- G.EnableTrap("laser");
- GameWait(3)
- TraitorTalk("I think I see some invaders coming... Have fun!");
- G.EarnPoints( 100 );
- GameWait(6)
- end
-
- function LevelSequence()
-
- -- 1st Have a tower and some walls and let the Basic guys attack.
- DisableTraitor()
- Traitor.SetGuiPosition( "TraitorWindow" , Vector3(0.6, -0.5, 1) );
-
- -- Set the spawn points
-
- SpawnPoints = {}
- SpawnPoints.NumPoints = 1
- SpawnPoints[0] = Vector3(500, 0, 500)
-
- -- Start Spawning the guys
- BasicWave = createSpawnStruct()
-
- BasicWave.Prob.Basic = 3.0;
- BasicWave.Prob.Miner = 1.0;
- BasicWave.Prob.Spiker = 1.0;
- BasicWave.Prob.Stacker = 1.0;
-
- BasicWave.SpawnSpeed = 2.0;
- BasicWave.MaxSpawn = 15;
- BasicWave.TotalSpawn = 25;
- BasicWave.GroupPercent = 0.25;
- BasicWave.GroupSize = 3;
- BasicWave.WhereToSpawn = CircleAroundTower--HardCodedSpawnPoints
-
-
- DrillerWave = createSpawnStruct()
-
- DrillerWave.Prob.Driller = 1.0;
- DrillerWave.SpawnSpeed = 3;
- DrillerWave.MaxSpawn = 15;
- DrillerWave.TotalSpawn = 22;
- DrillerWave.GroupPercent = 1.0;
- DrillerWave.GroupSize = 3;
- DrillerWave.WhereToSpawn = SmallCircleAroundTower--HardCodedSpawnPoints
-
- AddWave( "BasicAttack", BasicWave )
- G.SetMaxKills(25)
- --StopWave( "BasicAttack" )
-
- GameWait(5)
- WaitForClearEnemies()
- GameWait(2)
-
- TraitorTalk("No sweat! With our laser defended walls, we're unstoppable.")
- GameWait(9)
- TraitorTalk("I think we can just kick back and relax...");
- GameWait(6);
- TraitorTalk("Hey, what's that?");
- GameWait(3)
-
- StartCinematic()
- DrillerCinematic()
- EndCinematic()
-
-
- AddWave("DrillerWave", DrillerWave);
- G.SetMaxKills(50)
-
- InvaderTextPopup( "Driller" );
- GameWait(3)
-
- TraitorTalk("Ack, drillers! They have the ability to tunnel underneath walls and other obstacles. Don't let 'em near the tower!")
- WaitForClearEnemies( )
-
- TraitorTalk("Whoa, I didn't count on them showing up. I guess this isn't a perfect defense either...")
- GameWait(7)
- TraitorTalk("Beef up your defenses and do it fast, more are on their way!")
- --G.AddCredits(50)
- GameWaitOrMoney(30)
-
- BasicWave.SpawnSpeed = 4.0;
- BasicWave.TotalSpawn = 50
- BasicWave.MaxSpawn = 20
- BasicWave.Prob.Driller = 1.5
- BasicWave.Prob.Bomber = .5
- G.SetMaxKills(100)
-
- TraitorTalk("Here they come. Defend the base!");
- GameWait(4);
-
- InvadersKilledWait(100)
-
- TraitorTalk("Keep it up! I only see one wave left!");
- G.SetMaxKills(150)
- GameWait(4)
- TraitorTalk("Fix up the base, fast!")
- GameWaitOrMoney(20)
-
- BasicWave.TotalSpawn = 50
-
- InvadersKilledWait(140)
-
- TraitorTalk("Keep up the defense, there is not much left!");
- InvadersKilledWait(150) -- WaitForClearEnemies( )
-
- G.SetGameState( Victory );
-
- TraitorTalk("Nicely done. We make an excellent team!")
- GameWait(4)
-
- end
-
-
- levelRoutine = coroutine.create(LevelIntro);
-
- GMain["LevelUpdate"] = LevelUpdate;
-