Support for team-only lighting

This commit is contained in:
Anuken
2020-06-15 13:54:02 -04:00
parent b5660a50ca
commit 7001ad09cb
24 changed files with 90 additions and 75 deletions

View File

@@ -94,7 +94,7 @@ abstract class MinerComp implements Itemsc, Posc, Teamc, Rotc, Drawc{
Draw.color(Color.lightGray, Color.white, 1f - flashScl + Mathf.absin(Time.time(), 0.5f, flashScl));
Drawf.laser(Core.atlas.find("minelaser"), Core.atlas.find("minelaser-end"), px, py, ex, ey, 0.75f);
Drawf.laser(team(), Core.atlas.find("minelaser"), Core.atlas.find("minelaser-end"), px, py, ex, ey, 0.75f);
//TODO hack?
if(isLocal()){

View File

@@ -8,13 +8,14 @@ import arc.util.*;
import mindustry.annotations.Annotations.*;
import mindustry.content.*;
import mindustry.entities.*;
import mindustry.game.*;
import mindustry.gen.*;
import mindustry.graphics.*;
import mindustry.type.*;
import mindustry.world.*;
import static mindustry.Vars.world;
import static mindustry.entities.Puddles.maxLiquid;
import static mindustry.Vars.*;
import static mindustry.entities.Puddles.*;
@EntityDef(value = {Puddlec.class}, pooled = true)
@Component
@@ -111,7 +112,7 @@ abstract class PuddleComp implements Posc, Puddlec, Drawc{
if(liquid.lightColor.a > 0.001f && f > 0){
Color color = liquid.lightColor;
float opacity = color.a * f;
Drawf.light(tile.drawx(), tile.drawy(), 30f * f, color, opacity * 0.8f);
Drawf.light(Team.derelict, tile.drawx(), tile.drawy(), 30f * f, color, opacity * 0.8f);
}
}

View File

@@ -758,7 +758,7 @@ abstract class TileComp implements Posc, Teamc, Healthc, Tilec, Timerc, QuadTree
float fract = 1f;
float opacity = color.a * fract;
if(opacity > 0.001f){
Drawf.light(x, y, block.size * 30f * fract, color, opacity);
Drawf.light(team, x, y, block.size * 30f * fract, color, opacity);
}
}
}