Added new map

This commit is contained in:
Anuken 2017-11-29 23:20:15 -05:00
parent 6fb5cb839e
commit ff993a353d
9 changed files with 34 additions and 21 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 757 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.4 KiB

View File

@ -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());
}
}
}

View File

@ -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);

View File

@ -14,6 +14,7 @@ public class BlastEnemy extends Enemy{
bullet = null;
turretrotatespeed = 0f;
mass = 0.8f;
stopNearCore = false;
heal();
}

View File

@ -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;

View File

@ -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;
}
}

View File

@ -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);
}
}

View File

@ -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;