forked from Dzejrou/tdt
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCombatHelper.hpp
More file actions
103 lines (91 loc) · 2.9 KB
/
Copy pathCombatHelper.hpp
File metadata and controls
103 lines (91 loc) · 2.9 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
#pragma once
#include <Ogre.h>
#include <tuple>
#include <random>
#include <numeric>
#include <cstdlib>
#include "Enums.hpp"
#include "Util.hpp"
class EntitySystem;
/**
* Namespace containing auxiliary functions that help with the management of
* the combat component.
*/
namespace CombatHelper
{
/**
* Brief: Changes the target of a given entity's attack.
* Param: EntitySystem containing the entity and it's target.
* Param: ID of the entity.
* Param: ID of the target.
*/
void set_target(EntitySystem&, std::size_t, std::size_t);
/**
* Brief: Returns the target of a given entity's attack.
* Param: EntitySystem containing the entity.
* Param: ID of the entity.
*/
std::size_t get_target(EntitySystem&, std::size_t);
/**
* Brief: Changes the attack range of a given entity.
* Param: EntitySystem containing the entity.
* Param: ID of the entity.
* Param: The new attack range.
*/
void set_range(EntitySystem&, std::size_t, Ogre::Real);
/**
* Brief: Returns the attack range of a given entity.
* Param: EntitySystem containing the entity.
* Param: ID of the entity.
*/
Ogre::Real get_range(EntitySystem&, std::size_t);
/**
* Brief: Changes the damage range (min damage, max damage) that a given
* entity can deal when attacking.
* Param: EntitySystem containing the entity.
* Param: ID of the entity.
* Param: Minimal damage value.
* Param: Maximal damage value.
*/
void set_dmg_range(EntitySystem&, std::size_t, std::size_t, std::size_t);
/**
* Brief: Returns the damage range (in the form of a 2-member tuple) of
* a given entity.
* Param: EntitySystem containing the entity.
* Param: ID of the entity.
*/
std::tuple<std::size_t, std::size_t> get_dmg_range(EntitySystem&, std::size_t);
/**
* Brief: Returns a pseudo random damage value between given two numbers,
* used to calculate the damage of each individual attack.
* Param: Minimal damage value.
* Param: Maximal damage value.
*/
std::size_t get_dmg(std::size_t, std::size_t);
/**
* Brief: Changes the cooldown (minimal time between attacks) of a given entity.
* Param: EntitySystem containing the entity.
* Param: ID of the entity.
* Param: The new cooldown value.
*/
void set_cooldown(EntitySystem&, std::size_t, Ogre::Real);
/**
* Brief: Returns the cooldown (minimal time between attacks) of a given entity.
* Param: EntitySystem containing the entity.
* Param: ID of the entity.
*/
Ogre::Real get_cooldown(EntitySystem&, std::size_t);
/**
* Brief: Changes the attack type of a given entity.
* Param: EntitySystem containing the entity.
* Param: ID of the entity.
* Param: The new attack type.
*/
void set_atk_type(EntitySystem&, std::size_t, ATTACK_TYPE);
/**
* Brief: Returns the attack type of a given entity.
* Param: EntitySystem containing the entity.
* Param: ID of the entity.
*/
ATTACK_TYPE get_atk_type(EntitySystem&, std::size_t);
}