Let's say that it was 11:00 pm when Sam high-fived some guy who could summon pies. At 12:00 midnight, he'd gain that power. Then let's say in the morning he shake hands when some guy who could summon cats. If he doesn't come into contact with anyone else until 12:00 midnight, he'd be able to gain that power at 12:00. So basically, his power is reset to whatever the last prson he came into contact with every 24 hours