diff --git a/annotations/src/main/resources/classids.properties b/annotations/src/main/resources/classids.properties index 110096dd1d..0c04c4de0b 100644 --- a/annotations/src/main/resources/classids.properties +++ b/annotations/src/main/resources/classids.properties @@ -39,6 +39,7 @@ poly=18 pulsar=19 quad=23 quasar=32 +renale=47 risso=20 spiroct=21 stell=43 diff --git a/core/assets-raw/sprites/units/neoplasm/renale-segment0.png b/core/assets-raw/sprites/units/neoplasm/renale-segment0.png new file mode 100644 index 0000000000..9823064418 Binary files /dev/null and b/core/assets-raw/sprites/units/neoplasm/renale-segment0.png differ diff --git a/core/assets-raw/sprites/units/neoplasm/renale-segment1.png b/core/assets-raw/sprites/units/neoplasm/renale-segment1.png new file mode 100644 index 0000000000..36729c3e93 Binary files /dev/null and b/core/assets-raw/sprites/units/neoplasm/renale-segment1.png differ diff --git a/core/assets-raw/sprites/units/neoplasm/renale-segment2.png b/core/assets-raw/sprites/units/neoplasm/renale-segment2.png new file mode 100644 index 0000000000..067b851519 Binary files /dev/null and b/core/assets-raw/sprites/units/neoplasm/renale-segment2.png differ diff --git a/core/assets/icons/icons.properties b/core/assets/icons/icons.properties index cccf27c0d5..745fad30aa 100755 --- a/core/assets/icons/icons.properties +++ b/core/assets/icons/icons.properties @@ -567,3 +567,4 @@ 63117=afflict|block-afflict-ui 63116=shielded-wall|block-shielded-wall-ui 63115=fracture|block-fracture-ui +63114=renale|unit-renale-ui diff --git a/core/src/mindustry/ai/types/RepairAI.java b/core/src/mindustry/ai/types/RepairAI.java index 4879f673c8..14905a9ad7 100644 --- a/core/src/mindustry/ai/types/RepairAI.java +++ b/core/src/mindustry/ai/types/RepairAI.java @@ -11,6 +11,7 @@ public class RepairAI extends AIController{ @Nullable Teamc avoid; float retreatTimer; + Building damagedTarget; @Override public void updateMovement(){ @@ -57,14 +58,15 @@ public class RepairAI extends AIController{ @Override public void updateTargeting(){ - Building target = Units.findDamagedTile(unit.team, unit.x, unit.y); + if(timer.get(timerTarget, 15)){ + damagedTarget = Units.findDamagedTile(unit.team, unit.x, unit.y); + if(damagedTarget instanceof ConstructBuild) damagedTarget = null; + } - if(target instanceof ConstructBuild) target = null; - - if(target == null){ + if(damagedTarget == null){ super.updateTargeting(); }else{ - this.target = target; + this.target = damagedTarget; } } } diff --git a/core/src/mindustry/content/Blocks.java b/core/src/mindustry/content/Blocks.java index cd9c8a97cd..14983498af 100644 --- a/core/src/mindustry/content/Blocks.java +++ b/core/src/mindustry/content/Blocks.java @@ -4190,7 +4190,7 @@ public class Blocks{ recoil = 3f; range = 340; shootCone = 20f; - scaledHealth = 180; + scaledHealth = 220; rotateSpeed = 1.5f; researchCostMultiplier = 0.05f; @@ -4198,7 +4198,7 @@ public class Blocks{ }}; fracture = new ItemTurret("fracture"){{ - //requirements(Category.turret, with(Items.beryllium, 150, Items.silicon, 200, Items.graphite, 200, Items.carbide, 50)); + requirements(Category.turret, with(Items.beryllium, 150, Items.silicon, 200, Items.graphite, 200, Items.carbide, 50)); ammo( Items.tungsten, new BasicBulletType(8f, 41){{ @@ -4215,19 +4215,28 @@ public class Blocks{ trailLength = 3; hitEffect = despawnEffect = Fx.hitSquaresColor; buildingDamageMultiplier = 0.2f; + + if(false) + spawnBullets.add(new BulletType(){{ + instantDisappear = true; + lightning = 6; + lightningLength = 10; + lightningLengthRand = 10; + lightningColor = Color.valueOf("ff6214"); + lightningCone = 20f; + damage = 30; + despawnEffect = hitEffect = Fx.none; + }}); }} ); - shoot = new ShootSpread(15, 2f); - coolantMultiplier = 6f; - - inaccuracy = 0.2f; - velocityRnd = 0.17f; shake = 1f; - ammoPerShot = 3; - maxAmmo = 30; - consumeAmmoOnce = true; + + //shoot = new ShootAlternate(){{ + // shots = 3; + // barrels = 3; + //}}; drawer = new DrawTurret("reinforced-"){{ parts.add(new RegionPart("-blade"){{ @@ -4237,7 +4246,6 @@ public class Blocks{ mirror = true; under = true; moveX = 2f; - //moveY = -1f; moveRot = -7f; moves.add(new PartMove(PartProgress.recoil, 0f, -2f, 3f)); }}, @@ -4254,20 +4262,18 @@ public class Blocks{ heatColor = Color.valueOf("ff6214"); moveY = -8f; progress = PartProgress.recoil; - //drawRegion = false; mirror = false; under = true; }}); }}; - shootY = 5f; + shootY = 11f; outlineColor = Pal.darkOutline; size = 4; envEnabled |= Env.space; reload = 30f; recoil = 2f; range = 125; - shootCone = 40f; scaledHealth = 210; rotateSpeed = 3f; diff --git a/core/src/mindustry/content/UnitTypes.java b/core/src/mindustry/content/UnitTypes.java index 899926fe9a..8a07e98f4c 100644 --- a/core/src/mindustry/content/UnitTypes.java +++ b/core/src/mindustry/content/UnitTypes.java @@ -89,7 +89,7 @@ public class UnitTypes{ //region neoplasm - public static @EntityDef({Unitc.class, Crawlc.class}) UnitType latum; + public static @EntityDef({Unitc.class, Crawlc.class}) UnitType latum, renale; //endregion @@ -3906,6 +3906,27 @@ public class UnitTypes{ //endregion //region erekir - neoplasm + renale = new NeoplasmUnitType("renale"){{ + health = 500; + armor = 2; + hitSize = 9f; + omniMovement = false; + rotateSpeed = 2.5f; + drownTimeMultiplier = 2f; + drawCell = false; + segments = 3; + drawBody = false; + hidden = true; + crushDamage = 0.5f; + aiController = HugAI::new; + targetAir = false; + + segmentScl = 3f; + segmentPhase = 5f; + segmentMag = 0.5f; + speed = 1.2f; + }}; + latum = new NeoplasmUnitType("latum"){{ health = 20000; armor = 12; @@ -3924,6 +3945,8 @@ public class UnitTypes{ segmentScl = 4f; segmentPhase = 5f; speed = 1f; + + abilities.add(new SpawnDeathAbility(renale, 5, 11f)); }}; //endregion diff --git a/core/src/mindustry/core/NetServer.java b/core/src/mindustry/core/NetServer.java index a8fd7cc37a..6a83d5a82d 100644 --- a/core/src/mindustry/core/NetServer.java +++ b/core/src/mindustry/core/NetServer.java @@ -869,6 +869,7 @@ public class NetServer implements ApplicationListener{ } } + //TODO I don't like where this is, move somewhere else? /** Queues a building health update. This will be sent in a Call.buildHealthUpdate packet later. */ public void buildHealthUpdate(Building build){ buildHealthChanged.add(build.pos()); diff --git a/core/src/mindustry/entities/abilities/SpawnDeathAbility.java b/core/src/mindustry/entities/abilities/SpawnDeathAbility.java new file mode 100644 index 0000000000..2cf5f5ea47 --- /dev/null +++ b/core/src/mindustry/entities/abilities/SpawnDeathAbility.java @@ -0,0 +1,39 @@ +package mindustry.entities.abilities; + +import arc.math.*; +import arc.util.*; +import mindustry.*; +import mindustry.gen.*; +import mindustry.type.*; + +/** Spawns a certain amount of units upon death. */ +public class SpawnDeathAbility extends Ability{ + public UnitType type; + public int amount = 1, randAmount = 0; + /** Random spread of units away from the spawned. */ + public float spread = 8f; + /** If true, units spawned face outwards from the middle. */ + public boolean faceOutwards = true; + + public SpawnDeathAbility(UnitType type, int amount, float spread){ + this.type = type; + this.amount = amount; + this.spread = spread; + } + + public SpawnDeathAbility(){ + } + + @Override + public void death(Unit unit){ + if(!Vars.net.client()){ + int spawned = amount + Mathf.random(randAmount); + for(int i = 0; i < spawned; i++){ + Tmp.v1.rnd(Mathf.random(spread)); + var u = type.spawn(unit.team, unit.x + Tmp.v1.x, unit.y + Tmp.v1.y); + + u.rotation = faceOutwards ? Tmp.v1.angle() : unit.rotation + Mathf.range(5f); + } + } + } +} diff --git a/core/src/mindustry/entities/comp/CrawlComp.java b/core/src/mindustry/entities/comp/CrawlComp.java index 3ee98450c8..d1d8fcb7ce 100644 --- a/core/src/mindustry/entities/comp/CrawlComp.java +++ b/core/src/mindustry/entities/comp/CrawlComp.java @@ -26,7 +26,7 @@ abstract class CrawlComp implements Posc, Rotc, Hitboxc, Unitc{ transient Floor lastDeepFloor; transient float lastCrawlSlowdown = 1f; - transient float segmentRot, crawlTime; + transient float segmentRot, crawlTime = Mathf.random(100f); @Replace @Override diff --git a/core/src/mindustry/graphics/CacheLayer.java b/core/src/mindustry/graphics/CacheLayer.java index c68fd0db3d..ed9019cf64 100644 --- a/core/src/mindustry/graphics/CacheLayer.java +++ b/core/src/mindustry/graphics/CacheLayer.java @@ -3,6 +3,7 @@ package mindustry.graphics; import arc.*; import arc.graphics.*; import arc.graphics.gl.*; +import arc.math.*; import arc.util.*; import static mindustry.Vars.*; @@ -31,6 +32,19 @@ public class CacheLayer{ } } + /** Adds a cache layer at a certain position. All layers >= this index are shifted upwards.*/ + public static void add(int index, CacheLayer layer){ + index = Mathf.clamp(index, 0, all.length - 1); + + var prev = all; + all = new CacheLayer[all.length + 1]; + + System.arraycopy(prev, 0, all, 0, index); + System.arraycopy(prev, index, all, index + 1, prev.length - index); + + all[index] = layer; + } + /** Loads default cache layers. */ public static void init(){ add(