Added phasewalls

This commit is contained in:
Anuken 2018-06-18 14:37:50 -04:00
parent ee2cba89d5
commit 80d0a1555a
9 changed files with 2235 additions and 1318 deletions

Binary file not shown.

Before

Width:  |  Height:  |  Size: 290 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 205 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 365 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 242 B

File diff suppressed because it is too large Load Diff

Binary file not shown.

Before

Width:  |  Height:  |  Size: 112 KiB

After

Width:  |  Height:  |  Size: 116 KiB

View File

@ -13,6 +13,7 @@ public class Recipes implements ContentList{
@Override
public void load (){
new Recipe(defense, DefenseBlocks.ironwall, new ItemStack(Items.iron, 12));
new Recipe(defense, DefenseBlocks.ironwalllarge, new ItemStack(Items.iron, 12));
new Recipe(defense, DefenseBlocks.steelwall, new ItemStack(Items.steel, 12));
new Recipe(defense, DefenseBlocks.titaniumwall, new ItemStack(Items.titanium, 12));
new Recipe(defense, DefenseBlocks.diriumwall, new ItemStack(Items.surgealloy, 12));
@ -23,6 +24,8 @@ public class Recipes implements ContentList{
new Recipe(defense, DefenseBlocks.largedoor, new ItemStack(Items.steel, 3 * 4), new ItemStack(Items.iron, 3 * 4 * 4));
new Recipe(defense, DefenseBlocks.deflectorwall, new ItemStack(Items.titanium, 1));
new Recipe(defense, DefenseBlocks.deflectorwalllarge, new ItemStack(Items.titanium, 1));
new Recipe(defense, DefenseBlocks.phasewall, new ItemStack(Items.titanium, 1));
new Recipe(defense, DefenseBlocks.phasewalllarge, new ItemStack(Items.titanium, 1));
new Recipe(distribution, DistributionBlocks.conveyor, new ItemStack(Items.iron, 1));
new Recipe(distribution, DistributionBlocks.steelconveyor, new ItemStack(Items.steel, 1));

View File

@ -6,19 +6,21 @@ import io.anuke.mindustry.world.Block;
import io.anuke.mindustry.world.blocks.Wall;
import io.anuke.mindustry.world.blocks.defense.DeflectorWall;
import io.anuke.mindustry.world.blocks.defense.Door;
import io.anuke.mindustry.world.blocks.defense.PhaseWall;
public class DefenseBlocks extends BlockList implements ContentList {
public static Block stonewall, ironwall, steelwall, titaniumwall, diriumwall, steelwalllarge, titaniumwalllarge, diriumwalllarge, door, largedoor, deflectorwall, deflectorwalllarge;
public static Block ironwall, ironwalllarge, steelwall, titaniumwall, diriumwall, steelwalllarge, titaniumwalllarge, diriumwalllarge, door, largedoor, deflectorwall, deflectorwalllarge,
phasewall, phasewalllarge;
@Override
public void load() {
int wallHealthMultiplier = 4;
stonewall = new Wall("stonewall") {{
health = 40 * wallHealthMultiplier;
ironwall = new Wall("ironwall") {{
health = 80 * wallHealthMultiplier;
}};
ironwall = new Wall("ironwall") {{
ironwalllarge = new Wall("ironwall-large") {{
health = 80 * wallHealthMultiplier;
}};
@ -58,6 +60,16 @@ public class DefenseBlocks extends BlockList implements ContentList {
size = 2;
}};
phasewall = new PhaseWall("phase-wall") {{
health = 150 * wallHealthMultiplier;
}};
phasewalllarge = new PhaseWall("phase-wall-large") {{
health = 150 * 4 * wallHealthMultiplier;
size = 2;
regenSpeed = 0.5f;
}};
door = new Door("door") {{
health = 90 * wallHealthMultiplier;
}};

View File

@ -0,0 +1,20 @@
package io.anuke.mindustry.world.blocks.defense;
import io.anuke.mindustry.world.Tile;
import io.anuke.mindustry.world.blocks.Wall;
import io.anuke.ucore.core.Timers;
import io.anuke.ucore.util.Mathf;
public class PhaseWall extends Wall {
protected float regenSpeed = 0.25f;
public PhaseWall(String name) {
super(name);
update = true;
}
@Override
public void update(Tile tile) {
tile.entity.health = Mathf.clamp(tile.entity.health + regenSpeed * Timers.delta(), 0f, health);
}
}