summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: c146ab0)
raw | patch | inline | side by side (parent: c146ab0)
author | Stas'M <x86corez@gmail.com> | |
Mon, 24 Sep 2018 16:22:01 +0000 (19:22 +0300) | ||
committer | Stas'M <x86corez@gmail.com> | |
Mon, 24 Sep 2018 16:35:45 +0000 (19:35 +0300) |
src/game/g_game.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 c38572befa771c29a3d575d8ddcf940aaf6dadf6..1dcbcd26c457ddccc8378de1d3d437a0dc5f8d96 100644 (file)
--- a/src/game/g_game.pas
+++ b/src/game/g_game.pas
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_StartVote(Command, Initiator: string);
procedure g_Game_CheckVote;
procedure g_TakeScreenShot();
DE_GLOBEVENT = 0;
DE_BFGHIT = 1;
DE_KILLCOMBO = 2;
+ DE_BODYKILL = 3;
ANNOUNCE_NONE = 0;
ANNOUNCE_ME = 1;
gAnnouncer: Byte = ANNOUNCE_NONE;
goodsnd: array[0..3] of TPlayableSound;
killsnd: array[0..3] of TPlayableSound;
+ hahasnd: array[0..2] of TPlayableSound;
+ gBodyKillEvent: Integer = -1;
gDefInterTime: ShortInt = -1;
gInterEndTime: LongWord = 0;
gInterTime: LongWord = 0;
if g_Game_IsNet and g_Game_IsServer then
MH_SEND_GameEvent(NET_EV_KILLCOMBO, gDelayedEvents[a].DENum);
end;
+ DE_BODYKILL:
+ if gGameOn then
+ g_Game_Announce_BodyKill(gDelayedEvents[a].DENum);
end;
gDelayedEvents[a].Pending := False;
end;
g_Sound_CreateWADEx('SOUND_ANNOUNCER_KILL3X', GameWAD+':SOUNDS\KILL3X');
g_Sound_CreateWADEx('SOUND_ANNOUNCER_KILL4X', GameWAD+':SOUNDS\KILL4X');
g_Sound_CreateWADEx('SOUND_ANNOUNCER_KILLMX', GameWAD+':SOUNDS\KILLMX');
+ g_Sound_CreateWADEx('SOUND_ANNOUNCER_MUHAHA1', GameWAD+':SOUNDS\MUHAHA1');
+ g_Sound_CreateWADEx('SOUND_ANNOUNCER_MUHAHA2', GameWAD+':SOUNDS\MUHAHA2');
+ g_Sound_CreateWADEx('SOUND_ANNOUNCER_MUHAHA3', GameWAD+':SOUNDS\MUHAHA3');
goodsnd[0] := TPlayableSound.Create();
goodsnd[1] := TPlayableSound.Create();
killsnd[2].SetByName('SOUND_ANNOUNCER_KILL4X');
killsnd[3].SetByName('SOUND_ANNOUNCER_KILLMX');
+ hahasnd[0] := TPlayableSound.Create();
+ hahasnd[1] := TPlayableSound.Create();
+ hahasnd[2] := TPlayableSound.Create();
+
+ hahasnd[0].SetByName('SOUND_ANNOUNCER_MUHAHA1');
+ hahasnd[1].SetByName('SOUND_ANNOUNCER_MUHAHA2');
+ hahasnd[2].SetByName('SOUND_ANNOUNCER_MUHAHA3');
+
g_Game_LoadChatSounds(GameWAD+':CHATSND\SNDCFG');
g_Game_SetLoadingText(_lc[I_LOAD_ITEMS_DATA], 0, False);
g_Sound_Delete('SOUND_ANNOUNCER_KILL4X');
g_Sound_Delete('SOUND_ANNOUNCER_KILLMX');
+ hahasnd[0].Free();
+ hahasnd[1].Free();
+ hahasnd[2].Free();
+
+ g_Sound_Delete('SOUND_ANNOUNCER_MUHAHA1');
+ g_Sound_Delete('SOUND_ANNOUNCER_MUHAHA2');
+ g_Sound_Delete('SOUND_ANNOUNCER_MUHAHA3');
+
g_Game_FreeChatSounds();
DataLoaded := False;
killsnd[n].Play();
end;
+procedure g_Game_Announce_BodyKill(SpawnerUID: Word);
+var
+ a: Integer;
+begin
+ case gAnnouncer of
+ ANNOUNCE_NONE:
+ Exit;
+ ANNOUNCE_ME,
+ ANNOUNCE_MEPLUS:
+ if not g_Game_IsWatchedPlayer(SpawnerUID) then
+ Exit;
+ end;
+ for a := 0 to 2 do
+ if hahasnd[a].IsPlaying() then
+ Exit;
+
+ hahasnd[Random(3)].Play();
+end;
+
procedure g_Game_StartVote(Command, Initiator: string);
var
Need: Integer;
diff --git a/src/game/g_player.pas b/src/game/g_player.pas
index ca23ce315cc7f2009d858a527d208163a0693b47..c65d7206064025f82998691f1ada73203f575c7a 100644 (file)
--- a/src/game/g_player.pas
+++ b/src/game/g_player.pas
pm := g_PlayerModel_Get(FModelName);
pm.PlaySound(MODELSOUND_DIE, 5, FObj.X, FObj.Y);
pm.Free;
+
+ // Çëîâåùèé ñìåõ:
+ if (gBodyKillEvent <> -1)
+ and gDelayedEvents[gBodyKillEvent].Pending then
+ gDelayedEvents[gBodyKillEvent].Pending := False;
+ gBodyKillEvent := g_Game_DelayEvent(DE_BODYKILL, 1050, 0);
end;
end
else