{
// declarations
float multiplier, multiplier_from_accuracy, multiplier_from_distance;
- float final_damage; //, final_spread;
+ float final_damage;
vector final_force, center, vel;
- entity head, next;
+ entity head;
float i, queue = 0;
while(head)
{
- next = head.chain;
-
if(head.takedamage)
{
float distance_to_head = vlen(attack_hitpos - head.WarpZone_findradius_nearest);
#endif
}
}
- head = next;
+ head = head.chain;
}
// cone damage trace
head = WarpZone_FindRadius(w_shotorg, WEP_CVAR(shockwave, blast_distance), FALSE);
while(head)
{
- next = head.chain;
-
if((head != self) && head.takedamage)
{
// if it's a player, use the view origin as reference (stolen from RadiusDamage functions in g_damage.qc)
)
);
- final_force = normalize(center - (nearest_on_line - (w_shotdir * WEP_CVAR(shockwave, blast_force_forwardbias))));
+ // calculate damage from multiplier: 1 = "highest" damage, 0 = "lowest" edgedamage
+ final_damage =
+ (
+ (WEP_CVAR(shockwave, blast_damage) * multiplier)
+ +
+ (WEP_CVAR(shockwave, blast_edgedamage) * (1 - multiplier))
+ );
+
+ // figure out the direction of force
+ final_force = (w_shotdir * WEP_CVAR(shockwave, blast_force_forwardbias));
+ final_force = normalize((center - nearest_on_line) + final_force);
//te_lightning2(world, nearest_on_line, (attack_hitpos + (final_force * 200)));
- final_force = ((final_force * WEP_CVAR(shockwave, blast_force)) * multiplier);
+
+ // now multiply the direction by force units
+ final_force *= (WEP_CVAR(shockwave, blast_force) * multiplier);
final_force_z *= WEP_CVAR(shockwave, blast_force_zscale);
- final_damage = (WEP_CVAR(shockwave, blast_damage) * multiplier + WEP_CVAR(shockwave, blast_edgedamage) * (1 - multiplier));
+ // queue damage with this calculated info
if(W_Shockwave_Attack_CheckHit(queue, head, final_force, final_damage)) { ++queue; }
- //print("CONE HIT: multiplier = ", ftos(multiplier), strcat(", damage = ", ftos(final_damage), ", force = ", ftos(vlen(final_force))),"... multiplier_from_accuracy = ", ftos(multiplier_from_accuracy), ", multiplier_from_distance = ", ftos(multiplier_from_distance), ".\n");
+
+ #ifdef DEBUG_SHOCKWAVE
+ print(sprintf(
+ "BLAST HIT: multiplier = %f, damage = %f, force = %f... "
+ "multiplier_from_accuracy = %f, multiplier_from_distance = %f.\n",
+ multiplier,
+ final_damage,
+ vlen(final_force),
+ multiplier_from_accuracy,
+ multiplier_from_distance
+ ));
+ #endif
}
}
- head = next;
+ head = head.chain;
}
for(i = 1; i <= queue; ++i)
final_damage = shockwave_hit_damage[i];
Damage(head, self, self, final_damage, WEP_SHOCKWAVE, head.origin, final_force);
- print("SHOCKWAVE by ", self.netname, ": damage = ", ftos(final_damage), ", force = ", ftos(vlen(final_force)), ".\n");
+ #ifdef DEBUG_SHOCKWAVE
+ print(sprintf(
+ "SHOCKWAVE by %s: damage = %f, force = %f.\n",
+ self.netname,
+ final_damage,
+ vlen(final_force)
+ ));
+ #endif
shockwave_hit[i] = world;
shockwave_hit_force[i] = '0 0 0';
shockwave_hit_damage[i] = 0;
}
- //print("queue was ", ftos(queue), ".\n\n");
}
float W_Shockwave(float req)