| 1 |
|
| 2 |
|
| 3 |
|
| 4 |
|
| 5 |
|
| 6 |
|
| 7 |
|
| 8 |
|
| 9 |
|
| 10 |
|
| 11 |
|
| 12 |
|
| 13 |
|
| 14 |
|
| 15 |
|
| 16 |
|
| 17 |
|
| 18 |
#ifndef __map_h__ |
| 19 |
#define __map_h__ |
| 20 |
|
| 21 |
|
| 22 |
|
| 23 |
#include "assert.h" |
| 24 |
#include "glbdef.h" |
| 25 |
#include "gfxengine.h" |
| 26 |
#include "smokestack.h" |
| 27 |
#include "itemstack.h" |
| 28 |
#include "signpost.h" |
| 29 |
|
| 30 |
class MAP; |
| 31 |
class MOB; |
| 32 |
class ITEM; |
| 33 |
class SRAMSTREAM; |
| 34 |
class INTRINSIC_COUNTER; |
| 35 |
|
| 36 |
extern MAP *glbCurLevel; |
| 37 |
|
| 38 |
struct PT2 |
| 39 |
{ |
| 40 |
int x, y; |
| 41 |
int data; |
| 42 |
}; |
| 43 |
|
| 44 |
struct ROOM_DEF |
| 45 |
{ |
| 46 |
PT2 size; |
| 47 |
const SQUARE_NAMES *squarelist; |
| 48 |
|
| 49 |
|
| 50 |
const PT2 *squareflaglist; |
| 51 |
const PT2 *itemlist; |
| 52 |
const PT2 *moblist; |
| 53 |
const PT2 *itemtypelist; |
| 54 |
const PT2 *moblevellist; |
| 55 |
const PT2 *intrinsiclist; |
| 56 |
const PT2 *signpostlist; |
| 57 |
|
| 58 |
|
| 59 |
int minlevel, maxlevel; |
| 60 |
u8 rarity; |
| 61 |
u8 mandatory; |
| 62 |
u8 onlyonce; |
| 63 |
u8 allowstairs; |
| 64 |
u8 allowgeneration; |
| 65 |
u8 allowdig; |
| 66 |
u8 allowitems; |
| 67 |
u8 allowtel; |
| 68 |
int x, y; |
| 69 |
s8 quest; |
| 70 |
const char *name; |
| 71 |
}; |
| 72 |
|
| 73 |
struct ROOM |
| 74 |
{ |
| 75 |
PT2 l, h; |
| 76 |
const ROOM_DEF *definition; |
| 77 |
int rotation; |
| 78 |
}; |
| 79 |
|
| 80 |
#define ROOM_FLIP_X 1 |
| 81 |
#define ROOM_FLIP_Y 2 |
| 82 |
#define ROOM_FLOP 4 |
| 83 |
|
| 84 |
class MAP |
| 85 |
{ |
| 86 |
public: |
| 87 |
MAP(int level, BRANCH_NAMES branch); |
| 88 |
virtual ~MAP(); |
| 89 |
|
| 90 |
|
| 91 |
long getSeed() const { return mySeed; } |
| 92 |
|
| 93 |
|
| 94 |
void deleteAllMaps(); |
| 95 |
|
| 96 |
|
| 97 |
|
| 98 |
|
| 99 |
|
| 100 |
|
| 101 |
bool findPath(int sx, int sy, |
| 102 |
int ex, int ey, |
| 103 |
MOVE_NAMES movetype, |
| 104 |
bool allowmob, |
| 105 |
bool allowdoor, |
| 106 |
int &dx, int &dy); |
| 107 |
|
| 108 |
|
| 109 |
|
| 110 |
|
| 111 |
void updateAvatarSmell(int x, int y, int smell); |
| 112 |
|
| 113 |
|
| 114 |
|
| 115 |
|
| 116 |
int getAvatarSmell(int x, int y) const; |
| 117 |
|
| 118 |
|
| 119 |
|
| 120 |
bool getAvatarSmellGradient(MOB *mob, int x, int y, int &dx, int &dy) const; |
| 121 |
|
| 122 |
|
| 123 |
|
| 124 |
void populate(); |
| 125 |
|
| 126 |
|
| 127 |
|
| 128 |
|
| 129 |
bool createAndPlaceNPC(bool avoidfov); |
| 130 |
|
| 131 |
|
| 132 |
|
| 133 |
|
| 134 |
void refresh(bool preserve_ray = false); |
| 135 |
|
| 136 |
void updateLights(); |
| 137 |
|
| 138 |
int getDesiredMobCount() const; |
| 139 |
int getThreatLevel() const; |
| 140 |
|
| 141 |
|
| 142 |
|
| 143 |
void doHeartbeat(); |
| 144 |
|
| 145 |
|
| 146 |
|
| 147 |
void digHole(int x, int y, MOB *digger); |
| 148 |
|
| 149 |
|
| 150 |
|
| 151 |
|
| 152 |
void digPit(int x, int y, MOB *digger); |
| 153 |
|
| 154 |
|
| 155 |
bool digSquare(int x, int y, MOB *digger); |
| 156 |
|
| 157 |
|
| 158 |
void growForest(int x, int y, MOB *grower); |
| 159 |
|
| 160 |
|
| 161 |
void downPour(int x, int y, MOB *pourer); |
| 162 |
|
| 163 |
|
| 164 |
|
| 165 |
void floodSquare(SQUARE_NAMES tile, int x, int y, |
| 166 |
MOB *flooder); |
| 167 |
|
| 168 |
|
| 169 |
|
| 170 |
|
| 171 |
void dropItems(int x, int y, MOB *revealer); |
| 172 |
|
| 173 |
|
| 174 |
|
| 175 |
|
| 176 |
|
| 177 |
|
| 178 |
bool fillSquare(ITEM *boulder, MOB *filler, |
| 179 |
ITEM **newitem = 0); |
| 180 |
|
| 181 |
|
| 182 |
|
| 183 |
|
| 184 |
|
| 185 |
|
| 186 |
|
| 187 |
bool dropMobs(int x, int y, bool forcetrap, MOB *revealer, |
| 188 |
bool noskillevade=false); |
| 189 |
|
| 190 |
|
| 191 |
|
| 192 |
|
| 193 |
|
| 194 |
bool createTrap(int x, int y, MOB *trapper); |
| 195 |
|
| 196 |
|
| 197 |
|
| 198 |
bool freezeSquare(int x, int y, MOB *freezer); |
| 199 |
|
| 200 |
|
| 201 |
|
| 202 |
|
| 203 |
bool electrocuteSquare(int x, int y, MOB *shocker); |
| 204 |
|
| 205 |
|
| 206 |
void douseSquare(int x, int y, bool holy, MOB *douser); |
| 207 |
|
| 208 |
|
| 209 |
bool burnSquare(int x, int y, MOB *burner); |
| 210 |
|
| 211 |
|
| 212 |
bool electrifySquare(int x, int y, int points, |
| 213 |
MOB *shocker); |
| 214 |
|
| 215 |
|
| 216 |
|
| 217 |
bool resurrectCorpses(int x, int y, MOB *resser); |
| 218 |
|
| 219 |
|
| 220 |
bool raiseZombie(int x, int y, MOB *raiser); |
| 221 |
|
| 222 |
|
| 223 |
bool raiseSkeleton(int x, int y, MOB *raiser); |
| 224 |
|
| 225 |
|
| 226 |
void moveSmoke(); |
| 227 |
|
| 228 |
|
| 229 |
|
| 230 |
SMOKE_NAMES getSmoke(int x, int y, MOB **owner=0) const; |
| 231 |
|
| 232 |
|
| 233 |
SIGNPOST_NAMES getSignPost(int x, int y) const; |
| 234 |
|
| 235 |
|
| 236 |
|
| 237 |
|
| 238 |
void setSmoke(int x, int y, SMOKE_NAMES smoke, MOB *owner); |
| 239 |
|
| 240 |
|
| 241 |
|
| 242 |
void applySuction(int x, int y); |
| 243 |
|
| 244 |
|
| 245 |
void moveFluids(); |
| 246 |
|
| 247 |
void setWindDirection(int dx, int dy, int duration); |
| 248 |
|
| 249 |
|
| 250 |
|
| 251 |
|
| 252 |
void getWindDirection(int &dx, int &dy); |
| 253 |
|
| 254 |
|
| 255 |
void getAmbientWindDirection(int &dx, int &dy); |
| 256 |
|
| 257 |
|
| 258 |
|
| 259 |
|
| 260 |
inline void setTile(u8 x, u8 y, SQUARE_NAMES tile) |
| 261 |
{ |
| 262 |
UT_ASSERT(x < MAP_WIDTH && y < MAP_HEIGHT); |
| 263 |
ourMapDirty = true; |
| 264 |
mySquares[x + y * MAP_WIDTH] = tile; |
| 265 |
} |
| 266 |
inline SQUARE_NAMES getTile(u8 x, u8 y) const |
| 267 |
{ |
| 268 |
UT_ASSERT(x < MAP_WIDTH && y < MAP_HEIGHT); |
| 269 |
return (SQUARE_NAMES) mySquares[x + y * MAP_WIDTH]; |
| 270 |
} |
| 271 |
|
| 272 |
inline SQUARE_NAMES getTileSafe(u8 x, u8 y) const |
| 273 |
{ |
| 274 |
if (x >= MAP_WIDTH || y >= MAP_HEIGHT) |
| 275 |
{ |
| 276 |
return SQUARE_EMPTY; |
| 277 |
} |
| 278 |
return (SQUARE_NAMES) mySquares[x + y * MAP_WIDTH]; |
| 279 |
} |
| 280 |
inline u8 compareTile(u8 x, u8 y, SQUARE_NAMES tile) |
| 281 |
{ |
| 282 |
if (x >= MAP_WIDTH || y >= MAP_HEIGHT) |
| 283 |
return false; |
| 284 |
return (getTile(x, y) == tile); |
| 285 |
} |
| 286 |
bool hasNeighbouringTile(int x, int y, SQUARE_NAMES tile, |
| 287 |
MOB *&srcmob); |
| 288 |
inline void setFlag(u8 x, u8 y, int flag, bool state=true) |
| 289 |
{ |
| 290 |
UT_ASSERT(x < MAP_WIDTH && y < MAP_HEIGHT); |
| 291 |
if (!state) |
| 292 |
clearFlag(x, y, flag); |
| 293 |
else |
| 294 |
myFlags[x + y * MAP_WIDTH] |= flag; |
| 295 |
} |
| 296 |
inline void clearFlag(u8 x, u8 y, int flag) |
| 297 |
{ |
| 298 |
UT_ASSERT(x < MAP_WIDTH && y < MAP_HEIGHT); |
| 299 |
myFlags[x + y * MAP_WIDTH] &= ~flag; |
| 300 |
} |
| 301 |
|
| 302 |
|
| 303 |
|
| 304 |
inline int getFlag(u8 x, u8 y, int flag) const |
| 305 |
{ |
| 306 |
UT_ASSERT(x < MAP_WIDTH && y < MAP_HEIGHT); |
| 307 |
return myFlags[x + y * 32] & flag; |
| 308 |
} |
| 309 |
inline u8 getRawFlag(u8 x, u8 y) const |
| 310 |
{ |
| 311 |
UT_ASSERT(x < MAP_WIDTH && y < MAP_HEIGHT); |
| 312 |
return myFlags[x + y * 32]; |
| 313 |
} |
| 314 |
inline void setRawFlag(u8 x, u8 y, int flag) |
| 315 |
{ |
| 316 |
UT_ASSERT(x < MAP_WIDTH && y < MAP_HEIGHT); |
| 317 |
myFlags[x + y * 32] = flag; |
| 318 |
} |
| 319 |
|
| 320 |
int getDepth() const { return myDepth; } |
| 321 |
|
| 322 |
bool allowDiggingDown() const; |
| 323 |
bool allowMobGeneration() const; |
| 324 |
bool allowItemGeneration() const; |
| 325 |
bool allowTeleportation() const; |
| 326 |
|
| 327 |
|
| 328 |
void markMapped(int x, int y, int radx, int rady, |
| 329 |
bool uselos = true); |
| 330 |
|
| 331 |
|
| 332 |
void applyTempLight(int x, int y, int radius); |
| 333 |
|
| 334 |
void applyFlag(SQUAREFLAG_NAMES flag, |
| 335 |
int cx, int cy, int radius, |
| 336 |
bool uselos, bool state); |
| 337 |
|
| 338 |
|
| 339 |
bool isTransparent(int x, int y) const; |
| 340 |
|
| 341 |
|
| 342 |
bool isLit(int x, int y) const; |
| 343 |
|
| 344 |
|
| 345 |
bool isDiggable(int x, int y) const; |
| 346 |
|
| 347 |
|
| 348 |
|
| 349 |
void buildFOV(int x, int y, int rx, int ry); |
| 350 |
|
| 351 |
bool hasFOV(int x, int y) const; |
| 352 |
|
| 353 |
|
| 354 |
|
| 355 |
bool hasLOS(int x1, int y1, int x2, int y2) const; |
| 356 |
|
| 357 |
bool hasSlowLOS(int x1, int y1, int x2, int y2) const; |
| 358 |
|
| 359 |
bool hasDrunkLOS(int x1, int y1, int x2, int y2) const; |
| 360 |
|
| 361 |
|
| 362 |
|
| 363 |
bool hasManhattenLOS(int x1, int y1, int x2, int y2) const; |
| 364 |
|
| 365 |
void moveMob(MOB *mob, int ox, int oy, int nx, int ny); |
| 366 |
void registerMob(MOB *mob); |
| 367 |
void unregisterMob(MOB *mob); |
| 368 |
MOB *getMobHead() const { return myMobHead; } |
| 369 |
|
| 370 |
|
| 371 |
void wallCrush(MOB *mob); |
| 372 |
|
| 373 |
|
| 374 |
|
| 375 |
|
| 376 |
|
| 377 |
void chaseMobOnStaircase(SQUARE_NAMES destsquare, |
| 378 |
int srcx, int srcy, |
| 379 |
MOB *chasee, |
| 380 |
MAP *nextmap); |
| 381 |
|
| 382 |
|
| 383 |
|
| 384 |
bool describeSquare(int x, int y, bool blind, |
| 385 |
bool includeself); |
| 386 |
|
| 387 |
|
| 388 |
|
| 389 |
|
| 390 |
MAP *getMapUp(bool create = true); |
| 391 |
MAP *peekMapUp() const; |
| 392 |
MAP *getMapDown(bool create = true); |
| 393 |
MAP *peekMapDown() const; |
| 394 |
|
| 395 |
|
| 396 |
|
| 397 |
BRANCH_NAMES offshootName() const; |
| 398 |
|
| 399 |
BRANCH_NAMES branchName() const; |
| 400 |
MAP *getMapBranch(bool create = true); |
| 401 |
MAP *peekMapBranch() const; |
| 402 |
|
| 403 |
|
| 404 |
void setMapUp(MAP *map) { myMapUp = map; } |
| 405 |
void setMapDown(MAP *map) { myMapDown = map; } |
| 406 |
void setMapBranch(MAP *branch) { myMapBranch = branch; } |
| 407 |
|
| 408 |
|
| 409 |
MOB *getMob(int x, int y) const; |
| 410 |
|
| 411 |
|
| 412 |
MOB *getMobPrecise(int x, int y) const; |
| 413 |
|
| 414 |
|
| 415 |
MOB *getGuiltyMob(int x, int y) const; |
| 416 |
void setGuiltyMob(int x, int y, MOB *mob); |
| 417 |
|
| 418 |
ITEM *getItemHead() const { return myItemHead; } |
| 419 |
ITEM *getItem(int x, int y) const; |
| 420 |
ITEM *getItem(int x, int y, bool submerged) const; |
| 421 |
|
| 422 |
|
| 423 |
|
| 424 |
|
| 425 |
|
| 426 |
|
| 427 |
int getItemStack(ITEMSTACK &stack, int x, int y, |
| 428 |
int submergecheck = -1, |
| 429 |
bool checkmapped = false) const; |
| 430 |
|
| 431 |
|
| 432 |
|
| 433 |
|
| 434 |
|
| 435 |
int getPets(MOBSTACK &stack, MOB *owner, |
| 436 |
bool onlysensable) const; |
| 437 |
|
| 438 |
|
| 439 |
|
| 440 |
|
| 441 |
|
| 442 |
|
| 443 |
|
| 444 |
|
| 445 |
void acquireItem(ITEM *item, int x, int y, |
| 446 |
MOB *dropper, |
| 447 |
ITEM **newitem = 0, |
| 448 |
bool ignoregrade = false); |
| 449 |
|
| 450 |
ITEM *dropItem(int x, int y); |
| 451 |
void dropItem(ITEM *item); |
| 452 |
|
| 453 |
|
| 454 |
void fillBottle(ITEM *item, int x, int y) const; |
| 455 |
|
| 456 |
|
| 457 |
|
| 458 |
bool findRandomLoc(int &x, int &y, int movetype, |
| 459 |
bool allowmob, |
| 460 |
bool doublesize, |
| 461 |
bool avoidfov, |
| 462 |
bool avoidfire, |
| 463 |
bool avoidacid, |
| 464 |
bool avoidnomob); |
| 465 |
|
| 466 |
|
| 467 |
|
| 468 |
bool findTile(SQUARE_NAMES tile, int &x, int &y); |
| 469 |
|
| 470 |
|
| 471 |
|
| 472 |
|
| 473 |
bool findCloseTile(int &x, int &y, MOVE_NAMES move, |
| 474 |
bool allowmob = false, |
| 475 |
int maxradius = MAP_WIDTH); |
| 476 |
|
| 477 |
|
| 478 |
|
| 479 |
|
| 480 |
bool isSquareInLockedRoom(int x, int y) const; |
| 481 |
|
| 482 |
|
| 483 |
|
| 484 |
void moveNPCs(); |
| 485 |
|
| 486 |
|
| 487 |
|
| 488 |
bool canMove(int x, int y, MOVE_NAMES movetype, |
| 489 |
bool allowmob = true, |
| 490 |
bool allowdoor = false, |
| 491 |
bool allowitem = true); |
| 492 |
|
| 493 |
|
| 494 |
|
| 495 |
|
| 496 |
|
| 497 |
bool canRayMove(int x, int y, MOVE_NAMES movetype, |
| 498 |
bool reflect, bool *didreflect = 0); |
| 499 |
|
| 500 |
|
| 501 |
void throwItem(int x, int y, int dx, int dy, |
| 502 |
ITEM *item, ITEM *stack, ITEM *launcher, |
| 503 |
MOB *thrower, |
| 504 |
const ATTACK_DEF *attack, |
| 505 |
bool ricochet); |
| 506 |
|
| 507 |
|
| 508 |
|
| 509 |
|
| 510 |
|
| 511 |
|
| 512 |
|
| 513 |
|
| 514 |
void fireRay(int ox, int oy, int dx, int dy, |
| 515 |
int length, |
| 516 |
MOVE_NAMES movetype, bool dobounce, |
| 517 |
bool raycallback(int x, int y, bool final, |
| 518 |
void *data), |
| 519 |
void *data); |
| 520 |
|
| 521 |
|
| 522 |
|
| 523 |
|
| 524 |
void fireBall(int ox, int oy, int rad, bool includecenter, |
| 525 |
bool ballcallback(int x, int y, bool final, |
| 526 |
void *data), |
| 527 |
void *data); |
| 528 |
|
| 529 |
|
| 530 |
|
| 531 |
|
| 532 |
|
| 533 |
bool knockbackMob(int tx, int ty, int dx, int dy, |
| 534 |
bool infinitemass, |
| 535 |
bool ignoremob = false); |
| 536 |
|
| 537 |
|
| 538 |
static void saveGlobal(SRAMSTREAM &os); |
| 539 |
static void loadGlobal(SRAMSTREAM &is); |
| 540 |
|
| 541 |
void saveBranch(SRAMSTREAM &is, bool savebranch = true); |
| 542 |
bool save(SRAMSTREAM &os, bool savebranch = true); |
| 543 |
|
| 544 |
void loadBranch(SRAMSTREAM &is, bool checkbranch = true); |
| 545 |
bool load(SRAMSTREAM &is, bool checkbranch = true); |
| 546 |
|
| 547 |
bool verifyMob() const; |
| 548 |
bool verifyMobLocal() const; |
| 549 |
|
| 550 |
bool verifyCounterGone(INTRINSIC_COUNTER *counter) const; |
| 551 |
bool verifyCounterGoneLocal(INTRINSIC_COUNTER *counter) const; |
| 552 |
|
| 553 |
|
| 554 |
|
| 555 |
void reportMessage(const char *str, int x, int y) const; |
| 556 |
void reportMessage(BUF buf, int x, int y) const |
| 557 |
{ reportMessage(buf.buffer(), x, y); } |
| 558 |
|
| 559 |
int getItemCount() const { return myItemCount; } |
| 560 |
int getMobCount() const { return myMobCount; } |
| 561 |
|
| 562 |
|
| 563 |
|
| 564 |
MAP *findMapWithMob(MOB *mob, bool usebranch=true) const; |
| 565 |
bool isMobOnMap(MOB *mob) const; |
| 566 |
|
| 567 |
|
| 568 |
void collapseDungeon(bool dobranch = true); |
| 569 |
void collapseThisDungeon(); |
| 570 |
|
| 571 |
|
| 572 |
|
| 573 |
|
| 574 |
|
| 575 |
static void delayedLevelChange(MAP *newcurrent); |
| 576 |
|
| 577 |
|
| 578 |
static void checkForAvatarMapChange(); |
| 579 |
|
| 580 |
|
| 581 |
static void changeCurrentLevel(MAP *newcurrent); |
| 582 |
|
| 583 |
|
| 584 |
|
| 585 |
void refreshPtrMaps(); |
| 586 |
|
| 587 |
|
| 588 |
|
| 589 |
|
| 590 |
|
| 591 |
|
| 592 |
|
| 593 |
|
| 594 |
|
| 595 |
|
| 596 |
|
| 597 |
|
| 598 |
void build(bool alreadysavedseed); |
| 599 |
|
| 600 |
static bool isLoading() { return ourIsLoading; } |
| 601 |
|
| 602 |
|
| 603 |
bool isUnlocked() const; |
| 604 |
|
| 605 |
protected: |
| 606 |
|
| 607 |
|
| 608 |
void clear(); |
| 609 |
|
| 610 |
|
| 611 |
void buildRoguelike(); |
| 612 |
void buildQuest(GOD_NAMES god); |
| 613 |
void buildBigRoom(); |
| 614 |
void buildDrunkenCavern(bool islit, bool allowlakes, bool allowroom, bool buildstaircase); |
| 615 |
void buildMaze(int stride); |
| 616 |
|
| 617 |
|
| 618 |
void smooth(SQUARE_NAMES floor, SQUARE_NAMES wall); |
| 619 |
|
| 620 |
|
| 621 |
|
| 622 |
void fillWithTile(int x, int y, SQUARE_NAMES newtile, SQUARE_NAMES oldtile); |
| 623 |
|
| 624 |
void drawQixWall(int x, int y, int dx, int dy, bool islit); |
| 625 |
void buildQix(bool islit); |
| 626 |
|
| 627 |
void buildRiverRoom(); |
| 628 |
void buildSurfaceWorld(); |
| 629 |
void buildTutorial(); |
| 630 |
|
| 631 |
void buildSpaceShip(); |
| 632 |
|
| 633 |
void buildHello(); |
| 634 |
|
| 635 |
void drawCircle(int cx, int cy, int rad, |
| 636 |
SQUARE_NAMES tile, |
| 637 |
SQUAREFLAG_NAMES flag, |
| 638 |
bool overwrite = false); |
| 639 |
|
| 640 |
void drawLine(int x1, int y1, int x2, int y2, |
| 641 |
SQUARE_NAMES tile, |
| 642 |
bool overwrite = false); |
| 643 |
|
| 644 |
|
| 645 |
bool buildMoveDistance(int px, int py, MOVE_NAMES move); |
| 646 |
|
| 647 |
bool buildDistance(int px, int py); |
| 648 |
|
| 649 |
|
| 650 |
bool drawPath(int sx, int sy, int ex, int ey, |
| 651 |
bool lit = false); |
| 652 |
bool drawPathStraight(int sx, int sy, int ex, int ey, |
| 653 |
bool lit = false); |
| 654 |
void drawPath_old(int sx, int sy, int ex, int ey, |
| 655 |
bool lit = false); |
| 656 |
bool drawCorridor(int sx, int sy, int sdx, int sdy, |
| 657 |
int ex, int ey, int edx, int edy, |
| 658 |
bool lit = false); |
| 659 |
void createColouredTridudeLair(int x, int y, MOB_NAMES tridude, MOB *trueleader); |
| 660 |
MOB *createGoldenTridudeLair(int x, int y); |
| 661 |
static const ROOM_DEF *chooseRandomRoom(int depth); |
| 662 |
void buildRandomRoom(ROOM &room); |
| 663 |
public: |
| 664 |
void buildRandomRoomFromDefinition(ROOM &room, |
| 665 |
const ROOM_DEF *def); |
| 666 |
void populateRoom(const ROOM &room); |
| 667 |
void drawRoom(const ROOM &room, |
| 668 |
bool lit, |
| 669 |
bool mazetype, |
| 670 |
bool caverntype); |
| 671 |
protected: |
| 672 |
void chooseRandomExit(int *enter, int *delta, |
| 673 |
const ROOM &room); |
| 674 |
void closeUnusedExits(const ROOM &room, bool force); |
| 675 |
void roomToMapCoords(int &mx, int &my, |
| 676 |
const ROOM &room, int rx, int ry); |
| 677 |
void mapToRoomCoords(int &rx, int &ry, |
| 678 |
const ROOM &room, int mx, int my); |
| 679 |
|
| 680 |
|
| 681 |
|
| 682 |
bool isTileWall(int tile) const; |
| 683 |
bool isMapWall(int x, int y) const; |
| 684 |
bool isMapExit(int x, int y) const; |
| 685 |
bool isRoomExit(const ROOM &room, int x, int y) const; |
| 686 |
bool isMapPathway(int x, int y) const; |
| 687 |
bool checkRoomFits(const ROOM &room); |
| 688 |
|
| 689 |
|
| 690 |
void setPathTile(int x, int y, bool lit, bool usefloor); |
| 691 |
|
| 692 |
void addSignPost(SIGNPOST_NAMES post, int x, int y); |
| 693 |
|
| 694 |
public: |
| 695 |
#ifdef MAPSTATS |
| 696 |
static void printStatsHeader(FILE *fp); |
| 697 |
bool printStats(FILE *fp); |
| 698 |
#endif |
| 699 |
|
| 700 |
private: |
| 701 |
|
| 702 |
long mySeed; |
| 703 |
int myGlobalFlags; |
| 704 |
|
| 705 |
|
| 706 |
u8 *mySquares; |
| 707 |
|
| 708 |
u8 *myFlags; |
| 709 |
|
| 710 |
s8 myFOVX, myFOVY; |
| 711 |
|
| 712 |
u8 myBranch; |
| 713 |
|
| 714 |
s8 myDepth; |
| 715 |
|
| 716 |
|
| 717 |
|
| 718 |
static u16 *ourItemMap; |
| 719 |
static u16 *ourMobMap; |
| 720 |
|
| 721 |
static u8 *ourWallMap; |
| 722 |
|
| 723 |
|
| 724 |
static u16 *ourDistanceMap; |
| 725 |
static u16 *ourAvatarSmell; |
| 726 |
static u16 ourAvatarSmellWatermark; |
| 727 |
|
| 728 |
|
| 729 |
static int *ourCells; |
| 730 |
static int *ourCutOuts; |
| 731 |
|
| 732 |
|
| 733 |
|
| 734 |
static MOBREF *ourMobRefMap; |
| 735 |
static ITEM **ourItemPtrMap; |
| 736 |
|
| 737 |
|
| 738 |
|
| 739 |
static MOBREF *ourMobGuiltyMap; |
| 740 |
|
| 741 |
|
| 742 |
int myMobCount; |
| 743 |
int myItemCount; |
| 744 |
MOB *myMobHead; |
| 745 |
|
| 746 |
MOB *myMobSafeNext; |
| 747 |
|
| 748 |
ITEM *myItemHead; |
| 749 |
|
| 750 |
|
| 751 |
|
| 752 |
MAP *myMapUp; |
| 753 |
MAP *myMapDown; |
| 754 |
|
| 755 |
|
| 756 |
MAP *myMapBranch; |
| 757 |
|
| 758 |
|
| 759 |
|
| 760 |
|
| 761 |
SMOKESTACK mySmokeStack; |
| 762 |
|
| 763 |
SIGNLIST *mySignList; |
| 764 |
|
| 765 |
|
| 766 |
static bool ourIsLoading; |
| 767 |
|
| 768 |
|
| 769 |
|
| 770 |
|
| 771 |
static s8 ourWindDX, ourWindDY; |
| 772 |
static int ourWindCounter; |
| 773 |
static bool ourMapDirty; |
| 774 |
static MAP *ourDelayedLevelChange; |
| 775 |
}; |
| 776 |
|
| 777 |
#endif |