diff --git a/core/assets/maps/blankmap.png b/core/assets/maps/blankmap.png new file mode 100644 index 0000000000..52073f2a27 Binary files /dev/null and b/core/assets/maps/blankmap.png differ diff --git a/core/assets/maps/fortress.png b/core/assets/maps/fortress.png new file mode 100644 index 0000000000..d0d9eabca9 Binary files /dev/null and b/core/assets/maps/fortress.png differ diff --git a/core/src/io/anuke/mindustry/core/Control.java b/core/src/io/anuke/mindustry/core/Control.java index 7d78f2e6c6..993a4e48b5 100644 --- a/core/src/io/anuke/mindustry/core/Control.java +++ b/core/src/io/anuke/mindustry/core/Control.java @@ -465,7 +465,8 @@ public class Control extends Module{ if(Inputs.keyDown(Keys.SHIFT_LEFT)){ new HealerEnemy(0).set(player.x, player.y).add(); }else{ - new FortressEnemy(0).set(player.x, player.y).add(); + float px = player.x, py = player.y; + Timers.run(30f, ()->new BlastEnemy(0).set(px, py).add()); } } } diff --git a/core/src/io/anuke/mindustry/entities/effect/DamageArea.java b/core/src/io/anuke/mindustry/entities/effect/DamageArea.java index e49c0e988b..9ba2140c3f 100644 --- a/core/src/io/anuke/mindustry/entities/effect/DamageArea.java +++ b/core/src/io/anuke/mindustry/entities/effect/DamageArea.java @@ -14,7 +14,8 @@ public class DamageArea{ public static void damageEntities(float x, float y, float radius, int damage){ damage(true, x, y, radius, damage); - if(!Vars.android){ + + if(!Vars.android && Vars.player.distanceTo(x, y) < radius){ Player player = Vars.player; int amount = calculateDamage(x, y, player.x, player.y, radius, damage); player.damage(amount); @@ -46,7 +47,7 @@ public class DamageArea{ } } - if(!Vars.android){ + if(!Vars.android && Vars.player.distanceTo(x, y) < radius){ Player player = Vars.player; int amount = calculateDamage(x, y, player.x, player.y, radius, damage); player.damage(amount); diff --git a/core/src/io/anuke/mindustry/entities/enemies/BlastEnemy.java b/core/src/io/anuke/mindustry/entities/enemies/BlastEnemy.java index 9bf13cc50d..9a40debd03 100644 --- a/core/src/io/anuke/mindustry/entities/enemies/BlastEnemy.java +++ b/core/src/io/anuke/mindustry/entities/enemies/BlastEnemy.java @@ -14,6 +14,7 @@ public class BlastEnemy extends Enemy{ bullet = null; turretrotatespeed = 0f; mass = 0.8f; + stopNearCore = false; heal(); } diff --git a/core/src/io/anuke/mindustry/entities/enemies/Enemy.java b/core/src/io/anuke/mindustry/entities/enemies/Enemy.java index 539648be3c..e87552cb22 100644 --- a/core/src/io/anuke/mindustry/entities/enemies/Enemy.java +++ b/core/src/io/anuke/mindustry/entities/enemies/Enemy.java @@ -36,6 +36,7 @@ public class Enemy extends DestructibleEntity{ protected int spawned = 0; protected float angle; protected boolean targetCore = false; + protected boolean stopNearCore = true; protected float mass = 1f; public int spawn; @@ -63,7 +64,7 @@ public class Enemy extends DestructibleEntity{ void move(){ Tile core = Vars.control.getCore(); - boolean nearCore = distanceTo(core.worldx(), core.worldy()) <= range - 18f; + boolean nearCore = distanceTo(core.worldx(), core.worldy()) <= range - 18f && stopNearCore; Vector2 vec; diff --git a/core/src/io/anuke/mindustry/world/Map.java b/core/src/io/anuke/mindustry/world/Map.java index 95bbdf52f7..6ab0013d87 100644 --- a/core/src/io/anuke/mindustry/world/Map.java +++ b/core/src/io/anuke/mindustry/world/Map.java @@ -6,18 +6,19 @@ public enum Map{ canyon("the canyon"), maze("it's okay."), volcano("desc"), + fortress("desc", true), tutorial(false), test1(false), test2(false); public final boolean visible; - public final boolean sandbox; public final String description; + public final boolean flipBase; public int width, height; private Map(boolean visible){ this.visible = visible; - this.sandbox = false; + this.flipBase = false; this.description = "Test map!"; } @@ -25,9 +26,9 @@ public enum Map{ this(description, false); } - private Map(String description, boolean sandbox){ + private Map(String description, boolean flipBase){ this.visible = true; - this.sandbox = sandbox; + this.flipBase = flipBase; this.description = description; } } diff --git a/core/src/io/anuke/mindustry/world/World.java b/core/src/io/anuke/mindustry/world/World.java index fff4ef6546..e2891fd724 100644 --- a/core/src/io/anuke/mindustry/world/World.java +++ b/core/src/io/anuke/mindustry/world/World.java @@ -184,26 +184,28 @@ public class World extends Module{ void setDefaultBlocks(){ int x = control.getCore().x, y = control.getCore().y; + int flip = Mathf.sign(!currentMap.flipBase); + int fr = currentMap.flipBase ? 2 : 0; - set(x, y-2, DistributionBlocks.conveyor, 1); - set(x, y-3, DistributionBlocks.conveyor, 1); + set(x, y-2*flip, DistributionBlocks.conveyor, 1 + fr); + set(x, y-3*flip, DistributionBlocks.conveyor, 1 + fr); for(int i = 0; i < 2; i ++){ int d = Mathf.sign(i-0.5f); - set(x+2*d, y-2, ProductionBlocks.stonedrill, d); - set(x+2*d, y-1, DistributionBlocks.conveyor, 1); - set(x+2*d, y, DistributionBlocks.conveyor, 1); - set(x+2*d, y+1, WeaponBlocks.doubleturret, 0); + set(x+2*d, y-2*flip, ProductionBlocks.stonedrill, d); + set(x+2*d, y-1*flip, DistributionBlocks.conveyor, 1 + fr); + set(x+2*d, y, DistributionBlocks.conveyor, 1 + fr); + set(x+2*d, y+1*flip, WeaponBlocks.doubleturret, 0 + fr); - set(x+1*d, y-3, DistributionBlocks.conveyor, 2*d); - set(x+2*d, y-3, DistributionBlocks.conveyor, 2*d); - set(x+2*d, y-4, DistributionBlocks.conveyor, 1); - set(x+2*d, y-5, DistributionBlocks.conveyor, 1); + set(x+1*d, y-3*flip, DistributionBlocks.conveyor, 2*d); + set(x+2*d, y-3*flip, DistributionBlocks.conveyor, 2*d); + set(x+2*d, y-4*flip, DistributionBlocks.conveyor, 1 + fr); + set(x+2*d, y-5*flip, DistributionBlocks.conveyor, 1 + fr); - set(x+3*d, y-5, ProductionBlocks.stonedrill, 0); - set(x+3*d, y-4, ProductionBlocks.stonedrill, 0); - set(x+3*d, y-3, ProductionBlocks.stonedrill, 0); + set(x+3*d, y-5*flip, ProductionBlocks.stonedrill, 0 + fr); + set(x+3*d, y-4*flip, ProductionBlocks.stonedrill, 0 + fr); + set(x+3*d, y-3*flip, ProductionBlocks.stonedrill, 0 + fr); } } diff --git a/core/src/io/anuke/mindustry/world/blocks/types/production/NuclearReactor.java b/core/src/io/anuke/mindustry/world/blocks/types/production/NuclearReactor.java index e0bcacbf29..bd1879e331 100644 --- a/core/src/io/anuke/mindustry/world/blocks/types/production/NuclearReactor.java +++ b/core/src/io/anuke/mindustry/world/blocks/types/production/NuclearReactor.java @@ -87,6 +87,12 @@ public class NuclearReactor extends LiquidItemPowerGenerator{ public void onDestroyed(Tile tile){ super.onDestroyed(tile); + NuclearReactorEntity entity = tile.entity(); + + int fuel = entity.getItem(generateItem); + + if(fuel < 5) return; + int waves = 6; float delay = 8f;