Merge branch 'master' into clean
This commit is contained in:
commit
8d0d0883a3
4
COPYING
4
COPYING
|
@ -632,7 +632,7 @@ state the exclusion of warranty; and each file should have at least
|
||||||
the "copyright" line and a pointer to where the full notice is found.
|
the "copyright" line and a pointer to where the full notice is found.
|
||||||
|
|
||||||
Squirrel Battle
|
Squirrel Battle
|
||||||
Copyright (C) 2020 ÿnérant, eichhornchen, nicomarg, charlse
|
Copyright (C) 2020-2021 ÿnérant, eichhornchen, nicomarg, charlse
|
||||||
|
|
||||||
This program is free software: you can redistribute it and/or modify
|
This program is free software: you can redistribute it and/or modify
|
||||||
it under the terms of the GNU General Public License as published by
|
it under the terms of the GNU General Public License as published by
|
||||||
|
@ -652,7 +652,7 @@ Also add information on how to contact you by electronic and paper mail.
|
||||||
If the program does terminal interaction, make it output a short
|
If the program does terminal interaction, make it output a short
|
||||||
notice like this when it starts in an interactive mode:
|
notice like this when it starts in an interactive mode:
|
||||||
|
|
||||||
Squirrel Battle Copyright (C) 2020 ÿnérant, eichhornchen, nicomarg, charlse
|
Squirrel Battle Copyright (C) 2020-2021 ÿnérant, eichhornchen, nicomarg, charlse
|
||||||
This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
|
This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
|
||||||
This is free software, and you are welcome to redistribute it
|
This is free software, and you are welcome to redistribute it
|
||||||
under certain conditions; type `show c' for details.
|
under certain conditions; type `show c' for details.
|
||||||
|
|
17
docs/conf.py
17
docs/conf.py
|
@ -18,8 +18,11 @@
|
||||||
# -- Project information -----------------------------------------------------
|
# -- Project information -----------------------------------------------------
|
||||||
|
|
||||||
project = 'Squirrel Battle'
|
project = 'Squirrel Battle'
|
||||||
copyright = "2020"
|
copyright = "2020-2021"
|
||||||
author = "Yohann D'ANELLO,\nMathilde DEPRES,\nNicolas MARGULIES,\nCharles PEYRAT"
|
author = "Yohann D'ANELLO,\n" \
|
||||||
|
"Mathilde DEPRES,\n" \
|
||||||
|
"Nicolas MARGULIES,\n" \
|
||||||
|
"Charles PEYRAT"
|
||||||
|
|
||||||
|
|
||||||
# -- General configuration ---------------------------------------------------
|
# -- General configuration ---------------------------------------------------
|
||||||
|
@ -57,4 +60,12 @@ html_theme = 'sphinx_rtd_theme'
|
||||||
# Add any paths that contain custom static files (such as style sheets) here,
|
# Add any paths that contain custom static files (such as style sheets) here,
|
||||||
# relative to this directory. They are copied after the builtin static files,
|
# relative to this directory. They are copied after the builtin static files,
|
||||||
# so a file named "default.css" will overwrite the builtin "default.css".
|
# so a file named "default.css" will overwrite the builtin "default.css".
|
||||||
html_static_path = ['_static']
|
html_static_path = ['_static']
|
||||||
|
|
||||||
|
html_context = {
|
||||||
|
'gitlab_user': 'ynerant',
|
||||||
|
'gitlab_repo': 'squirrel-battle',
|
||||||
|
'gitlab_host': 'gitlab.crans.org',
|
||||||
|
'gitlab_version': 'master',
|
||||||
|
'display_gitlab': True,
|
||||||
|
}
|
||||||
|
|
14
docs/map.rst
14
docs/map.rst
|
@ -44,3 +44,17 @@ Mur
|
||||||
Les murs délimitent les salles du donjon. Personne ne peut les traverser.
|
Les murs délimitent les salles du donjon. Personne ne peut les traverser.
|
||||||
Ils sont représentés par un dièse ``#`` dans le `pack de textures`_ ASCII et
|
Ils sont représentés par un dièse ``#`` dans le `pack de textures`_ ASCII et
|
||||||
par une brique carrée ``🧱`` dans le `pack de textures`_ écureuil.
|
par une brique carrée ``🧱`` dans le `pack de textures`_ écureuil.
|
||||||
|
|
||||||
|
|
||||||
|
Échelles
|
||||||
|
~~~~~~~~
|
||||||
|
|
||||||
|
Les échelles sont les débuts et fin de niveau. Elles permettent de changer
|
||||||
|
d'étage en appuyant sur une touche. Elles sont représentées par un ``H`` dans
|
||||||
|
le `pack de textures`_ ASCII et par un émoji échelle ``🪜`` dans le
|
||||||
|
`pack de textures`_ écureuil.
|
||||||
|
|
||||||
|
Lorsqu'on est sur l'échelle du début de niveau, appuyer sur ``<`` permet de
|
||||||
|
monter d'un étage (revenir au niveau précédent). Lorsqu'on est sur l'échelle
|
||||||
|
de fin de niveau, on génère une nouvelle carte si ce n'est pas déjà fait avec
|
||||||
|
des monstres plus forts, et on place le joueur sur cette nouvelle carte.
|
||||||
|
|
|
@ -1,12 +1,50 @@
|
||||||
Exécution des tests
|
Exécution des tests
|
||||||
===================
|
===================
|
||||||
|
|
||||||
.. note::
|
|
||||||
La documentation va être revue ici.
|
|
||||||
|
|
||||||
Les tests sont gérés par ``pytest`` dans le module ``squirrelbattle.tests``.
|
|
||||||
|
|
||||||
``tox`` est un outil permettant de configurer l'exécution des tests. Ainsi, après
|
``tox`` est un outil permettant de configurer l'exécution des tests. Ainsi, après
|
||||||
installation de tox dans votre environnement virtuel via ``pip install tox``,
|
installation de tox dans votre environnement virtuel via ``pip install tox``,
|
||||||
il vous suffit d'exécuter ``tox -e py3`` pour lancer les tests et ``tox -e linters``
|
il vous suffit d'exécuter ``tox -e py3`` pour lancer les tests et ``tox -e linters``
|
||||||
pour vérifier la syntaxe du code.
|
pour vérifier la syntaxe du code.
|
||||||
|
|
||||||
|
Tests unitaires
|
||||||
|
---------------
|
||||||
|
|
||||||
|
Les tests sont gérés par ``pytest`` dans le module ``squirrelbattle.tests``.
|
||||||
|
Le module ``pytest-cov`` permet de mesurer la couverture du code.
|
||||||
|
Pour lancer les tests, il suffit de lancer ``tox -e py3`` ou de manière équivalente
|
||||||
|
``pytest --cov=squirrelbattle/ --cov-report=term-missing squirrelbattle/``
|
||||||
|
|
||||||
|
L'intégration continue lance les tests pour les versions de Python de 3.6 à 3.10,
|
||||||
|
sur une distribution Alpine Linux.
|
||||||
|
|
||||||
|
Chaque partie du code est testée unitairement, pour obtenir une couverture
|
||||||
|
maximale et assurer un bon fonctionnement. En particulier, le jeu est lancé
|
||||||
|
en commençant sur une carte déterministe (non générée aléatoirement) chargée
|
||||||
|
depuis ``assets/example_map.txt``, sur laquelle sont placés des ennemis et objets
|
||||||
|
avec lesquels le joueur doit interagir. On vérifie qu'à chaque touche appuyée,
|
||||||
|
il se passe le bon comportement. Le comportement des différents menus est
|
||||||
|
également testé.
|
||||||
|
|
||||||
|
L'environnement de test ne disposant pas a priori d'un terminal, le jeu est
|
||||||
|
conçu pour fonctionner sans support graphique, avec un terminal fictif où les
|
||||||
|
primitives de curses sont implémentées pour ne rien faire. On ne peut alors
|
||||||
|
pas s'assurer du bon fonctionnement de curses.
|
||||||
|
|
||||||
|
De plus, une très fine partie du code est ignorée lors de la couverture, ce
|
||||||
|
qui correspond à la phase d'initialisation du terminal et à la boucle infinie
|
||||||
|
qui reçoit les touches de l'utilisateur, qu'il est alors impossible de tester
|
||||||
|
unitairement.
|
||||||
|
|
||||||
|
|
||||||
|
Analyseur syntaxique
|
||||||
|
--------------------
|
||||||
|
|
||||||
|
``flake8`` est utilisé en guise d'analyseur syntaxique. Il vérifie si le code
|
||||||
|
est bien formatté afin d'assurer une certaine lisibilité. En particulier,
|
||||||
|
il vérifie l'indentation, si chaque variable est bien utilisée, s'il n'y a pas
|
||||||
|
d'import inutile et s'ils sont dans l'ordre lexicographique, si chaque ligne
|
||||||
|
fait au plus 80 caractères et si la signature de chaque fonction est bien
|
||||||
|
spécifiée.
|
||||||
|
|
||||||
|
Pour lancer l'analyse, ``tox -e linters`` suffit. L'intégration continue
|
||||||
|
effectue cette analyse à chaque commit.
|
||||||
|
|
2
main.py
2
main.py
|
@ -1,6 +1,6 @@
|
||||||
#!/usr/bin/env python3
|
#!/usr/bin/env python3
|
||||||
|
|
||||||
# Copyright (C) 2020 by ÿnérant, eichhornchen, nicomarg, charlse
|
# Copyright (C) 2020-2021 by ÿnérant, eichhornchen, nicomarg, charlse
|
||||||
# SPDX-License-Identifier: GPL-3.0-or-later
|
# SPDX-License-Identifier: GPL-3.0-or-later
|
||||||
import argparse
|
import argparse
|
||||||
import sys
|
import sys
|
||||||
|
|
2
setup.py
2
setup.py
|
@ -1,6 +1,6 @@
|
||||||
#!/usr/bin/env python3
|
#!/usr/bin/env python3
|
||||||
|
|
||||||
# Copyright (C) 2020 by ÿnérant, eichhornchen, nicomarg, charlse
|
# Copyright (C) 2020-2021 by ÿnérant, eichhornchen, nicomarg, charlse
|
||||||
# SPDX-License-Identifier: GPL-3.0-or-later
|
# SPDX-License-Identifier: GPL-3.0-or-later
|
||||||
|
|
||||||
import subprocess
|
import subprocess
|
||||||
|
|
|
@ -1,2 +1,2 @@
|
||||||
# Copyright (C) 2020 by ÿnérant, eichhornchen, nicomarg, charlse
|
# Copyright (C) 2020-2021 by ÿnérant, eichhornchen, nicomarg, charlse
|
||||||
# SPDX-License-Identifier: GPL-3.0-or-later
|
# SPDX-License-Identifier: GPL-3.0-or-later
|
||||||
|
|
|
@ -1,9 +1,9 @@
|
||||||
# Copyright (C) 2020 by ÿnérant, eichhornchen, nicomarg, charlse
|
# Copyright (C) 2020-2021 by ÿnérant, eichhornchen, nicomarg, charlse
|
||||||
# SPDX-License-Identifier: GPL-3.0-or-later
|
# SPDX-License-Identifier: GPL-3.0-or-later
|
||||||
|
|
||||||
from squirrelbattle.game import Game
|
from .display.display_manager import DisplayManager
|
||||||
from squirrelbattle.display.display_manager import DisplayManager
|
from .game import Game
|
||||||
from squirrelbattle.term_manager import TermManager
|
from .term_manager import TermManager
|
||||||
|
|
||||||
|
|
||||||
class Bootstrap:
|
class Bootstrap:
|
||||||
|
|
|
@ -1,2 +1,2 @@
|
||||||
# Copyright (C) 2020 by ÿnérant, eichhornchen, nicomarg, charlse
|
# Copyright (C) 2020-2021 by ÿnérant, eichhornchen, nicomarg, charlse
|
||||||
# SPDX-License-Identifier: GPL-3.0-or-later
|
# SPDX-License-Identifier: GPL-3.0-or-later
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
# Copyright (C) 2020 by ÿnérant, eichhornchen, nicomarg, charlse
|
# Copyright (C) 2020-2021 by ÿnérant, eichhornchen, nicomarg, charlse
|
||||||
# SPDX-License-Identifier: GPL-3.0-or-later
|
# SPDX-License-Identifier: GPL-3.0-or-later
|
||||||
|
|
||||||
import curses
|
import curses
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
# Copyright (C) 2020 by ÿnérant, eichhornchen, nicomarg, charlse
|
# Copyright (C) 2020-2021 by ÿnérant, eichhornchen, nicomarg, charlse
|
||||||
# SPDX-License-Identifier: GPL-3.0-or-later
|
# SPDX-License-Identifier: GPL-3.0-or-later
|
||||||
|
|
||||||
import curses
|
import curses
|
||||||
|
|
|
@ -1,22 +1,20 @@
|
||||||
# Copyright (C) 2020 by ÿnérant, eichhornchen, nicomarg, charlse
|
# Copyright (C) 2020-2021 by ÿnérant, eichhornchen, nicomarg, charlse
|
||||||
# SPDX-License-Identifier: GPL-3.0-or-later
|
# SPDX-License-Identifier: GPL-3.0-or-later
|
||||||
|
|
||||||
import curses
|
import curses
|
||||||
|
|
||||||
from squirrelbattle.display.creditsdisplay import CreditsDisplay
|
|
||||||
from squirrelbattle.display.display import VerticalSplit, HorizontalSplit, \
|
|
||||||
Display
|
|
||||||
from squirrelbattle.display.mapdisplay import MapDisplay
|
|
||||||
from squirrelbattle.display.messagedisplay import MessageDisplay
|
|
||||||
from squirrelbattle.display.statsdisplay import StatsDisplay
|
|
||||||
from squirrelbattle.display.menudisplay import MainMenuDisplay, \
|
|
||||||
PlayerInventoryDisplay, StoreInventoryDisplay, SettingsMenuDisplay, \
|
|
||||||
ChestInventoryDisplay
|
|
||||||
from squirrelbattle.display.logsdisplay import LogsDisplay
|
|
||||||
from squirrelbattle.display.texturepack import TexturePack
|
|
||||||
from typing import Any, List
|
from typing import Any, List
|
||||||
from squirrelbattle.game import Game, GameMode
|
|
||||||
from squirrelbattle.enums import DisplayActions
|
from .creditsdisplay import CreditsDisplay
|
||||||
|
from .display import Display, HorizontalSplit, VerticalSplit
|
||||||
|
from .logsdisplay import LogsDisplay
|
||||||
|
from .mapdisplay import MapDisplay
|
||||||
|
from .menudisplay import ChestInventoryDisplay, MainMenuDisplay, \
|
||||||
|
PlayerInventoryDisplay, SettingsMenuDisplay, StoreInventoryDisplay
|
||||||
|
from .messagedisplay import MessageDisplay
|
||||||
|
from .statsdisplay import StatsDisplay
|
||||||
|
from .texturepack import TexturePack
|
||||||
|
from ..enums import DisplayActions
|
||||||
|
from ..game import Game, GameMode
|
||||||
|
|
||||||
|
|
||||||
class DisplayManager:
|
class DisplayManager:
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
# Copyright (C) 2020 by ÿnérant, eichhornchen, nicomarg, charlse
|
# Copyright (C) 2020-2021 by ÿnérant, eichhornchen, nicomarg, charlse
|
||||||
# SPDX-License-Identifier: GPL-3.0-or-later
|
# SPDX-License-Identifier: GPL-3.0-or-later
|
||||||
|
|
||||||
from squirrelbattle.display.display import Display
|
from squirrelbattle.display.display import Display
|
||||||
|
|
|
@ -1,9 +1,9 @@
|
||||||
# Copyright (C) 2020 by ÿnérant, eichhornchen, nicomarg, charlse
|
# Copyright (C) 2020-2021 by ÿnérant, eichhornchen, nicomarg, charlse
|
||||||
# SPDX-License-Identifier: GPL-3.0-or-later
|
# SPDX-License-Identifier: GPL-3.0-or-later
|
||||||
|
|
||||||
from squirrelbattle.interfaces import Map
|
|
||||||
from .display import Display
|
from .display import Display
|
||||||
from ..game import Game
|
from ..game import Game
|
||||||
|
from ..interfaces import Map
|
||||||
|
|
||||||
|
|
||||||
class MapDisplay(Display):
|
class MapDisplay(Display):
|
||||||
|
|
|
@ -1,16 +1,15 @@
|
||||||
# Copyright (C) 2020 by ÿnérant, eichhornchen, nicomarg, charlse
|
# Copyright (C) 2020-2021 by ÿnérant, eichhornchen, nicomarg, charlse
|
||||||
# SPDX-License-Identifier: GPL-3.0-or-later
|
# SPDX-License-Identifier: GPL-3.0-or-later
|
||||||
|
|
||||||
import curses
|
import curses
|
||||||
from random import randint
|
from random import randint
|
||||||
from typing import List
|
from typing import List
|
||||||
|
|
||||||
from squirrelbattle.menus import Menu, MainMenu, SettingsMenu, StoreMenu,\
|
|
||||||
ChestMenu
|
|
||||||
from .display import Box, Display
|
from .display import Box, Display
|
||||||
from ..entities.player import Player
|
from ..entities.player import Player
|
||||||
from ..enums import KeyValues, GameMode
|
from ..enums import GameMode, KeyValues
|
||||||
from ..game import Game
|
from ..game import Game
|
||||||
|
from ..menus import ChestMenu, MainMenu, Menu, SettingsMenu, StoreMenu
|
||||||
from ..resources import ResourceManager
|
from ..resources import ResourceManager
|
||||||
from ..translations import gettext as _
|
from ..translations import gettext as _
|
||||||
|
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
# Copyright (C) 2020 by ÿnérant, eichhornchen, nicomarg, charlse
|
# Copyright (C) 2020-2021 by ÿnérant, eichhornchen, nicomarg, charlse
|
||||||
# SPDX-License-Identifier: GPL-3.0-or-later
|
# SPDX-License-Identifier: GPL-3.0-or-later
|
||||||
import curses
|
import curses
|
||||||
|
|
||||||
|
|
|
@ -1,14 +1,14 @@
|
||||||
# Copyright (C) 2020 by ÿnérant, eichhornchen, nicomarg, charlse
|
# Copyright (C) 2020-2021 by ÿnérant, eichhornchen, nicomarg, charlse
|
||||||
# SPDX-License-Identifier: GPL-3.0-or-later
|
# SPDX-License-Identifier: GPL-3.0-or-later
|
||||||
|
|
||||||
import curses
|
import curses
|
||||||
|
|
||||||
|
from .display import Display
|
||||||
from ..entities.items import Monocle
|
from ..entities.items import Monocle
|
||||||
from ..entities.player import Player
|
from ..entities.player import Player
|
||||||
from ..game import Game
|
from ..game import Game
|
||||||
from ..interfaces import FightingEntity
|
from ..interfaces import FightingEntity
|
||||||
from ..translations import gettext as _
|
from ..translations import gettext as _
|
||||||
from .display import Display
|
|
||||||
|
|
||||||
|
|
||||||
class StatsDisplay(Display):
|
class StatsDisplay(Display):
|
||||||
|
|
|
@ -1,8 +1,8 @@
|
||||||
# Copyright (C) 2020 by ÿnérant, eichhornchen, nicomarg, charlse
|
# Copyright (C) 2020-2021 by ÿnérant, eichhornchen, nicomarg, charlse
|
||||||
# SPDX-License-Identifier: GPL-3.0-or-later
|
# SPDX-License-Identifier: GPL-3.0-or-later
|
||||||
|
|
||||||
import curses
|
import curses
|
||||||
from typing import Any, Union, Tuple
|
from typing import Any, Tuple, Union
|
||||||
|
|
||||||
|
|
||||||
class TexturePack:
|
class TexturePack:
|
||||||
|
|
|
@ -1,2 +1,2 @@
|
||||||
# Copyright (C) 2020 by ÿnérant, eichhornchen, nicomarg, charlse
|
# Copyright (C) 2020-2021 by ÿnérant, eichhornchen, nicomarg, charlse
|
||||||
# SPDX-License-Identifier: GPL-3.0-or-later
|
# SPDX-License-Identifier: GPL-3.0-or-later
|
||||||
|
|
|
@ -1,11 +1,15 @@
|
||||||
from ..interfaces import Entity, FriendlyEntity, InventoryHolder, \
|
# Copyright (C) 2020-2021 by ÿnérant, eichhornchen, nicomarg, charlse
|
||||||
Map, FightingEntity
|
# SPDX-License-Identifier: GPL-3.0-or-later
|
||||||
from ..translations import gettext as _
|
|
||||||
from .player import Player
|
|
||||||
from .monsters import Monster
|
|
||||||
from .items import Item
|
|
||||||
from random import choice, shuffle
|
from random import choice, shuffle
|
||||||
|
|
||||||
|
from .items import Item
|
||||||
|
from .monsters import Monster
|
||||||
|
from .player import Player
|
||||||
|
from ..interfaces import Entity, FightingEntity, FriendlyEntity, \
|
||||||
|
InventoryHolder, Map
|
||||||
|
from ..translations import gettext as _
|
||||||
|
|
||||||
|
|
||||||
class Merchant(InventoryHolder, FriendlyEntity):
|
class Merchant(InventoryHolder, FriendlyEntity):
|
||||||
"""
|
"""
|
||||||
|
|
|
@ -1,10 +1,10 @@
|
||||||
# Copyright (C) 2020 by ÿnérant, eichhornchen, nicomarg, charlse
|
# Copyright (C) 2020-2021 by ÿnérant, eichhornchen, nicomarg, charlse
|
||||||
# SPDX-License-Identifier: GPL-3.0-or-later
|
# SPDX-License-Identifier: GPL-3.0-or-later
|
||||||
|
|
||||||
from random import choice, randint
|
from random import choice, randint
|
||||||
from typing import Optional, Any
|
from typing import Any, Optional
|
||||||
|
|
||||||
from ..interfaces import Entity, FightingEntity, Map, InventoryHolder
|
from ..interfaces import Entity, FightingEntity, InventoryHolder, Map
|
||||||
from ..translations import gettext as _
|
from ..translations import gettext as _
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
# Copyright (C) 2020 by ÿnérant, eichhornchen, nicomarg, charlse
|
# Copyright (C) 2020-2021 by ÿnérant, eichhornchen, nicomarg, charlse
|
||||||
# SPDX-License-Identifier: GPL-3.0-or-later
|
# SPDX-License-Identifier: GPL-3.0-or-later
|
||||||
|
|
||||||
from random import shuffle
|
from random import shuffle
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
# Copyright (C) 2020 by ÿnérant, eichhornchen, nicomarg, charlse
|
# Copyright (C) 2020-2021 by ÿnérant, eichhornchen, nicomarg, charlse
|
||||||
# SPDX-License-Identifier: GPL-3.0-or-later
|
# SPDX-License-Identifier: GPL-3.0-or-later
|
||||||
|
|
||||||
from random import randint
|
from random import randint
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
# Copyright (C) 2020 by ÿnérant, eichhornchen, nicomarg, charlse
|
# Copyright (C) 2020-2021 by ÿnérant, eichhornchen, nicomarg, charlse
|
||||||
# SPDX-License-Identifier: GPL-3.0-or-later
|
# SPDX-License-Identifier: GPL-3.0-or-later
|
||||||
|
|
||||||
from enum import Enum, auto
|
from enum import auto, Enum
|
||||||
from typing import Optional
|
from typing import Optional
|
||||||
|
|
||||||
from squirrelbattle.settings import Settings
|
from squirrelbattle.settings import Settings
|
||||||
|
|
|
@ -1,20 +1,20 @@
|
||||||
# Copyright (C) 2020 by ÿnérant, eichhornchen, nicomarg, charlse
|
# Copyright (C) 2020-2021 by ÿnérant, eichhornchen, nicomarg, charlse
|
||||||
# SPDX-License-Identifier: GPL-3.0-or-later
|
# SPDX-License-Identifier: GPL-3.0-or-later
|
||||||
|
|
||||||
from json import JSONDecodeError
|
|
||||||
from random import randint
|
|
||||||
from typing import Any, Optional, List
|
|
||||||
import curses
|
import curses
|
||||||
import json
|
import json
|
||||||
|
from json import JSONDecodeError
|
||||||
import os
|
import os
|
||||||
|
from random import randint
|
||||||
import sys
|
import sys
|
||||||
|
from typing import Any, List, Optional
|
||||||
|
|
||||||
|
from . import menus
|
||||||
from .entities.player import Player
|
from .entities.player import Player
|
||||||
from .enums import GameMode, KeyValues, DisplayActions
|
from .enums import DisplayActions, GameMode, KeyValues
|
||||||
from .interfaces import Map, Logs
|
from .interfaces import Logs, Map
|
||||||
from .resources import ResourceManager
|
from .resources import ResourceManager
|
||||||
from .settings import Settings
|
from .settings import Settings
|
||||||
from . import menus
|
|
||||||
from .translations import gettext as _, Translator
|
from .translations import gettext as _, Translator
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -1,13 +1,13 @@
|
||||||
# Copyright (C) 2020 by ÿnérant, eichhornchen, nicomarg, charlse
|
# Copyright (C) 2020-2021 by ÿnérant, eichhornchen, nicomarg, charlse
|
||||||
# SPDX-License-Identifier: GPL-3.0-or-later
|
# SPDX-License-Identifier: GPL-3.0-or-later
|
||||||
|
|
||||||
from enum import Enum, auto
|
|
||||||
from math import ceil, sqrt
|
|
||||||
from random import choice, choices, randint
|
|
||||||
from typing import List, Optional, Any, Dict, Tuple
|
|
||||||
from queue import PriorityQueue
|
|
||||||
from functools import reduce
|
|
||||||
from copy import deepcopy
|
from copy import deepcopy
|
||||||
|
from enum import auto, Enum
|
||||||
|
from functools import reduce
|
||||||
|
from math import ceil, sqrt
|
||||||
|
from queue import PriorityQueue
|
||||||
|
from random import choice, choices, randint
|
||||||
|
from typing import Any, Dict, List, Optional, Tuple
|
||||||
|
|
||||||
from .display.texturepack import TexturePack
|
from .display.texturepack import TexturePack
|
||||||
from .translations import gettext as _
|
from .translations import gettext as _
|
||||||
|
|
|
@ -1,207 +0,0 @@
|
||||||
# SOME DESCRIPTIVE TITLE.
|
|
||||||
# Copyright (C) YEAR ÿnérant, eichhornchen, nicomarg, charlse
|
|
||||||
# This file is distributed under the same license as the squirrelbattle package.
|
|
||||||
# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
|
|
||||||
#
|
|
||||||
#, fuzzy
|
|
||||||
msgid ""
|
|
||||||
msgstr ""
|
|
||||||
"Project-Id-Version: squirrelbattle 3.14.1\n"
|
|
||||||
"Report-Msgid-Bugs-To: squirrel-battle@crans.org\n"
|
|
||||||
"POT-Creation-Date: 2020-12-01 17:10+0100\n"
|
|
||||||
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
|
|
||||||
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
|
|
||||||
"Language-Team: LANGUAGE <LL@li.org>\n"
|
|
||||||
"Language: \n"
|
|
||||||
"MIME-Version: 1.0\n"
|
|
||||||
"Content-Type: text/plain; charset=UTF-8\n"
|
|
||||||
"Content-Transfer-Encoding: 8bit\n"
|
|
||||||
|
|
||||||
#: squirrelbattle/display/statsdisplay.py:34
|
|
||||||
msgid "Inventory:"
|
|
||||||
msgstr ""
|
|
||||||
|
|
||||||
#: squirrelbattle/display/statsdisplay.py:39
|
|
||||||
msgid "YOU ARE DEAD"
|
|
||||||
msgstr ""
|
|
||||||
|
|
||||||
#: squirrelbattle/interfaces.py:394 squirrelbattle/interfaces.py:398
|
|
||||||
#: squirrelbattle/interfaces.py:408
|
|
||||||
#, python-brace-format
|
|
||||||
msgid "{name} hits {opponent}."
|
|
||||||
msgstr ""
|
|
||||||
|
|
||||||
#: squirrelbattle/interfaces.py:405 squirrelbattle/interfaces.py:410
|
|
||||||
#: squirrelbattle/interfaces.py:420
|
|
||||||
#, python-brace-format
|
|
||||||
msgid "{name} takes {amount} damage."
|
|
||||||
msgstr ""
|
|
||||||
|
|
||||||
#: squirrelbattle/menus.py:45 squirrelbattle/tests/translations_test.py:14
|
|
||||||
#: squirrelbattle/tests/game_test.py:284 squirrelbattle/tests/game_test.py:287
|
|
||||||
#: squirrelbattle/tests/translations_test.py:16
|
|
||||||
#: squirrelbattle/tests/game_test.py:290
|
|
||||||
msgid "New game"
|
|
||||||
msgstr ""
|
|
||||||
|
|
||||||
#: squirrelbattle/menus.py:46 squirrelbattle/tests/translations_test.py:15
|
|
||||||
#: squirrelbattle/tests/translations_test.py:17
|
|
||||||
msgid "Resume"
|
|
||||||
msgstr ""
|
|
||||||
|
|
||||||
#: squirrelbattle/menus.py:47 squirrelbattle/tests/translations_test.py:17
|
|
||||||
#: squirrelbattle/tests/translations_test.py:19
|
|
||||||
msgid "Save"
|
|
||||||
msgstr ""
|
|
||||||
|
|
||||||
#: squirrelbattle/menus.py:48 squirrelbattle/tests/translations_test.py:16
|
|
||||||
#: squirrelbattle/tests/translations_test.py:18
|
|
||||||
msgid "Load"
|
|
||||||
msgstr ""
|
|
||||||
|
|
||||||
#: squirrelbattle/menus.py:49 squirrelbattle/tests/translations_test.py:18
|
|
||||||
#: squirrelbattle/tests/translations_test.py:20
|
|
||||||
msgid "Settings"
|
|
||||||
msgstr ""
|
|
||||||
|
|
||||||
#: squirrelbattle/menus.py:50 squirrelbattle/tests/translations_test.py:19
|
|
||||||
#: squirrelbattle/tests/translations_test.py:21
|
|
||||||
msgid "Exit"
|
|
||||||
msgstr ""
|
|
||||||
|
|
||||||
#: squirrelbattle/menus.py:71
|
|
||||||
msgid "Back"
|
|
||||||
msgstr ""
|
|
||||||
|
|
||||||
#: squirrelbattle/game.py:147 squirrelbattle/game.py:148
|
|
||||||
msgid ""
|
|
||||||
"Some keys are missing in your save file.\n"
|
|
||||||
"Your save seems to be corrupt. It got deleted."
|
|
||||||
msgstr ""
|
|
||||||
|
|
||||||
#: squirrelbattle/game.py:155 squirrelbattle/game.py:156
|
|
||||||
msgid ""
|
|
||||||
"No player was found on this map!\n"
|
|
||||||
"Maybe you died?"
|
|
||||||
msgstr ""
|
|
||||||
|
|
||||||
#: squirrelbattle/game.py:175 squirrelbattle/game.py:176
|
|
||||||
msgid ""
|
|
||||||
"The JSON file is not correct.\n"
|
|
||||||
"Your save seems corrupted. It got deleted."
|
|
||||||
msgstr ""
|
|
||||||
|
|
||||||
#: squirrelbattle/settings.py:21 squirrelbattle/tests/translations_test.py:21
|
|
||||||
#: squirrelbattle/tests/translations_test.py:25
|
|
||||||
#: squirrelbattle/tests/translations_test.py:27
|
|
||||||
msgid "Main key to move up"
|
|
||||||
msgstr ""
|
|
||||||
|
|
||||||
#: squirrelbattle/settings.py:22 squirrelbattle/tests/translations_test.py:23
|
|
||||||
#: squirrelbattle/tests/translations_test.py:27
|
|
||||||
#: squirrelbattle/tests/translations_test.py:29
|
|
||||||
msgid "Secondary key to move up"
|
|
||||||
msgstr ""
|
|
||||||
|
|
||||||
#: squirrelbattle/settings.py:23 squirrelbattle/tests/translations_test.py:25
|
|
||||||
#: squirrelbattle/tests/translations_test.py:29
|
|
||||||
#: squirrelbattle/tests/translations_test.py:31
|
|
||||||
msgid "Main key to move down"
|
|
||||||
msgstr ""
|
|
||||||
|
|
||||||
#: squirrelbattle/settings.py:24 squirrelbattle/tests/translations_test.py:27
|
|
||||||
#: squirrelbattle/tests/translations_test.py:31
|
|
||||||
#: squirrelbattle/tests/translations_test.py:33
|
|
||||||
msgid "Secondary key to move down"
|
|
||||||
msgstr ""
|
|
||||||
|
|
||||||
#: squirrelbattle/settings.py:25 squirrelbattle/tests/translations_test.py:29
|
|
||||||
#: squirrelbattle/tests/translations_test.py:33
|
|
||||||
#: squirrelbattle/tests/translations_test.py:35
|
|
||||||
msgid "Main key to move left"
|
|
||||||
msgstr ""
|
|
||||||
|
|
||||||
#: squirrelbattle/settings.py:26 squirrelbattle/tests/translations_test.py:31
|
|
||||||
#: squirrelbattle/tests/translations_test.py:35
|
|
||||||
#: squirrelbattle/tests/translations_test.py:37
|
|
||||||
msgid "Secondary key to move left"
|
|
||||||
msgstr ""
|
|
||||||
|
|
||||||
#: squirrelbattle/settings.py:27 squirrelbattle/tests/translations_test.py:33
|
|
||||||
#: squirrelbattle/tests/translations_test.py:37
|
|
||||||
#: squirrelbattle/tests/translations_test.py:39
|
|
||||||
msgid "Main key to move right"
|
|
||||||
msgstr ""
|
|
||||||
|
|
||||||
#: squirrelbattle/settings.py:29 squirrelbattle/tests/translations_test.py:35
|
|
||||||
#: squirrelbattle/tests/translations_test.py:39
|
|
||||||
#: squirrelbattle/tests/translations_test.py:41
|
|
||||||
msgid "Secondary key to move right"
|
|
||||||
msgstr ""
|
|
||||||
|
|
||||||
#: squirrelbattle/settings.py:30 squirrelbattle/tests/translations_test.py:37
|
|
||||||
#: squirrelbattle/tests/translations_test.py:41
|
|
||||||
#: squirrelbattle/tests/translations_test.py:43
|
|
||||||
msgid "Key to validate a menu"
|
|
||||||
msgstr ""
|
|
||||||
|
|
||||||
#: squirrelbattle/settings.py:31 squirrelbattle/tests/translations_test.py:39
|
|
||||||
#: squirrelbattle/tests/translations_test.py:43
|
|
||||||
#: squirrelbattle/tests/translations_test.py:45
|
|
||||||
msgid "Texture pack"
|
|
||||||
msgstr ""
|
|
||||||
|
|
||||||
#: squirrelbattle/settings.py:32 squirrelbattle/tests/translations_test.py:40
|
|
||||||
#: squirrelbattle/tests/translations_test.py:44
|
|
||||||
#: squirrelbattle/tests/translations_test.py:46
|
|
||||||
msgid "Language"
|
|
||||||
msgstr ""
|
|
||||||
|
|
||||||
#: squirrelbattle/interfaces.py:407 squirrelbattle/interfaces.py:412
|
|
||||||
#: squirrelbattle/interfaces.py:422
|
|
||||||
#, python-brace-format
|
|
||||||
msgid "{name} dies."
|
|
||||||
msgstr ""
|
|
||||||
|
|
||||||
#: squirrelbattle/tests/translations_test.py:47
|
|
||||||
#: squirrelbattle/tests/translations_test.py:49
|
|
||||||
msgid "player"
|
|
||||||
msgstr ""
|
|
||||||
|
|
||||||
#: squirrelbattle/tests/translations_test.py:49
|
|
||||||
#: squirrelbattle/tests/translations_test.py:51
|
|
||||||
msgid "tiger"
|
|
||||||
msgstr ""
|
|
||||||
|
|
||||||
#: squirrelbattle/tests/translations_test.py:50
|
|
||||||
#: squirrelbattle/tests/translations_test.py:52
|
|
||||||
msgid "hedgehog"
|
|
||||||
msgstr ""
|
|
||||||
|
|
||||||
#: squirrelbattle/tests/translations_test.py:51
|
|
||||||
#: squirrelbattle/tests/translations_test.py:53
|
|
||||||
msgid "rabbit"
|
|
||||||
msgstr ""
|
|
||||||
|
|
||||||
#: squirrelbattle/tests/translations_test.py:52
|
|
||||||
#: squirrelbattle/tests/translations_test.py:54
|
|
||||||
msgid "teddy bear"
|
|
||||||
msgstr ""
|
|
||||||
|
|
||||||
#: squirrelbattle/tests/translations_test.py:54
|
|
||||||
#: squirrelbattle/tests/translations_test.py:56
|
|
||||||
msgid "bomb"
|
|
||||||
msgstr ""
|
|
||||||
|
|
||||||
#: squirrelbattle/tests/translations_test.py:55
|
|
||||||
#: squirrelbattle/tests/translations_test.py:57
|
|
||||||
msgid "heart"
|
|
||||||
msgstr ""
|
|
||||||
|
|
||||||
#: squirrelbattle/entities/friendly.py:31
|
|
||||||
msgid "Flower power!!"
|
|
||||||
msgstr ""
|
|
||||||
|
|
||||||
#: squirrelbattle/entities/friendly.py:31
|
|
||||||
msgid "The sun is warm today"
|
|
||||||
msgstr ""
|
|
|
@ -1,13 +1,13 @@
|
||||||
# Copyright (C) 2020 by ÿnérant, eichhornchen, nicomarg, charlse
|
# Copyright (C) 2020-2021 by ÿnérant, eichhornchen, nicomarg, charlse
|
||||||
# SPDX-License-Identifier: GPL-3.0-or-later
|
# SPDX-License-Identifier: GPL-3.0-or-later
|
||||||
|
|
||||||
from enum import Enum
|
from enum import Enum
|
||||||
from typing import Any, Optional
|
from typing import Any, Optional
|
||||||
|
|
||||||
from .display.texturepack import TexturePack
|
from .display.texturepack import TexturePack
|
||||||
|
from .entities.friendly import Chest, Merchant
|
||||||
from .entities.player import Player
|
from .entities.player import Player
|
||||||
from .entities.friendly import Merchant, Chest
|
from .enums import DisplayActions, GameMode, KeyValues
|
||||||
from .enums import GameMode, KeyValues, DisplayActions
|
|
||||||
from .settings import Settings
|
from .settings import Settings
|
||||||
from .translations import gettext as _, Translator
|
from .translations import gettext as _, Translator
|
||||||
|
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
# Copyright (C) 2020 by ÿnérant, eichhornchen, nicomarg, charlse
|
# Copyright (C) 2020-2021 by ÿnérant, eichhornchen, nicomarg, charlse
|
||||||
# SPDX-License-Identifier: GPL-3.0-or-later
|
# SPDX-License-Identifier: GPL-3.0-or-later
|
||||||
|
|
||||||
from pathlib import Path
|
from pathlib import Path
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
# Copyright (C) 2020 by ÿnérant, eichhornchen, nicomarg, charlse
|
# Copyright (C) 2020-2021 by ÿnérant, eichhornchen, nicomarg, charlse
|
||||||
# SPDX-License-Identifier: GPL-3.0-or-later
|
# SPDX-License-Identifier: GPL-3.0-or-later
|
||||||
|
|
||||||
import json
|
import json
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
# Copyright (C) 2020 by ÿnérant, eichhornchen, nicomarg, charlse
|
# Copyright (C) 2020-2021 by ÿnérant, eichhornchen, nicomarg, charlse
|
||||||
# SPDX-License-Identifier: GPL-3.0-or-later
|
# SPDX-License-Identifier: GPL-3.0-or-later
|
||||||
|
|
||||||
import curses
|
import curses
|
||||||
|
|
|
@ -1,2 +1,2 @@
|
||||||
# Copyright (C) 2020 by ÿnérant, eichhornchen, nicomarg, charlse
|
# Copyright (C) 2020-2021 by ÿnérant, eichhornchen, nicomarg, charlse
|
||||||
# SPDX-License-Identifier: GPL-3.0-or-later
|
# SPDX-License-Identifier: GPL-3.0-or-later
|
||||||
|
|
|
@ -1,16 +1,16 @@
|
||||||
# Copyright (C) 2020 by ÿnérant, eichhornchen, nicomarg, charlse
|
# Copyright (C) 2020-2021 by ÿnérant, eichhornchen, nicomarg, charlse
|
||||||
# SPDX-License-Identifier: GPL-3.0-or-later
|
# SPDX-License-Identifier: GPL-3.0-or-later
|
||||||
|
|
||||||
import random
|
import random
|
||||||
import unittest
|
import unittest
|
||||||
|
|
||||||
from squirrelbattle.entities.items import BodySnatchPotion, Bomb, Heart, Item, \
|
from ..entities.friendly import Trumpet
|
||||||
Explosion
|
from ..entities.items import BodySnatchPotion, Bomb, Explosion, Heart, Item
|
||||||
from squirrelbattle.entities.monsters import Tiger, Hedgehog, Rabbit,\
|
from ..entities.monsters import GiantSeaEagle, Hedgehog, Rabbit, \
|
||||||
TeddyBear, GiantSeaEagle
|
TeddyBear, Tiger
|
||||||
from squirrelbattle.entities.friendly import Trumpet
|
from ..entities.player import Player
|
||||||
from squirrelbattle.entities.player import Player
|
from ..interfaces import Entity, Map
|
||||||
from squirrelbattle.interfaces import Entity, Map
|
from ..resources import ResourceManager
|
||||||
from squirrelbattle.resources import ResourceManager
|
|
||||||
|
|
||||||
|
|
||||||
class TestEntities(unittest.TestCase):
|
class TestEntities(unittest.TestCase):
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
# Copyright (C) 2020 by ÿnérant, eichhornchen, nicomarg, charlse
|
# Copyright (C) 2020-2021 by ÿnérant, eichhornchen, nicomarg, charlse
|
||||||
# SPDX-License-Identifier: GPL-3.0-or-later
|
# SPDX-License-Identifier: GPL-3.0-or-later
|
||||||
|
|
||||||
import curses
|
import curses
|
||||||
|
@ -8,13 +8,13 @@ import unittest
|
||||||
from ..bootstrap import Bootstrap
|
from ..bootstrap import Bootstrap
|
||||||
from ..display.display import Display
|
from ..display.display import Display
|
||||||
from ..display.display_manager import DisplayManager
|
from ..display.display_manager import DisplayManager
|
||||||
from ..entities.friendly import Merchant, Sunflower, Chest
|
from ..entities.friendly import Chest, Merchant, Sunflower
|
||||||
from ..entities.items import Bomb, Heart, Sword, Explosion, Shield, Helmet, \
|
from ..entities.items import Bomb, Bow, Chestplate, Explosion, FireBallStaff, \
|
||||||
Chestplate, RingCritical, Bow, FireBallStaff, ScrollofDamage,\
|
Heart, Helmet, Monocle, RingCritical, ScrollofDamage, ScrollofWeakening, \
|
||||||
ScrollofWeakening, Monocle
|
Shield, Sword
|
||||||
from ..entities.monsters import Rabbit, GiantSeaEagle
|
from ..entities.monsters import GiantSeaEagle, Rabbit
|
||||||
from ..entities.player import Player
|
from ..entities.player import Player
|
||||||
from ..enums import DisplayActions, KeyValues, GameMode
|
from ..enums import DisplayActions, GameMode, KeyValues
|
||||||
from ..game import Game
|
from ..game import Game
|
||||||
from ..interfaces import Map
|
from ..interfaces import Map
|
||||||
from ..menus import MainMenuValues
|
from ..menus import MainMenuValues
|
||||||
|
|
|
@ -1,11 +1,11 @@
|
||||||
# Copyright (C) 2020 by ÿnérant, eichhornchen, nicomarg, charlse
|
# Copyright (C) 2020-2021 by ÿnérant, eichhornchen, nicomarg, charlse
|
||||||
# SPDX-License-Identifier: GPL-3.0-or-later
|
# SPDX-License-Identifier: GPL-3.0-or-later
|
||||||
|
|
||||||
import unittest
|
import unittest
|
||||||
|
|
||||||
from squirrelbattle.display.texturepack import TexturePack
|
from ..display.texturepack import TexturePack
|
||||||
from squirrelbattle.interfaces import Map, Tile, Slope
|
from ..interfaces import Map, Slope, Tile
|
||||||
from squirrelbattle.resources import ResourceManager
|
from ..resources import ResourceManager
|
||||||
|
|
||||||
|
|
||||||
class TestInterfaces(unittest.TestCase):
|
class TestInterfaces(unittest.TestCase):
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
# Copyright (C) 2020 by ÿnérant, eichhornchen, nicomarg, charlse
|
# Copyright (C) 2020-2021 by ÿnérant, eichhornchen, nicomarg, charlse
|
||||||
# SPDX-License-Identifier: GPL-3.0-or-later
|
# SPDX-License-Identifier: GPL-3.0-or-later
|
||||||
|
|
||||||
from typing import Tuple
|
from typing import Tuple
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
# Copyright (C) 2020 by ÿnérant, eichhornchen, nicomarg, charlse
|
# Copyright (C) 2020-2021 by ÿnérant, eichhornchen, nicomarg, charlse
|
||||||
# SPDX-License-Identifier: GPL-3.0-or-later
|
# SPDX-License-Identifier: GPL-3.0-or-later
|
||||||
|
|
||||||
import unittest
|
import unittest
|
||||||
|
|
|
@ -1,11 +1,11 @@
|
||||||
# Copyright (C) 2020 by ÿnérant, eichhornchen, nicomarg, charlse
|
# Copyright (C) 2020-2021 by ÿnérant, eichhornchen, nicomarg, charlse
|
||||||
# SPDX-License-Identifier: GPL-3.0-or-later
|
# SPDX-License-Identifier: GPL-3.0-or-later
|
||||||
|
|
||||||
import gettext as gt
|
import gettext as gt
|
||||||
import os
|
import os
|
||||||
|
from pathlib import Path
|
||||||
import re
|
import re
|
||||||
import subprocess
|
import subprocess
|
||||||
from pathlib import Path
|
|
||||||
from typing import Any, List
|
from typing import Any, List
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue