BulletType despawnUnit field (#7088)
* a * i guess so * despawnUnitCount, which i forgot to include
This commit is contained in:
@@ -184,6 +184,10 @@ public class BulletType extends Content implements Cloneable{
|
|||||||
public Seq<BulletType> spawnBullets = new Seq<>();
|
public Seq<BulletType> spawnBullets = new Seq<>();
|
||||||
/** Unit spawned _instead of_ this bullet. Useful for missiles. */
|
/** Unit spawned _instead of_ this bullet. Useful for missiles. */
|
||||||
public @Nullable UnitType spawnUnit;
|
public @Nullable UnitType spawnUnit;
|
||||||
|
/** Unit spawned when this bullet hits something or despawns due to it hitting the end of its lifetime. */
|
||||||
|
public @Nullable UnitType despawnUnit;
|
||||||
|
/** Amount of units spawned when this bullet despawns. */
|
||||||
|
public int despawnUnitCount = 1;
|
||||||
|
|
||||||
/** Color of trail behind bullet. */
|
/** Color of trail behind bullet. */
|
||||||
public Color trailColor = Pal.missileYellowBack;
|
public Color trailColor = Pal.missileYellowBack;
|
||||||
@@ -443,6 +447,12 @@ public class BulletType extends Content implements Cloneable{
|
|||||||
createFrags(b, b.x, b.y);
|
createFrags(b, b.x, b.y);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if(despawnUnit != null){
|
||||||
|
for(int i = 0; i < despawnUnitCount; i++){
|
||||||
|
despawnUnit.spawn(b.team, b.x + Mathf.range(0.1f), b.y);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
despawnEffect.at(b.x, b.y, b.rotation(), hitColor);
|
despawnEffect.at(b.x, b.y, b.rotation(), hitColor);
|
||||||
despawnSound.at(b);
|
despawnSound.at(b);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user