mirror of
https://github.com/Anuken/Mindustry.git
synced 2025-07-11 00:07:46 +07:00
Implemented lightning tile damage
This commit is contained in:
@ -12,6 +12,7 @@ import io.anuke.mindustry.entities.Units;
|
|||||||
import io.anuke.mindustry.game.Team;
|
import io.anuke.mindustry.game.Team;
|
||||||
import io.anuke.mindustry.gen.Call;
|
import io.anuke.mindustry.gen.Call;
|
||||||
import io.anuke.mindustry.graphics.Palette;
|
import io.anuke.mindustry.graphics.Palette;
|
||||||
|
import io.anuke.mindustry.world.Tile;
|
||||||
import io.anuke.ucore.core.Effects;
|
import io.anuke.ucore.core.Effects;
|
||||||
import io.anuke.ucore.core.Effects.Effect;
|
import io.anuke.ucore.core.Effects.Effect;
|
||||||
import io.anuke.ucore.entities.EntityGroup;
|
import io.anuke.ucore.entities.EntityGroup;
|
||||||
@ -26,6 +27,7 @@ import io.anuke.ucore.util.Pooling;
|
|||||||
import io.anuke.ucore.util.SeedRandom;
|
import io.anuke.ucore.util.SeedRandom;
|
||||||
|
|
||||||
import static io.anuke.mindustry.Vars.bulletGroup;
|
import static io.anuke.mindustry.Vars.bulletGroup;
|
||||||
|
import static io.anuke.mindustry.Vars.world;
|
||||||
|
|
||||||
//TODO utterly broken
|
//TODO utterly broken
|
||||||
public class Lightning extends TimedEntity implements Poolable, DrawTrait{
|
public class Lightning extends TimedEntity implements Poolable, DrawTrait{
|
||||||
@ -109,6 +111,12 @@ public class Lightning extends TimedEntity implements Poolable, DrawTrait{
|
|||||||
createLighting(l.random.nextInt(), team, effect, color, damage, x2, y2, angle + l.random.range(30f), length / 3);
|
createLighting(l.random.nextInt(), team, effect, color, damage, x2, y2, angle + l.random.range(30f), length / 3);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Tile tile = world.tileWorld(x, y);
|
||||||
|
if(tile != null && tile.entity != null && tile.getTeamID() != team.ordinal()){
|
||||||
|
Effects.effect(effect, x, y, fangle);
|
||||||
|
tile.entity.damage(damage/4f);
|
||||||
|
}
|
||||||
|
|
||||||
x = x2;
|
x = x2;
|
||||||
y = y2;
|
y = y2;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user