This commit is contained in:
Anuken
2022-02-21 22:17:18 -05:00
parent 77becf9179
commit 370191407d
30 changed files with 241 additions and 150 deletions

View File

@@ -147,6 +147,26 @@ abstract class UnitComp implements Healthc, Physicsc, Hitboxc, Statusc, Teamc, I
netClient.clearRemovedEntity(id);
}
@Override
@Replace
public boolean inFogTo(Team viewer){
if(this.team == viewer || !state.rules.fog) return false;
if(hitSize <= 14f){
return !fogControl.isVisible(viewer, x, y);
}else{
//for large hitsizes, check around the unit instead
float trns = hitSize / 2f;
for(var p : Geometry.d8){
if(fogControl.isVisible(team, x + p.x * trns, y + p.y * trns)){
return false;
}
}
}
return true;
}
@Override
public float range(){
return type.maxRange;