Flexible necromancy (#430)
* made IMPROVED_NECROMANCY bonus configurable * updated cloak of the undead king
This commit is contained in:
1 parent
e666b2740c
commit
1685641357
5 files changed
+91
-35
No files matched your search
@@ -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;
|
||||
|
||||
Reference in new issue
Block a user