Subversion-Projekte sthq.gbs

Revision

Revision 279 | Revision 465 | Zur aktuellen Revision | Blame | Vergleich mit vorheriger | Letzte Änderung | Log anzeigen | RSS feed

//  EF2 Level Script File
//
//  Level:              map10.bsp
//  Script By:          DrBob & Argyle & Sam "Bicko" Bickley
//  Geometry By:        Argyle & TickNSwisted & Dr.Bob & Sam "Bicko" Bickley
//  Created on:         02/04/04
//  Last Edited on:     05/07/04
//  Last Edited By:     TickNSwisted

//**************************************************************************//  ~SETUP~
//**************************************************************************
//INCLUDES
        #include "maps/global_scripts/global_common.scr"
        #include "maps/global_scripts/global_playerLoadout.scr"
//FUNCTION DECLARATIONS
        //MAP FUNCTIONS
                void door1_control();
                void open_door1();
                void close_door1();
                void elevator1_down();
                void elevator1_up();
                void modulate_done();
        //INHERENT FUNCTIONS
                void main();
                void setupWorld();
        //CINEMATIC FUNCTIONS
                void cin_cells();
                void cin_cells_skip();
//VARIABLE DECLARATIONS
        //MAP VARIABLES
                //0 = Down
                //1 = Floating
                //2 = Up
                float elevator1_pos = 2;
                //0 = Open
                //1 = Moving
                //2 = Closed
                float door1_pos = 2;
        //INHERENT VARIABLES
        //CINEMATIC VARIABLES
//**************************************************************************//  ~FUNCTIONS~
//**************************************************************************//MAP FUNCTIONS
void door1_control()
{
        if( door1_pos == 0 ) {
                //The door appears to be open, so close it
                close_door1();
        }
        if( door1_pos == 2 ) {
                //The door appears to be closed, so open it
                open_door1();

                wait( 5 );

                //And close it again
                close_door1();
        }

        thread globalCommon_OnUse( $door1_lower, "door1_control" );
}


void open_door1()
{
        door1_pos = 1;

        $door1_right.movesouth( 100 );
        $door1_left.movenorth( 100 );
        wait( 0.5 );
        $door1_lower.movedown( 100 );
        $door1_upper.moveup( 100 );

        waitFor( $door1_upper );

        door1_pos = 0;
}


void close_door1()
{
        door1_pos = 1;

        $door1_upper.movedown( 100 );
        $door1_lower.moveup( 100 );
        wait( 0.5 );
        $door1_left.movesouth( 100 );
        $door1_right.movenorth( 100 );

        waitFor( $door1_right );

        door1_pos = 2;
}


void elevator1_down()
{
        if( elevator1_pos == 2 )
        {
                elevator1_pos = 1;

                $elevator1.playsound( "sound/environment/machine/lift4.wav" );

                $elevator1.time( 4 );
                $elevator1.movedown( 300 );
                wait( 4 );

                $elevator1.playsound( "sound/environment/machine/lift4stop.wav" );

                wait( 4 );

                elevator1_pos = 0;
        }
}


void elevator1_up()
{
        if( elevator1_pos == 0 )
        {
                elevator1_pos = 1;

                $elevator1.playsound( "sound/environment/machine/lift4.wav" );

                $elevator1.time( 4 );
                $elevator1.moveup( 300 );
                wait( 4 );

                $elevator1.playsound( "sound/environment/machine/lift4stop.wav" );
                wait( 4 );

                elevator1_pos = 2;
        }
}


void modulate_done()
{
        centerprint("Modulation Complete!");
}

