summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 5d01abb)
raw | patch | inline | side by side (parent: 5d01abb)
author | TerminalHash <lyashuk.voxx@gmail.com> | |
Sun, 27 Aug 2023 23:14:42 +0000 (02:14 +0300) | ||
committer | TerminalHash <lyashuk.voxx@gmail.com> | |
Sun, 27 Aug 2023 23:14:42 +0000 (02:14 +0300) |
There is only a value in the table. How to handle certain types of deaths and events
(like <50 HP and kill by third player) needs to be thought about.
(like <50 HP and kill by third player) needs to be thought about.
src/game/g_game.pas | patch | blob | history | |
src/game/g_language.pas | patch | blob | history | |
src/game/g_netmsg.pas | patch | blob | history | |
src/game/g_player.pas | patch | blob | history |
diff --git a/src/game/g_game.pas b/src/game/g_game.pas
index 0cca55387e1b518016faab9f0925fbc2b88c2b41..6a8d63ca9f944573bc507dfa267677c89f19aa8e 100644 (file)
--- a/src/game/g_game.pas
+++ b/src/game/g_game.pas
begin
if a.Spectator then Result := 1
else if b.Spectator then Result := -1
- else if a.Frags < b.Frags then Result := 1
- else if a.Frags > b.Frags then Result := -1
- else if a.Deaths < b.Deaths then Result := -1
- else if a.Deaths > b.Deaths then Result := 1
- else if a.Kills < b.Kills then Result := -1
- else Result := 1;
+ else if a.Assists < b.Assists then Result := 1
+ else if a.Assists > b.Assists then Result := -1
+ else if a.Frags < b.Frags then Result := 1
+ else if a.Frags > b.Frags then Result := -1
+ else if a.Deaths < b.Deaths then Result := -1
+ else if a.Deaths > b.Deaths then Result := 1
+ else if a.Kills < b.Kills then Result := -1
+ else Result := 1;
end;
procedure SortGameStat(var stat: TPlayerStatArray);
WriteLn(s,
Format('mon_killed,mon_total,secrets_found,secrets_total' + LineEnding + '%d,%d,%d,%d',[gCoopMonstersKilled, gTotalMonsters, gCoopSecretsFound, gSecretsCount]));
// lines 3-...: team, player name, frags, deaths
- WriteLn(s, 'team,name,frags,deaths');
+ WriteLn(s, 'team,name,frags,assists,deaths');
for I := Low(Stat.PlayerStat) to High(Stat.PlayerStat) do
with Stat.PlayerStat[I] do
- WriteLn(s, Format('%d,%s,%d,%d', [Team, dquoteStr(Name), Frags, Deaths]));
+ WriteLn(s, Format('%d,%s,%d,%d', [Team, dquoteStr(Name), Frags, Assists, Deaths]));
except
g_Console_Add(Format(_lc[I_CONSOLE_ERROR_WRITE], [fname]));
end;
Num := a;
Name := gPlayers[a].Name;
Frags := gPlayers[a].Frags;
+ Assists := gPlayers[a].Assists;
Deaths := gPlayers[a].Death;
Kills := gPlayers[a].Kills;
Team := gPlayers[a].Team;
e_TextureFontPrintEx(x+w1+16, _y, Format(_lc[I_GAME_PING_MS], [Ping, Loss]), gStdFont, rr, gg, bb, 1);
// Ôðàãè
e_TextureFontPrintEx(x+w1+w2+16, _y, IntToStr(Frags), gStdFont, rr, gg, bb, 1);
+ // Àññèñòû
+ e_TextureFontPrintEx(x+w1+w2+48, _y, IntToStr(Assists), gStdFont, rr, gg, bb, 1);
// Ñìåðòè
e_TextureFontPrintEx(x+w1+w2+w3+16, _y, IntToStr(Deaths), gStdFont, rr, gg, bb, 1);
_y := _y+ch;
else
e_TextureFontPrintEx(x+16, _y, Name, gStdFont, rr, gg, bb, 1);
e_TextureFontPrintEx(x+w1+16, _y, IntToStr(Frags), gStdFont, rr, gg, bb, 1);
- e_TextureFontPrintEx(x+w1+w2+16, _y, IntToStr(Deaths), gStdFont, rr, gg, bb, 1);
+ e_TextureFontPrintEx(x+w1+w2+16, _y, IntToStr(Assists), gStdFont, rr, gg, bb, 1);
+ e_TextureFontPrintEx(x+w1+w2+w3+16, _y, IntToStr(Deaths), gStdFont, rr, gg, bb, 1);
_y := _y+24;
end;
if gGameSettings.GameMode = GM_COOP then
begin
gPlayers[i].Frags := 0;
+ gPlayers[i].Assists := 0;
gPlayers[i].RecallState;
end;
if (gPlayer1 = nil) and (gSpectLatchPID1 > 0) then
index 975360b21de44c10402b978f31baa6f56c055e3d..b3262a8997f203490b9a1e5f6fb1c862d95fb96c 100644 (file)
--- a/src/game/g_language.pas
+++ b/src/game/g_language.pas
I_GAME_PING_MS,
I_GAME_PING_HUD,
I_GAME_FRAGS,
+ I_GAME_ASSISTS,
I_GAME_DEATHS,
I_GAME_DM,
I_GAME_CTF,
'Ïèíã: '),
('GAME FRAGS', 'Frags',
'Ôðàãîâ'),
+ ('GAME ASSISTS', 'Assists',
+ 'Àññèñòîâ'),
('GAME DEATHS', 'Deaths',
'Ñìåðòåé'),
('GAME DM', 'Deathmatch',
diff --git a/src/game/g_netmsg.pas b/src/game/g_netmsg.pas
index b090aa30e08bdb690b645389cd73d22cfd6a9549..9b8214ca0f8803ac1f06236ed410bffea5a14b2a 100644 (file)
--- a/src/game/g_netmsg.pas
+++ b/src/game/g_netmsg.pas
NetOut.Write(Byte(R_BERSERK in FRulez));
NetOut.Write(Frags);
+ NetOut.Write(Assists);
NetOut.Write(Death);
NetOut.Write(CurrWeap);
FRulez := FRulez + [R_BERSERK];
Frags := M.ReadLongInt();
+ Assists := M.ReadLongInt();
Death := M.ReadLongInt();
SetWeapon(M.ReadByte());
diff --git a/src/game/g_player.pas b/src/game/g_player.pas
index d0275d093fca62244370f201ff0cabb68bcb98f8..c903d13b0a780cc97c993011d746ba58be2be061 100644 (file)
--- a/src/game/g_player.pas
+++ b/src/game/g_player.pas
Name: String;
Team: Byte;
Frags: SmallInt;
+ Assists: SmallInt;
Deaths: SmallInt;
Lives: Byte;
Kills: Word;
FKills: Integer;
FMonsterKills: Integer;
FFrags: Integer;
+ FAssists: Integer;
FFragCombo: Byte;
FLastFrag: LongWord;
FComboEvnt: Integer;
property Air: Integer read FAir write FAir;
property JetFuel: Integer read FJetFuel write FJetFuel;
property Frags: Integer read FFrags write FFrags;
+ property Assists: Integer read FAssists write FAssists;
property Death: Integer read FDeath write FDeath;
property Kills: Integer read FKills write FKills;
property CurrWeap: Byte read FCurrWeap write FCurrWeap;
property eAir: Integer read FAir write FAir;
property eJetFuel: Integer read FJetFuel write FJetFuel;
property eFrags: Integer read FFrags write FFrags;
+ property eAssists: Integer read FAssists write FAssists;
property eDeath: Integer read FDeath write FDeath;
property eKills: Integer read FKills write FKills;
property eCurrWeap: Byte read FCurrWeap write FCurrWeap;
Name := gPlayers[a].FName;
Team := gPlayers[a].FTeam;
Frags := gPlayers[a].FFrags;
+ Assists := gPlayers[a].FAssists;
Deaths := gPlayers[a].FDeath;
Kills := gPlayers[a].FKills;
Color := gPlayers[a].FModel.Color;
X, Y, SY, a, p, m: Integer;
tw, th: Word;
cw, ch: Byte;
- s: string;
+ s, t: string;
stat: TPlayerStatArray;
begin
X := gPlayerScreenSize.X;
if gShowStat then
begin
s := IntToStr(Frags);
+ t := IntToStr(Assists);
e_CharFont_GetSize(gMenuFont, s, tw, th);
e_CharFont_PrintEx(gMenuFont, X-16-tw, Y, s, _RGB(255, 0, 0));
s := '';
+ t := '';
p := 1;
m := 0;
stat := g_Player_GetStats();
if Frags >= m then s := s+'+' else s := s+'-';
s := s+IntToStr(Abs(Frags-m));
+ t := IntToStr(p)+' / '+IntToStr(Length(stat))+' ';
+ if Assists >= m then t := t+'+' else t := t+'-';
+ t := t+IntToStr(Abs(Assists-m));
+
e_CharFont_GetSize(gMenuSmallFont, s, tw, th);
e_CharFont_PrintEx(gMenuSmallFont, X-16-tw, Y+32, s, _RGB(255, 0, 0));
end;
plr: TPlayer;
srv, netsrv: Boolean;
DoFrags: Boolean;
+ DoAssists: Boolean;
OldLR: Byte;
KP: TPlayer;
it: PItem;
begin
DoFrags := (gGameSettings.MaxLives = 0) or (gGameSettings.GameMode = GM_COOP);
+ DoAssists := (gGameSettings.GameMode = GM_TDM) or (gGameSettings.GameMode = GM_CTF);
Srv := g_Game_IsServer;
Netsrv := g_Game_IsServer and g_Game_IsNet;
if Srv then FDeath := FDeath + 1;
KP.FragCombo();
end;
+ // Assists block
+ if (DoAssists or (gGameSettings.GameMode = GM_TDM)) then
+ begin
+ if a = 4 then
+ begin
+ Inc(KP.FAssists);
+ end;
+ end;
+
if (gGameSettings.GameMode = GM_TDM) and DoFrags then
Inc(gTeamStat[KP.Team].Score,
IfThen(SameTeam(FUID, SpawnerUID), -1, 1));
FNoTarget := False;
FNoReload := False;
FFrags := 0;
+ FAssists := 0;
FLastFrag := 0;
FComboEvnt := -1;
FKills := 0;
utils.writeInt(st, LongInt(FMonsterKills));
// Ôðàãîâ
utils.writeInt(st, LongInt(FFrags));
+ // Àññèñòîâ
+ utils.writeInt(st, LongInt(FAssists));
// Ôðàãîâ ïîäðÿä
utils.writeInt(st, Byte(FFragCombo));
// Âðåìÿ ïîñëåäíåãî ôðàãà
FMonsterKills := utils.readLongInt(st);
// Ôðàãîâ
FFrags := utils.readLongInt(st);
+ // Àññèñòîâ
+ FAssists := utils.readLongInt(st);
// Ôðàãîâ ïîäðÿä
FFragCombo := utils.readByte(st);
// Âðåìÿ ïîñëåäíåãî ôðàãà