Misc cleanup

This commit is contained in:
Anuken 2022-02-03 20:38:49 -05:00
parent fa6ddd5f50
commit f573e78f4b
3 changed files with 14 additions and 21 deletions

View File

@ -2508,11 +2508,10 @@ public class UnitTypes{
speed = 0.48f;
health = 20000;
armor = 25f;
areaDamage = 22f;
rotateSpeed = 0.9f;
areaDamage = 30f;
rotateSpeed = 0.8f;
treadRects = new Rect[]{new Rect(27, 152, 56, 73), new Rect(24, 51 - 9, 29, 17), new Rect(59, 18 - 9, 39, 19)};
//TODO maybe different sprite, weapon impl
weapons.add(new Weapon("conquer-weapon"){{
layerOffset = 0.1f;
reload = 120f;
@ -2571,7 +2570,6 @@ public class UnitTypes{
}}
);
//TODO this is a bit over-the-top
for(int i = 1; i <= 3; i++){
int fi = i;
parts.add(new RegionPart("-blade"){{
@ -2585,7 +2583,6 @@ public class UnitTypes{
layerOffset = -0.002f;
x = 11 / 4f;
y = 0 / 4f;
}});
}
@ -2621,10 +2618,6 @@ public class UnitTypes{
sparkStroke = 3f;
}};
//trailChance = 0.1f;
trailInterval = 3f;
trailParam = 4f;
int count = 6;
for(int j = 0; j < count; j++){
int s = j;
@ -2632,7 +2625,7 @@ public class UnitTypes{
float fin = 0.05f + (j + 1) / (float)count;
float spd = speed;
float life = lifetime / Mathf.lerp(fin, 1f, 0.5f);
spawnBullets.add(new BasicBulletType(spd * (fin), 40){{
spawnBullets.add(new BasicBulletType(spd * fin, 45){{
drag = 0.002f;
width = 8f;
height = 10f;
@ -2671,10 +2664,7 @@ public class UnitTypes{
}};
}});
//TODO could change color when shooting
decals.add(new UnitDecal("conquer-glow", Color.red, Blending.additive){{
layer = -1f;
}});
decals.add(new UnitDecal("conquer-glow", Color.red, Blending.additive, -1f));
}};
//endregion
@ -2988,6 +2978,7 @@ public class UnitTypes{
}});
}
//TODO needs weapons! cool missiles or something
if(false)
weapons.add(new Weapon("quell-weapon"){{
x = 51 / 4f;

View File

@ -32,10 +32,9 @@ public class RegionPart extends WeaponPart{
public float outlineLayerOffset = -0.001f;
public float rotation, rotMove;
public float x, y, moveX, moveY;
public boolean oscAbs = false;
public @Nullable Color color, colorTo;
public Color heatColor = Pal.turretHeat.cpy();
public @Nullable WeaponPart child;
public Seq<WeaponPart> children = new Seq<>();
public RegionPart(String region){
this.suffix = region;
@ -103,7 +102,7 @@ public class RegionPart extends WeaponPart{
//draw child, if applicable - only at the end
//TODO lots of copy-paste here
if(child != null){
if(children.size > 0){
for(int s = 0; s < len; s++){
int i = (params.sideOverride == -1 ? s : params.sideOverride);
float sign = i == 1 ? -1 : 1;
@ -111,7 +110,9 @@ public class RegionPart extends WeaponPart{
childParam.set(params.warmup, params.reload, params.smoothReload, params.heat, params.x + Tmp.v1.x, params.y + Tmp.v1.y, i * sign + rotMove * prog * sign + params.rotation);
childParam.sideOverride = i;
child.draw(childParam);
for(var child : children){
child.draw(childParam);
}
}
}
}
@ -137,7 +138,7 @@ public class RegionPart extends WeaponPart{
}
heat = Core.atlas.find(name + suffix + "-heat");
if(child != null){
for(var child : children){
child.load(name);
}
}
@ -147,7 +148,7 @@ public class RegionPart extends WeaponPart{
if(outline && drawRegion){
out.addAll(regions);
}
if(child != null){
for(var child : children){
child.getOutlines(out);
}
}

View File

@ -24,9 +24,10 @@ public class UnitDecal{
this.color = color;
}
public UnitDecal(String region, Color color, Blending blending){
public UnitDecal(String region, Color color, Blending blending, float layer){
this.region = region;
this.color = color;
this.layer = layer;
this.blending = blending;
}