Horizon Official Technical Documentation
Horizon::Zone::Traits::MobMagicAttackDamage Class Reference

#include <AttributesImpl.hpp>

+ Inheritance diagram for Horizon::Zone::Traits::MobMagicAttackDamage:
+ Collaboration diagram for Horizon::Zone::Traits::MobMagicAttackDamage:

Public Member Functions

 MobMagicAttackDamage (std::weak_ptr< Unit > unit)
 
 ~MobMagicAttackDamage ()
 
void on_observable_changed (Intelligence *)
 
void on_observable_changed (BaseLevel *)
 
void on_observable_changed (MobWeaponAttack *)
 
void set_intelligence (Intelligence *_intelligence)
 
void set_base_level (BaseLevel *blvl)
 
void set_creature_weapon_attack (MobWeaponAttack *cw_atk)
 
int32_t compute ()
 
- Public Member Functions inherited from Horizon::Zone::Traits::Attribute
 Attribute ()=default
 
 Attribute (std::weak_ptr< Unit > unit, status_point_type st_type, int32_t base=0, int32_t equip=0, int32_t status=0)
 
 Attribute (const Attribute &other)
 
 Attribute (Attribute &&other) noexcept
 
std::shared_ptr< Unitunit ()
 
void unit (std::shared_ptr< Unit > e)
 
virtual void set_base (int32_t val, bool notify=true)
 
virtual void add_base (int32_t val, bool notify=true)
 
virtual void sub_base (int32_t val, bool notify=true)
 
virtual int32_t get_base () const
 
virtual void set_equip (int32_t val, bool notify=true)
 
virtual void add_equip (int32_t val, bool notify=true)
 
virtual void sub_equip (int32_t val, bool notify=true)
 
virtual int32_t get_equip () const
 
virtual void set_status (int32_t val, bool notify=true)
 
virtual void add_status (int32_t val, bool notify=true)
 
virtual void sub_status (int32_t val, bool notify=true)
 
virtual int32_t get_status () const
 
virtual int32_t total () const
 
virtual int32_t compute ()
 
template<typename TT , typename std::enable_if< std::is_integral< TT >::value >::type * = nullptr>
TT operator+ (TT right)
 
template<typename TT , typename std::enable_if< std::is_integral< TT >::value >::type * = nullptr>
TT operator/ (TT right)
 
template<typename TT , typename std::enable_if< std::is_integral< TT >::value >::type * = nullptr>
TT operator* (TT right)
 
template<typename TT , typename std::enable_if< std::is_integral< TT >::value >::type * = nullptr>
TT operator- (TT right)
 
int operator+ (Attribute const &right) const
 
double operator/ (Attribute const &right)
 
double operator* (Attribute const &right)
 
int operator- (Attribute const &right)
 
template<typename TT , typename std::enable_if< std::is_integral< TT >::value >::type * = nullptr>
bool operator== (TT right)
 
template<typename TT , typename std::enable_if< std::is_integral< TT >::value >::type * = nullptr>
bool operator!= (TT right)
 
template<typename TT , typename std::enable_if< std::is_integral< TT >::value >::type * = nullptr>
bool operator> (TT right)
 
template<typename TT , typename std::enable_if< std::is_integral< TT >::value >::type * = nullptr>
bool operator>= (TT right)
 
template<typename TT , typename std::enable_if< std::is_integral< TT >::value >::type * = nullptr>
bool operator< (TT right)
 
template<typename TT , typename std::enable_if< std::is_integral< TT >::value >::type * = nullptr>
bool operator<= (TT right)
 
bool operator== (Attribute const &right)
 
bool operator!= (Attribute const &right)
 
bool operator> (Attribute const &right)
 
bool operator>= (Attribute const &right)
 
bool operator< (Attribute const &right)
 
bool operator<= (Attribute const &right)
 
Attribute operator= (Attribute &right)
 
Attribute operator= (Attribute &&right)
 
void add_permanent_change (s_attribute_change_values change, std::string source)
 
void remove_permanent_change (std::string source)
 
void add_temporary_change (s_attribute_change_values change, uint64_t duration, std::string source)
 
void remove_temporary_change (std::string source)
 
void add_periodic_change (s_attribute_change_values change, uint64_t duration, uint64_t interval, std::string source)
 
void remove_periodic_change (std::string source)
 
void update (uint64_t delta)
 
void apply (bool notify=true)
 
void reset ()
 
void notify ()
 
status_point_type get_type () const
 
bool needs_recalculation () const
 
void recalculate (bool flag)
 
bool is_compute_ready () const
 
- Public Member Functions inherited from Horizon::Zone::Traits::AttributeVariance
virtual void add_min (int32_t val)
 
virtual void sub_min (int32_t val)
 
virtual int32_t get_min () const
 
virtual void set_min (int32_t val)
 
virtual void add_max (int32_t val)
 
virtual void sub_max (int32_t val)
 
virtual int32_t get_max () const
 
virtual void set_max (int32_t val)
 

