

function DefendAction(character){
	this.name = "defend";
	this.character = character;
	this.animation = character.animations["defend"];
	this.relations = new Array();
	this.age = 0;
}

DefendAction.prototype.update = function(time){
	this.animation.addTime(time);
	for(var i = 0; i < this.relations.length; i++){
		var rel = this.relations[i];
		var res = rel.condition();
		if(res){
			return rel.targetAction;
		}
	}
	
	this.age += time;
	return this;
}

DefendAction.prototype.setTime = function(time){
	this.age = time;
	this.animation.setTime(time);
}


