Fog placement fixc
This commit is contained in:
@@ -1884,7 +1884,6 @@ public class Blocks{
|
|||||||
requirements(Category.distribution, with(Items.beryllium, 1));
|
requirements(Category.distribution, with(Items.beryllium, 1));
|
||||||
health = 90;
|
health = 90;
|
||||||
speed = 4f;
|
speed = 4f;
|
||||||
fogRadius = 1;
|
|
||||||
researchCost = with(Items.beryllium, 5);
|
researchCost = with(Items.beryllium, 5);
|
||||||
}};
|
}};
|
||||||
|
|
||||||
@@ -1893,7 +1892,6 @@ public class Blocks{
|
|||||||
health = 90;
|
health = 90;
|
||||||
speed = 4f;
|
speed = 4f;
|
||||||
regionRotated1 = 1;
|
regionRotated1 = 1;
|
||||||
fogRadius = 1;
|
|
||||||
researchCost = with(Items.beryllium, 30);
|
researchCost = with(Items.beryllium, 30);
|
||||||
}};
|
}};
|
||||||
|
|
||||||
@@ -1901,7 +1899,6 @@ public class Blocks{
|
|||||||
requirements(Category.distribution, with(Items.graphite, 8, Items.beryllium, 8));
|
requirements(Category.distribution, with(Items.graphite, 8, Items.beryllium, 8));
|
||||||
health = 90;
|
health = 90;
|
||||||
speed = 4f;
|
speed = 4f;
|
||||||
fogRadius = 1;
|
|
||||||
researchCostMultiplier = 1.5f;
|
researchCostMultiplier = 1.5f;
|
||||||
}};
|
}};
|
||||||
|
|
||||||
@@ -1909,7 +1906,6 @@ public class Blocks{
|
|||||||
requirements(Category.distribution, with(Items.beryllium, 20));
|
requirements(Category.distribution, with(Items.beryllium, 20));
|
||||||
health = 90;
|
health = 90;
|
||||||
speed = 4f;
|
speed = 4f;
|
||||||
fogRadius = 1;
|
|
||||||
researchCostMultiplier = 0.3f;
|
researchCostMultiplier = 0.3f;
|
||||||
}};
|
}};
|
||||||
|
|
||||||
@@ -1918,7 +1914,6 @@ public class Blocks{
|
|||||||
health = 120;
|
health = 120;
|
||||||
speed = 4f;
|
speed = 4f;
|
||||||
regionRotated1 = 1;
|
regionRotated1 = 1;
|
||||||
fogRadius = 1;
|
|
||||||
}};
|
}};
|
||||||
|
|
||||||
surgeConveyor = new StackConveyor("surge-conveyor"){{
|
surgeConveyor = new StackConveyor("surge-conveyor"){{
|
||||||
@@ -4221,7 +4216,6 @@ public class Blocks{
|
|||||||
canOverdrive = false;
|
canOverdrive = false;
|
||||||
health = 800;
|
health = 800;
|
||||||
researchCostMultiplier = 4f;
|
researchCostMultiplier = 4f;
|
||||||
fogRadius = 1;
|
|
||||||
}};
|
}};
|
||||||
|
|
||||||
reinforcedPayloadRouter = new PayloadRouter("reinforced-payload-router"){{
|
reinforcedPayloadRouter = new PayloadRouter("reinforced-payload-router"){{
|
||||||
@@ -4229,7 +4223,6 @@ public class Blocks{
|
|||||||
moveTime = 35f;
|
moveTime = 35f;
|
||||||
health = 800;
|
health = 800;
|
||||||
canOverdrive = false;
|
canOverdrive = false;
|
||||||
fogRadius = 2;
|
|
||||||
researchCostMultiplier = 4f;
|
researchCostMultiplier = 4f;
|
||||||
}};
|
}};
|
||||||
|
|
||||||
|
|||||||
@@ -100,6 +100,15 @@ public final class FogControl implements CustomChunk{
|
|||||||
return fog == null || fog[team.id] == null ? null : fog[team.id].staticData;
|
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){
|
public boolean isVisible(Team team, float x, float y){
|
||||||
return isVisibleTile(team, World.toTile(x), World.toTile(y));
|
return isVisibleTile(team, World.toTile(x), World.toTile(y));
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -184,6 +184,7 @@ public class Build{
|
|||||||
|
|
||||||
if(
|
if(
|
||||||
check == null || //nothing there
|
check == null || //nothing there
|
||||||
|
(state.rules.staticFog && !fogControl.isDiscovered(team, wx, wy)) ||
|
||||||
(check.floor().isDeep() && !type.floating && !type.requiresWater && !type.placeableLiquid) || //deep water
|
(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
|
(type == check.block() && check.build != null && rotation == check.build.rotation && type.rotate) || //same block, same rotation
|
||||||
!check.interactable(team) || //cannot interact
|
!check.interactable(team) || //cannot interact
|
||||||
|
|||||||
Reference in New Issue
Block a user