2021-09-05 05:52:50 +02:00
|
|
|
#include "framework.h"
|
|
|
|
#include "generic_doors.h"
|
|
|
|
#include "level.h"
|
|
|
|
#include "control.h"
|
|
|
|
#include "box.h"
|
|
|
|
#include "items.h"
|
|
|
|
#include "lot.h"
|
|
|
|
#include "newinv2.h"
|
|
|
|
#include "input.h"
|
2021-09-11 09:41:29 +03:00
|
|
|
#include "pickup\pickup.h"
|
2021-09-05 05:52:50 +02:00
|
|
|
#include "sound.h"
|
|
|
|
#include "draw.h"
|
|
|
|
#include "sphere.h"
|
|
|
|
#include "lara_struct.h"
|
|
|
|
#include "lara.h"
|
|
|
|
#include "trmath.h"
|
|
|
|
#include "misc.h"
|
|
|
|
#include "double_doors.h"
|
2021-09-11 05:38:26 +02:00
|
|
|
#include "collide.h"
|
2021-09-05 05:52:50 +02:00
|
|
|
|
|
|
|
namespace TEN::Entities::Doors
|
|
|
|
{
|
|
|
|
PHD_VECTOR DoubleDoorPos(0, 0, 220);
|
|
|
|
|
|
|
|
OBJECT_COLLISION_BOUNDS DoubleDoorBounds =
|
|
|
|
{
|
|
|
|
-384, 384,
|
|
|
|
0, 0,
|
|
|
|
-1024, 512,
|
|
|
|
-ANGLE(10), ANGLE(10),
|
|
|
|
-ANGLE(30), ANGLE(30),
|
|
|
|
-ANGLE(10), ANGLE(10),
|
|
|
|
};
|
|
|
|
|
|
|
|
void DoubleDoorCollision(short itemNum, ITEM_INFO* l, COLL_INFO* coll)
|
|
|
|
{
|
|
|
|
ITEM_INFO* item = &g_Level.Items[itemNum];
|
|
|
|
|
|
|
|
if (TrInput & IN_ACTION
|
|
|
|
&& l->currentAnimState == LS_STOP
|
|
|
|
&& l->animNumber == LA_STAND_IDLE
|
|
|
|
&& !(item->status && item->gravityStatus)
|
|
|
|
&& !(l->hitStatus)
|
|
|
|
&& !Lara.gunStatus
|
2021-09-11 05:38:26 +02:00
|
|
|
|| Lara.isMoving && Lara.interactedItem == itemNum)
|
2021-09-05 05:52:50 +02:00
|
|
|
{
|
|
|
|
item->pos.yRot ^= ANGLE(180);
|
|
|
|
if (TestLaraPosition(&DoubleDoorBounds, item, l))
|
|
|
|
{
|
|
|
|
if (MoveLaraPosition(&DoubleDoorPos, item, l))
|
|
|
|
{
|
|
|
|
l->animNumber = LA_DOUBLEDOOR_OPEN_PUSH;
|
|
|
|
l->frameNumber = GF(LA_DOUBLEDOOR_OPEN_PUSH, 0);
|
|
|
|
l->currentAnimState = LS_DOUBLEDOOR_PUSH;
|
|
|
|
|
|
|
|
AddActiveItem(itemNum);
|
|
|
|
|
|
|
|
item->status = ITEM_ACTIVE;
|
|
|
|
Lara.isMoving = false;
|
|
|
|
Lara.gunStatus = LG_HANDS_BUSY;
|
|
|
|
Lara.headYrot = 0;
|
|
|
|
Lara.headXrot = 0;
|
|
|
|
Lara.torsoYrot = 0;
|
|
|
|
Lara.torsoXrot = 0;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2021-09-11 05:38:26 +02:00
|
|
|
Lara.interactedItem = itemNum;
|
2021-09-05 05:52:50 +02:00
|
|
|
}
|
|
|
|
item->pos.yRot ^= ANGLE(180);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2021-09-11 05:38:26 +02:00
|
|
|
if (Lara.isMoving && Lara.interactedItem == itemNum)
|
2021-09-05 05:52:50 +02:00
|
|
|
{
|
|
|
|
Lara.isMoving = false;
|
|
|
|
Lara.gunStatus = LG_NO_ARMS;
|
|
|
|
}
|
|
|
|
item->pos.yRot ^= ANGLE(180);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|