[hellfire] OperateL1LDoor bin exact

This commit is contained in:
qndel 2020-01-13 19:26:06 +01:00 committed by Anders Jenbo
commit c685a03a0e
2 changed files with 54 additions and 2 deletions

View file

@ -2359,7 +2359,7 @@ void OperateL1RDoor(int pnum, int oi, DIABOOL sendflag)
}
}
void OperateL1LDoor(int pnum, int oi, BOOL sendflag)
void OperateL1LDoor(int pnum, int oi, DIABOOL sendflag)
{
int xp, yp;
@ -2374,6 +2374,28 @@ void OperateL1LDoor(int pnum, int oi, BOOL sendflag)
if (object[oi]._oVar4 == 0) {
if (pnum == myplr && sendflag)
NetSendCmdParam1(TRUE, CMD_OPENDOOR, oi);
#ifdef HELLFIRE
if (currlevel < 21) {
if (!deltaload)
PlaySfxLoc(IS_DOOROPEN, object[oi]._ox, object[oi]._oy);
} else {
if (!deltaload)
PlaySfxLoc(IS_CROPEN, object[oi]._ox, object[oi]._oy);
}
if (currlevel < 21) {
if (object[oi]._oVar1 == 214)
ObjSetMicro(xp, yp, 408);
else
ObjSetMicro(xp, yp, 393);
} else {
ObjSetMicro(xp, yp, 206);
}
if (currlevel < 17) {
dArch[xp][yp] = 7;
} else {
dArch[xp][yp] = 1;
}
#else
if (!deltaload)
PlaySfxLoc(IS_DOOROPEN, object[oi]._ox, object[oi]._oy);
if (object[oi]._oVar1 == 214)
@ -2381,6 +2403,7 @@ void OperateL1LDoor(int pnum, int oi, BOOL sendflag)
else
ObjSetMicro(xp, yp, 393);
dArch[xp][yp] = 7;
#endif
objects_set_door_piece(xp - 1, yp);
object[oi]._oAnimFrame += 2;
object[oi]._oPreFlag = TRUE;
@ -2391,14 +2414,31 @@ void OperateL1LDoor(int pnum, int oi, BOOL sendflag)
return;
}
#ifdef HELLFIRE
if (currlevel < 21) {
if (!deltaload)
PlaySfxLoc(IS_DOORCLOS, xp, object[oi]._oy);
} else {
if (!deltaload)
PlaySfxLoc(IS_CRCLOS, xp, object[oi]._oy);
}
BOOLEAN dok = !dMonster[xp][yp];
dok = dok && !dItem[xp][yp];
dok = dok && !dDead[xp][yp];
if (dok) {
#else
if (!deltaload)
PlaySfxLoc(IS_DOORCLOS, xp, object[oi]._oy);
if (((dDead[xp][yp] != 0 ? 0 : 1) & (dMonster[xp][yp] != 0 ? 0 : 1) & (dItem[xp][yp] != 0 ? 0 : 1)) != 0) {
#endif
if (pnum == myplr && sendflag)
NetSendCmdParam1(TRUE, CMD_CLOSEDOOR, oi);
object[oi]._oVar4 = 0;
object[oi]._oSelFlag = 3;
ObjSetMicro(xp, yp, object[oi]._oVar1);
#ifdef HELLFIRE
if (currlevel < 17) {
#endif
if (object[oi]._oVar2 != 50) {
ObjSetMicro(xp, yp - 1, object[oi]._oVar2);
} else {
@ -2407,6 +2447,18 @@ void OperateL1LDoor(int pnum, int oi, BOOL sendflag)
else
ObjSetMicro(xp, yp - 1, 50);
}
#ifdef HELLFIRE
} else {
if (object[oi]._oVar2 != 86) {
ObjSetMicro(xp, yp - 1, object[oi]._oVar2);
} else {
if (dPiece[xp][yp - 1] == 210)
ObjSetMicro(xp, yp - 1, 234);
else
ObjSetMicro(xp, yp - 1, 86);
}
}
#endif
object[oi]._oAnimFrame -= 2;
object[oi]._oPreFlag = FALSE;
RedoPlayerVision();