#ifndef CONSTANTMINE_H_INCLUDED
#define CONSTANTMINE_H_INCLUDED

/// ngle define:

#define MAX_MYPROGR_ACTIONS 100
#define MAX_ASSIGN_SLOT_MINE 200

#define ENDLESS_DURATE 0xFFFF // to use as number of frames to set an infinite durate
#define NGTAG_END_SEQUENCE           0   // signals the end of ng token sequence
#define NGTAG_PROGRESSIVE_ACTIONS  1
#define NGTAG_LOCAL_DATA           2
#define NGTAG_GLOBAL_DATA          3
#define AXN_FREE  0  // this record is to free an action record. You type this value in ActionType to free a action progress record

/// custom define:
/* https://github.com/Arsunt/TR2Main/blob/b762737f1f317c0c2dd9398560d782398189c666/global/vars.h#L38 */
#define VAR(address, type)                     (*(type*)(address))            // uninitialized variable
#define VAA(address, type, length)             (*(type(*)length)(address))    // array (can be multidimensional)

#define MESSAGEBOX_FLAGS (MB_OK|MB_SETFOREGROUND|MB_ICONERROR|MB_SYSTEMMODAL)

#define STRING_PLUGIN_OBJECT_HELPER "Plugin_ObjectHelper"

#define DOUBLE_OFFSET_MUZZLEFLASH 0x8000
#define OFFSET_MUZZLEFLASH 0x7FFF

#define TIMER_EXTENDED 0

#define FUNCTION_ZONE_BEFORE 0x1
#define FUNCTION_ZONE_AFTER 0x2
#define FUNCTION_ZONE 0x3
#define FUNCTION_SHADOW_BEFORE 0x4
#define FUNCTION_SHADOW_AFTER 0x8
#define FUNCTION_SHADOW 0xC

#define GLOBAL_TARGET 0
#define GLOBAL_LOCK 1

#define QUERY_SPRITE 0x1
#define QUERY_GUNFLASH 0x2
#define QUERY_ZOMBIE 0x4
#define QUERY_KILLER 0x8
#define QUERY_DEATH 0x10
#define QUERY_HEADSHOT 0x20
#define QUERY_PATROL 0x40
#define QUERY_PATROL2 0x80
#define QUERY_VAULT 0x100
#define QUERY_TOUCH 0x200

#define HELPER_FLIPEFFECT_PLUGIN 1
#define HELPER_FLIPEFFECT_FUNCTION_QUERY 2
#define HELPER_FLIPEFFECT_GLOBAL 3
#define HELPER_FLIPEFFECT_POINTER 4

#define HELPER_CONDITION_ACTIVE 1

#define FLIPEFFECT_FUNCTION 1
#define FLIPEFFECT_GLOBAL 2
#define FLIPEFFECT_QUERY 3

#define SLOTS_NUMBER 8

#define CUST_TSU_LINKS 1
#define LINKS_NAME 0
#define LINKS_VALUE 1
#define LINKS_ARGS 3

#define CUST_TSU_OBJECTS 2         // Customize = CUST_TSU_OBJECTS, TRx_ flag, SlotID, HP, DMG1, DMG2, DMG3, DMG4, DMG5, DMG6
#define OBJECTS_NAME 0
#define OBJECTS_ID 1
#define OBJECTS_VALUE 2
#define OBJECTS_ARGS 9

#define CUST_TSU_SNOWMOBILE_SFX 3  // Customize = CUST_TSU_SNOWMOBILE_SFX, IdleID, MovingID, MovingMaxID, EnterID, StopID, HitFront, HitBack, CDAudioTrack, CDAlwaysPlay (Enabled/Disabled), CDStopWhenExitVehicle (Enabled/Disabled)
#define SNOW_IDLE 0
#define SNOW_MOVING 1
#define SNOW_MOVING_MAX 2
#define SNOW_START 3
#define SNOW_STOP 4
#define SNOW_HITF 5
#define SNOW_HITB 6
#define SNOW_CDTRACK 7
#define SNOW_CDALWAYS 8
#define SNOW_CDSTOP 9

#define CUST_TSU_FOOTSTEP 4      // Customize = CUST_TSU_FOOTSTEP, MudID, SnowID, SandID, GravelID, IceID, WaterID, StoneID, WoodID, MetalID, MarbleID, GrassID, ConcreteID, OldWoodID, OldMetalID

#define INFINITE_GUN_AMMO -1

// only for TRx_ vehicle slot !!!!!
#define CUST_TSU_VEHICLE_CTRL 5    // Customize=CUST_TSU_VEHICLE_CTRL, TRx_ flag, VEH_ flag
#define TRX_FLAG 0
#define VEH_FLAG 1

#define CUST_TSU_AIMING 6   // Customize= CUST_TSU_AIMING, EnableCamera (Enabled/Disabled), DisableRespectTargetDistance (Enabled/Disabled)
#define AIMING_SYSTEM 0
#define AIMING_VALUE 1
#define AIMING_ARGS 2

#define CUST_TSU_PROPERTIES 7
#define PROPERTIES_NAME 0
#define PROPERTIES_VALUE 1
#define PROPERTIES_ARGS 9

#define CUST_TSU_OPTIONS 8
#define OPTIONS_NAME 0
#define OPTIONS_VALUE 1
#define OPTIONS_ARGS 2

#define CUST_TSU_MESHSWAPS 9
#define MESHSWAPS_NAME 0
#define MESHSWAPS_ID 1
#define MESHSWAPS_VALUE 2
#define MESHSWAPS_ARGS 4
#define MESHSWAPS_STEP 3

#define CUST_TSU_SPRITES 10
#define SPRITES_NAME 0
#define SPRITES_VALUE 1
#define SPRITES_ARGS 3

