1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-11-25 22:42:04 +02:00

Flexible necromancy (#430)

* made IMPROVED_NECROMANCY bonus configurable
* updated cloak of the undead king
This commit is contained in:
Henning Koehler
2018-03-17 21:46:16 +13:00
committed by ArseniyShestakov
parent e666b2740c
commit 1685641357
5 changed files with 91 additions and 35 deletions

View File

@@ -13,6 +13,8 @@
#include "StringConstants.h"
#include "JsonNode.h"
#include "serializer/JsonSerializeFormat.h"
#include "VCMI_Lib.h"
#include "mapObjects/CObjectHandler.h"
Res::ResourceSet::ResourceSet()
{
@@ -86,6 +88,14 @@ bool Res::canAfford(const ResourceSet &res, const ResourceSet &price)
return true;
}
TResourceCap Res::ResourceSet::marketValue() const
{
TResourceCap total = 0;
for(int i = 0; i < GameConstants::RESOURCE_QUANTITY; i++)
total += static_cast<TResourceCap>(VLC->objh->resVals[i]) * static_cast<TResourceCap>(operator[](i));
return total;
}
std::string Res::ResourceSet::toString() const
{
std::ostringstream out;