Here is an attempt to simplify the above solution in the set_bleed_color() function. For now color is bled if adjacent to a sky sector, else a LOS is required from POI to POI. I assume that works better than CheckSight, which has a random element. Mind you this all depends on what "center" is. Works as POC.
Code: Select all
if (secZ >= bsecZ)
{
if (b_secs.Find(bsec) == b_secs.Size())
{
b_secs.Push(bsec);
if (sec.GetTexture(Sector.ceiling) == SkyFlatNum && bsec.GetTexture(Sector.ceiling) != SkyFlatNum)
{
set_bleed_color(bsec, shade(c, 0.2));
}
else
{
vector2 secv2, bsecv2;
foreach (ssec : hd_sectors)
{
if (ssec.sec == sec.SectorNum) secv2 = ssec.cspot;
if (ssec.sec == bsec.SectorNum) bsecv2 = ssec.cspot;
}
Actor p = Actor.Spawn("hd_phantom", (secv2.x, secv2.y, sec.FloorPlane.ZAtPoint(secv2) + (sec.CeilingPlane.ZAtPoint(secv2) - sec.FloorPlane.ZAtPoint(secv2)) / 2));
if (p)
{
Actor pb = Actor.Spawn("hd_phantom", (bsecv2.x, bsecv2.y, bsec.FloorPlane.ZAtPoint(bsecv2) + (bsec.CeilingPlane.ZAtPoint(bsecv2) - bsec.FloorPlane.ZAtPoint(bsecv2)) / 2));
if (pb)
{
p.target = pb;
if (p.CheckIfTargetInLOS()) set_bleed_color(bsec, shade(c, 0.2));
pb.Destroy();
}
p.Destroy();
}
}
}