From 095cc27ea66a9d6dc23ef3a1fc5f76dbf5baeb5a Mon Sep 17 00:00:00 2001 From: Ilya246 <57039557+Ilya246@users.noreply.github.com> Date: Thu, 14 Oct 2021 17:50:57 +0400 Subject: [PATCH 1/2] Add shootOnDeath to weapons (#6149) * Update Weapon.java * Add files via upload --- core/src/mindustry/entities/comp/UnitComp.java | 9 +++++++++ core/src/mindustry/type/Weapon.java | 2 ++ 2 files changed, 11 insertions(+) diff --git a/core/src/mindustry/entities/comp/UnitComp.java b/core/src/mindustry/entities/comp/UnitComp.java index 3d1d808685..ab36682972 100644 --- a/core/src/mindustry/entities/comp/UnitComp.java +++ b/core/src/mindustry/entities/comp/UnitComp.java @@ -38,6 +38,7 @@ abstract class UnitComp implements Healthc, Physicsc, Hitboxc, Statusc, Teamc, I @Import int id; @Import @Nullable Tile mineTile; @Import Vec2 vel; + @Import WeaponMount[] mounts; private UnitController controller; UnitType type; @@ -496,6 +497,14 @@ abstract class UnitComp implements Healthc, Physicsc, Hitboxc, Statusc, Teamc, I Events.fire(Trigger.suicideBomb); } + for(WeaponMount mount : mounts){ + if(mount.weapon.shootOnDeath && !(mount.weapon.bullet.killShooter && mount.shoot)){ + mount.reload = 0f; + mount.shoot = true; + mount.weapon.update(self(), mount); + } + } + //if this unit crash landed (was flying), damage stuff in a radius if(type.flying && !spawnedByCore){ Damage.damage(team, x, y, Mathf.pow(hitSize, 0.94f) * 1.25f, Mathf.pow(hitSize, 0.75f) * type.crashDamageMultiplier * 5f, true, false, true); diff --git a/core/src/mindustry/type/Weapon.java b/core/src/mindustry/type/Weapon.java index 513c8f9c41..db3c924825 100644 --- a/core/src/mindustry/type/Weapon.java +++ b/core/src/mindustry/type/Weapon.java @@ -117,6 +117,8 @@ public class Weapon implements Cloneable{ public Func mountType = WeaponMount::new; /** status effect duration when shot */ public float shootStatusDuration = 60f * 5f; + /** whether this weapon should fire when its owner dies */ + public boolean shootOnDeath = false; public Weapon(String name){ this.name = name; From ec1124499f4815b4faa5ebba68458069a2eb5161 Mon Sep 17 00:00:00 2001 From: Sunny Kim <58885089+sk7725@users.noreply.github.com> Date: Fri, 15 Oct 2021 00:16:36 +0900 Subject: [PATCH 2/2] Disable sector info for specific sectors (#6151) * showSectorLandInfo * showSectorLandInfo type --- core/src/mindustry/core/Control.java | 2 +- core/src/mindustry/type/SectorPreset.java | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/core/src/mindustry/core/Control.java b/core/src/mindustry/core/Control.java index 08c811f0f1..4f5990dcab 100644 --- a/core/src/mindustry/core/Control.java +++ b/core/src/mindustry/core/Control.java @@ -225,7 +225,7 @@ public class Control implements ApplicationListener, Loadable{ Effect.shake(5f, 5f, core); core.thrusterTime = 1f; - if(state.isCampaign() && Vars.showSectorLandInfo){ + if(state.isCampaign() && Vars.showSectorLandInfo && (state.rules.sector.preset == null || state.rules.sector.preset.showSectorLandInfo)){ ui.announce("[accent]" + state.rules.sector.name() + "\n" + (state.rules.sector.info.resources.any() ? "[lightgray]" + bundle.get("sectors.resources") + "[white] " + state.rules.sector.info.resources.toString(" ", u -> u.emoji()) : ""), 5); diff --git a/core/src/mindustry/type/SectorPreset.java b/core/src/mindustry/type/SectorPreset.java index 3aa2743dc2..63ff4fe509 100644 --- a/core/src/mindustry/type/SectorPreset.java +++ b/core/src/mindustry/type/SectorPreset.java @@ -18,6 +18,7 @@ public class SectorPreset extends UnlockableContent{ public float difficulty; public float startWaveTimeMultiplier = 2f; public boolean addStartingItems = false; + public boolean showSectorLandInfo = true; public SectorPreset(String name, Planet planet, int sector){ super(name);