diff --git a/annotations/src/main/resources/classids.properties b/annotations/src/main/resources/classids.properties index 2dc5b73284..bcf980e67a 100644 --- a/annotations/src/main/resources/classids.properties +++ b/annotations/src/main/resources/classids.properties @@ -32,6 +32,7 @@ pulsar=19 quad=23 quasar=32 risso=20 +scuttler=35 spiroct=21 toxopid=33 vela=25 \ No newline at end of file diff --git a/annotations/src/main/resources/revisions/scuttler/0.json b/annotations/src/main/resources/revisions/scuttler/0.json new file mode 100644 index 0000000000..d6d95c813a --- /dev/null +++ b/annotations/src/main/resources/revisions/scuttler/0.json @@ -0,0 +1 @@ +{fields:[{name:ammo,type:float},{name:controller,type:mindustry.entities.units.UnitController},{name:crawlTime,type:float},{name:elevation,type:float},{name:flag,type:double},{name:health,type:float},{name:isShooting,type:boolean},{name:mineTile,type:mindustry.world.Tile},{name:mounts,type:"mindustry.entities.units.WeaponMount[]"},{name:plans,type:arc.struct.Queue},{name:rotation,type:float},{name:segmentRot,type:float},{name:shield,type:float},{name:spawnedByCore,type:boolean},{name:stack,type:mindustry.type.ItemStack},{name:statuses,type:arc.struct.Seq},{name:team,type:mindustry.game.Team},{name:type,type:mindustry.type.UnitType},{name:updateBuilding,type:boolean},{name:vel,type:arc.math.geom.Vec2},{name:x,type:float},{name:y,type:float}]} \ No newline at end of file diff --git a/core/assets-raw/sprites/units/scuttler.png b/core/assets-raw/sprites/units/scuttler.png new file mode 100644 index 0000000000..f281d6d03d Binary files /dev/null and b/core/assets-raw/sprites/units/scuttler.png differ diff --git a/core/assets/icons/icons.properties b/core/assets/icons/icons.properties index 9e72e38042..ce48474def 100755 --- a/core/assets/icons/icons.properties +++ b/core/assets/icons/icons.properties @@ -402,3 +402,4 @@ 63307=fissile-matter|item-fissile-matter-ui 63306=neoplasm|liquid-neoplasm-ui 63305=dormant-cyst|item-dormant-cyst-ui +63304=scuttler|unit-scuttler-ui diff --git a/core/assets/logicids.dat b/core/assets/logicids.dat index d3592e0fed..c789bd76ec 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 3966aca65c..3178f2d671 100644 --- a/core/src/mindustry/content/UnitTypes.java +++ b/core/src/mindustry/content/UnitTypes.java @@ -24,7 +24,7 @@ import static arc.math.Angles.*; import static mindustry.Vars.*; public class UnitTypes implements ContentList{ - //region definitions + //region standard //mech public static @EntityDef({Unitc.class, Mechc.class}) UnitType mace, dagger, crawler, fortress, scepter, reign, vela; @@ -67,6 +67,12 @@ public class UnitTypes implements ContentList{ //endregion + //region neoplasm + + public static @EntityDef({Unitc.class, Crawlc.class}) UnitType scuttler; + + //endregion + @Override public void load(){ //region ground attack @@ -2394,6 +2400,16 @@ public class UnitTypes implements ContentList{ } }; + //endregion + //region neoplasm + + scuttler = new UnitType("scuttler"){{ + hitSize = 30f; + omniMovement = false; + rotateSpeed = 1f; + drawCell = false; + }}; + //endregion } } diff --git a/core/src/mindustry/entities/comp/CrawlComp.java b/core/src/mindustry/entities/comp/CrawlComp.java new file mode 100644 index 0000000000..f14c0c7519 --- /dev/null +++ b/core/src/mindustry/entities/comp/CrawlComp.java @@ -0,0 +1,48 @@ +package mindustry.entities.comp; + +import arc.math.geom.*; +import mindustry.ai.*; +import mindustry.annotations.Annotations.*; +import mindustry.content.*; +import mindustry.entities.*; +import mindustry.entities.EntityCollisions.*; +import mindustry.gen.*; +import mindustry.type.*; +import mindustry.world.blocks.environment.*; + +//TODO +@Component +abstract class CrawlComp implements Posc, Rotc, Hitboxc, Unitc{ + @Import float x, y, speedMultiplier; + @Import UnitType type; + @Import Vec2 vel; + + //TODO segments + float segmentRot; + float crawlTime; + + @Replace + @Override + public SolidPred solidity(){ + return EntityCollisions::legsSolid; + } + + @Override + @Replace + public int pathType(){ + return Pathfinder.costLegs; + } + + @Override + @Replace + public float floorSpeedMultiplier(){ + Floor on = isFlying() ? Blocks.air.asFloor() : floorOn(); + //TODO take into account extra blocks + return on.speedMultiplier * speedMultiplier; + } + + @Override + public void update(){ + crawlTime += vel.len(); + } +} diff --git a/core/src/mindustry/type/CellLiquid.java b/core/src/mindustry/type/CellLiquid.java index 715b23bed5..72c5744670 100644 --- a/core/src/mindustry/type/CellLiquid.java +++ b/core/src/mindustry/type/CellLiquid.java @@ -11,6 +11,7 @@ import static mindustry.entities.Puddles.*; public class CellLiquid extends Liquid{ public Color colorFrom = Color.white.cpy(), colorTo = Color.white.cpy(); + public int cells = 8; public CellLiquid(String name, Color color){ super(name, color); @@ -33,7 +34,7 @@ public class CellLiquid extends Liquid{ float length = Math.max(f, 0.3f) * 9f; rand.setSeed(id); - for(int i = 0; i < 8; i++){ + for(int i = 0; i < cells; i++){ Tmp.v1.trns(rand.random(360f), rand.random(length)); float vx = x + Tmp.v1.x, vy = y + Tmp.v1.y;