aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Northstar.CustomServers/mod.json8
-rw-r--r--Northstar.CustomServers/mod/scripts/vscripts/burnmeter/_burnmeter.gnut35
-rw-r--r--Northstar.CustomServers/mod/scripts/vscripts/burnmeter/cl_maphack.nut90
3 files changed, 11 insertions, 122 deletions
diff --git a/Northstar.CustomServers/mod.json b/Northstar.CustomServers/mod.json
index ea591352..28a08868 100644
--- a/Northstar.CustomServers/mod.json
+++ b/Northstar.CustomServers/mod.json
@@ -113,13 +113,7 @@
"After": "SvLoadoutsMP_Init"
}
},
- {
- "Path": "burnmeter/cl_maphack.nut",
- "RunOn": "CLIENT",
- "ClientCallback": {
- "Before": "ClMapHack_Init"
- }
- },
+
{
"Path": "lobby/sh_private_lobby_modes_init.gnut",
"RunOn": "( SERVER || CLIENT ) && MP"
diff --git a/Northstar.CustomServers/mod/scripts/vscripts/burnmeter/_burnmeter.gnut b/Northstar.CustomServers/mod/scripts/vscripts/burnmeter/_burnmeter.gnut
index dcae6bd2..d1f4bd80 100644
--- a/Northstar.CustomServers/mod/scripts/vscripts/burnmeter/_burnmeter.gnut
+++ b/Northstar.CustomServers/mod/scripts/vscripts/burnmeter/_burnmeter.gnut
@@ -378,40 +378,25 @@ void function PlayerUsesMaphackBurncardThreaded( entity player )
array<entity> aliveplayers = GetPlayerArray()
foreach ( entity otherPlayer in GetPlayerArray() )
{
- Remote_CallFunction_Replay( otherPlayer, "ServerCallback_SonarPulseFromPosition", player.GetOrigin().x, player.GetOrigin().y, player.GetOrigin().z, 2000)
+ Remote_CallFunction_Replay( otherPlayer, "ServerCallback_SonarPulseFromPosition", player.GetOrigin().x, player.GetOrigin().y, player.GetOrigin().z, SONAR_GRENADE_RADIUS )
- if ( otherPlayer.GetTeam() != player.GetTeam() && aliveplayers.find(otherPlayer) != -1 )
+ if ( otherPlayer.GetTeam() != player.GetTeam() && aliveplayers.find(otherPlayer) != -1 && aliveplayers.find(player) != -1 )
{
- MapHackSonar(player, otherPlayer)
+ StatusEffect_AddTimed( otherPlayer, eStatusEffect.maphack_detected, 1.0, MAPHACK_PULSE_DELAY / 2, 0.0 )
+ SonarStart( otherPlayer, player.GetOrigin(), player.GetTeam(), player )
+ IncrementSonarPerTeam( player.GetTeam() )
}
}
wait MAPHACK_PULSE_DELAY
- foreach ( entity otherPlayer in GetPlayerArray() )
- {
- if ( otherPlayer.GetTeam() != player.GetTeam() && aliveplayers.find(otherPlayer) != -1 ) {
- MapHackSonarStop(player, otherPlayer)
+ foreach ( entity otherPlayer in GetPlayerArray() ) {
+ if ( otherPlayer.GetTeam() != player.GetTeam() && aliveplayers.find(otherPlayer) != -1 && aliveplayers.find(player) != -1 ) {
+ SonarEnd (otherPlayer, player.GetTeam() )
+ DecrementSonarPerTeam( player.GetTeam() )
}
}
}
}
-void function MapHackSonar(entity player, entity otherPlayer)
-{
- // doing this should prevent infinite map hacks
- StatusEffect_AddTimed( otherPlayer, eStatusEffect.maphack_detected, 1.0, MAPHACK_PULSE_DELAY / 2, 0.0 )
- Highlight_SetEnemyHighlight( otherPlayer, "enemy_sonar" )
- Highlight_SetSonarHighlightWithParam1( otherPlayer, "enemy_sonar", player.GetOrigin() )
- Highlight_SetSonarHighlightOrigin( otherPlayer, player.GetOrigin() )
- otherPlayer.HighlightEnableForTeam( player.GetTeam() )
-}
-void function MapHackSonarStop(entity player, entity otherPlayer)
-{
- otherPlayer.HighlightDisableForTeam( player.GetTeam() )
- otherPlayer.HighlightSetTeamBitField( 0 )
- if (Hightlight_HasEnemyHighlight( otherPlayer, "enemy_sonar"))
- Highlight_ClearEnemyHighlight( otherPlayer )
-}
-
void function PlayerUsesPhaseRewindBurncard( entity player )
{
thread PlayerUsesPhaseRewindBurncardThreaded( player )
@@ -525,4 +510,4 @@ void function PlayerUsesReaperfallBurncard( entity player )
DispatchSpawn( reaper )
thread SuperSpectre_WarpFall( reaper )
-}
+} \ No newline at end of file
diff --git a/Northstar.CustomServers/mod/scripts/vscripts/burnmeter/cl_maphack.nut b/Northstar.CustomServers/mod/scripts/vscripts/burnmeter/cl_maphack.nut
deleted file mode 100644
index 58b408ca..00000000
--- a/Northstar.CustomServers/mod/scripts/vscripts/burnmeter/cl_maphack.nut
+++ /dev/null
@@ -1,90 +0,0 @@
-global function ClMapHack_Init
-
-void function ClMapHack_Init()
-{
- StatusEffect_RegisterEnabledCallback( eStatusEffect.maphack_detected, EntitySonarDetectedEnabled )
- StatusEffect_RegisterDisabledCallback( eStatusEffect.maphack_detected, EntitySonarDetectedDisabled )
-}
-
-void function EntitySonarDetectedEnabled( entity ent, int statusEffect, bool actuallyChanged )
-{
- if ( ent == GetLocalViewPlayer() )
- {
- // player is already maphack highlighted
- if ( statusEffect == eStatusEffect.maphack_detected && StatusEffect_Get( ent, eStatusEffect.lockon_detected ) )
- return
-
- entity viewModelEntity = ent.GetViewModelEntity()
- entity firstPersonProxy = ent.GetFirstPersonProxy()
- entity predictedFirstPersonProxy = ent.GetPredictedFirstPersonProxy()
-
- vector highlightColor = statusEffect == eStatusEffect.maphack_detected ? HIGHLIGHT_COLOR_ENEMY : <1, 0, 0>
-
- if ( IsValid( viewModelEntity ) )
- SonarViewModelHighlight( viewModelEntity, highlightColor )
-
- if ( IsValid( firstPersonProxy ) )
- SonarViewModelHighlight( firstPersonProxy, highlightColor )
-
- if ( IsValid( predictedFirstPersonProxy ) )
- SonarViewModelHighlight( predictedFirstPersonProxy, highlightColor )
-
- thread PlayLoopingSonarSound( ent )
- }
- else
- {
- ClInitHighlight( ent )
- }
-}
-
-void function EntitySonarDetectedDisabled( entity ent, int statusEffect, bool actuallyChanged )
-{
- if ( ent == GetLocalViewPlayer() )
- {
- // player should have maphack highlighted
- if ( statusEffect == eStatusEffect.maphack_detected && StatusEffect_Get( ent, eStatusEffect.lockon_detected ) )
- {
- return
- }
- else if ( statusEffect == eStatusEffect.lockon_detected && StatusEffect_Get( ent, eStatusEffect.maphack_detected ) )
- {
- // restore sonar after lockon wears off
- EntitySonarDetectedEnabled( ent, eStatusEffect.maphack_detected, true )
- return
- }
-
- entity viewModelEntity = ent.GetViewModelEntity()
- entity firstPersonProxy = ent.GetFirstPersonProxy()
- entity predictedFirstPersonProxy = ent.GetPredictedFirstPersonProxy()
-
- if ( IsValid( viewModelEntity ) )
- SonarViewModelClearHighlight( viewModelEntity )
-
- if ( IsValid( firstPersonProxy ) )
- SonarViewModelClearHighlight( firstPersonProxy )
-
- if ( IsValid( predictedFirstPersonProxy ) )
- SonarViewModelClearHighlight( predictedFirstPersonProxy )
-
- ent.Signal( "EntitySonarDetectedDisabled" )
- }
- else
- {
- ClInitHighlight( ent )
- }
-}
-
-void function PlayLoopingSonarSound( entity ent )
-{
- EmitSoundOnEntity( ent, "HUD_MP_EnemySonarTag_Activated_1P" )
-
- ent.EndSignal( "EntitySonarDetectedDisabled" )
- ent.EndSignal( "OnDeath" )
-
- while( true )
- {
- wait 1.5
- EmitSoundOnEntity( ent, "HUD_MP_EnemySonarTag_Flashed_1P" )
- }
-
-} \ No newline at end of file