Feature re-implementations

This commit is contained in:
Anuken
2020-02-08 21:54:41 -05:00
parent 5169e197b6
commit e23119e330
10 changed files with 53 additions and 23 deletions

View File

@@ -2,11 +2,13 @@ package mindustry.entities;
import arc.*;
import arc.graphics.*;
import arc.graphics.g2d.*;
import arc.math.*;
import arc.math.geom.*;
import arc.util.*;
import mindustry.content.*;
import mindustry.gen.*;
import mindustry.graphics.*;
import static mindustry.Vars.*;
@@ -32,7 +34,7 @@ public class Effects{
shake(intensity, duration, loc.getX(), loc.getY());
}
public static void createEffect(Effect effect, float x, float y, float rotation, Color color, Object data){
public static void create(Effect effect, float x, float y, float rotation, Color color, Object data){
if(headless || effect == Fx.none) return;
if(Core.settings.getBool("effects")){
Rect view = Core.camera.bounds(Tmp.r1);
@@ -51,4 +53,25 @@ public class Effects{
}
}
}
public static void decal(TextureRegion region, float x, float y, float rotation, float lifetime, Color color){
if(headless || region == null) return;
Decalc decal = DecalEntity.create();
decal.set(x, y);
decal.rotation(rotation);
decal.lifetime(lifetime);
decal.color().set(color);
decal.region(region);
decal.add();
}
public static void rubble(float x, float y, int blockSize){
if(headless) return;
TextureRegion region = Core.atlas.find("rubble-" + blockSize + "-" + Mathf.random(0, 1));
if(!Core.atlas.isFound(region)) return;
decal(region, x, y, Mathf.random(0, 4) * 90, 3600, Pal.rubble);
}
}