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

Function OperateL1LDoor

Source/objects.cpp:2043–2097  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2041}
2042
2043void OperateL1LDoor(int pnum, int oi, BOOL sendflag)
2044{
2045 int xp, yp;
2046
2047 if (object[oi]._oVar4 == 2) {
2048 if (!deltaload)
2049 PlaySfxLoc(IS_DOORCLOS, object[oi]._ox, object[oi]._oy);
2050 return;
2051 }
2052
2053 xp = object[oi]._ox;
2054 yp = object[oi]._oy;
2055 if (object[oi]._oVar4 == 0) {
2056 if (pnum == myplr && sendflag)
2057 NetSendCmdParam1(TRUE, CMD_OPENDOOR, oi);
2058 if (!deltaload)
2059 PlaySfxLoc(IS_DOOROPEN, object[oi]._ox, object[oi]._oy);
2060 if (object[oi]._oVar1 == 214)
2061 ObjSetMicro(xp, yp, 408);
2062 else
2063 ObjSetMicro(xp, yp, 393);
2064 dArch[xp][yp] = 7;
2065 objects_set_door_piece(xp - 1, yp);
2066 object[oi]._oAnimFrame += 2;
2067 object[oi]._oPreFlag = TRUE;
2068 DoorSet(oi, xp, yp - 1);
2069 object[oi]._oVar4 = 1;
2070 object[oi]._oSelFlag = 2;
2071 RedoPlayerVision();
2072 return;
2073 }
2074
2075 if (!deltaload)
2076 PlaySfxLoc(IS_DOORCLOS, xp, object[oi]._oy);
2077 if (((dDead[xp][yp] != 0 ? 0 : 1) & (dMonster[xp][yp] != 0 ? 0 : 1) & (dItem[xp][yp] != 0 ? 0 : 1)) != 0) {
2078 if (pnum == myplr && sendflag)
2079 NetSendCmdParam1(TRUE, CMD_CLOSEDOOR, oi);
2080 object[oi]._oVar4 = 0;
2081 object[oi]._oSelFlag = 3;
2082 ObjSetMicro(xp, yp, object[oi]._oVar1);
2083 if (object[oi]._oVar2 != 50) {
2084 ObjSetMicro(xp, yp - 1, object[oi]._oVar2);
2085 } else {
2086 if (dPiece[xp][yp - 1] == 396)
2087 ObjSetMicro(xp, yp - 1, 412);
2088 else
2089 ObjSetMicro(xp, yp - 1, 50);
2090 }
2091 object[oi]._oAnimFrame -= 2;
2092 object[oi]._oPreFlag = FALSE;
2093 RedoPlayerVision();
2094 } else {
2095 object[oi]._oVar4 = 2;
2096 }
2097}
2098
2099void OperateL2RDoor(int pnum, int oi, BOOL sendflag)
2100{

Callers 4

MonstCheckDoorsFunction · 0.85
OperateL1DoorFunction · 0.85
OperateObjectFunction · 0.85
SyncOpL1DoorFunction · 0.85

Calls 6

PlaySfxLocFunction · 0.85
NetSendCmdParam1Function · 0.85
ObjSetMicroFunction · 0.85
objects_set_door_pieceFunction · 0.85
DoorSetFunction · 0.85
RedoPlayerVisionFunction · 0.85

Tested by

no test coverage detected