an algorithm of aoe(area of effect)