Added affect function to temporarily apply effects to entity properties