Doors #156
|
@ -126,7 +126,7 @@ TexturePack.SQUIRREL_PACK = TexturePack(
|
||||||
CHEST='🧰',
|
CHEST='🧰',
|
||||||
CHESTPLATE='🦺',
|
CHESTPLATE='🦺',
|
||||||
DOOR=('🚪', curses.COLOR_WHITE, (1000, 1000, 1000),
|
DOOR=('🚪', curses.COLOR_WHITE, (1000, 1000, 1000),
|
||||||
curses.COLOR_WHITE, (1000, 1000, 1000)),
|
curses.COLOR_WHITE, (1000, 1000, 1000)),
|
||||||
EAGLE='🦅',
|
EAGLE='🦅',
|
||||||
EMPTY=' ',
|
EMPTY=' ',
|
||||||
EXPLOSION='💥',
|
EXPLOSION='💥',
|
||||||
|
|
|
@ -6,7 +6,7 @@ from random import randint
|
||||||
from typing import Dict, Optional, Tuple
|
from typing import Dict, Optional, Tuple
|
||||||
|
|
||||||
from .items import Item
|
from .items import Item
|
||||||
from ..interfaces import FightingEntity, InventoryHolder
|
from ..interfaces import FightingEntity, InventoryHolder, Tile
|
||||||
from ..translations import gettext as _
|
from ..translations import gettext as _
|
||||||
|
|
||||||
|
|
||||||
|
@ -152,6 +152,12 @@ class Player(InventoryHolder, FightingEntity):
|
||||||
return True
|
return True
|
||||||
elif entity.is_item():
|
elif entity.is_item():
|
||||||
entity.hold(self)
|
entity.hold(self)
|
||||||
|
tile = self.map.tiles[y][x]
|
||||||
|
if tile == Tile.DOOR and move_if_possible:
|
||||||
|
# Open door
|
||||||
|
self.map.tiles[y][x] = Tile.FLOOR
|
||||||
|
self.map.compute_visibility(y, x, self.vision)
|
||||||
|
return super().check_move(y, x, move_if_possible)
|
||||||
return super().check_move(y, x, move_if_possible)
|
return super().check_move(y, x, move_if_possible)
|
||||||
|
|
||||||
def save_state(self) -> dict:
|
def save_state(self) -> dict:
|
||||||
|
|
Loading…
Reference in New Issue