mirror of
https://github.com/Anuken/Mindustry.git
synced 2025-07-16 02:38:37 +07:00
Merge pull request #2877 from genNAowl/pierce-cap
Adds a Pierce Cap Variable
This commit is contained in:
@ -25,6 +25,7 @@ public abstract class BulletType extends Content{
|
|||||||
public float drawSize = 40f;
|
public float drawSize = 40f;
|
||||||
public float drag = 0f;
|
public float drag = 0f;
|
||||||
public boolean pierce, pierceBuilding;
|
public boolean pierce, pierceBuilding;
|
||||||
|
public int pierceCap = -1;
|
||||||
public Effect hitEffect, despawnEffect;
|
public Effect hitEffect, despawnEffect;
|
||||||
|
|
||||||
/** Effect created when shooting. */
|
/** Effect created when shooting. */
|
||||||
@ -235,6 +236,11 @@ public abstract class BulletType extends Content{
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void init(Bullet b){
|
public void init(Bullet b){
|
||||||
|
if(pierceCap >= 1) {
|
||||||
|
pierce = true;
|
||||||
|
pierceBuilding = true;
|
||||||
|
}
|
||||||
|
|
||||||
if(killShooter && b.owner() instanceof Healthc){
|
if(killShooter && b.owner() instanceof Healthc){
|
||||||
((Healthc)b.owner()).kill();
|
((Healthc)b.owner()).kill();
|
||||||
}
|
}
|
||||||
|
@ -144,6 +144,10 @@ abstract class BulletComp implements Timedc, Damagec, Hitboxc, Teamc, Posc, Draw
|
|||||||
return false;
|
return false;
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if(type.pierceCap != -1 && collided.size >= type.pierceCap) {
|
||||||
|
remove();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
Reference in New Issue
Block a user