diff --git a/core/assets-raw/sprites/blocks/units/mech-assembler-side1.png b/core/assets-raw/sprites/blocks/units/mech-assembler-side1.png index 07a26a1318..bfa591c50a 100644 Binary files a/core/assets-raw/sprites/blocks/units/mech-assembler-side1.png and b/core/assets-raw/sprites/blocks/units/mech-assembler-side1.png differ diff --git a/core/assets-raw/sprites/blocks/units/mech-assembler-side2.png b/core/assets-raw/sprites/blocks/units/mech-assembler-side2.png index c7677e0b77..9cd4cdeaa0 100644 Binary files a/core/assets-raw/sprites/blocks/units/mech-assembler-side2.png and b/core/assets-raw/sprites/blocks/units/mech-assembler-side2.png differ diff --git a/core/assets-raw/sprites/blocks/units/mech-assembler-top.png b/core/assets-raw/sprites/blocks/units/mech-assembler-top.png index 18b76fc062..40f43fdd24 100644 Binary files a/core/assets-raw/sprites/blocks/units/mech-assembler-top.png and b/core/assets-raw/sprites/blocks/units/mech-assembler-top.png differ diff --git a/core/assets-raw/sprites/units/bulwark-cell.png b/core/assets-raw/sprites/units/bulwark-cell.png new file mode 100644 index 0000000000..0fea687a7e Binary files /dev/null and b/core/assets-raw/sprites/units/bulwark-cell.png differ diff --git a/core/assets-raw/sprites/units/bulwark-foot.png b/core/assets-raw/sprites/units/bulwark-foot.png new file mode 100644 index 0000000000..f035f791d4 Binary files /dev/null and b/core/assets-raw/sprites/units/bulwark-foot.png differ diff --git a/core/assets-raw/sprites/units/bulwark-leg-base.png b/core/assets-raw/sprites/units/bulwark-leg-base.png new file mode 100644 index 0000000000..6091d58469 Binary files /dev/null and b/core/assets-raw/sprites/units/bulwark-leg-base.png differ diff --git a/core/assets-raw/sprites/units/bulwark-leg.png b/core/assets-raw/sprites/units/bulwark-leg.png new file mode 100644 index 0000000000..fc8fba6a7f Binary files /dev/null and b/core/assets-raw/sprites/units/bulwark-leg.png differ diff --git a/core/assets-raw/sprites/units/bulwark.png b/core/assets-raw/sprites/units/bulwark.png new file mode 100644 index 0000000000..828e169320 Binary files /dev/null and b/core/assets-raw/sprites/units/bulwark.png differ diff --git a/core/assets-raw/sprites/units/weapons/bulwark-weapon-heat.png b/core/assets-raw/sprites/units/weapons/bulwark-weapon-heat.png new file mode 100644 index 0000000000..11826e1305 Binary files /dev/null and b/core/assets-raw/sprites/units/weapons/bulwark-weapon-heat.png differ diff --git a/core/assets-raw/sprites/units/weapons/bulwark-weapon.png b/core/assets-raw/sprites/units/weapons/bulwark-weapon.png new file mode 100644 index 0000000000..85ab504421 Binary files /dev/null and b/core/assets-raw/sprites/units/weapons/bulwark-weapon.png differ diff --git a/core/assets-raw/sprites/units/weapons/vanquish-weapon-heat.png b/core/assets-raw/sprites/units/weapons/vanquish-weapon-heat.png new file mode 100644 index 0000000000..7dc109fcec Binary files /dev/null and b/core/assets-raw/sprites/units/weapons/vanquish-weapon-heat.png differ diff --git a/core/assets-raw/sprites/units/weapons/vanquish-weapon.png b/core/assets-raw/sprites/units/weapons/vanquish-weapon.png index 9f3ed5bfee..d58bf6e54f 100644 Binary files a/core/assets-raw/sprites/units/weapons/vanquish-weapon.png and b/core/assets-raw/sprites/units/weapons/vanquish-weapon.png differ diff --git a/core/assets/icons/icons.properties b/core/assets/icons/icons.properties index b849148108..dfcc029d5b 100755 --- a/core/assets/icons/icons.properties +++ b/core/assets/icons/icons.properties @@ -494,3 +494,4 @@ 63210=eruption-drill|block-eruption-drill-ui 63209=ship-assembler|block-ship-assembler-ui 63208=quell-missile|unit-quell-missile-ui +63207=bulwark|unit-bulwark-ui diff --git a/core/assets/logicids.dat b/core/assets/logicids.dat index 825c410021..f23087c238 100644 Binary files a/core/assets/logicids.dat and b/core/assets/logicids.dat differ diff --git a/core/src/mindustry/content/UnitTypes.java b/core/src/mindustry/content/UnitTypes.java index 3a6077588f..cece9e8a2d 100644 --- a/core/src/mindustry/content/UnitTypes.java +++ b/core/src/mindustry/content/UnitTypes.java @@ -34,7 +34,7 @@ public class UnitTypes{ public static @EntityDef(value = {Unitc.class, Mechc.class}, legacy = true) UnitType nova, pulsar, quasar; //legs - public static @EntityDef({Unitc.class, Legsc.class}) UnitType corvus, atrax; + public static @EntityDef({Unitc.class, Legsc.class}) UnitType corvus, atrax, bulwark; //legs, legacy public static @EntityDef(value = {Unitc.class, Legsc.class}, legacy = true) UnitType spiroct, arkyid, toxopid; @@ -2440,7 +2440,7 @@ public class UnitTypes{ layerOffset = 0.0001f; reload = 120f; shootY = 71f / 4f; - shake = 4f; + shake = 5f; recoil = 4f; rotate = true; rotateSpeed = 1f; @@ -2448,12 +2448,14 @@ public class UnitTypes{ x = 0f; y = 0; shadow = 28f; + heatColor = Color.valueOf("f9350f"); + cooldownTime = 80f; - bullet = new BasicBulletType(7f, 90){{ + bullet = new BasicBulletType(8f, 100){{ sprite = "missile-large"; - width = 9f; + width = 9.5f; height = 15f; - lifetime = 33f; + lifetime = 32f; hitSize = 6f; shootEffect = Fx.shootTitan; smokeEffect = Fx.shootSmokeTitan; @@ -2462,7 +2464,7 @@ public class UnitTypes{ pierceBuilding = true; hitColor = backColor = trailColor = Color.valueOf("feb380"); frontColor = Color.white; - trailWidth = 3f; + trailWidth = 3.1f; trailLength = 8; hitEffect = despawnEffect = Fx.blastExplosion; }}; @@ -2498,7 +2500,93 @@ public class UnitTypes{ //endregion //region erekir - mech - //TODO + bulwark = new UnitType("bulwark"){{ + drag = 0.1f; + speed = 0.62f; + hitSize = 23f; + health = 8000; + armor = 6f; + outlineColor = Pal.darkOutline; + envDisabled = Env.space; + + //TODO shield ability + + rotateSpeed = 2.7f; + + legCount = 4; + legLength = 15f; + legTrns = 0.45f; + legMoveSpace = 1.4f; + rippleScale = 2f; + landShake = 0.5f; + legExtension = -5f; + legBaseOffset = 5f; + + ammoType = new PowerAmmoType(2000); + + legSplashDamage = 32; + legSplashRange = 30; + drownTimeMultiplier = 2f; + + hovering = true; + visualElevation = 0.65f; + groundLayer = Layer.legUnit; + + weapons.add(new Weapon("bulwark-weapon"){{ + mirror = true; + top = false; + + x = 62/4f; + y = 1f; + shootY = 47 / 4f; + recoil = 3f; + reload = 40f; + shake = 3f; + cooldownTime = 40f; + + shots = 3; + inaccuracy = 3f; + velocityRnd = 0.33f; + heatColor = Color.red; + + bullet = new MissileBulletType(4.2f, 30){{ + homingPower = 0.2f; + weaveMag = 4; + weaveScale = 4; + lifetime = 60f; + //TODO better + shootEffect = Fx.shootBig2; + smokeEffect = Fx.shootSmokeTitan; + splashDamage = 50f; + splashDamageRadius = 30f; + frontColor = Color.white; + hitSound = Sounds.none; + width = height = 10f; + + lightColor = trailColor = backColor = Color.valueOf("8ca9e8"); + lightRadius = 40f; + lightOpacity = 0.7f; + + trailWidth = 2.8f; + trailLength = 20; + trailChance = -1f; + + despawnEffect = Fx.none; + hitEffect = new ExplosionEffect(){{ + lifetime = 20f; + waveStroke = 2f; + waveColor = sparkColor = trailColor; + waveRad = 12f; + smokeSize = 0f; + smokeSizeBase = 0f; + sparks = 10; + sparkRad = 35f; + sparkLen = 4f; + sparkStroke = 1.5f; + }}; + }}; + }}); + }}; //endregion //region erekir - flying diff --git a/core/src/mindustry/type/Weapon.java b/core/src/mindustry/type/Weapon.java index 71f1a94d02..83c3a002e6 100644 --- a/core/src/mindustry/type/Weapon.java +++ b/core/src/mindustry/type/Weapon.java @@ -151,6 +151,8 @@ public class Weapon implements Cloneable{ //TODO copy-pasted code public void drawOutline(Unit unit, WeaponMount mount){ + if(!outlineRegion.found()) return; + //apply layer offset, roll it back at the end float z = Draw.z(); Draw.z(z + layerOffset); @@ -173,6 +175,8 @@ public class Weapon implements Cloneable{ } public void draw(Unit unit, WeaponMount mount){ + if(!region.found()) return; + //apply layer offset, roll it back at the end float z = Draw.z(); Draw.z(z + layerOffset); @@ -434,7 +438,7 @@ public class Weapon implements Cloneable{ } public void load(){ - region = Core.atlas.find(name, Core.atlas.find("clear")); + region = Core.atlas.find(name); heatRegion = Core.atlas.find(name + "-heat"); outlineRegion = Core.atlas.find(name + "-outline"); } diff --git a/core/src/mindustry/world/blocks/defense/turrets/Turret.java b/core/src/mindustry/world/blocks/defense/turrets/Turret.java index 1cfa970481..68058178cc 100644 --- a/core/src/mindustry/world/blocks/defense/turrets/Turret.java +++ b/core/src/mindustry/world/blocks/defense/turrets/Turret.java @@ -463,8 +463,9 @@ public class Turret extends ReloadTurret{ return ammo.peek().type(); } - /** @return whether the turret has ammo. */ + /** @return whether the turret has ammo. */ public boolean hasAmmo(){ + //used for "side-ammo" like gas in some turrets if(!cons.canConsume()) return false; //skip first entry if it has less than the required amount of ammo diff --git a/tools/src/mindustry/tools/Generators.java b/tools/src/mindustry/tools/Generators.java index 1523fc0173..0d555560e9 100644 --- a/tools/src/mindustry/tools/Generators.java +++ b/tools/src/mindustry/tools/Generators.java @@ -503,9 +503,19 @@ public class Generators{ } }; - for(Weapon weapon : type.weapons){ + Seq weapons = type.weapons; + weapons.each(Weapon::load); + weapons.removeAll(w -> !w.region.found()); + + for(Weapon weapon : weapons){ if(outlined.add(weapon.name) && has(weapon.name)){ - save(outline.get(get(weapon.name)), weapon.name + "-outline"); + //only non-top weapons need separate outline sprites (this is mostly just mechs) + if(!weapon.top){ + save(outline.get(get(weapon.name)), weapon.name + "-outline"); + }else{ + //replace weapon with outlined version, no use keeping standard around + outliner.get(weapon.region); + } } } @@ -575,9 +585,7 @@ public class Generators{ //TODO draw under for layerOffset < 0 //draw weapon outlines on base - for(Weapon weapon : type.weapons){ - weapon.load(); - + for(Weapon weapon : weapons){ image.draw(weapon.flipSprite ? outline.get(get(weapon.region)).flipX() : outline.get(get(weapon.region)), (int)(weapon.x / Draw.scl + image.width / 2f - weapon.region.width / 2f), (int)(-weapon.y / Draw.scl + image.height / 2f - weapon.region.height / 2f), @@ -598,9 +606,7 @@ public class Generators{ image.draw(cell, image.width / 2 - cell.width / 2, image.height / 2 - cell.height / 2, true); } - for(Weapon weapon : type.weapons){ - weapon.load(); - + for(Weapon weapon : weapons){ Pixmap wepReg = weapon.top ? outline.get(get(weapon.region)) : get(weapon.region); if(weapon.flipSprite){ wepReg = wepReg.flipX();