Weapon utility handleBullet method
This commit is contained in:
@@ -408,6 +408,7 @@ public class Weapon implements Cloneable{
|
|||||||
angle = angleOffset + shootAngle + Mathf.range(inaccuracy);
|
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);
|
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){
|
if(!continuous){
|
||||||
shootSound.at(bulletX, bulletY, Mathf.random(soundPitchMin, soundPitchMax));
|
shootSound.at(bulletX, bulletY, Mathf.random(soundPitchMin, soundPitchMax));
|
||||||
@@ -423,6 +424,11 @@ public class Weapon implements Cloneable{
|
|||||||
mount.heat = 1f;
|
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(){
|
public void flip(){
|
||||||
x *= -1;
|
x *= -1;
|
||||||
shootX *= -1;
|
shootX *= -1;
|
||||||
|
|||||||
Reference in New Issue
Block a user