|
|
@ -200,18 +200,18 @@ void Monster::STRATEGY::STONE_GOLEM(Monster&m,float fElapsedTime,std::string str |
|
|
|
|
|
|
|
|
|
|
|
if(m.F(A::CASTING_TIMER)<=0.f){ |
|
|
|
if(m.F(A::CASTING_TIMER)<=0.f){ |
|
|
|
game->SetupWorldShake(ConfigFloat("Shockwave.Shockwave Screen Shake Time")); |
|
|
|
game->SetupWorldShake(ConfigFloat("Shockwave.Shockwave Screen Shake Time")); |
|
|
|
bool isSafe{false}; |
|
|
|
bool playerIsSafe{false}; |
|
|
|
for(std::any&data:m.VEC(A::STAGE_POLYGONS)){ |
|
|
|
for(std::any&data:m.VEC(A::STAGE_POLYGONS)){ |
|
|
|
std::vector<geom2d::triangle<float>>collisionTris{any_cast<StageMaskPolygon>(data).GetCollisionTriangles()}; |
|
|
|
std::vector<geom2d::triangle<float>>collisionTris{any_cast<StageMaskPolygon>(data).GetCollisionTriangles()}; |
|
|
|
for(geom2d::triangle<float>tri:collisionTris){ |
|
|
|
for(const geom2d::triangle<float>&tri:collisionTris){ |
|
|
|
if(geom2d::overlaps(game->GetPlayer()->Hitbox(),tri)){ |
|
|
|
if(geom2d::overlaps(game->GetPlayer()->Hitbox(),tri)){ |
|
|
|
isSafe=true; |
|
|
|
playerIsSafe=true; |
|
|
|
goto DoneWithCollisionCheck; |
|
|
|
goto DoneWithCollisionCheck; |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
DoneWithCollisionCheck: |
|
|
|
DoneWithCollisionCheck: |
|
|
|
if(!isSafe){ |
|
|
|
if(!playerIsSafe){ |
|
|
|
game->GetPlayer()->Hurt(ConfigInt("Shockwave.Damage"),m.OnUpperLevel(),m.GetZ()); |
|
|
|
game->GetPlayer()->Hurt(ConfigInt("Shockwave.Damage"),m.OnUpperLevel(),m.GetZ()); |
|
|
|
game->GetPlayer()->Knockback(util::pointTo(m.GetPos(),game->GetPlayer()->GetPos())*ConfigFloat("Shockwave.Knockback Amount")); |
|
|
|
game->GetPlayer()->Knockback(util::pointTo(m.GetPos(),game->GetPlayer()->GetPos())*ConfigFloat("Shockwave.Knockback Amount")); |
|
|
|
} |
|
|
|
} |
|
|
|