1
This commit is contained in:
parent
c0a93635a4
commit
cdcd828893
@ -17,6 +17,7 @@
|
|||||||
#include "bullet.h"
|
#include "bullet.h"
|
||||||
#include "glmhelper.h"
|
#include "glmhelper.h"
|
||||||
#include "pbutils.h"
|
#include "pbutils.h"
|
||||||
|
#include "creature.h"
|
||||||
|
|
||||||
#include "mt/Param.h"
|
#include "mt/Param.h"
|
||||||
#include "mt/Buff.h"
|
#include "mt/Buff.h"
|
||||||
@ -40,6 +41,9 @@ void Buff::Init()
|
|||||||
INIT_LIST_HEAD(&depend_entry);
|
INIT_LIST_HEAD(&depend_entry);
|
||||||
INIT_LIST_HEAD(&cond_entry);
|
INIT_LIST_HEAD(&cond_entry);
|
||||||
INIT_LIST_HEAD(&on_remove_contexts);
|
INIT_LIST_HEAD(&on_remove_contexts);
|
||||||
|
for (int effect_id : meta->_effect_list) {
|
||||||
|
effect_list_.push_back(owner->AddEffect(effect_id));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void Buff::UnInit()
|
void Buff::UnInit()
|
||||||
@ -59,6 +63,10 @@ void Buff::UnInit()
|
|||||||
list_del_init(&cb->entry);
|
list_del_init(&cb->entry);
|
||||||
}
|
}
|
||||||
ClearEventHandlers();
|
ClearEventHandlers();
|
||||||
|
for (auto& effect : effect_list_) {
|
||||||
|
owner->RemoveEffect(effect);
|
||||||
|
}
|
||||||
|
effect_list_.clear();
|
||||||
}
|
}
|
||||||
|
|
||||||
int Buff::GetLeftTime()
|
int Buff::GetLeftTime()
|
||||||
|
@ -66,7 +66,7 @@ protected:
|
|||||||
std::list<Weapon> hold_weapons_;
|
std::list<Weapon> hold_weapons_;
|
||||||
std::list<std::weak_ptr<EventHandlerPtr>> event_handlers_;
|
std::list<std::weak_ptr<EventHandlerPtr>> event_handlers_;
|
||||||
CreatureWeakPtr caster_;
|
CreatureWeakPtr caster_;
|
||||||
std::list<std::shared_ptr<Effect>> effect_list_;
|
std::list<std::weak_ptr<Effect>> effect_list_;
|
||||||
|
|
||||||
friend class PBUtils;
|
friend class PBUtils;
|
||||||
};
|
};
|
||||||
|
@ -30,11 +30,9 @@ namespace mt
|
|||||||
{
|
{
|
||||||
std::vector<std::string> strings;
|
std::vector<std::string> strings;
|
||||||
a8::Split(effect_list(), strings, '|');
|
a8::Split(effect_list(), strings, '|');
|
||||||
#if 0
|
|
||||||
for (auto& str : strings) {
|
for (auto& str : strings) {
|
||||||
_child_buff_list.push_back(a8::XValue(str));
|
_effect_list.push_back(a8::XValue(str));
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
{
|
{
|
||||||
std::vector<std::string> strings;
|
std::vector<std::string> strings;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user