Private Attributes

Intelligence_int { nullptr }
 
BaseLevel_blvl { nullptr }
 
MobWeaponAttack_cw_atk { nullptr }
 

Additional Inherited Members

- Protected Attributes inherited from Horizon::Zone::Traits::Attribute
status_point_type _status_point_type {status_point_type::STATUS_POINT_INVALID}
 
int32_t _base_val {0}
 
int32_t _equip_val {0}
 
int32_t _status_val {0}
 
bool _apply_periodic_changes {false}
 
bool _recalculate_flag {false}
 
bool _calculate_ready {false}
 
- Protected Attributes inherited from Horizon::Zone::Traits::AttributeVariance
int32_t _min { 0 }
 
int32_t _max { 0 }
 

Constructor & Destructor Documentation

◆ MobMagicAttackDamage()

Horizon::Zone::Traits::MobMagicAttackDamage::MobMagicAttackDamage ( std::weak_ptr< Unit unit)
inline
1836 AttributeVariance()
1837 { }
@ STATUS_MOB_MAGIC_ATTACK_DAMAGE
Definition: UnitDefinitions.hpp:432
std::shared_ptr< Unit > unit()
Definition: Attribute.hpp:259

◆ ~MobMagicAttackDamage()

Horizon::Zone::Traits::MobMagicAttackDamage::~MobMagicAttackDamage ( )
inline
1838{ }

Member Function Documentation

◆ compute()

int32_t MobMagicAttackDamage::compute ( )
virtual

Reimplemented from Horizon::Zone::Traits::Attribute.

940{
941 set_min(_blvl->total() + _int->total() + (_cw_atk->total() * 7 / 10));
942 set_max(_blvl->total() + _int->total() + (_cw_atk->total() * 13 / 10));
943
944 return std::rand() % (_max - _min + 1) + _min;
945}
virtual void set_max(int32_t val)
Definition: Attribute.hpp:65
virtual void set_min(int32_t val)
Definition: Attribute.hpp:56
int32_t _min
Definition: Attribute.hpp:71
int32_t _max
Definition: Attribute.hpp:71
virtual int32_t total() const
Definition: Attribute.hpp:289
MobWeaponAttack * _cw_atk
Definition: AttributesImpl.hpp:1853
Intelligence * _int
Definition: AttributesImpl.hpp:1851
BaseLevel * _blvl
Definition: AttributesImpl.hpp:1852

References Horizon::Zone::Traits::s_attribute_change_values::set_max(), and Horizon::Zone::Traits::s_attribute_change_values::set_min().

Referenced by on_observable_changed().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ on_observable_changed() [1/3]

void Horizon::Zone::Traits::MobMagicAttackDamage::on_observable_changed ( BaseLevel )
inline
1841{ if (is_compute_ready()) compute(); }
bool is_compute_ready() const
Definition: Attribute.hpp:412
int32_t compute()
Definition: Attribute.cpp:939

References compute(), and Horizon::Zone::Traits::Attribute::is_compute_ready().

+ Here is the call graph for this function:

◆ on_observable_changed() [2/3]

void Horizon::Zone::Traits::MobMagicAttackDamage::on_observable_changed ( Intelligence )
inline
1840{ if (is_compute_ready()) compute(); }

References compute(), and Horizon::Zone::Traits::Attribute::is_compute_ready().

+ Here is the call graph for this function:

◆ on_observable_changed() [3/3]

void Horizon::Zone::Traits::MobMagicAttackDamage::on_observable_changed ( MobWeaponAttack )
inline
1842{ if (is_compute_ready()) compute(); }

References compute(), and Horizon::Zone::Traits::Attribute::is_compute_ready().

+ Here is the call graph for this function:

◆ set_base_level()

void Horizon::Zone::Traits::MobMagicAttackDamage::set_base_level ( BaseLevel blvl)
inline
1845{ _blvl = blvl; }

References _blvl.

◆ set_creature_weapon_attack()

void Horizon::Zone::Traits::MobMagicAttackDamage::set_creature_weapon_attack ( MobWeaponAttack cw_atk)
inline
1846{ _cw_atk = cw_atk; }

References _cw_atk.

◆ set_intelligence()

void Horizon::Zone::Traits::MobMagicAttackDamage::set_intelligence ( Intelligence _intelligence)
inline
1844{ _int = _intelligence; }
uint8_t _intelligence
Definition: Client.hpp:55

References _int, and _intelligence.

Member Data Documentation

◆ _blvl

BaseLevel* Horizon::Zone::Traits::MobMagicAttackDamage::_blvl { nullptr }
private

Referenced by set_base_level().

◆ _cw_atk

MobWeaponAttack* Horizon::Zone::Traits::MobMagicAttackDamage::_cw_atk { nullptr }
private

◆ _int

Intelligence* Horizon::Zone::Traits::MobMagicAttackDamage::_int { nullptr }
private

Referenced by set_intelligence().


The documentation for this class was generated from the following files: