Fracture impl
This commit is contained in:
@@ -10,6 +10,7 @@ public class ContinuousBulletType extends BulletType{
|
||||
public float shake = 0f;
|
||||
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;
|
||||
@@ -29,11 +30,13 @@ public class ContinuousBulletType extends BulletType{
|
||||
|
||||
@Override
|
||||
public float continuousDamage(){
|
||||
if(!continuous) return -1f;
|
||||
return damage / damageInterval * 60f;
|
||||
}
|
||||
|
||||
@Override
|
||||
public float estimateDPS(){
|
||||
if(!continuous) return super.estimateDPS();
|
||||
//assume firing duration is about 100 by default, may not be accurate there's no way of knowing in this method
|
||||
//assume it pierces 3 blocks/units
|
||||
return damage * 100f / damageInterval * 3f;
|
||||
@@ -51,12 +54,22 @@ public class ContinuousBulletType extends BulletType{
|
||||
drawSize = Math.max(drawSize, length*2f);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void init(Bullet b){
|
||||
super.init(b);
|
||||
|
||||
if(!continuous){
|
||||
applyDamage(b);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void update(Bullet b){
|
||||
if(!continuous) return;
|
||||
|
||||
//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, pierceMax);
|
||||
applyDamage(b);
|
||||
}
|
||||
|
||||
if(shake > 0){
|
||||
@@ -64,6 +77,10 @@ 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);
|
||||
}
|
||||
|
||||
public float currentLength(Bullet b){
|
||||
return length;
|
||||
}
|
||||
|
||||
@@ -91,7 +91,7 @@ public class ContinuousFlameBulletType extends ContinuousBulletType{
|
||||
|
||||
@Override
|
||||
public float currentLength(Bullet b){
|
||||
return length * b.fslope();
|
||||
return length * b.fin(lengthInterp);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
Reference in New Issue
Block a user