#define CAM_LOOK (2)

#define ROT_X 4
#define ROT_Y 8
#define ROT_Z 16

#define ID_RIGHT  0
#define ID_LEFT   1

#define MAX_TRIGGER_RANGE 0x4000
#define SFX_LANDONLY 0x4000
#define SFX_WATERONLY -0x8000
#define MAX_FOOTPRINTS 32

// floor->fx
#define ConvertSFXTypeToTR4(x) (FloorSoundID)(x & 0xFu)

/* For triggers (item->flags) */
#define ATONESHOT    0x80        // Anti-trigger ONESHOT.
#define ONESHOT     0x0100
#define CODE_BITS   0x3e00
#define REVERSE        0x4000
#define SNOT_VISIBLE ONESHOT
#define KILLED_ITEM (-0x8000)
#define CLEAR_BODY  KILLED_ITEM

#define SAI_GUARD    0x1
#define SAI_AMBUSH    0x2
#define SAI_PATROL1    0x4
#define SAI_MODIFY    0x8
#define SAI_FOLLOW    0x10
#define SAI_PATROL2    0x20
#define SAI_X1        0x40
#define SAI_X2        0x80

#define SUNDERWATER     1
#define SOUTSIDE     8  // OUTSIDE means sky room
#define SDYNAMIC_LIT 16
#define SNOT_INSIDE     32    // NOT_INSIDE means in the wind/mist etc
#define SINSIDE         64    // INSIDE means room *not adjacent* to an OUTSIDE room!!
#define SSWAMP         128

#define HOLD_SNOWMOBILE_GUNS 24

#define dragon mydata.save.current.dragon_front
#define dragonb mydata.save.current.dragon_back
#define dragonbindex mydata.save.current.dragon_back_number
#define dragon_already_enabled mydata.save.current.dragon_enabled
#define start_dragon_cinematic mydata.save.current.dragon_cinematic
#define dragon_ocb mydata.save.current.marco_ocb

enum LaraHandsFlags {
    LG_ARMLESS,
    LG_HANDSBUSY,
    LG_DRAW,
    LG_UNDRAW,
    LG_READY,
    LG_SPECIAL
};

enum TR_OFFSET_MUZZLEFLASH
{
    TROFF_NULL,
    TROFF_SILENCER,
    TROFF_DUAL_GUN_LEFT,
    TROFF_DUAL_GUN_RIGHT,
    TROFF_SKIDOO_LEFT,
    TROFF_SKIDOO_RIGHT,
    TROFF_WKSHOTGUN,
    TROFF_WKMACHINEGUN,
    TROFF_MERCENARY1,
    TROFF_MERCENARY2,
	TROFF_LARSON,
	TROFF_SKATE_KID_LEFT,
	TROFF_SKATE_KID_RIGHT,
	TROFF_BALDY,
	TROFF_PIERRE_LEFT,
	TROFF_PIERRE_RIGHT,
	TROFF_COWBOY_LEFT,
	TROFF_COWBOY_RIGHT,
	TROFF_SAS1,
	TROFF_SAS2,
	TROFF_MAFIA_LEFT,
	TROFF_MAFIA_RIGHT,
    TROFF_NUMBER // only at the end !!!!
};

