This commit is contained in:
aozhiwei 2024-03-06 10:48:18 +08:00
parent 29bb2084f7
commit bef93e4fc2
5 changed files with 23 additions and 1 deletions

View File

@ -41,6 +41,7 @@ void Buff::Init()
INIT_LIST_HEAD(&effect_entry);
INIT_LIST_HEAD(&depend_entry);
INIT_LIST_HEAD(&cond_entry);
INIT_LIST_HEAD(&break_skill_entry);
INIT_LIST_HEAD(&on_remove_contexts);
for (int effect_id : meta->_effect_list) {
effect_list_.push_back(owner->AddEffect(effect_id));
@ -60,6 +61,9 @@ void Buff::UnInit()
if (!list_empty(&cond_entry)) {
list_del_init(&cond_entry);
}
if (!list_empty(&break_skill_entry)) {
list_del_init(&break_skill_entry);
}
while (!list_empty(&on_remove_contexts)) {
RemoveBuffCbConext* cb = list_last_entry(&on_remove_contexts,
RemoveBuffCbConext,

View File

@ -31,6 +31,7 @@ class Buff
list_head effect_entry;
list_head depend_entry;
list_head cond_entry;
list_head break_skill_entry;
list_head on_remove_contexts;
a8::XTimerWp remover_timer;
std::shared_ptr<a8::Args> init_args;

View File

@ -54,6 +54,7 @@
Creature::Creature():MoveableEntity()
{
INIT_LIST_HEAD(&break_skill_buffs_);
weak_ptr_chunk_.Set(this);
trigger_ = std::make_shared<Trigger>(this);
trigger_->Init();
@ -4129,3 +4130,16 @@ bool Creature::IsOb()
{
return a8::HasBitFlag(status, CS_IsOb);
}
bool Creature::HasBreakSkillBuffs(Buff* buff)
{
if (list_empty(&break_skill_buffs_)) {
return false;
}
return false;
}
void Creature::TriggerBreakSkill(Buff* buff)
{
}

View File

@ -208,6 +208,8 @@ class Creature : public MoveableEntity
void RecalcBuffAttr();
void RemoveBuffByEffectId(int buff_effect_id);
void ClearBuffList();
bool HasBreakSkillBuffs(Buff* buff);
void TriggerBreakSkill(Buff* buff);
void TriggerBuff(Skill* skill, std::set<Creature*>& target_list, BuffTriggerType_e trigger_type);
Skill* GetSkill(int skill_id);
Skill* GetMainSkill();
@ -480,6 +482,7 @@ private:
int follow_times_ = 0;
std::map<int, int> buff_tags_;
const mt::BattleHeroGrow* hero_grow_meta_ = nullptr;
list_head break_skill_buffs_;
int hero_level_ = 1;
int hero_exp_ = 0;

View File

@ -1038,7 +1038,7 @@ void Player::_CMMove(f8::MsgHdr* hdr, const cs::CMMove& msg)
}
}
}
#ifdef MYDEBUG
#ifdef MYDEBUG1
a8::XPrintf("attack_dir:%f,%f,%f cli_dir:%f,%f,%f\n",
{
GetAttackDir().x,