Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file modified addons/sourcemod/plugins/optional/l4d2_playstats.smx
Binary file not shown.
Binary file modified addons/sourcemod/plugins/optional/l4d2_skill_detect.smx
Binary file not shown.
2 changes: 1 addition & 1 deletion addons/sourcemod/scripting/include/l4d2_skill_detect.inc
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ enum CarAlarmTriggerReason
/**
* CarAlarmTriggerReason: the name of the 'reason' in OnCarAlarmTriggered() forward
*/
char sCarAlarmTriggerReason[CarAlarmTrigger_Size][] = {
stock char sCarAlarmTriggerReason[CarAlarmTrigger_Size][] = {
"unknown",
"hit",
"touched",
Expand Down
2 changes: 1 addition & 1 deletion addons/sourcemod/scripting/l4d2_playstats.sp
Original file line number Diff line number Diff line change
Expand Up @@ -2725,7 +2725,7 @@ public void OnWitchCrown(int attacker, int damage)
g_strRoundPlayerData[index][g_iCurTeam][plyCrowns]++;
}

public void OnWitchDrawCrown(int attacker, int damage, int chipdamage)
public void OnWitchCrownHurt(int attacker, int damage, int chipdamage)
{
int index = GetPlayerIndexForClient(attacker);
if (index == -1) {
Expand Down
2 changes: 1 addition & 1 deletion addons/sourcemod/scripting/l4d2_skill_detect.sp
Original file line number Diff line number Diff line change
Expand Up @@ -449,7 +449,7 @@ public APLRes
g_hForwardLevel = CreateGlobalForward("OnChargerLevel", ET_Ignore, Param_Cell, Param_Cell);
g_hForwardLevelHurt = CreateGlobalForward("OnChargerLevelHurt", ET_Ignore, Param_Cell, Param_Cell, Param_Cell);
g_hForwardCrown = CreateGlobalForward("OnWitchCrown", ET_Ignore, Param_Cell, Param_Cell);
g_hForwardDrawCrown = CreateGlobalForward("OnWitchDrawCrown", ET_Ignore, Param_Cell, Param_Cell, Param_Cell);
g_hForwardDrawCrown = CreateGlobalForward("OnWitchCrownHurt", ET_Ignore, Param_Cell, Param_Cell, Param_Cell);
g_hForwardTongueCut = CreateGlobalForward("OnTongueCut", ET_Ignore, Param_Cell, Param_Cell);
g_hForwardSmokerSelfClear = CreateGlobalForward("OnSmokerSelfClear", ET_Ignore, Param_Cell, Param_Cell, Param_Cell);
g_hForwardRockSkeeted = CreateGlobalForward("OnTankRockSkeeted", ET_Ignore, Param_Cell, Param_Cell);
Expand Down
27 changes: 27 additions & 0 deletions addons/sourcemod/scripting/l4d2_skill_detect/tracking.sp
Original file line number Diff line number Diff line change
Expand Up @@ -1374,6 +1374,11 @@ void CheckWitchCrown(int witch, int attacker, bool bOneShot = false)
// full crown? unharrassed
if (!witch_dmg_array[MAXPLAYERS + WTCH_STARTLED] && (bOneShot || witch_dmg_array[MAXPLAYERS + WTCH_CROWNSHOT] >= iWitchHealth))
{
PrintDebug("Witch Crown Check: Full crown detected. Attacker: %N, Damage: %i, Chip Damage: %i",
attacker,
witch_dmg_array[attacker],
chipDamage);

// make sure that we don't count any type of chip
if (g_cvarHideFakeDamage.BoolValue)
{
Expand All @@ -1389,6 +1394,11 @@ void CheckWitchCrown(int witch, int attacker, bool bOneShot = false)
}
else if (witch_dmg_array[MAXPLAYERS + WTCH_CROWNSHOT] >= g_cvarDrawCrownThresh.IntValue)
{
PrintDebug("Witch Crown Check: Draw crown detected. Attacker: %N, Crown Shot: %i, Threshold: %i",
attacker,
witch_dmg_array[MAXPLAYERS + WTCH_CROWNSHOT],
g_cvarDrawCrownThresh.IntValue);

// draw crown: harassed + over X damage done by one survivor -- in ONE shot

for (int i = 0; i <= MAXPLAYERS; i++)
Expand All @@ -1400,6 +1410,8 @@ void CheckWitchCrown(int witch, int attacker, bool bOneShot = false)
chipDamage += witch_dmg_array[i];
}

PrintDebug("Witch Crown Check: Chip Damage Calculated: %i, Total Health: %i", chipDamage, iWitchHealth);

// make sure that we don't count any type of chip
if (g_cvarHideFakeDamage.BoolValue)
{
Expand All @@ -1411,14 +1423,29 @@ void CheckWitchCrown(int witch, int attacker, bool bOneShot = false)
}
else
witch_dmg_array[MAXPLAYERS + WTCH_CROWNSHOT] = iWitchHealth - chipDamage;

PrintDebug("Witch Crown Check: Adjusted Crown Shot: %i, Adjusted Chip Damage: %i",
witch_dmg_array[MAXPLAYERS + WTCH_CROWNSHOT],
chipDamage);

// re-check whether it qualifies as a drawcrown:
if (witch_dmg_array[MAXPLAYERS + WTCH_CROWNSHOT] < g_cvarDrawCrownThresh.IntValue)
{
PrintDebug("Witch Crown Check: Adjusted Crown Shot below threshold. No draw crown.");
return;
}
}

// plus, set final shot as 'damage', and the rest as chip
HandleDrawCrown(attacker, witch_dmg_array[MAXPLAYERS + WTCH_CROWNSHOT], chipDamage);
}
else
{
PrintDebug("Witch Crown Check: No crown detected. Crown Shot: %i, Threshold: %i, Harassed: %i",
witch_dmg_array[MAXPLAYERS + WTCH_CROWNSHOT],
g_cvarDrawCrownThresh.IntValue,
witch_dmg_array[MAXPLAYERS + WTCH_STARTLED]);
}

// remove trie
}
Expand Down