From 677abf4924d9dfffb8c0de10cbf66b91f1ba5e94 Mon Sep 17 00:00:00 2001 From: Anuken Date: Mon, 27 Dec 2021 15:54:09 -0500 Subject: [PATCH] 3x3 breach --- .../sprites/blocks/turrets/breach.png | Bin 787 -> 2413 bytes core/assets/bundles/bundle.properties | 1 + core/src/mindustry/content/Blocks.java | 34 +++++++++--------- core/src/mindustry/content/Liquids.java | 2 +- .../mindustry/entities/bullet/BulletType.java | 2 ++ core/src/mindustry/type/Liquid.java | 4 +++ .../blocks/defense/turrets/BaseTurret.java | 2 +- .../blocks/defense/turrets/ItemTurret.java | 3 +- .../world/blocks/defense/turrets/Turret.java | 12 ++++++- .../world/consumers/ConsumeCoolant.java | 2 +- core/src/mindustry/world/meta/StatValues.java | 4 +++ 11 files changed, 45 insertions(+), 21 deletions(-) diff --git a/core/assets-raw/sprites/blocks/turrets/breach.png b/core/assets-raw/sprites/blocks/turrets/breach.png index 03284ae8d3a3da5dba187bd308c0505a03853638..affd6b4599f8a08bd3d049795635b8f847e2b994 100644 GIT binary patch literal 2413 zcmV-z36l1SP)GYL527Q5>SksVQ#o{`@Z+?t9sp4?bLy$yQ`{SRh`pa{k?BxVo;_412Y8} zm?^-(OaTUF3NSFE4sh(H^^1oeII_;^vs0gJ)VO-=@uw~xyz}mLPFq{wRNZ!wj5YxB zwTRjPh?m=Qd8`pe8NkYiJ^^5?5k?n)L&x=NH{xs;eFMPJ$Dgh~l+Bw_1wcMKJg)$Z z+vWLWo{T1d$OlAOT08<|+%ZKMMF1@yM3kmw02oVz!2?+Nu!sOKh6sZO@Z`h!^FPl- z==%sbaPVG+o?+++g9S**7i@$+0aEgXAtMYDpd??=5xNE_$rpx-Fh~I26v>X4kO*A@ zMCA*$>uAB~0{{_fKT6r6z3A5YXFfCjF)2yu!9!GWg>J5pydN& z<(LBOU`27gR?gbm+RV#P#>r8;juwpajhH8@R*v^X?~SXeT}KP10E#KV4jl9Cy|q@3 zeFX5*wnXhZS}@8-0N4n%a&&-*e5h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#V|-o;DnOEfu|yc2P$uldPrCY zJU~1n%PtGA}Rto2UI_h58ckk`Mt87}Wr4 z2~qHXVG*>F5D5Gc2r002ovPDHLkV1hV&SbYEh diff --git a/core/assets/bundles/bundle.properties b/core/assets/bundles/bundle.properties index 10d72f7b64..72490d09d8 100644 --- a/core/assets/bundles/bundle.properties +++ b/core/assets/bundles/bundle.properties @@ -840,6 +840,7 @@ bullet.infinitepierce = [stat]pierce bullet.healpercent = [stat]{0}[lightgray]% healing bullet.multiplier = [stat]{0}[lightgray]x ammo multiplier bullet.reload = [stat]{0}[lightgray]x fire rate +bullet.range = [stat]{0}[lightgray] tiles range unit.blocks = blocks unit.blockssquared = blocksĀ² diff --git a/core/src/mindustry/content/Blocks.java b/core/src/mindustry/content/Blocks.java index daade53c53..f5e7f4997b 100644 --- a/core/src/mindustry/content/Blocks.java +++ b/core/src/mindustry/content/Blocks.java @@ -2892,13 +2892,12 @@ public class Blocks{ consumes.add(new ConsumeCoolant(0.5f)).update(false); }}; - //TODO tungsten support? breach = new ItemTurret("breach"){{ - requirements(Category.turret, with(Items.beryllium, 35, Items.silicon, 20)); + requirements(Category.turret, with(Items.beryllium, 80, Items.silicon, 50)); ammo( - Items.beryllium, new BasicBulletType(7f, 40){{ - width = 8f; - height = 14f; + Items.beryllium, new BasicBulletType(7f, 70){{ + width = 12f; + height = 20f; shootEffect = Fx.colorSpark; smokeEffect = Fx.shootBigSmoke; ammoMultiplier = 1; @@ -2906,37 +2905,39 @@ public class Blocks{ pierceBuilding = true; hitColor = backColor = trailColor = Pal.berylShot; frontColor = Color.white; - trailWidth = 1.5f; + trailWidth = 2.1f; trailLength = 10; hitEffect = despawnEffect = Fx.hitBulletColor; }}, - Items.tungsten, new BasicBulletType(6.6f, 55){{ - width = 9f; - height = 14f; - shootEffect = Fx.tungstenSpark; + Items.tungsten, new BasicBulletType(7.5f, 140){{ + width = 13f; + height = 19f; + shootEffect = Fx.colorSpark; smokeEffect = Fx.shootBigSmoke; ammoMultiplier = 1; - reloadMultiplier = 0.7f; + reloadMultiplier = 1f; pierce = true; pierceBuilding = true; hitColor = backColor = trailColor = Pal.tungstenShot; frontColor = Color.white; - trailWidth = 1.6f; - trailLength = 10; + trailWidth = 2.2f; + trailLength = 11; hitEffect = despawnEffect = Fx.hitBulletColor; + rangeChange = 40f; }} ); //TODO no coolant? + ammoPerShot = 4; draw = new DrawTurret("reinforced-"); shootLength = 0f; outlineColor = Pal.darkOutline; - size = 2; + size = 3; envEnabled |= Env.space; - reloadTime = 35f; + reloadTime = 40f; restitution = 0.03f; - range = 180; + range = 190; shootCone = 3f; health = 350 * size * size; rotateSpeed = 1.6f; @@ -2944,6 +2945,7 @@ public class Blocks{ limitRange(); }}; + //TODO 3x3, different mechanics - not a fuse clone fracture = new ItemTurret("fracture"){{ requirements(Category.turret, with(Items.beryllium, 10, Items.graphite, 30, Items.silicon, 35)); ammo( diff --git a/core/src/mindustry/content/Liquids.java b/core/src/mindustry/content/Liquids.java index bcad1187b8..679bda6552 100644 --- a/core/src/mindustry/content/Liquids.java +++ b/core/src/mindustry/content/Liquids.java @@ -62,7 +62,7 @@ public class Liquids{ }}; gallium = new Liquid("gallium", Color.valueOf("9a9dbf")){{ - + coolant = false; }}; //TODO reactivity, etc diff --git a/core/src/mindustry/entities/bullet/BulletType.java b/core/src/mindustry/entities/bullet/BulletType.java index db914c7a34..d13910641f 100644 --- a/core/src/mindustry/entities/bullet/BulletType.java +++ b/core/src/mindustry/entities/bullet/BulletType.java @@ -114,6 +114,8 @@ public class BulletType extends Content implements Cloneable{ public boolean backMove = true; /** Bullet range override. */ public float maxRange = -1f; + /** When used in a turret with multiple ammo types, this can be set to a non-zero value to influence range. */ + public float rangeChange = 0f; /** % of block health healed **/ public float healPercent = 0f; /** Whether to make fire on impact */ diff --git a/core/src/mindustry/type/Liquid.java b/core/src/mindustry/type/Liquid.java index 15e6a81be4..d68af2a30b 100644 --- a/core/src/mindustry/type/Liquid.java +++ b/core/src/mindustry/type/Liquid.java @@ -42,6 +42,8 @@ public class Liquid extends UnlockableContent{ public float viscosity = 0.5f; /** how prone to exploding this liquid is, when heated. 0 = nothing, 1 = nuke */ public float explosiveness; + /** if false, this liquid cannot be a coolant */ + public boolean coolant = true; /** The associated status effect. */ public StatusEffect effect = StatusEffects.none; /** Effect shown in puddles. */ @@ -70,6 +72,8 @@ public class Liquid extends UnlockableContent{ super.init(); if(gas){ + //gases can't be coolants + coolant = false; //always "boils", it's a gas boilPoint = -1; //ensure no accidental global mutation diff --git a/core/src/mindustry/world/blocks/defense/turrets/BaseTurret.java b/core/src/mindustry/world/blocks/defense/turrets/BaseTurret.java index f8013c677f..e3d33c56e2 100644 --- a/core/src/mindustry/world/blocks/defense/turrets/BaseTurret.java +++ b/core/src/mindustry/world/blocks/defense/turrets/BaseTurret.java @@ -69,7 +69,7 @@ public class BaseTurret extends Block{ @Override public void drawSelect(){ - Drawf.dashCircle(x, y, range, team.color); + Drawf.dashCircle(x, y, range(), team.color); } } } diff --git a/core/src/mindustry/world/blocks/defense/turrets/ItemTurret.java b/core/src/mindustry/world/blocks/defense/turrets/ItemTurret.java index 01c9a58194..00c4b5aecb 100644 --- a/core/src/mindustry/world/blocks/defense/turrets/ItemTurret.java +++ b/core/src/mindustry/world/blocks/defense/turrets/ItemTurret.java @@ -39,7 +39,8 @@ public class ItemTurret extends Turret{ public void limitRange(float margin){ for(var entry : ammoTypes.copy().entries()){ var copy = entry.value.copy(); - copy.lifetime = (range + margin) / copy.speed; + float realRange = copy.rangeChange + range; + copy.lifetime = (realRange + margin) / copy.speed; ammoTypes.put(entry.key, copy); } } diff --git a/core/src/mindustry/world/blocks/defense/turrets/Turret.java b/core/src/mindustry/world/blocks/defense/turrets/Turret.java index ad4cabb7aa..8e18418a7d 100644 --- a/core/src/mindustry/world/blocks/defense/turrets/Turret.java +++ b/core/src/mindustry/world/blocks/defense/turrets/Turret.java @@ -214,6 +214,14 @@ public class Turret extends ReloadTurret{ public float heatReq; public float[] sideHeat = new float[4]; + @Override + public float range(){ + if(hasAmmo()){ + return range + peekAmmo().rangeChange; + } + return range; + } + @Override public float warmup(){ return shootWarmup; @@ -408,6 +416,8 @@ public class Turret extends ReloadTurret{ } protected void findTarget(){ + float range = range(); + if(targetAir && !targetGround){ target = Units.bestEnemy(team, x, y, range, e -> !e.dead() && !e.isGrounded(), unitSort); }else{ @@ -553,7 +563,7 @@ public class Turret extends ReloadTurret{ } protected void bullet(BulletType type, float angle){ - float lifeScl = type.scaleVelocity ? Mathf.clamp(Mathf.dst(x + bulletOffset.x, y + bulletOffset.y, targetPos.x, targetPos.y) / type.range(), minRange / type.range(), range / type.range()) : 1f; + float lifeScl = type.scaleVelocity ? Mathf.clamp(Mathf.dst(x + bulletOffset.x, y + bulletOffset.y, targetPos.x, targetPos.y) / type.range(), minRange / type.range(), range() / type.range()) : 1f; type.create(this, team, x + bulletOffset.x, y + bulletOffset.y, angle, 1f + Mathf.range(velocityInaccuracy), lifeScl); } diff --git a/core/src/mindustry/world/consumers/ConsumeCoolant.java b/core/src/mindustry/world/consumers/ConsumeCoolant.java index a71f6fdb55..fddb4b914b 100644 --- a/core/src/mindustry/world/consumers/ConsumeCoolant.java +++ b/core/src/mindustry/world/consumers/ConsumeCoolant.java @@ -5,7 +5,7 @@ public class ConsumeCoolant extends ConsumeLiquidFilter{ public float maxTemp = 0.5f, maxFlammability = 0.1f; public ConsumeCoolant(float amount){ - this.filter = liquid -> liquid.temperature <= maxTemp && liquid.flammability < maxFlammability; + this.filter = liquid -> liquid.coolant && liquid.temperature <= maxTemp && liquid.flammability < maxFlammability; this.amount = amount; } diff --git a/core/src/mindustry/world/meta/StatValues.java b/core/src/mindustry/world/meta/StatValues.java index e292f5bf33..cbfcbac5e7 100644 --- a/core/src/mindustry/world/meta/StatValues.java +++ b/core/src/mindustry/world/meta/StatValues.java @@ -305,6 +305,10 @@ public class StatValues{ sep(bt, Core.bundle.format("bullet.buildingdamage", (int)(type.buildingDamageMultiplier * 100))); } + if(type.rangeChange != 0 && !compact){ + sep(bt, Core.bundle.format("bullet.range", (type.rangeChange > 0 ? "+" : "-") + Strings.autoFixed(type.rangeChange / tilesize, 1))); + } + if(type.splashDamage > 0){ sep(bt, Core.bundle.format("bullet.splashdamage", (int)type.splashDamage, Strings.fixed(type.splashDamageRadius / tilesize, 1))); }