Various blocks added / Crater map updated / Fixed status effect bugs

This commit is contained in:
Anuken
2019-01-23 20:08:28 -05:00
parent 895725df64
commit 9dd6a77c76
142 changed files with 1382 additions and 1194 deletions

View File

@@ -32,8 +32,8 @@ public class Blocks implements ContentList{
public static Block
//environment
air, part, spawn, space, metalfloor, deepwater, water, tar, stone, craters, blackstone, dirt, sand, ice, snow,
grass, shrub, rock, icerock, blackrock, rocks,
air, part, spawn, space, metalfloor, deepwater, water, tar, stone, craters, charr, blackstone, dirt, sand, ice, snow,
grass, shrub, rock, icerock, blackrock, rocks, pine,
//crafting
siliconSmelter, plastaniumCompressor, phaseWeaver, surgeSmelter, pyratiteMixer, blastMixer, cryofluidMixer,
@@ -156,6 +156,10 @@ public class Blocks implements ContentList{
minimapColor = Color.valueOf("323232");
}};
charr = new Floor("char"){{
minimapColor = Color.valueOf("323232");
}};
blackstone = new Floor("blackstone"){{
minimapColor = Color.valueOf("252525");
playerUnmineable = true;
@@ -208,6 +212,11 @@ public class Blocks implements ContentList{
variants = 2;
}};
pine = new StaticWall("pine"){{
//fillsTile = false;
variants = 0;
}};
//endregion
//region crafting

View File

@@ -10,6 +10,7 @@ import io.anuke.arc.math.Mathf;
import io.anuke.arc.util.Time;
import io.anuke.arc.util.Tmp;
import io.anuke.mindustry.entities.Damage;
import io.anuke.mindustry.entities.Unit;
import io.anuke.mindustry.entities.bullet.*;
import io.anuke.mindustry.entities.effect.Fire;
import io.anuke.mindustry.entities.effect.Lightning;
@@ -48,7 +49,7 @@ public class Bullets implements ContentList{
fireball, basicFlame, fuseShot, driverBolt, healBullet, frag,
//bombs
bombExplosive, bombIncendiary, bombOil;
bombExplosive, bombIncendiary, bombOil, explode;
@Override
public void load(){
@@ -413,6 +414,8 @@ public class Bullets implements ContentList{
lifetime = 35f;
pierce = true;
drag = 0.05f;
statusDuration = 60f * 4;
shootEffect = Fx.shootSmallFlame;
hitEffect = Fx.hitFlameSmall;
despawnEffect = Fx.none;
status = StatusEffects.burning;
@@ -639,5 +642,34 @@ public class Bullets implements ContentList{
}
}
};
explode = new BombBulletType(2f, 3f, "clear"){{
hitEffect = Fx.pulverize;
lifetime = 20f;
speed = 1f;
splashDamageRadius = 60f;
splashDamage = 30f;
}
@Override
public void init(Bullet b){
if(b.getOwner() instanceof Unit){
Unit unit = (Unit)b.getOwner();
unit.damage(unit.maxHealth() + 1);
}
b.time(b.lifetime());
}
@Override
public void hit(Bullet b, float x, float y){
super.hit(b, x, y);
for(int i = 0; i < 3; i++){
Tile tile = world.tileWorld(x + Mathf.range(8f), y + Mathf.range(8f));
Puddle.deposit(tile, Liquids.oil, 5f);
}
}
};
}
}

View File

