5x5 burst drill
This commit is contained in:
@@ -10,6 +10,7 @@ import arc.struct.*;
|
||||
import arc.util.*;
|
||||
import mindustry.*;
|
||||
import mindustry.content.*;
|
||||
import mindustry.entities.effect.*;
|
||||
import mindustry.gen.*;
|
||||
import mindustry.graphics.*;
|
||||
import mindustry.world.*;
|
||||
@@ -93,6 +94,14 @@ public class Effect{
|
||||
return this;
|
||||
}
|
||||
|
||||
public WrapEffect wrap(Color color){
|
||||
return new WrapEffect(this, color);
|
||||
}
|
||||
|
||||
public WrapEffect wrap(Color color, float rotation){
|
||||
return new WrapEffect(this, color, rotation);
|
||||
}
|
||||
|
||||
public void at(Position pos){
|
||||
create(this, pos.getX(), pos.getY(), 0, Color.white, null);
|
||||
}
|
||||
|
||||
40
core/src/mindustry/entities/effect/WrapEffect.java
Normal file
40
core/src/mindustry/entities/effect/WrapEffect.java
Normal file
@@ -0,0 +1,40 @@
|
||||
package mindustry.entities.effect;
|
||||
|
||||
import arc.graphics.*;
|
||||
import mindustry.entities.*;
|
||||
|
||||
/** Wraps an effect with some parameters. */
|
||||
public class WrapEffect extends Effect{
|
||||
public Effect effect;
|
||||
public Color color = Color.white.cpy();
|
||||
public float rotation = Float.NaN;
|
||||
|
||||
public WrapEffect(){
|
||||
}
|
||||
|
||||
public WrapEffect(Effect effect, Color color){
|
||||
this.effect = effect;
|
||||
this.color = color;
|
||||
}
|
||||
|
||||
public WrapEffect(Effect effect, Color color, float rotation){
|
||||
this.effect = effect;
|
||||
this.color = color;
|
||||
this.rotation = rotation;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void init(){
|
||||
effect.init();
|
||||
clip = effect.clip;
|
||||
lifetime = effect.lifetime;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void render(EffectContainer e){
|
||||
e.color = color;
|
||||
if(!Float.isNaN(rotation)) e.rotation = rotation;
|
||||
effect.render(e);
|
||||
clip = Math.max(clip, effect.clip);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user