DEADSOFTWARE

Game: Add secret notification
[d2df-sdl.git] / src / game / g_netmsg.pas
index a060162f5460e7f36908a324c9eb0853cd12de54..a7219124df1b26292b2d87aafaa4130125879e4e 100644 (file)
@@ -109,6 +109,7 @@ const
   NET_EV_LMS_DRAW     = 16;
   NET_EV_KILLCOMBO    = 17;
   NET_EV_PLAYER_TOUCH = 18;
+  NET_EV_SECRET       = 19;
 
   NET_VE_STARTED      = 1;
   NET_VE_PASSED       = 2;
@@ -1831,6 +1832,16 @@ begin
         pl.Touch();
     end;
 
+    NET_EV_SECRET:
+    begin
+      pl := g_Player_Get(EvNum);
+      if pl <> nil then
+      begin
+        g_Console_Add(Format(_lc[I_PLAYER_SECRET], [pl.Name]), True);
+        g_Sound_PlayEx('SOUND_GAME_SECRET');
+      end;
+    end;
+
   end;
 end;
 
@@ -2116,7 +2127,7 @@ function MC_RECV_PlayerStats(var M: TMsg): Word;
 var
   PID: Word;
   Pl: TPlayer;
-  I: Integer;
+  I, OldFire: Integer;
   OldJet, Flam: Boolean;
   NewTeam: Byte;
 begin
@@ -2192,7 +2203,10 @@ begin
     FNoRespawn := M.ReadByte() <> 0;
     OldJet := FJetpack;
     FJetpack := M.ReadByte() <> 0;
+    OldFire := FFireTime;
     FFireTime := M.ReadLongInt();
+    if (OldFire <= 0) and (FFireTime > 0) then
+      g_Sound_PlayExAt('SOUND_IGNITE', Obj.X, Obj.Y);
     Flam := M.ReadByte() <> 0;
     if OldJet and not FJetpack then
       JetpackOff
@@ -2632,7 +2646,7 @@ end;
 
 procedure MC_RECV_MonsterState(var M: TMsg);
 var
-  ID: Integer;
+  ID, OldFire: Integer;
   MState, MFAnm: Byte;
   Mon: TMonster;
   AnimRevert: Boolean;
@@ -2653,7 +2667,10 @@ begin
     MonsterAmmo := M.ReadLongInt();
     MonsterPain := M.ReadLongInt();
     AnimRevert := M.ReadByte() <> 0;
+    OldFire := FFireTime;
     FFireTime := M.ReadLongInt();
+    if (OldFire <= 0) and (FFireTime > 0) then
+      g_Sound_PlayExAt('SOUND_IGNITE', Obj.X, Obj.Y);
     RevertAnim(AnimRevert);
 
     if MonsterState <> MState then