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

#include <Attribute.hpp>

Inherited by Horizon::Zone::Bonuses::Bonus, Horizon::Zone::Traits::Agility, Horizon::Zone::Traits::AgilityPointCost, Horizon::Zone::Traits::AttackDelay, Horizon::Zone::Traits::AttackRange, Horizon::Zone::Traits::AttackSpeed, Horizon::Zone::Traits::BaseAttack, Horizon::Zone::Traits::BaseExperience, Horizon::Zone::Traits::BaseLevel, Horizon::Zone::Traits::CRIT, Horizon::Zone::Traits::CurrentHP, Horizon::Zone::Traits::CurrentSP, Horizon::Zone::Traits::CurrentWeight, Horizon::Zone::Traits::DamageWalkDelay, Horizon::Zone::Traits::Dexterity, Horizon::Zone::Traits::DexterityPointCost, Horizon::Zone::Traits::EquipATK, Horizon::Zone::Traits::EquipMATK, Horizon::Zone::Traits::FLEE, Horizon::Zone::Traits::HIT, Horizon::Zone::Traits::HPRegeneration, Horizon::Zone::Traits::HardDEF, Horizon::Zone::Traits::HardMDEF, Horizon::Zone::Traits::Honor, Horizon::Zone::Traits::Intelligence, Horizon::Zone::Traits::IntelligencePointCost, Horizon::Zone::Traits::JobExperience, Horizon::Zone::Traits::JobLevel, Horizon::Zone::Traits::Luck, Horizon::Zone::Traits::LuckPointCost, Horizon::Zone::Traits::Manner, Horizon::Zone::Traits::MaxHP, Horizon::Zone::Traits::MaxSP, Horizon::Zone::Traits::MaxWeight, Horizon::Zone::Traits::MobAttackDamage, Horizon::Zone::Traits::MobChaseRange, Horizon::Zone::Traits::MobElement, Horizon::Zone::Traits::MobElementLevel, Horizon::Zone::Traits::MobMagicAttackDamage, Horizon::Zone::Traits::MobMode, Horizon::Zone::Traits::MobPrimaryRace, Horizon::Zone::Traits::MobSecondaryRace, Horizon::Zone::Traits::MobViewRange, Horizon::Zone::Traits::MobWeaponAttack, Horizon::Zone::Traits::MovementSpeed, Horizon::Zone::Traits::NextBaseExperience, Horizon::Zone::Traits::NextJobExperience, Horizon::Zone::Traits::SPRegeneration, Horizon::Zone::Traits::SkillPoint, Horizon::Zone::Traits::SoftDEF, Horizon::Zone::Traits::SoftMDEF, Horizon::Zone::Traits::StatusATK, Horizon::Zone::Traits::StatusMATK, Horizon::Zone::Traits::StatusPoint, Horizon::Zone::Traits::Strength, Horizon::Zone::Traits::StrengthPointCost, Horizon::Zone::Traits::UnitSize, Horizon::Zone::Traits::Virtue, Horizon::Zone::Traits::Vitality, Horizon::Zone::Traits::VitalityPointCost, Horizon::Zone::Traits::WeaponAttackCombined, Horizon::Zone::Traits::WeaponAttackLeft, Horizon::Zone::Traits::WeaponAttackRight, and Horizon::Zone::Traits::Zeny.

+ Collaboration diagram for Horizon::Zone::Traits::Attribute:

Public Member Functions

 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
 

Protected Attributes

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}
 

Private Attributes

std::weak_ptr< Unit_unit
 
PermanentChanges _permanent_changes {this}
 
TemporaryChanges _temporary_changes {this}
 
PeriodicChanges _periodic_changes {this}
 

Constructor & Destructor Documentation

◆ Attribute() [1/4]

Horizon::Zone::Traits::Attribute::Attribute ( )
default

◆ Attribute() [2/4]

Horizon::Zone::Traits::Attribute::Attribute ( std::weak_ptr< Unit unit,
status_point_type  st_type,
int32_t  base = 0,
int32_t  equip = 0,
int32_t  status = 0 
)
inline
240 : _status_point_type(st_type), _unit(unit)
241 {
242 add_permanent_change({base, equip, status}, "initial");
243 }
std::shared_ptr< Unit > unit()
Definition: Attribute.hpp:259
std::weak_ptr< Unit > _unit
Definition: Attribute.hpp:423
status_point_type _status_point_type
Definition: Attribute.hpp:415
void add_permanent_change(s_attribute_change_values change, std::string source)
Definition: Attribute.hpp:347

References add_permanent_change().

+ Here is the call graph for this function:

◆ Attribute() [3/4]

