Loads of bugfixes, gameplay tweaks
|
After Width: | Height: | Size: 183 B |
|
After Width: | Height: | Size: 156 B |
BIN
core/assets-raw/sprites/blocks/environment/grass-cliff-edge.png
Normal file
|
After Width: | Height: | Size: 170 B |
BIN
core/assets-raw/sprites/blocks/environment/grass-cliff-side.png
Normal file
|
After Width: | Height: | Size: 167 B |
BIN
core/assets-raw/sprites/blocks/production/blast-mixer.png
Normal file
|
After Width: | Height: | Size: 561 B |
BIN
core/assets-raw/sprites/blocks/production/thermite-mixer.png
Normal file
|
After Width: | Height: | Size: 463 B |
|
Before Width: | Height: | Size: 115 KiB After Width: | Height: | Size: 114 KiB |
@@ -36,7 +36,7 @@ public class Vars{
|
|||||||
//respawn time in frames
|
//respawn time in frames
|
||||||
public static final float respawnduration = 60*4;
|
public static final float respawnduration = 60*4;
|
||||||
//time between waves in frames (on normal mode)
|
//time between waves in frames (on normal mode)
|
||||||
public static final float wavespace = 60*60;
|
public static final float wavespace = 60*60*2;
|
||||||
//waves can last no longer than 3 minutes, otherwise the next one spawns
|
//waves can last no longer than 3 minutes, otherwise the next one spawns
|
||||||
public static final float maxwavespace = 60*60*4f;
|
public static final float maxwavespace = 60*60*4f;
|
||||||
|
|
||||||
|
|||||||
@@ -61,7 +61,7 @@ public class WaveSpawner {
|
|||||||
|
|
||||||
for(int i = 0; i < spawned; i ++){
|
for(int i = 0; i < spawned; i ++){
|
||||||
BaseUnit unit = UnitTypes.scout.create(Team.red);
|
BaseUnit unit = UnitTypes.scout.create(Team.red);
|
||||||
unit.inventory.addAmmo(AmmoTypes.bulletIron);
|
unit.inventory.addAmmo(AmmoTypes.bulletLead);
|
||||||
unit.setWave();
|
unit.setWave();
|
||||||
unit.setSquad(squad);
|
unit.setSquad(squad);
|
||||||
unit.set(spawn.x * quadsize * tilesize + quadsize * tilesize/2f + Mathf.range(quadsize*tilesize/3f),
|
unit.set(spawn.x * quadsize * tilesize + quadsize * tilesize/2f + Mathf.range(quadsize*tilesize/3f),
|
||||||
@@ -80,7 +80,7 @@ public class WaveSpawner {
|
|||||||
|
|
||||||
for(int i = 0; i < spawned; i ++){
|
for(int i = 0; i < spawned; i ++){
|
||||||
BaseUnit unit = UnitTypes.vtol.create(Team.red);
|
BaseUnit unit = UnitTypes.vtol.create(Team.red);
|
||||||
unit.inventory.addAmmo(AmmoTypes.bulletIron);
|
unit.inventory.addAmmo(AmmoTypes.bulletLead);
|
||||||
unit.setWave();
|
unit.setWave();
|
||||||
unit.setSquad(squad);
|
unit.setSquad(squad);
|
||||||
unit.set(baseX + Mathf.range(spread), baseY + Mathf.range(spread));
|
unit.set(baseX + Mathf.range(spread), baseY + Mathf.range(spread));
|
||||||
|
|||||||
@@ -8,9 +8,9 @@ import io.anuke.mindustry.type.AmmoType;
|
|||||||
import io.anuke.mindustry.type.ContentList;
|
import io.anuke.mindustry.type.ContentList;
|
||||||
|
|
||||||
public class AmmoTypes implements ContentList {
|
public class AmmoTypes implements ContentList {
|
||||||
public static AmmoType bulletIron, bulletLead, bulletSteel, bulletThorium, bulletSilicon, bulletThermite,
|
public static AmmoType bulletTungsten, bulletLead, bulletCarbide, bulletThorium, bulletSilicon, bulletThermite,
|
||||||
flakLead, flakExplosive, flakPlastic, flakSurge, missileExplosive, missileIncindiary, missileSurge,
|
flakLead, flakExplosive, flakPlastic, flakSurge, missileExplosive, missileIncindiary, missileSurge,
|
||||||
artilleryLead, artilleryThorium, artilleryPlastic, artilleryHoming, artilleryIncindiary,
|
artilleryCarbide, artilleryThorium, artilleryPlastic, artilleryHoming, artilleryIncindiary,
|
||||||
basicFlame, lancerLaser, lightning, spectreLaser, meltdownLaser, fuseShotgun, oil, water, lava, cryofluid;
|
basicFlame, lancerLaser, lightning, spectreLaser, meltdownLaser, fuseShotgun, oil, water, lava, cryofluid;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -18,27 +18,31 @@ public class AmmoTypes implements ContentList {
|
|||||||
|
|
||||||
//bullets
|
//bullets
|
||||||
|
|
||||||
bulletIron = new AmmoType(Items.tungsten, StandardBullets.iron, 3) {{
|
bulletLead = new AmmoType(Items.lead, StandardBullets.lead, 5) {{
|
||||||
|
shootEffect = ShootFx.shootSmall;
|
||||||
|
smokeEffect = ShootFx.shootSmallSmoke;
|
||||||
|
reloadMultiplier = 1.6f;
|
||||||
|
inaccuracy = 5f;
|
||||||
|
}};
|
||||||
|
|
||||||
|
bulletTungsten = new AmmoType(Items.tungsten, StandardBullets.tungsten, 2) {{
|
||||||
|
shootEffect = ShootFx.shootSmall;
|
||||||
|
smokeEffect = ShootFx.shootSmallSmoke;
|
||||||
|
reloadMultiplier = 0.8f;
|
||||||
|
}};
|
||||||
|
|
||||||
|
bulletCarbide = new AmmoType(Items.carbide, StandardBullets.carbide, 2) {{
|
||||||
|
shootEffect = ShootFx.shootSmall;
|
||||||
|
smokeEffect = ShootFx.shootSmallSmoke;
|
||||||
|
reloadMultiplier = 0.6f;
|
||||||
|
}};
|
||||||
|
|
||||||
|
bulletThorium = new AmmoType(Items.thorium, StandardBullets.thorium, 2) {{
|
||||||
shootEffect = ShootFx.shootSmall;
|
shootEffect = ShootFx.shootSmall;
|
||||||
smokeEffect = ShootFx.shootSmallSmoke;
|
smokeEffect = ShootFx.shootSmallSmoke;
|
||||||
}};
|
}};
|
||||||
|
|
||||||
bulletLead = new AmmoType(Items.lead, StandardBullets.lead, 3) {{
|
bulletSilicon = new AmmoType(Items.silicon, StandardBullets.homing, 4) {{
|
||||||
shootEffect = ShootFx.shootSmall;
|
|
||||||
smokeEffect = ShootFx.shootSmallSmoke;
|
|
||||||
}};
|
|
||||||
|
|
||||||
bulletSteel = new AmmoType(Items.carbide, StandardBullets.steel, 3) {{
|
|
||||||
shootEffect = ShootFx.shootSmall;
|
|
||||||
smokeEffect = ShootFx.shootSmallSmoke;
|
|
||||||
}};
|
|
||||||
|
|
||||||
bulletThorium = new AmmoType(Items.thorium, StandardBullets.thorium, 3) {{
|
|
||||||
shootEffect = ShootFx.shootSmall;
|
|
||||||
smokeEffect = ShootFx.shootSmallSmoke;
|
|
||||||
}};
|
|
||||||
|
|
||||||
bulletSilicon = new AmmoType(Items.silicon, StandardBullets.homing, 3) {{
|
|
||||||
shootEffect = ShootFx.shootSmall;
|
shootEffect = ShootFx.shootSmall;
|
||||||
smokeEffect = ShootFx.shootSmallSmoke;
|
smokeEffect = ShootFx.shootSmallSmoke;
|
||||||
}};
|
}};
|
||||||
@@ -46,6 +50,7 @@ public class AmmoTypes implements ContentList {
|
|||||||
bulletThermite = new AmmoType(Items.thermite, StandardBullets.tracer, 3) {{
|
bulletThermite = new AmmoType(Items.thermite, StandardBullets.tracer, 3) {{
|
||||||
shootEffect = ShootFx.shootSmall;
|
shootEffect = ShootFx.shootSmall;
|
||||||
smokeEffect = ShootFx.shootSmallSmoke;
|
smokeEffect = ShootFx.shootSmallSmoke;
|
||||||
|
inaccuracy = 3f;
|
||||||
}};
|
}};
|
||||||
|
|
||||||
//flak
|
//flak
|
||||||
@@ -89,7 +94,7 @@ public class AmmoTypes implements ContentList {
|
|||||||
|
|
||||||
//artillery
|
//artillery
|
||||||
|
|
||||||
artilleryLead = new AmmoType(Items.lead, ArtilleryBullets.lead, 1) {{
|
artilleryCarbide = new AmmoType(Items.carbide, ArtilleryBullets.carbide, 1) {{
|
||||||
shootEffect = ShootFx.shootBig2;
|
shootEffect = ShootFx.shootBig2;
|
||||||
smokeEffect = ShootFx.shootBigSmoke2;
|
smokeEffect = ShootFx.shootBigSmoke2;
|
||||||
}};
|
}};
|
||||||
|
|||||||
@@ -17,13 +17,16 @@ public class Recipes implements ContentList{
|
|||||||
new Recipe(defense, DefenseBlocks.tungstenWall, new ItemStack(Items.tungsten, 12));
|
new Recipe(defense, DefenseBlocks.tungstenWall, new ItemStack(Items.tungsten, 12));
|
||||||
new Recipe(defense, DefenseBlocks.tungstenWallLarge, new ItemStack(Items.tungsten, 12*4));
|
new Recipe(defense, DefenseBlocks.tungstenWallLarge, new ItemStack(Items.tungsten, 12*4));
|
||||||
|
|
||||||
//TURRETS
|
new Recipe(defense, DefenseBlocks.carbideWall, new ItemStack(Items.carbide, 12));
|
||||||
new Recipe(weapon, WeaponBlocks.duo, new ItemStack(Items.tungsten, 20));
|
new Recipe(defense, DefenseBlocks.carbideWallLarge, new ItemStack(Items.carbide, 12*4));
|
||||||
new Recipe(weapon, WeaponBlocks.scorch, new ItemStack(Items.tungsten, 25), new ItemStack(Items.carbide, 20));
|
|
||||||
new Recipe(weapon, WeaponBlocks.hail, new ItemStack(Items.tungsten, 25), new ItemStack(Items.carbide, 25));
|
|
||||||
|
|
||||||
new Recipe(weapon, WeaponBlocks.lancer, new ItemStack(Items.tungsten, 25), new ItemStack(Items.lead, 25), new ItemStack(Items.silicon, 25));
|
//TURRETS
|
||||||
new Recipe(weapon, WeaponBlocks.arc, new ItemStack(Items.tungsten, 25), new ItemStack(Items.lead, 30), new ItemStack(Items.silicon, 30));
|
new Recipe(weapon, TurretBlocks.duo, new ItemStack(Items.tungsten, 20));
|
||||||
|
new Recipe(weapon, TurretBlocks.scorch, new ItemStack(Items.tungsten, 25), new ItemStack(Items.carbide, 20));
|
||||||
|
new Recipe(weapon, TurretBlocks.hail, new ItemStack(Items.tungsten, 25), new ItemStack(Items.carbide, 25));
|
||||||
|
|
||||||
|
new Recipe(weapon, TurretBlocks.lancer, new ItemStack(Items.tungsten, 25), new ItemStack(Items.lead, 25), new ItemStack(Items.silicon, 25));
|
||||||
|
new Recipe(weapon, TurretBlocks.arc, new ItemStack(Items.tungsten, 25), new ItemStack(Items.lead, 30), new ItemStack(Items.silicon, 30));
|
||||||
|
|
||||||
//DISTRIBUTION
|
//DISTRIBUTION
|
||||||
new Recipe(distribution, DistributionBlocks.conveyor, new ItemStack(Items.lead, 1));
|
new Recipe(distribution, DistributionBlocks.conveyor, new ItemStack(Items.lead, 1));
|
||||||
@@ -42,11 +45,20 @@ public class Recipes implements ContentList{
|
|||||||
new Recipe(distribution, DistributionBlocks.bridgeconveyor, new ItemStack(Items.carbide, 8), new ItemStack(Items.tungsten, 8));
|
new Recipe(distribution, DistributionBlocks.bridgeconveyor, new ItemStack(Items.carbide, 8), new ItemStack(Items.tungsten, 8));
|
||||||
|
|
||||||
//CRAFTING
|
//CRAFTING
|
||||||
new Recipe(crafting, CraftingBlocks.smelter, new ItemStack(Items.tungsten, 40));
|
|
||||||
new Recipe(crafting, CraftingBlocks.siliconsmelter, new ItemStack(Items.tungsten, 60), new ItemStack(Items.lead, 50));
|
|
||||||
new Recipe(crafting, CraftingBlocks.arcsmelter, new ItemStack(Items.tungsten, 60), new ItemStack(Items.carbide, 60), new ItemStack(Items.lead, 50));
|
|
||||||
|
|
||||||
new Recipe(crafting, CraftingBlocks.pulverizer, new ItemStack(Items.tungsten, 50), new ItemStack(Items.lead, 50));
|
//smelting
|
||||||
|
new Recipe(crafting, CraftingBlocks.smelter, new ItemStack(Items.tungsten, 40));
|
||||||
|
new Recipe(crafting, CraftingBlocks.arcsmelter, new ItemStack(Items.tungsten, 60), new ItemStack(Items.carbide, 60), new ItemStack(Items.lead, 50));
|
||||||
|
new Recipe(crafting, CraftingBlocks.siliconsmelter, new ItemStack(Items.tungsten, 60), new ItemStack(Items.lead, 50));
|
||||||
|
|
||||||
|
//misc
|
||||||
|
new Recipe(crafting, CraftingBlocks.pulverizer, new ItemStack(Items.tungsten, 60), new ItemStack(Items.lead, 50));
|
||||||
|
new Recipe(crafting, CraftingBlocks.thermiteMixer, new ItemStack(Items.tungsten, 100), new ItemStack(Items.lead, 50));
|
||||||
|
new Recipe(crafting, CraftingBlocks.blastMixer, new ItemStack(Items.tungsten, 60), new ItemStack(Items.lead, 60), new ItemStack(Items.carbide, 40));
|
||||||
|
|
||||||
|
//processing
|
||||||
|
new Recipe(crafting, CraftingBlocks.separator, new ItemStack(Items.tungsten, 60), new ItemStack(Items.carbide, 50));
|
||||||
|
new Recipe(crafting, CraftingBlocks.centrifuge, new ItemStack(Items.tungsten, 130), new ItemStack(Items.carbide, 130), new ItemStack(Items.silicon, 30), new ItemStack(Items.titanium, 40));
|
||||||
|
|
||||||
//POWER
|
//POWER
|
||||||
new Recipe(power, PowerBlocks.powernode, new ItemStack(Items.tungsten, 2), new ItemStack(Items.lead, 6));
|
new Recipe(power, PowerBlocks.powernode, new ItemStack(Items.tungsten, 2), new ItemStack(Items.lead, 6));
|
||||||
@@ -65,6 +77,7 @@ public class Recipes implements ContentList{
|
|||||||
new Recipe(production, ProductionBlocks.carbideDrill, new ItemStack(Items.tungsten, 40), new ItemStack(Items.carbide, 40));
|
new Recipe(production, ProductionBlocks.carbideDrill, new ItemStack(Items.tungsten, 40), new ItemStack(Items.carbide, 40));
|
||||||
|
|
||||||
new Recipe(production, ProductionBlocks.waterextractor, new ItemStack(Items.tungsten, 50), new ItemStack(Items.carbide, 50), new ItemStack(Items.lead, 40));
|
new Recipe(production, ProductionBlocks.waterextractor, new ItemStack(Items.tungsten, 50), new ItemStack(Items.carbide, 50), new ItemStack(Items.lead, 40));
|
||||||
|
new Recipe(production, ProductionBlocks.cultivator, new ItemStack(Items.tungsten, 20), new ItemStack(Items.lead, 50), new ItemStack(Items.silicon, 20));
|
||||||
|
|
||||||
//UNITS
|
//UNITS
|
||||||
new Recipe(units, UnitBlocks.droneFactory, new ItemStack(Items.tungsten, 30), new ItemStack(Items.lead, 50), new ItemStack(Items.silicon, 30));
|
new Recipe(units, UnitBlocks.droneFactory, new ItemStack(Items.tungsten, 30), new ItemStack(Items.lead, 50), new ItemStack(Items.silicon, 30));
|
||||||
@@ -81,7 +94,7 @@ public class Recipes implements ContentList{
|
|||||||
new Recipe(liquid, LiquidBlocks.bridgeconduit, new ItemStack(Items.carbide, 8), new ItemStack(Items.lead, 8));
|
new Recipe(liquid, LiquidBlocks.bridgeconduit, new ItemStack(Items.carbide, 8), new ItemStack(Items.lead, 8));
|
||||||
//new Recipe(liquid, LiquidBlocks.laserconduit, new ItemStack(Items.titanium, 2), new ItemStack(Items.lead, 2), new ItemStack(Items.phasematter, 10));
|
//new Recipe(liquid, LiquidBlocks.laserconduit, new ItemStack(Items.titanium, 2), new ItemStack(Items.lead, 2), new ItemStack(Items.phasematter, 10));
|
||||||
|
|
||||||
new Recipe(liquid, LiquidBlocks.mechanicalPump, new ItemStack(Items.tungsten, 10), new ItemStack(Items.lead, 10), new ItemStack(Items.silicon, 10));
|
new Recipe(liquid, LiquidBlocks.mechanicalPump, new ItemStack(Items.tungsten, 30), new ItemStack(Items.lead, 20));
|
||||||
//new Recipe(liquid, LiquidBlocks.rotaryPump, new ItemStack(Items.carbide, 10), new ItemStack(Items.surgealloy, 5));
|
//new Recipe(liquid, LiquidBlocks.rotaryPump, new ItemStack(Items.carbide, 10), new ItemStack(Items.surgealloy, 5));
|
||||||
//new Recipe(liquid, LiquidBlocks.thermalPump, new ItemStack(Items.carbide, 10), new ItemStack(Items.surgealloy, 5));
|
//new Recipe(liquid, LiquidBlocks.thermalPump, new ItemStack(Items.carbide, 10), new ItemStack(Items.surgealloy, 5));
|
||||||
|
|
||||||
@@ -114,16 +127,16 @@ public class Recipes implements ContentList{
|
|||||||
new Recipe(defense, DefenseBlocks.phasewall, new ItemStack(Items.titanium, 1));
|
new Recipe(defense, DefenseBlocks.phasewall, new ItemStack(Items.titanium, 1));
|
||||||
new Recipe(defense, DefenseBlocks.phasewalllarge, new ItemStack(Items.titanium, 1));
|
new Recipe(defense, DefenseBlocks.phasewalllarge, new ItemStack(Items.titanium, 1));
|
||||||
|
|
||||||
new Recipe(weapon, WeaponBlocks.wave, new ItemStack(Items.tungsten, 1));
|
new Recipe(weapon, TurretBlocks.wave, new ItemStack(Items.tungsten, 1));
|
||||||
new Recipe(weapon, WeaponBlocks.lancer, new ItemStack(Items.tungsten, 1));
|
new Recipe(weapon, TurretBlocks.lancer, new ItemStack(Items.tungsten, 1));
|
||||||
new Recipe(weapon, WeaponBlocks.arc, new ItemStack(Items.tungsten, 1));
|
new Recipe(weapon, TurretBlocks.arc, new ItemStack(Items.tungsten, 1));
|
||||||
new Recipe(weapon, WeaponBlocks.swarmer, new ItemStack(Items.tungsten, 1));
|
new Recipe(weapon, TurretBlocks.swarmer, new ItemStack(Items.tungsten, 1));
|
||||||
new Recipe(weapon, WeaponBlocks.ripple, new ItemStack(Items.tungsten, 1));
|
new Recipe(weapon, TurretBlocks.ripple, new ItemStack(Items.tungsten, 1));
|
||||||
new Recipe(weapon, WeaponBlocks.fuse, new ItemStack(Items.tungsten, 1));
|
new Recipe(weapon, TurretBlocks.fuse, new ItemStack(Items.tungsten, 1));
|
||||||
new Recipe(weapon, WeaponBlocks.ripple, new ItemStack(Items.tungsten, 1));
|
new Recipe(weapon, TurretBlocks.ripple, new ItemStack(Items.tungsten, 1));
|
||||||
new Recipe(weapon, WeaponBlocks.cyclone, new ItemStack(Items.tungsten, 1));
|
new Recipe(weapon, TurretBlocks.cyclone, new ItemStack(Items.tungsten, 1));
|
||||||
new Recipe(weapon, WeaponBlocks.spectre, new ItemStack(Items.tungsten, 1));
|
new Recipe(weapon, TurretBlocks.spectre, new ItemStack(Items.tungsten, 1));
|
||||||
new Recipe(weapon, WeaponBlocks.meltdown, new ItemStack(Items.tungsten, 1));
|
new Recipe(weapon, TurretBlocks.meltdown, new ItemStack(Items.tungsten, 1));
|
||||||
|
|
||||||
new Recipe(crafting, CraftingBlocks.alloysmelter, new ItemStack(Items.titanium, 50), new ItemStack(Items.carbide, 50));
|
new Recipe(crafting, CraftingBlocks.alloysmelter, new ItemStack(Items.titanium, 50), new ItemStack(Items.carbide, 50));
|
||||||
new Recipe(crafting, CraftingBlocks.alloyfuser, new ItemStack(Items.carbide, 30), new ItemStack(Items.tungsten, 30));
|
new Recipe(crafting, CraftingBlocks.alloyfuser, new ItemStack(Items.carbide, 30), new ItemStack(Items.tungsten, 30));
|
||||||
|
|||||||
@@ -28,7 +28,7 @@ public class UnitTypes implements ContentList {
|
|||||||
speed = 0.2f;
|
speed = 0.2f;
|
||||||
drag = 0.4f;
|
drag = 0.4f;
|
||||||
range = 40f;
|
range = 40f;
|
||||||
setAmmo(AmmoTypes.bulletIron);
|
setAmmo(AmmoTypes.bulletLead);
|
||||||
}};
|
}};
|
||||||
|
|
||||||
vtol = new UnitType("vtol", team -> new Vtol(vtol, team)){{
|
vtol = new UnitType("vtol", team -> new Vtol(vtol, team)){{
|
||||||
@@ -37,7 +37,7 @@ public class UnitTypes implements ContentList {
|
|||||||
drag = 0.01f;
|
drag = 0.01f;
|
||||||
isFlying = true;
|
isFlying = true;
|
||||||
reload = 7;
|
reload = 7;
|
||||||
setAmmo(AmmoTypes.bulletIron);
|
setAmmo(AmmoTypes.bulletLead);
|
||||||
}};
|
}};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -18,7 +18,7 @@ public class Weapons implements ContentList {
|
|||||||
reload = 15f;
|
reload = 15f;
|
||||||
roundrobin = true;
|
roundrobin = true;
|
||||||
ejectEffect = ShootFx.shellEjectSmall;
|
ejectEffect = ShootFx.shellEjectSmall;
|
||||||
setAmmo(AmmoTypes.bulletIron);
|
setAmmo(AmmoTypes.bulletLead);
|
||||||
}};
|
}};
|
||||||
|
|
||||||
blaster2 = new Weapon("clustergun") {{
|
blaster2 = new Weapon("clustergun") {{
|
||||||
@@ -34,7 +34,7 @@ public class Weapons implements ContentList {
|
|||||||
reload = 12f;
|
reload = 12f;
|
||||||
roundrobin = true;
|
roundrobin = true;
|
||||||
ejectEffect = ShootFx.shellEjectSmall;
|
ejectEffect = ShootFx.shellEjectSmall;
|
||||||
setAmmo(AmmoTypes.bulletSteel);
|
setAmmo(AmmoTypes.bulletCarbide);
|
||||||
}};
|
}};
|
||||||
|
|
||||||
blaster4 = new Weapon("vulcan") {{
|
blaster4 = new Weapon("vulcan") {{
|
||||||
|
|||||||
@@ -133,7 +133,9 @@ public class Blocks extends BlockList implements ContentList{
|
|||||||
|
|
||||||
snow = new Floor("snow");
|
snow = new Floor("snow");
|
||||||
|
|
||||||
grass = new Floor("grass");
|
grass = new Floor("grass"){{
|
||||||
|
hasOres = true;
|
||||||
|
}};
|
||||||
|
|
||||||
shrub = new Rock("shrub");
|
shrub = new Rock("shrub");
|
||||||
|
|
||||||
|
|||||||
@@ -11,7 +11,9 @@ import io.anuke.mindustry.world.Block;
|
|||||||
import io.anuke.mindustry.world.blocks.production.*;
|
import io.anuke.mindustry.world.blocks.production.*;
|
||||||
|
|
||||||
public class CraftingBlocks extends BlockList implements ContentList {
|
public class CraftingBlocks extends BlockList implements ContentList {
|
||||||
public static Block smelter, arcsmelter, siliconsmelter, plasteelcompressor, phaseweaver, alloysmelter, alloyfuser, cryofluidmixer, melter, separator, centrifuge, biomatterCompressor, pulverizer, oilRefinery, stoneFormer, incinerator;
|
public static Block smelter, arcsmelter, siliconsmelter, plasteelcompressor, phaseweaver, alloysmelter, alloyfuser,
|
||||||
|
thermiteMixer, blastMixer,
|
||||||
|
cryofluidmixer, melter, separator, centrifuge, biomatterCompressor, pulverizer, oilRefinery, stoneFormer, incinerator;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void load() {
|
public void load() {
|
||||||
@@ -112,6 +114,30 @@ public class CraftingBlocks extends BlockList implements ContentList {
|
|||||||
size = 2;
|
size = 2;
|
||||||
}};
|
}};
|
||||||
|
|
||||||
|
blastMixer = new GenericCrafter("blast-mixer") {{
|
||||||
|
itemCapacity = 20;
|
||||||
|
hasItems = true;
|
||||||
|
hasPower = true;
|
||||||
|
inputLiquid = Liquids.oil;
|
||||||
|
liquidUse = 0.05f;
|
||||||
|
inputItem = new ItemStack(Items.thermite, 1);
|
||||||
|
output = Items.blastCompound;
|
||||||
|
powerUse = 0.04f;
|
||||||
|
|
||||||
|
size = 2;
|
||||||
|
}};
|
||||||
|
|
||||||
|
thermiteMixer = new PowerSmelter("thermite-mixer") {{
|
||||||
|
itemCapacity = 20;
|
||||||
|
hasItems = true;
|
||||||
|
hasPower = true;
|
||||||
|
inputs = new ItemStack[]{new ItemStack(Items.coal, 1), new ItemStack(Items.lead, 2), new ItemStack(Items.sand, 2)};
|
||||||
|
result = Items.thermite;
|
||||||
|
powerUse = 0.02f;
|
||||||
|
|
||||||
|
size = 2;
|
||||||
|
}};
|
||||||
|
|
||||||
melter = new PowerCrafter("melter") {{
|
melter = new PowerCrafter("melter") {{
|
||||||
health = 200;
|
health = 200;
|
||||||
outputLiquid = Liquids.lava;
|
outputLiquid = Liquids.lava;
|
||||||
|
|||||||
@@ -12,15 +12,16 @@ import io.anuke.ucore.util.Angles;
|
|||||||
import io.anuke.ucore.util.Mathf;
|
import io.anuke.ucore.util.Mathf;
|
||||||
import io.anuke.ucore.util.Strings;
|
import io.anuke.ucore.util.Strings;
|
||||||
|
|
||||||
public class WeaponBlocks extends BlockList implements ContentList {
|
public class TurretBlocks extends BlockList implements ContentList {
|
||||||
public static Block duo, /*scatter,*/ scorch, hail, wave, lancer, arc, swarmer, salvo, fuse, ripple, cyclone, spectre, meltdown;
|
public static Block duo, /*scatter,*/ scorch, hail, wave, lancer, arc, swarmer, salvo, fuse, ripple, cyclone, spectre, meltdown;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void load() {
|
public void load() {
|
||||||
duo = new DoubleTurret("duo") {{
|
duo = new DoubleTurret("duo") {{
|
||||||
ammoTypes = new AmmoType[]{AmmoTypes.bulletIron, AmmoTypes.bulletLead, AmmoTypes.bulletSteel, AmmoTypes.bulletThermite};
|
ammoTypes = new AmmoType[]{AmmoTypes.bulletTungsten, AmmoTypes.bulletLead, AmmoTypes.bulletCarbide, AmmoTypes.bulletThermite};
|
||||||
reload = 25f;
|
reload = 25f;
|
||||||
restitution = 0.03f;
|
restitution = 0.03f;
|
||||||
|
range = 80f;
|
||||||
ammoUseEffect = ShootFx.shellEjectSmall;
|
ammoUseEffect = ShootFx.shellEjectSmall;
|
||||||
}};
|
}};
|
||||||
/*
|
/*
|
||||||
@@ -37,8 +38,9 @@ public class WeaponBlocks extends BlockList implements ContentList {
|
|||||||
}};*/
|
}};*/
|
||||||
|
|
||||||
hail = new ItemTurret("hail") {{
|
hail = new ItemTurret("hail") {{
|
||||||
ammoTypes = new AmmoType[]{AmmoTypes.artilleryLead, AmmoTypes.artilleryHoming, AmmoTypes.artilleryIncindiary};
|
ammoTypes = new AmmoType[]{AmmoTypes.artilleryCarbide, AmmoTypes.artilleryHoming, AmmoTypes.artilleryIncindiary};
|
||||||
reload = 40f;
|
reload = 40f;
|
||||||
|
range = 200f;
|
||||||
}};
|
}};
|
||||||
|
|
||||||
scorch = new LiquidTurret("scorch") {{
|
scorch = new LiquidTurret("scorch") {{
|
||||||
@@ -111,7 +113,7 @@ public class WeaponBlocks extends BlockList implements ContentList {
|
|||||||
salvo = new ItemTurret("salvo") {{
|
salvo = new ItemTurret("salvo") {{
|
||||||
size = 2;
|
size = 2;
|
||||||
range = 100f;
|
range = 100f;
|
||||||
ammoTypes = new AmmoType[]{AmmoTypes.bulletIron, AmmoTypes.bulletLead, AmmoTypes.bulletSteel, AmmoTypes.bulletThermite, AmmoTypes.bulletThorium, AmmoTypes.bulletSilicon};
|
ammoTypes = new AmmoType[]{AmmoTypes.bulletTungsten, AmmoTypes.bulletLead, AmmoTypes.bulletCarbide, AmmoTypes.bulletThermite, AmmoTypes.bulletThorium, AmmoTypes.bulletSilicon};
|
||||||
reload = 70f;
|
reload = 70f;
|
||||||
restitution = 0.03f;
|
restitution = 0.03f;
|
||||||
ammoEjectBack = 3f;
|
ammoEjectBack = 3f;
|
||||||
@@ -135,7 +137,7 @@ public class WeaponBlocks extends BlockList implements ContentList {
|
|||||||
}};
|
}};
|
||||||
|
|
||||||
ripple = new ItemTurret("ripple") {{
|
ripple = new ItemTurret("ripple") {{
|
||||||
ammoTypes = new AmmoType[]{AmmoTypes.artilleryLead, AmmoTypes.artilleryHoming, AmmoTypes.artilleryIncindiary, AmmoTypes.artilleryPlastic, AmmoTypes.artilleryThorium};
|
ammoTypes = new AmmoType[]{AmmoTypes.artilleryCarbide, AmmoTypes.artilleryHoming, AmmoTypes.artilleryIncindiary, AmmoTypes.artilleryPlastic, AmmoTypes.artilleryThorium};
|
||||||
size = 3;
|
size = 3;
|
||||||
}};
|
}};
|
||||||
|
|
||||||
@@ -151,7 +153,7 @@ public class WeaponBlocks extends BlockList implements ContentList {
|
|||||||
}};
|
}};
|
||||||
|
|
||||||
spectre = new ItemTurret("eraser") {{
|
spectre = new ItemTurret("eraser") {{
|
||||||
ammoTypes = new AmmoType[]{AmmoTypes.bulletIron, AmmoTypes.bulletLead, AmmoTypes.bulletSteel, AmmoTypes.bulletThermite, AmmoTypes.bulletThorium, AmmoTypes.bulletSilicon};
|
ammoTypes = new AmmoType[]{AmmoTypes.bulletTungsten, AmmoTypes.bulletLead, AmmoTypes.bulletCarbide, AmmoTypes.bulletThermite, AmmoTypes.bulletThorium, AmmoTypes.bulletSilicon};
|
||||||
reload = 25f;
|
reload = 25f;
|
||||||
restitution = 0.03f;
|
restitution = 0.03f;
|
||||||
ammoUseEffect = ShootFx.shellEjectSmall;
|
ammoUseEffect = ShootFx.shellEjectSmall;
|
||||||
@@ -6,12 +6,12 @@ import io.anuke.mindustry.entities.bullet.BulletType;
|
|||||||
import io.anuke.mindustry.type.ContentList;
|
import io.anuke.mindustry.type.ContentList;
|
||||||
|
|
||||||
public class ArtilleryBullets extends BulletList implements ContentList{
|
public class ArtilleryBullets extends BulletList implements ContentList{
|
||||||
public static BulletType lead, thorium, plastic, homing, incindiary, surge;
|
public static BulletType carbide, thorium, plastic, homing, incindiary, surge;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void load() {
|
public void load() {
|
||||||
|
|
||||||
lead = new BasicBulletType(3f, 0, "shell") {
|
carbide = new BasicBulletType(3f, 0, "shell") {
|
||||||
{
|
{
|
||||||
hiteffect = BulletFx.flakExplosion;
|
hiteffect = BulletFx.flakExplosion;
|
||||||
knockback = 0.8f;
|
knockback = 0.8f;
|
||||||
|
|||||||
@@ -5,36 +5,38 @@ import io.anuke.mindustry.entities.bullet.BulletType;
|
|||||||
import io.anuke.mindustry.type.ContentList;
|
import io.anuke.mindustry.type.ContentList;
|
||||||
|
|
||||||
public class StandardBullets extends BulletList implements ContentList {
|
public class StandardBullets extends BulletList implements ContentList {
|
||||||
public static BulletType iron, lead, steel, thorium, homing, tracer;
|
public static BulletType tungsten, lead, carbide, thorium, homing, tracer;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void load() {
|
public void load() {
|
||||||
|
|
||||||
iron = new BasicBulletType(3f, 5, "bullet") {
|
tungsten = new BasicBulletType(3.2f, 10, "bullet") {
|
||||||
|
{
|
||||||
|
bulletWidth = 9f;
|
||||||
|
bulletHeight = 11f;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
lead = new BasicBulletType(2.5f, 5, "bullet") {
|
||||||
{
|
{
|
||||||
bulletWidth = 7f;
|
bulletWidth = 7f;
|
||||||
bulletHeight = 9f;
|
bulletHeight = 9f;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
lead = new BasicBulletType(3f, 5, "bullet") {
|
carbide = new BasicBulletType(3.5f, 18, "bullet") {
|
||||||
{
|
{
|
||||||
bulletWidth = 7f;
|
bulletWidth = 9f;
|
||||||
bulletHeight = 9f;
|
bulletHeight = 12f;
|
||||||
|
armorPierce = 0.2f;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
steel = new BasicBulletType(3f, 5, "bullet") {
|
thorium = new BasicBulletType(4f, 25, "bullet") {
|
||||||
{
|
{
|
||||||
bulletWidth = 7f;
|
bulletWidth = 10f;
|
||||||
bulletHeight = 9f;
|
bulletHeight = 13f;
|
||||||
}
|
armorPierce = 0.5f;
|
||||||
};
|
|
||||||
|
|
||||||
thorium = new BasicBulletType(3f, 5, "bullet") {
|
|
||||||
{
|
|
||||||
bulletWidth = 7f;
|
|
||||||
bulletHeight = 9f;
|
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -11,7 +11,7 @@ import io.anuke.ucore.util.Angles;
|
|||||||
import io.anuke.ucore.util.Mathf;
|
import io.anuke.ucore.util.Mathf;
|
||||||
|
|
||||||
public class UnitFx extends FxList implements ContentList {
|
public class UnitFx extends FxList implements ContentList {
|
||||||
public static Effect vtolHover, unitDrop, unitPickup;
|
public static Effect vtolHover, unitDrop, unitPickup, pickup;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void load() {
|
public void load() {
|
||||||
@@ -38,5 +38,12 @@ public class UnitFx extends FxList implements ContentList {
|
|||||||
Lines.poly(e.x, e.y, 4, 13f * e.fout());
|
Lines.poly(e.x, e.y, 4, 13f * e.fout());
|
||||||
Draw.reset();
|
Draw.reset();
|
||||||
});
|
});
|
||||||
|
|
||||||
|
pickup = new Effect(18, e -> {
|
||||||
|
Draw.color(Palette.lightishGray);
|
||||||
|
Lines.stroke(e.fout() * 2f);
|
||||||
|
Lines.spikes(e.x, e.y, 1f + e.fin() * 6f, e.fout() * 4f, 6);
|
||||||
|
Draw.reset();
|
||||||
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -75,7 +75,7 @@ public class ContentLoader {
|
|||||||
new DefenseBlocks(),
|
new DefenseBlocks(),
|
||||||
new DistributionBlocks(),
|
new DistributionBlocks(),
|
||||||
new ProductionBlocks(),
|
new ProductionBlocks(),
|
||||||
new WeaponBlocks(),
|
new TurretBlocks(),
|
||||||
new DebugBlocks(),
|
new DebugBlocks(),
|
||||||
new LiquidBlocks(),
|
new LiquidBlocks(),
|
||||||
new StorageBlocks(),
|
new StorageBlocks(),
|
||||||
|
|||||||
@@ -6,7 +6,9 @@ import com.badlogic.gdx.utils.Pool.Poolable;
|
|||||||
import com.badlogic.gdx.utils.Pools;
|
import com.badlogic.gdx.utils.Pools;
|
||||||
import io.anuke.annotations.Annotations.Loc;
|
import io.anuke.annotations.Annotations.Loc;
|
||||||
import io.anuke.annotations.Annotations.Remote;
|
import io.anuke.annotations.Annotations.Remote;
|
||||||
|
import io.anuke.mindustry.content.fx.UnitFx;
|
||||||
import io.anuke.mindustry.entities.Player;
|
import io.anuke.mindustry.entities.Player;
|
||||||
|
import io.anuke.mindustry.entities.traits.SaveTrait;
|
||||||
import io.anuke.mindustry.entities.traits.SyncTrait;
|
import io.anuke.mindustry.entities.traits.SyncTrait;
|
||||||
import io.anuke.mindustry.gen.CallEntity;
|
import io.anuke.mindustry.gen.CallEntity;
|
||||||
import io.anuke.mindustry.net.In;
|
import io.anuke.mindustry.net.In;
|
||||||
@@ -31,7 +33,7 @@ import java.io.IOException;
|
|||||||
|
|
||||||
import static io.anuke.mindustry.Vars.*;
|
import static io.anuke.mindustry.Vars.*;
|
||||||
|
|
||||||
public class ItemDrop extends SolidEntity implements SyncTrait, DrawTrait, VelocityTrait, TimeTrait, Poolable {
|
public class ItemDrop extends SolidEntity implements SaveTrait, SyncTrait, DrawTrait, VelocityTrait, TimeTrait, Poolable {
|
||||||
public static int typeID = -1;
|
public static int typeID = -1;
|
||||||
|
|
||||||
private static final float sinkLifetime = 80f;
|
private static final float sinkLifetime = 80f;
|
||||||
@@ -62,6 +64,10 @@ public class ItemDrop extends SolidEntity implements SyncTrait, DrawTrait, Veloc
|
|||||||
|
|
||||||
@Remote(called = Loc.server, in = In.entities)
|
@Remote(called = Loc.server, in = In.entities)
|
||||||
public static void onPickup(int itemid){
|
public static void onPickup(int itemid){
|
||||||
|
ItemDrop drop = itemGroup.getByID(itemid);
|
||||||
|
if(drop != null){
|
||||||
|
Effects.effect(UnitFx.pickup, drop);
|
||||||
|
}
|
||||||
itemGroup.removeByID(itemid);
|
itemGroup.removeByID(itemid);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -104,9 +110,14 @@ public class ItemDrop extends SolidEntity implements SyncTrait, DrawTrait, Veloc
|
|||||||
@Override
|
@Override
|
||||||
public void collision(SolidTrait other, float x, float y) {
|
public void collision(SolidTrait other, float x, float y) {
|
||||||
Player player = (Player)other;
|
Player player = (Player)other;
|
||||||
if(player.inventory.canAcceptItem(item, amount)){
|
if(player.inventory.canAcceptItem(item, 1)){
|
||||||
player.inventory.addItem(item, amount);
|
int used = Math.min(amount, player.inventory.capacity() - player.inventory.getItem().amount);
|
||||||
CallEntity.onPickup(getID());
|
player.inventory.addItem(item, used);
|
||||||
|
amount -= used;
|
||||||
|
|
||||||
|
if(amount <= 0) {
|
||||||
|
CallEntity.onPickup(getID());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -182,6 +193,22 @@ public class ItemDrop extends SolidEntity implements SyncTrait, DrawTrait, Veloc
|
|||||||
return itemGroup;
|
return itemGroup;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void writeSave(DataOutput data) throws IOException {
|
||||||
|
data.writeFloat(x);
|
||||||
|
data.writeFloat(y);
|
||||||
|
data.writeByte(item.id);
|
||||||
|
data.writeShort(amount);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void readSave(DataInput data) throws IOException {
|
||||||
|
x = data.readFloat();
|
||||||
|
y = data.readFloat();
|
||||||
|
item = Item.getByID(data.readByte());
|
||||||
|
amount = data.readShort();
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void write(DataOutput data) throws IOException{
|
public void write(DataOutput data) throws IOException{
|
||||||
data.writeFloat(x);
|
data.writeFloat(x);
|
||||||
|
|||||||
@@ -13,11 +13,13 @@ public class UnitDrops {
|
|||||||
dropTable = new Item[]{Items.tungsten, Items.lead, Items.carbide};
|
dropTable = new Item[]{Items.tungsten, Items.lead, Items.carbide};
|
||||||
}
|
}
|
||||||
|
|
||||||
for(Item item : dropTable){
|
for (int i = 0; i < 3; i++) {
|
||||||
if(Mathf.chance(0.2)){
|
for(Item item : dropTable){
|
||||||
int amount = Mathf.random(1, 30);
|
if(Mathf.chance(0.2)){
|
||||||
CallEntity.createItemDrop(item, amount, unit.x + Mathf.range(2f), unit.y + Mathf.range(2f),
|
int amount = Mathf.random(1, 5);
|
||||||
unit.getVelocity().x + Mathf.range(0.5f), unit.getVelocity().y + Mathf.range(0.5f));
|
CallEntity.createItemDrop(item, amount, unit.x + Mathf.range(2f), unit.y + Mathf.range(2f),
|
||||||
|
unit.getVelocity().x + Mathf.range(3f), unit.getVelocity().y + Mathf.range(3f));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -184,11 +184,19 @@ public class Drone extends FlyingUnit implements BuilderTrait {
|
|||||||
public final UnitState
|
public final UnitState
|
||||||
|
|
||||||
build = new UnitState(){
|
build = new UnitState(){
|
||||||
|
public void entered() {
|
||||||
|
target = null;
|
||||||
|
}
|
||||||
|
|
||||||
public void update() {
|
public void update() {
|
||||||
BuildEntity entity = (BuildEntity)target;
|
BuildEntity entity = (BuildEntity)target;
|
||||||
TileEntity core = getClosestCore();
|
TileEntity core = getClosestCore();
|
||||||
|
|
||||||
|
if(entity == null){
|
||||||
|
setState(repair);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
if(core == null) return;
|
if(core == null) return;
|
||||||
|
|
||||||
if(entity.progress() < 1f && entity.tile.block() instanceof BuildBlock){ //building is valid
|
if(entity.progress() < 1f && entity.tile.block() instanceof BuildBlock){ //building is valid
|
||||||
@@ -243,6 +251,9 @@ public class Drone extends FlyingUnit implements BuilderTrait {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
mine = new UnitState() {
|
mine = new UnitState() {
|
||||||
|
public void entered() {
|
||||||
|
target = null;
|
||||||
|
}
|
||||||
|
|
||||||
public void update() {
|
public void update() {
|
||||||
if(targetItem == null) {
|
if(targetItem == null) {
|
||||||
@@ -253,7 +264,11 @@ public class Drone extends FlyingUnit implements BuilderTrait {
|
|||||||
if(inventory.isFull()){
|
if(inventory.isFull()){
|
||||||
setState(drop);
|
setState(drop);
|
||||||
}else{
|
}else{
|
||||||
//only mines tungsten for now
|
if(targetItem != null && !inventory.canAcceptItem(targetItem)){
|
||||||
|
setState(drop);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
retarget(() -> {
|
retarget(() -> {
|
||||||
if(getMineTile() == null){
|
if(getMineTile() == null){
|
||||||
findItem();
|
findItem();
|
||||||
@@ -279,6 +294,9 @@ public class Drone extends FlyingUnit implements BuilderTrait {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
drop = new UnitState() {
|
drop = new UnitState() {
|
||||||
|
public void entered() {
|
||||||
|
target = null;
|
||||||
|
}
|
||||||
|
|
||||||
public void update() {
|
public void update() {
|
||||||
if(inventory.isEmpty()){
|
if(inventory.isEmpty()){
|
||||||
|
|||||||
@@ -169,6 +169,9 @@ public abstract class InputHandler extends InputAdapter{
|
|||||||
/**Returns the tile at the specified MOUSE coordinates.*/
|
/**Returns the tile at the specified MOUSE coordinates.*/
|
||||||
Tile tileAt(float x, float y){
|
Tile tileAt(float x, float y){
|
||||||
Vector2 vec = Graphics.world(x, y);
|
Vector2 vec = Graphics.world(x, y);
|
||||||
|
if(isPlacing()){
|
||||||
|
vec.sub(recipe.result.offset(), recipe.result.offset());
|
||||||
|
}
|
||||||
return world.tileWorld(vec.x, vec.y);
|
return world.tileWorld(vec.x, vec.y);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -21,9 +21,11 @@ public class AmmoType implements Content{
|
|||||||
* For liquid ammo, this is amount used per shot.*/
|
* For liquid ammo, this is amount used per shot.*/
|
||||||
public final float quantityMultiplier;
|
public final float quantityMultiplier;
|
||||||
/**Reload speed multiplier.*/
|
/**Reload speed multiplier.*/
|
||||||
public float speedMultiplier = 1f;
|
public float reloadMultiplier = 1f;
|
||||||
/**Bullet recoil strength.*/
|
/**Bullet recoil strength.*/
|
||||||
public float recoil = 0f;
|
public float recoil = 0f;
|
||||||
|
/**Additional inaccuracy in degrees.*/
|
||||||
|
public float inaccuracy;
|
||||||
/**Effect created when shooting.*/
|
/**Effect created when shooting.*/
|
||||||
public Effect shootEffect = Fx.none;
|
public Effect shootEffect = Fx.none;
|
||||||
/**Extra smoke effect created when shooting.*/
|
/**Extra smoke effect created when shooting.*/
|
||||||
@@ -40,7 +42,7 @@ public class AmmoType implements Content{
|
|||||||
this.liquid = null;
|
this.liquid = null;
|
||||||
this.bullet = result;
|
this.bullet = result;
|
||||||
this.quantityMultiplier = 1f;
|
this.quantityMultiplier = 1f;
|
||||||
this.speedMultiplier = 1f;
|
this.reloadMultiplier = 1f;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**Creates an AmmoType with an item.*/
|
/**Creates an AmmoType with an item.*/
|
||||||
|
|||||||
@@ -80,7 +80,7 @@ public class DebugFragment implements Fragment {
|
|||||||
new button("spawng", () ->{
|
new button("spawng", () ->{
|
||||||
BaseUnit unit = UnitTypes.scout.create(player.getTeam());
|
BaseUnit unit = UnitTypes.scout.create(player.getTeam());
|
||||||
unit.set(player.x, player.y);
|
unit.set(player.x, player.y);
|
||||||
unit.inventory.addAmmo(AmmoTypes.bulletIron);
|
unit.inventory.addAmmo(AmmoTypes.bulletLead);
|
||||||
unit.setWave();
|
unit.setWave();
|
||||||
unit.add();
|
unit.add();
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -36,12 +36,14 @@ public abstract class BaseBlock {
|
|||||||
|
|
||||||
/**Remove a stack from this inventory, and return the amount removed.*/
|
/**Remove a stack from this inventory, and return the amount removed.*/
|
||||||
public int removeStack(Tile tile, Item item, int amount){
|
public int removeStack(Tile tile, Item item, int amount){
|
||||||
|
tile.entity.wakeUp();
|
||||||
tile.entity.items.removeItem(item, amount);
|
tile.entity.items.removeItem(item, amount);
|
||||||
return amount;
|
return amount;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**Handle a stack input.*/
|
/**Handle a stack input.*/
|
||||||
public void handleStack(Item item, int amount, Tile tile, Unit source){
|
public void handleStack(Item item, int amount, Tile tile, Unit source){
|
||||||
|
tile.entity.wakeUp();
|
||||||
tile.entity.items.addItem(item, amount);
|
tile.entity.items.addItem(item, amount);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -4,7 +4,6 @@ import io.anuke.mindustry.content.fx.BlockFx;
|
|||||||
import io.anuke.mindustry.entities.effect.Fire;
|
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.blocks.defense.Turret;
|
|
||||||
import io.anuke.ucore.core.Effects;
|
import io.anuke.ucore.core.Effects;
|
||||||
import io.anuke.ucore.core.Effects.Effect;
|
import io.anuke.ucore.core.Effects.Effect;
|
||||||
import io.anuke.ucore.core.Timers;
|
import io.anuke.ucore.core.Timers;
|
||||||
@@ -21,6 +20,7 @@ public class CooledTurret extends Turret {
|
|||||||
public CooledTurret(String name) {
|
public CooledTurret(String name) {
|
||||||
super(name);
|
super(name);
|
||||||
hasLiquids = true;
|
hasLiquids = true;
|
||||||
|
liquidCapacity = 20f;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -29,7 +29,7 @@ public class CooledTurret extends Turret {
|
|||||||
|
|
||||||
TurretEntity entity = tile.entity();
|
TurretEntity entity = tile.entity();
|
||||||
|
|
||||||
float used = Math.min(Math.min(entity.liquids.amount, maxUsed * Timers.delta()), ((reload - entity.reload) / coolantMultiplier) / entity.liquids.liquid.heatCapacity);
|
float used = Math.min(Math.min(entity.liquids.amount, maxUsed * Timers.delta()), Math.max(0, ((reload - entity.reload) / coolantMultiplier) / entity.liquids.liquid.heatCapacity));
|
||||||
entity.reload += (used * entity.liquids.liquid.heatCapacity) / entity.liquids.liquid.heatCapacity;
|
entity.reload += (used * entity.liquids.liquid.heatCapacity) / entity.liquids.liquid.heatCapacity;
|
||||||
entity.liquids.amount -= used;
|
entity.liquids.amount -= used;
|
||||||
|
|
||||||
|
|||||||
@@ -24,7 +24,7 @@ public class DoubleTurret extends ItemTurret {
|
|||||||
tr.trns(entity.rotation - 90, shotWidth * i, size * tilesize / 2);
|
tr.trns(entity.rotation - 90, shotWidth * i, size * tilesize / 2);
|
||||||
bullet(tile, ammo.bullet, entity.rotation + Mathf.range(inaccuracy));
|
bullet(tile, ammo.bullet, entity.rotation + Mathf.range(inaccuracy));
|
||||||
|
|
||||||
useAmmo(tile);
|
|
||||||
effects(tile);
|
effects(tile);
|
||||||
|
useAmmo(tile);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -11,8 +11,6 @@ import io.anuke.mindustry.world.meta.BlockBar;
|
|||||||
|
|
||||||
public class ItemTurret extends CooledTurret {
|
public class ItemTurret extends CooledTurret {
|
||||||
protected int maxAmmo = 100;
|
protected int maxAmmo = 100;
|
||||||
//TODO implement this!
|
|
||||||
/**A value of 'null' means this turret does not need ammo.*/
|
|
||||||
protected AmmoType[] ammoTypes;
|
protected AmmoType[] ammoTypes;
|
||||||
protected ObjectMap<Item, AmmoType> ammoMap = new ObjectMap<>();
|
protected ObjectMap<Item, AmmoType> ammoMap = new ObjectMap<>();
|
||||||
|
|
||||||
|
|||||||
@@ -7,7 +7,6 @@ import io.anuke.mindustry.type.Liquid;
|
|||||||
import io.anuke.mindustry.world.BarType;
|
import io.anuke.mindustry.world.BarType;
|
||||||
import io.anuke.mindustry.world.meta.BlockBar;
|
import io.anuke.mindustry.world.meta.BlockBar;
|
||||||
import io.anuke.mindustry.world.Tile;
|
import io.anuke.mindustry.world.Tile;
|
||||||
import io.anuke.mindustry.world.blocks.defense.Turret;
|
|
||||||
import io.anuke.ucore.core.Effects;
|
import io.anuke.ucore.core.Effects;
|
||||||
|
|
||||||
public abstract class LiquidTurret extends Turret {
|
public abstract class LiquidTurret extends Turret {
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
package io.anuke.mindustry.world.blocks.defense;
|
package io.anuke.mindustry.world.blocks.defense.turrets;
|
||||||
|
|
||||||
import com.badlogic.gdx.graphics.Color;
|
import com.badlogic.gdx.graphics.Color;
|
||||||
import com.badlogic.gdx.graphics.g2d.TextureRegion;
|
import com.badlogic.gdx.graphics.g2d.TextureRegion;
|
||||||
@@ -8,14 +8,15 @@ import io.anuke.mindustry.entities.Predict;
|
|||||||
import io.anuke.mindustry.entities.TileEntity;
|
import io.anuke.mindustry.entities.TileEntity;
|
||||||
import io.anuke.mindustry.entities.Unit;
|
import io.anuke.mindustry.entities.Unit;
|
||||||
import io.anuke.mindustry.entities.Units;
|
import io.anuke.mindustry.entities.Units;
|
||||||
|
import io.anuke.mindustry.entities.bullet.Bullet;
|
||||||
import io.anuke.mindustry.entities.bullet.BulletType;
|
import io.anuke.mindustry.entities.bullet.BulletType;
|
||||||
import io.anuke.mindustry.graphics.Layer;
|
import io.anuke.mindustry.graphics.Layer;
|
||||||
import io.anuke.mindustry.graphics.Palette;
|
import io.anuke.mindustry.graphics.Palette;
|
||||||
import io.anuke.mindustry.type.AmmoEntry;
|
import io.anuke.mindustry.type.AmmoEntry;
|
||||||
import io.anuke.mindustry.type.AmmoType;
|
import io.anuke.mindustry.type.AmmoType;
|
||||||
import io.anuke.mindustry.world.Block;
|
import io.anuke.mindustry.world.Block;
|
||||||
import io.anuke.mindustry.world.meta.BlockGroup;
|
|
||||||
import io.anuke.mindustry.world.Tile;
|
import io.anuke.mindustry.world.Tile;
|
||||||
|
import io.anuke.mindustry.world.meta.BlockGroup;
|
||||||
import io.anuke.mindustry.world.meta.BlockStat;
|
import io.anuke.mindustry.world.meta.BlockStat;
|
||||||
import io.anuke.ucore.core.Effects;
|
import io.anuke.ucore.core.Effects;
|
||||||
import io.anuke.ucore.core.Effects.Effect;
|
import io.anuke.ucore.core.Effects.Effect;
|
||||||
@@ -166,6 +167,7 @@ public abstract class Turret extends Block{
|
|||||||
if(Float.isNaN(entity.rotation)){
|
if(Float.isNaN(entity.rotation)){
|
||||||
entity.rotation = 0;
|
entity.rotation = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
entity.rotation = Angles.moveToward(entity.rotation, targetRot, 5f * Timers.delta());
|
entity.rotation = Angles.moveToward(entity.rotation, targetRot, 5f * Timers.delta());
|
||||||
|
|
||||||
if(Angles.angleDist(entity.rotation, targetRot) < shootCone){
|
if(Angles.angleDist(entity.rotation, targetRot) < shootCone){
|
||||||
@@ -208,7 +210,7 @@ public abstract class Turret extends Block{
|
|||||||
|
|
||||||
entity.reload = 0f;
|
entity.reload = 0f;
|
||||||
}else{
|
}else{
|
||||||
entity.reload += Timers.delta() * peekAmmo(tile).speedMultiplier;
|
entity.reload += Timers.delta() * peekAmmo(tile).reloadMultiplier;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -218,17 +220,18 @@ public abstract class Turret extends Block{
|
|||||||
entity.recoil = recoil;
|
entity.recoil = recoil;
|
||||||
entity.heat = 1f;
|
entity.heat = 1f;
|
||||||
|
|
||||||
|
AmmoType type = peekAmmo(tile);
|
||||||
useAmmo(tile);
|
useAmmo(tile);
|
||||||
|
|
||||||
tr.trns(entity.rotation, size * tilesize / 2);
|
tr.trns(entity.rotation, size * tilesize / 2);
|
||||||
|
|
||||||
bullet(tile, ammo.bullet, entity.rotation + Mathf.range(inaccuracy));
|
bullet(tile, ammo.bullet, entity.rotation + Mathf.range(inaccuracy + type.inaccuracy));
|
||||||
|
|
||||||
effects(tile);
|
effects(tile);
|
||||||
}
|
}
|
||||||
|
|
||||||
protected void bullet(Tile tile, BulletType type, float angle){
|
protected void bullet(Tile tile, BulletType type, float angle){
|
||||||
io.anuke.mindustry.entities.bullet.Bullet.create(type, tile.entity, tile.getTeam(), tile.drawx() + tr.x, tile.drawy() + tr.y, angle);
|
Bullet.create(type, tile.entity, tile.getTeam(), tile.drawx() + tr.x, tile.drawy() + tr.y, angle);
|
||||||
}
|
}
|
||||||
|
|
||||||
protected void effects(Tile tile){
|
protected void effects(Tile tile){
|
||||||
@@ -3,7 +3,6 @@ package io.anuke.mindustry.world.blocks.distribution;
|
|||||||
import com.badlogic.gdx.graphics.g2d.TextureRegion;
|
import com.badlogic.gdx.graphics.g2d.TextureRegion;
|
||||||
import com.badlogic.gdx.math.GridPoint2;
|
import com.badlogic.gdx.math.GridPoint2;
|
||||||
import com.badlogic.gdx.utils.LongArray;
|
import com.badlogic.gdx.utils.LongArray;
|
||||||
import io.anuke.mindustry.content.Items;
|
|
||||||
import io.anuke.mindustry.entities.TileEntity;
|
import io.anuke.mindustry.entities.TileEntity;
|
||||||
import io.anuke.mindustry.entities.Unit;
|
import io.anuke.mindustry.entities.Unit;
|
||||||
import io.anuke.mindustry.graphics.Layer;
|
import io.anuke.mindustry.graphics.Layer;
|
||||||
@@ -62,11 +61,12 @@ public class Conveyor extends Block{
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void draw(Tile tile){
|
public void draw(Tile tile){
|
||||||
|
ConveyorEntity entity = tile.entity();
|
||||||
byte rotation = tile.getRotation();
|
byte rotation = tile.getRotation();
|
||||||
|
|
||||||
GridPoint2 point = Geometry.d4[rotation];
|
GridPoint2 point = Geometry.d4[rotation];
|
||||||
|
|
||||||
int offset = acceptItem(Items.stone, tile, null) ? (int)((Timers.time()/4f)%8) : 0;
|
int offset = entity.clogHeat <= 0.5f ? (int)((Timers.time()/4f)%8) : 0;
|
||||||
TextureRegion region = Draw.region(name);
|
TextureRegion region = Draw.region(name);
|
||||||
|
|
||||||
region1.setRegion(region, 0, 0, region.getRegionWidth() - offset, region.getRegionHeight());
|
region1.setRegion(region, 0, 0, region.getRegionWidth() - offset, region.getRegionHeight());
|
||||||
@@ -192,6 +192,12 @@ public class Conveyor extends Block{
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if(entity.minitem <= 0.0001f){
|
||||||
|
entity.clogHeat = Mathf.lerpDelta(entity.clogHeat, 1f, 0.05f);
|
||||||
|
}else{
|
||||||
|
entity.clogHeat = Mathf.lerpDelta(entity.clogHeat, 0f, 1f);
|
||||||
|
}
|
||||||
|
|
||||||
entity.carrying = 0f;
|
entity.carrying = 0f;
|
||||||
entity.minCarry = 2f;
|
entity.minCarry = 2f;
|
||||||
|
|
||||||
@@ -301,6 +307,8 @@ public class Conveyor extends Block{
|
|||||||
float carrying;
|
float carrying;
|
||||||
float minCarry = 2f;
|
float minCarry = 2f;
|
||||||
|
|
||||||
|
float clogHeat = 0f;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void write(DataOutputStream stream) throws IOException{
|
public void write(DataOutputStream stream) throws IOException{
|
||||||
stream.writeInt(convey.size);
|
stream.writeInt(convey.size);
|
||||||
|
|||||||
@@ -2,8 +2,8 @@ package io.anuke.mindustry.world.blocks.distribution;
|
|||||||
|
|
||||||
import io.anuke.mindustry.type.Item;
|
import io.anuke.mindustry.type.Item;
|
||||||
import io.anuke.mindustry.world.Block;
|
import io.anuke.mindustry.world.Block;
|
||||||
import io.anuke.mindustry.world.meta.BlockGroup;
|
|
||||||
import io.anuke.mindustry.world.Tile;
|
import io.anuke.mindustry.world.Tile;
|
||||||
|
import io.anuke.mindustry.world.meta.BlockGroup;
|
||||||
import io.anuke.ucore.core.Timers;
|
import io.anuke.ucore.core.Timers;
|
||||||
|
|
||||||
public class Router extends Block{
|
public class Router extends Block{
|
||||||
@@ -21,7 +21,7 @@ public class Router extends Block{
|
|||||||
@Override
|
@Override
|
||||||
public void update(Tile tile){
|
public void update(Tile tile){
|
||||||
int iterations = Math.max(1, (int) (Timers.delta() + 0.4f));
|
int iterations = Math.max(1, (int) (Timers.delta() + 0.4f));
|
||||||
boolean moved = false;
|
boolean moved = tile.entity.items.totalItems() > 0;
|
||||||
|
|
||||||
for(int i = 0; i < iterations; i ++) {
|
for(int i = 0; i < iterations; i ++) {
|
||||||
if (tile.entity.items.totalItems() > 0) {
|
if (tile.entity.items.totalItems() > 0) {
|
||||||
|
|||||||
@@ -2,6 +2,7 @@ package io.anuke.mindustry.world.blocks.production;
|
|||||||
|
|
||||||
import com.badlogic.gdx.graphics.Color;
|
import com.badlogic.gdx.graphics.Color;
|
||||||
import com.badlogic.gdx.graphics.g2d.TextureRegion;
|
import com.badlogic.gdx.graphics.g2d.TextureRegion;
|
||||||
|
import io.anuke.mindustry.content.blocks.Blocks;
|
||||||
import io.anuke.mindustry.entities.TileEntity;
|
import io.anuke.mindustry.entities.TileEntity;
|
||||||
import io.anuke.mindustry.content.fx.Fx;
|
import io.anuke.mindustry.content.fx.Fx;
|
||||||
import io.anuke.mindustry.type.Item;
|
import io.anuke.mindustry.type.Item;
|
||||||
@@ -80,7 +81,7 @@ public class Cultivator extends Drill {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean isValid(Tile tile){
|
public boolean isValid(Tile tile){
|
||||||
return tile.block().drops != null && tile.block().drops.item == result;
|
return tile.floor() == Blocks.grass;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static class CultivatorEntity extends DrillEntity{
|
public static class CultivatorEntity extends DrillEntity{
|
||||||
|
|||||||
@@ -1,10 +1,9 @@
|
|||||||
package io.anuke.mindustry.world.blocks.production;
|
package io.anuke.mindustry.world.blocks.production;
|
||||||
|
|
||||||
import com.badlogic.gdx.graphics.g2d.TextureRegion;
|
import com.badlogic.gdx.graphics.g2d.TextureRegion;
|
||||||
import com.badlogic.gdx.utils.Array;
|
|
||||||
import io.anuke.mindustry.content.Liquids;
|
import io.anuke.mindustry.content.Liquids;
|
||||||
import io.anuke.mindustry.entities.TileEntity;
|
|
||||||
import io.anuke.mindustry.content.fx.Fx;
|
import io.anuke.mindustry.content.fx.Fx;
|
||||||
|
import io.anuke.mindustry.entities.TileEntity;
|
||||||
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.ucore.core.Effects;
|
import io.anuke.ucore.core.Effects;
|
||||||
@@ -22,8 +21,6 @@ public class SolidPump extends Pump {
|
|||||||
protected float updateEffectChance = 0.02f;
|
protected float updateEffectChance = 0.02f;
|
||||||
protected float rotateSpeed = 1f;
|
protected float rotateSpeed = 1f;
|
||||||
|
|
||||||
protected final Array<Tile> drawTiles = new Array<>();
|
|
||||||
|
|
||||||
public SolidPump(String name){
|
public SolidPump(String name){
|
||||||
super(name);
|
super(name);
|
||||||
hasPower = true;
|
hasPower = true;
|
||||||
@@ -84,19 +81,20 @@ public class SolidPump extends Pump {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean isLayer(Tile tile) {
|
public boolean canPlaceOn(Tile tile) {
|
||||||
if(isMultiblock()){
|
if(isMultiblock()){
|
||||||
for(Tile other : tile.getLinkedTiles(drawTiles)){
|
for(Tile other : tile.getLinkedTiles(drawTiles)){
|
||||||
if(isValid(other)){
|
if(isValid(other)){
|
||||||
return false;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return true;
|
return false;
|
||||||
}else{
|
}else{
|
||||||
return !isValid(tile);
|
return isValid(tile);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
protected boolean isValid(Tile tile){
|
protected boolean isValid(Tile tile){
|
||||||
return !tile.floor().isLiquid;
|
return !tile.floor().isLiquid;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -14,10 +14,12 @@ import io.anuke.ucore.util.Mathf;
|
|||||||
public class ProcGen {
|
public class ProcGen {
|
||||||
private Simplex sim = new Simplex();
|
private Simplex sim = new Simplex();
|
||||||
private Simplex sim2 = new Simplex();
|
private Simplex sim2 = new Simplex();
|
||||||
|
private Simplex sim3 = new Simplex();
|
||||||
|
|
||||||
public MapTileData generate(GenProperties props){
|
public MapTileData generate(GenProperties props){
|
||||||
sim.setSeed(Mathf.random(99999));
|
sim.setSeed(Mathf.random(99999));
|
||||||
sim2.setSeed(Mathf.random(99999));
|
sim2.setSeed(Mathf.random(99999));
|
||||||
|
sim3.setSeed(Mathf.random(99999));
|
||||||
|
|
||||||
MapTileData data = new MapTileData(300, 300);
|
MapTileData data = new MapTileData(300, 300);
|
||||||
TileDataMarker marker = data.newDataMarker();
|
TileDataMarker marker = data.newDataMarker();
|
||||||
@@ -47,6 +49,10 @@ public class ProcGen {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if(sim3.octaveNoise2D(4, 0.5, 1f/120f, x, y) > 0.5){
|
||||||
|
marker.floor = (byte)Blocks.grass.id;
|
||||||
|
}
|
||||||
|
|
||||||
marker.elevation = (byte)Math.max(elevation, 0);
|
marker.elevation = (byte)Math.max(elevation, 0);
|
||||||
|
|
||||||
data.write(marker);
|
data.write(marker);
|
||||||
|
|||||||