aboutsummaryrefslogtreecommitdiff
path: root/Northstar.CustomServers
diff options
context:
space:
mode:
Diffstat (limited to 'Northstar.CustomServers')
-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 f177f1ca..674d08df 100644
--- a/Northstar.CustomServers/mod/scripts/vscripts/gamemodes/_gamemode_fd.nut
+++ b/Northstar.CustomServers/mod/scripts/vscripts/gamemodes/_gamemode_fd.nut
@@ -73,6 +73,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)
@@ -111,7 +112,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
@@ -119,6 +123,7 @@ void function FD_PlayerRespawnCallback( entity player )
}
}
+
void function PlayerEarnMeter_SetMode_Threaded( entity player, int mode )
{
WaitFrame()
@@ -126,6 +131,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 )