Horizon::Zone::Traits::Attribute::Attribute ( const Attribute other)
inline
247 : _unit(other._unit), _status_point_type(other._status_point_type), _base_val(other._base_val), _equip_val(other._equip_val), _status_val(other._status_val)
248 {
249 add_permanent_change({other._base_val, other._equip_val, other._status_val}, "initial");
250 }
int32_t _base_val
Definition: Attribute.hpp:416
int32_t _equip_val
Definition: Attribute.hpp:417
int32_t _status_val
Definition: Attribute.hpp:418

References _base_val, _equip_val, _status_val, and add_permanent_change().

+ Here is the call graph for this function:

◆ Attribute() [4/4]

Horizon::Zone::Traits::Attribute::Attribute ( Attribute &&  other)
inlinenoexcept
254 : _unit(std::move(other._unit)), _status_point_type(other._status_point_type), _base_val(other._base_val), _equip_val(other._equip_val), _status_val(other._status_val)
255 {
256 add_permanent_change({other._base_val, other._equip_val, other._status_val}, "initial");
257 }

References add_permanent_change().

+ Here is the call graph for this function:

Member Function Documentation

◆ add_base()

void Attribute::add_base ( int32_t  val,
bool  notify = true 
)
virtual

Reimplemented in Horizon::Zone::Traits::BaseLevel, Horizon::Zone::Traits::JobLevel, Horizon::Zone::Traits::MaxHP, Horizon::Zone::Traits::MaxSP, Horizon::Zone::Traits::Strength, Horizon::Zone::Traits::Agility, Horizon::Zone::Traits::Vitality, Horizon::Zone::Traits::Intelligence, Horizon::Zone::Traits::Dexterity, Horizon::Zone::Traits::Luck, Horizon::Zone::Traits::BaseExperience, Horizon::Zone::Traits::JobExperience, Horizon::Zone::Traits::AttackSpeed, Horizon::Zone::Traits::WeaponAttackLeft, and Horizon::Zone::Traits::WeaponAttackRight.

244 {
245 _base_val += val;
246 if (notify) this->notify();
247}
void notify()
Definition: Attribute.cpp:269

Referenced by Horizon::Zone::Traits::BaseLevel::add_base(), Horizon::Zone::Traits::JobLevel::add_base(), Horizon::Zone::Traits::MaxHP::add_base(), Horizon::Zone::Traits::MaxSP::add_base(), Horizon::Zone::Traits::Strength::add_base(), Horizon::Zone::Traits::Agility::add_base(), Horizon::Zone::Traits::Vitality::add_base(), Horizon::Zone::Traits::Intelligence::add_base(), Horizon::Zone::Traits::Dexterity::add_base(), Horizon::Zone::Traits::Luck::add_base(), Horizon::Zone::Traits::BaseExperience::add_base(), Horizon::Zone::Traits::JobExperience::add_base(), Horizon::Zone::Traits::AttackSpeed::add_base(), Horizon::Zone::Traits::WeaponAttackLeft::add_base(), Horizon::Zone::Traits::WeaponAttackRight::add_base(), and Horizon::Zone::UnitComponent::sync_data_types().

+ Here is the caller graph for this function:

◆ add_equip()

void Attribute::add_equip ( int32_t  val,
bool  notify = true 
)
virtual

◆ add_periodic_change()

void Horizon::Zone::Traits::Attribute::add_periodic_change ( s_attribute_change_values  change,
uint64_t  duration,
uint64_t  interval,
std::string  source 
)
inline
368 {
369 _periodic_changes.add_change(change, duration, interval, source);
370 }
PeriodicChanges _periodic_changes
Definition: Attribute.hpp:426
void add_change(s_attribute_change_values change, uint64_t duration, uint64_t interval, std::string source)
Definition: Attribute.cpp:145

References _periodic_changes, and Horizon::Zone::Traits::PeriodicChanges::add_change().

+ Here is the call graph for this function:

◆ add_permanent_change()

void Horizon::Zone::Traits::Attribute::add_permanent_change ( s_attribute_change_values  change,
std::string  source 
)
inline
348 {
349 _permanent_changes.add_change(change, source);
350 }
PermanentChanges _permanent_changes
Definition: Attribute.hpp:424
void add_change(s_attribute_change_values change, std::string source)
Definition: Attribute.cpp:70

References _permanent_changes, and Horizon::Zone::Traits::PermanentChanges::add_change().

Referenced by Attribute().

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

◆ add_status()

void Attribute::add_status ( int32_t  val,
bool  notify = true 
)
virtual

◆ add_temporary_change()

void Horizon::Zone::Traits::Attribute::add_temporary_change ( s_attribute_change_values  change,
uint64_t  duration,
std::string  source 
)
inline
358 {
359 _temporary_changes.add_change(change, duration, source);
360 }
TemporaryChanges _temporary_changes
Definition: Attribute.hpp:425
void add_change(s_attribute_change_values change, uint64_t duration, std::string source)
Definition: Attribute.cpp:101

