Misc fog improvements

This commit is contained in:
Anuken
2022-03-01 10:24:20 -05:00
parent 8b51ba17ec
commit 97cbc3d345
23 changed files with 214 additions and 45 deletions

View File

@@ -446,6 +446,11 @@ abstract class BuildingComp implements Posc, Teamc, Healthc, Buildingc, Timerc,
return nearby(Geometry.d4(rotation + 3).x * trns, Geometry.d4(rotation + 3).y * trns);
}
/** Any class that overrides this method and changes the value must call Vars.fogControl.forceUpdate(team). */
public float fogRadius(){
return block.fogRadius;
}
public int pos(){
return tile.pos();
}

View File

@@ -37,7 +37,7 @@ abstract class MechComp implements Posc, Flyingc, Hitboxc, Unitc, Mechc, Elevati
float lastExtend = walkExtension;
if(extendScl < lastExtend && base % 2f > 1f && !isFlying()){
if(!headless && extendScl < lastExtend && base % 2f > 1f && !isFlying() && !inFogTo(player.team())){
int side = -Mathf.sign(extend);
float width = hitSize / 2f * side, length = type.mechStride * 1.35f;

View File

@@ -30,7 +30,7 @@ abstract class TankComp implements Posc, Flyingc, Hitboxc, Unitc, ElevationMovec
@Override
public void update(){
//dust
if(walked && !headless){
if(walked && !headless && !inFogTo(player.team())){
treadEffectTime += Time.delta;
if(treadEffectTime >= 6f && type.treadRects.length > 0){
var treadRegion = type.treadRegion;