diff --git a/core/assets-raw/sprites/units/weapons/krepost-weapon-blade-heat.png b/core/assets-raw/sprites/units/weapons/krepost-weapon-blade-heat.png new file mode 100644 index 0000000000..6e0ef1fcb2 Binary files /dev/null and b/core/assets-raw/sprites/units/weapons/krepost-weapon-blade-heat.png differ diff --git a/core/assets-raw/sprites/units/weapons/krepost-weapon-blade.png b/core/assets-raw/sprites/units/weapons/krepost-weapon-blade.png new file mode 100644 index 0000000000..8b7303d2a5 Binary files /dev/null and b/core/assets-raw/sprites/units/weapons/krepost-weapon-blade.png differ diff --git a/core/assets/maps/three.msav b/core/assets/maps/three.msav index 404001dd8e..54b7731cc7 100644 Binary files a/core/assets/maps/three.msav and b/core/assets/maps/three.msav differ diff --git a/core/src/mindustry/content/SectorPresets.java b/core/src/mindustry/content/SectorPresets.java index c94c3e6e0e..fc63290739 100644 --- a/core/src/mindustry/content/SectorPresets.java +++ b/core/src/mindustry/content/SectorPresets.java @@ -123,7 +123,7 @@ public class SectorPresets{ difficulty = 3; }}; - three = new SectorPreset("three", erekir, 32){{ + three = new SectorPreset("three", erekir, 36){{ captureWave = 8; difficulty = 5; }}; diff --git a/core/src/mindustry/content/UnitTypes.java b/core/src/mindustry/content/UnitTypes.java index 303ec92800..13f0a43992 100644 --- a/core/src/mindustry/content/UnitTypes.java +++ b/core/src/mindustry/content/UnitTypes.java @@ -2821,6 +2821,7 @@ public class UnitTypes{ reload = 30f; shake = 3f; cooldownTime = 20f; + layerOffset = 0.02f; shots = 3; shotDelay = 3f; @@ -2828,6 +2829,22 @@ public class UnitTypes{ velocityRnd = 0.1f; heatColor = Color.red; + for(int i = 0; i < 3; i++){ + int fi = i; + parts.add(new RegionPart("-blade"){{ + under = true; + layerOffset = -0.001f; + heatColor = Pal.techBlue; + heatProgress = PartProgress.heat.add(0.2f).min(PartProgress.warmup); + progress = PartProgress.warmup.blend(PartProgress.reload, 0.2f); + x = 11 / 4f; + y = 10f / 4f; + moveY = 1f - fi * 3f; + moveX = fi * 0.5f; + rotMove = -30f - fi * 15f; + }}); + } + bullet = new BasicBulletType(9f, 75){{ pierceCap = 2; pierceBuilding = true; @@ -3052,7 +3069,7 @@ public class UnitTypes{ mirror = false; reload = 1f; shootOnDeath = true; - bullet = new ExplosionBulletType(135f, 25f){{ + bullet = new ExplosionBulletType(145f, 25f){{ suppressionRange = 140f; shootEffect = new ExplosionEffect(){{ lifetime = 50f; diff --git a/core/src/mindustry/entities/part/DrawPart.java b/core/src/mindustry/entities/part/DrawPart.java index 06b6c168fc..4b37fef1f6 100644 --- a/core/src/mindustry/entities/part/DrawPart.java +++ b/core/src/mindustry/entities/part/DrawPart.java @@ -21,7 +21,7 @@ public abstract class DrawPart{ //TODO document public float warmup, reload, smoothReload, heat, life; public float x, y, rotation; - public int sideOverride = -1; + public int sideOverride = -1, sideMultiplier = 1; public PartParams set(float warmup, float reload, float smoothReload, float heat, float x, float y, float rotation){ this.warmup = warmup; @@ -33,6 +33,7 @@ public abstract class DrawPart{ this.rotation = rotation; this.sideOverride = -1; this.life = 0f; + this.sideMultiplier = 1; return this; } } diff --git a/core/src/mindustry/entities/part/RegionPart.java b/core/src/mindustry/entities/part/RegionPart.java index a1728ed75b..70472994fd 100644 --- a/core/src/mindustry/entities/part/RegionPart.java +++ b/core/src/mindustry/entities/part/RegionPart.java @@ -70,7 +70,7 @@ public class RegionPart extends DrawPart{ //can be null var region = drawRegion ? regions[Math.min(i, regions.length - 1)] : null; - float sign = i == 1 ? -1 : 1; + float sign = (i == 0 ? 1 : -1) * params.sideMultiplier; Tmp.v1.set((x + moveX * prog) * sign, y + moveY * prog).rotate(params.rotation - 90); float @@ -78,7 +78,7 @@ public class RegionPart extends DrawPart{ ry = params.y + Tmp.v1.y, rot = rotMove * prog * sign + params.rotation - 90; - Draw.xscl = i == 0 ? 1 : -1; + Draw.xscl = sign; if(outline && drawRegion){ Draw.z(prevZ + outlineLayerOffset); @@ -112,10 +112,12 @@ public class RegionPart extends DrawPart{ if(children.size > 0){ for(int s = 0; s < len; s++){ int i = (params.sideOverride == -1 ? s : params.sideOverride); - float sign = i == 1 ? -1 : 1; + float sign = (i == 1 ? -1 : 1) * params.sideMultiplier; Tmp.v1.set((x + moveX * prog) * sign, y + moveY * prog).rotate(params.rotation - 90); childParam.set(params.warmup, params.reload, params.smoothReload, params.heat, params.x + Tmp.v1.x, params.y + Tmp.v1.y, i * sign + rotMove * prog * sign + params.rotation); + childParam.sideMultiplier = params.sideMultiplier; + childParam.life = params.life; childParam.sideOverride = i; for(var child : children){ child.draw(childParam); diff --git a/core/src/mindustry/entities/part/ShapePart.java b/core/src/mindustry/entities/part/ShapePart.java index 80407f66d7..804732e5ca 100644 --- a/core/src/mindustry/entities/part/ShapePart.java +++ b/core/src/mindustry/entities/part/ShapePart.java @@ -32,7 +32,7 @@ public class ShapePart extends DrawPart{ //use specific side if necessary int i = params.sideOverride == -1 ? s : params.sideOverride; - float sign = i == 1 ? -1 : 1; + float sign = (i == 0 ? 1 : -1) * params.sideMultiplier; Tmp.v1.set((x + moveX * prog) * sign, y + moveY * prog).rotate(params.rotation - 90); float diff --git a/core/src/mindustry/type/Weapon.java b/core/src/mindustry/type/Weapon.java index c1e5d9e8d2..3901c59a3a 100644 --- a/core/src/mindustry/type/Weapon.java +++ b/core/src/mindustry/type/Weapon.java @@ -193,10 +193,9 @@ public class Weapon implements Cloneable{ drawOutline(unit, mount); } - Draw.xscl = -Mathf.sign(flipSprite); - if(parts.size > 0){ DrawPart.params.set(mount.warmup, mount.reload / reload, mount.smoothReload, mount.heat, wx, wy, weaponRotation + 90); + DrawPart.params.sideMultiplier = flipSprite ? -1 : 1; for(int i = 0; i < parts.size; i++){ var part = parts.items[i]; @@ -206,6 +205,8 @@ public class Weapon implements Cloneable{ } } + Draw.xscl = -Mathf.sign(flipSprite); + Draw.rect(region, wx, wy, weaponRotation); if(heatRegion.found() && mount.heat > 0){