Moved unit-related classes, added base flying types

This commit is contained in:
Anuken
2018-04-22 17:40:23 -04:00
parent 5aa995b5ef
commit aa83510fbe
19 changed files with 84 additions and 24 deletions

View File

@@ -114,7 +114,10 @@ public class Recipes {
new Recipe(liquid, LiquidBlocks.pump, stack(Items.steel, 10)),
new Recipe(liquid, LiquidBlocks.fluxpump, stack(Items.steel, 10), stack(Items.densealloy, 5)),
new Recipe(units, UnitBlocks.flierFactory, stack(Items.steel, 10)),
new Recipe(units, UnitBlocks.droneFactory, stack(Items.steel, 10)),
new Recipe(units, UnitBlocks.vtolFactory, stack(Items.steel, 10)),
new Recipe(units, UnitBlocks.droneFactory, stack(Items.steel, 10)),
new Recipe(units, UnitBlocks.droneFactory, stack(Items.steel, 10)),
new Recipe(units, UnitBlocks.walkerFactory, stack(Items.steel, 10)),
new Recipe(units, DebugBlocks.itemSource, stack(Items.steel, 10)).setDebug(),

View File

@@ -1,12 +1,13 @@
package io.anuke.mindustry.content;
import io.anuke.mindustry.entities.units.UnitType;
import io.anuke.mindustry.entities.units.types.Flier;
import io.anuke.mindustry.entities.units.types.Vtol;
import io.anuke.mindustry.entities.units.types.Scout;
public class UnitTypes {
public static final UnitType
drone = new Vtol(),
scout = new Scout(),
flier = new Flier();
vtol = new Vtol();
}

View File

@@ -4,13 +4,22 @@ import io.anuke.mindustry.content.Items;
import io.anuke.mindustry.content.UnitTypes;
import io.anuke.mindustry.resource.ItemStack;
import io.anuke.mindustry.world.Block;
import io.anuke.mindustry.world.blocks.types.production.UnitFactory;
import io.anuke.mindustry.world.blocks.types.units.UnitFactory;
public class UnitBlocks {
public static final Block
flierFactory = new UnitFactory("flierfactory"){{
type = UnitTypes.flier;
droneFactory = new UnitFactory("dronefactory"){{
type = UnitTypes.drone;
produceTime = 200;
size = 2;
requirements = new ItemStack[]{
new ItemStack(Items.stone, 5)
};
}},
vtolFactory = new UnitFactory("vtolfactory"){{
type = UnitTypes.vtol;
produceTime = 200;
size = 2;
requirements = new ItemStack[]{

View File

@@ -123,7 +123,7 @@ public class TurretBullets {
hiteffect = BulletFx.hitLancer;
despawneffect = Fx.none;
hitsize = 4;
lifetime = 20f;
lifetime = 16f;
pierce = true;
}
@@ -134,12 +134,15 @@ public class TurretBullets {
@Override
public void draw(Bullet b) {
Lines.lineAngle(b.x, b.y, b.angle(), length);
float f = Mathf.curve(b.fin(), 0f, 0.2f);
float baseLen = length * f;
Lines.lineAngle(b.x, b.y, b.angle(), baseLen);
for(int s = 0; s < 3; s ++) {
Draw.color(colors[s]);
for (int i = 0; i < tscales.length; i++) {
Lines.stroke(7f * b.fout() * (s == 0 ? 1.5f : s == 1 ? 1f : 0.3f) * tscales[i]);
Lines.lineAngle(b.x, b.y, b.angle(), length * lenscales[i]);
Lines.lineAngle(b.x, b.y, b.angle(), baseLen * lenscales[i]);
}
}
Draw.reset();