Add possibility to change the language
This commit is contained in:
@ -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:
|
||||
|
Reference in New Issue
Block a user