diff --git a/core/assets-raw/sprites/units/conquer-cell.png b/core/assets-raw/sprites/units/conquer-cell.png index b42c07d4df..e7e350d5ec 100644 Binary files a/core/assets-raw/sprites/units/conquer-cell.png and b/core/assets-raw/sprites/units/conquer-cell.png differ diff --git a/core/assets-raw/sprites/units/conquer-glow.png b/core/assets-raw/sprites/units/conquer-glow.png index 294453e5dd..3e79f202b3 100644 Binary files a/core/assets-raw/sprites/units/conquer-glow.png and b/core/assets-raw/sprites/units/conquer-glow.png differ diff --git a/core/assets-raw/sprites/units/conquer-test1.png b/core/assets-raw/sprites/units/conquer-test1.png deleted file mode 100644 index 544bfc7456..0000000000 Binary files a/core/assets-raw/sprites/units/conquer-test1.png and /dev/null differ diff --git a/core/assets-raw/sprites/units/conquer-weapon.png b/core/assets-raw/sprites/units/conquer-weapon.png new file mode 100644 index 0000000000..7a8ecca09b Binary files /dev/null and b/core/assets-raw/sprites/units/conquer-weapon.png differ diff --git a/core/assets-raw/sprites/units/conquer.aseprite b/core/assets-raw/sprites/units/conquer.aseprite index f15725ad95..fef7b57363 100644 Binary files a/core/assets-raw/sprites/units/conquer.aseprite and b/core/assets-raw/sprites/units/conquer.aseprite differ diff --git a/core/assets-raw/sprites/units/conquer.png b/core/assets-raw/sprites/units/conquer.png index 4561798974..0eec5bc3dc 100644 Binary files a/core/assets-raw/sprites/units/conquer.png and b/core/assets-raw/sprites/units/conquer.png differ diff --git a/core/assets-raw/sprites/units/disrupt-cell.png b/core/assets-raw/sprites/units/disrupt-cell.png new file mode 100644 index 0000000000..4c6beb6e2d Binary files /dev/null and b/core/assets-raw/sprites/units/disrupt-cell.png differ diff --git a/core/assets-raw/sprites/units/disrupt.png b/core/assets-raw/sprites/units/disrupt.png new file mode 100644 index 0000000000..660ffb4767 Binary files /dev/null and b/core/assets-raw/sprites/units/disrupt.png differ diff --git a/core/assets/icons/icons.properties b/core/assets/icons/icons.properties index c4469beb0b..bc3865d75c 100755 --- a/core/assets/icons/icons.properties +++ b/core/assets/icons/icons.properties @@ -518,3 +518,4 @@ 63185=red-diamond-wall|block-red-diamond-wall-ui 63184=crystal-orbs|block-crystal-orbs-ui 63183=conquer|unit-conquer-ui +63182=disrupt|unit-disrupt-ui diff --git a/core/assets/logicids.dat b/core/assets/logicids.dat index ca952ad4a2..ecb86820fe 100644 Binary files a/core/assets/logicids.dat and b/core/assets/logicids.dat differ diff --git a/core/src/mindustry/content/Blocks.java b/core/src/mindustry/content/Blocks.java index e494dd551b..0938d34b3a 100644 --- a/core/src/mindustry/content/Blocks.java +++ b/core/src/mindustry/content/Blocks.java @@ -2513,7 +2513,7 @@ public class Blocks{ thrusterLength = 34/4f; armor = 5f; - unitCapModifier = 8; + unitCapModifier = 6; researchCostMultiplier = 0.07f; }}; @@ -2528,7 +2528,7 @@ public class Blocks{ thrusterLength = 40/4f; armor = 10f; - unitCapModifier = 16; + unitCapModifier = 12; researchCostMultiplier = 0.11f; }}; @@ -2543,7 +2543,7 @@ public class Blocks{ thrusterLength = 48/4f; armor = 15f; - unitCapModifier = 24; + unitCapModifier = 16; researchCostMultiplier = 0.11f; }}; diff --git a/core/src/mindustry/content/UnitTypes.java b/core/src/mindustry/content/UnitTypes.java index fd0ea4072d..4b49df1ca3 100644 --- a/core/src/mindustry/content/UnitTypes.java +++ b/core/src/mindustry/content/UnitTypes.java @@ -52,7 +52,7 @@ public class UnitTypes{ //air + payload public static @EntityDef({Unitc.class, Payloadc.class}) UnitType mega, - incite, emanate, quell; + incite, emanate, quell, disrupt; //air + payload, legacy public static @EntityDef(value = {Unitc.class, Payloadc.class}, legacy = true) UnitType quad; @@ -2509,8 +2509,45 @@ public class UnitTypes{ areaDamage = 22f; rotateSpeed = 0.9f; treadRects = new Rect[]{new Rect(27, 152, 56, 73), new Rect(24, 51, 29, 17), new Rect(59, 18, 39, 19)}; - decals.add(new UnitDecal("conquer-glow", 0, 0, 0, -1, Pal.turretHeat.cpy()){{ - blending = Blending.additive; + + //TODO maybe different sprite, weapon impl + weapons.add(new Weapon("conquer-weapon"){{ + layerOffset = 0.0001f; + reload = 120f; + shootY = 71f / 4f; + shake = 5f; + recoil = 4f; + rotate = true; + rotateSpeed = 0.6f; + mirror = false; + x = 0f; + shadow = 32f; + y = -5f; + heatColor = Color.valueOf("f9350f"); + cooldownTime = 80f; + + bullet = new BasicBulletType(8f, 110){{ + sprite = "missile-large"; + width = 9.5f; + height = 15f; + lifetime = 30f; + 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; + trailLength = 8; + hitEffect = despawnEffect = Fx.blastExplosion; + }}; + }}); + + //TODO could change color when shooting + decals.add(new UnitDecal("conquer-glow", Pal.turretHeat.cpy(), Blending.additive){{ + layer = -1f; }}); }}; @@ -2688,6 +2725,95 @@ public class UnitTypes{ ); }}; + disrupt = new UnitType("disrupt"){{ + defaultController = FlyingFollowAI::new; + envDisabled = 0; + + outlineColor = Pal.darkOutline; + lowAltitude = false; + flying = true; + drag = 0.07f; + speed = 1f; + rotateSpeed = 2.5f; + accel = 0.1f; + health = 10000f; + armor = 7f; + hitSize = 46f; + payloadCapacity = Mathf.sqr(6f) * tilePayload; + + engineSize = 6f; + engineOffset = 25.25f; + + float orbRad = 5f, partRad = 3f; + int parts = 10; + + abilities.add(new SuppressionFieldAbility(){{ + orbRadius = orbRad; + particleSize = partRad; + y = 10f; + particles = parts; + }}); + + for(int i : Mathf.signs){ + abilities.add(new SuppressionFieldAbility(){{ + orbRadius = orbRad; + particleSize = partRad; + y = -33f / 4f; + x = 43f * i / 4f; + particles = parts; + //visual only, the middle one does the actual suppressing + active = false; + }}); + } + + if(false) + weapons.add(new Weapon("quell-weapon"){{ + x = 51 / 4f; + y = 5 / 4f; + rotate = true; + rotateSpeed = 2f; + reload = 70f; + layerOffset = -0.001f; + recoil = 1f; + rotationLimit = 60f; + + bullet = new BulletType(){{ + shootEffect = Fx.shootBig; + smokeEffect = Fx.shootBigSmoke2; + shake = 1f; + speed = 0f; + keepVelocity = false; + }}; + + unitSpawned = new MissileUnitType("quell-missile"){{ + speed = 3.8f; + maxRange = 80f; + outlineColor = Pal.darkOutline; + health = 45; + + weapons.add(new Weapon(){{ + shootCone = 360f; + mirror = false; + reload = 1f; + shootOnDeath = true; + bullet = new BulletType(){{ + rangeOverride = 20f; + shootEffect = Fx.massiveExplosion; + killShooter = true; + //TODO status? + splashDamageRadius = 30f; + splashDamage = 120f; + }}; + }}); + }}; + }}); + + setEnginesMirror( + new UnitEngine(95 / 4f, -56 / 4f, 5f, 330f), + new UnitEngine(89 / 4f, -95 / 4f, 4f, 315f) + ); + }}; + //endregion //region erekir - neoplasm diff --git a/core/src/mindustry/entities/abilities/SuppressionFieldAbility.java b/core/src/mindustry/entities/abilities/SuppressionFieldAbility.java index 56ee158fb9..ddbe055b66 100644 --- a/core/src/mindustry/entities/abilities/SuppressionFieldAbility.java +++ b/core/src/mindustry/entities/abilities/SuppressionFieldAbility.java @@ -31,6 +31,7 @@ public class SuppressionFieldAbility extends Ability{ public float particleLen = 7f; public float rotateScl = 3f; public float particleLife = 110f; + public boolean active = true; public Interp particleInterp = f -> Interp.circleOut.apply(Interp.slope.apply(f)); public Color particleColor = Pal.sap.cpy(); @@ -42,6 +43,8 @@ public class SuppressionFieldAbility extends Ability{ @Override public void update(Unit unit){ + if(!active) return; + if((timer += Time.delta) >= reload){ any = false; builds.clear(); @@ -88,7 +91,7 @@ public class SuppressionFieldAbility extends Ability{ float rx = unit.x + Tmp.v1.x, ry = unit.y + Tmp.v1.y; float base = (Time.time / particleLife); - rand.setSeed(unit.id); + rand.setSeed(unit.id + hashCode()); Draw.color(particleColor); for(int i = 0; i < particles; i++){ float fin = (rand.random(1f) + base) % 1f, fout = 1f - fin; @@ -110,7 +113,7 @@ public class SuppressionFieldAbility extends Ability{ Fill.circle(rx, ry, rad * orbMidScl); //TODO improve - if(heat > 0.001f){ + if(heat > 0.001f && false){ Draw.color(Pal.sapBullet); Lines.stroke(1.2f * heat * Mathf.absin(10f, 1f)); Lines.circle(rx, ry, range); diff --git a/core/src/mindustry/entities/comp/TankComp.java b/core/src/mindustry/entities/comp/TankComp.java index b28b9ffca6..5c8b10502a 100644 --- a/core/src/mindustry/entities/comp/TankComp.java +++ b/core/src/mindustry/entities/comp/TankComp.java @@ -41,8 +41,9 @@ abstract class TankComp implements Posc, Flyingc, Hitboxc, Unitc, ElevationMovec float yOffset = (treadRegion.height/2f - (treadRect.y + treadRect.height/2f)) / 4f; for(int i : Mathf.signs){ - Tmp.v1.set(xOffset * i, yOffset - treadRect.height / 2f / 4f - 2f).rotate(rotation - 90); + Tmp.v1.set(xOffset * i, yOffset - treadRect.height / 2f / 4f).rotate(rotation - 90); + //TODO could fin for a while Effect.floorDustAngle(type.treadEffect, Tmp.v1.x + x, Tmp.v1.y + y, rotation + 180f); } diff --git a/core/src/mindustry/entities/units/UnitDecal.java b/core/src/mindustry/entities/units/UnitDecal.java index bd0b3c72ae..7ccd8b3222 100644 --- a/core/src/mindustry/entities/units/UnitDecal.java +++ b/core/src/mindustry/entities/units/UnitDecal.java @@ -1,6 +1,7 @@ package mindustry.entities.units; import arc.graphics.*; +import arc.graphics.g2d.*; import mindustry.graphics.*; /** A sprite drawn in addition to the base unit sprites. */ @@ -12,6 +13,8 @@ public class UnitDecal{ public Blending blending = Blending.normal; public Color color = Color.white; + public TextureRegion loadedRegion; + public UnitDecal(String region, float x, float y, float rotation, float layer, Color color){ this.region = region; this.x = x; @@ -21,6 +24,12 @@ public class UnitDecal{ this.color = color; } + public UnitDecal(String region, Color color, Blending blending){ + this.region = region; + this.color = color; + this.blending = blending; + } + public UnitDecal(){ } } diff --git a/core/src/mindustry/type/UnitType.java b/core/src/mindustry/type/UnitType.java index 38127c0ae3..dbc290fd45 100644 --- a/core/src/mindustry/type/UnitType.java +++ b/core/src/mindustry/type/UnitType.java @@ -454,7 +454,7 @@ public class UnitType extends UnlockableContent{ Fx.rand.setSeed(e.id); for(int i = 0; i < 3; i++){ Fx.v.trns(e.rotation + Fx.rand.range(40f), Fx.rand.random(6f * e.finpow())); - Fill.circle(e.x + Fx.v.x + Fx.rand.range(4f), e.y + Fx.v.y + Fx.rand.range(4f), e.fout() * hitSize / 28f * 3f * Fx.rand.random(0.8f, 1.1f) + 0.3f); + Fill.circle(e.x + Fx.v.x + Fx.rand.range(4f), e.y + Fx.v.y + Fx.rand.range(4f), Math.min(e.fout(), e.fin() * e.lifetime / 8f) * hitSize / 28f * 3f * Fx.rand.random(0.8f, 1.1f) + 0.3f); } }).layer(Layer.debris); } @@ -557,6 +557,10 @@ public class UnitType extends UnlockableContent{ segmentOutlineRegions[i] = Core.atlas.find(name + "-segment-outline" + i); } + for(var decal : decals){ + decal.loadedRegion = Core.atlas.find(decal.region); + } + clipSize = Math.max(region.width * 2f, clipSize); } @@ -774,7 +778,7 @@ public class UnitType extends UnlockableContent{ Draw.z(d.layer <= 0f ? z : d.layer); Draw.scl(d.xScale, d.yScale); Draw.color(d.color); - Draw.rect(d.region, unit.x + Angles.trnsx(base, d.x, d.y), unit.y + Angles.trnsy(base, d.x, d.y), base + d.rotation); + Draw.rect(d.loadedRegion, unit.x + Angles.trnsx(base, d.x, d.y), unit.y + Angles.trnsy(base, d.x, d.y), base + d.rotation); Draw.blend(); } Draw.reset(); diff --git a/core/src/mindustry/type/unit/TankUnitType.java b/core/src/mindustry/type/unit/TankUnitType.java index ca5597f19d..d858e2be03 100644 --- a/core/src/mindustry/type/unit/TankUnitType.java +++ b/core/src/mindustry/type/unit/TankUnitType.java @@ -17,5 +17,4 @@ public class TankUnitType extends UnitType{ outlineColor = Pal.darkOutline; } - }