Various tweaks
@ -36,7 +36,7 @@ allprojects{
|
||||
if(!project.hasProperty("versionType")) versionType = 'official'
|
||||
appName = 'Mindustry'
|
||||
steamworksVersion = '891ed912791e01fe9ee6237a6497e5212b85c256'
|
||||
rhinoVersion = 'bf4150f7add42d26c98e33c24acfd94fa87be2e1'
|
||||
rhinoVersion = '8437435dab9993769d72739608580d40c5343285'
|
||||
|
||||
loadVersionProps = {
|
||||
return new Properties().with{p -> p.load(file('../core/assets/version.properties').newReader()); return p }
|
||||
|
Before Width: | Height: | Size: 255 B After Width: | Height: | Size: 253 B |
Before Width: | Height: | Size: 354 B After Width: | Height: | Size: 341 B |
Before Width: | Height: | Size: 747 B After Width: | Height: | Size: 804 B |
Before Width: | Height: | Size: 670 B After Width: | Height: | Size: 740 B |
Before Width: | Height: | Size: 647 KiB After Width: | Height: | Size: 647 KiB |
Before Width: | Height: | Size: 960 KiB After Width: | Height: | Size: 960 KiB |
Before Width: | Height: | Size: 378 KiB After Width: | Height: | Size: 378 KiB |
Before Width: | Height: | Size: 185 KiB After Width: | Height: | Size: 189 KiB |
Before Width: | Height: | Size: 1.3 MiB After Width: | Height: | Size: 1.3 MiB |
Before Width: | Height: | Size: 2.1 MiB After Width: | Height: | Size: 2.1 MiB |
Before Width: | Height: | Size: 186 KiB After Width: | Height: | Size: 191 KiB |
Before Width: | Height: | Size: 1.3 MiB After Width: | Height: | Size: 1.3 MiB |
@ -433,6 +433,7 @@ public class Bullets implements ContentList{
|
||||
hitSize = 7f;
|
||||
lifetime = 18f;
|
||||
pierce = true;
|
||||
collidesAir = false;
|
||||
statusDuration = 60f * 4;
|
||||
shootEffect = Fx.shootSmallFlame;
|
||||
hitEffect = Fx.hitFlameSmall;
|
||||
@ -447,6 +448,7 @@ public class Bullets implements ContentList{
|
||||
hitSize = 7f;
|
||||
lifetime = 18f;
|
||||
pierce = true;
|
||||
collidesAir = false;
|
||||
statusDuration = 60f * 6;
|
||||
shootEffect = Fx.shootPyraFlame;
|
||||
hitEffect = Fx.hitFlameSmall;
|
||||
|
@ -103,6 +103,7 @@ public class UnitTypes implements ContentList{
|
||||
targetAir = false;
|
||||
health = 790;
|
||||
armor = 9f;
|
||||
mechFrontSway = 0.55f;
|
||||
|
||||
weapons.add(new Weapon("artillery"){{
|
||||
y = 1f;
|
||||
@ -131,11 +132,13 @@ public class UnitTypes implements ContentList{
|
||||
speed = 0.35f;
|
||||
hitsize = 20f;
|
||||
rotateSpeed = 2.1f;
|
||||
targetAir = false;
|
||||
health = 9000;
|
||||
armor = 11f;
|
||||
mechLegMoveScl = 1.3f;
|
||||
canDrown = false;
|
||||
mechFrontSway = 1f;
|
||||
|
||||
mechStepParticles = true;
|
||||
mechStepShake = 0.15f;
|
||||
|
||||
weapons.add(
|
||||
new Weapon("scepter-weapon"){{
|
||||
@ -188,11 +191,13 @@ public class UnitTypes implements ContentList{
|
||||
speed = 0.35f;
|
||||
hitsize = 26f;
|
||||
rotateSpeed = 1.65f;
|
||||
targetAir = false;
|
||||
health = 24000;
|
||||
armor = 14f;
|
||||
mechLegMoveScl = 1.75f;
|
||||
mechStepParticles = true;
|
||||
mechStepShake = 0.75f;
|
||||
canDrown = false;
|
||||
mechFrontSway = 1.9f;
|
||||
mechSideSway = 0.6f;
|
||||
|
||||
weapons.add(
|
||||
new Weapon("reign-weapon"){{
|
||||
@ -201,7 +206,7 @@ public class UnitTypes implements ContentList{
|
||||
shootY = 11f;
|
||||
reload = 9f;
|
||||
recoil = 5f;
|
||||
shake = 4f;
|
||||
shake = 2f;
|
||||
ejectEffect = Fx.shellEjectBig;
|
||||
shootSound = Sounds.artillery;
|
||||
|
||||
@ -319,6 +324,7 @@ public class UnitTypes implements ContentList{
|
||||
landShake = 2f;
|
||||
|
||||
commandLimit = 24;
|
||||
mechFrontSway = 0.55f;
|
||||
|
||||
speed = 0.4f;
|
||||
hitsize = 10f;
|
||||
@ -357,7 +363,7 @@ public class UnitTypes implements ContentList{
|
||||
speed = 0.85f;
|
||||
hitsize = 8f;
|
||||
health = 170;
|
||||
sway = 0.25f;
|
||||
mechSideSway = 0.25f;
|
||||
range = 40f;
|
||||
|
||||
weapons.add(new Weapon(){{
|
||||
|
@ -10,7 +10,7 @@ import static mindustry.Vars.*;
|
||||
|
||||
public class EntityCollisions{
|
||||
//range for tile collision scanning
|
||||
private static final int r = 1;
|
||||
private static final int r = 2;
|
||||
//move in 1-unit chunks
|
||||
private static final float seg = 1f;
|
||||
|
||||
|
@ -57,7 +57,7 @@ public class EntityGroup<T extends Entityc> implements Iterable<T>{
|
||||
each(Entityc::update);
|
||||
}
|
||||
|
||||
public void copy(Seq arr){
|
||||
public void copy(Seq<T> arr){
|
||||
arr.addAll(array);
|
||||
}
|
||||
|
||||
|
@ -8,7 +8,7 @@ import mindustry.gen.*;
|
||||
@Component
|
||||
abstract class MechComp implements Posc, Flyingc, Hitboxc, Unitc, Mechc, ElevationMovec{
|
||||
@SyncField(false) @SyncLocal float baseRotation;
|
||||
transient float walkTime;
|
||||
transient float walkTime, walkExtension;
|
||||
|
||||
@Override
|
||||
public void update(){
|
||||
|
@ -48,7 +48,6 @@ public class UnitType extends UnlockableContent{
|
||||
public boolean canBoost = false;
|
||||
public boolean destructibleWreck = true;
|
||||
public float groundLayer = Layer.groundUnit;
|
||||
public float sway = 1f;
|
||||
public float payloadCapacity = 8;
|
||||
public int commandLimit = 24;
|
||||
public float visualElevation = -1f;
|
||||
@ -62,7 +61,12 @@ public class UnitType extends UnlockableContent{
|
||||
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 boolean flipBackLegs = true;
|
||||
public float mechLegMoveScl = 1f;
|
||||
|
||||
public float mechSideSway = 0.54f, mechFrontSway = 0.1f;
|
||||
public float mechStride = -1f;
|
||||
public float mechStepShake = -1f;
|
||||
public boolean mechStepParticles = false;
|
||||
public Color mechLegColor = Pal.darkMetal;
|
||||
|
||||
public int itemCapacity = -1;
|
||||
public int ammoCapacity = 220;
|
||||
@ -133,6 +137,42 @@ public class UnitType extends UnlockableContent{
|
||||
a.update(unit);
|
||||
}
|
||||
}
|
||||
|
||||
if(unit instanceof Mechc){
|
||||
updateMechEffects(unit);
|
||||
}
|
||||
}
|
||||
|
||||
public void updateMechEffects(Unit unit){
|
||||
Mechc mech = (Mechc)unit;
|
||||
|
||||
float extend = walkExtend((Mechc)unit, false);
|
||||
float base = walkExtend((Mechc)unit, true);
|
||||
float extendScl = base % 1f;
|
||||
|
||||
float lastExtend = mech.walkExtension();
|
||||
|
||||
if(extendScl < lastExtend && base % 2f > 1f){
|
||||
int side = -Mathf.sign(extend);
|
||||
float width = hitsize / 2f * side, length = mechStride * 1.35f;
|
||||
|
||||
float cx = unit.x + Angles.trnsx(mech.baseRotation(), length, width),
|
||||
cy = unit.y + Angles.trnsy(mech.baseRotation(), length, width);
|
||||
|
||||
if(mechStepShake > 0){
|
||||
Effect.shake(mechStepShake, mechStepShake, cx, cy);
|
||||
}
|
||||
|
||||
if(mechStepParticles){
|
||||
Tile tile = world.tileWorld(cx, cy);
|
||||
if(tile != null){
|
||||
Color color = tile.floor().mapColor;
|
||||
Fx.unitLand.at(cx, cy, hitsize/8f, color);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
mech.walkExtension(extendScl);
|
||||
}
|
||||
|
||||
public void landed(Unit unit){}
|
||||
@ -208,6 +248,15 @@ public class UnitType extends UnlockableContent{
|
||||
}
|
||||
}
|
||||
|
||||
if(mechStride < 0){
|
||||
mechStride = 4f + (hitsize-8f)/2.1f;
|
||||
}
|
||||
|
||||
if(mechStepShake < 0){
|
||||
mechStepShake = Mathf.round((hitsize - 11f) / 9f);
|
||||
mechStepParticles = hitsize > 15f;
|
||||
}
|
||||
|
||||
canHeal = weapons.contains(w -> w.bullet instanceof HealBulletType);
|
||||
|
||||
//add mirrored weapon variants
|
||||
@ -286,10 +335,14 @@ public class UnitType extends UnlockableContent{
|
||||
Draw.z(z - 0.02f);
|
||||
|
||||
if(mech != null){
|
||||
drawMech((Unit & Mechc)mech);
|
||||
drawMech(mech);
|
||||
|
||||
//side
|
||||
legOffset.trns(mech.baseRotation(), 0f, Mathf.lerp(Mathf.sin(walkExtend(mech, true), 2f/Mathf.PI, 1) * mechSideSway, 0f, unit.elevation));
|
||||
|
||||
//front
|
||||
legOffset.add(Tmp.v1.trns(mech.baseRotation() + 90, 0f, Mathf.lerp(Mathf.sin(walkExtend(mech, true), 1f/Mathf.PI, 1) * mechFrontSway, 0f, unit.elevation)));
|
||||
|
||||
float ft = Mathf.sin(mech.walkTime(), 3f * mechLegMoveScl, 3f);
|
||||
legOffset.trns(mech.baseRotation(), 0f, Mathf.lerp(ft * 0.18f * sway, 0f, unit.elevation));
|
||||
unit.trns(legOffset.x, legOffset.y);
|
||||
}
|
||||
|
||||
@ -551,14 +604,15 @@ public class UnitType extends UnlockableContent{
|
||||
Draw.reset();
|
||||
}
|
||||
|
||||
public <T extends Unit & Mechc> void drawMech(T unit){
|
||||
public void drawMech(Mechc mech){
|
||||
Unit unit = (Unit)mech;
|
||||
|
||||
Draw.reset();
|
||||
|
||||
Draw.mixcol(Color.white, unit.hitTime);
|
||||
|
||||
float e = unit.elevation;
|
||||
float sin = Mathf.lerp(Mathf.sin(unit.walkTime(), 3f * mechLegMoveScl, 1f), 0f, e);
|
||||
float ft = sin*(2.5f + (unit.hitSize-8f)/2f);
|
||||
|
||||
float sin = Mathf.lerp(Mathf.sin(walkExtend(mech, true), 2f / Mathf.PI, 1f), 0f, e);
|
||||
float extension = walkExtend(mech, false);
|
||||
float boostTrns = e * 2f;
|
||||
|
||||
Floor floor = unit.isFlying() ? Blocks.air.asFloor() : unit.floorOn();
|
||||
@ -568,25 +622,43 @@ public class UnitType extends UnlockableContent{
|
||||
}
|
||||
|
||||
for(int i : Mathf.signs){
|
||||
Draw.mixcol(Tmp.c1.set(mechLegColor).lerp(Color.white, Mathf.clamp(unit.hitTime)), Math.max(Math.max(0, i * extension / mechStride), unit.hitTime));
|
||||
|
||||
Draw.rect(legRegion,
|
||||
unit.x + Angles.trnsx(unit.baseRotation(), ft * i - boostTrns, -boostTrns*i),
|
||||
unit.y + Angles.trnsy(unit.baseRotation(), ft * i - boostTrns, -boostTrns*i),
|
||||
unit.x + Angles.trnsx(mech.baseRotation(), extension * i - boostTrns, -boostTrns*i),
|
||||
unit.y + Angles.trnsy(mech.baseRotation(), extension * i - boostTrns, -boostTrns*i),
|
||||
legRegion.getWidth() * i * Draw.scl,
|
||||
legRegion.getHeight() * Draw.scl - Math.max(-sin * i, 0) * legRegion.getHeight() * 0.5f * Draw.scl,
|
||||
unit.baseRotation() - 90 + 35f*i*e);
|
||||
mech.baseRotation() - 90 + 35f*i*e);
|
||||
}
|
||||
|
||||
Draw.mixcol(Color.white, unit.hitTime);
|
||||
|
||||
if(floor.isLiquid){
|
||||
Draw.color(Color.white, floor.mapColor, unit.drownTime() * 0.4f);
|
||||
}else{
|
||||
Draw.color(Color.white);
|
||||
}
|
||||
|
||||
Draw.rect(baseRegion, unit, unit.baseRotation() - 90);
|
||||
Draw.rect(baseRegion, unit, mech.baseRotation() - 90);
|
||||
|
||||
Draw.mixcol();
|
||||
}
|
||||
|
||||
public float walkExtend(Mechc mech, boolean scaled){
|
||||
|
||||
//now ranges from -maxExtension to maxExtension*3
|
||||
float raw = mech.walkTime() % (mechStride * 4);
|
||||
|
||||
if(scaled) return raw / mechStride;
|
||||
|
||||
if(raw > mechStride*3) raw = raw - mechStride * 4;
|
||||
else if(raw > mechStride*2) raw = mechStride * 2 - raw;
|
||||
else if(raw > mechStride) raw = mechStride * 2 - raw;
|
||||
|
||||
return raw;
|
||||
}
|
||||
|
||||
public void applyColor(Unit unit){
|
||||
Draw.color();
|
||||
Draw.mixcol(Color.white, unit.hitTime);
|
||||
|
@ -39,6 +39,7 @@ public class CoreItemsDisplay extends Table{
|
||||
for(Item item : content.items()){
|
||||
if(usedItems.contains(item)){
|
||||
image(item.icon(Cicon.small)).padRight(3);
|
||||
//TODO leaks garbage
|
||||
label(() -> core == null ? "0" : UI.formatAmount(core.items.get(item))).padRight(3).left();
|
||||
|
||||
if(++i % 4 == 0){
|
||||
|