From 739ce7515474c3b2ba42d261a030628e4e191333 Mon Sep 17 00:00:00 2001 From: MEEP of Faith <54301439+MEEPofFaith@users.noreply.github.com> Date: Thu, 7 May 2020 18:53:00 -0700 Subject: [PATCH] Customizable Fragging Angle (#2006) * Customizable Fragging Angle * I did it wrong. * Undo that last change. * Anuke told me to make it just forwards * Thanks Anuke My inexperience is very evident. --- core/src/mindustry/entities/bullet/BulletType.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/core/src/mindustry/entities/bullet/BulletType.java b/core/src/mindustry/entities/bullet/BulletType.java index 4a288c814e..1b25efb8b8 100644 --- a/core/src/mindustry/entities/bullet/BulletType.java +++ b/core/src/mindustry/entities/bullet/BulletType.java @@ -64,6 +64,7 @@ public abstract class BulletType extends Content{ //additional effects + public float fragCone = 360f; public int fragBullets = 9; public float fragVelocityMin = 0.2f, fragVelocityMax = 1f; public BulletType fragBullet = null; @@ -117,7 +118,7 @@ public abstract class BulletType extends Content{ if(fragBullet != null){ for(int i = 0; i < fragBullets; i++){ float len = Mathf.random(1f, 7f); - float a = Mathf.random(360f); + float a = b.rotation() + Mathf.range(fragCone/2); fragBullet.create(b, x + Angles.trnsx(a, len), y + Angles.trnsy(a, len), a, Mathf.random(fragVelocityMin, fragVelocityMax)); } }