Index: weapon/beam.cpp =================================================================== --- weapon/beam.cpp (revision 5829) +++ weapon/beam.cpp (working copy) @@ -2866,9 +2866,9 @@ } // if no damage - don't even indicate it has been hit - if(wi->damage <= 0){ - do_damage = 0; - } +// if(wi->damage <= 0){ +// do_damage = 0; +// } // increment collision count r_coll_count++; @@ -3218,9 +3218,9 @@ // don't whack docked ships // Goober5000 - whacking docked ships should work now, so whack them // Goober5000 - weapons with no mass don't whack (bypass the calculations) - if(/*object_is_docked(objp) ||*/ (wip->mass == 0.0f)) { - return; - } +// if(/*object_is_docked(objp) ||*/ (wip->mass == 0.0f)) { +// return; +// } // determine how big of a whack to apply float whack; @@ -3239,13 +3239,26 @@ // whack direction vec3d whack_dir, temp; - vm_vec_dist_to_line(&objp->pos, &b->last_start, &b->last_shot, &temp, &dist); - vm_vec_sub(&whack_dir, &objp->pos, &temp); - vm_vec_normalize(&whack_dir); - vm_vec_scale(&whack_dir, whack); + if(wip->mass != 0.0f){ + vm_vec_dist_to_line(&objp->pos, &b->last_start, &b->last_shot, &temp, &dist); + vm_vec_sub(&whack_dir, &objp->pos, &temp); + vm_vec_normalize(&whack_dir); + vm_vec_scale(&whack_dir, whack); + + // apply the whack + ship_apply_whack(&whack_dir, hit_point, objp); + } + + // apply a 'push' whack for tractor beam type stuff + if(wip->b_info.push != 0.0f){ + whack = wip->b_info.push; + vm_vec_dist_to_line(&objp->pos, &b->last_start, &b->last_shot, &temp, &dist); + vm_vec_sub(&whack_dir, &objp->pos, &b->last_start); + vm_vec_normalize(&whack_dir); + vm_vec_scale(&whack_dir, whack); - // apply the whack - ship_apply_whack(&whack_dir, hit_point, objp); + ship_apply_whack(&whack_dir, hit_point, objp); + } } // return the amount of damage which should be applied to a ship. basically, filters friendly fire damage Index: weapon/weapon.h =================================================================== --- weapon/weapon.h (revision 5829) +++ weapon/weapon.h (working copy) @@ -226,7 +226,8 @@ float beam_shrink_pct; // what percent/second the beam shrinks at beam_weapon_section_info sections[MAX_BEAM_SECTIONS]; // info on the visible sections of the beam float range; // how far it will shoot-Bobboau - float damage_threshold; // point at wich damage will start being atenuated from 0.0 to 1.0 + float damage_threshold; // point at which damage will start being atenuated from 0.0 to 1.0 + float push; // similar to mass, in fact works how mass does on primaries float beam_width; // width of the beam (for certain collision checks) int beam_flash_idx; // idx of the ani used for the beam impact flash float beam_flash_radius; // radius of the flash Index: weapon/weapons.cpp =================================================================== --- weapon/weapons.cpp (revision 5829) +++ weapon/weapons.cpp (working copy) @@ -916,6 +916,7 @@ wip->b_info.beam_shrink_pct = 0.0f; wip->b_info.range = BEAM_FAR_LENGTH; wip->b_info.damage_threshold = 1.0f; + wip->b_info.push = 0.0f; wip->b_info.beam_width = -1.0f; wip->b_info.beam_flash_idx = -1; wip->b_info.beam_flash_radius = 0.0f; @@ -2008,6 +2009,9 @@ if ( optional_string("+Attenuation:") ) stuff_float(&wip->b_info.damage_threshold); + if ( optional_string("+Push:") ) + stuff_float(&wip->b_info.push); + if ( optional_string("+BeamWidth:") ) stuff_float(&wip->b_info.beam_width);