- // calculate our own hit origin as trace_endpos tends to jump around annoyingly (to player origin?)
- // NO. trace_endpos should be just fine. If not,
- // that's an engine bug that needs proper debugging.
- vector hitorigin = trace_endpos;
-
- float falloff = ExponentialFalloff(
- WEP_CVAR(arc, beam_falloff_mindist),
- WEP_CVAR(arc, beam_falloff_maxdist),
- WEP_CVAR(arc, beam_falloff_halflifedist),
- vlen(WarpZone_UnTransformOrigin(WarpZone_trace_transform, hitorigin) - w_shotorg)
- );
-
- // TODO: api or event for things that can be healed
- if(IS_VEHICLE(trace_ent) && SAME_TEAM(own, trace_ent))
- {
- float roothealth = ((burst) ? WEP_CVAR(arc, burst_healing_hps) : WEP_CVAR(arc, beam_healing_hps));
- // not handling shield, since it's not exactly a defensive stat
-
- if(trace_ent.vehicle_health <= trace_ent.max_health && roothealth)
- {
- trace_ent.vehicle_health = min(
- trace_ent.vehicle_health + (roothealth * coefficient),
- trace_ent.max_health
- );
- if(trace_ent.owner)
- trace_ent.owner.vehicle_health = (trace_ent.vehicle_health / trace_ent.max_health) * 100;
- new_beam_type = ARC_BT_HEAL;
- }
- }
- else if(trace_ent.classname == "onslaught_generator" && SAME_TEAM(own, trace_ent))
- {
- float roothealth = ((burst) ? WEP_CVAR(arc, burst_healing_hps) : WEP_CVAR(arc, beam_healing_hps));
- if(roothealth)
- {
- if(GetResourceAmount(trace_ent, RESOURCE_HEALTH) <= trace_ent.max_health)
- {
- GiveResourceWithLimit(trace_ent, RESOURCE_HEALTH, (roothealth * coefficient), trace_ent.max_health);
- WaypointSprite_UpdateHealth(trace_ent.sprite, GetResourceAmount(trace_ent, RESOURCE_HEALTH));
- trace_ent.frame = 10 * bound(0, (1 - GetResourceAmount(trace_ent, RESOURCE_HEALTH) / trace_ent.max_health), 1);
- trace_ent.lasthealth = GetResourceAmount(trace_ent, RESOURCE_HEALTH);
- trace_ent.SendFlags |= GSF_STATUS;
- }
- new_beam_type = ARC_BT_HEAL;
- }
- }
- else if(trace_ent.classname == "onslaught_controlpoint_icon" && SAME_TEAM(own, trace_ent))