Skip to content

Commit 62fb9ff

Browse files
committed
gameplay: make caber damage consistent
since the caber used distance mod, its base damage was extremely inconsistent and seemingly random, with a player essentially needing to "aim" this melee weapons using their eye position. also set the explosion location to the player's center, so that the explosion falloff is much more consistent and easier to land optimally. we set DMG_NOCLOSEDISTANCEMOD because there are various parts of the code which adjust the damage when this flag is not present, without checking if DMG_USEDISTANCEMOD is really applied. also treat the caber as a grenade in all cases in the code, for consistency. finally, add missing charge mini-crit code for the caber and pain train. ref: ValveSoftware/Source-1-Games#4428
1 parent 2969b92 commit 62fb9ff

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

src/game/server/tf/player_vs_environment/boss_alpha/boss_alpha.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -268,6 +268,7 @@ float ModifyBossDamage( const CTakeDamageInfo &info )
268268
case TF_WEAPON_GRENADELAUNCHER:
269269
case TF_WEAPON_PIPEBOMBLAUNCHER:
270270
case TF_WEAPON_GRENADE_DEMOMAN:
271+
case TF_WEAPON_STICKBOMB:
271272
return info.GetDamage() * tf_boss_alpha_dmg_mult_grenade.GetFloat();
272273

273274
case TF_WEAPON_ROCKETLAUNCHER:

src/game/shared/tf/tf_gamerules.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5848,7 +5848,7 @@ bool CTFGameRules::ApplyOnDamageModifyRules( CTakeDamageInfo &info, CBaseEntity
58485848
eDamageBonusCond = TF_COND_OFFENSEBUFF;
58495849
}
58505850
}
5851-
else if ( pTFAttacker && (bitsDamage & DMG_RADIUS_MAX) && pWeapon && ( (pWeapon->GetWeaponID() == TF_WEAPON_SWORD) || (pWeapon->GetWeaponID() == TF_WEAPON_BOTTLE)|| (pWeapon->GetWeaponID() == TF_WEAPON_WRENCH) ) )
5851+
else if ( pTFAttacker && (bitsDamage & DMG_RADIUS_MAX) && pWeapon && ( (pWeapon->GetWeaponID() == TF_WEAPON_SWORD) || (pWeapon->GetWeaponID() == TF_WEAPON_BOTTLE) || (pWeapon->GetWeaponID() == TF_WEAPON_WRENCH) || (pWeapon->GetWeaponID() == TF_WEAPON_STICKBOMB) || (pWeapon->GetWeaponID() == TF_WEAPON_SHOVEL) ) )
58525852
{
58535853
// First sword or bottle attack after a charge is a mini-crit.
58545854
bAllSeeCrit = true;

src/game/shared/tf/tf_weapon_bottle.cpp

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -171,8 +171,7 @@ void CTFStickBomb::Smack( void )
171171
{
172172
Vector vecForward;
173173
AngleVectors( pTFPlayer->EyeAngles(), &vecForward );
174-
Vector vecSwingStart = pTFPlayer->Weapon_ShootPosition();
175-
Vector vecSwingEnd = vecSwingStart + vecForward * GetSwingRange();
174+
Vector vecSwingStart = pTFPlayer->WorldSpaceCenter();
176175

177176
Vector explosion = vecSwingStart;
178177

@@ -192,7 +191,7 @@ void CTFStickBomb::Smack( void )
192191

193192
TE_TFExplosion( filter, 0.0f, explosion, Vector(0,0,1), TF_WEAPON_GRENADELAUNCHER, pTFPlayer->entindex(), -1, SPECIAL1, iCustomParticleIndex );
194193

195-
int dmgType = DMG_BLAST | DMG_USEDISTANCEMOD;
194+
int dmgType = DMG_BLAST | DMG_NOCLOSEDISTANCEMOD;
196195
if ( IsCurrentAttackACrit() )
197196
dmgType |= DMG_CRITICAL;
198197

0 commit comments

Comments
 (0)