vcmi: morale and luck now also IFactionMember

Not all bonus bearers have morale and luck, only faction members
This commit is contained in:
Konstantin
2023-05-02 00:53:51 +03:00
parent e37f798a68
commit a2d4c72016
6 changed files with 74 additions and 89 deletions
+14
View File
@@ -14,6 +14,8 @@
VCMI_LIB_NAMESPACE_BEGIN
class BonusList;
namespace PrimarySkill
{
enum PrimarySkill : int8_t;
@@ -50,6 +52,18 @@ public:
Returns primskill of creature or hero.
*/
int getPrimSkillLevel(PrimarySkill::PrimarySkill id) const;
/**
Returns morale or luck of creature or hero.
*/
int MoraleVal() const; //range [-3, +3]
int LuckVal() const; //range [-3, +3]
/**
Returns total value of all morale bonuses and sets bonusList as a pointer to the list of selected bonuses.
@param bonusList is the out param it's list of all selected bonuses
@return total value of all morale in the range [-3, +3] and 0 otherwise
*/
int MoraleValAndBonusList(std::shared_ptr<const BonusList> & bonusList) const;
int LuckValAndBonusList(std::shared_ptr<const BonusList> & bonusList) const;
};
VCMI_LIB_NAMESPACE_END