always unlock erekir core
This commit is contained in:
@@ -2612,6 +2612,7 @@ public class Blocks{
|
|||||||
size = 4;
|
size = 4;
|
||||||
thrusterLength = 34/4f;
|
thrusterLength = 34/4f;
|
||||||
armor = 5f;
|
armor = 5f;
|
||||||
|
alwaysUnlocked = true;
|
||||||
|
|
||||||
//TODO should this be higher?
|
//TODO should this be higher?
|
||||||
buildCostMultiplier = 0.75f;
|
buildCostMultiplier = 0.75f;
|
||||||
|
|||||||
@@ -73,6 +73,16 @@ public class FogControl implements CustomChunk{
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
//on tile removed, dynamic fog goes away
|
||||||
|
Events.on(TilePreChangeEvent.class, e -> {
|
||||||
|
if(state.rules.fog && e.tile.build != null && !e.tile.build.team.isAI() && e.tile.block().flags.contains(BlockFlag.hasFogRadius)){
|
||||||
|
var data = data(e.tile.team());
|
||||||
|
if(data != null){
|
||||||
|
data.dynamicUpdated = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
SaveVersion.addCustomChunk("fogdata", this);
|
SaveVersion.addCustomChunk("fogdata", this);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -171,22 +181,22 @@ public class FogControl implements CustomChunk{
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//add building updates (TODO this can run in the if-check, but the renderer needs it...)
|
||||||
|
for(var build : indexer.getFlagged(team.team, BlockFlag.hasFogRadius)){
|
||||||
|
unitEventQueue.add(FogEvent.get(build.tile.x, build.tile.y, build.block.fogRadius, 0));
|
||||||
|
}
|
||||||
|
|
||||||
|
//on the client, let the renderer know of all the fog sources
|
||||||
|
//TODO this runs at a lower FPS and hence may look bad...?
|
||||||
|
if(data.dynamicUpdated && !headless && team.team == Vars.player.team()){
|
||||||
|
renderer.fog.flushDynamic(unitEventQueue);
|
||||||
|
}
|
||||||
|
|
||||||
//if it's time for an update, flush *everything* onto the update queue
|
//if it's time for an update, flush *everything* onto the update queue
|
||||||
if(data.dynamicUpdated && Time.timeSinceMillis(data.lastDynamicMs) > staticUpdateInterval){
|
if(data.dynamicUpdated && Time.timeSinceMillis(data.lastDynamicMs) > staticUpdateInterval){
|
||||||
data.dynamicUpdated = false;
|
data.dynamicUpdated = false;
|
||||||
data.lastDynamicMs = Time.millis();
|
data.lastDynamicMs = Time.millis();
|
||||||
|
|
||||||
//add building updates
|
|
||||||
for(var build : indexer.getFlagged(team.team, BlockFlag.hasFogRadius)){
|
|
||||||
unitEventQueue.add(FogEvent.get(build.tileX(), build.tileY(), build.block.fogRadius, 0));
|
|
||||||
}
|
|
||||||
|
|
||||||
//on the client, let the renderer know of all the fog sources
|
|
||||||
//TODO this runs at a lower FPS and hence may look bad...?
|
|
||||||
if(!headless && team.team == Vars.player.team()){
|
|
||||||
renderer.fog.flushDynamic(unitEventQueue);
|
|
||||||
}
|
|
||||||
|
|
||||||
//add unit updates
|
//add unit updates
|
||||||
dynamicEventQueue.addAll(unitEventQueue);
|
dynamicEventQueue.addAll(unitEventQueue);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user