References _temporary_changes, and Horizon::Zone::Traits::TemporaryChanges::add_change().

+ Here is the call graph for this function:

◆ apply()

void Horizon::Zone::Traits::Attribute::apply ( bool  notify = true)
inline
386 {
387 // do not calculate until ready. Changes to stats (via permanent changes and temporary changes)
388 // will not be calculated until ready.
389 _calculate_ready = false;
393 _calculate_ready = true;
394 compute();
395 }
virtual int32_t compute()
Definition: Attribute.hpp:291
bool _calculate_ready
Definition: Attribute.hpp:421
bool _apply_periodic_changes
Definition: Attribute.hpp:419
void apply(bool notify=true)
Definition: Attribute.cpp:80
void apply(bool notify=true)
Definition: Attribute.cpp:111

References _apply_periodic_changes, _calculate_ready, _permanent_changes, _temporary_changes, Horizon::Zone::Traits::PermanentChanges::apply(), Horizon::Zone::Traits::TemporaryChanges::apply(), compute(), and notify().

+ Here is the call graph for this function:

◆ compute()

◆ get_base()

◆ get_equip()

virtual int32_t Horizon::Zone::Traits::Attribute::get_equip ( ) const
inlinevirtual

◆ get_status()

virtual int32_t Horizon::Zone::Traits::Attribute::get_status ( ) const
inlinevirtual
287{ return _status_val; }

References _status_val.

Referenced by operator=(), and Horizon::Zone::Traits::s_attribute_change_values::ApplyLiveAttribute::update_with_live_attribute().

+ Here is the caller graph for this function:

◆ get_type()

status_point_type Horizon::Zone::Traits::Attribute::get_type ( ) const
inline
407{ return _status_point_type; }

References _status_point_type.

◆ is_compute_ready()

bool Horizon::Zone::Traits::Attribute::is_compute_ready ( ) const
inline
412{ return _calculate_ready; }

References _calculate_ready.

Referenced by Horizon::Zone::Traits::EquipMATK::on_equipment_changed(), Horizon::Zone::Traits::HardDEF::on_equipment_changed(), Horizon::Zone::Traits::HardMDEF::on_equipment_changed(), Horizon::Zone::Traits::AttackSpeed::on_equipment_changed(), Horizon::Zone::Traits::AttackRange::on_equipment_changed(), Horizon::Zone::Traits::BaseAttack::on_equipment_changed(), Horizon::Zone::Traits::WeaponAttackLeft::on_equipment_changed(), Horizon::Zone::Traits::WeaponAttackRight::on_equipment_changed(), Horizon::Zone::Traits::FLEE::on_observable_changed(), Horizon::Zone::Traits::AttackSpeed::on_observable_changed(), Horizon::Zone::Traits::DamageWalkDelay::on_observable_changed(), Horizon::Zone::Traits::AttackDelay::on_observable_changed(), Horizon::Zone::Traits::MaxHP::on_observable_changed(), Horizon::Zone::Traits::MaxSP::on_observable_changed(), Horizon::Zone::Traits::HIT::on_observable_changed(), Horizon::Zone::Traits::StatusMATK::on_observable_changed(), Horizon::Zone::Traits::SoftMDEF::on_observable_changed(), Horizon::Zone::Traits::SPRegeneration::on_observable_changed(), Horizon::Zone::Traits::MobMagicAttackDamage::on_observable_changed(), Horizon::Zone::Traits::CRIT::on_observable_changed(), Horizon::Zone::Traits::StatusATK::on_observable_changed(), Horizon::Zone::Traits::EquipATK::on_observable_changed(), Horizon::Zone::Traits::BaseAttack::on_observable_changed(), Horizon::Zone::Traits::MobAttackDamage::on_observable_changed(), Horizon::Zone::Traits::MaxWeight::on_observable_changed(), Horizon::Zone::Traits::SoftDEF::on_observable_changed(), Horizon::Zone::Traits::HPRegeneration::on_observable_changed(), Horizon::Zone::Traits::WeaponAttackCombined::on_observable_changed(), Horizon::Zone::Traits::EquipATK::on_weapon_changed(), and Horizon::Zone::Traits::StatusATK::set_weapon_type().

+ Here is the caller graph for this function:

◆ needs_recalculation()

bool Horizon::Zone::Traits::Attribute::needs_recalculation ( ) const
inline
409{ return _recalculate_flag; }
bool _recalculate_flag
Definition: Attribute.hpp:420

References _recalculate_flag.

◆ notify()

