fixed bugs

all effects must have a time cost, otherwise AI can enter an
infinite loop

modifyEntity must be called once per effect, otherwise if one
call changes an entity, the second one won't match that entity
any more

added a check in randFloors to test if there's even enough floors
to find to prevent an infinite loop