Code: Select all
this.shipTakingDamage = function (amount, whom, type)
{
// if amount != 0 , shields have failed to absorb the hit
if ( amount !=0 ) { return; };
// try to determine whether forward or aft shield is hit
if( whom && whom.isValid && (whom.vectorForward.angleTo(whom.position.subtract(player.ship.position)) > 0.5 * Math.PI) )
{
// forward shield hit
player.ship.forwardShield += this._rsd_factor;
}
else
{
// aft hit
player.ship.aftShield += this._rsd_factor;
};
};
My intent is to have this only act for laser hits, but i couldn't find a description of the damagetype parameter.
I'm not sure yet whether i'll make an oxp/oxz out of it, as it does feel like a cheat.
It would make life easier for new players though, giving them a better chance to have fun playing.
A possibility would be to check for player elite ranking and disable the functionality if player is above a certain level
(above average ?) .