home *** CD-ROM | disk | FTP | other *** search
-
- function KamikazeCinematic()
- local tower = G.GetCogName("Tower");
- local towerPos = tower.GetPosition();
- Camera.CinemaLookAt( tower );
-
- -- Have them behind some walls
- TrapPlace( "wall", Vector3(116,0,136), Vector3(1,0,0));
- TrapPlace( "wall", Vector3(116,0,140), Vector3(1,0,0));
- TrapPlace( "wall", Vector3(120,0,140), Vector3(1,0,0));
- TrapPlace( "wall", Vector3(124,0,140), Vector3(1,0,0));
- TrapPlace( "wall", Vector3(128,0,140), Vector3(1,0,0));
- TrapPlace( "wall", Vector3(132,0,140), Vector3(1,0,0));
- TrapPlace( "wall", Vector3(136,0,140), Vector3(1,0,0));
- TrapPlace( "wall", Vector3(136,0,136), Vector3(1,0,0));
- TrapPlace( "wall", Vector3(136,0,132), Vector3(1,0,0));
- TrapPlace( "wall", Vector3(136,0,128), Vector3(1,0,0));
-
- -- Two invaders talking:
- local CinemaInvader = G.CreateAt( "Basic", Vector3( 122, 0, 134 ) );
- local CinemaInvader2 = G.CreateAt( "Basic", Vector3( 132, 0, 134 ) );
-
- CinemaInvader.TurnOffAI();
- CinemaInvader2.TurnOffAI();
-
- CinemaInvader.SetDirection( Vector3(1,0,0) )
- CinemaInvader2.SetDirection( Vector3(-1,0,0) )
-
-
- -- Show off level again
- TraitorTalk("Welcome Back!")
- Camera.CinemaMove( towerPos + Vector3(-40,65,-40), towerPos, 3 );
- GameWait(3)
-
- Camera.CinemaRotate( 3.14 * 2.0 / 12.0 )
-
- TraitorTalk("It may look like your base is in shambles, but I did this for a reason.")
- GameWait(6)
- TraitorTalk("If I know my brothers, they'll be pretty angry that we're still alive.");
- GameWait(6)
-
- camPos = Vector3(130,40,170)
- Camera.CinemaMove( camPos, Vector3(126,0,130), 4 );
- Camera.CinemaRotate(0)
- Camera.EndCinemaLookAt( );
- TraitorTalk( "Shh! I hear some invaders around here..." );
- GameWait( 5 );
-
- invPos = CinemaInvader.GetPosition()
- invPos[2] = invPos[2] - 8
- invPos2 = CinemaInvader2.GetPosition()
- invPos2[2] = invPos2[2] - 8
-
- --CinemaInvader.SetDirection( )
- G.SayPhraseScript( "Great, \n more walls." , CinemaInvader2 );
- GameWait( 2 );
- G.EndCurrentPhrase( CinemaInvader2 )
-
- Camera.CinemaMove( camPos, invPos, 0.5 );
- CinemaInvader.Hop( 20 )
- G.SayPhraseScript( "Hey did you\n hear?" , CinemaInvader );
- GameWait( 2 );
- G.EndCurrentPhrase( CinemaInvader )
-
- Camera.CinemaMove( camPos, invPos2, 0.5 );
- CinemaInvader2.Hop( 20 )
- G.SayPhraseScript( "Hear what?" , CinemaInvader2 );
- GameWait( 2 );
- G.EndCurrentPhrase( CinemaInvader2 )
-
- Camera.CinemaMove( camPos, invPos, 0.5 );
- CinemaInvader.Hop( 20 )
- G.SayPhraseScript( "They're sending \n in demolition \n experts." , CinemaInvader );
- GameWait( 2 );
- G.EndCurrentPhrase( CinemaInvader )
-
- Camera.CinemaMove( camPos, invPos2, 0.5 );
-
- G.SayPhraseScript( "Experts?!? \n Oh no ..." , CinemaInvader2 );
- GameWait( 2 );
-
- local CinemaInvader3 = G.CreateAt( "Kamikaze", Vector3( 90, 0, 110 ) );
- G.SayPhraseScript( "AHHHH!!" , CinemaInvader );
- G.SayPhraseScript( "AHHHH!!" , CinemaInvader2 );
- G.SayPhraseScript( "BANZAAAIII!" , CinemaInvader3 );
-
- GameWait( 1 );
- local CinemaInvader4 = G.CreateAt( "Kamikaze", Vector3( 90, 0, 110 ) );
-
- -- Kaboom!
- TraitorTalk( "Kamikazes! They're highly unstable and will blow on anything they hit!" );
- GameWait( 5 );
-
- G.KillAllInvaders();
- end
-
- function BomberCinematic()
-
- -- Bomber appears, depressed,
- camPos = Vector3(130,40,170)
- Camera.CinemaMove( camPos, Vector3(126,0,126), 4 );
- TraitorTalk( "A new invader's coming in!" );
-
- local CinemaInvader = G.CreateAt( "Bomber", Vector3( 125, 0, 130 ) );
- CinemaInvader.TurnOffAI();
- GameWait(4)
- G.SayPhraseScript( "Everyone \n avoids me..." , CinemaInvader );
-
- TraitorTalk("Bombers?! ARGH! Those invaders have huge explosions!")
- GameWait(3)
-
- G.SayPhraseScript( " *Sigh* \n Guess I'll \n Attack now." , CinemaInvader );
- GameWait(3)
-
- TraitorTalk("They eventually explode on their own, but they'll take out anything that's nearby.")
-
- G.SayPhraseScript( "Goodbye,\n Cruel World." , CinemaInvader );
- GameWait(2)
-
- CinemaInvader.ChangeStateScript( 5 );
- GameWait(5)
-
-
- 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/Campaign2.xml" );
- MainLevel.CreateLevel();
-
- G.SetInvSpeed( 20 );
- HUD.EnterLevel();
- G.SetGameState( InLevel );
- G.EarnPoints( 100 );
- G.SetMaxKills(0);
-
- G.SetLightTime( 5 );
- G.PostP( "None" );
-
- -- gameStartTime = 10000000;
-
- HUD.Message( "VictoryCondition" , "SetText", "Survive the Explosive Waves!" );
- HUD.Message( "LossCondition" , "SetText", "If the Tower falls you lose." );
-
- TraitorCanBeHidden = true
- --TraitorTalk(" ");
- end
-
- LevelStartup()
-
- function LevelIntro()
-
- local tempPos = Tower.GetPosition()
- Camera.LookAtPosition( tempPos )
-
- -- There is no intro for this level:
- gameStartTime = GameTime;
-
- ColorTextPopup( "Level 2: Krazy Kamikazes", Color(1,1,1,1) )
-
- G.DisableTrapAll()
-
- DisableTraitor()
- GameWait(1.5)
-
- StartCinematic()
- KamikazeCinematic()
- EndCinematic()
-
-
- G.EnableTrap("wall");
- G.EnableTrap("fan");
- G.EnableTrap("hammer");
- end
-
- function LevelSequence()
-
- -- 1st Have a tower and some walls and let the basic guys attack.
- Traitor.SetGuiPosition( "TraitorWindow" , Vector3(0.6, -0.5, 1) );
-
- -- Start Spawning the guys
- ExplosiveWave = createSpawnStruct()
-
- ExplosiveWave.Prob.Kamikaze = 1.0;
-
- ExplosiveWave.SpawnSpeed = 1;
- ExplosiveWave.MaxSpawn = 15;
- ExplosiveWave.TotalSpawn = 21; -- + 4 for cinematic
- ExplosiveWave.GroupPercent = 0.0;
- ExplosiveWave.GroupSize = 3;
- ExplosiveWave.WhereToSpawn = CircleAroundTower
-
- InvaderTextPopup( "Kamikaze" );
- AddWave( "StartAttack", ExplosiveWave );
- G.SetMaxKills(25);
-
- TraitorTalk("They'll blow up if they hit anything. Better throw them first!")
-
- InvadersKilledWait(22)
-
- TraitorTalk( "Just a few more Kamikazes!" )
- InvadersKilledWait( 25 )
-
- StopWave( "StartAttack" );
- GameWait(3)
- TraitorTalk( "Wow, we took a beating. We can't rely on hammers to destroy these guys.");
- GameWait(7)
- TraitorTalk("I know! Here are the blueprints for a Spring Trap!" )
-
- TrapTextPopup("Springs")
- G.EarnPoints( 50 )
- G.EnableTrap("spring");
- G.EarnPoints( 25 )
-
- GameWait(4)
- TraitorTalk( "They throw invaders high up into the air!" )
- GameWait(4)
- TraitorTalk( "Go ahead and place some down. You'll thank me later.");
- GameWaitOrMoney(25)
-
- ExplosiveWave.Prob.Basic = 0.4; -- Spawn some basics too
- ExplosiveWave.SpawnSpeed = 0.5;
- ExplosiveWave.TotalSpawn = 25;
-
- AddWave( "MainAttack", ExplosiveWave );
- G.SetMaxKills(50);
-
- TraitorTalk("Oh no, look out! More Kamikazes!")
- GameWait(6)
- TraitorTalk("There's some brave Basic invaders too!")
- InvadersKilledWait(45)
-
- TraitorTalk( "Almost There!" )
- InvadersKilledWait( 50 ) --WaitForClearEnemies( )
- StopWave( "MainAttack" );
- GameWait(3)
- TraitorTalk( "Wow, good job. But don't quit yet, I have a feeling it's not over." )
- GameWait(9)
-
- TraitorTalk( "Remember that you can use fans to blow the Invaders into the spring traps!" )
- GameWait(7)
- TraitorTalk("You better rebuild, I think I hear more coming.");
- G.EarnPoints( 50 )
- GameWaitOrMoney(25)
-
- -- Bomber Intro
-
- StartCinematic()
- BomberCinematic()
- EndCinematic()
-
- TraitorTalk( "Watch out! Those Bombers are too big to be blown around by fans!" )
-
- ExplosiveWave.Prob.Bomber = 3.0;
- ExplosiveWave.TotalSpawn = 29;
- ExplosiveWave.GroupPercent = 0.3;
- ExplosiveWave.WhereToSpawn = SmallCircleAroundTower
-
- InvaderTextPopup( "Bomber" );
-
- AddWave( "FinalAttack", ExplosiveWave );
- G.SetMaxKills(80);
-
- InvadersKilledWait(65)
-
- TraitorTalk( "Hold out a bit longer!" )
- InvadersKilledWait( 80 ) --WaitForClearEnemies( )
- StopWave( "FinalAttack" );
-
- TraitorTalk( "Hey, we're alive! Woohoo!" )
- GameWait(4)
-
- G.SetGameState( Victory );
-
- TraitorTalk( "I bet we'll be seeing more of those explosive invaders in the future." )
- GameWait(6)
-
-
- -- TraitorTalk( "I mean, I never had a doubt... ");
- -- GameWait(4)
- -- TraitorTalk( "Remember that you can still grab and throw invaders, but those traps sure do help!" )
- -- GameWait(6)
-
- -- G.SetGameState( Victory );
- end
-
- levelRoutine = coroutine.create(LevelIntro);
-
- GMain["LevelUpdate"] = LevelUpdate;
-