void Attribute::notify ( )
270{
271 if (unit()->type() != UNIT_PLAYER)
272 return;
273
274 switch(_status_point_type)
275 {
277 break;
281 case STATUS_BASELEVEL:
282 case STATUS_JOBLEVEL:
283 case STATUS_KARMA:
284 case STATUS_MANNER:
286 case STATUS_SKILLPOINT:
287 case STATUS_HIT:
288 case STATUS_FLEE:
290 case STATUS_MAXHP:
291 case STATUS_MAXSP:
292 case STATUS_CURRENTHP:
293 case STATUS_CURRENTSP:
294 case STATUS_ASPD:
296 case STATUS_EQUIP_ATK:
299 case STATUS_SOFT_DEF:
300 case STATUS_HARD_DEF:
301 case STATUS_SOFT_MDEF:
302 case STATUS_HARD_MDEF:
303 case STATUS_ZENY:
304 {
305 unit()->downcast<Horizon::Zone::Units::Player>()->get_session()->clif()->notify_compound_attribute_update(_status_point_type, total());
306 }
307 break;
308 case STATUS_CRITICAL:
309 {
310 unit()->downcast<Horizon::Zone::Units::Player>()->get_session()->clif()->notify_compound_attribute_update(_status_point_type, total() / 10);
311 }
312 break;
313 case STATUS_BASEEXP:
314 case STATUS_JOBEXP:
317 {
318 unit()->downcast<Horizon::Zone::Units::Player>()->get_session()->clif()->notify_experience_update(_status_point_type, total());
319 }
320 break;
326 case STATUS_LUCK_COST:
327 {
328 unit()->downcast<Horizon::Zone::Units::Player>()->get_session()->clif()->notify_required_attribute_update(_status_point_type, total());
329 }
330 break;
332 {
333 unit()->downcast<Horizon::Zone::Units::Player>()->get_session()->clif()->notify_attack_range_update(total());
334 }
335 break;
336 case STATUS_STRENGTH:
337 case STATUS_AGILITY:
338 case STATUS_VITALITY:
340 case STATUS_DEXTERITY:
341 case STATUS_LUCK:
342 {
343 unit()->downcast<Horizon::Zone::Units::Player>()->get_session()->clif()->notify_attribute_update(_status_point_type, get_base(), get_status() + get_equip());
344 }
345 break;
346 case STATUS_CARTINFO:
347 {
348 unit()->downcast<Horizon::Zone::Units::Player>()->get_session()->clif()->notify_cart_weight_update();
349 }
350 break;
351 default:
352 HLog(debug) << "Tried to send attribute update for status point type " << _status_point_type << " which is not implemented yet.";
353 break;
354 }
355}
#define HLog(type)
Definition: Logger.hpp:122
@ UNIT_PLAYER
Definition: UnitDefinitions.hpp:45
@ STATUS_DEXTERITY
Definition: UnitDefinitions.hpp:106
@ STATUS_AGILITY_COST
Definition: UnitDefinitions.hpp:122
@ STATUS_NEXTJOBEXP
Definition: UnitDefinitions.hpp:112
@ STATUS_JOBEXP
Definition: UnitDefinitions.hpp:91
@ STATUS_CARTINFO
Definition: UnitDefinitions.hpp:150
@ STATUS_BASEEXP
Definition: UnitDefinitions.hpp:90
@ STATUS_MAXSP
Definition: UnitDefinitions.hpp:97
@ STATUS_VITALITY_COST
Definition: UnitDefinitions.hpp:123
@ STATUS_SKILLPOINT
Definition: UnitDefinitions.hpp:101
@ STATUS_CURRENTSP
Definition: UnitDefinitions.hpp:96
@ STATUS_EQUIP_ATK
Definition: UnitDefinitions.hpp:131
@ STATUS_STATUS_ATK
Definition: UnitDefinitions.hpp:130
@ STATUS_STRENGTH_COST
Definition: UnitDefinitions.hpp:121
@ STATUS_MOVEMENT_SPEED
Definition: UnitDefinitions.hpp:89
@ STATUS_SOFT_DEF
Definition: UnitDefinitions.hpp:134
@ STATUS_PERFECT_DODGE
Definition: UnitDefinitions.hpp:140
@ STATUS_EQUIP_MATK
Definition: UnitDefinitions.hpp:132
@ STATUS_LUCK_COST
Definition: UnitDefinitions.hpp:126
@ STATUS_ASPD
Definition: UnitDefinitions.hpp:142
@ STATUS_INTELLIGENCE_COST
Definition: UnitDefinitions.hpp:124
@ STATUS_CRITICAL
Definition: UnitDefinitions.hpp:141
@ STATUS_MAXHP
Definition: UnitDefinitions.hpp:95
@ STATUS_STATUSPOINT
Definition: UnitDefinitions.hpp:98
@ STATUS_AGILITY
Definition: UnitDefinitions.hpp:103
@ STATUS_DEXTERITY_COST
Definition: UnitDefinitions.hpp:125
@ STATUS_NEXTBASEEXP
Definition: UnitDefinitions.hpp:111
@ STATUS_STATUS_MATK
Definition: UnitDefinitions.hpp:133
@ STATUS_BASELEVEL
Definition: UnitDefinitions.hpp:100
@ STATUS_CURRENTHP
Definition: UnitDefinitions.hpp:94
@ STATUS_STRENGTH
Definition: UnitDefinitions.hpp:102
@ STATUS_HARD_MDEF
Definition: UnitDefinitions.hpp:137
@ STATUS_VITALITY
Definition: UnitDefinitions.hpp:104
@ STATUS_FLEE
Definition: UnitDefinitions.hpp:139
@ STATUS_POINT_INVALID
Definition: UnitDefinitions.hpp:88
@ STATUS_CURRENT_WEIGHT
Definition: UnitDefinitions.hpp:113
@ STATUS_LUCK
Definition: UnitDefinitions.hpp:107
@ STATUS_KARMA
Definition: UnitDefinitions.hpp:92
@ STATUS_SOFT_MDEF
Definition: UnitDefinitions.hpp:136
@ STATUS_ATTACKRANGE
Definition: UnitDefinitions.hpp:213
@ STATUS_HARD_DEF
Definition: UnitDefinitions.hpp:135
@ STATUS_ZENY
Definition: UnitDefinitions.hpp:109
@ STATUS_MAX_WEIGHT
Definition: UnitDefinitions.hpp:114
@ STATUS_MANNER
Definition: UnitDefinitions.hpp:93
@ STATUS_HIT
Definition: UnitDefinitions.hpp:138
@ STATUS_JOBLEVEL
Definition: UnitDefinitions.hpp:144
@ STATUS_INTELLIGENCE
Definition: UnitDefinitions.hpp:105
virtual int32_t get_equip() const
Definition: Attribute.hpp:278
virtual int32_t get_status() const
Definition: Attribute.hpp:287
virtual int32_t get_base() const
Definition: Attribute.hpp:269
Definition: Player.hpp:62

