Merge pull request #3184 from MEEPofFaith/any-layer-effects

Any Layer Effects
This commit is contained in:
Anuken 2020-10-29 13:58:55 -04:00 committed by GitHub
commit afed4c4239
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 17 additions and 17 deletions

View file

@ -257,33 +257,33 @@ public class Fx{
randLenVectors(e.id, 9, 3 + 20f * e.finpow(), (x, y) -> {
Fill.circle(e.x + x, e.y + y, e.fout() * 4f + 0.4f);
});
}).ground(),
}).layer(Layer.debris),
unitLand = new Effect(30, e -> {
color(Tmp.c1.set(e.color).mul(1.1f));
randLenVectors(e.id, 6, 17f * e.finpow(), (x, y) -> {
Fill.circle(e.x + x, e.y + y, e.fout() * 4f + 0.3f);
});
}).ground(),
}).layer(Layer.debris),
unitLandSmall = new Effect(30, e -> {
color(Tmp.c1.set(e.color).mul(1.1f));
randLenVectors(e.id, (int)(6 * e.rotation), 12f * e.finpow() * e.rotation, (x, y) -> {
Fill.circle(e.x + x, e.y + y, e.fout() * 3f + 0.1f);
});
}).ground(),
}).layer(Layer.debris),
unitPickup = new Effect(18, e -> {
color(Pal.lightishGray);
stroke(e.fin() * 2f);
Lines.poly(e.x, e.y, 4, 13f * e.fout());
}).ground(),
}).layer(Layer.debris),
landShock = new Effect(12, e -> {
color(Pal.lancerLaser);
stroke(e.fout() * 3f);
Lines.poly(e.x, e.y, 12, 20f * e.fout());
}).ground(),
}).layer(Layer.debris),
pickup = new Effect(18, e -> {
color(Pal.lightishGray);
@ -1076,7 +1076,7 @@ public class Fx{
e.y + trnsy(lr, len) + Mathf.randomSeedRange(e.id + i + 8, 3f * e.fin()),
1f, 2f, rot + e.fin() * 50f * i);
}).ground(400f),
}).layer(Layer.debris, 400f),
shellEjectMedium = new Effect(34f, e -> {
color(Pal.lightOrange, Color.lightGray, Pal.lightishGray, e.fin());
@ -1099,7 +1099,7 @@ public class Fx{
});
}
}).ground(400f),
}).layer(Layer.debris, 400f),
shellEjectBig = new Effect(22f, e -> {
color(Pal.lightOrange, Color.lightGray, Pal.lightishGray, e.fin());
@ -1123,7 +1123,7 @@ public class Fx{
});
}
}).ground(400f),
}).layer(Layer.debris, 400f),
railShoot = new Effect(24f, e -> {
e.scaled(10f, b -> {
@ -1500,7 +1500,7 @@ public class Fx{
color(Tmp.c1.set(e.color).mul(1.5f));
stroke(e.fout() * 1.4f);
Lines.circle(e.x, e.y, (2f + e.fin() * 4f) * e.rotation);
}).ground(),
}).layer(Layer.debris),
bubble = new Effect(20, e -> {
color(Tmp.c1.set(e.color).shiftValue(0.1f));

View file

@ -27,8 +27,8 @@ public class Effect{
/** Clip size. */
public float size;
public boolean ground;
public float groundDuration;
public float layer = Layer.effect;
public float layerDuration;
public Effect(float life, float clipsize, Cons<EffectContainer> renderer){
this.id = all.size;
@ -42,14 +42,14 @@ public class Effect{
this(life,50f, renderer);
}
public Effect ground(){
ground = true;
public Effect layer(float l){
layer = l;
return this;
}
public Effect ground(float duration){
ground = true;
this.groundDuration = duration;
public Effect layer(float l, float duration){
layer = l;
this.layerDuration = duration;
return this;
}
@ -87,7 +87,7 @@ public class Effect{
public float render(int id, Color color, float life, float lifetime, float rotation, float x, float y, Object data){
container.set(id, color, life, lifetime, rotation, x, y, data);
Draw.z(ground ? Layer.debris : Layer.effect);
Draw.z(layer);
Draw.reset();
renderer.get(container);
Draw.reset();