@@ -665,10 +665,10 @@ public class Fx implements ContentList{
Draw.reset();
});
shootSmallFlame = new Effect(30f, e -> {
shootSmallFlame = new Effect(32f, e -> {
Draw.color(Palette.lightFlame, Palette.darkFlame, Color.GRAY, e.fin());
Angles.randLenVectors(e.id, 8, e.finpow() * 36f, e.rotation, 10f, (x, y) -> {
Angles.randLenVectors(e.id, 8, e.finpow() * 44f, e.rotation, 10f, (x, y) -> {
Fill.circle(e.x + x, e.y + y, 0.65f + e.fout() * 1.5f);
});

View File

@@ -9,7 +9,7 @@ public class UnitTypes implements ContentList{
public static UnitType
spirit, phantom,
wraith, ghoul, revenant,
dagger, titan, fortress;
dagger, crawler, titan, fortress;
@Override
public void load(){
@@ -33,6 +33,16 @@ public class UnitTypes implements ContentList{
health = 130;
}};
crawler = new UnitType("crawler", Crawler.class, Crawler::new){{
maxVelocity = 1.1f;
speed = 0.22f;
drag = 0.4f;
hitsize = 8f;
mass = 1.75f;
weapon = Weapons.suicideBomb;
health = 100;
}};
titan = new UnitType("titan", Titan.class, Titan::new){{
maxVelocity = 0.8f;
speed = 0.18f;

View File

@@ -5,7 +5,7 @@ import io.anuke.mindustry.type.Weapon;
public class Weapons implements ContentList{
public static Weapon blaster, blasterSmall, glaiveBlaster, droneBlaster, healBlaster, healBlasterDrone, chainBlaster, shockgun,
swarmer, bomber, bomberTrident, flakgun, flamethrower, missiles, artillery, laserBurster, healBlasterDrone2;
swarmer, bomber, bomberTrident, flakgun, flamethrower, missiles, artillery, laserBurster, healBlasterDrone2, suicideBomb;
@Override
public void load(){
@@ -127,6 +127,12 @@ public class Weapons implements ContentList{
ammo = Bullets.artilleryUnit;
}};
suicideBomb = new Weapon("bomber"){{
reload = 12f;
ejectEffect = Fx.none;
ammo = Bullets.explode;
}};
bomber = new Weapon("bomber"){{
length = 0f;
width = 2f;

View File

@@ -59,6 +59,8 @@ public class Zones implements ContentList{
}};
craters = new Zone("craters", new MapGenerator("craters", 1){{ distortion = 1.44f; }}){{ //TODO implement
alwaysUnlocked = true;
deployCost = ItemStack.with(Items.copper, 300);
startingItems = ItemStack.with(Items.copper, 200);
conditionWave = 15;
@@ -68,7 +70,39 @@ public class Zones implements ContentList{
rules = () -> new Rules(){{
waves = true;
waveTimer = true;
waveSpacing = 60 * 80;
waveSpacing = 60 * 60;
spawns = Array.with(
new SpawnGroup(UnitTypes.dagger){{
unitScaling = 2;
}},
new SpawnGroup(UnitTypes.crawler){{
begin = 5;
unitAmount = 2;
spacing = 2;
unitScaling = 2;
}},
new SpawnGroup(UnitTypes.dagger){{
begin = 10;
unitScaling = 1;
}},
new SpawnGroup(UnitTypes.crawler){{
begin = 15;
unitScaling = 1;
}},
new SpawnGroup(UnitTypes.dagger){{
begin = 20;
unitScaling = 1;
}},
new SpawnGroup(UnitTypes.crawler){{
begin = 25;
unitScaling = 1;
}}
);
}};
}};

View File

@@ -450,7 +450,7 @@ public class World implements ApplicationListener{
for(int x = 0; x < tiles.length; x++){
for(int y = 0; y < tiles[0].length; y++){
Tile tile = tiles[x][y];
if(tile.block().solid && !tile.block().update){
if(tile.block().solid && !tile.block().update && tile.block().fillsTile){
dark[x][y] = darkIterations;
}
}

View File

@@ -94,6 +94,10 @@ public class Bullet extends SolidEntity implements DamageTrait, ScaleTrait, Pool
create(type, null, Team.none, x, y, angle);
}
public Entity getOwner(){
return owner;
}
public boolean collidesTiles(){
return type.collidesTiles;
}

View File

@@ -0,0 +1,6 @@
package io.anuke.mindustry.entities.units.types;
import io.anuke.mindustry.entities.units.GroundUnit;
public class Crawler extends GroundUnit{
}

View File

@@ -114,10 +114,6 @@ public class FloorRenderer{
cbatch.endDraw();
}
public void updateFloor(Tile tile){
//TODO: implement
}
public void drawLayer(CacheLayer layer){
if(cache == null){
return;
@@ -190,7 +186,7 @@ public class FloorRenderer{
if(tile.block().cacheLayer == layer && layer == CacheLayer.walls){
tile.block().draw(tile);
}else if(floor.cacheLayer == layer && tile.block().cacheLayer != CacheLayer.walls){
}else if(floor.cacheLayer == layer && (tile.block().cacheLayer != CacheLayer.walls || !tile.block().fillsTile)){
floor.draw(tile);
}
}
@@ -205,7 +201,7 @@ public class FloorRenderer{
int chunksx = Mathf.ceil((float) (world.width()) / chunksize),
chunksy = Mathf.ceil((float) (world.height()) / chunksize) ;
cache = new Chunk[chunksx][chunksy];
SpriteCache sprites = new SpriteCache(world.width() * world.height(), (world.width() / chunksize) * (world.height() / chunksize) * 2, false);
SpriteCache sprites = new SpriteCache(world.width() * world.height() * 2, (world.width() / chunksize) * (world.height() / chunksize) * 2, false);
cbatch = new CacheBatch(sprites);
Time.mark();

View File

@@ -72,7 +72,7 @@ public class MapIO{
LegacyBlock block = LegacyColorMapper.get(color);
data.write(x, y, DataPosition.floor, block.floor.id);
data.write(x, y, DataPosition.elevation, (byte)block.elevation);
data.write(x, y, DataPosition.elevation, (byte)0);
//place spawn
if(color == Color.rgba8888(Color.RED)){

View File

@@ -50,7 +50,7 @@ public class StatusEffect extends Content{
}
if(effect != Fx.none && Mathf.chance(Time.delta() * 0.15f)){
Effects.effect(Fx.overdriven, unit.x + Mathf.range(unit.getSize() / 2f), unit.y + Mathf.range(unit.getSize() / 2f));
Effects.effect(effect, unit.x + Mathf.range(unit.getSize() / 2f), unit.y + Mathf.range(unit.getSize() / 2f));
}
}

View File

@@ -26,7 +26,7 @@ public class DeployDialog extends FloatingDialog{
shown(this::setup);
}
void setup(){
public void setup(){
buttons.clear();
cont.clear();
@@ -106,8 +106,8 @@ public class DeployDialog extends FloatingDialog{
for(Zone other : zone.zoneRequirements){
r.addImage("icon-zone").padRight(4);
r.add(other.localizedName()).color(Color.LIGHT_GRAY);
r.addImage(data.isCompleted(zone) ? "icon-check-2" : "icon-cancel-2")
.color(data.isCompleted(zone) ? Color.LIGHT_GRAY : Color.SCARLET).padLeft(3);
r.addImage(data.isCompleted(other) ? "icon-check-2" : "icon-cancel-2")
.color(data.isCompleted(other) ? Color.LIGHT_GRAY : Color.SCARLET).padLeft(3);
r.row();
}
});
@@ -205,6 +205,10 @@ public class DeployDialog extends FloatingDialog{
}
boolean canUnlock(Zone zone){
if(data.isUnlocked(zone)){
return true;
}
for(Zone other : zone.zoneRequirements){
if(!data.isCompleted(other)){
return false;

View File

@@ -40,7 +40,7 @@ public class PausedDialog extends FloatingDialog{
cont.addButton("$back", this::hide).colspan(2).width(dw*2 + 20f);
cont.row();
cont.addButton("database", ui.database::show);
cont.addButton("$database", ui.database::show);
cont.addButton("$settings", ui.settings::show);
if(!world.isZone()){

View File

@@ -64,6 +64,7 @@ public class TechTreeDialog extends FloatingDialog{
}
shown(() -> checkNodes(root));
hidden(ui.deploy::setup);
addCloseButton();
}

View File

@@ -76,6 +76,8 @@ public class Block extends BlockStorage{
public int timers = 0;
/** Cache layer. Only used for 'cached' rendering. */
public CacheLayer cacheLayer = CacheLayer.normal;
/**Special flag; if false, floor will be drawn under this block even if it is cached.*/
public boolean fillsTile = true;
/** Layer to draw extra stuff on. */
public Layer layer = null;
/** Extra layer to draw extra extra stuff on. */
@@ -243,7 +245,7 @@ public class Block extends BlockStorage{
@Override
public TextureRegion getContentIcon(){
return icon(Icon.medium);
return icon(Icon.large);
}
@Override

View File

@@ -30,7 +30,7 @@ public class Rock extends Block{
@Override
public TextureRegion[] generateIcons(){
return new TextureRegion[]{Core.atlas.find(name + "1")};
return variants == 0 ? super.generateIcons() : new TextureRegion[]{Core.atlas.find(name + "1")};
}
@Override