Use Rune Bomb or Cathedral Map to open Hive or Crypt

This commit is contained in:
staphen 2021-10-12 01:43:19 -04:00 committed by Anders Jenbo
commit ab13fba13f
4 changed files with 70 additions and 29 deletions

View file

@ -30,6 +30,7 @@
#include "options.h"
#include "player.h"
#include "stores.h"
#include "town.h"
#include "utils/language.h"
#include "utils/math.h"
#include "utils/stdcompat/algorithm.hpp"
@ -4421,6 +4422,30 @@ void UseItem(int p, item_misc_id mid, spell_id spl)
}
}
bool UseItemOpensHive(const Item &item, Point position)
{
if (item.IDidx != IDI_RUNEBOMB)
return false;
for (auto dir : PathDirs) {
Point adjacentPosition = position + dir;
if (OpensHive(adjacentPosition))
return true;
}
return false;
}
bool UseItemOpensCrypt(const Item &item, Point position)
{
if (item.IDidx != IDI_MAPOFDOOM)
return false;
for (auto dir : PathDirs) {
Point adjacentPosition = position + dir;
if (OpensGrave(adjacentPosition))
return true;
}
return false;
}
void SpawnSmith(int lvl)
{
constexpr int PinnedItemCount = 0;