2023-01-14 19:01:53 +02:00
|
|
|
/*
|
|
|
|
* DamageCalculator.h, part of VCMI engine
|
|
|
|
*
|
|
|
|
* Authors: listed in file AUTHORS in main folder
|
|
|
|
*
|
|
|
|
* License: GNU General Public License v2.0 or later
|
|
|
|
* Full text of license available in license.txt file, in main folder
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include "../GameConstants.h"
|
|
|
|
|
|
|
|
VCMI_LIB_NAMESPACE_BEGIN
|
|
|
|
|
|
|
|
class CBattleInfoCallback;
|
|
|
|
class IBonusBearer;
|
|
|
|
class CSelector;
|
|
|
|
struct BattleAttackInfo;
|
2023-03-23 17:49:33 +02:00
|
|
|
struct DamageRange;
|
2023-03-24 17:17:17 +02:00
|
|
|
struct DamageEstimation;
|
2023-01-14 19:01:53 +02:00
|
|
|
|
|
|
|
class DLL_LINKAGE DamageCalculator
|
|
|
|
{
|
|
|
|
const CBattleInfoCallback & callback;
|
|
|
|
const BattleAttackInfo & info;
|
|
|
|
|
|
|
|
int battleBonusValue(const IBonusBearer * bearer, const CSelector & selector) const;
|
|
|
|
|
2023-03-24 17:17:17 +02:00
|
|
|
DamageRange getCasualties(const DamageRange & damageDealt) const;
|
|
|
|
int64_t getCasualties(int64_t damageDealt) const;
|
|
|
|
|
2023-03-23 17:49:33 +02:00
|
|
|
DamageRange getBaseDamageSingle() const;
|
|
|
|
DamageRange getBaseDamageBlessCurse() const;
|
|
|
|
DamageRange getBaseDamageStack() const;
|
2023-01-14 19:01:53 +02:00
|
|
|
|
|
|
|
int getActorAttackBase() const;
|
|
|
|
int getActorAttackEffective() const;
|
|
|
|
int getActorAttackSlayer() const;
|
|
|
|
int getTargetDefenseBase() const;
|
|
|
|
int getTargetDefenseEffective() const;
|
|
|
|
int getTargetDefenseIgnored() const;
|
|
|
|
|
|
|
|
double getAttackSkillFactor() const;
|
|
|
|
double getAttackOffenseArcheryFactor() const;
|
|
|
|
double getAttackBlessFactor() const;
|
|
|
|
double getAttackLuckFactor() const;
|
|
|
|
double getAttackJoustingFactor() const;
|
|
|
|
double getAttackDeathBlowFactor() const;
|
|
|
|
double getAttackDoubleDamageFactor() const;
|
|
|
|
double getAttackHateFactor() const;
|
|
|
|
|
|
|
|
double getDefenseSkillFactor() const;
|
|
|
|
double getDefenseArmorerFactor() const;
|
|
|
|
double getDefenseMagicShieldFactor() const;
|
|
|
|
double getDefenseRangePenaltiesFactor() const;
|
|
|
|
double getDefenseObstacleFactor() const;
|
|
|
|
double getDefenseBlindParalysisFactor() const;
|
|
|
|
double getDefenseUnluckyFactor() const;
|
|
|
|
double getDefenseForgetfulnessFactor() const;
|
|
|
|
double getDefensePetrificationFactor() const;
|
|
|
|
double getDefenseMagicFactor() const;
|
|
|
|
double getDefenseMindFactor() const;
|
|
|
|
|
|
|
|
std::vector<double> getAttackFactors() const;
|
|
|
|
std::vector<double> getDefenseFactors() const;
|
|
|
|
public:
|
|
|
|
DamageCalculator(const CBattleInfoCallback & callback, const BattleAttackInfo & info ):
|
|
|
|
callback(callback),
|
|
|
|
info(info)
|
|
|
|
{}
|
|
|
|
|
2023-03-24 17:17:17 +02:00
|
|
|
DamageEstimation calculateDmgRange() const;
|
2023-01-14 19:01:53 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
VCMI_LIB_NAMESPACE_END
|