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

Function OperateBookLever

Source/objects.cpp:2461–2503  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2459}
2460
2461void OperateBookLever(int pnum, int i)
2462{
2463 int x, y, tren;
2464
2465 x = 2 * setpc_x + 16;
2466 y = 2 * setpc_y + 16;
2467 if (object[i]._oSelFlag != 0 && !qtextflag) {
2468 if (object[i]._otype == OBJ_BLINDBOOK && !quests[QTYPE_BLIND]._qvar1) {
2469 quests[QTYPE_BLIND]._qactive = 2;
2470 quests[QTYPE_BLIND]._qlog = 1;
2471 quests[QTYPE_BLIND]._qvar1 = 1;
2472 }
2473 if (object[i]._otype == OBJ_BLOODBOOK && !quests[QTYPE_BLOOD]._qvar1) {
2474 quests[QTYPE_BLOOD]._qactive = 2;
2475 quests[QTYPE_BLOOD]._qlog = 1;
2476 quests[QTYPE_BLOOD]._qvar1 = 1;
2477 SpawnQuestItem(IDI_BLDSTONE, 2 * setpc_x + 19, 2 * setpc_y + 26, 0, 1);
2478 SpawnQuestItem(IDI_BLDSTONE, 2 * setpc_x + 31, 2 * setpc_y + 26, 0, 1);
2479 SpawnQuestItem(IDI_BLDSTONE, 2 * setpc_x + 25, 2 * setpc_y + 33, 0, 1);
2480 }
2481 object[i]._otype = object[i]._otype;
2482 if (object[i]._otype == OBJ_STEELTOME && !quests[QTYPE_WARLRD]._qvar1) {
2483 quests[QTYPE_WARLRD]._qactive = 2;
2484 quests[QTYPE_WARLRD]._qlog = 1;
2485 quests[QTYPE_WARLRD]._qvar1 = 1;
2486 }
2487 if (object[i]._oAnimFrame != object[i]._oVar6) {
2488 if (object[i]._otype != OBJ_BLOODBOOK)
2489 ObjChangeMap(object[i]._oVar1, object[i]._oVar2, object[i]._oVar3, object[i]._oVar4);
2490 if (object[i]._otype == OBJ_BLINDBOOK) {
2491 CreateItem(3, x + 5, y + 5);
2492 tren = TransVal;
2493 TransVal = 9;
2494 DRLG_MRectTrans(object[i]._oVar1, object[i]._oVar2, object[i]._oVar3, object[i]._oVar4);
2495 TransVal = tren;
2496 }
2497 }
2498 object[i]._oAnimFrame = object[i]._oVar6;
2499 InitQTextMsg(object[i]._oVar7);
2500 if (pnum == myplr)
2501 NetSendCmdParam1(FALSE, CMD_OPERATEOBJ, i);
2502 }
2503}
2504
2505void OperateSChambBk(int pnum, int i)
2506{

Callers 2

OperateObjectFunction · 0.85
SyncOpObjectFunction · 0.85

Calls 6

SpawnQuestItemFunction · 0.85
ObjChangeMapFunction · 0.85
CreateItemFunction · 0.85
DRLG_MRectTransFunction · 0.85
InitQTextMsgFunction · 0.85
NetSendCmdParam1Function · 0.85

Tested by

no test coverage detected