1
0

FIX: New rounds starting while a player has 0 hp (fixes #10)

This commit is contained in:
Kwarde 2024-01-16 16:45:43 +01:00
parent 8e96f8d1de
commit 7f900a6541

17
game.py
View File

@ -118,6 +118,16 @@ try:
# Weird, right? To have round_end() at the start of a round.
# There will be multiple conditions where the current iteration will end.
# I'm lazy, hence why it's here :-)
if player1.health == 0:
print("END! {name} has been defeated. Congratulations {name2}!".format(name=player1.name, name2=player2.name))
game_running = False
break
elif player2.health == 0:
print("END! {name} has been defeated. Congratulations {name2}!".format(name=player2.name, name2=player1.name))
game_running = False
break
round_end()
print("== Round {round} ==".format(round=current_round))
@ -202,13 +212,6 @@ try:
slowest_caster.active_spell = spell_object_none
slowest_caster.active_spell_levenshtein_distance = 0
if player1.health == 0:
print("END! {name} has been defeated. Congratulations {name2}!".format(name=player1.name, name2=player2.name))
game_running = False
elif player2.health == 0:
print("END! {name} has been defeated. Congratulations {name2}!".format(name=player2.name, name2=player1.name))
game_running = False
except KeyboardInterrupt:
print()
print("<!> Duel ended because both {} and {} suddenly decided to test out their apparition skill!".format(player1.name, player2.name))