Fog placement fixc

This commit is contained in:
Anuken 2022-04-09 13:28:44 -04:00
parent 5d79ad9363
commit 8884491e46
3 changed files with 10 additions and 7 deletions

View File

@ -1884,7 +1884,6 @@ public class Blocks{
requirements(Category.distribution, with(Items.beryllium, 1));
health = 90;
speed = 4f;
fogRadius = 1;
researchCost = with(Items.beryllium, 5);
}};
@ -1893,7 +1892,6 @@ public class Blocks{
health = 90;
speed = 4f;
regionRotated1 = 1;
fogRadius = 1;
researchCost = with(Items.beryllium, 30);
}};
@ -1901,7 +1899,6 @@ public class Blocks{
requirements(Category.distribution, with(Items.graphite, 8, Items.beryllium, 8));
health = 90;
speed = 4f;
fogRadius = 1;
researchCostMultiplier = 1.5f;
}};
@ -1909,7 +1906,6 @@ public class Blocks{
requirements(Category.distribution, with(Items.beryllium, 20));
health = 90;
speed = 4f;
fogRadius = 1;
researchCostMultiplier = 0.3f;
}};
@ -1918,7 +1914,6 @@ public class Blocks{
health = 120;
speed = 4f;
regionRotated1 = 1;
fogRadius = 1;
}};
surgeConveyor = new StackConveyor("surge-conveyor"){{
@ -4221,7 +4216,6 @@ public class Blocks{
canOverdrive = false;
health = 800;
researchCostMultiplier = 4f;
fogRadius = 1;
}};
reinforcedPayloadRouter = new PayloadRouter("reinforced-payload-router"){{
@ -4229,7 +4223,6 @@ public class Blocks{
moveTime = 35f;
health = 800;
canOverdrive = false;
fogRadius = 2;
researchCostMultiplier = 4f;
}};

View File

@ -100,6 +100,15 @@ public final class FogControl implements CustomChunk{
return fog == null || fog[team.id] == null ? null : fog[team.id].staticData;
}
public boolean isDiscovered(Team team, int x, int y){
if(!state.rules.staticFog || team.isAI()) return true;
var data = getDiscovered(team);
if(data == null) return false;
if(x < 0 || y < 0 || x >= ww || y >= wh) return false;
return data.get(x + y * ww);
}
public boolean isVisible(Team team, float x, float y){
return isVisibleTile(team, World.toTile(x), World.toTile(y));
}

View File

@ -184,6 +184,7 @@ public class Build{
if(
check == null || //nothing there
(state.rules.staticFog && !fogControl.isDiscovered(team, wx, wy)) ||
(check.floor().isDeep() && !type.floating && !type.requiresWater && !type.placeableLiquid) || //deep water
(type == check.block() && check.build != null && rotation == check.build.rotation && type.rotate) || //same block, same rotation
!check.interactable(team) || //cannot interact