enum TR_TSU_OBJECTS
{
    TR1_BEAR1,
    TR1_BEAR2,
    TR1_BEAR3,
    TR1_BEAR4,
    TR1_BEAR5,
    TR1_BEAR6,
    TR1_BEAR7,
    TR1_BEAR8,
    TR1_BAT1,
    TR1_BAT2,
    TR1_BAT3,
    TR1_BAT4,
    TR1_BAT5,
    TR1_BAT6,
    TR1_BAT7,
    TR1_BAT8,
    TR1_WOLF1,
    TR1_WOLF2,
    TR1_WOLF3,
    TR1_WOLF4,
    TR1_WOLF5,
    TR1_WOLF6,
    TR1_WOLF7,
    TR1_WOLF8,
    TR1_RAPTOR1,
    TR1_RAPTOR2,
    TR1_RAPTOR3,
    TR1_RAPTOR4,
    TR1_RAPTOR5,
    TR1_RAPTOR6,
    TR1_RAPTOR7,
    TR1_RAPTOR8,
    TR1_TYRANNOSAUR1,
    TR1_TYRANNOSAUR2,
    TR1_TYRANNOSAUR3,
    TR1_TYRANNOSAUR4,
    TR1_TYRANNOSAUR5,
    TR1_TYRANNOSAUR6,
    TR1_TYRANNOSAUR7,
    TR1_TYRANNOSAUR8,
    TR1_LARSON1,
    TR1_LARSON2,
    TR1_LARSON3,
    TR1_LARSON4,
    TR1_LARSON5,
    TR1_LARSON6,
    TR1_LARSON7,
    TR1_LARSON8,
    TR1_MUMMY1,
    TR1_MUMMY2,
    TR1_MUMMY3,
    TR1_MUMMY4,
    TR1_MUMMY5,
    TR1_MUMMY6,
    TR1_MUMMY7,
    TR1_MUMMY8,
    TR1_PIERRE1,
    TR1_PIERRE2,
    TR1_PIERRE3,
    TR1_PIERRE4,
    TR1_PIERRE5,
    TR1_PIERRE6,
    TR1_PIERRE7,
    TR1_PIERRE8,
    TR1_LION_MALE1,
    TR1_LION_MALE2,
    TR1_LION_MALE3,
    TR1_LION_MALE4,
    TR1_LION_MALE5,
    TR1_LION_MALE6,
    TR1_LION_MALE7,
    TR1_LION_MALE8,
    TR1_LION_FEMALE1,
    TR1_LION_FEMALE2,
    TR1_LION_FEMALE3,
    TR1_LION_FEMALE4,
    TR1_LION_FEMALE5,
    TR1_LION_FEMALE6,
    TR1_LION_FEMALE7,
    TR1_LION_FEMALE8,
    TR1_GORILLA1,
    TR1_GORILLA2,
    TR1_GORILLA3,
    TR1_GORILLA4,
    TR1_GORILLA5,
    TR1_GORILLA6,
    TR1_GORILLA7,
    TR1_GORILLA8,
    TR1_CROCODILE_LAND1,
    TR1_CROCODILE_LAND2,
    TR1_CROCODILE_LAND3,
    TR1_CROCODILE_LAND4,
    TR1_CROCODILE_LAND5,
    TR1_CROCODILE_LAND6,
    TR1_CROCODILE_LAND7,
    TR1_CROCODILE_LAND8,
    TR1_CROCODILE_WATER1,
    TR1_CROCODILE_WATER2,
    TR1_CROCODILE_WATER3,
    TR1_CROCODILE_WATER4,
    TR1_CROCODILE_WATER5,
    TR1_CROCODILE_WATER6,
    TR1_CROCODILE_WATER7,
    TR1_CROCODILE_WATER8,
    TR1_GIANT_RAT_LAND1,
    TR1_GIANT_RAT_LAND2,
    TR1_GIANT_RAT_LAND3,
    TR1_GIANT_RAT_LAND4,
    TR1_GIANT_RAT_LAND5,
    TR1_GIANT_RAT_LAND6,
    TR1_GIANT_RAT_LAND7,
    TR1_GIANT_RAT_LAND8,
    TR1_GIANT_RAT_WATER1,
    TR1_GIANT_RAT_WATER2,
    TR1_GIANT_RAT_WATER3,
    TR1_GIANT_RAT_WATER4,
    TR1_GIANT_RAT_WATER5,
    TR1_GIANT_RAT_WATER6,
    TR1_GIANT_RAT_WATER7,
    TR1_GIANT_RAT_WATER8,
    TR1_CENTAUR_MUTANT1,
    TR1_CENTAUR_MUTANT2,
    TR1_CENTAUR_MUTANT3,
    TR1_CENTAUR_MUTANT4,
    TR1_CENTAUR_MUTANT5,
    TR1_CENTAUR_MUTANT6,
    TR1_CENTAUR_MUTANT7,
    TR1_CENTAUR_MUTANT8,
    TR1_MUTANT_GRENADE1,
    TR1_MUTANT_GRENADE2,
    TR1_MUTANT_GRENADE3,
    TR1_MUTANT_GRENADE4,
    TR1_MUTANT_GRENADE5,
    TR1_MUTANT_GRENADE6,
    TR1_MUTANT_GRENADE7,
    TR1_MUTANT_GRENADE8,
    TR1_WINGED_MUTANT1,
    TR1_WINGED_MUTANT2,
    TR1_WINGED_MUTANT3,
    TR1_WINGED_MUTANT4,
    TR1_WINGED_MUTANT5,
    TR1_WINGED_MUTANT6,
    TR1_WINGED_MUTANT7,
    TR1_WINGED_MUTANT8,
    TR1_MUTANT_BULLET1,
    TR1_MUTANT_BULLET2,
    TR1_MUTANT_BULLET3,
    TR1_MUTANT_BULLET4,
    TR1_MUTANT_BULLET5,
    TR1_MUTANT_BULLET6,
    TR1_MUTANT_BULLET7,
    TR1_MUTANT_BULLET8,
    TR1_PANTHER1,
    TR1_PANTHER2,
    TR1_PANTHER3,
    TR1_PANTHER4,
    TR1_PANTHER5,
    TR1_PANTHER6,
    TR1_PANTHER7,
    TR1_PANTHER8,
    TR1_SKATEBOARD_KID1,
    TR1_SKATEBOARD_KID2,
    TR1_SKATEBOARD_KID3,
    TR1_SKATEBOARD_KID4,
    TR1_SKATEBOARD_KID5,
    TR1_SKATEBOARD_KID6,
    TR1_SKATEBOARD_KID7,
    TR1_SKATEBOARD_KID8,
    TR1_SKATEBOARD1,
    TR1_SKATEBOARD2,
    TR1_SKATEBOARD3,
    TR1_SKATEBOARD4,
    TR1_SKATEBOARD5,
    TR1_SKATEBOARD6,
    TR1_SKATEBOARD7,
    TR1_SKATEBOARD8,
    TR1_MR_T1,
    TR1_MR_T2,
    TR1_MR_T3,
    TR1_MR_T4,
    TR1_MR_T5,
    TR1_MR_T6,
    TR1_MR_T7,
    TR1_MR_T8,
    TR1_COWBOY1,
    TR1_COWBOY2,
    TR1_COWBOY3,
    TR1_COWBOY4,
    TR1_COWBOY5,
    TR1_COWBOY6,
    TR1_COWBOY7,
    TR1_COWBOY8,
    TR1_LARA_EVIL_TWIN_MUTANT1,
    TR1_LARA_EVIL_TWIN_MUTANT2,
    TR1_LARA_EVIL_TWIN_MUTANT3,
    TR1_LARA_EVIL_TWIN_MUTANT4,
    TR1_LARA_EVIL_TWIN_MUTANT5,
    TR1_LARA_EVIL_TWIN_MUTANT6,
    TR1_LARA_EVIL_TWIN_MUTANT7,
    TR1_LARA_EVIL_TWIN_MUTANT8,
    TR1_GIANT_MUTANT1,
    TR1_GIANT_MUTANT2,
    TR1_GIANT_MUTANT3,
    TR1_GIANT_MUTANT4,
    TR1_GIANT_MUTANT5,
    TR1_GIANT_MUTANT6,
    TR1_GIANT_MUTANT7,
    TR1_GIANT_MUTANT8,
    TR2_SPIDER1,
    TR2_SPIDER2,
    TR2_SPIDER3,
    TR2_SPIDER4,
    TR2_SPIDER5,
    TR2_SPIDER6,
    TR2_SPIDER7,
    TR2_SPIDER8,
    TR2_CROW1,
    TR2_CROW2,
    TR2_CROW3,
    TR2_CROW4,
    TR2_CROW5,
    TR2_CROW6,
    TR2_CROW7,
    TR2_CROW8,
    TR2_TIGER1,
    TR2_TIGER2,
    TR2_TIGER3,
    TR2_TIGER4,
    TR2_TIGER5,
    TR2_TIGER6,
    TR2_TIGER7,
    TR2_TIGER8,
    TR2_TYRANNOSAUR1,
    TR2_TYRANNOSAUR2,
    TR2_TYRANNOSAUR3,
    TR2_TYRANNOSAUR4,
    TR2_TYRANNOSAUR5,
    TR2_TYRANNOSAUR6,
    TR2_TYRANNOSAUR7,
    TR2_TYRANNOSAUR8,
    TR2_DOBERMAN1,
    TR2_DOBERMAN2,
    TR2_DOBERMAN3,
    TR2_DOBERMAN4,
    TR2_DOBERMAN5,
    TR2_DOBERMAN6,
    TR2_DOBERMAN7,
    TR2_DOBERMAN8,
    TR2_MASKED_GOON1,
    TR2_MASKED_GOON2,
    TR2_MASKED_GOON3,
    TR2_MASKED_GOON4,
    TR2_MASKED_GOON5,
    TR2_MASKED_GOON6,
    TR2_MASKED_GOON7,
    TR2_MASKED_GOON8,
    TR2_RAT1,
    TR2_RAT2,
    TR2_RAT3,
    TR2_RAT4,
    TR2_RAT5,
    TR2_RAT6,
    TR2_RAT7,
    TR2_RAT8,
    TR2_STICK_GOON1,
    TR2_STICK_GOON2,
    TR2_STICK_GOON3,
    TR2_STICK_GOON4,
    TR2_STICK_GOON5,
    TR2_STICK_GOON6,
    TR2_STICK_GOON7,
    TR2_STICK_GOON8,
    TR2_SHOTGUN_GOON1,
    TR2_SHOTGUN_GOON2,
    TR2_SHOTGUN_GOON3,
    TR2_SHOTGUN_GOON4,
    TR2_SHOTGUN_GOON5,
    TR2_SHOTGUN_GOON6,
    TR2_SHOTGUN_GOON7,
    TR2_SHOTGUN_GOON8,
    TR2_RIG_WORKER_KHAKI_PANTS1,
    TR2_RIG_WORKER_KHAKI_PANTS2,
    TR2_RIG_WORKER_KHAKI_PANTS3,
    TR2_RIG_WORKER_KHAKI_PANTS4,
    TR2_RIG_WORKER_KHAKI_PANTS5,
    TR2_RIG_WORKER_KHAKI_PANTS6,
    TR2_RIG_WORKER_KHAKI_PANTS7,
    TR2_RIG_WORKER_KHAKI_PANTS8,
    TR2_RIG_WORKER_BLUE_JEANS1,
    TR2_RIG_WORKER_BLUE_JEANS2,
    TR2_RIG_WORKER_BLUE_JEANS3,
    TR2_RIG_WORKER_BLUE_JEANS4,
    TR2_RIG_WORKER_BLUE_JEANS5,
    TR2_RIG_WORKER_BLUE_JEANS6,
    TR2_RIG_WORKER_BLUE_JEANS7,
    TR2_RIG_WORKER_BLUE_JEANS8,
    TR2_FLAMETHROWER1,
    TR2_FLAMETHROWER2,
    TR2_FLAMETHROWER3,
    TR2_FLAMETHROWER4,
    TR2_FLAMETHROWER5,
    TR2_FLAMETHROWER6,
    TR2_FLAMETHROWER7,
    TR2_FLAMETHROWER8,
    TR2_FLAME1,
    TR2_FLAME2,
    TR2_FLAME3,
    TR2_FLAME4,
    TR2_FLAME5,
    TR2_FLAME6,
    TR2_FLAME7,
    TR2_FLAME8,
    TR2_BARRACUDA1,
    TR2_BARRACUDA2,
    TR2_BARRACUDA3,
    TR2_BARRACUDA4,
    TR2_BARRACUDA5,
    TR2_BARRACUDA6,
    TR2_BARRACUDA7,
    TR2_BARRACUDA8,
    TR2_MERCENARY1,
    TR2_MERCENARY2,
    TR2_MERCENARY3,
    TR2_MERCENARY4,
    TR2_MERCENARY5,
    TR2_MERCENARY6,
    TR2_MERCENARY7,
    TR2_MERCENARY8,
    TR2_MERCENARY_BLACK_MASK1,
    TR2_MERCENARY_BLACK_MASK2,
    TR2_MERCENARY_BLACK_MASK3,
    TR2_MERCENARY_BLACK_MASK4,
    TR2_MERCENARY_BLACK_MASK5,
    TR2_MERCENARY_BLACK_MASK6,
    TR2_MERCENARY_BLACK_MASK7,
    TR2_MERCENARY_BLACK_MASK8,
    TR2_EAGLE1,
    TR2_EAGLE2,
    TR2_EAGLE3,
    TR2_EAGLE4,
    TR2_EAGLE5,
    TR2_EAGLE6,
    TR2_EAGLE7,
    TR2_EAGLE8,
    TR2_MONK1,
    TR2_MONK2,
    TR2_MONK3,
    TR2_MONK4,
    TR2_MONK5,
    TR2_MONK6,
    TR2_MONK7,
    TR2_MONK8,
    TR2_YETI1,
    TR2_YETI2,
    TR2_YETI3,
    TR2_YETI4,
    TR2_YETI5,
    TR2_YETI6,
    TR2_YETI7,
    TR2_YETI8,
    TR2_BIRD_MONSTER1,
    TR2_BIRD_MONSTER2,
    TR2_BIRD_MONSTER3,
    TR2_BIRD_MONSTER4,
    TR2_BIRD_MONSTER5,
    TR2_BIRD_MONSTER6,
    TR2_BIRD_MONSTER7,
    TR2_BIRD_MONSTER8,
    TR2_GIANT_SPIDER1,
    TR2_GIANT_SPIDER2,
    TR2_GIANT_SPIDER3,
    TR2_GIANT_SPIDER4,
    TR2_GIANT_SPIDER5,
    TR2_GIANT_SPIDER6,
    TR2_GIANT_SPIDER7,
    TR2_GIANT_SPIDER8,
    TR2_SPEAR_XIAN_GUARD1,
    TR2_SPEAR_XIAN_GUARD2,
    TR2_SPEAR_XIAN_GUARD3,
    TR2_SPEAR_XIAN_GUARD4,
    TR2_SPEAR_XIAN_GUARD5,
    TR2_SPEAR_XIAN_GUARD6,
    TR2_SPEAR_XIAN_GUARD7,
    TR2_SPEAR_XIAN_GUARD8,
    TR2_SPEAR_XIAN_GUARD_STATUE1,
    TR2_SPEAR_XIAN_GUARD_STATUE2,
    TR2_SPEAR_XIAN_GUARD_STATUE3,
    TR2_SPEAR_XIAN_GUARD_STATUE4,
    TR2_SPEAR_XIAN_GUARD_STATUE5,
    TR2_SPEAR_XIAN_GUARD_STATUE6,
    TR2_SPEAR_XIAN_GUARD_STATUE7,
    TR2_SPEAR_XIAN_GUARD_STATUE8,
    TR2_SWORD_XIAN_GUARD1,
    TR2_SWORD_XIAN_GUARD2,
    TR2_SWORD_XIAN_GUARD3,
    TR2_SWORD_XIAN_GUARD4,
    TR2_SWORD_XIAN_GUARD5,
    TR2_SWORD_XIAN_GUARD6,
    TR2_SWORD_XIAN_GUARD7,
    TR2_SWORD_XIAN_GUARD8,
    TR2_SWORD_XIAN_GUARD_STATUE1,
    TR2_SWORD_XIAN_GUARD_STATUE2,
    TR2_SWORD_XIAN_GUARD_STATUE3,
    TR2_SWORD_XIAN_GUARD_STATUE4,
    TR2_SWORD_XIAN_GUARD_STATUE5,
    TR2_SWORD_XIAN_GUARD_STATUE6,
    TR2_SWORD_XIAN_GUARD_STATUE7,
    TR2_SWORD_XIAN_GUARD_STATUE8,
    TR2_SPARKLE1,
    TR2_SPARKLE2,
    TR2_SPARKLE3,
    TR2_SPARKLE4,
    TR2_SPARKLE5,
    TR2_SPARKLE6,
    TR2_SPARKLE7,
    TR2_SPARKLE8,
    TR2_KNIFETHROWER1,
    TR2_KNIFETHROWER2,
    TR2_KNIFETHROWER3,
    TR2_KNIFETHROWER4,
    TR2_KNIFETHROWER5,
    TR2_KNIFETHROWER6,
    TR2_KNIFETHROWER7,
    TR2_KNIFETHROWER8,
    TR2_KNIFE1,
    TR2_KNIFE2,
    TR2_KNIFE3,
    TR2_KNIFE4,
    TR2_KNIFE5,
    TR2_KNIFE6,
    TR2_KNIFE7,
    TR2_KNIFE8,
    TR2_BLACK_MORAY_EEL1,
    TR2_BLACK_MORAY_EEL2,
    TR2_BLACK_MORAY_EEL3,
    TR2_BLACK_MORAY_EEL4,
    TR2_BLACK_MORAY_EEL5,
    TR2_BLACK_MORAY_EEL6,
    TR2_BLACK_MORAY_EEL7,
    TR2_BLACK_MORAY_EEL8,
    TR2_YELLOW_MORAY_EEL1,
    TR2_YELLOW_MORAY_EEL2,
    TR2_YELLOW_MORAY_EEL3,
    TR2_YELLOW_MORAY_EEL4,
    TR2_YELLOW_MORAY_EEL5,
    TR2_YELLOW_MORAY_EEL6,
    TR2_YELLOW_MORAY_EEL7,
    TR2_YELLOW_MORAY_EEL8,
    TR2_WINSTON1,
    TR2_WINSTON2,
    TR2_WINSTON3,
    TR2_WINSTON4,
    TR2_WINSTON5,
    TR2_WINSTON6,
    TR2_WINSTON7,
    TR2_WINSTON8,
    TR3_LIZARD1,
    TR3_LIZARD2,
    TR3_LIZARD3,
    TR3_LIZARD4,
    TR3_LIZARD5,
    TR3_LIZARD6,
    TR3_LIZARD7,
    TR3_LIZARD8,
    TR3_GAS1,
    TR3_GAS2,
    TR3_GAS3,
    TR3_GAS4,
    TR3_GAS5,
    TR3_GAS6,
    TR3_GAS7,
    TR3_GAS8,
    TR5_GUARD_TWO1,
    TR5_GUARD_TWO2,
    TR5_GUARD_TWO3,
    TR5_GUARD_TWO4,
    TR5_GUARD_TWO5,
    TR5_GUARD_TWO6,
    TR5_GUARD_TWO7,
    TR5_GUARD_TWO8,
    TR5_GUARD_THREE1,
    TR5_GUARD_THREE2,
    TR5_GUARD_THREE3,
    TR5_GUARD_THREE4,
    TR5_GUARD_THREE5,
    TR5_GUARD_THREE6,
    TR5_GUARD_THREE7,
    TR5_GUARD_THREE8,
    TR5_GUARD_FOUR1,
    TR5_GUARD_FOUR2,
    TR5_GUARD_FOUR3,
    TR5_GUARD_FOUR4,
    TR5_GUARD_FOUR5,
    TR5_GUARD_FOUR6,
    TR5_GUARD_FOUR7,
    TR5_GUARD_FOUR8,
    TR5_ARMED_BADDY_ONE1,
    TR5_ARMED_BADDY_ONE2,
    TR5_ARMED_BADDY_ONE3,
    TR5_ARMED_BADDY_ONE4,
    TR5_ARMED_BADDY_ONE5,
    TR5_ARMED_BADDY_ONE6,
    TR5_ARMED_BADDY_ONE7,
    TR5_ARMED_BADDY_ONE8,
    TR5_VCI_WORKER1,
    TR5_VCI_WORKER2,
    TR5_VCI_WORKER3,
    TR5_VCI_WORKER4,
    TR5_VCI_WORKER5,
    TR5_VCI_WORKER6,
    TR5_VCI_WORKER7,
    TR5_VCI_WORKER8,
    TR5_ARMED_BADDY_TWO1,
    TR5_ARMED_BADDY_TWO2,
    TR5_ARMED_BADDY_TWO3,
    TR5_ARMED_BADDY_TWO4,
    TR5_ARMED_BADDY_TWO5,
    TR5_ARMED_BADDY_TWO6,
    TR5_ARMED_BADDY_TWO7,
    TR5_ARMED_BADDY_TWO8,
    TR_OBJECTS_NUMBER
};

