diff options
author | Maya <malte.hoermeyer@web.de> | 2022-07-24 19:53:10 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-07-24 19:53:10 +0200 |
commit | d420367d429e6a4f21d4b7661ac4a19ac1c3420b (patch) | |
tree | d9a9ab73ed736b5276932d87276fbe735a9864c7 /Northstar.CustomServers/mod/scripts/vscripts | |
parent | 14ee2ce0a4fcee0e9f2afce87936016cd8b72568 (diff) | |
download | NorthstarMods-d420367d429e6a4f21d4b7661ac4a19ac1c3420b.tar.gz NorthstarMods-d420367d429e6a4f21d4b7661ac4a19ac1c3420b.zip |
[FD]Formatting Frontier Defense Gamemode Files (#439)
* Formatting Frontier Defense Gamemode Files
Co-authored-by: Jack <66967891+ASpoonPlaysGames@users.noreply.github.com>
Co-authored-by: x3Karma <juliuslimck@gmail.com>
Diffstat (limited to 'Northstar.CustomServers/mod/scripts/vscripts')
18 files changed, 756 insertions, 742 deletions
diff --git a/Northstar.CustomServers/mod/scripts/vscripts/_harvester.gnut b/Northstar.CustomServers/mod/scripts/vscripts/_harvester.gnut index e2acd1bd..4e381031 100644 --- a/Northstar.CustomServers/mod/scripts/vscripts/_harvester.gnut +++ b/Northstar.CustomServers/mod/scripts/vscripts/_harvester.gnut @@ -12,7 +12,7 @@ global struct HarvesterStruct { } -HarvesterStruct function SpawnHarvester(vector origin,vector angles,int health,int shieldHealth,int team) +HarvesterStruct function SpawnHarvester( vector origin, vector angles, int health, int shieldHealth, int team ) { entity harvester = CreateEntity( "prop_script" ) harvester.SetValueForModelKey( $"models/props/generator_coop/generator_coop.mdl" ) @@ -20,10 +20,10 @@ HarvesterStruct function SpawnHarvester(vector origin,vector angles,int health,i harvester.SetAngles( angles ) harvester.kv.solid = SOLID_VPHYSICS - harvester.SetMaxHealth(health) - harvester.SetHealth(health) - harvester.SetShieldHealthMax(shieldHealth) - harvester.SetShieldHealth(shieldHealth) + harvester.SetMaxHealth( health ) + harvester.SetHealth( health ) + harvester.SetShieldHealthMax( shieldHealth ) + harvester.SetShieldHealth( shieldHealth ) harvester.EnableAttackableByAI( 30, 0, AI_AP_FLAG_NONE ) SetObjectCanBeMeleed( harvester, false ) SetTeam(harvester,team) @@ -34,15 +34,15 @@ HarvesterStruct function SpawnHarvester(vector origin,vector angles,int health,i AI_CreateDangerousArea_Static( harvester, null, 90, TEAM_INVALID, true, true, origin ) DispatchSpawn( harvester ) - SetGlobalNetEnt("FD_activeHarvester",harvester) + SetGlobalNetEnt( "FD_activeHarvester", harvester ) - entity blackbox = CreatePropDynamic(MODEL_HARVESTER_TOWER_COLLISION,origin,angles,0) + entity blackbox = CreatePropDynamic( MODEL_HARVESTER_TOWER_COLLISION, origin, angles, 0 ) blackbox.Hide() blackbox.Solid() // blackbox.kv.CollisionGroup = TRACE_COLLISION_GROUP_PLAYER ToggleNPCPathsForEntity( blackbox, false ) - entity rings = CreatePropDynamic(MODEL_HARVESTER_TOWER_RINGS,origin,angles,6) + entity rings = CreatePropDynamic( MODEL_HARVESTER_TOWER_RINGS, origin, angles, 6 ) thread PlayAnim( rings, "generator_cycle_fast" ) @@ -55,19 +55,19 @@ HarvesterStruct function SpawnHarvester(vector origin,vector angles,int health,i return ret } -HarvesterStruct function generateBeamFX(HarvesterStruct harvester) +HarvesterStruct function generateBeamFX( HarvesterStruct harvester ) { - entity Harvester_Beam = StartParticleEffectOnEntity_ReturnEntity(harvester.harvester,GetParticleSystemIndex(FX_HARVESTER_BEAM),FX_PATTACH_ABSORIGIN_FOLLOW,0) - EffectSetControlPointVector( Harvester_Beam, 1, GetShieldTriLerpColor(0.0) ) + entity Harvester_Beam = StartParticleEffectOnEntity_ReturnEntity( harvester.harvester, GetParticleSystemIndex( FX_HARVESTER_BEAM ), FX_PATTACH_ABSORIGIN_FOLLOW ,0 ) + EffectSetControlPointVector( Harvester_Beam, 1, GetShieldTriLerpColor( 0.0 ) ) harvester.particleBeam = Harvester_Beam Harvester_Beam.DisableHibernation() return harvester } -HarvesterStruct function generateShieldFX(HarvesterStruct harvester) +HarvesterStruct function generateShieldFX( HarvesterStruct harvester ) { - entity Harvester_Shield = StartParticleEffectOnEntity_ReturnEntity(harvester.harvester,GetParticleSystemIndex(FX_HARVESTER_OVERSHIELD),FX_PATTACH_ABSORIGIN_FOLLOW,0) - EffectSetControlPointVector( Harvester_Shield, 1, GetShieldTriLerpColor(0.0) ) + entity Harvester_Shield = StartParticleEffectOnEntity_ReturnEntity( harvester.harvester, GetParticleSystemIndex( FX_HARVESTER_OVERSHIELD ), FX_PATTACH_ABSORIGIN_FOLLOW, 0 ) + EffectSetControlPointVector( Harvester_Shield, 1, GetShieldTriLerpColor( 0.0 ) ) harvester.particleShield = Harvester_Shield return harvester }
\ No newline at end of file diff --git a/Northstar.CustomServers/mod/scripts/vscripts/ai/_ai_emp_titans.gnut b/Northstar.CustomServers/mod/scripts/vscripts/ai/_ai_emp_titans.gnut index 8fde4343..2792d617 100644 --- a/Northstar.CustomServers/mod/scripts/vscripts/ai/_ai_emp_titans.gnut +++ b/Northstar.CustomServers/mod/scripts/vscripts/ai/_ai_emp_titans.gnut @@ -38,7 +38,7 @@ void function EMPTitanThinkConstant( entity titan ) //Used to identify this titan as an arc titan // SetTargetName( titan, "empTitan" ) // unable to do this due to FD reasons - file.empTitans.append(titan) + file.empTitans.append( titan ) //Wait for titan to stand up and exit bubble shield before deploying arc ability. WaitTillHotDropComplete( titan ) @@ -95,8 +95,8 @@ void function EMPTitanThinkConstant( entity titan ) { StopSoundOnEntity( titan, "EMP_Titan_Electrical_Field" ) EnableTitanRodeo( titan ) //Make the arc titan rodeoable now that it is no longer electrified. - if (file.empTitans.find(titan)) - file.empTitans.remove(file.empTitans.find(titan)) + if (file.empTitans.find( titan ) ) + file.empTitans.remove( file.empTitans.find( titan ) ) } foreach ( particleSystem in particles ) @@ -117,7 +117,7 @@ void function EMPTitanThinkConstant( entity titan ) { origin = titan.GetAttachmentOrigin( attachID ) - RadiusDamage( + RadiusDamage( origin, // center titan, // attacker titan, // inflictor @@ -143,7 +143,7 @@ void function EmpField_DamagedEntity( entity target, var damageInfo ) entity titan = DamageInfo_GetAttacker( damageInfo ) if ( !IsValid( titan ) ) - return + return local className = target.GetClassName() if ( className == "rpg_missile" || className == "npc_turret_sentry" || className == "grenade" ) @@ -189,7 +189,7 @@ string function GetEMPAttachmentForTitan( entity titan ) return "hijack" } -bool function IsEMPTitan(entity titan) +bool function IsEMPTitan( entity titan ) { - return file.empTitans.find(titan) != -1 ? true : false + return file.empTitans.find( titan ) != -1 ? true : false } diff --git a/Northstar.CustomServers/mod/scripts/vscripts/ai/_ai_stationary_firing_positions.gnut b/Northstar.CustomServers/mod/scripts/vscripts/ai/_ai_stationary_firing_positions.gnut index 2e7c938e..430de58a 100644 --- a/Northstar.CustomServers/mod/scripts/vscripts/ai/_ai_stationary_firing_positions.gnut +++ b/Northstar.CustomServers/mod/scripts/vscripts/ai/_ai_stationary_firing_positions.gnut @@ -262,36 +262,41 @@ int function DistanceCompareClosestForStationaryAIPosition( ArrayDistanceEntryFo } -void function DebugDrawStationaryAiPositions(int typeMask){ - thread DebugDrawStationaryAiPositions_thread(typeMask) +void function DebugDrawStationaryAiPositions( int typeMask ) +{ + thread DebugDrawStationaryAiPositions_thread( typeMask ) } -void function DebugDrawStationaryAiPositions_thread(int typeMask) -{ while(true) +void function DebugDrawStationaryAiPositions_thread( int typeMask ) +{ + while( true ) { - for(int i = 0;i<4;i++){ - if((1<<i)&typeMask) - foreach(StationaryAIPosition a in file.stationaryPositions[i]) + for( int i = 0; i < 4; i++ ) + { + if( ( 1 << i ) & typeMask ) + foreach( StationaryAIPosition a in file.stationaryPositions[i] ) { - switch(i){ + switch( i ) + { case 0: - DebugDrawSphere(a.origin,50,255,255,0,false,0.2) + DebugDrawSphere( a.origin, 50, 255, 255, 0,false, 0.5 ) case 1: - DebugDrawSphere(a.origin,50,0,255,255,false,0.2) + DebugDrawSphere( a.origin, 50, 0, 255, 255, false, 0.5 ) case 2: - DebugDrawSphere(a.origin,50,0,0,255,false,0.2) + DebugDrawSphere( a.origin, 50, 0, 0, 255, false, 0.5 ) case 3: - DebugDrawSphere(a.origin,50,255,0,255,false,0.2) - } - if(a.inUse){ - DebugDrawSphere(a.origin,40,255,0,0,false,0.2) - }else{ - DebugDrawSphere(a.origin,40,0,255,0,false,0.2) + DebugDrawSphere( a.origin, 50, 255, 0, 255, false, 0.5 ) } + + if( a.inUse ) + DebugDrawSphere( a.origin, 40, 255, 0, 0, false, 0.5 ) + else + DebugDrawSphere( a.origin, 40, 0, 255, 0, false, 0.5 ) + } } - wait 0.1 + wait 0.4 } } diff --git a/Northstar.CustomServers/mod/scripts/vscripts/gamemodes/_gamemode_fd.nut b/Northstar.CustomServers/mod/scripts/vscripts/gamemodes/_gamemode_fd.nut index d630cbed..c8ad470d 100644 --- a/Northstar.CustomServers/mod/scripts/vscripts/gamemodes/_gamemode_fd.nut +++ b/Northstar.CustomServers/mod/scripts/vscripts/gamemodes/_gamemode_fd.nut @@ -29,8 +29,8 @@ struct player_struct_fd{ global HarvesterStruct& fd_harvester global vector shopPosition -global vector shopAngles = <0,0,0> -global table<string,array<vector> > routes +global vector shopAngles = < 0, 0, 0 > +global table< string, array<vector> > routes global array<entity> routeNodes global array<entity> spawnedNPCs @@ -52,27 +52,27 @@ void function GamemodeFD_Init() { PrecacheModel( MODEL_ATTRITION_BANK ) PrecacheModel( $"models/humans/grunts/imc_grunt_shield_captain.mdl" ) - PrecacheParticleSystem($"P_smokescreen_FD") + PrecacheParticleSystem( $"P_smokescreen_FD" ) RegisterSignal( "SniperSwitchedEnemy" ) // for use in SniperTitanThink behavior. - RegisterSignal("FD_ReachedHarvester") - RegisterSignal("OnFailedToPath") + RegisterSignal( "FD_ReachedHarvester" ) + RegisterSignal( "OnFailedToPath" ) - SetRoundBased(true) - SetShouldUseRoundWinningKillReplay(false) + SetRoundBased( true ) + SetShouldUseRoundWinningKillReplay( false ) Riff_ForceBoostAvailability( eBoostAvailability.Disabled ) - PlayerEarnMeter_SetEnabled(false) + PlayerEarnMeter_SetEnabled( false ) SetShouldUsePickLoadoutScreen( true ) //general Callbacks - AddCallback_EntitiesDidLoad(LoadEntities) - AddCallback_GameStateEnter(eGameState.Prematch,FD_createHarvester) - AddCallback_GameStateEnter( eGameState.Playing,startMainGameLoop) - AddCallback_OnRoundEndCleanup(FD_NPCCleanup) - AddCallback_OnClientConnected(GamemodeFD_InitPlayer) + AddCallback_EntitiesDidLoad( LoadEntities ) + AddCallback_GameStateEnter( eGameState.Prematch,FD_createHarvester ) + AddCallback_GameStateEnter( eGameState.Playing, startMainGameLoop ) + AddCallback_OnRoundEndCleanup( FD_NPCCleanup ) + AddCallback_OnClientConnected( GamemodeFD_InitPlayer ) //Damage Callbacks - AddDamageByCallback("player",FD_DamageByPlayerCallback) + AddDamageByCallback( "player", FD_DamageByPlayerCallback) AddDamageCallback( "player", DamageScaleByDifficulty ) AddDamageCallback( "npc_titan", DamageScaleByDifficulty ) AddDamageCallback( "npc_turret_sentry", DamageScaleByDifficulty ) @@ -83,38 +83,38 @@ void function GamemodeFD_Init() AddSpawnCallback( "player", FD_PlayerRespawnCallback ) AddSpawnCallback("npc_turret_sentry", AddTurretSentry ) //death Callbacks - AddCallback_OnNPCKilled(OnNpcDeath) - AddCallback_OnPlayerKilled(GamemodeFD_OnPlayerKilled) + AddCallback_OnNPCKilled( OnNpcDeath ) + AddCallback_OnPlayerKilled( GamemodeFD_OnPlayerKilled ) AddDeathCallback( "npc_frag_drone", OnTickDeath ) // ticks dont come up in the other callback because of course they dont //Command Callbacks - AddClientCommandCallback("FD_ToggleReady",ClientCommandCallbackToggleReady) - AddClientCommandCallback("FD_UseHarvesterShieldBoost",useShieldBoost) + AddClientCommandCallback( "FD_ToggleReady", ClientCommandCallbackToggleReady ) + AddClientCommandCallback( "FD_UseHarvesterShieldBoost", useShieldBoost ) //shop Callback - SetBoostPurchaseCallback(FD_BoostPurchaseCallback) - SetTeamReserveInteractCallback(FD_TeamReserveDepositOrWithdrawCallback) + SetBoostPurchaseCallback( FD_BoostPurchaseCallback ) + SetTeamReserveInteractCallback( FD_TeamReserveDepositOrWithdrawCallback ) //earn meter ScoreEvent_SetupEarnMeterValuesForMixedModes() } -void function FD_BoostPurchaseCallback(entity player,BoostStoreData data) +void function FD_BoostPurchaseCallback( entity player, BoostStoreData data ) { file.players[player].moneySpend += data.cost } -void function FD_PlayerRespawnCallback(entity player) +void function FD_PlayerRespawnCallback( entity player ) { - if(player in file.players) + if( player in file.players ) file.players[player].lastRespawn = Time() Highlight_SetFriendlyHighlight( player, "sp_friendly_hero" ) } -void function FD_TeamReserveDepositOrWithdrawCallback(entity player, string action,int amount) +void function FD_TeamReserveDepositOrWithdrawCallback( entity player, string action, int amount ) { - switch(action) + switch( action ) { case"deposit": file.players[player].moneyShared += amount @@ -124,64 +124,64 @@ void function FD_TeamReserveDepositOrWithdrawCallback(entity player, string acti break } } -void function GamemodeFD_OnPlayerKilled(entity victim, entity attacker, var damageInfo) +void function GamemodeFD_OnPlayerKilled( entity victim, entity attacker, var damageInfo ) { file.players[victim].longestLife = Time() - file.players[victim].lastRespawn file.players[victim].diedThisRound = true array<entity> militiaplayers = GetPlayerArrayOfTeam( TEAM_MILITIA ) int deaths = 0 - foreach (entity player in militiaplayers) - if (!IsAlive(player)) + foreach ( entity player in militiaplayers ) + if ( !IsAlive( player ) ) deaths++ foreach( entity player in GetPlayerArray() ) { - if (player == victim || player.GetTeam() != TEAM_MILITIA) + if ( player == victim || player.GetTeam() != TEAM_MILITIA ) continue - if (deaths == 1) // only one pilot died + if ( deaths == 1 ) // only one pilot died PlayFactionDialogueToPlayer( "fd_singlePilotDown", player ) - else if (deaths > 1 && deaths < militiaplayers.len() - 1) // multiple pilots died but at least one alive + else if ( deaths > 1 && deaths < militiaplayers.len() - 1 ) // multiple pilots died but at least one alive PlayFactionDialogueToPlayer( "fd_multiPilotDown", player ) - else if (deaths == militiaplayers.len() - 1) // ur shit out of luck ur the only survivor + else if ( deaths == militiaplayers.len() - 1 ) // ur shit out of luck ur the only survivor PlayFactionDialogueToPlayer( "fd_onlyPlayerIsAlive", player ) } } -void function FD_UsedCoreCallback(entity titan,entity weapon) +void function FD_UsedCoreCallback( entity titan, entity weapon ) { - if(!(titan in file.players)) + if( !( titan in file.players ) ) { return } file.players[titan].coresUsed += 1 } -void function GamemodeFD_InitPlayer(entity player) +void function GamemodeFD_InitPlayer( entity player ) { player_struct_fd data data.diedThisRound = false file.players[player] <- data - thread SetTurretSettings_threaded(player) - if(GetGlobalNetInt("FD_currentWave")>1) - PlayerEarnMeter_AddEarnedAndOwned(player,1.0,1.0) + thread SetTurretSettings_threaded( player ) + if( GetGlobalNetInt( "FD_currentWave" ) > 1 ) + PlayerEarnMeter_AddEarnedAndOwned( player, 1.0, 1.0 ) - if ( GetGlobalNetInt("FD_currentWave") != 0 ) + if ( GetGlobalNetInt( "FD_currentWave" ) != 0 ) DisableTitanSelectionForPlayer( player ) // this might need moving to when they exit the titan selection UI when we do that else EnableTitanSelectionForPlayer( player ) - if ( GetGlobalNetInt("FD_currentWave") != 0 ) + if ( GetGlobalNetInt( "FD_currentWave" ) != 0 ) DisableTitanSelectionForPlayer( player ) // this might need moving to when they exit the titan selection UI when we do that else EnableTitanSelectionForPlayer( player ) } -void function SetTurretSettings_threaded(entity player) +void function SetTurretSettings_threaded( entity player ) { //has to be delayed because PlayerConnect callbacks get called in wrong order WaitFrame() - DeployableTurret_SetAISettingsForPlayer_AP(player,"npc_turret_sentry_burn_card_ap_fd") - DeployableTurret_SetAISettingsForPlayer_AT(player,"npc_turret_sentry_burn_card_at_fd") + DeployableTurret_SetAISettingsForPlayer_AP( player, "npc_turret_sentry_burn_card_ap_fd" ) + DeployableTurret_SetAISettingsForPlayer_AT( player, "npc_turret_sentry_burn_card_at_fd" ) } void function OnTickDeath( entity victim, var damageInfo ) @@ -199,25 +199,25 @@ void function OnTickDeath( entity victim, var damageInfo ) void function OnNpcDeath( entity victim, entity attacker, var damageInfo ) { - if(victim.IsTitan()&&attacker in file.players) + if( victim.IsTitan() && attacker in file.players ) file.players[attacker].titanKills++ - int victimTypeID = FD_GetAITypeID_ByString(victim.GetTargetName()) - if(victimTypeID == eFD_AITypeIDs.TITAN_MORTAR||victimTypeID == eFD_AITypeIDs.SPECTRE_MORTAR) - if(attacker in file.players) + int victimTypeID = FD_GetAITypeID_ByString( victim.GetTargetName() ) + if( ( victimTypeID == eFD_AITypeIDs.TITAN_MORTAR ) || ( victimTypeID == eFD_AITypeIDs.SPECTRE_MORTAR ) ) + if( attacker in file.players ) file.players[attacker].mortarUnitsKilled++ int findIndex = spawnedNPCs.find( victim ) if ( findIndex != -1 ) { spawnedNPCs.remove( findIndex ) - string netIndex = GetAiNetIdFromTargetName(victim.GetTargetName()) - if(netIndex != "") - SetGlobalNetInt(netIndex,GetGlobalNetInt(netIndex)-1) + string netIndex = GetAiNetIdFromTargetName( victim.GetTargetName() ) + if( netIndex != "" ) + SetGlobalNetInt( netIndex, GetGlobalNetInt( netIndex ) - 1 ) - SetGlobalNetInt("FD_AICount_Current",GetGlobalNetInt("FD_AICount_Current")-1) + SetGlobalNetInt( "FD_AICount_Current", GetGlobalNetInt( "FD_AICount_Current" ) - 1 ) } - if ( victim.GetOwner() == attacker || !attacker.IsPlayer() || attacker == victim || victim.GetBossPlayer() == attacker || victim.GetClassName() == "npc_turret_sentry" ) + if ( victim.GetOwner() == attacker || !attacker.IsPlayer() || ( attacker == victim ) || ( victim.GetBossPlayer() == attacker ) || victim.GetClassName() == "npc_turret_sentry" ) return int playerScore = 0 @@ -230,7 +230,7 @@ void function OnNpcDeath( entity victim, entity attacker, var damageInfo ) string eventName = FD_GetScoreEventName( victim.GetClassName() ) playerScore = ScoreEvent_GetPointValue( GetScoreEvent( eventName ) ) - switch (victim.GetClassName()) + switch ( victim.GetClassName() ) { case "npc_soldier": money = 5 @@ -248,10 +248,10 @@ void function OnNpcDeath( entity victim, entity attacker, var damageInfo ) default: money = 0 // titans seem to total up to 50 money undoomed health } - foreach(player in GetPlayerArray()) + foreach( player in GetPlayerArray() ) Remote_CallFunction_NonReplay( player, "ServerCallback_OnTitanKilled", attacker.GetEncodedEHandle(), victim.GetEncodedEHandle(), scriptDamageType, damageSourceId ) } - if (money != 0) + if ( money != 0 ) AddMoneyToPlayer( attacker , money ) attacker.AddToPlayerGameStat( PGS_ASSAULT_SCORE, playerScore ) // seems to be how combat score is counted @@ -273,15 +273,18 @@ void function OnNpcDeath( entity victim, entity attacker, var damageInfo ) } -void function RateSpawnpoints_FD(int _0, array<entity> _1, int _2, entity _3){} +void function RateSpawnpoints_FD( int _0, array<entity> _1, int _2, entity _3 ) +{ + +} -bool function useShieldBoost(entity player,array<string> args) +bool function useShieldBoost( entity player, array<string> args ) { - if((GetGlobalNetTime("FD_harvesterInvulTime")<Time())&&(player.GetPlayerNetInt("numHarvesterShieldBoost")>0)) + if( ( GetGlobalNetTime( "FD_harvesterInvulTime" ) < Time() ) && ( player.GetPlayerNetInt( "numHarvesterShieldBoost" ) > 0 ) ) { - fd_harvester.harvester.SetShieldHealth(fd_harvester.harvester.GetShieldHealthMax()) - SetGlobalNetTime("FD_harvesterInvulTime",Time()+5) - MessageToTeam(TEAM_MILITIA,eEventNotifications.FD_PlayerHealedHarvester, null, player) + fd_harvester.harvester.SetShieldHealth( fd_harvester.harvester.GetShieldHealthMax() ) + SetGlobalNetTime( "FD_harvesterInvulTime", Time() + 5 ) + MessageToTeam( TEAM_MILITIA,eEventNotifications.FD_PlayerHealedHarvester, null, player ) player.SetPlayerNetInt( "numHarvesterShieldBoost", player.GetPlayerNetInt( "numHarvesterShieldBoost" ) - 1 ) file.players[player].harvesterHeals += 1 } @@ -298,22 +301,22 @@ void function mainGameLoop() startHarvester() bool showShop = false - for(int i = GetGlobalNetInt("FD_currentWave");i<waveEvents.len();i++) + for( int i = GetGlobalNetInt( "FD_currentWave" ); i < waveEvents.len(); i++ ) { - if(!runWave(i,showShop)) + if( !runWave( i, showShop ) ) break - if(i==0) + if( i == 0 ) { - PlayerEarnMeter_SetEnabled(true) + PlayerEarnMeter_SetEnabled( true ) showShop = true - foreach(entity player in GetPlayerArray()) + foreach( entity player in GetPlayerArray() ) { - PlayerEarnMeter_AddEarnedAndOwned(player,1.0,1.0) + PlayerEarnMeter_AddEarnedAndOwned( player, 1.0, 1.0 ) } DisableTitanSelection() } - else if (i + 1 == waveEvents.len() ) + else if( i + 1 == waveEvents.len() ) { EnableTitanSelection() } @@ -325,211 +328,212 @@ void function mainGameLoop() -array<int> function getHighestEnemyAmountsForWave(int waveIndex) +array<int> function getHighestEnemyAmountsForWave( int waveIndex ) { table<int,int> npcs - npcs[eFD_AITypeIDs.TITAN]<-0 - npcs[eFD_AITypeIDs.TITAN_NUKE]<-0 - npcs[eFD_AITypeIDs.TITAN_ARC]<-0 - npcs[eFD_AITypeIDs.TITAN_MORTAR]<-0 - npcs[eFD_AITypeIDs.GRUNT]<-0 - npcs[eFD_AITypeIDs.SPECTRE]<-0 - npcs[eFD_AITypeIDs.SPECTRE_MORTAR]<-0 - npcs[eFD_AITypeIDs.STALKER]<-0 - npcs[eFD_AITypeIDs.REAPER]<-0 - npcs[eFD_AITypeIDs.TICK]<-0 - npcs[eFD_AITypeIDs.DRONE]<-0 - npcs[eFD_AITypeIDs.DRONE_CLOAK]<-0 - // npcs[eFD_AITypeIDs.RONIN]<-0 - // npcs[eFD_AITypeIDs.NORTHSTAR]<-0 - // npcs[eFD_AITypeIDs.SCORCH]<-0 - // npcs[eFD_AITypeIDs.LEGION]<-0 - // npcs[eFD_AITypeIDs.TONE]<-0 - // npcs[eFD_AITypeIDs.ION]<-0 - // npcs[eFD_AITypeIDs.MONARCH]<-0 - // npcs[eFD_AITypeIDs.TITAN_SNIPER]<-0 - - - foreach(WaveEvent e in waveEvents[waveIndex]) + npcs[eFD_AITypeIDs.TITAN] <- 0 + npcs[eFD_AITypeIDs.TITAN_NUKE] <- 0 + npcs[eFD_AITypeIDs.TITAN_ARC] <- 0 + npcs[eFD_AITypeIDs.TITAN_MORTAR] <- 0 + npcs[eFD_AITypeIDs.GRUNT] <- 0 + npcs[eFD_AITypeIDs.SPECTRE] <- 0 + npcs[eFD_AITypeIDs.SPECTRE_MORTAR] <- 0 + npcs[eFD_AITypeIDs.STALKER] <- 0 + npcs[eFD_AITypeIDs.REAPER] <- 0 + npcs[eFD_AITypeIDs.TICK] <- 0 + npcs[eFD_AITypeIDs.DRONE] <- 0 + npcs[eFD_AITypeIDs.DRONE_CLOAK] <- 0 + // npcs[eFD_AITypeIDs.RONIN] <- 0 + // npcs[eFD_AITypeIDs.NORTHSTAR] <- 0 + // npcs[eFD_AITypeIDs.SCORCH] <- 0 + // npcs[eFD_AITypeIDs.LEGION] <- 0 + // npcs[eFD_AITypeIDs.TONE] <- 0 + // npcs[eFD_AITypeIDs.ION] <- 0 + // npcs[eFD_AITypeIDs.MONARCH] <- 0 + // npcs[eFD_AITypeIDs.TITAN_SNIPER] <- 0 + + + foreach( WaveEvent e in waveEvents[waveIndex] ) { - if(e.spawnEvent.spawnAmount==0) + if( e.spawnEvent.spawnAmount == 0 ) continue - switch(e.spawnEvent.spawnType) + switch( e.spawnEvent.spawnType ) { - case(eFD_AITypeIDs.TITAN): - case(eFD_AITypeIDs.RONIN): - case(eFD_AITypeIDs.NORTHSTAR): - case(eFD_AITypeIDs.SCORCH): - case(eFD_AITypeIDs.TONE): - case(eFD_AITypeIDs.ION): - case(eFD_AITypeIDs.MONARCH): - case(eFD_AITypeIDs.LEGION): - case(eFD_AITypeIDs.TITAN_SNIPER): - npcs[eFD_AITypeIDs.TITAN]+=e.spawnEvent.spawnAmount + case( eFD_AITypeIDs.TITAN ): + case( eFD_AITypeIDs.RONIN ): + case( eFD_AITypeIDs.NORTHSTAR ): + case( eFD_AITypeIDs.SCORCH ): + case( eFD_AITypeIDs.TONE ): + case( eFD_AITypeIDs.ION ): + case( eFD_AITypeIDs.MONARCH ): + case( eFD_AITypeIDs.LEGION ): + case( eFD_AITypeIDs.TITAN_SNIPER ): + npcs[eFD_AITypeIDs.TITAN] += e.spawnEvent.spawnAmount break default: - npcs[e.spawnEvent.spawnType]+=e.spawnEvent.spawnAmount + npcs[e.spawnEvent.spawnType] += e.spawnEvent.spawnAmount } } - array<int> ret = [-1,-1,-1,-1,-1,-1,-1,-1,-1] - foreach(int key,int value in npcs) + array<int> ret = [ -1, -1, -1, -1, -1, -1, -1, -1, -1 ] + foreach( int key, int value in npcs ) { - if(value==0) + if( value == 0 ) continue int lowestArrayIndex = 0 bool keyIsSet = false - foreach(index,int arrayValue in ret) + foreach( index, int arrayValue in ret ) { - if(arrayValue==-1) + if( arrayValue == -1 ) { ret[index] = key keyIsSet = true break } - if(npcs[ret[lowestArrayIndex]]>npcs[ret[index]]) + if( npcs[ ret[lowestArrayIndex] ] > npcs[ ret[index] ] ) lowestArrayIndex = index } - if((!keyIsSet)&&(npcs[ret[lowestArrayIndex]]<value)) + if( ( !keyIsSet ) && ( npcs[ ret[lowestArrayIndex] ] < value ) ) ret[lowestArrayIndex] = key } - foreach(int val in ret){ - printt("ArrayVal",val) + foreach( int val in ret ) + { + printt( "ArrayVal", val ) } return ret } -void function SetEnemyAmountNetVars(int waveIndex) +void function SetEnemyAmountNetVars( int waveIndex ) { int total = 0 table<int,int> npcs - npcs[eFD_AITypeIDs.TITAN]<-0 - npcs[eFD_AITypeIDs.TITAN_NUKE]<-0 - npcs[eFD_AITypeIDs.TITAN_ARC]<-0 - npcs[eFD_AITypeIDs.TITAN_MORTAR]<-0 - npcs[eFD_AITypeIDs.GRUNT]<-0 - npcs[eFD_AITypeIDs.SPECTRE]<-0 - npcs[eFD_AITypeIDs.SPECTRE_MORTAR]<-0 - npcs[eFD_AITypeIDs.STALKER]<-0 - npcs[eFD_AITypeIDs.REAPER]<-0 - npcs[eFD_AITypeIDs.TICK]<-0 - npcs[eFD_AITypeIDs.DRONE]<-0 - npcs[eFD_AITypeIDs.DRONE_CLOAK]<-0 - // npcs[eFD_AITypeIDs.RONIN]<-0 - // npcs[eFD_AITypeIDs.NORTHSTAR]<-0 - // npcs[eFD_AITypeIDs.SCORCH]<-0 - // npcs[eFD_AITypeIDs.LEGION]<-0 - // npcs[eFD_AITypeIDs.TONE]<-0 - // npcs[eFD_AITypeIDs.ION]<-0 - // npcs[eFD_AITypeIDs.MONARCH]<-0 - // npcs[eFD_AITypeIDs.TITAN_SNIPER]<-0 - - - foreach(WaveEvent e in waveEvents[waveIndex]) + npcs[eFD_AITypeIDs.TITAN] <- 0 + npcs[eFD_AITypeIDs.TITAN_NUKE] <- 0 + npcs[eFD_AITypeIDs.TITAN_ARC] <- 0 + npcs[eFD_AITypeIDs.TITAN_MORTAR] <- 0 + npcs[eFD_AITypeIDs.GRUNT] <- 0 + npcs[eFD_AITypeIDs.SPECTRE] <- 0 + npcs[eFD_AITypeIDs.SPECTRE_MORTAR] <- 0 + npcs[eFD_AITypeIDs.STALKER] <- 0 + npcs[eFD_AITypeIDs.REAPER] <- 0 + npcs[eFD_AITypeIDs.TICK] <- 0 + npcs[eFD_AITypeIDs.DRONE] <- 0 + npcs[eFD_AITypeIDs.DRONE_CLOAK] <- 0 + // npcs[eFD_AITypeIDs.RONIN] <- 0 + // npcs[eFD_AITypeIDs.NORTHSTAR] <- 0 + // npcs[eFD_AITypeIDs.SCORCH] <- 0 + // npcs[eFD_AITypeIDs.LEGION] <- 0 + // npcs[eFD_AITypeIDs.TONE] <- 0 + // npcs[eFD_AITypeIDs.ION] <- 0 + // npcs[eFD_AITypeIDs.MONARCH] <- 0 + // npcs[eFD_AITypeIDs.TITAN_SNIPER] <- 0 + + + foreach( WaveEvent e in waveEvents[waveIndex] ) { - if(e.spawnEvent.spawnAmount==0) + if( e.spawnEvent.spawnAmount == 0 ) continue - switch(e.spawnEvent.spawnType) + switch( e.spawnEvent.spawnType ) { - case(eFD_AITypeIDs.TITAN): - case(eFD_AITypeIDs.RONIN): - case(eFD_AITypeIDs.NORTHSTAR): - case(eFD_AITypeIDs.SCORCH): - case(eFD_AITypeIDs.TONE): - case(eFD_AITypeIDs.ION): - case(eFD_AITypeIDs.MONARCH): - case(eFD_AITypeIDs.LEGION): - case(eFD_AITypeIDs.TITAN_SNIPER): - npcs[eFD_AITypeIDs.TITAN]+=e.spawnEvent.spawnAmount + case( eFD_AITypeIDs.TITAN ): + case( eFD_AITypeIDs.RONIN ): + case( eFD_AITypeIDs.NORTHSTAR ): + case( eFD_AITypeIDs.SCORCH ): + case( eFD_AITypeIDs.TONE ): + case( eFD_AITypeIDs.ION ): + case( eFD_AITypeIDs.MONARCH ): + case( eFD_AITypeIDs.LEGION ): + case( eFD_AITypeIDs.TITAN_SNIPER ): + npcs[eFD_AITypeIDs.TITAN] += e.spawnEvent.spawnAmount break default: - npcs[e.spawnEvent.spawnType]+=e.spawnEvent.spawnAmount + npcs[e.spawnEvent.spawnType] += e.spawnEvent.spawnAmount } total+= e.spawnEvent.spawnAmount } - SetGlobalNetInt("FD_AICount_Titan",npcs[eFD_AITypeIDs.TITAN]) - SetGlobalNetInt("FD_AICount_Titan_Nuke",npcs[eFD_AITypeIDs.TITAN_NUKE]) - SetGlobalNetInt("FD_AICount_Titan_Mortar",npcs[eFD_AITypeIDs.TITAN_MORTAR]) - SetGlobalNetInt("FD_AICount_Titan_Arc",npcs[eFD_AITypeIDs.TITAN_ARC]) - SetGlobalNetInt("FD_AICount_Grunt",npcs[eFD_AITypeIDs.GRUNT]) - SetGlobalNetInt("FD_AICount_Spectre",npcs[eFD_AITypeIDs.SPECTRE]) - SetGlobalNetInt("FD_AICount_Spectre_Mortar",npcs[eFD_AITypeIDs.SPECTRE_MORTAR]) - SetGlobalNetInt("FD_AICount_Stalker",npcs[eFD_AITypeIDs.STALKER]) - SetGlobalNetInt("FD_AICount_Reaper",npcs[eFD_AITypeIDs.REAPER]) - SetGlobalNetInt("FD_AICount_Ticks",npcs[eFD_AITypeIDs.TICK]) - SetGlobalNetInt("FD_AICount_Drone",npcs[eFD_AITypeIDs.DRONE]) - SetGlobalNetInt("FD_AICount_Drone_Cloak",npcs[eFD_AITypeIDs.DRONE_CLOAK]) - SetGlobalNetInt("FD_AICount_Current",total) - SetGlobalNetInt("FD_AICount_Total",total) + SetGlobalNetInt( "FD_AICount_Titan", npcs[eFD_AITypeIDs.TITAN] ) + SetGlobalNetInt( "FD_AICount_Titan_Nuke", npcs[eFD_AITypeIDs.TITAN_NUKE] ) + SetGlobalNetInt( "FD_AICount_Titan_Mortar", npcs[eFD_AITypeIDs.TITAN_MORTAR] ) + SetGlobalNetInt( "FD_AICount_Titan_Arc", npcs[eFD_AITypeIDs.TITAN_ARC] ) + SetGlobalNetInt( "FD_AICount_Grunt", npcs[eFD_AITypeIDs.GRUNT] ) + SetGlobalNetInt( "FD_AICount_Spectre", npcs[eFD_AITypeIDs.SPECTRE] ) + SetGlobalNetInt( "FD_AICount_Spectre_Mortar", npcs[eFD_AITypeIDs.SPECTRE_MORTAR] ) + SetGlobalNetInt( "FD_AICount_Stalker", npcs[eFD_AITypeIDs.STALKER] ) + SetGlobalNetInt( "FD_AICount_Reaper", npcs[eFD_AITypeIDs.REAPER] ) + SetGlobalNetInt( "FD_AICount_Ticks", npcs[eFD_AITypeIDs.TICK] ) + SetGlobalNetInt( "FD_AICount_Drone", npcs[eFD_AITypeIDs.DRONE] ) + SetGlobalNetInt( "FD_AICount_Drone_Cloak", npcs[eFD_AITypeIDs.DRONE_CLOAK] ) + SetGlobalNetInt( "FD_AICount_Current", total ) + SetGlobalNetInt( "FD_AICount_Total", total ) } -bool function runWave(int waveIndex,bool shouldDoBuyTime) +bool function runWave( int waveIndex, bool shouldDoBuyTime ) { - SetGlobalNetInt("FD_currentWave",waveIndex) + SetGlobalNetInt( "FD_currentWave", waveIndex ) file.havesterWasDamaged = false file.harvesterShieldDown = false - SetEnemyAmountNetVars(waveIndex) - for(int i = 0; i<20;i++)//Number of npc type ids + SetEnemyAmountNetVars( waveIndex ) + for( int i = 0; i < 20; i++ )//Number of npc type ids { - file.harvesterDamageSource.append(0.0) + file.harvesterDamageSource.append( 0.0 ) } - foreach(entity player in GetPlayerArray()) + foreach( entity player in GetPlayerArray() ) { file.players[player].diedThisRound = false file.players[player].scoreThisRound = 0 } - array<int> enemys = getHighestEnemyAmountsForWave(waveIndex) + array<int> enemys = getHighestEnemyAmountsForWave( waveIndex ) - foreach(entity player in GetPlayerArray()) + foreach( entity player in GetPlayerArray() ) { - Remote_CallFunction_NonReplay(player,"ServerCallback_FD_AnnouncePreParty",enemys[0],enemys[1],enemys[2],enemys[3],enemys[4],enemys[5],enemys[6],enemys[7],enemys[8]) + Remote_CallFunction_NonReplay( player, "ServerCallback_FD_AnnouncePreParty", enemys[0], enemys[1], enemys[2], enemys[3], enemys[4], enemys[5], enemys[6], enemys[7], enemys[8] ) } - if(shouldDoBuyTime) + if( shouldDoBuyTime ) { - SetGlobalNetInt("FD_waveState",WAVE_STATE_BREAK) + SetGlobalNetInt( "FD_waveState", WAVE_STATE_BREAK ) OpenBoostStores() - foreach(entity player in GetPlayerArray()) - Remote_CallFunction_NonReplay(player,"ServerCallback_FD_NotifyStoreOpen") - while(Time()<GetGlobalNetTime("FD_nextWaveStartTime")) + foreach( entity player in GetPlayerArray() ) + Remote_CallFunction_NonReplay( player, "ServerCallback_FD_NotifyStoreOpen" ) + while( Time() < GetGlobalNetTime( "FD_nextWaveStartTime" ) ) { - if(allPlayersReady()) - SetGlobalNetTime("FD_nextWaveStartTime",Time()) + if( allPlayersReady() ) + SetGlobalNetTime( "FD_nextWaveStartTime", Time() ) WaitFrame() } CloseBoostStores() - MessageToTeam(TEAM_MILITIA,eEventNotifications.FD_StoreClosing) + MessageToTeam( TEAM_MILITIA, eEventNotifications.FD_StoreClosing ) } //SetGlobalNetTime("FD_nextWaveStartTime",Time()+10) wait 10 - SetGlobalNetInt("FD_waveState",WAVE_STATE_INCOMING) - foreach(entity player in GetPlayerArray()) + SetGlobalNetInt( "FD_waveState", WAVE_STATE_INCOMING ) + foreach( entity player in GetPlayerArray() ) { - Remote_CallFunction_NonReplay(player,"ServerCallback_FD_ClearPreParty") - player.SetPlayerNetBool("FD_readyForNextWave",false) + Remote_CallFunction_NonReplay( player, "ServerCallback_FD_ClearPreParty" ) + player.SetPlayerNetBool( "FD_readyForNextWave", false ) } - SetGlobalNetBool("FD_waveActive",true) - MessageToTeam(TEAM_MILITIA,eEventNotifications.FD_AnnounceWaveStart) - SetGlobalNetInt("FD_waveState",WAVE_STATE_BREAK) + SetGlobalNetBool( "FD_waveActive", true ) + MessageToTeam( TEAM_MILITIA, eEventNotifications.FD_AnnounceWaveStart ) + SetGlobalNetInt( "FD_waveState", WAVE_STATE_BREAK ) //main wave loop thread SetWaveStateReady() executeWave() - SetGlobalNetInt("FD_waveState",WAVE_STATE_COMPLETE) - if(!IsAlive(fd_harvester.harvester)) + SetGlobalNetInt( "FD_waveState", WAVE_STATE_COMPLETE ) + if( !IsAlive( fd_harvester.harvester ) ) { float totalDamage = 0.0 - array<float> highestDamage = [0.0,0.0,0.0] - array<int> highestDamageSource = [-1,-1,-1] + array<float> highestDamage = [ 0.0, 0.0, 0.0 ] + array<int> highestDamageSource = [ -1, -1, -1 ] foreach(index,float damage in file.harvesterDamageSource) { totalDamage += damage - if(highestDamage[0]<damage) + if( highestDamage[0] < damage ) { highestDamage[2] = highestDamage[1] highestDamageSource[2] = highestDamageSource[1] @@ -538,34 +542,34 @@ bool function runWave(int waveIndex,bool shouldDoBuyTime) highestDamageSource[0] = index highestDamage[0] = damage } - else if(highestDamage[1]<damage) + else if( highestDamage[1] < damage ) { highestDamage[2] = highestDamage[1] highestDamageSource[2] = highestDamageSource[1] highestDamage[1] = damage highestDamageSource[1] = index } - else if(highestDamage[2]<damage) + else if( highestDamage[2] < damage ) { highestDamage[2] = damage highestDamageSource[2] = index } } - foreach(entity player in GetPlayerArray()) + foreach( entity player in GetPlayerArray() ) { - Remote_CallFunction_NonReplay(player,"ServerCallback_FD_DisplayHarvesterKiller",GetGlobalNetInt("FD_restartsRemaining"),getHintForTypeId(highestDamageSource[0]),highestDamageSource[0],highestDamage[0]/totalDamage,highestDamageSource[1],highestDamage[1]/totalDamage,highestDamageSource[2],highestDamage[2]/totalDamage) + Remote_CallFunction_NonReplay( player, "ServerCallback_FD_DisplayHarvesterKiller", GetGlobalNetInt( "FD_restartsRemaining" ), getHintForTypeId( highestDamageSource[0] ), highestDamageSource[0], highestDamage[0] / totalDamage, highestDamageSource[1], highestDamage[1] / totalDamage , highestDamageSource[2], highestDamage[2] / totalDamage ) } - if(GetGlobalNetInt("FD_restartsRemaining")>0) + if( GetGlobalNetInt( "FD_restartsRemaining" ) > 0 ) FD_DecrementRestarts() else SetRoundBased(false) - SetWinner(TEAM_IMC)//restart round + SetWinner( TEAM_IMC )//restart round spawnedNPCs = [] // reset npcs count restetWaveEvents() - foreach(player in GetPlayerArray()) - PlayerEarnMeter_AddEarnedAndOwned(player,1.0,1.0) + foreach( player in GetPlayerArray() ) + PlayerEarnMeter_AddEarnedAndOwned( player, 1.0, 1.0 ) return false } @@ -573,26 +577,26 @@ bool function runWave(int waveIndex,bool shouldDoBuyTime) wait 2 //wave end - SetGlobalNetBool("FD_waveActive",false) - MessageToTeam(TEAM_MILITIA,eEventNotifications.FD_AnnounceWaveEnd) + SetGlobalNetBool( "FD_waveActive", false ) + MessageToTeam( TEAM_MILITIA, eEventNotifications.FD_AnnounceWaveEnd ) if ( isFinalWave() && IsAlive( fd_harvester.harvester ) ) { //Game won code - MessageToTeam(TEAM_MILITIA,eEventNotifications.FD_AnnounceWaveEnd) - foreach(entity player in GetPlayerArray()) + MessageToTeam( TEAM_MILITIA, eEventNotifications.FD_AnnounceWaveEnd ) + foreach( entity player in GetPlayerArray() ) { - AddPlayerScore(player,"FDTeamWave") + AddPlayerScore( player, "FDTeamWave" ) } wait 1 int highestScore = 0; entity highestScore_player = GetPlayerArray()[0] - foreach(entity player in GetPlayerArray()) + foreach( entity player in GetPlayerArray() ) { - if(!file.players[player].diedThisRound) - AddPlayerScore(player,"FDDidntDie") - if(highestScore<file.players[player].scoreThisRound) + if( !file.players[player].diedThisRound ) + AddPlayerScore( player, "FDDidntDie" ) + if( highestScore < file.players[player].scoreThisRound ) { highestScore = file.players[player].scoreThisRound highestScore_player = player @@ -600,11 +604,11 @@ bool function runWave(int waveIndex,bool shouldDoBuyTime) } file.players[highestScore_player].totalMVPs += 1 - AddPlayerScore(highestScore_player,"FDWaveMVP") + AddPlayerScore( highestScore_player, "FDWaveMVP" ) wait 1 - foreach(entity player in GetPlayerArray()) - if(!file.havesterWasDamaged) - AddPlayerScore(player,"FDTeamFlawlessWave") + foreach( entity player in GetPlayerArray() ) + if( !file.havesterWasDamaged ) + AddPlayerScore( player, "FDTeamFlawlessWave" ) @@ -624,7 +628,7 @@ bool function runWave(int waveIndex,bool shouldDoBuyTime) { float damagepercent = ( ( file.harvesterDamageTaken / fd_harvester.harvester.GetMaxHealth().tofloat() ) * 100 ) float healthpercent = ( ( fd_harvester.harvester.GetHealth().tofloat() / fd_harvester.harvester.GetMaxHealth() ) * 100 ) - if (damagepercent < 5) // if less than 5% damage taken + if ( damagepercent < 5 ) // if less than 5% damage taken PlayFactionDialogueToTeam( "fd_waveRecapNearPerfect", TEAM_MILITIA ) else if ( healthpercent < 15 ) // if less than 15% health remains and more than 5% damage taken PlayFactionDialogueToTeam( "fd_waveRecapLowHealth", TEAM_MILITIA ) @@ -640,33 +644,33 @@ bool function runWave(int waveIndex,bool shouldDoBuyTime) } //Player scoring - MessageToTeam(TEAM_MILITIA,eEventNotifications.FD_NotifyWaveBonusIncoming) + MessageToTeam( TEAM_MILITIA, eEventNotifications.FD_NotifyWaveBonusIncoming ) wait 2 - foreach(entity player in GetPlayerArray()) + foreach( entity player in GetPlayerArray() ) { - if (isSecondWave()) + if ( isSecondWave() ) PlayFactionDialogueToPlayer( "fd_wavePayoutFirst", player ) else PlayFactionDialogueToPlayer( "fd_wavePayoutAddtnl", player ) - AddPlayerScore(player,"FDTeamWave") - AddMoneyToPlayer(player,GetCurrentPlaylistVarInt("fd_money_per_round",600)) + AddPlayerScore( player, "FDTeamWave" ) + AddMoneyToPlayer( player, GetCurrentPlaylistVarInt( "fd_money_per_round", 600 ) ) // this function is called "Set" but in reality it is "Add" - SetJoinInProgressBonus( GetCurrentPlaylistVarInt("fd_money_per_round",600) ) - EmitSoundOnEntityOnlyToPlayer(player,player,"HUD_MP_BountyHunt_BankBonusPts_Deposit_Start_1P") + SetJoinInProgressBonus( GetCurrentPlaylistVarInt( "fd_money_per_round" ,600 ) ) + EmitSoundOnEntityOnlyToPlayer( player, player, "HUD_MP_BountyHunt_BankBonusPts_Deposit_Start_1P" ) } wait 1 int highestScore = 0; entity highestScore_player = GetPlayerArray()[0] - foreach(entity player in GetPlayerArray()) + foreach( entity player in GetPlayerArray() ) { - if(!file.players[player].diedThisRound) + if( !file.players[player].diedThisRound ) { - AddPlayerScore(player,"FDDidntDie") + AddPlayerScore( player, "FDDidntDie" ) player.AddToPlayerGameStat( PGS_ASSAULT_SCORE, FD_SCORE_DIDNT_DIE ) } - AddMoneyToPlayer(player,100) - EmitSoundOnEntityOnlyToPlayer(player,player,"HUD_MP_BountyHunt_BankBonusPts_Deposit_Start_1P") - if(highestScore<file.players[player].scoreThisRound) + AddMoneyToPlayer( player, 100 ) + EmitSoundOnEntityOnlyToPlayer( player, player, "HUD_MP_BountyHunt_BankBonusPts_Deposit_Start_1P" ) + if( highestScore < file.players[player].scoreThisRound ) { highestScore = file.players[player].scoreThisRound highestScore_player = player @@ -675,48 +679,50 @@ bool function runWave(int waveIndex,bool shouldDoBuyTime) } wait 1 file.players[highestScore_player].totalMVPs += 1 - AddPlayerScore(highestScore_player,"FDWaveMVP") - AddMoneyToPlayer(highestScore_player,100) + AddPlayerScore( highestScore_player, "FDWaveMVP" ) + AddMoneyToPlayer( highestScore_player, 100 ) highestScore_player.AddToPlayerGameStat( PGS_ASSAULT_SCORE, FD_SCORE_MVP ) - EmitSoundOnEntityOnlyToPlayer(highestScore_player,highestScore_player,"HUD_MP_BountyHunt_BankBonusPts_Deposit_Start_1P") - foreach(entity player in GetPlayerArray()) + EmitSoundOnEntityOnlyToPlayer( highestScore_player, highestScore_player, "HUD_MP_BountyHunt_BankBonusPts_Deposit_Start_1P" ) + foreach( entity player in GetPlayerArray() ) { - Remote_CallFunction_NonReplay(player,"ServerCallback_FD_NotifyMVP",highestScore_player.GetEncodedEHandle()) + Remote_CallFunction_NonReplay( player, "ServerCallback_FD_NotifyMVP", highestScore_player.GetEncodedEHandle() ) } wait 1 - foreach(entity player in GetPlayerArray()) + foreach( entity player in GetPlayerArray() ) { - if(!file.havesterWasDamaged) + if( !file.havesterWasDamaged ) { - AddPlayerScore(player,"FDTeamFlawlessWave") - AddMoneyToPlayer(player,100) + AddPlayerScore( player, "FDTeamFlawlessWave" ) + AddMoneyToPlayer( player, 100 ) player.AddToPlayerGameStat( PGS_ASSAULT_SCORE, FD_SCORE_TEAM_FLAWLESS_WAVE ) - EmitSoundOnEntityOnlyToPlayer(player,player,"HUD_MP_BountyHunt_BankBonusPts_Deposit_Start_1P") + EmitSoundOnEntityOnlyToPlayer( player, player, "HUD_MP_BountyHunt_BankBonusPts_Deposit_Start_1P" ) } } wait 1 - if(waveIndex<waveEvents.len()) - SetGlobalNetTime("FD_nextWaveStartTime",Time()+75) + if( waveIndex<waveEvents.len() ) + SetGlobalNetTime( "FD_nextWaveStartTime", Time() + 75 ) return true } -void function SetWaveStateReady(){ +void function SetWaveStateReady() +{ wait 5 - SetGlobalNetInt("FD_waveState",WAVE_STATE_IN_PROGRESS) + SetGlobalNetInt( "FD_waveState", WAVE_STATE_IN_PROGRESS ) } -void function gameWonMedals(){ +void function gameWonMedals() +{ table<string,entity> medals //most mvps } -void function OnHarvesterDamaged(entity harvester, var damageInfo) +void function OnHarvesterDamaged( entity harvester, var damageInfo ) { if ( !IsValid( harvester ) ) return @@ -739,15 +745,15 @@ void function OnHarvesterDamaged(entity harvester, var damageInfo) fd_harvester.lastDamage = Time() - damageAmount = (damageAmount * GetCurrentPlaylistVarFloat("fd_player_damage_scalar",1.0)) + damageAmount = ( damageAmount * GetCurrentPlaylistVarFloat( "fd_player_damage_scalar", 1.0 ) ) - float shieldPercent = ( (harvester.GetShieldHealth().tofloat() / harvester.GetShieldHealthMax()) * 100 ) - if ( shieldPercent < 100 && !file.harvesterShieldDown) + float shieldPercent = ( ( harvester.GetShieldHealth().tofloat() / harvester.GetShieldHealthMax() ) * 100 ) + if ( shieldPercent < 100 && !file.harvesterShieldDown ) PlayFactionDialogueToTeam( "fd_baseShieldTakingDmg", TEAM_MILITIA ) - if ( shieldPercent < 35 && !file.harvesterShieldDown) // idk i made this up + if ( shieldPercent < 35 && !file.harvesterShieldDown ) // idk i made this up PlayFactionDialogueToTeam( "fd_baseShieldLow", TEAM_MILITIA ) if ( harvester.GetShieldHealth() == 0 ) @@ -762,21 +768,21 @@ void function OnHarvesterDamaged(entity harvester, var damageInfo) float oldhealthpercent = ( ( harvester.GetHealth().tofloat() / harvester.GetMaxHealth() ) * 100 ) float healthpercent = ( ( newHealth / harvester.GetMaxHealth() ) * 100 ) - if (healthpercent <= 75 && oldhealthpercent > 75) // we don't want the dialogue to keep saying "Harvester is below 75% health" everytime they take additional damage + if ( healthpercent <= 75 && oldhealthpercent > 75 ) // we don't want the dialogue to keep saying "Harvester is below 75% health" everytime they take additional damage PlayFactionDialogueToTeam( "fd_baseHealth75", TEAM_MILITIA ) - if (healthpercent <= 50 && oldhealthpercent > 50) + if ( healthpercent <= 50 && oldhealthpercent > 50 ) PlayFactionDialogueToTeam( "fd_baseHealth50", TEAM_MILITIA ) - if (healthpercent <= 25 && oldhealthpercent > 25) + if ( healthpercent <= 25 && oldhealthpercent > 25 ) PlayFactionDialogueToTeam( "fd_baseHealth25", TEAM_MILITIA ) - if (healthpercent <= 10) + if( healthpercent <= 10 ) PlayFactionDialogueToTeam( "fd_baseLowHealth", TEAM_MILITIA ) if( newHealth <= 0 ) { - EmitSoundAtPosition(TEAM_UNASSIGNED,fd_harvester.harvester.GetOrigin(),"coop_generator_destroyed") + EmitSoundAtPosition( TEAM_UNASSIGNED, fd_harvester.harvester.GetOrigin(), "coop_generator_destroyed" ) newHealth = 0 PlayFactionDialogueToTeam( "fd_baseDeath", TEAM_MILITIA ) fd_harvester.rings.Anim_Stop() @@ -786,7 +792,7 @@ void function OnHarvesterDamaged(entity harvester, var damageInfo) } if ( DamageInfo_GetDamageSourceIdentifier( damageInfo ) == eDamageSourceId.mp_titancore_laser_cannon ) - DamageInfo_SetDamage( damageInfo, DamageInfo_GetDamage( damageInfo )/10 ) // laser core shreds super well for some reason + DamageInfo_SetDamage( damageInfo, DamageInfo_GetDamage( damageInfo ) / 10 ) // laser core shreds super well for some reason if ( attacker.IsPlayer() ) attacker.NotifyDidDamage( harvester, DamageInfo_GetHitBox( damageInfo ), DamageInfo_GetDamagePosition( damageInfo ), DamageInfo_GetCustomDamageType( damageInfo ), DamageInfo_GetDamage( damageInfo ), DamageInfo_GetDamageFlags( damageInfo ), DamageInfo_GetHitGroup( damageInfo ), DamageInfo_GetWeapon( damageInfo ), DamageInfo_GetDistFromAttackOrigin( damageInfo ) ) @@ -794,7 +800,7 @@ void function OnHarvesterDamaged(entity harvester, var damageInfo) void function FD_NPCCleanup() { - foreach ( entity npc in GetEntArrayByClass_Expensive("C_AI_BaseNPC") ) + foreach ( entity npc in GetEntArrayByClass_Expensive( "C_AI_BaseNPC" ) ) if ( IsValid( npc ) ) npc.Destroy() } @@ -804,7 +810,7 @@ void function HarvesterThink() entity harvester = fd_harvester.harvester - EmitSoundOnEntity( harvester,"coop_generator_startup" ) + EmitSoundOnEntity( harvester, "coop_generator_startup" ) float lastTime = Time() wait 4 @@ -823,13 +829,13 @@ void function HarvesterThink() if ( IsValid( fd_harvester.particleShield ) ) { - vector shieldColor = GetShieldTriLerpColor(1.0-(harvester.GetShieldHealth().tofloat()/harvester.GetShieldHealthMax().tofloat())) + vector shieldColor = GetShieldTriLerpColor( 1.0 - ( harvester.GetShieldHealth().tofloat() / harvester.GetShieldHealthMax().tofloat() ) ) EffectSetControlPointVector( fd_harvester.particleShield, 1, shieldColor ) } if( IsValid( fd_harvester.particleBeam ) ) { - vector beamColor = GetShieldTriLerpColor( 1.0 - (harvester.GetHealth().tofloat() / harvester.GetMaxHealth().tofloat() ) ) + vector beamColor = GetShieldTriLerpColor( 1.0 - ( harvester.GetHealth().tofloat() / harvester.GetMaxHealth().tofloat() ) ) EffectSetControlPointVector( fd_harvester.particleBeam, 1, beamColor ) } @@ -837,21 +843,21 @@ void function HarvesterThink() if( IsValid( fd_harvester.particleShield ) ) fd_harvester.particleShield.Destroy() - if ( ( ( currentTime-fd_harvester.lastDamage) >= GENERATOR_SHIELD_REGEN_DELAY ) && ( harvester.GetShieldHealth() < harvester.GetShieldHealthMax() ) ) + if ( ( ( currentTime-fd_harvester.lastDamage ) >= GENERATOR_SHIELD_REGEN_DELAY ) && ( harvester.GetShieldHealth() < harvester.GetShieldHealthMax() ) ) { - if( !IsValid(fd_harvester.particleShield) ) - generateShieldFX(fd_harvester) + if( !IsValid( fd_harvester.particleShield ) ) + generateShieldFX( fd_harvester ) //printt((currentTime-fd_harvester.lastDamage)) - if(harvester.GetShieldHealth()==0) - EmitSoundOnEntity(harvester,"coop_generator_shieldrecharge_start") + if( harvester.GetShieldHealth() == 0 ) + EmitSoundOnEntity( harvester, "coop_generator_shieldrecharge_start" ) if (!isRegening) { - EmitSoundOnEntity( harvester,"coop_generator_shieldrecharge_resume" ) + EmitSoundOnEntity( harvester, "coop_generator_shieldrecharge_resume" ) file.harvesterShieldDown = false - if (GetGlobalNetBool("FD_waveActive")) + if (GetGlobalNetBool( "FD_waveActive" ) ) PlayFactionDialogueToTeam( "fd_baseShieldRecharging", TEAM_MILITIA ) else PlayFactionDialogueToTeam( "fd_baseShieldRechargingShort", TEAM_MILITIA ) @@ -862,22 +868,22 @@ void function HarvesterThink() if ( newShieldHealth >= harvester.GetShieldHealthMax() ) { - StopSoundOnEntity(harvester,"coop_generator_shieldrecharge_resume") - harvester.SetShieldHealth(harvester.GetShieldHealthMax()) - EmitSoundOnEntity(harvester,"coop_generator_shieldrecharge_end") - if (GetGlobalNetBool("FD_waveActive")) + StopSoundOnEntity( harvester, "coop_generator_shieldrecharge_resume" ) + harvester.SetShieldHealth( harvester.GetShieldHealthMax() ) + EmitSoundOnEntity( harvester, "coop_generator_shieldrecharge_end" ) + if( GetGlobalNetBool( "FD_waveActive" ) ) PlayFactionDialogueToTeam( "fd_baseShieldUp", TEAM_MILITIA ) isRegening = false } else { - harvester.SetShieldHealth(newShieldHealth) + harvester.SetShieldHealth( newShieldHealth ) } - } else if ( ( ( currentTime-fd_harvester.lastDamage) < GENERATOR_SHIELD_REGEN_DELAY ) && ( harvester.GetShieldHealth() < harvester.GetShieldHealthMax() ) ) + } else if ( ( ( currentTime-fd_harvester.lastDamage ) < GENERATOR_SHIELD_REGEN_DELAY ) && ( harvester.GetShieldHealth() < harvester.GetShieldHealthMax() ) ) isRegening = false if ( ( lastShieldHealth > 0 ) && ( harvester.GetShieldHealth() == 0 ) ) - EmitSoundOnEntity(harvester,"coop_generator_shielddown") + EmitSoundOnEntity( harvester, "coop_generator_shielddown" ) lastShieldHealth = harvester.GetShieldHealth() lastTime = currentTime @@ -896,11 +902,11 @@ void function startHarvester() void function HarvesterAlarm() { - while(IsAlive(fd_harvester.harvester)) + while( IsAlive( fd_harvester.harvester ) ) { - if(fd_harvester.harvester.GetShieldHealth()==0) + if( fd_harvester.harvester.GetShieldHealth() == 0 ) { - wait EmitSoundOnEntity(fd_harvester.harvester,"coop_generator_underattack_alarm") + wait EmitSoundOnEntity( fd_harvester.harvester, "coop_generator_underattack_alarm" ) } else { @@ -911,16 +917,16 @@ void function HarvesterAlarm() void function initNetVars() { - SetGlobalNetInt("FD_totalWaves",waveEvents.len()) - SetGlobalNetInt("burn_turretLimit",2) + SetGlobalNetInt( "FD_totalWaves", waveEvents.len() ) + SetGlobalNetInt( "burn_turretLimit", 2 ) if(!FD_HasRestarted()) { bool showShop = false - SetGlobalNetInt("FD_currentWave",0) - if(FD_IsDifficultyLevelOrHigher(eFDDifficultyLevel.INSANE)) - FD_SetNumAllowedRestarts(0) + SetGlobalNetInt( "FD_currentWave", 0 ) + if( FD_IsDifficultyLevelOrHigher( eFDDifficultyLevel.INSANE ) ) + FD_SetNumAllowedRestarts( 0 ) else - FD_SetNumAllowedRestarts(2) + FD_SetNumAllowedRestarts( 2 ) } @@ -928,13 +934,13 @@ void function initNetVars() void function FD_DamageByPlayerCallback(entity victim,var damageInfo) { - entity player = DamageInfo_GetAttacker(damageInfo) - if(!(player in file.players)) + entity player = DamageInfo_GetAttacker( damageInfo ) + if( !( player in file.players ) ) return - float damage = DamageInfo_GetDamage(damageInfo) + float damage = DamageInfo_GetDamage( damageInfo ) file.players[player].damageDealt += damage file.players[player].scoreThisRound += damage.tointeger() //TODO NOT HOW SCORE WORKS - if(victim.IsTitan()) + if( victim.IsTitan() ) { //TODO Money and score for titan damage } @@ -965,7 +971,7 @@ void function DamageScaleByDifficulty( entity ent, var damageInfo ) return - DamageInfo_SetDamage( damageInfo, (damageAmount * GetCurrentPlaylistVarFloat("fd_player_damage_scalar",1.0)) ) + DamageInfo_SetDamage( damageInfo, ( damageAmount * GetCurrentPlaylistVarFloat( "fd_player_damage_scalar", 1.0 ) ) ) @@ -984,15 +990,17 @@ void function HealthScaleByDifficulty( entity ent ) return if ( ent.IsTitan() ) - ent.SetMaxHealth( ent.GetMaxHealth() + GetCurrentPlaylistVarInt("fd_titan_health_adjust",0) ) + ent.SetMaxHealth( ent.GetMaxHealth() + GetCurrentPlaylistVarInt( "fd_titan_health_adjust", 0 ) ) else - ent.SetMaxHealth( ent.GetMaxHealth() + GetCurrentPlaylistVarInt("fd_reaper_health_adjust",0) ) + ent.SetMaxHealth( ent.GetMaxHealth() + GetCurrentPlaylistVarInt( "fd_reaper_health_adjust", 0 ) ) - if(GetCurrentPlaylistVarInt("fd_pro_titan_shields",0)&&ent.IsTitan()){ + if( GetCurrentPlaylistVarInt( "fd_pro_titan_shields", 0 ) && ent.IsTitan() ) + { entity soul = ent.GetTitanSoul() - if(IsValid(soul)){ - soul.SetShieldHealthMax(2500) - soul.SetShieldHealth(2500) + if( IsValid( soul ) ) + { + soul.SetShieldHealthMax( 2500 ) + soul.SetShieldHealth( 2500 ) } } @@ -1002,7 +1010,7 @@ void function HealthScaleByDifficulty( entity ent ) void function FD_createHarvester() { - fd_harvester = SpawnHarvester(file.harvester_info.GetOrigin(),file.harvester_info.GetAngles(),GetCurrentPlaylistVarInt("fd_harvester_health",25000),GetCurrentPlaylistVarInt("fd_harvester_shield",6000),TEAM_MILITIA) + fd_harvester = SpawnHarvester( file.harvester_info.GetOrigin(), file.harvester_info.GetAngles(), GetCurrentPlaylistVarInt( "fd_harvester_health", 25000 ), GetCurrentPlaylistVarInt( "fd_harvester_shield", 6000 ), TEAM_MILITIA ) fd_harvester.harvester.Minimap_SetAlignUpright( true ) fd_harvester.harvester.Minimap_AlwaysShow( TEAM_IMC, null ) fd_harvester.harvester.Minimap_AlwaysShow( TEAM_MILITIA, null ) @@ -1014,54 +1022,56 @@ void function FD_createHarvester() bool function isFinalWave() { - return ((GetGlobalNetInt("FD_currentWave")+1)==GetGlobalNetInt("FD_totalWaves")) + return ( ( GetGlobalNetInt( "FD_currentWave" ) + 1 ) == GetGlobalNetInt( "FD_totalWaves" ) ) } bool function isSecondWave() { - return ((GetGlobalNetInt("FD_currentWave")+1)==1) + return ( (GetGlobalNetInt( "FD_currentWave" ) + 1 ) == 1 ) } void function LoadEntities() { - CreateBoostStoreLocation(TEAM_MILITIA,shopPosition,shopAngles) - foreach ( entity info_target in GetEntArrayByClass_Expensive("info_target") ) + CreateBoostStoreLocation( TEAM_MILITIA, shopPosition, shopAngles ) + foreach ( entity info_target in GetEntArrayByClass_Expensive( "info_target" ) ) { if ( GameModeRemove( info_target ) ) continue - if(info_target.HasKey("editorclass")){ - switch(info_target.kv.editorclass){ - case"info_fd_harvester": + if( info_target.HasKey( "editorclass" ) ) + { + switch( info_target.kv.editorclass ) + { + case "info_fd_harvester": file.harvester_info = info_target break - case"info_fd_mode_model": + case "info_fd_mode_model": entity prop = CreatePropDynamic( info_target.GetModelName(), info_target.GetOrigin(), info_target.GetAngles(), 6 ) break - case"info_fd_ai_position": - AddStationaryAIPosition(info_target.GetOrigin(),int(info_target.kv.aiType)) + case "info_fd_ai_position": + AddStationaryAIPosition( info_target.GetOrigin(), int( info_target.kv.aiType ) ) break - case"info_fd_route_node": - routeNodes.append(info_target) + case "info_fd_route_node": + routeNodes.append( info_target ) break - case"info_fd_smoke_screen": - file.smokePoints.append(info_target) + case "info_fd_smoke_screen": + file.smokePoints.append( info_target ) break } } } ValidateAndFinalizePendingStationaryPositions() initNetVars() - SetTeam(GetTeamEnt(TEAM_IMC),TEAM_IMC) + SetTeam( GetTeamEnt( TEAM_IMC ), TEAM_IMC ) } bool function allPlayersReady() { - foreach(entity player in GetPlayerArray()) + foreach( entity player in GetPlayerArray() ) { - if(!player.GetPlayerNetBool("FD_readyForNextWave")) + if( !player.GetPlayerNetBool( "FD_readyForNextWave" ) ) return false } return true @@ -1071,65 +1081,65 @@ void function CheckLastPlayerReady() { int readyplayers = 0 entity notready - foreach(entity player in GetPlayerArray()) + foreach( entity player in GetPlayerArray() ) { - if(player.GetPlayerNetBool("FD_readyForNextWave")) + if( player.GetPlayerNetBool( "FD_readyForNextWave" ) ) readyplayers++ else notready = player // keep a track of this player } - if (readyplayers == GetPlayerArray().len() - 1) + if ( readyplayers == GetPlayerArray().len() - 1 ) PlayFactionDialogueToPlayer( "fd_playerNeedsToReadyUp", notready ) // ready up i swear there's one player like this in every match i've played } bool function ClientCommandCallbackToggleReady( entity player, array<string> args ) { - if(args[0]=="true") - player.SetPlayerNetBool("FD_readyForNextWave",true) - if(args[0]=="false") - player.SetPlayerNetBool("FD_readyForNextWave",false) + if( args[0] == "true" ) + player.SetPlayerNetBool( "FD_readyForNextWave", true ) + if( args[0] == "false" ) + player.SetPlayerNetBool( "FD_readyForNextWave", false ) CheckLastPlayerReady() return true } -int function getHintForTypeId(int typeId) +int function getHintForTypeId( int typeId ) { //this is maybe a bit of an naive aproch - switch(typeId) + switch( typeId ) { case eFD_AITypeIDs.TITAN_NUKE: - return (348 +RandomIntRangeInclusive(0,1)) + return ( 348 + RandomIntRangeInclusive( 0, 1 ) ) case eFD_AITypeIDs.TITAN_ARC: - return (350 +RandomIntRangeInclusive(0,1)) + return ( 350 + RandomIntRangeInclusive( 0, 1 ) ) case eFD_AITypeIDs.TITAN_MORTAR: - return (352 +RandomIntRangeInclusive(0,1)) + return ( 352 + RandomIntRangeInclusive( 0, 1 ) ) case eFD_AITypeIDs.GRUNT: return 354 case eFD_AITypeIDs.SPECTRE: return 355 case eFD_AITypeIDs.SPECTRE_MORTAR: - return (356 +RandomIntRangeInclusive(0,1)) + return ( 356 + RandomIntRangeInclusive( 0, 1 ) ) case eFD_AITypeIDs.STALKER: - if(RandomIntRangeInclusive(0,1)==0) + if( RandomIntRangeInclusive( 0, 1 ) == 0 ) return 358 else return 361 case eFD_AITypeIDs.REAPER: - return (359 +RandomIntRangeInclusive(0,1)) + return ( 359 + RandomIntRangeInclusive( 0, 1 ) ) case eFD_AITypeIDs.DRONE: return 362 case eFD_AITypeIDs.TITAN_SNIPER: - return (371 +RandomIntRangeInclusive(0,2)) + return ( 371 + RandomIntRangeInclusive( 0, 2 ) ) default: - return (363+RandomIntRangeInclusive(0,7)) + return ( 363 + RandomIntRangeInclusive( 0, 7 ) ) } unreachable } -string function GetTargetNameForID(int typeId) +string function GetTargetNameForID( int typeId ) { - switch(typeId) + switch( typeId ) { case eFD_AITypeIDs.TITAN_NUKE: return "npc_titan_nuke" @@ -1175,7 +1185,7 @@ string function GetTargetNameForID(int typeId) unreachable } -string function GetAiNetIdFromTargetName(string targetName) +string function GetAiNetIdFromTargetName( string targetName ) { switch ( targetName ) { @@ -1229,13 +1239,13 @@ string function GetAiNetIdFromTargetName(string targetName) case "tick": return "FD_AICount_Ticks" } - printt("unknown target name ",targetName) + printt( "unknown target name ", targetName ) return "" } -void function AddTurretSentry(entity turret) +void function AddTurretSentry( entity turret ) { turret.Minimap_AlwaysShow( TEAM_IMC, null ) turret.Minimap_AlwaysShow( TEAM_MILITIA, null ) @@ -1243,7 +1253,7 @@ void function AddTurretSentry(entity turret) turret.Minimap_SetCustomState( eMinimapObject_npc.FD_TURRET ) } -void function DisableTitanSelection( ) +void function DisableTitanSelection() { foreach ( entity player in GetPlayerArray() ) { @@ -1251,7 +1261,7 @@ void function DisableTitanSelection( ) } } -void function EnableTitanSelection( ) +void function EnableTitanSelection() { foreach ( entity player in GetPlayerArray() ) { 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 5b641ee8..f72a08da 100644 --- a/Northstar.CustomServers/mod/scripts/vscripts/gamemodes/_gamemode_fd_events.nut +++ b/Northstar.CustomServers/mod/scripts/vscripts/gamemodes/_gamemode_fd_events.nut @@ -71,75 +71,76 @@ global struct WaveEvent{ -global table<string,entity> GlobalEventEntitys -global array<array<WaveEvent> > waveEvents +global table< string, entity > GlobalEventEntitys +global array< array<WaveEvent> > waveEvents void function executeWave() { - print("executeWave Start") - thread runEvents(0) - while(IsAlive(fd_harvester.harvester)&&(!allEventsExecuted(GetGlobalNetInt("FD_currentWave")))) + print( "executeWave Start" ) + thread runEvents( 0 ) + while( IsAlive( fd_harvester.harvester ) && ( !allEventsExecuted( GetGlobalNetInt( "FD_currentWave" ) ) ) ) WaitFrame() wait 5 //incase droppod is last event so all npc are spawned - waitUntilLessThanAmountAlive(0) - waitUntilLessThanAmountAlive_expensive(0) + waitUntilLessThanAmountAlive( 0 ) + waitUntilLessThanAmountAlive_expensive( 0 ) - foreach(entity ent in GetEntArrayByClass_Expensive("npc_turret_sentry")) - RevivableTurret_Revive(ent) + foreach (entity ent in GetEntArrayByClass_Expensive( "npc_turret_sentry" ) ) + RevivableTurret_Revive( ent ) } -bool function allEventsExecuted(int waveIndex) +bool function allEventsExecuted( int waveIndex ) { - foreach(WaveEvent e in waveEvents[waveIndex]) + foreach( WaveEvent e in waveEvents[waveIndex] ) { - if(e.executeOnThisCall>e.timesExecuted) + if( e.executeOnThisCall > e.timesExecuted ) return false } return true } -void function runEvents(int firstExecuteIndex) +void function runEvents( int firstExecuteIndex ) { - print("runEvents Start") - WaveEvent currentEvent = waveEvents[GetGlobalNetInt("FD_currentWave")][firstExecuteIndex] + print( "runEvents Start" ) + WaveEvent currentEvent = waveEvents[GetGlobalNetInt( "FD_currentWave" )][firstExecuteIndex] while(true) { currentEvent.timesExecuted++ if(currentEvent.timesExecuted!=currentEvent.executeOnThisCall) { - print("not on this call") + print( "not on this call" ) return } - if(!IsAlive(fd_harvester.harvester)) + if( !IsAlive(fd_harvester.harvester ) ) { - print("harvesterDead") + print( "harvesterDead" ) return } - if(currentEvent.shouldThread) + if( currentEvent.shouldThread ) { - print("execute with thread") - thread currentEvent.eventFunction(currentEvent.smokeEvent,currentEvent.spawnEvent,currentEvent.flowControlEvent,currentEvent.soundEvent) + print( "execute with thread" ) + thread currentEvent.eventFunction( currentEvent.smokeEvent, currentEvent.spawnEvent, currentEvent.flowControlEvent, currentEvent.soundEvent ) } else { - print("execute without thread") - currentEvent.eventFunction(currentEvent.smokeEvent,currentEvent.spawnEvent,currentEvent.flowControlEvent,currentEvent.soundEvent) + print( "execute without thread" ) + currentEvent.eventFunction( currentEvent.smokeEvent, currentEvent.spawnEvent, currentEvent.flowControlEvent, currentEvent.soundEvent ) } - if(currentEvent.nextEventIndex==0) + if( currentEvent.nextEventIndex == 0 ) { - print("zero index") + print( "zero index" ) return } - currentEvent = waveEvents[GetGlobalNetInt("FD_currentWave")][currentEvent.nextEventIndex] + currentEvent = waveEvents[GetGlobalNetInt( "FD_currentWave" )][currentEvent.nextEventIndex] } - print("runEvents End") + print( "runEvents End" ) } -void function restetWaveEvents(){ - foreach(WaveEvent event in waveEvents[GetGlobalNetInt("FD_currentWave")]) +void function restetWaveEvents() +{ + foreach( WaveEvent event in waveEvents[GetGlobalNetInt( "FD_currentWave" )] ) { event.timesExecuted = 0 } @@ -161,7 +162,7 @@ void function restetWaveEvents(){ ####### # ####### # # # ##### ####### # # ####### # # # # # ####### # # \*****************************************************************************************************************/ -WaveEvent function CreateSmokeEvent(vector position,float lifetime,int nextEventIndex,int executeOnThisCall = 1) +WaveEvent function CreateSmokeEvent( vector position, float lifetime, int nextEventIndex, int executeOnThisCall = 1 ) { WaveEvent event event.eventFunction = spawnSmoke @@ -173,7 +174,7 @@ WaveEvent function CreateSmokeEvent(vector position,float lifetime,int nextEvent return event } -WaveEvent function CreateArcTitanEvent(vector origin,vector angles,string route,int nextEventIndex,int executeOnThisCall = 1,string entityGlobalKey="") +WaveEvent function CreateArcTitanEvent( vector origin, vector angles, string route, int nextEventIndex, int executeOnThisCall = 1, string entityGlobalKey = "" ) { WaveEvent event event.eventFunction = spawnArcTitan @@ -189,7 +190,7 @@ WaveEvent function CreateArcTitanEvent(vector origin,vector angles,string route, return event } -WaveEvent function CreateSuperSpectreEvent(vector origin,vector angles,string route,int nextEventIndex,int executeOnThisCall = 1,string entityGlobalKey="") +WaveEvent function CreateSuperSpectreEvent( vector origin, vector angles, string route, int nextEventIndex, int executeOnThisCall = 1, string entityGlobalKey = "" ) { WaveEvent event event.eventFunction = spawnSuperSpectre @@ -205,7 +206,7 @@ WaveEvent function CreateSuperSpectreEvent(vector origin,vector angles,string ro return event } -WaveEvent function CreateSuperSpectreEventWithMinion(vector origin,vector angles,string route,int nextEventIndex,int executeOnThisCall = 1,string entityGlobalKey="") +WaveEvent function CreateSuperSpectreEventWithMinion( vector origin, vector angles, string route, int nextEventIndex, int executeOnThisCall = 1, string entityGlobalKey = "" ) { WaveEvent event event.eventFunction = spawnSuperSpectreWithMinion @@ -221,7 +222,7 @@ WaveEvent function CreateSuperSpectreEventWithMinion(vector origin,vector angles return event } -WaveEvent function CreateDroppodGruntEvent(vector origin,string route,int nextEventIndex,int executeOnThisCall = 1,string entityGlobalKey="") +WaveEvent function CreateDroppodGruntEvent( vector origin, string route, int nextEventIndex, int executeOnThisCall = 1, string entityGlobalKey = "" ) { WaveEvent event event.eventFunction = spawnDroppodGrunts @@ -236,7 +237,7 @@ WaveEvent function CreateDroppodGruntEvent(vector origin,string route,int nextEv return event } -WaveEvent function CreateDroppodStalkerEvent(vector origin,string route,int nextEventIndex,int executeOnThisCall = 1,string entityGlobalKey="") +WaveEvent function CreateDroppodStalkerEvent( vector origin, string route, int nextEventIndex, int executeOnThisCall = 1, string entityGlobalKey = "" ) { WaveEvent event event.eventFunction = spawnDroppodStalker @@ -251,7 +252,7 @@ WaveEvent function CreateDroppodStalkerEvent(vector origin,string route,int next return event } -WaveEvent function CreateDroppodSpectreMortarEvent(vector origin,string route,int nextEventIndex,int executeOnThisCall = 1,string entityGlobalKey="") +WaveEvent function CreateDroppodSpectreMortarEvent( vector origin, string route, int nextEventIndex, int executeOnThisCall = 1, string entityGlobalKey = "" ) { WaveEvent event event.eventFunction = spawnDroppodSpectreMortar @@ -266,7 +267,7 @@ WaveEvent function CreateDroppodSpectreMortarEvent(vector origin,string route,in return event } -WaveEvent function CreateWaitForTimeEvent(float waitTime,int nextEventIndex,int executeOnThisCall = 1) +WaveEvent function CreateWaitForTimeEvent( float waitTime, int nextEventIndex, int executeOnThisCall = 1 ) { WaveEvent event event.shouldThread = false @@ -277,7 +278,7 @@ WaveEvent function CreateWaitForTimeEvent(float waitTime,int nextEventIndex,int return event } -WaveEvent function CreateWaitUntilAliveEvent(int amount,int nextEventIndex,int executeOnThisCall = 1) +WaveEvent function CreateWaitUntilAliveEvent( int amount, int nextEventIndex, int executeOnThisCall = 1 ) { WaveEvent event event.eventFunction = waitUntilLessThanAmountAliveEvent @@ -288,7 +289,7 @@ WaveEvent function CreateWaitUntilAliveEvent(int amount,int nextEventIndex,int e return event } -WaveEvent function CreateWaitUntilAliveWeightedEvent(int amount,int nextEventIndex,int executeOnThisCall = 1) +WaveEvent function CreateWaitUntilAliveWeightedEvent( int amount, int nextEventIndex, int executeOnThisCall = 1 ) { WaveEvent event event.eventFunction = waitUntilLessThanAmountAliveEventWeighted @@ -299,7 +300,7 @@ WaveEvent function CreateWaitUntilAliveWeightedEvent(int amount,int nextEventInd return event } -WaveEvent function CreateGenericSpawnEvent(string npcClassName,vector origin,vector angles,string route,int spawnType,int spawnAmount,int nextEventIndex,int executeOnThisCall = 1,string entityGlobalKey="") +WaveEvent function CreateGenericSpawnEvent( string npcClassName, vector origin, vector angles, string route, int spawnType, int spawnAmount, int nextEventIndex, int executeOnThisCall = 1, string entityGlobalKey = "" ) { WaveEvent event event.eventFunction = spawnGenericNPC @@ -316,7 +317,7 @@ WaveEvent function CreateGenericSpawnEvent(string npcClassName,vector origin,vec return event } -WaveEvent function CreateGenericTitanSpawnWithAiSettingsEvent(string npcClassName,string aiSettings,vector origin,vector angles,string route,int spawnType,int spawnAmount,int nextEventIndex,int executeOnThisCall = 1,string entityGlobalKey="") +WaveEvent function CreateGenericTitanSpawnWithAiSettingsEvent( string npcClassName, string aiSettings, vector origin, vector angles, string route, int spawnType, int spawnAmount, int nextEventIndex, int executeOnThisCall = 1, string entityGlobalKey = "" ) { WaveEvent event event.eventFunction = spawnGenericNPCTitanwithSettings @@ -334,7 +335,7 @@ WaveEvent function CreateGenericTitanSpawnWithAiSettingsEvent(string npcClassNam return event } -WaveEvent function CreateNukeTitanEvent(vector origin,vector angles,string route,int nextEventIndex,int executeOnThisCall = 1,string entityGlobalKey="") +WaveEvent function CreateNukeTitanEvent( vector origin, vector angles, string route, int nextEventIndex, int executeOnThisCall = 1, string entityGlobalKey = "" ) { WaveEvent event event.eventFunction = spawnNukeTitan @@ -350,7 +351,7 @@ WaveEvent function CreateNukeTitanEvent(vector origin,vector angles,string route return event } -WaveEvent function CreateMortarTitanEvent(vector origin,vector angles,int nextEventIndex,int executeOnThisCall = 1,string entityGlobalKey="") +WaveEvent function CreateMortarTitanEvent( vector origin, vector angles, int nextEventIndex, int executeOnThisCall = 1, string entityGlobalKey = "" ) { WaveEvent event event.eventFunction = spawnMortarTitan @@ -365,7 +366,7 @@ WaveEvent function CreateMortarTitanEvent(vector origin,vector angles,int nextEv return event } -WaveEvent function CreateCloakDroneEvent(vector origin,vector angles,int nextEventIndex,int executeOnThisCall = 1,string entityGlobalKey="") +WaveEvent function CreateCloakDroneEvent( vector origin, vector angles, int nextEventIndex, int executeOnThisCall = 1, string entityGlobalKey = "" ) { WaveEvent event event.eventFunction = fd_spawnCloakDrone @@ -380,7 +381,7 @@ WaveEvent function CreateCloakDroneEvent(vector origin,vector angles,int nextEve return event } -WaveEvent function CreateDroppodTickEvent( vector origin, int amount, string route,int nextEventIndex,int executeOnThisCall = 1,string entityGlobalKey="") +WaveEvent function CreateDroppodTickEvent( vector origin, int amount, string route, int nextEventIndex, int executeOnThisCall = 1, string entityGlobalKey = "" ) { WaveEvent event event.eventFunction = SpawnTick @@ -394,7 +395,7 @@ WaveEvent function CreateDroppodTickEvent( vector origin, int amount, string rou return event } -WaveEvent function CreateNorthstarSniperTitanEvent(vector origin,vector angles,int nextEventIndex,int executeOnThisCall = 1,string entityGlobalKey="") +WaveEvent function CreateNorthstarSniperTitanEvent( vector origin, vector angles, int nextEventIndex, int executeOnThisCall = 1, string entityGlobalKey = "" ) { WaveEvent event event.eventFunction = spawnSniperTitan @@ -409,7 +410,7 @@ WaveEvent function CreateNorthstarSniperTitanEvent(vector origin,vector angles,i return event } -WaveEvent function CreateToneSniperTitanEvent(vector origin,vector angles,int nextEventIndex,int executeOnThisCall = 1,string entityGlobalKey="") +WaveEvent function CreateToneSniperTitanEvent( vector origin, vector angles, int nextEventIndex, int executeOnThisCall = 1, string entityGlobalKey = "" ) { WaveEvent event event.eventFunction = SpawnToneSniperTitan @@ -425,7 +426,7 @@ WaveEvent function CreateToneSniperTitanEvent(vector origin,vector angles,int ne } -WaveEvent function CreateIonTitanEvent(vector origin,vector angles,string route,int nextEventIndex,int executeOnThisCall = 1,string entityGlobalKey="") +WaveEvent function CreateIonTitanEvent( vector origin, vector angles, string route, int nextEventIndex, int executeOnThisCall = 1, string entityGlobalKey = "" ) { WaveEvent event event.eventFunction = SpawnIonTitan @@ -441,7 +442,7 @@ WaveEvent function CreateIonTitanEvent(vector origin,vector angles,string route, return event } -WaveEvent function CreateScorchTitanEvent(vector origin,vector angles,string route,int nextEventIndex,int executeOnThisCall = 1,string entityGlobalKey="") +WaveEvent function CreateScorchTitanEvent( vector origin, vector angles, string route, int nextEventIndex, int executeOnThisCall = 1, string entityGlobalKey = "" ) { WaveEvent event event.eventFunction = SpawnScorchTitan @@ -457,7 +458,7 @@ WaveEvent function CreateScorchTitanEvent(vector origin,vector angles,string rou return event } -WaveEvent function CreateRoninTitanEvent(vector origin,vector angles,string route,int nextEventIndex,int executeOnThisCall = 1,string entityGlobalKey="") +WaveEvent function CreateRoninTitanEvent( vector origin, vector angles, string route, int nextEventIndex, int executeOnThisCall = 1, string entityGlobalKey = "" ) { WaveEvent event event.eventFunction = SpawnRoninTitan @@ -473,7 +474,7 @@ WaveEvent function CreateRoninTitanEvent(vector origin,vector angles,string rout return event } -WaveEvent function CreateToneTitanEvent(vector origin,vector angles,string route,int nextEventIndex,int executeOnThisCall = 1,string entityGlobalKey="") +WaveEvent function CreateToneTitanEvent( vector origin, vector angles, string route, int nextEventIndex, int executeOnThisCall = 1, string entityGlobalKey = "" ) { WaveEvent event event.eventFunction = SpawnToneTitan @@ -489,7 +490,7 @@ WaveEvent function CreateToneTitanEvent(vector origin,vector angles,string route return event } -WaveEvent function CreateLegionTitanEvent(vector origin,vector angles,string route,int nextEventIndex,int executeOnThisCall = 1,string entityGlobalKey="") +WaveEvent function CreateLegionTitanEvent( vector origin, vector angles, string route, int nextEventIndex, int executeOnThisCall = 1, string entityGlobalKey = "" ) { WaveEvent event event.eventFunction = SpawnLegionTitan @@ -505,7 +506,7 @@ WaveEvent function CreateLegionTitanEvent(vector origin,vector angles,string rou return event } -WaveEvent function CreateMonarchTitanEvent(vector origin,vector angles,string route,int nextEventIndex,int executeOnThisCall = 1,string entityGlobalKey="") +WaveEvent function CreateMonarchTitanEvent( vector origin, vector angles, string route, int nextEventIndex, int executeOnThisCall = 1, string entityGlobalKey = "" ) { WaveEvent event event.eventFunction = SpawnMonarchTitan @@ -521,7 +522,7 @@ WaveEvent function CreateMonarchTitanEvent(vector origin,vector angles,string ro return event } -WaveEvent function CreateWaitForDeathOfEntitysEvent(array<string> waitGlobalDataKey,int nextEventIndex,int executeOnThisCall = 1) +WaveEvent function CreateWaitForDeathOfEntitysEvent( array<string> waitGlobalDataKey, int nextEventIndex, int executeOnThisCall = 1 ) { WaveEvent event event.eventFunction = waitForDeathOfEntitys @@ -532,7 +533,7 @@ WaveEvent function CreateWaitForDeathOfEntitysEvent(array<string> waitGlobalData return event } -WaveEvent function CreateWaitForLessThanTypedEvent(int aiTypeId,int amount,int nextEventIndex,int executeOnThisCall = 1) +WaveEvent function CreateWaitForLessThanTypedEvent(int aiTypeId,int amount,int nextEventIndex,int executeOnThisCall = 1 ) { WaveEvent event event.eventFunction = waitForLessThanAliveTyped @@ -543,6 +544,7 @@ WaveEvent function CreateWaitForLessThanTypedEvent(int aiTypeId,int amount,int n event.flowControlEvent.waitEntityType = aiTypeId return event } + WaveEvent function CreateSpawnDroneEvent(vector origin,vector angles,string route,int nextEventIndex, bool shouldLoop = true, int executeOnThisCall = 1,string entityGlobalKey="") { WaveEvent event @@ -569,25 +571,25 @@ WaveEvent function CreateSpawnDroneEvent(vector origin,vector angles,string rout ####### # ####### # # # # ##### # # ##### # ### ####### # # ##### \************************************************************************************************************/ -void function spawnSmoke(SmokeEvent smokeEvent,SpawnEvent spawnEvent,FlowControlEvent flowControlEvent,SoundEvent soundEvent) +void function spawnSmoke( SmokeEvent smokeEvent, SpawnEvent spawnEvent, FlowControlEvent flowControlEvent, SoundEvent soundEvent ) { - printt("smoke") + printt( "smoke" ) SmokescreenStruct smokescreen smokescreen.smokescreenFX = $"P_smokescreen_FD" smokescreen.isElectric = false - smokescreen.origin = smokeEvent.position + < 0 , 0, 150> - smokescreen.angles = <0,0,0> + smokescreen.origin = smokeEvent.position + < 0, 0, 150 > + smokescreen.angles = < 0, 0, 0 > smokescreen.lifetime = smokeEvent.lifetime smokescreen.fxXYRadius = 150 smokescreen.fxZRadius = 120 - smokescreen.fxOffsets = [ <120.0, 0.0, 0.0>,<0.0, 120.0, 0.0>, <0.0, 0.0, 0.0>,<0.0, -120.0, 0.0>,< -120.0, 0.0, 0.0>, <0.0, 100.0, 0.0>] + smokescreen.fxOffsets = [ < 120.0, 0.0, 0.0 >, < 0.0, 120.0, 0.0 >, < 0.0, 0.0, 0.0 >, < 0.0, -120.0, 0.0 >, < -120.0, 0.0, 0.0 >, < 0.0, 100.0, 0.0 > ] Smokescreen(smokescreen) } -void function spawnDrones(SmokeEvent smokeEvent,SpawnEvent spawnEvent,FlowControlEvent flowControlEvent,SoundEvent soundEvent) +void function spawnDrones( SmokeEvent smokeEvent, SpawnEvent spawnEvent, FlowControlEvent flowControlEvent, SoundEvent soundEvent ) { //TODO - PingMinimap(spawnEvent.origin.x, spawnEvent.origin.y, 4, 600, 150, 0) + PingMinimap( spawnEvent.origin.x, spawnEvent.origin.y, 4, 600, 150, 0 ) array<vector> offsets = [ < 0, 32, 0 >, < 32, 0, 0 >, < 0, -32, 0 >, < -32, 0, 0 > ] @@ -600,142 +602,142 @@ void function spawnDrones(SmokeEvent smokeEvent,SpawnEvent spawnEvent,FlowContro guy = CreateGenericDrone( TEAM_IMC, spawnEvent.origin + offsets[i], spawnEvent.angles ) SetSpawnOption_AISettings( guy, "npc_drone_plasma_fd" ) - if(spawnEvent.entityGlobalKey!="") - GlobalEventEntitys[spawnEvent.entityGlobalKey+i.tostring()] <- guy + if( spawnEvent.entityGlobalKey != "" ) + GlobalEventEntitys[ spawnEvent.entityGlobalKey + i.tostring() ] <- guy SetTeam( guy, TEAM_IMC ) guy.DisableNPCFlag( NPC_ALLOW_INVESTIGATE ) - guy.EnableNPCFlag(NPC_STAY_CLOSE_TO_SQUAD) - guy.EnableNPCMoveFlag(NPCMF_WALK_ALWAYS | NPCMF_PREFER_SPRINT) + guy.EnableNPCFlag( NPC_STAY_CLOSE_TO_SQUAD ) + guy.EnableNPCMoveFlag( NPCMF_WALK_ALWAYS | NPCMF_PREFER_SPRINT ) DispatchSpawn( guy ) //guy.GiveWeapon("mp_weapon_engineer_combat_drone") SetSquad( guy, squadName ) - SetTargetName( guy, GetTargetNameForID(eFD_AITypeIDs.DRONE)) - AddMinimapForHumans(guy) - spawnedNPCs.append(guy) - thread droneNav_thread(guy, spawnEvent.route, 0, 500, spawnEvent.shouldLoop) + SetTargetName( guy, GetTargetNameForID( eFD_AITypeIDs.DRONE ) ) + AddMinimapForHumans( guy ) + spawnedNPCs.append( guy ) + thread droneNav_thread(guy, spawnEvent.route, 0, 500, spawnEvent.shouldLoop ) } } -void function waitForDeathOfEntitys(SmokeEvent smokeEvent,SpawnEvent spawnEvent,FlowControlEvent flowControlEvent,SoundEvent soundEvent) +void function waitForDeathOfEntitys( SmokeEvent smokeEvent, SpawnEvent spawnEvent, FlowControlEvent flowControlEvent, SoundEvent soundEvent ) { - while(IsAlive(fd_harvester.harvester)) + while( IsAlive( fd_harvester.harvester ) ) { bool anyoneAlive = false - foreach(string key in flowControlEvent.waitGlobalDataKey ) + foreach( string key in flowControlEvent.waitGlobalDataKey ) { - if(!(key in GlobalEventEntitys)) + if( !( key in GlobalEventEntitys ) ) continue - if(IsAlive(GlobalEventEntitys[key])) + if( IsAlive( GlobalEventEntitys[key] ) ) anyoneAlive = true } - if(!anyoneAlive) + if( !anyoneAlive ) break } } -void function waitForLessThanAliveTyped(SmokeEvent smokeEvent,SpawnEvent spawnEvent,FlowControlEvent flowControlEvent,SoundEvent soundEvent) +void function waitForLessThanAliveTyped( SmokeEvent smokeEvent, SpawnEvent spawnEvent, FlowControlEvent flowControlEvent, SoundEvent soundEvent ) { - while(IsAlive(fd_harvester.harvester)) + while( IsAlive( fd_harvester.harvester ) ) { int amount - foreach(entity npc in spawnedNPCs) + foreach( entity npc in spawnedNPCs ) { - if(FD_GetAITypeID_ByString(npc.GetTargetName())) //TODO getaitypeid_bystring does not contain all possible strings + if( FD_GetAITypeID_ByString( npc.GetTargetName() ) ) //TODO getaitypeid_bystring does not contain all possible strings amount++ } - if(amount<=flowControlEvent.waitAmount) + if( amount <= flowControlEvent.waitAmount ) break WaitFrame() } } -void function spawnArcTitan(SmokeEvent smokeEvent,SpawnEvent spawnEvent,FlowControlEvent flowControlEvent,SoundEvent soundEvent) +void function spawnArcTitan( SmokeEvent smokeEvent, SpawnEvent spawnEvent, FlowControlEvent flowControlEvent, SoundEvent soundEvent ) { - PingMinimap(spawnEvent.origin.x, spawnEvent.origin.y, 4, 600, 150, 0) - entity npc = CreateArcTitan(TEAM_IMC,spawnEvent.origin,spawnEvent.angles) - npc.DisableNPCFlag(NPC_ALLOW_INVESTIGATE | NPC_USE_SHOOTING_COVER|NPC_ALLOW_PATROL) - SetSpawnOption_Titanfall(npc) - SetTargetName( npc, GetTargetNameForID(spawnEvent.spawnType)) // required for client to create icons - SetSpawnOption_AISettings(npc,"npc_titan_stryder_leadwall_arc") - spawnedNPCs.append(npc) - DispatchSpawn(npc) - AddMinimapForTitans(npc) + PingMinimap( spawnEvent.origin.x, spawnEvent.origin.y, 4, 600, 150, 0 ) + entity npc = CreateArcTitan( TEAM_IMC, spawnEvent.origin, spawnEvent.angles ) + npc.DisableNPCFlag( NPC_ALLOW_INVESTIGATE | NPC_USE_SHOOTING_COVER | NPC_ALLOW_PATROL ) + SetSpawnOption_Titanfall( npc ) + SetTargetName( npc, GetTargetNameForID( spawnEvent.spawnType ) ) // required for client to create icons + SetSpawnOption_AISettings( npc, "npc_titan_stryder_leadwall_arc" ) + spawnedNPCs.append( npc ) + DispatchSpawn( npc ) + AddMinimapForTitans( npc ) npc.WaitSignal( "TitanHotDropComplete" ) npc.GetTitanSoul().SetTitanSoulNetBool( "showOverheadIcon", true ) - npc.AssaultSetFightRadius(0) + npc.AssaultSetFightRadius( 0 ) GlobalEventEntitys[spawnEvent.entityGlobalKey] <- npc - thread singleNav_thread(npc,spawnEvent.route) - thread EMPTitanThinkConstant(npc) + thread singleNav_thread( npc, spawnEvent.route ) + thread EMPTitanThinkConstant( npc ) } -void function waitForTime(SmokeEvent smokeEvent,SpawnEvent spawnEvent,FlowControlEvent flowControlEvent,SoundEvent soundEvent) +void function waitForTime( SmokeEvent smokeEvent, SpawnEvent spawnEvent, FlowControlEvent flowControlEvent, SoundEvent soundEvent ) { float waitUntil = Time() + flowControlEvent.waitTime - while(Time()<waitUntil) + while( Time() < waitUntil ) { - if(!IsAlive(fd_harvester.harvester)) + if( !IsAlive( fd_harvester.harvester ) ) return WaitFrame() } } -void function waitUntilLessThanAmountAliveEvent(SmokeEvent smokeEvent,SpawnEvent spawnEvent,FlowControlEvent flowControlEvent,SoundEvent soundEvent) +void function waitUntilLessThanAmountAliveEvent( SmokeEvent smokeEvent, SpawnEvent spawnEvent, FlowControlEvent flowControlEvent, SoundEvent soundEvent ) { - waitUntilLessThanAmountAlive(flowControlEvent.waitAmount) + waitUntilLessThanAmountAlive( flowControlEvent.waitAmount ) } -void function waitUntilLessThanAmountAliveEventWeighted(SmokeEvent smokeEvent,SpawnEvent spawnEvent,FlowControlEvent flowControlEvent,SoundEvent soundEvent) +void function waitUntilLessThanAmountAliveEventWeighted( SmokeEvent smokeEvent, SpawnEvent spawnEvent, FlowControlEvent flowControlEvent, SoundEvent soundEvent ) { - waitUntilLessThanAmountAliveWeighted(flowControlEvent.waitAmount) + waitUntilLessThanAmountAliveWeighted( flowControlEvent.waitAmount ) } -void function spawnSuperSpectre(SmokeEvent smokeEvent,SpawnEvent spawnEvent,FlowControlEvent flowControlEvent,SoundEvent soundEvent) +void function spawnSuperSpectre( SmokeEvent smokeEvent, SpawnEvent spawnEvent, FlowControlEvent flowControlEvent, SoundEvent soundEvent ) { - PingMinimap(spawnEvent.origin.x, spawnEvent.origin.y, 4, 600, 150, 0) + PingMinimap( spawnEvent.origin.x, spawnEvent.origin.y, 4, 600, 150, 0 ) - entity npc = CreateSuperSpectre(TEAM_IMC,spawnEvent.origin,spawnEvent.angles) - SetSpawnOption_AISettings(npc,"npc_super_spectre_fd") - spawnedNPCs.append(npc) - if(spawnEvent.entityGlobalKey!="") + entity npc = CreateSuperSpectre( TEAM_IMC, spawnEvent.origin, spawnEvent.angles ) + SetSpawnOption_AISettings( npc, "npc_super_spectre_fd" ) + spawnedNPCs.append( npc ) + if( spawnEvent.entityGlobalKey != "" ) GlobalEventEntitys[spawnEvent.entityGlobalKey] <- npc wait 4.7 - DispatchSpawn(npc) - SetTargetName( npc, GetTargetNameForID(spawnEvent.spawnType)) - AddMinimapForHumans(npc) - thread SuperSpectre_WarpFall(npc) - npc.WaitSignal("WarpfallComplete") - thread singleNav_thread(npc, spawnEvent.route) + DispatchSpawn( npc ) + SetTargetName( npc, GetTargetNameForID( spawnEvent.spawnType ) ) + AddMinimapForHumans( npc ) + thread SuperSpectre_WarpFall( npc ) + npc.WaitSignal( "WarpfallComplete" ) + thread singleNav_thread( npc, spawnEvent.route ) } -void function spawnSuperSpectreWithMinion(SmokeEvent smokeEvent,SpawnEvent spawnEvent,FlowControlEvent flowControlEvent,SoundEvent soundEvent) +void function spawnSuperSpectreWithMinion( SmokeEvent smokeEvent, SpawnEvent spawnEvent, FlowControlEvent flowControlEvent, SoundEvent soundEvent ) { - PingMinimap(spawnEvent.origin.x, spawnEvent.origin.y, 4, 600, 150, 0) + PingMinimap( spawnEvent.origin.x, spawnEvent.origin.y, 4, 600, 150, 0 ) - entity npc = CreateSuperSpectre(TEAM_IMC,spawnEvent.origin,spawnEvent.angles) - SetSpawnOption_AISettings(npc,"npc_super_spectre_fd") - spawnedNPCs.append(npc) - if(spawnEvent.entityGlobalKey!="") + entity npc = CreateSuperSpectre( TEAM_IMC, spawnEvent.origin,spawnEvent.angles ) + SetSpawnOption_AISettings( npc, "npc_super_spectre_fd" ) + spawnedNPCs.append( npc ) + if( spawnEvent.entityGlobalKey != "" ) GlobalEventEntitys[spawnEvent.entityGlobalKey] <- npc wait 4.7 - DispatchSpawn(npc) - SetTargetName( npc, GetTargetNameForID(spawnEvent.spawnType)) - AddMinimapForHumans(npc) - thread SuperSpectre_WarpFall(npc) - npc.WaitSignal("WarpfallComplete") - thread ReaperMinionLauncherThink(npc) + DispatchSpawn( npc ) + SetTargetName( npc, GetTargetNameForID( spawnEvent.spawnType ) ) + AddMinimapForHumans( npc ) + thread SuperSpectre_WarpFall( npc ) + npc.WaitSignal( "WarpfallComplete" ) + thread ReaperMinionLauncherThink( npc ) } void function spawnDroppodGrunts( SmokeEvent smokeEvent, SpawnEvent spawnEvent, FlowControlEvent flowControlEvent, SoundEvent soundEvent ) { PingMinimap( spawnEvent.origin.x, spawnEvent.origin.y, 4, 600, 150, 0 ) - entity pod = CreateDropPod( spawnEvent.origin, <0,0,0> ) + entity pod = CreateDropPod( spawnEvent.origin, < 0, 0, 0 > ) SetTeam( pod, TEAM_IMC ) InitFireteamDropPod( pod ) waitthread LaunchAnimDropPod( pod, "pod_testpath", spawnEvent.origin, < 0, 0, 0 > ) @@ -745,10 +747,10 @@ void function spawnDroppodGrunts( SmokeEvent smokeEvent, SpawnEvent spawnEvent, for ( int i = 0; i < spawnEvent.spawnAmount; i++ ) { - entity guy = CreateSoldier( TEAM_IMC, spawnEvent.origin,<0,0,0> ) + entity guy = CreateSoldier( TEAM_IMC, spawnEvent.origin, < 0, 0, 0 > ) - if( spawnEvent.entityGlobalKey!="" ) - GlobalEventEntitys[ spawnEvent.entityGlobalKey + i.tostring() ] <- guy + if( spawnEvent.entityGlobalKey != "" ) + GlobalEventEntitys[ spawnEvent.entityGlobalKey+ i.tostring() ] <- guy SetTeam( guy, TEAM_IMC ) guy.EnableNPCFlag( NPC_ALLOW_INVESTIGATE | NPC_ALLOW_HAND_SIGNALS | NPC_ALLOW_FLEE ) guy.DisableNPCFlag( NPC_ALLOW_PATROL ) @@ -779,13 +781,13 @@ void function spawnDroppodGrunts( SmokeEvent smokeEvent, SpawnEvent spawnEvent, thread SquadNav_Thread( guys,spawnEvent.route ) } -void function spawnDroppodStalker(SmokeEvent smokeEvent,SpawnEvent spawnEvent,FlowControlEvent flowControlEvent,SoundEvent soundEvent) +void function spawnDroppodStalker( SmokeEvent smokeEvent, SpawnEvent spawnEvent, FlowControlEvent flowControlEvent, SoundEvent soundEvent ) { - PingMinimap(spawnEvent.origin.x, spawnEvent.origin.y, 4, 600, 150, 0) - entity pod = CreateDropPod( spawnEvent.origin, <0,0,0> ) + PingMinimap( spawnEvent.origin.x, spawnEvent.origin.y, 4, 600, 150, 0 ) + entity pod = CreateDropPod( spawnEvent.origin, < 0, 0, 0 > ) SetTeam( pod, TEAM_IMC ) InitFireteamDropPod( pod ) - waitthread LaunchAnimDropPod( pod, "pod_testpath", spawnEvent.origin, <0,0,0> ) + waitthread LaunchAnimDropPod( pod, "pod_testpath", spawnEvent.origin, < 0, 0, 0 > ) string squadName = MakeSquadName( TEAM_IMC, UniqueString( "ZiplineTable" ) ) array<entity> guys @@ -793,9 +795,9 @@ void function spawnDroppodStalker(SmokeEvent smokeEvent,SpawnEvent spawnEvent,Fl for ( int i = 0; i < spawnEvent.spawnAmount; i++ ) { - entity guy = CreateStalker( TEAM_IMC, spawnEvent.origin,<0,0,0> ) - if(spawnEvent.entityGlobalKey!="") - GlobalEventEntitys[spawnEvent.entityGlobalKey+i.tostring()] <- guy + entity guy = CreateStalker( TEAM_IMC, spawnEvent.origin, < 0, 0, 0 > ) + if( spawnEvent.entityGlobalKey != "" ) + GlobalEventEntitys[ spawnEvent.entityGlobalKey + i.tostring() ] <- guy SetTeam( guy, TEAM_IMC ) guy.EnableNPCFlag( NPC_ALLOW_INVESTIGATE | NPC_ALLOW_HAND_SIGNALS | NPC_ALLOW_FLEE ) guy.DisableNPCFlag( NPC_ALLOW_PATROL) @@ -804,9 +806,9 @@ void function spawnDroppodStalker(SmokeEvent smokeEvent,SpawnEvent spawnEvent,Fl SetSquad( guy, squadName ) guy.AssaultSetFightRadius( 0 ) // makes them keep moving instead of stopping to shoot you. - AddMinimapForHumans(guy) - spawnedNPCs.append(guy) - SetTargetName( guy, GetTargetNameForID(eFD_AITypeIDs.STALKER)) + AddMinimapForHumans( guy ) + spawnedNPCs.append( guy ) + SetTargetName( guy, GetTargetNameForID( eFD_AITypeIDs.STALKER ) ) thread FDStalkerThink( guy , fd_harvester.harvester ) guys.append( guy ) } @@ -815,7 +817,7 @@ void function spawnDroppodStalker(SmokeEvent smokeEvent,SpawnEvent spawnEvent,Fl { case eFDDifficultyLevel.EASY: case eFDDifficultyLevel.NORMAL: // easy and normal stalkers have no weapons - foreach(npc in guys) + foreach( npc in guys ) { npc.TakeActiveWeapon() npc.SetNoTarget( false ) @@ -826,7 +828,7 @@ void function spawnDroppodStalker(SmokeEvent smokeEvent,SpawnEvent spawnEvent,Fl case eFDDifficultyLevel.HARD: case eFDDifficultyLevel.MASTER: case eFDDifficultyLevel.INSANE: // give all EPGs - foreach(npc in guys) + foreach( npc in guys ) { npc.TakeActiveWeapon() npc.GiveWeapon( "mp_weapon_epg", [] ) @@ -840,27 +842,27 @@ void function spawnDroppodStalker(SmokeEvent smokeEvent,SpawnEvent spawnEvent,Fl } ActivateFireteamDropPod( pod, guys ) - SquadNav_Thread(guys,spawnEvent.route) + SquadNav_Thread( guys, spawnEvent.route ) } -void function spawnDroppodSpectreMortar(SmokeEvent smokeEvent,SpawnEvent spawnEvent,FlowControlEvent flowControlEvent,SoundEvent soundEvent) +void function spawnDroppodSpectreMortar( SmokeEvent smokeEvent, SpawnEvent spawnEvent, FlowControlEvent flowControlEvent, SoundEvent soundEvent ) { - PingMinimap(spawnEvent.origin.x, spawnEvent.origin.y, 4, 600, 150, 0) - entity pod = CreateDropPod( spawnEvent.origin, <0,0,0> ) + PingMinimap( spawnEvent.origin.x, spawnEvent.origin.y, 4, 600, 150, 0 ) + entity pod = CreateDropPod( spawnEvent.origin, < 0, 0, 0 > ) SetTeam( pod, TEAM_IMC ) InitFireteamDropPod( pod ) - waitthread LaunchAnimDropPod( pod, "pod_testpath", spawnEvent.origin, <0,0,0> ) + waitthread LaunchAnimDropPod( pod, "pod_testpath", spawnEvent.origin, < 0, 0, 0 > ) string squadName = MakeSquadName( TEAM_IMC, UniqueString( "ZiplineTable" ) ) array<entity> guys for ( int i = 0; i < 4; i++ ) { - entity guy = CreateSpectre( TEAM_IMC, spawnEvent.origin,<0,0,0> ) - SetSpawnOption_AISettings(guy, "npc_spectre_mortar") - if(spawnEvent.entityGlobalKey!="") - GlobalEventEntitys[spawnEvent.entityGlobalKey+i.tostring()] <- guy + entity guy = CreateSpectre( TEAM_IMC, spawnEvent.origin,< 0, 0, 0 > ) + SetSpawnOption_AISettings( guy, "npc_spectre_mortar" ) + if( spawnEvent.entityGlobalKey != "" ) + GlobalEventEntitys[ spawnEvent.entityGlobalKey + i.tostring() ] <- guy SetTeam( guy, TEAM_IMC ) DispatchSpawn( guy ) spawnedNPCs.append(guy) @@ -876,235 +878,234 @@ void function spawnDroppodSpectreMortar(SmokeEvent smokeEvent,SpawnEvent spawnEv } -void function spawnGenericNPC(SmokeEvent smokeEvent,SpawnEvent spawnEvent,FlowControlEvent flowControlEvent,SoundEvent soundEvent) +void function spawnGenericNPC( SmokeEvent smokeEvent, SpawnEvent spawnEvent, FlowControlEvent flowControlEvent, SoundEvent soundEvent ) { - PingMinimap(spawnEvent.origin.x, spawnEvent.origin.y, 4, 600, 150, 0) + PingMinimap( spawnEvent.origin.x, spawnEvent.origin.y, 4, 600, 150, 0 ) entity npc = CreateNPC( spawnEvent.npcClassName, TEAM_IMC, spawnEvent.origin, spawnEvent.angles ) - if(spawnEvent.entityGlobalKey!="") + if( spawnEvent.entityGlobalKey != "" ) GlobalEventEntitys[spawnEvent.entityGlobalKey] <- npc - DispatchSpawn(npc) + DispatchSpawn( npc ) } -void function spawnGenericNPCTitanwithSettings(SmokeEvent smokeEvent,SpawnEvent spawnEvent,FlowControlEvent flowControlEvent,SoundEvent soundEvent) +void function spawnGenericNPCTitanwithSettings( SmokeEvent smokeEvent, SpawnEvent spawnEvent, FlowControlEvent flowControlEvent, SoundEvent soundEvent ) { - PingMinimap(spawnEvent.origin.x, spawnEvent.origin.y, 4, 600, 150, 0) + PingMinimap( spawnEvent.origin.x, spawnEvent.origin.y, 4, 600, 150, 0 ) entity npc = CreateNPCTitan( spawnEvent.npcClassName, TEAM_IMC, spawnEvent.origin, spawnEvent.angles ) if( spawnEvent.aiSettings == "npc_titan_atlas_tracker_fd_sniper" ) SetTargetName( npc, "npc_titan_atlas_tracker" ) // required for client to create icons - SetSpawnOption_AISettings( npc, spawnEvent.aiSettings) - SetSpawnOption_Titanfall(npc) - DispatchSpawn(npc) - if(spawnEvent.entityGlobalKey!="") + SetSpawnOption_AISettings( npc, spawnEvent.aiSettings ) + SetSpawnOption_Titanfall( npc ) + DispatchSpawn( npc ) + if( spawnEvent.entityGlobalKey != "" ) GlobalEventEntitys[spawnEvent.entityGlobalKey] <- npc - spawnedNPCs.append(npc) - AddMinimapForTitans(npc) + spawnedNPCs.append( npc ) + AddMinimapForTitans( npc ) npc.WaitSignal( "TitanHotDropComplete" ) npc.GetTitanSoul().SetTitanSoulNetBool( "showOverheadIcon", true ) } -void function SpawnIonTitan(SmokeEvent smokeEvent,SpawnEvent spawnEvent,FlowControlEvent flowControlEvent,SoundEvent soundEvent) +void function SpawnIonTitan( SmokeEvent smokeEvent, SpawnEvent spawnEvent, FlowControlEvent flowControlEvent, SoundEvent soundEvent ) { - PingMinimap(spawnEvent.origin.x, spawnEvent.origin.y, 4, 600, 150, 0) - entity npc = CreateNPCTitan("titan_atlas",TEAM_IMC, spawnEvent.origin, spawnEvent.angles) - SetSpawnOption_AISettings(npc,"npc_titan_atlas_stickybomb_boss_fd") - SetSpawnOption_Titanfall(npc) - SetTargetName( npc, GetTargetNameForID(spawnEvent.spawnType)) // required for client to create icons + PingMinimap( spawnEvent.origin.x, spawnEvent.origin.y, 4, 600, 150, 0 ) + entity npc = CreateNPCTitan( "titan_atlas", TEAM_IMC, spawnEvent.origin, spawnEvent.angles) + SetSpawnOption_AISettings( npc, "npc_titan_atlas_stickybomb_boss_fd" ) + SetSpawnOption_Titanfall( npc ) + SetTargetName( npc, GetTargetNameForID( spawnEvent.spawnType ) ) // required for client to create icons DispatchSpawn( npc ) - if(spawnEvent.entityGlobalKey!="") + if( spawnEvent.entityGlobalKey != "" ) GlobalEventEntitys[spawnEvent.entityGlobalKey] <- npc - spawnedNPCs.append(npc) - AddMinimapForTitans(npc) + spawnedNPCs.append( npc ) + AddMinimapForTitans( npc ) npc.WaitSignal( "TitanHotDropComplete" ) npc.GetTitanSoul().SetTitanSoulNetBool( "showOverheadIcon", true ) - thread singleNav_thread(npc, spawnEvent.route) + thread singleNav_thread( npc, spawnEvent.route ) } -void function SpawnScorchTitan(SmokeEvent smokeEvent,SpawnEvent spawnEvent,FlowControlEvent flowControlEvent,SoundEvent soundEvent) +void function SpawnScorchTitan( SmokeEvent smokeEvent, SpawnEvent spawnEvent, FlowControlEvent flowControlEvent, SoundEvent soundEvent ) { - PingMinimap(spawnEvent.origin.x, spawnEvent.origin.y, 4, 600, 150, 0) - entity npc = CreateNPCTitan("titan_ogre",TEAM_IMC, spawnEvent.origin, spawnEvent.angles) - SetSpawnOption_AISettings(npc,"npc_titan_ogre_meteor_boss_fd") - SetSpawnOption_Titanfall(npc) - SetTargetName( npc, GetTargetNameForID(spawnEvent.spawnType)) // required for client to create icons + PingMinimap( spawnEvent.origin.x, spawnEvent.origin.y, 4, 600, 150, 0 ) + entity npc = CreateNPCTitan( "titan_ogre", TEAM_IMC, spawnEvent.origin, spawnEvent.angles ) + SetSpawnOption_AISettings( npc, "npc_titan_ogre_meteor_boss_fd" ) + SetSpawnOption_Titanfall( npc ) + SetTargetName( npc, GetTargetNameForID( spawnEvent.spawnType ) ) // required for client to create icons DispatchSpawn( npc ) - if(spawnEvent.entityGlobalKey!="") + if( spawnEvent.entityGlobalKey != "" ) GlobalEventEntitys[spawnEvent.entityGlobalKey] <- npc - spawnedNPCs.append(npc) - AddMinimapForTitans(npc) + spawnedNPCs.append( npc ) + AddMinimapForTitans( npc ) npc.WaitSignal( "TitanHotDropComplete" ) npc.GetTitanSoul().SetTitanSoulNetBool( "showOverheadIcon", true ) - thread singleNav_thread(npc, spawnEvent.route) + thread singleNav_thread( npc, spawnEvent.route ) } -void function SpawnRoninTitan(SmokeEvent smokeEvent,SpawnEvent spawnEvent,FlowControlEvent flowControlEvent,SoundEvent soundEvent) +void function SpawnRoninTitan( SmokeEvent smokeEvent, SpawnEvent spawnEvent, FlowControlEvent flowControlEvent, SoundEvent soundEvent ) { - PingMinimap(spawnEvent.origin.x, spawnEvent.origin.y, 4, 600, 150, 0) - entity npc = CreateNPCTitan("titan_stryder",TEAM_IMC, spawnEvent.origin, spawnEvent.angles) - SetSpawnOption_AISettings(npc,"npc_titan_stryder_leadwall_boss_fd") - SetSpawnOption_Titanfall(npc) - SetTargetName( npc, GetTargetNameForID(spawnEvent.spawnType)) // required for client to create icons + PingMinimap( spawnEvent.origin.x, spawnEvent.origin.y, 4, 600, 150, 0 ) + entity npc = CreateNPCTitan( "titan_stryder", TEAM_IMC, spawnEvent.origin, spawnEvent.angles) + SetSpawnOption_AISettings (npc, "npc_titan_stryder_leadwall_boss_fd" ) + SetSpawnOption_Titanfall( npc ) + SetTargetName( npc, GetTargetNameForID( spawnEvent.spawnType ) ) // required for client to create icons DispatchSpawn( npc ) - if(spawnEvent.entityGlobalKey!="") + if( spawnEvent.entityGlobalKey != "" ) GlobalEventEntitys[spawnEvent.entityGlobalKey] <- npc - spawnedNPCs.append(npc) - AddMinimapForTitans(npc) + spawnedNPCs.append( npc ) + AddMinimapForTitans( npc ) npc.WaitSignal( "TitanHotDropComplete" ) npc.GetTitanSoul().SetTitanSoulNetBool( "showOverheadIcon", true ) - thread singleNav_thread(npc, spawnEvent.route) + thread singleNav_thread( npc, spawnEvent.route ) } -void function SpawnToneTitan(SmokeEvent smokeEvent,SpawnEvent spawnEvent,FlowControlEvent flowControlEvent,SoundEvent soundEvent) +void function SpawnToneTitan( SmokeEvent smokeEvent, SpawnEvent spawnEvent, FlowControlEvent flowControlEvent, SoundEvent soundEvent ) { - PingMinimap(spawnEvent.origin.x, spawnEvent.origin.y, 4, 600, 150, 0) - entity npc = CreateNPCTitan("titan_atlas",TEAM_IMC, spawnEvent.origin, spawnEvent.angles) - SetSpawnOption_AISettings(npc,"npc_titan_atlas_tracker_boss_fd") - SetSpawnOption_Titanfall(npc) - SetTargetName( npc, GetTargetNameForID(spawnEvent.spawnType)) // required for client to create icons + PingMinimap( spawnEvent.origin.x, spawnEvent.origin.y, 4, 600, 150, 0 ) + entity npc = CreateNPCTitan( "titan_atlas", TEAM_IMC, spawnEvent.origin, spawnEvent.angles) + SetSpawnOption_AISettings( npc, "npc_titan_atlas_tracker_boss_fd" ) + SetSpawnOption_Titanfall( npc ) + SetTargetName( npc, GetTargetNameForID( spawnEvent.spawnType ) ) // required for client to create icons DispatchSpawn( npc ) - if(spawnEvent.entityGlobalKey!="") + if( spawnEvent.entityGlobalKey != "" ) GlobalEventEntitys[spawnEvent.entityGlobalKey] <- npc - spawnedNPCs.append(npc) - AddMinimapForTitans(npc) + spawnedNPCs.append( npc ) + AddMinimapForTitans( npc ) npc.WaitSignal( "TitanHotDropComplete" ) npc.GetTitanSoul().SetTitanSoulNetBool( "showOverheadIcon", true ) - thread singleNav_thread(npc, spawnEvent.route) + thread singleNav_thread( npc, spawnEvent.route ) } -void function SpawnLegionTitan(SmokeEvent smokeEvent,SpawnEvent spawnEvent,FlowControlEvent flowControlEvent,SoundEvent soundEvent) +void function SpawnLegionTitan( SmokeEvent smokeEvent, SpawnEvent spawnEvent, FlowControlEvent flowControlEvent, SoundEvent soundEvent ) { - PingMinimap(spawnEvent.origin.x, spawnEvent.origin.y, 4, 600, 150, 0) - entity npc = CreateNPCTitan("titan_ogre",TEAM_IMC, spawnEvent.origin, spawnEvent.angles) - SetSpawnOption_AISettings(npc,"npc_titan_ogre_minigun_boss_fd") - SetSpawnOption_Titanfall(npc) - SetTargetName( npc, GetTargetNameForID(spawnEvent.spawnType)) // required for client to create icons + PingMinimap( spawnEvent.origin.x, spawnEvent.origin.y, 4, 600, 150, 0 ) + entity npc = CreateNPCTitan( "titan_ogre", TEAM_IMC, spawnEvent.origin, spawnEvent.angles ) + SetSpawnOption_AISettings( npc, "npc_titan_ogre_minigun_boss_fd" ) + SetSpawnOption_Titanfall( npc ) + SetTargetName( npc, GetTargetNameForID( spawnEvent.spawnType ) ) // required for client to create icons DispatchSpawn( npc ) - if(spawnEvent.entityGlobalKey!="") + if( spawnEvent.entityGlobalKey != "" ) GlobalEventEntitys[spawnEvent.entityGlobalKey] <- npc - spawnedNPCs.append(npc) - AddMinimapForTitans(npc) + spawnedNPCs.append( npc ) + AddMinimapForTitans( npc ) npc.WaitSignal( "TitanHotDropComplete" ) npc.GetTitanSoul().SetTitanSoulNetBool( "showOverheadIcon", true ) - thread singleNav_thread(npc, spawnEvent.route) + thread singleNav_thread( npc, spawnEvent.route ) } -void function SpawnMonarchTitan(SmokeEvent smokeEvent,SpawnEvent spawnEvent,FlowControlEvent flowControlEvent,SoundEvent soundEvent) +void function SpawnMonarchTitan( SmokeEvent smokeEvent, SpawnEvent spawnEvent, FlowControlEvent flowControlEvent, SoundEvent soundEvent ) { - PingMinimap(spawnEvent.origin.x, spawnEvent.origin.y, 4, 600, 150, 0) - entity npc = CreateNPCTitan("titan_atlas",TEAM_IMC, spawnEvent.origin, spawnEvent.angles) - SetSpawnOption_AISettings(npc,"npc_titan_atlas_vanguard_boss_fd") - SetSpawnOption_Titanfall(npc) - SetTargetName( npc, GetTargetNameForID(spawnEvent.spawnType)) // required for client to create icons + PingMinimap( spawnEvent.origin.x, spawnEvent.origin.y, 4, 600, 150, 0 ) + entity npc = CreateNPCTitan( "titan_atlas", TEAM_IMC, spawnEvent.origin, spawnEvent.angles ) + SetSpawnOption_AISettings( npc,"npc_titan_atlas_vanguard_boss_fd" ) + SetSpawnOption_Titanfall( npc ) + SetTargetName( npc, GetTargetNameForID( spawnEvent.spawnType ) ) // required for client to create icons DispatchSpawn( npc ) - if(spawnEvent.entityGlobalKey!="") + if( spawnEvent.entityGlobalKey != "" ) GlobalEventEntitys[spawnEvent.entityGlobalKey] <- npc - spawnedNPCs.append(npc) - AddMinimapForTitans(npc) + spawnedNPCs.append( npc ) + AddMinimapForTitans( npc ) npc.WaitSignal( "TitanHotDropComplete" ) npc.GetTitanSoul().SetTitanSoulNetBool( "showOverheadIcon", true ) - thread singleNav_thread(npc, spawnEvent.route) + thread singleNav_thread( npc, spawnEvent.route ) } -void function spawnNukeTitan(SmokeEvent smokeEvent,SpawnEvent spawnEvent,FlowControlEvent flowControlEvent,SoundEvent soundEvent) +void function spawnNukeTitan( SmokeEvent smokeEvent, SpawnEvent spawnEvent, FlowControlEvent flowControlEvent, SoundEvent soundEvent ) { - PingMinimap(spawnEvent.origin.x, spawnEvent.origin.y, 4, 600, 150, 0) - entity npc = CreateNPCTitan("titan_ogre",TEAM_IMC, spawnEvent.origin, spawnEvent.angles) - SetSpawnOption_AISettings(npc,"npc_titan_ogre_minigun_nuke") - SetSpawnOption_Titanfall(npc) - SetTargetName( npc, GetTargetNameForID(spawnEvent.spawnType)) // required for client to create icons - npc.EnableNPCMoveFlag(NPCMF_WALK_ALWAYS) - npc.AssaultSetFightRadius(0) - DispatchSpawn(npc) - if(spawnEvent.entityGlobalKey!="") + PingMinimap( spawnEvent.origin.x, spawnEvent.origin.y, 4, 600, 150, 0 ) + entity npc = CreateNPCTitan( "titan_ogre", TEAM_IMC, spawnEvent.origin, spawnEvent.angles ) + SetSpawnOption_AISettings( npc, "npc_titan_ogre_minigun_nuke" ) + SetSpawnOption_Titanfall( npc ) + SetTargetName( npc, GetTargetNameForID( spawnEvent.spawnType ) ) // required for client to create icons + npc.EnableNPCMoveFlag( NPCMF_WALK_ALWAYS ) + npc.AssaultSetFightRadius( 0 ) + DispatchSpawn( npc ) + if( spawnEvent.entityGlobalKey != "" ) GlobalEventEntitys[spawnEvent.entityGlobalKey] <- npc - spawnedNPCs.append(npc) - AddMinimapForTitans(npc) + spawnedNPCs.append( npc ) + AddMinimapForTitans( npc ) npc.WaitSignal( "TitanHotDropComplete" ) npc.GetTitanSoul().SetTitanSoulNetBool( "showOverheadIcon", true ) - thread singleNav_thread(npc,spawnEvent.route) - thread NukeTitanThink(npc,fd_harvester.harvester) + thread singleNav_thread( npc, spawnEvent.route ) + thread NukeTitanThink( npc, fd_harvester.harvester ) } -void function spawnMortarTitan(SmokeEvent smokeEvent,SpawnEvent spawnEvent,FlowControlEvent flowControlEvent,SoundEvent soundEvent) +void function spawnMortarTitan( SmokeEvent smokeEvent, SpawnEvent spawnEvent, FlowControlEvent flowControlEvent, SoundEvent soundEvent ) { - - PingMinimap(spawnEvent.origin.x, spawnEvent.origin.y, 4, 600, 150, 0) - entity npc = CreateNPCTitan("titan_atlas",TEAM_IMC, spawnEvent.origin, spawnEvent.angles) - SetSpawnOption_AISettings(npc,"npc_titan_atlas_tracker_mortar") - SetSpawnOption_Titanfall(npc) - SetTargetName( npc, GetTargetNameForID(spawnEvent.spawnType)) // required for client to create icons - DispatchSpawn(npc) - if(spawnEvent.entityGlobalKey!="") + PingMinimap( spawnEvent.origin.x, spawnEvent.origin.y, 4, 600, 150, 0 ) + entity npc = CreateNPCTitan( "titan_atlas", TEAM_IMC, spawnEvent.origin, spawnEvent.angles ) + SetSpawnOption_AISettings( npc, "npc_titan_atlas_tracker_mortar" ) + SetSpawnOption_Titanfall( npc ) + SetTargetName( npc, GetTargetNameForID( spawnEvent.spawnType ) ) // required for client to create icons + DispatchSpawn( npc ) + if( spawnEvent.entityGlobalKey != "" ) GlobalEventEntitys[spawnEvent.entityGlobalKey] <- npc - spawnedNPCs.append(npc) - AddMinimapForTitans(npc) + spawnedNPCs.append( npc ) + AddMinimapForTitans( npc ) npc.WaitSignal( "TitanHotDropComplete" ) npc.GetTitanSoul().SetTitanSoulNetBool( "showOverheadIcon", true ) - thread MortarTitanThink(npc,fd_harvester.harvester) + thread MortarTitanThink( npc, fd_harvester.harvester ) } -void function spawnSniperTitan(SmokeEvent smokeEvent,SpawnEvent spawnEvent,FlowControlEvent flowControlEvent,SoundEvent soundEvent) +void function spawnSniperTitan( SmokeEvent smokeEvent, SpawnEvent spawnEvent, FlowControlEvent flowControlEvent, SoundEvent soundEvent ) { - PingMinimap(spawnEvent.origin.x, spawnEvent.origin.y, 4, 600, 150, 0) - entity npc = CreateNPCTitan("titan_stryder",TEAM_IMC, spawnEvent.origin, spawnEvent.angles) - SetSpawnOption_AISettings(npc,"npc_titan_stryder_sniper_fd") - SetSpawnOption_Titanfall(npc) - SetTargetName( npc, GetTargetNameForID(spawnEvent.spawnType)) // required for client to create icons - DispatchSpawn(npc) - if(spawnEvent.entityGlobalKey!="") + PingMinimap( spawnEvent.origin.x, spawnEvent.origin.y, 4, 600, 150, 0 ) + entity npc = CreateNPCTitan( "titan_stryder", TEAM_IMC, spawnEvent.origin, spawnEvent.angles) + SetSpawnOption_AISettings( npc, "npc_titan_stryder_sniper_fd" ) + SetSpawnOption_Titanfall( npc ) + SetTargetName( npc, GetTargetNameForID( spawnEvent.spawnType ) ) // required for client to create icons + DispatchSpawn( npc ) + if( spawnEvent.entityGlobalKey != "" ) GlobalEventEntitys[spawnEvent.entityGlobalKey] <- npc - spawnedNPCs.append(npc) - AddMinimapForTitans(npc) + spawnedNPCs.append( npc ) + AddMinimapForTitans( npc ) npc.WaitSignal( "TitanHotDropComplete" ) npc.GetTitanSoul().SetTitanSoulNetBool( "showOverheadIcon", true ) - thread SniperTitanThink(npc,fd_harvester.harvester) + thread SniperTitanThink( npc, fd_harvester.harvester ) } -void function SpawnToneSniperTitan(SmokeEvent smokeEvent,SpawnEvent spawnEvent,FlowControlEvent flowControlEvent,SoundEvent soundEvent) +void function SpawnToneSniperTitan( SmokeEvent smokeEvent, SpawnEvent spawnEvent, FlowControlEvent flowControlEvent, SoundEvent soundEvent ) { - PingMinimap(spawnEvent.origin.x, spawnEvent.origin.y, 4, 600, 150, 0) - entity npc = CreateNPCTitan("titan_atlas",TEAM_IMC, spawnEvent.origin, spawnEvent.angles) - SetSpawnOption_AISettings(npc,"npc_titan_atlas_tracker_fd_sniper") - SetSpawnOption_Titanfall(npc) - SetTargetName( npc, GetTargetNameForID(spawnEvent.spawnType)) // required for client to create icons + PingMinimap( spawnEvent.origin.x, spawnEvent.origin.y, 4, 600, 150, 0 ) + entity npc = CreateNPCTitan( "titan_atlas", TEAM_IMC, spawnEvent.origin, spawnEvent.angles ) + SetSpawnOption_AISettings( npc, "npc_titan_atlas_tracker_fd_sniper" ) + SetSpawnOption_Titanfall( npc ) + SetTargetName( npc, GetTargetNameForID( spawnEvent.spawnType ) ) // required for client to create icons DispatchSpawn( npc ) - if(spawnEvent.entityGlobalKey!="") + if( spawnEvent.entityGlobalKey != "" ) GlobalEventEntitys[spawnEvent.entityGlobalKey] <- npc - npc.AssaultSetFightRadius(0) - spawnedNPCs.append(npc) - AddMinimapForTitans(npc) + npc.AssaultSetFightRadius( 0 ) + spawnedNPCs.append( npc ) + AddMinimapForTitans( npc ) npc.WaitSignal( "TitanHotDropComplete" ) npc.GetTitanSoul().SetTitanSoulNetBool( "showOverheadIcon", true ) - thread SniperTitanThink(npc,fd_harvester.harvester) + thread SniperTitanThink( npc, fd_harvester.harvester ) } -void function fd_spawnCloakDrone(SmokeEvent smokeEffect,SpawnEvent spawnEvent,FlowControlEvent flowControlEvent,SoundEvent soundEvent) +void function fd_spawnCloakDrone( SmokeEvent smokeEvent, SpawnEvent spawnEvent,FlowControlEvent flowControlEvent,SoundEvent soundEvent ) { entity npc = SpawnCloakDrone( TEAM_IMC, spawnEvent.origin, spawnEvent.angles, fd_harvester.harvester.GetOrigin() ) - spawnedNPCs.append(npc) - if(spawnEvent.entityGlobalKey!="") + spawnedNPCs.append( npc ) + if( spawnEvent.entityGlobalKey != "" ) GlobalEventEntitys[spawnEvent.entityGlobalKey] <- npc - SetTargetName( npc, GetTargetNameForID(spawnEvent.spawnType)) - AddMinimapForHumans(npc) + SetTargetName( npc, GetTargetNameForID( spawnEvent.spawnType ) ) + AddMinimapForHumans( npc ) } -void function SpawnTick( SmokeEvent smokeEffect,SpawnEvent spawnEvent,FlowControlEvent flowControlEvent,SoundEvent soundEvent ) +void function SpawnTick( SmokeEvent smokeEvent, SpawnEvent spawnEvent, FlowControlEvent flowControlEvent, SoundEvent soundEvent ) { PingMinimap( spawnEvent.origin.x, spawnEvent.origin.y, 4, 600, 150, 0 ) - entity pod = CreateDropPod( spawnEvent.origin, <0,0,0> ) + entity pod = CreateDropPod( spawnEvent.origin, < 0, 0, 0 > ) SetTeam( pod, TEAM_IMC ) InitFireteamDropPod( pod ) - waitthread LaunchAnimDropPod( pod, "pod_testpath", spawnEvent.origin, <0,0,0> ) + waitthread LaunchAnimDropPod( pod, "pod_testpath", spawnEvent.origin, < 0, 0, 0 > ) string squadName = MakeSquadName( TEAM_IMC, UniqueString( "ZiplineTable" ) ) array<entity> guys for ( int i = 0; i < spawnEvent.spawnAmount; i++ ) { - entity guy = CreateFragDrone( TEAM_IMC, spawnEvent.origin, <0,0,0> ) - if( spawnEvent.entityGlobalKey!="" ) + entity guy = CreateFragDrone( TEAM_IMC, spawnEvent.origin, < 0, 0, 0 > ) + if( spawnEvent.entityGlobalKey != "" ) GlobalEventEntitys[ spawnEvent.entityGlobalKey + i.tostring() ] <- guy SetSpawnOption_AISettings( guy, "npc_frag_drone_fd" ) SetTeam( guy, TEAM_IMC ) @@ -1114,7 +1115,7 @@ void function SpawnTick( SmokeEvent smokeEffect,SpawnEvent spawnEvent,FlowContro SetTargetName( guy, GetTargetNameForID( eFD_AITypeIDs.TICK ) ) SetSquad( guy, squadName ) spawnedNPCs.append( guy ) - guy.AssaultSetFightRadius( expect int( guy.Dev_GetAISettingByKeyField("LookDistDefault_Combat") ) ) // make the ticks target players very aggressively + guy.AssaultSetFightRadius( expect int( guy.Dev_GetAISettingByKeyField( "LookDistDefault_Combat" ) ) ) // make the ticks target players very aggressively guys.append( guy ) } @@ -1135,11 +1136,11 @@ void function SpawnTick( SmokeEvent smokeEffect,SpawnEvent spawnEvent,FlowContro \****************************************************************************************/ -void function PingMinimap(float x, float y, float duration, float spreadRadius, float ringRadius, int colorIndex) +void function PingMinimap( float x, float y, float duration, float spreadRadius, float ringRadius, int colorIndex ) { - foreach(entity player in GetPlayerArray()) + foreach( entity player in GetPlayerArray() ) { - Remote_CallFunction_NonReplay(player, "ServerCallback_FD_PingMinimap", x, y, duration, spreadRadius, ringRadius, colorIndex) + Remote_CallFunction_NonReplay( player, "ServerCallback_FD_PingMinimap", x, y, duration, spreadRadius, ringRadius, colorIndex ) } } @@ -1164,14 +1165,14 @@ void function waitUntilLessThanAmountAlive( int amount ) continue } } - int aliveNPCs = spawnedNPCs.len() -deduct - while ( aliveNPCs>amount ) + int aliveNPCs = spawnedNPCs.len() - deduct + while( aliveNPCs > amount ) { WaitFrame() deduct = 0 foreach ( entity npc in spawnedNPCs ) { - if ( !IsValid( npc ) ) + if( !IsValid( npc ) ) { deduct++ continue @@ -1187,75 +1188,75 @@ void function waitUntilLessThanAmountAlive( int amount ) continue } } - aliveNPCs = spawnedNPCs.len() -deduct + aliveNPCs = spawnedNPCs.len() - deduct - if ( !IsAlive( fd_harvester.harvester ) ) + if( !IsAlive( fd_harvester.harvester ) ) return } } -void function waitUntilLessThanAmountAliveWeighted(int amount,int humanWeight=1,int reaperWeight=3, int titanWeight=5) +void function waitUntilLessThanAmountAliveWeighted( int amount, int humanWeight = 1, int reaperWeight = 3, int titanWeight = 5 ) { int aliveNPCsWeighted = 0; - foreach(npc in spawnedNPCs) + foreach( npc in spawnedNPCs ) { - if(!IsValid(npc)) + if( !IsValid( npc ) ) continue if( IsValid( GetPetTitanOwner( npc ) ) ) continue - if(npc.GetTeam()==TEAM_MILITIA) + if( npc.GetTeam() == TEAM_MILITIA ) continue - if(npc.IsTitan()) + if( npc.IsTitan() ) aliveNPCsWeighted += titanWeight - else if(npc.GetTargetName()=="reaper") + else if( npc.GetTargetName() == "reaper" ) aliveNPCsWeighted += reaperWeight else aliveNPCsWeighted += humanWeight } - while(aliveNPCsWeighted>amount) + while( aliveNPCsWeighted > amount ) { WaitFrame() aliveNPCsWeighted = 0; - foreach(npc in spawnedNPCs) + foreach( npc in spawnedNPCs ) { - if(!IsValid(npc)) + if( !IsValid( npc ) ) continue if( IsValid( GetPetTitanOwner( npc ) ) ) continue - if(npc.GetTeam()==TEAM_MILITIA) + if( npc.GetTeam() == TEAM_MILITIA ) continue - if(npc.IsTitan()) + if( npc.IsTitan() ) aliveNPCsWeighted += titanWeight - else if(npc.GetTargetName()=="reaper") + else if( npc.GetTargetName() == "reaper" ) aliveNPCsWeighted += reaperWeight else aliveNPCsWeighted += humanWeight } - if(!IsAlive(fd_harvester.harvester)) + if( !IsAlive( fd_harvester.harvester ) ) return } } -void function waitUntilLessThanAmountAlive_expensive(int amount) +void function waitUntilLessThanAmountAlive_expensive( int amount ) { array<entity> npcs = GetNPCArray() int deduct = 0 - foreach (entity npc in npcs) + foreach ( entity npc in npcs ) { if( IsValid( GetPetTitanOwner( npc ) ) ) { deduct++ continue } - if(npc.GetTeam()==TEAM_MILITIA) + if( npc.GetTeam() == TEAM_MILITIA ) { deduct++ continue @@ -1263,31 +1264,31 @@ void function waitUntilLessThanAmountAlive_expensive(int amount) } int aliveTitans = npcs.len() - deduct - while(aliveTitans>amount) + while( aliveTitans > amount ) { WaitFrame() npcs = GetNPCArray() deduct = 0 - foreach(entity npc in npcs) + foreach( entity npc in npcs ) { if( IsValid( GetPetTitanOwner( npc ) ) ) { deduct++ continue } - if(npc.GetTeam()==TEAM_MILITIA) + if( npc.GetTeam() == TEAM_MILITIA ) { deduct++ continue } } aliveTitans = GetNPCArray().len() - deduct - if(!IsAlive(fd_harvester.harvester)) + if( !IsAlive( fd_harvester.harvester ) ) return } } -void function AddMinimapForTitans(entity titan) +void function AddMinimapForTitans( entity titan ) { titan.Minimap_SetAlignUpright( true ) titan.Minimap_AlwaysShow( TEAM_IMC, null ) @@ -1297,7 +1298,7 @@ void function AddMinimapForTitans(entity titan) } // including drones -void function AddMinimapForHumans(entity human) +void function AddMinimapForHumans( entity human ) { human.Minimap_SetAlignUpright( true ) human.Minimap_AlwaysShow( TEAM_IMC, null ) diff --git a/Northstar.CustomServers/mod/scripts/vscripts/gamemodes/_gamemode_fd_nav.nut b/Northstar.CustomServers/mod/scripts/vscripts/gamemodes/_gamemode_fd_nav.nut index 06753f78..2d76c99e 100644 --- a/Northstar.CustomServers/mod/scripts/vscripts/gamemodes/_gamemode_fd_nav.nut +++ b/Northstar.CustomServers/mod/scripts/vscripts/gamemodes/_gamemode_fd_nav.nut @@ -6,16 +6,15 @@ global function Dev_MarkRoute -void function singleNav_thread(entity npc, string routeName,int nodesToSkip= 0,float nextDistance = 500.0, bool shouldLoop = false) +void function singleNav_thread( entity npc, string routeName, int nodesToSkip= 0, float nextDistance = 500.0, bool shouldLoop = false ) { npc.EndSignal( "OnDeath" ) npc.EndSignal( "OnDestroy" ) - if(!npc.IsNPC()){ + if( !npc.IsNPC() ) return - } @@ -54,7 +53,7 @@ void function singleNav_thread(entity npc, string routeName,int nodesToSkip= 0,f float dist = 1000000000 foreach ( entity node in routeNodes ) { - if( !node.HasKey("route_name") ) + if( !node.HasKey( "route_name" ) ) continue if ( Distance( npc.GetOrigin(), node.GetOrigin() ) < dist ) { @@ -89,10 +88,10 @@ void function singleNav_thread(entity npc, string routeName,int nodesToSkip= 0,f targetNode = targetNode.GetLinkEnt() } - npc.Signal("FD_ReachedHarvester") + npc.Signal( "FD_ReachedHarvester" ) } -void function SquadNav_Thread( array<entity> npcs ,string routeName,int nodesToSkip = 0,float nextDistance = 200.0 ) +void function SquadNav_Thread( array<entity> npcs, string routeName, int nodesToSkip = 0, float nextDistance = 200.0 ) { //TODO this function wont stop when noone alive anymore also it only works half of the time /* @@ -121,7 +120,7 @@ void function SquadNav_Thread( array<entity> npcs ,string routeName,int nodesToS float dist = 1000000000 foreach ( entity node in routeNodes ) { - if( !node.HasKey("route_name") ) + if( !node.HasKey( "route_name" ) ) continue if ( Distance( npcs[0].GetOrigin(), node.GetOrigin() ) < dist ) { @@ -141,27 +140,27 @@ void function SquadNav_Thread( array<entity> npcs ,string routeName,int nodesToS { targetNode = targetNode.GetLinkEnt() } - while ( targetNode != null ) { if( !IsAlive( fd_harvester.harvester ) ) return - SquadAssaultOrigin(npcs,targetNode.GetOrigin(),nextDistance) + + SquadAssaultOrigin( npcs, targetNode.GetOrigin(), nextDistance ) targetNode = targetNode.GetLinkEnt() } } -void function droneNav_thread(entity npc, string routeName,int nodesToSkip= 0,float nextDistance = 500.0, bool shouldLoop = false) +void function droneNav_thread( entity npc, string routeName,int nodesToSkip= 0,float nextDistance = 500.0, bool shouldLoop = false ) { npc.EndSignal( "OnDeath" ) npc.EndSignal( "OnDestroy" ) - if(!npc.IsNPC()){ + if( !npc.IsNPC() ) return - } + // NEW STUFF WaitFrame() // so other code setting up what happens on signals is run before this @@ -173,7 +172,7 @@ void function droneNav_thread(entity npc, string routeName,int nodesToSkip= 0,fl float dist = 1000000000 foreach ( entity node in routeNodes ) { - if( !node.HasKey("route_name") ) + if( !node.HasKey( "route_name" ) ) continue if ( Distance( npc.GetOrigin(), node.GetOrigin() ) < dist ) { @@ -182,7 +181,7 @@ void function droneNav_thread(entity npc, string routeName,int nodesToSkip= 0,fl firstNode = node } } - printt("Entity had no route defined: using nearest node: " + targetNode.kv.route_name) + printt( "Entity had no route defined: using nearest node: " + targetNode.kv.route_name ) } else { @@ -210,22 +209,22 @@ void function droneNav_thread(entity npc, string routeName,int nodesToSkip= 0,fl targetNode = targetNode.GetLinkEnt() if ( targetNode == null ) - printt("entity finished pathing") + printt( "entity finished pathing" ) if ( targetNode == null && shouldLoop ) { - printt("entity reached end of loop, looping") + printt( "entity reached end of loop, looping" ) targetNode = firstNode } } - npc.Signal("FD_ReachedHarvester") + npc.Signal( "FD_ReachedHarvester" ) } entity function GetRouteStart( string routeName ) { foreach( entity node in routeNodes ) { - if( !node.HasKey("route_name") ) + if( !node.HasKey( "route_name" ) ) continue if( expect string( node.kv.route_name ) == routeName ) { @@ -234,37 +233,38 @@ entity function GetRouteStart( string routeName ) } } -array<entity> function getRoute(string routeName) +array<entity> function getRoute( string routeName ) { array<entity> ret array<entity> currentNode = [] foreach(entity node in routeNodes) { - if(!node.HasKey("route_name")) + if( !node.HasKey( "route_name" ) ) continue - if(node.kv.route_name==routeName) + if( node.kv.route_name == routeName ) { currentNode = [node] break } } - if(currentNode.len()==0) + if( currentNode.len() == 0 ) { - printt("Route not found") + printt( "Route not found" ) return [] } - while(currentNode.len()!=0) + while( currentNode.len() != 0 ) { - ret.append(currentNode[0]) + ret.append( currentNode[0] ) currentNode = currentNode[0].GetLinkEntArray() } return ret } -void function Dev_MarkRoute(string routename){ - foreach(entity e in getRoute(routename)) +void function Dev_MarkRoute( string routename ) +{ + foreach( entity e in getRoute( routename ) ) { - DebugDrawSphere(e.GetOrigin(),30.0,255,0,255,false,40) + DebugDrawSphere( e.GetOrigin(), 30.0, 255, 0, 255, false, 40 ) } }
\ No newline at end of file diff --git a/Northstar.CustomServers/mod/scripts/vscripts/mp/levels/mp_angel_city.nut b/Northstar.CustomServers/mod/scripts/vscripts/mp/levels/mp_angel_city.nut index 4ff36dbf..1781a21f 100644 --- a/Northstar.CustomServers/mod/scripts/vscripts/mp/levels/mp_angel_city.nut +++ b/Northstar.CustomServers/mod/scripts/vscripts/mp/levels/mp_angel_city.nut @@ -28,8 +28,8 @@ void function CodeCallback_MapInit() // Load Frontier Defense Data - if(GameRules_GetGameMode()=="fd") - initFrontierDefenseData() + if( GameRules_GetGameMode() == "fd" ) + initFrontierDefenseData() } diff --git a/Northstar.CustomServers/mod/scripts/vscripts/mp/levels/mp_black_water_canal.nut b/Northstar.CustomServers/mod/scripts/vscripts/mp/levels/mp_black_water_canal.nut index 0c12ad18..46525cea 100644 --- a/Northstar.CustomServers/mod/scripts/vscripts/mp/levels/mp_black_water_canal.nut +++ b/Northstar.CustomServers/mod/scripts/vscripts/mp/levels/mp_black_water_canal.nut @@ -6,8 +6,8 @@ void function CodeCallback_MapInit() AddSpawnCallback( "info_spawnpoint_titan_start", TrimBadTitanStartSpawns ) // Load Frontier Defense Data - if(GameRules_GetGameMode()=="fd") - initFrontierDefenseData() + if( GameRules_GetGameMode() == "fd" ) + initFrontierDefenseData() } diff --git a/Northstar.CustomServers/mod/scripts/vscripts/mp/levels/mp_colony02.nut b/Northstar.CustomServers/mod/scripts/vscripts/mp/levels/mp_colony02.nut index 02b11010..f0c17dcf 100644 --- a/Northstar.CustomServers/mod/scripts/vscripts/mp/levels/mp_colony02.nut +++ b/Northstar.CustomServers/mod/scripts/vscripts/mp/levels/mp_colony02.nut @@ -3,6 +3,10 @@ global function CodeCallback_MapInit void function CodeCallback_MapInit() { AddCallback_EntitiesDidLoad( CreateEvacNodes ) + + // Load Frontier Defense Data + if( GameRules_GetGameMode() == "fd" ) + initFrontierDefenseData() } void function CreateEvacNodes() @@ -16,10 +20,4 @@ void function CreateEvacNodes() AddEvacNode( CreateScriptRef( < -1035.991211, -671.114380, 824.180908 >, < 16.220453, -24.511070, 0 > ) ) SetEvacSpaceNode( GetEnt( "intro_spacenode" ) ) - - - - // Load Frontier Defense Data - if(GameRules_GetGameMode()=="fd") - initFrontierDefenseData() }
\ No newline at end of file diff --git a/Northstar.CustomServers/mod/scripts/vscripts/mp/levels/mp_drydock.nut b/Northstar.CustomServers/mod/scripts/vscripts/mp/levels/mp_drydock.nut index 4bd40ff1..e6eb493d 100644 --- a/Northstar.CustomServers/mod/scripts/vscripts/mp/levels/mp_drydock.nut +++ b/Northstar.CustomServers/mod/scripts/vscripts/mp/levels/mp_drydock.nut @@ -3,6 +3,6 @@ global function CodeCallback_MapInit void function CodeCallback_MapInit() { // Load Frontier Defense Data - if(GameRules_GetGameMode()=="fd") - initFrontierDefenseData() + if( GameRules_GetGameMode() == "fd" ) + initFrontierDefenseData() }
\ No newline at end of file diff --git a/Northstar.CustomServers/mod/scripts/vscripts/mp/levels/mp_forwardbase_kodai.nut b/Northstar.CustomServers/mod/scripts/vscripts/mp/levels/mp_forwardbase_kodai.nut index 81d11795..99965a1b 100644 --- a/Northstar.CustomServers/mod/scripts/vscripts/mp/levels/mp_forwardbase_kodai.nut +++ b/Northstar.CustomServers/mod/scripts/vscripts/mp/levels/mp_forwardbase_kodai.nut @@ -15,9 +15,10 @@ void function CodeCallback_MapInit() { // Battery spawns (in LTS/Free Agents) are in old locations, so we move them to the proper locations AddSpawnCallbackEditorClass( "script_ref", "script_power_up_other", FixBatterySpawns ) + // Load Frontier Defense Data - if(GameRules_GetGameMode()=="fd") - initFrontierDefenseData() + if( GameRules_GetGameMode() == "fd" ) + initFrontierDefenseData() } void function FixBatterySpawns( entity spawn ) diff --git a/Northstar.CustomServers/mod/scripts/vscripts/mp/levels/mp_glitch.nut b/Northstar.CustomServers/mod/scripts/vscripts/mp/levels/mp_glitch.nut index 4bd40ff1..e6eb493d 100644 --- a/Northstar.CustomServers/mod/scripts/vscripts/mp/levels/mp_glitch.nut +++ b/Northstar.CustomServers/mod/scripts/vscripts/mp/levels/mp_glitch.nut @@ -3,6 +3,6 @@ global function CodeCallback_MapInit void function CodeCallback_MapInit() { // Load Frontier Defense Data - if(GameRules_GetGameMode()=="fd") - initFrontierDefenseData() + if( GameRules_GetGameMode() == "fd" ) + initFrontierDefenseData() }
\ No newline at end of file diff --git a/Northstar.CustomServers/mod/scripts/vscripts/mp/levels/mp_grave.nut b/Northstar.CustomServers/mod/scripts/vscripts/mp/levels/mp_grave.nut index 73059b9e..9b5d3080 100644 --- a/Northstar.CustomServers/mod/scripts/vscripts/mp/levels/mp_grave.nut +++ b/Northstar.CustomServers/mod/scripts/vscripts/mp/levels/mp_grave.nut @@ -6,7 +6,7 @@ void function CodeCallback_MapInit() AddSpawnCallback( "info_spawnpoint_titan_start", TrimBadTitanStartSpawns ) // Load Frontier Defense Data - if(GameRules_GetGameMode()=="fd") + if( GameRules_GetGameMode() == "fd" ) initFrontierDefenseData() } diff --git a/Northstar.CustomServers/mod/scripts/vscripts/mp/levels/mp_homestead.nut b/Northstar.CustomServers/mod/scripts/vscripts/mp/levels/mp_homestead.nut index 03701458..e6eb493d 100644 --- a/Northstar.CustomServers/mod/scripts/vscripts/mp/levels/mp_homestead.nut +++ b/Northstar.CustomServers/mod/scripts/vscripts/mp/levels/mp_homestead.nut @@ -3,8 +3,6 @@ global function CodeCallback_MapInit void function CodeCallback_MapInit() { // Load Frontier Defense Data - - print(GameRules_GetGameMode()) - if(GameRules_GetGameMode()=="fd") - initFrontierDefenseData() + if( GameRules_GetGameMode() == "fd" ) + initFrontierDefenseData() }
\ No newline at end of file diff --git a/Northstar.CustomServers/mod/scripts/vscripts/mp/levels/mp_relic02.nut b/Northstar.CustomServers/mod/scripts/vscripts/mp/levels/mp_relic02.nut index 5c6a18ed..3441fc60 100644 --- a/Northstar.CustomServers/mod/scripts/vscripts/mp/levels/mp_relic02.nut +++ b/Northstar.CustomServers/mod/scripts/vscripts/mp/levels/mp_relic02.nut @@ -1,6 +1,6 @@ void function CodeCallback_MapInit() { // Load Frontier Defense Data - if(GameRules_GetGameMode()=="fd") - initFrontierDefenseData() + if( GameRules_GetGameMode() == "fd" ) + initFrontierDefenseData() }
\ No newline at end of file diff --git a/Northstar.CustomServers/mod/scripts/vscripts/mp/levels/mp_rise.nut b/Northstar.CustomServers/mod/scripts/vscripts/mp/levels/mp_rise.nut index 94dce470..e6eb493d 100644 --- a/Northstar.CustomServers/mod/scripts/vscripts/mp/levels/mp_rise.nut +++ b/Northstar.CustomServers/mod/scripts/vscripts/mp/levels/mp_rise.nut @@ -2,6 +2,7 @@ global function CodeCallback_MapInit void function CodeCallback_MapInit() { - if(GameRules_GetGameMode()=="fd") - initFrontierDefenseData() + // Load Frontier Defense Data + if( GameRules_GetGameMode() == "fd" ) + initFrontierDefenseData() }
\ No newline at end of file diff --git a/Northstar.CustomServers/mod/scripts/vscripts/mp/levels/mp_thaw.nut b/Northstar.CustomServers/mod/scripts/vscripts/mp/levels/mp_thaw.nut index 5c6a18ed..3441fc60 100644 --- a/Northstar.CustomServers/mod/scripts/vscripts/mp/levels/mp_thaw.nut +++ b/Northstar.CustomServers/mod/scripts/vscripts/mp/levels/mp_thaw.nut @@ -1,6 +1,6 @@ void function CodeCallback_MapInit() { // Load Frontier Defense Data - if(GameRules_GetGameMode()=="fd") - initFrontierDefenseData() + if( GameRules_GetGameMode() == "fd" ) + initFrontierDefenseData() }
\ No newline at end of file diff --git a/Northstar.CustomServers/mod/scripts/vscripts/mp/levels/mp_wargames.nut b/Northstar.CustomServers/mod/scripts/vscripts/mp/levels/mp_wargames.nut index d19d88ee..bb03f1f5 100644 --- a/Northstar.CustomServers/mod/scripts/vscripts/mp/levels/mp_wargames.nut +++ b/Northstar.CustomServers/mod/scripts/vscripts/mp/levels/mp_wargames.nut @@ -31,8 +31,8 @@ void function CodeCallback_MapInit() ClassicMP_SetLevelIntro( WargamesIntroSetup, 20.0 ) // Load Frontier Defense Data - if(GameRules_GetGameMode()=="fd") - initFrontierDefenseData() + if( GameRules_GetGameMode() == "fd" ) + initFrontierDefenseData() } |