add:  var elevationBonus = (this.getHeight() - evt.target.getHeight())/this.traits.elevation.rate * this.traits.elevation.value;  dmg.crush += dmg.crush * elevationBonus; dmg.hack += dmg.hack * elevationBonus; dmg.pierce += dmg.pierce * elevationBonus; console.write( dmg.crush + "|" + dmg.hack ); 
context: function performAttackRanged( evt ){	this.last_combat_time = getGameTime();	// Create a projectile from us, to the target, that will do some damage when it hits them.	dmg = new DamageType();	var a = this.actions.attack.ranged;	dmg.crush = parseInt(a.damage * a.crush);	dmg.hack = parseInt(a.damage * a.hack);	dmg.pierce = parseInt(a.damage * a.pierce);		// Add flank bonus	if(evt.target.traits.flank_penalty)	{		var flank = (evt.target.getAttackDirections()-1)*evt.target.traits.flank_penalty.value;		dmg.crush += dmg.crush * flank;		dmg.hack += dmg.hack * flank;		dmg.pierce += dmg.pierce * flank;	}	// The parameters for Projectile are:		// 1 - The actor to use as the projectile. There are two ways of specifying this:	//     the first is by giving an entity. The projectile's actor is found by looking	//     in the actor of that entity. This way is usual, and preferred - visual	//     information, like the projectile model, should be stored in the actor files.	//     The second way is to give a actor/file name string (e.g. "props/weapon/weap_	//     arrow_front.xml"). This is only meant to be used for 'Acts of Gaia' where	//     there is no originating entity. Right now, this entity is the one doing the	//     firing, so pass this.	// 2 - Where the projectile is coming from. This can be an entity or a Vector3D.	//     For now, that's also us.	// 3 - Where the projectile is going to. Again, either a vector (attack ground?) 	//     or an entity. Let's shoot at our target, lest we get people terribly confused.	// 4 - How fast the projectile should go. To keep things clear, we'll set it to 	//     just a bit faster than the average cavalry.	// 5 - Who fired it? Erm... yep, us again.	// 6 - The function you'd like to call when it hits an entity.	// There's also a seventh parameter, for a function to call when it misses (more	//  accurately, when it hits the floor). At the moment, however, the default	//  action (do nothing) is what we want.	// Parameters 5, 6, and 7 are all optional.		projectile = new Projectile( this, this, evt.target, 12.0, this, projectileEventImpact )		// We'll attach the damage information to the projectile, just to show you can	// do that like you can with most other objects. Could also do this by making	// the function we pass a closure.		projectile.damage = dmg;		// Finally, tell the engine not to send this event to anywhere else - 	// in particular, this shouldn't get to the melee event handler, above.		evt.stopPropagation();		//console.write( "Fire!" );}
meta: 1070	/local1/tlutelli/issta_data/temp/all_js/javascript/2006_temp/2006/1070/dd056390930527dc8190fe0c73bd54f687f110a5/template_entity_script.js/buggy/binaries/data/mods/official/entities/template_entity_script.js