diff --git a/src/game/client/components/players.cpp b/src/game/client/components/players.cpp index c8e0000784e..5d4ca1687ba 100644 --- a/src/game/client/components/players.cpp +++ b/src/game/client/components/players.cpp @@ -1340,6 +1340,14 @@ void CPlayers::OnRender() aRenderInfo[i].m_ColorBody = ColorRGBA(1, 1, 1); aRenderInfo[i].m_ColorFeet = ColorRGBA(1, 1, 1); } + if(!IsTeamplay && g_Config.m_ClColorFreeze) + { + aRenderInfo[i].m_CustomColoredSkin = m_pClient->m_aClients[i].m_RenderInfo.m_CustomColoredSkin; + aRenderInfo[i].m_ColorFeet = g_Config.m_ClColorFreezeFeet ? aRenderInfo[i].m_ColorFeet : ColorRGBA(1, 1, 1); + float Darken = (g_Config.m_ClColorFreezeDarken / 100.0f) * 0.5f + 0.5f; + aRenderInfo[i].m_ColorBody = m_pClient->m_aClients[i].m_RenderInfo.m_ColorBody; + aRenderInfo[i].m_ColorBody = ColorRGBA(aRenderInfo[i].m_ColorBody.r * Darken, aRenderInfo[i].m_ColorBody.g * Darken, aRenderInfo[i].m_ColorBody.b * Darken, 1.0); + } } } } diff --git a/src/game/client/gameclient.cpp b/src/game/client/gameclient.cpp index b115a29c28a..730734c1e37 100644 --- a/src/game/client/gameclient.cpp +++ b/src/game/client/gameclient.cpp @@ -67,7 +67,6 @@ #include "components/outlines.h" #include "components/particles.h" #include "components/player_indicator.h" -#include "components/verify.h" #include "components/players.h" #include "components/race_demo.h" #include "components/rainbow.h" @@ -77,6 +76,7 @@ #include "components/sounds.h" #include "components/spectator.h" #include "components/statboard.h" +#include "components/verify.h" #include "components/voting.h" #include "prediction/entities/character.h" #include "prediction/entities/projectile.h" @@ -128,7 +128,7 @@ void CGameClient::OnConsoleInit() &m_Voting, &m_Particles, // doesn't render anything, just updates all the particles &m_RaceDemo, - &m_Rainbow, + &m_Rainbow, &m_MapSounds, &m_Background, // render instead of m_MapLayersBackground when g_Config.m_ClOverlayEntities == 100 &m_MapLayersBackground, // first to render @@ -145,9 +145,9 @@ void CGameClient::OnConsoleInit() &m_FreezeBars, &m_DamageInd, &m_PlayerIndicator, - &m_Verify, - &m_Bindwheel, - &m_Tater, + &m_Verify, + &m_Bindwheel, + &m_Tater, &m_Hud, &m_Spectator, &m_Emoticon, @@ -172,7 +172,7 @@ void CGameClient::OnConsoleInit() &m_Motd, // for pressing esc to remove it &m_Menus, &m_Spectator, - &m_Bindwheel, + &m_Bindwheel, &m_Emoticon, &m_Controls, &m_Binds}); @@ -2004,6 +2004,32 @@ void CGameClient::OnNewSnapshot() m_Effects.AirJump(Pos, Alpha); } + if(g_Config.m_ClFreezeStars) + for(int i = 0; i < MAX_CLIENTS; i++) + { + if(m_Snap.m_aCharacters[i].m_Active && m_Snap.m_aCharacters[i].m_HasExtendedData && m_Snap.m_aCharacters[i].m_PrevExtendedData) + { + int FreezeTimeNow = m_Snap.m_aCharacters[i].m_ExtendedData.m_FreezeEnd - Client()->GameTick(g_Config.m_ClDummy); + int FreezeTimePrev = m_Snap.m_aCharacters[i].m_PrevExtendedData->m_FreezeEnd - Client()->PrevGameTick(g_Config.m_ClDummy); + vec2 Pos = vec2(m_Snap.m_aCharacters[i].m_Cur.m_X, m_Snap.m_aCharacters[i].m_Cur.m_Y); + int StarsNow = (FreezeTimeNow + 1) / Client()->GameTickSpeed(); + int StarsPrev = (FreezeTimePrev + 1) / Client()->GameTickSpeed(); + if(StarsNow < StarsPrev || (StarsPrev == 0 && StarsNow > 0)) + { + int Amount = StarsNow + 1; + float a = 3 * pi / 2; + float s = a - pi / 3; + float e = a + pi / 3; + for(int i = 0; i < Amount; i++) + { + float f = mix(s, e, (i + 1) / (float)(Amount + 2)); + vec2 Dir = vec2(cos(f), sin(f)); + m_Effects.DamageIndicator(Pos, Dir); + } + } + } + } + if(m_Snap.m_LocalClientId != m_PrevLocalId) m_PredictedDummyId = m_PrevLocalId; m_PrevLocalId = m_Snap.m_LocalClientId; @@ -2153,6 +2179,27 @@ void CGameClient::OnPredict() m_NewPredictedTick = true; vec2 Pos = pLocalChar->Core()->m_Pos; int Events = pLocalChar->Core()->m_TriggeredEvents; + + // for(int i = 0; i < MAX_CLIENTS; i++) + //{ + // if(CCharacter *pChar = m_PredictedWorld.GetCharacterById(i)) + // { + // if(pChar->m_FreezeTime % Client()->GameTickSpeed() == Client()->GameTickSpeed() - 1) + // { + // int Amount = (pChar->m_FreezeTime + 1) / Client()->GameTickSpeed(); + // float a = 3 * pi / 2; + // float s = a - pi / 3; + // float e = a + pi / 3; + // for(int i = 0; i < Amount; i++) + // { + // float f = mix(s, e, (i + 1) / (float)(Amount + 2)); + // vec2 Dir = vec2(cos(f), sin(f)); + // m_Effects.DamageIndicator(pChar->m_Pos, Dir); + // } + // } + // } + // } + if(g_Config.m_ClPredict && !m_SuppressEvents) if(Events & COREEVENT_AIR_JUMP) m_Effects.AirJump(Pos, 1.0f); @@ -2959,7 +3006,7 @@ void CGameClient::UpdateRenderedCharacters() vec2(m_aClients[i].m_RenderPrev.m_X, m_aClients[i].m_RenderPrev.m_Y), vec2(m_aClients[i].m_RenderCur.m_X, m_aClients[i].m_RenderCur.m_Y), m_aClients[i].m_IsPredicted ? Client()->PredIntraGameTick(g_Config.m_ClDummy) : Client()->IntraGameTick(g_Config.m_ClDummy)); - + if(g_Config.m_ClRemoveAnti) Pos = GetFreezePos(i); @@ -2990,7 +3037,6 @@ void CGameClient::UpdateRenderedCharacters() if(g_Config.m_ClUnpredOthersInFreeze && g_Config.m_ClAmIFrozen) Pos = UnpredPos; - } } m_Snap.m_aCharacters[i].m_Position = Pos; @@ -3109,13 +3155,13 @@ vec2 CGameClient::GetSmoothPos(int ClientId) vec2 CGameClient::GetFreezePos(int ClientId) { vec2 Pos = mix(m_aClients[ClientId].m_PrevPredicted.m_Pos, m_aClients[ClientId].m_Predicted.m_Pos, Client()->PredIntraGameTick(g_Config.m_ClDummy)); - //int64_t Now = time_get(); + // int64_t Now = time_get(); CCharacter *pChar = m_PredictedWorld.GetCharacterById(ClientId); for(int i = 0; i < 2; i++) { - //int64_t Len = clamp(m_aClients[ClientId].m_SmoothLen[i], (int64_t)1, time_freq()); - //int64_t TimePassed = Now - m_aClients[ClientId].m_SmoothStart[i]; + // int64_t Len = clamp(m_aClients[ClientId].m_SmoothLen[i], (int64_t)1, time_freq()); + // int64_t TimePassed = Now - m_aClients[ClientId].m_SmoothStart[i]; float MixAmount = 0.0f; int SmoothTick; float SmoothIntra; @@ -3126,7 +3172,7 @@ vec2 CGameClient::GetFreezePos(int ClientId) TicksFrozen = pChar->m_FreezeAccumulation; } - if(g_Config.m_ClRemoveAnti && pChar->m_FreezeTime > 0) + if(g_Config.m_ClRemoveAnti && pChar && pChar->m_FreezeTime > 0) { MixAmount = mix(0.0f, 1.0f, 1.0f - (float)std::min(TicksFrozen, g_Config.m_ClUnfreezeLagDelayTicks) / (float)g_Config.m_ClUnfreezeLagDelayTicks); } @@ -4221,7 +4267,7 @@ int CGameClient::FindFirstMultiViewId() return ClientId; } -bool CGameClient::CheckNewInput() +bool CGameClient::CheckNewInput() { return m_Controls.CheckNewInput(); } diff --git a/src/game/tater_variables.h b/src/game/tater_variables.h index 72488fc30ee..db99a12095b 100644 --- a/src/game/tater_variables.h +++ b/src/game/tater_variables.h @@ -55,10 +55,16 @@ MACRO_CONFIG_INT(ClShowSkinName, tc_skin_name, 0, 0, 1, CFGFLAG_CLIENT | CFGFLAG //MACRO_CONFIG_INT(ClFreeGhost, tc_freeghost, 0, 0, 1, CFGFLAG_CLIENT , "") -MACRO_CONFIG_INT(ClSmoothPredictionMargin, tc_prediction_margin_smooth, 0, 0, 1, CFGFLAG_CLIENT | CFGFLAG_SAVE, "Makes prediction margin transition smooth, causes worse jitter adjustment (reverts a ddnet change)") - MACRO_CONFIG_INT(ClFastInput, tc_fast_input, 1, 0, 1, CFGFLAG_CLIENT | CFGFLAG_SAVE, "Uses input for prediction up to 20ms faster") +MACRO_CONFIG_INT(ClColorFreeze, tc_color_freeze, 0, 0, 1, CFGFLAG_CLIENT | CFGFLAG_SAVE, "Use skin colors for frozen tees") +MACRO_CONFIG_INT(ClColorFreezeDarken, tc_color_freeze_darken, 90, 0, 100, CFGFLAG_CLIENT | CFGFLAG_SAVE, "Makes color of tees darker when in freeze (0-100)") +MACRO_CONFIG_INT(ClColorFreezeFeet, tc_color_freeze_feet, 0, 0, 1, CFGFLAG_CLIENT | CFGFLAG_SAVE, "Also use color for frozen tee feet") + +//Revert Variables +MACRO_CONFIG_INT(ClSmoothPredictionMargin, tc_prediction_margin_smooth, 0, 0, 1, CFGFLAG_CLIENT | CFGFLAG_SAVE, "Makes prediction margin transition smooth, causes worse ping jitter adjustment (reverts a ddnet change)") +MACRO_CONFIG_INT(ClFreezeStars, tc_freeze_stars, 0, 0, 1, CFGFLAG_CLIENT | CFGFLAG_SAVE, "Show old freeze stars") + //Outline Variables MACRO_CONFIG_INT(ClOutline, tc_outline, 0, 0, 1, CFGFLAG_CLIENT | CFGFLAG_SAVE, "Draws outlines") @@ -115,11 +121,6 @@ MACRO_CONFIG_INT(ClApplyProfileFlag, tc_profile_flag, 0, 0, 1, CFGFLAG_CLIENT | MACRO_CONFIG_INT(ClApplyProfileColors, tc_profile_colors, 1, 0, 1, CFGFLAG_CLIENT | CFGFLAG_SAVE, "Apply colors in profiles") MACRO_CONFIG_INT(ClApplyProfileEmote, tc_profile_emote, 1, 0, 1, CFGFLAG_CLIENT | CFGFLAG_SAVE, "Apply emote in profiles") -// Voting -MACRO_CONFIG_INT(ClVoteAuto, tc_vote_auto, 0, 0, 1, CFGFLAG_CLIENT | CFGFLAG_SAVE, "Activate auto vote") -MACRO_CONFIG_INT(ClVoteDefaultAll, tc_vote_default, 0, 0, 1, CFGFLAG_CLIENT | CFGFLAG_SAVE, "Default vote everybody (0:yes,1:no)") -MACRO_CONFIG_INT(ClVoteDefaultFriend, tc_vote_default, 0, 0, 1, CFGFLAG_CLIENT | CFGFLAG_SAVE, "Default vote friends (0:yes,1:no,3:Default)") - // Auto Verify MACRO_CONFIG_INT(ClAutoVerify, tc_auto_verify, 0, 0, 1, CFGFLAG_CLIENT | CFGFLAG_SAVE, "Auto verify")