It looks like this is saying:
- if I start the battle with more than 0 hp, battle the ghost and decrease my hp
- at that point if I have 0 or more hp, I win the battle and gain xp
- if I have enough xp, I gain a level
- I have less than 0 hp after the battle, I lose my clothes but my hp is reset to 0 (so I don't die)
- at that point if I have 0 or more hp, I win the battle and gain xp
- if I start the battle with 0 or less hp, I'm dead
Is that correct? It seems to work that way in the game when I tested it. I also did a simpler test of nested if/else statements, and that worked for me.