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

#include <AttributesImpl.hpp>

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

Public Member Functions

 FLEE (std::weak_ptr< Unit > unit)
 
 ~FLEE ()
 
void on_observable_changed (Agility *)
 
void on_observable_changed (BaseLevel *)
 
void on_observable_changed (Luck *)
 
int32_t compute ()
 Computes FLEE status based on agility, luck and Base Level. FLEE = 100 + BaseLv + AGI + Floor(LUK ÷ 5) More...
 
void set_agility (Agility *agi)
 
void set_base_level (BaseLevel *blvl)
 
void set_luck (Luck *luk)
 
- 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
 

Private Attributes

Agility_agi {nullptr}
 
BaseLevel_blvl {nullptr}
 
Luck_luk {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}
 

Constructor & Destructor Documentation

◆ FLEE()

Horizon::Zone::Traits::FLEE::FLEE ( std::weak_ptr< Unit unit)
inline
1393 { }
@ STATUS_FLEE
Definition: UnitDefinitions.hpp:139
std::shared_ptr< Unit > unit()
Definition: Attribute.hpp:259

◆ ~FLEE()

Horizon::Zone::Traits::FLEE::~FLEE ( )
inline
1394{ }

Member Function Documentation

◆ compute()

int32_t FLEE::compute ( )
virtual

Computes FLEE status based on agility, luck and Base Level. FLEE = 100 + BaseLv + AGI + Floor(LUK ÷ 5)

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

749{
750 int32_t blvl = 1, agi = 1, luk = 1;
751
752 if (_agi != nullptr)
753 agi = _agi->total();
754
755 if (_blvl != nullptr)
756 blvl = _blvl->get_base();
757
758 if (_luk != nullptr)
759 luk = _luk->total();
760
761 set_base(100 + blvl + agi + (luk / 5));
762
763 return total();
764}
virtual void set_base(int32_t val, bool notify=true)
Definition: Attribute.hpp:262
virtual int32_t get_base() const
Definition: Attribute.hpp:269
virtual int32_t total() const
Definition: Attribute.hpp:289
Luck * _luk
Definition: AttributesImpl.hpp:1409
BaseLevel * _blvl
Definition: AttributesImpl.hpp:1408
Agility * _agi
Definition: AttributesImpl.hpp:1407

References Horizon::Zone::Traits::s_attribute_change_values::set_base().

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::FLEE::on_observable_changed ( Agility )
inline
1396{ if (is_compute_ready()) compute(); }
bool is_compute_ready() const
Definition: Attribute.hpp:412
int32_t compute()
Computes FLEE status based on agility, luck and Base Level. FLEE = 100 + BaseLv + AGI + Floor(LUK ÷ 5...
Definition: Attribute.cpp:748

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::FLEE::on_observable_changed ( BaseLevel )
inline
1397{ 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::FLEE::on_observable_changed ( Luck )
inline
1398{ if (is_compute_ready()) compute(); }

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

+ Here is the call graph for this function:

◆ set_agility()

void Horizon::Zone::Traits::FLEE::set_agility ( Agility agi)
inline
1402{ _agi = agi; }

References _agi.

◆ set_base_level()

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

References _blvl.

◆ set_luck()

void Horizon::Zone::Traits::FLEE::set_luck ( Luck luk)
inline
1404{ _luk = luk; }

References _luk.

Member Data Documentation

◆ _agi

Agility* Horizon::Zone::Traits::FLEE::_agi {nullptr}
private

Referenced by set_agility().

◆ _blvl

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

Referenced by set_base_level().

◆ _luk

Luck* Horizon::Zone::Traits::FLEE::_luk {nullptr}
private

Referenced by set_luck().


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