| 518 | } |
| 519 | |
| 520 | void AddChestTraps() |
| 521 | { |
| 522 | int i, j; |
| 523 | char oi; |
| 524 | |
| 525 | for (j = 0; j < MAXDUNY; j++) { |
| 526 | for (i = 0; i < MAXDUNX; i++) { |
| 527 | if (dObject[i][j] > 0) { |
| 528 | oi = dObject[i][j] - 1; |
| 529 | if (object[oi]._otype >= OBJ_CHEST1 && object[oi]._otype <= OBJ_CHEST3 && !object[oi]._oTrapFlag && random_(0, 100) < 10) { |
| 530 | object[oi]._otype += OBJ_BOOKCASER; |
| 531 | object[oi]._oTrapFlag = TRUE; |
| 532 | if (leveltype == DTYPE_CATACOMBS) { |
| 533 | object[oi]._oVar4 = random_(0, 2); |
| 534 | } else { |
| 535 | object[oi]._oVar4 = random_(0, 3); |
| 536 | } |
| 537 | } |
| 538 | } |
| 539 | } |
| 540 | } |
| 541 | } |
| 542 | |
| 543 | void LoadMapObjects(BYTE *pMap, int startx, int starty, int x1, int y1, int w, int h, int leveridx) |
| 544 | { |
no test coverage detected