mirror of
https://github.com/Anuken/Mindustry.git
synced 2025-01-20 01:07:16 +07:00
Regen projection recolor
This commit is contained in:
parent
0ede0dbf0c
commit
9c2618f2e8
Binary file not shown.
Before Width: | Height: | Size: 2.9 KiB After Width: | Height: | Size: 2.0 KiB |
@ -1545,28 +1545,30 @@ public class Blocks{
|
||||
buildSpeed = 1.5f;
|
||||
}};
|
||||
|
||||
//TODO green looks bad switch to orange
|
||||
//TODO orange also looks bad hhhh
|
||||
regenProjector = new RegenProjector("regen-projector"){{
|
||||
requirements(Category.effect, with(Items.silicon, 60, Items.tungsten, 60, Items.oxide, 30, Items.beryllium, 80));
|
||||
size = 3;
|
||||
consumes.power(1f);
|
||||
range = 28;
|
||||
baseColor = Pal.regen;
|
||||
|
||||
consumes.liquid(Liquids.hydrogen, 1f / 60f);
|
||||
|
||||
healPercent = 4f / 60f;
|
||||
|
||||
Color col = Color.valueOf("8ca9e8");
|
||||
|
||||
drawer = new DrawMulti(new DrawRegion("-bottom"), new DrawLiquidTile(Liquids.hydrogen, 9f / 4f), new DrawBlock(), new DrawGlowRegion(){{
|
||||
color = Color.orange;//Color.valueOf("1eff21");
|
||||
color = Color.sky;
|
||||
}}, new DrawPulseShape(false){{
|
||||
//radiusScl = 0.95f;
|
||||
layer = Layer.effect;
|
||||
color = col;
|
||||
}}, new DrawShape(){{
|
||||
layer = Layer.effect;
|
||||
radius = 3.5f;
|
||||
useWarmupRadius = true;
|
||||
timeScl = 2f;
|
||||
color = col;
|
||||
}});
|
||||
}};
|
||||
|
||||
@ -2338,7 +2340,7 @@ public class Blocks{
|
||||
|
||||
//TODO different requirements
|
||||
consumes.power(6f);
|
||||
consumes.liquids(LiquidStack.with(Liquids.water, 0.5f, Liquids.hydrogen, 4f / 60f));
|
||||
consumes.liquids(LiquidStack.with(Liquids.water, 0.4f, Liquids.hydrogen, 4f / 60f));
|
||||
}};
|
||||
|
||||
//endregion
|
||||
|
@ -1467,7 +1467,7 @@ public class Fx{
|
||||
}),
|
||||
|
||||
regenParticle = new Effect(100f, e -> {
|
||||
color(Pal.accent);
|
||||
color(Pal.regen);
|
||||
|
||||
Fill.square(e.x, e.y, e.fslope() * 1.5f + 0.14f, 45f);
|
||||
}),
|
||||
|
@ -16,6 +16,8 @@ public class Pal{
|
||||
sapBullet = Color.valueOf("bf92f9"),
|
||||
sapBulletBack = Color.valueOf("6d56bf"),
|
||||
|
||||
regen = Color.valueOf("d1efff"),
|
||||
|
||||
reactorPurple = Color.valueOf("bf92f9"),
|
||||
reactorPurple2 = Color.valueOf("8a73c6"),
|
||||
|
||||
|
@ -30,7 +30,7 @@ public class RegenProjector extends Block{
|
||||
|
||||
public DrawBlock drawer = new DrawMulti(new DrawRegion("-bottom"), new DrawSideRegion(true));
|
||||
|
||||
public float effectChance = 0.013f;
|
||||
public float effectChance = 0.003f;
|
||||
public Color baseColor = Pal.accent;
|
||||
public Effect effect = Fx.regenParticle;
|
||||
|
||||
@ -53,7 +53,7 @@ public class RegenProjector extends Block{
|
||||
x *= tilesize;
|
||||
y *= tilesize;
|
||||
|
||||
Drawf.dashSquare(Pal.accent, x, y, range * tilesize);
|
||||
Drawf.dashSquare(baseColor, 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)));
|
||||
});
|
||||
@ -111,7 +111,7 @@ public class RegenProjector extends Block{
|
||||
|
||||
if(consValid()){
|
||||
//use Math.max to prevent stacking
|
||||
for(Building build : targets){
|
||||
for(var build : targets){
|
||||
if(!build.damaged() || build.isHealSuppressed()) continue;
|
||||
|
||||
didRegen = true;
|
||||
@ -121,7 +121,7 @@ public class RegenProjector extends Block{
|
||||
float value = mendMap.get(pos);
|
||||
mendMap.put(pos, Math.min(Math.max(value, healPercent * edelta() * build.block.health / 100f), build.block.health - build.health));
|
||||
|
||||
if(Mathf.chanceDelta(effectChance)){
|
||||
if(value <= 0 && Mathf.chanceDelta(effectChance * build.block.size * build.block.size)){
|
||||
effect.at(build.x + Mathf.range(build.block.size * tilesize/2f - 1f), build.y + Mathf.range(build.block.size * tilesize/2f - 1f));
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user