2021-09-05 05:52:50 +02:00
|
|
|
#include "framework.h"
|
2021-12-24 03:32:19 +03:00
|
|
|
#include "Objects/Generic/Doors/generic_doors.h"
|
2021-12-22 16:23:57 +03:00
|
|
|
#include "Specific/level.h"
|
|
|
|
#include "Game/control/control.h"
|
|
|
|
#include "Game/control/box.h"
|
|
|
|
#include "Game/items.h"
|
|
|
|
#include "Game/control/lot.h"
|
|
|
|
#include "Game/gui.h"
|
|
|
|
#include "Specific/input.h"
|
|
|
|
#include "Game/pickup/pickup.h"
|
|
|
|
#include "Sound/sound.h"
|
|
|
|
#include "Game/animation.h"
|
|
|
|
#include "Game/collision/sphere.h"
|
|
|
|
#include "Game/Lara/lara_struct.h"
|
|
|
|
#include "Game/Lara/lara.h"
|
|
|
|
#include "Specific/trmath.h"
|
|
|
|
#include "Game/misc.h"
|
2021-12-24 11:08:16 +03:00
|
|
|
#include "Objects/Generic/Doors/sequence_door.h"
|
2021-12-24 03:32:19 +03:00
|
|
|
#include "Objects/Generic/Switches/fullblock_switch.h"
|
2021-12-22 16:23:57 +03:00
|
|
|
#include "Game/itemdata/door_data.h"
|
2021-09-05 05:52:50 +02:00
|
|
|
|
|
|
|
using namespace TEN::Entities::Switches;
|
|
|
|
|
|
|
|
namespace TEN::Entities::Doors
|
|
|
|
{
|
|
|
|
void SequenceDoorControl(short itemNumber)
|
|
|
|
{
|
|
|
|
ITEM_INFO* item = &g_Level.Items[itemNumber];
|
2022-02-09 16:55:46 +11:00
|
|
|
DOOR_DATA* door = (DOOR_DATA*)item->Data;
|
2021-09-05 05:52:50 +02:00
|
|
|
|
|
|
|
if (CurrentSequence == 3)
|
|
|
|
{
|
2022-02-09 16:55:46 +11:00
|
|
|
if (SequenceResults[Sequences[0]][Sequences[1]][Sequences[2]] == item->TriggerFlags)
|
2021-09-05 05:52:50 +02:00
|
|
|
{
|
2022-02-09 16:55:46 +11:00
|
|
|
if (item->ActiveState == 1)
|
|
|
|
item->TargetState = 1;
|
2021-09-05 05:52:50 +02:00
|
|
|
else
|
2022-02-09 16:55:46 +11:00
|
|
|
item->TargetState = 0;
|
2021-09-05 05:52:50 +02:00
|
|
|
|
2021-09-15 16:58:53 +03:00
|
|
|
TestTriggers(item, true);
|
2021-09-05 05:52:50 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
CurrentSequence = 4;
|
|
|
|
}
|
|
|
|
|
2022-02-09 16:55:46 +11:00
|
|
|
if (item->ActiveState == item->TargetState)
|
2021-09-05 05:52:50 +02:00
|
|
|
{
|
2022-02-09 16:55:46 +11:00
|
|
|
if (item->ActiveState == 1)
|
2021-09-05 05:52:50 +02:00
|
|
|
{
|
|
|
|
if (!door->opened)
|
|
|
|
{
|
|
|
|
OpenThatDoor(&door->d1, door);
|
|
|
|
OpenThatDoor(&door->d2, door);
|
|
|
|
OpenThatDoor(&door->d1flip, door);
|
|
|
|
OpenThatDoor(&door->d2flip, door);
|
|
|
|
door->opened = true;
|
2022-02-09 16:55:46 +11:00
|
|
|
item->Flags |= 0x3E;
|
2021-09-05 05:52:50 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
if (door->opened)
|
|
|
|
{
|
|
|
|
ShutThatDoor(&door->d1, door);
|
|
|
|
ShutThatDoor(&door->d2, door);
|
|
|
|
ShutThatDoor(&door->d1flip, door);
|
|
|
|
ShutThatDoor(&door->d2flip, door);
|
|
|
|
door->opened = false;
|
2022-02-09 16:55:46 +11:00
|
|
|
item->Flags &= 0xC1;
|
2021-09-05 05:52:50 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
AnimateItem(item);
|
|
|
|
}
|
|
|
|
}
|