Skip to content

Commit 650291e

Browse files
committed
added support for attributes that increase/decrease the metal cost when engineers use the wrench to repair teammate armor
1 parent 4d490e1 commit 650291e

File tree

3 files changed

+28
-2
lines changed

3 files changed

+28
-2
lines changed
264 Bytes
Binary file not shown.

game/quiver/scripts/items/items_game.txt

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -224410,6 +224410,28 @@
224410224410
"effect_type" "neutral"
224411224411
"stored_as_integer" "0"
224412224412
}
224413+
"935"
224414+
{
224415+
"name" "armor repair cost decreased"
224416+
"attribute_class" "mult_armor_repair_cost"
224417+
"description_string" "#Attrib_Armor_CostDecreased"
224418+
"description_format" "value_is_percentage"
224419+
"hidden" "0"
224420+
"effect_type" "positive"
224421+
"armory_desc" "on_wearer"
224422+
"stored_as_integer" "0"
224423+
}
224424+
"936"
224425+
{
224426+
"name" "armor repair cost increased"
224427+
"attribute_class" "mult_armor_repair_cost"
224428+
"description_string" "#Attrib_Armor_CostIncreased"
224429+
"description_format" "value_is_inverted_percentage"
224430+
"hidden" "0"
224431+
"effect_type" "negative"
224432+
"armory_desc" "on_wearer"
224433+
"stored_as_integer" "0"
224434+
}
224413224435

224414224436
"1000"
224415224437
{

src/game/shared/tf/tf_weapon_wrench.cpp

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -171,8 +171,12 @@ void CTFWrench::OnFriendlyPlayerHit(CTFPlayer* pOtherPlayer, CTFPlayer* pPlayer,
171171
if (flCurArmor < flMaxArmor)
172172
{
173173
int iArmorToGive = (GetRepairAmount() * 0.25f);
174-
int iArmorRepairMultPenalty = pOtherPlayer->GetPlayerClass()->GetArmorMetalPenaltyMult();
175-
int iRepairCost = iArmorToGive * iArmorRepairMultPenalty;
174+
float flArmorRepairMultPenalty = pOtherPlayer->GetPlayerClass()->GetArmorMetalPenaltyMult();
175+
176+
CALL_ATTRIB_HOOK_FLOAT_ON_OTHER(pOtherPlayer, flArmorRepairMultPenalty, mult_armor_repair_cost);
177+
CALL_ATTRIB_HOOK_FLOAT(flArmorRepairMultPenalty, mult_armor_repair_cost);
178+
179+
int iRepairCost = (iArmorToGive * flArmorRepairMultPenalty);
176180

177181
if (iRepairCost > pPlayer->GetBuildResources())
178182
{

0 commit comments

Comments
 (0)