2017-07-20 06:08:49 +02:00
|
|
|
/*
|
|
|
|
* Timed.cpp, 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
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
#include "StdInc.h"
|
|
|
|
|
|
|
|
#include "Timed.h"
|
|
|
|
#include "Registry.h"
|
|
|
|
#include "../ISpellMechanics.h"
|
|
|
|
|
|
|
|
#include "../../battle/IBattleState.h"
|
2023-08-31 17:45:52 +02:00
|
|
|
#include "../../battle/CBattleInfoCallback.h"
|
2017-07-20 06:08:49 +02:00
|
|
|
#include "../../battle/Unit.h"
|
2024-02-14 15:48:06 +02:00
|
|
|
#include "../../json/JsonBonus.h"
|
2023-10-23 12:59:15 +02:00
|
|
|
#include "../../mapObjects/CGHeroInstance.h"
|
|
|
|
#include "../../networkPacks/PacksForClientBattle.h"
|
2023-10-24 00:27:52 +02:00
|
|
|
#include "../../networkPacks/SetStackEffect.h"
|
2017-07-20 06:08:49 +02:00
|
|
|
#include "../../serializer/JsonSerializeFormat.h"
|
|
|
|
|
2022-07-26 15:07:42 +02:00
|
|
|
VCMI_LIB_NAMESPACE_BEGIN
|
|
|
|
|
2017-07-20 06:08:49 +02:00
|
|
|
namespace spells
|
|
|
|
{
|
|
|
|
namespace effects
|
|
|
|
{
|
|
|
|
|
2023-02-07 00:40:01 +02:00
|
|
|
static void describeEffect(std::vector<MetaString> & log, const Mechanics * m, const std::vector<Bonus> & bonuses, const battle::Unit * target)
|
2017-07-20 06:08:49 +02:00
|
|
|
{
|
2023-02-07 00:40:01 +02:00
|
|
|
auto addLogLine = [&](const int32_t baseTextID, const boost::logic::tribool & plural)
|
|
|
|
{
|
|
|
|
MetaString line;
|
2023-06-18 11:18:25 +02:00
|
|
|
target->addText(line, EMetaText::GENERAL_TXT, baseTextID, plural);
|
2023-02-07 00:40:01 +02:00
|
|
|
target->addNameReplacement(line, plural);
|
|
|
|
log.push_back(std::move(line));
|
|
|
|
};
|
|
|
|
|
|
|
|
if(m->getSpellIndex() == SpellID::DISEASE)
|
|
|
|
{
|
|
|
|
addLogLine(553, boost::logic::indeterminate);
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
for(const auto & bonus : bonuses)
|
|
|
|
{
|
|
|
|
switch(bonus.type)
|
|
|
|
{
|
2023-05-01 00:20:01 +02:00
|
|
|
case BonusType::NOT_ACTIVE:
|
2023-02-07 00:40:01 +02:00
|
|
|
{
|
2023-10-05 15:13:52 +02:00
|
|
|
switch(bonus.subtype.as<SpellID>().toEnum())
|
2023-02-07 00:40:01 +02:00
|
|
|
{
|
|
|
|
case SpellID::STONE_GAZE:
|
|
|
|
addLogLine(558, boost::logic::indeterminate);
|
|
|
|
return;
|
|
|
|
case SpellID::PARALYZE:
|
|
|
|
addLogLine(563, boost::logic::indeterminate);
|
|
|
|
return;
|
|
|
|
default:
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
break;
|
2023-05-01 00:20:01 +02:00
|
|
|
case BonusType::POISON:
|
2023-02-07 00:40:01 +02:00
|
|
|
addLogLine(561, boost::logic::indeterminate);
|
|
|
|
return;
|
2023-05-01 00:20:01 +02:00
|
|
|
case BonusType::BIND_EFFECT:
|
2023-02-07 00:40:01 +02:00
|
|
|
addLogLine(-560, true);
|
|
|
|
return;
|
2023-05-01 00:20:01 +02:00
|
|
|
case BonusType::STACK_HEALTH:
|
2023-02-07 00:40:01 +02:00
|
|
|
{
|
|
|
|
if(bonus.val < 0)
|
|
|
|
{
|
2023-05-01 00:20:01 +02:00
|
|
|
BonusList unitHealth = *target->getBonuses(Selector::type()(BonusType::STACK_HEALTH));
|
2017-07-20 06:08:49 +02:00
|
|
|
|
2023-02-07 00:40:01 +02:00
|
|
|
auto oldHealth = unitHealth.totalValue();
|
|
|
|
unitHealth.push_back(std::make_shared<Bonus>(bonus));
|
|
|
|
auto newHealth = unitHealth.totalValue();
|
|
|
|
|
|
|
|
//"The %s shrivel with age, and lose %d hit points."
|
|
|
|
MetaString line;
|
2023-06-18 11:18:25 +02:00
|
|
|
target->addText(line, EMetaText::GENERAL_TXT, 551);
|
2023-02-07 00:40:01 +02:00
|
|
|
target->addNameReplacement(line);
|
|
|
|
|
2023-06-18 11:18:25 +02:00
|
|
|
line.replaceNumber(oldHealth - newHealth);
|
2023-02-07 00:40:01 +02:00
|
|
|
log.push_back(std::move(line));
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
default:
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2017-07-20 06:08:49 +02:00
|
|
|
|
Entities redesign and a few ERM features
* Made most Handlers derived from CHandlerBase and moved service API there.
* Declared existing Entity APIs.
* Added basic script context caching
* Started Lua script module
* Started Lua spell effect API
* Started script state persistence
* Started battle info callback binding
* CommitPackage removed
* Extracted spells::Caster to own header; Expanded Spell API.
* implemented !!MC:S, !!FU:E, !!FU:P, !!MA, !!VR:H, !!VR:C
* !!BU:C, !!BU:E, !!BU:G, !!BU:M implemented
* Allow use of "MC:S@varName@" to declare normal variable (technically v-variable with string key)
* Re-enabled VERM macros.
* !?GM0 added
* !?TM implemented
* Added !!MF:N
* Started !?OB, !!BM, !!HE, !!OW, !!UN
* Added basic support of w-variables
* Added support for ERM indirect variables
* Made !?FU regular trigger
* !!re (ERA loop receiver) implemented
* Fixed ERM receivers with zero args.
2018-03-17 16:58:30 +02:00
|
|
|
void Timed::apply(ServerCallback * server, const Mechanics * m, const EffectTarget & target) const
|
2017-07-20 06:08:49 +02:00
|
|
|
{
|
Entities redesign and a few ERM features
* Made most Handlers derived from CHandlerBase and moved service API there.
* Declared existing Entity APIs.
* Added basic script context caching
* Started Lua script module
* Started Lua spell effect API
* Started script state persistence
* Started battle info callback binding
* CommitPackage removed
* Extracted spells::Caster to own header; Expanded Spell API.
* implemented !!MC:S, !!FU:E, !!FU:P, !!MA, !!VR:H, !!VR:C
* !!BU:C, !!BU:E, !!BU:G, !!BU:M implemented
* Allow use of "MC:S@varName@" to declare normal variable (technically v-variable with string key)
* Re-enabled VERM macros.
* !?GM0 added
* !?TM implemented
* Added !!MF:N
* Started !?OB, !!BM, !!HE, !!OW, !!UN
* Added basic support of w-variables
* Added support for ERM indirect variables
* Made !?FU regular trigger
* !!re (ERA loop receiver) implemented
* Fixed ERM receivers with zero args.
2018-03-17 16:58:30 +02:00
|
|
|
const bool describe = server->describeChanges();
|
|
|
|
int32_t duration = m->getEffectDuration();
|
|
|
|
|
|
|
|
std::vector<Bonus> converted;
|
|
|
|
convertBonus(m, duration, converted);
|
|
|
|
|
|
|
|
std::shared_ptr<const Bonus> peculiarBonus = nullptr;
|
|
|
|
std::shared_ptr<const Bonus> addedValueBonus = nullptr;
|
|
|
|
std::shared_ptr<const Bonus> fixedValueBonus = nullptr;
|
|
|
|
|
2023-02-07 00:40:01 +02:00
|
|
|
const auto *casterHero = dynamic_cast<const CGHeroInstance *>(m->caster);
|
Entities redesign and a few ERM features
* Made most Handlers derived from CHandlerBase and moved service API there.
* Declared existing Entity APIs.
* Added basic script context caching
* Started Lua script module
* Started Lua spell effect API
* Started script state persistence
* Started battle info callback binding
* CommitPackage removed
* Extracted spells::Caster to own header; Expanded Spell API.
* implemented !!MC:S, !!FU:E, !!FU:P, !!MA, !!VR:H, !!VR:C
* !!BU:C, !!BU:E, !!BU:G, !!BU:M implemented
* Allow use of "MC:S@varName@" to declare normal variable (technically v-variable with string key)
* Re-enabled VERM macros.
* !?GM0 added
* !?TM implemented
* Added !!MF:N
* Started !?OB, !!BM, !!HE, !!OW, !!UN
* Added basic support of w-variables
* Added support for ERM indirect variables
* Made !?FU regular trigger
* !!re (ERA loop receiver) implemented
* Fixed ERM receivers with zero args.
2018-03-17 16:58:30 +02:00
|
|
|
if(casterHero)
|
|
|
|
{
|
2024-01-16 18:14:40 +02:00
|
|
|
peculiarBonus = casterHero->getFirstBonus(Selector::typeSubtype(BonusType::SPECIAL_PECULIAR_ENCHANT, BonusSubtypeID(m->getSpellId())));
|
|
|
|
addedValueBonus = casterHero->getFirstBonus(Selector::typeSubtype(BonusType::SPECIAL_ADD_VALUE_ENCHANT, BonusSubtypeID(m->getSpellId())));
|
|
|
|
fixedValueBonus = casterHero->getFirstBonus(Selector::typeSubtype(BonusType::SPECIAL_FIXED_VALUE_ENCHANT, BonusSubtypeID(m->getSpellId())));
|
Entities redesign and a few ERM features
* Made most Handlers derived from CHandlerBase and moved service API there.
* Declared existing Entity APIs.
* Added basic script context caching
* Started Lua script module
* Started Lua spell effect API
* Started script state persistence
* Started battle info callback binding
* CommitPackage removed
* Extracted spells::Caster to own header; Expanded Spell API.
* implemented !!MC:S, !!FU:E, !!FU:P, !!MA, !!VR:H, !!VR:C
* !!BU:C, !!BU:E, !!BU:G, !!BU:M implemented
* Allow use of "MC:S@varName@" to declare normal variable (technically v-variable with string key)
* Re-enabled VERM macros.
* !?GM0 added
* !?TM implemented
* Added !!MF:N
* Started !?OB, !!BM, !!HE, !!OW, !!UN
* Added basic support of w-variables
* Added support for ERM indirect variables
* Made !?FU regular trigger
* !!re (ERA loop receiver) implemented
* Fixed ERM receivers with zero args.
2018-03-17 16:58:30 +02:00
|
|
|
}
|
|
|
|
//TODO: does hero specialty should affects his stack casting spells?
|
|
|
|
|
2017-07-20 06:08:49 +02:00
|
|
|
SetStackEffect sse;
|
Entities redesign and a few ERM features
* Made most Handlers derived from CHandlerBase and moved service API there.
* Declared existing Entity APIs.
* Added basic script context caching
* Started Lua script module
* Started Lua spell effect API
* Started script state persistence
* Started battle info callback binding
* CommitPackage removed
* Extracted spells::Caster to own header; Expanded Spell API.
* implemented !!MC:S, !!FU:E, !!FU:P, !!MA, !!VR:H, !!VR:C
* !!BU:C, !!BU:E, !!BU:G, !!BU:M implemented
* Allow use of "MC:S@varName@" to declare normal variable (technically v-variable with string key)
* Re-enabled VERM macros.
* !?GM0 added
* !?TM implemented
* Added !!MF:N
* Started !?OB, !!BM, !!HE, !!OW, !!UN
* Added basic support of w-variables
* Added support for ERM indirect variables
* Made !?FU regular trigger
* !!re (ERA loop receiver) implemented
* Fixed ERM receivers with zero args.
2018-03-17 16:58:30 +02:00
|
|
|
BattleLogMessage blm;
|
2023-08-31 17:45:52 +02:00
|
|
|
blm.battleID = m->battle()->getBattle()->getBattleID();
|
|
|
|
sse.battleID = m->battle()->getBattle()->getBattleID();
|
Entities redesign and a few ERM features
* Made most Handlers derived from CHandlerBase and moved service API there.
* Declared existing Entity APIs.
* Added basic script context caching
* Started Lua script module
* Started Lua spell effect API
* Started script state persistence
* Started battle info callback binding
* CommitPackage removed
* Extracted spells::Caster to own header; Expanded Spell API.
* implemented !!MC:S, !!FU:E, !!FU:P, !!MA, !!VR:H, !!VR:C
* !!BU:C, !!BU:E, !!BU:G, !!BU:M implemented
* Allow use of "MC:S@varName@" to declare normal variable (technically v-variable with string key)
* Re-enabled VERM macros.
* !?GM0 added
* !?TM implemented
* Added !!MF:N
* Started !?OB, !!BM, !!HE, !!OW, !!UN
* Added basic support of w-variables
* Added support for ERM indirect variables
* Made !?FU regular trigger
* !!re (ERA loop receiver) implemented
* Fixed ERM receivers with zero args.
2018-03-17 16:58:30 +02:00
|
|
|
|
2023-02-07 00:40:01 +02:00
|
|
|
for(const auto & t : target)
|
Entities redesign and a few ERM features
* Made most Handlers derived from CHandlerBase and moved service API there.
* Declared existing Entity APIs.
* Added basic script context caching
* Started Lua script module
* Started Lua spell effect API
* Started script state persistence
* Started battle info callback binding
* CommitPackage removed
* Extracted spells::Caster to own header; Expanded Spell API.
* implemented !!MC:S, !!FU:E, !!FU:P, !!MA, !!VR:H, !!VR:C
* !!BU:C, !!BU:E, !!BU:G, !!BU:M implemented
* Allow use of "MC:S@varName@" to declare normal variable (technically v-variable with string key)
* Re-enabled VERM macros.
* !?GM0 added
* !?TM implemented
* Added !!MF:N
* Started !?OB, !!BM, !!HE, !!OW, !!UN
* Added basic support of w-variables
* Added support for ERM indirect variables
* Made !?FU regular trigger
* !!re (ERA loop receiver) implemented
* Fixed ERM receivers with zero args.
2018-03-17 16:58:30 +02:00
|
|
|
{
|
|
|
|
std::vector<Bonus> buffer;
|
|
|
|
std::copy(converted.begin(), converted.end(), std::back_inserter(buffer));
|
|
|
|
|
|
|
|
const battle::Unit * affected = t.unitValue;
|
|
|
|
if(!affected)
|
|
|
|
{
|
|
|
|
logGlobal->error("[Internal error] Invalid target for timed effect");
|
|
|
|
continue;
|
|
|
|
}
|
|
|
|
|
|
|
|
if(!affected->alive())
|
|
|
|
continue;
|
|
|
|
|
|
|
|
if(describe)
|
|
|
|
describeEffect(blm.lines, m, converted, affected);
|
|
|
|
|
|
|
|
|
|
|
|
//Apply hero specials - peculiar enchants
|
|
|
|
const auto tier = std::max(affected->creatureLevel(), 1); //don't divide by 0 for certain creatures (commanders, war machines)
|
|
|
|
if(peculiarBonus)
|
|
|
|
{
|
|
|
|
si32 power = 0;
|
|
|
|
switch (peculiarBonus->additionalInfo[0])
|
|
|
|
{
|
|
|
|
case 0: //normal
|
|
|
|
switch (tier)
|
|
|
|
{
|
|
|
|
case 1:
|
|
|
|
case 2:
|
|
|
|
power = 3;
|
|
|
|
break;
|
|
|
|
case 3:
|
|
|
|
case 4:
|
|
|
|
power = 2;
|
|
|
|
break;
|
|
|
|
case 5:
|
|
|
|
case 6:
|
|
|
|
power = 1;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
case 1:
|
|
|
|
//Coronius style specialty bonus.
|
|
|
|
//Please note that actual Coronius isnt here, because Slayer is a spell that doesnt affect monster stats and is used only in calculateDmgRange
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
if(m->isNegativeSpell())
|
|
|
|
{
|
|
|
|
//negative spells like weakness are defined in json with negative numbers, so we need do same here
|
|
|
|
power = -1 * power;
|
|
|
|
}
|
|
|
|
for(Bonus& b : buffer)
|
|
|
|
{
|
|
|
|
b.val += power;
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
if(addedValueBonus)
|
|
|
|
{
|
|
|
|
for(Bonus & b : buffer)
|
|
|
|
{
|
|
|
|
b.val += addedValueBonus->additionalInfo[0];
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if(fixedValueBonus)
|
|
|
|
{
|
|
|
|
for(Bonus & b : buffer)
|
|
|
|
{
|
|
|
|
b.val = fixedValueBonus->additionalInfo[0];
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
if(cumulative)
|
2023-02-07 00:40:01 +02:00
|
|
|
sse.toAdd.emplace_back(affected->unitId(), buffer);
|
Entities redesign and a few ERM features
* Made most Handlers derived from CHandlerBase and moved service API there.
* Declared existing Entity APIs.
* Added basic script context caching
* Started Lua script module
* Started Lua spell effect API
* Started script state persistence
* Started battle info callback binding
* CommitPackage removed
* Extracted spells::Caster to own header; Expanded Spell API.
* implemented !!MC:S, !!FU:E, !!FU:P, !!MA, !!VR:H, !!VR:C
* !!BU:C, !!BU:E, !!BU:G, !!BU:M implemented
* Allow use of "MC:S@varName@" to declare normal variable (technically v-variable with string key)
* Re-enabled VERM macros.
* !?GM0 added
* !?TM implemented
* Added !!MF:N
* Started !?OB, !!BM, !!HE, !!OW, !!UN
* Added basic support of w-variables
* Added support for ERM indirect variables
* Made !?FU regular trigger
* !!re (ERA loop receiver) implemented
* Fixed ERM receivers with zero args.
2018-03-17 16:58:30 +02:00
|
|
|
else
|
2023-02-07 00:40:01 +02:00
|
|
|
sse.toUpdate.emplace_back(affected->unitId(), buffer);
|
Entities redesign and a few ERM features
* Made most Handlers derived from CHandlerBase and moved service API there.
* Declared existing Entity APIs.
* Added basic script context caching
* Started Lua script module
* Started Lua spell effect API
* Started script state persistence
* Started battle info callback binding
* CommitPackage removed
* Extracted spells::Caster to own header; Expanded Spell API.
* implemented !!MC:S, !!FU:E, !!FU:P, !!MA, !!VR:H, !!VR:C
* !!BU:C, !!BU:E, !!BU:G, !!BU:M implemented
* Allow use of "MC:S@varName@" to declare normal variable (technically v-variable with string key)
* Re-enabled VERM macros.
* !?GM0 added
* !?TM implemented
* Added !!MF:N
* Started !?OB, !!BM, !!HE, !!OW, !!UN
* Added basic support of w-variables
* Added support for ERM indirect variables
* Made !?FU regular trigger
* !!re (ERA loop receiver) implemented
* Fixed ERM receivers with zero args.
2018-03-17 16:58:30 +02:00
|
|
|
}
|
2017-07-20 06:08:49 +02:00
|
|
|
|
|
|
|
if(!(sse.toAdd.empty() && sse.toUpdate.empty()))
|
2024-10-04 20:59:51 +02:00
|
|
|
server->apply(sse);
|
Entities redesign and a few ERM features
* Made most Handlers derived from CHandlerBase and moved service API there.
* Declared existing Entity APIs.
* Added basic script context caching
* Started Lua script module
* Started Lua spell effect API
* Started script state persistence
* Started battle info callback binding
* CommitPackage removed
* Extracted spells::Caster to own header; Expanded Spell API.
* implemented !!MC:S, !!FU:E, !!FU:P, !!MA, !!VR:H, !!VR:C
* !!BU:C, !!BU:E, !!BU:G, !!BU:M implemented
* Allow use of "MC:S@varName@" to declare normal variable (technically v-variable with string key)
* Re-enabled VERM macros.
* !?GM0 added
* !?TM implemented
* Added !!MF:N
* Started !?OB, !!BM, !!HE, !!OW, !!UN
* Added basic support of w-variables
* Added support for ERM indirect variables
* Made !?FU regular trigger
* !!re (ERA loop receiver) implemented
* Fixed ERM receivers with zero args.
2018-03-17 16:58:30 +02:00
|
|
|
|
|
|
|
if(describe && !blm.lines.empty())
|
2024-10-04 20:59:51 +02:00
|
|
|
server->apply(blm);
|
2017-07-20 06:08:49 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
void Timed::convertBonus(const Mechanics * m, int32_t & duration, std::vector<Bonus> & converted) const
|
|
|
|
{
|
|
|
|
int32_t maxDuration = 0;
|
|
|
|
|
2023-02-07 00:40:01 +02:00
|
|
|
for(const auto & b : bonus)
|
2017-07-20 06:08:49 +02:00
|
|
|
{
|
|
|
|
Bonus nb(*b);
|
|
|
|
|
|
|
|
//use configured duration if present
|
|
|
|
if(nb.turnsRemain == 0)
|
|
|
|
nb.turnsRemain = duration;
|
|
|
|
vstd::amax(maxDuration, nb.turnsRemain);
|
|
|
|
|
2023-10-21 13:50:42 +02:00
|
|
|
nb.sid = BonusSourceID(m->getSpellId()); //for all
|
2023-05-01 00:20:01 +02:00
|
|
|
nb.source = BonusSource::SPELL_EFFECT;//for all
|
2017-07-20 06:08:49 +02:00
|
|
|
|
|
|
|
//fix to original config: shield should display damage reduction
|
2023-10-10 17:05:18 +02:00
|
|
|
if((nb.sid.as<SpellID>() == SpellID::SHIELD || nb.sid.as<SpellID>() == SpellID::AIR_SHIELD) && (nb.type == BonusType::GENERAL_DAMAGE_REDUCTION))
|
2017-07-20 06:08:49 +02:00
|
|
|
nb.val = 100 - nb.val;
|
|
|
|
//we need to know who cast Bind
|
2023-10-10 17:05:18 +02:00
|
|
|
else if(nb.sid.as<SpellID>() == SpellID::BIND && nb.type == BonusType::BIND_EFFECT && m->caster->getHeroCaster() == nullptr)
|
2018-03-04 10:13:07 +02:00
|
|
|
nb.additionalInfo = m->caster->getCasterUnitId();
|
2017-07-20 06:08:49 +02:00
|
|
|
|
|
|
|
converted.push_back(nb);
|
|
|
|
}
|
|
|
|
|
|
|
|
//if all spell effects have special duration, use it later for special bonuses
|
|
|
|
duration = maxDuration;
|
|
|
|
}
|
|
|
|
|
|
|
|
void Timed::serializeJsonUnitEffect(JsonSerializeFormat & handler)
|
|
|
|
{
|
|
|
|
assert(!handler.saving);
|
|
|
|
handler.serializeBool("cumulative", cumulative, false);
|
|
|
|
{
|
|
|
|
auto guard = handler.enterStruct("bonus");
|
|
|
|
const JsonNode & data = handler.getCurrent();
|
|
|
|
|
|
|
|
for(const auto & p : data.Struct())
|
|
|
|
{
|
|
|
|
//TODO: support JsonSerializeFormat in Bonus
|
|
|
|
auto guard = handler.enterStruct(p.first);
|
|
|
|
const JsonNode & bonusNode = handler.getCurrent();
|
|
|
|
auto b = JsonUtils::parseBonus(bonusNode);
|
2023-07-15 12:05:27 +02:00
|
|
|
if (b)
|
|
|
|
bonus.push_back(b);
|
|
|
|
else
|
|
|
|
logMod->error("Failed to parse bonus '%s'!", p.first);
|
2017-07-20 06:08:49 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
2022-07-26 15:07:42 +02:00
|
|
|
|
|
|
|
VCMI_LIB_NAMESPACE_END
|