References Horizon::Zone::Traits::s_attribute_change_values::get_base(), Horizon::Zone::Traits::s_attribute_change_values::get_equip(), Horizon::Zone::Traits::s_attribute_change_values::get_status(), HLog, STATUS_AGILITY, STATUS_AGILITY_COST, STATUS_ASPD, STATUS_ATTACKRANGE, STATUS_BASEEXP, STATUS_BASELEVEL, STATUS_CARTINFO, STATUS_CRITICAL, STATUS_CURRENT_WEIGHT, STATUS_CURRENTHP, STATUS_CURRENTSP, STATUS_DEXTERITY, STATUS_DEXTERITY_COST, STATUS_EQUIP_ATK, STATUS_EQUIP_MATK, STATUS_FLEE, STATUS_HARD_DEF, STATUS_HARD_MDEF, STATUS_HIT, STATUS_INTELLIGENCE, STATUS_INTELLIGENCE_COST, STATUS_JOBEXP, STATUS_JOBLEVEL, STATUS_KARMA, STATUS_LUCK, STATUS_LUCK_COST, STATUS_MANNER, STATUS_MAX_WEIGHT, STATUS_MAXHP, STATUS_MAXSP, STATUS_MOVEMENT_SPEED, STATUS_NEXTBASEEXP, STATUS_NEXTJOBEXP, STATUS_PERFECT_DODGE, STATUS_POINT_INVALID, STATUS_SKILLPOINT, STATUS_SOFT_DEF, STATUS_SOFT_MDEF, STATUS_STATUS_ATK, STATUS_STATUS_MATK, STATUS_STATUSPOINT, STATUS_STRENGTH, STATUS_STRENGTH_COST, STATUS_VITALITY, STATUS_VITALITY_COST, STATUS_ZENY, and UNIT_PLAYER.

Referenced by apply(), compute(), set_base(), set_equip(), and set_status().

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

◆ operator!=() [1/2]

bool Horizon::Zone::Traits::Attribute::operator!= ( Attribute const &  right)
inline
321{ return total() != right.total(); }

References total().

+ Here is the call graph for this function:

◆ operator!=() [2/2]

template<typename TT , typename std::enable_if< std::is_integral< TT >::value >::type * = nullptr>
bool Horizon::Zone::Traits::Attribute::operator!= ( TT  right)
inline
310{ return total() != right; }

References total().

+ Here is the call graph for this function:

◆ operator*() [1/2]

double Horizon::Zone::Traits::Attribute::operator* ( Attribute const &  right)
inline
304{ return right.total() * total(); }

References total().

+ Here is the call graph for this function:

◆ operator*() [2/2]

template<typename TT , typename std::enable_if< std::is_integral< TT >::value >::type * = nullptr>
TT Horizon::Zone::Traits::Attribute::operator* ( TT  right)
inline
298{ return total() * right; }

References total().

+ Here is the call graph for this function:

