1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-11-23 22:37:55 +02:00

Moved all once-per-hero visitable (sans Tree) to config

This commit is contained in:
Ivan Savenko
2023-01-22 22:58:53 +02:00
parent a6bda58276
commit bfd6c40f25
8 changed files with 400 additions and 298 deletions

View File

@@ -198,15 +198,7 @@ class DLL_LINKAGE CRewardableObject : public CArmedInstance
/// grants reward to hero
void grantRewardBeforeLevelup(const CVisitInfo & reward, const CGHeroInstance * hero) const;
protected:
/// controls selection of reward granted to player
enum ESelectMode
{
SELECT_FIRST, // first reward that matches limiters
SELECT_PLAYER, // player can select from all allowed rewards
SELECT_RANDOM // reward will be selected from allowed randomly
};
public:
enum EVisitMode
{
VISIT_UNLIMITED, // any number of times. Side effect - object hover text won't contain visited/not visited text
@@ -216,6 +208,15 @@ protected:
VISIT_PLAYER // every player can visit object once
};
protected:
/// controls selection of reward granted to player
enum ESelectMode
{
SELECT_FIRST, // first reward that matches limiters
SELECT_PLAYER, // player can select from all allowed rewards
SELECT_RANDOM // reward will be selected from allowed randomly
};
/// filters list of visit info and returns rewards that can be granted to current hero
virtual std::vector<ui32> getAvailableRewards(const CGHeroInstance * hero) const;
@@ -247,6 +248,8 @@ protected:
bool canRefuse;
public:
EVisitMode getVisitMode() const;
void setPropertyDer(ui8 what, ui32 val) override;
std::string getHoverText(PlayerColor player) const override;
std::string getHoverText(const CGHeroInstance * hero) const override;