1
0

Cast spells if one of two player fails to cast their spell. Adds player.cast_spell(): Not scripted yet, currently just a placeholder so that cast_spell() prints somethin when called! (and modifies health)

This commit is contained in:
2024-01-15 15:36:37 +01:00
parent 7f6ccb15ef
commit fd8b6567f7
3 changed files with 41 additions and 7 deletions

View File

@ -54,4 +54,9 @@ class Player:
elif (spell.type == SPELL_TYPE_USELESS):
return "{name} must not be feeling well, since they casted a non existing spell. Cast FAILED!".format(name=self.name)
else: message = "{name} tried to cast '{spell}' but mispronounced it. Cast FAILED!"
return message.format(name=self.name, spell=spell.name)
return message.format(name=self.name, spell=spell.name)
def cast_spell(self, spell: Spell, opponent): #: Player ?
# Below is pretty much a placeholder and will be implemented after placing all cast_spell()s in game.py
print("> {} hits {} and does {} damage!".format(self.name, opponent.name, spell.damage))
opponent.health -= spell.damage