<commit_before>Enemy.Yellow = function (state, x, y, key, fireProba) {

   Phaser.Sprite.call(this, state.game, x, y, key, 10);

   this.texture.baseTexture.scaleMode = PIXI.scaleModes.NEAREST;

   this.bulletSpeed = 100;
   this.power = 100;
   this.type = 6;
   this.fireProba = fireProba*0.5;
   this.value = 100;
   this.game.physics.arcade.enable(this);
   this.anchor.setTo(0.5);		
   this.body.immovable = true;
   this.state = state;
   this.health = 10;

   this.shots = this.game.add.group(game.world, 'bullet pool', false, true, Phaser.Physics.ARCADE);

   this.animations.add('move', [10, 11], 6, true);
   this.animations.play('move');

   return this;
};

Enemy.Yellow.prototype = Object.create(Phaser.Sprite.prototype);
Enemy.Yellow.prototype.constructor = Enemy.Yellow;

Enemy.Yellow.prototype.livingShots = function() {
   return this.shots.countLiving();
}

Enemy.Yellow.prototype.update = function() {
   this.game.physics.arcade.collide(this.shots, this.state.player, this.collide, function(){return (!this.state.lostAlife && this.state.shield_time == 0);}, this);

   if (this.alive && Math.random() < this.fireProba && this.state.clear_nofiretime == 0) 
      this.fire();
}

Enemy.Yellow.prototype.collide = function(player, shot) {
   this.state.playerHit(player, shot);
}

Enemy.Yellow.prototype.fire = function () {
   var x = this.x;
   var y = this.y;

   if (!this.state.mute) {
      this.state.enemyfire_sd.play();
   }

   try {
      this.shots.getFirstDead().fire(x, y, 0, -this.bulletSpeed, 0, 0);
   } catch(err) {
      this.shots.add(new Shot(game, 'enemyshots', 5, 10), true);
      this.shots.getFirstExists(false).fire(x, y, 0, -this.bulletSpeed, 0, 0);
   }
};

Enemy.Yellow.prototype.death = function(obj) {
   var x = this.x;
   var y = this.y;
   var speed = 250;

   if (!this.state.mute) {
      this.state.enemyfire_sd.play();
   }

   try {
      this.shots.getFirstDead().fire(x, y,  17.74 , -speed, 0, 0);
   } catch(err) {
      this.shots.add(new Shot(game, 'enemyshots', 5, 10), true);
      this.shots.setAll('tracking', true);
      this.shots.getFirstExists(false).fire(x, y, 17.74 , -speed, 0, 0);
   }

   try {
      this.shots.getFirstDead().fire(x, y, 9.09, -speed, 0, 0);
   } catch(err) {
      this.shots.add(new Shot(game, 'enemyshots', 5, 10), true);
      this.shots.setAll('tracking', true);
      this.shots.getFirstExists(false).fire(x, y, 9.09 , -speed, 0, 0);
   }

   try {
      this.shots.getFirstDead().fire(x, y,  0, -speed, 0, 0);
   } catch(err) {
      this.shots.add(new Shot(game, 'enemyshots', 5, 10), true);
      this.shots.setAll('tracking', true);
      this.shots.getFirstExists(false).fire(x, y, 0, -speed, 0, 0);
   }

   try {
      this.shots.getFirstDead().fire(x, y,  -9.09, -speed, 0, 0);
   } catch(err) {
      this.shots.add(new Shot(game, 'enemyshots', 5, 10), true);
      this.shots.setAll('tracking', true);
      this.shots.getFirstExists(false).fire(x, y, -9.09, -speed, 0, 0);
   }

   try {
      this.shots.getFirstDead().fire(x, y,  -17.74 , -speed, 0, 0);
   } catch(err) {
      this.shots.add(new Shot(game, 'enemyshots', 5, 10), true);
      this.shots.setAll('tracking', true);
      this.shots.getFirstExists(false).fire(x, y, -17.74 , -speed, 0, 0);
   }

   this.destroy();
}
<commit_msg>fix death<commit_after>Enemy.Yellow = function (state, x, y, key, fireProba) {

   Phaser.Sprite.call(this, state.game, x, y, key, 10);

   this.texture.baseTexture.scaleMode = PIXI.scaleModes.NEAREST;

   this.bulletSpeed = 100;
   this.power = 100;
   this.type = 6;
   this.fireProba = fireProba*0.5;
   this.value = 100;
   this.game.physics.arcade.enable(this);
   this.anchor.setTo(0.5);		
   this.body.immovable = true;
   this.state = state;
   this.health = 10;

   this.shots = this.game.add.group(game.world, 'bullet pool', false, true, Phaser.Physics.ARCADE);

   this.animations.add('move', [10, 11], 6, true);
   this.animations.play('move');

   this.events.onKilled.add(this.death, this);

   return this;
};

Enemy.Yellow.prototype = Object.create(Phaser.Sprite.prototype);
Enemy.Yellow.prototype.constructor = Enemy.Yellow;

Enemy.Yellow.prototype.livingShots = function() {
   return this.shots.countLiving();
}

Enemy.Yellow.prototype.update = function() {
   this.game.physics.arcade.collide(this.shots, this.state.player, this.collide, function(){return (!this.state.lostAlife && this.state.shield_time == 0);}, this);

   if (this.alive && Math.random() < this.fireProba && this.state.clear_nofiretime == 0) 
      this.fire();
}

Enemy.Yellow.prototype.collide = function(player, shot) {
   this.state.playerHit(player, shot);
}

Enemy.Yellow.prototype.fire = function () {
   var x = this.x;
   var y = this.y;

   if (!this.state.mute) {
      this.state.enemyfire_sd.play();
   }

   try {
      this.shots.getFirstDead().fire(x, y, 0, -this.bulletSpeed, 0, 0);
   } catch(err) {
      this.shots.add(new Shot(game, 'enemyshots', 5, 10), true);
      this.shots.getFirstExists(false).fire(x, y, 0, -this.bulletSpeed, 0, 0);
   }
};

Enemy.Yellow.prototype.death = function(obj) {
   var x = this.x;
   var y = this.y;
   var speed = 250;

   if (!this.state.mute) {
      this.state.enemyfire_sd.play();
   }

   try {
      this.shots.getFirstDead().fire(x, y,  17.74 , -speed, 0, 0);
   } catch(err) {
      this.shots.add(new Shot(game, 'enemyshots', 5, 10), true);
      this.shots.setAll('tracking', true);
      this.shots.getFirstExists(false).fire(x, y, 17.74 , -speed, 0, 0);
   }

   try {
      this.shots.getFirstDead().fire(x, y, 9.09, -speed, 0, 0);
   } catch(err) {
      this.shots.add(new Shot(game, 'enemyshots', 5, 10), true);
      this.shots.setAll('tracking', true);
      this.shots.getFirstExists(false).fire(x, y, 9.09 , -speed, 0, 0);
   }

   try {
      this.shots.getFirstDead().fire(x, y,  0, -speed, 0, 0);
   } catch(err) {
      this.shots.add(new Shot(game, 'enemyshots', 5, 10), true);
      this.shots.setAll('tracking', true);
      this.shots.getFirstExists(false).fire(x, y, 0, -speed, 0, 0);
   }

   try {
      this.shots.getFirstDead().fire(x, y,  -9.09, -speed, 0, 0);
   } catch(err) {
      this.shots.add(new Shot(game, 'enemyshots', 5, 10), true);
      this.shots.setAll('tracking', true);
      this.shots.getFirstExists(false).fire(x, y, -9.09, -speed, 0, 0);
   }

   try {
      this.shots.getFirstDead().fire(x, y,  -17.74 , -speed, 0, 0);
   } catch(err) {
      this.shots.add(new Shot(game, 'enemyshots', 5, 10), true);
      this.shots.setAll('tracking', true);
      this.shots.getFirstExists(false).fire(x, y, -17.74 , -speed, 0, 0);
   }

   this.destroy();
}

{'fraction_non_alphanumeric': 0.18425007514277125, 'fraction_numerical': 0.030658250676284943, 'mean_word_length': 3.028450363196126, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 3, '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': '2056310', 'n_tokens_mistral': 2766, 'n_tokens_neox': 2531, 'n_words': 471}