Fog building hiding

This commit is contained in:
Anuken
2022-02-19 20:34:55 -05:00
parent 66a806c304
commit 99b01f3a3c
11 changed files with 90 additions and 17 deletions

View File

@@ -150,6 +150,8 @@ public class Block extends UnlockableContent implements Senseable{
public int size = 1;
/** multiblock offset */
public float offset = 0f;
/** offset for iteration (internal use only) */
public int sizeOffset = 0;
/** Clipping size of this block. Should be as large as the block will draw. */
public float clipSize = -1f;
/** When placeRangeCheck is enabled, this is the range checked for enemy blocks. */
@@ -1076,6 +1078,7 @@ public class Block extends UnlockableContent implements Senseable{
}
offset = ((size + 1) % 2) * tilesize / 2f;
sizeOffset = -((size - 1) / 2);
if(requirements.length > 0){
buildCost = 0f;

View File

@@ -7,6 +7,7 @@ import arc.math.*;
import arc.util.*;
import mindustry.content.*;
import mindustry.entities.*;
import mindustry.game.*;
import mindustry.gen.*;
import mindustry.graphics.*;
import mindustry.world.*;
@@ -110,6 +111,12 @@ public class BaseShield extends Block{
drawShield();
}
//always visible due to their shield nature
@Override
public boolean inFogTo(Team viewer){
return false;
}
public void drawShield(){
if(!broken){
float radius = radius();

View File

@@ -10,6 +10,7 @@ import arc.util.io.*;
import mindustry.annotations.Annotations.*;
import mindustry.content.*;
import mindustry.entities.*;
import mindustry.game.*;
import mindustry.gen.*;
import mindustry.graphics.*;
import mindustry.logic.*;
@@ -140,6 +141,11 @@ public class ForceProjector extends Block{
radscl = warmup = 0f;
}
@Override
public boolean inFogTo(Team viewer){
return false;
}
@Override
public void updateTile(){
boolean phaseValid = itemConsumer != null && itemConsumer.valid(this);