65 lines
1.7 KiB
C++
65 lines
1.7 KiB
C++
#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::XTimerAttacher xtimer_attacher;
|
|
bool is_treasure_box = false;
|
|
bool is_terminator_airdrop_box = false;
|
|
CreatureWeakPtr master;
|
|
int real_object_uniid = 0;
|
|
std::shared_ptr<Ability> context_ability;
|
|
bool sweep_lock = false;
|
|
|
|
virtual ~RoomObstacle() override;
|
|
virtual void Initialize() override;
|
|
virtual void RecalcSelfCollider() override;
|
|
virtual bool IsTerminatorAirDropBox(Room* room) override { return is_terminator_airdrop_box; }
|
|
virtual bool DoInteraction(Human* sender) override;
|
|
void ActiveTimerFunc();
|
|
void UpdateTimerFunc();
|
|
void Active();
|
|
void DetachFromMaster();
|
|
virtual void Die(Room* room) override;
|
|
Entity* GetRealObject(Room* room);
|
|
|
|
RoomObstacleWeakPtrChunk* GetWeakPtrChunk() { return &weak_ptr_chunk_; };
|
|
RoomObstacleWeakPtr AllocWeakPtr();
|
|
RoomObstacleWeakPtr& GetWeakPtrRef();
|
|
|
|
private:
|
|
void SpecExplosion();
|
|
void ActiveSelfExplosion();
|
|
void ActiveMine();
|
|
void ActiveTrap();
|
|
void ActivePosionGas();
|
|
void ActiveSpring();
|
|
void ActiveHideHouse();
|
|
void ActiveGully();
|
|
void ActiveAirDrop();
|
|
void ActiveKeepRangeBuff();
|
|
|
|
void SummonAirDropBox(int box_id);
|
|
void ProcKeepRangeBuff();
|
|
|
|
protected:
|
|
RoomObstacleWeakPtr weak_ptr_;
|
|
RoomObstacleWeakPtrChunk weak_ptr_chunk_;
|
|
|
|
std::set<GridCell*>* grid_list_ = nullptr;
|
|
int explosion_times_ = 0;
|
|
bool detached_ = false;
|
|
std::map<int, CreatureWeakPtr>* hit_objects_ = nullptr;
|
|
|
|
RoomObstacle();
|
|
|
|
friend class EntityFactory;
|
|
};
|