2021-08-30 17:50:32 +03:00
|
|
|
#pragma once
|
|
|
|
|
2021-08-31 17:37:15 +02:00
|
|
|
struct ITEM_INFO;
|
2021-11-04 05:33:15 +03:00
|
|
|
class FLOOR_INFO;
|
2021-08-30 17:50:32 +03:00
|
|
|
|
2021-09-15 10:12:42 +03:00
|
|
|
#define TRIG_BITS(T) ((T & 0x3FFF) >> 10)
|
|
|
|
|
|
|
|
constexpr auto ONESHOT = 0x0100;
|
|
|
|
constexpr auto SWONESHOT = 0x0040;
|
|
|
|
constexpr auto ATONESHOT = 0x0080;
|
|
|
|
constexpr auto VALUE_BITS = 0x03FF;
|
|
|
|
constexpr auto CODE_BITS = 0x3E00;
|
|
|
|
constexpr auto END_BIT = 0x8000;
|
2021-10-14 17:26:10 +02:00
|
|
|
constexpr auto TRIGGERED = 0x20;
|
2021-09-15 10:12:42 +03:00
|
|
|
enum FLOORDATA_MASKS
|
|
|
|
{
|
|
|
|
FD_MASK_FUNCTION = 0x001F,
|
|
|
|
FD_MASK_SUBFUNCTION = 0x7F00,
|
|
|
|
FD_MASK_END_DATA = 0x8000
|
|
|
|
};
|
|
|
|
|
2021-09-11 22:41:25 +03:00
|
|
|
enum TRIGGER_TYPES
|
|
|
|
{
|
|
|
|
TRIGGER,
|
|
|
|
PAD,
|
|
|
|
SWITCH,
|
|
|
|
KEY,
|
|
|
|
PICKUP,
|
|
|
|
HEAVY,
|
|
|
|
ANTIPAD,
|
|
|
|
COMBAT,
|
|
|
|
DUMMY,
|
|
|
|
ANTITRIGGER,
|
|
|
|
HEAVYSWITCH,
|
|
|
|
HEAVYANTITRIGGER,
|
|
|
|
MONKEY,
|
|
|
|
TIGHTROPE_T,
|
|
|
|
CRAWLDUCK_T,
|
2021-09-13 01:18:06 +03:00
|
|
|
CLIMB_T
|
2021-09-11 22:41:25 +03:00
|
|
|
};
|
|
|
|
|
|
|
|
enum TRIGOBJECTS_TYPES
|
|
|
|
{
|
|
|
|
TO_OBJECT,
|
|
|
|
TO_CAMERA,
|
|
|
|
TO_SINK,
|
|
|
|
TO_FLIPMAP,
|
|
|
|
TO_FLIPON,
|
|
|
|
TO_FLIPOFF,
|
|
|
|
TO_TARGET,
|
|
|
|
TO_FINISH,
|
|
|
|
TO_CD,
|
|
|
|
TO_FLIPEFFECT,
|
|
|
|
TO_SECRET,
|
|
|
|
TO_BODYBAG,
|
|
|
|
TO_FLYBY,
|
|
|
|
TO_CUTSCENE
|
|
|
|
};
|
|
|
|
|
2021-09-15 21:09:09 +03:00
|
|
|
extern int TriggerTimer;
|
2021-09-15 17:40:00 +03:00
|
|
|
extern int KeyTriggerActive;
|
|
|
|
|
2021-09-15 10:12:42 +03:00
|
|
|
bool GetKeyTrigger(ITEM_INFO* item);
|
|
|
|
int GetSwitchTrigger(ITEM_INFO* item, short* itemNos, int attatchedToSwitch);
|
2021-08-30 17:50:32 +03:00
|
|
|
int SwitchTrigger(short itemNum, short timer);
|
2021-09-15 17:20:42 +03:00
|
|
|
int KeyTrigger(short itemNum);
|
|
|
|
int PickupTrigger(short itemNum);
|
2021-10-04 03:14:05 +03:00
|
|
|
void RefreshCamera(short type, short* data);
|
2021-08-30 17:52:38 +03:00
|
|
|
int TriggerActive(ITEM_INFO* item);
|
2021-08-30 17:50:32 +03:00
|
|
|
short* GetTriggerIndex(FLOOR_INFO* floor, int x, int y, int z);
|
|
|
|
short* GetTriggerIndex(ITEM_INFO* item);
|
2021-10-01 18:31:06 +03:00
|
|
|
void TestTriggers(FLOOR_INFO* floor, int x, int y, int z, bool heavy, int heavyFlags = 0);
|
2021-09-15 16:58:53 +03:00
|
|
|
void TestTriggers(int x, int y, int z, short roomNumber, bool heavy, int heavyFlags = 0);
|
|
|
|
void TestTriggers(ITEM_INFO* item, bool heavy, int heavyFlags = 0);
|
2021-08-30 17:50:32 +03:00
|
|
|
void ProcessSectorFlags(FLOOR_INFO* floor);
|
|
|
|
void ProcessSectorFlags(int x, int y, int z, short roomNumber);
|
|
|
|
void ProcessSectorFlags(ITEM_INFO* item);
|