#pragma once #include "weakptr.h" #include "gridservice.h" #include "obstacle.h" #include "weakptr.h" class Ability; class RoomObstacle : public Obstacle { public: Room* room = nullptr; a8::Attacher xtimer_attacher; CreatureWeakPtr master; int real_object_uniid = 0; std::shared_ptr context_ability; bool sweep_lock = false; const mt::Buff* buff_meta = nullptr; const mt::Skill* skill_meta = nullptr; long long born_frameno = 0; a8::XTimerWp life_time_timer; virtual ~RoomObstacle() override; virtual void Initialize() override; virtual bool DoInteraction(Human* sender) override; virtual void OnBattleStart(Room* room) override; void ActiveTimerFunc(); void UpdateTimerFunc(); void Active(); virtual void Die(Room* room) override; Entity* GetRealObject(Room* room); RoomObstacleWeakPtrChunk* GetWeakPtrChunk() { return &weak_ptr_chunk_; }; RoomObstacleWeakPtr AllocWeakPtr(); RoomObstacleWeakPtr& GetWeakPtrRef(); void Destory(); void PushCollisionObjects(); void DestoryAt(int time); private: void SpecExplosion(int delay_time = 0); void ActiveSelfExplosion(); void ActiveMine(); void ActiveTrap(); void ActivePosionGas(); void ActiveSpring(); void ActiveHideHouse(); void ActiveGully(); void ActiveAirDrop(); void ActiveKeepRangeBuff(); void ActiveStrengthenWall(); void ActiveMedicalStation(); void SummonAirDropBox(int box_id); void ProcKeepRangeBuff(); void DetachFromMaster(); void InstallPreExplostionSummonTimer(); void CalcTempPassObjects(); protected: RoomObstacleWeakPtr weak_ptr_; RoomObstacleWeakPtrChunk weak_ptr_chunk_; std::set* grid_list_ = nullptr; int explosion_times_ = 0; bool detached_ = false; std::map* hit_objects_ = nullptr; std::shared_ptr> pos_list; int total_explosion_times_ = 0; std::map* temp_pass_objects_ = nullptr; RoomObstacle(); friend class EntityFactory; };