This commit is contained in:
aozhiwei 2022-01-06 13:16:54 +08:00
parent 94c8f64887
commit 31d6f2693b
3 changed files with 24 additions and 0 deletions

View File

@ -2704,6 +2704,9 @@ Hero* Creature::InternalSummonHero(Buff* buff, MetaData::Player* hero_meta, a8::
born_pos.x, born_pos.x,
born_pos.y born_pos.y
); );
if (obstacle) {
obstacle->DestoryAt(std::get<1>(tuple));
}
delay_time += std::get<1>(tuple); delay_time += std::get<1>(tuple);
} }
SummonHeroInfo* summon_info = new SummonHeroInfo; SummonHeroInfo* summon_info = new SummonHeroInfo;

View File

@ -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_
);
}

View File

@ -40,6 +40,7 @@ class RoomObstacle : public Obstacle
RoomObstacleWeakPtr& GetWeakPtrRef(); RoomObstacleWeakPtr& GetWeakPtrRef();
void Destory(); void Destory();
void PushCollisionObjects(); void PushCollisionObjects();
void DestoryAt(int time);
private: private:
void SpecExplosion(); void SpecExplosion();