From e56bdc16c2a50ba2da266ec7bf1605d1e93b744e Mon Sep 17 00:00:00 2001 From: Yohann D'ANELLO Date: Fri, 8 Jan 2021 11:55:25 +0100 Subject: [PATCH 1/3] Add item description, closes #59 --- squirrelbattle/display/menudisplay.py | 2 ++ squirrelbattle/entities/items.py | 28 +++++++++++++++++++++++++++ 2 files changed, 30 insertions(+) diff --git a/squirrelbattle/display/menudisplay.py b/squirrelbattle/display/menudisplay.py index 6c4d991..4e08436 100644 --- a/squirrelbattle/display/menudisplay.py +++ b/squirrelbattle/display/menudisplay.py @@ -172,6 +172,7 @@ class PlayerInventoryDisplay(MenuDisplay): and self.selected else f" {rep} " self.addstr(self.pad, i + 1, 0, selection + " " + item.translated_name.capitalize() + + (f" ({item.description})" if item.description else "") + (": " + str(item.price) + " Hazels" if self.store_mode else "")) @@ -217,6 +218,7 @@ class StoreInventoryDisplay(MenuDisplay): and self.selected else f" {rep} " self.addstr(self.pad, i + 1, 0, selection + " " + item.translated_name.capitalize() + + (f" ({item.description})" if item.description else "") + ": " + str(item.price) + " Hazels") price = f"{self.pack.HAZELNUT} {self.menu.merchant.hazel} Hazels" diff --git a/squirrelbattle/entities/items.py b/squirrelbattle/entities/items.py index 0436e37..9828fb6 100644 --- a/squirrelbattle/entities/items.py +++ b/squirrelbattle/entities/items.py @@ -24,6 +24,13 @@ class Item(Entity): self.held_by = held_by self.price = price + @property + def description(self) -> str: + """ + In the inventory, indicate the usefulness of the item. + """ + return "" + def drop(self) -> None: """ The item is dropped from the inventory onto the floor. @@ -109,6 +116,10 @@ class Heart(Item): super().__init__(name=name, price=price, *args, **kwargs) self.healing = healing + @property + def description(self) -> str: + return "HP+5" + def hold(self, entity: InventoryHolder) -> None: """ When holding a heart, the player is healed and @@ -217,6 +228,10 @@ class Weapon(Item): super().__init__(*args, **kwargs) self.damage = damage + @property + def description(self) -> str: + return f"STR+{self.damage}" if self.damage else super().description + def save_state(self) -> dict: """ Saves the state of the weapon into a dictionary @@ -261,6 +276,11 @@ class Armor(Item): super().__init__(*args, **kwargs) self.constitution = constitution + @property + def description(self) -> str: + return f"CON+{self.constitution}" if self.constitution \ + else super().description + def equip(self) -> None: super().equip() self.held_by.constitution += self.constitution @@ -375,6 +395,14 @@ class Ring(Item): self.critical = critical self.experience = experience + @property + def description(self) -> str: + fields = [("MAX HP", self.maxhealth), ("STR", self.strength), + ("INT", self.intelligence), ("CHR", self.charisma), + ("DEX", self.dexterity), ("CON", self.constitution), + ("CRI", self.critical), ("XP", self.experience)] + return ", ".join(f"{key}+{value}" for key, value in fields if value) + def equip(self) -> None: super().equip() self.held_by.maxhealth += self.maxhealth From 571e9db3e8728695b290e8d1f94e1f142459ef9f Mon Sep 17 00:00:00 2001 From: Yohann D'ANELLO Date: Fri, 8 Jan 2021 12:06:28 +0100 Subject: [PATCH 2/3] Fix french translations --- squirrelbattle/entities/items.py | 7 +- squirrelbattle/interfaces.py | 2 +- .../locale/de/LC_MESSAGES/squirrelbattle.po | 95 +++++++++++++------ .../locale/es/LC_MESSAGES/squirrelbattle.po | 95 +++++++++++++------ .../locale/fr/LC_MESSAGES/squirrelbattle.po | 95 +++++++++++++------ squirrelbattle/tests/translations_test.py | 7 ++ 6 files changed, 205 insertions(+), 96 deletions(-) diff --git a/squirrelbattle/entities/items.py b/squirrelbattle/entities/items.py index 9828fb6..dab346c 100644 --- a/squirrelbattle/entities/items.py +++ b/squirrelbattle/entities/items.py @@ -86,7 +86,7 @@ class Item(Entity): """ Returns the list of all item classes. """ - return [BodySnatchPotion, Bomb, Heart, Shield, Sword,\ + return [BodySnatchPotion, Bomb, Heart, Shield, Sword, Chestplate, Helmet, RingCritical, RingXP] def be_sold(self, buyer: InventoryHolder, seller: InventoryHolder) -> bool: @@ -118,7 +118,7 @@ class Heart(Item): @property def description(self) -> str: - return "HP+5" + return f"HP+{self.healing}" def hold(self, entity: InventoryHolder) -> None: """ @@ -304,6 +304,7 @@ class Shield(Armor): super().__init__(name=name, constitution=constitution, price=price, *args, **kwargs) + class Helmet(Armor): """ Class of helmet items, they can be equipped on the head. @@ -319,6 +320,7 @@ class Helmet(Armor): self.held_by.remove_from_inventory(self) self.held_by.equipped_helmet = self + class Chestplate(Armor): """ Class of chestplate items, they can be equipped on the body. @@ -334,6 +336,7 @@ class Chestplate(Armor): self.held_by.remove_from_inventory(self) self.held_by.equipped_armor = self + class BodySnatchPotion(Item): """ The body-snatch potion allows to exchange all characteristics with a random diff --git a/squirrelbattle/interfaces.py b/squirrelbattle/interfaces.py index f1f740b..fa43c73 100644 --- a/squirrelbattle/interfaces.py +++ b/squirrelbattle/interfaces.py @@ -605,7 +605,7 @@ class Entity: from squirrelbattle.entities.monsters import Tiger, Hedgehog, \ Rabbit, TeddyBear, GiantSeaEagle from squirrelbattle.entities.friendly import Merchant, Sunflower, \ - Trumpet + Trumpet return [BodySnatchPotion, Bomb, Heart, Hedgehog, Rabbit, TeddyBear, Sunflower, Tiger, Merchant, GiantSeaEagle, Trumpet] diff --git a/squirrelbattle/locale/de/LC_MESSAGES/squirrelbattle.po b/squirrelbattle/locale/de/LC_MESSAGES/squirrelbattle.po index 20aa2a7..1d6d8df 100644 --- a/squirrelbattle/locale/de/LC_MESSAGES/squirrelbattle.po +++ b/squirrelbattle/locale/de/LC_MESSAGES/squirrelbattle.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: squirrelbattle 3.14.1\n" "Report-Msgid-Bugs-To: squirrel-battle@crans.org\n" -"POT-Creation-Date: 2021-01-08 01:57+0100\n" +"POT-Creation-Date: 2021-01-08 12:03+0100\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -21,40 +21,49 @@ msgstr "" msgid "{name} takes {amount} damage." msgstr "{name} nimmt {amount} Schadenspunkte." -#: squirrelbattle/display/menudisplay.py:160 +#: squirrelbattle/display/creditsdisplay.py:28 +#: squirrelbattle/display/menudisplay.py:123 +#: squirrelbattle/display/menudisplay.py:148 +msgid "Credits" +msgstr "" + +#: squirrelbattle/display/creditsdisplay.py:32 +msgid "Developers:" +msgstr "" + +#: squirrelbattle/display/creditsdisplay.py:38 +msgid "Translators:" +msgstr "" + +#: squirrelbattle/display/menudisplay.py:168 msgid "INVENTORY" msgstr "BESTAND" -#: squirrelbattle/display/menudisplay.py:202 +#: squirrelbattle/display/menudisplay.py:214 msgid "STALL" msgstr "STAND" -#: squirrelbattle/display/statsdisplay.py:23 -#: squirrelbattle/tests/translations_test.py:60 -msgid "player" -msgstr "Spieler" - -#: squirrelbattle/display/statsdisplay.py:35 +#: squirrelbattle/display/statsdisplay.py:40 msgid "Inventory:" msgstr "Bestand:" -#: squirrelbattle/display/statsdisplay.py:52 +#: squirrelbattle/display/statsdisplay.py:57 msgid "Equipped main:" msgstr "" -#: squirrelbattle/display/statsdisplay.py:56 +#: squirrelbattle/display/statsdisplay.py:61 msgid "Equipped secondary:" msgstr "" -#: squirrelbattle/display/statsdisplay.py:61 +#: squirrelbattle/display/statsdisplay.py:66 msgid "Equipped chestplate:" msgstr "" -#: squirrelbattle/display/statsdisplay.py:65 +#: squirrelbattle/display/statsdisplay.py:70 msgid "Equipped helmet:" msgstr "" -#: squirrelbattle/display/statsdisplay.py:72 +#: squirrelbattle/display/statsdisplay.py:77 msgid "YOU ARE DEAD" msgstr "SIE WURDEN GESTORBEN" @@ -63,41 +72,41 @@ msgstr "SIE WURDEN GESTORBEN" msgid "I don't sell any squirrel" msgstr "Ich verkaufe keinen Eichhörnchen." -#: squirrelbattle/entities/friendly.py:52 +#: squirrelbattle/entities/friendly.py:55 msgid "Flower power!!" msgstr "Blumenmacht!!" -#: squirrelbattle/entities/friendly.py:52 +#: squirrelbattle/entities/friendly.py:55 msgid "The sun is warm today" msgstr "Die Sonne ist warm heute" #. The bomb is exploding. #. Each entity that is close to the bomb takes damages. #. The player earn XP if the entity was killed. -#: squirrelbattle/entities/items.py:163 +#: squirrelbattle/entities/items.py:178 msgid "Bomb is exploding." msgstr "Die Bombe explodiert." -#: squirrelbattle/entities/items.py:344 +#: squirrelbattle/entities/items.py:365 #, python-brace-format msgid "{player} exchanged its body with {entity}." msgstr "{player} täuscht seinem Körper mit {entity} aus." -#: squirrelbattle/game.py:182 +#: squirrelbattle/game.py:200 #, python-brace-format msgid "The player climbs down to the floor {floor}." msgstr "Der Spieler klettert auf dem Stock {floor} hinunter." -#: squirrelbattle/game.py:195 +#: squirrelbattle/game.py:213 #, python-brace-format msgid "The player climbs up the floor {floor}." msgstr "Der Spieler klettert auf dem Stock {floor} hinoben." -#: squirrelbattle/game.py:285 squirrelbattle/tests/game_test.py:592 +#: squirrelbattle/game.py:304 squirrelbattle/tests/game_test.py:603 msgid "The buyer does not have enough money" msgstr "Der Kaufer hat nicht genug Geld" -#: squirrelbattle/game.py:328 +#: squirrelbattle/game.py:347 msgid "" "Some keys are missing in your save file.\n" "Your save seems to be corrupt. It got deleted." @@ -105,7 +114,7 @@ msgstr "" "In Ihrer Speicherdatei fehlen einige Schlüssel.\n" "Ihre Speicherung scheint korrupt zu sein. Es wird gelöscht." -#: squirrelbattle/game.py:336 +#: squirrelbattle/game.py:355 msgid "" "No player was found on this map!\n" "Maybe you died?" @@ -113,7 +122,7 @@ msgstr "" "Auf dieser Karte wurde kein Spieler gefunden!\n" "Vielleicht sind Sie gestorben?" -#: squirrelbattle/game.py:356 +#: squirrelbattle/game.py:375 msgid "" "The JSON file is not correct.\n" "Your save seems corrupted. It got deleted." @@ -121,26 +130,26 @@ msgstr "" "Die JSON-Datei ist nicht korrekt.\n" "Ihre Speicherung scheint korrumpiert. Sie wurde gelöscht." -#: squirrelbattle/interfaces.py:452 +#: squirrelbattle/interfaces.py:712 msgid "It's a critical hit!" msgstr "" -#: squirrelbattle/interfaces.py:453 +#: squirrelbattle/interfaces.py:713 #, python-brace-format msgid "{name} hits {opponent}." msgstr "{name} schlägt {opponent}." -#: squirrelbattle/interfaces.py:465 +#: squirrelbattle/interfaces.py:727 #, python-brace-format msgid "{name} takes {damage} damage." msgstr "" -#: squirrelbattle/interfaces.py:467 +#: squirrelbattle/interfaces.py:729 #, python-brace-format msgid "{name} dies." msgstr "{name} stirbt." -#: squirrelbattle/interfaces.py:501 +#: squirrelbattle/interfaces.py:763 #, python-brace-format msgid "{entity} said: {message}" msgstr "{entity} hat gesagt: {message}" @@ -149,8 +158,8 @@ msgstr "{entity} hat gesagt: {message}" msgid "Back" msgstr "Zurück" -#: squirrelbattle/tests/game_test.py:358 squirrelbattle/tests/game_test.py:361 -#: squirrelbattle/tests/game_test.py:364 squirrelbattle/tests/game_test.py:367 +#: squirrelbattle/tests/game_test.py:368 squirrelbattle/tests/game_test.py:371 +#: squirrelbattle/tests/game_test.py:374 squirrelbattle/tests/game_test.py:377 #: squirrelbattle/tests/translations_test.py:16 msgid "New game" msgstr "Neu Spiel" @@ -247,6 +256,10 @@ msgstr "Textur-Packung" msgid "Language" msgstr "Sprache" +#: squirrelbattle/tests/translations_test.py:62 +msgid "player" +msgstr "Spieler" + #: squirrelbattle/tests/translations_test.py:64 msgid "hedgehog" msgstr "Igel" @@ -290,3 +303,23 @@ msgstr "Herz" #: squirrelbattle/tests/translations_test.py:75 msgid "sword" msgstr "schwert" + +#: squirrelbattle/tests/translations_test.py:76 +msgid "helmet" +msgstr "" + +#: squirrelbattle/tests/translations_test.py:77 +msgid "chestplate" +msgstr "" + +#: squirrelbattle/tests/translations_test.py:78 +msgid "shield" +msgstr "" + +#: squirrelbattle/tests/translations_test.py:79 +msgid "ring_of_critical_damage" +msgstr "" + +#: squirrelbattle/tests/translations_test.py:81 +msgid "ring_of_more_experience" +msgstr "" diff --git a/squirrelbattle/locale/es/LC_MESSAGES/squirrelbattle.po b/squirrelbattle/locale/es/LC_MESSAGES/squirrelbattle.po index 0bfdac6..9c15730 100644 --- a/squirrelbattle/locale/es/LC_MESSAGES/squirrelbattle.po +++ b/squirrelbattle/locale/es/LC_MESSAGES/squirrelbattle.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: squirrelbattle 3.14.1\n" "Report-Msgid-Bugs-To: squirrel-battle@crans.org\n" -"POT-Creation-Date: 2021-01-06 15:19+0100\n" +"POT-Creation-Date: 2021-01-08 12:03+0100\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -21,40 +21,49 @@ msgstr "" msgid "{name} takes {amount} damage." msgstr "{name} recibe {amount} daño." -#: squirrelbattle/display/menudisplay.py:160 +#: squirrelbattle/display/creditsdisplay.py:28 +#: squirrelbattle/display/menudisplay.py:123 +#: squirrelbattle/display/menudisplay.py:148 +msgid "Credits" +msgstr "" + +#: squirrelbattle/display/creditsdisplay.py:32 +msgid "Developers:" +msgstr "" + +#: squirrelbattle/display/creditsdisplay.py:38 +msgid "Translators:" +msgstr "" + +#: squirrelbattle/display/menudisplay.py:168 msgid "INVENTORY" msgstr "INVENTORIO" -#: squirrelbattle/display/menudisplay.py:202 +#: squirrelbattle/display/menudisplay.py:214 msgid "STALL" msgstr "PUESTO" -#: squirrelbattle/display/statsdisplay.py:23 -#: squirrelbattle/tests/translations_test.py:60 -msgid "player" -msgstr "jugador" - -#: squirrelbattle/display/statsdisplay.py:35 +#: squirrelbattle/display/statsdisplay.py:40 msgid "Inventory:" msgstr "Inventorio :" -#: squirrelbattle/display/statsdisplay.py:52 +#: squirrelbattle/display/statsdisplay.py:57 msgid "Equipped main:" msgstr "" -#: squirrelbattle/display/statsdisplay.py:56 +#: squirrelbattle/display/statsdisplay.py:61 msgid "Equipped secondary:" msgstr "" -#: squirrelbattle/display/statsdisplay.py:61 +#: squirrelbattle/display/statsdisplay.py:66 msgid "Equipped chestplate:" msgstr "" -#: squirrelbattle/display/statsdisplay.py:65 +#: squirrelbattle/display/statsdisplay.py:70 msgid "Equipped helmet:" msgstr "" -#: squirrelbattle/display/statsdisplay.py:72 +#: squirrelbattle/display/statsdisplay.py:77 msgid "YOU ARE DEAD" msgstr "ERES MUERTO" @@ -62,41 +71,41 @@ msgstr "ERES MUERTO" msgid "I don't sell any squirrel" msgstr "No vendo ninguna ardilla" -#: squirrelbattle/entities/friendly.py:52 +#: squirrelbattle/entities/friendly.py:55 msgid "Flower power!!" msgstr "Poder de las flores!!" -#: squirrelbattle/entities/friendly.py:52 +#: squirrelbattle/entities/friendly.py:55 msgid "The sun is warm today" msgstr "El sol está caliente hoy" #. The bomb is exploding. #. Each entity that is close to the bomb takes damages. #. The player earn XP if the entity was killed. -#: squirrelbattle/entities/items.py:163 +#: squirrelbattle/entities/items.py:178 msgid "Bomb is exploding." msgstr "La bomba está explotando." -#: squirrelbattle/entities/items.py:344 +#: squirrelbattle/entities/items.py:365 #, python-brace-format msgid "{player} exchanged its body with {entity}." msgstr "{player} intercambió su cuerpo con {entity}." -#: squirrelbattle/game.py:182 +#: squirrelbattle/game.py:200 #, python-brace-format msgid "The player climbs down to the floor {floor}." msgstr "" -#: squirrelbattle/game.py:195 +#: squirrelbattle/game.py:213 #, python-brace-format msgid "The player climbs up the floor {floor}." msgstr "" -#: squirrelbattle/game.py:285 squirrelbattle/tests/game_test.py:592 +#: squirrelbattle/game.py:304 squirrelbattle/tests/game_test.py:603 msgid "The buyer does not have enough money" msgstr "El comprador no tiene suficiente dinero" -#: squirrelbattle/game.py:328 +#: squirrelbattle/game.py:347 msgid "" "Some keys are missing in your save file.\n" "Your save seems to be corrupt. It got deleted." @@ -104,7 +113,7 @@ msgstr "" "Algunas claves faltan en su archivo de guarda.\n" "Su guarda parece a ser corruptido. Fue eliminado." -#: squirrelbattle/game.py:336 +#: squirrelbattle/game.py:355 msgid "" "No player was found on this map!\n" "Maybe you died?" @@ -112,7 +121,7 @@ msgstr "" "No jugador encontrado sobre la carta !\n" "¿ Quizas murió ?" -#: squirrelbattle/game.py:356 +#: squirrelbattle/game.py:375 msgid "" "The JSON file is not correct.\n" "Your save seems corrupted. It got deleted." @@ -120,26 +129,26 @@ msgstr "" "El JSON archivo no es correcto.\n" "Su guarda parece corrupta. Fue eliminada." -#: squirrelbattle/interfaces.py:452 +#: squirrelbattle/interfaces.py:712 msgid "It's a critical hit!" msgstr "" -#: squirrelbattle/interfaces.py:453 +#: squirrelbattle/interfaces.py:713 #, python-brace-format msgid "{name} hits {opponent}." msgstr "{name} golpea a {opponent}." -#: squirrelbattle/interfaces.py:465 +#: squirrelbattle/interfaces.py:727 #, python-brace-format msgid "{name} takes {damage} damage." msgstr "" -#: squirrelbattle/interfaces.py:467 +#: squirrelbattle/interfaces.py:729 #, python-brace-format msgid "{name} dies." msgstr "{name} se muere." -#: squirrelbattle/interfaces.py:501 +#: squirrelbattle/interfaces.py:763 #, python-brace-format msgid "{entity} said: {message}" msgstr "{entity} dijo : {message}" @@ -148,8 +157,8 @@ msgstr "{entity} dijo : {message}" msgid "Back" msgstr "Volver" -#: squirrelbattle/tests/game_test.py:358 squirrelbattle/tests/game_test.py:361 -#: squirrelbattle/tests/game_test.py:364 squirrelbattle/tests/game_test.py:367 +#: squirrelbattle/tests/game_test.py:368 squirrelbattle/tests/game_test.py:371 +#: squirrelbattle/tests/game_test.py:374 squirrelbattle/tests/game_test.py:377 #: squirrelbattle/tests/translations_test.py:16 msgid "New game" msgstr "Nuevo partido" @@ -246,6 +255,10 @@ msgstr "Paquete de texturas" msgid "Language" msgstr "Languaje" +#: squirrelbattle/tests/translations_test.py:62 +msgid "player" +msgstr "jugador" + #: squirrelbattle/tests/translations_test.py:64 msgid "hedgehog" msgstr "erizo" @@ -289,3 +302,23 @@ msgstr "corazón" #: squirrelbattle/tests/translations_test.py:75 msgid "sword" msgstr "espada" + +#: squirrelbattle/tests/translations_test.py:76 +msgid "helmet" +msgstr "" + +#: squirrelbattle/tests/translations_test.py:77 +msgid "chestplate" +msgstr "" + +#: squirrelbattle/tests/translations_test.py:78 +msgid "shield" +msgstr "" + +#: squirrelbattle/tests/translations_test.py:79 +msgid "ring_of_critical_damage" +msgstr "" + +#: squirrelbattle/tests/translations_test.py:81 +msgid "ring_of_more_experience" +msgstr "" diff --git a/squirrelbattle/locale/fr/LC_MESSAGES/squirrelbattle.po b/squirrelbattle/locale/fr/LC_MESSAGES/squirrelbattle.po index 42172c3..18baf0b 100644 --- a/squirrelbattle/locale/fr/LC_MESSAGES/squirrelbattle.po +++ b/squirrelbattle/locale/fr/LC_MESSAGES/squirrelbattle.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: squirrelbattle 3.14.1\n" "Report-Msgid-Bugs-To: squirrel-battle@crans.org\n" -"POT-Creation-Date: 2021-01-06 15:19+0100\n" +"POT-Creation-Date: 2021-01-08 12:03+0100\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -21,40 +21,49 @@ msgstr "" msgid "{name} takes {amount} damage." msgstr "{name} prend {amount} points de dégât." -#: squirrelbattle/display/menudisplay.py:160 +#: squirrelbattle/display/creditsdisplay.py:28 +#: squirrelbattle/display/menudisplay.py:123 +#: squirrelbattle/display/menudisplay.py:148 +msgid "Credits" +msgstr "" + +#: squirrelbattle/display/creditsdisplay.py:32 +msgid "Developers:" +msgstr "" + +#: squirrelbattle/display/creditsdisplay.py:38 +msgid "Translators:" +msgstr "" + +#: squirrelbattle/display/menudisplay.py:168 msgid "INVENTORY" msgstr "INVENTAIRE" -#: squirrelbattle/display/menudisplay.py:202 +#: squirrelbattle/display/menudisplay.py:214 msgid "STALL" msgstr "STAND" -#: squirrelbattle/display/statsdisplay.py:23 -#: squirrelbattle/tests/translations_test.py:60 -msgid "player" -msgstr "joueur" - -#: squirrelbattle/display/statsdisplay.py:35 +#: squirrelbattle/display/statsdisplay.py:40 msgid "Inventory:" msgstr "Inventaire :" -#: squirrelbattle/display/statsdisplay.py:52 +#: squirrelbattle/display/statsdisplay.py:57 msgid "Equipped main:" msgstr "Équipement principal :" -#: squirrelbattle/display/statsdisplay.py:56 +#: squirrelbattle/display/statsdisplay.py:61 msgid "Equipped secondary:" msgstr "Équipement secondaire :" -#: squirrelbattle/display/statsdisplay.py:61 +#: squirrelbattle/display/statsdisplay.py:66 msgid "Equipped chestplate:" msgstr "Plastron équipé :" -#: squirrelbattle/display/statsdisplay.py:65 +#: squirrelbattle/display/statsdisplay.py:70 msgid "Equipped helmet:" msgstr "Casque équipé :" -#: squirrelbattle/display/statsdisplay.py:72 +#: squirrelbattle/display/statsdisplay.py:77 msgid "YOU ARE DEAD" msgstr "VOUS ÊTES MORT" @@ -63,41 +72,41 @@ msgstr "VOUS ÊTES MORT" msgid "I don't sell any squirrel" msgstr "Je ne vends pas d'écureuil" -#: squirrelbattle/entities/friendly.py:52 +#: squirrelbattle/entities/friendly.py:55 msgid "Flower power!!" msgstr "Pouvoir des fleurs !!" -#: squirrelbattle/entities/friendly.py:52 +#: squirrelbattle/entities/friendly.py:55 msgid "The sun is warm today" msgstr "Le soleil est chaud aujourd'hui" #. The bomb is exploding. #. Each entity that is close to the bomb takes damages. #. The player earn XP if the entity was killed. -#: squirrelbattle/entities/items.py:163 +#: squirrelbattle/entities/items.py:178 msgid "Bomb is exploding." msgstr "La bombe explose." -#: squirrelbattle/entities/items.py:344 +#: squirrelbattle/entities/items.py:365 #, python-brace-format msgid "{player} exchanged its body with {entity}." msgstr "{player} a échangé son corps avec {entity}." -#: squirrelbattle/game.py:182 +#: squirrelbattle/game.py:200 #, python-brace-format msgid "The player climbs down to the floor {floor}." msgstr "Le joueur descend à l'étage {floor}." -#: squirrelbattle/game.py:195 +#: squirrelbattle/game.py:213 #, python-brace-format msgid "The player climbs up the floor {floor}." msgstr "Le joueur monte à l'étage {floor}." -#: squirrelbattle/game.py:285 squirrelbattle/tests/game_test.py:592 +#: squirrelbattle/game.py:304 squirrelbattle/tests/game_test.py:603 msgid "The buyer does not have enough money" msgstr "L'acheteur n'a pas assez d'argent" -#: squirrelbattle/game.py:328 +#: squirrelbattle/game.py:347 msgid "" "Some keys are missing in your save file.\n" "Your save seems to be corrupt. It got deleted." @@ -105,7 +114,7 @@ msgstr "" "Certaines clés de votre ficher de sauvegarde sont manquantes.\n" "Votre sauvegarde semble corrompue. Elle a été supprimée." -#: squirrelbattle/game.py:336 +#: squirrelbattle/game.py:355 msgid "" "No player was found on this map!\n" "Maybe you died?" @@ -113,7 +122,7 @@ msgstr "" "Aucun joueur n'a été trouvé sur la carte !\n" "Peut-être êtes-vous mort ?" -#: squirrelbattle/game.py:356 +#: squirrelbattle/game.py:375 msgid "" "The JSON file is not correct.\n" "Your save seems corrupted. It got deleted." @@ -121,26 +130,26 @@ msgstr "" "Le fichier JSON de sauvegarde est incorrect.\n" "Votre sauvegarde semble corrompue. Elle a été supprimée." -#: squirrelbattle/interfaces.py:452 +#: squirrelbattle/interfaces.py:712 msgid "It's a critical hit!" msgstr "C'est un coup critique !" -#: squirrelbattle/interfaces.py:453 +#: squirrelbattle/interfaces.py:713 #, python-brace-format msgid "{name} hits {opponent}." msgstr "{name} frappe {opponent}." -#: squirrelbattle/interfaces.py:465 +#: squirrelbattle/interfaces.py:727 #, python-brace-format msgid "{name} takes {damage} damage." msgstr "{name} prend {damage} dégâts." -#: squirrelbattle/interfaces.py:467 +#: squirrelbattle/interfaces.py:729 #, python-brace-format msgid "{name} dies." msgstr "{name} meurt." -#: squirrelbattle/interfaces.py:501 +#: squirrelbattle/interfaces.py:763 #, python-brace-format msgid "{entity} said: {message}" msgstr "{entity} a dit : {message}" @@ -149,8 +158,8 @@ msgstr "{entity} a dit : {message}" msgid "Back" msgstr "Retour" -#: squirrelbattle/tests/game_test.py:358 squirrelbattle/tests/game_test.py:361 -#: squirrelbattle/tests/game_test.py:364 squirrelbattle/tests/game_test.py:367 +#: squirrelbattle/tests/game_test.py:368 squirrelbattle/tests/game_test.py:371 +#: squirrelbattle/tests/game_test.py:374 squirrelbattle/tests/game_test.py:377 #: squirrelbattle/tests/translations_test.py:16 msgid "New game" msgstr "Nouvelle partie" @@ -247,6 +256,10 @@ msgstr "Pack de textures" msgid "Language" msgstr "Langue" +#: squirrelbattle/tests/translations_test.py:62 +msgid "player" +msgstr "joueur" + #: squirrelbattle/tests/translations_test.py:64 msgid "hedgehog" msgstr "hérisson" @@ -290,3 +303,23 @@ msgstr "cœur" #: squirrelbattle/tests/translations_test.py:75 msgid "sword" msgstr "épée" + +#: squirrelbattle/tests/translations_test.py:76 +msgid "helmet" +msgstr "casque" + +#: squirrelbattle/tests/translations_test.py:77 +msgid "chestplate" +msgstr "plastron" + +#: squirrelbattle/tests/translations_test.py:78 +msgid "shield" +msgstr "bouclier" + +#: squirrelbattle/tests/translations_test.py:79 +msgid "ring of critical damage" +msgstr "anneau de coup critique" + +#: squirrelbattle/tests/translations_test.py:81 +msgid "ring of more experience" +msgstr "anneau de plus d'expérience" diff --git a/squirrelbattle/tests/translations_test.py b/squirrelbattle/tests/translations_test.py index 4a99e73..1ffa7d3 100644 --- a/squirrelbattle/tests/translations_test.py +++ b/squirrelbattle/tests/translations_test.py @@ -73,3 +73,10 @@ class TestTranslations(unittest.TestCase): self.assertEqual(_("explosion"), "explosion") self.assertEqual(_("heart"), "cœur") self.assertEqual(_("sword"), "épée") + self.assertEqual(_("helmet"), "casque") + self.assertEqual(_("chestplate"), "plastron") + self.assertEqual(_("shield"), "bouclier") + self.assertEqual(_("ring of critical damage"), + "anneau de coup critique") + self.assertEqual(_("ring of more experience"), + "anneau de plus d'expérience") From 120ec82d096e33574a4e72082683c5ec7200fe67 Mon Sep 17 00:00:00 2001 From: Yohann D'ANELLO Date: Fri, 8 Jan 2021 12:07:13 +0100 Subject: [PATCH 3/3] Helmet needs only one character in squirrel mode, add a trailing space --- squirrelbattle/display/texturepack.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/squirrelbattle/display/texturepack.py b/squirrelbattle/display/texturepack.py index 81302b3..1fa0584 100644 --- a/squirrelbattle/display/texturepack.py +++ b/squirrelbattle/display/texturepack.py @@ -118,7 +118,7 @@ TexturePack.SQUIRREL_PACK = TexturePack( HAZELNUT='🌰', HEART='💜', HEDGEHOG='🦔', - HELMET='⛑️', + HELMET='⛑️ ', PLAYER='🐿️ ️', MERCHANT='🦜', RABBIT='🐇',