Regen projector visual fixes

This commit is contained in:
Anuken
2021-12-27 14:52:35 -05:00
parent 0f5b091655
commit f337a12f90
3 changed files with 13 additions and 4 deletions

View File

@@ -1447,7 +1447,7 @@ public class Fx{
Fill.square(e.x, e.y, e.fslope() * 1.5f + 0.14f, 45f);
}),
regenSuppressParticle = new Effect(30f, e -> {
regenSuppressParticle = new Effect(35f, e -> {
color(Pal.sapBullet, e.color, e.fin());
stroke(e.fout() * 1.4f + 0.5f);

View File

@@ -68,7 +68,7 @@ public class MendProjector extends Block{
/** @return whether a building has regen/healing suppressed; if so, spawns particles on it. */
public static boolean checkSuppression(Building build){
if(build.isHealSuppressed()){
if(Mathf.chanceDelta(0.04)){
if(Mathf.chanceDelta(0.03)){
Fx.regenSuppressParticle.at(build.x + Mathf.range(build.block.size * tilesize/2f - 1f), build.y + Mathf.range(build.block.size * tilesize/2f - 1f));
}

View File

@@ -1,10 +1,12 @@
package mindustry.world.blocks.defense;
import arc.*;
import arc.graphics.*;
import arc.graphics.g2d.*;
import arc.math.*;
import arc.struct.*;
import arc.util.*;
import mindustry.*;
import mindustry.content.*;
import mindustry.entities.*;
import mindustry.entities.units.*;
@@ -29,6 +31,7 @@ public class RegenProjector extends Block{
public DrawBlock drawer = new DrawMulti(new DrawRegion("-bottom"), new DrawSideRegion(true));
public float effectChance = 0.013f;
public Color baseColor = Pal.accent;
public Effect effect = Fx.regenParticle;
public RegenProjector(String name){
@@ -47,7 +50,13 @@ public class RegenProjector extends Block{
public void drawPlace(int x, int y, int rotation, boolean valid){
super.drawPlace(x, y, rotation, valid);
x *= tilesize;
y *= tilesize;
Drawf.dashSquare(Pal.accent, x, y, range * tilesize);
indexer.eachBlock(Vars.player.team(), Tmp.r1.setCentered(x, y, range * tilesize), b -> true, t -> {
Drawf.selected(t, Tmp.c1.set(baseColor).a(Mathf.absin(4f, 1f)));
});
}
@Override
@@ -140,9 +149,9 @@ public class RegenProjector extends Block{
public void drawSelect(){
super.drawSelect();
Drawf.dashSquare(Pal.accent, x, y, range * tilesize);
Drawf.dashSquare(baseColor, x, y, range * tilesize);
for(var target : targets){
Drawf.selected(target, Pal.accent);
Drawf.selected(target, Tmp.c1.set(baseColor).a(Mathf.absin(4f, 1f)));
}
}