Skip to content

Commit

Permalink
prepare shotgun rewrite
Browse files Browse the repository at this point in the history
  • Loading branch information
Nopied committed Aug 24, 2023
1 parent 1e56ab5 commit ac44d41
Showing 1 changed file with 13 additions and 16 deletions.
29 changes: 13 additions & 16 deletions addons/sourcemod/scripting/freak_fortress_2.sp
Original file line number Diff line number Diff line change
Expand Up @@ -5908,29 +5908,26 @@ public Action OnTakeDamageAlive(int client, int& iAttacker, int& inflictor, floa
}
}

if(TF2_GetPlayerClass(iAttacker) == TFClass_Heavy)
if(StrContains(classname, "tf_weapon_shotgun")!=-1)
{
if(StrContains(classname, "tf_weapon_shotgun")!=-1)
int maxHealth = GetEntProp(iAttacker, Prop_Data, "m_iMaxHealth");
int currentHealth = GetEntProp(iAttacker, Prop_Data, "m_iHealth");
if(currentHealth <= maxHealth * 2)
{
int maxHealth = GetEntProp(iAttacker, Prop_Data, "m_iMaxHealth");
int currentHealth = GetEntProp(iAttacker, Prop_Data, "m_iHealth");
if(currentHealth <= maxHealth * 2)
{
currentHealth += 50;
TF2Util_TakeHealth(iAttacker, 50.0, TAKEHEALTH_IGNORE_MAXHEALTH);
currentHealth += 50;
TF2Util_TakeHealth(iAttacker, 50.0, TAKEHEALTH_IGNORE_MAXHEALTH);

if(currentHealth > maxHealth * 2)
{
SetEntProp(iAttacker, Prop_Data, "m_iHealth", maxHealth * 2);
}
if(currentHealth > maxHealth * 2)
{
SetEntProp(iAttacker, Prop_Data, "m_iHealth", maxHealth * 2);
}
}

float charge = GetEntPropFloat(iAttacker, Prop_Send, "m_flRageMeter") + (damage * 0.056);
SetEntPropFloat(iAttacker, Prop_Send, "m_flRageMeter",
charge > 100.0 ? 100.0 : charge);
}

// float charge = GetEntPropFloat(iAttacker, Prop_Send, "m_flRageMeter") + (damage * 0.056);
// SetEntPropFloat(iAttacker, Prop_Send, "m_flRageMeter",
// charge > 100.0 ? 100.0 : charge);

if(damagecustom==TF_WEAPON_SENTRY_BULLET)
{
damagetype |= DMG_PREVENT_PHYSICS_FORCE;
Expand Down

0 comments on commit ac44d41

Please sign in to comment.