aboutsummaryrefslogtreecommitdiff
path: root/Northstar.CustomServers
diff options
context:
space:
mode:
authorx3Karma <juliuslimck@gmail.com>2022-05-30 19:37:01 +0800
committerGitHub <noreply@github.com>2022-05-30 13:37:01 +0200
commit14b38ad5277317f66a1d0212d58c536f7da89b27 (patch)
tree7ee77626a86afdbd8b6f2d61f7ababe51a75b9de /Northstar.CustomServers
parent9103a2061ae36e8f8759b21576657c42a19cbc9b (diff)
downloadNorthstarMods-14b38ad5277317f66a1d0212d58c536f7da89b27.tar.gz
NorthstarMods-14b38ad5277317f66a1d0212d58c536f7da89b27.zip
[FD] Cloak Drone Changes (#374)
* Revert _ai_cloak_drone.gnut * Fix Cloak Drones (and maybe Cloak Field) not cloaking targets correctly
Diffstat (limited to 'Northstar.CustomServers')
-rw-r--r--Northstar.CustomServers/mod/scripts/vscripts/ai/_ai_cloak_drone.gnut47
-rw-r--r--Northstar.CustomServers/mod/scripts/vscripts/weapons/_cloaker.gnut6
2 files changed, 5 insertions, 48 deletions
diff --git a/Northstar.CustomServers/mod/scripts/vscripts/ai/_ai_cloak_drone.gnut b/Northstar.CustomServers/mod/scripts/vscripts/ai/_ai_cloak_drone.gnut
index 33437ad7..a71b71f1 100644
--- a/Northstar.CustomServers/mod/scripts/vscripts/ai/_ai_cloak_drone.gnut
+++ b/Northstar.CustomServers/mod/scripts/vscripts/ai/_ai_cloak_drone.gnut
@@ -334,11 +334,7 @@ void function CloakedDronePathFollowNPC( entity cloakedDrone, entity goalNPC )
function() : ( goalNPC )
{
if ( IsAlive( goalNPC ) )
- {
goalNPC.s.cloakedDrone = null
- if(IsCloaked(goalNPC))
- goalNPC.Signal( "KillHandleCloakEnd" )
- }
}
)
@@ -386,9 +382,6 @@ void function CloakedDronePathFollowNPC( entity cloakedDrone, entity goalNPC )
float startTime = Time()
path.goalValid = false
- if(!IsCloaked(goalNPC))
- CloakNPC(goalNPC)
-
CloakedDroneFindPathDefault( path, defaultHeight, mins, maxs, cloakedDrone, goalNPC, mask )
//find a new path if necessary
@@ -683,43 +676,3 @@ function IsSquadCenterClose( npc, dist = 256 )
return false
}
-
-void function CloakNPC ( entity npc )
-{
- npc.SetCloakDuration( 1.0, -1, 1.0 )
-
- EmitSoundOnEntity( npc, "cloak_on_3P" )
- EmitSoundOnEntity( npc, "cloak_sustain_loop_3P" )
-
- thread HandleNPCCloakEnd( npc )
-}
-
-void function HandleNPCCloakEnd( entity npc )
-{
- npc.EndSignal( "OnDeath" )
- npc.Signal( "OnStartCloak" )
- npc.EndSignal( "OnStartCloak" )
- npc.EndSignal( "KillHandleCloakEnd" ) //Calling DisableCloak() after EnableCloak() doesn't kill this thread by design (to allow attacking through cloak etc), so this signal is for when you want to kill this thread
-
- OnThreadEnd(
- function() : ( npc )
- {
- if ( !IsValid( npc ) )
- return
-
- StopSoundOnEntity( npc, "cloak_sustain_loop_3P" )
-
- if ( !IsCloaked( npc ) )
- return
-
- if ( !IsAlive( npc ) || !npc.IsHuman() )
- {
- EmitSoundOnEntity( npc, "cloak_interruptend_3P" )
- npc.SetCloakDuration( 0, 0, 1.0 )
- return
- }
- }
- )
-
- WaitForever()
-}
diff --git a/Northstar.CustomServers/mod/scripts/vscripts/weapons/_cloaker.gnut b/Northstar.CustomServers/mod/scripts/vscripts/weapons/_cloaker.gnut
index 6ec0bc0a..b4045f3e 100644
--- a/Northstar.CustomServers/mod/scripts/vscripts/weapons/_cloaker.gnut
+++ b/Northstar.CustomServers/mod/scripts/vscripts/weapons/_cloaker.gnut
@@ -97,6 +97,8 @@ function CloakerThink( entity cloaker, float radius, array<string> ents = [ "any
void function CloakerCloaksGuy( guy )
{
+ if( guy.IsNPC() )
+ guy.SetCanCloak(true) // if you don't want to cloak specific targets, it should be handled by shouldCloakGuyFunc in CloakerThink
guy.SetCloakDuration( 2.0, -1, 0 )
EmitSoundOnEntity( guy, CLOAKED_DRONE_CLOAK_START_SFX )
EmitSoundOnEntity( guy, CLOAKED_DRONE_CLOAK_LOOP_SFX )
@@ -110,6 +112,8 @@ void function CloakerDeCloaksGuy( guy )
StopSoundOnEntity( guy, CLOAKED_DRONE_CLOAK_LOOP_SFX )
guy.Minimap_AlwaysShow( TEAM_IMC, null )
guy.Minimap_AlwaysShow( TEAM_MILITIA, null )
+ if( guy.IsNPC() )
+ guy.SetCanCloak(false)
}
bool function CloakerShouldCloakGuy( entity cloaker, entity guy )
@@ -118,4 +122,4 @@ bool function CloakerShouldCloakGuy( entity cloaker, entity guy )
return false
return true
-} \ No newline at end of file
+}