def T_RadiusDamage(inflictor, attacker, damage, ignore, dtype, *qwp_extra): points = 0 head = engine.world org = Vector(0, 0, 0) head = qc.findradius(inflictor.origin, damage + 40) while head: # bprint (PRINT_HIGH, head.classname); # bprint (PRINT_HIGH, " | "); # bprint (PRINT_HIGH, head.netname); # bprint (PRINT_HIGH, "\n"); if head != ignore: if head.takedamage: org = head.origin + (head.mins + head.maxs) * 0.5 points = 0.5 * qc.length(inflictor.origin - org) if points < 0: points = 0 points = damage - points if head == attacker: points *= 0.5 if points > 0: if CanDamage(head, inflictor): head.deathtype = dtype T_Damage(head, inflictor, attacker, points) head = head.chain
def T_BeamDamage(attacker, damage, *qwp_extra): for head in engine.findradius(attacker.origin, damage + 40): if head.takedamage: points = 0.5 * qc.length(attacker.origin - head.origin) if points < 0: points = 0 points = damage - points if head == attacker: points *= 0.5 if (points > 0) and CanDamage(head, attacker): T_Damage(head, attacker, attacker, points)
def T_RadiusDamage(inflictor, attacker, damage, ignore, *qwp_extra): for head in engine.findradius(inflictor.origin, damage + 40): if head.takedamage and (head != ignore): org = head.origin + (head.mins + head.maxs) * 0.5 points = 0.5 * qc.length(inflictor.origin - org) if points < 0: points = 0 points = damage - points if head == attacker: points *= 0.5 if (points > 0) and CanDamage(head, inflictor): T_Damage(head, inflictor, attacker, points)
def T_BeamDamage(attacker, damage, *qwp_extra): points = 0 head = engine.world head = qc.findradius(attacker.origin, damage + 40) while head: if head.takedamage: points = 0.5 * qc.length(attacker.origin - head.origin) if points < 0: points = 0 points = damage - points if head == attacker: points *= 0.5 if points > 0: if CanDamage(head, attacker): T_Damage(head, attacker, attacker, points) head = head.chain