Skip to content

Commit

Permalink
soldier backup finish
Browse files Browse the repository at this point in the history
  • Loading branch information
Nopied committed Aug 28, 2023
1 parent feb0158 commit df70842
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions addons/sourcemod/scripting/freak_fortress_2.sp
Original file line number Diff line number Diff line change
Expand Up @@ -2579,7 +2579,7 @@ public Action TF2Items_OnGiveNamedItem(int client, char[] classname, int iItemDe
}*/
case 226: //Battalion's Backup
{
Handle itemOverride=PrepareItemHandle(item, _, _, "140 ; 10.0");
Handle itemOverride=PrepareItemHandle(item, _, _, "140 ; 10.0 ; 4365 ; 1.5");
if(itemOverride!=null)
{
item=itemOverride;
Expand Down Expand Up @@ -5744,17 +5744,18 @@ public Action OnTakeDamageAlive(int client, int& iAttacker, int& inflictor, floa
// rage: 62.3, drain: 54.6

float realDamage = damage * 1.53846; // player damamge -35%
if(damagetype & DMG_CRIT && TF2_IsPlayerCritBuffed(iAttacker))
if(TF2_IsPlayerCritBuffed(iAttacker))
realDamage *= 3.0;
else if(damagetype & DMG_CRIT && TF2_IsPlayerInCondition(iAttacker, TFCond_Buffed))
else if(TF2_IsPlayerInCondition(iAttacker, TFCond_Buffed))
realDamage *= 1.35;
damage *= 0.3;

int buffer = TF2Util_GetPlayerConditionProvider(client, TFCond_DefenseBuffed);
if(!IsValidClient(buffer)) return Plugin_Changed;

float rage = GetEntPropFloat(buffer, Prop_Send, "m_flRageMeter"),
drain = rage - (max(0.0, (realDamage - damage) / 1200.0) * 100.0);
float multiplier = TF2Attrib_HookValueFloat(1.0, "mod_buff_duration", buffer),
rage = GetEntPropFloat(buffer, Prop_Send, "m_flRageMeter"),
drain = rage - (max(0.0, (realDamage - damage) / (1200.0 * multiplier)) * 100.0);
SetEntPropFloat(buffer, Prop_Send, "m_flRageMeter", drain);

// PrintToChatAll("realDamage: %.1f, damage: %.1f", realDamage, damage);
Expand Down

0 comments on commit df70842

Please sign in to comment.