diff --git a/android/build.gradle b/android/build.gradle index c215486765..586efca310 100644 --- a/android/build.gradle +++ b/android/build.gradle @@ -92,6 +92,17 @@ android{ } } + buildTypes{ + all{ + minifyEnabled = true + shrinkResources = true + //this is the ONLY WAY I could find to force r8 to keep its filthy hands off of my default interfaces. + //may have undesirable side effects + debuggable = true + proguardFiles("proguard-rules.pro") + } + } + if(project.hasProperty("RELEASE_STORE_FILE") || System.getenv("CI") == "true"){ buildTypes{ release{ diff --git a/core/assets-raw/sprites/blocks/campaign/interplanetary-accelerator-team.png b/core/assets-raw/sprites/blocks/campaign/interplanetary-accelerator-team_TODO_UNUSED.png similarity index 100% rename from core/assets-raw/sprites/blocks/campaign/interplanetary-accelerator-team.png rename to core/assets-raw/sprites/blocks/campaign/interplanetary-accelerator-team_TODO_UNUSED.png diff --git a/core/assets-raw/sprites/units/conquer.aseprite b/core/assets-raw/sprites/units/conquer.aseprite index a03661e347..a867d6e0c0 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/krepost-cell.png b/core/assets-raw/sprites/units/krepost-cell.png new file mode 100644 index 0000000000..2e87344fb5 Binary files /dev/null and b/core/assets-raw/sprites/units/krepost-cell.png differ diff --git a/core/assets-raw/sprites/units/krepost-foot__.png b/core/assets-raw/sprites/units/krepost-foot__.png new file mode 100644 index 0000000000..f035f791d4 Binary files /dev/null and b/core/assets-raw/sprites/units/krepost-foot__.png differ diff --git a/core/assets-raw/sprites/units/krepost-leg-base.png b/core/assets-raw/sprites/units/krepost-leg-base.png new file mode 100644 index 0000000000..9915e77d4b Binary files /dev/null and b/core/assets-raw/sprites/units/krepost-leg-base.png differ diff --git a/core/assets-raw/sprites/units/krepost-leg.png b/core/assets-raw/sprites/units/krepost-leg.png new file mode 100644 index 0000000000..fc8fba6a7f Binary files /dev/null and b/core/assets-raw/sprites/units/krepost-leg.png differ diff --git a/core/assets-raw/sprites/units/krepost.png b/core/assets-raw/sprites/units/krepost.png index 8abb5caf67..bb37e06850 100644 Binary files a/core/assets-raw/sprites/units/krepost.png and b/core/assets-raw/sprites/units/krepost.png differ diff --git a/core/assets/icons/icons.properties b/core/assets/icons/icons.properties index bc3865d75c..0ae2b2e3c7 100755 --- a/core/assets/icons/icons.properties +++ b/core/assets/icons/icons.properties @@ -519,3 +519,4 @@ 63184=crystal-orbs|block-crystal-orbs-ui 63183=conquer|unit-conquer-ui 63182=disrupt|unit-disrupt-ui +63181=krepost|unit-krepost-ui diff --git a/core/assets/logicids.dat b/core/assets/logicids.dat index ecb86820fe..d6b1e06210 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 d3a9ea1dae..6fa79887f1 100644 --- a/core/src/mindustry/content/Blocks.java +++ b/core/src/mindustry/content/Blocks.java @@ -3147,14 +3147,14 @@ public class Blocks{ //TODO balance, set up, where is liquid/sec displayed? status effects maybe? ammo( Liquids.ozone, new ContinuousFlameBulletType(){{ - damage = 85f; + damage = 90f; length = range; knockback = 1f; colors = new Color[]{Color.valueOf("eb7abe").a(0.55f), Color.valueOf("e189f5").a(0.7f), Color.valueOf("907ef7").a(0.8f), Color.valueOf("91a4ff"), Color.white}; }}, Liquids.cyanogen, new ContinuousFlameBulletType(){{ - damage = 180f; + damage = 200f; rangeChange = 70f; length = range + rangeChange; knockback = 2f; @@ -3167,7 +3167,7 @@ public class Blocks{ ); acceptCoolant = false; - scaledHealth = 320; + scaledHealth = 330; shootLength = 7f; size = 3; }}; diff --git a/core/src/mindustry/content/SectorPresets.java b/core/src/mindustry/content/SectorPresets.java index 0bc24a8e27..c94c3e6e0e 100644 --- a/core/src/mindustry/content/SectorPresets.java +++ b/core/src/mindustry/content/SectorPresets.java @@ -125,7 +125,7 @@ public class SectorPresets{ three = new SectorPreset("three", erekir, 32){{ captureWave = 8; - difficulty = 8; + difficulty = 5; }}; //endregion diff --git a/core/src/mindustry/content/UnitTypes.java b/core/src/mindustry/content/UnitTypes.java index 8dcb38a3b1..72db812aaf 100644 --- a/core/src/mindustry/content/UnitTypes.java +++ b/core/src/mindustry/content/UnitTypes.java @@ -2650,6 +2650,42 @@ public class UnitTypes{ }}); }}; + krepost = new UnitType("krepost"){{ + drag = 0.1f; + speed = 1f; + hitSize = 19f; + health = 7300; + armor = 5f; + outlineColor = Pal.darkOutline; + envDisabled = Env.space; + rotateSpeed = 1.8f; + lockLegBase = true; + legStraightness = 1f; + baseLegStraightness = 0.6f; + + legCount = 8; + legLength = 30f; + legTrns = 2f; + legMoveSpace = 1.05f; + rippleScale = 1.2f; + landShake = 0.5f; + legGroupSize = 2; + legExtension = -5f; + legBaseOffset = 19f; + legStraightLength = 0.9f; + maxStretch = 1.2f; + + ammoType = new PowerAmmoType(2000); + + legSplashDamage = 32; + legSplashRange = 32; + drownTimeMultiplier = 2f; + + hovering = true; + visualElevation = 0.4f; + groundLayer = Layer.legUnit; + }}; + //endregion //region erekir - flying diff --git a/core/src/mindustry/entities/comp/LegsComp.java b/core/src/mindustry/entities/comp/LegsComp.java index f147217c57..a5512a19fb 100644 --- a/core/src/mindustry/entities/comp/LegsComp.java +++ b/core/src/mindustry/entities/comp/LegsComp.java @@ -17,7 +17,9 @@ import mindustry.world.blocks.environment.*; @Component abstract class LegsComp implements Posc, Rotc, Hitboxc, Flyingc, Unitc{ - @Import float x, y; + private static final Vec2 straightVec = new Vec2(); + + @Import float x, y, rotation; @Import UnitType type; @Import Team team; @@ -83,6 +85,10 @@ abstract class LegsComp implements Posc, Rotc, Hitboxc, Flyingc, Unitc{ baseRotation = Angles.moveToward(baseRotation, Mathf.angle(deltaX(), deltaY()), type.rotateSpeed); } + if(type.lockLegBase){ + baseRotation = rotation; + } + float rot = baseRotation; float legLength = type.legLength; @@ -106,8 +112,8 @@ abstract class LegsComp implements Posc, Rotc, Hitboxc, Flyingc, Unitc{ int deeps = 0; for(int i = 0; i < legs.length; i++){ - float dstRot = legAngle(rot, i); - Vec2 baseOffset = Tmp.v5.trns(dstRot, type.legBaseOffset).add(x, y); + float dstRot = legAngle(i); + Vec2 baseOffset = legOffset(Tmp.v5, i).add(x, y); Leg l = legs[i]; l.joint.sub(baseOffset).limit(type.maxStretch * legLength/2f).add(baseOffset); @@ -121,6 +127,7 @@ abstract class LegsComp implements Posc, Rotc, Hitboxc, Flyingc, Unitc{ //back legs have reversed directions boolean backLeg = Math.abs((i + 0.5f) - legs.length/2f) <= 0.501f; if(backLeg && type.flipBackLegs) side = !side; + if(type.flipLegSide) side = !side; l.moving = move; l.stage = moving ? stageF % 1f : Mathf.lerpDelta(l.stage, 0f, 0.1f); @@ -180,9 +187,29 @@ abstract class LegsComp implements Posc, Rotc, Hitboxc, Flyingc, Unitc{ } } + Vec2 legOffset(Vec2 out, int index){ + out.trns(defaultLegAngle(index), type.legBaseOffset); + + if(type.legStraightness > 0){ + straightVec.trns(defaultLegAngle(index) - baseRotation, type.legBaseOffset); + straightVec.y = Mathf.sign(straightVec.y) * type.legBaseOffset * type.legStraightLength; + straightVec.rotate(baseRotation); + out.lerp(straightVec, type.baseLegStraightness); + } + + return out; + } + /** @return outwards facing angle of leg at the specified index. */ - float legAngle(float rotation, int index){ - return rotation + 360f / legs.length * index + (360f / legs.length / 2f); + float legAngle(int index){ + if(type.legStraightness > 0){ + return Mathf.slerp(defaultLegAngle(index), (index >= legs.length/2 ? -90 : 90f) + baseRotation, type.legStraightness); + } + return defaultLegAngle(index); + } + + float defaultLegAngle(int index){ + return baseRotation + 360f / legs.length * index + (360f / legs.length / 2f); } } diff --git a/core/src/mindustry/type/UnitType.java b/core/src/mindustry/type/UnitType.java index dbc290fd45..7c738f3b8e 100644 --- a/core/src/mindustry/type/UnitType.java +++ b/core/src/mindustry/type/UnitType.java @@ -111,7 +111,12 @@ public class UnitType extends UnlockableContent{ public int legCount = 4, legGroupSize = 2; public float legLength = 10f, legSpeed = 0.1f, legTrns = 1f, legBaseOffset = 0f, legMoveSpace = 1f, legExtension = 0, legPairOffset = 0, legLengthScl = 1f, kinematicScl = 1f, maxStretch = 1.75f; public float legSplashDamage = 0f, legSplashRange = 5; - public boolean flipBackLegs = true; + public float legStraightLength = 1f; + /** If true, legs are locked to the base of the unit instead of being on an implicit rotating "mount". */ + public boolean lockLegBase = false; + public float baseLegStraightness, legStraightness; + /** TODO neither of these appear to do much */ + public boolean flipBackLegs = true, flipLegSide = false; public float mechSideSway = 0.54f, mechFrontSway = 0.1f; public float mechStride = -1f; @@ -1028,23 +1033,25 @@ public class UnitType extends UnlockableContent{ float rotation = unit.baseRotation(); float invDrown = 1f - unit.drownTime; - for(Leg leg : legs){ - Drawf.shadow(leg.base.x, leg.base.y, ssize, invDrown); + if(footRegion.found()){ + for(Leg leg : legs){ + Drawf.shadow(leg.base.x, leg.base.y, ssize, invDrown); + } } //legs are drawn front first for(int j = legs.length - 1; j >= 0; j--){ int i = (j % 2 == 0 ? j/2 : legs.length - 1 - j/2); Leg leg = legs[i]; - float angle = unit.legAngle(rotation, i); + float angle = unit.legAngle(i); boolean flip = i >= legs.length/2f; int flips = Mathf.sign(flip); - Vec2 position = legOffset.trns(angle, legBaseOffset).add(unit); + Vec2 position = unit.legOffset(legOffset, i).add(unit); Tmp.v1.set(leg.base).sub(leg.joint).inv().setLength(legExtension); - if(leg.moving && visualElevation > 0){ + if(footRegion.found() && leg.moving && visualElevation > 0){ float scl = visualElevation * invDrown; float elev = Mathf.slope(1f - leg.stage) * scl; Draw.color(Pal.shadow); @@ -1054,7 +1061,9 @@ public class UnitType extends UnlockableContent{ Draw.mixcol(Tmp.c3, Tmp.c3.a); - Draw.rect(footRegion, leg.base.x, leg.base.y, position.angleTo(leg.base)); + if(footRegion.found()){ + Draw.rect(footRegion, leg.base.x, leg.base.y, position.angleTo(leg.base)); + } Lines.stroke(legRegion.height * Draw.scl * flips); Lines.line(legRegion, position.x, position.y, leg.joint.x, leg.joint.y, false);