enum AimingSystem
{
    AIM_RESDISTANCE,
    AIM_NUMBER
};

enum AttributeEntity
{
    ATT_HP,
    ATT_DMG1,
    ATT_DMG2,
    ATT_DMG3,
    ATT_DMG4,
    ATT_DMG5,
    ATT_DMG6,
    ATT_NUMBER
};

enum LinkEntity
{
    LNK_OBJECT1,
    LNK_OBJECT2,
    LNK_NUMBER
};

enum PropertyEntity
{
    PTY_ANIM,
    PTY_SND1,
    PTY_SND2,
    PTY_SND3,
    PTY_SND4,
    PTY_SND5,
    PTY_SND6,
    PTY_SND7,
    PTY_NUMBER
};

enum OptionEntity
{
    OPT_HEAD,
    OPT_NUMBER
};

enum MeshswapEntity
{
    MSH_SLOT,
    MSH_MESH,
    MSH_NUMBER
};

enum SpriteEntity
{
    SPR_SLOT,
    SPR_INDEX,
    SPR_NUMBER
};

enum TYPE_ZONE
{
    ZONE_SKELLY,
    ZONE_BASIC,
    ZONE_CROC,
    ZONE_HUMAN,
    ZONE_FLYER,
    ZONE_MAX_NUMBER
};

