This commit is contained in:
Anuken
2022-03-01 17:59:11 -05:00
parent 0805fffa18
commit f47f96663a
10 changed files with 26 additions and 12 deletions

View File

@@ -79,9 +79,12 @@ public class BurstDrill extends Drill{
}
invertTime = 1f;
Effect.shake(shake, shake, this);
progress %= drillTime;
drillEffect.at(x + Mathf.range(drillEffectRnd), y + Mathf.range(drillEffectRnd), dominantItem.color);
if(wasVisible){
Effect.shake(shake, shake, this);
drillEffect.at(x + Mathf.range(drillEffectRnd), y + Mathf.range(drillEffectRnd), dominantItem.color);
}
}
}

View File

@@ -295,7 +295,7 @@ public class Drill extends Block{
progress %= delay;
drillEffect.at(x + Mathf.range(drillEffectRnd), y + Mathf.range(drillEffectRnd), dominantItem.color);
if(wasVisible) drillEffect.at(x + Mathf.range(drillEffectRnd), y + Mathf.range(drillEffectRnd), dominantItem.color);
}
}

View File

@@ -200,7 +200,7 @@ public class GenericCrafter extends Block{
}
}
if(Mathf.chanceDelta(updateEffectChance)){
if(wasVisible && Mathf.chanceDelta(updateEffectChance)){
updateEffect.at(x + Mathf.range(size * 4f), y + Mathf.range(size * 4));
}
}else{
@@ -242,7 +242,9 @@ public class GenericCrafter extends Block{
}
}
craftEffect.at(x, y);
if(wasVisible){
craftEffect.at(x, y);
}
progress %= 1f;
}

View File

@@ -154,7 +154,7 @@ public class WallCrafter extends Block{
float eff = getEfficiency(tile.x, tile.y, rotation, dest -> {
//TODO make not chance based?
if(cons && Mathf.chanceDelta(updateEffectChance * warmup)){
if(wasVisible && cons && Mathf.chanceDelta(updateEffectChance * warmup)){
updateEffect.at(
dest.worldx() + Mathf.range(3f) - dx * tilesize,
dest.worldy() + Mathf.range(3f) - dy * tilesize,

View File

@@ -63,7 +63,9 @@ public class CoreBlock extends StorageBlock{
if(player == null || tile == null || !(tile.build instanceof CoreBuild entity)) return;
CoreBlock block = (CoreBlock)tile.block();
Fx.spawn.at(entity);
if(entity.wasVisible){
Fx.spawn.at(entity);
}
player.set(entity);
@@ -392,7 +394,7 @@ public class CoreBlock extends StorageBlock{
if(team == state.rules.defaultTeam && state.isCampaign()){
state.rules.sector.info.handleCoreItem(item, amount);
if(realAmount == 0){
if(realAmount == 0 && wasVisible){
Fx.coreBurn.at(x, y);
}
}

View File

@@ -38,7 +38,7 @@ public class StorageBlock extends Block{
if(Mathf.chance(0.3)){
Tile edge = Edges.getFacingEdge(source, self);
Tile edge2 = Edges.getFacingEdge(self, source);
if(edge != null && edge2 != null){
if(edge != null && edge2 != null && self.wasVisible){
Fx.coreBurn.at((edge.worldx() + edge2.worldx())/2f, (edge.worldy() + edge2.worldy())/2f);
}
}