diff --git a/app/Game/Channel/GameObjects/Doll.js b/app/Game/Channel/GameObjects/Doll.js index 3b107c0..4a8fa16 100755 --- a/app/Game/Channel/GameObjects/Doll.js +++ b/app/Game/Channel/GameObjects/Doll.js @@ -69,7 +69,10 @@ function (Parent, Item, Box2D, Nc, Assert) { // Max danger of knife: 3 var dangerDamage = item.options.danger / 3; - var damage = velocityDamage * (weightDamage * 180 + dangerDamage * 80); + // + 0.5 and / 2: offsetting for lower velocity impact + // * 300: tested imperically by throwing piano from deadly height + // * 80: tested imperically by throwing knife fast + var damage = (velocityDamage + 0.5) * (weightDamage * 300 + dangerDamage * 80) / 2; var callback = function() { self.player.addDamage(damage, item.lastMoved.player, item); diff --git a/app/Game/Channel/Player.js b/app/Game/Channel/Player.js index 46a12fd..0e2779c 100755 --- a/app/Game/Channel/Player.js +++ b/app/Game/Channel/Player.js @@ -60,29 +60,19 @@ function (Parent, Nc) { } }; - Player.prototype.addDamage = function(damage, enemy, byItem, reheal) { + Player.prototype.addDamage = function(damage, enemy, byItem) { this.stats.health -= damage; - if(this.stats.health > 100) this.stats.health = 100; if(this.stats.health < 0) this.stats.health = 0; - - /* + if(this.stats.health <= 0) { if(enemy != this) enemy.score(); this.kill(enemy, byItem); } else { this.broadcastStats(); } - */ + this.broadcastStats(); - - if (!reheal) { - // reheal hack after 1 second - var self = this; - setTimeout(function(){ - self.addDamage(-100, enemy, byItem, true); - }, 2500); - } }; Player.prototype.spawn = function(x, y) { @@ -104,8 +94,6 @@ function (Parent, Nc) { item: byItem ? byItem.options.name : "Suicide" }); - - Nc.trigger(Nc.ns.channel.events.game.player.killed, this, killedByPlayer); // sends endround if(this.ragDoll) { diff --git a/app/Game/Client/View/DomController.js b/app/Game/Client/View/DomController.js index 586e9cf..bb4c74d 100755 --- a/app/Game/Client/View/DomController.js +++ b/app/Game/Client/View/DomController.js @@ -186,7 +186,7 @@ function (Settings, Nc, Screenfull, Graph, PointerLockManager) { setTimeout(function(){self.ping.innerHTML = "Reload in 3...".replace(/ /g, ' ');}, 6000); setTimeout(function(){self.ping.innerHTML = "Reload in 2...".replace(/ /g, ' ');}, 7000); setTimeout(function(){self.ping.innerHTML = "Reload in 1...".replace(/ /g, ' ');}, 8000); - setTimeout(function(){self.ping.innerHTML = "Reload now. ".replace(/ /g, ' '); location.reload(); }, 1000); + setTimeout(function(){self.ping.innerHTML = "Reload now. ".replace(/ /g, ' '); location.reload(); }, 9000); } }; diff --git a/app/Game/Config/ItemSettings.js b/app/Game/Config/ItemSettings.js index 92331ab..0546123 100644 --- a/app/Game/Config/ItemSettings.js +++ b/app/Game/Config/ItemSettings.js @@ -367,7 +367,7 @@ function () { "category": "livingroom", "image": "piano.gif", - "weight": "15", + "weight": "10", "width": "66", "height": "48",