2023-05-17 15:52:16 +02:00
|
|
|
/*
|
2023-05-17 16:05:09 +02:00
|
|
|
* ArtifactUtils.h, part of VCMI engine
|
2023-05-17 15:52:16 +02:00
|
|
|
*
|
|
|
|
* Authors: listed in file AUTHORS in main folder
|
|
|
|
*
|
|
|
|
* License: GNU General Public License v2.0 or later
|
|
|
|
* Full text of license available in license.txt file, in main folder
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
#pragma once
|
|
|
|
|
2023-05-17 16:05:09 +02:00
|
|
|
#include "StdInc.h"
|
|
|
|
|
2023-05-17 15:52:16 +02:00
|
|
|
#include "GameConstants.h"
|
|
|
|
|
|
|
|
VCMI_LIB_NAMESPACE_BEGIN
|
|
|
|
|
|
|
|
class CArtHandler;
|
|
|
|
class CArtifact;
|
|
|
|
class CGHeroInstance;
|
|
|
|
class CArtifactSet;
|
|
|
|
class CArtifactInstance;
|
|
|
|
struct ArtSlotInfo;
|
|
|
|
class CMap;
|
|
|
|
|
|
|
|
namespace ArtifactUtils
|
|
|
|
{
|
|
|
|
// Calculates where an artifact gets placed when it gets transferred from one hero to another.
|
|
|
|
DLL_LINKAGE ArtifactPosition getArtAnyPosition(const CArtifactSet * target, const ArtifactID & aid);
|
|
|
|
DLL_LINKAGE ArtifactPosition getArtBackpackPosition(const CArtifactSet * target, const ArtifactID & aid);
|
|
|
|
// TODO: Make this constexpr when the toolset is upgraded
|
2023-08-19 23:22:31 +02:00
|
|
|
DLL_LINKAGE const std::vector<ArtifactPosition> & unmovableSlots();
|
2024-04-19 16:14:41 +02:00
|
|
|
DLL_LINKAGE const std::vector<ArtifactPosition> & commonWornSlots();
|
2023-07-24 18:09:17 +02:00
|
|
|
DLL_LINKAGE const std::vector<ArtifactPosition> & allWornSlots();
|
|
|
|
DLL_LINKAGE const std::vector<ArtifactPosition> & commanderSlots();
|
2023-05-17 15:52:16 +02:00
|
|
|
DLL_LINKAGE bool isArtRemovable(const std::pair<ArtifactPosition, ArtSlotInfo> & slot);
|
|
|
|
DLL_LINKAGE bool checkSpellbookIsNeeded(const CGHeroInstance * heroPtr, const ArtifactID & artID, const ArtifactPosition & slot);
|
|
|
|
DLL_LINKAGE bool isSlotBackpack(const ArtifactPosition & slot);
|
|
|
|
DLL_LINKAGE bool isSlotEquipment(const ArtifactPosition & slot);
|
|
|
|
DLL_LINKAGE bool isBackpackFreeSlots(const CArtifactSet * target, const size_t reqSlots = 1);
|
2023-09-12 17:30:48 +02:00
|
|
|
DLL_LINKAGE std::vector<const CArtifact*> assemblyPossibilities(const CArtifactSet * artSet, const ArtifactID & aid);
|
2023-05-17 15:52:16 +02:00
|
|
|
DLL_LINKAGE CArtifactInstance * createScroll(const SpellID & sid);
|
2023-12-31 23:43:35 +02:00
|
|
|
DLL_LINKAGE CArtifactInstance * createNewArtifactInstance(const CArtifact * art);
|
2023-05-17 15:52:16 +02:00
|
|
|
DLL_LINKAGE CArtifactInstance * createNewArtifactInstance(const ArtifactID & aid);
|
2023-08-19 19:48:28 +02:00
|
|
|
DLL_LINKAGE CArtifactInstance * createArtifact(CMap * map, const ArtifactID & aid, SpellID spellID = SpellID::NONE);
|
2023-06-30 20:02:57 +02:00
|
|
|
DLL_LINKAGE void insertScrrollSpellName(std::string & description, const SpellID & sid);
|
2023-05-17 15:52:16 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
VCMI_LIB_NAMESPACE_END
|