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