home *** CD-ROM | disk | FTP | other *** search
/ PC Gamer 6 / 1995-05_Disc_6.iso / bioforge / script / chaosblk.scr < prev    next >
Text File  |  1995-02-20  |  22KB  |  1,103 lines

  1. // ***ROOM LOADS***
  2.  
  3. { CE1_LOAD
  4.     if @SetCurrentFigure(caynan) then
  5.         {
  6.         if .curfig._HPS >= 0 then
  7.             {
  8.             SparWithPlayer
  9.             }
  10.         }
  11. }
  12.  
  13. // set up the mondite guard in this cell in the appropriate position -bes
  14. // we only want to do this from within cell#2 camera monitor, as other code
  15. //   handles this for when we enter the room -bes
  16. { CE2_LOAD
  17.     if( _GRD1_Alive = _TRUE ) and @IsMonitorRunning() then
  18.         {
  19.         if @SetCurrentFigure(Guard1) then
  20.             {
  21.             if( _GRD1_Awake = _TRUE ) then
  22.                 {
  23.                 Motion atk_stand continue snap_to
  24.                 suspend
  25.                 StopMotion
  26.                 SparWithPlayer
  27.                 }
  28.             else
  29.                 {
  30.                 //SnapToPose wake_up 0
  31.                 // We may need to use SnapToMotion instead here
  32.                 Motion wake_up continue snap_to
  33.                 suspend
  34.                 StopMotion
  35.                 SparWithPlayer
  36.                 }
  37.  
  38.             }
  39.         else debug("Can't find Guard1") //DON'T TRANSLATE
  40.         }
  41. }
  42.  
  43.  
  44. { CE4_LOAD
  45.     // if I walk into this room and the USEBOT is in here and is in
  46.     //   AUTOMATIC mode, then activate it
  47.     //if @SetCurrentFigure(Use_Bot) and @IsMonitorRunning() = _FALSE then
  48.     //      {
  49.     //      //Caption "Lex near Use_Bot"
  50.     //      if @AmInExtent(curfig,CE4) and _use_bot_activated = 0 then
  51.     //              {
  52.     //              motion Activate continue
  53.     //              TurnToEnemy
  54.     //              SparWithPlayer
  55.     //
  56.     //              :keep_turning
  57.     //              suspend
  58.     //              if @IsMyMotion( Activate ) then jump keep_turning
  59.     //              AI on
  60.     //              }
  61.     //      else
  62.     //              SparWithPlayer
  63.     //      }
  64.  
  65.     if @SetCurrentFigure(Use_Bot) then
  66.         SparWithPlayer
  67. }
  68.  
  69. { BLK_LOAD
  70.     // if I walk into this room and the USEBOT is in here and is in
  71.     //   AUTOMATIC mode, then activate it
  72.     //if @SetCurrentFigure(Use_Bot) and @IsMonitorRunning() = _FALSE then
  73.     //      {
  74.     //      //Caption "Lex near Use_Bot"
  75.     //      if @AmInExtent(curfig,BLK) and _use_bot_activated = 0 then
  76.     //              {
  77.     //              motion Activate continue
  78.     //              TurnToEnemy
  79.     //              SparWithPlayer
  80.     //
  81.     //              :keep_turning
  82.     //              suspend
  83.     //              if @IsMyMotion( Activate ) then jump keep_turning
  84.     //              AI on
  85.     //              }
  86.     //      else
  87.     //              SparWithPlayer
  88.     //      }
  89.  
  90.     if @SetCurrentFigure(Use_Bot) then
  91.         SparWithPlayer
  92. }
  93.  
  94.  
  95. // ***CEL CAMERAS***
  96.  
  97. // ***CE3***
  98.  
  99. // This makes sure that the camera CE33 is used before the Nursebot is
  100. // destroyed, and that CE32 is used afterwards. -KLD
  101. { CE3_LOAD
  102.  
  103.     if @IsProcessValid(_ce3_modifyvar_handle) then
  104.         KillProcess _ce3_modifyvar_handle
  105.     
  106.     _CE31_Volume = 0
  107.     _ce3_modifyvar_handle = @ModifyVarEveryNth(_CE31_Volume +10 0 100 300)
  108.  
  109.     if _Bot_Blown == 0 then
  110.         {
  111.         CameraAutoActivate CE33 On
  112.         CameraAutoActivate CE32 Off
  113.         }
  114.     else
  115.         {
  116.         CameraAutoActivate CE33 Off
  117.         CameraAutoActivate CE32 On
  118.         }
  119. }
  120.  
  121. // ***CELL BLOCK CAMERAS***
  122.  
  123. { BLK1_LOAD
  124.                
  125.     MUSIC _CELPANEL
  126.         
  127.     If @IsHandlePlaying(_BLEED_2) then StopSound(_BLEED_2)
  128.     
  129. }
  130.  
  131. { BLK2_LOAD
  132.                
  133.     
  134.     If @IsHandlePlaying(_BLEED_2) then StopSound(_BLEED_2)
  135. }
  136.  
  137. { BLK3_LOAD
  138. // This is to set the skip shape so that cell2 will be dark
  139.     if _Cell2RepairNeeded == 1 then
  140.         _drk_frame = 1
  141.     else
  142.         _drk_frame = 0
  143.  
  144.  
  145.  
  146.     If _dr5_frame = 1 and @IsHandlePlaying(_BLEED_2) then
  147.         {
  148.         StopSound(_BLEED_2)
  149.         return
  150.         }
  151.  
  152.     If _dr5_frame = 2 then
  153.         {
  154.         If @IsHandlePlaying(_BLEED_2) then
  155.             {
  156.             SetVolume(_BLEED_2 20)
  157.             _BleedVol = 20
  158.             return
  159.             }
  160.         If @IsHandlePlaying(_BLEED_2) = _FALSE then
  161.             {
  162.             _BLEED_2 = @Ambient(_grd_ambient 20)
  163.             _BleedVol = 20
  164.             return
  165.             }
  166.         }
  167.  
  168.     If _dr5_frame = 0 then
  169.         {
  170.         If @IsHandlePlaying(_BLEED_2) then
  171.             {
  172.             SetVolume(_BLEED_2 35)
  173.             _BleedVol = 35
  174.             return
  175.             }
  176.         If @IsHandlePlaying(_BLEED_2) = _FALSE and _FuckingKlaxon = 1 then
  177.             {
  178.             _BLEED_2 = @Ambient(_grd_ambient 35)
  179.             _BleedVol = 35
  180.             return
  181.             }
  182.         }
  183.  
  184.     Wait 2 seconds
  185.     AddLogEntry LEX SeeGun
  186. }
  187.  
  188. { BLK4_LOAD
  189.  
  190.     // Need to make a var that checks if Lex was in Caynan's cell 
  191.     //      yet - otherwise don't change music - JT
  192.     If _Caynan_Alive = _TRUE then MUSIC _CELPANEL
  193.     If _dr5_frame = 1 and @IsHandlePlaying(_BLEED_2) then
  194.         {
  195.         StopSound(_BLEED_2)
  196.         return
  197.         }
  198.  
  199.     If _dr5_frame = 2 then
  200.         {
  201.         If @IsHandlePlaying(_BLEED_2) then
  202.                 {
  203.                 SetVolume(_BLEED_2, 30)
  204.                 _BleedVol = 30
  205.                 return
  206.                 }
  207.         If @IsHandlePlaying(_BLEED_2) = _FALSE then
  208.                 {
  209.                 _BLEED_2 = @Ambient(_grd_ambient 30)
  210.                 _BleedVol = 30
  211.                 return
  212.                 }
  213.         }
  214.  
  215.     If _dr5_frame = 0 then
  216.         {
  217.         If @IsHandlePlaying(_BLEED_2) then
  218.             {
  219.             SetVolume(_BLEED_2, 45)
  220.             _BleedVol = 45
  221.             return
  222.             }
  223.         Else
  224.             {
  225.             _BLEED_2 = @Ambient(_grd_ambient 45)
  226.             _BleedVol = 45
  227.             return
  228.             }
  229.         }
  230.     
  231. }
  232.  
  233. { BLK5_LOAD
  234.                
  235.  
  236.     If _dr5_frame = 1 and @IsHandlePlaying(_BLEED_2) then
  237.         {
  238.         StopSound(_BLEED_2)
  239.         return
  240.         }
  241.         
  242.     If _dr5_frame = 2 then
  243.         {
  244.         If @IsHandlePlaying(_BLEED_2) then
  245.             {
  246.             SetVolume(_BLEED_2, 50)
  247.             _BleedVol = 50
  248.             return
  249.             }
  250.         If @IsHandlePlaying(_BLEED_2) =_FALSE and _FuckingKlaxon = 1 then                
  251.             {
  252.             _BLEED_2 = @Ambient(_grd_ambient 50)
  253.             _BleedVol = 50
  254.             return
  255.             }
  256.         }
  257.         
  258.      If _dr5_frame = 0 then
  259.         {
  260.         If @IsHandlePlaying(_BLEED_2) then
  261.             {
  262.             SetVolume(_BLEED_2, 65)
  263.             _BleedVol = 65
  264.             return
  265.             }
  266.         If @IsHandlePlaying(_BLEED_2) = _FALSE then                
  267.             {
  268.             _BLEED_2 = @Ambient(_grd_ambient 65)
  269.             _BleedVol = 65
  270.             return
  271.             }
  272.         }
  273.  
  274. }
  275.  
  276.  
  277. { CayBye                // Caynan forgets he's greeted you - BAR
  278.     _cay_greet = 0  
  279. }
  280.  
  281. // ==============  LEX PRIES OPEN THE CELL PANEL MONITOR ===========
  282.  
  283. { celpan_use    // fork is not in hand for this code to be called
  284.     _Suppress_Quakes ++
  285.     AI off
  286.     Face 0 gradual
  287.  
  288.     if _celpan_open = 1 then
  289.         {
  290.         //Motion look_console freeze
  291.         Motion look_at_mon freeze      // good fake motion
  292.         @Process CC_CircuitBoard
  293.         }
  294.     else
  295.         {
  296.         Motion pry_celpan_fail freeze
  297.         Motion stand continue
  298.         Wait 2 seconds
  299.         AddLogEntry LEX PanelOn
  300.         }
  301.     AI on
  302.     _Suppress_Quakes --
  303. }
  304.  
  305. { celpan_fork_use       // fork is currently in hand
  306.  
  307.     _Suppress_Quakes ++
  308.     AI off
  309.     //Go PanLoc walk 10
  310.     //@Process CheckDist
  311.     Face 0 gradual
  312.  
  313.     if _celpan_open = 1 then
  314.         {
  315.         //Motion look_console freeze
  316.         Motion look_at_mon freeze     // good fake motion
  317.         @Process CC_CircuitBoard
  318.         }
  319.     else
  320.         {
  321.         Motion pry_celpan 90
  322.         suspend
  323.         @Process Celpan_Swing
  324.         _celpan_open = 1
  325.         }
  326.     AI on
  327.     _Suppress_Quakes --
  328. }
  329.  
  330. [ Celpan_Swing
  331.  
  332.     00:01   _pn1_frame =    2
  333.     00:03   _pn1_frame =    3
  334.         @SOUND(_hinge, 200, 1024)
  335.     00:05   _pn1_frame =    4
  336.     00:07   _pn1_frame =    5
  337.     00:09   _pn1_frame =    6
  338.     00:11   _pn1_frame =    7
  339.     00:13   _pn1_frame =    8
  340.     00:15   _pn1_frame =    9
  341.     00:17   _pn1_frame =    10
  342.     00:19   _pn1_frame =    11
  343.         @SOUND(_panel_hit, 200, -1024)
  344.     00:21   _pn1_frame =    12
  345.  
  346. ]
  347.  
  348. //{ CheckDist
  349.  
  350. //      wait 35
  351. //      if @IsMyMotion != stand then StopMotion
  352. //}
  353.  
  354. // ==============  LEX PRIES OPEN THE CELL BLOCK DOOR ==============
  355.  
  356. [ fully_open_cell_door
  357.  
  358.     // DOORS OPEN FULLY AND SOUND BLEEDS THROUGH AS THE DOORS OPEN
  359.  
  360.     // This waits the first second while Lex raises his arms
  361.     // for the big pull.
  362.     00:10   @SOUND          _blk_door_screech
  363.     00:10   _dr5_frame =    2
  364.     00:11   If @IsHandlePlaying(_BLEED_2) then 
  365.             @ModifyVolumeOverTime(_BLEED_2, _BleedVol, 65, 60)
  366.         Else
  367.             {
  368.             _BLEED_2 = @Ambient(_grd_ambient, 0)
  369.             @ModifyVolumeOverTime(_BLEED_2, 0, 65, 60)
  370.             }
  371.     00:23   _dr5_frame =    3
  372.     01:06   _dr5_frame =    4
  373.     01:19   _dr5_frame =    5
  374.     02:02   _dr5_frame =    6
  375.     02:15   _dr5_frame =    7
  376.     02:28   _dr5_frame =    8
  377.     03:11   _dr5_frame =    9
  378.     03:24   _dr5_frame =    10
  379.     03:29   _dr5_frame =    0
  380. ]
  381.  
  382. [ partially_open_cell_door
  383.  
  384.     // DOORS OPEN PARTIALLY, SPARKS FLY FROM THE PANEL, THEN THEY
  385.     // SNAP BACK SHUT.  AMBIENT BLEED SHOULD BE ONLY MOMENTARY.
  386.  
  387.     02:00   @SOUND(_blk_door_partial)
  388.             _dr5_frame =    1
  389.     02:02   _dr5_frame =    2
  390.             _BLEED_2 = @Ambient(_grd4_bleed_blk5, 50)
  391.             _fuckingklaxon = 1
  392.     02:23   @SOUND(_light1, 255, -2048)
  393.     02:24   @Sound(_explosion2)
  394.             @Process( celpan_explosion )
  395.     07:00   AddLogEntry LEX CellDoor
  396. ]
  397.  
  398. [ just_see_sparks
  399.  
  400.     // DOORS OPEN PARTIALLY, SPARKS FLY FROM THE PANEL, THEN THEY
  401.     // SNAP BACK SHUT.  AMBIENT BLEED SHOULD BE ONLY MOMENTARY.
  402.  
  403.     02:00   @SOUND(_blk_door_partial)
  404.     02:23   @SOUND(_light1, 255, -2048)
  405.     02:24   @Sound(_explosion2)
  406.             @Process( celpan_explosion )
  407. ]
  408.  
  409. [ celpan_explosion
  410.     00:00   _xplo_frame =  1
  411.     00:05   _xplo_frame =  2
  412.     00:10   _xplo_frame =  3
  413.     00:15   _xplo_frame =  4
  414.     00:20   _xplo_frame =  5
  415.     00:25   _xplo_frame =  6
  416.     01:00   _xplo_frame =  7
  417.     00:05   _xplo_frame =  8
  418.     00:10   _xplo_frame =  9
  419.     00:15   _xplo_frame = 10
  420.  
  421.     _Burn_Frame = 1
  422. ]
  423.  
  424.  
  425. {   PRY_DR_USE
  426.     LocalVar _handle
  427.  
  428.     if _cel_door_state = 1 then return  // door already opened
  429.  
  430.     // position character
  431.  
  432.     AI off
  433.     GO PRY_HERE WALK
  434.     Face -90 gradual
  435.  
  436.     // run the scene
  437.  
  438.     //if _celpan_state = 5 then // puzzle is solved... (long version)
  439.     if _celpan_state = 4 then // puzzle is solved...
  440.         {
  441.         // Get ready to pry the thing open raise hands to door.
  442.         Motion Pry_Ready
  443.  
  444.         @Process fully_open_cell_door
  445.  
  446.         // open the door frame
  447.         _do1_frame = 2
  448.  
  449.         // Now actually force it open in 115 30ths.
  450.         Motion Pry_Door 115
  451.  
  452.         _dr5_space = _NEGATIVE
  453.         _cel_door_state = 1
  454.  
  455.         // add a log entry into the maintenance monitor that reflects this
  456.         //   event -bes
  457.         AddLogEntry GMAINT C4REP
  458.  
  459.         CaptureKeyboard DemoKeys
  460.  
  461.         Motion stand continue
  462.         Wait 2 seconds
  463.  
  464.         SuspendWhile @Fade(down,45)
  465.         Freeze
  466.         Music _GMreset
  467.         StopAllSounds
  468.  
  469.         BankInSFX _demo_sfx
  470.         //Camera show demo1
  471.         //SuspendWhile @Fade(up,45)
  472.         StartFlic "demo1"
  473.         //@Fade(up,45)
  474.         SetFlicRate 4
  475.         //Wait 15
  476.         @Fade(up,45)
  477.  
  478.         MUSIC _TITLEMUSIC
  479.         SuspendWhile @RunFlic Demo1Sounds 162
  480.         SuspendWhile _IntroProcess
  481.  
  482.         StopFlic
  483.         Thaw
  484.  
  485.         //SuspendWhile @Fade(down,45)
  486.         camera show demo2
  487.         Music _STOP_MUSIC
  488.         MUSIC _GMReset
  489.         Music _MACHINE_SHOP
  490.         SuspendWhile @Fade(up,45)
  491.  
  492.         @Call ShowScreenShots
  493.  
  494.         SuspendWhile @Fade(down,45)
  495.         camera show demo19
  496.         //Music _STOP_MUSIC
  497.         SuspendWhile @Fade(up,45)
  498.         //Music _TANKS
  499.         Wait 5 seconds
  500.         StopAllSounds
  501.         Exit
  502.         }
  503.  
  504.     // puzzle not solved: only partially open the door
  505.     if _dr5_frame != 2 then
  506.         {
  507.         @Process partially_open_cell_door
  508.         }
  509.     else
  510.         {
  511.         @Process just_see_sparks
  512.         }
  513.  
  514.     Motion PRY_DOOR_FAIL 130
  515.  
  516.     :CleanUp
  517.  
  518.     AI on
  519. }
  520.  
  521.  
  522. [ Demo1Sounds
  523.     00:00   _current_level = _CHAOS_LEVEL
  524.     09:00   @SOUND(_demo_sfx)        
  525.     10:00   _IntroProcess = @Fade(down,45)
  526.     300:00  @SOUND(_silence)
  527. ]
  528.  
  529.  
  530. [ ShowScreenShots
  531.     00:20   @Fade(down,10)
  532.     01:00   camera show demo3
  533.             @Fade(up,10)
  534.  
  535.     02:20   @Fade(down,10)
  536.     03:00   camera show demo4
  537.             @Fade(up,10)
  538.  
  539.     04:20   @Fade(down,10)
  540.     05:00   camera show demo5
  541.             @Fade(up,10)
  542.  
  543.     06:20   @Fade(down,10)
  544.     07:00   camera show demo6
  545.             @Fade(up,10)
  546.  
  547.     08:20   @Fade(down,10)
  548.     09:00   camera show demo7
  549.             @Fade(up,10)
  550.  
  551.     10:20   @Fade(down,10)
  552.     11:00   camera show demo8
  553.             @Fade(up,10)
  554.  
  555.     12:20   @Fade(down,10)
  556.     13:00   camera show demo9
  557.             @Fade(up,10)
  558.  
  559.     14:20   @Fade(down,10)
  560.     15:00   camera show demo10
  561.             @Fade(up,10)
  562.  
  563.     16:20   @Fade(down,10)
  564.     17:00   camera show demo11
  565.             @Fade(up,10)
  566.  
  567.     18:20   @Fade(down,10)
  568.     19:00   camera show demo12
  569.             @Fade(up,10)
  570.  
  571.     20:20   @Fade(down,10)
  572.     21:00   camera show demo13
  573.             @Fade(up,10)
  574.  
  575.     22:20   @Fade(down,10)
  576.     23:00   camera show demo14
  577.             @Fade(up,10)
  578.  
  579.     24:20   @Fade(down,10)
  580.     25:00   camera show demo15
  581.             @Fade(up,10)
  582.  
  583.     26:20   @Fade(down,10)
  584.     27:00   camera show demo16
  585.             @Fade(up,10)
  586.  
  587.     28:20   @Fade(down,10)
  588.     29:00   camera show demo17
  589.             @Fade(up,10)
  590.  
  591.     30:20   @Fade(down,10)
  592.     31:00   camera show demo18
  593.             @Fade(up,10)
  594.  
  595.     31:20   return
  596. ]
  597.  
  598.  
  599. { F1KEY
  600.     CaptureKeyboard F1Keys
  601.     _current_level = 666
  602.     Freeze
  603.  
  604.     camera show keys
  605.  
  606.     :waiting_for_esc
  607.     suspend
  608.     if _current_level == 666 then jump waiting_for_esc
  609.  
  610.     Thaw
  611.     camera unlock
  612.     ReleaseKeyboard
  613. }
  614.  
  615. // If they hit ESC then let them exit. -bes
  616. { F1Keys _key _modifiers _mouse
  617.     if _key == _HK_ESC then
  618.         _current_level = _CHAOS_LEVEL
  619.     return
  620. }
  621.  
  622.  
  623.  
  624. // If they hit ALT_X then let them exit. -bes
  625. { DemoKeys _key _modifiers _mouse
  626.     if _key == _HK_X then
  627.         if @WasAltPressed(_modifiers) then
  628.             Exit
  629.     if _key == _HK_ESC then
  630.         Exit
  631.     return
  632. }
  633.  
  634.  
  635.  
  636. { FLICKER_LIGHT
  637.  
  638.     LinkMeToCameras BLK1, BLK2, BLK3, BLK4, BLK5
  639.  
  640.     :LightLoop
  641.     if @random(1,4) = 1 then jump LightOn
  642.     _lht_frame = 2
  643.  
  644.     // The light is dimming just a little...
  645.     if( @IsCurrentCamera(BLK2) ) then
  646.         ChangePalette -2 -2 -2 999
  647.     if( @IsCurrentCamera(BLK1) || @IsCurrentCamera(BLK3) ) then
  648.         ChangePalette -1 -1 -1 999
  649.  
  650.     @SOUND (_light1, lght_loc)
  651.     suspend
  652.     _lht_frame = 3
  653.     suspend
  654.     jump LightLoop
  655.  
  656.     :LightOn
  657.  
  658.     // The light normally stays on fairly brightly.
  659.     _lht_frame = 1
  660.  
  661.     if( @IsCurrentCamera(BLK1) || @IsCurrentCamera(BLK2) || @IsCurrentCamera(BLK3) ) then
  662.         ChangePalette 0 0 0 999
  663.     suspend
  664.     _LightInterval = @random(10,40)
  665.     Wait _LightInterval
  666.     Jump LightLoop
  667. }
  668.  
  669.  
  670. // Cell block drip
  671. { BLOCK_DRIP
  672.  
  673.     @SetCurrentFigure Player
  674.     LinkMeToCameras BLK1, BLK2, BLK3, BLK4, BLK5
  675.  
  676.     :top
  677.     Wait 30
  678.     // don't run the drip if we are still reacting from the previous one
  679.     if @IsMyMotion( dripped_on ) then jump top
  680.  
  681.     SuspendWhile @ModifyVarEveryNth( _dp1_frame, 1, 0, 7, 2)
  682.  
  683.     // if we're going to be hit by the drip, then run that code
  684.     if @AmInTrigger( curfig, Drip ) then
  685.         {
  686.         _dp1_frame = 0
  687.         _dp2_frame = 8
  688.         suspend
  689.         _dp2_frame ++
  690.         suspend
  691.         If @SetCurrentFigure(Lex) then @Sound(_blk_drip_head)
  692.         Else @Sound(_blk_drip_head_nursebot)
  693.         Motion dripped_on continue
  694.         SuspendWhile @ModifyVarEveryNth( _dp2_frame, 1, 9, 12, 2)
  695.         }
  696.     else
  697.         {
  698.         SuspendWhile @ModifyVarEveryNth( _dp1_frame, 1, 8, 12, 2 )
  699.         if @IsCurrentCamera(blk1) then @SOUND(_blk_drip_floor, 70)
  700.         else if @IsCurrentCamera(blk2) then @SOUND(_blk_drip_floor, 90)
  701.         }
  702.  
  703.     _dp1_frame = 0
  704.     _dp2_frame = 0
  705.     jump top
  706. }
  707.  
  708. { SetCellOneBars _value
  709.     _cel1_off = _value
  710.     _bars1_on = 1 - _value
  711.  
  712.     if( _value == 0 ) then
  713.         {
  714.         if( @IsProcessValid(_CellOneProcess) == _FALSE ) then
  715.             {
  716.             _CellOneProcess = @Process CellOneBars
  717.             if( @SetCurrentFigure Use_Bot ) then
  718.                 AddAvoidancePoint AvdBar1 110
  719.             }
  720.         }
  721.     else
  722.         {
  723.         KillProcess _CellOneProcess
  724.         _CellOneProcess = _INVALID_PROCESS_ID
  725.         _BR1_FRAME = 0
  726.         if( @SetCurrentFigure Use_Bot ) then
  727.             RemoveAvoidancePoint AvdBar1
  728.         }
  729. }
  730.  
  731. { SetCellThreeBars _value
  732.     _cel3_off = _value
  733.     _bars3_on = 1 - _value
  734.  
  735.     if( _value == 0 ) then
  736.         {
  737.         if( @IsProcessValid(_CellThreeProcess) == _FALSE ) then
  738.             {
  739.             _CellThreeProcess = @Process CellThreeBars
  740.             if( @SetCurrentFigure Use_Bot ) then
  741.                 AddAvoidancePoint AvdBar3 110
  742.             }
  743.         }
  744.     else
  745.         {
  746.         KillProcess _CellThreeProcess
  747.         _CellThreeProcess = _INVALID_PROCESS_ID
  748.         _BR3_FRAME = 0
  749.         if( @SetCurrentFigure Use_Bot ) then
  750.             RemoveAvoidancePoint AvdBar3
  751.         }
  752. }
  753.  
  754. { SetCellFourBars _value
  755.     _cel4_off = _value
  756.     _bars4_on = 1 - _value
  757.  
  758.     if( _value == 0 ) then
  759.         {
  760.         if( @IsProcessValid(_CellFourProcess) == _FALSE ) then
  761.             {
  762.             _CellFourProcess = @Process CellFourBars
  763.             if( @SetCurrentFigure Use_Bot ) then
  764.                 AddAvoidancePoint AvdBar4 110
  765.             }
  766.         }
  767.     else
  768.         {
  769.         KillProcess _CellFourProcess
  770.         _CellFourProcess = _INVALID_PROCESS_ID
  771.         _BR4_FRAME = 0
  772.         if( @SetCurrentFigure Use_Bot ) then
  773.             RemoveAvoidancePoint AvdBar4
  774.         }
  775. }
  776.  
  777.  
  778.  
  779. { CellOneBars
  780.  
  781.     LocalVar _ShortOff
  782.  
  783.     LinkMeToCameras BLK4, CE11, CE12, CE22, CE24
  784.  
  785.     _ShortOff  = _FALSE
  786.  
  787.     suspend
  788.     //@Call SetCellOneBars( _cel1_off )
  789.  
  790.     :top
  791.         // don't run anything if the cellbars have been turned off
  792.         if _cel1_off then
  793.             debug "Evil1"
  794.  
  795.     :LOOP_ON
  796.  
  797.         _bars1_on = 1
  798.  
  799. // Apparently, this was supposed to sync the cell bars to real time.
  800. // However, it did not, so I'm reverting back to the prior code. -KLD
  801.         //SuspendWhile @ModifyVarEveryNth(_Br1_frame, +1, 1, 5, 2)
  802.  
  803.         _BR1_FRAME = 1
  804.         suspend
  805.         _BR1_FRAME = 2
  806.         suspend
  807.         _BR1_FRAME = 3
  808.         suspend
  809.         _BR1_FRAME = 4
  810.         suspend
  811.         _BR1_FRAME = 5
  812.         suspend
  813.  
  814.         LOOP LOOP_ON 6
  815.  
  816.     If _Cell1RepairNeeded Then
  817.         Jump Loop_Off
  818.     else
  819.         Jump Top
  820.  
  821.     :LOOP_OFF
  822.  
  823.         @Sound(_bars_crackle, AVDBAR3)
  824.  
  825.         // Flicker the bars briefly
  826.  
  827.         _BR1_FRAME = 0
  828.         suspend
  829.         _BR1_FRAME = 1
  830.         suspend
  831.         _BR1_FRAME = 0
  832.         suspend
  833.         _BR1_FRAME = 1
  834.         suspend
  835.  
  836.         _bars1_on  = 0
  837.         _BR1_FRAME = 0
  838.         suspend
  839.  
  840.         if( _ShortOff = _FALSE ) then
  841.             {
  842.             wait 60
  843.             _ShortOff = _TRUE
  844.             }
  845.         else
  846.             {
  847.             wait 20
  848.             _ShortOff = _FALSE
  849.             }
  850.  
  851.         _bars1_on  = 1
  852.  
  853.         @Sound(_bars_crackle, AVDBAR3)
  854.  
  855.         // Flicker the bars briefly
  856.  
  857.         _BR1_FRAME = 1
  858.         suspend
  859.         _BR1_FRAME = 0
  860.         suspend
  861.         _BR1_FRAME = 1
  862.         suspend
  863.         _BR1_FRAME = 0
  864.         suspend
  865.  
  866.     Jump top
  867.  
  868. }
  869.  
  870. { CellTwoBars
  871.  
  872.     LinkMeToCameras BLK2, BLK3, CE12, CE21, CE22, CE23, CE24
  873.  
  874.     // NOTE: CELL #2 BARS SHOULD NEVER BE "OFF"... - LRG
  875.     _bars2_on  = 1
  876.  
  877.     :LOOP
  878.  
  879.         // don't flicker as long as the cell-bars are turned off
  880.         if _cel2_off then
  881.             debug "Evil2"
  882.  
  883. // Apparently, this was supposed to sync the cell bars to real time.
  884. // However, it did not, so I'm reverting back to the prior code. -KLD
  885.         //SuspendWhile @ModifyVarEveryNth(_br2_Frame, +1, 1, 5, 2)
  886.  
  887.         _BR2_FRAME = 1
  888.         suspend
  889.         _BR2_FRAME = 2
  890.         suspend
  891.         _BR2_FRAME = 3
  892.         suspend
  893.         _BR2_FRAME = 4
  894.         suspend
  895.         _BR2_FRAME = 5
  896.         suspend
  897.  
  898.     Jump LOOP
  899.  
  900. }
  901.  
  902.  
  903. // NOTE: CELL #3 BARS ARE SOLID UNTIL _BOT_BLOWN = 1  - LRG
  904. { CellThreeBars
  905.  
  906.     LinkMeToCameras BLK1, CE31, CE32, CE33, CE42, CE43
  907.  
  908.     suspend
  909.     //@Call SetCellThreeBars( _cel3_off )
  910.  
  911.     :top
  912.         // don't flicker as long as the cell-bars are turned off
  913.         if _cel3_off then
  914.             debug "Evil3"
  915.  
  916.     :LOOP_ON
  917.  
  918.     // Apparently, this was supposed to sync the cell bars to real time.
  919.     //    However, it did not, so I'm reverting back to the prior code. -KLD
  920.  
  921.     // Leave this commented out.  When this process is killed, we want the
  922.     //    bars to stop flickering period.  Because of ModifyVarEveryNth, we
  923.     //    sometimes have the modifyvar process running, and it won't be
  924.     //    killed when this code-block is killed. -bes
  925.     //SuspendWhile @ModifyVarEveryNth(_br3_Frame, +1, 1, 5, 2)
  926.  
  927.     _BR3_FRAME = 1
  928.     suspend
  929.     _BR3_FRAME = 2
  930.     suspend
  931.     _BR3_FRAME = 3
  932.     suspend
  933.     _BR3_FRAME = 4
  934.     suspend
  935.     _BR3_FRAME = 5
  936.     suspend
  937.  
  938.     LOOP LOOP_ON 6
  939.  
  940.     If( _Cell3RepairNeeded ) then
  941.         {
  942.         If _BOT_BLOWN = 1 then
  943.             {
  944.             Jump LOOP_OFF
  945.             }
  946.         }
  947.  
  948.  
  949.     Jump top
  950.  
  951.     :LOOP_OFF
  952.  
  953.         @Sound(_bars_crackle, AVDBAR3)
  954.  
  955.         // Flicker the bars briefly
  956.  
  957.         _BR3_FRAME = 0
  958.         suspend
  959.         _BR3_FRAME = 1
  960.         suspend
  961.         _BR3_FRAME = 0
  962.         suspend
  963.         _BR3_FRAME = 1
  964.         suspend
  965.  
  966.         _bars3_on  = 0
  967.         _BR3_FRAME = 0
  968.     suspend
  969.  
  970.         // set to 4 seconds (used to be 2) for focus group.
  971.         wait 120
  972.         _bars3_on  = 1
  973.  
  974.         @Sound(_bars_crackle, AVDBAR3)
  975.  
  976.         // Flicker the bars briefly
  977.  
  978.         _BR3_FRAME = 1
  979.         suspend
  980.         _BR3_FRAME = 0
  981.         suspend
  982.         _BR3_FRAME = 1
  983.         suspend
  984.         _BR3_FRAME = 0
  985.         suspend
  986.  
  987.     Jump top
  988.  
  989. }
  990.  
  991. // NOTE: CELL #4 BARS CAN BE TURNED OFF, BUT NEVER FLICKER - LRG
  992. { CellFourBars
  993.  
  994.     LinkMeToCameras BLK1, CE32, CE41, CE42, CE43, BLK7
  995.  
  996. // This should be handles by save/load properly now. -KLD
  997. //      suspend
  998. //      @Call SetCellFourBars( _cel4_off )
  999.  
  1000.     :LOOP
  1001.  
  1002.         // don't flicker the bars if they have been turned off
  1003.         if _cel4_off then
  1004.             debug "Evil4"
  1005.  
  1006. // Apparently, this was supposed to sync the cell bars to real time.
  1007. // However, it did not, so I'm reverting back to the prior code. -KLD
  1008. //              SuspendWhile @ModifyVarEveryNth(_br4_Frame, +1, 1, 5, 2)
  1009.  
  1010.         _BR4_FRAME = 1
  1011.         suspend
  1012.         _BR4_FRAME = 2
  1013.         suspend
  1014.         _BR4_FRAME = 3
  1015.         suspend
  1016.         _BR4_FRAME = 4
  1017.         suspend
  1018.         _BR4_FRAME = 5
  1019.         suspend
  1020.  
  1021.     Jump LOOP
  1022.  
  1023. }
  1024.  
  1025. // This animates the little indicators on the wall in Lex's starting cell
  1026.  
  1027. { CELL3_MON
  1028.  
  1029.     LinkMeToCameras CE31, CE32, CE33
  1030.  
  1031.     @SetCurrentFigure Player
  1032.  
  1033.     :LOOP
  1034.         if( @AmInExtent( CurFig, CE3 ) == 0 ) then
  1035.             {
  1036.             Suspend
  1037.             Jump Loop
  1038.             }
  1039.  
  1040.         if( _Bot_Blown == 1 ) then
  1041.             _Medical_Speed = 10
  1042.             
  1043.         if( _Medical_Speed < 10 && _Medical_Speed > 4 ) then
  1044.             _Medical_Speed -= 1
  1045.  
  1046.         _MED_FRAME = 1
  1047.         Wait _Medical_Speed
  1048.         _MED_FRAME = 2
  1049.         Wait _Medical_Speed
  1050.         _MED_FRAME = 3
  1051.         Wait _Medical_Speed
  1052.         _MED_FRAME = 4
  1053.         Wait _Medical_Speed
  1054.         _MED_FRAME = 5
  1055.         // AVDBNK3 is a waypoint close enough to the actual mon location.
  1056.         @Sound(_pim_beep_5, AVDBNK3)
  1057.         Wait _Medical_Speed
  1058.         _MED_FRAME = 6
  1059.         Wait _Medical_Speed
  1060.  
  1061.     Jump LOOP
  1062. }
  1063.  
  1064. // *** OPTIMIZATION EXAMPLE - LRG ***
  1065.  
  1066. // The below code is no longer used.  I rewrote it for speed (see CELL3_MON
  1067. // above).  I left this as an example to show how to rewrite such
  1068. // procedures.  If/then/elses are MUCH slower in the script as opposed to
  1069. // "unrolling" a loop as was done above.  Remember, the script is basically
  1070. // an "interpreter" rather than a "compiler" (although some pre-compilation
  1071. // is done).  This means that the process of intrepretation takes a LOT of
  1072. // time.  Solution: Keep the VOLUME of code being interpreted low.
  1073. // CELL3_MON averages about 2 lines between suspends.  The code below
  1074. // averages about 13 lines between suspends (including a JUMP).
  1075. // ALSO: Note how three if/then sound lines an be reduced to a single
  1076. // function call thanks to Brendan's expanded @Sound support.  Much faster!
  1077.  
  1078. //{ CellHealthIndicators
  1079. //
  1080. //      :IndicatorStart
  1081. //      If _Med_Frame > 6 then
  1082. //              {
  1083. //              _Med_Frame = 1
  1084. //              }
  1085. //      else
  1086. //              {
  1087. //              _Med_Frame ++
  1088. //              }
  1089. //      If _Med_Frame = 5 then
  1090. //              {
  1091. //              If @IsCurrentCamera(CE31) then @SOUND(_pim_beep_5, 80)
  1092. //              If @IsCurrentCamera(CE32) then @SOUND(_pim_beep_5, 100)
  1093. //              If @IsCurrentCamera(CE33) then @SOUND(_pim_beep_5, 130)
  1094. //              }
  1095. //      Suspend
  1096. //      Jump IndicatorStart
  1097. //
  1098. //}
  1099.  
  1100.  
  1101. // END OF FILE
  1102.  
  1103.