Drawf.Laser with different ends (#5301)

* Laser with different ends

* Allow usage of different ended TractorBeamTurret lasers

* oops

* aaaa

* too. many. commits.

* Remove rotation

* I shouldn't be allowed to edit from the browser.
This commit is contained in:
MEEP of Faith
2021-07-20 08:22:17 -07:00
committed by GitHub
parent 6e967dce70
commit 7656aedb6b
2 changed files with 20 additions and 15 deletions

View File

@@ -20,10 +20,6 @@ import static mindustry.Vars.*;
public class TractorBeamTurret extends BaseTurret{
public final int timerTarget = timers++;
public float retargetTime = 5f;
public @Load("block-@size") TextureRegion baseRegion;
public @Load("@-laser") TextureRegion laser;
public @Load("@-laser-end") TextureRegion laserEnd;
public float shootCone = 6f;
public float shootLength = 5f;
@@ -39,6 +35,11 @@ public class TractorBeamTurret extends BaseTurret{
public Sound shootSound = Sounds.tractorbeam;
public float shootSoundVolume = 0.9f;
public @Load("block-@size") TextureRegion baseRegion;
public @Load("@-laser") TextureRegion laser;
public @Load(value = "@-laser-start", fallback = "@-laser-end") TextureRegion laserStart;
public @Load("@-laser-end") TextureRegion laserEnd;
public TractorBeamTurret(String name){
super(name);
@@ -151,7 +152,7 @@ public class TractorBeamTurret extends BaseTurret{
Draw.mixcol(laserColor, Mathf.absin(4f, 0.6f));
Drawf.laser(team, laser, laserEnd,
Drawf.laser(team, laser, laserStart, laserEnd,
x + Angles.trnsx(ang, shootLength), y + Angles.trnsy(ang, shootLength),
lastX, lastY, strength * efficiency() * laserWidth);