More unit progress

This commit is contained in:
Anuken
2022-01-31 14:05:50 -05:00
parent 7c22478618
commit c6cfaa5ce5
17 changed files with 155 additions and 12 deletions

View File

@@ -31,6 +31,7 @@ public class SuppressionFieldAbility extends Ability{
public float particleLen = 7f;
public float rotateScl = 3f;
public float particleLife = 110f;
public boolean active = true;
public Interp particleInterp = f -> Interp.circleOut.apply(Interp.slope.apply(f));
public Color particleColor = Pal.sap.cpy();
@@ -42,6 +43,8 @@ public class SuppressionFieldAbility extends Ability{
@Override
public void update(Unit unit){
if(!active) return;
if((timer += Time.delta) >= reload){
any = false;
builds.clear();
@@ -88,7 +91,7 @@ public class SuppressionFieldAbility extends Ability{
float rx = unit.x + Tmp.v1.x, ry = unit.y + Tmp.v1.y;
float base = (Time.time / particleLife);
rand.setSeed(unit.id);
rand.setSeed(unit.id + hashCode());
Draw.color(particleColor);
for(int i = 0; i < particles; i++){
float fin = (rand.random(1f) + base) % 1f, fout = 1f - fin;
@@ -110,7 +113,7 @@ public class SuppressionFieldAbility extends Ability{
Fill.circle(rx, ry, rad * orbMidScl);
//TODO improve
if(heat > 0.001f){
if(heat > 0.001f && false){
Draw.color(Pal.sapBullet);
Lines.stroke(1.2f * heat * Mathf.absin(10f, 1f));
Lines.circle(rx, ry, range);

View File

@@ -41,8 +41,9 @@ abstract class TankComp implements Posc, Flyingc, Hitboxc, Unitc, ElevationMovec
float yOffset = (treadRegion.height/2f - (treadRect.y + treadRect.height/2f)) / 4f;
for(int i : Mathf.signs){
Tmp.v1.set(xOffset * i, yOffset - treadRect.height / 2f / 4f - 2f).rotate(rotation - 90);
Tmp.v1.set(xOffset * i, yOffset - treadRect.height / 2f / 4f).rotate(rotation - 90);
//TODO could fin for a while
Effect.floorDustAngle(type.treadEffect, Tmp.v1.x + x, Tmp.v1.y + y, rotation + 180f);
}

View File

@@ -1,6 +1,7 @@
package mindustry.entities.units;
import arc.graphics.*;
import arc.graphics.g2d.*;
import mindustry.graphics.*;
/** A sprite drawn in addition to the base unit sprites. */
@@ -12,6 +13,8 @@ public class UnitDecal{
public Blending blending = Blending.normal;
public Color color = Color.white;
public TextureRegion loadedRegion;
public UnitDecal(String region, float x, float y, float rotation, float layer, Color color){
this.region = region;
this.x = x;
@@ -21,6 +24,12 @@ public class UnitDecal{
this.color = color;
}
public UnitDecal(String region, Color color, Blending blending){
this.region = region;
this.color = color;
this.blending = blending;
}
public UnitDecal(){
}
}