Added lights for laser turret projectiles

This commit is contained in:
Anuken 2020-04-24 09:50:40 -04:00
parent eeb88df5f6
commit 018fe5dea2
6 changed files with 24 additions and 3 deletions

View File

@ -537,6 +537,10 @@ public class Bullets implements ContentList{
Lines.lineAngle(b.x() + Tmp.v1.x, b.y() + Tmp.v1.y, b.rotation(), baseLen * lenscales[i], CapStyle.none);
}
}
Tmp.v1.trns(b.rotation(), baseLen * 1.1f);
renderer.lights.line(b.x(), b.y(), b.x() + Tmp.v1.x, b.y() + Tmp.v1.y, 40, Color.orange, 0.7f);
Draw.reset();
}
};

View File

@ -9,6 +9,8 @@ import mindustry.entities.*;
import mindustry.gen.*;
import mindustry.graphics.*;
import static mindustry.Vars.renderer;
public class LaserBulletType extends BulletType{
protected Color[] colors = {Pal.lancerLaser.cpy().mul(1f, 1f, 1f, 0.4f), Pal.lancerLaser, Color.white};
protected float length = 160f;
@ -69,5 +71,8 @@ public class LaserBulletType extends BulletType{
}
Lines.precise(false);
Draw.reset();
Tmp.v1.trns(b.rotation(), baseLen * 1.1f);
renderer.lights.line(b.x(), b.y(), b.x() + Tmp.v1.x, b.y() + Tmp.v1.y, width * 1.4f * b.fout(), colors[0], 0.6f);
}
}

View File

@ -53,12 +53,15 @@ public class LightRenderer{
}
public void line(float x, float y, float x2, float y2){
line(x, y, x2, y2, 30, Color.orange, 0.3f);
}
public void line(float x, float y, float x2, float y2, float stroke, Color tint, float alpha){
if(!enabled()) return;
add(() -> {
Draw.color(Color.orange, 0.3f);
Draw.color(tint, alpha);
float stroke = 30f;
float rot = Mathf.angleExact(x2 - x, y2 - y);
TextureRegion ledge = Core.atlas.find("circle-end"), lmid = Core.atlas.find("circle-mid");

View File

@ -38,6 +38,12 @@ public class ImpactReactor extends PowerGenerator{
outputsPower = consumesPower = true;
bottomRegion = reg("-bottom");
plasmaRegions = new int[plasmas];
}
@Override
public void load(){
super.load();
for(int i = 0; i < plasmas; i++){
plasmaRegions[i] = reg("-plasma-" + i);
}

View File

@ -1,9 +1,11 @@
package mindustry.world.blocks.production;
import arc.graphics.g2d.*;
import arc.math.*;
import arc.math.geom.*;
import arc.util.ArcAnnotate.*;
import mindustry.gen.*;
import mindustry.graphics.*;
import mindustry.world.*;
import mindustry.world.blocks.payloads.*;
@ -46,6 +48,7 @@ public class PayloadAcceptor extends Block{
public void drawPayload(){
if(payload != null){
Draw.z(Layer.blockOver);
payload.draw(x + inputVector.x, y + inputVector.y, inputRotation);
}
}

View File

@ -1,3 +1,3 @@
org.gradle.daemon=true
org.gradle.jvmargs=-Xms256m -Xmx1024m
archash=29e322768aa47aa4b4c796ae998766b769da224b
archash=b8be5f9e64493e00e0243f9c41a83af1c574aaab