'use strict';

Darwinator.MeleeWeapon = function (game, coolDown, damage, owner) {
    Darwinator.Weapon.call(this, game, coolDown, damage, owner);

    // nothing permanent here, just some values to get started with implementation
    this.coolDown           = 250;
    this.damage             = this.owner.damage;
    this.knockBackDistance  = 2 * this.owner.attributes.strength;
};

Darwinator.MeleeWeapon.prototype = Object.create(Darwinator.Weapon.prototype);

Darwinator.MeleeWeapon.prototype.strike = function(target){
  if (!this.onCooldown()){
    var crit  = Math.random() - this.criticalStrike;
    var dmg   = this.damage;

    if (crit < 0){
      dmg *= 2;
    }
    target.takeDamage(dmg);
    this.lastAttack = Date.now();
    this.knockBack(target);
    return dmg;
  }
};

Darwinator.MeleeWeapon.prototype.knockBack = function(target){
    var angle           = this.game.physics.arcade.angleBetween(this.owner, target);
    var targetFuturePos = Darwinator.Helpers.calculatePosition(target.x, target.y, this.knockBackDistance, angle);
    target.knockedBack  = true;
    target.knockBackPos = targetFuturePos;
};
@@ -338,16 +338,22 @@
 tance  =
+ 100 +
  2 * thi
@@ -786,16 +786,28 @@
 mg;%0A  %7D%0A
+  return 0;%0A
 %7D;%0A%0ADarw

make sure undefined is not added to enemy damage statistics