From f61ecb463a481d5547ddb34e794c901c099f2d83 Mon Sep 17 00:00:00 2001 From: BobTheBob <32057864+BobTheBob9@users.noreply.github.com> Date: Tue, 28 Dec 2021 17:49:07 +0000 Subject: dropship intro changes and fix for infinite amped weapons on disembark --- .../mod/scripts/vscripts/burnmeter/_burnmeter.gnut | 8 ++++++ .../vscripts/mp/_classic_mp_dropship_intro.gnut | 29 ++++++++++++++++------ 2 files changed, 30 insertions(+), 7 deletions(-) (limited to 'Northstar.CustomServers/mod') diff --git a/Northstar.CustomServers/mod/scripts/vscripts/burnmeter/_burnmeter.gnut b/Northstar.CustomServers/mod/scripts/vscripts/burnmeter/_burnmeter.gnut index 4be04643e..efaea76ff 100644 --- a/Northstar.CustomServers/mod/scripts/vscripts/burnmeter/_burnmeter.gnut +++ b/Northstar.CustomServers/mod/scripts/vscripts/burnmeter/_burnmeter.gnut @@ -49,6 +49,7 @@ void function BurnMeter_Init() AddCallback_OnClientConnected( InitBurncardsForLateJoiner ) AddCallback_OnPlayerRespawned( StartPhaseRewindLifetime ) + AddCallback_OnTitanBecomesPilot( RemoveAmpedWeaponsForTitanPilot ) // necessary signals RegisterSignal( "StopAmpedWeapons" ) @@ -263,6 +264,13 @@ void function PlayerUsesAmpedWeaponsBurncardThreaded( entity player ) } } +void function RemoveAmpedWeaponsForTitanPilot( entity player, entity titan ) +{ + foreach ( entity weapon in player.GetMainWeapons() ) + foreach ( string mod in GetWeaponBurnMods( weapon.GetWeaponClassName() ) ) + weapon.RemoveMod( mod ) +} + void function PlayerUsesSmartPistolBurncard( entity player ) { // take secondary weapon diff --git a/Northstar.CustomServers/mod/scripts/vscripts/mp/_classic_mp_dropship_intro.gnut b/Northstar.CustomServers/mod/scripts/vscripts/mp/_classic_mp_dropship_intro.gnut index 4f6a12914..78dec3d14 100644 --- a/Northstar.CustomServers/mod/scripts/vscripts/mp/_classic_mp_dropship_intro.gnut +++ b/Northstar.CustomServers/mod/scripts/vscripts/mp/_classic_mp_dropship_intro.gnut @@ -64,25 +64,40 @@ void function OnPrematchStart() // make 2 empty dropship structs per team IntroDropship emptyDropship - file.militiaDropships = [ clone emptyDropship, clone emptyDropship ] - file.imcDropships = [ clone emptyDropship, clone emptyDropship ] + file.militiaDropships.clear() + file.imcDropships.clear() - // spawn dropships - foreach ( entity dropshipSpawn in GetEntArrayByClass_Expensive( "info_spawnpoint_dropship_start" ) ) - { + array validDropshipSpawns + array dropshipSpawns = GetEntArrayByClass_Expensive( "info_spawnpoint_dropship_start" ) + foreach ( entity dropshipSpawn in dropshipSpawns ) + { if ( dropshipSpawn.HasKey( "gamemode_" + GetSpawnpointGamemodeOverride() ) ) if ( dropshipSpawn.kv[ "gamemode_" + GetSpawnpointGamemodeOverride() ] == "0" ) continue + + validDropshipSpawns.append( dropshipSpawn ) + } + + // if no dropship spawns for this mode, just allow any dropship spawns + if ( validDropshipSpawns.len() < 2 ) + validDropshipSpawns = dropshipSpawns + // spawn dropships + foreach ( entity dropshipSpawn in validDropshipSpawns ) + { // todo: possibly make this only spawn dropships if we've got enough players to need them int createTeam = HasSwitchedSides() ? dropshipSpawn.GetTeam() : GetOtherTeam( dropshipSpawn.GetTeam() ) array teamDropships = createTeam == TEAM_MILITIA ? file.militiaDropships : file.imcDropships - int dropshipIndex = !IsValid( teamDropships[ 0 ].dropship ) ? 0 : 1 + if ( teamDropships.len() >= 2 ) + continue + // create entity entity dropship = CreateDropship( createTeam, dropshipSpawn.GetOrigin(), dropshipSpawn.GetAngles() ) - teamDropships[ dropshipIndex ].dropship = dropship + teamDropships.append( clone emptyDropship ) + teamDropships[ teamDropships.len() - 1 ].dropship = dropship + AddAnimEvent( dropship, "dropship_warpout", WarpoutEffect ) dropship.SetValueForModelKey( $"models/vehicle/crow_dropship/crow_dropship_hero.mdl" ) dropship.SetModel( $"models/vehicle/crow_dropship/crow_dropship_hero.mdl" ) -- cgit v1.2.3