Add in throwable items (dagger) from pixel dungeon
This commit is contained in:
@@ -36,11 +36,13 @@ describe('Terrain', () => {
|
||||
|
||||
expect(blocksSight(TileType.EMPTY)).toBe(false);
|
||||
expect(blocksSight(TileType.EXIT)).toBe(false);
|
||||
expect(blocksSight(TileType.GRASS_SAPLINGS)).toBe(false);
|
||||
});
|
||||
|
||||
it('should return correct destruction result', () => {
|
||||
expect(getDestructionResult(TileType.GRASS)).toBe(TileType.GRASS_SAPLINGS);
|
||||
expect(getDestructionResult(TileType.DOOR_CLOSED)).toBe(TileType.DOOR_OPEN);
|
||||
expect(getDestructionResult(TileType.DOOR_OPEN)).toBe(TileType.DOOR_CLOSED);
|
||||
|
||||
expect(getDestructionResult(TileType.WALL)).toBeUndefined();
|
||||
});
|
||||
@@ -48,7 +50,17 @@ describe('Terrain', () => {
|
||||
it('should correctly identify tiles destructible by walk', () => {
|
||||
expect(isDestructibleByWalk(TileType.GRASS)).toBe(true);
|
||||
expect(isDestructibleByWalk(TileType.DOOR_CLOSED)).toBe(true);
|
||||
expect(isDestructibleByWalk(TileType.DOOR_OPEN)).toBe(true); // Should be closable by walk
|
||||
expect(isDestructibleByWalk(TileType.WALL)).toBe(false);
|
||||
});
|
||||
|
||||
it('should handle unknown tile types gracefully', () => {
|
||||
const unknownTile = 999;
|
||||
expect(isBlocking(unknownTile)).toBe(false);
|
||||
expect(isDestructible(unknownTile)).toBe(false);
|
||||
expect(blocksSight(unknownTile)).toBe(false);
|
||||
expect(getDestructionResult(unknownTile)).toBeUndefined();
|
||||
expect(isDestructibleByWalk(unknownTile)).toBe(false);
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user