#define TIMID       0
#define VIOLENT     1

#define LARA_ANIM(id) id
#define LARA_ANIM_FRAME(id) Ptr_VetAnimations[id].frame_base
#define HP_CANT_BE_TARGETED (-16384)

#define NO_ARGS     -1
#define NO_VALUE    -2
#define NO_FLYING   0
#define NO_ITEM     -1
#define NO_BOX      2047
#define FRONT_ARC   0x4000
#define BLOCKABLE   0x8000
#define BLOCKED     0x4000
#define BLOCKED_SEARCH 0x8000
#define NO_HEIGHT    (-0x7f00)

/// item states
#define STS_NOT_ACTIVE   0
#define STS_ACTIVE       1
#define STS_DESACTIVATED 2
#define STS_INVISIBLE    3

/// hit_effect flags
#define HIT_NONE     0
#define HIT_BLOOD    1
#define HIT_SMOKE    2
#define HIT_FRAGMENT 3

#define GF_MIRROR_USED 0x20

#define input                               VAR(0x005355D8, int)
#define Ptr_LaraTarget                      VAR(0x0080DF5A, ITEM_INFO*)
#define ZonaSave_111_StateIdAnimExtraSlot   VAR(0x0080DF7A, short)
#define ZonaSave_113_DifferenzaOrientHLara  VAR(0x0080DF7C, short)
#define ZonaSave_125_AltroRotateY           VAR(0x0080DF8E, short)
#define ZonaSave_125_AltroRotateX           VAR(0x0080DF90, short)
#define ZonaSave_FB_CopiaOrientamento       VAR(0x0080DF64, short)
#define lara_head_y_rotation                VAR(0x0080DF68, short)
#define ModeCameraNow                       VAR(0x007FE724, CAMERA_TYPE)
#define ModeCameraNext                      VAR(0x007FE720, CAMERA_TYPE)
#define SmokeWeapon                         VAR(0x00804E00, int)
#define SmokeCountR                         VAR(0x00804D4C, int)
#define SmokeCountL                         VAR(0x00804D48, int)
#define GF_LEVEL_FLAGS                      VAR(0x007FD140, int)
#define LaraItem                            VAR(0x0080E01C, ITEM_INFO*)
#define Mirror_Room                         VAR(0x007FD130, short)
#define ObjInLaraHandNow                    VAR(0x0080DEC4, short)
#define ObjInLaraHandNext                   VAR(0x0080DEC6, short)
#define SaveGame_MunitionUsed               VAR(0x007F773A, int)
#define lara_head_y_rot                     VAR(0x0080DF64, int)
#define lara_head_x_rot                     VAR(0x0080DF68, int)
#define uzi_right                           VAR(0x004BF228, int)
#define uzi_left                            VAR(0x004BF224, int)
#define Ptr_VetItems                        VAR(0x007FE16C, ITEM_INFO*)
#define Ptr_VetAnimationsMeshTree           VAR(0x00533958, int*)
#define Ptr_VetAnimations                   VAR(0x00533938, ANIM_STRUCT*)
#define Ptr_VetObjects                      VAA(0x0052B720, OBJECT_INFO, [SLOT_NUMBER_OBJECTS])
#define Ptr_VetSpriteTextures               VAR(0x00533994, SPRITES*)
#define Ptr_VetRoom                         VAR(0x00533934, StrRoomTr4*)
#define Ptr_VetMeshes                       VAR(0x00533950, StrMeshTr4**)
#define Ptr_VetBoxes                        VAR(0x007FE890, BOX_INFO*)
#define Ptr_VetCamera                       VAR(0x007FE75C, StrCameraTr4*)
#define Ptr_VetStatics                      VAR(0x00533294, MESH_INFO*)
//#define sparks                              VAA(0x008012E0, SPARKS, [128])
#define Ptr_VetEffects                      VAR(0x008011C0, FX_INFO*)
#define baddie_slots                        VAR(0x007FD0DC, CREATURE_INFO*)
#define baddie_slots_number                 VAR(0x004BF568, int)
#define TotBoxInfos                         VAR(0x007FE894, int)
#define number_draw_rooms                   VAR(0x007FD1E4, int)
#define draw_rooms                          VAA(0x007FDE60, short, [200])
#define WeaponSelect                        VAR(0x0080DEC8, int)
#define ValRoom_38                          VAR(0x00753BE0, int)
#define ValRoom_3A_CordX                    VAR(0x0075403C, int)
#define ValRoom_3E_CordY                    VAR(0x00753BD8, int)
#define ValRoom_3C_CordZ                    VAR(0x00753B98, int)
#define AltraSizeSchermoX                   VAR(0x00753C60, int)
#define Schermo_SizeY_Reale                 VAR(0x00753BB0, int)
#define Zona3C_Default                      VAR(0x004BF50C, ITEM_INFO)
#define ZoneSmokeSpark                      VAA(0x007FEFE0, SMOKE_SPARKS, [])
#define ZoneFireList                        VAA(0x007FFE40, FIRE_LIST, [])
#define ZoneFireSparks                      VAA(0x008004E0, FIRE_SPARKS, [])
#define ValOscilla0_255                     VAR(0x004BF2D2, short)
#define Vet_Atan_Long                       VAA(0x004B24A8, long, [])
#define Vet_Atan_Word                       VAA(0x004B24C8, WORD, [])
#define phd_sin_table                       VAA(0x004B34D0, short, [])
#define phd_cos_table                       VAA(0x004B34D2, short, [])
#define EsitoCalculateTarget                VAR(0x007FE898, int)
#define LaraLocationFlags                   VAR(0x0080DECC, short)
#define ZoneGrid                            VAA(0x007FE860, short*, [ZONE_MAX_NUMBER])
#define TestAttivataUnaFlipMap              VAR(0x007FE0F8, int)
#define Ptr_ZonaRecord30                    VAR(0x007E70C8, int*)
#define Ptr_AltraZonaRecord30               VAR(0x007FE004, int*)
#define Camera_Bounce                       VAR(0x007FE738, int)
#define FrameCounterCutscene                VAR(0x007F4EA4, int)
#define FlyCameraSource_X                   VAR(0x007F5720, DWORD)
#define cd_flags                            VAA(0x007FE060, char, [128])
#define GL_LEVEL_FLAGS                      VAR(0x007FD140, int)
#define ZonaSave_7D_TempoFlare              VAR(0x0080DEE6, int)
#define ZonaSave_11F_FramesAnimArma         VAR(0x0080DF88, short)
#define ZonaSave_10D_FrameNowExtraSlot      VAR(0x0080DF76, short)
#define trigger_index                       VAR(0x007FE128, short*)  // Trigger Index (Maps)
#define SaveGame_AmmoHit                    VAR(0x007F773E, int)
#define SaveGame_EnemyKilled                VAR(0x007F7756, int)
#define los_rooms                           VAA(0x007FE140, short, [20])
#define number_los_rooms                    VAR(0x004BF2F0, int)
#define SphereDefault                       VAR(0x007F6DC0, SPHERE)
#define next_item_active                    VAR(0x007FD0EA, short)
#define next_item_free                      VAR(0x007FD0E8, short)
#define FootprintSFX                        VAA(0x004ABF3C, char, [])
#define ZonaFootPrint                       VAA(0x00800FC0, FOOTPRINT, [])
#define IndiceFootPrint                     VAR(0x00800FA0, int)
#define TestOverPlatform                    VAR(0x007FE0E0, BOOL)
#define FXType                              VAR(0x007FE6C0, short)
#define height_type                         VAR(0x007FE170, int)
#define LaraFlags                           VAR(0x0080DF04, WORD)
#define VehicleIndex                        VAR(0x0080DEE8, short)
#define ContaQuindicesimiSecondo            VAR(0x004BF238, int)
#define Ptr_ItemTorch                       VAR(0x004BF210, ITEM_INFO*)
#define TestForzaQuestaCamera               VAR(0x007FE72C, int)
#define SetCameraDistance                   VAR(0x007FE740, int)
#define SetCameraHOrient                    VAR(0x007FE744, short)
#define SetCameraVOrient                    VAR(0x007FE746, short)
#define level_items                         VAR(0x004BF564, int)
#define Camera_Pos                          VAR(0x007FE700, GAMEVECTOR)
#define Camera_Target                       VAR(0x007FE710, GAMEVECTOR)
#define Ptr_LaraColl                        VAR(0x004AB9B0, COLL_INFO*)
#define Ptr_VetChanges                      VAR(0x0053393C, CHANGE_STRUCT*)
#define Ptr_VetRanges                       VAR(0x00533940, RANGE_STRUCT*)
#define GL_playing_cutseq					VAR(0x004BFB54, long)

