Move buffs from Mob to CombatNPC

This commit is contained in:
gsemaj 2023-07-25 13:42:40 -04:00
parent 7a59248ace
commit c0e566050b
No known key found for this signature in database
GPG Key ID: 24B96BAA40497929
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*, 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)
: BaseNPC(angle, iID, t, id), maxHealth(maxHP) {
spawnX = x;

View File

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

View File

@ -41,7 +41,6 @@ struct Mob : public CombatNPC {
time_t lastDrainTime = 0;
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
std::unordered_map<int, Buff*> buffs = {};
// group
int groupLeader = 0;