This commit is contained in:
aozhiwei 2021-07-23 11:27:23 +00:00
parent 49fa3bb28b
commit f7f8dcbc57
5 changed files with 20 additions and 0 deletions

View File

@ -170,6 +170,17 @@ namespace MetaData
a8::SetBitFlag(receive_special_damage_type, n); a8::SetBitFlag(receive_special_damage_type, n);
} }
} }
{
std::vector<std::string> strings;
a8::Split(i->sweep_tags(), strings, '|');
for (auto& str : strings) {
int n = a8::XValue(str);
if (n <= 0 || n > 63) {
abort();
}
a8::SetBitFlag(sweep_tags, n);
}
}
{ {
int_param1 = a8::XValue(i->param1()); int_param1 = a8::XValue(i->param1());
float_param1 = a8::XValue(i->param1()).GetDouble(); float_param1 = a8::XValue(i->param1()).GetDouble();

View File

@ -53,6 +53,7 @@ namespace MetaData
float float_param1 = 0; float float_param1 = 0;
int int_param2 = 0; int int_param2 = 0;
float float_param2 = 0; float float_param2 = 0;
long long sweep_tags = 0;
void Init(); void Init();
}; };

View File

@ -52,6 +52,7 @@ public:
bool debug_trace = false; bool debug_trace = false;
bool added_to_over_room = false; bool added_to_over_room = false;
a8::Vec2 last_player_jump_pos; a8::Vec2 last_player_jump_pos;
std::map<int, RoomObstacleWeakPtr> mine_objects;
~Room(); ~Room();
void InitData(RoomInitInfo& init_info); void InitData(RoomInitInfo& init_info);

View File

@ -45,12 +45,18 @@ RoomObstacle::~RoomObstacle()
if (!hit_objects_) { if (!hit_objects_) {
A8_SAFE_DELETE(hit_objects_); A8_SAFE_DELETE(hit_objects_);
} }
if (meta->sweep_tags != 0) {
room->mine_objects.erase(GetUniId());
}
} }
void RoomObstacle::Initialize() void RoomObstacle::Initialize()
{ {
Obstacle::Initialize(); Obstacle::Initialize();
xtimer_attacher.xtimer = &room->xtimer; xtimer_attacher.xtimer = &room->xtimer;
if (meta->sweep_tags != 0) {
room->mine_objects[GetUniId()] = GetWeakPtrRef();
}
} }
void RoomObstacle::RecalcSelfCollider() void RoomObstacle::RecalcSelfCollider()

View File

@ -71,6 +71,7 @@ message MapThing
optional int32 bullet_hit = 28; optional int32 bullet_hit = 28;
optional int32 collision_hit = 29; optional int32 collision_hit = 29;
optional int32 explosion_hit = 30; optional int32 explosion_hit = 30;
optional string sweep_tags = 31;
} }
message SafeArea message SafeArea