Surge crucible effects
This commit is contained in:
44
core/src/mindustry/world/draw/DrawCircles.java
Normal file
44
core/src/mindustry/world/draw/DrawCircles.java
Normal file
@@ -0,0 +1,44 @@
|
||||
package mindustry.world.draw;
|
||||
|
||||
import arc.graphics.*;
|
||||
import arc.graphics.g2d.*;
|
||||
import arc.math.*;
|
||||
import arc.util.*;
|
||||
import mindustry.entities.units.*;
|
||||
import mindustry.gen.*;
|
||||
import mindustry.world.*;
|
||||
|
||||
public class DrawCircles extends DrawBlock{
|
||||
public Color color = Color.valueOf("7457ce");
|
||||
|
||||
public int amount = 5, sides = 15;
|
||||
public float strokeMin = 0.2f, strokeMax = 2f, timeScl = 160f;
|
||||
public float radius = 12f;
|
||||
public Interp strokeInterp = Interp.pow3In;
|
||||
|
||||
public DrawCircles(Color color){
|
||||
this.color = color;
|
||||
}
|
||||
|
||||
public DrawCircles(){
|
||||
}
|
||||
|
||||
@Override
|
||||
public void drawPlan(Block block, BuildPlan plan, Eachable<BuildPlan> list){}
|
||||
|
||||
@Override
|
||||
public void drawBase(Building build){
|
||||
if(build.warmup() <= 0.001f) return;
|
||||
|
||||
Draw.color(color, build.warmup() * color.a);
|
||||
|
||||
for(int i = 0; i < amount; i++){
|
||||
float life = ((Time.time / timeScl + i/(float)amount) % 1f);
|
||||
|
||||
Lines.stroke(build.warmup() * strokeInterp.apply(strokeMax, strokeMin, life));
|
||||
Lines.poly(build.x, build.y, sides, life * radius);
|
||||
}
|
||||
|
||||
Draw.color();
|
||||
}
|
||||
}
|
||||
46
core/src/mindustry/world/draw/DrawHeatRegion.java
Normal file
46
core/src/mindustry/world/draw/DrawHeatRegion.java
Normal file
@@ -0,0 +1,46 @@
|
||||
package mindustry.world.draw;
|
||||
|
||||
import arc.*;
|
||||
import arc.graphics.*;
|
||||
import arc.graphics.g2d.*;
|
||||
import arc.math.*;
|
||||
import mindustry.gen.*;
|
||||
import mindustry.graphics.*;
|
||||
import mindustry.world.*;
|
||||
import mindustry.world.blocks.production.HeatCrafter.*;
|
||||
|
||||
/** Not standalone. */
|
||||
public class DrawHeatRegion extends DrawBlock{
|
||||
public Color heatColor = new Color(1f, 0.22f, 0.22f, 0.8f);
|
||||
public float heatPulse = 0.3f, heatPulseScl = 10f;
|
||||
|
||||
public TextureRegion heat;
|
||||
public String suffix = "-glow";
|
||||
|
||||
public DrawHeatRegion(String suffix){
|
||||
this.suffix = suffix;
|
||||
}
|
||||
|
||||
public DrawHeatRegion(){
|
||||
}
|
||||
|
||||
@Override
|
||||
public void drawBase(Building build){
|
||||
|
||||
Draw.z(Layer.blockAdditive);
|
||||
if(build instanceof HeatCrafterBuild hc && hc.heat > 0){
|
||||
Draw.blend(Blending.additive);
|
||||
Draw.color(heatColor, Mathf.clamp(hc.heat / hc.heatRequirement()) * (heatColor.a * (1f - heatPulse + Mathf.absin(heatPulseScl, heatPulse))));
|
||||
Draw.rect(heat, build.x, build.y);
|
||||
Draw.blend();
|
||||
Draw.color();
|
||||
}
|
||||
Draw.z(Layer.block);
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void load(Block block){
|
||||
heat = Core.atlas.find(block.name + suffix);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user