2016-04-29 14:53:19 +00:00
|
|
|
#include <game/mapitems.h>
|
|
|
|
|
|
|
|
bool IsValidGameTile(int Index)
|
|
|
|
{
|
2016-04-30 09:02:00 +00:00
|
|
|
return (
|
2020-09-14 14:00:32 +00:00
|
|
|
Index == TILE_AIR ||
|
|
|
|
(Index >= TILE_SOLID && Index <= TILE_THROUGH) ||
|
|
|
|
Index == TILE_FREEZE ||
|
|
|
|
(Index >= TILE_UNFREEZE && Index <= TILE_DUNFREEZE) ||
|
2022-01-07 15:53:40 +00:00
|
|
|
(Index >= TILE_LFREEZE && Index <= TILE_LUNFREEZE) ||
|
2020-09-14 14:00:32 +00:00
|
|
|
(Index >= TILE_WALLJUMP && Index <= TILE_SOLO_DISABLE) ||
|
|
|
|
(Index >= TILE_REFILL_JUMPS && Index <= TILE_STOPA) ||
|
|
|
|
(Index >= TILE_CP && Index <= TILE_THROUGH_DIR) ||
|
|
|
|
(Index >= TILE_OLDLASER && Index <= TILE_UNLOCK_TEAM) ||
|
|
|
|
(Index >= TILE_NPC_DISABLE && Index <= TILE_NPH_DISABLE) ||
|
|
|
|
(Index >= TILE_TELE_GUN_ENABLE && Index <= TILE_TELE_GUN_DISABLE) ||
|
|
|
|
(Index >= TILE_TELE_GRENADE_ENABLE && Index <= TILE_TELE_GRENADE_DISABLE) ||
|
|
|
|
(Index >= TILE_TELE_LASER_ENABLE && Index <= TILE_TELE_LASER_DISABLE) ||
|
|
|
|
(Index >= TILE_NPC_ENABLE && Index <= TILE_NPH_ENABLE) ||
|
|
|
|
(Index >= TILE_ENTITIES_OFF_1 && Index <= TILE_ENTITIES_OFF_2) ||
|
|
|
|
IsValidEntity(Index));
|
2016-04-29 14:53:19 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
bool IsValidFrontTile(int Index)
|
|
|
|
{
|
2016-04-30 09:02:00 +00:00
|
|
|
return (
|
2020-09-14 14:00:32 +00:00
|
|
|
Index == TILE_AIR ||
|
|
|
|
Index == TILE_DEATH ||
|
|
|
|
(Index >= TILE_NOLASER && Index <= TILE_THROUGH) ||
|
|
|
|
Index == TILE_FREEZE ||
|
|
|
|
(Index >= TILE_UNFREEZE && Index <= TILE_DUNFREEZE) ||
|
2022-01-07 15:53:40 +00:00
|
|
|
(Index >= TILE_LFREEZE && Index <= TILE_LUNFREEZE) ||
|
2020-09-14 14:00:32 +00:00
|
|
|
(Index >= TILE_WALLJUMP && Index <= TILE_SOLO_DISABLE) ||
|
|
|
|
(Index >= TILE_REFILL_JUMPS && Index <= TILE_STOPA) ||
|
|
|
|
(Index >= TILE_CP && Index <= TILE_THROUGH_DIR) ||
|
|
|
|
(Index >= TILE_OLDLASER && Index <= TILE_UNLOCK_TEAM) ||
|
|
|
|
(Index >= TILE_NPC_DISABLE && Index <= TILE_NPH_DISABLE) ||
|
|
|
|
(Index >= TILE_TELE_GUN_ENABLE && Index <= TILE_ALLOW_BLUE_TELE_GUN) ||
|
|
|
|
(Index >= TILE_TELE_GRENADE_ENABLE && Index <= TILE_TELE_GRENADE_DISABLE) ||
|
|
|
|
(Index >= TILE_TELE_LASER_ENABLE && Index <= TILE_TELE_LASER_DISABLE) ||
|
|
|
|
(Index >= TILE_NPC_ENABLE && Index <= TILE_NPH_ENABLE) ||
|
|
|
|
(Index >= TILE_ENTITIES_OFF_1 && Index <= TILE_ENTITIES_OFF_2) ||
|
|
|
|
IsValidEntity(Index));
|
2016-04-29 14:53:19 +00:00
|
|
|
}
|
|
|
|
|
2017-06-11 17:53:55 +00:00
|
|
|
bool IsValidTeleTile(int Index)
|
|
|
|
{
|
|
|
|
return (
|
2020-09-14 14:00:32 +00:00
|
|
|
Index == TILE_TELEINEVIL ||
|
|
|
|
Index == TILE_TELEINWEAPON ||
|
|
|
|
Index == TILE_TELEINHOOK ||
|
|
|
|
Index == TILE_TELEIN ||
|
|
|
|
Index == TILE_TELEOUT ||
|
|
|
|
Index == TILE_TELECHECK ||
|
|
|
|
Index == TILE_TELECHECKOUT ||
|
|
|
|
Index == TILE_TELECHECKIN ||
|
|
|
|
Index == TILE_TELECHECKINEVIL);
|
2017-06-11 17:53:55 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
bool IsValidSpeedupTile(int Index)
|
|
|
|
{
|
|
|
|
return Index == TILE_BOOST;
|
|
|
|
}
|
|
|
|
|
|
|
|
bool IsValidSwitchTile(int Index)
|
|
|
|
{
|
|
|
|
return (
|
2020-09-14 14:00:32 +00:00
|
|
|
Index == TILE_JUMP ||
|
|
|
|
Index == TILE_FREEZE ||
|
|
|
|
Index == TILE_DFREEZE ||
|
|
|
|
Index == TILE_DUNFREEZE ||
|
2022-01-07 15:53:40 +00:00
|
|
|
Index == TILE_LFREEZE ||
|
|
|
|
Index == TILE_LUNFREEZE ||
|
2020-09-14 14:00:32 +00:00
|
|
|
Index == TILE_HIT_ENABLE ||
|
|
|
|
Index == TILE_HIT_DISABLE ||
|
|
|
|
(Index >= TILE_SWITCHTIMEDOPEN && Index <= TILE_SWITCHCLOSE) ||
|
|
|
|
Index == TILE_ADD_TIME ||
|
2021-02-01 13:55:26 +00:00
|
|
|
Index == TILE_SUBTRACT_TIME ||
|
2020-09-14 14:00:32 +00:00
|
|
|
Index == TILE_ALLOW_TELE_GUN ||
|
|
|
|
Index == TILE_ALLOW_BLUE_TELE_GUN ||
|
2021-02-01 14:01:45 +00:00
|
|
|
(IsValidEntity(Index) && Index >= ENTITY_OFFSET + ENTITY_ARMOR_1));
|
2017-06-11 17:53:55 +00:00
|
|
|
}
|
|
|
|
|
2019-03-26 18:15:24 +00:00
|
|
|
bool IsValidTuneTile(int Index)
|
|
|
|
{
|
2020-09-13 20:00:49 +00:00
|
|
|
return Index == TILE_TUNE;
|
2019-03-26 18:15:24 +00:00
|
|
|
}
|
|
|
|
|
2016-04-29 14:53:19 +00:00
|
|
|
bool IsValidEntity(int Index)
|
|
|
|
{
|
2016-04-30 09:02:00 +00:00
|
|
|
Index -= ENTITY_OFFSET;
|
|
|
|
return (
|
2020-09-14 14:00:32 +00:00
|
|
|
(Index >= ENTITY_SPAWN && Index <= ENTITY_LASER_O_FAST) ||
|
2022-02-17 23:51:02 +00:00
|
|
|
(Index >= ENTITY_PLASMAE && Index <= ENTITY_ARMOR_LASER) ||
|
2020-09-14 14:00:32 +00:00
|
|
|
(Index >= ENTITY_DRAGGER_WEAK && Index <= ENTITY_DRAGGER_STRONG_NW) ||
|
|
|
|
Index == ENTITY_DOOR);
|
2016-04-29 14:53:19 +00:00
|
|
|
}
|
2019-03-21 21:50:22 +00:00
|
|
|
|
|
|
|
bool IsRotatableTile(int Index)
|
|
|
|
{
|
|
|
|
return (
|
2020-09-14 14:00:32 +00:00
|
|
|
Index == TILE_STOP ||
|
|
|
|
Index == TILE_STOPS ||
|
|
|
|
Index == TILE_CP ||
|
|
|
|
Index == TILE_CP_F ||
|
|
|
|
Index == TILE_THROUGH_DIR ||
|
|
|
|
Index == TILE_ENTITIES_OFF_1 ||
|
|
|
|
Index == TILE_ENTITIES_OFF_2 ||
|
|
|
|
Index - ENTITY_OFFSET == ENTITY_CRAZY_SHOTGUN_EX ||
|
|
|
|
Index - ENTITY_OFFSET == ENTITY_CRAZY_SHOTGUN);
|
2019-03-21 21:50:22 +00:00
|
|
|
}
|
2020-09-08 13:11:32 +00:00
|
|
|
|
|
|
|
bool IsCreditsTile(int TileIndex)
|
|
|
|
{
|
2020-09-14 14:00:32 +00:00
|
|
|
return (
|
|
|
|
(TILE_CREDITS_1 == TileIndex) ||
|
|
|
|
(TILE_CREDITS_2 == TileIndex) ||
|
|
|
|
(TILE_CREDITS_3 == TileIndex) ||
|
|
|
|
(TILE_CREDITS_4 == TileIndex) ||
|
|
|
|
(TILE_CREDITS_5 == TileIndex) ||
|
|
|
|
(TILE_CREDITS_6 == TileIndex) ||
|
|
|
|
(TILE_CREDITS_7 == TileIndex) ||
|
|
|
|
(TILE_CREDITS_8 == TileIndex));
|
2020-09-08 13:11:32 +00:00
|
|
|
}
|