Quote:
Originally Posted by Pon
It's also something I've wondered if it's possible to enable (in an extremely hacky way) in Lua. I may experiment for the hell of it...
|
I was thinking the same thing. It's definitely possible (and wouldn't be too hard).
Semi-pseudo-code:
Code:
player_ondamage( player, damageinfo )
-- if on the same team and not damaging self
if victim:GetTeamId() == attacker:GetTeamId() and not victim:GetId() == attacker:GetId() then
-- get damage
damage = damageinfo:GetDamage()
-- perhaps apply some reduction to damage (maybe based on armor type?)
damage = damage / 2
-- strip armor
victim:RemoveArmor( damage )
-- already did the stripping, don't damage further
damageinfo:SetDamage( 0 )
end
end
It'd require friendly fire to be on to work, though.