<commit_before>var RPYeti = RPYeti || {};

RPYeti.Yeti = function (group) {
	RPYeti.Character.call( this );

	this.name = '';
	this.type = 'Yeti';

	this.health = RPYeti.config.character.yeti.health;

	this.model = RPYeti.loader.models.yeti.clone();
	this.model.userData.character = this;
	this.model.name = 'yeti model';

	this.pivot.add(this.model);

	(function (self) {
		self.model.traverse(function(child) {
			child.userData.character = self;
		});
	})(this);

	this.group = group;
	group.add(this.pivot);
};

RPYeti.Yeti.prototype = Object.create( RPYeti.Character.prototype );
RPYeti.Yeti.prototype.constructor = RPYeti.Yeti;

RPYeti.Yeti.prototype.position = function (x, z, scale, lookAtPos) {
	RPYeti.Character.prototype.position.call( this, x, z, scale, lookAtPos );
};

RPYeti.Yeti.prototype.hide = function () {
	this.model.rotation.set(0, 0, 0);
	this.model.position.y = 8.5;
	this.model.position.x = -2;

	this.bounds = new THREE.Box3().setFromObject(this.model);
	this.pivot.translateY(-(Math.abs(this.bounds.max.y) + Math.abs(this.bounds.min.y)));
};

RPYeti.Yeti.prototype.appear = function () {
	(function (self) {
		self.positionTween = new TWEEN.Tween(self.pivot.position)
			.easing(RPYeti.config.character.yeti.appearEasing)
			.onComplete(function () {
				RPYeti.Character.prototype.appear.call( self );
			});

		self.positionTween.to({ y: Math.abs(self.bounds.max.y) }, RPYeti.config.character.yeti.appearDuration).start();
	})(this);
};

RPYeti.Yeti.prototype.disappear = function () {
	(function (self) {
		self.positionTween = new TWEEN.Tween(self.pivot.position)
			.easing(RPYeti.config.character.yeti.disappearEasing)
			.onComplete(function () {
				RPYeti.Character.prototype.disappear.call( self );
			});

		self.positionTween.to({ y: -Math.abs(self.bounds.max.y) }, RPYeti.config.character.yeti.disappearDuration).start();
	})(this);
};

RPYeti.Yeti.prototype.hit = function (byObject) {
	RPYeti.Character.prototype.hit.call( this, byObject );
};

RPYeti.Yeti.prototype.defeat = function (byObject) {
	(function (self) {
		if (!self.isDefeated) {<commit_msg>fixed a tween race condition<commit_after>var RPYeti = RPYeti || {};

RPYeti.Yeti = function (group) {
	RPYeti.Character.call( this );

	this.name = '';
	this.type = 'Yeti';

	this.health = RPYeti.config.character.yeti.health;

	this.model = RPYeti.loader.models.yeti.clone();
	this.model.userData.character = this;
	this.model.name = 'yeti model';

	this.pivot.add(this.model);

	(function (self) {
		self.model.traverse(function(child) {
			child.userData.character = self;
		});
	})(this);

	this.group = group;
	group.add(this.pivot);
};

RPYeti.Yeti.prototype = Object.create( RPYeti.Character.prototype );
RPYeti.Yeti.prototype.constructor = RPYeti.Yeti;

RPYeti.Yeti.prototype.position = function (x, z, scale, lookAtPos) {
	RPYeti.Character.prototype.position.call( this, x, z, scale, lookAtPos );
};

RPYeti.Yeti.prototype.hide = function () {
	this.model.rotation.set(0, 0, 0);
	this.model.position.y = 8.5;
	this.model.position.x = -2;

	this.bounds = new THREE.Box3().setFromObject(this.model);
	this.pivot.translateY(-(Math.abs(this.bounds.max.y) + Math.abs(this.bounds.min.y)));
};

RPYeti.Yeti.prototype.appear = function () {
	(function (self) {
		self.positionTween = new TWEEN.Tween(self.pivot.position)
			.easing(RPYeti.config.character.yeti.appearEasing)
			.onComplete(function () {
				RPYeti.Character.prototype.appear.call( self );
			});

		self.positionTween.to({ y: Math.abs(self.bounds.max.y) }, RPYeti.config.character.yeti.appearDuration).start();
	})(this);
};

RPYeti.Yeti.prototype.disappear = function () {
	if (!self.isDefeated) {
		(function (self) {
			self.positionTween = new TWEEN.Tween(self.pivot.position)
				.easing(RPYeti.config.character.yeti.disappearEasing)
				.onComplete(function () {
					RPYeti.Character.prototype.disappear.call( self );
				});

			self.positionTween.to({ y: -Math.abs(self.bounds.max.y) }, RPYeti.config.character.yeti.disappearDuration).start();
		})(this);
	}
};

RPYeti.Yeti.prototype.hit = function (byObject) {
	RPYeti.Character.prototype.hit.call( this, byObject );
};

RPYeti.Yeti.prototype.defeat = function (byObject) {
	(function (self) {
		if (!self.isDefeated) {
{'fraction_non_alphanumeric': 0.1729093050647821, 'fraction_numerical': 0.003297997644287397, 'mean_word_length': 4.229064039408867, 'pattern_counts': {'":': 0, '<': 3, '<?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': '4200633', 'n_tokens_mistral': 1705, 'n_tokens_neox': 1608, 'n_words': 218}