◆ operator+() [1/2]

int Horizon::Zone::Traits::Attribute::operator+ ( Attribute const &  right) const
inline
302{ return total() + right.total() ; }

References total().

+ Here is the call graph for this function:

◆ operator+() [2/2]

template<typename TT , typename std::enable_if< std::is_integral< TT >::value >::type * = nullptr>
TT Horizon::Zone::Traits::Attribute::operator+ ( TT  right)
inline
294{ return total() + right; }

References total().

+ Here is the call graph for this function:

◆ operator-() [1/2]

int Horizon::Zone::Traits::Attribute::operator- ( Attribute const &  right)
inline
305{ return right.total() - total(); }

References total().

+ Here is the call graph for this function:

◆ operator-() [2/2]

template<typename TT , typename std::enable_if< std::is_integral< TT >::value >::type * = nullptr>
TT Horizon::Zone::Traits::Attribute::operator- ( TT  right)
inline
300{ return total() - right; }

References total().

+ Here is the call graph for this function:

◆ operator/() [1/2]

double Horizon::Zone::Traits::Attribute::operator/ ( Attribute const &  right)
inline
303{ return right.total() / total(); }

References total().

+ Here is the call graph for this function:

◆ operator/() [2/2]

template<typename TT , typename std::enable_if< std::is_integral< TT >::value >::type * = nullptr>
TT Horizon::Zone::Traits::Attribute::operator/ ( TT  right)
inline
296{ return total() / right; }

References total().

+ Here is the call graph for this function:

◆ operator<() [1/2]

bool Horizon::Zone::Traits::Attribute::operator< ( Attribute const &  right)
inline
324{ return total() < right.total(); }

References total().

+ Here is the call graph for this function:

◆ operator<() [2/2]

template<typename TT , typename std::enable_if< std::is_integral< TT >::value >::type * = nullptr>
bool Horizon::Zone::Traits::Attribute::operator< ( TT  right)
inline
316{ return total() < right; }

References total().

+ Here is the call graph for this function:

◆ operator<=() [1/2]

bool Horizon::Zone::Traits::Attribute::operator<= ( Attribute const &  right)
inline
325{ return total() <= right.total(); }

References total().

+ Here is the call graph for this function:

◆ operator<=() [2/2]

template<typename TT , typename std::enable_if< std::is_integral< TT >::value >::type * = nullptr>
bool Horizon::Zone::Traits::Attribute::operator<= ( TT  right)
inline
318{ return total() <= right; }

References total().

+ Here is the call graph for this function:

◆ operator=() [1/2]

Attribute Horizon::Zone::Traits::Attribute::operator= ( Attribute &&  right)
inline
338 {
339 unit(right.unit());
340 set_base(right.get_base());
341 set_equip(right.get_equip());
342 set_status(right.get_status());
343
344 return *this;
345 }
virtual void set_equip(int32_t val, bool notify=true)
Definition: Attribute.hpp:271
virtual void set_base(int32_t val, bool notify=true)
Definition: Attribute.hpp:262
virtual void set_status(int32_t val, bool notify=true)
Definition: Attribute.hpp:280

References set_base(), set_equip(), set_status(), and unit().

+ Here is the call graph for this function:

◆ operator=() [2/2]

Attribute Horizon::Zone::Traits::Attribute::operator= ( Attribute right)
inline
328 {
329 unit(right.unit());
330 set_base(right.get_base());
331 set_equip(right.get_equip());
332 set_status(right.get_status());
333
334 return *this;
335 }

References get_base(), get_equip(), get_status(), set_base(), set_equip(), set_status(), and unit().

Referenced by Horizon::Zone::Bonuses::Bonus::operator=().

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

◆ operator==() [1/2]

bool Horizon::Zone::Traits::Attribute::operator== ( Attribute const &  right)
inline
320{ return total() == right.total(); }

References total().

+ Here is the call graph for this function:

◆ operator==() [2/2]

template<typename TT , typename std::enable_if< std::is_integral< TT >::value >::type * = nullptr>
bool Horizon::Zone::Traits::Attribute::operator== ( TT  right)
inline
308{ return total() == right; }

References total().

+ Here is the call graph for this function:

◆ operator>() [1/2]

bool Horizon::Zone::Traits::Attribute::operator> ( Attribute const &  right)
inline
322{ return total() > right.total(); }

References total().

+ Here is the call graph for this function:

◆ operator>() [2/2]

template<typename TT , typename std::enable_if< std::is_integral< TT >::value >::type * = nullptr>
bool Horizon::Zone::Traits::Attribute::operator> ( TT  right)
inline
312{ return total() > right; }

References total().

+ Here is the call graph for this function:

◆ operator>=() [1/2]

bool Horizon::Zone::Traits::Attribute::operator>= ( Attribute const &  right)
inline
323{ return total() >= right.total(); }

