From 05b484e54a59ce5fe9a671a972827365dd754dd9 Mon Sep 17 00:00:00 2001 From: Forgetest <33988868+jensewe@users.noreply.github.com> Date: Sun, 25 Feb 2024 20:32:40 +0800 Subject: [PATCH] Rework `l4d2_tank_flying_incap` + Animation fix (#742) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * l4d2_tank_flying_incap: Rework + Animation fix Feature: - A version that doesn't mess up with damage calculations for incapped. - An animation fix to skip the getting-up at the end of fly. ㅤ- NOTE: Survivors will be able to shoot as soon as they land. * l4d2_tank_flying_incap: Fix a rare case where animation fix is not working * l4d2_tank_flying_incap: Default animation fix to off --- .../plugins/fixes/l4d2_tank_flying_incap.smx | Bin 9847 -> 6599 bytes .../scripting/l4d2_tank_flying_incap.sp | 182 +++++++++--------- 2 files changed, 92 insertions(+), 90 deletions(-) diff --git a/addons/sourcemod/plugins/fixes/l4d2_tank_flying_incap.smx b/addons/sourcemod/plugins/fixes/l4d2_tank_flying_incap.smx index 918d56de20112ca180ca0523b151f0db7a2d69fa..ac0e5838f23c817265806cf47417c43308b8d5dd 100644 GIT binary patch delta 6437 zcmXYzcQjk?LjiUB0 zYK7W<`F_stp7T2I*K_XkJoo+FbN{&iw9q1ORn?aUgaia=MgYM21polNO8@|@;Q8P6 zzszO;07&p2$OHh$;-SQQlPCc23ZEc6)M5ZY7(Q9?B;oxvKDqGx#k&!Hp#a{MW$|Nt zO5zcc0|36^Qw7hS8~_d&!izqhR(Sv*0iTw5R3HEV3qGCk*!;f-;5`KI!T5ZS=N#{~ z_)N!BrT_rodjbmawB!9X{=wCF2de=9_wd<>hac~T`23D19Pjn`!;Jv$;u~q;TN0*` z5G=s=Ea2`e)0T^J8V)m=-~q_`1Wce8_K{6KA3Eb>>F0D^&u`FYTpPc4zpP?%UbA^> zVb9KQG*e%oI^{{MWJAyubM`WYG`4*io@H@H$6Shp%ehTFRq8i9&oiJ zWP&LNp$y1pOrv%qlzcVV^Yk!C9_Ta(Wll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v-qU}v#C>Blv5w}2QO}9lOzw2W+*5W{e9ERmE^V}4fuY9 zCq8gEeru&rGWU@0|0-98j|+Q33tw-O*EnmptjL9-PN7|e}Vs! z*DT1NvCExQUORBo-})rqz-m&(?(f;mswD}|Crv9D!R=q`!gNajC(OQHOV#f;hXRJd zcBshkqD;CwhXO*|$l_ig+>ZUvJQgcM93AomNq^R>Uj6yP#cioBE+ zoa;~dJV&x+?h8@YR*8uXzGtx3;t=G}N-u4W`P9<0Op@m2#X4%>%T?PVG!W5qQ@oKF z@$|BT)WTtnSNGg|cDZQDWt1Y*{dc<4`a47!VzoTd>8Wl6fPhuDARL<}6Fu{B+am z!F!XK?F(&9Ch#Fq!D#dS+Rq5(sr${hNn5wqyw;P(DO*P}Q-u@j&QgC=Ti*@c3#NOg z@qE&Q(OV)Z($k2GN;c$eE24UcQIeSE- IKxYp8A6d!@mjD0& diff --git a/addons/sourcemod/scripting/l4d2_tank_flying_incap.sp b/addons/sourcemod/scripting/l4d2_tank_flying_incap.sp index db3697afd..16f2c3528 100644 --- a/addons/sourcemod/scripting/l4d2_tank_flying_incap.sp +++ b/addons/sourcemod/scripting/l4d2_tank_flying_incap.sp @@ -2,141 +2,143 @@ #pragma newdecls required #include -#include -#define L4D2UTIL_STOCKS_ONLY 1 -#include - -int iSurvivorIncapHealth = 300; +#include bool - bLateLoad, - bDebug = false; + bDebug = false, + bAnim = false; ConVar convarDebug, - convarSurvivorIncapHealth = null; + convarAnim = null; + +float + g_flIncapTime[MAXPLAYERS+1]; public Plugin myinfo = { name = "[L4D2] Flying Incap - Tank Punch", - author = "Sir", + author = "Sir, Forgetest", description = "Sends Survivors flying on the incapping punch.", - version = "1.0", + version = "2.0", url = "https://github.com/SirPlease/L4D2-Competitive-Rework" }; -public APLRes AskPluginLoad2(Handle plugin, bool late, char[] error, int errMax) +public void OnPluginStart() { - bLateLoad = late; - return APLRes_Success; + convarDebug = CreateConVar("l4d2_tank_flying_incap_debug", "0", "Are we debugging?"); + convarAnim = CreateConVar("l4d2_tank_flying_incap_anim_fix", "0", "Remove the getting-up animation at the end of fly. (NOTE: Survivors will be able to shoot as soon as they land.)"); + bDebug = convarDebug.BoolValue; + bAnim = convarAnim.BoolValue; + convarDebug.AddChangeHook(CvarsChanged); + convarAnim.AddChangeHook(CvarsChanged); + + HookEvent("player_incapacitated", Event_player_incapacitated); } -public void OnPluginStart() +// also serves as late-loader +public void OnMapStart() { - if (bLateLoad) + for (int i = 1; i <= MaxClients; ++i) { - for (int i = 1; i < MaxClients+1; i++) - { - if (IsClientInGame(i)) - { - OnClientPutInServer(i); - } - } + g_flIncapTime[i] = 0.0; } - - convarDebug = CreateConVar("l4d2_tank_flying_incap_debug", "0", "Are we debugging?"); - convarSurvivorIncapHealth = FindConVar("survivor_incap_health"); - bDebug = convarDebug.BoolValue; - iSurvivorIncapHealth = convarSurvivorIncapHealth.IntValue; - convarDebug.AddChangeHook(CvarsChanged); - convarSurvivorIncapHealth.AddChangeHook(CvarsChanged); } -public void OnClientPutInServer(int client) +void Event_player_incapacitated(Event event, const char[] name, bool dontBroadcast) { - SDKHook(client, SDKHook_OnTakeDamage, OnTakeDamage); + int userid = event.GetInt("userid"); + + // Doesn't matter it's valid or not, has a minimum of 0. + g_flIncapTime[GetClientOfUserId(userid)] = GetGameTime(); + + // punch fly animation is applied this frame, + RequestFrame(NextFrame_HookAnimation, userid); } -public void OnClientDisconnect(int client) +void NextFrame_HookAnimation(int userid) { - SDKUnhook(client, SDKHook_OnTakeDamage, OnTakeDamage); + if (!bAnim) + return; + + int client = GetClientOfUserId(userid); + if (!client || !IsClientInGame(client)) + return; + + if (GetClientTeam(client) != 2 || !IsPlayerAlive(client)) + return; + + if (!GetEntProp(client, Prop_Send, "m_isIncapacitated")) + return; + + AnimHookEnable(client, AnimHook_PunchFly); } -public Action OnTakeDamage(int victim, int &attacker, int &inflictor, float &damage, int &damagetype) +Action AnimHook_PunchFly(int client, int &activity) { - if (damagetype != DMG_CLUB) - return Plugin_Continue; + static int last = 0; - if (!IsValidSurvivor(victim) || !IsValidTank(attacker)) - return Plugin_Continue; + if (bDebug && last != activity) + { + if (activity < 0) activity = 0; - if (inflictor <= MaxClients || !IsValidEdict(inflictor)) - return Plugin_Continue; + char curActName[64], lastActName[64]; + AnimGetActivity(activity, curActName, sizeof(curActName)); + AnimGetActivity(last, lastActName, sizeof(lastActName)); + PrintToChatAll("\x01[FlyingIncap]: (%.1f) (%N) [\x05%s\x01] [\x04%s\x01]", GetGameTime(), client, curActName, lastActName); - char sClassName[ENTITY_MAX_NAME_LENGTH]; - GetEdictClassname(inflictor, sClassName, sizeof(sClassName)); - - if (strcmp("weapon_tank_claw", sClassName) == 0) + last = activity; + } + + switch (activity) { - if (!IsIncapacitated(victim)) + case L4D2_ACT_TERROR_HIT_BY_TANKPUNCH, + L4D2_ACT_TERROR_IDLE_FALL_FROM_TANKPUNCH, + L4D2_ACT_TERROR_JUMP_LANDING, + L4D2_ACT_TERROR_JUMP_LANDING_HARD, + L4D2_ACT_DEPLOY_PISTOL: + { + return Plugin_Continue; + } + + // Skip the getting up from ground animation + case L4D2_ACT_TERROR_TANKPUNCH_LAND: { - int iTotalHealth = GetSurvivorPermanentHealth(victim) + GetSurvivorTemporaryHealth(victim); - - if (iTotalHealth <= damage) - { - if (bDebug) - PrintToChatAll("[FlyingIncap]: %N got hit by Tank and has %i HP on incapping punch", victim, iTotalHealth); - - DataPack dp; - CreateDataTimer(0.4, Timer_ApplyDamageLater, dp, TIMER_FLAG_NO_MAPCHANGE); - dp.WriteCell(GetClientUserId(victim)); - dp.WriteCell(GetClientUserId(attacker)); - dp.WriteCell(inflictor); - dp.WriteCell(iTotalHealth); - - SetEntityHealth(victim, 1); - SetTempHealth(victim, 0.0); - damage = 0.0; - return Plugin_Changed; - } + PlayerAnimState.FromPlayer(client).m_bIsPunchedByTank = false; // no longer in punched animation + + activity = L4D2_ACT_DIESIMPLE; // incap animation intro } } - return Plugin_Continue; + + AnimHookDisable(client, AnimHook_PunchFly); + return Plugin_Changed; } -Action Timer_ApplyDamageLater(Handle timer, DataPack dp) +int g_iIncap; +public Action L4D_TankClaw_OnPlayerHit_Pre(int tank, int claw, int player) { - dp.Reset(); - int iSurvivor = GetClientOfUserId(dp.ReadCell()); - int iTank = GetClientOfUserId(dp.ReadCell()); - int iInflictor = dp.ReadCell(); - float damage = float(dp.ReadCell()); - damage = damage >= 1.0 ? damage : 1.0; - - if (iSurvivor > 0) - { - iTank = iTank > 0 ? iTank : 0; - - if (bDebug) - PrintToChatAll("[FlyingIncap]: Applied %0.2f damage to %N", damage, iSurvivor); + g_iIncap = GetEntProp(player, Prop_Send, "m_isIncapacitated"); - SDKHooks_TakeDamage(iSurvivor, iInflictor, iTank, damage, DMG_CLUB, WEPID_TANK_CLAW); - - if (IsIncapacitated(iSurvivor)) - SetEntityHealth(iSurvivor, iSurvivorIncapHealth); + if (GetGameTime() == g_flIncapTime[player]) + { + SetEntProp(player, Prop_Send, "m_isIncapacitated", 0); } - return Plugin_Stop; + return Plugin_Continue; } -void CvarsChanged(ConVar convar, const char[] oldValue, const char[] newValue) +public void L4D_TankClaw_OnPlayerHit_Post(int tank, int claw, int player) { - bDebug = convarDebug.BoolValue; - iSurvivorIncapHealth = convarSurvivorIncapHealth.IntValue; + SetEntProp(player, Prop_Send, "m_isIncapacitated", g_iIncap); } -void SetTempHealth(int client, float fHealth) +public void L4D_TankClaw_OnPlayerHit_PostHandled(int tank, int claw, int player) { - SetEntPropFloat(client, Prop_Send, "m_healthBufferTime", GetGameTime()); - SetEntPropFloat(client, Prop_Send, "m_healthBuffer", fHealth); + SetEntProp(player, Prop_Send, "m_isIncapacitated", g_iIncap); +} + +void CvarsChanged(ConVar convar, const char[] oldValue, const char[] newValue) +{ + bDebug = convarDebug.BoolValue; + bAnim = convarAnim.BoolValue; } \ No newline at end of file