From a39f2bd3a925d6530b4d8b4870b3a08350fecb30 Mon Sep 17 00:00:00 2001 From: Anuken Date: Thu, 19 Aug 2021 09:36:53 -0400 Subject: [PATCH] wip --- .../src/main/resources/classids.properties | 1 + .../main/resources/revisions/scuttler/0.json | 1 + core/assets-raw/sprites/units/scuttler.png | Bin 0 -> 866 bytes core/assets/icons/icons.properties | 1 + core/assets/logicids.dat | Bin 2886 -> 2896 bytes core/src/mindustry/content/UnitTypes.java | 18 ++++++- .../mindustry/entities/comp/CrawlComp.java | 48 ++++++++++++++++++ core/src/mindustry/type/CellLiquid.java | 3 +- 8 files changed, 70 insertions(+), 2 deletions(-) create mode 100644 annotations/src/main/resources/revisions/scuttler/0.json create mode 100644 core/assets-raw/sprites/units/scuttler.png create mode 100644 core/src/mindustry/entities/comp/CrawlComp.java 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 0000000000000000000000000000000000000000..f281d6d03d62a3aca324ec5a5cdf1a041a2df235 GIT binary patch literal 866 zcmV-o1D*VdP)Px#6;Mo6MF0Q*n3|-py1@UYWzcI=Zg7AA0031UFOmQN00(qZPE-H?|NsC002)gJ zMgRZ;=t)FDRCt{2-Aj7vFc3uHFk$~ozJnxRZon0n)qg*f92Ci_OWEZ&VwTV68I@d;afHhnb z*#Opg9b!3H$#sy$U^Q1y)`A^gu~-WBc(r07*u~Y7bzrAgD3*b}UY%G4c6()F5!mll zi8bJaS0t8zGhU5Y0Zw@(VgWekRfy~0q*ov=gR|bcxC%~t%i2PSPt$M{tYnT8o1kc8(=B8TX!$OfXBhzw)+8AfxBUkvw*u%&(njuMXyqW zyFIVdg1a?GQi8iJ$I^kjB}Y?%yB){VfV&m%1Q;-2z<_5CFkrrE0X~uVh=tojz^4%( zlkiOItm2~%o=cxod|bh+mNSaqG4Ou)bmBJw{1Wd}SmyrFyLr_1MT*qwI6u9>+rX@Wof{X0OtZ632-jJkpSlc s9BDi7wawcF?hEkh0bV`8tG6BaAF@Ou)yiaC@&Et;07*qoM6N<$g1*d_s{jB1 literal 0 HcmV?d00001 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 d3592e0fede5848c070781018cbdd676fe6b2508..c789bd76ecca9f59bd9da7ec1fc6390b4f0e9770 100644 GIT binary patch delta 28 jcmX>mc0p`|87HIqW^+zCMoy06w$q9|1Xx1=s)p 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;