Meltdown prototype
This commit is contained in:
BIN
core/assets-raw/sprites/blocks/turrets/turrets/meltdown-heat.png
Normal file
BIN
core/assets-raw/sprites/blocks/turrets/turrets/meltdown-heat.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 533 B |
Binary file not shown.
|
Before Width: | Height: | Size: 466 B After Width: | Height: | Size: 635 B |
File diff suppressed because it is too large
Load Diff
Binary file not shown.
|
Before Width: | Height: | Size: 97 KiB After Width: | Height: | Size: 99 KiB |
@@ -35,7 +35,7 @@ public class Recipes implements ContentList{
|
|||||||
new Recipe(defense, DefenseBlocks.surgeWallLarge, new ItemStack(Items.surgealloy, 12 * 4));
|
new Recipe(defense, DefenseBlocks.surgeWallLarge, new ItemStack(Items.surgealloy, 12 * 4));
|
||||||
|
|
||||||
//projectors
|
//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.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));
|
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"){{
|
plastaniumCompressor = new PlastaniumCompressor("plastanium-compressor"){{
|
||||||
hasItems = true;
|
hasItems = true;
|
||||||
liquidCapacity = 60f;
|
liquidCapacity = 60f;
|
||||||
craftTime = 80f;
|
craftTime = 60f;
|
||||||
output = Items.plastanium;
|
output = Items.plastanium;
|
||||||
itemCapacity = 30;
|
itemCapacity = 30;
|
||||||
size = 2;
|
size = 2;
|
||||||
@@ -67,7 +67,7 @@ public class CraftingBlocks extends BlockList implements ContentList{
|
|||||||
updateEffect = BlockFx.plasticburn;
|
updateEffect = BlockFx.plasticburn;
|
||||||
|
|
||||||
consumes.liquid(Liquids.oil, 0.25f);
|
consumes.liquid(Liquids.oil, 0.25f);
|
||||||
consumes.power(0.25f);
|
consumes.power(0.3f);
|
||||||
consumes.item(Items.titanium, 2);
|
consumes.item(Items.titanium, 2);
|
||||||
}};
|
}};
|
||||||
|
|
||||||
|
|||||||
@@ -19,7 +19,7 @@ public class LiquidBlocks extends BlockList implements ContentList{
|
|||||||
|
|
||||||
rotaryPump = new Pump("rotary-pump"){{
|
rotaryPump = new Pump("rotary-pump"){{
|
||||||
shadow = "shadow-rounded-2";
|
shadow = "shadow-rounded-2";
|
||||||
pumpAmount = 0.25f;
|
pumpAmount = 0.2f;
|
||||||
consumes.power(0.015f);
|
consumes.power(0.015f);
|
||||||
liquidCapacity = 30f;
|
liquidCapacity = 30f;
|
||||||
powerCapacity = 20f;
|
powerCapacity = 20f;
|
||||||
@@ -30,7 +30,7 @@ public class LiquidBlocks extends BlockList implements ContentList{
|
|||||||
|
|
||||||
thermalPump = new Pump("thermal-pump"){{
|
thermalPump = new Pump("thermal-pump"){{
|
||||||
shadow = "shadow-rounded-2";
|
shadow = "shadow-rounded-2";
|
||||||
pumpAmount = 0.55f;
|
pumpAmount = 0.3f;
|
||||||
consumes.power(0.03f);
|
consumes.power(0.03f);
|
||||||
liquidCapacity = 40f;
|
liquidCapacity = 40f;
|
||||||
hasPower = true;
|
hasPower = true;
|
||||||
|
|||||||
@@ -22,7 +22,7 @@ public class PowerBlocks extends BlockList implements ContentList{
|
|||||||
thermalGenerator = new LiquidHeatGenerator("thermal-generator"){{
|
thermalGenerator = new LiquidHeatGenerator("thermal-generator"){{
|
||||||
maxLiquidGenerate = 0.5f;
|
maxLiquidGenerate = 0.5f;
|
||||||
powerCapacity = 40f;
|
powerCapacity = 40f;
|
||||||
powerPerLiquid = 1.5f;
|
powerPerLiquid = 1f;
|
||||||
generateEffect = BlockFx.redgeneratespark;
|
generateEffect = BlockFx.redgeneratespark;
|
||||||
size = 2;
|
size = 2;
|
||||||
}};
|
}};
|
||||||
|
|||||||
@@ -216,7 +216,7 @@ public class TurretBlocks extends BlockList implements ContentList{
|
|||||||
|
|
||||||
spectre = new DoubleTurret("spectre"){{
|
spectre = new DoubleTurret("spectre"){{
|
||||||
ammoTypes = new AmmoType[]{AmmoTypes.bulletDenseBig, AmmoTypes.bulletPyratiteBig, AmmoTypes.bulletThoriumBig};
|
ammoTypes = new AmmoType[]{AmmoTypes.bulletDenseBig, AmmoTypes.bulletPyratiteBig, AmmoTypes.bulletThoriumBig};
|
||||||
reload = 4f;
|
reload = 6f;
|
||||||
coolantMultiplier = 0.5f;
|
coolantMultiplier = 0.5f;
|
||||||
maxCoolantUsed = 1.5f;
|
maxCoolantUsed = 1.5f;
|
||||||
restitution = 0.1f;
|
restitution = 0.1f;
|
||||||
@@ -236,12 +236,16 @@ public class TurretBlocks extends BlockList implements ContentList{
|
|||||||
|
|
||||||
meltdown = new LaserTurret("meltdown"){{
|
meltdown = new LaserTurret("meltdown"){{
|
||||||
shootType = AmmoTypes.meltdownLaser;
|
shootType = AmmoTypes.meltdownLaser;
|
||||||
|
shootEffect = ShootFx.shootBigSmoke2;
|
||||||
shootCone = 40f;
|
shootCone = 40f;
|
||||||
|
recoil = 4f;
|
||||||
size = 4;
|
size = 4;
|
||||||
|
shootShake = 2f;
|
||||||
powerUsed = 10f;
|
powerUsed = 10f;
|
||||||
range = 140f;
|
range = 160f;
|
||||||
reload = 60f;
|
reload = 130f;
|
||||||
shootDuration = 60f;
|
firingMoveFract = 0.25f;
|
||||||
|
shootDuration = 180f;
|
||||||
powerCapacity = 50f;
|
powerCapacity = 50f;
|
||||||
}};
|
}};
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -20,10 +20,7 @@ import io.anuke.mindustry.world.Tile;
|
|||||||
import io.anuke.mindustry.world.blocks.distribution.MassDriver.DriverBulletData;
|
import io.anuke.mindustry.world.blocks.distribution.MassDriver.DriverBulletData;
|
||||||
import io.anuke.ucore.core.Effects;
|
import io.anuke.ucore.core.Effects;
|
||||||
import io.anuke.ucore.core.Timers;
|
import io.anuke.ucore.core.Timers;
|
||||||
import io.anuke.ucore.graphics.Draw;
|
import io.anuke.ucore.graphics.*;
|
||||||
import io.anuke.ucore.graphics.Fill;
|
|
||||||
import io.anuke.ucore.graphics.Lines;
|
|
||||||
import io.anuke.ucore.graphics.Shapes;
|
|
||||||
import io.anuke.ucore.util.Angles;
|
import io.anuke.ucore.util.Angles;
|
||||||
import io.anuke.ucore.util.Mathf;
|
import io.anuke.ucore.util.Mathf;
|
||||||
|
|
||||||
@@ -161,14 +158,16 @@ public class TurretBullets extends BulletList implements ContentList{
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
meltdownLaser = new BulletType(0.001f, 140){
|
meltdownLaser = new BulletType(0.001f, 20){
|
||||||
Color[] colors = {Palette.lancerLaser.cpy().mul(1f, 1f, 1f, 0.4f), Palette.lancerLaser, Color.WHITE};
|
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[] tscales = {1f, 0.7f, 0.5f, 0.2f};
|
||||||
float[] lenscales = {1f, 1.1f, 1.13f, 1.14f};
|
float[] strokes = {2f, 1.5f, 1f, 0.3f};
|
||||||
float length = 100f;
|
float[] lenscales = {1f, 1.12f, 1.15f, 1.17f};
|
||||||
|
float length = 200f;
|
||||||
|
|
||||||
{
|
{
|
||||||
hiteffect = BulletFx.hitLancer;
|
hiteffect = BulletFx.hitMeltdown;
|
||||||
despawneffect = Fx.none;
|
despawneffect = Fx.none;
|
||||||
hitsize = 4;
|
hitsize = 4;
|
||||||
lifetime = 16f;
|
lifetime = 16f;
|
||||||
@@ -177,19 +176,31 @@ public class TurretBullets extends BulletList implements ContentList{
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void update(Bullet b){
|
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
|
@Override
|
||||||
public void draw(Bullet b){
|
public void draw(Bullet b){
|
||||||
float baseLen = length * b.fout();
|
float baseLen = (length) * b.fout();
|
||||||
|
|
||||||
Lines.lineAngle(b.x, b.y, b.angle(), baseLen);
|
Lines.lineAngle(b.x, b.y, b.angle(), baseLen);
|
||||||
for(int s = 0; s < 3; s++){
|
for(int s = 0; s < colors.length; s++){
|
||||||
Draw.color(colors[s]);
|
Draw.color(tmpColor.set(colors[s]).mul(1f + Mathf.absin(Timers.time(), 1f, 0.1f)));
|
||||||
for(int i = 0; i < tscales.length; i++){
|
for(int i = 0; i < tscales.length; i++){
|
||||||
Lines.stroke(7f * b.fout() * (s == 0 ? 1.5f : s == 1 ? 1f : 0.3f) * tscales[i]);
|
vector.trns(b.angle() + 180f, (lenscales[i] - 1f) * 35f);
|
||||||
Lines.lineAngle(b.x, b.y, b.angle(), baseLen * lenscales[i]);
|
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();
|
Draw.reset();
|
||||||
|
|||||||
@@ -11,7 +11,7 @@ import io.anuke.ucore.util.Angles;
|
|||||||
import io.anuke.ucore.util.Mathf;
|
import io.anuke.ucore.util.Mathf;
|
||||||
|
|
||||||
public class BulletFx extends FxList implements ContentList{
|
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;
|
artilleryTrail, incendTrail, missileTrail, absorb, flakExplosionBig, plasticExplosionFlak;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -101,6 +101,18 @@ public class BulletFx extends FxList implements ContentList{
|
|||||||
Draw.reset();
|
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 -> {
|
hitLaser = new Effect(8, e -> {
|
||||||
Draw.color(Color.WHITE, Palette.heal, e.fin());
|
Draw.color(Color.WHITE, Palette.heal, e.fin());
|
||||||
Lines.stroke(0.5f + e.fout());
|
Lines.stroke(0.5f + e.fout());
|
||||||
|
|||||||
@@ -238,19 +238,20 @@ public interface BuilderTrait extends Entity{
|
|||||||
/**Do not call directly.*/
|
/**Do not call directly.*/
|
||||||
default void updateMining(Unit unit){
|
default void updateMining(Unit unit){
|
||||||
Tile tile = getMineTile();
|
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);
|
setMineTile(null);
|
||||||
}else{
|
}else{
|
||||||
Item item = tile.floor().drops.item;
|
Item item = tile.floor().drops.item;
|
||||||
unit.rotation = Mathf.slerpDelta(unit.rotation, unit.angleTo(tile.worldx(), tile.worldy()), 0.4f);
|
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())){
|
Mathf.chance(Timers.delta() * (0.06 - item.hardness * 0.01) * getMinePower())){
|
||||||
Call.transferItemToUnit(item,
|
|
||||||
tile.worldx() + Mathf.range(tilesize / 2f),
|
Call.transferItemTo(item, 1,
|
||||||
tile.worldy() + Mathf.range(tilesize / 2f),
|
tile.worldx() + Mathf.range(tilesize / 2f),
|
||||||
unit);
|
tile.worldy() + Mathf.range(tilesize / 2f), core.tile);
|
||||||
}
|
}
|
||||||
|
|
||||||
if(Mathf.chance(0.06 * Timers.delta())){
|
if(Mathf.chance(0.06 * Timers.delta())){
|
||||||
|
|||||||
@@ -13,6 +13,8 @@ public class Palette{
|
|||||||
missileYellow = Color.valueOf("ffd2ae"),
|
missileYellow = Color.valueOf("ffd2ae"),
|
||||||
missileYellowBack = Color.valueOf("e58956"),
|
missileYellowBack = Color.valueOf("e58956"),
|
||||||
|
|
||||||
|
meltdownHit = Color.valueOf("ffb98b"),
|
||||||
|
|
||||||
plastaniumBack = Color.valueOf("d8d97f"),
|
plastaniumBack = Color.valueOf("d8d97f"),
|
||||||
plastaniumFront = Color.valueOf("fffac6"),
|
plastaniumFront = Color.valueOf("fffac6"),
|
||||||
|
|
||||||
|
|||||||
@@ -27,6 +27,8 @@ public class LaserTurret extends PowerTurret{
|
|||||||
entity.bullet.setRotation(entity.rotation);
|
entity.bullet.setRotation(entity.rotation);
|
||||||
entity.bullet.set(tile.drawx() + tr.x, tile.drawy() + tr.y);
|
entity.bullet.set(tile.drawx() + tr.x, tile.drawy() + tr.y);
|
||||||
entity.bullet.time(0f);
|
entity.bullet.time(0f);
|
||||||
|
entity.heat = 1f;
|
||||||
|
entity.recoil = recoil;
|
||||||
entity.bulletLife -= Timers.delta();
|
entity.bulletLife -= Timers.delta();
|
||||||
if(entity.bulletLife <= 0f){
|
if(entity.bulletLife <= 0f){
|
||||||
entity.bullet = null;
|
entity.bullet = null;
|
||||||
@@ -49,7 +51,7 @@ public class LaserTurret extends PowerTurret{
|
|||||||
protected void turnToTarget(Tile tile, float targetRot){
|
protected void turnToTarget(Tile tile, float targetRot){
|
||||||
LaserTurretEntity entity = tile.entity();
|
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
|
@Override
|
||||||
|
|||||||
Reference in New Issue
Block a user