-
Notifications
You must be signed in to change notification settings - Fork 3
/
dungeon.h
48 lines (40 loc) · 1.52 KB
/
dungeon.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
#pragma once
#include <Arduino.h>
#include "dungeonTypes.h"
#include "externBitmaps.h"
// uncomment this line to make the player invincible
//#define _GODMODE_
// Dungeon
class Dungeon
{
public:
DUNGEON _dungeon;
static constexpr uint8_t getLevelWidth() { return( LEVEL_WIDTH ); }
static constexpr uint8_t getLevelHeight() { return( LEVEL_HEIGHT ); }
void clear();
void init();
bool isPlayerAlive() { return( _dungeon.playerHP > 0 ); }
void gameLoop();
void checkPlayerMovement();
#ifdef _USE_FIELD_OF_VIEW_
void updateFieldOfView();
uint8_t getCell( const int8_t distance, const int8_t offsetLR );
#endif
uint8_t *getCellRaw( int8_t x, int8_t y, const int8_t distance, const int8_t offsetLR, const uint8_t orientation );
void limitDungeonPosition( int8_t &x, int8_t &y );
void updateStatusPane();
void openChest( INTERACTION_INFO &info );
void initDice();
void updateDice();
uint8_t getDice( uint8_t maxValue );
MONSTER_STATS *findMonster( const uint8_t position );
void playerAttack( MONSTER_STATS *monster );
void monsterAttack( MONSTER_STATS *monster );
void playerInteraction( uint8_t *cell, const uint8_t cellValue );
void /*__attribute__ ((noinline))*/ renderImage();
// bitmap drawing functions
uint8_t /*__attribute__ ((always_inline))*/ getWallPixels( const int8_t x, const int8_t y );
uint8_t getDownScaledBitmapData( int8_t x, int8_t y,
const uint8_t distance, const NON_WALL_OBJECT *object,
bool useMask );
};