This commit is contained in:
Anuken
2021-11-24 13:33:01 -05:00
parent 3512190373
commit b7ac1e1d74
5 changed files with 39 additions and 4 deletions
@@ -11,6 +11,8 @@ public class ContinuousBulletType extends BulletType{
public float damageInterval = 5f;
public boolean largeHit = false;
public boolean laserAbsorb = true;
/** can't use pierceCap here for... many reasons. DO NOT USE, BUGGY */
public int pierceMax = -1;
{
speed = 0f;
@@ -54,7 +56,7 @@ public class ContinuousBulletType extends BulletType{
//damage every 5 ticks
if(b.timer(1, damageInterval)){
Damage.collideLine(b, b.team, hitEffect, b.x, b.y, b.rotation(), currentLength(b), largeHit, laserAbsorb);
Damage.collideLine(b, b.team, hitEffect, b.x, b.y, b.rotation(), currentLength(b), largeHit, laserAbsorb, pierceMax);
}
if(shake > 0){
@@ -5,6 +5,7 @@ import arc.graphics.g2d.*;
import arc.math.*;
import arc.util.*;
import mindustry.content.*;
import mindustry.entities.*;
import mindustry.gen.*;
import mindustry.graphics.*;
@@ -47,14 +48,13 @@ public class ContinuousFlameBulletType extends ContinuousBulletType{
lifetime = 16f;
hitColor = colors[1].cpy().a(1f);
lightColor = hitColor;
//TODO what if, instead of piercing, it stopped at the first target regardless? or maybe 2?
laserAbsorb = false;
}
@Override
public void draw(Bullet b){
float mult = b.fslope();
float realLength = length * mult;
float realLength = (pierceMax <= 0 ? length : Damage.findPierceLength(b, pierceMax, length)) * mult;
float sin = Mathf.sin(Time.time, oscScl, oscMag);