Bullet pierceCap fix + Malis + Other fixes

This commit is contained in:
Anuken
2022-04-10 17:12:49 -04:00
parent 84686a260d
commit 89af2c8033
25 changed files with 112 additions and 79 deletions

View File

@@ -44,6 +44,10 @@ public class BulletType extends Content implements Cloneable{
public boolean pierceBuilding;
/** Maximum # of pierced objects. */
public int pierceCap = -1;
/** If false, this bullet isn't removed after pierceCap is exceeded. Expert usage only. */
public boolean removeAfterPierce = true;
/** For piercing lasers, setting this to true makes it get absorbed by plastanium walls. */
public boolean laserAbsorb = true;
/** Life fraction at which this bullet has the best range/damage/etc. Used for lasers and continuous turrets. */
public float optimalLifeFract = 0f;
/** Z layer to drawn on. */

View File

@@ -11,11 +11,10 @@ public class ContinuousBulletType extends BulletType{
public float damageInterval = 5f;
public boolean largeHit = false;
public boolean continuous = true;
public boolean laserAbsorb = true;
/** can't use pierceCap here for... many reasons. DO NOT USE, BUGGY */
public int pierceMax = -1;
{
removeAfterPierce = false;
pierceCap = -1;
speed = 0f;
despawnEffect = Fx.none;
shootEffect = Fx.none;
@@ -78,7 +77,7 @@ public class ContinuousBulletType extends BulletType{
}
public void applyDamage(Bullet b){
Damage.collideLine(b, b.team, hitEffect, b.x, b.y, b.rotation(), currentLength(b), largeHit, laserAbsorb, pierceMax);
Damage.collideLine(b, b.team, hitEffect, b.x, b.y, b.rotation(), currentLength(b), largeHit, laserAbsorb, pierceCap);
}
public float currentLength(Bullet b){

View File

@@ -57,7 +57,7 @@ public class ContinuousFlameBulletType extends ContinuousBulletType{
@Override
public void draw(Bullet b){
float mult = b.fin(lengthInterp);
float realLength = (pierceMax <= 0 ? length : Damage.findPierceLength(b, pierceMax, length)) * mult;
float realLength = (pierceCap <= 0 ? length : Damage.findPierceLength(b, pierceCap, length)) * mult;
float sin = Mathf.sin(Time.time, oscScl, oscMag);

View File

@@ -63,7 +63,7 @@ public class LaserBulletType extends BulletType{
@Override
public void init(Bullet b){
float resultLength = Damage.collideLaser(b, length, largeHit), rot = b.rotation();
float resultLength = Damage.collideLaser(b, length, largeHit, laserAbsorb, pierceCap), rot = b.rotation();
laserEffect.at(b.x, b.y, rot, resultLength * 0.75f);

View File

@@ -36,7 +36,7 @@ public class ShrapnelBulletType extends BulletType{
public void init(Bullet b){
super.init(b);
Damage.collideLaser(b, length, hitLarge);
Damage.collideLaser(b, length, hitLarge, laserAbsorb, pierceCap);
}
@Override