Skip to content

Commit bf86334

Browse files
authored
Added special hittables damage convar (#906)
Added special hittables damage convar Replaced some extra spaces to tabs Fixed a convar description
1 parent f1f59df commit bf86334

1 file changed

Lines changed: 25 additions & 13 deletions

File tree

addons/sourcemod/scripting/l4d2_hittable_control.sp

Lines changed: 25 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
bool bIsGauntletFinale = false; //Gauntlet finales do reduced hittable damage
2929
float fOverkill[MAXPLAYERS + 1][2048]; // Overkill, prolly don't need this big of a global array, could also use adt_array.
3030
float fSpecialOverkill[MAXPLAYERS + 1][3]; // Dealing with breakable pieces that will cause multiple hits in a row (unintended behaviour)
31-
bool bLateLoad; // Late load support!
31+
bool bLateLoad; // Late load support!
3232

3333
//cvars
3434
ConVar hGauntletFinaleMulti;
@@ -47,6 +47,9 @@ ConVar hMilitiaRockStandingDamage;
4747
ConVar hSofaChairStandingDamage;
4848
ConVar hAtlasBallDamage;
4949
ConVar hIBeamDamage;
50+
ConVar hBrickPalletsPiecesDamage;
51+
ConVar hBoatSmashPiecesDamage;
52+
ConVar hConcretePillerPiecesDamage;
5053
ConVar hDiescraperBallDamage;
5154
ConVar hVanDamage;
5255
ConVar hStandardIncapDamage;
@@ -57,10 +60,10 @@ ConVar hUnbreakableForklifts;
5760

5861
public Plugin myinfo =
5962
{
60-
name = "L4D2 Hittable Control",
61-
author = "Stabby, Visor, Sir, Derpduck, Forgetest",
62-
version = "0.7",
63-
description = "Allows for customisation of hittable damage values (and debugging)"
63+
name = "L4D2 Hittable Control",
64+
author = "Stabby, Visor, Sir, Derpduck, Forgetest",
65+
version = "0.8",
66+
description = "Allows for customisation of hittable damage values (and debugging)"
6467
};
6568

6669
public void OnPluginStart()
@@ -113,6 +116,15 @@ public void OnPluginStart()
113116
hIBeamDamage = CreateConVar( "hc_ibeam_standing_damage", "48.0",
114117
"Damage of ibeams to non-incapped survivors.",
115118
FCVAR_NONE, true, 0.0, true, 300.0 );
119+
hBrickPalletsPiecesDamage = CreateConVar( "hc_brick_pallets_standing_damage", "13.0",
120+
"Damage of hittable brick pallets pieces to non-incapped survivors.",
121+
FCVAR_NONE, true, 0.0, true, 300.0 );
122+
hBoatSmashPiecesDamage = CreateConVar( "hc_boat_smash_standing_damage", "23.0",
123+
"Damage of hittable boat smash pieces to non-incapped survivors.",
124+
FCVAR_NONE, true, 0.0, true, 300.0 );
125+
hConcretePillerPiecesDamage = CreateConVar( "hc_concrete_piller_standing_damage", "8.0",
126+
"Damage of hittable concrete piller pieces to non-incapped survivors.",
127+
FCVAR_NONE, true, 0.0, true, 300.0 );
116128
hDiescraperBallDamage = CreateConVar( "hc_diescraper_ball_standing_damage", "100.0",
117129
"Damage of hittable ball statue on Diescraper finale to non-incapped survivors.",
118130
FCVAR_NONE, true, 0.0, true, 300.0 );
@@ -123,12 +135,12 @@ public void OnPluginStart()
123135
"Damage of all hittables to incapped players. -1 will have incap damage default to valve's standard incoherent damages. -2 will have incap damage default to each hittable's corresponding standing damage.",
124136
FCVAR_NONE, true, -2.0, true, 300.0 );
125137
hTankSelfDamage = CreateConVar( "hc_disable_self_damage", "0",
126-
"If set, tank will not damage itself with hittables. (0.6.1 simply prevents all damage from Prop_Physics & Alarm Cars to cover for the event a Tank punches a hittable into another and gets hit)",
138+
"If set, tank will not damage itself with hittables. (1: simply prevents all damage from Prop_Physics & Alarm Cars to cover for the event a Tank punches a hittable into another and gets hit)",
127139
FCVAR_NONE, true, 0.0, true, 1.0 );
128140
hOverHitInterval = CreateConVar( "hc_overhit_time", "1.2",
129141
"The amount of time to wait before allowing consecutive hits from the same hittable to register. Recommended values: 0.0-0.5: instant kill; 0.5-0.7: sizeable overhit; 0.7-1.0: standard overhit; 1.0-1.2: reduced overhit; 1.2+: no overhit unless the car rolls back on top. Set to tank's punch interval (default 1.5) to fully remove all possibility of overhit.",
130142
FCVAR_NONE, true, 0.0, false );
131-
hOverHitDebug = CreateConVar( "hc_debug", "0",
143+
hOverHitDebug = CreateConVar( "hc_debug", "0",
132144
"0: Disable Debug - 1: Enable Debug",
133145
FCVAR_NONE, true, 0.0, false );
134146
hUnbreakableForklifts = CreateConVar( "hc_unbreakable_forklifts", "0",
@@ -140,7 +152,7 @@ public void OnPluginStart()
140152
for (int i = 1; i <= MaxClients; i++)
141153
{
142154
if(IsClientInGame(i))
143-
OnClientPutInServer(i);
155+
OnClientPutInServer(i);
144156
}
145157
}
146158

@@ -261,21 +273,21 @@ bool ProcessSpecialHittables(int victim, int &attacker, int &inflictor, float &d
261273
{
262274
if (fSpecialOverkill[victim][0] - GetGameTime() > 0) return true;
263275
fSpecialOverkill[victim][0] = GetGameTime() + hOverHitInterval.FloatValue;
264-
damage = 13.0;
276+
damage = hBrickPalletsPiecesDamage.FloatValue;
265277
attacker = FindTank();
266278
}
267279
else if (StrContains(sModelName, "boat_smash_break", false) != -1) // [1]
268280
{
269281
if (fSpecialOverkill[victim][1] - GetGameTime() > 0) return true;
270282
fSpecialOverkill[victim][1] = GetGameTime() + hOverHitInterval.FloatValue;
271-
damage = 23.0;
283+
damage = hBoatSmashPiecesDamage.FloatValue;
272284
attacker = FindTank();
273285
}
274286
else if (StrContains(sModelName, "concretepiller01_dm01", false) != -1) // [2]
275287
{
276288
if (fSpecialOverkill[victim][2] - GetGameTime() > 0) return true;
277289
fSpecialOverkill[victim][2] = GetGameTime() + hOverHitInterval.FloatValue;
278-
damage = 8.0;
290+
damage = hConcretePillerPiecesDamage.FloatValue;
279291
attacker = FindTank();
280292
}
281293

@@ -305,7 +317,7 @@ bool GetHittableDamage(int entity, float &damage)
305317
else if (StrContains(sModelName, "forklift_brokenlift", false) != -1)
306318
{
307319
damage = hBrokenForkliftStandingDamage.FloatValue;
308-
}
320+
}
309321
else if (StrEqual(sModelName, "models/props_vehicles/airport_baggage_cart2.mdl", false))
310322
{
311323
damage = hBaggageStandingDamage.FloatValue;
@@ -381,7 +393,7 @@ Action OnTakeDamage(int victim, int &attacker, int &inflictor, float &damage, in
381393
if (!IsValidEdict(attacker) ||
382394
!IsValidEdict(victim) ||
383395
!IsValidEdict(inflictor))
384-
return Plugin_Continue;
396+
return Plugin_Continue;
385397

386398
char sClass[64];
387399
GetEdictClassname(inflictor, sClass, sizeof(sClass));

0 commit comments

Comments
 (0)