aboutsummaryrefslogtreecommitdiff
path: root/Northstar.CustomServers/scripts/vscripts/ai/_ai_lethality.gnut
diff options
context:
space:
mode:
authorBobTheBob <32057864+BobTheBob9@users.noreply.github.com>2021-08-31 23:14:58 +0100
committerBobTheBob <32057864+BobTheBob9@users.noreply.github.com>2021-08-31 23:14:58 +0100
commit9a96d0bff56f1969c68bb52a2f33296095bdc67d (patch)
tree4175928e488632705692e3cccafa1a38dd854615 /Northstar.CustomServers/scripts/vscripts/ai/_ai_lethality.gnut
parent27bd240871b7c0f2f49fef137718b2e3c208e3b4 (diff)
downloadNorthstarMods-9a96d0bff56f1969c68bb52a2f33296095bdc67d.tar.gz
NorthstarMods-9a96d0bff56f1969c68bb52a2f33296095bdc67d.zip
move to new mod format
Diffstat (limited to 'Northstar.CustomServers/scripts/vscripts/ai/_ai_lethality.gnut')
-rw-r--r--Northstar.CustomServers/scripts/vscripts/ai/_ai_lethality.gnut97
1 files changed, 0 insertions, 97 deletions
diff --git a/Northstar.CustomServers/scripts/vscripts/ai/_ai_lethality.gnut b/Northstar.CustomServers/scripts/vscripts/ai/_ai_lethality.gnut
deleted file mode 100644
index 771fe6d93..000000000
--- a/Northstar.CustomServers/scripts/vscripts/ai/_ai_lethality.gnut
+++ /dev/null
@@ -1,97 +0,0 @@
-untyped
-
-global enum eAILethality
-{
- VeryLow,
- Low,
- Medium,
- High,
- VeryHigh
-}
-
-global function SetAILethality
-
-global function UpdateNPCForAILethality
-
-function SetAILethality( aiLethality )
-{
- Assert( IsMultiplayer() )
- level.nv.aiLethality = aiLethality
-
- switch ( aiLethality )
- {
- case eAILethality.Medium:
- break
-
- case eAILethality.High:
- NPCSetAimConeFocusParams( 6, 2.5 )
- NPCSetAimPatternFocusParams( 4, 0.3, 0.8 )
- break
- case eAILethality.VeryHigh:
- NPCSetAimConeFocusParams( 5, 2.0 )
- NPCSetAimPatternFocusParams( 4, 0.3, 0.8 )
- break
- }
-
- // reset ai lethality
-
- array<entity> npcs = GetNPCArray()
- foreach ( npc in npcs )
- {
- UpdateNPCForAILethality( npc )
- }
-}
-
-
-function SetTitanAccuracyAndProficiency( entity npcTitan )
-{
- Assert( IsMultiplayer() )
- int lethality = Riff_AILethality()
- float accuracyMultiplier = 1.0
- int weaponProficiency = eWeaponProficiency.GOOD
-
- entity player = GetPetTitanOwner( npcTitan )
- entity soul = npcTitan.GetTitanSoul()
-
- // auto titans have lower proficiency
- if ( player && soul == null)
- {
- soul = player.GetTitanSoul() // in mid transfer
- }
-
- if ( IsValid( soul ) )
- {
- if ( SoulHasPassive( soul, ePassives.PAS_ENHANCED_TITAN_AI ) )
- {
- weaponProficiency = eWeaponProficiency.GOOD
- }
- else if ( player )
- {
- weaponProficiency = eWeaponProficiency.AVERAGE
- entity ordnanceWeapon = npcTitan.GetOffhandWeapon( OFFHAND_ORDNANCE )
- if ( IsValid( ordnanceWeapon ) )
- ordnanceWeapon.AllowUse( false )
-
- entity centerWeapon = npcTitan.GetOffhandWeapon( OFFHAND_TITAN_CENTER )
- if ( IsValid( centerWeapon ) )
- centerWeapon.AllowUse( false )
- }
- }
-
- npcTitan.kv.AccuracyMultiplier = accuracyMultiplier
- npcTitan.kv.WeaponProficiency = weaponProficiency
-}
-
-function UpdateNPCForAILethality( entity npc )
-{
- Assert( IsMultiplayer() )
- if ( npc.IsTitan() )
- {
- SetTitanAccuracyAndProficiency( npc )
- return
- }
-
- if ( IsMinion( npc ) )
- SetProficiency( npc )
-}
-