enum FLF_FLAGS
{
    FLF_FLARE_CONTROL_LEFT = 1,
    FLF_FLARE_CONTROL_RIGHT = 2,
    FLF_CAN_LOOK = 4,
    FLF_IS_BURNING = 8,
    FLF_KEEP_DUCKED = 16,
    FLF_IS_MOVING = 32,
    FLF_CAN_MONKEY_SWING = 64,
    FLF_BURN_BLUE = 128,
    FLF_GASSED = 256,
    FLF_BURN_SMOKE = 512,
    FLF_IS_DUCKED = 1024,
    FLF_HAS_FIRED = 2048,
    FLF_BUSY = 4096,
    FLF_LIT_TORCH = 8192,
    FLF_IS_CLIMBING = 16384,
    FLF_FIRED = 32768
};

/// used by mesh_bits to found the mesh (to hide it: "&= ~(MESH_BITS_)", to show it: "|= (MESH_BITS_)")
/// it's a multiple of two.
#define MESH_BITS_0  0x1             // mesh no° 1
#define MESH_BITS_1  0x2             // mesh no° 2, etc..
#define MESH_BITS_2  0x4
#define MESH_BITS_3  0x8
#define MESH_BITS_4  0x10
#define MESH_BITS_5  0x20
#define MESH_BITS_6  0x40
#define MESH_BITS_7  0x80
#define MESH_BITS_8  0x100
#define MESH_BITS_9  0x200
#define MESH_BITS_10 0x400
#define MESH_BITS_11 0x800
#define MESH_BITS_12 0x1000
#define MESH_BITS_13 0x2000
#define MESH_BITS_14 0x4000
#define MESH_BITS_15 0x8000
#define MESH_BITS_16 0x10000
#define MESH_BITS_17 0x20000
#define MESH_BITS_18 0x40000
#define MESH_BITS_19 0x80000
#define MESH_BITS_20 0x100000
#define MESH_BITS_21 0x200000
#define MESH_BITS_22 0x400000
#define MESH_BITS_23 0x800000
#define MESH_BITS_24 0x1000000
#define MESH_BITS_25 0x2000000
#define MESH_BITS_26 0x4000000
#define MESH_BITS_27 0x8000000

