1
This commit is contained in:
parent
94c8f64887
commit
31d6f2693b
@ -2704,6 +2704,9 @@ Hero* Creature::InternalSummonHero(Buff* buff, MetaData::Player* hero_meta, a8::
|
||||
born_pos.x,
|
||||
born_pos.y
|
||||
);
|
||||
if (obstacle) {
|
||||
obstacle->DestoryAt(std::get<1>(tuple));
|
||||
}
|
||||
delay_time += std::get<1>(tuple);
|
||||
}
|
||||
SummonHeroInfo* summon_info = new SummonHeroInfo;
|
||||
|
@ -743,3 +743,23 @@ void RoomObstacle::InstallPreExplostionSummonTimer()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void RoomObstacle::DestoryAt(int time)
|
||||
{
|
||||
room->xtimer.AddDeadLineTimerAndAttach
|
||||
(
|
||||
time / FRAME_RATE_MS,
|
||||
a8::XParams()
|
||||
.SetSender(this),
|
||||
[] (const a8::XParams& param)
|
||||
{
|
||||
RoomObstacle* obstacle = (RoomObstacle*)param.sender.GetUserData();
|
||||
obstacle->DetachFromMaster();
|
||||
#ifdef DEBUG
|
||||
obstacle->room->BroadcastDebugMsg
|
||||
(a8::Format("obstacle destory %d", {obstacle->meta->i->thing_id()}));
|
||||
#endif
|
||||
},
|
||||
&xtimer_attacher.timer_list_
|
||||
);
|
||||
}
|
||||
|
@ -40,6 +40,7 @@ class RoomObstacle : public Obstacle
|
||||
RoomObstacleWeakPtr& GetWeakPtrRef();
|
||||
void Destory();
|
||||
void PushCollisionObjects();
|
||||
void DestoryAt(int time);
|
||||
|
||||
private:
|
||||
void SpecExplosion();
|
||||
|
Loading…
x
Reference in New Issue
Block a user