Is it illegal to kill one's own kind in order to get a chance to survive in an emergency?

Killing is illegal, has nothing to do with self-defense, and does not meet the conditions of emergency hedging, because people's right to life is equal, and only the legitimate interests protected outweigh the losses can constitute emergency hedging.

I don't think it's illegal to rob directly, because robbing a lifebuoy and using it with others to save people will endanger their lives. For the matter of sacrificing yourself, you can only ask yourself and not force others, so the law will not stipulate this, and you can only accept moral condemnation.