2023-04-23 10:12:53 +02:00
|
|
|
/*
|
|
|
|
* QuestArtifactPlacer, part of VCMI engine
|
|
|
|
*
|
|
|
|
* 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-20 10:17:37 +02:00
|
|
|
#include "../Zone.h"
|
|
|
|
#include "../Functions.h"
|
|
|
|
#include "../../mapObjects/ObjectTemplate.h"
|
2023-04-23 10:12:53 +02:00
|
|
|
|
|
|
|
VCMI_LIB_NAMESPACE_BEGIN
|
|
|
|
|
|
|
|
class QuestArtifactPlacer : public Modificator
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
MODIFICATOR(QuestArtifactPlacer);
|
|
|
|
|
|
|
|
void process() override;
|
|
|
|
void init() override;
|
|
|
|
|
|
|
|
void addQuestArtZone(std::shared_ptr<Zone> otherZone);
|
|
|
|
void findZonesForQuestArts();
|
|
|
|
|
|
|
|
void addQuestArtifact(const ArtifactID& id);
|
2024-01-16 18:15:35 +02:00
|
|
|
void removeQuestArtifact(const ArtifactID& id);
|
2023-04-23 10:12:53 +02:00
|
|
|
void rememberPotentialArtifactToReplace(CGObjectInstance* obj);
|
2024-06-24 20:06:50 +02:00
|
|
|
CGObjectInstance * drawObjectToReplace();
|
2023-04-23 10:12:53 +02:00
|
|
|
std::vector<CGObjectInstance*> getPossibleArtifactsToReplace() const;
|
2024-06-01 17:28:17 +02:00
|
|
|
void placeQuestArtifacts(vstd::RNG & rand);
|
2023-04-23 10:12:53 +02:00
|
|
|
void dropReplacedArtifact(CGObjectInstance* obj);
|
|
|
|
|
2023-04-29 11:46:03 +02:00
|
|
|
size_t getMaxQuestArtifactCount() const;
|
2024-01-16 18:15:35 +02:00
|
|
|
[[nodiscard]] ArtifactID drawRandomArtifact();
|
|
|
|
void addRandomArtifact(const ArtifactID & artid);
|
2023-04-29 11:46:03 +02:00
|
|
|
|
2023-04-23 10:12:53 +02:00
|
|
|
protected:
|
|
|
|
|
|
|
|
std::vector<std::shared_ptr<Zone>> questArtZones; //artifacts required for Seer Huts will be placed here - or not if null
|
|
|
|
std::vector<ArtifactID> questArtifactsToPlace;
|
|
|
|
std::vector<CGObjectInstance*> artifactsToReplace; //Common artifacts which may be replaced by quest artifacts from other zones
|
2023-04-29 11:46:03 +02:00
|
|
|
|
|
|
|
size_t maxQuestArtifacts;
|
|
|
|
std::vector<ArtifactID> questArtifacts;
|
2023-04-23 10:12:53 +02:00
|
|
|
};
|
|
|
|
|
2024-06-01 17:28:17 +02:00
|
|
|
VCMI_LIB_NAMESPACE_END
|