DEADSOFTWARE

Player: Add blinking on low invisibility
authorbinarymaster <x86corez@gmail.com>
Tue, 7 Mar 2017 21:50:47 +0000 (00:50 +0300)
committerbinarymaster <x86corez@gmail.com>
Tue, 7 Mar 2017 21:50:47 +0000 (00:50 +0300)
src/game/g_player.pas

index a99e5b069ef21ba255f7f4a4e08b2fe6d1b38d3c..f2a98ff8aedc6f6f86c10b39ed904677955781fc 100644 (file)
@@ -2176,6 +2176,7 @@ procedure TPlayer.Draw();
 var
   ID: DWORD;
   w, h: Word;
+  dr: Boolean;
 begin
   if FLive then
   begin
@@ -2195,7 +2196,16 @@ begin
     begin
       if (gPlayerDrawn <> nil) and ((Self = gPlayerDrawn) or
          ((FTeam = gPlayerDrawn.Team) and (gGameSettings.GameMode <> GM_DM))) then
-        FModel.Draw(FObj.X, FObj.Y, 200)
+      begin
+        if (FMegaRulez[MR_INVIS] - gTime) <= 2100 then
+          dr := not Odd((FMegaRulez[MR_INVIS] - gTime) div 300)
+        else
+          dr := True;
+        if dr then
+          FModel.Draw(FObj.X, FObj.Y, 200)
+        else
+          FModel.Draw(FObj.X, FObj.Y);
+      end
       else
         FModel.Draw(FObj.X, FObj.Y, 254);
     end