aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Northstar.CustomServers/mod/scripts/vscripts/gamemodes/_gamemode_fd.nut30
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 )