1
This commit is contained in:
parent
0cda57c482
commit
1b7e3ebe6d
@ -299,9 +299,10 @@ int Creature::GetBuffNum(int buff_id)
|
|||||||
}
|
}
|
||||||
|
|
||||||
int Creature::AddBuff(Creature* caster,
|
int Creature::AddBuff(Creature* caster,
|
||||||
MetaData::Buff* buff_meta,
|
MetaData::Buff* buff_meta,
|
||||||
int skill_lv,
|
int skill_lv,
|
||||||
MetaData::Skill* buff_skill_meta)
|
MetaData::Skill* buff_skill_meta,
|
||||||
|
bool no_check_immune)
|
||||||
{
|
{
|
||||||
if (buff_meta->only_spec_race) {
|
if (buff_meta->only_spec_race) {
|
||||||
if (!a8::HasBitFlag(buff_meta->only_spec_race, GetEntityType())) {
|
if (!a8::HasBitFlag(buff_meta->only_spec_race, GetEntityType())) {
|
||||||
@ -336,7 +337,7 @@ int Creature::AddBuff(Creature* caster,
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (IsImmuneBuffEffect(buff_meta->i->buff_effect())) {
|
if (!no_check_immune && IsImmuneBuffEffect(buff_meta->i->buff_effect())) {
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
if (buff_meta->i->depend_effect() != 0 && !HasBuffEffect(buff_meta->i->depend_effect())) {
|
if (buff_meta->i->depend_effect() != 0 && !HasBuffEffect(buff_meta->i->depend_effect())) {
|
||||||
@ -400,7 +401,7 @@ int Creature::AddBuff(Creature* caster,
|
|||||||
for (int child_buff_id : buff->meta->child_buff_list) {
|
for (int child_buff_id : buff->meta->child_buff_list) {
|
||||||
MetaData::Buff* child_buff_meta = MetaMgr::Instance()->GetBuff(child_buff_id);
|
MetaData::Buff* child_buff_meta = MetaMgr::Instance()->GetBuff(child_buff_id);
|
||||||
if (child_buff_meta) {
|
if (child_buff_meta) {
|
||||||
AddBuff(caster, child_buff_meta, skill_lv, buff_skill_meta);
|
AddBuff(caster, child_buff_meta, skill_lv, buff_skill_meta, true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -121,9 +121,10 @@ class Creature : public MoveableEntity
|
|||||||
Buff* GetBuffByUniId(int buff_uniid);
|
Buff* GetBuffByUniId(int buff_uniid);
|
||||||
int GetBuffNum(int buff_id);
|
int GetBuffNum(int buff_id);
|
||||||
int AddBuff(Creature* caster,
|
int AddBuff(Creature* caster,
|
||||||
MetaData::Buff* buff_meta,
|
MetaData::Buff* buff_meta,
|
||||||
int skill_lv,
|
int skill_lv,
|
||||||
MetaData::Skill* buff_skill_meta = nullptr);
|
MetaData::Skill* buff_skill_meta = nullptr,
|
||||||
|
bool no_check_immune = false);
|
||||||
bool IsImmuneBuffEffect(int buff_effect);
|
bool IsImmuneBuffEffect(int buff_effect);
|
||||||
int MustBeAddBuff(Creature* caster, int buff_id);
|
int MustBeAddBuff(Creature* caster, int buff_id);
|
||||||
int TryAddBuff(Creature* caster, int buff_id);
|
int TryAddBuff(Creature* caster, int buff_id);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user