From b03a912682a572b6b3b9e341f8662f2c62e020e7 Mon Sep 17 00:00:00 2001 From: Tim Goll Date: Mon, 3 Jun 2024 10:02:46 +0200 Subject: [PATCH] Corpse: On Fire Feedback (#1551) - added "corpse on fire" to targetID when looking at a corpse - moved the warning message when trying to inspect from chat to mstack - allow spectators to look at burning corpses - cleanup of missing `IsPlayerRagdoll` calls --- CHANGELOG.md | 2 ++ .../materials/vgui/ttt/tid/tid_onfire.vmt | 10 ++++++++++ .../materials/vgui/ttt/tid/tid_onfire.vtf | Bin 0 -> 5696 bytes gamemodes/terrortown/gamemode/client/cl_main.lua | 2 +- .../terrortown/gamemode/server/sv_corpse.lua | 4 ++-- lua/ttt2/libraries/targetid.lua | 10 +++++----- 6 files changed, 20 insertions(+), 8 deletions(-) create mode 100644 gamemodes/terrortown/content/materials/vgui/ttt/tid/tid_onfire.vmt create mode 100644 gamemodes/terrortown/content/materials/vgui/ttt/tid/tid_onfire.vtf diff --git a/CHANGELOG.md b/CHANGELOG.md index f5482e4b1d..5485ae1dd1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -63,6 +63,8 @@ All notable changes to TTT2 will be documented here. Inspired by [keep a changel - The level time now starts with the first preparing phase, meaning that idle on connect doesn't decrease the map time (by @TimGoll) - Minor cleanup and optimizations in weapon code (by @TW1STaL1CKY) - Now always properly checks if an entity is a true ragdoll to make sure no other props get ragdoll handling (by @TimGoll) +- Spectators are now able to look at corpses on fire (by @TimGoll) +- Corpses on fire display that information in targetID and MStack (by @TimGoll) ### Fixed diff --git a/gamemodes/terrortown/content/materials/vgui/ttt/tid/tid_onfire.vmt b/gamemodes/terrortown/content/materials/vgui/ttt/tid/tid_onfire.vmt new file mode 100644 index 0000000000..d36b930c80 --- /dev/null +++ b/gamemodes/terrortown/content/materials/vgui/ttt/tid/tid_onfire.vmt @@ -0,0 +1,10 @@ +"UnlitGeneric" +{ + "$basetexture" "vgui/ttt/tid/tid_onfire" + "$nocull" 1 + "$nodecal" 1 + "$nolod" 1 + "$translucent" 1 + "$vertexalpha" 1 + "$vertexcolor" 1 +} diff --git a/gamemodes/terrortown/content/materials/vgui/ttt/tid/tid_onfire.vtf b/gamemodes/terrortown/content/materials/vgui/ttt/tid/tid_onfire.vtf new file mode 100644 index 0000000000000000000000000000000000000000..9fbec9261074ed0dc7c6e1e807b249cbe78b7da0 GIT binary patch literal 5696 zcmdT|eQZ-z6u+;p?OMi034MqzxFQ`0jyM#CO32D0ALX-<_t@mi0V4`=TMb_V5|%k6 zCQ1ilf`ZKO4^bTBYfUDRRml)d1QP-dD;(S7voc+Pu!9dsny7!bHidw1Tw z_nhirhSwLxhZ|HkBY%BizPfw8Nx4m zAYuFYwvCktqYZ)JcvG6_a%<1iPcU}2qavEU+;&*%6^BTB=^?&KOT=EhbBf+~Jf zqt5LwmX8CdJVegF$(-9l=0e}vQz|cGOHO$pREfw{eumeSHC&(BngXEmbeVJBwJ)7* zCx3`9S!dqP%ms|}6K`-v4G93DW(=+>p~Z1k=FgSh;ZthjNG3ixxkh)?o285suP>CM zY1uOxK;;)wXTEP(W3s^z!;37@?~#8a zS(=lc(b@X$j@yx6yK|d<0OlR0r7#U9Rt=f5%?_X+Wae}X;+QT25dx&2aA2Q7^Jng{ z5k5&;GpW1we!}(t{{G_N`PUfxDxuuTf=pLe;R#WEMjOnW76;61B_i!|K#^@1S0t6) zy)9Q_{%zLBMnAX3o8>otP(J_KAd@7mo!Xf{pzGUj)P&a)E79Jf6&Vg8x3LW5Lgf4O zdXD3jI3vvV{v3-X+yJzLuy<Rc=XO1YK=Ws7%YTOzb?6_}DBh0t z4h;0q`W)kvCW`%-vjF33x1fCi^A}d*B%Pb^MDR=2I@;^ZAE;KA*|d1EA)JDT?1`e- zA^$BkjXABWvoDig9T$_(uD^|6#jCFPq59vy8k*u$D6Cu;gC9m0R&{yu8^ zQ4V!~srUrJQ-}MxiDHJ)!X~r7cpvs8JFp*KkMj>{e2C9HAI1ybWrG{Cs|lZAFx*o= z5iB;12dy{4uw54C_I!BD*@mXrQzdxj|bMb{J053}ga;#X&#Q0yBfjE`3EZfnCU3Bwv2vgMPNN`4y< zFwJ{VoV)rw`qsgL{>>W((0oyJS>z}&^^H$-K9U^{x~~%7?e-saeD#_4?_c2FsY+O$ zH&n6ja=A=5Fu#*?x}4u##jVY&<0k)@Kdl<;J6_kVdOd7ly%Bbp*Okn>&<=XUF71w84;?aP%mm5lQr7!l6LWSF=(Vc}vWA31EA-w)eg zxC9Unwc+|`ZFKF|_RoXz=+&YlQrtmdC)q>zR^!dRvac+3hGdrmGo**-iK*_YC)8Y~ z_(Q5fY)YQpou}LjaQnGhd-b(2j_xb!yVJwse%N(=;fV9-sMlVh^;XP}{wFtv;vt9* ztLI5~@$1HTv*Nt(9i{aW-Uo|sH5MXxY{Wiet<1+KGLwSWf%2?Njm6MX7#`Q=J+3}b zMZVO=Yx<)bQa$n?h4_rTW31>V)EC~9KSrfK5cIL1$YcLjeWKYT^g zX=tYRKjNXi?mo5hTJq9l)BHy6xuj23ieLA}8YEE@S_F!7iarpbhQ_h3&8q`On z$UfE2p4b26w)Zj8hp#UZt8Xg9-;-)o{XIYLddlZi&a zjm+=v%G}E2#eTdJkv#+Q@lrDshm1M%+V~K_Px<%w>P2h|mU?LEt>I;Npa6dcQqQBu zfVaE+=u6YH=e6-e31g~-(^r!-6~2hE^~cct^d)UFllEUgIc8~C9y-C-!tbJd?BV_9fAC(ha{vGU literal 0 HcmV?d00001 diff --git a/gamemodes/terrortown/gamemode/client/cl_main.lua b/gamemodes/terrortown/gamemode/client/cl_main.lua index 80124da4d2..29cc1a12ea 100644 --- a/gamemodes/terrortown/gamemode/client/cl_main.lua +++ b/gamemodes/terrortown/gamemode/client/cl_main.lua @@ -561,7 +561,7 @@ function GM:CleanUpMap() for i = 1, #ragdolls do local ent = ragdolls[i] - if not IsValid(ent) or CORPSE.GetPlayerNick(ent, "") == "" then + if not IsValid(ent) or not ent:IsPlayerRagdoll() then continue end diff --git a/gamemodes/terrortown/gamemode/server/sv_corpse.lua b/gamemodes/terrortown/gamemode/server/sv_corpse.lua index 7ae97fd7e7..b5d0271e8b 100644 --- a/gamemodes/terrortown/gamemode/server/sv_corpse.lua +++ b/gamemodes/terrortown/gamemode/server/sv_corpse.lua @@ -258,8 +258,8 @@ function CORPSE.ShowSearch(ply, rag, isCovert, isLongRange) end -- prevent search for anyone if the body is burning - if rag:IsOnFire() then - LANG.Msg(ply, "body_burning", nil, MSG_CHAT_WARN) + if rag:IsOnFire() and ply:IsTerror() then + LANG.Msg(ply, "body_burning", nil, MSG_MSTACK_WARN) return end diff --git a/lua/ttt2/libraries/targetid.lua b/lua/ttt2/libraries/targetid.lua index d4140c32a1..dd0468f938 100644 --- a/lua/ttt2/libraries/targetid.lua +++ b/lua/ttt2/libraries/targetid.lua @@ -35,6 +35,7 @@ local materialAutoClose = Material("vgui/ttt/tid/tid_auto_close") local materialDoor = Material("vgui/ttt/tid/tid_big_door") local materialDestructible = Material("vgui/ttt/tid/tid_destructible") local materialDNATargetID = Material("vgui/ttt/dnascanner/dna_hud") +local materialFire = Material("vgui/ttt/tid/tid_onfire") --- -- This function makes sure local variables, which use other libraries that are not yet initialized, are initialized later. @@ -514,11 +515,6 @@ function targetid.HUDDrawTargetIDRagdolls(tData) return end - -- only show this if the ragdoll has a nick, else it could be a mattress - if not CORPSE.GetPlayerNick(ent, false) then - return - end - local corpse_found = CORPSE.GetFound(ent, false) or not gameloop.IsDetectiveMode() local corpse_ply = corpse_found and CORPSE.GetPlayer(ent) or false local binoculars_useable = IsValid(c_wep) and c_wep:GetClass() == "weapon_ttt_binoculars" @@ -563,6 +559,10 @@ function targetid.HUDDrawTargetIDRagdolls(tData) else tData:SetSubtitle(ParT("corpse_hint", key_params)) end + + if ent:IsOnFire() then + tData:AddDescriptionLine(TryT("body_burning"), COLOR_ORANGE, { materialFire }) + end elseif binoculars_useable then tData:SetSubtitle(ParT("corpse_binoculars", { key = Key("+attack", "ATTACK") })) else