From 88f1e0c4af649534224bc817d1c342e456468546 Mon Sep 17 00:00:00 2001 From: EggleEgg <125359838+EggleEgg@users.noreply.github.com> Date: Sun, 8 Feb 2026 02:57:51 +0100 Subject: [PATCH] Erekir rebalance v5 (#11511) * werwe * phase scathe + minor tweak to surge scathe * bs changes * yay * scathe bs * 45t * applied correctly now * 343rfe * whatever * a * Idk what I m doing * idk * bs * tecta + titan balance changes * tiny fix * some reverts + cyanosub nerf * oop * better * boring vanq buffs * no, stop * now * -100% build mult * revert tecta nerf * better tecta bvb but -15% dps * armor rend effect * some reverts * more * more * more * avert changes * avert shenanigans * more balance ig * PLEASE FREE ME * more vanq changes * more stuff * flux buff * conquer buff and stuff * I m starting to like this * finally fragOnLastHit fixed * more tecta shield buffs * done * shieldarc json support just in case * revert reflect convex spread * fixes, dont override bullet.type * cleanup + more tecta shield changes * screw it, 0.5 * fix chance to deflect db entry --- core/assets/bundles/bundle.properties | 8 +-- core/src/mindustry/content/Blocks.java | 67 ++++++++++------- core/src/mindustry/content/Fx.java | 10 +++ core/src/mindustry/content/StatusEffects.java | 4 +- core/src/mindustry/content/UnitTypes.java | 72 +++++++++++++------ .../entities/abilities/ShieldArcAbility.java | 19 ++++- .../mindustry/entities/bullet/BulletType.java | 37 +++++----- .../mindustry/entities/comp/BulletComp.java | 1 + 8 files changed, 144 insertions(+), 74 deletions(-) diff --git a/core/assets/bundles/bundle.properties b/core/assets/bundles/bundle.properties index 455e4a994d..d45a58bd66 100644 --- a/core/assets/bundles/bundle.properties +++ b/core/assets/bundles/bundle.properties @@ -1108,7 +1108,7 @@ ability.armorplate.description = Reduces damage taken while shooting ability.shieldarc = Shield Arc ability.shieldarc.description = Projects a force shield in an arc that absorbs or deflects bullets, missiles and units ability.suppressionfield = Repair Suppression -ability.suppressionfield.description = Stops nearby repair buildings +ability.suppressionfield.description = Stops nearby repair buildings and build towers ability.energyfield = Energy Field ability.energyfield.description = Zaps nearby enemies ability.energyfield.healdescription = Zaps nearby enemies and heals allies @@ -2544,9 +2544,9 @@ unit.navanax.description = Fires explosive EMP projectiles, dealing significant #Erekir unit.stell.description = Fires standard bullets at enemy targets. unit.locus.description = Fires alternating bullets at enemy targets. -unit.precept.description = Fires piercing cluster bullets at enemy targets. Less affected by harmful terrain. -unit.vanquish.description = Fires large piercing splitting bullets at enemy targets. Less affected by harmful terrain. -unit.conquer.description = Fires large piercing cascades of bullets at enemy targets. Less affected by harmful terrain. +unit.precept.description = Fires piercing cluster bullets at enemy targets. Less affected by liquid drag +unit.vanquish.description = Fires large piercing splitting bullets at enemy targets. Less affected by liquid drag. +unit.conquer.description = Fires large piercing cascades of bullets at enemy targets. Significantly less affected by liquid drag. unit.merui.description = Fires long-range artillery at enemy ground targets. Can step over most terrain. unit.cleroi.description = Fires dual shells at enemy targets. Targets enemy projectiles with point defense turrets. Can step over most terrain. unit.anthicus.description = Fires long-range homing missiles at enemy targets. Can step over most terrain. diff --git a/core/src/mindustry/content/Blocks.java b/core/src/mindustry/content/Blocks.java index 584fede457..813838da39 100644 --- a/core/src/mindustry/content/Blocks.java +++ b/core/src/mindustry/content/Blocks.java @@ -1617,7 +1617,7 @@ public class Blocks{ }}; cyanogenSynthesizer = new HeatCrafter("cyanogen-synthesizer"){{ - requirements(Category.crafting, with(Items.carbide, 50, Items.silicon, 80, Items.beryllium, 90)); + requirements(Category.crafting, with(Items.carbide, 80, Items.silicon, 120, Items.beryllium, 140, Items.oxide, 40)); heatRequirement = 20f; maxEfficiency = 1f; @@ -2770,8 +2770,8 @@ public class Blocks{ }}; fluxReactor = new VariableReactor("flux-reactor"){{ - requirements(Category.power, with(Items.graphite, 300, Items.carbide, 100, Items.oxide, 100, Items.silicon, 600, Items.surgeAlloy, 200)); - powerProduction = 265f; + requirements(Category.power, with(Items.graphite, 240, Items.carbide, 60, Items.oxide, 80, Items.silicon, 480, Items.surgeAlloy, 120)); + powerProduction = 18000f / 60f; maxHeat = 150f; consumeLiquid(Liquids.cyanogen, 9f / 60f); @@ -4510,8 +4510,8 @@ public class Blocks{ shootEffect = Fx.shootBigColor; smokeEffect = Fx.shootSmokeSquareSparse; ammoMultiplier = 1; - hitColor = backColor = trailColor = Pal.graphiteAmmoBack; - frontColor = Pal.graphiteAmmoFront; + hitColor = backColor = trailColor = Pal.siliconAmmoBack; + frontColor = Color.valueOf("dae1ee"); trailWidth = 6f; trailLength = 6; hitEffect = despawnEffect = Fx.hitSquaresColor; @@ -4597,7 +4597,7 @@ public class Blocks{ outlineColor = Pal.darkOutline; liquidCapacity = 50f; - liquidConsumed = 15f / 60f; + liquidConsumed = 18f / 60f; targetInterval = 5f; newTargetInterval = 30f; targetUnderBlocks = false; @@ -4613,6 +4613,7 @@ public class Blocks{ Liquids.ozone, new ContinuousFlameBulletType(){{ damage = 60f; length = r; + ammoMultiplier = 1.2f; knockback = 1f; pierceCap = 2; buildingDamageMultiplier = 0.3f; @@ -4623,7 +4624,6 @@ public class Blocks{ Liquids.cyanogen, new ContinuousFlameBulletType(){{ damage = 130f; rangeChange = 70f; - ammoMultiplier = 1.5f; length = r + rangeChange; knockback = 2f; pierceCap = 3; @@ -4746,10 +4746,10 @@ public class Blocks{ lifetime = 190f; height = 19f; width = 17f; - reloadMultiplier = 0.65f; + reloadMultiplier = 0.7f; splashDamageRadius = 110f; rangeChange = 8f; - splashDamage = 150f; + splashDamage = 180f; scaledSplashDamage = true; hitColor = backColor = trailColor = Color.valueOf("a0b380"); frontColor = Color.valueOf("e4ffd6"); @@ -4772,7 +4772,26 @@ public class Blocks{ shrinkY = 0.1f; buildingDamageMultiplier = 0.25f; status = StatusEffects.corroded; - statusDuration = 300f; + statusDuration = 60f * 8f; + + fragBullets = 1; + fragBullet = new EmptyBulletType(){{ + damage = 0f; + lifetime = 60f * 2.5f; + bulletInterval = 20f; + hitEffect = despawnEffect = Fx.none; + intervalBullet = new EmptyBulletType(){{ + splashDamage = 15f; + collidesGround = true; + collidesAir = false; + collides = false; + hitEffect = despawnEffect = Fx.none; + pierce = true; + instantDisappear = true; + splashDamageRadius = 90f; + buildingDamageMultiplier = 0f; + }}; + }}; }} ); @@ -4894,8 +4913,8 @@ public class Blocks{ collidesTiles = false; shootEffect = Fx.shootBig2; smokeEffect = Fx.shootSmokeDisperse; - frontColor = Pal.graphiteAmmoFront; - backColor = trailColor = hitColor = Pal.graphiteAmmoBack; + frontColor = Color.valueOf("dae1ee"); + backColor = trailColor = hitColor = Pal.siliconAmmoBack; ammoMultiplier = 4f; lifetime = 34f; @@ -5213,6 +5232,7 @@ public class Blocks{ speed = 4.6f; maxRange = 6f; lifetime = 60f * 5.5f; + hitSize = 10f; outlineColor = Pal.darkOutline; engineColor = trailColor = Pal.redLight; engineLayer = Layer.effect; @@ -5293,13 +5313,14 @@ public class Blocks{ shootEffect = Fx.shootBig; smokeEffect = Fx.shootSmokeMissileColor; hitColor = Color.valueOf("ffd37f"); - ammoMultiplier = 3f; + ammoMultiplier = 5f; reloadMultiplier = 0.8f; spawnUnit = new MissileUnitType("scathe-missile-phase"){{ - speed = 4f; + speed = 2.5f; maxRange = 6f; - lifetime = 60f * 6.1f; + lifetime = 60f * 9.77f; + hitSize = 10f; outlineColor = Pal.darkOutline; engineColor = trailColor = Color.valueOf("ffd37f"); engineLayer = Layer.effect; @@ -5337,10 +5358,9 @@ public class Blocks{ deathExplosionEffect = Fx.massiveExplosion; shootOnDeath = true; shake = 10f; - bullet = new ExplosionBulletType(400f, 120f){{ - //stats must be mirrored to the bullet that the unit uses + bullet = new ExplosionBulletType(320f, 120f){{ reloadMultiplier = 0.8f; - ammoMultiplier = 3f; + ammoMultiplier = 5f; hitColor = engineColor; shootEffect = new MultiEffect(Fx.massiveExplosion, Fx.scatheExplosion, Fx.scatheLight, new WaveEffect(){{ @@ -5364,7 +5384,7 @@ public class Blocks{ width = height = 18f; collidesTiles = false; splashDamageRadius = 56f; - splashDamage = 164f; + splashDamage = 120f; backColor = trailColor = hitColor = engineColor; frontColor = Color.white; smokeEffect = Fx.shootBigSmoke2; @@ -5385,10 +5405,10 @@ public class Blocks{ rotation = 180f; y = -9f; color = Color.grays(0.6f).lerp(Pal.redLight, 0.5f).a(0.4f); - interval = 7f; + interval = 15f; }}); - abilities.add(new ForceFieldAbility(90f, 0f, 2000f, 999999999f)); + abilities.add(new ForceFieldAbility(120f, 0f, 3000f, 999999999f)); }}; }}, @@ -5399,13 +5419,13 @@ public class Blocks{ hitColor = Color.valueOf("f7e97e"); ammoMultiplier = 1f; - rangeChange = -8f*9f; reloadMultiplier = 0.9f; spawnUnit = new MissileUnitType("scathe-missile-surge"){{ speed = 4.4f; maxRange = 6f; lifetime = 60f * 1.4f; + hitSize = 10f; outlineColor = Pal.darkOutline; engineColor = trailColor = Color.valueOf("f7e97e"); engineLayer = Layer.effect; @@ -5436,7 +5456,6 @@ public class Blocks{ bullet = new ExplosionBulletType(1800f, 40f){{ //mirror stats ammoMultiplier = 1f; - rangeChange = -8f*9f; reloadMultiplier = 0.9f; lightning = 10; lightningDamage = 45f; @@ -5461,7 +5480,7 @@ public class Blocks{ spawnUnit = new MissileUnitType("scathe-missile-surge-split"){{ speed = 4.8f; maxRange = 6f; - lifetime = 60f * 3.5f; + lifetime = 60f * 3.7f; outlineColor = Pal.darkOutline; engineColor = trailColor = Color.valueOf("f7e97e"); engineLayer = Layer.effect; diff --git a/core/src/mindustry/content/Fx.java b/core/src/mindustry/content/Fx.java index 5caaa4b53b..8c71b0a051 100644 --- a/core/src/mindustry/content/Fx.java +++ b/core/src/mindustry/content/Fx.java @@ -905,6 +905,16 @@ public class Fx{ Drawf.light(e.x, e.y, 20f, e.color, 0.6f * e.fout()); }), + squareWaveEffect = new Effect(14, 40f, e -> { + rand.setSeed(e.id); + color(Color.white, e.color, rand.random(0.8f, 1.5f) * e.fin()); + stroke(rand.random(0.4f, 0.8f) + e.fout() * 2); + float rot = rand.random(45f, 180f) * e.fin(); + float rotation = rand.random(0, 1) > 0.5f ? rot : -rot; + Lines.square(e.x, e.y, e.fin() * rand.random(4f, 11f) + 4f, e.rotation + rand.random(360f) + rotation); + Drawf.light(e.x, e.y, 23f, e.color, e.fout() * 0.7f); + }), + hitFuse = new Effect(14, e -> { color(Color.white, Pal.surge, e.fin()); diff --git a/core/src/mindustry/content/StatusEffects.java b/core/src/mindustry/content/StatusEffects.java index 7e9466f2d6..6792c68861 100644 --- a/core/src/mindustry/content/StatusEffects.java +++ b/core/src/mindustry/content/StatusEffects.java @@ -192,8 +192,8 @@ public class StatusEffects{ corroded = new StatusEffect("corroded"){{ color = Color.valueOf("e4ffd6"); - intervalDamage = 25f; - intervalDamageTime = 30f; + intervalDamage = 20f; + intervalDamageTime = 15f; effectChance = 0.1f; effect = Fx.corrosionVapor; diff --git a/core/src/mindustry/content/UnitTypes.java b/core/src/mindustry/content/UnitTypes.java index 072d6402a5..314a16fdf8 100644 --- a/core/src/mindustry/content/UnitTypes.java +++ b/core/src/mindustry/content/UnitTypes.java @@ -2826,7 +2826,7 @@ public class UnitTypes{ y = -1f; heatColor = Color.valueOf("f9350f"); cooldownTime = 30f; - bullet = new BasicBulletType(7f, 120){{ + bullet = new BasicBulletType(7f, 10){{ sprite = "missile-large"; width = 7.5f; height = 13f; @@ -2891,7 +2891,7 @@ public class UnitTypes{ weapons.add(new Weapon("vanquish-weapon"){{ shootSound = Sounds.shootTank; layerOffset = 0.0001f; - reload = 70f; + reload = 80f; shootY = 71f / 4f; shake = 5f; recoil = 4f; @@ -2904,17 +2904,18 @@ public class UnitTypes{ heatColor = Color.valueOf("f9350f"); cooldownTime = 80f; - bullet = new BasicBulletType(8f, 190){{ + bullet = new BasicBulletType(8f, 150f){{ sprite = "missile-large"; width = 9.5f; - height = 13f; - lifetime = 18f; + height = 18f; + lifetime = 16f; hitSize = 6f; shootEffect = Fx.shootTitan; smokeEffect = Fx.shootSmokeTitan; pierceCap = 2; pierce = true; pierceBuilding = true; + hitColor = backColor = trailColor = Color.valueOf("feb380"); frontColor = Color.white; trailWidth = 3.1f; @@ -2922,19 +2923,21 @@ public class UnitTypes{ hitEffect = despawnEffect = Fx.blastExplosion; splashDamageRadius = 20f; splashDamage = 50f; + maxRange = 190f; fragOnHit = false; + pierceFragCap = 1; fragRandomSpread = 0f; fragSpread = 10f; fragBullets = 5; fragVelocityMin = 1f; despawnSound = Sounds.explosionDull; - fragBullet = new BasicBulletType(8f, 35){{ + fragBullet = new BasicBulletType(8f, 35f){{ sprite = "missile-large"; width = 8f; - height = 12f; - lifetime = 15f; + height = 16f; + lifetime = 10f; hitSize = 4f; hitColor = backColor = trailColor = Color.valueOf("feb380"); frontColor = Color.white; @@ -2951,7 +2954,7 @@ public class UnitTypes{ for(float f : new float[]{34f / 4f, -36f / 4f}){ int fi = i ++; weapons.add(new Weapon("vanquish-point-weapon"){{ - reload = 35f + fi * 5; + reload = 22 + fi * 5; x = 48f / 4f; y = f; shootY = 5.5f; @@ -2960,16 +2963,21 @@ public class UnitTypes{ rotateSpeed = 2f; shootSound = Sounds.shootStell; - bullet = new BasicBulletType(4.5f, 25){{ + bullet = new BasicBulletType(12f, 50f){{ + sprite = "missile-large"; width = 6.5f; height = 11f; + shrinkY = 0f; + shrinkX = 0.2f; + lifetime = 15f; shootEffect = Fx.sparkShoot; smokeEffect = Fx.shootBigSmoke; hitColor = backColor = trailColor = Color.valueOf("feb380"); frontColor = Color.white; - trailWidth = 1.5f; - trailLength = 4; - hitEffect = despawnEffect = Fx.hitBulletColor; + trailWidth = 2.5f; + trailLength = 5; + hitEffect = Fx.blastExplosion; + despawnEffect = Fx.hitBulletColor; }}; }}); } @@ -3358,7 +3366,7 @@ public class UnitTypes{ drag = 0.1f; hitSize = 21f; rotateSpeed = 3f; - health = 2900; + health = 2700; armor = 7f; fogRadius = 40f; stepShake = 0f; @@ -3473,9 +3481,9 @@ public class UnitTypes{ trailColor = engineColor = Pal.techBlue; engineSize = 1.75f; engineLayer = Layer.effect; - speed = 3.7f; + speed = 3.35f; maxRange = 6f; - lifetime = 60f * 1.5f; + lifetime = 60f * 1.66f; outlineColor = Pal.darkOutline; health = 55; lowAltitude = true; @@ -3533,9 +3541,9 @@ public class UnitTypes{ region = "tecta-shield"; radius = 45f; angle = 82f; - regen = 40f / 60f; + regen = 45f / 60f; cooldown = 60f * 8f; - max = 2200f; + max = 2500f; y = -20f; width = 8f; whenShooting = false; @@ -3581,14 +3589,14 @@ public class UnitTypes{ velocityRnd = 0.33f; heatColor = Color.red; - bullet = new MissileBulletType(4.2f, 60){{ + bullet = new MissileBulletType(4.2f, 51){{ homingPower = 0.2f; weaveMag = 4; weaveScale = 4; lifetime = 55f; shootEffect = Fx.shootBig2; smokeEffect = Fx.shootSmokeTitan; - splashDamage = 70f; + splashDamage = 60f; splashDamageRadius = 30f; frontColor = Color.white; hitSound = Sounds.none; @@ -3679,7 +3687,7 @@ public class UnitTypes{ shadow = 10f; shootStatus = StatusEffects.slow; - shootStatusDuration = reload + 1f; + shootStatusDuration = reload + 170f; shoot.shots = 1; heatColor = Color.red; @@ -3901,13 +3909,31 @@ public class UnitTypes{ width = 7f; height = 12f; lifetime = 18f; + //floating point inaccuracy makes 0.6f show as -39% + buildingDamageMultiplier = 0.599999f; shootEffect = Fx.sparkShoot; smokeEffect = Fx.shootBigSmoke; hitColor = backColor = trailColor = Pal.suppress; frontColor = Color.white; trailWidth = 1.5f; trailLength = 5; - hitEffect = despawnEffect = Fx.hitBulletColor; + hitEffect = despawnEffect = new MultiEffect(Fx.hitSquaresColor, Fx.squareWaveEffect); + + fragOnDespawn = false; + fragBullets = 2; + fragBullet = new BasicBulletType(3f, 15){{ + width = 5f; + height = 8f; + lifetime = 14f; + fragVelocityMax = 1f; + fragVelocityMin = 0.7f; + buildingDamageMultiplier = 0.5f; + hitColor = backColor = trailColor = Pal.suppress; + frontColor = Color.white; + trailWidth = 1.2f; + trailLength = 4; + hitEffect = despawnEffect = Fx.hitBulletColor; + }}; }}; }}); }}; @@ -4046,7 +4072,7 @@ public class UnitTypes{ health = 6000f; armor = 4f; hitSize = 36f; - payloadCapacity = Mathf.sqr(3f) * tilePayload; + payloadCapacity = Mathf.sqr(4f) * tilePayload; researchCostMultiplier = 0f; targetAir = false; diff --git a/core/src/mindustry/entities/abilities/ShieldArcAbility.java b/core/src/mindustry/entities/abilities/ShieldArcAbility.java index 3dffd2c93e..dff883ee9e 100644 --- a/core/src/mindustry/entities/abilities/ShieldArcAbility.java +++ b/core/src/mindustry/entities/abilities/ShieldArcAbility.java @@ -38,13 +38,18 @@ public class ShieldArcAbility extends Ability{ if(penX > penY){ b.vel.x *= -1; + b.vel.y *= paramField.reflectVel; }else{ b.vel.y *= -1; + b.vel.x *= paramField.reflectVel; } b.owner = paramUnit; b.team = paramUnit.team; - b.time += 1f; + b.time = b.lifetime * paramField.reflectTime; + if(paramField.reflectBuildingDamage > 0f){ + b.buildingDamageMultiplier = paramField.reflectBuildingDamage; + } }else{ b.absorb(); @@ -124,6 +129,12 @@ public class ShieldArcAbility extends Ability{ public float width = 6f; /** Bullet deflection chance. -1 to disable */ public float chanceDeflect = -1f; + /** Multiplier for reflected bullet building damage. -1 to disable */ + public float reflectBuildingDamage = 1f; + /** Velocity multiplier for reflected bullets on the opposite axis. Negative values = concave, positive values = convex */ + public float reflectVel = 1f; + /** Time multiplier for reflected bullets. */ + public float reflectTime = 1f - 0.5f; /** Deflection sound. */ public Sound deflectSound = Sounds.none; public Sound breakSound = Sounds.shieldBreakSmall; @@ -154,8 +165,10 @@ public class ShieldArcAbility extends Ability{ t.add(abilityStat("repairspeed", Strings.autoFixed(regen * 60f, 2))); t.row(); t.add(abilityStat("cooldown", Strings.autoFixed(cooldown / 60f, 2))); - t.row(); - t.add(abilityStat("deflectchance", Strings.autoFixed(chanceDeflect *100f, 2))); + if(chanceDeflect > 0f){ + t.row(); + t.add(abilityStat("deflectchance", Strings.autoFixed(chanceDeflect *100f, 2))); + } } @Override diff --git a/core/src/mindustry/entities/bullet/BulletType.java b/core/src/mindustry/entities/bullet/BulletType.java index 9e2b10e846..b03e48e9b6 100644 --- a/core/src/mindustry/entities/bullet/BulletType.java +++ b/core/src/mindustry/entities/bullet/BulletType.java @@ -157,7 +157,7 @@ public class BulletType extends Content implements Cloneable{ public float extraRangeMargin = 0f; /** Range initialized in init(). */ public float range = 0f; - /** When used in a turret with multiple ammoo types, this can be set to a non-zero value to influence minRange */ + /** When used in a turret with multiple ammo types, this can be set to a non-zero value to influence minRange */ public float minRangeChange = 0f; /** % of block health healed **/ public float healPercent = 0f; @@ -173,11 +173,13 @@ public class BulletType extends Content implements Cloneable{ public boolean makeFire = false; /** Whether this bullet will always hit blocks under it. */ public boolean hitUnder = false; - /** Whether to create hit effects on despawn. Forced to true if this bullet has any special effects like splash damage. */ + /** Whether to create hit effects on despawn. Forced to true if this bullet has any special effects like splash damage. Disable setDefaults to avoid override */ public boolean despawnHit = false; - /** If true, this bullet will create bullets when it hits anything, not just when it despawns. */ + /** If true, this bullet will create bullets when it hits anything */ public boolean fragOnHit = true; - /** If false, this bullet will not create fraags when absorbed by a shield. */ + /** If true, this bullet will create bullets when it despawns */ + public boolean fragOnDespawn = true; + /** If false, this bullet will not create frags when absorbed by a shield. */ public boolean fragOnAbsorb = true; /** If true, unit armor is ignored in damage calculations. */ public boolean pierceArmor = false; @@ -269,7 +271,7 @@ public class BulletType extends Content implements Cloneable{ /** Random offset of trail effect. */ public float trailSpread = 0f; /** Rotation/size parameter that is passed to trail. Usually, this controls size. */ - public float trailParam = 2f; + public float trailParam = 2f; /** Whether the parameter passed to the trail is the bullet rotation, instead of a flat value. */ public boolean trailRotation = false; /** Interpolation for trail width as function of bullet lifetime */ @@ -527,16 +529,20 @@ public class BulletType extends Content implements Cloneable{ } public void hit(Bullet b){ - hit(b, b.x, b.y); + hit(b, b.x, b.y, true); } public void hit(Bullet b, float x, float y){ + hit(b, b.x, b.y, true); + } + + public void hit(Bullet b, float x, float y, boolean createFrags){ hitEffect.at(x, y, b.rotation(), hitColor); hitSound.at(x, y, hitSoundPitch + Mathf.range(hitSoundPitchRange), hitSoundVolume); Effect.shake(hitShake, hitShake, b); - if(fragOnHit){ + if(createFrags && fragOnHit){ if(delayFrags && fragBullet != null && fragBullet.delayFrags){ Time.run(0f, () -> createFrags(b, x, y)); }else{ @@ -596,7 +602,7 @@ public class BulletType extends Content implements Cloneable{ } public void createFrags(Bullet b, float x, float y){ - if(fragBullet != null && (fragOnAbsorb || !b.absorbed) && !(b.frags >= pierceFragCap && pierceFragCap > 0)){ + if(fragBullet != null && (fragOnAbsorb || !b.absorbed) && (pierceFragCap < 0 || b.frags < pierceFragCap)){ for(int i = 0; i < fragBullets; i++){ float len = Mathf.random(fragOffsetMin, fragOffsetMax); float a = b.rotation() + Mathf.range(fragRandomSpread / 2) + fragAngle + fragSpread * i - (fragBullets - 1) * fragSpread / 2f; @@ -620,15 +626,11 @@ public class BulletType extends Content implements Cloneable{ /** Called when the bullet reaches the end of its lifetime or is destroyed by something external. */ public void despawned(Bullet b){ if(despawnHit){ - hit(b); + hit(b, b.x, b.y, false); }else{ createUnits(b, b.x, b.y); } - if(!fragOnHit){ - createFrags(b, b.x, b.y); - } - despawnEffect.at(b.x, b.y, b.rotation(), hitColor); despawnSound.at(b, 1f + Mathf.range(hitSoundPitchRange)); @@ -641,15 +643,13 @@ public class BulletType extends Content implements Cloneable{ Fx.trailFade.at(b.x, b.y, trailWidth, trailColor, b.trail.copy()); } - //if the bullet never created any frags and is removed (probably by hitting something), it needs to spawn those - //TODO: disabled for now as this makes vanquish significantly more powerful - if(b.frags == 0 && !fragOnHit && fragBullet != null){ - // createFrags(b, b.x, b.y); + if(b.frags == 0 && fragOnDespawn && fragBullet != null){ + createFrags(b, b.x, b.y); } } public float buildingDamage(Bullet b){ - return b.damage() * buildingDamageMultiplier; + return b.damage() * b.buildingDamageMultiplier; } public float shieldDamage(Bullet b){ @@ -960,6 +960,7 @@ public class BulletType extends Content implements Cloneable{ bullet.hitSize = hitSize; bullet.mover = mover; bullet.damage = (damage < 0 ? this.damage : damage) * bullet.damageMultiplier(); + bullet.buildingDamageMultiplier = buildingDamageMultiplier; //reset trail if(bullet.trail != null){ bullet.trail.clear(); diff --git a/core/src/mindustry/entities/comp/BulletComp.java b/core/src/mindustry/entities/comp/BulletComp.java index f3176adb1a..f89e2e9860 100644 --- a/core/src/mindustry/entities/comp/BulletComp.java +++ b/core/src/mindustry/entities/comp/BulletComp.java @@ -45,6 +45,7 @@ abstract class BulletComp implements Timedc, Damagec, Hitboxc, Teamc, Posc, Draw transient @Nullable Tile aimTile; transient float aimX, aimY; transient float originX, originY; + transient float buildingDamageMultiplier; transient @Nullable Mover mover; transient boolean absorbed, hit; transient @Nullable Trail trail;