1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-11-29 23:07:48 +02:00

Fix 1989 cavaliers -> champions in stables

This commit is contained in:
Vadim Markovtsev
2016-01-30 23:51:21 +03:00
parent 7f68124b97
commit c30a6f2ff3
2 changed files with 56 additions and 22 deletions

View File

@@ -159,11 +159,14 @@ public:
/// Inherits from CArmedInstance for proper trasfer of armies
class DLL_LINKAGE CRewardableObject : public CArmedInstance
{
void grantReward(ui32 rewardID, const CGHeroInstance * hero) const;
/// function that must be called if hero got level-up during grantReward call
void grantRewardAfterLevelup(const CVisitInfo & reward, const CGHeroInstance * hero) const;
/// grants reward to hero
void grantRewardBeforeLevelup(const CVisitInfo & reward, const CGHeroInstance * hero) const;
protected:
/// controls selection of reward granted to player
enum ESelectMode
@@ -185,9 +188,9 @@ protected:
/// filters list of visit info and returns rewards that can be granted to current hero
virtual std::vector<ui32> getAvailableRewards(const CGHeroInstance * hero) const;
void grantReward(ui32 rewardID, const CGHeroInstance * hero) const;
virtual CVisitInfo getVisitInfo(int index, const CGHeroInstance *h) const;
/// Rewars that can be granted by an object
/// Rewards that can be granted by an object
std::vector<CVisitInfo> info;
/// MetaString's that contain text for messages for specific situations
@@ -263,11 +266,16 @@ public:
class DLL_LINKAGE CGBonusingObject : public CRewardableObject //objects giving bonuses to luck/morale/movement
{
protected:
CVisitInfo getVisitInfo(int index, const CGHeroInstance *h) const override;
public:
void initObj() override;
CGBonusingObject();
void onHeroVisit(const CGHeroInstance *h) const override;
template <typename Handler> void serialize(Handler &h, const int version)
{
h & static_cast<CRewardableObject&>(*this);