Wave effects on energy-harvesting performance of flapping hydrofoil