References total().

+ Here is the call graph for this function:

◆ operator>=() [2/2]

template<typename TT , typename std::enable_if< std::is_integral< TT >::value >::type * = nullptr>
bool Horizon::Zone::Traits::Attribute::operator>= ( TT  right)
inline
314{ return total() >= right; }

References total().

+ Here is the call graph for this function:

◆ recalculate()

void Horizon::Zone::Traits::Attribute::recalculate ( bool  flag)
inline
410{ _recalculate_flag = flag; }

References _recalculate_flag.

◆ remove_periodic_change()

void Horizon::Zone::Traits::Attribute::remove_periodic_change ( std::string  source)
inline
373 {
375 }
void remove_change(std::string source)
Definition: Attribute.cpp:150

References _periodic_changes, and Horizon::Zone::Traits::PeriodicChanges::remove_change().

+ Here is the call graph for this function:

◆ remove_permanent_change()

void Horizon::Zone::Traits::Attribute::remove_permanent_change ( std::string  source)
inline
353 {
355 }
void remove_change(std::string source)
Definition: Attribute.cpp:75

References _permanent_changes, and Horizon::Zone::Traits::PermanentChanges::remove_change().

+ Here is the call graph for this function:

◆ remove_temporary_change()

void Horizon::Zone::Traits::Attribute::remove_temporary_change ( std::string  source)
inline
363 {
365 }
void remove_change(std::string source)
Definition: Attribute.cpp:106

References _temporary_changes, and Horizon::Zone::Traits::TemporaryChanges::remove_change().

+ Here is the call graph for this function:

◆ reset()

void Horizon::Zone::Traits::Attribute::reset ( )
inline
398 {
400 _base_val = 0;
401 _equip_val = 0;
402 _status_val = 0;
403 }

References _apply_periodic_changes, _base_val, _equip_val, and _status_val.

◆ set_base()

virtual void Horizon::Zone::Traits::Attribute::set_base ( int32_t  val,
bool  notify = true 
)
inlinevirtual

Reimplemented in Horizon::Zone::Traits::BaseLevel, Horizon::Zone::Traits::JobLevel, Horizon::Zone::Traits::MaxHP, Horizon::Zone::Traits::MaxSP, Horizon::Zone::Traits::SkillPoint, Horizon::Zone::Traits::Strength, Horizon::Zone::Traits::Agility, Horizon::Zone::Traits::Vitality, Horizon::Zone::Traits::Intelligence, Horizon::Zone::Traits::Dexterity, Horizon::Zone::Traits::Luck, Horizon::Zone::Traits::BaseExperience, Horizon::Zone::Traits::JobExperience, Horizon::Zone::Traits::Zeny, Horizon::Zone::Traits::Honor, Horizon::Zone::Traits::Manner, Horizon::Zone::Traits::Virtue, Horizon::Zone::Traits::MovementSpeed, Horizon::Zone::Traits::AttackSpeed, Horizon::Zone::Traits::WeaponAttackLeft, and Horizon::Zone::Traits::WeaponAttackRight.

263 {
264 _base_val = val;
265 if (notify) this->notify();
266 }

References _base_val, and notify().

Referenced by operator=(), Horizon::Zone::Traits::BaseLevel::set_base(), Horizon::Zone::Traits::JobLevel::set_base(), Horizon::Zone::Traits::MaxHP::set_base(), Horizon::Zone::Traits::MaxSP::set_base(), Horizon::Zone::Traits::SkillPoint::set_base(), Horizon::Zone::Traits::Strength::set_base(), Horizon::Zone::Traits::Agility::set_base(), Horizon::Zone::Traits::Vitality::set_base(), Horizon::Zone::Traits::Intelligence::set_base(), Horizon::Zone::Traits::Dexterity::set_base(), Horizon::Zone::Traits::Luck::set_base(), Horizon::Zone::Traits::BaseExperience::set_base(), Horizon::Zone::Traits::JobExperience::set_base(), Horizon::Zone::Traits::Zeny::set_base(), Horizon::Zone::Traits::Honor::set_base(), Horizon::Zone::Traits::Manner::set_base(), Horizon::Zone::Traits::Virtue::set_base(), Horizon::Zone::Traits::MovementSpeed::set_base(), Horizon::Zone::Traits::AttackSpeed::set_base(), Horizon::Zone::Traits::WeaponAttackLeft::set_base(), Horizon::Zone::Traits::WeaponAttackRight::set_base(), and Horizon::Zone::UnitComponent::sync_data_types().

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

◆ set_equip()

virtual void Horizon::Zone::Traits::Attribute::set_equip ( int32_t  val,
bool  notify = true 
)
inlinevirtual

