mirror of
https://github.com/vcmi/vcmi.git
synced 2025-11-06 09:09:40 +02:00
Merge pull request #5659 from IvanSavenko/artifact_split
Reorganized artifact-related classes
This commit is contained in:
@@ -9,10 +9,11 @@
|
||||
*/
|
||||
#include "StdInc.h"
|
||||
|
||||
#include "../../lib/ArtifactUtils.h"
|
||||
#include "../../lib/AsyncRunner.h"
|
||||
#include "../../lib/UnlockGuard.h"
|
||||
#include "../../lib/StartInfo.h"
|
||||
#include "../../lib/entities/artifact/ArtifactUtils.h"
|
||||
#include "../../lib/entities/artifact/CArtifact.h"
|
||||
#include "../../lib/entities/building/CBuilding.h"
|
||||
#include "../../lib/mapObjects/MapObjects.h"
|
||||
#include "../../lib/mapObjects/ObjectTemplate.h"
|
||||
|
||||
@@ -14,6 +14,7 @@
|
||||
|
||||
#include "../../lib/UnlockGuard.h"
|
||||
#include "../../lib/CConfigHandler.h"
|
||||
#include "../../lib/entities/artifact/CArtifact.h"
|
||||
#include "../../lib/mapObjects/MapObjects.h"
|
||||
#include "../../lib/mapObjects/CQuest.h"
|
||||
#include "../../lib/mapping/CMapDefines.h"
|
||||
|
||||
@@ -11,6 +11,7 @@
|
||||
#include <limits>
|
||||
|
||||
#include "Nullkiller.h"
|
||||
#include "../../../lib/entities/artifact/CArtifact.h"
|
||||
#include "../../../lib/mapObjectConstructors/AObjectTypeHandler.h"
|
||||
#include "../../../lib/mapObjectConstructors/CObjectClassesHandler.h"
|
||||
#include "../../../lib/mapObjects/CGResource.h"
|
||||
@@ -268,7 +269,7 @@ uint64_t RewardEvaluator::getArmyReward(
|
||||
{
|
||||
for(auto artID : info.reward.artifacts)
|
||||
{
|
||||
const auto * art = dynamic_cast<const CArtifact *>(LIBRARY->artifacts()->getById(artID));
|
||||
const auto * art = artID.toArtifact();
|
||||
|
||||
rewardValue += evaluateArtifactArmyValue(art);
|
||||
}
|
||||
|
||||
@@ -11,6 +11,7 @@
|
||||
#include "AbstractGoal.h"
|
||||
#include "../AIGateway.h"
|
||||
#include "../../../lib/constants/StringConstants.h"
|
||||
#include "../../../lib/entities/artifact/CArtifact.h"
|
||||
|
||||
namespace NKAI
|
||||
{
|
||||
@@ -55,7 +56,7 @@ std::string AbstractGoal::toString() const
|
||||
desc = "GATHER TROOPS";
|
||||
break;
|
||||
case GET_ART_TYPE:
|
||||
desc = "GET ARTIFACT OF TYPE " + LIBRARY->artifacts()->getByIndex(aid)->getNameTranslated();
|
||||
desc = "GET ARTIFACT OF TYPE " + ArtifactID(aid).toEntity(LIBRARY)->getNameTranslated();
|
||||
break;
|
||||
case DIG_AT_TILE:
|
||||
desc = "DIG AT TILE " + tile.toString();
|
||||
|
||||
@@ -15,6 +15,7 @@
|
||||
|
||||
#include "../../lib/UnlockGuard.h"
|
||||
#include "../../lib/CConfigHandler.h"
|
||||
#include "../../lib/entities/artifact/CArtifact.h"
|
||||
#include "../../lib/mapObjects/CGTownInstance.h"
|
||||
#include "../../lib/mapObjects/CQuest.h"
|
||||
#include "../../lib/mapping/CMapDefines.h"
|
||||
|
||||
@@ -15,6 +15,7 @@
|
||||
#include "../ResourceManager.h"
|
||||
#include "../BuildingManager.h"
|
||||
#include "../../../lib/constants/StringConstants.h"
|
||||
#include "../../../lib/entities/artifact/CArtifact.h"
|
||||
|
||||
using namespace Goals;
|
||||
|
||||
@@ -85,7 +86,7 @@ std::string AbstractGoal::name() const //TODO: virtualize
|
||||
}
|
||||
break;
|
||||
case GET_ART_TYPE:
|
||||
desc = "GET ARTIFACT OF TYPE " + LIBRARY->artifacts()->getByIndex(aid)->getNameTranslated();
|
||||
desc = "GET ARTIFACT OF TYPE " + ArtifactID(aid).toEntity(LIBRARY)->getNameTranslated();
|
||||
break;
|
||||
case VISIT_TILE:
|
||||
desc = "VISIT TILE " + tile.toString();
|
||||
|
||||
@@ -12,6 +12,7 @@
|
||||
#include "../../lib/GameConstants.h"
|
||||
#include "../../lib/GameLibrary.h"
|
||||
#include "../../lib/CCreatureHandler.h"
|
||||
#include "../../lib/entities/artifact/CArtifact.h"
|
||||
#include "../../lib/mapObjects/CompoundMapObjectID.h"
|
||||
#include "../../lib/mapObjectConstructors/AObjectTypeHandler.h"
|
||||
#include "../../lib/mapObjects/CGHeroInstance.h"
|
||||
@@ -94,15 +95,15 @@ std::optional<int> MapObjectsEvaluator::getObjectValue(const CGObjectInstance *
|
||||
auto artifactObject = dynamic_cast<const CGArtifact *>(obj);
|
||||
switch(artifactObject->getArtifactInstance()->getType()->aClass)
|
||||
{
|
||||
case CArtifact::EartClass::ART_TREASURE:
|
||||
case EArtifactClass::ART_TREASURE:
|
||||
return 2000;
|
||||
case CArtifact::EartClass::ART_MINOR:
|
||||
case EArtifactClass::ART_MINOR:
|
||||
return 5000;
|
||||
case CArtifact::EartClass::ART_MAJOR:
|
||||
case EArtifactClass::ART_MAJOR:
|
||||
return 10000;
|
||||
case CArtifact::EartClass::ART_RELIC:
|
||||
case EArtifactClass::ART_RELIC:
|
||||
return 20000;
|
||||
case CArtifact::EartClass::ART_SPECIAL:
|
||||
case EArtifactClass::ART_SPECIAL:
|
||||
return 20000;
|
||||
default:
|
||||
return 0; //invalid artifact class
|
||||
|
||||
@@ -15,7 +15,6 @@
|
||||
#include "Goals/Goals.h"
|
||||
#include "Goals/CompleteQuest.h"
|
||||
|
||||
#include "../../lib/ArtifactUtils.h"
|
||||
#include "../../lib/AsyncRunner.h"
|
||||
#include "../../lib/CThreadHelper.h"
|
||||
#include "../../lib/UnlockGuard.h"
|
||||
@@ -29,6 +28,8 @@
|
||||
#include "../../lib/bonuses/Limiters.h"
|
||||
#include "../../lib/bonuses/Updaters.h"
|
||||
#include "../../lib/bonuses/Propagators.h"
|
||||
#include "../../lib/entities/artifact/ArtifactUtils.h"
|
||||
#include "../../lib/entities/artifact/CArtifact.h"
|
||||
#include "../../lib/entities/building/CBuilding.h"
|
||||
#include "../../lib/mapObjects/CQuest.h"
|
||||
#include "../../lib/networkPacks/PacksForClient.h"
|
||||
|
||||
Reference in New Issue
Block a user