aboutsummaryrefslogtreecommitdiff
path: root/Northstar.CustomServers/mod/scripts/vscripts/mp/_ai_mp.gnut
blob: ce9227a2c42ba6a94feb81624a1525565b1e3163 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
untyped
global function MpInitAILoadouts
global function SetProficiency
global function SPMP_UpdateNPCProficiency
global function SPMP_Callback_ForceAIMissPlayer
global function IsAutoPopulateEnabled

void function MpInitAILoadouts()
{

}

void function SetProficiency( entity npc )
{
	// i think this is correct? iirc grunts and stuff in attrition are *really* bad so having poor as their proficiency makes sense
	npc.kv.WeaponProficiency = GetDifficultyLevel()
}

void function SPMP_UpdateNPCProficiency( entity npc )
{
	SetProficiency( npc ) // this seems bad? dont see why they should be any different unless SP should use a different function
}

bool function IsAutoPopulateEnabled( var team = null )
{
	if ( IsNPCSpawningEnabled() == false )
		return false

	if ( Flag( "disable_npcs" ) )
		return false

	if ( team == TEAM_MILITIA && Flag( "Disable_MILITIA" ) )
		return false
	if ( team == TEAM_IMC && Flag( "Disable_IMC" ) )
		return false

	return true
}

bool function SPMP_Callback_ForceAIMissPlayer( entity npc, entity player )
{
	if ( GetGameState() >= eGameState.Postmatch )
		return true
	
	if ( player.IsTitan() )
		return false
		
	int lethality = Riff_AILethality()
	if ( lethality <= eAILethality.Medium )
		if ( player.GetTitanSoulBeingRodeoed() != null )
			return true
	
	if ( Bleedout_IsBleedoutLogicActive() && Bleedout_ShouldAIMissBleedingPlayer( player ) )
		return true
	
	if ( player.ContextAction_IsActive() )
		return RandomFloat( 1 ) >= 0.25
	
	if ( IsFastPilot( player ) )
	{
		float chance = ( lethality + 1 ) * 0.125
		if ( lethality <= eAILethality.Medium && npc.IsMechanical() )
			chance /= 1.25
		
		return RandomFloat( 1 ) >= chance
	}
	
	return false
}