MCPcopy Create free account
hub / github.com/diasurgical/devilution / ForceL4Trig

Function ForceL4Trig

Source/trigs.cpp:528–593  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

526}
527
528BOOL ForceL4Trig()
529{
530 int i, j, dx, dy;
531
532 for (i = 0; L4UpList[i] != -1; ++i) {
533 if (dPiece[cursmx][cursmy] == L4UpList[i]) {
534 sprintf(infostr, "Up to level %i", currlevel - 1);
535 for (j = 0; j < numtrigs; j++) {
536 if (trigs[j]._tmsg == WM_DIABPREVLVL) {
537 cursmx = trigs[j]._tx;
538 cursmy = trigs[j]._ty;
539 return TRUE;
540 }
541 }
542 }
543 }
544
545 for (i = 0; L4DownList[i] != -1; i++) {
546 if (dPiece[cursmx][cursmy] == L4DownList[i]) {
547 sprintf(infostr, "Down to level %i", currlevel + 1);
548 for (j = 0; j < numtrigs; j++) {
549 if (trigs[j]._tmsg == WM_DIABNEXTLVL) {
550 cursmx = trigs[j]._tx;
551 cursmy = trigs[j]._ty;
552 return TRUE;
553 }
554 }
555 }
556 }
557
558 if (currlevel == 13) {
559 for (i = 0; L4TWarpUpList[i] != -1; i++) {
560 if (dPiece[cursmx][cursmy] == L4TWarpUpList[i]) {
561 for (j = 0; j < numtrigs; j++) {
562 if (trigs[j]._tmsg == WM_DIABTWARPUP) {
563 dx = abs(trigs[j]._tx - cursmx);
564 dy = abs(trigs[j]._ty - cursmy);
565 if (dx < 4 && dy < 4) {
566 strcpy(infostr, "Up to town");
567 cursmx = trigs[j]._tx;
568 cursmy = trigs[j]._ty;
569 return TRUE;
570 }
571 }
572 }
573 }
574 }
575 }
576
577 if (currlevel == 15) {
578 for (i = 0; L4PentaList[i] != -1; i++) {
579 if (dPiece[cursmx][cursmy] == L4PentaList[i]) {
580 strcpy(infostr, "Down to Diablo");
581 for (j = 0; j < numtrigs; j++) {
582 if (trigs[j]._tmsg == WM_DIABNEXTLVL) {
583 cursmx = trigs[j]._tx;
584 cursmy = trigs[j]._ty;
585 return TRUE;

Callers 1

CheckTrigForceFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected