diff options
author | RoyalBlue1 <realEmail@veryRealURL.com> | 2022-08-01 15:46:37 +0200 |
---|---|---|
committer | RoyalBlue1 <realEmail@veryRealURL.com> | 2022-08-01 15:46:37 +0200 |
commit | 6a9d495d7b98dee746c076eac0c905a5c90de704 (patch) | |
tree | 1c5da15e547908130a476eca709aabdfb67051ee /Northstar.CustomServers/mod/scripts | |
parent | 4fc690438d1881da522d3375b36651c7946b23e4 (diff) | |
parent | ff279c0a1e36308c199f13f1edd93775ed79225a (diff) | |
download | NorthstarMods-6a9d495d7b98dee746c076eac0c905a5c90de704.tar.gz NorthstarMods-6a9d495d7b98dee746c076eac0c905a5c90de704.zip |
Merge remote-tracking branch 'upsteam/gamemode_fd' into gamemode_fd
Diffstat (limited to 'Northstar.CustomServers/mod/scripts')
-rw-r--r-- | Northstar.CustomServers/mod/scripts/vscripts/gamemodes/_gamemode_fd.nut | 30 |
1 files changed, 29 insertions, 1 deletions
diff --git a/Northstar.CustomServers/mod/scripts/vscripts/gamemodes/_gamemode_fd.nut b/Northstar.CustomServers/mod/scripts/vscripts/gamemodes/_gamemode_fd.nut index 4e62314b..6a0fdbef 100644 --- a/Northstar.CustomServers/mod/scripts/vscripts/gamemodes/_gamemode_fd.nut +++ b/Northstar.CustomServers/mod/scripts/vscripts/gamemodes/_gamemode_fd.nut @@ -120,6 +120,7 @@ void function GamemodeFD_Init() AddCallback_GameStateEnter( eGameState.Playing, startMainGameLoop ) AddCallback_OnRoundEndCleanup( FD_NPCCleanup ) AddCallback_OnClientConnected( GamemodeFD_InitPlayer ) + AddCallback_OnPlayerGetsNewPilotLoadout( FD_OnPlayerGetsNewPilotLoadout ) //Damage Callbacks AddDamageByCallback( "player", FD_DamageByPlayerCallback) @@ -158,7 +159,10 @@ void function FD_PlayerRespawnCallback( entity player ) { if( player in file.players ) file.players[player].lastRespawn = Time() - + + if( GetCurrentPlaylistVarInt( "fd_at_unlimited_ammo", 1 ) ) + FD_GivePlayerInfiniteAntiTitanAmmo( player ) + if ( !file.playersHaveTitans ) { // why in the fuck do i need to WaitFrame() here, this sucks @@ -190,6 +194,7 @@ void function FD_PlayerRespawnCallback( entity player ) file.playersInDropship.append( player ) } + void function PlayerEarnMeter_SetMode_Threaded( entity player, int mode ) { WaitFrame() @@ -197,6 +202,29 @@ void function PlayerEarnMeter_SetMode_Threaded( entity player, int mode ) PlayerEarnMeter_SetMode( player, mode ) } +void function FD_OnPlayerGetsNewPilotLoadout( entity player, PilotLoadoutDef loadout ) +{ + if( GetCurrentPlaylistVarInt( "fd_at_unlimited_ammo", 1 ) ) + FD_GivePlayerInfiniteAntiTitanAmmo( player ) +} + +void function FD_GivePlayerInfiniteAntiTitanAmmo( entity player ) +{ + array<entity> weapons = player.GetMainWeapons() + foreach ( entity weaponEnt in weapons ) + { + if ( weaponEnt.GetWeaponType() != WT_ANTITITAN ) + continue + + if( !weaponEnt.HasMod( "at_unlimited_ammo" ) ) + { + array<string> mods = weaponEnt.GetMods() + mods.append( "at_unlimited_ammo" ) + weaponEnt.SetMods( mods ) + } + } +} + void function FD_TeamReserveDepositOrWithdrawCallback( entity player, string action, int amount ) { switch( action ) |