aboutsummaryrefslogtreecommitdiff
path: root/Northstar.CustomServers/mod/scripts/vscripts/gamemodes
diff options
context:
space:
mode:
authorWill Castro <39478251+VITALISED@users.noreply.github.com>2022-01-10 20:38:50 +1100
committerWill Castro <39478251+VITALISED@users.noreply.github.com>2022-01-10 20:38:50 +1100
commitaf2f675a13c1e82fc4900bd61aadc88facd4775a (patch)
treed2bb2463e38a91b74f6cafddcf5f7412959dc7fb /Northstar.CustomServers/mod/scripts/vscripts/gamemodes
parent62ff78cefebfb2c525adea2bd11deba664fc04f3 (diff)
downloadNorthstarMods-af2f675a13c1e82fc4900bd61aadc88facd4775a.tar.gz
NorthstarMods-af2f675a13c1e82fc4900bd61aadc88facd4775a.zip
Add assist medals and scoring
Diffstat (limited to 'Northstar.CustomServers/mod/scripts/vscripts/gamemodes')
-rw-r--r--Northstar.CustomServers/mod/scripts/vscripts/gamemodes/_gamemode_ps.nut11
-rw-r--r--Northstar.CustomServers/mod/scripts/vscripts/gamemodes/_gamemode_tdm.nut7
2 files changed, 16 insertions, 2 deletions
diff --git a/Northstar.CustomServers/mod/scripts/vscripts/gamemodes/_gamemode_ps.nut b/Northstar.CustomServers/mod/scripts/vscripts/gamemodes/_gamemode_ps.nut
index 4f05d87a5..965557b6f 100644
--- a/Northstar.CustomServers/mod/scripts/vscripts/gamemodes/_gamemode_ps.nut
+++ b/Northstar.CustomServers/mod/scripts/vscripts/gamemodes/_gamemode_ps.nut
@@ -32,13 +32,20 @@ void function GiveScoreForPlayerKill( entity victim, entity attacker, var damage
{
if ( victim != attacker && victim.IsPlayer() && attacker.IsPlayer() || GetGameState() != eGameState.Playing )
AddTeamScore( attacker.GetTeam(), 1 )
+
+ var existingAttackers = []
+ foreach(DamageHistoryStruct attackerInfo in victim.e.recentDamageHistory)
+ {
+ if( attackerInfo.attacker != attacker && !(attackerInfo.attacker in existingAttackers) )
+ attackerInfo.attacker.AddToPlayerGameStat( PGS_ASSISTS, 1 )
+ }
}
int function CheckScoreForDraw()
{
- if ( GameRules_GetTeamScore( TEAM_IMC ) > GameRules_GetTeamScore( TEAM_MILITIA ) )
+ if (GameRules_GetTeamScore(TEAM_IMC) > GameRules_GetTeamScore(TEAM_MILITIA))
return TEAM_IMC
- else if ( GameRules_GetTeamScore( TEAM_MILITIA ) > GameRules_GetTeamScore( TEAM_IMC ) )
+ else if (GameRules_GetTeamScore(TEAM_MILITIA) > GameRules_GetTeamScore(TEAM_IMC))
return TEAM_MILITIA
return TEAM_UNASSIGNED
diff --git a/Northstar.CustomServers/mod/scripts/vscripts/gamemodes/_gamemode_tdm.nut b/Northstar.CustomServers/mod/scripts/vscripts/gamemodes/_gamemode_tdm.nut
index ba1807900..3248d72ef 100644
--- a/Northstar.CustomServers/mod/scripts/vscripts/gamemodes/_gamemode_tdm.nut
+++ b/Northstar.CustomServers/mod/scripts/vscripts/gamemodes/_gamemode_tdm.nut
@@ -12,6 +12,13 @@ void function GiveScoreForPlayerKill( entity victim, entity attacker, var damage
{
if ( victim != attacker && victim.IsPlayer() && attacker.IsPlayer() || GetGameState() != eGameState.Playing )
AddTeamScore( attacker.GetTeam(), 1 )
+
+ var existingAttackers = []
+ foreach(DamageHistoryStruct attackerInfo in victim.e.recentDamageHistory)
+ {
+ if( attackerInfo.attacker != attacker && !(attackerInfo.attacker in existingAttackers) )
+ attackerInfo.attacker.AddToPlayerGameStat( PGS_ASSISTS, 1 )
+ }
}
void function RateSpawnpoints_Directional( int checkclass, array<entity> spawnpoints, int team, entity player )