//**************************************************************************
//INHERENT FUNCTIONS
//**************************************************************************
void main()
{
        soundtrack( "music/m10l1-romulan_installation.mus" );

        $player.give( "models/weapons/worldmodel-phaser-STX.tik" );
        $player.give( "models/weapons/worldmodel-compressionrifle.tik" );
        $player.give( "models/weapons/worldmodel-rom-disruptor.tik" );
        
        $player.ammo( "Phaser", 200 );
        $player.ammo( "Disruptor", 200 );
        $player.ammo( "Fed", 200 );

        $player.armor( "BasicArmor", 100 );

        $player.use( "romulanDisruptor" );

        $fan1.bind($fan1_origin);
        $fan1_origin.rotateZ(100);

        //-----------cut-out---------------------
        //$sky.rendereffects( "+skyorigin" );
        //$world.weather( "rain", 400 );
        //$world.entity_fade_dist( 3072 );
        //stuffcmd ( "r_light_emphasize 100\n" );
        //------------------------TickNSwisted---

        //Setup the world
        setupWorld();

        //Wait for the player
        waitForPlayer();

        //Show the mission objective
        $player.setobjectiveshow( "findstammheim", 1 );
}

void setupWorld()
{
        //Setup onUse threads...
        thread globalCommon_OnUse( $door1_lower, "door1_control" );

        //Change the player's model
        $player.model( "char/hazardteam_jurot.tik" );

        //Load the mission objectives
        $player.loadobjectives( "GBS10" );

        //Give the player her weapons
        globalLoadout_GiveWeapon( WEAPON_TRICORDER_STX );
        globalLoadout_GiveWeapon( WEAPON_ROMULAN_DISRUPTOR );
        $player.give( "models/weapons/worldmodel-rom-disruptor-rifle.tik" );

        //Make Stammheim so that he isn't allowed to be killed by you
        $stammheim.not_allowed_to_kill();

        //Remove Stammheim's toy
        $stammheim.removeactorweapon( "CompressionRifle" );

        //Spawn cameras
        spawn( "Camera", "targetname", "cam1" );

        //Remove NPCs AI
        $stammheim.ai_off();

        //Set NPCs sides
        $stammheim.actortype( "teammate" );
        $player.addrosterteammate1( $stammheim );

        //Make it so that Romulans wont attack Stammheim, only you
        $stammheim.flags( "+notarget" );

        //Make Stammheim a mission target
        $stammheim.missionobjective( 1 );

        //Setup NPC animations
        $stammheim.anim( "idle_breathing" );

        //Setup NPC facial animation
        $stammheim.morph( "exp_eyes_heavy" );
        $stammheim.morph( "exp_Nervous" );
        $stammheim.morph( "exp_Fear" );
        $stammheim.morph( "exp_Sad" );

        //Make NPCs non-pushable
}