// used by ExplodingDeath(XX, MESH_BITS, XX)
#define ALL_LARA_MESH (MESH_BITS_0+MESH_BITS_1+MESH_BITS_2+MESH_BITS_3+MESH_BITS_4+MESH_BITS_5+MESH_BITS_6+MESH_BITS_7+MESH_BITS_8+MESH_BITS_9+MESH_BITS_10+MESH_BITS_11+MESH_BITS_12+MESH_BITS_13+MESH_BITS_14)
#define ALL_SNOWMOBILE_MESH (MESH_BITS_0+MESH_BITS_1+MESH_BITS_2+MESH_BITS_3+MESH_BITS_4+MESH_BITS_5+MESH_BITS_6)

// MPS_ flags
// you should type here your MPS_ flags for plugin command.
// then you'll test the presence of these flags checking the Trng.MainPluginFlags  value using "&" operator
// please: do not use the value 0x40000000 (MPS_DISABLE) because it has been already set by trng engine

#define ONE_DEGREE         (182)
#define PITCH_SHIFT        (4)
#define SQUARE(A)          ((A) * (A))
#define WALL_L             (1024)
#define STEP_L             (WALL_L / 4)
#ifndef ABS
#define ABS(x) (((x) < 0) ? (-(x)) : (x))
#endif
#define QUADRANT_ABS(x, y) ((x - y) >= 0 ? x - y : y - x)
#define STEPUP_HEIGHT      ((STEP_L * 3) / 2)
#define W2V_SHIFT          14
#define WALL_SHIFT         10
#define PREDICTIVE_SCALE_FACTOR 14
#define PEOPLE_SHOOT_RANGE SQUARE(WALL_L*8)
#define ITEM_IS_COLLIDE_TARGET 1

#define ArraySize(a) (sizeof(a)/sizeof((a)[0]))

// with this you can change the size of the array easy
#define ArrayInit(a, for_value) {                                       \
    for (for_value = 0; for_value < ArraySize(a.text); for_value++) {   \
        a.text[for_value] = "";                                         \
        a.value[for_value] = NO_ITEM;                                   \
        a.text_enabled[for_value] = FALSE;                              \
    }                                                                   \
}


#define Weapons                             VAA(0x004AB830, WEAPON_INFO, [8]) /* = {
    Unarmed,
    Pistols,
    Shotguns,
    Uzis,
    Crossbow,
    Grenadegun,
    Revolver,
    Flare
};
*/
#define PistolTable                         VAA(0x004AB804, PISTOL_DEF, [4]) /* = {
    Unarmed,
    Pistols,
    Uzis,
    Revolver
};
*/

#endif