Implemented nuclear reactor functionality and explosiveness
This commit is contained in:
@@ -12,7 +12,6 @@ import io.anuke.mindustry.entities.enemies.Enemy;
|
||||
import io.anuke.mindustry.resource.Item;
|
||||
import io.anuke.mindustry.world.Block;
|
||||
import io.anuke.mindustry.world.Tile;
|
||||
import io.anuke.mindustry.world.blocks.Blocks;
|
||||
import io.anuke.mindustry.world.blocks.ProductionBlocks;
|
||||
import io.anuke.mindustry.world.blocks.types.Wall;
|
||||
import io.anuke.ucore.core.Effects;
|
||||
@@ -63,11 +62,8 @@ public class TileEntity extends Entity{
|
||||
Block block = tile.block();
|
||||
|
||||
block.onDestroyed(tile);
|
||||
for(Tile other : tile.getLinkedTiles()){
|
||||
other.setBlock(Blocks.air);
|
||||
}
|
||||
|
||||
tile.setBlock(Blocks.air);
|
||||
Vars.world.removeBlock(tile);
|
||||
}
|
||||
|
||||
public void collision(Bullet other){
|
||||
@@ -105,6 +101,10 @@ public class TileEntity extends Entity{
|
||||
return sum;
|
||||
}
|
||||
|
||||
public int getItem(Item item){
|
||||
return items.get(item, 0);
|
||||
}
|
||||
|
||||
public boolean hasItem(Item item){
|
||||
return items.get(item, 0) > 0;
|
||||
}
|
||||
|
||||
@@ -3,6 +3,7 @@ package io.anuke.mindustry.entities.effect;
|
||||
import com.badlogic.gdx.math.Vector2;
|
||||
|
||||
import io.anuke.mindustry.Vars;
|
||||
import io.anuke.mindustry.entities.Player;
|
||||
import io.anuke.mindustry.entities.enemies.Enemy;
|
||||
import io.anuke.mindustry.world.Tile;
|
||||
import io.anuke.ucore.entities.Entities;
|
||||
@@ -11,6 +12,15 @@ import io.anuke.ucore.util.Mathf;
|
||||
//TODO
|
||||
public class DamageArea{
|
||||
|
||||
public static void damageEntities(float x, float y, float radius, int damage){
|
||||
damage(true, x, y, radius, damage);
|
||||
if(!Vars.android){
|
||||
Player player = Vars.player;
|
||||
int amount = calculateDamage(x, y, player.x, player.y, radius, damage);
|
||||
player.damage(amount);
|
||||
}
|
||||
}
|
||||
|
||||
public static void damage(boolean enemies, float x, float y, float radius, int damage){
|
||||
|
||||
if(enemies){
|
||||
@@ -35,6 +45,12 @@ public class DamageArea{
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if(!Vars.android){
|
||||
Player player = Vars.player;
|
||||
int amount = calculateDamage(x, y, player.x, player.y, radius, damage);
|
||||
player.damage(amount);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -26,6 +26,33 @@ public class Fx{
|
||||
});
|
||||
}),
|
||||
|
||||
reactorsmoke = new Effect(17, e -> {
|
||||
Angles.randLenVectors(e.id, 4, e.ifract()*8f, (x, y)->{
|
||||
float size = 1f+e.fract()*5f;
|
||||
Draw.color(Color.LIGHT_GRAY, Color.GRAY, e.ifract());
|
||||
Draw.rect("circle", e.x + x, e.y + y, size, size);
|
||||
Draw.reset();
|
||||
});
|
||||
}),
|
||||
|
||||
nuclearsmoke = new Effect(40, e -> {
|
||||
Angles.randLenVectors(e.id, 4, e.ifract()*13f, (x, y)->{
|
||||
float size = e.sfract()*4f;
|
||||
Draw.color(Color.LIGHT_GRAY, Color.GRAY, e.ifract());
|
||||
Draw.rect("circle", e.x + x, e.y + y, size, size);
|
||||
Draw.reset();
|
||||
});
|
||||
}),
|
||||
|
||||
nuclearcloud = new Effect(90, e -> {
|
||||
Angles.randLenVectors(e.id, 10, e.powfract()*90f, (x, y)->{
|
||||
float size = e.fract()*14f;
|
||||
Draw.color(Color.LIME, Color.GRAY, e.ifract());
|
||||
Draw.rect("circle", e.x + x, e.y + y, size, size);
|
||||
Draw.reset();
|
||||
});
|
||||
}),
|
||||
|
||||
chainshot = new Effect(9f, e -> {
|
||||
Draw.color(Color.WHITE, lightOrange, e.ifract());
|
||||
Draw.thick(e.fract()*4f);
|
||||
@@ -86,6 +113,13 @@ public class Fx{
|
||||
Draw.reset();
|
||||
}),
|
||||
|
||||
nuclearShockwave = new Effect(10f, e -> {
|
||||
Draw.color(Color.WHITE, Color.LIGHT_GRAY, e.ifract());
|
||||
Draw.thick(e.fract()*3f + 0.2f);
|
||||
Draw.polygon(40, e.x, e.y, e.ifract()*140f);
|
||||
Draw.reset();
|
||||
}),
|
||||
|
||||
shockwaveSmall = new Effect(10f, e -> {
|
||||
Draw.color(Color.WHITE, Color.LIGHT_GRAY, e.ifract());
|
||||
Draw.thick(e.fract()*2f + 0.1f);
|
||||
|
||||
@@ -17,7 +17,7 @@ import io.anuke.ucore.util.Mathf;
|
||||
|
||||
public class Shield extends Entity{
|
||||
public boolean active;
|
||||
public boolean hitPlayers = true;
|
||||
public boolean hitPlayers = false;
|
||||
|
||||
private float uptime = 0f;
|
||||
private final Tile tile;
|
||||
|
||||
Reference in New Issue
Block a user