mirror of
https://github.com/zenorogue/hyperrogue.git
synced 2024-11-20 11:54:48 +00:00
default_levs() as a function
This commit is contained in:
parent
00262e8f6a
commit
4287ddf883
@ -133,6 +133,14 @@ EX bool grailWasFound(cell *c) {
|
||||
return c->master->alt->alt->emeraldval & GRAIL_FOUND;
|
||||
}
|
||||
|
||||
EX int default_levs() {
|
||||
if(IRREGULAR)
|
||||
return 1;
|
||||
if(S3 >= OINF)
|
||||
return 1;
|
||||
return S3-3;
|
||||
}
|
||||
|
||||
void hrmap::generateAlts(heptagon *h, int levs, bool link_cdata) {
|
||||
if(hybri) { PIU ( generateAlts(h, levs, link_cdata) ); }
|
||||
if(!h->alt) return;
|
||||
|
4
cell.cpp
4
cell.cpp
@ -11,6 +11,8 @@
|
||||
namespace hr {
|
||||
|
||||
#if HDR
|
||||
extern int default_levs();
|
||||
|
||||
struct hrmap {
|
||||
virtual heptagon *getOrigin() { return NULL; }
|
||||
virtual cell *gamestart() { return getOrigin()->c7; }
|
||||
@ -18,7 +20,7 @@ struct hrmap {
|
||||
virtual vector<cell*>& allcells();
|
||||
virtual void verify() { }
|
||||
virtual void link_alt(const cellwalker& hs) { }
|
||||
virtual void generateAlts(heptagon *h, int levs = IRREGULAR ? 1 : S3 >= OINF ? 1 : S3-3, bool link_cdata = true);
|
||||
virtual void generateAlts(heptagon *h, int levs = default_levs(), bool link_cdata = true);
|
||||
heptagon *may_create_step(heptagon *h, int direction) {
|
||||
if(h->move(direction)) return h->move(direction);
|
||||
return create_step(h, direction);
|
||||
|
Loading…
Reference in New Issue
Block a user