Closed TimGoll closed 11 months ago
i'm not sure if this is generally useful as it can't be applied to the three base roles ever.
Infected zombies are definitely an outlier for this usecase.
I don't think this should be done in the gamemode. Roles should take of this themselves if it would useful for them.
i'm not sure if this is generally useful as it can't be applied to the three base roles ever.
Infected zombies are definitely an outlier for this usecase.
I don't think this should be done in the gamemode. Roles should take of this themselves if it would useful for them.
fair point, I have to gree with you here. I'll close this. If someone has a valid argument to keep it, then we can reopen it
Kind of the same type of thing you're talking about, the explosion when that Hanf Role dies doesn't damage nearby teammates.
local entities = ents.FindInSphere(pos, R_OUTER)
for k, ent in ipairs(entities) do
-- If the entity is a player and not on the same team as the player who triggered the explosion
if IsValid(ent) and ent:IsPlayer() and ent:GetTeam() ~= ply:GetTeam() then
-- Calculate distance and damage
local distance = pos:Distance(ent:GetPos())
local damage = DMG_EXPLOSION * (1 - (distance / R_OUTER))
-- Deal damage to the player
local dmginfo = DamageInfo()
dmginfo:SetDamage(damage)
dmginfo:SetAttacker(ply)
dmginfo:SetInflictor(ply)
dmginfo:SetDamageType(DMG_BLAST)
ent:TakeDamageInfo(dmginfo)
end
end
The code is located at:
[Taken from SMORE]
Would be a nice setting that should be disabled by default. My suggestion would be a global convar, not one per role, but I need feedback from the community / the dev team on this one