diff --git a/userraw/maps/mp/_utility.gsc b/userraw/maps/mp/_utility.gsc index d8b76f8..ee24958 100644 --- a/userraw/maps/mp/_utility.gsc +++ b/userraw/maps/mp/_utility.gsc @@ -1,6 +1,18 @@ #include common_scripts\utility; #include maps\mp\gametypes\_hud_util; +/* + Returns the map's current vision, so its overridable. +*/ +getMapVision() +{ + vision = getDvar("mapname"); + if (isDefined(level.nukeVision)) + vision = level.nukeVision; + + return vision; +} + exploder_sound() { if ( isdefined( self.script_delay ) ) @@ -47,7 +59,7 @@ loadModel(info) ============= ///ScriptDocBegin "Name: delayThread( , , , , , )" -"Summary: Delaythread is cool! It saves you from having to write extra script for once off commands. Note you don’t have to thread it off. Delaythread is that smart!" +"Summary: Delaythread is cool! It saves you from having to write extra script for once off commands. Note you don�t have to thread it off. Delaythread is that smart!" "Module: Utility" "MandatoryArg: : The delay before the function occurs" "MandatoryArg: : The function to run." diff --git a/userraw/maps/mp/gametypes/_damage.gsc b/userraw/maps/mp/gametypes/_damage.gsc index 96051e8..16a24b6 100644 --- a/userraw/maps/mp/gametypes/_damage.gsc +++ b/userraw/maps/mp/gametypes/_damage.gsc @@ -458,11 +458,11 @@ PlayerKilled_internal( eInflictor, attacker, victim, iDamage, sMeansOfDeath, sWe { if ( isDefined( victim.endGame ) ) { - victim VisionSetNakedForPlayer( getDvar( "mapname" ), 2 ); + victim VisionSetNakedForPlayer( getMapVision(), 2 ); } else if ( !isDefined( victim.nuked ) ) { - victim VisionSetNakedForPlayer( getDvar( "mapname" ), 0 ); + victim VisionSetNakedForPlayer( getMapVision(), 0 ); victim ThermalVisionOff(); } } @@ -917,7 +917,7 @@ doFinalKillcam( delay, victim, attacker, attackerNum, killcamentityindex, killca { player closePopupMenu(); player closeInGameMenu(); - player VisionSetNakedForPlayer( getDvar( "mapname" ), 0 ); + player VisionSetNakedForPlayer( getMapVision(), 0 ); player.killcamentitylookat = victim getEntityNumber(); if ( (player != victim || (!isRoundBased() || isLastRound())) && player _hasPerk( "specialty_copycat" ) ) diff --git a/userraw/maps/mp/gametypes/_gamelogic.gsc b/userraw/maps/mp/gametypes/_gamelogic.gsc index 1b4c728..ea0f3c8 100644 --- a/userraw/maps/mp/gametypes/_gamelogic.gsc +++ b/userraw/maps/mp/gametypes/_gamelogic.gsc @@ -1072,7 +1072,7 @@ matchStartTimer_Internal( countTime, matchStartTimer ) wait ( matchStartTimer.inFrames * 0.05 ); matchStartTimer setValue( countTime ); if ( countTime == 2 ) - visionSetNaked( getDvar( "mapname" ), 3.0 ); + visionSetNaked( getMapVision(), 3.0 ); countTime--; wait ( 1 - (matchStartTimer.inFrames * 0.05) ); } @@ -1105,12 +1105,12 @@ matchStartTimer( type, duration ) if ( countTime >= 2 ) { matchStartTimer_Internal( countTime, matchStartTimer ); - visionSetNaked( getDvar( "mapname" ), 3.0 ); + visionSetNaked( getMapVision(), 3.0 ); } else { visionSetNaked( "mpIntro", 0 ); - visionSetNaked( getDvar( "mapname" ), 1.0 ); + visionSetNaked( getMapVision(), 1.0 ); } matchStartTimer destroyElem(); @@ -1119,7 +1119,7 @@ matchStartTimer( type, duration ) matchStartTimerSkip() { - visionSetNaked( getDvar( "mapname" ), 0 ); + visionSetNaked( getMapVision(), 0 ); } @@ -3100,7 +3100,7 @@ doFinalKillCam() if( isDefined( level.nukeDetonated ) ) player VisionSetNakedForPlayer( "mpnuke_aftermath", 0 ); else - player VisionSetNakedForPlayer( getDvar( "mapname" ), 0 ); + player VisionSetNakedForPlayer( getMapVision(), 0 ); player.killcamentitylookat = victim getEntityNumber(); diff --git a/userraw/maps/mp/killstreaks/_emp.gsc b/userraw/maps/mp/killstreaks/_emp.gsc index 4b3fd3d..5fd3fbf 100644 --- a/userraw/maps/mp/killstreaks/_emp.gsc +++ b/userraw/maps/mp/killstreaks/_emp.gsc @@ -128,7 +128,7 @@ EMP_JamTeam( teamName, duration, delay, silent ) // however, if the client receives the previous visionset change in the same packet as this one, // this will force them to lerp from the bright one to the normal one. visionSetNaked( "coup_sunblind", 0 ); - visionSetNaked( getDvar( "mapname" ), 3.0 ); + visionSetNaked( getMapVision(), 3.0 ); } level.teamEMPed[teamName] = true; @@ -183,7 +183,7 @@ EMP_JamPlayers( owner, duration, delay, silent ) // however, if the client receives the previous visionset change in the same packet as this one, // this will force them to lerp from the bright one to the normal one. visionSetNaked( "coup_sunblind", 0 ); - visionSetNaked( getDvar( "mapname" ), 3.0 ); + visionSetNaked( getMapVision(), 3.0 ); } level notify ( "emp_update" ); diff --git a/userraw/maps/mp/killstreaks/_killstreaks.gsc b/userraw/maps/mp/killstreaks/_killstreaks.gsc index f651f51..927016b 100644 --- a/userraw/maps/mp/killstreaks/_killstreaks.gsc +++ b/userraw/maps/mp/killstreaks/_killstreaks.gsc @@ -751,9 +751,8 @@ clearRideIntro( delay ) wait( delay ); //self freezeControlsWrapper( false ); - - if ( !isDefined( level.nukeVisionInProgress ) ) - self VisionSetNakedForPlayer( getDvar( "mapname" ), 0 ); + + self VisionSetNakedForPlayer( getMapVision(), 0 ); } destroyOnEvents(elem) diff --git a/userraw/maps/mp/killstreaks/_nuke.gsc b/userraw/maps/mp/killstreaks/_nuke.gsc index f3267bc..2c6a548 100644 --- a/userraw/maps/mp/killstreaks/_nuke.gsc +++ b/userraw/maps/mp/killstreaks/_nuke.gsc @@ -84,10 +84,8 @@ onPlayerSpawned() if(isDefined(level.moabXP[self.team]) || isDefined(level.moabXP[self.guid])) self.xpScaler = 2; - if (isDefined(level.nukeVisionInProgress) && level.nukePermAftermath) - { - self visionSetNakedForPlayer( "aftermath", 0 ); - } + if (isDefined(level.nukeVision)) + self visionSetNakedForPlayer( level.nukeVision, 0 ); } } @@ -355,11 +353,13 @@ nukeVision() level endon ( "nuke_cancelled" ); level.nukeVisionInProgress = true; - visionSetNaked( "mpnuke", 3 ); + level.nukeVision = "mpnuke"; + visionSetNaked( level.nukeVision, 3 ); level waittill( "nuke_death" ); - visionSetNaked( "mpnuke_aftermath", 5 ); + level.nukeVision = "mpnuke_aftermath"; + visionSetNaked( level.nukeVision, 5 ); if( level.NukeEndsGame ) { @@ -372,13 +372,17 @@ nukeVision() if (level.nukePermAftermath) { - visionSetNaked( "aftermath", 1 ); - VisionSetPain("aftermath"); + level.nukeVision = "aftermath"; + + visionSetNaked( level.nukeVision, 1 ); + VisionSetPain( level.nukeVision ); } else { + level.nukeVision = undefined; level.nukeVisionInProgress = undefined; - visionSetNaked( getDvar( "mapname" ), 10 ); + + visionSetNaked( getMapVision(), 10 ); } } } diff --git a/userraw/maps/mp/perks/_perkfunctions.gsc b/userraw/maps/mp/perks/_perkfunctions.gsc index 1334274..dc502e2 100644 --- a/userraw/maps/mp/perks/_perkfunctions.gsc +++ b/userraw/maps/mp/perks/_perkfunctions.gsc @@ -103,7 +103,7 @@ unsetEndGame() revertVisionSet() { - self VisionSetNakedForPlayer( getDvar( "mapname" ), 1 ); + self VisionSetNakedForPlayer( getMapVision(), 1 ); } endGameDeath( duration ) @@ -773,7 +773,7 @@ toggleBlastShield( isEnabled ) self VisionSetNakedForPlayer( "black_bw", 0.15 ); wait ( 0.15 ); self _setPerk( "_specialty_blastshield" ); - self VisionSetNakedForPlayer( getDvar( "mapname" ), 0 ); + self VisionSetNakedForPlayer( getMapVision(), 0 ); self playSoundToPlayer( "item_blast_shield_on", self ); } else @@ -781,7 +781,7 @@ toggleBlastShield( isEnabled ) self VisionSetNakedForPlayer( "black_bw", 0.15 ); wait ( 0.15 ); self _unsetPerk( "_specialty_blastshield" ); - self VisionSetNakedForPlayer( getDvar( "mapname" ), 0 ); + self VisionSetNakedForPlayer( getMapVision(), 0 ); self playSoundToPlayer( "item_blast_shield_off", self ); } }