src/entities/Enemy.js
/**
	* Ignores the given item type for a certain amount of time.
	*
	* @param {Number} type - The item type.
	* @return {Enemy} A reference to this game entity.
	*/
Ignores the given item type for a certain amount of time.
@param {Number} type - The item type.
@return {Enemy} A reference to this game entity.
Ignores the given item type for a certain amount of time . @param { Number } type - The item type . @return { Enemy } A reference to this game entity .
ignoreItem( type ) {
		switch ( type ) {
			case HEALTH_PACK:
				this.ignoreHealth = true;
				this.endTimeIgnoreHealth = this.currentTime + this.ignoreItemsTimeout;
				break;
			case WEAPON_TYPES_SHOTGUN:
				this.ignoreShotgun = true;
				this.endTimeIgnoreShotgun = this.currentTime + this.ignoreItemsTimeout;
				break;
			case WEAPON_TYPES_ASSAULT_RIFLE:
				this.ignoreAssaultRifle = true;
				this.endTimeIgnoreAssaultRifle = this.currentTime + this.ignoreItemsTimeout;
				break;
			default:
				console.error( 'DIVE.Enemy: Invalid item type:', type );
				break;
		}
		return this;
	}
ignoreItem ( type ) { switch ( type ) { case HEALTH_PACK : this . ignoreHealth = true ; this . endTimeIgnoreHealth = this . currentTime + this . ignoreItemsTimeout ; break ; case WEAPON_TYPES_SHOTGUN : this . ignoreShotgun = true ; this . endTimeIgnoreShotgun = this . currentTime + this . ignoreItemsTimeout ; break ; case WEAPON_TYPES_ASSAULT_RIFLE : this . ignoreAssaultRifle = true ; this . endTimeIgnoreAssaultRifle = this . currentTime + this . ignoreItemsTimeout ; break ; default : console . error ( 'DIVE.Enemy: Invalid item type:' , type ) ; break ; } return this ; }
Ignores the given item type for a certain amount of time.
Ignores the given item type for a certain amount of time .