Added lights for laser turret projectiles
This commit is contained in:
@@ -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();
|
||||
}
|
||||
};
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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");
|
||||
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user