1
This commit is contained in:
parent
59abd5958b
commit
194360aed8
@ -172,6 +172,12 @@ void CallFuncBuff::Activate()
|
|||||||
{
|
{
|
||||||
SummonCarSpecPoint();
|
SummonCarSpecPoint();
|
||||||
}
|
}
|
||||||
|
break;
|
||||||
|
case BuffCallFunc_e::kRangeHoldBuff:
|
||||||
|
{
|
||||||
|
RangeHoldBuff();
|
||||||
|
}
|
||||||
|
break;
|
||||||
default:
|
default:
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
@ -964,3 +970,82 @@ void CallFuncBuff::SummonCarSpecPoint()
|
|||||||
},
|
},
|
||||||
&owner->room->xtimer_attacher_);
|
&owner->room->xtimer_attacher_);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void CallFuncBuff::RangeHoldBuff()
|
||||||
|
{
|
||||||
|
struct InnerObject
|
||||||
|
{
|
||||||
|
CreatureWeakPtr c;
|
||||||
|
std::set<int> buff_uniids;
|
||||||
|
|
||||||
|
void OnEnter()
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
void OnLeave()
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
|
auto context = A8_MAKE_ANON_STRUCT_SHARED
|
||||||
|
(
|
||||||
|
std::map<int, InnerObject> in_human_infos;
|
||||||
|
int keep_buff_uniid = 0;
|
||||||
|
);
|
||||||
|
|
||||||
|
auto on_enter =
|
||||||
|
[this, context] (Human* hum)
|
||||||
|
{
|
||||||
|
if (context->in_human_infos.find(hum->GetUniId()) != context->in_human_infos.end()) {
|
||||||
|
abort();
|
||||||
|
}
|
||||||
|
//context->in_human_infos[hum->GetUniId()] = o;
|
||||||
|
//context->in_human_infos[hum->GetUniId()].OnEnter();
|
||||||
|
};
|
||||||
|
auto on_stay =
|
||||||
|
[this, context] (Human* hum)
|
||||||
|
{
|
||||||
|
};
|
||||||
|
auto on_leave =
|
||||||
|
[this, context] (Human* hum)
|
||||||
|
{
|
||||||
|
auto itr = context->in_human_infos.find(hum->GetUniId());
|
||||||
|
if (itr == context->in_human_infos.end()) {
|
||||||
|
abort();
|
||||||
|
}
|
||||||
|
for (int buff_uniid : itr->second.buff_uniids) {
|
||||||
|
hum->RemoveBuffByUniId(buff_uniid);
|
||||||
|
}
|
||||||
|
itr->second.OnLeave();
|
||||||
|
};
|
||||||
|
auto check_cb =
|
||||||
|
[this, context, on_enter, on_stay, on_leave]
|
||||||
|
()
|
||||||
|
{
|
||||||
|
if (owner->HasBuffEffect(kBET_Fly) ||
|
||||||
|
owner->HasBuffEffect(kBET_Jump)) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (!owner->dead) {
|
||||||
|
|
||||||
|
};
|
||||||
|
};
|
||||||
|
{
|
||||||
|
event_handlers_.push_back(owner->GetTrigger()->AddListener
|
||||||
|
(
|
||||||
|
kDieEvent,
|
||||||
|
[this, context] (const a8::Args& args) mutable
|
||||||
|
{
|
||||||
|
if (context->keep_buff_uniid) {
|
||||||
|
owner->RemoveBuffByUniId(context->keep_buff_uniid);
|
||||||
|
context->keep_buff_uniid = 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
));
|
||||||
|
}
|
||||||
|
{
|
||||||
|
context->keep_buff_uniid = owner->TryAddBuff(GetCaster().Get(), meta->_int_buff_param4, skill_meta);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
@ -29,6 +29,9 @@ A8_DECLARE_CLASS_ENUM(BuffCallFunc_e, int,
|
|||||||
kAddMaxHp = 29,
|
kAddMaxHp = 29,
|
||||||
kSummonCarSpecPoint = 30,
|
kSummonCarSpecPoint = 30,
|
||||||
kBossAnimi = 31,
|
kBossAnimi = 31,
|
||||||
|
kAntiHide = 32,
|
||||||
|
kDisableClientSkill = 33,
|
||||||
|
kRangeHoldBuff = 34,
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
||||||
@ -59,6 +62,7 @@ class CallFuncBuff : public Buff
|
|||||||
void ClearSummonObstacle();
|
void ClearSummonObstacle();
|
||||||
void DecSkillCd();
|
void DecSkillCd();
|
||||||
void SummonCarSpecPoint();
|
void SummonCarSpecPoint();
|
||||||
|
void RangeHoldBuff();
|
||||||
|
|
||||||
float hold_param2_ = 0.0;
|
float hold_param2_ = 0.0;
|
||||||
Weapon* hold_weapon_ = nullptr;
|
Weapon* hold_weapon_ = nullptr;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user