mirror of
https://github.com/vcmi/vcmi.git
synced 2025-11-27 22:49:25 +02:00
* support for HP regeneration
* minor fixes
This commit is contained in:
@@ -15,6 +15,9 @@
|
||||
#include <boost/thread.hpp>
|
||||
#include <boost/thread/shared_mutex.hpp>
|
||||
|
||||
#undef min
|
||||
#undef max
|
||||
|
||||
/*
|
||||
* NetPacksLib.cpp, part of VCMI engine
|
||||
*
|
||||
@@ -602,6 +605,12 @@ DLL_EXPORT void BattleNextRound::applyGs( CGameState *gs )
|
||||
s->state -= HAD_MORALE;
|
||||
s->counterAttacks = 1 + s->valOfFeatures(StackFeature::ADDITIONAL_RETALIATION);
|
||||
|
||||
//regeneration
|
||||
if( s->hasFeatureOfType(StackFeature::HP_REGENERATION) )
|
||||
s->firstHPleft = std::min<ui32>( s->MaxHealth(), s->valOfFeatures(StackFeature::HP_REGENERATION) );
|
||||
if( s->hasFeatureOfType(StackFeature::FULL_HP_REGENERATION) )
|
||||
s->firstHPleft = s->MaxHealth();
|
||||
|
||||
//remove effects and restore only those with remaining turns in duration
|
||||
std::vector<CStack::StackEffect> tmpEffects = s->effects;
|
||||
s->effects.clear();
|
||||
|
||||
Reference in New Issue
Block a user