mirror of
https://github.com/vcmi/vcmi.git
synced 2025-11-27 22:49:25 +02:00
Unified CStack ammo, casts and counterattacks
* it is possible now to add casts and shoots OTF (f.e. with spell bonus) Centralized stack 'ammo' loading from bonus system. * introduced small proxy class for local bonus cache (no need to use global cache if particular selector used on node only in one place) * handle killing resurrected creatures * use IBonusBearer::MaxHealth() where possible * Fixed https://bugs.vcmi.eu/view.php?id=2486 * Possible fix for 0 HP after resurrection. * Hack-fixed https://bugs.vcmi.eu/view.php?id=2584 * Unified CStack health API * Use CHealth for CStack count and health points * increased SERIALIZATION_VERSION
This commit is contained in:
@@ -189,3 +189,22 @@ struct ArtifactLocation
|
||||
h & artHolder & slot;
|
||||
}
|
||||
};
|
||||
|
||||
class CHealthInfo
|
||||
{
|
||||
public:
|
||||
CHealthInfo():
|
||||
stackId(0), delta(0), firstHPleft(0), fullUnits(0), resurrected(0)
|
||||
{
|
||||
}
|
||||
uint32_t stackId;
|
||||
int32_t delta;
|
||||
int32_t firstHPleft;
|
||||
int32_t fullUnits;
|
||||
int32_t resurrected;
|
||||
|
||||
template <typename Handler> void serialize(Handler & h, const int version)
|
||||
{
|
||||
h & stackId & delta & firstHPleft & fullUnits & resurrected;
|
||||
}
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user