<commit_before>'use strict';

Darwinator.Enemy = function(game, target, x, y, health, strength, agility, intellect) {
  if (strength > intellect && strength > agility) {
    this.category = 'enemy_strength';
  } else if (agility > intellect && agility > strength) {
    this.category = 'enemy_agility';
  } else if (intellect > strength && intellect > agility) {
    this.category = 'enemy_intellect';
  } else {
    this.category = 'enemy';
  }
  Darwinator.Entity.call(this, game, x, y, this.category,/* [],*/ health, strength, agility, intellect);

  this.scale.setTo(0.25,0.25);
  this.target = target;
  if(!target)
    console.log('Enemy: target is falsey');
  this.path = [];
  this.attacking = false;
  this.time = null;
  this.overlap = null;
  this.debug = true;
  //Allow enemy to overlap objects, i.e. reduce the hitbox
  //this.body.setRectangle(20*4, 16*4, 0, 16*4);
  this.lastPathUpdate = 0;
  // score properties to measure success
  this.dateOfBirthMs = Date.now();
  this.timeSurvivedMs = undefined; //set this to dateOfBirthMs - Date.now() on death OR end of game round
  this.damageDone = 0;
  // this.body.immovable = true;
};

Darwinator.Enemy.prototype = Object.create(Darwinator.Entity.prototype);

Darwinator.Enemy.prototype.arm = function(weapon) {
  this.weapon = weapon;
};

Darwinator.Enemy.prototype.update = function() {<commit_msg>Only update enemies if they are alive<commit_after>'use strict';

Darwinator.Enemy = function(game, target, x, y, health, strength, agility, intellect) {
  if (strength > intellect && strength > agility) {
    this.category = 'enemy_strength';
  } else if (agility > intellect && agility > strength) {
    this.category = 'enemy_agility';
  } else if (intellect > strength && intellect > agility) {
    this.category = 'enemy_intellect';
  } else {
    this.category = 'enemy';
  }
  Darwinator.Entity.call(this, game, x, y, this.category,/* [],*/ health, strength, agility, intellect);

  this.scale.setTo(0.25,0.25);
  this.target = target;
  if(!target)
    console.log('Enemy: target is falsey');
  this.path = [];
  this.attacking = false;
  this.time = null;
  this.overlap = null;
  this.debug = true;
  //Allow enemy to overlap objects, i.e. reduce the hitbox
  //this.body.setRectangle(20*4, 16*4, 0, 16*4);
  this.lastPathUpdate = 0;
  // score properties to measure success
  this.dateOfBirthMs = Date.now();
  this.timeSurvivedMs = undefined; //set this to dateOfBirthMs - Date.now() on death OR end of game round
  this.damageDone = 0;
};

Darwinator.Enemy.prototype = Object.create(Darwinator.Entity.prototype);

Darwinator.Enemy.prototype.arm = function(weapon) {
  this.weapon = weapon;
};

Darwinator.Enemy.prototype.update = function() {
  if (!this.alive) {
    return;
  }
{'fraction_non_alphanumeric': 0.14550072568940495, 'fraction_numerical': 0.013062409288824383, 'mean_word_length': 3.761658031088083, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 15, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '739203', 'n_tokens_mistral': 975, 'n_tokens_neox': 940, 'n_words': 229}