My Project
 
Loading...
Searching...
No Matches
dungeon.h
Go to the documentation of this file.
1#pragma once
2
3#include <map>
4#include "bundle.h"
5#include "heroclass.h"
6#include "gamesinprogress.h"
7//#include "hero.h"
8#include "level.h"
9
10class Char;
11
12typedef std::map<int, ArrayList< Item* > > DroppedItemsType;
13
14class Dungeon{
15public:
16 static Bundle* gameBundle(const std::string& fileName);
17 static std::string gameFile(const HeroClass& cl);
18 static void preview(GamesInProgress::Info& info, Bundle* bundle);
19
20 static int potionOfStrength;
21 static int scrollsOfUpgrade;
23 static bool dewVial; // true if the dew vial can be spawned
24
25 static int challenges;
26
27 static Hero* hero;
28 static Level* level;
29
30 static int depth;
31 static int gold;
32
33 static std::string resultDescription;
34
36 static bool nightMode;
37 static std::vector<bool> visible;
38 static std::set<int> chapters;
39
40 static void init();
41 static bool isChallenged(int mask);
42 static Level* newLevel();
43
44 static void loadGame(HeroClass cl);
45 static void loadGame(const std::string& fileName);
46 static void loadGame(const std::string& fileName, bool fullLoad);
47
48 static void resetLevel();
49 static void saveLevel();
50 static Level* loadLevel(HeroClass cl);
51 static void switchLevel(Level* level, int pos);
52 static void observe();
53
54 static bool shopOnLevel() { return depth == 6 || depth == 11 || depth == 16; }
55 static bool bossLevel();
56 static bool bossLevel(int depth){ return depth == 5 || depth == 10 || depth == 15 || depth == 20 || depth == 25; }
57 static int findPath(Char* ch, int from, int to, std::vector<bool>& pass, std::vector<bool>& visible);
58 static int flee(Char* ch, int cur, int from, std::vector<bool>& pass, std::vector<bool>& visible);
59 static void fail(const std::string& desc);
60 static void win(const String& desc);
61 static void deleteGame(HeroClass cl, boolean deleteLevels);
62 static void saveAll();
63private:
64 static const std::string RG_GAME_FILE ;
65 static const std::string RG_DEPTH_FILE ;
66 static const std::string WR_GAME_FILE ;
67 static const std::string WR_DEPTH_FILE ;
68 static const std::string MG_GAME_FILE ;
69 static const std::string MG_DEPTH_FILE ;
70 static const std::string RN_GAME_FILE ;
71 static const std::string RN_DEPTH_FILE ;
72 static const std::string VERSION ;
73 static const std::string CHALLENGES ;
74 static const std::string HERO ;
75 static const std::string GOLD ;
76 static const std::string DEPTH ;
77 static const std::string LEVEL ;
78 static const std::string DROPPED ;
79 static const std::string POS ;
80 static const std::string SOU ;
81 static const std::string SOE ;
82 static const std::string DV ;
83 static const std::string CHAPTERS ;
84 static const std::string QUESTS ;
85 static const std::string BADGES ;
86
87 static std::vector<bool> passable;
88 static std::string depthFile(HeroClass cl);
89};
Definition char.h:9
Definition dungeon.h:14
static int challenges
Definition dungeon.h:25
static void loadGame(HeroClass cl)
Definition dungeon.cpp:406
static std::vector< bool > visible
Definition dungeon.h:37
static bool bossLevel(int depth)
Definition dungeon.h:56
static int depth
Definition dungeon.h:30
static std::string gameFile(const HeroClass &cl)
Definition dungeon.cpp:50
static std::string resultDescription
Definition dungeon.h:33
static int flee(Char *ch, int cur, int from, std::vector< bool > &pass, std::vector< bool > &visible)
Definition dungeon.cpp:369
static void preview(GamesInProgress::Info &info, Bundle *bundle)
Definition dungeon.cpp:64
static bool shopOnLevel()
Definition dungeon.h:54
static void resetLevel()
Definition dungeon.cpp:245
static void init()
Definition dungeon.cpp:106
static DroppedItemsType droppedItems
Definition dungeon.h:35
static void observe()
Definition dungeon.cpp:292
static bool dewVial
Definition dungeon.h:23
static Level * loadLevel(HeroClass cl)
Definition dungeon.cpp:258
static Bundle * gameBundle(const std::string &fileName)
Definition dungeon.cpp:37
static std::set< int > chapters
Definition dungeon.h:38
static void fail(const std::string &desc)
Definition dungeon.cpp:398
static int potionOfStrength
Definition dungeon.h:20
static Level * newLevel()
Definition dungeon.cpp:157
static bool nightMode
Definition dungeon.h:36
static bool bossLevel()
Definition dungeon.cpp:331
static int scrollsOfEnchantment
Definition dungeon.h:22
static void saveLevel()
Definition dungeon.cpp:307
static void saveAll()
Definition dungeon.cpp:538
static Hero * hero
Definition dungeon.h:27
static Level * level
Definition dungeon.h:28
static int gold
Definition dungeon.h:31
static int findPath(Char *ch, int from, int to, std::vector< bool > &pass, std::vector< bool > &visible)
Definition dungeon.cpp:336
static void deleteGame(HeroClass cl, boolean deleteLevels)
Definition dungeon.cpp:524
static int scrollsOfUpgrade
Definition dungeon.h:21
static bool isChallenged(int mask)
Definition dungeon.cpp:152
static void win(const String &desc)
Definition dungeon.cpp:512
static void switchLevel(Level *level, int pos)
Definition dungeon.cpp:272
Definition heroclass.h:10
Definition hero.h:18
Definition level.h:17
std::map< int, ArrayList< Item * > > DroppedItemsType
Definition dungeon.h:12
Definition gamesinprogress.h:8
std::string String
Definition typedefine.h:8