mirror of
https://github.com/Jackzmc/sourcemod-plugins.git
synced 2025-05-07 16:53:21 +00:00
TKStopper: Disable reverse indirect damage
This commit is contained in:
parent
1ad848b7a3
commit
0eb0901fb5
2 changed files with 10 additions and 4 deletions
Binary file not shown.
|
@ -170,6 +170,8 @@ public Action Event_OnTakeDamage(int victim, int& attacker, int& inflictor, flo
|
||||||
if(isPlayerTroll[attacker]) return Plugin_Stop;
|
if(isPlayerTroll[attacker]) return Plugin_Stop;
|
||||||
if(isUnderAttack[victim]) return Plugin_Continue;
|
if(isUnderAttack[victim]) return Plugin_Continue;
|
||||||
|
|
||||||
|
bool isDamageDirect = damagetype & (DMG_BLAST|DMG_BURN|DMG_BLAST_SURFACE) == 0;
|
||||||
|
|
||||||
int time = GetTime();
|
int time = GetTime();
|
||||||
if(time - lastFF[attacker] > hForgivenessTime.IntValue) {
|
if(time - lastFF[attacker] > hForgivenessTime.IntValue) {
|
||||||
playerTotalDamageFF[attacker] = 0.0;
|
playerTotalDamageFF[attacker] = 0.0;
|
||||||
|
@ -177,7 +179,7 @@ public Action Event_OnTakeDamage(int victim, int& attacker, int& inflictor, flo
|
||||||
playerTotalDamageFF[attacker] += damage;
|
playerTotalDamageFF[attacker] += damage;
|
||||||
lastFF[attacker] = time;
|
lastFF[attacker] = time;
|
||||||
|
|
||||||
if(playerTotalDamageFF[attacker] > hThreshold.IntValue && !IsFinaleEnding && damagetype & (DMG_BLAST|DMG_BURN|DMG_BLAST_SURFACE) == 0) {
|
if(playerTotalDamageFF[attacker] > hThreshold.IntValue && !IsFinaleEnding && isDamageDirect) {
|
||||||
if(hAction.IntValue == 1) {
|
if(hAction.IntValue == 1) {
|
||||||
LogMessage("[NOTICE] Kicking %N for excessive FF (%f HP) for %d minutes.", attacker, playerTotalDamageFF[attacker], hBanTime.IntValue);
|
LogMessage("[NOTICE] Kicking %N for excessive FF (%f HP) for %d minutes.", attacker, playerTotalDamageFF[attacker], hBanTime.IntValue);
|
||||||
NotifyAllAdmins("[Notice] Kicking %N for excessive FF (%f HP) for %d minutes.", attacker, playerTotalDamageFF[attacker], hBanTime.IntValue);
|
NotifyAllAdmins("[Notice] Kicking %N for excessive FF (%f HP) for %d minutes.", attacker, playerTotalDamageFF[attacker], hBanTime.IntValue);
|
||||||
|
@ -198,9 +200,13 @@ public Action Event_OnTakeDamage(int victim, int& attacker, int& inflictor, flo
|
||||||
if(L4D_IsInFirstCheckpoint(victim) || L4D_IsInLastCheckpoint(victim) || time - iJoinTime[attacker] <= hJoinTime.IntValue * 60000) {
|
if(L4D_IsInFirstCheckpoint(victim) || L4D_IsInLastCheckpoint(victim) || time - iJoinTime[attacker] <= hJoinTime.IntValue * 60000) {
|
||||||
damage = 0.0;
|
damage = 0.0;
|
||||||
return Plugin_Handled;
|
return Plugin_Handled;
|
||||||
}else {
|
}else if(IsFinaleEnding) {
|
||||||
SDKHooks_TakeDamage(attacker, attacker, attacker, IsFinaleEnding ? damage * 2.0 : damage / 1.9);
|
SDKHooks_TakeDamage(attacker, attacker, attacker, damage * 2.0);
|
||||||
damage = IsFinaleEnding ? 0.0 : damage / 2.1;
|
damage = 0.0;
|
||||||
|
return Plugin_Changed;
|
||||||
|
}else if(!isDamageDirect) {
|
||||||
|
SDKHooks_TakeDamage(attacker, attacker, attacker, damage / 1.9);
|
||||||
|
damage /= 2.1;
|
||||||
return Plugin_Changed;
|
return Plugin_Changed;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue