Add effects from 1.7

I don't really have any clue on what it really does. I've just copied it from the old implementation.