aboutsummaryrefslogtreecommitdiff
path: root/Northstar.CustomServers/mod
diff options
context:
space:
mode:
Diffstat (limited to 'Northstar.CustomServers/mod')
-rw-r--r--Northstar.CustomServers/mod/scripts/vscripts/burnmeter/_burnmeter.gnut57
-rw-r--r--Northstar.CustomServers/mod/scripts/vscripts/earn_meter/sv_earn_meter_mp.gnut14
-rw-r--r--Northstar.CustomServers/mod/scripts/vscripts/gamemodes/_gamemode_fd.nut2
-rw-r--r--Northstar.CustomServers/mod/scripts/vscripts/gamemodes/_gamemode_speedball.nut16
-rw-r--r--Northstar.CustomServers/mod/scripts/vscripts/mp/levels/mp_wargames.nut16
5 files changed, 78 insertions, 27 deletions
diff --git a/Northstar.CustomServers/mod/scripts/vscripts/burnmeter/_burnmeter.gnut b/Northstar.CustomServers/mod/scripts/vscripts/burnmeter/_burnmeter.gnut
index 3eb6bda6..6d13c75b 100644
--- a/Northstar.CustomServers/mod/scripts/vscripts/burnmeter/_burnmeter.gnut
+++ b/Northstar.CustomServers/mod/scripts/vscripts/burnmeter/_burnmeter.gnut
@@ -34,13 +34,15 @@ void function BurnMeter_Init()
// setup burncard use funcs
BurnReward_GetByRef( "burnmeter_amped_weapons" ).rewardAvailableCallback = PlayerUsesAmpedWeaponsBurncard
BurnReward_GetByRef( "burnmeter_smart_pistol" ).rewardAvailableCallback = PlayerUsesSmartPistolBurncard
- BurnReward_GetByRef( "burnmeter_emergency_battery" ).rewardAvailableCallback = PlayerUsesBatteryBurncard
+ BurnReward_GetByRef( "burnmeter_emergency_battery" ).rewardAvailableCallback = Burnmeter_EmergencyBattery
BurnReward_GetByRef( "burnmeter_radar_jammer" ).rewardAvailableCallback = PlayerUsesRadarJammerBurncard
BurnReward_GetByRef( "burnmeter_maphack" ).rewardAvailableCallback = PlayerUsesMaphackBurncard
BurnReward_GetByRef( "burnmeter_phase_rewind" ).rewardAvailableCallback = PlayerUsesPhaseRewindBurncard
// these ones aren't so important, they're either for fd ( unsupported rn ) or unused
- //BurnReward_GetByRef( "burnmeter_harvester_shield" ).rewardAvailableCallback =
+ BurnReward_GetByRef( "burnmeter_harvester_shield" ).rewardAvailableCallback = PlayerUsesHarvesterShieldBurncard
+ BurnReward_GetByRef( "burnmeter_amped_weapons_permanent" ).rewardAvailableCallback = PlayerUsesPermanentAmpedWeaponsBurncard
+ BurnReward_GetByRef( "burnmeter_instant_battery" ).rewardAvailableCallback = Burnmeter_AmpedBattery
BurnReward_GetByRef( "burnmeter_rodeo_grenade" ).rewardAvailableCallback = PlayerUsesRodeoGrenadeBurncard
BurnReward_GetByRef( "burnmeter_nuke_titan" ).rewardAvailableCallback = PlayerUsesNukeTitanBurncard // unused in vanilla, fun though
@@ -185,9 +187,13 @@ void function PhaseRewindLifetime( entity player )
void function RunBurnCardUseFunc( entity player, string itemRef )
{
+ print( itemRef )
+
void functionref( entity ) ornull func = BurnReward_GetByRef( itemRef ).rewardAvailableCallback
if ( func != null )
( expect void functionref( entity ) ( func ) )( player )
+ else
+ print( "tried to call usefunc for burncard " + itemRef + ", but func did not exist!" )
}
void function UseBurnCardWeapon( entity weapon, entity player )
@@ -214,6 +220,19 @@ void function UseBurnCardWeaponInCriticalSection( entity weapon, entity ownerPla
void function BurnMeter_GiveRewardDirect( entity player, string itemRef )
{
+ BurnReward burncard = BurnReward_GetByRef( itemRef )
+
+ array<string> mods = [ "burn_card_weapon_mod" ]
+ if ( burncard.extraWeaponMod != "" )
+ mods.append( burncard.extraWeaponMod )
+
+ // ensure inventory slot isn't full to avoid crash
+ entity preexistingWeapon = player.GetOffhandWeapon( OFFHAND_INVENTORY )
+ if ( IsValid( preexistingWeapon ) )
+ player.TakeWeaponNow( preexistingWeapon.GetWeaponClassName() )
+
+ player.GiveOffhandWeapon( burncard.weaponName, OFFHAND_INVENTORY, mods )
+ Remote_CallFunction_Replay( player, "ServerCallback_RewardReadyMessage", player.s.respawnTime )
}
@@ -294,11 +313,6 @@ void function PlayerUsesSmartPistolBurncard( entity player )
// do we need to track the player losing smart pistol, then give their old weapon back? idk not implementing for now, check later
}
-void function PlayerUsesBatteryBurncard( entity player )
-{
- Rodeo_GiveBatteryToPlayer( player )
-}
-
void function PlayerUsesRadarJammerBurncard( entity player )
{
foreach ( entity otherPlayer in GetPlayerArray() )
@@ -425,6 +439,35 @@ void function PlayerUsesNukeBurncardThreaded( entity player )
PlayerEarnMeter_SetOwnedFrac( player, ownedFrac )
}
+void function PlayerUsesPermanentAmpedWeaponsBurncard( entity player )
+{
+ array<entity> weapons = player.GetMainWeapons()
+ //weapons.extend( player.GetOffhandWeapons() ) // idk? unsure of vanilla behaviour here
+ foreach ( entity weapon in weapons )
+ {
+ weapon.RemoveMod( "silencer" ) // both this and the burnmod will override firing fx, if a second one overrides this we crash
+ foreach ( string mod in GetWeaponBurnMods( weapon.GetWeaponClassName() ) )
+ {
+ // catch incompatibilities just in case
+ try
+ {
+ weapon.AddMod( mod )
+ }
+ catch( ex )
+ {
+ weapons.removebyvalue( weapon )
+ }
+ }
+
+ weapon.SetScriptFlags0( weapon.GetScriptFlags0() | WEAPONFLAG_AMPED )
+ }
+}
+
+void function PlayerUsesHarvesterShieldBurncard( entity player )
+{
+ player.SetPlayerNetInt( "numHarvesterShieldBoost", player.GetPlayerNetInt( "numHarvesterShieldBoost" ) + 1 )
+}
+
void function PlayerUsesRodeoGrenadeBurncard( entity player )
{
player.SetPlayerNetInt( "numSuperRodeoGrenades", player.GetPlayerNetInt( "numSuperRodeoGrenades" ) + 1 )
diff --git a/Northstar.CustomServers/mod/scripts/vscripts/earn_meter/sv_earn_meter_mp.gnut b/Northstar.CustomServers/mod/scripts/vscripts/earn_meter/sv_earn_meter_mp.gnut
index 6682807b..4c42a825 100644
--- a/Northstar.CustomServers/mod/scripts/vscripts/earn_meter/sv_earn_meter_mp.gnut
+++ b/Northstar.CustomServers/mod/scripts/vscripts/earn_meter/sv_earn_meter_mp.gnut
@@ -166,18 +166,8 @@ void function EarnMeterMP_BoostEarned( entity player )
while ( burncard.ref == "burnmeter_random_foil" )
burncard = BurnReward_GetRandom()
-
- array<string> mods = [ "burn_card_weapon_mod" ]
- if ( burncard.extraWeaponMod != "" )
- mods.append( burncard.extraWeaponMod )
-
- // ensure inventory slot isn't full to avoid crash
- entity preexistingWeapon = player.GetOffhandWeapon( OFFHAND_INVENTORY )
- if ( IsValid( preexistingWeapon ) )
- player.TakeWeaponNow( preexistingWeapon.GetWeaponClassName() )
-
- player.GiveOffhandWeapon( burncard.weaponName, OFFHAND_INVENTORY, mods )
- Remote_CallFunction_Replay( player, "ServerCallback_RewardReadyMessage", player.s.respawnTime )
+
+ BurnMeter_GiveRewardDirect( player, burncard.ref )
}
void function EarnMeterMP_TitanEarned( entity player )
diff --git a/Northstar.CustomServers/mod/scripts/vscripts/gamemodes/_gamemode_fd.nut b/Northstar.CustomServers/mod/scripts/vscripts/gamemodes/_gamemode_fd.nut
index b5f700e5..8a6b8bf0 100644
--- a/Northstar.CustomServers/mod/scripts/vscripts/gamemodes/_gamemode_fd.nut
+++ b/Northstar.CustomServers/mod/scripts/vscripts/gamemodes/_gamemode_fd.nut
@@ -3,7 +3,7 @@ global function RateSpawnpoints_FD
void function GamemodeFD_Init()
{
-
+ PrecacheModel( MODEL_ATTRITION_BANK )
}
void function RateSpawnpoints_FD(int _0, array<entity> _1, int _2, entity _3)
diff --git a/Northstar.CustomServers/mod/scripts/vscripts/gamemodes/_gamemode_speedball.nut b/Northstar.CustomServers/mod/scripts/vscripts/gamemodes/_gamemode_speedball.nut
index 3bc11c3a..974481c1 100644
--- a/Northstar.CustomServers/mod/scripts/vscripts/gamemodes/_gamemode_speedball.nut
+++ b/Northstar.CustomServers/mod/scripts/vscripts/gamemodes/_gamemode_speedball.nut
@@ -21,6 +21,7 @@ void function GamemodeSpeedball_Init()
AddSpawnCallbackEditorClass( "script_ref", "info_speedball_flag", CreateFlag )
+ AddCallback_GameStateEnter( eGameState.Prematch, CreateFlagIfNoFlagSpawnpoint )
AddCallback_GameStateEnter( eGameState.Playing, ResetFlag )
AddCallback_OnTouchHealthKit( "item_flag", OnFlagCollected )
AddCallback_OnPlayerKilled( OnPlayerKilled )
@@ -114,6 +115,21 @@ void function DropFlag()
file.flagCarrier = null
}
+void function CreateFlagIfNoFlagSpawnpoint()
+{
+ if ( IsValid( file.flag ) )
+ return
+
+ foreach ( entity hardpoint in GetEntArrayByClass_Expensive( "info_hardpoint" ) )
+ {
+ if ( hardpoint.kv.hardpointGroup == "B" )
+ {
+ CreateFlag( hardpoint )
+ return
+ }
+ }
+}
+
void function ResetFlag()
{
file.flag.ClearParent()
diff --git a/Northstar.CustomServers/mod/scripts/vscripts/mp/levels/mp_wargames.nut b/Northstar.CustomServers/mod/scripts/vscripts/mp/levels/mp_wargames.nut
index 92307f3c..11587947 100644
--- a/Northstar.CustomServers/mod/scripts/vscripts/mp/levels/mp_wargames.nut
+++ b/Northstar.CustomServers/mod/scripts/vscripts/mp/levels/mp_wargames.nut
@@ -104,7 +104,8 @@ void function OnPrematchStart()
entity militiaIon = CreatePropDynamic( $"models/titans/medium/titan_medium_ajax.mdl", < -1809.98, 2790.39, -1409 >, < 0, 80, 0 > )
thread PlayAnim( militiaIon, "at_titan_activation_wargames_intro" )
-
+ militiaIon.Anim_SetInitialTime( 4.5 )
+
entity militiaPilot = CreateElitePilot( TEAM_UNASSIGNED, < 0, 0, 0 >, < 0, 0, 0 > )
DispatchSpawn( militiaPilot )
militiaPilot.SetParent( militiaIon, "HIJACK" )
@@ -116,7 +117,6 @@ void function OnPrematchStart()
DispatchSpawn( militiaMarvinChillin )
thread PlayAnim( militiaMarvinChillin, "mv_idle_unarmed" )
-
// imc grunts
entity imcGrunt1 = CreatePropDynamic( $"models/humans/grunts/imc_grunt_rifle.mdl", < -2915, 2867, -1788 >, < 0, -137, 0 > )
thread PlayAnim( imcGrunt1, "pt_console_idle" )
@@ -188,6 +188,7 @@ void function PlayerWatchesWargamesIntro( entity player )
player.kv.VisibilityFlags = ENTITY_VISIBLE_TO_EVERYONE
ClearPlayerAnimViewEntity( player )
player.EnableWeaponViewModel()
+ DeployAndEnableWeapons(player)
player.ClearParent()
player.UnforceStand()
player.MovementEnable()
@@ -224,15 +225,16 @@ void function PlayerWatchesWargamesIntro( entity player )
player.kv.VisibilityFlags = ENTITY_VISIBLE_TO_OWNER
TrainingPod_ViewConeLock_PodClosed( player )
player.DisableWeaponViewModel()
+ HolsterAndDisableWeapons(player)
player.MovementDisable()
player.SetInvulnerable()
- // spawn faction leader
- // no clue why client subtracts 4.5 from the time we give this, so just add it here instead
- if ( factionTeam == TEAM_IMC )
- Remote_CallFunction_NonReplay( player, "ServerCallback_SpawnIMCFactionLeaderForIntro", file.introStartTime + 4.5, playerPod.GetEncodedEHandle() )
+ if ( factionTeam == TEAM_MILITIA && GetFactionChoice( player ) == "faction_marvin" )
+ Remote_CallFunction_NonReplay( player, "ServerCallback_SpawnMilitiaFactionLeaderForIntro", file.introStartTime, playerPod.GetEncodedEHandle() )
+ else if ( factionTeam == TEAM_MILITIA )
+ Remote_CallFunction_NonReplay( player, "ServerCallback_SpawnMilitiaFactionLeaderForIntro", file.introStartTime + 1.75, playerPod.GetEncodedEHandle() )
else
- Remote_CallFunction_NonReplay( player, "ServerCallback_SpawnMilitiaFactionLeaderForIntro", file.introStartTime + 4.5, playerPod.GetEncodedEHandle() )
+ Remote_CallFunction_NonReplay( player, "ServerCallback_SpawnIMCFactionLeaderForIntro", file.introStartTime + 4.5, playerPod.GetEncodedEHandle() )
// idle pod sequence
FirstPersonSequenceStruct podIdleSequence