From 9212c178fcdceb69eaba7b87671a0aeee6e4035b Mon Sep 17 00:00:00 2001 From: Anuken Date: Mon, 16 May 2022 11:06:50 -0400 Subject: [PATCH] Weapon utility handleBullet method --- core/src/mindustry/type/Weapon.java | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/core/src/mindustry/type/Weapon.java b/core/src/mindustry/type/Weapon.java index 43b5c42203..50d8c4d6e4 100644 --- a/core/src/mindustry/type/Weapon.java +++ b/core/src/mindustry/type/Weapon.java @@ -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;