Beaver is a tiger
This commit is contained in:
parent
8a85f58261
commit
fb3f3ee5e8
|
@ -25,14 +25,14 @@ Dans le `pack de textures`_ ASCII, il est représenté par le caractère ``*``.
|
|||
Dans le `pack de textures`_ écureuil, il est représenté par l'émoji ``🦔``.
|
||||
|
||||
|
||||
Castor
|
||||
------
|
||||
Tigre
|
||||
-----
|
||||
|
||||
Son nom est fixé à `beaver`. Il a par défaut une force à **2** et **20** points de vie.
|
||||
Son nom est fixé à `tiger`. Il a par défaut une force à **2** et **20** points de vie.
|
||||
|
||||
Dans le `pack de textures`_ ASCII, il est représenté par le caractère ``_``.
|
||||
Dans le `pack de textures`_ ASCII, il est représenté par le caractère ``n``.
|
||||
|
||||
Dans le `pack de textures`_ écureuil, il est représenté par l'émoji ``🦫``.
|
||||
Dans le `pack de textures`_ écureuil, il est représenté par l'émoji ``🐅``.
|
||||
|
||||
|
||||
Lapin
|
||||
|
|
|
@ -12,7 +12,7 @@ Pack de textures
|
|||
.. _Cœur: entities/items.html#coeur
|
||||
.. _Bombe: entities/items.html#bombe
|
||||
.. _Lapin: entities/monsters.html#lapin
|
||||
.. _Castor: entities/monsters.html#castor
|
||||
.. _Tigre: entities/monsters.html#tigre
|
||||
.. _Nounours: entities/monsters.html#nounours
|
||||
|
||||
Chaque entité_ et chaque tuile_ de la carte_ est associé à un caractère pour
|
||||
|
@ -42,7 +42,7 @@ Chaque tuile fait un caractère de large.
|
|||
* Cœur_ : ``❤``
|
||||
* Bombe_ : ``o``
|
||||
* Lapin_ : ``Y``
|
||||
* Castor_ : ``_``
|
||||
* Tigre_ : ``n``
|
||||
* Nounours_ : ``8``
|
||||
|
||||
|
||||
|
@ -61,5 +61,5 @@ Chaque tuile fait 2 caractères de large pour afficher les émojis proprement.
|
|||
* Cœur_ : ``💜``
|
||||
* Bombe_ : ``💣``
|
||||
* Lapin_ : ``🐇``
|
||||
* Castor_ : ``🦫``
|
||||
* Tigre_ : ``🐅``
|
||||
* Nounours_ : ``🧸``
|
||||
|
|
|
@ -51,7 +51,7 @@ TexturePack.ASCII_PACK = TexturePack(
|
|||
HEART='❤',
|
||||
BOMB='o',
|
||||
RABBIT='Y',
|
||||
BEAVER='_',
|
||||
TIGER='n',
|
||||
TEDDY_BEAR='8',
|
||||
)
|
||||
|
||||
|
@ -70,6 +70,6 @@ TexturePack.SQUIRREL_PACK = TexturePack(
|
|||
HEART='💜',
|
||||
BOMB='💣',
|
||||
RABBIT='🐇',
|
||||
BEAVER='🦫',
|
||||
TIGER='🐅',
|
||||
TEDDY_BEAR='🧸',
|
||||
)
|
||||
|
|
|
@ -52,13 +52,13 @@ class Monster(FightingEntity):
|
|||
break
|
||||
|
||||
|
||||
class Beaver(Monster):
|
||||
class Tiger(Monster):
|
||||
"""
|
||||
A beaver monster
|
||||
A tiger monster
|
||||
"""
|
||||
def __init__(self, strength: int = 2, maxhealth: int = 20,
|
||||
*args, **kwargs) -> None:
|
||||
super().__init__(name="beaver", strength=strength,
|
||||
super().__init__(name="tiger", strength=strength,
|
||||
maxhealth=maxhealth, *args, **kwargs)
|
||||
|
||||
|
||||
|
|
|
@ -318,9 +318,9 @@ class Entity:
|
|||
Returns all entities subclasses
|
||||
"""
|
||||
from squirrelbattle.entities.items import Heart, Bomb
|
||||
from squirrelbattle.entities.monsters import Beaver, Hedgehog, \
|
||||
from squirrelbattle.entities.monsters import Tiger, Hedgehog, \
|
||||
Rabbit, TeddyBear
|
||||
return [Beaver, Bomb, Heart, Hedgehog, Rabbit, TeddyBear]
|
||||
return [Tiger, Bomb, Heart, Hedgehog, Rabbit, TeddyBear]
|
||||
|
||||
@staticmethod
|
||||
def get_all_entity_classes_in_a_dict() -> dict:
|
||||
|
@ -328,11 +328,11 @@ class Entity:
|
|||
Returns all entities subclasses in a dictionary
|
||||
"""
|
||||
from squirrelbattle.entities.player import Player
|
||||
from squirrelbattle.entities.monsters import Beaver, Hedgehog, Rabbit, \
|
||||
from squirrelbattle.entities.monsters import Tiger, Hedgehog, Rabbit, \
|
||||
TeddyBear
|
||||
from squirrelbattle.entities.items import Bomb, Heart
|
||||
return {
|
||||
"Beaver": Beaver,
|
||||
"Tiger": Tiger,
|
||||
"Bomb": Bomb,
|
||||
"Heart": Heart,
|
||||
"Hedgehog": Hedgehog,
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
import unittest
|
||||
|
||||
from squirrelbattle.entities.items import Bomb, Heart, Item
|
||||
from squirrelbattle.entities.monsters import Beaver, Hedgehog, Rabbit, TeddyBear
|
||||
from squirrelbattle.entities.monsters import Tiger, Hedgehog, Rabbit, TeddyBear
|
||||
from squirrelbattle.entities.player import Player
|
||||
from squirrelbattle.interfaces import Entity, Map
|
||||
from squirrelbattle.resources import ResourceManager
|
||||
|
@ -36,17 +36,17 @@ class TestEntities(unittest.TestCase):
|
|||
"""
|
||||
Test some random stuff with fighting entities.
|
||||
"""
|
||||
entity = Beaver()
|
||||
entity = Tiger()
|
||||
self.map.add_entity(entity)
|
||||
self.assertEqual(entity.maxhealth, 20)
|
||||
self.assertEqual(entity.maxhealth, entity.health)
|
||||
self.assertEqual(entity.strength, 2)
|
||||
for _ in range(9):
|
||||
self.assertEqual(entity.hit(entity),
|
||||
"beaver hits beaver. beaver takes 2 damage.")
|
||||
"tiger hits tiger. tiger takes 2 damage.")
|
||||
self.assertFalse(entity.dead)
|
||||
self.assertEqual(entity.hit(entity), "beaver hits beaver. "
|
||||
+ "beaver takes 2 damage. beaver dies.")
|
||||
self.assertEqual(entity.hit(entity), "tiger hits tiger. "
|
||||
+ "tiger takes 2 damage. tiger dies.")
|
||||
self.assertTrue(entity.dead)
|
||||
|
||||
entity = Rabbit()
|
||||
|
|
Loading…
Reference in New Issue