mirror of
https://github.com/ineedbots/iw4_bot_warfare.git
synced 2025-04-22 05:55:42 +00:00
mapvision fix
This commit is contained in:
parent
7c4bb2e8a8
commit
60cfeb84bb
@ -1,6 +1,18 @@
|
|||||||
#include common_scripts\utility;
|
#include common_scripts\utility;
|
||||||
#include maps\mp\gametypes\_hud_util;
|
#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()
|
exploder_sound()
|
||||||
{
|
{
|
||||||
if ( isdefined( self.script_delay ) )
|
if ( isdefined( self.script_delay ) )
|
||||||
@ -47,7 +59,7 @@ loadModel(info)
|
|||||||
=============
|
=============
|
||||||
///ScriptDocBegin
|
///ScriptDocBegin
|
||||||
"Name: delayThread( <delay>, <function>, <arg1>, <arg2>, <arg3>, <arg4> )"
|
"Name: delayThread( <delay>, <function>, <arg1>, <arg2>, <arg3>, <arg4> )"
|
||||||
"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<EFBFBD>t have to thread it off. Delaythread is that smart!"
|
||||||
"Module: Utility"
|
"Module: Utility"
|
||||||
"MandatoryArg: <delay> : The delay before the function occurs"
|
"MandatoryArg: <delay> : The delay before the function occurs"
|
||||||
"MandatoryArg: <delay> : The function to run."
|
"MandatoryArg: <delay> : The function to run."
|
||||||
|
@ -458,11 +458,11 @@ PlayerKilled_internal( eInflictor, attacker, victim, iDamage, sMeansOfDeath, sWe
|
|||||||
{
|
{
|
||||||
if ( isDefined( victim.endGame ) )
|
if ( isDefined( victim.endGame ) )
|
||||||
{
|
{
|
||||||
victim VisionSetNakedForPlayer( getDvar( "mapname" ), 2 );
|
victim VisionSetNakedForPlayer( getMapVision(), 2 );
|
||||||
}
|
}
|
||||||
else if ( !isDefined( victim.nuked ) )
|
else if ( !isDefined( victim.nuked ) )
|
||||||
{
|
{
|
||||||
victim VisionSetNakedForPlayer( getDvar( "mapname" ), 0 );
|
victim VisionSetNakedForPlayer( getMapVision(), 0 );
|
||||||
victim ThermalVisionOff();
|
victim ThermalVisionOff();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -917,7 +917,7 @@ doFinalKillcam( delay, victim, attacker, attackerNum, killcamentityindex, killca
|
|||||||
{
|
{
|
||||||
player closePopupMenu();
|
player closePopupMenu();
|
||||||
player closeInGameMenu();
|
player closeInGameMenu();
|
||||||
player VisionSetNakedForPlayer( getDvar( "mapname" ), 0 );
|
player VisionSetNakedForPlayer( getMapVision(), 0 );
|
||||||
player.killcamentitylookat = victim getEntityNumber();
|
player.killcamentitylookat = victim getEntityNumber();
|
||||||
|
|
||||||
if ( (player != victim || (!isRoundBased() || isLastRound())) && player _hasPerk( "specialty_copycat" ) )
|
if ( (player != victim || (!isRoundBased() || isLastRound())) && player _hasPerk( "specialty_copycat" ) )
|
||||||
|
@ -1072,7 +1072,7 @@ matchStartTimer_Internal( countTime, matchStartTimer )
|
|||||||
wait ( matchStartTimer.inFrames * 0.05 );
|
wait ( matchStartTimer.inFrames * 0.05 );
|
||||||
matchStartTimer setValue( countTime );
|
matchStartTimer setValue( countTime );
|
||||||
if ( countTime == 2 )
|
if ( countTime == 2 )
|
||||||
visionSetNaked( getDvar( "mapname" ), 3.0 );
|
visionSetNaked( getMapVision(), 3.0 );
|
||||||
countTime--;
|
countTime--;
|
||||||
wait ( 1 - (matchStartTimer.inFrames * 0.05) );
|
wait ( 1 - (matchStartTimer.inFrames * 0.05) );
|
||||||
}
|
}
|
||||||
@ -1105,12 +1105,12 @@ matchStartTimer( type, duration )
|
|||||||
if ( countTime >= 2 )
|
if ( countTime >= 2 )
|
||||||
{
|
{
|
||||||
matchStartTimer_Internal( countTime, matchStartTimer );
|
matchStartTimer_Internal( countTime, matchStartTimer );
|
||||||
visionSetNaked( getDvar( "mapname" ), 3.0 );
|
visionSetNaked( getMapVision(), 3.0 );
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
visionSetNaked( "mpIntro", 0 );
|
visionSetNaked( "mpIntro", 0 );
|
||||||
visionSetNaked( getDvar( "mapname" ), 1.0 );
|
visionSetNaked( getMapVision(), 1.0 );
|
||||||
}
|
}
|
||||||
|
|
||||||
matchStartTimer destroyElem();
|
matchStartTimer destroyElem();
|
||||||
@ -1119,7 +1119,7 @@ matchStartTimer( type, duration )
|
|||||||
|
|
||||||
matchStartTimerSkip()
|
matchStartTimerSkip()
|
||||||
{
|
{
|
||||||
visionSetNaked( getDvar( "mapname" ), 0 );
|
visionSetNaked( getMapVision(), 0 );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -3100,7 +3100,7 @@ doFinalKillCam()
|
|||||||
if( isDefined( level.nukeDetonated ) )
|
if( isDefined( level.nukeDetonated ) )
|
||||||
player VisionSetNakedForPlayer( "mpnuke_aftermath", 0 );
|
player VisionSetNakedForPlayer( "mpnuke_aftermath", 0 );
|
||||||
else
|
else
|
||||||
player VisionSetNakedForPlayer( getDvar( "mapname" ), 0 );
|
player VisionSetNakedForPlayer( getMapVision(), 0 );
|
||||||
|
|
||||||
player.killcamentitylookat = victim getEntityNumber();
|
player.killcamentitylookat = victim getEntityNumber();
|
||||||
|
|
||||||
|
@ -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,
|
// 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.
|
// this will force them to lerp from the bright one to the normal one.
|
||||||
visionSetNaked( "coup_sunblind", 0 );
|
visionSetNaked( "coup_sunblind", 0 );
|
||||||
visionSetNaked( getDvar( "mapname" ), 3.0 );
|
visionSetNaked( getMapVision(), 3.0 );
|
||||||
}
|
}
|
||||||
|
|
||||||
level.teamEMPed[teamName] = true;
|
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,
|
// 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.
|
// this will force them to lerp from the bright one to the normal one.
|
||||||
visionSetNaked( "coup_sunblind", 0 );
|
visionSetNaked( "coup_sunblind", 0 );
|
||||||
visionSetNaked( getDvar( "mapname" ), 3.0 );
|
visionSetNaked( getMapVision(), 3.0 );
|
||||||
}
|
}
|
||||||
|
|
||||||
level notify ( "emp_update" );
|
level notify ( "emp_update" );
|
||||||
|
@ -751,9 +751,8 @@ clearRideIntro( delay )
|
|||||||
wait( delay );
|
wait( delay );
|
||||||
|
|
||||||
//self freezeControlsWrapper( false );
|
//self freezeControlsWrapper( false );
|
||||||
|
|
||||||
if ( !isDefined( level.nukeVisionInProgress ) )
|
self VisionSetNakedForPlayer( getMapVision(), 0 );
|
||||||
self VisionSetNakedForPlayer( getDvar( "mapname" ), 0 );
|
|
||||||
}
|
}
|
||||||
|
|
||||||
destroyOnEvents(elem)
|
destroyOnEvents(elem)
|
||||||
|
@ -84,10 +84,8 @@ onPlayerSpawned()
|
|||||||
if(isDefined(level.moabXP[self.team]) || isDefined(level.moabXP[self.guid]))
|
if(isDefined(level.moabXP[self.team]) || isDefined(level.moabXP[self.guid]))
|
||||||
self.xpScaler = 2;
|
self.xpScaler = 2;
|
||||||
|
|
||||||
if (isDefined(level.nukeVisionInProgress) && level.nukePermAftermath)
|
if (isDefined(level.nukeVision))
|
||||||
{
|
self visionSetNakedForPlayer( level.nukeVision, 0 );
|
||||||
self visionSetNakedForPlayer( "aftermath", 0 );
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -355,11 +353,13 @@ nukeVision()
|
|||||||
level endon ( "nuke_cancelled" );
|
level endon ( "nuke_cancelled" );
|
||||||
|
|
||||||
level.nukeVisionInProgress = true;
|
level.nukeVisionInProgress = true;
|
||||||
visionSetNaked( "mpnuke", 3 );
|
level.nukeVision = "mpnuke";
|
||||||
|
visionSetNaked( level.nukeVision, 3 );
|
||||||
|
|
||||||
level waittill( "nuke_death" );
|
level waittill( "nuke_death" );
|
||||||
|
|
||||||
visionSetNaked( "mpnuke_aftermath", 5 );
|
level.nukeVision = "mpnuke_aftermath";
|
||||||
|
visionSetNaked( level.nukeVision, 5 );
|
||||||
|
|
||||||
if( level.NukeEndsGame )
|
if( level.NukeEndsGame )
|
||||||
{
|
{
|
||||||
@ -372,13 +372,17 @@ nukeVision()
|
|||||||
|
|
||||||
if (level.nukePermAftermath)
|
if (level.nukePermAftermath)
|
||||||
{
|
{
|
||||||
visionSetNaked( "aftermath", 1 );
|
level.nukeVision = "aftermath";
|
||||||
VisionSetPain("aftermath");
|
|
||||||
|
visionSetNaked( level.nukeVision, 1 );
|
||||||
|
VisionSetPain( level.nukeVision );
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
level.nukeVision = undefined;
|
||||||
level.nukeVisionInProgress = undefined;
|
level.nukeVisionInProgress = undefined;
|
||||||
visionSetNaked( getDvar( "mapname" ), 10 );
|
|
||||||
|
visionSetNaked( getMapVision(), 10 );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -103,7 +103,7 @@ unsetEndGame()
|
|||||||
|
|
||||||
revertVisionSet()
|
revertVisionSet()
|
||||||
{
|
{
|
||||||
self VisionSetNakedForPlayer( getDvar( "mapname" ), 1 );
|
self VisionSetNakedForPlayer( getMapVision(), 1 );
|
||||||
}
|
}
|
||||||
|
|
||||||
endGameDeath( duration )
|
endGameDeath( duration )
|
||||||
@ -773,7 +773,7 @@ toggleBlastShield( isEnabled )
|
|||||||
self VisionSetNakedForPlayer( "black_bw", 0.15 );
|
self VisionSetNakedForPlayer( "black_bw", 0.15 );
|
||||||
wait ( 0.15 );
|
wait ( 0.15 );
|
||||||
self _setPerk( "_specialty_blastshield" );
|
self _setPerk( "_specialty_blastshield" );
|
||||||
self VisionSetNakedForPlayer( getDvar( "mapname" ), 0 );
|
self VisionSetNakedForPlayer( getMapVision(), 0 );
|
||||||
self playSoundToPlayer( "item_blast_shield_on", self );
|
self playSoundToPlayer( "item_blast_shield_on", self );
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@ -781,7 +781,7 @@ toggleBlastShield( isEnabled )
|
|||||||
self VisionSetNakedForPlayer( "black_bw", 0.15 );
|
self VisionSetNakedForPlayer( "black_bw", 0.15 );
|
||||||
wait ( 0.15 );
|
wait ( 0.15 );
|
||||||
self _unsetPerk( "_specialty_blastshield" );
|
self _unsetPerk( "_specialty_blastshield" );
|
||||||
self VisionSetNakedForPlayer( getDvar( "mapname" ), 0 );
|
self VisionSetNakedForPlayer( getMapVision(), 0 );
|
||||||
self playSoundToPlayer( "item_blast_shield_off", self );
|
self playSoundToPlayer( "item_blast_shield_off", self );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user