Added phase walls
|
Before Width: | Height: | Size: 192 B After Width: | Height: | Size: 280 B |
|
Before Width: | Height: | Size: 115 B After Width: | Height: | Size: 164 B |
|
Before Width: | Height: | Size: 157 B After Width: | Height: | Size: 286 B |
|
Before Width: | Height: | Size: 98 B After Width: | Height: | Size: 158 B |
|
Before Width: | Height: | Size: 128 B After Width: | Height: | Size: 229 B |
@@ -459,11 +459,11 @@ block.rock.name=rock
|
||||
block.blackrock.name=blackrock
|
||||
block.icerock.name=icerock
|
||||
block.copper-wall.name=Copper Wall
|
||||
block.copper-wall-large.name=Large Tungsten Wall
|
||||
block.copper-wall-large.name=Large Copper Wall
|
||||
block.composite-wall.name=Composite Wall
|
||||
block.composite-wall-large.name=Large Composite Wall
|
||||
block.phase-wall.name=Composite Wall
|
||||
block.phase-wall-large.name=Large Composite Wall
|
||||
block.phase-wall.name=Phase Wall
|
||||
block.phase-wall-large.name=Large Phase Wall
|
||||
block.thorium-wall.name=Thorium Wall
|
||||
block.thorium-wall-large.name=Large Thorium Wall
|
||||
block.door.name=Door
|
||||
|
||||
|
Before Width: | Height: | Size: 136 KiB After Width: | Height: | Size: 138 KiB |
@@ -24,8 +24,8 @@ public class Recipes implements ContentList{
|
||||
new Recipe(defense, DefenseBlocks.thoriumWallLarge, new ItemStack(Items.thorium, 12 * 4));
|
||||
|
||||
//TODO will be added once sprites are ready
|
||||
//new Recipe(defense, DefenseBlocks.phaseWall, new ItemStack(Items.phasematter, 12));
|
||||
//new Recipe(defense, DefenseBlocks.phaseWallLarge, new ItemStack(Items.phasematter, 12 * 4));
|
||||
new Recipe(defense, DefenseBlocks.phaseWall, new ItemStack(Items.phasematter, 12));
|
||||
new Recipe(defense, DefenseBlocks.phaseWallLarge, new ItemStack(Items.phasematter, 12 * 4));
|
||||
|
||||
new Recipe(defense, DefenseBlocks.door, new ItemStack(Items.densealloy, 12), new ItemStack(Items.silicon, 8));
|
||||
new Recipe(defense, DefenseBlocks.doorLarge, new ItemStack(Items.densealloy, 12 * 4), new ItemStack(Items.silicon, 8 * 4));
|
||||
|
||||
@@ -6,7 +6,6 @@ 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 copperWall, copperWallLarge, compositeWall, compositeWallLarge, thoriumWall, thoriumWallLarge, door, doorLarge, deflectorwall, deflectorwalllarge,
|
||||
@@ -52,14 +51,13 @@ public class DefenseBlocks extends BlockList implements ContentList{
|
||||
size = 2;
|
||||
}};
|
||||
|
||||
phaseWall = new PhaseWall("phase-wall"){{
|
||||
phaseWall = new DeflectorWall("phase-wall"){{
|
||||
health = 150 * wallHealthMultiplier;
|
||||
}};
|
||||
|
||||
phaseWallLarge = new PhaseWall("phase-wall-large"){{
|
||||
phaseWallLarge = new DeflectorWall("phase-wall-large"){{
|
||||
health = 150 * 4 * wallHealthMultiplier;
|
||||
size = 2;
|
||||
regenSpeed = 0.5f;
|
||||
}};
|
||||
|
||||
door = new Door("door"){{
|
||||
|
||||
@@ -17,9 +17,9 @@ import io.anuke.ucore.util.Physics;
|
||||
import static io.anuke.mindustry.Vars.tilesize;
|
||||
|
||||
public class DeflectorWall extends Wall{
|
||||
static final float hitTime = 10f;
|
||||
public static final float hitTime = 10f;
|
||||
|
||||
protected float maxDamageDeflect = 5f;
|
||||
protected float maxDamageDeflect = 10f;
|
||||
protected Rectangle rect = new Rectangle();
|
||||
|
||||
public DeflectorWall(String name){
|
||||
@@ -81,7 +81,7 @@ public class DeflectorWall extends Wall{
|
||||
return new DeflectorEntity();
|
||||
}
|
||||
|
||||
static class DeflectorEntity extends TileEntity{
|
||||
public static class DeflectorEntity extends TileEntity{
|
||||
public float hit;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,10 +1,18 @@
|
||||
package io.anuke.mindustry.world.blocks.defense;
|
||||
|
||||
import com.badlogic.gdx.graphics.Color;
|
||||
import io.anuke.mindustry.entities.TileEntity;
|
||||
import io.anuke.mindustry.entities.bullet.Bullet;
|
||||
import io.anuke.mindustry.world.Tile;
|
||||
import io.anuke.mindustry.world.blocks.Wall;
|
||||
import io.anuke.mindustry.world.blocks.defense.DeflectorWall.DeflectorEntity;
|
||||
import io.anuke.ucore.core.Graphics;
|
||||
import io.anuke.ucore.core.Timers;
|
||||
import io.anuke.ucore.graphics.Draw;
|
||||
import io.anuke.ucore.util.Mathf;
|
||||
|
||||
import static io.anuke.mindustry.Vars.tilesize;
|
||||
|
||||
public class PhaseWall extends Wall{
|
||||
protected float regenSpeed = 0.25f;
|
||||
|
||||
@@ -13,8 +21,39 @@ public class PhaseWall extends Wall{
|
||||
update = true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void handleBulletHit(TileEntity entity, Bullet bullet){
|
||||
super.handleBulletHit(entity, bullet);
|
||||
((DeflectorEntity) entity).hit = 1f;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void draw(Tile tile){
|
||||
super.draw(tile);
|
||||
|
||||
DeflectorEntity entity = tile.entity();
|
||||
|
||||
if(entity.hit < 0.0001f) return;
|
||||
|
||||
Graphics.setAdditiveBlending();
|
||||
|
||||
Draw.color(Color.WHITE);
|
||||
Draw.alpha(entity.hit * 0.5f);
|
||||
Draw.rect("blank", tile.drawx(), tile.drawy(), tilesize * size, tilesize * size);
|
||||
Draw.reset();
|
||||
|
||||
entity.hit = Mathf.clamp(entity.hit - Timers.delta() / DeflectorWall.hitTime);
|
||||
|
||||
Graphics.setNormalBlending();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void update(Tile tile){
|
||||
tile.entity.health = Mathf.clamp(tile.entity.health + regenSpeed * Timers.delta(), 0f, health);
|
||||
}
|
||||
|
||||
@Override
|
||||
public TileEntity getEntity(){
|
||||
return new DeflectorEntity();
|
||||
}
|
||||
}
|
||||
|
||||