implemented main logic for saving invincibility to save state file - does not work yet