WIP actually insect-like unit
@@ -92,6 +92,17 @@ android{
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
buildTypes{
|
||||||
|
all{
|
||||||
|
minifyEnabled = true
|
||||||
|
shrinkResources = true
|
||||||
|
//this is the ONLY WAY I could find to force r8 to keep its filthy hands off of my default interfaces.
|
||||||
|
//may have undesirable side effects
|
||||||
|
debuggable = true
|
||||||
|
proguardFiles("proguard-rules.pro")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if(project.hasProperty("RELEASE_STORE_FILE") || System.getenv("CI") == "true"){
|
if(project.hasProperty("RELEASE_STORE_FILE") || System.getenv("CI") == "true"){
|
||||||
buildTypes{
|
buildTypes{
|
||||||
release{
|
release{
|
||||||
|
|||||||
|
Before Width: | Height: | Size: 3.7 KiB After Width: | Height: | Size: 3.7 KiB |
|
After Width: | Height: | Size: 1.6 KiB |
|
After Width: | Height: | Size: 647 B |
|
After Width: | Height: | Size: 611 B |
|
After Width: | Height: | Size: 691 B |
|
Before Width: | Height: | Size: 3.3 KiB After Width: | Height: | Size: 5.6 KiB |
@@ -519,3 +519,4 @@
|
|||||||
63184=crystal-orbs|block-crystal-orbs-ui
|
63184=crystal-orbs|block-crystal-orbs-ui
|
||||||
63183=conquer|unit-conquer-ui
|
63183=conquer|unit-conquer-ui
|
||||||
63182=disrupt|unit-disrupt-ui
|
63182=disrupt|unit-disrupt-ui
|
||||||
|
63181=krepost|unit-krepost-ui
|
||||||
|
|||||||
@@ -3147,14 +3147,14 @@ public class Blocks{
|
|||||||
//TODO balance, set up, where is liquid/sec displayed? status effects maybe?
|
//TODO balance, set up, where is liquid/sec displayed? status effects maybe?
|
||||||
ammo(
|
ammo(
|
||||||
Liquids.ozone, new ContinuousFlameBulletType(){{
|
Liquids.ozone, new ContinuousFlameBulletType(){{
|
||||||
damage = 85f;
|
damage = 90f;
|
||||||
length = range;
|
length = range;
|
||||||
knockback = 1f;
|
knockback = 1f;
|
||||||
|
|
||||||
colors = new Color[]{Color.valueOf("eb7abe").a(0.55f), Color.valueOf("e189f5").a(0.7f), Color.valueOf("907ef7").a(0.8f), Color.valueOf("91a4ff"), Color.white};
|
colors = new Color[]{Color.valueOf("eb7abe").a(0.55f), Color.valueOf("e189f5").a(0.7f), Color.valueOf("907ef7").a(0.8f), Color.valueOf("91a4ff"), Color.white};
|
||||||
}},
|
}},
|
||||||
Liquids.cyanogen, new ContinuousFlameBulletType(){{
|
Liquids.cyanogen, new ContinuousFlameBulletType(){{
|
||||||
damage = 180f;
|
damage = 200f;
|
||||||
rangeChange = 70f;
|
rangeChange = 70f;
|
||||||
length = range + rangeChange;
|
length = range + rangeChange;
|
||||||
knockback = 2f;
|
knockback = 2f;
|
||||||
@@ -3167,7 +3167,7 @@ public class Blocks{
|
|||||||
);
|
);
|
||||||
|
|
||||||
acceptCoolant = false;
|
acceptCoolant = false;
|
||||||
scaledHealth = 320;
|
scaledHealth = 330;
|
||||||
shootLength = 7f;
|
shootLength = 7f;
|
||||||
size = 3;
|
size = 3;
|
||||||
}};
|
}};
|
||||||
|
|||||||
@@ -125,7 +125,7 @@ public class SectorPresets{
|
|||||||
|
|
||||||
three = new SectorPreset("three", erekir, 32){{
|
three = new SectorPreset("three", erekir, 32){{
|
||||||
captureWave = 8;
|
captureWave = 8;
|
||||||
difficulty = 8;
|
difficulty = 5;
|
||||||
}};
|
}};
|
||||||
|
|
||||||
//endregion
|
//endregion
|
||||||
|
|||||||
@@ -2650,6 +2650,42 @@ public class UnitTypes{
|
|||||||
}});
|
}});
|
||||||
}};
|
}};
|
||||||
|
|
||||||
|
krepost = new UnitType("krepost"){{
|
||||||
|
drag = 0.1f;
|
||||||
|
speed = 1f;
|
||||||
|
hitSize = 19f;
|
||||||
|
health = 7300;
|
||||||
|
armor = 5f;
|
||||||
|
outlineColor = Pal.darkOutline;
|
||||||
|
envDisabled = Env.space;
|
||||||
|
rotateSpeed = 1.8f;
|
||||||
|
lockLegBase = true;
|
||||||
|
legStraightness = 1f;
|
||||||
|
baseLegStraightness = 0.6f;
|
||||||
|
|
||||||
|
legCount = 8;
|
||||||
|
legLength = 30f;
|
||||||
|
legTrns = 2f;
|
||||||
|
legMoveSpace = 1.05f;
|
||||||
|
rippleScale = 1.2f;
|
||||||
|
landShake = 0.5f;
|
||||||
|
legGroupSize = 2;
|
||||||
|
legExtension = -5f;
|
||||||
|
legBaseOffset = 19f;
|
||||||
|
legStraightLength = 0.9f;
|
||||||
|
maxStretch = 1.2f;
|
||||||
|
|
||||||
|
ammoType = new PowerAmmoType(2000);
|
||||||
|
|
||||||
|
legSplashDamage = 32;
|
||||||
|
legSplashRange = 32;
|
||||||
|
drownTimeMultiplier = 2f;
|
||||||
|
|
||||||
|
hovering = true;
|
||||||
|
visualElevation = 0.4f;
|
||||||
|
groundLayer = Layer.legUnit;
|
||||||
|
}};
|
||||||
|
|
||||||
//endregion
|
//endregion
|
||||||
//region erekir - flying
|
//region erekir - flying
|
||||||
|
|
||||||
|
|||||||
@@ -17,7 +17,9 @@ import mindustry.world.blocks.environment.*;
|
|||||||
|
|
||||||
@Component
|
@Component
|
||||||
abstract class LegsComp implements Posc, Rotc, Hitboxc, Flyingc, Unitc{
|
abstract class LegsComp implements Posc, Rotc, Hitboxc, Flyingc, Unitc{
|
||||||
@Import float x, y;
|
private static final Vec2 straightVec = new Vec2();
|
||||||
|
|
||||||
|
@Import float x, y, rotation;
|
||||||
@Import UnitType type;
|
@Import UnitType type;
|
||||||
@Import Team team;
|
@Import Team team;
|
||||||
|
|
||||||
@@ -83,6 +85,10 @@ abstract class LegsComp implements Posc, Rotc, Hitboxc, Flyingc, Unitc{
|
|||||||
baseRotation = Angles.moveToward(baseRotation, Mathf.angle(deltaX(), deltaY()), type.rotateSpeed);
|
baseRotation = Angles.moveToward(baseRotation, Mathf.angle(deltaX(), deltaY()), type.rotateSpeed);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if(type.lockLegBase){
|
||||||
|
baseRotation = rotation;
|
||||||
|
}
|
||||||
|
|
||||||
float rot = baseRotation;
|
float rot = baseRotation;
|
||||||
float legLength = type.legLength;
|
float legLength = type.legLength;
|
||||||
|
|
||||||
@@ -106,8 +112,8 @@ abstract class LegsComp implements Posc, Rotc, Hitboxc, Flyingc, Unitc{
|
|||||||
int deeps = 0;
|
int deeps = 0;
|
||||||
|
|
||||||
for(int i = 0; i < legs.length; i++){
|
for(int i = 0; i < legs.length; i++){
|
||||||
float dstRot = legAngle(rot, i);
|
float dstRot = legAngle(i);
|
||||||
Vec2 baseOffset = Tmp.v5.trns(dstRot, type.legBaseOffset).add(x, y);
|
Vec2 baseOffset = legOffset(Tmp.v5, i).add(x, y);
|
||||||
Leg l = legs[i];
|
Leg l = legs[i];
|
||||||
|
|
||||||
l.joint.sub(baseOffset).limit(type.maxStretch * legLength/2f).add(baseOffset);
|
l.joint.sub(baseOffset).limit(type.maxStretch * legLength/2f).add(baseOffset);
|
||||||
@@ -121,6 +127,7 @@ abstract class LegsComp implements Posc, Rotc, Hitboxc, Flyingc, Unitc{
|
|||||||
//back legs have reversed directions
|
//back legs have reversed directions
|
||||||
boolean backLeg = Math.abs((i + 0.5f) - legs.length/2f) <= 0.501f;
|
boolean backLeg = Math.abs((i + 0.5f) - legs.length/2f) <= 0.501f;
|
||||||
if(backLeg && type.flipBackLegs) side = !side;
|
if(backLeg && type.flipBackLegs) side = !side;
|
||||||
|
if(type.flipLegSide) side = !side;
|
||||||
|
|
||||||
l.moving = move;
|
l.moving = move;
|
||||||
l.stage = moving ? stageF % 1f : Mathf.lerpDelta(l.stage, 0f, 0.1f);
|
l.stage = moving ? stageF % 1f : Mathf.lerpDelta(l.stage, 0f, 0.1f);
|
||||||
@@ -180,9 +187,29 @@ abstract class LegsComp implements Posc, Rotc, Hitboxc, Flyingc, Unitc{
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Vec2 legOffset(Vec2 out, int index){
|
||||||
|
out.trns(defaultLegAngle(index), type.legBaseOffset);
|
||||||
|
|
||||||
|
if(type.legStraightness > 0){
|
||||||
|
straightVec.trns(defaultLegAngle(index) - baseRotation, type.legBaseOffset);
|
||||||
|
straightVec.y = Mathf.sign(straightVec.y) * type.legBaseOffset * type.legStraightLength;
|
||||||
|
straightVec.rotate(baseRotation);
|
||||||
|
out.lerp(straightVec, type.baseLegStraightness);
|
||||||
|
}
|
||||||
|
|
||||||
|
return out;
|
||||||
|
}
|
||||||
|
|
||||||
/** @return outwards facing angle of leg at the specified index. */
|
/** @return outwards facing angle of leg at the specified index. */
|
||||||
float legAngle(float rotation, int index){
|
float legAngle(int index){
|
||||||
return rotation + 360f / legs.length * index + (360f / legs.length / 2f);
|
if(type.legStraightness > 0){
|
||||||
|
return Mathf.slerp(defaultLegAngle(index), (index >= legs.length/2 ? -90 : 90f) + baseRotation, type.legStraightness);
|
||||||
|
}
|
||||||
|
return defaultLegAngle(index);
|
||||||
|
}
|
||||||
|
|
||||||
|
float defaultLegAngle(int index){
|
||||||
|
return baseRotation + 360f / legs.length * index + (360f / legs.length / 2f);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -111,7 +111,12 @@ public class UnitType extends UnlockableContent{
|
|||||||
public int legCount = 4, legGroupSize = 2;
|
public int legCount = 4, legGroupSize = 2;
|
||||||
public float legLength = 10f, legSpeed = 0.1f, legTrns = 1f, legBaseOffset = 0f, legMoveSpace = 1f, legExtension = 0, legPairOffset = 0, legLengthScl = 1f, kinematicScl = 1f, maxStretch = 1.75f;
|
public float legLength = 10f, legSpeed = 0.1f, legTrns = 1f, legBaseOffset = 0f, legMoveSpace = 1f, legExtension = 0, legPairOffset = 0, legLengthScl = 1f, kinematicScl = 1f, maxStretch = 1.75f;
|
||||||
public float legSplashDamage = 0f, legSplashRange = 5;
|
public float legSplashDamage = 0f, legSplashRange = 5;
|
||||||
public boolean flipBackLegs = true;
|
public float legStraightLength = 1f;
|
||||||
|
/** If true, legs are locked to the base of the unit instead of being on an implicit rotating "mount". */
|
||||||
|
public boolean lockLegBase = false;
|
||||||
|
public float baseLegStraightness, legStraightness;
|
||||||
|
/** TODO neither of these appear to do much */
|
||||||
|
public boolean flipBackLegs = true, flipLegSide = false;
|
||||||
|
|
||||||
public float mechSideSway = 0.54f, mechFrontSway = 0.1f;
|
public float mechSideSway = 0.54f, mechFrontSway = 0.1f;
|
||||||
public float mechStride = -1f;
|
public float mechStride = -1f;
|
||||||
@@ -1028,23 +1033,25 @@ public class UnitType extends UnlockableContent{
|
|||||||
float rotation = unit.baseRotation();
|
float rotation = unit.baseRotation();
|
||||||
float invDrown = 1f - unit.drownTime;
|
float invDrown = 1f - unit.drownTime;
|
||||||
|
|
||||||
|
if(footRegion.found()){
|
||||||
for(Leg leg : legs){
|
for(Leg leg : legs){
|
||||||
Drawf.shadow(leg.base.x, leg.base.y, ssize, invDrown);
|
Drawf.shadow(leg.base.x, leg.base.y, ssize, invDrown);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
//legs are drawn front first
|
//legs are drawn front first
|
||||||
for(int j = legs.length - 1; j >= 0; j--){
|
for(int j = legs.length - 1; j >= 0; j--){
|
||||||
int i = (j % 2 == 0 ? j/2 : legs.length - 1 - j/2);
|
int i = (j % 2 == 0 ? j/2 : legs.length - 1 - j/2);
|
||||||
Leg leg = legs[i];
|
Leg leg = legs[i];
|
||||||
float angle = unit.legAngle(rotation, i);
|
float angle = unit.legAngle(i);
|
||||||
boolean flip = i >= legs.length/2f;
|
boolean flip = i >= legs.length/2f;
|
||||||
int flips = Mathf.sign(flip);
|
int flips = Mathf.sign(flip);
|
||||||
|
|
||||||
Vec2 position = legOffset.trns(angle, legBaseOffset).add(unit);
|
Vec2 position = unit.legOffset(legOffset, i).add(unit);
|
||||||
|
|
||||||
Tmp.v1.set(leg.base).sub(leg.joint).inv().setLength(legExtension);
|
Tmp.v1.set(leg.base).sub(leg.joint).inv().setLength(legExtension);
|
||||||
|
|
||||||
if(leg.moving && visualElevation > 0){
|
if(footRegion.found() && leg.moving && visualElevation > 0){
|
||||||
float scl = visualElevation * invDrown;
|
float scl = visualElevation * invDrown;
|
||||||
float elev = Mathf.slope(1f - leg.stage) * scl;
|
float elev = Mathf.slope(1f - leg.stage) * scl;
|
||||||
Draw.color(Pal.shadow);
|
Draw.color(Pal.shadow);
|
||||||
@@ -1054,7 +1061,9 @@ public class UnitType extends UnlockableContent{
|
|||||||
|
|
||||||
Draw.mixcol(Tmp.c3, Tmp.c3.a);
|
Draw.mixcol(Tmp.c3, Tmp.c3.a);
|
||||||
|
|
||||||
|
if(footRegion.found()){
|
||||||
Draw.rect(footRegion, leg.base.x, leg.base.y, position.angleTo(leg.base));
|
Draw.rect(footRegion, leg.base.x, leg.base.y, position.angleTo(leg.base));
|
||||||
|
}
|
||||||
|
|
||||||
Lines.stroke(legRegion.height * Draw.scl * flips);
|
Lines.stroke(legRegion.height * Draw.scl * flips);
|
||||||
Lines.line(legRegion, position.x, position.y, leg.joint.x, leg.joint.y, false);
|
Lines.line(legRegion, position.x, position.y, leg.joint.x, leg.joint.y, false);
|
||||||
|
|||||||