diff options
author | zxcPandora <81985226+zxcPandora@users.noreply.github.com> | 2023-01-25 01:57:38 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-01-24 18:57:38 +0100 |
commit | e8a2e28b59c398821dc0ffb802ec26c385ed5172 (patch) | |
tree | 3d98ec4491202c6233e03ad24552ce46a4493a78 /Northstar.CustomServers/mod | |
parent | 540e4e51957652d542095e6eed27c442fad1eeaa (diff) | |
download | NorthstarMods-e8a2e28b59c398821dc0ffb802ec26c385ed5172.tar.gz NorthstarMods-e8a2e28b59c398821dc0ffb802ec26c385ed5172.zip |
[FD]New features and bug fix (#566)
* Correction of variable type
Correction of variable type
* weapon type check
idk why Respawn use weapon.GetWeaponType(),it doesn't work for actually anti-titan weapon.(Because they didn't have this key value)
* fix wrong reaper icon
fix wrong reaper icon
* Show store in the minimap during buy time
Show store in the minimap during buy time
* ping store test
ping store test
* Add missing event and correct error event
Add missing event and correct error event
* Add turret repair tip
Add turret repair tip
* Add wave restart event
Add wave restart event
* fix bug
return when titan can get heal without battery.
Example:Vanguard
* Track entity deployed by player
1.Track entity deployed by player
2.Destroy player deployed entity this round after wave lost
3.Don't destroy those entities not deployed in this round
* use untyped
use untyped
* update for #565
update for #565
Diffstat (limited to 'Northstar.CustomServers/mod')
-rw-r--r-- | Northstar.CustomServers/mod/scripts/vscripts/ai/_ai_turret.gnut | 9 | ||||
-rw-r--r-- | Northstar.CustomServers/mod/scripts/vscripts/gamemodes/_gamemode_fd.nut | 74 |
2 files changed, 81 insertions, 2 deletions
diff --git a/Northstar.CustomServers/mod/scripts/vscripts/ai/_ai_turret.gnut b/Northstar.CustomServers/mod/scripts/vscripts/ai/_ai_turret.gnut index 5961d839..90f0b4b2 100644 --- a/Northstar.CustomServers/mod/scripts/vscripts/ai/_ai_turret.gnut +++ b/Northstar.CustomServers/mod/scripts/vscripts/ai/_ai_turret.gnut @@ -43,6 +43,13 @@ void function RevivableTurret_DamageCallback( entity turret, var damageInfo ) function RevivableTurret_UseFunction( player , turret ) { entity tur = expect entity( turret ) + entity ent = expect entity( player ) + entity owner = tur.GetBossPlayer() + if( ent != owner ) + { + int ownerEHandle = owner.GetEncodedEHandle() + MessageToTeam( TEAM_MILITIA,eEventNotifications.FD_TurretRepair, null, ent, ownerEHandle ) + } thread RevivableTurret_Revive( tur ) return true } @@ -68,4 +75,4 @@ void function RevivableTurret_Kill( entity turret ) wait 1 turret.SetNoTarget( true ) turret.DisableTurret() -}
\ No newline at end of file +} diff --git a/Northstar.CustomServers/mod/scripts/vscripts/gamemodes/_gamemode_fd.nut b/Northstar.CustomServers/mod/scripts/vscripts/gamemodes/_gamemode_fd.nut index e8bc0966..2ea75d0a 100644 --- a/Northstar.CustomServers/mod/scripts/vscripts/gamemodes/_gamemode_fd.nut +++ b/Northstar.CustomServers/mod/scripts/vscripts/gamemodes/_gamemode_fd.nut @@ -1,3 +1,5 @@ +untyped + global function GamemodeFD_Init global function RateSpawnpoints_FD global function startHarvester @@ -22,6 +24,8 @@ enum eDropshipState{ struct player_struct_fd{ bool diedThisRound int scoreThisRound + int moneyThisRound + array< entity > deployedEntityThisRound /* int totalMVPs int mortarUnitsKilled @@ -67,6 +71,7 @@ struct { table<entity, table<string, float> > playerAwardStats entity harvester_info bool playersHaveTitans = false + bool waveRestart = false string animationOverride = "" int dropshipState @@ -324,6 +329,18 @@ void function GamemodeFD_InitPlayer( entity player ) } // unfortunate that i cant seem to find a nice callback for them exiting that menu but thisll have to do thread TryDisableTitanSelectionForPlayerAfterDelay( player, TEAM_TITAN_SELECT_DURATION_MIDGAME ) + thread TrackDeployedArcTrapThisRound( player ) +} + +void function TrackDeployedArcTrapThisRound( entity player ) +{ + player.EndSignal( "OnDestroy" ) + while( IsValid( player ) ) + { + entity ArcTrap = expect entity ( player.WaitSignal( "DeployArcTrap" ).projectile ) + file.players[ player ].deployedEntityThisRound.append( ArcTrap ) + AddEntityDestroyedCallback( ArcTrap, FD_OnEntityDestroyed ) + } } void function TryDisableTitanSelectionForPlayerAfterDelay( entity player, float waitAmount ) @@ -444,7 +461,7 @@ bool function useShieldBoost( entity player, array<string> args ) { fd_harvester.harvester.SetShieldHealth( fd_harvester.harvester.GetShieldHealthMax() ) SetGlobalNetTime( "FD_harvesterInvulTime", Time() + 5 ) - MessageToTeam( TEAM_MILITIA,eEventNotifications.FD_PlayerHealedHarvester, null, player ) + MessageToTeam( TEAM_MILITIA,eEventNotifications.FD_PlayerBoostedHarvesterShield, null, player ) player.SetPlayerNetInt( "numHarvesterShieldBoost", player.GetPlayerNetInt( "numHarvesterShieldBoost" ) - 1 ) file.playerAwardStats[player]["harvesterHeals"]++ } @@ -467,6 +484,19 @@ void function mainGameLoop() bool showShop = false for( int i = GetGlobalNetInt( "FD_currentWave" ); i < waveEvents.len(); i++ ) { + if( file.waveRestart ) + { + showShop = true + foreach( entity player in GetPlayerArray() ) + { + SetMoneyForPlayer( player, file.players[player].moneyThisRound ) + player.SetPlayerNetInt( "numHarvesterShieldBoost", 0 ) + player.SetPlayerNetInt( "numSuperRodeoGrenades", 0 ) + PlayerInventory_TakeAllInventoryItems( player ) + } + SetGlobalNetTime( "FD_nextWaveStartTime", Time() + 75 ) + } + if( !runWave( i, showShop ) ) break @@ -648,6 +678,8 @@ bool function runWave( int waveIndex, bool shouldDoBuyTime ) { file.players[player].diedThisRound = false file.players[player].scoreThisRound = 0 + file.players[player].moneyThisRound = GetPlayerMoney( player ) + file.players[ player ].deployedEntityThisRound = [] } array<int> enemys = getHighestEnemyAmountsForWave( waveIndex ) @@ -655,6 +687,11 @@ bool function runWave( int waveIndex, bool shouldDoBuyTime ) { 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( file.waveRestart ) + { + file.waveRestart = false + MessageToTeam( TEAM_MILITIA,eEventNotifications.FD_WaveRestart ) + } if( shouldDoBuyTime ) { SetGlobalNetInt( "FD_waveState", WAVE_STATE_BREAK ) @@ -731,6 +768,8 @@ bool function runWave( int waveIndex, bool shouldDoBuyTime ) FD_DecrementRestarts() else SetRoundBased(false) + + file.waveRestart = true //wave restart point SetWinner( TEAM_IMC )//restart round spawnedNPCs = [] // reset npcs count restetWaveEvents() @@ -919,6 +958,9 @@ void function FD_SmokeHealTeammate( entity player, entity target, int shieldRest void function FD_BatteryHealTeammate( entity battery, entity titan, int shieldRestoreAmount, int healthRestoreAmount ) { + if( !IsValid( battery ) ) + return + entity BatteryParent = battery.GetParent() entity TargetTitan int currentHeal @@ -1159,9 +1201,23 @@ void function OnHarvesterDamaged( entity harvester, var damageInfo ) void function FD_NPCCleanup() { + foreach( entity player in GetPlayerArray() ) + { + foreach ( entity ent in file.players[ player ].deployedEntityThisRound ) + { + if ( IsValid( ent ) ) + ent.Destroy() + } + } foreach ( entity npc in GetEntArrayByClass_Expensive( "C_AI_BaseNPC" ) ) + { + entity BossPlayer = npc.GetBossPlayer() + if( IsValidPlayer( BossPlayer ) && !file.players[ BossPlayer ].deployedEntityThisRound.contains( npc ) ) + continue + if ( IsValid( npc ) ) npc.Destroy() + } } void function HarvesterThink() @@ -1516,7 +1572,10 @@ void function CheckLastPlayerReady() bool function ClientCommandCallbackToggleReady( entity player, array<string> args ) { if( args[0] == "true" ) + { player.SetPlayerNetBool( "FD_readyForNextWave", true ) + MessageToTeam( TEAM_MILITIA,eEventNotifications.FD_PlayerReady, null, player ) + } if( args[0] == "false" ) player.SetPlayerNetBool( "FD_readyForNextWave", false ) @@ -1672,6 +1731,19 @@ void function AddTurretSentry( entity turret ) turret.Minimap_AlwaysShow( TEAM_MILITIA, null ) turret.Minimap_SetHeightTracking( true ) turret.Minimap_SetCustomState( eMinimapObject_npc.FD_TURRET ) + entity player = turret.GetBossPlayer() + file.players[ player ].deployedEntityThisRound.append( turret ) + AddEntityDestroyedCallback( turret, FD_OnEntityDestroyed ) +} + +function FD_OnEntityDestroyed( ent ) +{ + expect entity( ent ) + + Assert( ent.IsValidInternal() ) + entity player = IsTurret( ent ) ? ent.GetBossPlayer() : ent.GetOwner() + if( file.players[ player ].deployedEntityThisRound.contains( ent ) ) + file.players[ player ].deployedEntityThisRound.fastremovebyvalue( ent ) } void function DisableTitanSelection() |