Horizon Official Technical Documentation
Horizon::Zone::CombatRegistry::MeleeResultOperation Class Reference

#include <Combat.hpp>

+ Inheritance diagram for Horizon::Zone::CombatRegistry::MeleeResultOperation:
+ Collaboration diagram for Horizon::Zone::CombatRegistry::MeleeResultOperation:

Classes

class  MeleeResultOperand
 

Public Types

enum  melee_result_operation_type { MELEE_RESULT_OPERATION_DAMAGE = 0 , MELEE_RESULT_OPERATION_HEALING }
 
- Public Types inherited from Horizon::Zone::CombatRegistry::CombatOperation
enum  combat_operation_type {
  COMBAT_OPERATION_ATTRIBUTE , COMBAT_OPERATION_APPEARANCE , COMBAT_OPERATION_STATUS , COMBAT_OPERATION_SKILL_EXECUTION ,
  COMBAT_OPERATION_MELEE_EXECUTION , COMBAT_OPERATION_SKILL_RESULT , COMBAT_OPERATION_MELEE_RESULT , COMBAT_OPERATION_MAX
}
 

Public Member Functions

 MeleeResultOperation ()=delete
 
 MeleeResultOperation (MeleeResultOperand *operand, melee_result_operation_type type, CombatValueDamage *value)
 
 MeleeResultOperation (MeleeResultOperand *operand, melee_result_operation_type type, CombatValueHealing *value)
 
 ~MeleeResultOperation ()
 
void execute () const override
 
- Public Member Functions inherited from Horizon::Zone::CombatRegistry::CombatOperation
 CombatOperation ()=delete
 
 CombatOperation (const CombatOperation &right)=delete
 
 CombatOperation (CombatOperation &&right)=delete
 
 CombatOperation (CombatOperand *operand, int operation_type, int operation_sub_type, CombatOperationValue *value)
 
 CombatOperation (CombatOperand *operand, int operation_type, int operation_sub_type)
 
virtual ~CombatOperation ()
 
virtual CombatOperandget_operand () const
 
int get_operation_type () const
 
int get_operation_sub_type () const
 
virtual CombatOperationValueget_operation_value () const
 
int get_priority ()
 
void set_priority (int priority)
 
virtual void execute () const =0
 
void operator= (const CombatOperation &operation)=delete
 

Additional Inherited Members

- Protected Attributes inherited from Horizon::Zone::CombatRegistry::CombatOperation
CombatOperand_operand {nullptr}
 
int _operation_type { 0 }
 
int _operation_sub_type { 0 }
 
CombatOperationValue_operation_value {nullptr}
 
int _priority { 0 }
 

Member Enumeration Documentation

◆ melee_result_operation_type

Enumerator
MELEE_RESULT_OPERATION_DAMAGE 
MELEE_RESULT_OPERATION_HEALING 

Constructor & Destructor Documentation

◆ MeleeResultOperation() [1/3]

Horizon::Zone::CombatRegistry::MeleeResultOperation::MeleeResultOperation ( )
delete

◆ MeleeResultOperation() [2/3]

Horizon::Zone::CombatRegistry::MeleeResultOperation::MeleeResultOperation ( MeleeResultOperand operand,
melee_result_operation_type  type,
CombatValueDamage value 
)
inline
581 : CombatOperation(operand, COMBAT_OPERATION_MELEE_RESULT, (int) type, value) { }
@ COMBAT_OPERATION_MELEE_RESULT
Definition: Combat.hpp:295

◆ MeleeResultOperation() [3/3]

Horizon::Zone::CombatRegistry::MeleeResultOperation::MeleeResultOperation ( MeleeResultOperand operand,
melee_result_operation_type  type,
CombatValueHealing value 
)
inline
584 : CombatOperation(operand, COMBAT_OPERATION_MELEE_RESULT, (int) type, value) { }

◆ ~MeleeResultOperation()

Horizon::Zone::CombatRegistry::MeleeResultOperation::~MeleeResultOperation ( )
inline
586{ }

Member Function Documentation

◆ execute()

void CombatRegistry::MeleeResultOperation::execute ( ) const
overridevirtual

Implements Horizon::Zone::CombatRegistry::CombatOperation.

568{
569 std::shared_ptr<Unit> source = get_operand()->get_source();
570 std::shared_ptr<Unit> target = get_operand()->get_target();
571
572 switch(get_operation_sub_type())
573 {
575 {
578 config.guid = source->guid();
579 config.target_guid = target->guid();
580 config.start_time = get_sys_time();
581 config.delay_skill = source->status()->attack_delay()->total();
582 config.delay_damage = source->status()->damage_walk_delay()->total();
583 config.damage = value->get_damage().right_damage;
584 config.is_sp_damaged = 0;
585 config.number_of_hits = value->get_damage().number_of_hits;
587 config.left_damage = value->get_damage().left_damage;
588 source->notify_nearby_players_of_basic_attack(config);
589 target->on_damage_received(source, value->get_damage().left_damage + value->get_damage().right_damage);
590 }
591 break;
593 {
594 // Could be a possibility?
595 }
596 break;
597 }
598}
@ ZCNA3_DAMAGE
Definition: ClientDefinitions.hpp:121
@ ZCNA3_CRITICAL_HIT
Definition: ClientDefinitions.hpp:131
int64_t get_sys_time()
Definition: Utility.cpp:68
std::shared_ptr< Unit > get_target()
Definition: Combat.hpp:263
std::shared_ptr< Unit > get_source()
Definition: Combat.hpp:262
int get_operation_sub_type() const
Definition: Combat.hpp:319
virtual CombatOperationValue * get_operation_value() const
Definition: Combat.hpp:320
virtual CombatOperand * get_operand() const
Definition: Combat.hpp:317
combat_damage get_damage()
Definition: Combat.hpp:224
int number_of_hits
Definition: CombatDefinitions.hpp:109
bool is_critical
Definition: CombatDefinitions.hpp:116
int64_t right_damage
Definition: CombatDefinitions.hpp:107
int64_t left_damage
Definition: CombatDefinitions.hpp:107
Definition: GridNotifiers.hpp:393
int is_sp_damaged
Definition: GridNotifiers.hpp:394
int delay_skill
Definition: GridNotifiers.hpp:394
int guid
Definition: GridNotifiers.hpp:394
int damage
Definition: GridNotifiers.hpp:394
int action_type
Definition: GridNotifiers.hpp:394
int number_of_hits
Definition: GridNotifiers.hpp:394
int delay_damage
Definition: GridNotifiers.hpp:394
int left_damage
Definition: GridNotifiers.hpp:394
int start_time
Definition: GridNotifiers.hpp:394
int target_guid
Definition: GridNotifiers.hpp:394

References s_grid_unit_basic_attack_config::action_type, s_grid_unit_basic_attack_config::damage, s_grid_unit_basic_attack_config::delay_damage, s_grid_unit_basic_attack_config::delay_skill, Horizon::Zone::CombatRegistry::CombatValueDamage::get_damage(), get_sys_time(), s_grid_unit_basic_attack_config::guid, combat_damage::is_critical, s_grid_unit_basic_attack_config::is_sp_damaged, combat_damage::left_damage, s_grid_unit_basic_attack_config::left_damage, combat_damage::number_of_hits, s_grid_unit_basic_attack_config::number_of_hits, combat_damage::right_damage, s_grid_unit_basic_attack_config::start_time, s_grid_unit_basic_attack_config::target_guid, ZCNA3_CRITICAL_HIT, and ZCNA3_DAMAGE.

+ Here is the call graph for this function:

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