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

Function ForceL2Trig

Source/trigs.cpp:418–472  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

416}
417
418BOOL ForceL2Trig()
419{
420 int i, j, dx, dy;
421
422 for (i = 0; L2UpList[i] != -1; i++) {
423 if (dPiece[cursmx][cursmy] == L2UpList[i]) {
424 for (j = 0; j < numtrigs; j++) {
425 if (trigs[j]._tmsg == WM_DIABPREVLVL) {
426 dx = abs(trigs[j]._tx - cursmx);
427 dy = abs(trigs[j]._ty - cursmy);
428 if (dx < 4 && dy < 4) {
429 sprintf(infostr, "Up to level %i", currlevel - 1);
430 cursmx = trigs[j]._tx;
431 cursmy = trigs[j]._ty;
432 return TRUE;
433 }
434 }
435 }
436 }
437 }
438
439 for (i = 0; L2DownList[i] != -1; i++) {
440 if (dPiece[cursmx][cursmy] == L2DownList[i]) {
441 sprintf(infostr, "Down to level %i", currlevel + 1);
442 for (j = 0; j < numtrigs; j++) {
443 if (trigs[j]._tmsg == WM_DIABNEXTLVL) {
444 cursmx = trigs[j]._tx;
445 cursmy = trigs[j]._ty;
446 return TRUE;
447 }
448 }
449 }
450 }
451
452 if (currlevel == 5) {
453 for (i = 0; L2TWarpUpList[i] != -1; i++) {
454 if (dPiece[cursmx][cursmy] == L2TWarpUpList[i]) {
455 for (j = 0; j < numtrigs; j++) {
456 if (trigs[j]._tmsg == WM_DIABTWARPUP) {
457 dx = abs(trigs[j]._tx - cursmx);
458 dy = abs(trigs[j]._ty - cursmy);
459 if (dx < 4 && dy < 4) {
460 strcpy(infostr, "Up to town");
461 cursmx = trigs[j]._tx;
462 cursmy = trigs[j]._ty;
463 return TRUE;
464 }
465 }
466 }
467 }
468 }
469 }
470
471 return FALSE;
472}
473
474BOOL ForceL3Trig()
475{

Callers 1

CheckTrigForceFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected