src/entities/Enemy.js
/**
	* Resets the enemy after a death.
	*
	* @return {Enemy} A reference to this game entity.
	*/
Resets the enemy after a death.
@return {Enemy} A reference to this game entity.
Resets the enemy after a death . @return { Enemy } A reference to this game entity .
reset() {
		this.health = this.maxHealth;
		this.status = STATUS_ALIVE;
		this.resetSearch();
		this.ignoreHealth = false;
		this.ignoreWeapons = false;
		this.brain.clearSubgoals();
		this.memoryRecords.length = 0;
		this.memorySystem.clear();
		this.targetSystem.reset();
		this.weaponSystem.reset();
		this.resetAnimations();
		const run = this.animations.get( 'soldier_forward' );
		run.enabled = true;
		return this;
	}
reset ( ) { this . health = this . maxHealth ; this . status = STATUS_ALIVE ; this . resetSearch ( ) ; this . ignoreHealth = false ; this . ignoreWeapons = false ; this . brain . clearSubgoals ( ) ; this . memoryRecords . length = 0 ; this . memorySystem . clear ( ) ; this . targetSystem . reset ( ) ; this . weaponSystem . reset ( ) ; this . resetAnimations ( ) ; const run = this . animations . get ( 'soldier_forward' ) ; run . enabled = true ; return this ; }
Resets the enemy after a death.
Resets the enemy after a death .
// reset search for attacker // items // clear brain and memory // reset target and weapon system // reset all animations // set default animation