Reimplemented in Horizon::Zone::Traits::BaseLevel, Horizon::Zone::Traits::JobLevel, Horizon::Zone::Traits::MaxHP, Horizon::Zone::Traits::MaxSP, Horizon::Zone::Traits::Strength, Horizon::Zone::Traits::Agility, Horizon::Zone::Traits::Vitality, Horizon::Zone::Traits::Intelligence, Horizon::Zone::Traits::Dexterity, Horizon::Zone::Traits::Luck, Horizon::Zone::Traits::BaseExperience, Horizon::Zone::Traits::JobExperience, Horizon::Zone::Traits::AttackSpeed, Horizon::Zone::Traits::WeaponAttackLeft, and Horizon::Zone::Traits::WeaponAttackRight.

272 {
273 _equip_val = val;
274 if (notify) this->notify();
275 }

References _equip_val, and notify().

Referenced by operator=(), Horizon::Zone::Bonuses::Bonus::set(), Horizon::Zone::Traits::BaseLevel::set_equip(), Horizon::Zone::Traits::JobLevel::set_equip(), Horizon::Zone::Traits::MaxHP::set_equip(), Horizon::Zone::Traits::MaxSP::set_equip(), Horizon::Zone::Traits::Strength::set_equip(), Horizon::Zone::Traits::Agility::set_equip(), Horizon::Zone::Traits::Vitality::set_equip(), Horizon::Zone::Traits::Intelligence::set_equip(), Horizon::Zone::Traits::Dexterity::set_equip(), Horizon::Zone::Traits::Luck::set_equip(), Horizon::Zone::Traits::BaseExperience::set_equip(), Horizon::Zone::Traits::JobExperience::set_equip(), Horizon::Zone::Traits::AttackSpeed::set_equip(), Horizon::Zone::Traits::WeaponAttackLeft::set_equip(), and Horizon::Zone::Traits::WeaponAttackRight::set_equip().

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

◆ set_status()

virtual void Horizon::Zone::Traits::Attribute::set_status ( int32_t  val,
bool  notify = true 
)
inlinevirtual

◆ sub_base()

void Attribute::sub_base ( int32_t  val,
bool  notify = true 
)
virtual

◆ sub_equip()

void Attribute::sub_equip ( int32_t  val,
bool  notify = true 
)
virtual

◆ sub_status()

void Attribute::sub_status ( int32_t  val,
bool  notify = true 
)
virtual

◆ total()

◆ unit() [1/2]

std::shared_ptr< Unit > Horizon::Zone::Traits::Attribute::unit ( )
inline
259{ return _unit.lock(); }

References _unit.

Referenced by operator=().

+ Here is the caller graph for this function:

◆ unit() [2/2]

void Horizon::Zone::Traits::Attribute::unit ( std::shared_ptr< Unit e)
inline
260{ _unit = e; }

References _unit.

◆ update()

void Horizon::Zone::Traits::Attribute::update ( uint64_t  delta)
inline
378 {
380 if (_apply_periodic_changes == true) {
382 }
383 }
void update(uint64_t delta)
Definition: Attribute.cpp:155
void update(uint64_t delta)
Definition: Attribute.cpp:132

References _apply_periodic_changes, _periodic_changes, _temporary_changes, Horizon::Zone::Traits::TemporaryChanges::update(), and Horizon::Zone::Traits::PeriodicChanges::update().

+ Here is the call graph for this function:

Member Data Documentation

◆ _apply_periodic_changes

bool Horizon::Zone::Traits::Attribute::_apply_periodic_changes {false}
protected

Referenced by apply(), reset(), and update().

◆ _base_val

int32_t Horizon::Zone::Traits::Attribute::_base_val {0}
protected

◆ _calculate_ready

bool Horizon::Zone::Traits::Attribute::_calculate_ready {false}
protected

Referenced by apply(), and is_compute_ready().

◆ _equip_val

int32_t Horizon::Zone::Traits::Attribute::_equip_val {0}
protected

◆ _periodic_changes

PeriodicChanges Horizon::Zone::Traits::Attribute::_periodic_changes {this}
private

◆ _permanent_changes

PermanentChanges Horizon::Zone::Traits::Attribute::_permanent_changes {this}
private

◆ _recalculate_flag

bool Horizon::Zone::Traits::Attribute::_recalculate_flag {false}
protected

Referenced by needs_recalculation(), and recalculate().

◆ _status_point_type

status_point_type Horizon::Zone::Traits::Attribute::_status_point_type {status_point_type::STATUS_POINT_INVALID}
protected

Referenced by get_type().

◆ _status_val

int32_t Horizon::Zone::Traits::Attribute::_status_val {0}
protected

◆ _temporary_changes

TemporaryChanges Horizon::Zone::Traits::Attribute::_temporary_changes {this}
private

◆ _unit

std::weak_ptr<Unit> Horizon::Zone::Traits::Attribute::_unit
private

Referenced by unit().


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