1
This commit is contained in:
parent
d43e781022
commit
9b77cb1b91
@ -809,9 +809,19 @@ void Bullet::ProcFlyHook(Entity* target)
|
|||||||
if (target->IsCreature(room)) {
|
if (target->IsCreature(room)) {
|
||||||
Creature* c = (Creature*)target;
|
Creature* c = (Creature*)target;
|
||||||
room->frame_event.AddPropChg(c->GetWeakPtrRef(), kPropBeHook, 0, sender.Get()->GetUniId());
|
room->frame_event.AddPropChg(c->GetWeakPtrRef(), kPropBeHook, 0, sender.Get()->GetUniId());
|
||||||
c->AutoNavigation(born_pos, gun_meta->i->bullet_speed() * 2);
|
int buff_uniid = c->TryAddBuff(c, gun_meta->i->buffid());
|
||||||
|
c->AutoNavigation(born_pos, gun_meta->i->bullet_speed() * 2,
|
||||||
|
[buff_uniid] (Creature* c)
|
||||||
|
{
|
||||||
|
c->RemoveBuffByUniId(buff_uniid);
|
||||||
|
}
|
||||||
|
);
|
||||||
} else {
|
} else {
|
||||||
sender.Get()->AutoNavigation(GetPos(), gun_meta->i->bullet_speed() * 2);
|
sender.Get()->AutoNavigation(GetPos(), gun_meta->i->bullet_speed() * 2,
|
||||||
|
[] (Creature* c)
|
||||||
|
{
|
||||||
|
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
sender.Get()->IncDisableMoveTimes();
|
sender.Get()->IncDisableMoveTimes();
|
||||||
|
@ -3616,7 +3616,8 @@ void Creature::_UpdateSpecMove()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void Creature::AutoNavigation(a8::Vec2 target_pos, float speed)
|
void Creature::AutoNavigation(a8::Vec2 target_pos, float speed,
|
||||||
|
std::function<void (Creature*)> cb)
|
||||||
{
|
{
|
||||||
float distance = GetPos().Distance(target_pos);
|
float distance = GetPos().Distance(target_pos);
|
||||||
if (distance < 0.001f) {
|
if (distance < 0.001f) {
|
||||||
|
@ -278,7 +278,8 @@ class Creature : public MoveableEntity
|
|||||||
float GetAttrAbs(int attr_id);
|
float GetAttrAbs(int attr_id);
|
||||||
float GetAttrRate(int attr_id);
|
float GetAttrRate(int attr_id);
|
||||||
void RecalcDtoAttr();
|
void RecalcDtoAttr();
|
||||||
void AutoNavigation(a8::Vec2 target_pos, float speed);
|
void AutoNavigation(a8::Vec2 target_pos, float speed,
|
||||||
|
std::function<void (Creature*)> cb);
|
||||||
void AddTraceBullet(int bullet_uniid, int target_uniid, int gun_id);
|
void AddTraceBullet(int bullet_uniid, int target_uniid, int gun_id);
|
||||||
void LockAttackDir(int time);
|
void LockAttackDir(int time);
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user