This commit is contained in:
aozhiwei 2022-10-26 17:29:24 +08:00
parent fde4c50b68
commit 3ffa7abaf2
2 changed files with 29 additions and 3 deletions

View File

@ -11,7 +11,7 @@
float VirtualBullet::GetStrengthenWall()
{
return 0;
return strengthened_;
}
long long VirtualBullet::GetWeaponUniId()
@ -117,7 +117,6 @@ void VirtualBullet::Check(float distance)
//穿物件
continue;
}
#if 0
if (!obstacle->CanThroughable(this)) {
if (TestCollision(room, collider)) {
objects.insert(collider->owner);
@ -149,7 +148,6 @@ void VirtualBullet::Check(float distance)
}
}
}
#endif
}
}
}
@ -287,3 +285,27 @@ bool VirtualBullet::TestCollision(Room* room, ColliderComponent* b)
{
return false;
}
void VirtualBullet::OnStrengthen(Obstacle* ob)
{
if (ob->IsRoomObstacle()) {
RoomObstacle* room_ob = ob->AsRoomObstacle();
if (room_ob->skill_meta) {
MetaData::Skill* skill_meta = room_ob->skill_meta;
if (skill_meta && skill_meta->number_meta) {
switch (skill_meta->GetMagicId()) {
case MAGIC_WLFB:
{
strengthen_wall = skill_meta->number_meta->float_ratio2;
}
break;
default:
{
}
break;
}
}
}
}
}

View File

@ -8,6 +8,7 @@ namespace MetaData
struct GridCell;
class Room;
class Obstacle;
class VirtualBullet : public IBullet, public ITask
{
public:
@ -23,6 +24,7 @@ class VirtualBullet : public IBullet, public ITask
a8::Vec2 dir;
a8::Vec2 born_pos;
a8::Vec2 born_dir;
float strengthen_wall = 0;
virtual float GetStrengthenWall() override;
virtual long long GetWeaponUniId() override;
@ -49,11 +51,13 @@ class VirtualBullet : public IBullet, public ITask
std::set<GridCell*>& GetGridList() { return grid_list_; };
bool TestCollision(Room* room, Entity* b);
bool TestCollision(Room* room, ColliderComponent* b);
void OnStrengthen(Obstacle* ob);
private:
bool later_removed_ = false;
a8::Vec2 pos_;
std::set<GridCell*> grid_list_;
std::set<int> hit_objects_;
float strengthened_ = 0.0f;
};