Template:PatchDiff/October 4, 2011 Patch/update/scripts/vscripts/choreo/glados coop.nut

N/A 1 BluePingCount <- 0         N/A 2 BlueBadPingCount <- 0   N/A 3 BlueLastPing <- Time   N/A 4 BlueInPortalTraining <-0   N/A 5 OrangeInPortalTraining <-0   N/A 6 OrangePingCount <- 0          N/A 7 OrangeLastPing <- Time   N/A 8 OrangeBadPingCount <- 0   N/A 9 BluePortalTrainingCounter <- 0   N/A 10 OrangePortalTrainingCounter <- 0   N/A 11 BlueHasGun <-0   N/A 12 OrangeHasGun <-0   N/A 13 CoopStartCalCompleteSet <- 0   N/A 14 BlueInMaze <- 0   N/A 15 OrangeInMaze <- 0   N/A 16 BlueInCrusher <-0   N/A 17 OrangeInCrusher <-0   N/A 18 mp_coop_infinifling_traindeath <- 0   N/A 19 mp_coop_infinifling_traindeath01 <- 0   N/A 20 mp_coop_catapult_wall_introdeath <- 0   N/A 21 mp_coop_wall_blockdeath <- 0   N/A 22 bluetrust <-0   N/A 23 orangetrust <-0   N/A 24 BlueTalk <-0   N/A 25 OrangeTalk <-0   N/A 26 BlueNoTalk <-0   N/A 27 OrangeNoTalk <-0   N/A 28 startdeath <-0   N/A 29 mp_coop_turret_ballcount <-0   N/A 30 InHub2 <-0   N/A 31 teambtstaunts <- 0   N/A 32 GladosInsideTauntCam <- 0   N/A 33 GladosInsideTauntCamCounter <- 1   N/A 34 GladosInsideTauntCamInterval <- 0   N/A 35 GladosInsideTauntCamLastInterval <- 0   N/A 36 OrangeTauntCam <-0   N/A 37 BlueTauntCam <-0   N/A 38 BlueTauntFinaleInterval <-0   N/A 39 OrangeTauntFinaleInterval <-0   N/A 40 LastDeathTime <- 0   N/A 41 LastTauntTime <- 0   N/A 42 BluePingStartTimer <-0   N/A 43 OrangePingStartTimer <-0   N/A 44 BluePingStartDone <- 0   N/A 45 OrangePingStartDone <- 0   N/A 46 //Fire Once   N/A 47 CoopStartBButtonSet <-0   N/A 48 CoopStartButtonSet <-0   N/A 49 CoopStartBoxButtonSet <-0   N/A 50 CoopCrushersBlueCrushset <- 0   N/A 51 CoopCrushersOrangeCrushset <- 0   N/A 52 CoopMazeBlueCrushset <- 0   N/A 53 CoopMazeOrangeCrushset <- 0   N/A 54 InHub2Set <- 0   N/A 55 testcnt <-0   N/A 56 BluePingTraining1 <-0   N/A 57 BluePingTraining2 <-0   N/A 58 OrangePingTraining1 <-0   N/A 59 OrangePingTraining2 <-0   N/A 60 mp_coop_wall_2death <-0   N/A 61 HumanResourceDeath1 <-0   N/A 62 HumanResourceDeath2 <-0   N/A 63 HumanResourceDeath3 <-0   N/A 64 HumanResourceDeath4 <-0   N/A 65 HumanResourceDeath5 <-0   N/A 66 HumanResourceDeath6 <-0   N/A 67 HumanResourceDeath7 <-0   N/A 68 EarlyDeath1 <-0   N/A 69 EarlyDeath2 <-0   N/A 70 EarlyDeath3 <-0   N/A 71 EarlyDeath4 <-0   N/A 72 EarlyDeath5 <-0   N/A 73 Tbeam_enddeathturret <-0   N/A 74 Tbeam_enddeathfall <-0   N/A 75 Tbeam_enddeathcounter <-0   N/A 76 Tbeam_enddeathother <- 0   N/A 77 mp_coop_laser_crusherdeath <-0   N/A 78 mp_coop_turret_wallscount <-0   N/A 79 mp_coop_tbeam_laser_1death1 <-0   N/A 80 mp_coop_tbeam_laser_1death2 <-0   N/A 81 mp_coop_tbeam_redirectdeath <-0   N/A 82 mp_coop_tbeam_drilldeathorange <-0   N/A 83 mp_coop_tbeam_drilldeathblue <-0   N/A 84 mp_coop_tbeam_polaritydeathorange <-0   N/A 85 mp_coop_tbeam_polaritydeathblue <-0   N/A 86 mp_coop_tbeam_polarity3deathorange <-0   N/A 87 mp_coop_tbeam_polarity3deathblue <-0   N/A 88 polarity2whisper <- 0   N/A 89 mp_coop_multifling_1cube <- 0   N/A 90 //ispaused   N/A 91 //IsPlayingBack   N/A 92 //EstimateLength   N/A 93    N/A 94 //debug stuff   N/A 95 debug <- false        //Set true to enable debug block during think function   N/A 96 debugInterval <- 10.00   N/A 97    N/A 98 lastthink <- Time   N/A 99 startBlock <- 0   N/A 100    N/A 101 //Queue of scenes started with GladosPlayVcd   N/A 102 scenequeue <- {}   N/A 103 firedfromqueue <- false   N/A 104    N/A 105 //Map Name   N/A 106 curMapName <- GetMapName   N/A 107    N/A 108 //PitchShifting stuff   N/A 109 pitchShifting <- false   N/A 110 pitchShiftLastThink <- Time   N/A 111 pitchShiftInterval <- 1.0   N/A 112 pitchShiftValue <- 1.0   N/A 113 pitchOverride <- null   N/A 114    N/A 115 //State Flags   N/A 116 stateSlowFieldTraining <- false   N/A 117    N/A 118    N/A 119 //jailbreak specific stuff   N/A 120 if (curMapName=="sp_sabotage_jailbreak_01" || curMapName=="sp_sabotage_jailbreak" || curMapName=="sp_a2_bts1")   N/A 121 {   N/A 122        jailbreakpos <- 0   N/A 123 }   N/A 124    N/A 125    N/A 126 //sp_catapult_fling_sphere_peek specific stuff   N/A 127 if (curMapName=="sp_a2_sphere_peek")   N/A 128 {   N/A 129        peekctr <- 0   N/A 130 }   N/A 131    N/A 132    N/A 133 //Dings   N/A 134 sceneDingOn  <- CreateSceneEntity("scenes/npc/glados_manual/ding_on.vcd")   N/A 135 sceneDingOff <- CreateSceneEntity("scenes/npc/glados_manual/ding_off.vcd")   N/A 136    N/A 137    N/A 138    N/A 139 DoIncludeScript( "choreo/glados_coop_scenetable_include", self.GetScriptScope )   N/A 140 DoIncludeScript( "choreo/glados_coop_scenetable_include_manual", self.GetScriptScope )   N/A 141 DoIncludeScript( "choreo/glados_coop_scenetable_include_manual_dlc1", self.GetScriptScope )   N/A 142    N/A 143    N/A 144 //Co-op sepcific stuff   N/A 145        coopFirstPlayerToGetGun <- 0 //Saves id of first player to pick up portal gun   N/A 146        coopBlue <- 2 //id of blue player   N/A 147        coopOrange <- 1 //id of orange player   N/A 148        coopTalkIDBlue <-1 //Blue id for IsPlayerSpeaking - There's some weirdness where it may not be the same as coopBlue    N/A 149        coopTalkIDOrange <-2 //Orange id for IsPlayerSpeaking - There's some weirdness where it may not be the same as coopOrange   N/A 150        coopWaitingForGetGun <- null //Waiting for the second player to pick up the portal gun   N/A 151        coopRelaxationVaultVoiceMonitor <- false //true = GladosThink should monitor for player speech   N/A 152        coopRelaxationVaultVoiceBlueTicks <- 0 //Number of times GladosThink has detected Blue speaking   N/A 153        coopRelaxationVaultVoiceOrangeTicks <- 0 //Number of times GladosThink has detected Blue speaking   N/A 154        coopRelaxationVaultthreshold <- 20 //number of times in GladosThink that a player has to talk before it is an interruption   N/A 155        coopSilencethreshold <- 1.0 //number of seconds in GladosThink that both players have to remain silent before it is considered a silence   N/A 156        coopSilenceTicks <- 0 //Number of consecutive GladosThink calls during which neither player was speaking   N/A 157        coopSayOnSilence <- 0 //if >0: When coopSilenceTicks>=coopSilencethreshold, GladosPlayVcd(coopSayOnSilence)   N/A 158        coopWaitingToExit <- false   N/A 159 //Co-op Ping Training Stuff   N/A 160        coopPingGameOn <- false   N/A 161        coopPingPlayerTurn <- 0   N/A 162        coopPingTurnNumber <- 0   N/A 163        coopPingNextScene <- null   N/A 164        coopPingNextSceneDelay <- null   N/A 165        coopWrongMovesBlue <- 0   N/A 166        coopWrongMovesOrange <- 0   N/A 167        coopSaidWrongMovesDialog <- false   N/A 168        coopPingsOrange <- 0   N/A 169        coopPingsBlue <- 0   N/A 170        coopPingNoInterrupt <- false   N/A 171        coopTimeSinceTurn <- Time   N/A 172        coopSilenceBlahsPlayed <- 0   N/A 173        coopTriggeredElevator <- false   N/A 174    N/A 175 //Score Stating Stuff   N/A 176        coopScoreToState <- null   N/A 177    N/A 178 // Achievement LIMITED_PORTALS   N/A 179 LIMITED_PORTALS_MAP <- "mp_coop_catapult_wall_intro"        // Map the achievement takes place on. N/A 180 LIMITED_PORTALS_COUNT <- 5                                                               // Max number of portals to make the achievement. N/A 181   N/A 182 // Achievement STAYING_ALIVE   N/A 183 STAYING_ALIVE_SECTION <- 4                                                                // Section the achievement applies to. N/A 184   N/A 185 // Achievement SPEED_RUN_COOP   N/A 186 SPEED_RUN_THRESHOLD <- 60                                                                // Number of seconds a run must be finished in to count. N/A 187 SPEED_RUN_SECTION <- 2                                                                       // Section the achievement applies to. N/A 188 mp_coop_speed_run_time <- 0  N/A 189    N/A 190 function printldebug(arg)   N/A 191 {   N/A 192        if (debug)   N/A 193        {   N/A 194                printl(arg)   N/A 195        }   N/A 196 }   N/A 197    N/A 198    N/A 199 // OnPostSpawn - this is all the initial setup stuff   N/A 200 function OnPostSpawn   N/A 201 {   N/A 202                local i = 0   N/A 203                //assign a unique id to each scene entity (uses SetTeam because that's the only thing available)   N/A 204                foreach (val in SceneTable)   N/A 205                {   N/A 206                        i+=1   N/A 207                        val.vcd.ValidateScriptScope   N/A 208                        val.vcd.SetTeam(i)   N/A 209                        val.index <- i   N/A 210                }                  N/A 211                //Initialize the deferred scene queue   N/A 212                QueueInitialize   N/A 213    N/A 214                //Map specific Spawn stuff   N/A 215                switch (curMapName)   N/A 216                {   N/A 217                        case "sp_a1_wakeup":   N/A 218                                EntFire("@glados","runscriptcode","sp_a1_wakeup_start_map",1.0)   N/A 219                                break   N/A 220                }   N/A 221 }   N/A 222    N/A 223    N/A 224    N/A 225 //Passed the unique team id associated with a scene entity defined in SceneTable, this function returns the correct SceneTable index for that entry   N/A 226 //ex: SceneTableInst = SceneTable[findIndex(team)]   N/A 227 function findIndex(team)   N/A 228 {   N/A 229                local idx, val   N/A 230                foreach (idx, val in SceneTable)   N/A 231                {   N/A 232                        if (val.index == team)   N/A 233                        {   N/A 234                                return idx   N/A 235                        }   N/A 236                }   N/A 237                return null   N/A 238 }   N/A 239    N/A 240 //Passed the unique team id associated with a scene entity defined in SceneTable, this function returns the scene instance that originally fired it. N/A 241 //Unfortunately, if multiple scene instances fire the same vcd, this isn't reliable. Hopefully we can either a) fix that  N/A 242 //or b) not have multiple scene instances use the same vcd (which is currently the case as of 07/19/2010 - efw)   N/A 243 function FindSceneInstanceByTeam(team)   N/A 244 {   N/A 245        local idx, val   N/A 246        local idx2, val2   N/A 247        local inst = null   N/A 248        foreach (idx, val in scenequeue)   N/A 249        {   N/A 250                foreach (idx2, val2 in val.waitFiredVcds)   N/A 251                {   N/A 252                        if (val2 == team)   N/A 253                        {   N/A 254                                inst = val   N/A 255                                break   N/A 256                        }   N/A 257                }   N/A 258                if (inst != null)   N/A 259                        break   N/A 260        }   N/A 261        return inst   N/A 262 }   N/A 263    N/A 264    N/A 265 function SceneCanceled   N/A 266 {   N/A 267        printldebug("========SCENE CANCELLED - CALLING ENTITY: "+findIndex(owninginstance.GetTeam))   N/A 268 }   N/A 269    N/A 270 //If a vcd is tagged to "exit early" (by setting postdelay < 0), this event fires rather than PlayNextScene when the vcd finishes. N/A 271 //SkipOnCompletion has all the functionality of PlayNextScene, except it doesn't actually play the next scene, because the next scene presumably  N/A 272 //already started playing when the vcd exited early. N/A 273 //SkipOnCompletion does, however, evaluate the vcd's SceneTable entry to see if any EntFires need to happen. N/A 274 function SkipOnCompletion  N/A 275 {   N/A 276        printldebug("========SKIPONCOMPLETION CALLING ENTITY: "+findIndex(owninginstance.GetTeam)+" : TIME "+Time)   N/A 277        local team = owninginstance.GetTeam   N/A 278        local inst = FindSceneInstanceByTeam(team)   N/A 279        if (inst != null)   N/A 280        {   N/A 281                inst.deleteFiredVcd(team)   N/A 282                inst.waitVcdCurrent = findIndex(team)   N/A 283                //Are there any EntFires associated with this vcd? N/A 284               if (inst.waitVcdCurrent != null)   N/A 285                {   N/A 286                        if ("fires" in SceneTable[inst.waitVcdCurrent])   N/A 287                        {   N/A 288                                local idx, val   N/A 289                                foreach (idx, val in SceneTable[inst.waitVcdCurrent].fires)   N/A 290                                {   N/A 291                                        if (!("fireatstart" in val))   N/A 292                                        {   N/A 293                                                printldebug(">>>>>>ENT FIRE AT (SKIPCOMPLETION) END: "+val.entity+":"+val.input)   N/A 294                                                EntFire(val.entity,val.input,val.parameter,val.delay)   N/A 295                                        }   N/A 296                                }   N/A 297                        }   N/A 298                }   N/A 299        }   N/A 300 }          N/A 301    N/A 302    N/A 303 function PlayNextScene   N/A 304 {   N/A 305        printldebug("========PLAYNEXTSCENE CALLING ENTITY: "+findIndex(owninginstance.GetTeam)+" : TIME "+Time)   N/A 306        local team = owninginstance.GetTeam   N/A 307        local inst = FindSceneInstanceByTeam(team)   N/A 308        if (inst != null)   N/A 309        {   N/A 310                inst.deleteFiredVcd(team)   N/A 311                inst.waitVcdCurrent = findIndex(team)   N/A 312                PlayNextSceneInternal(inst)   N/A 313        }          N/A 314 }          N/A 315    N/A 316    N/A 317    N/A 318 function PlayNextSceneInternal(inst = null)   N/A 319 //inst = just completed scene   N/A 320 {   N/A 321        local i = 0   N/A 322        local tmp = 0   N/A 323        //printldebug("===================Scene Done!" + i)  N/A 324    N/A 325        //Set the ducking back to the default value   N/A 326        SendToConsole( "snd_ducktovolume 0.55" )   N/A 327    N/A 328        //Are there any "fire at the end" triggers associated with the just completed?   N/A 329        if (inst.waitVcdCurrent != null)   N/A 330        {   N/A 331                if ("fires" in SceneTable[inst.waitVcdCurrent])   N/A 332                {   N/A 333                        local idx, val   N/A 334                        foreach (idx, val in SceneTable[inst.waitVcdCurrent].fires)   N/A 335                        {   N/A 336                                if (!("fireatstart" in val))   N/A 337                                {   N/A 338                                        printldebug(">>>>>>ENT FIRE AT END: "+val.entity+":"+val.input)   N/A 339                                        EntFire(val.entity,val.input,val.parameter,val.delay)   N/A 340                                }   N/A 341                        }   N/A 342                }   N/A 343        }   N/A 344        //Is there another vcd in the scene chain? N/A 345       if (inst.waitNext != null)   N/A 346        {   N/A 347                printldebug("=====There is a next scene: "+inst.waitNext)   N/A 348                if (inst.waitLength == null)   N/A 349                {   N/A 350                        i+=1   N/A 351                        printldebug("===================Ready to play:" + i)   N/A 352                        GladosPlayVcd(inst)   N/A 353                 }          N/A 354                else   N/A 355                {   N/A 356                        inst.waitStartTime = Time   N/A 357                        inst.waiting = 1   N/A 358                }          N/A 359        }   N/A 360        else   N/A 361        {   N/A 362                printldebug("=====No next scene!")   N/A 363                //Remove the instance from the scene list   N/A 364                scenequeue_DeleteScene(inst.index)   N/A 365                //The current scene is over. Check to see if there are any queued scenes. N/A 366               if (QueueCheck)   N/A 367                        return   N/A 368    N/A 369                //Do the ding if nothing's queued and the previous scene requires a ding   N/A 370                if (!inst.waitNoDingOff)   N/A 371                        EntFireByHandle( sceneDingOff, "Start", "", 0.1, null, null )   N/A 372        }   N/A 373 }   N/A 374    N/A 375    N/A 376 //Think function   N/A 377 function GladosThink   N/A 378 {   N/A 379    N/A 380        //Put debug stuff here! N/A 381       if (debug)   N/A 382        {   N/A 383                if (Time-lastthink>debugInterval)   N/A 384                {   N/A 385                        printldebug("===================GladosThink-> " + lastthink)   N/A 386                        lastthink = Time   N/A 387                        QueueDebug   N/A 388                }   N/A 389        }          N/A 390    N/A 391    N/A 392    N/A 393        local idx, val   N/A 394        foreach (idx,val in scenequeue)   N/A 395        {   N/A 396                //Check if current vcd is scheduled to exit early   N/A 397                if (val.waitExitingEarly)   N/A 398                {   N/A 399                        if (Time-val.waitExitingEarlyStartTime >= val.waitExitingEarlyThreshold)   N/A 400                        {   N/A 401                                local team   N/A 402                                val.waitExitingEarly=false   N/A 403                                local curscene = characterCurscene(val.currentCharacter)   N/A 404                                if (curscene!=null)   N/A 405                                {   N/A 406                                        curscene.ValidateScriptScope   N/A 407                                        curscene.GetScriptScope.SkipOnCompletion <- SkipOnCompletion.bindenv(this)   N/A 408                                        curscene.DisconnectOutput("OnCompletion", "PlayNextScene")   N/A 409                                        curscene.DisconnectOutput("OnCompletion", "SkipOnCompletion")   N/A 410                                        curscene.ConnectOutput( "OnCompletion", "SkipOnCompletion" )   N/A 411                                        team = curscene.GetTeam   N/A 412                                        val.waitVcdCurrent = findIndex(team)   N/A 413                                }   N/A 414                                printldebug("====EXITING EARLY!!!!!!!")   N/A 415                                PlayNextSceneInternal(val)   N/A 416                                return   N/A 417                        }   N/A 418                }   N/A 419        }   N/A 420    N/A 421        local tmp   N/A 422        //Check the deferred scene queue   N/A 423        tmp = QueueThink   N/A 424        //Is a queued scene ready to fire? N/A 425       if (tmp != null)   N/A 426        {   N/A 427                        printldebug("===========Forcing a queued Scene!!!!========")   N/A 428                        GladosPlayVcd(tmp,true)   N/A 429                        return   N/A 430        }   N/A 431    N/A 432        foreach (idx,val in scenequeue)   N/A 433        {   N/A 434                //Are we waiting to play another vcd? N/A 435               if (val.waiting == 1)   N/A 436                {   N/A 437                        if (Time-val.waitStartTime >= val.waitLength)   N/A 438                        {   N/A 439                                val.waiting = 0   N/A 440                                GladosPlayVcd(val)   N/A 441                        }   N/A 442                }   N/A 443        }   N/A 444    N/A 445        if (curMapName=="mp_coop_start" &&  BluePingStartDone==1){   N/A 446                local curTime=Time   N/A 447                local BluePingStartInterval = curTime - BluePingStartTimer   N/A 448                if (BluePingStartInterval>20){   N/A 449                        BluePingStartTimer=Time   N/A 450                        GladosPlayVcd(1331)   N/A 451                }   N/A 452        }   N/A 453        if (curMapName=="mp_coop_start" &&  OrangePingStartDone==1){   N/A 454                local curTime=Time   N/A 455                local OrangePingStartInterval = curTime - OrangePingStartTimer   N/A 456                if (OrangePingStartInterval>20){   N/A 457                        OrangePingStartTimer=Time   N/A 458                        GladosPlayVcd(1332)   N/A 459                }                  N/A 460        }   N/A 461    N/A 462        if (GladosInsideTauntCam == 1){   N/A 463                local curTime=Time   N/A 464                local tauntreactionfired = 0   N/A 465                local GladosInsideTauntCamInterval = curTime-GladosInsideTauntCamLastInterval   N/A 466                printldebug("=================================== CAM INTERVAL:"+GladosInsideTauntCamCounter+" - "+GladosInsideTauntCamInterval+" - "+GladosInsideTauntCam)   N/A 467                if (GladosInsideTauntCamInterval>8 || GladosInsideTauntCamCounter==1){   N/A 468                        if (BlueTauntCam==1        && OrangeTauntCam==0){   N/A 469                                if (curTime-BlueTauntFinaleInterval<5){   N/A 470                                        tauntreactionfired = 1   N/A 471                                        GladosInsideTauntCamLastInterval=Time-6   N/A 472                                        GladosPlayVcd(1194)   N/A 473                                }   N/A 474                        }   N/A 475    N/A 476                        if (BlueTauntCam==0        && OrangeTauntCam==1){   N/A 477                                if (curTime-OrangeTauntFinaleInterval<5){   N/A 478                                        tauntreactionfired = 1   N/A 479                                        GladosInsideTauntCamLastInterval=Time-6   N/A 480                                        GladosPlayVcd(1195)   N/A 481                                }   N/A 482                        }   N/A 483    N/A 484                        if (tauntreactionfired == 0){   N/A 485                        switch (GladosInsideTauntCamCounter)   N/A 486                        {   N/A 487                                case 1:   N/A 488                                        GladosPlayVcd(1156)   N/A 489                                        GladosInsideTauntCamCounter=GladosInsideTauntCamCounter+1   N/A 490                                        GladosInsideTauntCamLastInterval=Time   N/A 491                                        // this is where we want to count completing paint_longjump   N/A 492                                        EndSpeedRunTimer   N/A 493                                        break   N/A 494    N/A 495                                case 2:   N/A 496                                        GladosPlayVcd(1166)   N/A 497                                        GladosInsideTauntCamCounter=GladosInsideTauntCamCounter+1   N/A 498                                        GladosInsideTauntCamLastInterval=Time   N/A 499                                        break   N/A 500                                case 3:   N/A 501                                        GladosPlayVcd(1165)   N/A 502                                        GladosInsideTauntCamCounter=GladosInsideTauntCamCounter+1   N/A 503                                        GladosInsideTauntCamLastInterval=Time   N/A 504                                        break   N/A 505                                case 4:   N/A 506                                        GladosPlayVcd(1167)   N/A 507                                        GladosInsideTauntCamCounter=GladosInsideTauntCamCounter+1   N/A 508                                        GladosInsideTauntCamLastInterval=Time   N/A 509                                        break   N/A 510                                case 5:   N/A 511                                        GladosPlayVcd(1168)   N/A 512                                        GladosInsideTauntCamCounter=GladosInsideTauntCamCounter+1   N/A 513                                        GladosInsideTauntCamLastInterval=Time   N/A 514                                        break   N/A 515                                case 6:   N/A 516                                        GladosPlayVcd(1158)   N/A 517                                        GladosInsideTauntCamCounter=GladosInsideTauntCamCounter+1   N/A 518                                        GladosInsideTauntCamLastInterval=Time   N/A 519                                        break   N/A 520                                case 7:   N/A 521                                        GladosPlayVcd(1157)   N/A 522                                        GladosInsideTauntCamCounter=GladosInsideTauntCamCounter+1   N/A 523                                        GladosInsideTauntCamLastInterval=Time   N/A 524                                        break   N/A 525                                case 8:   N/A 526                                        GladosPlayVcd(1169)   N/A 527                                        GladosInsideTauntCamCounter=GladosInsideTauntCamCounter+1   N/A 528                                        GladosInsideTauntCamLastInterval=Time   N/A 529                                        break   N/A 530                                case 9:   N/A 531                                        GladosPlayVcd(1159)   N/A 532                                        GladosInsideTauntCamCounter=GladosInsideTauntCamCounter+1   N/A 533                                        GladosInsideTauntCamLastInterval=Time   N/A 534                                        break   N/A 535                                case 10:   N/A 536                                        GladosPlayVcd(1160)   N/A 537                                        GladosInsideTauntCamCounter=GladosInsideTauntCamCounter+1   N/A 538                                        GladosInsideTauntCamLastInterval=Time   N/A 539                                        break   N/A 540                                case 11:   N/A 541                                        GladosPlayVcd(1164)   N/A 542                                        GladosInsideTauntCamCounter=GladosInsideTauntCamCounter+1   N/A 543                                        GladosInsideTauntCamLastInterval=Time   N/A 544                                        break   N/A 545                                case 12:   N/A 546                                        GladosPlayVcd(1163)   N/A 547                                        GladosInsideTauntCamCounter=1   N/A 548                                        GladosInsideTauntCamLastInterval=Time   N/A 549                                        break   N/A 550                        }   N/A 551                        }   N/A 552    N/A 553                }   N/A 554    N/A 555        }   N/A 556    N/A 557    N/A 558 }   N/A 559    N/A 560 function GladosBlowUpBots   N/A 561 {   N/A 562        // this calls the function in game code   N/A 563        CoopGladosBlowUpBots   N/A 564 }   N/A 565    N/A 566 function GladosEndingTauntCam_Begin{   N/A 567        GladosInsideTauntCam =1   N/A 568 }   N/A 569    N/A 570 function GladosEndingTauntCam_End{   N/A 571        GladosInsideTauntCam =0   N/A 572 }   N/A 573    N/A 574    N/A 575 //Play a vcd from the SceneTable, plus set up next line (if any). N/A 576 //This is the function that should be used to start a scene from inside a map. N/A 577 function GladosPlayVcd(arg,IgnoreQueue = null, caller = null)  N/A 578 //arg==instance        -> Continue playing scene defined by scene class instance arg   N/A 579 //arg==integer        -> Start playing new scene (scene being a chain of vcds) from SceneTable[SceneTableLookup[arg]]   N/A 580 //arg==string                -> Start playing new scene (scene being a chain of vcds) from SceneTable[arg]   N/A 581 //arg==null                        -> Continue playing current scene with next vcd in current chain   N/A 582 //IgnoreQueue                -> true == don't check for queue status (this is used to force a queued vcd to play)   N/A 583 //caller                                -> If passed as an entity, the vcd will have its "target1" set to caller.GetName   N/A 584 {   N/A 585        printldebug("=========GladosPlayVcd Called!=========")          N/A 586        local dingon = false   N/A 587        local inst   N/A 588        local fromqueue = firedfromqueue   N/A 589        firedfromqueue = false   N/A 590        if (curMapName=="mp_coop_start" ){          N/A 591                if (arg==30){          N/A 592                        BluePingStartDone=1   N/A 593                        BluePingStartTimer=Time+15   N/A 594                }   N/A 595                if (arg==32){          N/A 596                        BluePingStartDone=2   N/A 597                        OrangePingStartDone=1   N/A 598                        OrangePingStartTimer=Time+25   N/A 599                }   N/A 600                if (arg==34){          N/A 601                        OrangePingStartDone=2   N/A 602                }   N/A 603        }   N/A 604    N/A 605    N/A 606        if (typeof arg == "instance")   N/A 607        {   N/A 608                inst = arg   N/A 609                arg=inst.waitNext   N/A 610        }   N/A 611        else   N/A 612        {   N/A 613                //If this is a call from the map, look up the integer arg in the scene lookup table. N/A 614               //We need to do this because hammer/the engine can't pass a squirrel script a string, just an integer. N/A 615               //In other words, from a map, @glados.GladosPlayVcd("MyVcd") crashes the game. GladosPlayVcd(16) doesn't.  N/A 616                local sceneStart = 0   N/A 617                if (typeof arg == "integer")   N/A 618                {   N/A 619                        sceneStart = arg   N/A 620                        printldebug("{}{}{}{}{}{}{}{}{}GladosPlayVcd: "+arg)          N/A 621                        arg = SceneTableLookup[arg]   N/A 622                }   N/A 623                else   N/A 624                {   N/A 625                        sceneStart = 0   N/A 626                }   N/A 627                //if SkipIfBusy is present & we're already playing a scene, skip this new scene   N/A 628                if ("skipifbusy" in SceneTable[arg])   N/A 629                {   N/A 630                  if (!("char" in SceneTable[arg])){   N/A 631                          SceneTable[arg].char <- "glados"   N/A 632                  }   N/A 633    N/A 634                        if (characterCurscene(SceneTable[arg].char)!=null)   N/A 635                        {   N/A 636                                return   N/A 637                        }   N/A 638                }   N/A 639                //if queue is present & we're already playing a scene, add scene to queue   N/A 640                 if ("queue" in SceneTable[arg])   N/A 641                 {   N/A 642                         if (IgnoreQueue == null)   N/A 643                        {   N/A 644                                //queue if a specific character is talking   N/A 645                                 if ("queuecharacter" in SceneTable[arg])   N/A 646                                 {   N/A 647                                        if (characterCurscene(SceneTable[arg].queuecharacter)!=null)   N/A 648                                        {   N/A 649                                                 QueueAdd(arg)   N/A 650                                                 return   N/A 651                                         }   N/A 652                                }   N/A 653                                //otherwise, queue if the character associated with the vcd is talking   N/A 654                                else   N/A 655                                {   N/A 656                                        if (!("char" in SceneTable[arg])){   N/A 657                                          SceneTable[arg].char <- "glados"   N/A 658                                  }   N/A 659    N/A 660                                        if (characterCurscene(SceneTable[arg].char)!=null)   N/A 661                                        {   N/A 662                                                 QueueAdd(arg)   N/A 663                                                 return   N/A 664                                         }   N/A 665                                 }          N/A 666                        }                  N/A 667          }   N/A 668          if (!("char" in SceneTable[arg])){   N/A 669                  SceneTable[arg].char <- "glados"   N/A 670          }   N/A 671                 if (scenequeue_AddScene(arg,SceneTable[arg].char) == null)   N/A 672                        return   N/A 673                inst = scenequeue[arg]   N/A 674                inst.waitSceneStart = sceneStart   N/A 675    N/A 676                if ("idle" in SceneTable[arg])   N/A 677                {   N/A 678                        nags_init(inst,arg)   N/A 679                }   N/A 680    N/A 681                //This is a new dialog block, so turn off special processing   N/A 682                dingon=true   N/A 683                pitchShifting = false   N/A 684                //startBlock = Time   N/A 685                if ("noDingOff" in SceneTable[arg])   N/A 686                        inst.waitNoDingOff = true   N/A 687                else   N/A 688                        inst.waitNoDingOff = false          N/A 689                if ("noDingOn" in SceneTable[arg])   N/A 690                        inst.waitNoDingOn = true   N/A 691                else   N/A 692                        inst.waitNoDingOn = false          N/A 693        }   N/A 694    N/A 695        //If this scene is a nag/idle cycle, grab the next line off the stack   N/A 696        if (inst.isNag)   N/A 697        {   N/A 698                //If we're not in a vcd chain, grab the next vcd from the randomized pool   N/A 699                if (!inst.naginchain)   N/A 700                {   N/A 701                        arg = nags_fetch(inst)   N/A 702                }          N/A 703                //if nothing fetched (because the nag has used all the lines and isn't marked as "repeat"), remove this scene   N/A 704                if (arg == null)   N/A 705                {   N/A 706                        scenequeue_DeleteScene(inst.index)   N/A 707                        return   N/A 708                }   N/A 709        }   N/A 710    N/A 711        //Set ducking volume correctly for booming glados audio   N/A 712        SendToConsole( "snd_ducktovolume 0.2" )   N/A 713    N/A 714  //SetDucking( "announcerVOLayer", "announcerVO", 0.01 )   N/A 715  //SetDucking( "gladosVOLayer", "gladosVO", 0.1 )   N/A 716    N/A 717        local preDelay = 0.00   N/A 718        preDelay = EvaluateTimeKey("predelay", SceneTable[arg])   N/A 719        if (fromqueue && "queuepredelay" in SceneTable[arg])   N/A 720        {   N/A 721                preDelay = EvaluateTimeKey("queuepredelay", SceneTable[arg])   N/A 722        }   N/A 723    N/A 724        if ( arg != null )   N/A 725        {   N/A 726    N/A 727                local ltalkover   N/A 728                ltalkover =  "talkover" in SceneTable[arg]   N/A 729    N/A 730                //Cancel any vcd that's already playing   N/A 731                if (!ltalkover)   N/A 732                {   N/A 733                        GladosAllCharactersStopScene   N/A 734                }          N/A 735                else   N/A 736                {   N/A 737                        //characters can't currently talk over themselves   N/A 738                  if (!("char" in SceneTable[arg])){   N/A 739                          SceneTable[arg].char <- "glados"   N/A 740                  }   N/A 741                        GladosCharacterStopScene(SceneTable[arg].char)   N/A 742                }   N/A 743    N/A 744                //Play the initial ding (unless the scene specifically requests no ding)   N/A 745                if (dingon && !inst.waitNoDingOn)   N/A 746                        EntFireByHandle( sceneDingOn, "Start", "", preDelay, null, null )   N/A 747    N/A 748    N/A 749                //Start the new vcd          N/A 750                printldebug("===================Playing:" + arg)   N/A 751          if (!("char" in SceneTable[arg])){   N/A 752                  SceneTable[arg].char <- "glados"   N/A 753          }   N/A 754    N/A 755                inst.currentCharacter = SceneTable[arg].char   N/A 756    N/A 757                //Bind the OnCompletion Event   N/A 758                SceneTable[arg].vcd.ValidateScriptScope   N/A 759                SceneTable[arg].vcd.GetScriptScope.PlayNextScene <- PlayNextScene.bindenv(this)   N/A 760                SceneTable[arg].vcd.DisconnectOutput( "OnCompletion", "PlayNextScene" )   N/A 761                SceneTable[arg].vcd.ConnectOutput( "OnCompletion", "PlayNextScene" )   N/A 762                SceneTable[arg].vcd.ConnectOutput( "OnCanceled", "SceneCanceled" )   N/A 763    N/A 764                //Set the target1 if necessary   N/A 765                if (caller != null)   N/A 766                {   N/A 767                        if (typeof caller == "string")   N/A 768                        {   N/A 769                                EntFireByHandle( SceneTable[arg].vcd, "SetTarget1", caller, 0, null, null )   N/A 770                                printldebug("++++++++++++SETTING TARGET: "+caller)   N/A 771                        }          N/A 772                        else   N/A 773                        {   N/A 774                                EntFireByHandle( SceneTable[arg].vcd, "SetTarget1", caller.GetName, 0, null, null )   N/A 775                        }   N/A 776                }          N/A 777                if ("settarget1" in SceneTable[arg])   N/A 778                {   N/A 779                        EntFireByHandle( SceneTable[arg].vcd, "SetTarget1", SceneTable[arg].settarget1, 0, null, null )   N/A 780                }   N/A 781    N/A 782                inst.waitVcdTeam = SceneTable[arg].index   N/A 783                inst.waitVcdCurrent = arg   N/A 784    N/A 785                inst.addFiredVcd(SceneTable[arg].index)   N/A 786    N/A 787                if (dingon && !inst.waitNoDingOn)   N/A 788                        EntFireByHandle( SceneTable[arg].vcd, "Start", "", preDelay+0.18, null, null )   N/A 789                else          N/A 790                        EntFireByHandle( SceneTable[arg].vcd, "Start", "", preDelay, null, null )   N/A 791    N/A 792    N/A 793                //Does this vcd have a "fire into entities" array? N/A 794               if ("fires" in SceneTable[arg])   N/A 795                {   N/A 796                        local idx, val   N/A 797                        foreach (idx, val in SceneTable[arg].fires)   N/A 798                        {   N/A 799                                if ("fireatstart" in val)   N/A 800                                {   N/A 801                                        printldebug(">>>>>>ENT FIRE AT START: "+val.entity+":"+val.input)   N/A 802                                        EntFire(val.entity,val.input,val.parameter, val.delay)   N/A 803                                }   N/A 804                        }   N/A 805                }   N/A 806    N/A 807                if ("special" in SceneTable[arg])   N/A 808                {   N/A 809                        switch (SceneTable[arg].special)   N/A 810                        {   N/A 811                                case 1: //Block-wide pitch shifting   N/A 812                                        pitchShifting = true   N/A 813                                        break   N/A 814                                case 2: //Speed up   N/A 815                                        if (pitchOverride == null)          N/A 816                                                EntFireByHandle( SceneTable[arg].vcd, "PitchShift", "2.5", 0, null, null )   N/A 817                                        break   N/A 818                                case 3: //Slow down a bit          N/A 819                                        EntFireByHandle( SceneTable[arg].vcd, "PitchShift", "0.9", 0, null, null )   N/A 820                                        break   N/A 821                        }   N/A 822                }   N/A 823                if (pitchOverride!=null)   N/A 824                        EntFireByHandle( SceneTable[arg].vcd, "PitchShift", pitchOverride.tostring, 0, null, null )   N/A 825    N/A 826    //Setup next line (if there is one)   N/A 827    if (SceneTable[arg].next != null || inst.isNag)   N/A 828    {   N/A 829            local pdelay = EvaluateTimeKey("postdelay",SceneTable[arg])   N/A 830    N/A 831            //if this is a nag, use min/max defined in the first entry in the scene   N/A 832            if (inst.isNag)   N/A 833            {   N/A 834                    pdelay = RandomFloat(inst.nagminsecs,inst.nagmaxsecs)   N/A 835            }   N/A 836    N/A 837            if (pdelay<0.00)   N/A 838            {   N/A 839                    if (inst.isNag)   N/A 840                            //If the "next" key != null, it means we're in a vcd chain   N/A 841                            if (SceneTable[arg].next != null)   N/A 842                            {   N/A 843                                    inst.waitNext = SceneTable[arg].next   N/A 844                                    inst.naginchain = true   N/A 845                            }   N/A 846                            else   N/A 847                            {   N/A 848                                    //Otherwise, just slug in the same index (any non-null value would work here, however)   N/A 849                                                inst.waitNext = arg   N/A 850                                    inst.naginchain = false   N/A 851                                        }   N/A 852                    else   N/A 853                                        inst.waitNext = SceneTable[arg].next   N/A 854                                 inst.waitExitingEarly=true   N/A 855                                 inst.waitLength=null   N/A 856                                 inst.waitExitingEarlyStartTime=Time   N/A 857                                //If we're in a nag vcd chain, use the vcds postdelay rather than the nag-wide delay   N/A 858                                //This is because vcd chains generally need to be explicitly timed at the chain level   N/A 859                                //since the vcds are grouped together as a block   N/A 860                                 if (inst.naginchain)   N/A 861                                         pdelay = EvaluateTimeKey("postdelay",SceneTable[arg])   N/A 862                                 inst.waitExitingEarlyThreshold=pdelay*-1   N/A 863                        }   N/A 864                        else   N/A 865                        {   N/A 866                                 inst.waitExitingEarly=false   N/A 867                    if (inst.isNag)   N/A 868                    {   N/A 869                            //If the "next" key != null, it means we're in a vcd chain   N/A 870                            if (SceneTable[arg].next != null)   N/A 871                            {   N/A 872                                    inst.waitNext = SceneTable[arg].next   N/A 873                                    inst.naginchain = true   N/A 874                            }   N/A 875                            else   N/A 876                            {   N/A 877                                    //Otherwise, just slug in the same index (any non-null value would work here, however)   N/A 878                                                inst.waitNext = arg   N/A 879                                    inst.naginchain = false   N/A 880                                        }   N/A 881                                }   N/A 882                    else   N/A 883                    {   N/A 884                                        inst.waitNext = SceneTable[arg].next   N/A 885                                }          N/A 886                                //If we're in a nag vcd chain, use the vcds postdelay rather than the nag-wide delay   N/A 887                                //This is because vcd chains generally need to be explicitly timed at the chain level   N/A 888                                //since the vcds are grouped together as a block   N/A 889                                 if (inst.naginchain)   N/A 890                                         pdelay = EvaluateTimeKey("postdelay",SceneTable[arg])   N/A 891                        }          N/A 892                   inst.waitLength = pdelay   N/A 893    }          N/A 894                else   N/A 895                {   N/A 896                        inst.waitNext = null   N/A 897                        printldebug("===================SCENE END")   N/A 898                }   N/A 899        }          N/A 900 }   N/A 901    N/A 902 function EvaluateTimeKey(keyname, keytable)   N/A 903 {   N/A 904        local ret = null   N/A 905    N/A 906         if (keyname in keytable)   N/A 907         {   N/A 908                 local typ = typeof keytable[keyname]   N/A 909                 if (typ == "array")   N/A 910                 {   N/A 911                         if (keytable[keyname].len != 2)   N/A 912                         {   N/A 913                                printldebug("!!!!!!!!!!!!EVALUATE TIME KEY ERROR: "+keyname+" is an array with a length != 2")                   N/A 914                                return 0.00   N/A 915                         }   N/A 916                         ret = RandomFloat(keytable[keyname][0],keytable[keyname][1])   N/A 917                 }   N/A 918                 else   N/A 919                 {   N/A 920                         ret = keytable[keyname]   N/A 921                 }          N/A 922         }   N/A 923         if (ret == null)   N/A 924                 ret = 0.00   N/A 925        printldebug(">>>>>>>>>EVALUATE TIME KEY: "+keyname+" : "+ret)                   N/A 926         return ret   N/A 927 }   N/A 928    N/A 929    N/A 930 function GladosToggleDebug(arg = null)   N/A 931 {   N/A 932        debug = !debug   N/A 933        if (debug)   N/A 934                printl("======================GLaDOS debug ON")   N/A 935        else   N/A 936                printl("======================GLaDOS debug OFF")   N/A 937        if (arg!=null)   N/A 938                debugInterval = arg   N/A 939 }   N/A 940    N/A 941 function GladosSetPitch(arg)   N/A 942 {   N/A 943        pitchOverride = arg   N/A 944        local curscene = self.GetCurrentScene   N/A 945        if ( curscene != null )          N/A 946                EntFireByHandle( curscene, "PitchShift", pitchOverride.tostring, 0, null, null )   N/A 947 }   N/A 948    N/A 949    N/A 950 //Stops a scene for all characters   N/A 951 function GladosAllCharactersStopScene   N/A 952 {   N/A 953        GladosCharacterStopScene("glados")   N/A 954        GladosCharacterStopScene("wheatley")   N/A 955        GladosCharacterStopScene("cave_body")   N/A 956 }   N/A 957    N/A 958 function characterCurscene(arg)   N/A 959 {   N/A 960        local ret = null, ent = null   N/A 961        switch (arg)   N/A 962        {   N/A 963                case "glados":   N/A 964                case "@glados":   N/A 965                        ent = Entities.FindByName(ent, "@glados")   N/A 966                        break   N/A 967                case "@sphere":   N/A 968                case "wheatley":          N/A 969                case "sphere":   N/A 970                        ent = Entities.FindByName(ent, "@sphere")   N/A 971                        break   N/A 972                case "cave_body":          N/A 973                case "cavebody":          N/A 974                        ent = Entities.FindByName(ent, "@cave_body")   N/A 975                        break   N/A 976        }   N/A 977        if (ent != null)   N/A 978        {   N/A 979                ret = ent.GetCurrentScene   N/A 980        }          N/A 981        return ret   N/A 982 }   N/A 983    N/A 984 //Stops a scene for a particular character   N/A 985 function GladosCharacterStopScene(arg)   N/A 986 {   N/A 987        local ent = null   N/A 988        local curscene = characterCurscene(arg)   N/A 989        if ( curscene != null )   N/A 990        {   N/A 991                EntFireByHandle( curscene, "Cancel", "", 0, null, null )   N/A 992        }   N/A 993 }   N/A 994    N/A 995 //Turns off current Glados speech   N/A 996 function GladosStopTalking   N/A 997 {   N/A 998        local curscene = self.GetCurrentScene   N/A 999        pitchOverride = null   N/A 1000        waitNext = null   N/A 1001        waitLength = null   N/A 1002        if ( curscene != null )          N/A 1003                        EntFireByHandle( curscene, "Cancel", "", 0, null, null )   N/A 1004 }   N/A 1005    N/A 1006 //Turns off current Glados speech if the scene # passed as arg is currently playing   N/A 1007 function GladosStopScene(arg)   N/A 1008 {   N/A 1009        if (waitSceneStart == arg)   N/A 1010        {   N/A 1011                local curscene = self.GetCurrentScene   N/A 1012                pitchOverride = null   N/A 1013                waiting = 0   N/A 1014                waitNext = null   N/A 1015                waitLength = null   N/A 1016                if ( curscene != null )          N/A 1017                        EntFireByHandle( curscene, "Cancel", "", 0, null, null )   N/A 1018        }                  N/A 1019 }   N/A 1020    N/A 1021 //Slowfield functions   N/A 1022 function GladosEndSlowFieldTraining   N/A 1023 {   N/A 1024        stateSlowFieldTraining = false   N/A 1025        GladosStopTalking   N/A 1026 }   N/A 1027    N/A 1028 function GladosStartSlowFieldTraining   N/A 1029 {   N/A 1030        stateSlowFieldTraining = true   N/A 1031        GladosPlayVcd(40)   N/A 1032 }   N/A 1033    N/A 1034 function GladosSlowFieldOn   N/A 1035 {   N/A 1036        if (stateSlowFieldTraining)   N/A 1037                GladosPlayVcd(41)   N/A 1038 }   N/A 1039    N/A 1040 function GladosSlowFieldOff   N/A 1041 {   N/A 1042        if (stateSlowFieldTraining)   N/A 1043                GladosPlayVcd(40)   N/A 1044 }   N/A 1045 //End of Slowfield functions   N/A 1046    N/A 1047 //Special Chamber Processing   N/A 1048 function GladosRelaxationVaultPowerUp   N/A 1049 {   N/A 1050        EntFire("open_portal_relay","Trigger","", 0.00)   N/A 1051 }   N/A 1052    N/A 1053    N/A 1054 //--   N/A 1055 //Queue Functions   N/A 1056 //--   N/A 1057    N/A 1058 Queue <- []   N/A 1059    N/A 1060 //Initialize the queue   N/A 1061 function QueueInitialize   N/A 1062 {   N/A 1063        Queue.clear   N/A 1064 }   N/A 1065    N/A 1066 //Add a scene to the queue   N/A 1067 function QueueAdd(arg)   N/A 1068 {   N/A 1069        Queue.append( { item = arg added = Time })   N/A 1070        if (arg in SceneTable)   N/A 1071        {   N/A 1072                 if ("queueforcesecs" in SceneTable[arg])   N/A 1073                 {   N/A 1074                         Queue[Queue.len-1].queueforcesecs <- SceneTable[arg].queueforcesecs   N/A 1075                 }   N/A 1076                 if ("queuetimeout" in SceneTable[arg])   N/A 1077                 {   N/A 1078                         Queue[Queue.len-1].queuetimeout <- SceneTable[arg].queuetimeout   N/A 1079                 }   N/A 1080                 if ("queuepredelay" in SceneTable[arg])   N/A 1081                 {   N/A 1082                         Queue[Queue.len-1].queuepredelay <- SceneTable[arg].queuepredelay   N/A 1083                 }   N/A 1084    N/A 1085        }   N/A 1086 }   N/A 1087    N/A 1088 //Returns number of items in the queue   N/A 1089 function QueueLen   N/A 1090 {   N/A 1091        return Queue.len   N/A 1092 }   N/A 1093    N/A 1094    N/A 1095 //Fetch the next scene in the queue   N/A 1096 function QueueGetNext   N/A 1097 {   N/A 1098        local ret,l   N/A 1099        ret = null   N/A 1100        l=QueueLen   N/A 1101        if (l>0)   N/A 1102        {   N/A 1103                ret = Queue[l-1].item   N/A 1104                Queue.remove(l-1)   N/A 1105        }   N/A 1106        return ret   N/A 1107 }   N/A 1108    N/A 1109 function QueueDebug   N/A 1110 {   N/A 1111        printldebug("===================  items in queue-> " + Queue.len)   N/A 1112 }   N/A 1113    N/A 1114 //General stuff called from GladosThink   N/A 1115 function QueueThink   N/A 1116 {   N/A 1117        local ret,t,index   N/A 1118        if (QueueLen==0)   N/A 1119        {   N/A 1120                return null   N/A 1121        }          N/A 1122    N/A 1123        t=Time   N/A 1124        //Check to see if any queued scenes timed out   N/A 1125        for (index = QueueLen; index > 0; index -= 1)   N/A 1126        {   N/A 1127                 if ("queuetimeout" in Queue[index-1])   N/A 1128                 {   N/A 1129                         if (t-Queue[index-1].added > Queue[index-1].queuetimeout)   N/A 1130                         {   N/A 1131                                 Queue.remove(index-1)   N/A 1132                         }   N/A 1133                 }   N/A 1134        }   N/A 1135    N/A 1136        //Check to see if any queued scenes should force fire   N/A 1137        foreach (index, scene in Queue)   N/A 1138        {   N/A 1139                 if ("queueforcesecs" in scene)   N/A 1140                 {   N/A 1141                         if (t-scene.added >scene.queueforcesecs)   N/A 1142                         {   N/A 1143                                 ret = scene.item   N/A 1144                                 Queue.remove(index)   N/A 1145                                 return ret   N/A 1146                         }   N/A 1147                 }   N/A 1148        }   N/A 1149        return null   N/A 1150 }   N/A 1151    N/A 1152 //Debug testbed function   N/A 1153 function QueueTest   N/A 1154 {   N/A 1155        local a = []   N/A 1156        for(local i=0;i<10;i+=1)   N/A 1157        {   N/A 1158                a.append(RandomInt(1,100))   N/A 1159                printldebug(">>>>>> " + i + " : " + a[i])   N/A 1160        }   N/A 1161        for (local i = a.len; i>0; i-=1)   N/A 1162        {   N/A 1163                if (a[i-1]<50)   N/A 1164                        a.remove(i-1)   N/A 1165        }   N/A 1166        foreach (index, n in a)   N/A 1167        {   N/A 1168                printldebug(">>>>>> " + index + " : " + a[index])   N/A 1169        }   N/A 1170 }   N/A 1171    N/A 1172 //Delete a single item from the queue   N/A 1173 function QueueDeleteItem(item)   N/A 1174 {   N/A 1175        if (QueueLen==0)   N/A 1176        {   N/A 1177                return false   N/A 1178        }          N/A 1179        foreach (index, scene in Queue)   N/A 1180        {   N/A 1181                if (scene.item == item)   N/A 1182                {   N/A 1183                                 Queue.remove(index)   N/A 1184                                 return true   N/A 1185                 }   N/A 1186        }   N/A 1187        return false   N/A 1188 }   N/A 1189    N/A 1190    N/A 1191 //Check to see if there's a Queued scene ready to go. If so, fire it! (and return true)  N/A 1192 function QueueCheck   N/A 1193 {   N/A 1194        local tmp   N/A 1195        if (QueueLen>0)   N/A 1196        {   N/A 1197                tmp=QueueGetNext   N/A 1198                if (tmp != null)   N/A 1199                {   N/A 1200                        firedfromqueue = true   N/A 1201                        GladosPlayVcd(tmp,true)   N/A 1202                        //GladosPlayVcd(tmp)   N/A 1203                        return true   N/A 1204                }   N/A 1205        }   N/A 1206        return false   N/A 1207 }   N/A 1208    N/A 1209 //--   N/A 1210 //End of Queue Functions   N/A 1211 //--   N/A 1212    N/A 1213 //--   N/A 1214 //sp_sabotage_jailbreak specific functions   N/A 1215 //--   N/A 1216    N/A 1217 function jailbreak_alert(arg)   N/A 1218 {   N/A 1219        jailbreakpos =arg   N/A 1220        printldebug("==========JAILBREAK ALERT "+arg)   N/A 1221 }   N/A 1222    N/A 1223 function jailbreak_whoah_speech   N/A 1224 {   N/A 1225        if (jailbreakpos == 0)   N/A 1226        {   N/A 1227                GladosPlayVcd(303)   N/A 1228        }   N/A 1229        else   N/A 1230        {   N/A 1231                GladosPlayVcd(302)   N/A 1232        }   N/A 1233 }   N/A 1234    N/A 1235    N/A 1236 //--   N/A 1237 //sp_sabotage_darkness specific functions   N/A 1238 //--   N/A 1239    N/A 1240    N/A 1241 function PlayGhostStory   N/A 1242 {   N/A 1243        GladosPlayVcd(445)   N/A 1244 }   N/A 1245    N/A 1246 function PlaySmellyHumansOne   N/A 1247 {   N/A 1248        GladosPlayVcd(446)   N/A 1249 }   N/A 1250    N/A 1251 function PlaySmellyHumansTwo   N/A 1252 {   N/A 1253        GladosPlayVcd(447)   N/A 1254 }   N/A 1255    N/A 1256 function PlaySmellyHumansThree   N/A 1257 {   N/A 1258        GladosPlayVcd(448)   N/A 1259 }   N/A 1260    N/A 1261 function PlaySmellyHumansFour   N/A 1262 {   N/A 1263        GladosPlayVcd(449)   N/A 1264 }   N/A 1265    N/A 1266    N/A 1267 //--   N/A 1268 //Glados Battle specific functions   N/A 1269 //--   N/A 1270    N/A 1271 function sp_sabotage_glados_specials(arg)   N/A 1272 {   N/A 1273        switch (arg)   N/A 1274        {   N/A 1275                case 1:   N/A 1276                        SendToConsole( "scene_playvcd npc/sphere03/fgb_ready_glados06")   N/A 1277                        break   N/A 1278                case 2:   N/A 1279                        //SendToConsole( "scene_playvcd npc/sphere03/gladosbattle_pre09")   N/A 1280                        SendToConsole( "scene_playvcd npc/sphere03/fgb_pull_me_out01")   N/A 1281                        break   N/A 1282        }   N/A 1283 }   N/A 1284    N/A 1285 glados_gibbering <- false   N/A 1286 glados_gibbering_start <- Time   N/A 1287 glados_gibbering_next <- 0.00   N/A 1288 glados_gibbering_times <- {}   N/A 1289    N/A 1290 glados_gibbering_times[1] <- 0.7   N/A 1291 glados_gibbering_times[2] <- 1.37   N/A 1292 glados_gibbering_times[3] <- 1.22   N/A 1293 glados_gibbering_times[4] <- 1.27   N/A 1294 glados_gibbering_times[5] <- 5.29   N/A 1295 glados_gibbering_times[6] <- 4.15   N/A 1296 glados_gibbering_times[7] <- 3.35   N/A 1297    N/A 1298    N/A 1299    N/A 1300 function sp_sabotage_glados_start_gibberish   N/A 1301 {   N/A 1302        //gibberish is off for now   N/A 1303        //glados_gibbering = true   N/A 1304        glados_gibbering_start = Time   N/A 1305        glados_gibbering_next = 0.00   N/A 1306 }   N/A 1307    N/A 1308 function sp_sabotage_glados_stop_gibberish   N/A 1309 {   N/A 1310        glados_gibbering = false   N/A 1311 }   N/A 1312    N/A 1313 function sp_sabotage_glados_gibberish   N/A 1314 {   N/A 1315        local i = RandomInt(1,7)   N/A 1316        if (Time - glados_gibbering_start > glados_gibbering_next)   N/A 1317        {   N/A 1318                SendToConsole( "scene_playvcd npc/glados/sp_sabotage_glados_gibberish0"+i)   N/A 1319                glados_gibbering_start = Time   N/A 1320                //glados_gibbering_next = RandomFloat(3.5, 5.0)   N/A 1321                glados_gibbering_next = glados_gibbering_times[i]   N/A 1322        }          N/A 1323 }   N/A 1324    N/A 1325    N/A 1326    N/A 1327 // ==============================   N/A 1328 // player starts vault trap   N/A 1329 // ==============================   N/A 1330 function VaultTrapStart   N/A 1331 {   N/A 1332        GladosPlayVcd(-50)   N/A 1333 }   N/A 1334    N/A 1335 // ==============================   N/A 1336 // player begins moving in relaxation vault   N/A 1337 // ==============================   N/A 1338 function VaultTrapStartMoving   N/A 1339 {   N/A 1340        GladosPlayVcd(-53)   N/A 1341 }   N/A 1342    N/A 1343 // ==============================   N/A 1344 // turrets are on the ground and begin their scene   N/A 1345 // ==============================   N/A 1346 function TurretScene   N/A 1347 {   N/A 1348        GladosPlayVcd(-700)   N/A 1349 }   N/A 1350    N/A 1351 // ==============================   N/A 1352 // ==============================   N/A 1353 function TurretDeathReactionDialog   N/A 1354 {   N/A 1355        GladosPlayVcd(-57)   N/A 1356        //gladosbattle_pre_05 // my turrets! N/A 1357       //gladosbattle_pre_06 // oh, you were busy back there   N/A 1358        //gladosbattle_pre_17 // i suppose we could just sit here and glare ... but i have a better idea   N/A 1359 }   N/A 1360    N/A 1361    N/A 1362    N/A 1363 // ==============================   N/A 1364 // ==============================   N/A 1365 function WheatleyBouncingDownTubeDialog   N/A 1366 {   N/A 1367        // play various "ouch.. oof... ow..." lines here  N/A 1368        // play glados dialog responding to wheatley falling. "...sigh..." N/A 1369 }  N/A 1370    N/A 1371    N/A 1372 // ==============================   N/A 1373 // ==============================   N/A 1374 function WheatleyLandsInChamberDialog   N/A 1375 {   N/A 1376        GladosPlayVcd(-61)   N/A 1377        printldebug("==========HELLO!!!!!!!!!!!!!!!!!!!!!")   N/A 1378        //wheatley - gladosbattle_pre01 // Hello! N/A 1379       //gladosbattle_pre_09 // i hate you so much   N/A 1380 }   N/A 1381    N/A 1382 // ==============================   N/A 1383 // ==============================   N/A 1384 function CoreDetectedDialog   N/A 1385 {   N/A 1386        //announcer - gladosbattle02 // warning: core corrupted   N/A 1387        //glados - gladosbattle_xfer04 // that's funny i don't feel corrupted. in fact i feel pretty good  N/A 1388        //announcer - gladosbattle03 // alternate core detected   N/A 1389        //wheatley pre05  // ah that's me they're talking about! N/A 1390       //announcer - gladosbattle03 // to initiate a core transfer deposit core in receptacle   N/A 1391        //ent_fire "deploy_core_receptacle_relay" trigger // deploys the core receptacle   N/A 1392        //glados - gladosbattle_xfer05 // core transfer? N/A 1393       //glados - gladosbattle_xfer06 // oh you are kidding me   N/A 1394    N/A 1395        // ********************************************************************************   N/A 1396        // ********************************************************************************   N/A 1397        // TODO - NAG: NEED NAG FOR 'INSERT CORE' TO PLAY UNTIL WheatleyCoreSocketed GETS CALLED   N/A 1398        // ********************************************************************************   N/A 1399        // ********************************************************************************   N/A 1400 }   N/A 1401    N/A 1402    N/A 1403 // ==============================   N/A 1404 // ==============================   N/A 1405 function WheatleyCoreSocketed   N/A 1406 {   N/A 1407        // ********************************************************************************   N/A 1408        // ********************************************************************************   N/A 1409        // TODO - NAG:  END 'INSERT CORE' NAG HERE   N/A 1410        // ********************************************************************************   N/A 1411        // ********************************************************************************   N/A 1412    N/A 1413        GladosPlayVcd(-71) // announcer - substitute core accepted. core, are you willing to start the procedure? N/A 1414   N/A 1415        // ********************************************************************************   N/A 1416        // ********************************************************************************   N/A 1417        // TODO - NAG:  BEGIN 'PRESS BUTTON' NAG HERE   N/A 1418        // ********************************************************************************   N/A 1419        // ********************************************************************************   N/A 1420 }   N/A 1421    N/A 1422 // ==============================   N/A 1423 //        called when the player reaches a catapult or enters the room to press stalemate button   N/A 1424 // ==============================   N/A 1425 function StalemateAssociateNotSoFast   N/A 1426 {   N/A 1427        GladosPlayVcd(-84)   N/A 1428 }   N/A 1429    N/A 1430    N/A 1431 // ==============================   N/A 1432 // ==============================   N/A 1433 function CoreTransferInitiated   N/A 1434 {   N/A 1435        // ********************************************************************************   N/A 1436        // ********************************************************************************   N/A 1437        // TODO - NAG:  END 'PRESS BUTTON' NAG HERE   N/A 1438        // ********************************************************************************   N/A 1439        // ********************************************************************************   N/A 1440    N/A 1441        GladosPlayVcd(-88) //Stalemate Resolved. Core Transfer Initiated. N/A 1442 }  N/A 1443    N/A 1444 // ==============================   N/A 1445 // ==============================   N/A 1446 function WheatleyCoreTransferStart   N/A 1447 {   N/A 1448        GladosPlayVcd(-4) // Here I go! N/A 1449 }  N/A 1450    N/A 1451 // ==============================   N/A 1452 // ==============================   N/A 1453 function PitHandsGrabGladosHead   N/A 1454 {   N/A 1455        GladosPlayVcd(-89) // Get your hands off me! N/A 1456 }  N/A 1457    N/A 1458 // ==============================   N/A 1459 // ==============================   N/A 1460 function PullGladosIntoPit   N/A 1461 {   N/A 1462        GladosPlayVcd(-90) // CHELL! STOP THIS! I AM YOUR MOTHER! N/A 1463 }  N/A 1464    N/A 1465 // ==============================   N/A 1466 // ==============================   N/A 1467 function CoreTransferCompleted   N/A 1468 {   N/A 1469        GladosPlayVcd(-9)  // Wow! Check ME out, Partner! .. Look how small you are! N/A 1470 }  N/A 1471    N/A 1472 // ==============================   N/A 1473 // ==============================   N/A 1474 function PlayerEnteredElevator   N/A 1475 {   N/A 1476        GladosPlayVcd(-13) // Glados: Don't do this...   N/A 1477 }   N/A 1478    N/A 1479    N/A 1480 // ==============================   N/A 1481 // ==============================   N/A 1482 function DialogDuringPotatosManufacture   N/A 1483 {   N/A 1484        GladosPlayVcd(-33)   N/A 1485 }   N/A 1486    N/A 1487 // ==============================   N/A 1488 // ==============================   N/A 1489 function PotatosPresentation   N/A 1490 {   N/A 1491        GladosPlayVcd(-34)   N/A 1492 }   N/A 1493    N/A 1494 // ==============================   N/A 1495 // ==============================   N/A 1496 function ElevatorMoronScene   N/A 1497 {   N/A 1498        GladosPlayVcd(-37)   N/A 1499 }   N/A 1500    N/A 1501 // ==============================   N/A 1502 // ==============================   N/A 1503 function ElevatorConclusion   N/A 1504 {   N/A 1505        GladosPlayVcd(-44)   N/A 1506 }   N/A 1507    N/A 1508    N/A 1509 //--   N/A 1510 //sp_sabotage_factory functions   N/A 1511 //--   N/A 1512    N/A 1513 function sabotage_factory_WatchTheLine   N/A 1514 {   N/A 1515        GladosPlayVcd(441)   N/A 1516 }   N/A 1517    N/A 1518 function sabotage_factory_ReachedHackingSpot   N/A 1519 {   N/A 1520        GladosPlayVcd(442)   N/A 1521 }   N/A 1522    N/A 1523 function sabotage_factory_PlayerReachedWheatley   N/A 1524 {   N/A 1525        WheatleyStopNag   N/A 1526        GladosPlayVcd(443)   N/A 1527 }   N/A 1528    N/A 1529 function sabotage_factory_PlayerReachedExitDoor   N/A 1530 {   N/A 1531        WheatleyStopNag   N/A 1532        GladosPlayVcd(444)   N/A 1533 }          N/A 1534    N/A 1535    N/A 1536 //--   N/A 1537 //sp_sabotage_factory - Science Fair functions   N/A 1538 //--   N/A 1539 function ScienceFairGoingTheRightWay   N/A 1540 {   N/A 1541        GladosPlayVcd( -100 )   N/A 1542 }   N/A 1543    N/A 1544 function ScienceFairBringDaughter   N/A 1545 {   N/A 1546        GladosPlayVcd( -101 )   N/A 1547 }   N/A 1548    N/A 1549 function JustToReassureYou   N/A 1550 {   N/A 1551        GladosPlayVcd( -102 )   N/A 1552 }   N/A 1553    N/A 1554 function DefinitelySureThisWay   N/A 1555 {   N/A 1556        GladosPlayVcd( -103 )   N/A 1557 }   N/A 1558    N/A 1559    N/A 1560 //--   N/A 1561 //sp_catapult_fling_sphere_peek functions   N/A 1562 //--   N/A 1563    N/A 1564 function sp_catapult_fling_sphere_peek   N/A 1565 {   N/A 1566                switch (peekctr)   N/A 1567                {   N/A 1568                        case 0:   N/A 1569                                GladosPlayVcd(335)   N/A 1570                                break   N/A 1571                        case 2:   N/A 1572                                GladosPlayVcd(362)   N/A 1573                                break   N/A 1574                        case 4:   N/A 1575                                GladosPlayVcd(363)   N/A 1576                                break   N/A 1577                }          N/A 1578                peekctr+=1   N/A 1579 }   N/A 1580    N/A 1581    N/A 1582 //--   N/A 1583 //New test functions   N/A 1584 //--   N/A 1585 function GladosTest1(arg)   N/A 1586 {   N/A 1587        foreach (index, scene in arg)   N/A 1588        {   N/A 1589                if (scene.item)   N/A 1590                {   N/A 1591                        arg.remove(index)   N/A 1592                }   N/A 1593        }   N/A 1594 }   N/A 1595    N/A 1596    N/A 1597 //--   N/A 1598 //Scene Queue Functions START   N/A 1599 //--   N/A 1600    N/A 1601 class scene {   N/A 1602        //constructor   N/A 1603        constructor(a, caller)   N/A 1604        {   N/A 1605                index = a   N/A 1606                owner = caller   N/A 1607                currentCharacter = ""   N/A 1608                waitSceneStart = 0 //1 means we're waiting for the current vcd to finish so we can play the next vcd in the chain   N/A 1609                waiting = 0    N/A 1610                waitVcdCurrent = null   N/A 1611                waitStartTime = Time   N/A 1612                waitLength = Time   N/A 1613                waitNext = null   N/A 1614                waitExitingEarly = false   N/A 1615                waitExitingEarlyStartTime = Time   N/A 1616                waitExitingEarlyThreshold = 0.00 //How many seconds sould the VCD play before moving on to the next one   N/A 1617                waitNoDingOff = false   N/A 1618                waitNoDingOn = false   N/A 1619                waitVcdTeam = -1   N/A 1620                waitFiredVcds = []   N/A 1621                nagminsecs = 0   N/A 1622                nagmaxsecs = 0   N/A 1623                nags = []   N/A 1624                isNag = false   N/A 1625                nagpool = []   N/A 1626                naglastfetched = null   N/A 1627                nagrandom = false   N/A 1628                nagrandomonrepeat = false   N/A 1629                nagtimeslistcompleted = 0   N/A 1630                nagrepeat = false   N/A 1631                naginchain = false   N/A 1632        }   N/A 1633    N/A 1634        function nagsClear   N/A 1635        {   N/A 1636                naglastfetched = null   N/A 1637                nags.clear   N/A 1638        }   N/A 1639    N/A 1640        function nagpoolClear   N/A 1641        {   N/A 1642                nagpool.clear   N/A 1643        }   N/A 1644    N/A 1645    N/A 1646        function addFiredVcd(team)   N/A 1647        {   N/A 1648                waitFiredVcds.append(team)   N/A 1649        }   N/A 1650    N/A 1651        function deleteFiredVcd(team)   N/A 1652        {   N/A 1653                local idx, val   N/A 1654                local fnd = null   N/A 1655                foreach (idx, val in waitFiredVcds)   N/A 1656                {   N/A 1657                        if (val == team)   N/A 1658                        {   N/A 1659                                fnd = idx   N/A 1660                                break   N/A 1661                        }   N/A 1662                }          N/A 1663                if (fnd != null)   N/A 1664                {   N/A 1665                        waitFiredVcds.remove(fnd)   N/A 1666                }   N/A 1667        }   N/A 1668    N/A 1669    N/A 1670        //property   N/A 1671        index = 0;   N/A 1672        owner = null;   N/A 1673        currentCharacter = "";   N/A 1674        waitSceneStart = 0; //1 means we're waiting for the current vcd to finish so we can play the next vcd in the chain   N/A 1675        waiting = 0;    N/A 1676        waitVcdCurrent = null; //SceneTable index of last launched vcd   N/A 1677        waitStartTime = 0;   N/A 1678        waitLength = 0;   N/A 1679        waitNext = null;   N/A 1680        waitExitingEarly = false;   N/A 1681        waitExitingEarlyStartTime = 0;   N/A 1682        waitExitingEarlyThreshold = 0.00; //How many seconds sould the VCD play before moving on to the next one   N/A 1683        waitNoDingOff = false;   N/A 1684        waitNoDingOn = false;   N/A 1685        waitFires = [];   N/A 1686        waitVcdTeam = -1;   N/A 1687        waitFiredVcds = [];   N/A 1688        isNag = false;   N/A 1689        nags = [];   N/A 1690        nagpool = [];   N/A 1691        nagminsecs = 0;   N/A 1692        nagmaxsecs = 0;   N/A 1693        naglastfetched = null;   N/A 1694        nagrandom = false;   N/A 1695        nagrandomonrepeat = false;   N/A 1696        nagtimeslistcompleted = 0;   N/A 1697        nagrepeat = false;   N/A 1698        naginchain = false;   N/A 1699 }   N/A 1700    N/A 1701    N/A 1702 function scenequeue_AddScene(arg,char)   N/A 1703 {   N/A 1704        local idx, val,delme   N/A 1705        delme=null   N/A 1706        foreach (idx, val in scenequeue)   N/A 1707        {   N/A 1708                if (SceneTable[idx].char==char)   N/A 1709                {   N/A 1710                        delme = idx   N/A 1711                }   N/A 1712                if (idx == arg)   N/A 1713                {   N/A 1714                        printldebug(">>>>>>>>>>Scene "+arg+" is already in the queue")   N/A 1715                        return null   N/A 1716                }   N/A 1717        }   N/A 1718        if (delme != null)   N/A 1719        {   N/A 1720                printldebug(">>>>>>>>>>DELETING SCENE "+delme)   N/A 1721                scenequeue_DeleteScene(delme)   N/A 1722        }   N/A 1723        scenequeue[arg] <- scene(arg, this)   N/A 1724        scenequeue_Dump   N/A 1725        return scenequeue[arg]   N/A 1726 }   N/A 1727    N/A 1728 function scenequeue_DeleteScene(arg)   N/A 1729 {   N/A 1730        local idx, val   N/A 1731        foreach (idx, val in scenequeue)   N/A 1732        {   N/A 1733                if (idx == arg)   N/A 1734                {   N/A 1735                        printldebug(">>>>>>>>>>Scene "+arg+" deleted!")   N/A 1736                        delete scenequeue[arg]   N/A 1737                        return true   N/A 1738                }   N/A 1739        }   N/A 1740        return null   N/A 1741 }   N/A 1742    N/A 1743 function scenequeue_Dump   N/A 1744 {   N/A 1745    N/A 1746        printldebug(">>>>>>>>>>Scene Dump at "+Time)   N/A 1747        foreach (idx, val in scenequeue)   N/A 1748        {   N/A 1749                printldebug(">>>>>>>>>>Scene "+idx+" ADDED at "+val.waitStartTime+" Type "+ typeof val)   N/A 1750        }          N/A 1751 }   N/A 1752    N/A 1753 //--   N/A 1754 //Scene Queue Functions END   N/A 1755 //--   N/A 1756    N/A 1757 //--   N/A 1758 //Nag Table Functions START   N/A 1759 //--   N/A 1760    N/A 1761 function nags_init(inst,scenetableentry)   N/A 1762 {   N/A 1763        local i = 0   N/A 1764        inst.nagsClear   N/A 1765        if ("idleminsecs" in SceneTable[scenetableentry])   N/A 1766        {   N/A 1767                inst.nagminsecs = SceneTable[scenetableentry].idleminsecs   N/A 1768                if ("idlemaxsecs" in SceneTable[scenetableentry])   N/A 1769                {   N/A 1770                        inst.nagmaxsecs = SceneTable[scenetableentry].idlemaxsecs   N/A 1771                }   N/A 1772                else   N/A 1773                {   N/A 1774                        inst.nagmaxsecs = inst.nagminsecs   N/A 1775                }   N/A 1776        }   N/A 1777    N/A 1778        if ("idlerandomonrepeat" in SceneTable[scenetableentry])   N/A 1779        {   N/A 1780                inst.nagrandomonrepeat = true   N/A 1781        }   N/A 1782    N/A 1783        if ("idlerepeat" in SceneTable[scenetableentry])   N/A 1784        {   N/A 1785                inst.nagrepeat = true   N/A 1786        }   N/A 1787    N/A 1788        if ("idlerandom" in SceneTable[scenetableentry])   N/A 1789        {   N/A 1790                inst.nagrandom = true   N/A 1791        }   N/A 1792    N/A 1793        local igroup = SceneTable[scenetableentry].idlegroup   N/A 1794        local idx, val,oig=0   N/A 1795        foreach (idx, val in SceneTable)   N/A 1796        {   N/A 1797                if (!("idlegroup" in val))   N/A 1798                        continue   N/A 1799                if (val.idlegroup != igroup)   N/A 1800                        continue   N/A 1801                local rar = 101, mnum = 0   N/A 1802                if ("idlerarity" in val)   N/A 1803                {   N/A 1804                        rar = val.idlerarity   N/A 1805                }   N/A 1806                if ("idlemaxplays" in val)   N/A 1807                {   N/A 1808                        mnum = val.idlemaxplays   N/A 1809                }   N/A 1810                //Skip vcds that are part of a chain (and not the first link in the chain)   N/A 1811                if ("idleunder" in val)   N/A 1812                {   N/A 1813                        continue   N/A 1814                }   N/A 1815                if ("idleorderingroup" in val)   N/A 1816                {   N/A 1817                        oig=val.idleorderingroup   N/A 1818                }   N/A 1819                else   N/A 1820                {   N/A 1821                        oig=0   N/A 1822                }   N/A 1823                inst.nags.append({SceneTableIndex=idx, rarity = rar, maxplays = mnum, totplays = 0,orderingroup = oig})   N/A 1824        }   N/A 1825        inst.nags.sort(nag_array_compare)   N/A 1826        inst.isNag = true   N/A 1827        inst.nagtimeslistcompleted = 0   N/A 1828        nags_createpool(inst)   N/A 1829 }   N/A 1830    N/A 1831 function nags_createpool(inst)   N/A 1832 {   N/A 1833        inst.nagpoolClear   N/A 1834        local idx, val   N/A 1835        local takeit = false   N/A 1836        local tempa = []   N/A 1837        foreach (idx, val in inst.nags)   N/A 1838        {   N/A 1839                takeit=false   N/A 1840                if (val.totplays >= val.maxplays && val.maxplays>0)   N/A 1841                {   N/A 1842                        continue   N/A 1843                }   N/A 1844                if (RandomInt(1,100)<val.rarity)   N/A 1845                {   N/A 1846                        takeit=true   N/A 1847                }          N/A 1848                if (takeit)   N/A 1849                {   N/A 1850                        tempa.append(val)   N/A 1851                }   N/A 1852        }   N/A 1853        local r   N/A 1854        //The pool can still be empty at this point if only rare lines were available and none of them "made their roll". N/A 1855       if (tempa.len == 0)   N/A 1856                return   N/A 1857    N/A 1858        if (inst.nagrandom || (inst.nagrandomonrepeat && inst.nagtimeslistcompleted > 0))   N/A 1859        {   N/A 1860                //Make sure the first entry in the new list isn't the same as the last vcd played. N/A 1861               //This ensures no repeats. N/A 1862               if (tempa.len>1 && inst.naglastfetched!=null)   N/A 1863                {   N/A 1864                        while (true)   N/A 1865                        {   N/A 1866                                r=RandomInt(0,tempa.len-1)   N/A 1867                                if (tempa[r].SceneTableIndex != inst.naglastfetched)   N/A 1868                                {   N/A 1869                                        inst.nagpool.append(tempa[r])   N/A 1870                                        tempa.remove(r)   N/A 1871                                        break   N/A 1872                                }   N/A 1873                        }   N/A 1874                }   N/A 1875                //Now build the rest of the pool   N/A 1876                while (tempa.len>0)   N/A 1877                {   N/A 1878                        r=RandomInt(0,tempa.len-1)   N/A 1879                        inst.nagpool.append(tempa[r])   N/A 1880                        tempa.remove(r)   N/A 1881                }   N/A 1882        }   N/A 1883        else   N/A 1884        {   N/A 1885                foreach(idx, val in tempa)   N/A 1886                {   N/A 1887                        inst.nagpool.append(val)   N/A 1888                }   N/A 1889        }          N/A 1890 }   N/A 1891    N/A 1892 function nags_nagpooldump(inst)   N/A 1893 {   N/A 1894        local idx, val   N/A 1895        foreach (idx, val in inst.nagpool)   N/A 1896                printldebug("*********NAG "+idx+" : "+val.SceneTableIndex)   N/A 1897 }   N/A 1898    N/A 1899 function nags_fetch(inst)   N/A 1900 {   N/A 1901        if (inst.nagpool.len == 0)   N/A 1902        {   N/A 1903                if (inst.nagrepeat)   N/A 1904                {   N/A 1905                        inst.nagtimeslistcompleted += 1   N/A 1906                        nags_createpool(inst)   N/A 1907                        if (inst.nagpool.len == 0)   N/A 1908                                return null   N/A 1909                }   N/A 1910                else   N/A 1911                {   N/A 1912                        return null   N/A 1913                }          N/A 1914        }   N/A 1915        local ret = inst.nagpool[0].SceneTableIndex   N/A 1916        foreach( idx, val in inst.nags)   N/A 1917        {   N/A 1918                if (val.SceneTableIndex == ret)   N/A 1919                {   N/A 1920                        val.totplays+=1   N/A 1921                        break   N/A 1922                }   N/A 1923        }   N/A 1924        //nags_nagpooldump(inst)   N/A 1925        inst.nagpool.remove(0)   N/A 1926        inst.naglastfetched = ret   N/A 1927        return ret   N/A 1928 }   N/A 1929    N/A 1930 function GladosStopNag(arg = 0)   N/A 1931 {   N/A 1932        nag_stop("glados",arg)   N/A 1933 }   N/A 1934    N/A 1935 function WheatleyStopNag(arg = 0)   N/A 1936 {   N/A 1937        nag_stop("wheatley",arg)   N/A 1938 }   N/A 1939    N/A 1940 function nag_stop(char, stoptype)   N/A 1941 {   N/A 1942        local idx, val   N/A 1943        local todel = null   N/A 1944        foreach (idx, val in scenequeue)   N/A 1945        {   N/A 1946                if (val.isNag && val.currentCharacter == char)   N/A 1947                {   N/A 1948                        todel=idx   N/A 1949                        break   N/A 1950                }   N/A 1951        }   N/A 1952        if (todel != null)   N/A 1953        {   N/A 1954                scenequeue_DeleteScene(todel)          N/A 1955        }   N/A 1956 }   N/A 1957    N/A 1958 function nag_array_compare(a,b)   N/A 1959 {   N/A 1960        if(a.orderingroup>b.orderingroup) return 1   N/A 1961        else if(a.orderingroup<b.orderingroup) return -1   N/A 1962        return 0;   N/A 1963 }   N/A 1964    N/A 1965    N/A 1966 //--   N/A 1967 //Nag Table Functions END   N/A 1968 //--   N/A 1969    N/A 1970 function SabotageFactoryRecycledTurretNoticesPlayer   N/A 1971 {   N/A 1972        GladosPlayVcd(439, null, "conveyor_turret")   N/A 1973 }   N/A 1974    N/A 1975 function TrustFlingCatapultTurretNoticesPlayer   N/A 1976 {   N/A 1977        GladosPlayVcd(439, null, "catapulted_turret")   N/A 1978 }   N/A 1979    N/A 1980    N/A 1981    N/A 1982    N/A 1983    N/A 1984    N/A 1985 //-   N/A 1986 //Context-specific functions   N/A 1987 //-   N/A 1988 function GladosPlayerGetsGun(arg)   N/A 1989 {   N/A 1990        if (coopFirstPlayerToGetGun == 0)   N/A 1991        {   N/A 1992                if (arg == coopBlue)   N/A 1993                {   N/A 1994                        coopFirstPlayerToGetGun = coopBlue   N/A 1995                        BlueHasGun=1   N/A 1996                        GladosPlayVcd(1)   N/A 1997                }   N/A 1998                else   N/A 1999                {   N/A 2000                        OrangeHasGun=1   N/A 2001                        coopFirstPlayerToGetGun = coopOrange   N/A 2002                        GladosPlayVcd(2)   N/A 2003                }   N/A 2004        }   N/A 2005        else          N/A 2006        {          N/A 2007                        if (arg == coopBlue)   N/A 2008                        {   N/A 2009                                BlueHasGun=1   N/A 2010                                GladosPlayVcd(3)   N/A 2011                        }   N/A 2012                        else   N/A 2013                        {   N/A 2014                                OrangeHasGun=1   N/A 2015                                GladosPlayVcd(4)   N/A 2016                        }   N/A 2017    N/A 2018        }   N/A 2019 }   N/A 2020    N/A 2021 // a newly spawned cube or sphere was destroyed   N/A 2022 function GladosDroppedCubeDestroyed(arg)   N/A 2023 {   N/A 2024        if ( arg == coopBlue )   N/A 2025        {   N/A 2026                EntFireByHandle( badCatchBlue, "Start", "", 0, null, null )   N/A 2027        }   N/A 2028        else   N/A 2029        {   N/A 2030                EntFireByHandle( badCatchOrange, "Start", "", 0, null, null )   N/A 2031        }   N/A 2032 }   N/A 2033    N/A 2034 function GladosGiveCompliment(arg)   N/A 2035 {   N/A 2036        EntFireByHandle( ComplimentSceneTable[arg], "Start", "", 0, null, null )   N/A 2037 }   N/A 2038    N/A 2039 function GladosCoopTurnOffVoice   N/A 2040 {   N/A 2041        coopRelaxationVaultVoiceMonitor = false   N/A 2042        coopRelaxationVaultVoiceBlueTicks = 0   N/A 2043        coopRelaxationVaultVoiceOrangeTicks = 0   N/A 2044 }   N/A 2045 function GladosInitRelaxationVault   N/A 2046 {   N/A 2047        //coopRelaxationVaultVoiceMonitor = true   N/A 2048        coopRelaxationVaultVoiceMonitor = false   N/A 2049        coopRelaxationVaultVoiceBlueTicks = 0   N/A 2050        coopRelaxationVaultVoiceOrangeTicks = 0   N/A 2051        GladosPlayVcd(0,"glados")   N/A 2052 }   N/A 2053    N/A 2054 function GladosCoopPingPortalTraining   N/A 2055 {   N/A 2056                GladosPlayVcd(35)          N/A 2057 }   N/A 2058    N/A 2059 function CoopStartCalComplete   N/A 2060 {   N/A 2061                if (CoopStartCalCompleteSet == 0){   N/A 2062                        CoopStartCalCompleteSet = 1   N/A 2063                        GladosPlayVcd(1007)          N/A 2064                }   N/A 2065 }   N/A 2066    N/A 2067    N/A 2068 function CoopStartBButton(player)   N/A 2069 {   N/A 2070    N/A 2071        if (player == coopBlue && CoopStartBButtonSet == 0){                  N/A 2072                CoopStartBButtonSet = 1   N/A 2073                GladosPlayVcd(1004)          N/A 2074        }   N/A 2075 }   N/A 2076    N/A 2077 function CoopStartButton(player)   N/A 2078 {   N/A 2079    N/A 2080        if (player == coopOrange && CoopStartButtonSet == 0){                  N/A 2081                CoopStartButtonSet = 1   N/A 2082                GladosPlayVcd(1005)          N/A 2083        }   N/A 2084 }   N/A 2085    N/A 2086 function CoopStartBoxButton(player)   N/A 2087 {   N/A 2088        CoopStartBoxButtonSet++   N/A 2089        if (CoopStartBoxButtonSet == 2){   N/A 2090                GladosPlayVcd(1006)   N/A 2091        }   N/A 2092 }   N/A 2093    N/A 2094    N/A 2095    N/A 2096 function GladosCoopInitiatePlanB   N/A 2097 {   N/A 2098        GladosPlayVcd(60)   N/A 2099 }   N/A 2100    N/A 2101 function GladosCoopEnterRadarRoom   N/A 2102 {   N/A 2103        GladosPlayVcd(65)   N/A 2104 }   N/A 2105    N/A 2106    N/A 2107 function GladosCoopStartRadar   N/A 2108 {   N/A 2109        GladosPlayVcd(66)   N/A 2110 }   N/A 2111    N/A 2112 function GladosCoopExplainMakeHuman   N/A 2113 {   N/A 2114        GladosPlayVcd(75)   N/A 2115 }   N/A 2116    N/A 2117 function GladosCoopExplainMakeHumanFail   N/A 2118 {   N/A 2119        GladosPlayVcd(80)   N/A 2120 }   N/A 2121    N/A 2122 //////   N/A 2123 function GladosCoopArtifact_1_Enter   N/A 2124 {   N/A 2125        GladosPlayVcd(100)   N/A 2126 }   N/A 2127    N/A 2128 function GladosCoopArtifact_1_Scan   N/A 2129 {   N/A 2130        GladosPlayVcd(102)   N/A 2131 }   N/A 2132    N/A 2133 function GladosCoopArtifact_1_Return   N/A 2134 {   N/A 2135        GladosPlayVcd(103)   N/A 2136 }   N/A 2137 ///////   N/A 2138    N/A 2139 function GladosCoopReturnHubArtifact_1   N/A 2140 {   N/A 2141        GladosPlayVcd(85)   N/A 2142 }   N/A 2143    N/A 2144 function GladosToggleDebugMode   N/A 2145 {   N/A 2146        debug = !debug   N/A 2147        if (debug) printl("=======================GLaDOS debug mode ON")   N/A 2148        else printl("=======================GLaDOS debug mode OFF")   N/A 2149 }   N/A 2150    N/A 2151 //---   N/A 2152 // PAX PAX END OF DEMO   N/A 2153 //---   N/A 2154 //ping reminder   N/A 2155 function GladosCoopPAXEndDemo   N/A 2156 {   N/A 2157        GladosPlayVcd(153)   N/A 2158 }   N/A 2159    N/A 2160 //PrivateTalk mix vcds   N/A 2161        PrivateMixVcds <- {}   N/A 2162        PrivateMixVcds[1] <- CreateSceneEntity("scenes/npc/glados/COOP_PRIVATETALK_MIX01.vcd")   N/A 2163        PrivateMixVcds[2] <- CreateSceneEntity("scenes/npc/glados/COOP_PRIVATETALK_MIX02.vcd")   N/A 2164        PrivateMixVcds[3] <- CreateSceneEntity("scenes/npc/glados/COOP_PRIVATETALK_MIX03.vcd")   N/A 2165        PrivateMixVcds[4] <- CreateSceneEntity("scenes/npc/glados/COOP_PRIVATETALK_MIX04.vcd")   N/A 2166        PrivateMixVcds[5] <- CreateSceneEntity("scenes/npc/glados/COOP_PRIVATETALK_MIX05.vcd")   N/A 2167        PrivateMixVcds[6] <- CreateSceneEntity("scenes/npc/glados/COOP_PRIVATETALK_MIX06.vcd")   N/A 2168        PrivateMixVcds[7] <- CreateSceneEntity("scenes/npc/glados/COOP_PRIVATETALK_MIX07.vcd")   N/A 2169        PrivateMixVcds[8] <- CreateSceneEntity("scenes/npc/glados/COOP_PRIVATETALK_MIX08.vcd")   N/A 2170        PrivateMixVcds[9]  <- CreateSceneEntity("scenes/npc/glados/COOP_TEST_CHAMBER_BLUE06.vcd")          N/A 2171        PrivateMixVcds[10] <- CreateSceneEntity("scenes/npc/glados/COOP_TEST_CHAMBER_BLUE03.vcd")   N/A 2172    N/A 2173    N/A 2174 //PrivateTalk Both vcds   N/A 2175        PrivateBothVcds <- {}   N/A 2176        PrivateBothVcds[1] <- CreateSceneEntity("scenes/npc/glados/COOP_PRIVATETALK_BOTH01.vcd")   N/A 2177        PrivateBothVcds[2] <- CreateSceneEntity("scenes/npc/glados/COOP_PRIVATETALK_BOTH02.vcd")   N/A 2178        PrivateBothVcds[3] <- CreateSceneEntity("scenes/npc/glados/COOP_PRIVATETALK_BOTH03.vcd")   N/A 2179        PrivateBothVcds[4] <- CreateSceneEntity("scenes/npc/glados/COOP_PRIVATETALK_BOTH04.vcd")   N/A 2180        PrivateBothVcds[5] <- CreateSceneEntity("scenes/npc/glados/COOP_PRIVATETALK_BOTH05.vcd")   N/A 2181        PrivateBothVcds[6] <- CreateSceneEntity("scenes/npc/glados/COOP_PRIVATETALK_BOTH06.vcd")   N/A 2182        PrivateBothVcds[7] <- CreateSceneEntity("scenes/npc/glados/COOP_PRIVATETALK_BOTH07.vcd")   N/A 2183        PrivateBothVcds[8] <- CreateSceneEntity("scenes/npc/glados/COOP_PRIVATETALK_BOTH08.vcd")   N/A 2184        PrivateBothVcds[9]  <- CreateSceneEntity("scenes/npc/glados/COOP_TEST_CHAMBER_ORANGE06.vcd")                  N/A 2185        PrivateBothVcds[10] <- CreateSceneEntity("scenes/npc/glados/COOP_TEST_CHAMBER_ORANGE03.vcd")   N/A 2186    N/A 2187 //Fires two different vcds - one for each player's ears only. N/A 2188 function GladosPrivateTalk(player,vndx)  N/A 2189 {   N/A 2190        if (player == coopBlue)   N/A 2191        {   N/A 2192                GladosSetBroadcastState( PrivateMixVcds[vndx], "blue" )   N/A 2193                GladosSetBroadcastState( PrivateBothVcds[vndx], "orange" )   N/A 2194                EntFireByHandle(PrivateMixVcds[vndx], "Start", "", 0.00, null, null )   N/A 2195                EntFireByHandle(PrivateBothVcds[vndx], "Start", "", 0.00, null, null )   N/A 2196        }          N/A 2197        else   N/A 2198        {   N/A 2199                GladosSetBroadcastState( PrivateMixVcds[vndx], "orange" )   N/A 2200                GladosSetBroadcastState( PrivateBothVcds[vndx], "blue" )   N/A 2201                EntFireByHandle(PrivateMixVcds[vndx], "Start", "", 0.0, null, null )   N/A 2202                EntFireByHandle(PrivateBothVcds[vndx], "Start", "", 0.00, null, null )   N/A 2203        }   N/A 2204 }   N/A 2205    N/A 2206 function GladosSayHello(player)   N/A 2207 {   N/A 2208        if (player == coopBlue)   N/A 2209        {   N/A 2210                GladosSetBroadcastState( HelloVcds[1], "blue" )   N/A 2211                EntFireByHandle(HelloVcds[1], "Start", "", 0.00, null, null )   N/A 2212        }          N/A 2213        else   N/A 2214        {   N/A 2215                GladosSetBroadcastState( HelloVcds[2], "orange" )   N/A 2216                EntFireByHandle(HelloVcds[2], "Start", "", 0.00, null, null )   N/A 2217        }   N/A 2218 }   N/A 2219    N/A 2220 function GladosSetBroadcastState(vcd,target )   N/A 2221 {   N/A 2222        local ORANGE_PLAYER = 2   N/A 2223        local BLUE_PLAYER = 3   N/A 2224        if ( target == "both" )   N/A 2225        {   N/A 2226                vcd.AddBroadcastTeamTarget( BLUE_PLAYER )   N/A 2227                vcd.AddBroadcastTeamTarget( ORANGE_PLAYER )   N/A 2228        }   N/A 2229        else if ( target == "blue" )   N/A 2230        {   N/A 2231                vcd.AddBroadcastTeamTarget( BLUE_PLAYER )   N/A 2232                vcd.RemoveBroadcastTeamTarget( ORANGE_PLAYER )   N/A 2233        }   N/A 2234        else if ( target == "orange" )   N/A 2235        {   N/A 2236                vcd.RemoveBroadcastTeamTarget( BLUE_PLAYER )   N/A 2237                vcd.AddBroadcastTeamTarget( ORANGE_PLAYER )   N/A 2238        }   N/A 2239 }   N/A 2240    N/A 2241    N/A 2242 //Tells GLaDOS that the level wants to end and transition to the next level. N/A 2243 //This gives her a chance to finish up any dialog before transitioning  N/A 2244 //Relies on a relay called "gladosendoflevelrelay" in the map that actually switches levels when triggered. N/A 2245 //GLaDOS triggers "gladosendoflevelrelay" from her think function. N/A 2246 function GladosEndLevelRequest  N/A 2247 {   N/A 2248        coopWaitingToExit = true   N/A 2249 }   N/A 2250    N/A 2251 //-   N/A 2252 //Score annoucing stuff   N/A 2253 //-   N/A 2254        function GladosAnnouncePlayerDemerit(arg,low,hi)   N/A 2255        {   N/A 2256                local mapname = GetMapName   N/A 2257                switch (mapname){                  N/A 2258                        case "mp_coop_catapult_1":   N/A 2259                                if (arg==coopBlue){   N/A 2260                                        break   N/A 2261                                }   N/A 2262                                else{   N/A 2263                                        break   N/A 2264                                }          N/A 2265                }   N/A 2266        }   N/A 2267    N/A 2268        function GladosAnnouncePlayerScore(arg,low,hi)   N/A 2269        {   N/A 2270                local mapname = GetMapName   N/A 2271                switch (mapname)   N/A 2272                {   N/A 2273    N/A 2274                        case "mp_coop_doors":   N/A 2275                                if (arg==coopBlue){   N/A 2276                                        GladosPlayVcd(1012)   N/A 2277                                        break   N/A 2278                                }   N/A 2279                                else{   N/A 2280                                        GladosPlayVcd(1013)   N/A 2281                                        break   N/A 2282                                }          N/A 2283                        case "mp_coop_fling_3":   N/A 2284                                if (arg==coopBlue){   N/A 2285 //                                        GladosPlayVcd(1012)   N/A 2286                                        break   N/A 2287                                }   N/A 2288                                else{   N/A 2289        //                                GladosPlayVcd(1013)  turned off for now, not on right track. N/A 2290                                       break   N/A 2291                                }          N/A 2292    N/A 2293                }   N/A 2294    N/A 2295                printldebug("2222222222222222222222222222222222")   N/A 2296        }   N/A 2297    N/A 2298        function GladosStateScore   N/A 2299        {   N/A 2300                printldebug("333333333333333333333333333333")   N/A 2301        }   N/A 2302    N/A 2303        function GladosStateScienceCollaborationPoints   N/A 2304        {   N/A 2305                                printldebug("444444444444444444444444444444")   N/A 2306        }   N/A 2307 //-   N/A 2308 //END OF Score annoucing stuff   N/A 2309 //-   N/A 2310    N/A 2311    N/A 2312 //---   N/A 2313 // NEW NEW Ping Training Sequence stuff   N/A 2314 //---   N/A 2315        //ping reminder   N/A 2316        function GladosCoopPingReminder1   N/A 2317        {   N/A 2318                GladosPlayVcd(45)   N/A 2319        }   N/A 2320    N/A 2321 //---   N/A 2322 //Ping Training Sequence stuff   N/A 2323 //---   N/A 2324        //Play the ping training intro   N/A 2325        function GladosCoopPingTrainingIntro   N/A 2326        {   N/A 2327                GladosPlayVcd(10)   N/A 2328        }   N/A 2329    N/A 2330        //Housecleaning / entity stuff that happens when the ping training is over    N/A 2331        function GladosCoopPingGameOver   N/A 2332        {   N/A 2333                EntFire("aperture_door","SetSpeed",35, 0.00)   N/A 2334                EntFire("aperture_door","Close", "", 0.00)   N/A 2335                EntFire("dome_exit_door_blue","Open", "", 3.00)   N/A 2336                EntFire("dome_exit_door_orange","Open", "", 3.00)   N/A 2337                EntFire("platform_2_gate_exit","Open", "", 1.00)   N/A 2338                EntFire("platform_1_gate_exit","Open", "", 1.00)   N/A 2339        }   N/A 2340    N/A 2341        //Turns ping training game on   N/A 2342        function GladosCoopPingTrainingGameOn   N/A 2343        {   N/A 2344                if (debug)   N/A 2345                        printl("========================GAME ON!!!!!")   N/A 2346                coopPingGameOn = true  //We are in ping training mode! N/A 2347               coopPingPlayerTurn = coopBlue  //It's BLUE's turn   N/A 2348                coopPingTurnNumber = 1 //It's turn #1   N/A 2349                coopTimeSinceTurn = Time  //Turn #1 starts NOW! N/A 2350               EntFire("PingHint","ShowHint", "!player_blue", 0.00)  //Fire the ping hint to blue player   N/A 2351        }   N/A 2352    N/A 2353        //Dome ping redirect   N/A 2354        function GladosPingTrainingPingDome(arg)   N/A 2355        {   N/A 2356                GladosPingTrainingPing(arg)   N/A 2357        }   N/A 2358    N/A 2359        //Handles player placing a ping   N/A 2360        function GladosPingTrainingPing(arg)   N/A 2361        {   N/A 2362                //Track total # of pings by both players   N/A 2363                if (arg == coopBlue) coopPingsBlue += 1   N/A 2364                if (arg == coopOrange) coopPingsOrange += 1   N/A 2365                //Process ping only if GLaDOS isn't talking   N/A 2366                if ((!coopPingNoInterrupt) && coopPingGameOn)   N/A 2367                {   N/A 2368                        if (arg==coopBlue) //Ping belongs to BLUE   N/A 2369                        {   N/A 2370                                if (coopPingPlayerTurn==coopBlue) //Is it actually BLUE's turn? N/A 2371                               {   N/A 2372                                        switch (coopPingTurnNumber)   N/A 2373                                        {   N/A 2374                                                case 1:  //Turn 1   N/A 2375                                                        coopPingPlayerTurn = coopOrange   N/A 2376                                                        coopPingNextScene = 5   N/A 2377                                                        coopPingNextSceneDelay = 0.4   N/A 2378                                                        coopTimeSinceTurn = Time   N/A 2379                                                        GladosPingTrainingSpeak(2,true,0.00)   N/A 2380                                                        EntFire("PingHint","EndHint", "!player_blue", 0.00)    N/A 2381                                                        EntFire("PingHint","ShowHint", "!player_orange", 3.00)    N/A 2382                                                        break   N/A 2383                                                case 2: //Turn 2   N/A 2384                                                        coopPingPlayerTurn = coopOrange   N/A 2385                                                        coopPingNextScene = 16   N/A 2386                                                        coopPingNextSceneDelay = 0.4   N/A 2387                                                        coopTimeSinceTurn = Time   N/A 2388                                                        GladosPingTrainingSpeak(4, true, 0.00)   N/A 2389                                                        break   N/A 2390                                        }   N/A 2391                                }   N/A 2392                                else //BLUE is pinging out of turn! N/A 2393                               {   N/A 2394                                        GladosPingTrainingWrongMove(coopBlue)   N/A 2395                                }   N/A 2396                        }   N/A 2397                        if (arg==coopOrange) //Ping belongs to ORANGE   N/A 2398                        {   N/A 2399                                if (coopPingPlayerTurn==coopOrange) //Is it actually ORANGE's turn? N/A 2400                               {   N/A 2401                                        switch (coopPingTurnNumber)   N/A 2402                                        {   N/A 2403                                                case 1: //TURN 1   N/A 2404                                                        coopPingPlayerTurn = coopBlue   N/A 2405                                                        coopPingNextScene = 3   N/A 2406                                                        coopPingTurnNumber = 2   N/A 2407                                                        coopPingNextSceneDelay = 0.4   N/A 2408                                                        coopTimeSinceTurn = Time   N/A 2409                                                        GladosPingTrainingSpeak(19, true, 0.00)   N/A 2410                                                        EntFire("PingHint","EndHint", "!player_orange", 0.00)    N/A 2411                                                        //GladosPingTrainingSpeak(20, true, 0.00)   N/A 2412                                                        break   N/A 2413                                                case 2: //TURN 2 (FINAL MOVE OF GAME)   N/A 2414                                                        coopPingGameOn = false   N/A 2415                                                        GladosPlayVcd(11) //Play game over dialog dialog (also closes dome doors)   N/A 2416                                                        break   N/A 2417                                        }   N/A 2418                                }   N/A 2419                                else //Orange is pinging out of turn! N/A 2420                               {   N/A 2421                                        GladosPingTrainingWrongMove(coopOrange)   N/A 2422                                }   N/A 2423                        }   N/A 2424                }          N/A 2425        }   N/A 2426    N/A 2427        //Handles player placing ping when it's not their turn   N/A 2428        function GladosPingTrainingWrongMove(arg)   N/A 2429        {   N/A 2430                //Gave players their last warning, so shut the game down   N/A 2431                if (coopSaidWrongMovesDialog)   N/A 2432                {   N/A 2433                        coopPingGameOn = false   N/A 2434                        GladosPlayVcd(12)   N/A 2435                        return   N/A 2436                }   N/A 2437                //Give players a final warning   N/A 2438                if (coopPingsBlue>0 && coopPingsOrange>0 && (coopWrongMovesBlue+coopWrongMovesOrange)>0 && !coopSaidWrongMovesDialog)   N/A 2439                {   N/A 2440                        coopSaidWrongMovesDialog = true   N/A 2441                        GladosPingTrainingSpeak(11, true, 0.00)   N/A 2442                        return   N/A 2443                }   N/A 2444                //Tell BLUE not to go out of turn   N/A 2445                if (arg==coopBlue && coopWrongMovesOrange == 0 && coopWrongMovesBlue < 5) //BLUE goes out of turn, but Orange hasn't placed a ping   N/A 2446                {   N/A 2447                        GladosPingTrainingSpeak(13, true, 0.00)   N/A 2448                        coopWrongMovesBlue +=1   N/A 2449                        return   N/A 2450                }   N/A 2451                //Tell ORANGE not to go out of turn   N/A 2452                if (arg==coopOrange && coopWrongMovesBlue == 0 && coopWrongMovesOrange < 5)   N/A 2453                {   N/A 2454                        GladosPingTrainingSpeak(14, true, 0.00)   N/A 2455                        coopWrongMovesOrange += 1   N/A 2456                        return   N/A 2457                }   N/A 2458                //Failsafe for final warning   N/A 2459                if (!coopSaidWrongMovesDialog)   N/A 2460                {   N/A 2461                        coopSaidWrongMovesDialog = true   N/A 2462                        GladosPingTrainingSpeak(11, true, 0.00)   N/A 2463                        return   N/A 2464                }   N/A 2465        }   N/A 2466    N/A 2467        function GladosPingTrainingSpeak(arg,setNoInterrupt,d)   N/A 2468        //arg: PingTrainingVcd index   N/A 2469        //setNoInterrupt: true = dialog can't be interrupted by intervening event   N/A 2470        //d: delay (in seconds) before line   N/A 2471        {   N/A 2472                        if (setNoInterrupt == null) setNoInterrupt = true   N/A 2473                        if (d == null) d = 0.00   N/A 2474                        coopPingNoInterrupt = setNoInterrupt   N/A 2475                        EntFireByHandle(PingTrainingVcds[arg], "Start", "", d, null, null )   N/A 2476        }   N/A 2477    N/A 2478        //Automatically called at the end of every PingTrainingVcd. Starts next vcd if one has been set. N/A 2479       function GladosPingTrainingNextScene   N/A 2480        {   N/A 2481                local i = coopPingNextScene   N/A 2482                local d = coopPingNextSceneDelay   N/A 2483                if (coopPingNextScene != null)   N/A 2484                {   N/A 2485                        coopPingNextScene = null   N/A 2486                        coopPingNextSceneDelay = null   N/A 2487                        GladosPingTrainingSpeak(i,true,d)   N/A 2488                }   N/A 2489                else coopPingNoInterrupt = false          N/A 2490        }   N/A 2491 //--   N/A 2492 //END of ping training sequence stuff   N/A 2493 //--   N/A 2494    N/A 2495 //-   N/A 2496 //END OF Context-specific functions   N/A 2497 //-   N/A 2498    N/A 2499 //   N/A 2500 //microphone utilities   N/A 2501 //   N/A 2502 function GladosStartMicTest   N/A 2503 {   N/A 2504        debugMicTest = true   N/A 2505 }   N/A 2506 function GladosStopMicTest   N/A 2507 {   N/A 2508        debugMicTest = false   N/A 2509 }   N/A 2510    N/A 2511 //   N/A 2512 //END of microphone utilities   N/A 2513 //   N/A 2514    N/A 2515 //   N/A 2516 //Catches for old method of firing directly into speakvcd   N/A 2517 //   N/A 2518 //Glados placing portals for player using ping tool. N/A 2519 SceneTableLookup[35] <- "mp_coop_startcoop_portal_ping_intro00"  N/A 2520 function CoopRaceButtonPress(player){   N/A 2521        if (player==coopBlue)   N/A 2522        {   N/A 2523                GladosPlayVcd(1012)          N/A 2524        }   N/A 2525        else   N/A 2526        {   N/A 2527                GladosPlayVcd(1013)          N/A 2528        }   N/A 2529 }   N/A 2530    N/A 2531 function CoopStartHandOff   N/A 2532 {   N/A 2533 }   N/A 2534    N/A 2535 function CoopStartBoxCatch   N/A 2536 {   N/A 2537                GladosPlayVcd(1023)   N/A 2538 }   N/A 2539    N/A 2540    N/A 2541 function GladosPingIntroDone   N/A 2542 {   N/A 2543        BlueInPortalTraining = 1   N/A 2544        OrangeInPortalTraining = 1   N/A 2545 }   N/A 2546    N/A 2547 function CoopStartTwoPortals{   N/A 2548        GladosPlayVcd(1002)   N/A 2549 }   N/A 2550    N/A 2551 function CoopRadarRoom{   N/A 2552  LastDeathTime=Time+5000 //extra time added so death responses will not fire   N/A 2553        GladosPlayVcd(1009)   N/A 2554        EndSpeedRunTimer   N/A 2555 }   N/A 2556    N/A 2557 function CoopBlueprintRoom{   N/A 2558  LastDeathTime=Time+5000 //extra time added so death responses will not fire   N/A 2559        GladosPlayVcd(1055)   N/A 2560        EndSpeedRunTimer   N/A 2561 }   N/A 2562 function CoopSecutiryRoom{   N/A 2563  LastDeathTime=Time+5000 //extra time added so death responses will not fire   N/A 2564        GladosPlayVcd(1196)   N/A 2565        EndSpeedRunTimer   N/A 2566 }   N/A 2567    N/A 2568 function CoopTbeamSecurity   N/A 2569 {   N/A 2570        LastDeathTime=Time+5000 //extra time added so death responses will not fire   N/A 2571        GladosPlayVcd(1094)   N/A 2572    N/A 2573        // Award the STAYING_ALIVE achievement here, before GLADOS nukes the players. N/A 2574       // If no one died...   N/A 2575        local nTotalDeaths = GetPlayerDeathCount( 0 ) + GetPlayerDeathCount( 1 );   N/A 2576        if ( nTotalDeaths == 0 )   N/A 2577        {   N/A 2578                // ...and both players completed every map in the branch during this session. N/A 2579               if ( CoopGetLevelsCompletedThisBranch == CoopGetBranchTotalLevelCount(STAYING_ALIVE_SECTION-1)-1 )   N/A 2580                {   N/A 2581                        RecordAchievementEvent( "ACH.STAYING_ALIVE", GetBluePlayerIndex )   N/A 2582                        RecordAchievementEvent( "ACH.STAYING_ALIVE", GetOrangePlayerIndex )   N/A 2583                }   N/A 2584        }   N/A 2585    N/A 2586        EndSpeedRunTimer   N/A 2587 }   N/A 2588    N/A 2589 function RespondToTaunt(tauntnumber){   N/A 2590        printldebug("---RESPONDTOTAUNT"+tauntnumber)   N/A 2591        local curMapName = GetMapName   N/A 2592        //taunt 0 given at start   N/A 2593        LastTauntTime=Time   N/A 2594        switch (curMapName)   N/A 2595        {   N/A 2596                case "mp_coop_start":    N/A 2597                        if (tauntnumber == 1)   N/A 2598                        {   N/A 2599                                GladosPlayVcd(1064)   N/A 2600                        }   N/A 2601                        break   N/A 2602    N/A 2603                case "mp_coop_laser_2":    N/A 2604                        if (tauntnumber == 2)   N/A 2605                        {   N/A 2606                                GladosPlayVcd(1065)   N/A 2607                        }   N/A 2608                        break   N/A 2609                case "mp_coop_rat_maze":    N/A 2610                        if (tauntnumber == 3)   N/A 2611                        {   N/A 2612                                GladosPlayVcd(1017)   N/A 2613                        }   N/A 2614                        break   N/A 2615                case "mp_coop_catapult_1":    N/A 2616                        if (tauntnumber == 5)   N/A 2617                        {   N/A 2618                                GladosPlayVcd(1051)   N/A 2619                        }   N/A 2620                        break   N/A 2621                case "mp_coop_lobby_2":   N/A 2622                case "mp_coop_lobby_3":   N/A 2623                        if (tauntnumber == 4){                                            N/A 2624                                //moved ot hub stuff   N/A 2625                        }   N/A 2626                        break   N/A 2627                case "mp_coop_catapult_wall_intro":   N/A 2628                        if (tauntnumber == 7){                                            N/A 2629                                GladosPlayVcd(1097)   N/A 2630                        }   N/A 2631                        break                  N/A 2632                case "mp_coop_wall_5":   N/A 2633                        if (tauntnumber == 8){                                            N/A 2634                                GladosPlayVcd(1098)   N/A 2635                        }   N/A 2636                        break                                          N/A 2637                case "mp_coop_tbeam_laser_1":   N/A 2638                        if (tauntnumber == 9){                                            N/A 2639                                GladosPlayVcd(1099)   N/A 2640                        }   N/A 2641                        break                                                                  N/A 2642        }   N/A 2643 }   N/A 2644    N/A 2645 function CoopHubTrack01{   N/A 2646        GladosPlayVcd(1020)          N/A 2647 }   N/A 2648 function CoopHubTrack02{   N/A 2649        InHub2=1   N/A 2650        GladosPlayVcd(1095)          N/A 2651 }   N/A 2652    N/A 2653 function CoopHubTrack03{   N/A 2654        GladosPlayVcd(1062)          N/A 2655 }   N/A 2656    N/A 2657 function CoopHubTrack04{   N/A 2658        GladosPlayVcd(1173)          N/A 2659    N/A 2660 }   N/A 2661    N/A 2662 function CoopHubTrack05{   N/A 2663        GladosPlayVcd(1130)   N/A 2664 }   N/A 2665    N/A 2666 function CoopHubTrack06{   N/A 2667        GladosPlayVcd(1130) // FIX ME: Need a new glados line here   N/A 2668 }   N/A 2669    N/A 2670    N/A 2671    N/A 2672 function CoopRaceButton(arg)   N/A 2673 {   N/A 2674        if (arg==coopBlue)   N/A 2675        {   N/A 2676                GladosPlayVcd(1026)   N/A 2677        }   N/A 2678        else   N/A 2679        {   N/A 2680                GladosPlayVcd(1027)   N/A 2681        }          N/A 2682 }   N/A 2683    N/A 2684 function CoopLaserTurretkill   N/A 2685 {   N/A 2686        GladosPlayVcd(1028)   N/A 2687 }   N/A 2688    N/A 2689 function CoopMazeOrangeCrush(arg){   N/A 2690        if (arg == 1){   N/A 2691                OrangeInMaze = 1   N/A 2692        }   N/A 2693        else{   N/A 2694                OrangeInMaze = 0   N/A 2695        }   N/A 2696 }   N/A 2697    N/A 2698 function CoopMazeBlueCrush(arg){   N/A 2699        if (arg == 1){   N/A 2700                BlueInMaze = 1   N/A 2701        }   N/A 2702        else{   N/A 2703                BlueInMaze = 0   N/A 2704        }   N/A 2705 }   N/A 2706    N/A 2707 function CoopCrushersBlueCrush(arg){   N/A 2708        if (arg == 1){   N/A 2709                BlueInCrusher = 1   N/A 2710        }   N/A 2711        else{   N/A 2712                BlueInCrusher = 0   N/A 2713        }   N/A 2714 }   N/A 2715    N/A 2716 function CoopCrushersOrangeCrush(arg){   N/A 2717        if (arg == 1){   N/A 2718                OrangeInCrusher = 1   N/A 2719        }   N/A 2720        else{   N/A 2721                OrangeInCrusher = 0   N/A 2722        }   N/A 2723 }   N/A 2724    N/A 2725 function CoopRedirectAhead(player){   N/A 2726        if (player == coopBlue){   N/A 2727                GladosPlayVcd(1092)   N/A 2728        }   N/A 2729        else{   N/A 2730                GladosPlayVcd(1093)          N/A 2731        }   N/A 2732    N/A 2733 }   N/A 2734    N/A 2735    N/A 2736 function Fling1Drop4Balls{   N/A 2737                GladosPlayVcd(1198)          N/A 2738 }   N/A 2739    N/A 2740    N/A 2741    N/A 2742    N/A 2743    N/A 2744 function BotDeath(player,dmgtype)   N/A 2745 {   N/A 2746        printl("*******************DEATH***************************")   N/A 2747        printl("player: "+player)   N/A 2748        printl("dmg: "+dmgtype)   N/A 2749        printl("*******************DEATH***************************")   N/A 2750    N/A 2751        printldebug("*******************DEATH***************************")   N/A 2752        printldebug(player)   N/A 2753        printldebug(dmgtype)   N/A 2754        printldebug(HumanResourceDeath4)   N/A 2755        printldebug(LastDeathTime)   N/A 2756        printldebug(mp_coop_tbeam_laser_1death1)   N/A 2757        printldebug(mp_coop_tbeam_laser_1death2)   N/A 2758        printldebug("*******************DEATH***************************")   N/A 2759        local curTime=Time   N/A 2760        if (curTime-LastDeathTime<10){   N/A 2761                return   N/A 2762        }   N/A 2763        LastDeathTime=Time   N/A 2764    N/A 2765        if (curMapName == "mp_coop_tbeam_polarity3" && mp_coop_tbeam_polarity3deathblue==1 && player== coopBlue){                  N/A 2766                mp_coop_tbeam_polarity3deathblue=2   N/A 2767                GladosPlayVcd(1322)          N/A 2768                return   N/A 2769        }   N/A 2770        if (curMapName == "mp_coop_tbeam_polarity3" && mp_coop_tbeam_polarity3deathblue==0 && player== coopBlue){                  N/A 2771                mp_coop_tbeam_polarity3deathblue=1   N/A 2772                GladosPlayVcd(1323)          N/A 2773                return   N/A 2774        }   N/A 2775    N/A 2776        if (curMapName == "mp_coop_tbeam_polarity3" && mp_coop_tbeam_polarity3deathorange==1 && player== coopOrange){                  N/A 2777                mp_coop_tbeam_polarity3deathorange=2   N/A 2778                GladosPlayVcd(1325)          N/A 2779                return   N/A 2780        }   N/A 2781        if (curMapName == "mp_coop_tbeam_polarity3" && mp_coop_tbeam_polarity3deathorange==0 && player== coopOrange){                  N/A 2782                mp_coop_tbeam_polarity3deathorange=1   N/A 2783                GladosPlayVcd(1324)          N/A 2784                return   N/A 2785        }   N/A 2786    N/A 2787    N/A 2788    N/A 2789    N/A 2790    N/A 2791        if (curMapName == "mp_coop_tbeam_drill" && mp_coop_tbeam_drilldeathblue==0 && player== coopBlue){                  N/A 2792                mp_coop_tbeam_drilldeathblue=1   N/A 2793                GladosPlayVcd(1318)          N/A 2794                return   N/A 2795        }   N/A 2796        if (curMapName == "mp_coop_tbeam_drill" && mp_coop_tbeam_drilldeathorange==0 && player== coopOrange){                  N/A 2797                mp_coop_tbeam_drilldeathorange=1   N/A 2798                GladosPlayVcd(1319)          N/A 2799                return   N/A 2800        }   N/A 2801    N/A 2802        if (curMapName == "mp_coop_tbeam_polarity" && mp_coop_tbeam_polaritydeathblue==0 && player== coopBlue){                  N/A 2803                mp_coop_tbeam_polaritydeathblue=1   N/A 2804                GladosPlayVcd(1320)          N/A 2805                return   N/A 2806        }   N/A 2807        if (curMapName == "mp_coop_tbeam_polarity" && mp_coop_tbeam_polaritydeathorange==0 && player== coopOrange){                  N/A 2808                mp_coop_tbeam_polaritydeathorange=1   N/A 2809                GladosPlayVcd(1321)          N/A 2810                return   N/A 2811        }   N/A 2812    N/A 2813    N/A 2814        if (curMapName == "mp_coop_tbeam_redirect" && mp_coop_tbeam_redirectdeath==0){                  N/A 2815                mp_coop_tbeam_redirectdeath=1   N/A 2816                GladosPlayVcd(1316)          N/A 2817                return   N/A 2818        }   N/A 2819        if (curMapName == "mp_coop_lobby_2" || curMapName == "mp_coop_lobby_3"){                  N/A 2820                local tauntflag3 = GetGladosSpokenFlags( 3 ) //used for deaths   N/A 2821                if ((tauntflag3 & (1 << 1)) == 0){   N/A 2822                        tauntflag3 = tauntflag3 + (1 << 1)   N/A 2823                        AddGladosSpokenFlags( 3, tauntflag3 )   N/A 2824                        GladosPlayVcd(1199)   N/A 2825                        return   N/A 2826                }   N/A 2827                if ((tauntflag3 & (1 << 2)) == 0){   N/A 2828                        tauntflag3 = tauntflag3 + (1 << 2)   N/A 2829                        AddGladosSpokenFlags( 3, tauntflag3 )   N/A 2830                        GladosPlayVcd(1200)   N/A 2831                        return   N/A 2832                }   N/A 2833                if ((tauntflag3 & (1 << 0)) == 0){   N/A 2834                        tauntflag3 = tauntflag3 + (1 << 0)   N/A 2835                        AddGladosSpokenFlags( 3, tauntflag3 )   N/A 2836                        GladosPlayVcd(1096)   N/A 2837                        return   N/A 2838                }                  N/A 2839                if ((tauntflag3 & (1 << 3)) == 0){   N/A 2840                        tauntflag3 = tauntflag3 + (1 << 3)   N/A 2841                        AddGladosSpokenFlags( 3, tauntflag3 )   N/A 2842                        GladosPlayVcd(1201)   N/A 2843                        return   N/A 2844                }   N/A 2845                if ((tauntflag3 & (1 << 4)) == 0){   N/A 2846                        tauntflag3 = tauntflag3 + (1 << 4)   N/A 2847                        AddGladosSpokenFlags( 3, tauntflag3 )   N/A 2848                        GladosPlayVcd(1202)   N/A 2849                        return   N/A 2850                }   N/A 2851        }   N/A 2852        if (curMapName == "mp_coop_turret_walls" && mp_coop_turret_wallscount==9){                  N/A 2853                GladosPlayVcd(1192)          N/A 2854        }   N/A 2855    N/A 2856        if (curMapName == "mp_coop_turret_walls" && mp_coop_turret_wallscount==4){                  N/A 2857                GladosPlayVcd(1193)          N/A 2858        }   N/A 2859    N/A 2860        if (curMapName == "mp_coop_turret_walls" && mp_coop_turret_wallscount==2){                  N/A 2861                GladosPlayVcd(1191)          N/A 2862        }   N/A 2863    N/A 2864        if (curMapName == "mp_coop_turret_walls" && mp_coop_turret_wallscount==0){                  N/A 2865                GladosPlayVcd(1153)   N/A 2866        }          N/A 2867    N/A 2868        if (curMapName == "mp_coop_turret_walls"){                  N/A 2869                mp_coop_turret_wallscount=mp_coop_turret_wallscount+1   N/A 2870        }   N/A 2871    N/A 2872    N/A 2873        if (curMapName == "mp_coop_turret_ball" && mp_coop_turret_ballcount==2){                  N/A 2874                if (player==2){   N/A 2875                        GladosPlayVcd(1189)          N/A 2876                }   N/A 2877                else{   N/A 2878                        GladosPlayVcd(1188)          N/A 2879                }   N/A 2880                mp_coop_turret_ballcount=3   N/A 2881        }   N/A 2882    N/A 2883        if (curMapName == "mp_coop_turret_ball" && mp_coop_turret_ballcount==1){   N/A 2884                mp_coop_turret_ballcount=2   N/A 2885                GladosPlayVcd(1190)          N/A 2886        }   N/A 2887        if (curMapName == "mp_coop_turret_ball" && mp_coop_turret_ballcount==0){   N/A 2888                mp_coop_turret_ballcount=1   N/A 2889                GladosPlayVcd(1187)          N/A 2890        }          N/A 2891    N/A 2892        if (curMapName == "mp_coop_tbeam_end" ){   N/A 2893                local fireddeath = 0   N/A 2894                if (dmgtype==2 && Tbeam_enddeathturret==0){   N/A 2895                                Tbeam_enddeathturret=1   N/A 2896                                fireddeath=1   N/A 2897                                GladosPlayVcd(1180)          N/A 2898                }   N/A 2899                if (dmgtype==32 && Tbeam_enddeathfall==0){   N/A 2900                        Tbeam_enddeathfall=1   N/A 2901                        fireddeath=1   N/A 2902                        GladosPlayVcd(1179)          N/A 2903                }   N/A 2904                if (Tbeam_enddeathother==2 && fireddeath==0)   N/A 2905                {   N/A 2906                        GladosPlayVcd(1181)   N/A 2907                        Tbeam_enddeathother=Tbeam_enddeathother+1   N/A 2908                }   N/A 2909                if (Tbeam_enddeathother==1 && fireddeath==0)   N/A 2910                {   N/A 2911                        GladosPlayVcd(1182)   N/A 2912                        Tbeam_enddeathother=Tbeam_enddeathother+1   N/A 2913                }   N/A 2914                if (Tbeam_enddeathother==0 && fireddeath==0)   N/A 2915                {   N/A 2916                        GladosPlayVcd(1183)   N/A 2917                        Tbeam_enddeathother=Tbeam_enddeathother+1   N/A 2918                }                  N/A 2919                Tbeam_enddeathcounter=Tbeam_enddeathcounter+1   N/A 2920    N/A 2921        }   N/A 2922    N/A 2923    N/A 2924        if (curMapName == "mp_coop_rat_maze" )   N/A 2925        {   N/A 2926                if (player== coopBlue && dmgtype == 1 && BlueInMaze == 1 && CoopMazeBlueCrushset == 2)   N/A 2927                {   N/A 2928                                CoopMazeBlueCrushset = 3   N/A 2929                                GladosPlayVcd(1047)          N/A 2930                }   N/A 2931                if (player== coopOrange && dmgtype == 1 && OrangeInMaze == 1  && CoopMazeOrangeCrushset == 2)   N/A 2932                {   N/A 2933                                CoopMazeOrangeCrushset = 3   N/A 2934                                GladosPlayVcd(1048)          N/A 2935                }                                          N/A 2936                if (player==coopBlue && dmgtype == 1 && BlueInMaze == 1 && CoopMazeBlueCrushset == 1)   N/A 2937                {   N/A 2938                                CoopMazeBlueCrushset = 2   N/A 2939                                GladosPlayVcd(1045)          N/A 2940                }   N/A 2941                if (player== coopOrange && dmgtype == 1 && OrangeInMaze == 1  && CoopMazeOrangeCrushset == 1)   N/A 2942                {   N/A 2943                                CoopMazeOrangeCrushset = 2   N/A 2944                                GladosPlayVcd(1046)          N/A 2945                }                                  N/A 2946    N/A 2947                if (player==coopBlue && dmgtype == 1 && BlueInMaze == 1 && CoopMazeBlueCrushset == 0)   N/A 2948                {   N/A 2949                                CoopMazeBlueCrushset = 1   N/A 2950                                GladosPlayVcd(1043)          N/A 2951                }   N/A 2952                if (player== coopOrange && dmgtype == 1 && OrangeInMaze == 1  && CoopMazeOrangeCrushset == 0)   N/A 2953                {   N/A 2954                                CoopMazeOrangeCrushset = 1   N/A 2955                                GladosPlayVcd(1044)          N/A 2956                }                  N/A 2957    N/A 2958    N/A 2959        }   N/A 2960    N/A 2961        if (curMapName == "mp_coop_laser_crusher")   N/A 2962        {   N/A 2963                mp_coop_laser_crusherdeath=1   N/A 2964                if (player==coopBlue && dmgtype == 1 && BlueInCrusher == 1 && CoopCrushersBlueCrushset == 1)   N/A 2965                {   N/A 2966                                CoopCrushersOrangeCrushset = 2   N/A 2967                                CoopCrushersBlueCrushset = 2   N/A 2968                                GladosPlayVcd(1042)          N/A 2969                }   N/A 2970                if (player== coopOrange && dmgtype == 1 && OrangeInCrusher == 1  && CoopCrushersOrangeCrushset == 1)   N/A 2971                {   N/A 2972                                CoopCrushersOrangeCrushset = 2   N/A 2973                                CoopCrushersBlueCrushset = 2   N/A 2974                                GladosPlayVcd(1042)          N/A 2975                }                                  N/A 2976    N/A 2977                if (player==coopBlue && dmgtype == 1 && BlueInCrusher == 1 && CoopCrushersBlueCrushset == 0)   N/A 2978                {   N/A 2979                                CoopCrushersBlueCrushset = 1   N/A 2980                                GladosPlayVcd(1040)          N/A 2981                }   N/A 2982                if (player== coopOrange && dmgtype == 1 && OrangeInCrusher == 1  && CoopCrushersOrangeCrushset == 0)   N/A 2983                {   N/A 2984                                CoopCrushersOrangeCrushset = 1   N/A 2985                                GladosPlayVcd(1041)          N/A 2986                }                  N/A 2987    N/A 2988        }   N/A 2989        if (curMapName == "mp_coop_start")   N/A 2990        {   N/A 2991                if (startdeath==3)   N/A 2992                {   N/A 2993                        GladosPlayVcd(1086)   N/A 2994                        startdeath=startdeath+1   N/A 2995    N/A 2996                }   N/A 2997                if (startdeath==2)   N/A 2998                {   N/A 2999                        GladosPlayVcd(1085)   N/A 3000                        startdeath=startdeath+1   N/A 3001    N/A 3002                }   N/A 3003                if (startdeath==1)   N/A 3004                {   N/A 3005                        GladosPlayVcd(1084)   N/A 3006                        startdeath=startdeath+1   N/A 3007    N/A 3008                }   N/A 3009                if (player==coopBlue && startdeath==0)   N/A 3010                {   N/A 3011                        startdeath=startdeath+1   N/A 3012                        GladosPlayVcd(1088)   N/A 3013    N/A 3014                }   N/A 3015                if (player==coopOrange && startdeath==0)   N/A 3016                {   N/A 3017                        startdeath=startdeath+1   N/A 3018                        GladosPlayVcd(1087)   N/A 3019                }   N/A 3020        }   N/A 3021        if ((curMapName == "mp_coop_lobby_2" || curMapName == "mp_coop_lobby_3") && InHub2==1 && InHub2Set==0 )        {   N/A 3022                        InHub2Set=1   N/A 3023                        GladosPlayVcd(1096)   N/A 3024        }   N/A 3025        if (curMapName == "mp_coop_wall_2")        {   N/A 3026                        mp_coop_wall_2death=mp_coop_wall_2death+1   N/A 3027        }   N/A 3028        if (curMapName == "mp_coop_paint_redirect" && HumanResourceDeath1==2 ){   N/A 3029                HumanResourceDeath1=3   N/A 3030                GladosPlayVcd(1294)          N/A 3031        }   N/A 3032    N/A 3033        if (curMapName == "mp_coop_paint_redirect" && HumanResourceDeath1==1 ){   N/A 3034                HumanResourceDeath1=2   N/A 3035                GladosPlayVcd(1293)          N/A 3036        }   N/A 3037    N/A 3038        if (curMapName == "mp_coop_paint_redirect" && HumanResourceDeath1==0 ){   N/A 3039                HumanResourceDeath1=1   N/A 3040                GladosPlayVcd(1145)          N/A 3041        }   N/A 3042        if (curMapName == "mp_coop_paint_bridge" && HumanResourceDeath2==1){   N/A 3043                HumanResourceDeath2=2   N/A 3044                GladosPlayVcd(1296)          N/A 3045        }   N/A 3046        if (curMapName == "mp_coop_paint_bridge" && HumanResourceDeath2==0){   N/A 3047                HumanResourceDeath2=1   N/A 3048                GladosPlayVcd(1146)          N/A 3049        }   N/A 3050    N/A 3051        if (curMapName == "mp_coop_paint_walljumps" && HumanResourceDeath3==0){   N/A 3052                HumanResourceDeath3=1   N/A 3053                GladosPlayVcd(1150)          N/A 3054        }   N/A 3055        if (curMapName == "mp_coop_paint_red_racer" && HumanResourceDeath4==5){   N/A 3056                HumanResourceDeath4=6   N/A 3057                GladosPlayVcd(1186)          N/A 3058        }          N/A 3059        if (curMapName == "mp_coop_paint_red_racer" && HumanResourceDeath4==4){   N/A 3060                HumanResourceDeath4=HumanResourceDeath4+1   N/A 3061        }                  N/A 3062        if (curMapName == "mp_coop_paint_red_racer" && HumanResourceDeath4==3){   N/A 3063                HumanResourceDeath4=HumanResourceDeath4+1   N/A 3064        }          N/A 3065        if (curMapName == "mp_coop_paint_red_racer" && HumanResourceDeath4==2){   N/A 3066                HumanResourceDeath4=3   N/A 3067                GladosPlayVcd(1185)          N/A 3068        }   N/A 3069        if (curMapName == "mp_coop_paint_red_racer" && HumanResourceDeath4==1){   N/A 3070                HumanResourceDeath4=2   N/A 3071                GladosPlayVcd(1184)          N/A 3072        }   N/A 3073        if (curMapName == "mp_coop_paint_red_racer" && HumanResourceDeath4==0){   N/A 3074                HumanResourceDeath4=1   N/A 3075                GladosPlayVcd(1148)          N/A 3076        }   N/A 3077        if (curMapName == "mp_coop_paint_speed_catch" && HumanResourceDeath5==0){   N/A 3078                HumanResourceDeath5=1   N/A 3079                GladosPlayVcd(1149)          N/A 3080        }   N/A 3081        if (curMapName == "mp_coop_paint_speed_fling" && HumanResourceDeath6==0){   N/A 3082                HumanResourceDeath6=1   N/A 3083                GladosPlayVcd(1299)          N/A 3084        }   N/A 3085                if (curMapName == "mp_coop_paint_longjump_intro" && HumanResourceDeath7==3){   N/A 3086                HumanResourceDeath7=4   N/A 3087                GladosPlayVcd(1303)          N/A 3088        }   N/A 3089                if (curMapName == "mp_coop_paint_longjump_intro" && HumanResourceDeath7==2){   N/A 3090                HumanResourceDeath7=3   N/A 3091                GladosPlayVcd(1302)          N/A 3092        }   N/A 3093        if (curMapName == "mp_coop_paint_longjump_intro" && HumanResourceDeath7==1){   N/A 3094                HumanResourceDeath7=2   N/A 3095                GladosPlayVcd(1301)          N/A 3096        }   N/A 3097        if (curMapName == "mp_coop_paint_longjump_intro" && HumanResourceDeath7==0){   N/A 3098                HumanResourceDeath7=1   N/A 3099                GladosPlayVcd(1300)          N/A 3100        }   N/A 3101    N/A 3102    N/A 3103    N/A 3104        if (curMapName == "mp_coop_race_2"&& EarlyDeath1==0 ){   N/A 3105                EarlyDeath1=1   N/A 3106                GladosPlayVcd(1151)          N/A 3107        }   N/A 3108        if (curMapName == "mp_coop_multifling_1" &&  EarlyDeath2==0){   N/A 3109                EarlyDeath2=1   N/A 3110                GladosPlayVcd(1152)          N/A 3111                //add this line to ending if earlydeath2!=1   N/A 3112        }   N/A 3113        if (curMapName == "mp_coop_fling_crushers" && EarlyDeath3==2){   N/A 3114                EarlyDeath3=3   N/A 3115                GladosPlayVcd(1178)          N/A 3116        }   N/A 3117    N/A 3118        if (curMapName == "mp_coop_fling_crushers" && EarlyDeath3==1){   N/A 3119                EarlyDeath3=2   N/A 3120                GladosPlayVcd(1177)          N/A 3121        }   N/A 3122        if (curMapName == "mp_coop_fling_crushers" && EarlyDeath3==0){   N/A 3123                EarlyDeath3=1   N/A 3124                GladosPlayVcd(1147)          N/A 3125        }   N/A 3126    N/A 3127    N/A 3128        if (curMapName == "mp_coop_come_along" && EarlyDeath4==0){   N/A 3129                EarlyDeath4=1   N/A 3130                GladosPlayVcd(1154)          N/A 3131        }   N/A 3132        if (curMapName == "mp_coop_catapult_1" && EarlyDeath5==0){   N/A 3133                EarlyDeath5=1   N/A 3134                GladosPlayVcd(1155)          N/A 3135        }   N/A 3136        if (curMapName == "mp_coop_tbeam_laser_1" ){   N/A 3137                if (player==2 && mp_coop_tbeam_laser_1death1==0){   N/A 3138                                mp_coop_tbeam_laser_1death1=1   N/A 3139                                GladosPlayVcd(1204)          N/A 3140                                return   N/A 3141                }   N/A 3142                if (player==1 && mp_coop_tbeam_laser_1death2==0){   N/A 3143                                mp_coop_tbeam_laser_1death2=1   N/A 3144                                GladosPlayVcd(1206)          N/A 3145                }   N/A 3146                if (player==2 && mp_coop_tbeam_laser_1death3==1){   N/A 3147                                mp_coop_tbeam_laser_1death1=2   N/A 3148                                GladosPlayVcd(1205)          N/A 3149                }   N/A 3150        }   N/A 3151        if (curMapName == "mp_coop_infinifling_train" && mp_coop_infinifling_traindeath01==0){   N/A 3152                mp_coop_infinifling_traindeath01=1   N/A 3153                GladosPlayVcd(1255)          N/A 3154        }   N/A 3155        if (curMapName == "mp_coop_infinifling_train" ){   N/A 3156                        mp_coop_infinifling_traindeath=mp_coop_infinifling_traindeath+1   N/A 3157        }   N/A 3158    N/A 3159        if (curMapName == "mp_coop_catapult_wall_intro" && mp_coop_catapult_wall_introdeath==0){   N/A 3160                mp_coop_catapult_wall_introdeath=1   N/A 3161                GladosPlayVcd(1257)          N/A 3162        }   N/A 3163        if (curMapName == "mp_coop_wall_block" && mp_coop_wall_blockdeath==0){   N/A 3164                mp_coop_wall_blockdeath=1   N/A 3165                GladosPlayVcd(1258)          N/A 3166        }   N/A 3167    N/A 3168        //DLC functions   N/A 3169                DLC1_BotDeath(player,dmgtype)   N/A 3170        //   N/A 3171 }   N/A 3172    N/A 3173 function CoopCrushersBox(player){   N/A 3174                local x = RandomInt(1,100)   N/A 3175                if (x>50)   N/A 3176                {   N/A 3177                        GladosPlayVcd(1012)          N/A 3178                }   N/A 3179                else   N/A 3180                {   N/A 3181                        GladosPlayVcd(1013)          N/A 3182                }   N/A 3183 }   N/A 3184    N/A 3185    N/A 3186 function GladosCoopMapStart{   N/A 3187        local curMapName = GetMapName   N/A 3188        switch (curMapName)   N/A 3189        {   N/A 3190 ///////Calibration Course   N/A 3191                        ///function handled elsewhere          N/A 3192 ///////Team Building Course                          N/A 3193                case "mp_coop_doors":  //introduction   N/A 3194                        GladosPlayVcd(54)   N/A 3195                        break   N/A 3196                case "mp_coop_race_2":  //human sports - fewest possible points   N/A 3197                        GladosPlayVcd(1022)   N/A 3198                        break                          N/A 3199                case "mp_coop_laser_2": // potentially lethal   N/A 3200                        GladosPlayVcd(1016)   N/A 3201                        break   N/A 3202                case "mp_coop_rat_maze": //forged partnership - one lazy   N/A 3203    N/A 3204                        break   N/A 3205                case "mp_coop_laser_crusher":  //not a competition but if it were...   N/A 3206                        local x = RandomInt(1,100)   N/A 3207                        if (x>50){   N/A 3208                                GladosPlayVcd(1018)   N/A 3209                        }   N/A 3210                        else{   N/A 3211                                GladosPlayVcd(1019)   N/A 3212                        }   N/A 3213                        break   N/A 3214                case "mp_coop_teambts":  //outside the box. N/A 3215                       GladosPlayVcd(1021)   N/A 3216                        break   N/A 3217    N/A 3218 ///////Confidence Building Course                                                  N/A 3219                case "mp_coop_fling_3":   N/A 3220                        GladosPlayVcd(1029)   N/A 3221                        break   N/A 3222                case "mp_coop_infinifling_train":   N/A 3223                        GladosPlayVcd(1031)   N/A 3224                        break   N/A 3225                case "mp_coop_come_along":   N/A 3226                        GladosPlayVcd(1056)   N/A 3227                        break                  N/A 3228                case "mp_coop_fling_1":   N/A 3229                        GladosPlayVcd(1032)   N/A 3230                        break   N/A 3231                case "mp_coop_catapult_1":   N/A 3232                        GladosPlayVcd(1057)   N/A 3233                        break   N/A 3234                case "mp_coop_multifling_1":   N/A 3235                        GladosPlayVcd(1058)   N/A 3236                        break   N/A 3237                case "mp_coop_fling_crushers":   N/A 3238                        GladosPlayVcd(1059)   N/A 3239                        break   N/A 3240                case "mp_coop_fan":   N/A 3241                        GladosPlayVcd(1054)   N/A 3242                        break   N/A 3243    N/A 3244 /////////Obstacle  Building Course   N/A 3245                case "mp_coop_wall_intro":   N/A 3246                        GladosPlayVcd(1111)   N/A 3247                        break   N/A 3248                case "mp_coop_wall_2":   N/A 3249                        GladosPlayVcd(1118)   N/A 3250                        break   N/A 3251                case "mp_coop_catapult_wall_intro":   N/A 3252                        GladosPlayVcd(1117)   N/A 3253                        break   N/A 3254                case "mp_coop_wall_block":   N/A 3255                        GladosPlayVcd(1119)   N/A 3256                        break   N/A 3257                case "mp_coop_catapult_2":   N/A 3258                        GladosPlayVcd(1121)   N/A 3259                        break   N/A 3260                case "mp_coop_turret_walls": //check this is in ? N/A 3261                       GladosPlayVcd(1122)   N/A 3262                        break                          N/A 3263                case "mp_coop_turret_ball":   N/A 3264                        GladosPlayVcd(1083)   N/A 3265                        break                          N/A 3266                case "mp_coop_wall_5":   N/A 3267                        GladosPlayVcd(1060)   N/A 3268                        break   N/A 3269    N/A 3270    N/A 3271    N/A 3272    N/A 3273        ///////Subterfuge Building Course   N/A 3274                case "mp_coop_tbeam_redirect":   N/A 3275                        GladosPlayVcd(1125)          N/A 3276                        break                  N/A 3277                case "mp_coop_tbeam_drill":   N/A 3278                        if (IsLocalSplitScreen){   N/A 3279                                GladosPlayVcd(1306)   N/A 3280                        }   N/A 3281                        else{   N/A 3282                                GladosPrivateTalk(2,10)                  N/A 3283                        }   N/A 3284                        break   N/A 3285                case "mp_coop_tbeam_catch_grind_1":   N/A 3286                        local x = RandomInt(1,100)   N/A 3287                        if (x>50)   N/A 3288                        {   N/A 3289                                GladosPlayVcd(1080)          N/A 3290                                bluetrust=1   N/A 3291                        }   N/A 3292                        else   N/A 3293                        {   N/A 3294                                GladosPlayVcd(1081)          N/A 3295                                orangetrust=1   N/A 3296                        }   N/A 3297                        break   N/A 3298                case "mp_coop_tbeam_laser_1":   N/A 3299                        GladosPlayVcd(1073)          N/A 3300                        break   N/A 3301                case "mp_coop_tbeam_polarity":   N/A 3302                        local x = RandomInt(1,100)   N/A 3303                        if (x>50)   N/A 3304                        {   N/A 3305                                GladosPlayVcd(1069)          N/A 3306                                bluetrust=1   N/A 3307                        }   N/A 3308                        else   N/A 3309                        {   N/A 3310                                GladosPlayVcd(1070)          N/A 3311                                orangetrust=1   N/A 3312                        }   N/A 3313                        break   N/A 3314                case "mp_coop_tbeam_polarity2":   N/A 3315                        local x = RandomInt(1,100)   N/A 3316                        if (x>50)   N/A 3317                        {   N/A 3318                                GladosPlayVcd(1090)          N/A 3319                        }   N/A 3320                        else   N/A 3321                        {   N/A 3322                                GladosPlayVcd(1091)          N/A 3323                        }   N/A 3324                        break                  N/A 3325                case "mp_coop_tbeam_polarity3":   N/A 3326                        GladosPlayVcd(1261)          N/A 3327    N/A 3328                        break                  N/A 3329                case "mp_coop_tbeam_maze":   N/A 3330                        GladosPlayVcd(1127)          N/A 3331                        break                  N/A 3332                case "mp_coop_tbeam_end":   N/A 3333                                GladosPlayVcd(1129)          N/A 3334 //                        GladosPrivateTalk(2,9)                  N/A 3335                        break   N/A 3336    N/A 3337 /////////XXXXXX  Building Course   N/A 3338                case "mp_coop_paint_come_along":   N/A 3339                        GladosPlayVcd(1131)          N/A 3340                        break                  N/A 3341                case "mp_coop_paint_redirect":   N/A 3342                        GladosPlayVcd(1133)          N/A 3343                        break                  N/A 3344                case "mp_coop_paint_bridge":   N/A 3345                        GladosPlayVcd(1135)          N/A 3346                        break                  N/A 3347                case "mp_coop_paint_walljumps":   N/A 3348                        GladosPlayVcd(1137)          N/A 3349                        break                  N/A 3350                case "mp_coop_paint_speed_fling":   N/A 3351                        GladosPlayVcd(1139)          N/A 3352                        break                  N/A 3353                case "mp_coop_paint_red_racer":   N/A 3354                        GladosPlayVcd(1141)          N/A 3355                        break                  N/A 3356                case "mp_coop_paint_speed_catch":   N/A 3357                        GladosPlayVcd(1175)          N/A 3358                        break                  N/A 3359                case "mp_coop_paint_longjump_intro":   N/A 3360                        GladosPlayVcd(1143)          N/A 3361                        break   N/A 3362    N/A 3363        }   N/A 3364    N/A 3365        //DLC functions   N/A 3366                DLC1_GladosCoopMapStart   N/A 3367        //-   N/A 3368    N/A 3369        StartSpeedRunTimer   N/A 3370 }   N/A 3371    N/A 3372    N/A 3373 //plays when exit door opens   N/A 3374 function GladosCoopOpenExitDoor(player)   N/A 3375 {   N/A 3376        //endmap stuff   N/A 3377        local mapname = GetMapName   N/A 3378        printldebug("****=================================Player "+player+" map NEW CODE"+mapname)   N/A 3379        if (debug)   N/A 3380                printldebug("****=================================Player "+player+" map "+mapname)   N/A 3381        if (coopTriggeredElevator)   N/A 3382        {   N/A 3383                return   N/A 3384        }   N/A 3385        coopTriggeredElevator = true   N/A 3386        EntFire( "@relay_disable_exit", "Trigger", "", 0.0 )   N/A 3387        switch (mapname)   N/A 3388        {   N/A 3389 ///////Calibration Course   N/A 3390                case "mp_coop_start": //DONE   N/A 3391                        EntFire( "@relay_enable_exit", "Trigger", "", 0 )   N/A 3392                        //plays at the end of the taunt stuff   N/A 3393                        break          N/A 3394    N/A 3395 ///////Team Building Course   N/A 3396                case "mp_coop_doors":         //Done   N/A 3397                        GladosPlayVcd(1011)   N/A 3398                        break          N/A 3399                case "mp_coop_race_2":         //Done   N/A 3400                        EntFire( "@relay_enable_exit", "Trigger", "", 0 )                          N/A 3401                        // plays off putting ball in CoopRacePlaceBox   N/A 3402                        break   N/A 3403                case "mp_coop_laser_2": //Done   N/A 3404                        GladosPlayVcd(18)   N/A 3405                        break   N/A 3406                case "mp_coop_rat_maze": //Done   N/A 3407                        local x = RandomInt(1,100)   N/A 3408                        if (x>50){   N/A 3409                                GladosPlayVcd(1036)   N/A 3410                        }   N/A 3411                        else{   N/A 3412                                GladosPlayVcd(1037)   N/A 3413                        }   N/A 3414                        break   N/A 3415                case "mp_coop_laser_crusher": // Done   N/A 3416                        if (mp_coop_laser_crusherdeath==0){   N/A 3417                                if (player == coopBlue){   N/A 3418                                        GladosPlayVcd(23)   N/A 3419                                }   N/A 3420                                else{   N/A 3421                                        GladosPlayVcd(24)   N/A 3422                                }   N/A 3423                        }   N/A 3424                        else{   N/A 3425                                        GladosPlayVcd(1170)   N/A 3426                        }   N/A 3427                        break   N/A 3428    N/A 3429    N/A 3430    N/A 3431 ///////Confidence Building Course                          N/A 3432                case "mp_coop_fling_3":   N/A 3433                        GladosPlayVcd(1030)   N/A 3434                        break   N/A 3435                case "mp_coop_infinifling_train":   N/A 3436                        if (mp_coop_infinifling_traindeath>0){   N/A 3437                                GladosPlayVcd(1049)   N/A 3438                        }   N/A 3439                        else{   N/A 3440                                GladosPlayVcd(1050)   N/A 3441                        }   N/A 3442                        break   N/A 3443                case "mp_coop_come_along":   N/A 3444                        if (EarlyDeath4==0){   N/A 3445                                GladosPlayVcd(1172)   N/A 3446                        }   N/A 3447                        else{   N/A 3448                                GladosPlayVcd(1171)   N/A 3449                        }   N/A 3450 //                        GladosPlayVcd(1034) - removed   N/A 3451                        break                  N/A 3452                case "mp_coop_fling_1":  //deliberatly blank   N/A 3453                        EntFire( "@relay_enable_exit", "Trigger", "", 0.0 )   N/A 3454                        break   N/A 3455                case "mp_coop_catapult_1":            N/A 3456                        EntFire( "@relay_enable_exit", "Trigger", "", 0.0 )   N/A 3457                        //end speech fired in taunt response   N/A 3458    N/A 3459                        break   N/A 3460                case "mp_coop_multifling_1": // Done   N/A 3461                        if (EarlyDeath2==0){   N/A 3462                                GladosPlayVcd(1162)          N/A 3463                        }   N/A 3464                        else{   N/A 3465                                GladosPlayVcd(1052)   N/A 3466                        }   N/A 3467                        break                                          N/A 3468                case "mp_coop_fling_crushers": //Map 6   N/A 3469                        if (EarlyDeath3>0){   N/A 3470                                        GladosPlayVcd(1176)   N/A 3471                        }   N/A 3472                        else{   N/A 3473                                        GladosPlayVcd(1053)   N/A 3474                        }   N/A 3475                        break   N/A 3476                ////mp_coop_fan end with CoopBlueprintRoom function          N/A 3477    N/A 3478 ///////Obstacle Building Course                  N/A 3479                case "mp_coop_wall_intro":   N/A 3480                        GladosPlayVcd(1063)   N/A 3481                        break   N/A 3482                case "mp_coop_wall_2":   N/A 3483                        if (mp_coop_wall_2death==0){   N/A 3484                                GladosPlayVcd(1113)   N/A 3485                                break   N/A 3486                        }   N/A 3487                        if (mp_coop_wall_2death==1){   N/A 3488                                GladosPlayVcd(1115)   N/A 3489                                break   N/A 3490                        }   N/A 3491                        if (mp_coop_wall_2death==2){   N/A 3492                                GladosPlayVcd(1116)   N/A 3493                                break   N/A 3494                        }   N/A 3495                        GladosPlayVcd(1114)   N/A 3496                        break   N/A 3497                case "mp_coop_catapult_wall_intro":   N/A 3498                        GladosPlayVcd(1082)   N/A 3499                        break   N/A 3500                case "mp_coop_wall_block":   N/A 3501                        if (mp_coop_wall_blockdeath==1){   N/A 3502                                GladosPlayVcd(1259)   N/A 3503                        }   N/A 3504                        else{   N/A 3505                                GladosPlayVcd(1120)   N/A 3506                        }   N/A 3507                        break   N/A 3508                case "mp_coop_catapult_2":   N/A 3509                                GladosPlayVcd(1144)   N/A 3510                                break   N/A 3511    N/A 3512    N/A 3513                case "mp_coop_turret_walls":   N/A 3514                        if (mp_coop_turret_wallscount==0){   N/A 3515                                GladosPlayVcd(1123)   N/A 3516                        }   N/A 3517                        else{   N/A 3518                                GladosPlayVcd(1260)   N/A 3519                        }   N/A 3520                        break                          N/A 3521                case "mp_coop_turret_ball":   N/A 3522                        GladosPlayVcd(1124)   N/A 3523                        break                  N/A 3524                case "mp_coop_wall_5":   N/A 3525                        GladosPlayVcd(15)   N/A 3526                        break   N/A 3527 ///////Subterfuge Buidling Course   N/A 3528                case "mp_coop_tbeam_redirect":   N/A 3529                        //moved to normal ending as one in front is rarely end. N/A 3530                       break                  N/A 3531                case "mp_coop_tbeam_drill":   N/A 3532                        if (IsLocalSplitScreen){   N/A 3533                                GladosPlayVcd(1307)   N/A 3534                        }   N/A 3535                        else{   N/A 3536                                GladosPrivateTalk(2,4)                  N/A 3537                                EntFire( "@relay_enable_exit", "Trigger", "", 15.0 )                          N/A 3538                        }   N/A 3539    N/A 3540                        break                  N/A 3541                case "mp_coop_tbeam_catch_grind_1":   N/A 3542                        // chet, I swapped this withtbeam_laser_1 so we can grant the trickfire there -mtw   N/A 3543                        GladosPlayVcd(1256)          N/A 3544                        break                  N/A 3545                case "mp_coop_tbeam_laser_1":   N/A 3546                        //none here anymore because we gran the trickfire here -mtw                          N/A 3547                        break                  N/A 3548                case "mp_coop_tbeam_polarity":   N/A 3549                        if (bluetrust==1)   N/A 3550                        {   N/A 3551                                GladosPlayVcd(1071)          N/A 3552                        }   N/A 3553                        else   N/A 3554                        {   N/A 3555                                GladosPlayVcd(1072)          N/A 3556                        }   N/A 3557                        break                  N/A 3558                case "mp_coop_tbeam_polarity2":   N/A 3559                        printldebug(">"+polarity2whisper)   N/A 3560                        if (polarity2whisper == 2){                  N/A 3561                                GladosPlayVcd(1309)          N/A 3562                        }   N/A 3563                        else{   N/A 3564                                GladosPlayVcd(1308)          N/A 3565                        }   N/A 3566                        break                  N/A 3567                case "mp_coop_tbeam_polarity3":   N/A 3568                        GladosPlayVcd(1174)          N/A 3569                        break                  N/A 3570                case "mp_coop_tbeam_maze":   N/A 3571                                GladosPlayVcd(1128)                  N/A 3572 //                        GladosPrivateTalk(2,5)                  N/A 3573        //                EntFire( "@relay_enable_exit", "Trigger", "", 10.0 )                          N/A 3574                        break                  N/A 3575                case "mp_coop_tbeam_end":   N/A 3576                        GladosPlayVcd(15)                  N/A 3577                        break   N/A 3578    N/A 3579 /////////XXXXXX  Building Course   N/A 3580                case "mp_coop_paint_come_along":   N/A 3581                        GladosPlayVcd(1132)                  N/A 3582                        break                  N/A 3583                case "mp_coop_paint_redirect":   N/A 3584                        GladosPlayVcd(1295)                  N/A 3585                        break                  N/A 3586                case "mp_coop_paint_bridge":   N/A 3587                        if (HumanResourceDeath2>0){   N/A 3588                                        GladosPlayVcd(1297)                  N/A 3589                        }   N/A 3590                        else{   N/A 3591                                        GladosPlayVcd(1298)                  N/A 3592                        }   N/A 3593                        break                  N/A 3594                case "mp_coop_paint_walljumps":   N/A 3595                        GladosPlayVcd(1138)                  N/A 3596                        break                  N/A 3597                case "mp_coop_paint_speed_fling":   N/A 3598                        GladosPlayVcd(1140)   N/A 3599                        break                  N/A 3600                case "mp_coop_paint_red_racer":   N/A 3601                        GladosPlayVcd(1142)                  N/A 3602                        break                  N/A 3603                case "mp_coop_paint_speed_catch":   N/A 3604                        GladosPlayVcd(1262)                  N/A 3605                        break                  N/A 3606                case "mp_coop_paint_longjump_intro":   N/A 3607                        GladosPlayVcd(15)                  N/A 3608                        break   N/A 3609        }   N/A 3610    N/A 3611        //DLC functions   N/A 3612                DLC1_GladosCoopOpenExitDoor(player)   N/A 3613        //-   N/A 3614    N/A 3615        EndSpeedRunTimer   N/A 3616    N/A 3617        CheckAchievementsOnExitDoorOpen   N/A 3618 }   N/A 3619    N/A 3620 function CheckAchievementsOnExitDoorOpen   N/A 3621 {   N/A 3622        // If the player completed the specified map using only a few portals. N/A 3623       if ( GetMapName == LIMITED_PORTALS_MAP &&   N/A 3624             CoopGetNumPortalsPlaced <= LIMITED_PORTALS_COUNT )   N/A 3625        {   N/A 3626                RecordAchievementEvent( "ACH.LIMITED_PORTALS", GetBluePlayerIndex )   N/A 3627                RecordAchievementEvent( "ACH.LIMITED_PORTALS", GetOrangePlayerIndex )   N/A 3628        }   N/A 3629 }   N/A 3630    N/A 3631 function StartSpeedRunTimer   N/A 3632 {   N/A 3633        mp_coop_speed_run_time = Time   N/A 3634 }   N/A 3635    N/A 3636 function EndSpeedRunTimer   N/A 3637 {   N/A 3638        local run_length = Time - mp_coop_speed_run_time   N/A 3639        SetMapRunTime( run_length )   N/A 3640 }   N/A 3641    N/A 3642 function SetMapRunTime( flTime )   N/A 3643 {   N/A 3644        // cap it at two hours   N/A 3645        if ( flTime > 7200.0 )   N/A 3646        {   N/A 3647                flTime = 7200.0   N/A 3648        }   N/A 3649    N/A 3650        CoopSetMapRunTime( flTime )   N/A 3651    N/A 3652        if ( flTime < SPEED_RUN_THRESHOLD &&   N/A 3653             GetCoopSectionIndex == SPEED_RUN_SECTION )   N/A 3654        {   N/A 3655                NotifySpeedRunSuccess( flTime, GetMapName )   N/A 3656        }   N/A 3657 }   N/A 3658    N/A 3659 function CoopRacePlaceBox   N/A 3660 {   N/A 3661        local mapname = GetMapName   N/A 3662        if (mapname == "mp_coop_race_2")   N/A 3663        {   N/A 3664                GladosPlayVcd(19)   N/A 3665        }   N/A 3666 }   N/A 3667    N/A 3668    N/A 3669    N/A 3670 //Plays the final audio for each level   N/A 3671 function GladosCoopElevatorEntrance(arg)   N/A 3672 {   N/A 3673        printldebug("====================================Player "+arg+" OLD CODE")   N/A 3674        local mapname = GetMapName   N/A 3675        switch (mapname)   N/A 3676        {   N/A 3677 /////////Calibration Course   N/A 3678 //                case "mp_coop_start": //DONE   N/A 3679 //                        EntFire( "@relay_enable_exit", "Trigger", "", 0.0 )   N/A 3680 //                        //plays at the end of the taunt stuff   N/A 3681 //                        break          N/A 3682 //   N/A 3683 /////////Team Building Course   N/A 3684 //                case "mp_coop_doors":         //Done   N/A 3685 //                        GladosPlayVcd(1011)   N/A 3686 //                        break          N/A 3687 //                case "mp_coop_race_2":         //Done   N/A 3688 //                        GladosPlayVcd(19)   N/A 3689 //                        break   N/A 3690 //                case "mp_coop_laser_2": //Done   N/A 3691 //                        GladosPlayVcd(18)   N/A 3692 //                        break   N/A 3693 //                case "mp_coop_rat_maze": //Done   N/A 3694 //                        local x = RandomInt(1,100)   N/A 3695 //                        if (x>50){   N/A 3696 //                                GladosPlayVcd(1036)   N/A 3697 //                        }   N/A 3698 //                        else{   N/A 3699 //                                GladosPlayVcd(1037)   N/A 3700 //                        }   N/A 3701 //                        break   N/A 3702 //                case "mp_coop_laser_crusher": // Done   N/A 3703 //                        if (arg == coopBlue)   N/A 3704 //                                GladosPlayVcd(23)   N/A 3705 //                        else   N/A 3706 //                                GladosPlayVcd(24)   N/A 3707 //                        break   N/A 3708 //                //mp_coop_teambts end with GladosCoopEnterRadarRoom function          N/A 3709 //   N/A 3710 //   N/A 3711 /////////Confidence Building Course                          N/A 3712 //                case "mp_coop_fling_3":   N/A 3713 //                        GladosPlayVcd(1030)   N/A 3714 //                        break   N/A 3715 //                case "mp_coop_infinifling_train":   N/A 3716 //                        if (mp_coop_infinifling_traindeath>0){   N/A 3717 //                                GladosPlayVcd(1049)   N/A 3718 //                        }   N/A 3719 //                        else{   N/A 3720 //                                GladosPlayVcd(1050)   N/A 3721 //                        }   N/A 3722 //                        break   N/A 3723 //                case "mp_coop_come_along":   N/A 3724 //                        GladosPlayVcd(1034)   N/A 3725 //                        break                  N/A 3726 //                case "mp_coop_fling_1":  //deliberatly blank   N/A 3727 //                        EntFire( "@relay_enable_exit", "Trigger", "", 0.0 )   N/A 3728 //                        break   N/A 3729 //                case "mp_coop_catapult_1":            N/A 3730 //                        EntFire( "@relay_enable_exit", "Trigger", "", 0.0 )   N/A 3731 //                        //end speech fired in taunt response   N/A 3732 //   N/A 3733 //                        break   N/A 3734 //                case "mp_coop_multifling_1": // Done   N/A 3735 //                        GladosPlayVcd(1052)   N/A 3736 //                        break                                          N/A 3737 //                case "mp_coop_fling_crushers": //Map 6   N/A 3738 //                        GladosPlayVcd(1053)   N/A 3739 //                        break   N/A 3740 //                ////mp_coop_fan end with CoopBlueprintRoom function          N/A 3741 //                          N/A 3742 /////////Obstacle Building Course                  N/A 3743 //                case "mp_coop_wall_intro":   N/A 3744 //                        GladosPlayVcd(1082)   N/A 3745 //                        break   N/A 3746 //                case "mp_coop_wall_2":   N/A 3747 //                        GladosPlayVcd(15)   N/A 3748 //                        break   N/A 3749 //                case "mp_coop_catapult_wall_intro":   N/A 3750 //                        GladosPlayVcd(15)   N/A 3751 //                        break   N/A 3752 //                case "mp_coop_wall_block":   N/A 3753 //                        GladosPlayVcd(15)   N/A 3754 //                        break   N/A 3755 //                case "mp_coop_catapult_2":   N/A 3756 ////                        if (OrangeTalk>500 && BlueTalk==0)   N/A 3757 ////                                GladosPlayVcd(15)   N/A 3758 ////                        break   N/A 3759 ////                        }   N/A 3760 ////                        else{   N/A 3761 ////                                if (BlueTalk>500 && OrangeTalk==0)   N/A 3762 ////                                        GladosPlayVcd(15)   N/A 3763 ////                                        break   N/A 3764 ////                                }   N/A 3765 ////   N/A 3766 ////                        }   N/A 3767 //                                GladosPlayVcd(15)   N/A 3768 //                                break   N/A 3769 //                                //didn't hook up sound stuff because quiet person may still  have noisy avatar - need more thinking on this. N/A 3770 //  N/A 3771 //   N/A 3772 //                case "mp_coop_turret_walls":   N/A 3773 //                        GladosPlayVcd(15)   N/A 3774 //                        break                          N/A 3775 //                case "mp_coop_turret_ball":   N/A 3776 //                        GladosPlayVcd(15)   N/A 3777 //                        break                  N/A 3778 //                case "mp_coop_wall_5":   N/A 3779 //                        GladosPlayVcd(15)   N/A 3780 //                        break   N/A 3781 /////////Subterfuge Buidling Course   N/A 3782                case "mp_coop_tbeam_redirect":   N/A 3783                        if (IsLocalSplitScreen){   N/A 3784                                GladosPlayVcd(1305)   N/A 3785                        }   N/A 3786                        else{   N/A 3787                                EntFire( "@relay_disable_exit", "Trigger", "", 0.0 )   N/A 3788                                GladosPrivateTalk(1,1)                  N/A 3789                                EntFire( "@relay_enable_exit", "Trigger", "", 13.0 )                          N/A 3790                                break                  N/A 3791                        }   N/A 3792 //                case "mp_coop_tbeam_drill":   N/A 3793 //                        GladosPrivateTalk(2,4)                  N/A 3794 //                        EntFire( "@relay_enable_exit", "Trigger", "", 15.0 )                          N/A 3795 //                        break                  N/A 3796 //                case "mp_coop_tbeam_catch_grind_1":   N/A 3797 //                        GladosPrivateTalk(1,2)                  N/A 3798 //                        EntFire( "@relay_enable_exit", "Trigger", "", 14.0 )                          N/A 3799 //                        break                  N/A 3800 //                case "mp_coop_tbeam_laser_1":   N/A 3801 //                        GladosPrivateTalk(2,3)                  N/A 3802 //                        EntFire( "@relay_enable_exit", "Trigger", "", 12.0 )                          N/A 3803 //                        break                  N/A 3804 //                case "mp_coop_tbeam_polarity":   N/A 3805 //                        if (bluetrust==1)   N/A 3806 //                        {   N/A 3807 //                                GladosPlayVcd(1071)          N/A 3808 //                        }   N/A 3809 //                        else   N/A 3810 //                        {   N/A 3811 //                                GladosPlayVcd(1072)          N/A 3812 //                        }   N/A 3813 //                        break                  N/A 3814 //                case "mp_coop_tbeam_polarity2":   N/A 3815 //                        GladosPlayVcd(15)                  N/A 3816 //                        break                  N/A 3817 //                case "mp_coop_tbeam_polarity3":   N/A 3818 //                        GladosPlayVcd(15)                  N/A 3819 //                        break                  N/A 3820 //                case "mp_coop_tbeam_maze":   N/A 3821 //                        GladosPrivateTalk(2,5)                  N/A 3822 //                        EntFire( "@relay_enable_exit", "Trigger", "", 10.0 )                          N/A 3823 //                        break                  N/A 3824 //                case "mp_coop_tbeam_end":   N/A 3825 //                        GladosPlayVcd(15)                  N/A 3826 //                        break   N/A 3827 //   N/A 3828 ///////////XXXXXX  Building Course   N/A 3829 //                case "mp_coop_paint_come_along":   N/A 3830 //                        GladosPlayVcd(15)                  N/A 3831 //                        break                  N/A 3832 //                case "mp_coop_paint_redirect":   N/A 3833 //                        GladosPlayVcd(15)                  N/A 3834 //                        break                  N/A 3835 //                case "mp_coop_paint_bridge":   N/A 3836 //                        GladosPlayVcd(15)                  N/A 3837 //                        break                  N/A 3838 //                case "mp_coop_paint_walljumps":   N/A 3839 //                        GladosPlayVcd(15)                  N/A 3840 //                        break                  N/A 3841 //                case "mp_coop_paint_speed_fling":   N/A 3842 //                        GladosPlayVcd(15)   N/A 3843 //                        break                  N/A 3844 //                case "mp_coop_paint_red_racer":   N/A 3845 //                        GladosPlayVcd(15)                  N/A 3846 //                        break                  N/A 3847 //                case "mp_coop_paint_speed_catch":   N/A 3848 //                        GladosPlayVcd(15)                  N/A 3849 //                        break                  N/A 3850 //                case "mp_coop_paint_longjump_intro":   N/A 3851 //                        GladosPlayVcd(15)                  N/A 3852 //                        break   N/A 3853        }   N/A 3854 }   N/A 3855    N/A 3856    N/A 3857    N/A 3858    N/A 3859 function CoopPingTool(player,surface)   N/A 3860 {   N/A 3861        local curTime = Time   N/A 3862        local mapname = GetMapName   N/A 3863        printldebug(surface)   N/A 3864        if (player == coopBlue){                  N/A 3865                if (BlueInPortalTraining == 1 && BlueHasGun == 0 && mapname == "mp_coop_start"){   N/A 3866                        local BluePingInterval = curTime-BlueLastPing   N/A 3867                        local BluePingInterval2 = curTime-BluePortalTrainingCounter   N/A 3868                        BlueLastPing = curTime   N/A 3869                        if (surface==1 && BluePortalTrainingCounter==0 && BluePingTraining1==0){   N/A 3870                                BluePortalTrainingCounter=Time   N/A 3871                                BluePingInterval2=0   N/A 3872                                BluePingTraining1=1   N/A 3873                                GladosPlayVcd(1000)   N/A 3874    N/A 3875                        }   N/A 3876                        if (surface==1 && BluePingInterval2>7 && BluePortalTrainingCounter!=0  && BluePingTraining2==0){   N/A 3877                                BluePortalTrainingCounter=0   N/A 3878                                BluePingTraining2=1   N/A 3879                                GladosPlayVcd(1001)   N/A 3880                        }                  N/A 3881                }   N/A 3882        }   N/A 3883    N/A 3884        if (player == coopOrange){                  N/A 3885                if (OrangeInPortalTraining == 1 && OrangeHasGun == 0 && mapname == "mp_coop_start"){   N/A 3886                        local OrangePingInterval = curTime-OrangeLastPing   N/A 3887                        local OrangePingInterval2 = curTime-OrangePortalTrainingCounter   N/A 3888                        OrangeLastPing = curTime   N/A 3889                        if (surface==1 && OrangePortalTrainingCounter==0 && OrangePingTraining1==0){   N/A 3890                                OrangePortalTrainingCounter=Time   N/A 3891                                OrangePingInterval2=0   N/A 3892                                OrangePingTraining1=1   N/A 3893                                GladosPlayVcd(1014)   N/A 3894    N/A 3895                        }   N/A 3896                        if (surface==1 && OrangePingInterval2>7 && OrangePortalTrainingCounter!=0  && OrangePingTraining2==0){   N/A 3897                                OrangePortalTrainingCounter=0   N/A 3898                                OrangePingTraining2=1   N/A 3899                                GladosPlayVcd(1015)   N/A 3900                        }                  N/A 3901                }   N/A 3902        }   N/A 3903 }   N/A 3904    N/A 3905 /////// Subterfuge section   N/A 3906    N/A 3907 function CoopPolarityWhisper(player){   N/A 3908        if (player == coopBlue){                  N/A 3909                                GladosPlayVcd(1066)   N/A 3910                                polarity2whisper=2   N/A 3911        }   N/A 3912        else{   N/A 3913                                GladosPlayVcd(1067)   N/A 3914                                polarity2whisper=1   N/A 3915        }   N/A 3916 }   N/A 3917    N/A 3918    N/A 3919    N/A 3920 function CoopReturnHubTrack01{   N/A 3921        local tVcd   N/A 3922        tVcd=RandomInt(1263,1266)   N/A 3923        printldebug("THIS IS RANDOM:"+ tVcd)   N/A 3924        GladosPlayVcd(tVcd)   N/A 3925 }   N/A 3926    N/A 3927 function CoopReturnHubTrack02{   N/A 3928        local tVcd   N/A 3929        tVcd=RandomInt(1267,1270)   N/A 3930        printldebug("THIS IS RANDOM:"+ tVcd)   N/A 3931        GladosPlayVcd(tVcd)   N/A 3932    N/A 3933 }   N/A 3934    N/A 3935 function CoopReturnHubTrack03{   N/A 3936        local tVcd   N/A 3937        tVcd=RandomInt(1271,1273)   N/A 3938        printldebug("THIS IS RANDOM:"+ tVcd)   N/A 3939        GladosPlayVcd(tVcd)   N/A 3940 }   N/A 3941    N/A 3942 function CoopReturnHubTrack04{   N/A 3943        local tVcd   N/A 3944        tVcd=RandomInt(1274,1276)   N/A 3945        printldebug("THIS IS RANDOM:"+ tVcd)   N/A 3946        GladosPlayVcd(tVcd)   N/A 3947 }   N/A 3948    N/A 3949 function CoopReturnHubTrack05{   N/A 3950        local tVcd   N/A 3951        tVcd=RandomInt(1277,1279)   N/A 3952        printldebug("THIS IS RANDOM:"+ tVcd)   N/A 3953        GladosPlayVcd(tVcd)   N/A 3954 }   N/A 3955    N/A 3956 function CoopReturnHubTrack06{        // FIX ME   N/A 3957        local tVcd   N/A 3958        tVcd=RandomInt(1277,1279)   N/A 3959        printldebug("THIS IS RANDOM:"+ tVcd)   N/A 3960        GladosPlayVcd(tVcd)   N/A 3961 }   N/A 3962    N/A 3963 function CoopReturnHubAllFinished{   N/A 3964        local tVcd   N/A 3965        tVcd=RandomInt(1280,1286)   N/A 3966        printldebug("THIS IS RANDOM:"+ tVcd)   N/A 3967        GladosPlayVcd(tVcd)   N/A 3968    N/A 3969 }   N/A 3970    N/A 3971 function PlayerTauntCamera (player,animation){   N/A 3972        printldebug("===============>CAMERA GESTURE!"+player+" x "+animation)   N/A 3973         //added to block playing of responses while at vault door. N/A 3974        if (curMapName == "mp_coop_paint_longjump_intro"){   N/A 3975                 return   N/A 3976         }   N/A 3977    N/A 3978         local curTime=Time   N/A 3979        if (curTime-LastTauntTime<5){   N/A 3980                return   N/A 3981        }   N/A 3982        LastTauntTime=Time   N/A 3983        local tauntflag0 = GetGladosSpokenFlags( 0 )  //30   N/A 3984        local tauntflag1 = GetGladosSpokenFlags( 1 )  //18   N/A 3985        local tauntflag2 = GetGladosSpokenFlags( 2 )   N/A 3986        local tauntflag3 = GetGladosSpokenFlags( 3 ) //4 used for deaths   N/A 3987    N/A 3988        if (((tauntflag1 & (1 << 18)) == 0) && (curMapName == "mp_coop_race_2" || curMapName == "mp_coop_laser_2" || curMapName == "mp_coop_fling_3")){   N/A 3989                local TellStory = 0   N/A 3990                local Player2   N/A 3991                while ( Player2 = Entities.FindByName ( Player2, "blue" )  )   N/A 3992                {   N/A 3993            print ( "Canceling:\t" + Player2.GetName + "\n" )   N/A 3994            if (Player2 !=null){   N/A 3995                    break   N/A 3996            }   N/A 3997                }   N/A 3998                if ( Player2!=null){   N/A 3999                        local vecPlayerPos=Player2.GetOrigin   N/A 4000                        local Door   N/A 4001                        while ( Door = (Entities.FindByNameNearest( "@exit_door", vecPlayerPos, 600 )) )   N/A 4002                        {   N/A 4003                    if        (Door !=null){   N/A 4004                            TellStory = 1   N/A 4005                break   N/A 4006                    }   N/A 4007                        }   N/A 4008                }   N/A 4009                if (TellStory==0){   N/A 4010                        tauntflag1 = tauntflag1 + (1 << 18)   N/A 4011                        AddGladosSpokenFlags( 1, tauntflag1 )   N/A 4012                        GladosPlayVcd(1330)   N/A 4013                        return   N/A 4014                }    N/A 4015        }        N/A 4016    N/A 4017        if ( animation == "smallWave" ){   N/A 4018                if ((tauntflag0 & (1 << 0)) == 0){   N/A 4019                        tauntflag0 = tauntflag0 + (1 << 0)   N/A 4020                        AddGladosSpokenFlags( 0, tauntflag0 )   N/A 4021                        GladosPlayVcd(1227)   N/A 4022                        return   N/A 4023                }   N/A 4024                if ((tauntflag0 & (1 << 1)) == 0){   N/A 4025                        tauntflag0 = tauntflag0 + (1 << 1)   N/A 4026                        AddGladosSpokenFlags( 0, tauntflag0 )   N/A 4027                        GladosPlayVcd(1228)   N/A 4028                        return   N/A 4029                }   N/A 4030                if ((tauntflag0 & (1 << 2)) == 0){   N/A 4031                        tauntflag0 = tauntflag0 + (1 << 2)   N/A 4032                        AddGladosSpokenFlags( 0, tauntflag0 )   N/A 4033                        GladosPlayVcd(1229)   N/A 4034                        return   N/A 4035                }   N/A 4036                if ((tauntflag0 & (1 << 26)) == 0){   N/A 4037                        tauntflag0 = tauntflag0 + (1 << 26)   N/A 4038                        AddGladosSpokenFlags( 0, tauntflag0 )   N/A 4039                        GladosPlayVcd(1234)   N/A 4040                        return   N/A 4041                }   N/A 4042                if ((tauntflag0 & (1 << 28)) == 0){   N/A 4043                        tauntflag0 = tauntflag0 + (1 << 28)   N/A 4044                        AddGladosSpokenFlags( 0, tauntflag0 )   N/A 4045                        GladosPlayVcd(1236)   N/A 4046                        return   N/A 4047                }                  N/A 4048                if ((tauntflag0 & (1 << 29)) == 0){   N/A 4049                        tauntflag0 = tauntflag0 + (1 << 29)   N/A 4050                        AddGladosSpokenFlags( 0, tauntflag0 )   N/A 4051                        GladosPlayVcd(1237)   N/A 4052                        return   N/A 4053                }                  N/A 4054                if ((tauntflag0 & (1 << 30)) == 0){   N/A 4055                        tauntflag0 = tauntflag0 + (1 << 30)   N/A 4056                        AddGladosSpokenFlags( 0, tauntflag0 )   N/A 4057                        GladosPlayVcd(1238)   N/A 4058                        return   N/A 4059                }                                  N/A 4060        }   N/A 4061    N/A 4062    N/A 4063        if ( animation == "highFive" ){   N/A 4064                if ((tauntflag0 & (1 << 3)) == 0){   N/A 4065                        tauntflag0 = tauntflag0 + (1 << 3)   N/A 4066                        AddGladosSpokenFlags( 0, tauntflag0 )   N/A 4067                        GladosPlayVcd(1207)   N/A 4068                        return   N/A 4069                }   N/A 4070                if ((tauntflag0 & (1 << 4)) == 0){   N/A 4071                        tauntflag0 = tauntflag0 + (1 << 4)   N/A 4072                        AddGladosSpokenFlags( 0, tauntflag0 )   N/A 4073                        GladosPlayVcd(1208)   N/A 4074                        return   N/A 4075                }   N/A 4076                if ((tauntflag0 & (1 << 5)) == 0){   N/A 4077                        tauntflag0 = tauntflag0 + (1 << 5)   N/A 4078                        AddGladosSpokenFlags( 0, tauntflag0 )   N/A 4079                        GladosPlayVcd(1209)   N/A 4080                        return   N/A 4081                }   N/A 4082                if ((tauntflag1 & (1 << 0)) == 0){   N/A 4083                        tauntflag1 = tauntflag1 + (1 << 0)   N/A 4084                        AddGladosSpokenFlags( 1, tauntflag1 )   N/A 4085                        GladosPlayVcd(1248)   N/A 4086                        return   N/A 4087                }   N/A 4088                if ((tauntflag1 & (1 << 1)) == 0){   N/A 4089                        tauntflag1 = tauntflag1 + (1 << 1)   N/A 4090                        AddGladosSpokenFlags( 1, tauntflag1 )   N/A 4091                        GladosPlayVcd(1249)   N/A 4092                        return   N/A 4093                }   N/A 4094                if ((tauntflag1 & (1 << 2)) == 0){   N/A 4095                        tauntflag1 = tauntflag1 + (1 << 2)   N/A 4096                        AddGladosSpokenFlags( 1, tauntflag1 )   N/A 4097                        GladosPlayVcd(1251)   N/A 4098                        return   N/A 4099                }   N/A 4100                if ((tauntflag1 & (1 << 9)) == 0){   N/A 4101                        tauntflag1 = tauntflag1 + (1 << 9)   N/A 4102                        AddGladosSpokenFlags( 1, tauntflag1 )   N/A 4103                        GladosPlayVcd(1289)   N/A 4104                        return   N/A 4105                }                  N/A 4106    N/A 4107        }   N/A 4108    N/A 4109        if ( animation == "teamhug" ){   N/A 4110                if ((tauntflag0 & (1 << 6)) == 0){   N/A 4111                        tauntflag0 = tauntflag0 + (1 << 6)   N/A 4112                        AddGladosSpokenFlags( 0, tauntflag0 )   N/A 4113                        GladosPlayVcd(1210)   N/A 4114                        return   N/A 4115                }   N/A 4116                if ((tauntflag0 & (1 << 7)) == 0){   N/A 4117                        tauntflag0 = tauntflag0 + (1 << 7)   N/A 4118                        AddGladosSpokenFlags( 0, tauntflag0 )   N/A 4119                        GladosPlayVcd(1211)   N/A 4120                        return   N/A 4121                }   N/A 4122                if ((tauntflag0 & (1 << 8)) == 0){   N/A 4123                        tauntflag0 = tauntflag0 + (1 << 8)   N/A 4124                        AddGladosSpokenFlags( 0, tauntflag0 )   N/A 4125                        GladosPlayVcd(1212)   N/A 4126                        return   N/A 4127                }   N/A 4128                if ((tauntflag1 & (1 << 3)) == 0){   N/A 4129                        tauntflag1 = tauntflag1 + (1 << 3)   N/A 4130                        AddGladosSpokenFlags( 1, tauntflag1 )   N/A 4131                        GladosPlayVcd(1221)   N/A 4132                        return   N/A 4133                }                  N/A 4134                if ((tauntflag1 & (1 << 4)) == 0){   N/A 4135                        tauntflag1 = tauntflag1 + (1 << 4)   N/A 4136                        AddGladosSpokenFlags( 1, tauntflag1 )   N/A 4137                        GladosPlayVcd(1231)   N/A 4138                        return   N/A 4139                }                  N/A 4140                if ((tauntflag1 & (1 << 10)) == 0){   N/A 4141                        tauntflag1 = tauntflag1 + (1 << 10)   N/A 4142                        AddGladosSpokenFlags( 1, tauntflag1 )   N/A 4143                        GladosPlayVcd(1290)   N/A 4144                        return   N/A 4145                }                  N/A 4146    N/A 4147        }   N/A 4148    N/A 4149        if ( animation == "TeamEggTease" || animation == "TeamBallTease" ){   N/A 4150                if ((tauntflag0 & (1 << 9)) == 0){   N/A 4151                        tauntflag0 = tauntflag0 + (1 << 9)   N/A 4152                        AddGladosSpokenFlags( 0, tauntflag0 )   N/A 4153                        GladosPlayVcd(1213)   N/A 4154                        return   N/A 4155                }   N/A 4156                if ((tauntflag0 & (1 << 10)) == 0){   N/A 4157                        tauntflag0 = tauntflag0 + (1 << 10)   N/A 4158                        AddGladosSpokenFlags( 0, tauntflag0 )   N/A 4159                        GladosPlayVcd(1214)   N/A 4160                        return   N/A 4161                }   N/A 4162                if ((tauntflag0 & (1 << 11)) == 0){   N/A 4163                        tauntflag0 = tauntflag0 + (1 << 11)   N/A 4164                        AddGladosSpokenFlags( 0, tauntflag0 )   N/A 4165                        GladosPlayVcd(1215)   N/A 4166                        return   N/A 4167                }   N/A 4168                if ((tauntflag0 & (1 << 12)) == 0){   N/A 4169                        tauntflag0 = tauntflag0 + (1 << 12)   N/A 4170                        AddGladosSpokenFlags( 0, tauntflag0 )   N/A 4171                        GladosPlayVcd(1216)   N/A 4172                        return   N/A 4173                }   N/A 4174                if ((tauntflag1 & (1 << 8)) == 0){   N/A 4175                        tauntflag1 = tauntflag1 + (1 << 8)   N/A 4176                        AddGladosSpokenFlags( 1, tauntflag1 )   N/A 4177                        GladosPlayVcd(1288)   N/A 4178                        return   N/A 4179                }                  N/A 4180    N/A 4181        }   N/A 4182    N/A 4183    N/A 4184        if ( animation == "laugh" ){   N/A 4185                if ((tauntflag0 & (1 << 13)) == 0){   N/A 4186                        tauntflag0 = tauntflag0 + (1 << 13)   N/A 4187                        AddGladosSpokenFlags( 0, tauntflag0 )   N/A 4188                        GladosPlayVcd(1239)   N/A 4189                        return   N/A 4190                }   N/A 4191                if ((tauntflag0 & (1 << 14)) == 0){   N/A 4192                        tauntflag0 = tauntflag0 + (1 << 14)   N/A 4193                        AddGladosSpokenFlags( 0, tauntflag0 )   N/A 4194                        GladosPlayVcd(1254)   N/A 4195                        return   N/A 4196                }   N/A 4197    N/A 4198                if ((tauntflag0 & (1 << 15)) == 0){   N/A 4199                        tauntflag0 = tauntflag0 + (1 << 15)   N/A 4200                        AddGladosSpokenFlags( 0, tauntflag0 )   N/A 4201                        GladosPlayVcd(1240)   N/A 4202                        return   N/A 4203                }   N/A 4204                if ((tauntflag0 & (1 << 16)) == 0){   N/A 4205                        tauntflag0 = tauntflag0 + (1 << 16)   N/A 4206                        AddGladosSpokenFlags( 0, tauntflag0 )   N/A 4207                        GladosPlayVcd(1241)   N/A 4208                        return   N/A 4209                }   N/A 4210                if ((tauntflag0 & (1 << 17)) == 0){   N/A 4211                        tauntflag0 = tauntflag0 + (1 << 17)   N/A 4212                        AddGladosSpokenFlags( 0, tauntflag0 )   N/A 4213                        GladosPlayVcd(1253)   N/A 4214                        return   N/A 4215                }   N/A 4216                if ((tauntflag1 & (1 << 11)) == 0){   N/A 4217                        tauntflag1 = tauntflag1 + (1 << 11)   N/A 4218                        AddGladosSpokenFlags( 1, tauntflag1 )   N/A 4219                        GladosPlayVcd(1291)   N/A 4220                        return   N/A 4221                }                  N/A 4222    N/A 4223        }   N/A 4224    N/A 4225        if ( animation == "robotDance" ){   N/A 4226                if ((tauntflag0 & (1 << 18)) == 0){   N/A 4227                        tauntflag0 = tauntflag0 + (1 << 18)   N/A 4228                        AddGladosSpokenFlags( 0, tauntflag0 )   N/A 4229                        GladosPlayVcd(1242)   N/A 4230                        return   N/A 4231                }   N/A 4232                if ((tauntflag0 & (1 << 19)) == 0){   N/A 4233                        tauntflag0 = tauntflag0 + (1 << 19)   N/A 4234                        AddGladosSpokenFlags( 0, tauntflag0 )   N/A 4235                        GladosPlayVcd(1243)   N/A 4236                        return   N/A 4237                }   N/A 4238                if ((tauntflag1 & (1 << 12)) == 0){   N/A 4239                        tauntflag1 = tauntflag1 + (1 << 12)   N/A 4240                        AddGladosSpokenFlags( 1, tauntflag1 )   N/A 4241                        GladosPlayVcd(1292)   N/A 4242                        return   N/A 4243                }                  N/A 4244    N/A 4245                if ((tauntflag0 & (1 << 20)) == 0){   N/A 4246                        tauntflag0 = tauntflag0 + (1 << 20)   N/A 4247                        AddGladosSpokenFlags( 0, tauntflag0 )   N/A 4248                        GladosPlayVcd(1244)   N/A 4249                        return   N/A 4250                }   N/A 4251                if ((tauntflag0 & (1 << 21)) == 0){   N/A 4252                        tauntflag0 = tauntflag0 + (1 << 21)   N/A 4253                        AddGladosSpokenFlags( 0, tauntflag0 )   N/A 4254                        GladosPlayVcd(1245)   N/A 4255                        return   N/A 4256                }   N/A 4257                if ((tauntflag0 & (1 << 22)) == 0){   N/A 4258                        tauntflag0 = tauntflag0 + (1 << 22)   N/A 4259                        AddGladosSpokenFlags( 0, tauntflag0 )   N/A 4260                        GladosPlayVcd(1246)   N/A 4261                        return   N/A 4262                }   N/A 4263                if ((tauntflag0 & (1 << 23)) == 0){   N/A 4264                        tauntflag0 = tauntflag0 + (1 << 23)   N/A 4265                        AddGladosSpokenFlags( 0, tauntflag0 )   N/A 4266                        GladosPlayVcd(1247)   N/A 4267                        return   N/A 4268                }   N/A 4269        }   N/A 4270    N/A 4271        if ( animation == "rps" ){   N/A 4272                if ((tauntflag0 & (1 << 24)) == 0){   N/A 4273                        tauntflag0 = tauntflag0 + (1 << 24)   N/A 4274                        AddGladosSpokenFlags( 0, tauntflag0 )   N/A 4275                        GladosPlayVcd(1217)   N/A 4276                        return   N/A 4277                }   N/A 4278                if ((tauntflag0 & (1 << 25)) == 0){   N/A 4279                        tauntflag0 = tauntflag0 + (1 << 25)   N/A 4280                        AddGladosSpokenFlags( 0, tauntflag0 )   N/A 4281                        GladosPlayVcd(1218)   N/A 4282                        return   N/A 4283                }   N/A 4284                if ((tauntflag0 & (1 << 27)) == 0){   N/A 4285                        tauntflag0 = tauntflag0 + (1 << 27)   N/A 4286                        AddGladosSpokenFlags( 0, tauntflag0 )   N/A 4287                        GladosPlayVcd(1235)   N/A 4288                        return   N/A 4289                }                  N/A 4290                if ((tauntflag1 & (1 << 5)) == 0){   N/A 4291                        tauntflag1 = tauntflag1 + (1 << 5)   N/A 4292                        AddGladosSpokenFlags( 1, tauntflag1 )   N/A 4293                        GladosPlayVcd(1232)   N/A 4294                        return   N/A 4295                }                                  N/A 4296                if ((tauntflag1 & (1 << 6)) == 0){   N/A 4297                        tauntflag1 = tauntflag1 + (1 << 6)   N/A 4298                        AddGladosSpokenFlags( 1, tauntflag1 )   N/A 4299                        GladosPlayVcd(1233)   N/A 4300                        return   N/A 4301                }                                  N/A 4302                if ((tauntflag1 & (1 << 13)) == 0){   N/A 4303                        tauntflag1 = tauntflag1 + (1 << 13)   N/A 4304                        AddGladosSpokenFlags( 1, tauntflag1 )   N/A 4305                        GladosPlayVcd(1287)   N/A 4306                        return   N/A 4307                }                                  N/A 4308        }   N/A 4309        if ( animation == "trickfire" ){   N/A 4310                if ((tauntflag1 & (1 << 14)) == 0){   N/A 4311                        tauntflag1 = tauntflag1 + (1 << 14)   N/A 4312                        AddGladosSpokenFlags( 1, tauntflag1 )   N/A 4313                        GladosPlayVcd(1252)   N/A 4314                        return   N/A 4315                }                  N/A 4316    N/A 4317                if ((tauntflag1 & (1 << 15)) == 0){   N/A 4318                        tauntflag1 = tauntflag1 + (1 << 15)   N/A 4319                        AddGladosSpokenFlags( 1, tauntflag1 )   N/A 4320                        GladosPlayVcd(1327)   N/A 4321                        return   N/A 4322                }                  N/A 4323                if ((tauntflag1 & (1 << 16)) == 0){   N/A 4324                        tauntflag1 = tauntflag1 + (1 << 16)   N/A 4325                        AddGladosSpokenFlags( 1, tauntflag1 )   N/A 4326                        GladosPlayVcd(1328)   N/A 4327                        return   N/A 4328                }                                  N/A 4329                if ((tauntflag1 & (1 << 17)) == 0){   N/A 4330                        tauntflag1 = tauntflag1 + (1 << 17)   N/A 4331                        AddGladosSpokenFlags( 1, tauntflag1 )   N/A 4332                        GladosPlayVcd(1329)   N/A 4333                        return   N/A 4334                }                                  N/A 4335  }   N/A 4336    N/A 4337    N/A 4338    N/A 4339 }   N/A 4340    N/A 4341 function CoopBotAnimation(player,animation)   N/A 4342 {   N/A 4343    N/A 4344        testcnt=testcnt+1   N/A 4345        printldebug("===============>TEST TEST :"+testcnt)   N/A 4346        printldebug("===============>GESTURE!"+player+" x "+animation)   N/A 4347    N/A 4348        if (GladosInsideTauntCam == 1 ){   N/A 4349                if (player==1){   N/A 4350                        OrangeTauntCam=1          N/A 4351                        OrangeTauntFinaleInterval = Time   N/A 4352                }   N/A 4353                if (player==2){   N/A 4354                        BlueTauntCam=1          N/A 4355                        BlueTauntFinaleInterval = Time   N/A 4356    N/A 4357                }   N/A 4358                if (BlueTauntCam==1 && OrangeTauntCam==1){   N/A 4359    N/A 4360                        GladosInsideTauntCam = 0   N/A 4361                        printldebug("===============>CAM TEST :"+GladosInsideTauntCam)   N/A 4362                        printldebug("===============>CAM TEST :"+GladosInsideTauntCam)   N/A 4363                        printldebug("===============>CAM TEST :"+GladosInsideTauntCam)   N/A 4364                        printldebug("===============>CAM TEST :"+GladosInsideTauntCam)   N/A 4365                        printldebug("===============>CAM TEST :"+GladosInsideTauntCam)   N/A 4366                        GladosPlayVcd(1161)   N/A 4367    N/A 4368                }   N/A 4369        }   N/A 4370    N/A 4371        if (curMapName == "mp_coop_teambts"){   N/A 4372                 local curTime=Time   N/A 4373                if (curTime-LastTauntTime<5){   N/A 4374                        return   N/A 4375                }   N/A 4376                LastTauntTime=Time          N/A 4377                teambtstaunts=teambtstaunts+1   N/A 4378                switch (teambtstaunts)   N/A 4379                {   N/A 4380                        case 1:   N/A 4381                                if (player == coopBlue){                  N/A 4382                                        GladosPlayVcd(1100)   N/A 4383                                }   N/A 4384                                else{   N/A 4385                                        GladosPlayVcd(1101)   N/A 4386                                }   N/A 4387                                break   N/A 4388    N/A 4389                        case 2:           N/A 4390                                GladosPlayVcd(1102)                  N/A 4391                                break   N/A 4392    N/A 4393                        case 3:   N/A 4394                                if (player == coopBlue){                  N/A 4395                                        GladosPlayVcd(1103)   N/A 4396                                }   N/A 4397                                else{   N/A 4398                                        GladosPlayVcd(1104)   N/A 4399                                }   N/A 4400                                break                                  N/A 4401    N/A 4402                        case 4:           N/A 4403                                GladosPlayVcd(1105)                  N/A 4404                                break   N/A 4405    N/A 4406                        case 5:           N/A 4407                                GladosPlayVcd(1106)                  N/A 4408                                break   N/A 4409                }   N/A 4410        }   N/A 4411 }   N/A 4412    N/A 4413 ///bit for killing stuck players in tbeam   N/A 4414 function GladosCoopKillTbeamMaze{   N/A 4415                GladosPlayVcd(1304)          N/A 4416 }   N/A 4417    N/A 4418 function CoopCubeFizzle{   N/A 4419        local curMapName = GetMapName   N/A 4420        if (curMapName=="mp_coop_multifling_1"){   N/A 4421                switch (mp_coop_multifling_1cube)   N/A 4422                {   N/A 4423                        case 0:   N/A 4424                                mp_coop_multifling_1cube = 1   N/A 4425                                GladosPlayVcd(1310)                  N/A 4426                                break   N/A 4427                        case 1:   N/A 4428                                mp_coop_multifling_1cube = 2   N/A 4429                                GladosPlayVcd(1311)                  N/A 4430                                break   N/A 4431                        case 2:   N/A 4432                                mp_coop_multifling_1cube = 3   N/A 4433                                GladosPlayVcd(1312)                  N/A 4434                                break   N/A 4435                        case 3:   N/A 4436                                mp_coop_multifling_1cube = 4   N/A 4437                                GladosPlayVcd(1313)                  N/A 4438                                break   N/A 4439                }   N/A 4440        }   N/A 4441 }   N/A 4442    N/A 4443 // Announcer Stuf   N/A 4444 function CoopHubAllFinished   N/A 4445 {   N/A 4446        local x = RandomInt(1,100)   N/A 4447        if (x>66)   N/A 4448        {   N/A 4449                GladosPlayVcd(1108)          N/A 4450        }   N/A 4451        else   N/A 4452        {   N/A 4453                if (x>33)   N/A 4454                {   N/A 4455                        GladosPlayVcd(1109)          N/A 4456                }   N/A 4457                else{   N/A 4458                        GladosPlayVcd(1110)          N/A 4459                }   N/A 4460        }   N/A 4461 }   N/A 4462    N/A 4463    N/A 4464    N/A 4465 //--   N/A 4466 //DLC 1 FUNCTIONS   N/A 4467 //--   N/A 4468    N/A 4469 function DLC1_GladosCoopMapStart{   N/A 4470        local curMapName = GetMapName   N/A 4471        switch (curMapName)   N/A 4472        {   N/A 4473                case "mp_coop_separation_1":   N/A 4474                        GladosPlayVcd(-10000)          N/A 4475                        break                  N/A 4476                case "mp_coop_catapult_catch":   N/A 4477                        GladosPlayVcd(-10030)          N/A 4478                        break   N/A 4479                case "mp_coop_2paints_1bridge":   N/A 4480                        GladosPlayVcd(-10040)          N/A 4481                        break   N/A 4482                case "mp_coop_bridge_catch":   N/A 4483                        GladosPlayVcd(-10100)          N/A 4484                        break   N/A 4485                case "mp_coop_laser_tbeam":   N/A 4486                        GladosPlayVcd(-10120)          N/A 4487                        break   N/A 4488                case "mp_coop_paint_rat_maze":   N/A 4489                        GladosPlayVcd(-10130)          N/A 4490                        break   N/A 4491                case "mp_coop_paint_crazy_box":   N/A 4492                        GladosPlayVcd(-10140)          N/A 4493                        break   N/A 4494        }          N/A 4495 }   N/A 4496    N/A 4497    N/A 4498 function DLC1_GladosCoopOpenExitDoor(player)   N/A 4499 {   N/A 4500        local mapname = GetMapName   N/A 4501        switch (curMapName)   N/A 4502        {   N/A 4503                case "mp_coop_separation_1":   N/A 4504                        GladosPlayVcd(-10010)                  N/A 4505                        break   N/A 4506                case "mp_coop_tripleaxis":   N/A 4507                        GladosPlayVcd(-10025)                  N/A 4508                        break   N/A 4509                case "mp_coop_catapult_catch":   N/A 4510                        GladosPlayVcd(-10035)          N/A 4511                        break   N/A 4512                case "mp_coop_2paints_1bridge":   N/A 4513                        GladosPlayVcd(-10045)          N/A 4514                        break   N/A 4515                case "mp_coop_bridge_catch":   N/A 4516                        GladosPlayVcd(-10105)          N/A 4517                        break   N/A 4518                case "mp_coop_laser_tbeam":   N/A 4519                        GladosPlayVcd(-10125)          N/A 4520                        break   N/A 4521                case "mp_coop_paint_rat_maze":   N/A 4522                        GladosPlayVcd(-10135)          N/A 4523                        break   N/A 4524                case "mp_coop_paint_crazy_box":   N/A 4525                        GladosPlayVcd(-10145)          N/A 4526                        break   N/A 4527        }          N/A 4528 }   N/A 4529    N/A 4530 function DLC1_mp_coop_tripleaxis_intro   N/A 4531 {   N/A 4532        GladosPlayVcd(-10020)                  N/A 4533 }   N/A 4534    N/A 4535 function DLC1_mp_coop_2paints_1bridge_machine_break   N/A 4536 {   N/A 4537        GladosPlayVcd(-10050)                  N/A 4538 }   N/A 4539    N/A 4540 //On start of night vision gag   N/A 4541 function DLC1_mp_coop_paint_crazy_box_lightsout   N/A 4542 {   N/A 4543        GladosPlayVcd(-10145)   N/A 4544 }   N/A 4545    N/A 4546 //On final gantry gate starting to open   N/A 4547 function DLC1_mp_coop_paint_crazy_box_gantry_open   N/A 4548 {   N/A 4549        GladosPlayVcd(-10170)   N/A 4550 }   N/A 4551    N/A 4552 //When players are in position for the final boss door   N/A 4553 function DLC1_mp_coop_paint_crazy_box_gantry_at_door   N/A 4554 {   N/A 4555        printl("***********************AT DOOR!!!!!!***************************")   N/A 4556 }   N/A 4557    N/A 4558    N/A 4559 //On first disassembler malfunction   N/A 4560 function DLC1_2Paints_1Bridge_Malfunction   N/A 4561 {   N/A 4562        GladosPlayVcd(-10050)   N/A 4563 }   N/A 4564    N/A 4565 //On land in offices   N/A 4566 function DLC1_2Paints_1Bridge_Offices   N/A 4567 {   N/A 4568        GladosPlayVcd(-10060)   N/A 4569 }   N/A 4570    N/A 4571 //On Seeing office switches   N/A 4572 function DLC1_2Paints_1Bridge_SeeSwitches   N/A 4573 {   N/A 4574        GladosPlayVcd(-10075)   N/A 4575 }   N/A 4576    N/A 4577 //On power cycling   N/A 4578    N/A 4579 function DLC1_2Paints_1Bridge_PowerCycle   N/A 4580 {   N/A 4581        GladosPlayVcd(-10080)   N/A 4582 }   N/A 4583    N/A 4584 //On enter white paint   N/A 4585 function DLC1_2Paints_1Bridge_WhitePaintIntro   N/A 4586 {   N/A 4587 }   N/A 4588    N/A 4589 //On exit white paint   N/A 4590 function DLC1_2Paints_1Bridge_WhitePaintOutro   N/A 4591 {   N/A 4592        EntFire( "@relay_disable_exit", "Trigger", "", 0.0 )   N/A 4593        GladosPlayVcd(-10090)   N/A 4594 }   N/A 4595    N/A 4596    N/A 4597 //---   N/A 4598 //AUTOGENERATED DEATH FUNCTION   N/A 4599 //---   N/A 4600 function DLC1_BotDeath(player,dmgtype)   N/A 4601 {   N/A 4602        //player:   N/A 4603        //        1 = orange   N/A 4604        //        2 = blue   N/A 4605        //dmgtype:   N/A 4606        //        0 = acid   N/A 4607        //        1 = crushed/grindered   N/A 4608        //        2 = turret   N/A 4609        if (characterCurscene("glados")!=null)   N/A 4610        {   N/A 4611                return   N/A 4612        }   N/A 4613        if (curMapName == "mp_coop_separation_1" && (dlc1_deathbits & (1 << 1)) == 0 && dmgtype == 2)   N/A 4614        {   N/A 4615                dlc1_deathbits = dlc1_deathbits + (1 << 1)   N/A 4616                GladosPlayVcd(-11000)   N/A 4617                return   N/A 4618        }   N/A 4619        if (curMapName == "mp_coop_separation_1" && (dlc1_deathbits & (1 << 2)) == 0)   N/A 4620        {   N/A 4621                dlc1_deathbits = dlc1_deathbits + (1 << 2)   N/A 4622                GladosPlayVcd(-11001)   N/A 4623                return   N/A 4624        }   N/A 4625        if (curMapName == "mp_coop_separation_1" && (dlc1_deathbits & (1 << 3)) == 0)   N/A 4626        {   N/A 4627                dlc1_deathbits = dlc1_deathbits + (1 << 3)   N/A 4628                GladosPlayVcd(-11002)   N/A 4629                return   N/A 4630        }   N/A 4631        if (curMapName == "mp_coop_separation_1" && (dlc1_deathbits & (1 << 4)) == 0)   N/A 4632        {   N/A 4633                dlc1_deathbits = dlc1_deathbits + (1 << 4)   N/A 4634                GladosPlayVcd(-11003)   N/A 4635                return   N/A 4636        }   N/A 4637        if (curMapName == "mp_coop_catapult_catch" && (dlc1_deathbits & (1 << 1)) == 0 && (dmgtype == 0 || dmgtype >1000))   N/A 4638        {   N/A 4639                dlc1_deathbits = dlc1_deathbits + (1 << 1)   N/A 4640                GladosPlayVcd(-11004)   N/A 4641                return   N/A 4642        }   N/A 4643        if (curMapName == "mp_coop_catapult_catch" && (dlc1_deathbits & (1 << 2)) == 0 && (dmgtype == 0 || dmgtype >1000))   N/A 4644        {   N/A 4645                dlc1_deathbits = dlc1_deathbits + (1 << 2)   N/A 4646                GladosPlayVcd(-11005)   N/A 4647                return   N/A 4648        }   N/A 4649        if (curMapName == "mp_coop_catapult_catch" && (dlc1_deathbits & (1 << 3)) == 0 && (dmgtype == 0 || dmgtype >1000))   N/A 4650        {   N/A 4651                dlc1_deathbits = dlc1_deathbits + (1 << 3)   N/A 4652                GladosPlayVcd(-11006)   N/A 4653                return   N/A 4654        }   N/A 4655        if (curMapName == "mp_coop_catapult_catch" && (dlc1_deathbits & (1 << 4)) == 0 && (dmgtype == 0 || dmgtype >1000))   N/A 4656        {   N/A 4657                dlc1_deathbits = dlc1_deathbits + (1 << 4)   N/A 4658                GladosPlayVcd(-11007)   N/A 4659                return   N/A 4660        }   N/A 4661        if (curMapName == "mp_coop_catapult_catch" && (dlc1_deathbits & (1 << 5)) == 0 && (dmgtype == 0 || dmgtype >1000))   N/A 4662        {   N/A 4663                dlc1_deathbits = dlc1_deathbits + (1 << 5)   N/A 4664                GladosPlayVcd(-11008)   N/A 4665                return   N/A 4666        }   N/A 4667        if (curMapName == "mp_coop_2paints_1bridge" && (dlc1_deathbits & (1 << 1)) == 0 && (dmgtype == 0 || dmgtype >1000))   N/A 4668        {   N/A 4669                dlc1_deathbits = dlc1_deathbits + (1 << 1)   N/A 4670                GladosPlayVcd(-11009)   N/A 4671                return   N/A 4672        }   N/A 4673        if (curMapName == "mp_coop_2paints_1bridge" && (dlc1_deathbits & (1 << 2)) == 0 && (dmgtype == 0 || dmgtype >1000))   N/A 4674        {   N/A 4675                dlc1_deathbits = dlc1_deathbits + (1 << 2)   N/A 4676                GladosPlayVcd(-11010)   N/A 4677                return   N/A 4678        }   N/A 4679        if (curMapName == "mp_coop_2paints_1bridge" && (dlc1_deathbits & (1 << 3)) == 0 && (dmgtype == 0 || dmgtype >1000))   N/A 4680        {   N/A 4681                dlc1_deathbits = dlc1_deathbits + (1 << 3)   N/A 4682                GladosPlayVcd(-11011)   N/A 4683                return   N/A 4684        }   N/A 4685        if (curMapName == "mp_coop_2paints_1bridge" && (dlc1_deathbits & (1 << 4)) == 0 && (dmgtype == 0 || dmgtype >1000))   N/A 4686        {   N/A 4687                dlc1_deathbits = dlc1_deathbits + (1 << 4)   N/A 4688                GladosPlayVcd(-11012)   N/A 4689                return   N/A 4690        }   N/A 4691        if (curMapName == "mp_coop_bridge_catch" && (dlc1_deathbits & (1 << 1)) == 0 && (dmgtype == 0 || dmgtype >1000))   N/A 4692        {   N/A 4693                dlc1_deathbits = dlc1_deathbits + (1 << 1)   N/A 4694                GladosPlayVcd(-11013)   N/A 4695                return   N/A 4696        }   N/A 4697        if (curMapName == "mp_coop_bridge_catch" && (dlc1_deathbits & (1 << 2)) == 0 && (dmgtype == 0 || dmgtype >1000))   N/A 4698        {   N/A 4699                dlc1_deathbits = dlc1_deathbits + (1 << 2)   N/A 4700                GladosPlayVcd(-11014)   N/A 4701                return   N/A 4702        }   N/A 4703        if (curMapName == "mp_coop_bridge_catch" && (dlc1_deathbits & (1 << 3)) == 0)   N/A 4704        {   N/A 4705                dlc1_deathbits = dlc1_deathbits + (1 << 3)   N/A 4706                GladosPlayVcd(-11015)   N/A 4707                return   N/A 4708        }   N/A 4709        if (curMapName == "mp_coop_bridge_catch" && (dlc1_deathbits & (1 << 4)) == 0)   N/A 4710        {   N/A 4711                dlc1_deathbits = dlc1_deathbits + (1 << 4)   N/A 4712                GladosPlayVcd(-11016)   N/A 4713                return   N/A 4714        }   N/A 4715        if (curMapName == "mp_coop_laser_tbeam" && (dlc1_deathbits & (1 << 1)) == 0)   N/A 4716        {   N/A 4717                dlc1_deathbits = dlc1_deathbits + (1 << 1)   N/A 4718                GladosPlayVcd(-11017)   N/A 4719                return   N/A 4720        }   N/A 4721        if (curMapName == "mp_coop_laser_tbeam" && (dlc1_deathbits & (1 << 2)) == 0)   N/A 4722        {   N/A 4723                dlc1_deathbits = dlc1_deathbits + (1 << 2)   N/A 4724                GladosPlayVcd(-11018)   N/A 4725                return   N/A 4726        }   N/A 4727        if (curMapName == "mp_coop_laser_tbeam" && (dlc1_deathbits & (1 << 3)) == 0)   N/A 4728        {   N/A 4729                dlc1_deathbits = dlc1_deathbits + (1 << 3)   N/A 4730                GladosPlayVcd(-11019)   N/A 4731                return   N/A 4732        }   N/A 4733        if (curMapName == "mp_coop_paint_rat_maze" && (dlc1_deathbits & (1 << 1)) == 0 && dmgtype == 1)   N/A 4734        {   N/A 4735                dlc1_deathbits = dlc1_deathbits + (1 << 1)   N/A 4736                GladosPlayVcd(-11020)   N/A 4737                return   N/A 4738        }   N/A 4739        if (curMapName == "mp_coop_paint_rat_maze" && (dlc1_deathbits & (1 << 2)) == 0 && dmgtype == 1)   N/A 4740        {   N/A 4741                dlc1_deathbits = dlc1_deathbits + (1 << 2)   N/A 4742                GladosPlayVcd(-11021)   N/A 4743                return   N/A 4744        }   N/A 4745        if (curMapName == "mp_coop_paint_rat_maze" && (dlc1_deathbits & (1 << 3)) == 0 && dmgtype == 1)   N/A 4746        {   N/A 4747                dlc1_deathbits = dlc1_deathbits + (1 << 3)   N/A 4748                GladosPlayVcd(-11022)   N/A 4749                return   N/A 4750        }   N/A 4751        if (curMapName == "mp_coop_paint_rat_maze" && (dlc1_deathbits & (1 << 10)) == 0)   N/A 4752        {   N/A 4753                dlc1_deathbits = dlc1_deathbits + (1 << 10)   N/A 4754                GladosPlayVcd(-11023)   N/A 4755                return   N/A 4756        }   N/A 4757        if (curMapName == "mp_coop_paint_rat_maze" && (dlc1_deathbits & (1 << 11)) == 0)   N/A 4758        {   N/A 4759                dlc1_deathbits = dlc1_deathbits + (1 << 11)   N/A 4760                GladosPlayVcd(-11024)   N/A 4761                return   N/A 4762        }   N/A 4763        if (curMapName == "mp_coop_paint_rat_maze" && (dlc1_deathbits & (1 << 12)) == 0)   N/A 4764        {   N/A 4765                dlc1_deathbits = dlc1_deathbits + (1 << 12)   N/A 4766                GladosPlayVcd(-11025)   N/A 4767                return   N/A 4768        }   N/A 4769        if (curMapName == "mp_coop_paint_rat_maze" && (dlc1_deathbits & (1 << 13)) == 0)   N/A 4770        {   N/A 4771                dlc1_deathbits = dlc1_deathbits + (1 << 13)   N/A 4772                GladosPlayVcd(-11026)   N/A 4773                return   N/A 4774        }   N/A 4775 }   N/A 4776 //---   N/A 4777 //END OF AUTOGENERATED DEATH FUNCTION   N/A 4778 //---   N/A 4779    N/A 4780 //--   N/A 4781 //END OF DLC 1 FUNCTIONS   N/A 4782 //--