More effect tweaks / Unfinished implementation of lancer turret

This commit is contained in:
Anuken
2018-04-04 23:50:27 -04:00
parent 05356776c5
commit 62608bea6c
16 changed files with 340 additions and 308 deletions
@@ -5,7 +5,7 @@ import io.anuke.mindustry.game.Team;
public abstract class Unit extends SyncEntity {
//total duration of hit effect
public static final float hitDuration = 5f;
public static final float hitDuration = 9f;
public Team team = Team.blue;
public Vector2 velocity = new Vector2();
@@ -8,6 +8,7 @@ import io.anuke.mindustry.game.Team;
import io.anuke.mindustry.world.Tile;
import io.anuke.ucore.core.Effects;
import io.anuke.ucore.core.Effects.Effect;
import io.anuke.ucore.entities.SolidEntity;
import io.anuke.ucore.function.Consumer;
import io.anuke.ucore.util.Mathf;
import io.anuke.ucore.util.Physics;
@@ -23,7 +24,7 @@ public class DamageArea{
/**Damages entities in a line.
* Only enemies of the specified team are damaged.*/
public static void damageLine(Team team, Effect effect, float x, float y, float angle, float length, int damage){
public static void collideLine(SolidEntity hitter, Team team, Effect effect, float x, float y, float angle, float length){
tr.trns(angle, length);
rect.setPosition(x, y).setSize(tr.x, tr.y);
float x2 = tr.x + x, y2 = tr.y + y;
@@ -56,7 +57,8 @@ public class DamageArea{
if (vec != null) {
Effects.effect(effect, vec.x, vec.y);
e.damage(damage);
e.collision(hitter, vec.x, vec.y);
hitter.collision(e, vec.x, vec.y);
}
};
@@ -31,7 +31,7 @@ public class StaticEffectEntity extends EffectEntity {
@Override
public void drawOver(){
if(once) Effects.renderEffect(id, renderer, color, once ? lifetime : time, rotation, x, y);
if(once) Effects.renderEffect(id, renderer, color, lifetime, rotation, x, y);
}
public static class StaticEffect extends Effect{