14 public void onFire(DamagingProjectileAPI projectile, WeaponAPI weapon, CombatEngineAPI engine) {
15 float speedMult = 0.25f + 0.75f * (float) Math.random();
16 projectile.getVelocity().scale(speedMult);
18 float angVel = (float) (Math.signum((
float) Math.random() - 0.5f) *
19 (0.5f + Math.random()) * 720f);
20 projectile.setAngularVelocity(angVel);
22 if (projectile instanceof MissileAPI) {
23 MissileAPI missile = (MissileAPI) projectile;
24 float flightTimeMult = 0.25f + 0.75f * (float) Math.random();
25 missile.setMaxFlightTime(missile.getMaxFlightTime() * flightTimeMult);
29 float delay = 0.25f + 0.75f * (float) Math.random();
30 weapon.setRefireDelay(delay);