Merge remote-tracking branch 'origin/master'
@@ -27,7 +27,7 @@ allprojects {
|
|||||||
appName = 'Mindustry'
|
appName = 'Mindustry'
|
||||||
gdxVersion = '1.9.8'
|
gdxVersion = '1.9.8'
|
||||||
roboVMVersion = '2.3.0'
|
roboVMVersion = '2.3.0'
|
||||||
uCoreVersion = '74dc653bbd66d1e8b10e22efb4f1206195674dd5'
|
uCoreVersion = 'cf9553e76e6226650b86921a73208e360049ba44'
|
||||||
|
|
||||||
getVersionString = {
|
getVersionString = {
|
||||||
String buildVersion = getBuildVersion()
|
String buildVersion = getBuildVersion()
|
||||||
|
|||||||
BIN
core/assets-raw/sprites/blocks/turrets/turrets/meltdown-heat.png
Normal file
|
After Width: | Height: | Size: 533 B |
|
Before Width: | Height: | Size: 466 B After Width: | Height: | Size: 635 B |
|
Before Width: | Height: | Size: 155 B After Width: | Height: | Size: 155 B |
|
Before Width: | Height: | Size: 94 B After Width: | Height: | Size: 94 B |
@@ -512,8 +512,8 @@ block.blackrock.name=blackrock
|
|||||||
block.icerock.name=icerock
|
block.icerock.name=icerock
|
||||||
block.copper-wall.name=Copper Wall
|
block.copper-wall.name=Copper Wall
|
||||||
block.copper-wall-large.name=Large Copper Wall
|
block.copper-wall-large.name=Large Copper Wall
|
||||||
block.composite-wall.name=Composite Wall
|
block.dense-alloy-wall.name=Dense Alloy Wall
|
||||||
block.composite-wall-large.name=Large Composite Wall
|
block.dense-alloy-wall-large.name=Large Dense Alloy Wall
|
||||||
block.phase-wall.name=Phase Wall
|
block.phase-wall.name=Phase Wall
|
||||||
block.phase-wall-large.name=Large Phase Wall
|
block.phase-wall-large.name=Large Phase Wall
|
||||||
block.thorium-wall.name=Thorium Wall
|
block.thorium-wall.name=Thorium Wall
|
||||||
@@ -628,6 +628,8 @@ block.overdrive-projector.name=Overdrive Projector
|
|||||||
block.force-projector.name=Force Projector
|
block.force-projector.name=Force Projector
|
||||||
block.arc.name=Arc
|
block.arc.name=Arc
|
||||||
block.rtg-generator.name=RTG Generator
|
block.rtg-generator.name=RTG Generator
|
||||||
|
block.spectre.name=Spectre
|
||||||
|
block.meltdown.name=Meltdown
|
||||||
|
|
||||||
unit.alpha-drone.name=Alpha Drone
|
unit.alpha-drone.name=Alpha Drone
|
||||||
unit.drone.name=Drone
|
unit.drone.name=Drone
|
||||||
|
|||||||
@@ -610,3 +610,5 @@ content.unit.name=Units
|
|||||||
block.force-projector.name=Force Projector
|
block.force-projector.name=Force Projector
|
||||||
block.arc.name=Arc
|
block.arc.name=Arc
|
||||||
block.rtg-generator.name=RTG Generator
|
block.rtg-generator.name=RTG Generator
|
||||||
|
block.spectre.name=Spectre
|
||||||
|
block.meltdown.name=Meltdown
|
||||||
|
|||||||
@@ -610,3 +610,5 @@ content.unit.name=Units
|
|||||||
block.force-projector.name=Force Projector
|
block.force-projector.name=Force Projector
|
||||||
block.arc.name=Arc
|
block.arc.name=Arc
|
||||||
block.rtg-generator.name=RTG Generator
|
block.rtg-generator.name=RTG Generator
|
||||||
|
block.spectre.name=Spectre
|
||||||
|
block.meltdown.name=Meltdown
|
||||||
|
|||||||
@@ -610,3 +610,5 @@ content.unit.name=Units
|
|||||||
block.force-projector.name=Force Projector
|
block.force-projector.name=Force Projector
|
||||||
block.arc.name=Arc
|
block.arc.name=Arc
|
||||||
block.rtg-generator.name=RTG Generator
|
block.rtg-generator.name=RTG Generator
|
||||||
|
block.spectre.name=Spectre
|
||||||
|
block.meltdown.name=Meltdown
|
||||||
|
|||||||
@@ -610,3 +610,5 @@ content.unit.name=Units
|
|||||||
block.force-projector.name=Force Projector
|
block.force-projector.name=Force Projector
|
||||||
block.arc.name=Arc
|
block.arc.name=Arc
|
||||||
block.rtg-generator.name=RTG Generator
|
block.rtg-generator.name=RTG Generator
|
||||||
|
block.spectre.name=Spectre
|
||||||
|
block.meltdown.name=Meltdown
|
||||||
|
|||||||
@@ -610,3 +610,5 @@ content.unit.name=Units
|
|||||||
block.force-projector.name=Force Projector
|
block.force-projector.name=Force Projector
|
||||||
block.arc.name=Arc
|
block.arc.name=Arc
|
||||||
block.rtg-generator.name=RTG Generator
|
block.rtg-generator.name=RTG Generator
|
||||||
|
block.spectre.name=Spectre
|
||||||
|
block.meltdown.name=Meltdown
|
||||||
|
|||||||
@@ -610,3 +610,5 @@ content.unit.name=Units
|
|||||||
block.force-projector.name=Force Projector
|
block.force-projector.name=Force Projector
|
||||||
block.arc.name=Arc
|
block.arc.name=Arc
|
||||||
block.rtg-generator.name=RTG Generator
|
block.rtg-generator.name=RTG Generator
|
||||||
|
block.spectre.name=Spectre
|
||||||
|
block.meltdown.name=Meltdown
|
||||||
|
|||||||
@@ -610,3 +610,5 @@ content.unit.name=Units
|
|||||||
block.force-projector.name=Force Projector
|
block.force-projector.name=Force Projector
|
||||||
block.arc.name=Arc
|
block.arc.name=Arc
|
||||||
block.rtg-generator.name=RTG Generator
|
block.rtg-generator.name=RTG Generator
|
||||||
|
block.spectre.name=Spectre
|
||||||
|
block.meltdown.name=Meltdown
|
||||||
|
|||||||
@@ -610,3 +610,5 @@ content.unit.name=Units
|
|||||||
block.force-projector.name=Force Projector
|
block.force-projector.name=Force Projector
|
||||||
block.arc.name=Arc
|
block.arc.name=Arc
|
||||||
block.rtg-generator.name=RTG Generator
|
block.rtg-generator.name=RTG Generator
|
||||||
|
block.spectre.name=Spectre
|
||||||
|
block.meltdown.name=Meltdown
|
||||||
|
|||||||
@@ -640,3 +640,5 @@ content.unit.name=Units
|
|||||||
block.force-projector.name=Force Projector
|
block.force-projector.name=Force Projector
|
||||||
block.arc.name=Arc
|
block.arc.name=Arc
|
||||||
block.rtg-generator.name=RTG Generator
|
block.rtg-generator.name=RTG Generator
|
||||||
|
block.spectre.name=Spectre
|
||||||
|
block.meltdown.name=Meltdown
|
||||||
|
|||||||
@@ -610,3 +610,5 @@ content.unit.name=Units
|
|||||||
block.force-projector.name=Force Projector
|
block.force-projector.name=Force Projector
|
||||||
block.arc.name=Arc
|
block.arc.name=Arc
|
||||||
block.rtg-generator.name=RTG Generator
|
block.rtg-generator.name=RTG Generator
|
||||||
|
block.spectre.name=Spectre
|
||||||
|
block.meltdown.name=Meltdown
|
||||||
|
|||||||
@@ -610,3 +610,5 @@ content.unit.name=Units
|
|||||||
block.force-projector.name=Force Projector
|
block.force-projector.name=Force Projector
|
||||||
block.arc.name=Arc
|
block.arc.name=Arc
|
||||||
block.rtg-generator.name=RTG Generator
|
block.rtg-generator.name=RTG Generator
|
||||||
|
block.spectre.name=Spectre
|
||||||
|
block.meltdown.name=Meltdown
|
||||||
|
|||||||
@@ -640,3 +640,5 @@ unit.interceptor.name=Винищувач-перехполювач
|
|||||||
unit.interceptor.description=Швидка, ударна бойова одиниця, котра використовує набіг з відскоком
|
unit.interceptor.description=Швидка, ударна бойова одиниця, котра використовує набіг з відскоком
|
||||||
mode.custom.warning=Note that blocks cannot be used in custom games until they are unlocked in sectors.\n\n[LIGHT_GRAY]If you have not unlocked any blocks, none will appear.
|
mode.custom.warning=Note that blocks cannot be used in custom games until they are unlocked in sectors.\n\n[LIGHT_GRAY]If you have not unlocked any blocks, none will appear.
|
||||||
content.unit.name=Units
|
content.unit.name=Units
|
||||||
|
block.spectre.name=Spectre
|
||||||
|
block.meltdown.name=Meltdown
|
||||||
|
|||||||
@@ -610,3 +610,5 @@ content.unit.name=Units
|
|||||||
block.force-projector.name=Force Projector
|
block.force-projector.name=Force Projector
|
||||||
block.arc.name=Arc
|
block.arc.name=Arc
|
||||||
block.rtg-generator.name=RTG Generator
|
block.rtg-generator.name=RTG Generator
|
||||||
|
block.spectre.name=Spectre
|
||||||
|
block.meltdown.name=Meltdown
|
||||||
|
|||||||
@@ -610,3 +610,5 @@ content.unit.name=Units
|
|||||||
block.force-projector.name=Force Projector
|
block.force-projector.name=Force Projector
|
||||||
block.arc.name=Arc
|
block.arc.name=Arc
|
||||||
block.rtg-generator.name=RTG Generator
|
block.rtg-generator.name=RTG Generator
|
||||||
|
block.spectre.name=Spectre
|
||||||
|
block.meltdown.name=Meltdown
|
||||||
|
|||||||
|
Before Width: | Height: | Size: 97 KiB After Width: | Height: | Size: 99 KiB |
@@ -217,7 +217,7 @@ public class AmmoTypes implements ContentList{
|
|||||||
|
|
||||||
spectreLaser = new AmmoType(TurretBullets.lancerLaser);
|
spectreLaser = new AmmoType(TurretBullets.lancerLaser);
|
||||||
|
|
||||||
meltdownLaser = new AmmoType(TurretBullets.lancerLaser);
|
meltdownLaser = new AmmoType(TurretBullets.meltdownLaser);
|
||||||
|
|
||||||
fuseShotgun = new AmmoType(Items.densealloy, TurretBullets.fuseShot, 1f){{
|
fuseShotgun = new AmmoType(Items.densealloy, TurretBullets.fuseShot, 1f){{
|
||||||
shootEffect = Fx.none;
|
shootEffect = Fx.none;
|
||||||
|
|||||||
@@ -19,8 +19,8 @@ public class Recipes implements ContentList{
|
|||||||
new Recipe(defense, DefenseBlocks.copperWall, new ItemStack(Items.copper, 12));
|
new Recipe(defense, DefenseBlocks.copperWall, new ItemStack(Items.copper, 12));
|
||||||
new Recipe(defense, DefenseBlocks.copperWallLarge, new ItemStack(Items.copper, 12 * 4));
|
new Recipe(defense, DefenseBlocks.copperWallLarge, new ItemStack(Items.copper, 12 * 4));
|
||||||
|
|
||||||
new Recipe(defense, DefenseBlocks.compositeWall, new ItemStack(Items.densealloy, 12));
|
new Recipe(defense, DefenseBlocks.denseAlloyWall, new ItemStack(Items.densealloy, 12));
|
||||||
new Recipe(defense, DefenseBlocks.compositeWallLarge, new ItemStack(Items.densealloy, 12 * 4));
|
new Recipe(defense, DefenseBlocks.denseAlloyWallLarge, new ItemStack(Items.densealloy, 12 * 4));
|
||||||
|
|
||||||
new Recipe(defense, DefenseBlocks.door, new ItemStack(Items.densealloy, 12), new ItemStack(Items.silicon, 8));
|
new Recipe(defense, DefenseBlocks.door, new ItemStack(Items.densealloy, 12), new ItemStack(Items.silicon, 8));
|
||||||
new Recipe(defense, DefenseBlocks.doorLarge, new ItemStack(Items.densealloy, 12 * 4), new ItemStack(Items.silicon, 8 * 4));
|
new Recipe(defense, DefenseBlocks.doorLarge, new ItemStack(Items.densealloy, 12 * 4), new ItemStack(Items.silicon, 8 * 4));
|
||||||
@@ -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);
|
||||||
}};
|
}};
|
||||||
|
|
||||||
|
|||||||
@@ -114,10 +114,9 @@ public class DebugBlocks extends BlockList implements ContentList{
|
|||||||
for(int i = 0; i < items.size; i++){
|
for(int i = 0; i < items.size; i++){
|
||||||
if(i == 0) continue;
|
if(i == 0) continue;
|
||||||
final int f = i;
|
final int f = i;
|
||||||
ImageButton button = cont.addImageButton("white", "toggle", 24, () -> {
|
ImageButton button = cont.addImageButton("liquid-icon-" + items.get(i).name, "toggle", 24, () -> {
|
||||||
Call.setLiquidSourceLiquid(null, tile, items.get(f));
|
Call.setLiquidSourceLiquid(null, tile, items.get(f));
|
||||||
}).size(38, 42).padBottom(-5.1f).group(group).get();
|
}).size(38, 42).padBottom(-5.1f).group(group).get();
|
||||||
button.getStyle().imageUpColor = items.get(i).color;
|
|
||||||
button.setChecked(entity.source.id == f);
|
button.setChecked(entity.source.id == f);
|
||||||
|
|
||||||
if(i % 4 == 3){
|
if(i % 4 == 3){
|
||||||
|
|||||||
@@ -7,7 +7,7 @@ import io.anuke.mindustry.world.Block;
|
|||||||
import io.anuke.mindustry.world.blocks.defense.*;
|
import io.anuke.mindustry.world.blocks.defense.*;
|
||||||
|
|
||||||
public class DefenseBlocks extends BlockList implements ContentList{
|
public class DefenseBlocks extends BlockList implements ContentList{
|
||||||
public static Block copperWall, copperWallLarge, compositeWall, compositeWallLarge, thoriumWall, thoriumWallLarge, door, doorLarge,
|
public static Block copperWall, copperWallLarge, denseAlloyWall, denseAlloyWallLarge, thoriumWall, thoriumWallLarge, door, doorLarge,
|
||||||
phaseWall, phaseWallLarge, surgeWall, surgeWallLarge, mendProjector, overdriveProjector, forceProjector, shockMine;
|
phaseWall, phaseWallLarge, surgeWall, surgeWallLarge, mendProjector, overdriveProjector, forceProjector, shockMine;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -23,11 +23,11 @@ public class DefenseBlocks extends BlockList implements ContentList{
|
|||||||
size = 2;
|
size = 2;
|
||||||
}};
|
}};
|
||||||
|
|
||||||
compositeWall = new Wall("composite-wall"){{
|
denseAlloyWall = new Wall("dense-alloy-wall"){{
|
||||||
health = 110 * wallHealthMultiplier;
|
health = 110 * wallHealthMultiplier;
|
||||||
}};
|
}};
|
||||||
|
|
||||||
compositeWallLarge = new Wall("composite-wall-large"){{
|
denseAlloyWallLarge = new Wall("dense-alloy-wall-large"){{
|
||||||
health = 110 * wallHealthMultiplier * 4;
|
health = 110 * wallHealthMultiplier * 4;
|
||||||
size = 2;
|
size = 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;
|
||||||
}};
|
}};
|
||||||
|
|||||||
@@ -82,7 +82,7 @@ public class TurretBlocks extends BlockList implements ContentList{
|
|||||||
};
|
};
|
||||||
}};
|
}};
|
||||||
|
|
||||||
lancer = new LaserTurret("lancer"){{
|
lancer = new ChargeTurret("lancer"){{
|
||||||
range = 90f;
|
range = 90f;
|
||||||
chargeTime = 60f;
|
chargeTime = 60f;
|
||||||
chargeMaxDelay = 30f;
|
chargeMaxDelay = 30f;
|
||||||
@@ -105,7 +105,7 @@ public class TurretBlocks extends BlockList implements ContentList{
|
|||||||
|
|
||||||
arc = new PowerTurret("arc"){{
|
arc = new PowerTurret("arc"){{
|
||||||
shootType = AmmoTypes.arc;
|
shootType = AmmoTypes.arc;
|
||||||
reload = 30f;
|
reload = 40f;
|
||||||
shootShake = 1f;
|
shootShake = 1f;
|
||||||
powerUsed = 5f;
|
powerUsed = 5f;
|
||||||
powerCapacity = 30f;
|
powerCapacity = 30f;
|
||||||
@@ -216,10 +216,13 @@ 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;
|
||||||
restitution = 0.03f;
|
coolantMultiplier = 0.5f;
|
||||||
ammoUseEffect = ShootFx.shellEjectMedium;
|
maxCoolantUsed = 1.5f;
|
||||||
|
restitution = 0.1f;
|
||||||
|
ammoUseEffect = ShootFx.shellEjectBig;
|
||||||
range = 200f;
|
range = 200f;
|
||||||
|
inaccuracy = 3f;
|
||||||
recoil = 3f;
|
recoil = 3f;
|
||||||
xRand = 3f;
|
xRand = 3f;
|
||||||
shotWidth = 4f;
|
shotWidth = 4f;
|
||||||
@@ -231,9 +234,19 @@ public class TurretBlocks extends BlockList implements ContentList{
|
|||||||
health = 155 * size * size;
|
health = 155 * size * size;
|
||||||
}};
|
}};
|
||||||
|
|
||||||
meltdown = new PowerTurret("meltdown"){{
|
meltdown = new LaserTurret("meltdown"){{
|
||||||
shootType = AmmoTypes.meltdownLaser;
|
shootType = AmmoTypes.meltdownLaser;
|
||||||
|
shootEffect = ShootFx.shootBigSmoke2;
|
||||||
|
shootCone = 40f;
|
||||||
|
recoil = 4f;
|
||||||
size = 4;
|
size = 4;
|
||||||
|
shootShake = 2f;
|
||||||
|
powerUsed = 10f;
|
||||||
|
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.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;
|
||||||
|
|
||||||
@@ -31,7 +28,7 @@ import static io.anuke.mindustry.Vars.content;
|
|||||||
import static io.anuke.mindustry.Vars.world;
|
import static io.anuke.mindustry.Vars.world;
|
||||||
|
|
||||||
public class TurretBullets extends BulletList implements ContentList{
|
public class TurretBullets extends BulletList implements ContentList{
|
||||||
public static BulletType fireball, basicFlame, lancerLaser, fuseShot, waterShot, cryoShot, lavaShot, oilShot, lightning, driverBolt, healBullet, arc;
|
public static BulletType fireball, basicFlame, lancerLaser, meltdownLaser, fuseShot, waterShot, cryoShot, lavaShot, oilShot, lightning, driverBolt, healBullet, arc;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void load(){
|
public void load(){
|
||||||
@@ -161,6 +158,55 @@ public class TurretBullets extends BulletList implements ContentList{
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
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[] strokes = {2f, 1.5f, 1f, 0.3f};
|
||||||
|
float[] lenscales = {1f, 1.12f, 1.15f, 1.17f};
|
||||||
|
float length = 200f;
|
||||||
|
|
||||||
|
{
|
||||||
|
hiteffect = BulletFx.hitMeltdown;
|
||||||
|
despawneffect = Fx.none;
|
||||||
|
hitsize = 4;
|
||||||
|
lifetime = 16f;
|
||||||
|
pierce = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void update(Bullet b){
|
||||||
|
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();
|
||||||
|
|
||||||
|
Lines.lineAngle(b.x, b.y, b.angle(), baseLen);
|
||||||
|
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++){
|
||||||
|
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();
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
fuseShot = new BulletType(0.01f, 70){
|
fuseShot = new BulletType(0.01f, 70){
|
||||||
int rays = 3;
|
int rays = 3;
|
||||||
float raySpace = 2f;
|
float raySpace = 2f;
|
||||||
|
|||||||
@@ -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());
|
||||||
|
|||||||
@@ -102,6 +102,11 @@ public class Player extends Unit implements BuilderTrait, CarryTrait, ShooterTra
|
|||||||
player.onDeath();
|
player.onDeath();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public float getDrag(){
|
||||||
|
return mech.drag;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Timer getTimer(){
|
public Timer getTimer(){
|
||||||
return timer;
|
return timer;
|
||||||
@@ -431,6 +436,8 @@ public class Player extends Unit implements BuilderTrait, CarryTrait, ShooterTra
|
|||||||
|
|
||||||
//region update methods
|
//region update methods
|
||||||
|
|
||||||
|
float lastx, lasty;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void update(){
|
public void update(){
|
||||||
hitTime -= Timers.delta();
|
hitTime -= Timers.delta();
|
||||||
|
|||||||
@@ -53,7 +53,9 @@ public class Predict{
|
|||||||
* See {@link #intercept(float, float, float, float, float, float, float)}.
|
* See {@link #intercept(float, float, float, float, float, float, float)}.
|
||||||
*/
|
*/
|
||||||
public static Vector2 intercept(TargetTrait src, TargetTrait dst, float v){
|
public static Vector2 intercept(TargetTrait src, TargetTrait dst, float v){
|
||||||
return intercept(src.getX(), src.getY(), dst.getX(), dst.getY(), dst.getVelocity().x - src.getVelocity().x, dst.getVelocity().x - src.getVelocity().y, v);
|
return intercept(src.getX(), src.getY(), dst.getX(), dst.getY(),
|
||||||
|
dst.getTargetVelocityX() - src.getTargetVelocityX(),
|
||||||
|
dst.getTargetVelocityY() - src.getTargetVelocityY(), v);
|
||||||
}
|
}
|
||||||
|
|
||||||
private static Vector2 quad(float a, float b, float c){
|
private static Vector2 quad(float a, float b, float c){
|
||||||
|
|||||||
@@ -207,13 +207,15 @@ public abstract class Unit extends DestructibleEntity implements SaveTrait, Targ
|
|||||||
|
|
||||||
/**Updates velocity and status effects.*/
|
/**Updates velocity and status effects.*/
|
||||||
public void updateVelocityStatus(float drag, float maxVelocity){
|
public void updateVelocityStatus(float drag, float maxVelocity){
|
||||||
|
Floor floor = getFloorOn();
|
||||||
|
|
||||||
|
|
||||||
if(isCarried()){ //carried units do not take into account velocity normally
|
if(isCarried()){ //carried units do not take into account velocity normally
|
||||||
set(carrier.getX(), carrier.getY());
|
set(carrier.getX(), carrier.getY());
|
||||||
velocity.set(carrier.getVelocity());
|
velocity.set(carrier.getVelocity());
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
Floor floor = getFloorOn();
|
|
||||||
Tile tile = world.tileWorld(x, y);
|
Tile tile = world.tileWorld(x, y);
|
||||||
|
|
||||||
status.update(this);
|
status.update(this);
|
||||||
|
|||||||
@@ -37,23 +37,23 @@ public class Bullet extends BulletEntity<BulletType> implements TeamTrait, SyncT
|
|||||||
public Bullet(){
|
public Bullet(){
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void create(BulletType type, TeamTrait owner, float x, float y, float angle){
|
public static Bullet create(BulletType type, TeamTrait owner, float x, float y, float angle){
|
||||||
create(type, owner, owner.getTeam(), x, y, angle);
|
return create(type, owner, owner.getTeam(), x, y, angle);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void create(BulletType type, Entity owner, Team team, float x, float y, float angle){
|
public static Bullet create(BulletType type, Entity owner, Team team, float x, float y, float angle){
|
||||||
create(type, owner, team, x, y, angle, 1f);
|
return create(type, owner, team, x, y, angle, 1f);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void create(BulletType type, Entity owner, Team team, float x, float y, float angle, float velocityScl){
|
public static Bullet create(BulletType type, Entity owner, Team team, float x, float y, float angle, float velocityScl){
|
||||||
create(type, owner, team, x, y, angle, velocityScl, 1f, null);
|
return create(type, owner, team, x, y, angle, velocityScl, 1f, null);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void create(BulletType type, Entity owner, Team team, float x, float y, float angle, float velocityScl, float lifetimeScl){
|
public static Bullet create(BulletType type, Entity owner, Team team, float x, float y, float angle, float velocityScl, float lifetimeScl){
|
||||||
create(type, owner, team, x, y, angle, velocityScl, lifetimeScl, null);
|
return create(type, owner, team, x, y, angle, velocityScl, lifetimeScl, null);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void create(BulletType type, Entity owner, Team team, float x, float y, float angle, float velocityScl, float lifetimeScl, Object data){
|
public static Bullet create(BulletType type, Entity owner, Team team, float x, float y, float angle, float velocityScl, float lifetimeScl, Object data){
|
||||||
Bullet bullet = Pooling.obtain(Bullet.class, Bullet::new);
|
Bullet bullet = Pooling.obtain(Bullet.class, Bullet::new);
|
||||||
bullet.type = type;
|
bullet.type = type;
|
||||||
bullet.owner = owner;
|
bullet.owner = owner;
|
||||||
@@ -78,14 +78,15 @@ public class Bullet extends BulletEntity<BulletType> implements TeamTrait, SyncT
|
|||||||
bullet.set(x, y);
|
bullet.set(x, y);
|
||||||
|
|
||||||
bullet.add();
|
bullet.add();
|
||||||
|
return bullet;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void create(BulletType type, Bullet parent, float x, float y, float angle){
|
public static Bullet create(BulletType type, Bullet parent, float x, float y, float angle){
|
||||||
create(type, parent.owner, parent.team, x, y, angle);
|
return create(type, parent.owner, parent.team, x, y, angle);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void create(BulletType type, Bullet parent, float x, float y, float angle, float velocityScl){
|
public static Bullet create(BulletType type, Bullet parent, float x, float y, float angle, float velocityScl){
|
||||||
create(type, parent.owner, parent.team, x, y, angle, velocityScl);
|
return create(type, parent.owner, parent.team, x, y, angle, velocityScl);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Remote(called = Loc.server)
|
@Remote(called = Loc.server)
|
||||||
|
|||||||
@@ -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())){
|
||||||
|
|||||||
@@ -2,6 +2,7 @@ package io.anuke.mindustry.entities.traits;
|
|||||||
|
|
||||||
import io.anuke.mindustry.game.Team;
|
import io.anuke.mindustry.game.Team;
|
||||||
import io.anuke.ucore.entities.trait.PosTrait;
|
import io.anuke.ucore.entities.trait.PosTrait;
|
||||||
|
import io.anuke.ucore.entities.trait.SolidTrait;
|
||||||
import io.anuke.ucore.entities.trait.VelocityTrait;
|
import io.anuke.ucore.entities.trait.VelocityTrait;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -13,6 +14,22 @@ public interface TargetTrait extends PosTrait, VelocityTrait{
|
|||||||
|
|
||||||
Team getTeam();
|
Team getTeam();
|
||||||
|
|
||||||
|
default float getTargetVelocityX(){
|
||||||
|
if(this instanceof SolidTrait){
|
||||||
|
return getX() - ((SolidTrait) this).lastPosition().x;
|
||||||
|
}else{
|
||||||
|
return getVelocity().x;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
default float getTargetVelocityY(){
|
||||||
|
if(this instanceof SolidTrait){
|
||||||
|
return getY() - ((SolidTrait) this).lastPosition().y;
|
||||||
|
}else{
|
||||||
|
return getVelocity().y;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Whether this entity is a valid target.
|
* Whether this entity is a valid target.
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -82,6 +82,11 @@ public abstract class BaseUnit extends Unit implements ShooterTrait{
|
|||||||
threads.runDelay(unit::remove);
|
threads.runDelay(unit::remove);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public float getDrag(){
|
||||||
|
return type.drag;
|
||||||
|
}
|
||||||
|
|
||||||
/**Called when a command is recieved from the command center.*/
|
/**Called when a command is recieved from the command center.*/
|
||||||
public abstract void onCommand(UnitCommand command);
|
public abstract void onCommand(UnitCommand command);
|
||||||
|
|
||||||
|
|||||||
@@ -1,17 +1,14 @@
|
|||||||
package io.anuke.mindustry.entities.units;
|
package io.anuke.mindustry.entities.units;
|
||||||
|
|
||||||
import io.anuke.mindustry.Vars;
|
|
||||||
import io.anuke.mindustry.content.Items;
|
|
||||||
import io.anuke.mindustry.entities.effect.ItemDrop;
|
|
||||||
import io.anuke.mindustry.game.Team;
|
|
||||||
import io.anuke.mindustry.type.Item;
|
import io.anuke.mindustry.type.Item;
|
||||||
import io.anuke.ucore.util.Mathf;
|
|
||||||
|
|
||||||
public class UnitDrops{
|
public class UnitDrops{
|
||||||
private static final int maxItems = 200;
|
private static final int maxItems = 200;
|
||||||
private static Item[] dropTable;
|
private static Item[] dropTable;
|
||||||
|
|
||||||
public static void dropItems(BaseUnit unit){
|
public static void dropItems(BaseUnit unit){
|
||||||
|
//just don't drop anything for now
|
||||||
|
/*
|
||||||
if(Vars.itemGroup.size() > maxItems || unit.getTeam() != Team.red){
|
if(Vars.itemGroup.size() > maxItems || unit.getTeam() != Team.red){
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -28,6 +25,6 @@ public class UnitDrops{
|
|||||||
unit.getVelocity().x + Mathf.range(3f), unit.getVelocity().y + Mathf.range(3f));
|
unit.getVelocity().x + Mathf.range(3f), unit.getVelocity().y + Mathf.range(3f));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}*/
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -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"),
|
||||||
|
|
||||||
|
|||||||
@@ -0,0 +1,70 @@
|
|||||||
|
package io.anuke.mindustry.world.blocks.defense.turrets;
|
||||||
|
|
||||||
|
import io.anuke.mindustry.content.fx.Fx;
|
||||||
|
import io.anuke.mindustry.entities.TileEntity;
|
||||||
|
import io.anuke.mindustry.type.AmmoType;
|
||||||
|
import io.anuke.mindustry.world.Tile;
|
||||||
|
import io.anuke.ucore.core.Effects;
|
||||||
|
import io.anuke.ucore.core.Effects.Effect;
|
||||||
|
import io.anuke.ucore.core.Timers;
|
||||||
|
import io.anuke.ucore.util.Mathf;
|
||||||
|
|
||||||
|
import static io.anuke.mindustry.Vars.tilesize;
|
||||||
|
|
||||||
|
public class ChargeTurret extends PowerTurret{
|
||||||
|
|
||||||
|
protected float chargeTime = 30f;
|
||||||
|
protected int chargeEffects = 5;
|
||||||
|
protected float chargeMaxDelay = 10f;
|
||||||
|
protected Effect chargeEffect = Fx.none;
|
||||||
|
protected Effect chargeBeginEffect = Fx.none;
|
||||||
|
|
||||||
|
public ChargeTurret(String name){
|
||||||
|
super(name);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void shoot(Tile tile, AmmoType ammo){
|
||||||
|
LaserTurretEntity entity = tile.entity();
|
||||||
|
|
||||||
|
useAmmo(tile);
|
||||||
|
|
||||||
|
tr.trns(entity.rotation, size * tilesize / 2);
|
||||||
|
Effects.effect(chargeBeginEffect, tile.drawx() + tr.x, tile.drawy() + tr.y, entity.rotation);
|
||||||
|
|
||||||
|
for(int i = 0; i < chargeEffects; i++){
|
||||||
|
Timers.run(Mathf.random(chargeMaxDelay), () -> {
|
||||||
|
if(!isTurret(tile)) return;
|
||||||
|
tr.trns(entity.rotation, size * tilesize / 2);
|
||||||
|
Effects.effect(chargeEffect, tile.drawx() + tr.x, tile.drawy() + tr.y, entity.rotation);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
entity.shooting = true;
|
||||||
|
|
||||||
|
Timers.run(chargeTime, () -> {
|
||||||
|
if(!isTurret(tile)) return;
|
||||||
|
tr.trns(entity.rotation, size * tilesize / 2);
|
||||||
|
entity.recoil = recoil;
|
||||||
|
entity.heat = 1f;
|
||||||
|
bullet(tile, ammo.bullet, entity.rotation + Mathf.range(inaccuracy));
|
||||||
|
effects(tile);
|
||||||
|
entity.shooting = false;
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean shouldTurn(Tile tile){
|
||||||
|
LaserTurretEntity entity = tile.entity();
|
||||||
|
return !entity.shooting;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public TileEntity getEntity(){
|
||||||
|
return new LaserTurretEntity();
|
||||||
|
}
|
||||||
|
|
||||||
|
public class LaserTurretEntity extends TurretEntity{
|
||||||
|
public boolean shooting;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,7 +1,6 @@
|
|||||||
package io.anuke.mindustry.world.blocks.defense.turrets;
|
package io.anuke.mindustry.world.blocks.defense.turrets;
|
||||||
|
|
||||||
import io.anuke.mindustry.content.fx.BlockFx;
|
import io.anuke.mindustry.content.fx.BlockFx;
|
||||||
import io.anuke.mindustry.entities.effect.Fire;
|
|
||||||
import io.anuke.mindustry.type.Liquid;
|
import io.anuke.mindustry.type.Liquid;
|
||||||
import io.anuke.mindustry.world.Tile;
|
import io.anuke.mindustry.world.Tile;
|
||||||
import io.anuke.mindustry.world.consumers.ConsumeLiquidFilter;
|
import io.anuke.mindustry.world.consumers.ConsumeLiquidFilter;
|
||||||
@@ -13,14 +12,10 @@ import io.anuke.ucore.util.Mathf;
|
|||||||
import static io.anuke.mindustry.Vars.tilesize;
|
import static io.anuke.mindustry.Vars.tilesize;
|
||||||
|
|
||||||
public class CooledTurret extends Turret{
|
public class CooledTurret extends Turret{
|
||||||
/**
|
/**How much reload is lowered by for each unit of liquid of heat capacity 1.*/
|
||||||
* How much reload is lowered by for each unit of liquid of heat capacity 1.
|
|
||||||
*/
|
|
||||||
protected float coolantMultiplier = 1f;
|
protected float coolantMultiplier = 1f;
|
||||||
/**
|
/**Max coolant used per tick.*/
|
||||||
* Max coolant used per tick.
|
protected float maxCoolantUsed = 1f;
|
||||||
*/
|
|
||||||
protected float maxUsed = 1f;
|
|
||||||
protected Effect coolEffect = BlockFx.fuelburn;
|
protected Effect coolEffect = BlockFx.fuelburn;
|
||||||
|
|
||||||
public CooledTurret(String name){
|
public CooledTurret(String name){
|
||||||
@@ -28,7 +23,7 @@ public class CooledTurret extends Turret{
|
|||||||
hasLiquids = true;
|
hasLiquids = true;
|
||||||
liquidCapacity = 20f;
|
liquidCapacity = 20f;
|
||||||
|
|
||||||
consumes.add(new ConsumeLiquidFilter(liquid -> liquid.temperature <= 0.5f, 0.01f)).update(false).optional(true);
|
consumes.add(new ConsumeLiquidFilter(liquid -> liquid.temperature <= 0.5f && liquid.flammability < 0.1f, 0.01f)).update(false).optional(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -38,18 +33,13 @@ public class CooledTurret extends Turret{
|
|||||||
TurretEntity entity = tile.entity();
|
TurretEntity entity = tile.entity();
|
||||||
Liquid liquid = entity.liquids.current();
|
Liquid liquid = entity.liquids.current();
|
||||||
|
|
||||||
float used = Math.min(Math.min(entity.liquids.get(liquid), maxUsed * Timers.delta()), Math.max(0, ((reload - entity.reload) / coolantMultiplier) / liquid.heatCapacity));
|
float used = Math.min(Math.min(entity.liquids.get(liquid), maxCoolantUsed * Timers.delta()), Math.max(0, ((reload - entity.reload) / coolantMultiplier) / liquid.heatCapacity));
|
||||||
entity.reload += (used * liquid.heatCapacity) / liquid.heatCapacity;
|
entity.reload += (used * liquid.heatCapacity) / liquid.heatCapacity;
|
||||||
entity.liquids.remove(liquid, used);
|
entity.liquids.remove(liquid, used);
|
||||||
|
|
||||||
if(Mathf.chance(0.04 * used)){
|
if(Mathf.chance(0.04 * used)){
|
||||||
Effects.effect(coolEffect, tile.drawx() + Mathf.range(size * tilesize / 2f), tile.drawy() + Mathf.range(size * tilesize / 2f));
|
Effects.effect(coolEffect, tile.drawx() + Mathf.range(size * tilesize / 2f), tile.drawy() + Mathf.range(size * tilesize / 2f));
|
||||||
}
|
}
|
||||||
|
|
||||||
//don't use oil as coolant, thanks
|
|
||||||
if(Mathf.chance(liquid.flammability / 10f * used)){
|
|
||||||
Fire.create(tile);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@@ -1,62 +1,65 @@
|
|||||||
package io.anuke.mindustry.world.blocks.defense.turrets;
|
package io.anuke.mindustry.world.blocks.defense.turrets;
|
||||||
|
|
||||||
import io.anuke.mindustry.content.fx.Fx;
|
|
||||||
import io.anuke.mindustry.entities.TileEntity;
|
import io.anuke.mindustry.entities.TileEntity;
|
||||||
|
import io.anuke.mindustry.entities.bullet.Bullet;
|
||||||
|
import io.anuke.mindustry.entities.bullet.BulletType;
|
||||||
import io.anuke.mindustry.type.AmmoType;
|
import io.anuke.mindustry.type.AmmoType;
|
||||||
import io.anuke.mindustry.world.Tile;
|
import io.anuke.mindustry.world.Tile;
|
||||||
import io.anuke.ucore.core.Effects;
|
|
||||||
import io.anuke.ucore.core.Effects.Effect;
|
|
||||||
import io.anuke.ucore.core.Timers;
|
import io.anuke.ucore.core.Timers;
|
||||||
import io.anuke.ucore.util.Mathf;
|
import io.anuke.ucore.util.Angles;
|
||||||
|
|
||||||
import static io.anuke.mindustry.Vars.tilesize;
|
import static io.anuke.mindustry.Vars.tilesize;
|
||||||
|
|
||||||
public class LaserTurret extends PowerTurret{
|
public class LaserTurret extends PowerTurret{
|
||||||
|
protected float firingMoveFract = 0.25f;
|
||||||
protected float chargeTime = 30f;
|
protected float shootDuration = 100f;
|
||||||
protected int chargeEffects = 5;
|
|
||||||
protected float chargeMaxDelay = 10f;
|
|
||||||
protected Effect chargeEffect = Fx.none;
|
|
||||||
protected Effect chargeBeginEffect = Fx.none;
|
|
||||||
|
|
||||||
public LaserTurret(String name){
|
public LaserTurret(String name){
|
||||||
super(name);
|
super(name);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void shoot(Tile tile, AmmoType ammo){
|
protected void updateShooting(Tile tile){
|
||||||
LaserTurretEntity entity = tile.entity();
|
LaserTurretEntity entity = tile.entity();
|
||||||
|
|
||||||
useAmmo(tile);
|
if(entity.bulletLife > 0 && entity.bullet != null){
|
||||||
|
tr.trns(entity.rotation, size * tilesize / 2, 0f);
|
||||||
tr.trns(entity.rotation, size * tilesize / 2);
|
entity.bullet.setRotation(entity.rotation);
|
||||||
Effects.effect(chargeBeginEffect, tile.drawx() + tr.x, tile.drawy() + tr.y, entity.rotation);
|
entity.bullet.set(tile.drawx() + tr.x, tile.drawy() + tr.y);
|
||||||
|
entity.bullet.time(0f);
|
||||||
for(int i = 0; i < chargeEffects; i++){
|
entity.heat = 1f;
|
||||||
Timers.run(Mathf.random(chargeMaxDelay), () -> {
|
entity.recoil = recoil;
|
||||||
if(!isTurret(tile)) return;
|
entity.bulletLife -= Timers.delta();
|
||||||
tr.trns(entity.rotation, size * tilesize / 2);
|
if(entity.bulletLife <= 0f){
|
||||||
Effects.effect(chargeEffect, tile.drawx() + tr.x, tile.drawy() + tr.y, entity.rotation);
|
entity.bullet = null;
|
||||||
});
|
}
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
entity.shooting = true;
|
if(entity.reload >= reload){
|
||||||
|
AmmoType type = peekAmmo(tile);
|
||||||
|
|
||||||
Timers.run(chargeTime, () -> {
|
shoot(tile, type);
|
||||||
if(!isTurret(tile)) return;
|
|
||||||
tr.trns(entity.rotation, size * tilesize / 2);
|
entity.reload = 0f;
|
||||||
entity.recoil = recoil;
|
}else{
|
||||||
entity.heat = 1f;
|
entity.reload += tile.entity.delta() * peekAmmo(tile).reloadMultiplier;
|
||||||
bullet(tile, ammo.bullet, entity.rotation + Mathf.range(inaccuracy));
|
}
|
||||||
effects(tile);
|
|
||||||
entity.shooting = false;
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean shouldTurn(Tile tile){
|
protected void turnToTarget(Tile tile, float targetRot){
|
||||||
LaserTurretEntity entity = tile.entity();
|
LaserTurretEntity entity = tile.entity();
|
||||||
return !entity.shooting;
|
|
||||||
|
entity.rotation = Angles.moveToward(entity.rotation, targetRot, rotatespeed * entity.delta() * (entity.bulletLife > 0f ? firingMoveFract : 1f));
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void bullet(Tile tile, BulletType type, float angle){
|
||||||
|
LaserTurretEntity entity = tile.entity();
|
||||||
|
|
||||||
|
entity.bullet = Bullet.create(type, tile.entity, tile.getTeam(), tile.drawx() + tr.x, tile.drawy() + tr.y, angle);
|
||||||
|
entity.bulletLife = shootDuration;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -64,7 +67,8 @@ public class LaserTurret extends PowerTurret{
|
|||||||
return new LaserTurretEntity();
|
return new LaserTurretEntity();
|
||||||
}
|
}
|
||||||
|
|
||||||
public class LaserTurretEntity extends TurretEntity{
|
class LaserTurretEntity extends TurretEntity{
|
||||||
public boolean shooting;
|
Bullet bullet;
|
||||||
|
float bulletLife;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -213,7 +213,7 @@ public abstract class Turret extends Block{
|
|||||||
}
|
}
|
||||||
|
|
||||||
if(shouldTurn(tile)){
|
if(shouldTurn(tile)){
|
||||||
entity.rotation = Angles.moveToward(entity.rotation, targetRot, rotatespeed * entity.delta());
|
turnToTarget(tile, targetRot);
|
||||||
}
|
}
|
||||||
|
|
||||||
if(Angles.angleDist(entity.rotation, targetRot) < shootCone){
|
if(Angles.angleDist(entity.rotation, targetRot) < shootCone){
|
||||||
@@ -235,6 +235,12 @@ public abstract class Turret extends Block{
|
|||||||
tile.drawx(), tile.drawy(), range, e -> !e.isDead() && (!e.isFlying() || targetAir));
|
tile.drawx(), tile.drawy(), range, e -> !e.isDead() && (!e.isFlying() || targetAir));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
protected void turnToTarget(Tile tile, float targetRot){
|
||||||
|
TurretEntity entity = tile.entity();
|
||||||
|
|
||||||
|
entity.rotation = Angles.moveToward(entity.rotation, targetRot, rotatespeed * entity.delta());
|
||||||
|
}
|
||||||
|
|
||||||
public boolean shouldTurn(Tile tile){
|
public boolean shouldTurn(Tile tile){
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|||||||