Meltdown prototype
This commit is contained in:
@@ -35,7 +35,7 @@ public class Recipes implements ContentList{
|
||||
new Recipe(defense, DefenseBlocks.surgeWallLarge, new ItemStack(Items.surgealloy, 12 * 4));
|
||||
|
||||
//projectors
|
||||
new Recipe(defense, DefenseBlocks.mendProjector, new ItemStack(Items.lead, 200), new ItemStack(Items.densealloy, 150), new ItemStack(Items.titanium, 150), new ItemStack(Items.silicon, 250));
|
||||
new Recipe(defense, DefenseBlocks.mendProjector, new ItemStack(Items.lead, 200), new ItemStack(Items.densealloy, 150), new ItemStack(Items.titanium, 50), new ItemStack(Items.silicon, 250));
|
||||
new Recipe(defense, DefenseBlocks.overdriveProjector, new ItemStack(Items.lead, 200), new ItemStack(Items.densealloy, 150), new ItemStack(Items.titanium, 150), new ItemStack(Items.silicon, 250));
|
||||
new Recipe(defense, DefenseBlocks.forceProjector, new ItemStack(Items.lead, 200), new ItemStack(Items.densealloy, 150), new ItemStack(Items.titanium, 150), new ItemStack(Items.silicon, 250));
|
||||
|
||||
|
||||
@@ -57,7 +57,7 @@ public class CraftingBlocks extends BlockList implements ContentList{
|
||||
plastaniumCompressor = new PlastaniumCompressor("plastanium-compressor"){{
|
||||
hasItems = true;
|
||||
liquidCapacity = 60f;
|
||||
craftTime = 80f;
|
||||
craftTime = 60f;
|
||||
output = Items.plastanium;
|
||||
itemCapacity = 30;
|
||||
size = 2;
|
||||
@@ -67,7 +67,7 @@ public class CraftingBlocks extends BlockList implements ContentList{
|
||||
updateEffect = BlockFx.plasticburn;
|
||||
|
||||
consumes.liquid(Liquids.oil, 0.25f);
|
||||
consumes.power(0.25f);
|
||||
consumes.power(0.3f);
|
||||
consumes.item(Items.titanium, 2);
|
||||
}};
|
||||
|
||||
|
||||
@@ -19,7 +19,7 @@ public class LiquidBlocks extends BlockList implements ContentList{
|
||||
|
||||
rotaryPump = new Pump("rotary-pump"){{
|
||||
shadow = "shadow-rounded-2";
|
||||
pumpAmount = 0.25f;
|
||||
pumpAmount = 0.2f;
|
||||
consumes.power(0.015f);
|
||||
liquidCapacity = 30f;
|
||||
powerCapacity = 20f;
|
||||
@@ -30,7 +30,7 @@ public class LiquidBlocks extends BlockList implements ContentList{
|
||||
|
||||
thermalPump = new Pump("thermal-pump"){{
|
||||
shadow = "shadow-rounded-2";
|
||||
pumpAmount = 0.55f;
|
||||
pumpAmount = 0.3f;
|
||||
consumes.power(0.03f);
|
||||
liquidCapacity = 40f;
|
||||
hasPower = true;
|
||||
|
||||
@@ -22,7 +22,7 @@ public class PowerBlocks extends BlockList implements ContentList{
|
||||
thermalGenerator = new LiquidHeatGenerator("thermal-generator"){{
|
||||
maxLiquidGenerate = 0.5f;
|
||||
powerCapacity = 40f;
|
||||
powerPerLiquid = 1.5f;
|
||||
powerPerLiquid = 1f;
|
||||
generateEffect = BlockFx.redgeneratespark;
|
||||
size = 2;
|
||||
}};
|
||||
|
||||
@@ -216,7 +216,7 @@ public class TurretBlocks extends BlockList implements ContentList{
|
||||
|
||||
spectre = new DoubleTurret("spectre"){{
|
||||
ammoTypes = new AmmoType[]{AmmoTypes.bulletDenseBig, AmmoTypes.bulletPyratiteBig, AmmoTypes.bulletThoriumBig};
|
||||
reload = 4f;
|
||||
reload = 6f;
|
||||
coolantMultiplier = 0.5f;
|
||||
maxCoolantUsed = 1.5f;
|
||||
restitution = 0.1f;
|
||||
@@ -236,12 +236,16 @@ public class TurretBlocks extends BlockList implements ContentList{
|
||||
|
||||
meltdown = new LaserTurret("meltdown"){{
|
||||
shootType = AmmoTypes.meltdownLaser;
|
||||
shootEffect = ShootFx.shootBigSmoke2;
|
||||
shootCone = 40f;
|
||||
recoil = 4f;
|
||||
size = 4;
|
||||
shootShake = 2f;
|
||||
powerUsed = 10f;
|
||||
range = 140f;
|
||||
reload = 60f;
|
||||
shootDuration = 60f;
|
||||
range = 160f;
|
||||
reload = 130f;
|
||||
firingMoveFract = 0.25f;
|
||||
shootDuration = 180f;
|
||||
powerCapacity = 50f;
|
||||
}};
|
||||
}
|
||||
|
||||
@@ -20,10 +20,7 @@ import io.anuke.mindustry.world.Tile;
|
||||
import io.anuke.mindustry.world.blocks.distribution.MassDriver.DriverBulletData;
|
||||
import io.anuke.ucore.core.Effects;
|
||||
import io.anuke.ucore.core.Timers;
|
||||
import io.anuke.ucore.graphics.Draw;
|
||||
import io.anuke.ucore.graphics.Fill;
|
||||
import io.anuke.ucore.graphics.Lines;
|
||||
import io.anuke.ucore.graphics.Shapes;
|
||||
import io.anuke.ucore.graphics.*;
|
||||
import io.anuke.ucore.util.Angles;
|
||||
import io.anuke.ucore.util.Mathf;
|
||||
|
||||
@@ -161,14 +158,16 @@ public class TurretBullets extends BulletList implements ContentList{
|
||||
}
|
||||
};
|
||||
|
||||
meltdownLaser = new BulletType(0.001f, 140){
|
||||
Color[] colors = {Palette.lancerLaser.cpy().mul(1f, 1f, 1f, 0.4f), Palette.lancerLaser, Color.WHITE};
|
||||
meltdownLaser = new BulletType(0.001f, 20){
|
||||
Color tmpColor = new Color();
|
||||
Color[] colors = {Color.valueOf("ec745855"), Color.valueOf("ec7458aa"), Color.valueOf("ff9c5a"), Color.WHITE};
|
||||
float[] tscales = {1f, 0.7f, 0.5f, 0.2f};
|
||||
float[] lenscales = {1f, 1.1f, 1.13f, 1.14f};
|
||||
float length = 100f;
|
||||
float[] strokes = {2f, 1.5f, 1f, 0.3f};
|
||||
float[] lenscales = {1f, 1.12f, 1.15f, 1.17f};
|
||||
float length = 200f;
|
||||
|
||||
{
|
||||
hiteffect = BulletFx.hitLancer;
|
||||
hiteffect = BulletFx.hitMeltdown;
|
||||
despawneffect = Fx.none;
|
||||
hitsize = 4;
|
||||
lifetime = 16f;
|
||||
@@ -177,19 +176,31 @@ public class TurretBullets extends BulletList implements ContentList{
|
||||
|
||||
@Override
|
||||
public void update(Bullet b){
|
||||
Damage.collideLine(b, b.getTeam(), hiteffect, b.x, b.y, b.angle(), length);
|
||||
if(b.timer.get(1, 5f)){
|
||||
Damage.collideLine(b, b.getTeam(), hiteffect, b.x, b.y, b.angle(), length);
|
||||
}
|
||||
Effects.shake(1f, 1f, b.x, b.y);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void hit(Bullet b, float hitx, float hity){
|
||||
Effects.effect(hiteffect, colors[2], hitx, hity);
|
||||
if(Mathf.chance(0.4)){
|
||||
Fire.create(world.tileWorld(hitx, hity));
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void draw(Bullet b){
|
||||
float baseLen = length * b.fout();
|
||||
float baseLen = (length) * b.fout();
|
||||
|
||||
Lines.lineAngle(b.x, b.y, b.angle(), baseLen);
|
||||
for(int s = 0; s < 3; s++){
|
||||
Draw.color(colors[s]);
|
||||
for(int s = 0; s < colors.length; s++){
|
||||
Draw.color(tmpColor.set(colors[s]).mul(1f + Mathf.absin(Timers.time(), 1f, 0.1f)));
|
||||
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(), baseLen * lenscales[i]);
|
||||
vector.trns(b.angle() + 180f, (lenscales[i] - 1f) * 35f);
|
||||
Lines.stroke((9f + Mathf.absin(Timers.time(), 0.8f, 1.5f)) * b.fout() * strokes[s] * tscales[i]);
|
||||
Lines.lineAngle(b.x + vector.x, b.y + vector.y, b.angle(), baseLen * lenscales[i], CapStyle.none);
|
||||
}
|
||||
}
|
||||
Draw.reset();
|
||||
|
||||
@@ -11,7 +11,7 @@ import io.anuke.ucore.util.Angles;
|
||||
import io.anuke.ucore.util.Mathf;
|
||||
|
||||
public class BulletFx extends FxList implements ContentList{
|
||||
public static Effect hitBulletSmall, hitFuse, hitBulletBig, hitFlameSmall, hitLiquid, hitLaser, hitLancer, despawn, flakExplosion, blastExplosion, plasticExplosion,
|
||||
public static Effect hitBulletSmall, hitFuse, hitBulletBig, hitFlameSmall, hitLiquid, hitLaser, hitLancer, hitMeltdown, despawn, flakExplosion, blastExplosion, plasticExplosion,
|
||||
artilleryTrail, incendTrail, missileTrail, absorb, flakExplosionBig, plasticExplosionFlak;
|
||||
|
||||
@Override
|
||||
@@ -101,6 +101,18 @@ public class BulletFx extends FxList implements ContentList{
|
||||
Draw.reset();
|
||||
});
|
||||
|
||||
hitMeltdown = new Effect(12, e -> {
|
||||
Draw.color(Palette.meltdownHit);
|
||||
Lines.stroke(e.fout() * 2f);
|
||||
|
||||
Angles.randLenVectors(e.id, 6, e.finpow() * 18f, e.rotation, 360f, (x, y) -> {
|
||||
float ang = Mathf.atan2(x, y);
|
||||
Lines.lineAngle(e.x + x, e.y + y, ang, e.fout() * 4 + 1f);
|
||||
});
|
||||
|
||||
Draw.reset();
|
||||
});
|
||||
|
||||
hitLaser = new Effect(8, e -> {
|
||||
Draw.color(Color.WHITE, Palette.heal, e.fin());
|
||||
Lines.stroke(0.5f + e.fout());
|
||||
|
||||
@@ -238,19 +238,20 @@ public interface BuilderTrait extends Entity{
|
||||
/**Do not call directly.*/
|
||||
default void updateMining(Unit unit){
|
||||
Tile tile = getMineTile();
|
||||
TileEntity core = unit.getClosestCore();
|
||||
|
||||
if(tile.block() != Blocks.air || unit.distanceTo(tile.worldx(), tile.worldy()) > mineDistance || !unit.inventory.canAcceptItem(tile.floor().drops.item)){
|
||||
if(core == null || tile.block() != Blocks.air || unit.distanceTo(tile.worldx(), tile.worldy()) > mineDistance || !unit.inventory.canAcceptItem(tile.floor().drops.item)){
|
||||
setMineTile(null);
|
||||
}else{
|
||||
Item item = tile.floor().drops.item;
|
||||
unit.rotation = Mathf.slerpDelta(unit.rotation, unit.angleTo(tile.worldx(), tile.worldy()), 0.4f);
|
||||
|
||||
if(unit.inventory.canAcceptItem(item) &&
|
||||
if(core.items.get(item) < core.tile.block().getMaximumAccepted(core.tile, item) &&
|
||||
Mathf.chance(Timers.delta() * (0.06 - item.hardness * 0.01) * getMinePower())){
|
||||
Call.transferItemToUnit(item,
|
||||
tile.worldx() + Mathf.range(tilesize / 2f),
|
||||
tile.worldy() + Mathf.range(tilesize / 2f),
|
||||
unit);
|
||||
|
||||
Call.transferItemTo(item, 1,
|
||||
tile.worldx() + Mathf.range(tilesize / 2f),
|
||||
tile.worldy() + Mathf.range(tilesize / 2f), core.tile);
|
||||
}
|
||||
|
||||
if(Mathf.chance(0.06 * Timers.delta())){
|
||||
|
||||
@@ -13,6 +13,8 @@ public class Palette{
|
||||
missileYellow = Color.valueOf("ffd2ae"),
|
||||
missileYellowBack = Color.valueOf("e58956"),
|
||||
|
||||
meltdownHit = Color.valueOf("ffb98b"),
|
||||
|
||||
plastaniumBack = Color.valueOf("d8d97f"),
|
||||
plastaniumFront = Color.valueOf("fffac6"),
|
||||
|
||||
|
||||
@@ -27,6 +27,8 @@ public class LaserTurret extends PowerTurret{
|
||||
entity.bullet.setRotation(entity.rotation);
|
||||
entity.bullet.set(tile.drawx() + tr.x, tile.drawy() + tr.y);
|
||||
entity.bullet.time(0f);
|
||||
entity.heat = 1f;
|
||||
entity.recoil = recoil;
|
||||
entity.bulletLife -= Timers.delta();
|
||||
if(entity.bulletLife <= 0f){
|
||||
entity.bullet = null;
|
||||
@@ -49,7 +51,7 @@ public class LaserTurret extends PowerTurret{
|
||||
protected void turnToTarget(Tile tile, float targetRot){
|
||||
LaserTurretEntity entity = tile.entity();
|
||||
|
||||
entity.rotation = Angles.moveToward(entity.rotation, targetRot, rotatespeed * entity.delta() * (entity.bulletLife <= 0f ? firingMoveFract : 1f));
|
||||
entity.rotation = Angles.moveToward(entity.rotation, targetRot, rotatespeed * entity.delta() * (entity.bulletLife > 0f ? firingMoveFract : 1f));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
Reference in New Issue
Block a user