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 zcmeAS@N?(olHy`uVBq!ia0y~yVE6#S9Lx+144mDP3m6y}7>k44ofy`glX=O&z#tmn z6XMFiz%XOhk`22K{9l%OAv-v)pn-vbAyiI(5(5JRdr6RA@P9C1kn(1BV_;x<;pyTS zQZeW4UGJ(_1_CY*4HEx*?`u|x&pUK_#p+e5FX!;C_|JLF%tQYA*Gh9JFF!ba_914MgWGTIv1G4X!aF=wsi$_Q^a??+S+OR!0NhNS%Ybe z@J)tmm9j~e5hqJ098E9{_rKO88@Dln>s!UvB*hy?uTCmWSRSr1t#NPM+z8gP>eM8` z8}CCqO&_#`t4wP!j_ZwJ^s7`&VzhW3+VT3ql5hpR=FRtZ?cnmOKK)3^;{DpL><4`L zfiXU9TaDQJ6%{;pa{ubEznfM! zovGZq{#3*6ssE=lluOsMNASH9`^RhWKx)VBa_I!k9nt0b2O5qayu0l;V_4(v#Qx0< zy93W(Zr<&>KB#%O?fT12yG`ALns)0Rztp%})jhazx9suD4ZB6(vq%^u9B4@AGf3E% z$!It6M@Q>z=L5?HP0q?pU17QMKor=1*I&b8n8IdS;y7ZJSfGrkoC2dn)Zo)%NIl7r7%O z6Am;mo@UnJ`S9w&UA}D$d+aI#a%4F-m>g&jXMSI{=vvzY#*LK`JiuFBowlTgdxcJC{^Cx#|Ha$>(^gy6tuI~fZoLuV<%!MT^2d*)!=i8@! z&X3`Sbi#pm46|QDE-iDvDYr4yx}lo8M}o{LiOIb1OFJ(nRECH%np2GNN0Yt z{wlYHz=Mp2zl?osH}01`$X+g9pmg9Q13S~4HOw`+Uzqw>EF>PdG&C2=e%pTcufczopr0KUwYs{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;