aboutsummaryrefslogtreecommitdiff
path: root/Northstar.CustomServers/mod
diff options
context:
space:
mode:
Diffstat (limited to 'Northstar.CustomServers/mod')
-rw-r--r--Northstar.CustomServers/mod/scripts/vscripts/ai/_ai_stalker.gnut79
-rw-r--r--Northstar.CustomServers/mod/scripts/vscripts/gamemodes/_gamemode_fd_events.nut41
2 files changed, 115 insertions, 5 deletions
diff --git a/Northstar.CustomServers/mod/scripts/vscripts/ai/_ai_stalker.gnut b/Northstar.CustomServers/mod/scripts/vscripts/ai/_ai_stalker.gnut
index f49560e0..29e235b5 100644
--- a/Northstar.CustomServers/mod/scripts/vscripts/ai/_ai_stalker.gnut
+++ b/Northstar.CustomServers/mod/scripts/vscripts/ai/_ai_stalker.gnut
@@ -2,6 +2,7 @@ global function AiStalker_Init
global function GetDeathForce
global function StalkerGearOverloads
global function StalkerMeltingDown
+global function FDStalkerThink
global function IsStalkerLimbBlownOff
@@ -157,6 +158,82 @@ void function StalkerOnDamaged_Internal( entity npc, var damageInfo )
npc.SetActivityModifier( ACT_MODIFIER_STAGGER, true )
}
}
+ if( GameRules_GetGameMode() == FD )
+ thread StalkerSprint( npc, damageInfo )
+}
+
+void function StalkerSprint( entity npc, var damageInfo )
+{
+ npc.EndSignal("OnDeath")
+ npc.EndSignal("OnDestroy")
+ float damage = DamageInfo_GetDamage( damageInfo )
+
+ if ( npc.GetHealth() - damage < 50 || npc.GetHealth() <= 80)
+ {
+ entity weapon = npc.GetActiveWeapon()
+ if (IsValid(weapon))
+ npc.TakeActiveWeapon() // when stalkers fall over on harvester they will randomly shoot their guns, we don't want that.
+ npc.EnableNPCMoveFlag( NPCMF_PREFER_SPRINT )
+ npc.SetCapabilityFlag( bits_CAP_MOVE_SHOOT | bits_CAP_WEAPON_RANGE_ATTACK1 | bits_CAP_AIM_GUN, false )
+ npc.SetNPCFlag( NPC_IGNORE_ALL, true )
+ npc.SetNPCFlag( NPC_DISABLE_SENSING, true )
+ npc.SetNoTarget( true )
+ npc.ClearMoveAnim()
+ npc.SetMoveAnim("sp_spectre_sprint_F")
+ }
+}
+
+void function FDStalkerThink( entity npc, entity generator )
+{
+ npc.EndSignal( "OnDeath" )
+ npc.EndSignal( "OnDestroy" )
+ generator.EndSignal( "OnDeath" )
+ generator.EndSignal( "OnDestroy" )
+ bool isSprinting = false
+ thread FDStalkerGetsStunned( npc , generator )
+ while (IsAlive(npc))
+ {
+ WaitFrame()
+
+ if ( DistanceSqr( npc.GetOrigin(), generator.GetOrigin() ) < (600 * 600) && !isSprinting)
+ {
+ entity weapon = npc.GetActiveWeapon()
+ if (IsValid(weapon))
+ npc.TakeActiveWeapon() // when stalkers fall over on harvester they will randomly shoot their guns, we don't want that.
+ npc.EnableNPCMoveFlag( NPCMF_PREFER_SPRINT )
+ npc.SetCapabilityFlag( bits_CAP_MOVE_SHOOT | bits_CAP_WEAPON_RANGE_ATTACK1 | bits_CAP_AIM_GUN, false )
+ npc.EnableNPCFlag( NPC_DISABLE_SENSING | NPC_IGNORE_ALL )
+ npc.ClearMoveAnim()
+ npc.SetMoveAnim("sp_spectre_sprint_F")
+ npc.SetNoTarget( true )
+ isSprinting = true
+ }
+
+ if ( DistanceSqr( npc.GetOrigin(), generator.GetOrigin() ) > (230 * 230) )
+ continue
+
+ break
+ }
+
+ thread StalkerGearOverloads( npc )
+}
+
+void function FDStalkerGetsStunned( entity npc , entity generator )
+{
+ npc.EndSignal( "OnDeath" )
+ npc.EndSignal( "OnDestroy" )
+ npc.WaitSignal( "ArcStunned" )
+ print("arc trapped...")
+
+ entity weapon = npc.GetActiveWeapon()
+ if (IsValid(weapon))
+ npc.TakeActiveWeapon() // when stalkers fall over on harvester they will randomly shoot their guns, we don't want that.
+ npc.EnableNPCMoveFlag( NPCMF_PREFER_SPRINT )
+ npc.SetCapabilityFlag( bits_CAP_MOVE_SHOOT | bits_CAP_WEAPON_RANGE_ATTACK1 | bits_CAP_AIM_GUN, false )
+ npc.EnableNPCFlag( NPC_DISABLE_SENSING | NPC_IGNORE_ALL )
+ npc.ClearMoveAnim()
+ npc.SetMoveAnim("sp_spectre_sprint_F")
+ npc.SetNoTarget( true ) // stop keeping track of any player and instead go for the harvester
}
bool function TryDismemberStalker( entity npc, var damageInfo, entity attacker, int hitGroup )
@@ -603,4 +680,4 @@ vector function GetDeathForce()
vector angles = <RandomFloatRange(-45,-75),RandomFloat(360),0>
vector forward = AnglesToForward( angles )
return forward * RandomFloatRange( 0.25, 0.75 )
-} \ No newline at end of file
+}
diff --git a/Northstar.CustomServers/mod/scripts/vscripts/gamemodes/_gamemode_fd_events.nut b/Northstar.CustomServers/mod/scripts/vscripts/gamemodes/_gamemode_fd_events.nut
index 5a8996ec..af63aeee 100644
--- a/Northstar.CustomServers/mod/scripts/vscripts/gamemodes/_gamemode_fd_events.nut
+++ b/Northstar.CustomServers/mod/scripts/vscripts/gamemodes/_gamemode_fd_events.nut
@@ -483,6 +483,7 @@ void function spawnDroppodStalker(SmokeEvent smokeEvent,SpawnEvent spawnEvent,Wa
string squadName = MakeSquadName( TEAM_IMC, UniqueString( "ZiplineTable" ) )
array<entity> guys
+ int difficultyLevel = FD_GetDifficultyLevel()
for ( int i = 0; i < spawnEvent.spawnAmount; i++ )
{
@@ -491,16 +492,48 @@ void function spawnDroppodStalker(SmokeEvent smokeEvent,SpawnEvent spawnEvent,Wa
SetTeam( guy, TEAM_IMC )
guy.EnableNPCFlag( NPC_ALLOW_INVESTIGATE | NPC_ALLOW_HAND_SIGNALS | NPC_ALLOW_FLEE )
guy.DisableNPCFlag( NPC_ALLOW_PATROL)
+ SetSpawnOption_AISettings( guy, "npc_stalker_fd" )
DispatchSpawn( guy )
SetSquad( guy, squadName )
+ guy.AssaultSetFightRadius( 0 ) // makes them keep moving instead of stopping to shoot you.
AddMinimapForHumans(guy)
+ file.spawnedNPCs.append(guy)
SetTargetName( guy, GetTargetNameForID(eFD_AITypeIDs.STALKER))
+ thread FDStalkerThink( guy , fd_harvester.harvester )
guys.append( guy )
- }
+ }
- ActivateFireteamDropPod( pod, guys )
- thread SquadNav_Thread(guys,spawnEvent.route)
+ switch ( difficultyLevel )
+ {
+ case eFDDifficultyLevel.EASY:
+ case eFDDifficultyLevel.NORMAL: // easy and normal stalkers have no weapons
+ foreach(npc in guys)
+ {
+ npc.TakeActiveWeapon()
+ npc.SetNoTarget( false )
+ npc.EnableNPCFlag( NPC_DISABLE_SENSING | NPC_IGNORE_ALL )
+ npc.SetEnemy( fd_harvester.harvester )
+ }
+ break
+ case eFDDifficultyLevel.HARD:
+ case eFDDifficultyLevel.MASTER:
+ case eFDDifficultyLevel.INSANE: // give all EPGs
+ foreach(npc in guys)
+ {
+ npc.TakeActiveWeapon()
+ npc.GiveWeapon( "mp_weapon_epg", [] )
+ npc.SetActiveWeaponByName( "mp_weapon_epg" )
+ }
+ break
+
+ default:
+ unreachable
+
+ }
+
+ ActivateFireteamDropPod( pod, guys )
+ SquadNav_Thread(guys,spawnEvent.route)
}
@@ -733,4 +766,4 @@ void function AddMinimapForHumans(entity human)
human.Minimap_AlwaysShow( TEAM_MILITIA, null )
human.Minimap_SetHeightTracking( true )
human.Minimap_SetCustomState( eMinimapObject_npc.AI_TDM_AI )
-} \ No newline at end of file
+}