Move buffs from Mob to CombatNPC

This commit is contained in:
gsemaj 2023-07-25 13:42:40 -04:00 committed by gsemaj
parent c70205a15b
commit 0dd628717d
3 changed files with 7 additions and 1 deletions

View File

@ -104,6 +104,8 @@ struct CombatNPC : public BaseNPC, public ICombatant {
std::map<AIState, void (*)(CombatNPC*, time_t)> stateHandlers; std::map<AIState, void (*)(CombatNPC*, time_t)> stateHandlers;
std::map<AIState, void (*)(CombatNPC*, EntityRef)> transitionHandlers; std::map<AIState, void (*)(CombatNPC*, EntityRef)> transitionHandlers;
std::unordered_map<int, Buff*> buffs = {};
CombatNPC(int x, int y, int z, int angle, uint64_t iID, int t, int id, int maxHP) CombatNPC(int x, int y, int z, int angle, uint64_t iID, int t, int id, int maxHP)
: BaseNPC(angle, iID, t, id), maxHealth(maxHP) { : BaseNPC(angle, iID, t, id), maxHealth(maxHP) {
spawnX = x; spawnX = x;

View File

@ -3,6 +3,7 @@
#include "EntityRef.hpp" #include "EntityRef.hpp"
#include <vector> #include <vector>
#include <assert.h>
struct Group { struct Group {
std::vector<EntityRef> members; std::vector<EntityRef> members;
@ -14,6 +15,10 @@ struct Group {
}); });
return filtered; return filtered;
} }
EntityRef getLeader() {
assert(members.size() > 0);
return members[0];
}
Group(EntityRef leader); Group(EntityRef leader);
}; };

View File

@ -41,7 +41,6 @@ struct Mob : public CombatNPC {
time_t lastDrainTime = 0; time_t lastDrainTime = 0;
int skillStyle = -1; // -1 for nothing, 0-2 for corruption, -2 for eruption int skillStyle = -1; // -1 for nothing, 0-2 for corruption, -2 for eruption
int hitX = 0, hitY = 0, hitZ = 0; // for use in ability targeting int hitX = 0, hitY = 0, hitZ = 0; // for use in ability targeting
std::unordered_map<int, Buff*> buffs = {};
// group // group
int groupLeader = 0; int groupLeader = 0;