From 3d0541084be62e7890a3e6177335be63803e3737 Mon Sep 17 00:00:00 2001 From: MEEPofFaith <54301439+MEEPofFaith@users.noreply.github.com> Date: Sat, 29 Jul 2023 10:29:21 -0700 Subject: [PATCH] Weird creation things (#8860) --- core/src/mindustry/entities/bullet/BulletType.java | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/core/src/mindustry/entities/bullet/BulletType.java b/core/src/mindustry/entities/bullet/BulletType.java index 300e6f9209..780978e408 100644 --- a/core/src/mindustry/entities/bullet/BulletType.java +++ b/core/src/mindustry/entities/bullet/BulletType.java @@ -125,6 +125,10 @@ public class BulletType extends Content implements Cloneable{ /** Whether to move the bullet back depending on delta to fix some delta-time related issues. * Do not change unless you know what you're doing. */ public boolean backMove = true; + /** If true, the angle param in create is ignored. */ + public boolean ignoreSpawnAngle = false; + /** Chance for this bullet to be created. */ + public float createChance = 1; /** Bullet range positive override. */ public float maxRange = -1f; /** When > 0, overrides range even if smaller than base range. */ @@ -736,6 +740,8 @@ public class BulletType extends Content implements Cloneable{ } public @Nullable Bullet create(@Nullable Entityc owner, @Nullable Entityc shooter, Team team, float x, float y, float angle, float damage, float velocityScl, float lifetimeScl, Object data, @Nullable Mover mover, float aimX, float aimY){ + if(!Mathf.chance(createChance)) return null; + if(ignoreSpawnAngle) angle = 0; if(spawnUnit != null){ //don't spawn units clientside! if(!net.client()){