aboutsummaryrefslogtreecommitdiff
path: root/Northstar.CustomServers/mod/scripts
diff options
context:
space:
mode:
Diffstat (limited to 'Northstar.CustomServers/mod/scripts')
-rw-r--r--Northstar.CustomServers/mod/scripts/vscripts/gamemodes/_gamemode_mfd.nut59
-rw-r--r--Northstar.CustomServers/mod/scripts/vscripts/mp/_classic_mp_dropship_intro.gnut5
-rw-r--r--Northstar.CustomServers/mod/scripts/vscripts/mp/_score.nut4
3 files changed, 40 insertions, 28 deletions
diff --git a/Northstar.CustomServers/mod/scripts/vscripts/gamemodes/_gamemode_mfd.nut b/Northstar.CustomServers/mod/scripts/vscripts/gamemodes/_gamemode_mfd.nut
index 9d5dbd24..1c776ede 100644
--- a/Northstar.CustomServers/mod/scripts/vscripts/gamemodes/_gamemode_mfd.nut
+++ b/Northstar.CustomServers/mod/scripts/vscripts/gamemodes/_gamemode_mfd.nut
@@ -24,11 +24,17 @@ void function GamemodeMfd_Init()
SetShouldUseRoundWinningKillReplay( true )
Riff_ForceSetEliminationMode( eEliminationMode.Pilots )
}
-
+
+ AddCallback_OnClientConnected( SetupMFDPlayer )
AddCallback_OnPlayerKilled( UpdateMarksForKill )
AddCallback_GameStateEnter( eGameState.Playing, CreateInitialMarks )
}
+void function SetupMFDPlayer( entity player )
+{
+ player.s.roundsSincePicked <- 0
+}
+
void function CreateInitialMarks()
{
entity imcMark = CreateEntity( MARKER_ENT_CLASSNAME )
@@ -75,32 +81,11 @@ void function MFDThink()
wait MFD_BETWEEN_MARKS_TIME
// wait for enough players to spawn
- array<entity> imcPlayers
- array<entity> militiaPlayers
- while ( imcPlayers.len() == 0 || militiaPlayers.len() == 0 )
- {
- imcPlayers = GetPlayerArrayOfTeam( TEAM_IMC )
- militiaPlayers = GetPlayerArrayOfTeam( TEAM_MILITIA )
-
+ while ( GetPlayerArrayOfTeam( TEAM_IMC ).len() == 0 || GetPlayerArrayOfTeam( TEAM_MILITIA ).len() == 0 )
WaitFrame()
- }
- // get marks, wanna increment the mark each mark, reset on player change
- int imcIndex = imcPlayers.find( imcMark )
- if ( imcIndex == -1 ) // last mark
- imcIndex = 0
- else
- imcIndex = ( imcIndex + 1 ) % imcPlayers.len()
-
- imcMark = imcPlayers[ imcIndex ]
-
- int militiaIndex = militiaPlayers.find( imcMark )
- if ( militiaIndex == -1 ) // last mark
- militiaIndex = 0
- else
- militiaIndex = ( militiaIndex + 1 ) % militiaPlayers.len()
-
- militiaMark = militiaPlayers[ militiaIndex ]
+ imcMark = PickTeamMark( TEAM_IMC )
+ militiaMark = PickTeamMark( TEAM_MILITIA )
level.mfdPendingMarkedPlayerEnt[ TEAM_IMC ].SetOwner( imcMark )
level.mfdPendingMarkedPlayerEnt[ TEAM_MILITIA ].SetOwner( militiaMark )
@@ -132,6 +117,30 @@ void function MFDThink()
}
}
+entity function PickTeamMark( int team )
+{
+ array<entity> possibleMarks
+
+ int maxRounds
+ foreach ( entity player in GetPlayerArrayOfTeam( team ) )
+ {
+ if ( maxRounds < player.s.roundsSincePicked )
+ {
+ maxRounds = expect int( player.s.roundsSincePicked )
+ possibleMarks = [ player ]
+ }
+ else if ( maxRounds == player.s.roundsSincePicked )
+ possibleMarks.append( player )
+ }
+
+ entity mark = possibleMarks.getrandom()
+ foreach ( entity player in GetPlayerArrayOfTeam( team ) )
+ if ( player != mark )
+ player.s.roundsSincePicked++
+
+ return mark
+}
+
void function MarkPlayers( entity imcMark, entity militiaMark )
{
imcMark.EndSignal( "OnDestroy" )
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 1e6d8271..fdcc468c 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
@@ -70,8 +70,9 @@ void function OnPrematchStart()
// spawn dropships
foreach ( entity dropshipSpawn in GetEntArrayByClass_Expensive( "info_spawnpoint_dropship_start" ) )
{
- if ( GameModeRemove( dropshipSpawn ) || ( GetSpawnpointGamemodeOverride() != GAMETYPE && dropshipSpawn.HasKey( "gamemode_" + GetSpawnpointGamemodeOverride() ) && dropshipSpawn.kv[ "gamemode_" + GetSpawnpointGamemodeOverride() ] == "0" ) )
- continue
+ if ( dropshipSpawn.HasKey( "gamemode_" + GetSpawnpointGamemodeOverride() ) )
+ if ( dropshipSpawn.kv[ "gamemode_" + GetSpawnpointGamemodeOverride() ] == "0" )
+ continue
// todo: possibly make this only spawn dropships if we've got enough players to need them
int createTeam = HasSwitchedSides() ? dropshipSpawn.GetTeam() : GetOtherTeam( dropshipSpawn.GetTeam() )
diff --git a/Northstar.CustomServers/mod/scripts/vscripts/mp/_score.nut b/Northstar.CustomServers/mod/scripts/vscripts/mp/_score.nut
index e52c9142..108909a3 100644
--- a/Northstar.CustomServers/mod/scripts/vscripts/mp/_score.nut
+++ b/Northstar.CustomServers/mod/scripts/vscripts/mp/_score.nut
@@ -216,7 +216,9 @@ void function ScoreEvent_SetupEarnMeterValuesForMixedModes() // mixed modes in t
ScoreEvent_SetEarnMeterValues( "KillPilot", 0.7, 0.15 )
ScoreEvent_SetEarnMeterValues( "KillTitan", 0.0, 0.15 )
ScoreEvent_SetEarnMeterValues( "TitanKillTitan", 0.0, 0.0 ) // unsure
- ScoreEvent_SetEarnMeterValues( "PilotBatteryStolen", 0.0, 0.35 )
+ ScoreEvent_SetEarnMeterValues( "PilotBatteryStolen", 0.0, 0.35 ) // this actually just doesn't have overdrive in vanilla even
+ ScoreEvent_SetEarnMeterValues( "Headshot", 0.0, 0.02 )
+ ScoreEvent_SetEarnMeterValues( "FirstStrike", 0.0, 0.05 )
// ai
ScoreEvent_SetEarnMeterValues( "KillGrunt", 0.0, 0.02, 0.5 )