//CINEMATIC FUNCTIONS
void cin_cells()
{
        skipthread( "cin_cells_skip" );

        cam_fadeout( 0.1, 0, 0, 0, 1, 0 );

        //Make Illia holster any weapon she might have acquired
        $player.holster();

        //Bring up a fake player model
        fakeplayer();

        //Make the fakeplayer use the same weapon as you
        globalCommon_AiActorUseWeapon( $fakeplayer, "current" );

        //Initialize the fake player
        //$fakeplayer.strictlyfollowpath( 1 );

        $cam1.follow( $cin_cells_cam1_pos1, $fakeplayer );
        $cam1.cut();

        //Make it a cinematic
        cinematic();
        letterbox( 0.5 );

        wait( 0.5 );

        cam_fadein( 1, 0, 0, 0, 1, 0 );

        cuecamera( $cam1 );

        wait( 0.1 );

        //Make Illia walk up to the doors
        $fakeplayer.walkto( "$cin_cells_illia_pos_enter" );
        waitFor( $fakeplayer );

        //Open the door
        thread open_door1();

        //Make the camera pan down to look through the door
        $cam1.follow( $cin_cells_cam1_pos2 );

        //Make Illia hesitate slightly
        wait( 0.5 );

        //Make Illia walk to inside the cell room
        //$fakeplayer.walkto( "$cin_cells_illia_pos_inside", "run", 0, -1 );
        $fakeplayer.walkto( "$cin_cells_illia_pos_inside" );
        waitFor( $fakeplayer );
        $fakeplayer.headwatch( $stammheim );
        $fakeplayer.walkto( "$cin_cells_illia_pos_nearcell" );
        wait( 1 );

        //Close the door again, just to be tidy
        close_door1();

        //Fade the camera out
        cam_fadeout( 1, 0, 0, 0, 1, 0 );

        wait( 2 );

        //Setup the camera inside the cell room
        $cam1.follow( $cin_cells_cam1_pos3 );
        $cam1.cut();

        cam_fadein( 1, 0, 0, 0, 1, 0 );

        wait( 1 );

        //POSSIBLE ANIMATIONS FOR STAMMHEIM:
        //      cheer                           :                       Arms above head
        //      conv-embarrassment              :                       Head in hands
        //      conv-gesture1                   :                       Looking around, scared
        //      conv-laugh1                     :                       Pain
        //      conv-look                       :                       Looking around, scared
        //      conv-shakehead                  :                       Pain in head, voices            //      idle_breathing                  :                       Hard to breathe]

        //Illia: Stammheim.
        $fakeplayer.morph( "exp_Relief" );
        $fakeplayer.playdialog( "localization/sound/dialog/map10/Illia/stammheim.mp3", 1, 10000, 0 );
        waitForDialog( $fakeplayer );
        $fakeplayer.unmorph( "exp_Relief" );

        wait( 0.5 );

        //Turn Stammheim towards the player
        $stammheim.turntowardsplayer();
        $stammheim.headwatch( $fakeplayer );

        wait( 0.5 );

        //Stammheim: Who...who are you?
        $stammheim.playdialog( "localization/sound/dialog/map10/Stammheim/whoareyou.mp3", 2, 10000, 0 );
        waitForDialog( $stammheim );

        //Start the camera panning up on Illia
        $cam1.follow( $cin_cells_cam1_pos4 );
        $cam1.cut();

        //Illia: You know me Stammheim.
        $fakeplayer.anim( "conv-gesture1" );
        $fakeplayer.morph( "exp_Skeptical" );
        $fakeplayer.playdialog( "localization/sound/dialog/map10/Illia/youknowme.mp3", 1, 10000, 0 );
        waitForDialog( $fakeplayer );
        $fakeplayer.anim( "idle" );

        //Illia: The mission on Cardassia Prime?
        $fakeplayer.anim( "conv_shrug" );
        $fakeplayer.playdialog( "localization/sound/dialog/map10/Illia/cardassiaprime.mp3", 1, 10000, 0 );
        waitForDialog( $fakeplayer );
        $fakeplayer.anim( "idle" );

        wait( 0.5 );

        //Illia: Doesn't that ring a bell?
        $fakeplayer.unmorph( "exp_Skeptical" );
        $fakeplayer.morph( "exp_Confused" );
        $fakeplayer.playdialog( "localization/sound/dialog/map10/Illia/ringabell.mp3", 1, 10000, 0 );
        waitForDialog( $fakeplayer );

        wait( 0.5 );

        //Pointing at Stammheim through the forcefield
        $cam1.follow( $cin_cells_cam1_pos5 );
        $cam1.cut();

        //Stammheim: No more questions...please...please...
        $stammheim.anim( "conv-shakehead" );
        $stammheim.playdialog( "localization/sound/dialog/map10/Stammheim/nomorequestions.mp3", 2, 10000, 0 );
        waitForDialog( $stammheim );

        wait( 1.5 );

        //Stammheim: My head...
        $stammheim.anim( "cheer" );
        $stammheim.morph( "exp_Pain" );
        $stammheim.playdialog( "localization/sound/dialog/map10/Stammheim/myhead.mp3", 2, 10000, 0 );
        waitForAnimation( $stammheim, "cheer" );
        $stammheim.anim( "idle" );
        waitForDialog( $stammheim );

        //Stammheim: The Romulan said the pain would stop...but it hasn't.
        $stammheim.anim( "conv-shakehead" );
        $stammheim.playdialog( "localization/sound/dialog/map10/Stammheim/painstop.mp3", 2, 10000, 0 );
        waitForDialog( $stammheim );

        wait( 0.5 );

        //Looking at Illia
        $cam1.follow( $cin_cells_cam1_pos6, $fakeplayer );
        $cam1.cut();

        //Illia: The Romulans didn't exactly handle him with kid gloves, it seems.
        $fakeplayer.playdialog( "localization/sound/dialog/map10/Illia/romulans.mp3", 1, 10000, 0 );
        waitForDialog( $fakeplayer );
        $fakeplayer.unmorph( "exp_Confused" );
        $fakeplayer.morph( "exp_Serious" );

        wait( 0.5 );

        //Make Illia walk over to the console & deactivate the forcefield
        $fakeplayer.walkto( "$cin_cells_illia_pos_console" );
        waitFor( $fakeplayer );

        wait( 0.1 );

        //Make Illia use the console and play a sound
        //$fakeplayer.turntowardsentity( $console );
        $fakeplayer.headwatch( $console );
        $fakeplayer.turntoangle( 0 );
        waitFor( $fakeplayer );
        $fakeplayer.anim( "ent-transporter-rear-gesture" );
        $console.playsound( "sound/ships/romulan/rom_beep_yes.wav", 0, 1 );

        $cam1.lookat( $fakeplayer );

        waitForAnimation( $fakeplayer, "ent-transporter-rear-gesture" );
        $fakeplayer.anim( "idle" );

        $cam1.follow( $cin_cells_cam1_pos7, $stammheim );
        $cam1.cut();

        //Stop the forcefield sound, and play the forcefield_down sound
        $stammheim_forcefield.stoploopsound();
        $stammheim_forcefield.playsound( "sound/ships/enterprise/ent_forcefield_down.wav", 0, 1 );
        $stammheim_forcefield.remove();

        wait( 0.1 );

        //Illia: Come on Alexander. I'll get you out of here.
        $fakeplayer.playdialog( "localization/sound/dialog/map10/Illia/comeonalexander.mp3", 1, 10000, 0 );
        waitForDialog( $fakeplayer );

        //Illia: Try to follow me, ok?
        $fakeplayer.playdialog( "localization/sound/dialog/map10/Illia/follow.mp3", 1, 10000, 0 );
        waitForDialog( $fakeplayer );

        wait( 1 );

        //Illia: Do you understand?
        $fakeplayer.playdialog( "localization/sound/dialog/map10/Illia/understood.mp3", 1, 10000, 0 );
        $stammheim.anim( "idle_breathing" );
        waitForDialog( $fakeplayer );

        wait( 1.5 );

        //Stammheim: Follow...Yes...
        $stammheim.anim( "conv-yes" );

        $cam1.follow( $cin_cells_cam1_posstammheim, $stammheim );
        //$cam1.cut();

        $stammheim.playdialog( "localization/sound/dialog/map10/Stammheim/follow.mp3", 2, 10000, 0 );
        waitForDialog( $stammheim );
        $stammheim.anim( "idle_breathing" );

        wait( 0.5 );

        //Stammheim: Follow...
        $stammheim.playdialog( "localization/sound/dialog/map10/Stammheim/follow2.mp3", 2, 10000, 0 );
        wait( 1 );

        cin_cells_skip();
}

void cin_cells_skip()
{
        skipthread( "Null" );
        killthread( "cin_cells" );

        cam_fadeout( 1, 0, 0, 0, 1, 0 );

        wait( 2 );

        //Remove all evidence of before the cin
        $stammheim_forcefield.remove();

        $fakeplayer.warpto( "$cin_cells_illia_pos_inside" );
        removefakeplayer();

        //End the cinematic
        noncinematic();
        clearletterbox( 0.1 );
        cueplayer();

        wait( 0.1 );

        cam_fadein( 0.1, 0, 0, 0, 1, 0 );

        //Now that the cinematic is over, make Stammheim follow you
        $stammheim.ai_on();

        //Make the objective complete
        $player.setobjectivecomplete( "findstammheim", 1 );
        $stammheim.missionobjective( 0 );

        //Show the new objective
        $player.setobjectiveshow( "escapewithshuttle", 1 );
}