require( "scripts/objects/youngchildbed.lua" );


camayoungchild = youngchildbed:new{
	anchor_x=10,
	anchor_y=-30,
	object_name="camayoungchild",
	
}

function youngchildbed:parent_action()	
	self.parent_is_coming = false;
	DebugOut("simple_object:parent_action:"..self.object_name);
	
	if self.parent_chosen == "dad" then
		HideDadIcon(self.object_name);
	else
		HideMomIcon(self.object_name);
	end
	
	RemoveObjectFromClickedList(self.object_name);
	if GetCharacterState(self.parent_chosen) == self.parent_state_action and self.object_is_dirty and GetObjectState("jumpingsquare") == "clean" then
		if self.sound_of_work_enable then
			if self.parent_chosen == "dad" then
				PlaySound("working_father", true);
			else
				PlaySound("working_mother", true);
			end
		end
		PlayCharacterAnimation(self.parent_chosen, self.character_cleaning_animation);
		FlipAnimation(self.parent_chosen, self.flipped_animation);
		PlayObjectAnimation(self.object_name, self.object_cleaning_animation);
		
		if self.show_cleaning_particle then
			--ShowParticle(self.object_name, "effects/powder.lua", "0", "0"););
			ShowParticle(self.object_name, "effects/powder.lua", self.particle_x, self.particle_y);
		end
		
		ChangeObjectState(self.object_name, self.cleaning_state_name);
		SetCharacterState(self.parent_chosen, self.cleaning_state_name);
		self.new_state_start_time = GetCurrentTime();
		self:get_cleaning_state_time();
		
		if self.cleaning_timer_enabled then
			SetCleaningTimerVisible(self.object_name, true);
		end
		
		if self.sound_of_cleaning ~= "" then
			PlaySound(self.sound_of_cleaning, true);
		end
	else
		ShowMiss(self.object_name);
		if self.stress_inc_enabled and not self.no_stress_power then
			AddFutureCharacterStress(self.parent_chosen, -self.stress_inc);
		end
		if self.no_stress_power then
			HideNoStressIcon(self.object_name);
		end
		self.no_stress_power = false;
		FinishCharacterTask(self.parent_chosen);
		self.parent_chosen = "";
		self.click_enable = self.set_click_enable;
		if self.object_is_dirty then
			IncludeObjectMouseHandler(self.object_name);			
			self.click_enable = true;
			PlayObjectAnimation(self.object_name, self.object_dirty_animation);	
			--PlayGlowAnimation(self.object_name, "dirty");
		else
			if self.click_enable then
				IncludeObjectMouseHandler(self.object_name);
			end
		end
	end
end