X-Git-Url: https://deadsoftware.ru/gitweb?a=blobdiff_plain;f=src%2Fgame%2Fg_game.pas;h=6a8d63ca9f944573bc507dfa267677c89f19aa8e;hb=46340979eb07041ef9b30fc62e84cabce72d4901;hp=2c158c4e2335c16dfa78df2323cd49f44b5677a6;hpb=86f970455d280f4e01f49bc5940222a805875425;p=d2df-sdl.git diff --git a/src/game/g_game.pas b/src/game/g_game.pas index 2c158c4..6a8d63c 100644 --- a/src/game/g_game.pas +++ b/src/game/g_game.pas @@ -131,6 +131,7 @@ procedure g_Game_ChatSound(Text: String; Taunt: Boolean = True); procedure g_Game_Announce_GoodShot(SpawnerUID: Word); procedure g_Game_Announce_KillCombo(Param: Integer); procedure g_Game_Announce_BodyKill(SpawnerUID: Word); +procedure g_Game_Effect_Bubbles(fX, fY: Integer; count: Word; devX, devY: Byte; Silent: Boolean = False); procedure g_Game_StartVote(Command, Initiator: string); procedure g_Game_CheckVote; procedure g_TakeScreenShot(Filename: string = ''); @@ -640,12 +641,14 @@ function Compare(a, b: TPlayerStat): Integer; 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); @@ -667,7 +670,7 @@ end; // saves a shitty CSV containing the game stats passed to it procedure SaveGameStat(Stat: TEndCustomGameStat; Path: string); -var +var s: TextFile; dir, fname, map, mode, etime: String; I: Integer; @@ -709,16 +712,16 @@ begin // if it's a coop game: monsters killed, monsters total, secrets found, secrets total // otherwise nothing if Stat.GameMode in [GM_TDM, GM_CTF] then - WriteLn(s, + WriteLn(s, Format('red_score,blue_score' + LineEnding + '%d,%d', [Stat.TeamStat[TEAM_RED].Score, Stat.TeamStat[TEAM_BLUE].Score])) else if Stat.GameMode in [GM_COOP, GM_SINGLE] then 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; @@ -1085,6 +1088,7 @@ begin 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; @@ -1339,6 +1343,8 @@ begin 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; @@ -2913,7 +2919,8 @@ begin 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; @@ -5381,6 +5388,7 @@ begin 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 @@ -5857,7 +5865,7 @@ begin // if someone has a higher score, set it to that instead gsScoreLimit := max(gsScoreLimit, b); gGameSettings.ScoreLimit := gsScoreLimit; - + if g_Game_IsNet then MH_SEND_GameSettings; end; end; @@ -6070,13 +6078,13 @@ begin 'p1_priority_kastet': begin if (Length(P) = 2) then - gPlayer1Settings.WeaponPreferences[WEAPON_KASTET] := EnsureRange(StrToIntDef(P[1], WP_FIRST), WP_FIRST, WP_LAST+1); + gPlayer1Settings.WeaponPreferences[WEAPON_KASTET] := EnsureRange(StrToIntDef(P[1], WP_FIRST), WP_FIRST, WP_LAST+1); end; 'p2_priority_kastet': begin if (Length(P) = 2) then - gPlayer2Settings.WeaponPreferences[WEAPON_KASTET] := EnsureRange(StrToIntDef(P[1], WP_FIRST), WP_FIRST, WP_LAST+1); - end; + gPlayer2Settings.WeaponPreferences[WEAPON_KASTET] := EnsureRange(StrToIntDef(P[1], WP_FIRST), WP_FIRST, WP_LAST+1); + end; 'p1_priority_saw': begin if (Length(P) = 2) then @@ -6090,13 +6098,13 @@ begin 'p1_priority_pistol': begin if (Length(P) = 2) then - gPlayer1Settings.WeaponPreferences[WEAPON_KASTET] := EnsureRange(StrToIntDef(P[1], WP_FIRST), WP_FIRST, WP_LAST+1); + gPlayer1Settings.WeaponPreferences[WEAPON_KASTET] := EnsureRange(StrToIntDef(P[1], WP_FIRST), WP_FIRST, WP_LAST+1); end; 'p2_priority_pistol': begin if (Length(P) = 2) then - gPlayer2Settings.WeaponPreferences[WEAPON_KASTET] := EnsureRange(StrToIntDef(P[1], WP_FIRST), WP_FIRST, WP_LAST+1); - end; + gPlayer2Settings.WeaponPreferences[WEAPON_KASTET] := EnsureRange(StrToIntDef(P[1], WP_FIRST), WP_FIRST, WP_LAST+1); + end; 'p1_priority_shotgun1': begin if (Length(P) = 2) then @@ -6176,17 +6184,17 @@ begin begin if (Length(P) = 2) then gPlayer2Settings.WeaponPreferences[WEAPON_FLAMETHROWER] := EnsureRange(StrToIntDef(P[1], WP_FIRST), WP_FIRST, WP_LAST+1); - end; + end; 'p1_priority_berserk': begin if (Length(P) = 2) then - gPlayer1Settings.WeaponPreferences[WP_LAST+1] := EnsureRange(StrToIntDef(P[1], WP_FIRST), WP_FIRST, WP_LAST+1); + gPlayer1Settings.WeaponPreferences[WP_LAST+1] := EnsureRange(StrToIntDef(P[1], WP_FIRST), WP_FIRST, WP_LAST+1); end; 'p2_priority_berserk': begin if (Length(P) = 2) then - gPlayer2Settings.WeaponPreferences[WP_LAST+1] := EnsureRange(StrToIntDef(P[1], WP_FIRST), WP_FIRST, WP_LAST+1); - end; + gPlayer2Settings.WeaponPreferences[WP_LAST+1] := EnsureRange(StrToIntDef(P[1], WP_FIRST), WP_FIRST, WP_LAST+1); + end; end; end; @@ -6952,7 +6960,7 @@ begin t := TEAM_RED else if P[2] = 'blue' then t := TEAM_BLUE - else + else t := TEAM_NONE; if Length(P) = 3 @@ -7850,7 +7858,7 @@ begin DateTimeToString(date, 'yyyy-mm-dd-hh-nn-ss', t); Filename := 'screenshot-' + date; end; - + name := e_CatPath(dir, Filename + '.png'); s := createDiskFile(name); try @@ -8202,6 +8210,14 @@ begin hahasnd[Random(3)].Play(); end; +procedure g_Game_Effect_Bubbles (fX, fY: Integer; count: Word; devX, devY: Byte; Silent: Boolean); +begin + g_GFX_Bubbles(fX, fY, count, devX, devY); + if not Silent then if Random(2) = 0 + then g_Sound_PlayExAt('SOUND_GAME_BUBBLE1', fX, fY) + else g_Sound_PlayExAt('SOUND_GAME_BUBBLE2', fX, fY); +end; + procedure g_Game_StartVote(Command, Initiator: string); var Need: Integer;