missing commits from last commit 7eb3d0b8b0

This commit is contained in:
logsol 2014-03-19 02:40:03 +01:00
parent 7eb3d0b8b0
commit 039213cf50
11 changed files with 257 additions and 430 deletions

View file

@ -53,14 +53,16 @@ function (Parent, Item, Box2D, Nc) {
if(absItemVelocity.x > max || absItemVelocity.y > max) {
if(item.lastMoved && item.lastMoved.player != this.player) {
var damage = b2Math.SubtractVV(itemVelocity, ownVelocity);
damage.Abs();
damage.Multiply(itemMass);
var damageVector = b2Math.SubtractVV(itemVelocity, ownVelocity);
damageVector.Abs();
damageVector.Multiply(itemMass);
var damage = damageVector.Length() * 2;
damage *= item.options.danger ? item.options.danger : 1;
var player = item.lastMoved.player;
var callback = function() {
self.player.addDamage(damage.Length() * 2, player);
self.player.addDamage(damage, player);
}
Nc.trigger(Nc.ns.channel.engine.worldQueue.add, callback)