Add possibility to change the language

This commit is contained in:
Yohann D'ANELLO
2020-11-27 20:53:24 +01:00
parent 2498fd2a61
commit 4287b4f045
5 changed files with 30 additions and 8 deletions

View File

@ -129,7 +129,7 @@ class Map:
"""
Put randomly {count} hedgehogs on the map, where it is available.
"""
for _ in range(count):
for ignored in range(count):
y, x = 0, 0
while True:
y, x = randint(0, self.height - 1), randint(0, self.width - 1)
@ -392,7 +392,7 @@ class FightingEntity(Entity):
Deals damage to the opponent, based on the stats
"""
return _("{name} hits {opponent}.")\
.format(name=str(self), opponent=str(opponent)) + " "\
.format(name=self.name, opponent=opponent.name) + " "\
+ opponent.take_damage(self, self.strength)
def take_damage(self, attacker: "Entity", amount: int) -> str:
@ -403,8 +403,8 @@ class FightingEntity(Entity):
if self.health <= 0:
self.die()
return _("{name} takes {amount} damage.")\
.format(name=str(self), amount=str(amount)) \
+ (" " + "{name} dies.".format(name=str(self))
.format(name=self.name, amount=str(amount)) \
+ (" " + "{name} dies.".format(name=self.name)
if self.health <= 0 else "")
def die(self) -> None: