home *** CD-ROM | disk | FTP | other *** search
/ MacFormat 2003 June / macformat-130.iso / mac / Reviewed⁄Demos / Spearhead Demo / demota / pak1.pk3 / maps / obj / mp_druckkammern_tow.scr < prev   
Encoding:
Text File  |  2002-10-31  |  22.2 KB  |  974 lines

  1. // MP_Druckkammern_TOW
  2. // Note: For objective function calls TakeOver and SetCurrent the
  3. // teams are as such:
  4. // 0 = Axis
  5. // 1 = Allies
  6. // 2 = Neutral
  7.  
  8.  
  9. //----------------------------------------------------------
  10. // Main
  11. //----------------------------------------------------------
  12. main:
  13.     level.script="maps/obj/MP_Druckkammern_TOW.scr"
  14.     level.music="MP_Druckkammern_TOW"
  15.  
  16.     //Farplane Color and Distance ((Don't move or Weather.SCR will over-write.))
  17.     $world farplane 4000
  18.     //$world farplane_cull 2
  19.     //$world farplane_bias -1024
  20.  
  21.     setcvar "g_scoreboardpic" "mp_druckkammern_tow" 
  22.  
  23.     level.gametype = int( getcvar( g_gametype ) )
  24.  
  25.     //Exec our helper scripts
  26.     exec global/tow_dm.scr
  27.     exec global/dm_ai.scr    
  28.     exec global/friendly.scr
  29.     exec global/ambient.scr
  30.     exec global/weather.scr
  31.     exec global/door_locked.scr::lock
  32.  
  33.     //gametype 5 = Tug of War
  34.     if( level.gametype == 5 )
  35.     {
  36.         setcvar "g_obj_alliedtext1" "Protect the Transport"
  37.         setcvar "g_obj_alliedtext2" "Disengage U-Boat Clamps"
  38.         setcvar "g_obj_alliedtext3" "Open Pen Doors"
  39.         setcvar "g_obj_alliedtext4" "Steal U-Boat"
  40.         setcvar "g_obj_alliedtext5" "Detonate German Entrance"
  41.  
  42.         setcvar "g_obj_axistext1" "Protect Entrance"
  43.         setcvar "g_obj_axistext2" "Close Pen Doors"
  44.         setcvar "g_obj_axistext3" "Engage U-Boat Clamps"
  45.         setcvar "g_obj_axistext4" "Prevent U-Boat Theft"
  46.         setcvar "g_obj_axistext5" "Destroy Allied Transport"
  47.     }
  48.     else
  49.     {
  50.         //This will remove the bombs so that we can play in other modes...
  51.         $boat_bomb remove
  52.         $fuel_depot_bomb remove
  53.  
  54.         // set scoreboard messages
  55.         setcvar "g_obj_alliedtext1" "Druckkammern" 
  56.         setcvar "g_obj_alliedtext2" ""
  57.         setcvar "g_obj_alliedtext3" ""
  58.         setcvar "g_obj_axistext1" ""
  59.         setcvar "g_obj_axistext2" ""
  60.         setcvar "g_obj_axistext3" ""
  61.     }
  62.     
  63.     //////////////////////////
  64.     level waittill prespawn
  65.     //////////////////////////
  66.  
  67.  
  68.     //////////////////////////
  69.     level waittill spawn
  70.     //////////////////////////
  71.     
  72.     //Hide the bodies!
  73.     $bodies1 hide
  74.     $bodies2 hide
  75.     $bodies3 hide
  76.     $bodies4 hide
  77.     
  78.     //init the sub
  79.     thread init_sub
  80.     
  81.     //Globals
  82.     level.bClampsSwitchDown            = 0
  83.     level.bDoorsSwitchDown            = 0
  84.     level.clampsEngaged                = 1
  85.     level.bRoundStarted                = 0
  86.     level.bClampsMoving                = 0
  87.  
  88.     // set the parameters for this round based match
  89.     level.dmrespawning            = 1            // 1 or 0
  90.     level.dmroundlimit            = 15        // round time limit in minutes
  91.     level.clockside                = axis        // set to axis, allies, kills, or draw
  92.     level.numObjectives            = 5            // Number of objectives needed to win
  93.  
  94.     //////////////////////////
  95.     level waittill roundstart
  96.     //////////////////////////    
  97.  
  98.     //TOW match init the TOW stuff
  99.     if( level.gametype == 5 )
  100.     {            
  101.         //init the switch handles
  102.         thread init_objective_switch_handles
  103.  
  104.         //Init the spawner bombs
  105.         thread init_spawner_bombs
  106.  
  107.         //Init the sub clamps
  108.         thread init_sub_clamps
  109.  
  110.         //Setup the starting team objectives
  111.         thread set_objectives
  112.  
  113.         level.bRoundStarted = 1
  114.     }
  115.  
  116.     thread start_generator_sound
  117.  
  118. end
  119.  
  120.  
  121.  
  122. //----------------------------------------------------------
  123. //Sound for Generators 
  124. //----------------------------------------------------------
  125. start_generator_sound:
  126.  
  127.     $gen_sound_speaker loopsound power_generator
  128.  
  129. end
  130.  
  131. //----------------------------------------------------------
  132. //Destroy the allied spawner here
  133. //----------------------------------------------------------
  134. destroy_allied_spawner local.planter:
  135.  
  136.     //Make sure we are the allies    
  137.     iprintln "The Allied Transport has been destroyed!"
  138.  
  139.     //Take over the objective
  140.     $obj_allied_spawner TakeOver 0
  141.  
  142.     //Give the planter some points
  143.     if( local.planter != NULL && local.planter != NIL )
  144.     {
  145.         local.planter AddKills 5
  146.     }
  147.     
  148.     iprintln "The Allied Team can no longer respawn!"
  149.  
  150.     //See if someone won
  151.     thread Check_End_Match
  152.  
  153. end
  154.  
  155. //----------------------------------------------------------
  156. //Destroy the axis spawner here
  157. //----------------------------------------------------------
  158. destroy_axis_spawner local.planter:
  159.  
  160.     iprintln "The Axis Entrance has been destroyed!"
  161.  
  162.     $obj_axis_spawner TakeOver 1    
  163.  
  164.     //blow up stuff
  165.     $hose_explo_1 thread Do_Fuel_Tank_Explosion
  166.  
  167.     wait 2
  168.  
  169.     $fuel_explo_1 thread Do_Fuel_Tank_Explosion
  170.  
  171.     wait 1
  172.  
  173.     $fuel_explo_2 thread Do_Fuel_Tank_Explosion
  174.  
  175.     wait .5
  176.  
  177.     $fuel_explo_3 thread Do_Fuel_Tank_Explosion
  178.  
  179.     iprintln "The Axis Team can no longer respawn!"
  180.         
  181.     //Give the planter some points
  182.     if( local.planter != NULL && local.planter != NIL )
  183.     {
  184.         local.planter AddKills 5
  185.     }
  186.  
  187.     //See if someone won
  188.     thread Check_End_Match
  189.  
  190. end
  191.  
  192. //----------------------------------------------------------
  193. //Open/close the sub pen doors here
  194. //----------------------------------------------------------
  195. toggle_subpen_doors:
  196.  
  197.     if( level.bRoundStarted == 1 )
  198.     {
  199.         if( parm.other.dmteam == axis )
  200.         {
  201.             if( $obj_subpen_doors.ControlledBy != 0 && $obj_steal_sub.ControlledBy != 1 )
  202.             {    
  203.                 //Flip the switch
  204.                 thread sub_doors_switch
  205.  
  206.                 //Take over the objective
  207.                 $obj_subpen_doors TakeOver 0            
  208.                 
  209.                 //Close the pen doors
  210.                 $subpen_doors close $door_entity
  211.                 $subpen_doors playsound subpen_doors_close
  212.  
  213.                 //Give 2 points for taking objective
  214.                 parm.other AddKills 2
  215.                 
  216.                 iprintln "The Axis have closed the Pen Doors!"
  217.             }
  218.         }
  219.         else if( parm.other.dmteam == allies )
  220.         {
  221.             if( $obj_subpen_doors.ControlledBy != 1 )
  222.             {    
  223.                 //Flip the switch
  224.                 thread sub_doors_switch
  225.  
  226.                 //Take over the objective
  227.                 $obj_subpen_doors TakeOver 1
  228.                 
  229.                 //Open the doors
  230.                 $subpen_doors open $door_entity                
  231.                 $subpen_doors playsound subpen_doors_open
  232.                 
  233.                 //Give 2 points for taking objective
  234.                 parm.other AddKills 2 
  235.                 
  236.                 iprintln "The Allies have opened the Pen Doors!"
  237.             }
  238.         }
  239.  
  240.         //Did anyone win?
  241.         thread Check_End_Match
  242.  
  243.         //Update team current objectives
  244.         thread set_objectives
  245.     }
  246.  
  247. end
  248.  
  249. //----------------------------------------------------------
  250. //Open/close the sub clamps
  251. //----------------------------------------------------------
  252. toggle_sub_clamps:
  253.  
  254.     if( (level.bRoundStarted == 1) && (level.bClampsMoving == 0) )
  255.     {
  256.         if( parm.other.dmteam == axis )
  257.         {
  258.             if( $obj_sub_clamps.ControlledBy != 0 )
  259.             {
  260.                 level.bClampsMoving = 1            // set semaphore
  261.                 
  262.                 //Take the objective
  263.                 $obj_sub_clamps TakeOver 0                
  264.                 iprintln "The Axis have engaged the Sub Clamps!"
  265.  
  266.                 //Update team current objectives
  267.                 thread set_objectives
  268.  
  269.                 //Flip the switch
  270.                 thread sub_clamps_switch
  271.  
  272.                 //engage the clamps
  273.                 waitthread engage_sub_clamps
  274.  
  275.                 //Give 2 points for taking objective
  276.                 parm.other AddKills 2
  277.  
  278.                 level.bClampsMoving = 0            // clear semaphore
  279.                 waitthread Check_End_Match
  280.             }
  281.         }
  282.         else if( parm.other.dmteam == allies )
  283.         {
  284.             if( $obj_sub_clamps.ControlledBy != 1 )
  285.             {
  286.                 level.bClampsMoving = 1            // set semaphore
  287.                 
  288.                 //Take the objective
  289.                 $obj_sub_clamps TakeOver 1                
  290.                 iprintln "The Allies have disengaged the Sub Clamps!"
  291.  
  292.                 //Update team current objectives
  293.                 thread set_objectives
  294.  
  295.                 //Flip the switch
  296.                 thread sub_clamps_switch 
  297.  
  298.                 //disengage the clamps
  299.                 waitthread disengage_sub_clamps
  300.  
  301.                 //Give 2 points for taking objective
  302.                 parm.other AddKills 2 
  303.  
  304.                 level.bClampsMoving = 0            // clear semaphore
  305.                 waitthread Check_End_Match
  306.             }
  307.         }
  308.  
  309.         //Did anyone win?
  310.         thread Check_End_Match
  311.  
  312.         //Update team current objectives
  313.         thread set_objectives
  314.     }
  315.  
  316. end
  317.  
  318. //----------------------------------------------------------
  319. //steal the sub
  320. //----------------------------------------------------------
  321. steal_sub:
  322.  
  323.     if( level.bRoundStarted == 1 )
  324.     {
  325.         //Only the allies can actually take this objective
  326.         if( parm.other.dmteam != axis && $obj_steal_sub.ControlledBy != 1 )
  327.         {    
  328.             if( $obj_sub_clamps.ControlledBy == 1 && $obj_subpen_doors.ControlledBy == 1 )            
  329.             {
  330.                 local.winstate = int( getcvar( g_TOW_winstate ) )
  331.                 if( local.winstate == 0 )
  332.                 {
  333.                     //Give 2 points for taking objective
  334.                     parm.other AddKills 2 
  335.                     
  336.                     drawhud 0
  337.                     
  338.                     setcvar "g_TOW_winstate" "2"
  339.                     //Flip the switch
  340.                     thread start_sub_switch
  341.                     
  342.                     $obj_steal_sub TakeOver 1
  343.                 
  344.                     $player nodamage
  345.                     $player hide
  346.                     $player notsolid
  347.                     $player safeholster 1
  348.                     freezeplayer
  349.  
  350.                     //ignore the clock for the movies
  351.                     level ignoreclock 1
  352.  
  353.                     //if there is a bomb ticking stop it.
  354.                     waitthread global/tow_dm.scr::StopBomb
  355.  
  356.                     //if the axis managed to hit the close doors switch after the 
  357.                     $subpen_doors open $door_entity
  358.  
  359.                     thread sub_exit
  360.                     wait 25
  361.                     
  362.                     iprintln "The Allies have stolen the U-Boat!"    
  363.  
  364.                     teamwin allies
  365.                 }
  366.             }
  367.             else if( $obj_sub_clamps.ControlledBy == 0 && $obj_subpen_doors.ControlledBy == 0 )
  368.             {
  369.                 //Clamps locked doors closed
  370.                 parm.other iprint "Pen Doors and Submarine Clamps must be disengaged before launching"            
  371.             }
  372.             else if( $obj_sub_clamps.ControlledBy == 0 && $obj_subpen_doors.ControlledBy == 1 )
  373.             {    
  374.                 //Clamps locked Doors open
  375.                 parm.other iprint "Submarine Clamps must be disengaged before launching"            
  376.             }
  377.             else if( $obj_sub_clamps.ControlledBy == 1 && $obj_subpen_doors.ControlledBy == 0 )
  378.             {
  379.                 //Clamps open doors locked
  380.                 parm.other iprint "Pen Doors must be opened before launching"
  381.             }
  382.  
  383.         }
  384.         
  385.  
  386.         //Did anyone win?
  387.         thread Check_End_Match
  388.  
  389.         //Update team current objectives
  390.         thread set_objectives
  391.     }
  392.  
  393. end
  394.  
  395. //----------------------------------------------------------
  396. //Set the teams current objectives
  397. //----------------------------------------------------------
  398. set_objectives:
  399.     
  400.     //First lets do the allies
  401.     if( $obj_sub_clamps.ControlledBy == 0 )
  402.     {    
  403.         $obj_sub_clamps SetCurrent 1
  404.     }
  405.     else if( $obj_subpen_doors.ControlledBy == 0 )
  406.     {    
  407.         $obj_subpen_doors SetCurrent 1
  408.     }    
  409.     else if( $obj_steal_sub.ControlledBy == 0 )
  410.     {    
  411.         $obj_steal_sub SetCurrent 1
  412.     }
  413.  
  414.     //Now the Axis    
  415.     if( $obj_subpen_doors.ControlledBy == 1 )
  416.     {    
  417.         $obj_subpen_doors SetCurrent 0
  418.     }
  419.     else if( $obj_sub_clamps.ControlledBy == 1 )
  420.     {    
  421.         $obj_sub_clamps SetCurrent 0
  422.     }
  423.     else
  424.     {    
  425.         $obj_allied_spawner SetCurrent 0
  426.     }
  427.  
  428. end
  429.  
  430.  
  431. //--------------------------------------------------------------
  432. //Move the clamps handle
  433. //--------------------------------------------------------------
  434. sub_clamps_switch:    
  435.     
  436.     if( level.bClampsSwitchDown == 0 )
  437.     {
  438.         $clamp_handle_origin speed 1.0
  439.         $clamp_handle_origin rotatexdownto -90
  440.         $clamp_handle_origin waitmove
  441.         $clamp_handle_origin playsound switchbox 
  442.         level.bClampsSwitchDown = 1
  443.     }
  444.     else
  445.     {
  446.         $clamp_handle_origin rotatexupto 0
  447.         $clamp_handle_origin waitmove
  448.         level.bClampsSwitchDown = 0
  449.     }
  450.  
  451. end
  452.  
  453.  
  454. //--------------------------------------------------------------
  455. //Move the doors handle
  456. //--------------------------------------------------------------
  457. sub_doors_switch:        
  458.     
  459.     if( level.bDoorsSwitchDown == 0 )
  460.     {
  461.         $subpen_doors_handle_origin speed 1.0
  462.         $subpen_doors_handle_origin rotatezdownto 90
  463.         $subpen_doors_handle_origin waitmove
  464.         $subpen_doors_handle_origin playsound switchbox 
  465.         level.bDoorsSwitchDown = 1
  466.     }
  467.     else
  468.     {
  469.         $subpen_doors_handle_origin rotatezupto 0
  470.         $subpen_doors_handle_origin waitmove
  471.         level.bDoorsSwitchDown = 0
  472.     }    
  473.  
  474. end
  475.  
  476. //--------------------------------------------------------------
  477. //Start the sub switch
  478. //--------------------------------------------------------------
  479. start_sub_switch:
  480.     
  481.     $sub_controls_handle_origin speed 1.0
  482.     $sub_controls_handle_origin rotatezdownto 90
  483.     $sub_controls_handle_origin waitmove
  484.     $sub_controls_handle_origin playsound switchbox
  485.  
  486. end
  487.  
  488.  
  489. //--------------------------------------------------------------
  490. //Init the objective switch handles
  491. //--------------------------------------------------------------
  492. init_objective_switch_handles:
  493.     
  494.     $clamp_handle bind $clamp_handle_origin
  495.     $subpen_door_handle bind $subpen_doors_handle_origin
  496.  
  497.     $clamp_handle_origin notsolid
  498.     $subpen_doors_handle_origin notsolid
  499.     $clamp_handle notsolid
  500.     $subpen_door_handle notsolid
  501. end
  502.  
  503. //--------------------------------------------------------------
  504. //Lets get the sub outta dodge
  505. //--------------------------------------------------------------
  506. sub_exit:    
  507.     
  508.     drawhud 0
  509.  
  510.     //remove the sub clamps
  511.     $sub_clamps_1R remove
  512.     $sub_clamps_2R remove
  513.     $sub_clamps_3R remove
  514.     $sub_clamps_4R remove
  515.  
  516.     $sub_clamps_1L remove
  517.     $sub_clamps_2L remove
  518.     $sub_clamps_3L remove
  519.     $sub_clamps_4L remove
  520.  
  521.     //remove the ramps
  522.     $ramp1 remove
  523.     $ramp2 remove
  524.     $ramp3 remove
  525.     
  526.     forcemusic aux2 aux2
  527.  
  528.     //Stop the sub idle sound
  529.     //$lowerhull stoploopsound
  530.     //wait 1
  531.     //$lowerhull loopsound sub_moving
  532.  
  533.     //Start the sub rolling
  534.     $lowerhull followpath $sub_path normalangles     
  535.     
  536.     //setup our camera        
  537.     $watch_camera fov 80 2
  538.     $watch_camera speed .5                                
  539.     $watch_camera follow $camera_path $lowerhull
  540.     
  541.     wait 2
  542.  
  543.     //Cue the movie baby!
  544.     cuecamera $watch_camera
  545.     
  546.     $lowerhull move
  547.     //$lowerhull stoploopsound
  548.  
  549. end
  550.  
  551.  
  552.  
  553.  
  554. //--------------------------------------------------------------
  555. //init the sub
  556. //--------------------------------------------------------------
  557. init_sub:
  558.  
  559.     //bind the sub objects together    
  560.     $upperhull angles "0 90 0"
  561.  
  562.     $upperhull bind $lowerhull
  563.     $sub_col bind $lowerhull
  564.  
  565.     $sub_controls_handle bind sub_controls_handle_origin    
  566.     //$sub_controls_handle_origin bind $sub_controls
  567.     $sub_controls bind $lowerhull
  568.     //Added by Vex
  569.     $lowerhull loopsound sub_idle
  570.  
  571. end
  572.  
  573.  
  574.  
  575. //-----------------------------------------------
  576. // Init the spawner bombs
  577. //-----------------------------------------------
  578. init_spawner_bombs:
  579.     
  580.     //Allied spawner bomb
  581.     $boat_bomb thread global/tow_dm.scr::bomb_thinker "axis" maps/obj/MP_Druckkammern_TOW.scr::destroy_allied_spawner
  582.     $fuel_depot_bomb thread global/tow_dm.scr::bomb_thinker "allies" maps/obj/MP_Druckkammern_TOW.scr::destroy_axis_spawner
  583.  
  584. end
  585.  
  586. //-----------------------------------------------
  587. // Init the sub clamps
  588. //-----------------------------------------------
  589. init_sub_clamps:
  590.     
  591.     $sub_clamps_1R bind    $sub_clamps_1R_origin
  592.     $sub_clamps_2R bind $sub_clamps_2R_origin
  593.     $sub_clamps_3R bind $sub_clamps_3R_origin
  594.     $sub_clamps_4R bind $sub_clamps_4R_origin
  595.  
  596.     $sub_clamps_1L bind    $sub_clamps_1L_origin
  597.     $sub_clamps_2L bind    $sub_clamps_2L_origin
  598.     $sub_clamps_3L bind    $sub_clamps_3L_origin
  599.     $sub_clamps_4L bind    $sub_clamps_4L_origin
  600.  
  601. end
  602.  
  603. //-----------------------------------------------
  604. // disengage sub clamps
  605. //-----------------------------------------------
  606. disengage_sub_clamps:
  607.     
  608.     //Disengage the clamps
  609.     if( level.clampsEngaged == 1 )
  610.     {
  611.         //Clamp set 1
  612.         $sub_clamps_1L_origin speed 0.5
  613.         $sub_clamps_1L_origin rotatexdownto -45
  614.         $sub_clamps_1L_origin waitmove
  615.         $sub_clamps_1L_origin playsound subclamp_open
  616.  
  617.         $sub_clamps_1R_origin speed 0.5
  618.         $sub_clamps_1R_origin rotatexdownto 45
  619.         $sub_clamps_1R_origin waitmove
  620.         $sub_clamps_1R_origin playsound subclamp_open
  621.  
  622.         wait 2
  623.  
  624.         //Clamp set 2
  625.         $sub_clamps_2L_origin speed 0.5
  626.         $sub_clamps_2L_origin rotatexdownto -45
  627.         $sub_clamps_2L_origin waitmove
  628.         $sub_clamps_2L_origin playsound subclamp_open 
  629.  
  630.         $sub_clamps_2R_origin speed 0.5
  631.         $sub_clamps_2R_origin rotatexdownto 45
  632.         $sub_clamps_2R_origin waitmove
  633.         $sub_clamps_2R_origin playsound subclamp_open
  634.  
  635.         wait 2
  636.  
  637.         //Clamp set 3
  638.         $sub_clamps_3L_origin speed 0.5
  639.         $sub_clamps_3L_origin rotatexdownto -45
  640.         $sub_clamps_3L_origin waitmove
  641.         $sub_clamps_3L_origin playsound subclamp_open
  642.         
  643.         $sub_clamps_3R_origin speed 0.5
  644.         $sub_clamps_3R_origin rotatexdownto 45
  645.         $sub_clamps_3R_origin waitmove
  646.         $sub_clamps_3R_origin playsound subclamp_open                                                                            
  647.         wait 2
  648.  
  649.         //Clamp set 4
  650.         $sub_clamps_4L_origin speed 0.5
  651.         $sub_clamps_4L_origin rotatexdownto -45
  652.         $sub_clamps_4L_origin waitmove
  653.         $sub_clamps_4L_origin playsound subclamp_open
  654.  
  655.         $sub_clamps_4R_origin speed 0.5
  656.         $sub_clamps_4R_origin rotatexdownto 45
  657.         $sub_clamps_4R_origin waitmove
  658.         $sub_clamps_4R_origin playsound subclamp_open
  659.  
  660.         level.clampsEngaged = 0
  661.     }
  662.  
  663. end
  664.  
  665.  
  666. //-----------------------------------------------
  667. // engage sub clamps
  668. //-----------------------------------------------
  669. engage_sub_clamps:
  670.  
  671.     //Disengage the clamps
  672.     if( level.clampsEngaged == 0 )
  673.     {
  674.         //Clamp set 1
  675.         $sub_clamps_1L_origin speed 0.5
  676.         $sub_clamps_1L_origin rotatexdownto 0
  677.         $sub_clamps_1L_origin waitmove
  678.         $sub_clamps_1L_origin playsound subclamp_close 
  679.  
  680.         $sub_clamps_1R_origin speed 0.5
  681.         $sub_clamps_1R_origin rotatexdownto 0
  682.         $sub_clamps_1R_origin waitmove
  683.         $sub_clamps_1R_origin playsound subclamp_close 
  684.  
  685.         wait 2
  686.  
  687.         //Clamp set 2
  688.         $sub_clamps_2L_origin speed 0.5
  689.         $sub_clamps_2L_origin rotatexdownto 0
  690.         $sub_clamps_2L_origin waitmove
  691.         $sub_clamps_2L_origin playsound subclamp_close
  692.  
  693.         $sub_clamps_2R_origin speed 0.5
  694.         $sub_clamps_2R_origin rotatexdownto 0
  695.         $sub_clamps_2R_origin waitmove
  696.         $sub_clamps_2R_origin playsound subclamp_close 
  697.  
  698.         wait 2
  699.  
  700.         //Clamp set 3
  701.         $sub_clamps_3L_origin speed 0.5
  702.         $sub_clamps_3L_origin rotatexdownto 0
  703.         $sub_clamps_3L_origin waitmove
  704.         $sub_clamps_3L_origin playsound subclamp_close 
  705.  
  706.         $sub_clamps_3R_origin speed 0.5                                  
  707.         $sub_clamps_3R_origin rotatexdownto 0
  708.         $sub_clamps_3R_origin waitmove
  709.         $sub_clamps_3R_origin playsound subclamp_close 
  710.  
  711.         wait 2
  712.  
  713.         //Clamp set 4
  714.         $sub_clamps_4L_origin speed 0.5
  715.         $sub_clamps_4L_origin rotatexdownto 0
  716.         $sub_clamps_4L_origin waitmove
  717.         $sub_clamps_4L_origin playsound subclamp_close
  718.  
  719.         $sub_clamps_4R_origin speed 0.5
  720.         $sub_clamps_4R_origin rotatexdownto 0
  721.         $sub_clamps_4R_origin waitmove
  722.         $sub_clamps_4R_origin playsound subclamp_close
  723.         level.clampsEngaged = 1
  724.     }
  725. end
  726.  
  727. //-----------------------------------------------
  728. // See if someone won
  729. //-----------------------------------------------
  730. Check_End_Match:
  731.  
  732.     local.nAxis        = 0
  733.     local.nAllied    = 0
  734.  
  735.     //Allied Spawner
  736.     if( $obj_allied_spawner.ControlledBy == 0 )
  737.     {
  738.         local.nAxis++
  739.     }
  740.  
  741.     //Axis Spawner
  742.     if( $obj_axis_spawner.ControlledBy == 0 )
  743.     {
  744.         local.nAxis++
  745.     }    
  746.     
  747.     //Sub Doors
  748.     if( $obj_subpen_doors.ControlledBy == 0 )
  749.     {
  750.         local.nAxis++
  751.     }    
  752.     
  753.     //Sub Clamps
  754.     if( $obj_sub_clamps.ControlledBy == 0 )
  755.     {
  756.         local.nAxis++
  757.     }    
  758.  
  759.     //Submarine
  760.     if( $obj_steal_sub.ControlledBy == 0 )
  761.     {
  762.         local.nAxis++
  763.     }
  764.     
  765.     //Allies win by stealing the sub which is already handled so we only need to see if the axis have taken all the objectives...
  766.     //Only show the movie if the wingame cvar has not been set yet.
  767.     local.winstate = int( getcvar( g_TOW_winstate ) )
  768.     if( local.winstate == 0 )
  769.     {
  770.         if( local.nAxis == level.numObjectives )
  771.         {
  772.             setcvar "g_TOW_winstate" "1"
  773.  
  774.             //If the clock expires during the movie ignore it
  775.             level ignoreclock 1
  776.  
  777.             //if there is a bomb ticking stop it.
  778.             waitthread global/tow_dm.scr::StopBomb
  779.  
  780.             //Play the cinematic
  781.             thread AxisWon
  782.         }    
  783.     }
  784.  
  785. end
  786.  
  787.  
  788.  
  789. //-----------------------------------------------
  790. // Blow up 
  791. //-----------------------------------------------
  792. Do_Fuel_Tank_Explosion:
  793.     
  794.     if (self.exploder_set != NIL)
  795.     {
  796.         exec global/exploder.scr::explode self.exploder_set
  797.     }
  798.     
  799.     if (self.explosion_fx != NIL)
  800.     {
  801.         self thread spawn_fx self.explosion_fx
  802.     }
  803.     
  804.     if (self.explosion_sound != NIL)
  805.     {
  806.         self playsound self.explosion_sound
  807.     }
  808.  
  809.     if (self.target != NIL && self.target != NULL && self.target != "")
  810.     {
  811.         self.target thread blow_up
  812.         
  813.         waitframe
  814.     }
  815.     
  816.     radiusdamage self.origin level.bomb_damage level.bomb_explosion_radius
  817.     
  818.     if (self.killarea != NIL)
  819.     {
  820.         self.killarea volumedamage 1000
  821.     }
  822.     
  823.     self hide
  824.  
  825.     self.live = 0
  826.     
  827.     self.exploded = 1    
  828.  
  829. end
  830.  
  831.  
  832. //-----------------------------------------------
  833. //Do some fx
  834. //-----------------------------------------------
  835. spawn_fx local.fx:
  836.  
  837.     local.temp = spawn script_model model local.fx
  838.     local.temp.origin = self.origin
  839.     local.temp anim start
  840.     wait 5
  841.     local.temp remove
  842.  
  843. end
  844.  
  845. //-----------------------------------------------
  846. //Blow up a thing
  847. //-----------------------------------------------
  848. blow_up:
  849.  
  850.     if ( self.destroyed_model != NIL )
  851.     {
  852.         local.damaged = self thread spawn_damaged self.destroyed_model
  853.     }
  854.     
  855.     if( self.target != NIL )
  856.     {
  857.         self.target thread blow_up
  858.     }
  859.     
  860.     self remove
  861.  
  862. end
  863.  
  864. //-----------------------------------------------
  865. //spawn a damaged model
  866. //-----------------------------------------------
  867. spawn_damaged local.model:
  868.  
  869.     local.damaged = spawn script_model model local.model
  870.     local.damaged.origin = self.origin
  871.     local.damaged.angles = self.angles
  872.  
  873. end local.damaged
  874.  
  875. //-----------------------------------------------
  876. //Axis have won do their cinematic
  877. //-----------------------------------------------
  878. AxisWon:
  879.  
  880.     drawhud 0
  881.     
  882.     //Standard hide player stuff
  883.     $player nodamage
  884.     $player hide
  885.     $player notsolid
  886.     $player safeholster 1
  887.     freezeplayer
  888.  
  889.     level ignoreclock 1
  890.  
  891.     //spawn the officers
  892.     waitthread global/dm_ai.scr::spawnset 2 officers    
  893.  
  894.     //spawn the colonel
  895.     waitthread global/dm_ai.scr::spawnset 1 colonel    
  896.  
  897.     $colonel thread Do_Axis_Colonel_End
  898.  
  899.     //Tell the officers to do their ending sequence    
  900.     for( local.i = 1; local.i <= $officers.size; local.i++ )
  901.     {
  902.         $officers[local.i] thread Do_Axis_Officers_End
  903.     }
  904.  
  905. end
  906.  
  907. //-----------------------------------------------
  908. //Axis colonel handler
  909. //-----------------------------------------------
  910. Do_Axis_Colonel_End:
  911.  
  912.     self nodamage
  913.  
  914.     forcemusic aux4 aux4
  915.  
  916.     self walkto self.target
  917.     
  918.     $cam_follow_comander speed 1.6
  919.     $cam_follow_comander follow $col_camera_path
  920.     $cam_follow_comander cut
  921.     cuecamera $cam_follow_comander
  922.  
  923.     wait 10
  924.     
  925.     $cam_behind_dudes fov 60
  926.     $cam_behind_dudes watch self
  927.     $cam_behind_dudes cut
  928.     cuecamera $cam_behind_dudes
  929.  
  930.     //colonel salutes the officers        
  931.     self anim american_salute
  932.  
  933.     wait 1.6
  934.  
  935.     //show the bodies
  936.     $bodies1 show
  937.     $bodies2 show
  938.     $bodies3 show
  939.     $bodies4 show
  940.  
  941.     $axis_camera speed .6
  942.     $axis_camera fov 100
  943.     $axis_camera follow $axis_camera_path
  944.     $axis_camera cut
  945.     cuecamera $axis_camera
  946.  
  947.     wait 8
  948.  
  949.     teamwin axis
  950.  
  951. end       
  952.  
  953.  
  954. //-----------------------------------------------
  955. //Axis officers handler
  956. //-----------------------------------------------
  957. Do_Axis_Officers_End:
  958.  
  959.     self nodamage
  960.     self lookat $colonel
  961.  
  962.     local.rand = randomfloat 0.50
  963.     local.wait = 8 + local.rand
  964.  
  965.     wait local.wait
  966.     
  967.     //Officers salute the colonel
  968.     self anim american_salute
  969.     self waittill animdone
  970.  
  971.     self anim atease
  972.  
  973. end
  974.