1
This commit is contained in:
parent
9d617d6970
commit
44da536ac7
@ -462,24 +462,12 @@ void Skill::ProcJSHX()
|
|||||||
|
|
||||||
void Skill::ProcSWZB()
|
void Skill::ProcSWZB()
|
||||||
{
|
{
|
||||||
owner->GetTrigger()->AddListener
|
|
||||||
(
|
struct _Nested
|
||||||
kPreDieEvent,
|
|
||||||
[this] (const a8::Args& args)
|
|
||||||
{
|
{
|
||||||
int killer_id = args.Get<int>(0);
|
static void cb(CreatureWeakPtr sender, Entity* e, const mt::Skill* skill_meta)
|
||||||
CreatureWeakPtr sender = owner->GetWeakPtrRef();
|
|
||||||
const mt::Skill* skill_meta = meta;
|
|
||||||
Position center = owner->GetPos();
|
|
||||||
std::shared_ptr<Explosion> e = EntityFactory::Instance()->MakeExplosion();
|
|
||||||
e->SetThrough(true);
|
|
||||||
e->SetNoSync();
|
|
||||||
e->SetHitCb
|
|
||||||
(
|
|
||||||
[sender, center, skill_meta] (const a8::Args& args) mutable
|
|
||||||
{
|
{
|
||||||
if (sender.Get()) {
|
if (sender.Get()) {
|
||||||
Entity* e = args.Get<Entity*>(0);
|
|
||||||
if (e->IsCreature(sender.Get()->room)) {
|
if (e->IsCreature(sender.Get()->room)) {
|
||||||
Creature* c = (Creature*)e;
|
Creature* c = (Creature*)e;
|
||||||
if (c->IsInvincible()) {
|
if (c->IsInvincible()) {
|
||||||
@ -508,6 +496,27 @@ void Skill::ProcSWZB()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
owner->GetTrigger()->AddListener
|
||||||
|
(
|
||||||
|
kPreDieEvent,
|
||||||
|
[this] (const a8::Args& args)
|
||||||
|
{
|
||||||
|
int killer_id = args.Get<int>(0);
|
||||||
|
CreatureWeakPtr sender = owner->GetWeakPtrRef();
|
||||||
|
const mt::Skill* skill_meta = meta;
|
||||||
|
Position center = owner->GetPos();
|
||||||
|
std::shared_ptr<Explosion> e = EntityFactory::Instance()->MakeExplosion();
|
||||||
|
e->SetThrough(true);
|
||||||
|
e->SetNoSync();
|
||||||
|
e->SetHitCb
|
||||||
|
(
|
||||||
|
[sender, center, skill_meta] (const a8::Args& args) mutable
|
||||||
|
{
|
||||||
|
Entity* e = args.Get<Entity*>(0);
|
||||||
|
_Nested::cb(sender, e, skill_meta);
|
||||||
|
}
|
||||||
);
|
);
|
||||||
e->EnemyAndObstacleAttack
|
e->EnemyAndObstacleAttack
|
||||||
(
|
(
|
||||||
|
Loading…
x
Reference in New Issue
Block a user