Weapon utility handleBullet method

This commit is contained in:
Anuken 2022-05-16 11:06:50 -04:00
parent bf91676fea
commit 9212c178fc

View file

@ -408,6 +408,7 @@ public class Weapon implements Cloneable{
angle = angleOffset + shootAngle + Mathf.range(inaccuracy);
mount.bullet = bullet.create(unit, unit.team, bulletX, bulletY, angle, -1f, (1f - velocityRnd) + Mathf.random(velocityRnd), lifeScl, null, mover, mount.aimX, mount.aimY);
handleBullet(unit, mount, mount.bullet);
if(!continuous){
shootSound.at(bulletX, bulletY, Mathf.random(soundPitchMin, soundPitchMax));
@ -423,6 +424,11 @@ public class Weapon implements Cloneable{
mount.heat = 1f;
}
//override to do special things to a bullet after spawning
protected void handleBullet(Unit unit, WeaponMount mount, Bullet bullet){
}
public void flip(){
x *= -1;
shootX *= -1;