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

@@ -166,7 +166,7 @@ public abstract class BulletType extends Content{
}
public void drawLight(Bulletc b){
Drawf.light(b, lightRadius, lightColor, lightOpacity);
Drawf.light(b.team(), b, lightRadius, lightColor, lightOpacity);
}
public void init(Bulletc b){

View File

@@ -72,7 +72,7 @@ public class ContinuousLaserBulletType extends BulletType{
Tmp.v1.trns(b.rotation(), baseLen * 1.1f);
Drawf.light(b.x(), b.y(), b.x() + Tmp.v1.x, b.y() + Tmp.v1.y, 40, Color.orange, 0.7f);
Drawf.light(b.team(), b.x(), b.y(), b.x() + Tmp.v1.x, b.y() + Tmp.v1.y, 40, Color.orange, 0.7f);
Draw.reset();
}

View File

@@ -93,7 +93,7 @@ public class LaserBulletType extends BulletType{
Draw.reset();
Tmp.v1.trns(b.rotation(), baseLen * 1.1f);
Drawf.light(b.x(), b.y(), b.x() + Tmp.v1.x, b.y() + Tmp.v1.y, width * 1.4f * b.fout(), colors[0], 0.6f);
Drawf.light(b.team(), b.x(), b.y(), b.x() + Tmp.v1.x, b.y() + Tmp.v1.y, width * 1.4f * b.fout(), colors[0], 0.6f);
}
@Override

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);
}
}
}