Files
Gleb Mazovetskiy b5f788cb33 trigs.cpp: Optimize & clean up the data structures
1. Use appropriate types.
2. Do not use an end marker for static arrays (their length is known).
2022-10-16 03:53:26 +01:00

52 lines
1.2 KiB
C++

/**
* @file trigs.h
*
* Interface of functionality for triggering events when the player enters an area.
*/
#pragma once
#include "engine/point.hpp"
#include "interfac.h"
#include "levels/gendung.h"
namespace devilution {
#define MAXTRIGGERS 7
struct TriggerStruct {
WorldTilePosition position;
interface_mode _tmsg;
int _tlvl;
};
extern bool trigflag;
extern int numtrigs;
extern TriggerStruct trigs[MAXTRIGGERS];
extern int TWarpFrom;
void InitNoTriggers();
bool IsWarpOpen(dungeon_type type);
void InitTownTriggers();
void InitL1Triggers();
void InitL2Triggers();
void InitL3Triggers();
void InitL4Triggers();
void InitHiveTriggers();
void InitCryptTriggers();
void InitSKingTriggers();
void InitSChambTriggers();
void InitPWaterTriggers();
void InitVPTriggers();
void Freeupstairs();
void CheckTrigForce();
void CheckTriggers();
/**
* @brief Check if the provided position is in the entrance boundary of the entrance.
* @param entrance The entrance to check.
* @param position The position to check against the entrance boundary.
*/
bool EntranceBoundaryContains(Point entrance, Point position);
} // namespace devilution