diff --git a/core/assets-raw/sprites/units/precept-cell.png b/core/assets-raw/sprites/units/precept-cell.png new file mode 100644 index 0000000000..8f4a9ecdaf Binary files /dev/null and b/core/assets-raw/sprites/units/precept-cell.png differ diff --git a/core/assets-raw/sprites/units/precept-treads.png b/core/assets-raw/sprites/units/precept-treads.png new file mode 100644 index 0000000000..913546e376 Binary files /dev/null and b/core/assets-raw/sprites/units/precept-treads.png differ diff --git a/core/assets-raw/sprites/units/precept-weapon-cell.png b/core/assets-raw/sprites/units/precept-weapon-cell.png new file mode 100644 index 0000000000..e3cad4156d Binary files /dev/null and b/core/assets-raw/sprites/units/precept-weapon-cell.png differ diff --git a/core/assets-raw/sprites/units/precept-weapon.png b/core/assets-raw/sprites/units/precept-weapon.png new file mode 100644 index 0000000000..a90cf9ad73 Binary files /dev/null and b/core/assets-raw/sprites/units/precept-weapon.png differ diff --git a/core/assets-raw/sprites/units/precept.png b/core/assets-raw/sprites/units/precept.png new file mode 100644 index 0000000000..683a19acee Binary files /dev/null and b/core/assets-raw/sprites/units/precept.png differ diff --git a/core/assets/icons/icons.properties b/core/assets/icons/icons.properties index 60451df04d..0cdaf71573 100755 --- a/core/assets/icons/icons.properties +++ b/core/assets/icons/icons.properties @@ -557,3 +557,4 @@ 63135=unit-repair-tower|block-unit-repair-tower-ui 63134=merui|unit-merui-ui 63133=osc|unit-osc-ui +63132=precept|unit-precept-ui diff --git a/core/assets/logicids.dat b/core/assets/logicids.dat index c18ca7932c..d2ecc3dbe5 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 c9accc663e..35fb04c44c 100644 --- a/core/src/mindustry/content/UnitTypes.java +++ b/core/src/mindustry/content/UnitTypes.java @@ -80,7 +80,7 @@ public class UnitTypes{ public static @EntityDef({Unitc.class, BuildingTetherc.class, Payloadc.class}) UnitType manifold, assemblyDrone, effectDrone; //tank - public static @EntityDef({Unitc.class, Tankc.class}) UnitType stell, locus, vanquish, conquer; + public static @EntityDef({Unitc.class, Tankc.class}) UnitType stell, locus, precept, vanquish, conquer; //endregion @@ -2585,6 +2585,52 @@ public class UnitTypes{ }}); }}; + precept = new TankUnitType("precept"){{ + hitSize = 26f; + treadPullOffset = 5; + speed = 0.64f; + rotateSpeed = 2f; + health = 2100; + armor = 8f; + itemCapacity = 0; + treadRects = new Rect[]{new Rect(16, 38, 30, 75), new Rect(44, 7, 17, 60)}; + researchCostMultiplier = 0f; + + weapons.add(new Weapon("precept-weapon"){{ + layerOffset = 0.0001f; + reload = 30f; + shootY = 18f; + recoil = 1f; + rotate = true; + rotateSpeed = 1.3f; + mirror = false; + shootCone = 2f; + x = 0f; + y = -1f; + heatColor = Color.valueOf("f9350f"); + cooldownTime = 30f; + bullet = new BasicBulletType(8f, 130){{ + sprite = "missile-large"; + width = 9.5f; + height = 15f; + lifetime = 30f; + hitSize = 6f; + shootEffect = Fx.shootTitan; + smokeEffect = Fx.shootSmokeTitan; + pierceCap = 2; + pierce = true; + pierceBuilding = true; + hitColor = backColor = trailColor = Color.valueOf("feb380"); + frontColor = Color.white; + trailWidth = 3.1f; + trailLength = 8; + hitEffect = despawnEffect = Fx.blastExplosion; + splashDamageRadius = 20f; + splashDamage = 50f; + }}; + }}); + }}; + vanquish = new TankUnitType("vanquish"){{ hitSize = 28f; treadPullOffset = 4; diff --git a/core/src/mindustry/graphics/BlockRenderer.java b/core/src/mindustry/graphics/BlockRenderer.java index 170b80b0ab..6c6d0d871b 100644 --- a/core/src/mindustry/graphics/BlockRenderer.java +++ b/core/src/mindustry/graphics/BlockRenderer.java @@ -332,7 +332,7 @@ public class BlockRenderer{ procLinks.clear(); procLights.clear(); - var bounds = camera.bounds(Tmp.r3).grow(tilesize); + var bounds = camera.bounds(Tmp.r3).grow(tilesize * 2f); //draw floor lights floorTree.intersect(bounds, tile -> lightview.add(tile)); diff --git a/core/src/mindustry/type/UnitType.java b/core/src/mindustry/type/UnitType.java index b89af108dd..4650430b7a 100644 --- a/core/src/mindustry/type/UnitType.java +++ b/core/src/mindustry/type/UnitType.java @@ -362,17 +362,26 @@ public class UnitType extends UnlockableContent{ /** how much of a top part of a tread sprite is "cut off" relative to the pattern; this is corrected for */ public int treadPullOffset = 0; - //SEGMENTED / CRAWL UNITS + //SEGMENTED / CRAWL UNITS (this is WIP content!) - //for crawlers + /** number of independent segments */ public int segments = 0; - public float segmentSpacing = 2f, segmentScl = 4f, segmentPhase = 5f, segmentRotSpeed = 1f, segmentMaxRot = 30f; + /** magnitude of sine offset between segments */ + public float segmentMag = 2f, + /** scale of sine offset between segments */ + segmentScl = 4f, + /** index multiplier of sine offset between segments */ + segmentPhase = 5f, + /** how fast each segment moves towards the next one */ + segmentRotSpeed = 1f, + /** maximum difference between segment angles */ + segmentMaxRot = 30f, /** speed multiplier this unit will have when crawlSlowdownFrac is met. */ - public float crawlSlowdown = 0.5f; + crawlSlowdown = 0.5f, /** damage dealt to blocks under this tank/crawler every frame. */ - public float crushDamage = 0f; + crushDamage = 0f, /** the fraction of solids under this block necessary for it to reach crawlSlowdown. */ - public float crawlSlowdownFrac = 0.55f; + crawlSlowdownFrac = 0.55f; //MISSILE UNITS @@ -1377,6 +1386,7 @@ public class UnitType extends UnlockableContent{ Draw.reset(); } + //TODO public void drawCrawl(Crawlc crawl){ Unit unit = (Unit)crawl; applyColor(unit); @@ -1386,20 +1396,18 @@ public class UnitType extends UnlockableContent{ TextureRegion[] regions = p == 0 ? segmentOutlineRegions : segmentRegions; for(int i = 0; i < segments; i++){ - float trns = Mathf.sin(crawl.crawlTime() + i * segmentPhase, segmentScl, segmentSpacing); + float trns = Mathf.sin(crawl.crawlTime() + i * segmentPhase, segmentScl, segmentMag); //at segment 0, rotation = segmentRot, but at the last segment it is rotation float rot = Mathf.slerp(crawl.segmentRot(), unit.rotation, i / (float)(segments - 1)); float tx = Angles.trnsx(rot, trns), ty = Angles.trnsy(rot, trns); - //shadow Draw.color(0f, 0f, 0f, 0.2f); //Draw.rect(regions[i], unit.x + tx + 2f, unit.y + ty - 2f, rot - 90); applyColor(unit); - //TODO merge outlines? Draw.rect(regions[i], unit.x + tx, unit.y + ty, rot - 90); } diff --git a/gradle.properties b/gradle.properties index 675f91763b..7b642a60b2 100644 --- a/gradle.properties +++ b/gradle.properties @@ -25,4 +25,4 @@ org.gradle.caching=true #used for slow jitpack builds; TODO see if this actually works org.gradle.internal.http.socketTimeout=100000 org.gradle.internal.http.connectionTimeout=100000 -archash=7f36a32bec +archash=9ae34c37ed