Surge uses / Fixes, optimizations / Turret implementation base

This commit is contained in:
Anuken
2018-08-27 23:50:23 -04:00
parent 9b57550f3d
commit 802e7b12d0
42 changed files with 875 additions and 720 deletions
@@ -13,8 +13,9 @@ public class AmmoTypes implements ContentList{
public static AmmoType bulletCopper, bulletDense, bulletThorium, bulletSilicon, bulletPyratite,
shotgunTungsten, bombExplosive, bombIncendiary, bombOil, shellCarbide, flamerThermite, weaponMissile, weaponMissileSwarm, bulletMech,
healBlaster, bulletGlaive,
flakLead, flakExplosive, flakPlastic, flakSurge, missileExplosive, missileIncindiary, missileSurge,
artilleryDense, artilleryPlastic, artilleryHoming, artilleryIncindiary, artilleryExplosive,
flakExplosive, flakPlastic, flakSurge,
missileExplosive, missileIncindiary, missileSurge,
artilleryDense, artilleryPlastic, artilleryHoming, artilleryIncindiary, artilleryExplosive,
basicFlame, lancerLaser, lightning, spectreLaser, meltdownLaser, fuseShotgun, oil, water, lava, cryofluid;
@Override
@@ -29,7 +30,6 @@ public class AmmoTypes implements ContentList{
inaccuracy = 5f;
}};
bulletGlaive = new AmmoType(Items.pyratite, StandardBullets.glaive, 3){{
shootEffect = ShootFx.shootSmall;
smokeEffect = ShootFx.shootSmallSmoke;
@@ -118,24 +118,19 @@ public class AmmoTypes implements ContentList{
//flak
flakLead = new AmmoType(Items.lead, FlakBullets.lead, 5){{
shootEffect = ShootFx.shootSmall;
smokeEffect = ShootFx.shootSmallSmoke;
}};
flakExplosive = new AmmoType(Items.blastCompound, FlakBullets.explosive, 5){{
shootEffect = ShootFx.shootSmall;
smokeEffect = ShootFx.shootSmallSmoke;
shootEffect = ShootFx.shootBig;
smokeEffect = ShootFx.shootBigSmoke;
}};
flakPlastic = new AmmoType(Items.plastanium, FlakBullets.plastic, 5){{
shootEffect = ShootFx.shootSmall;
smokeEffect = ShootFx.shootSmallSmoke;
shootEffect = ShootFx.shootBig;
smokeEffect = ShootFx.shootBigSmoke;
}};
flakSurge = new AmmoType(Items.surgealloy, FlakBullets.surge, 5){{
shootEffect = ShootFx.shootSmall;
smokeEffect = ShootFx.shootSmallSmoke;
shootEffect = ShootFx.shootBig;
smokeEffect = ShootFx.shootBigSmoke;
}};
//missiles
@@ -22,14 +22,18 @@ public class Recipes implements ContentList{
new Recipe(defense, DefenseBlocks.compositeWall, new ItemStack(Items.densealloy, 12));
new Recipe(defense, DefenseBlocks.compositeWallLarge, 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.doorLarge, new ItemStack(Items.densealloy, 12 * 4), new ItemStack(Items.silicon, 8 * 4));
new Recipe(defense, DefenseBlocks.thoriumWall, new ItemStack(Items.thorium, 12));
new Recipe(defense, DefenseBlocks.thoriumWallLarge, new ItemStack(Items.thorium, 12 * 4));
new Recipe(defense, DefenseBlocks.phaseWall, new ItemStack(Items.phasematter, 12));
new Recipe(defense, DefenseBlocks.phaseWallLarge, new ItemStack(Items.phasematter, 12 * 4));
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.surgeWall, new ItemStack(Items.surgealloy, 12));
new Recipe(defense, DefenseBlocks.surgeWallLarge, new ItemStack(Items.surgealloy, 12 * 4));
//projectors
new Recipe(defense, DefenseBlocks.mendProjector, new ItemStack(Items.lead, 200), new ItemStack(Items.densealloy, 150), new ItemStack(Items.titanium, 150), new ItemStack(Items.silicon, 250));
@@ -38,12 +42,13 @@ public class Recipes implements ContentList{
new Recipe(weapon, TurretBlocks.duo, new ItemStack(Items.copper, 40));
new Recipe(weapon, TurretBlocks.scorch, new ItemStack(Items.copper, 50), new ItemStack(Items.densealloy, 20));
new Recipe(weapon, TurretBlocks.hail, new ItemStack(Items.copper, 60), new ItemStack(Items.densealloy, 35));
new Recipe(weapon, TurretBlocks.lancer, new ItemStack(Items.copper, 50), new ItemStack(Items.lead, 100), new ItemStack(Items.silicon, 90));
new Recipe(weapon, TurretBlocks.wave, new ItemStack(Items.densealloy, 60), new ItemStack(Items.titanium, 70), new ItemStack(Items.lead, 150));
new Recipe(weapon, TurretBlocks.swarmer, new ItemStack(Items.densealloy, 70), new ItemStack(Items.titanium, 70), new ItemStack(Items.plastanium, 90), new ItemStack(Items.silicon, 60));
new Recipe(weapon, TurretBlocks.salvo, new ItemStack(Items.copper, 210), new ItemStack(Items.densealloy, 190), new ItemStack(Items.thorium, 130));
new Recipe(weapon, TurretBlocks.swarmer, new ItemStack(Items.densealloy, 70), new ItemStack(Items.titanium, 70), new ItemStack(Items.plastanium, 90), new ItemStack(Items.silicon, 60));
new Recipe(weapon, TurretBlocks.ripple, new ItemStack(Items.copper, 300), new ItemStack(Items.densealloy, 220), new ItemStack(Items.thorium, 120));
new Recipe(weapon, TurretBlocks.cyclone, new ItemStack(Items.copper, 210), new ItemStack(Items.densealloy, 190), new ItemStack(Items.thorium, 130));
new Recipe(weapon, TurretBlocks.fuse, new ItemStack(Items.copper, 300), new ItemStack(Items.densealloy, 220), new ItemStack(Items.thorium, 120));
//DISTRIBUTION
new Recipe(distribution, DistributionBlocks.conveyor, new ItemStack(Items.copper, 1));
@@ -4,14 +4,11 @@ import io.anuke.mindustry.content.Items;
import io.anuke.mindustry.content.fx.BlockFx;
import io.anuke.mindustry.type.ContentList;
import io.anuke.mindustry.world.Block;
import io.anuke.mindustry.world.blocks.Wall;
import io.anuke.mindustry.world.blocks.defense.DeflectorWall;
import io.anuke.mindustry.world.blocks.defense.Door;
import io.anuke.mindustry.world.blocks.defense.MendProjector;
import io.anuke.mindustry.world.blocks.defense.*;
public class DefenseBlocks extends BlockList implements ContentList{
public static Block copperWall, copperWallLarge, compositeWall, compositeWallLarge, thoriumWall, thoriumWallLarge, door, doorLarge, deflectorwall, deflectorwalllarge,
phaseWall, phaseWallLarge, mendProjector;
phaseWall, phaseWallLarge, surgeWall, surgeWallLarge, mendProjector;
@Override
public void load(){
@@ -62,6 +59,15 @@ public class DefenseBlocks extends BlockList implements ContentList{
size = 2;
}};
surgeWall = new SurgeWall("surge-wall"){{
health = 230 * wallHealthMultiplier;
}};
surgeWallLarge = new SurgeWall("surge-wall-large"){{
health = 230 * 4 * wallHealthMultiplier;
size = 2;
}};
door = new Door("door"){{
health = 100 * wallHealthMultiplier;
}};
@@ -1,6 +1,7 @@
package io.anuke.mindustry.content.blocks;
import com.badlogic.gdx.graphics.Color;
import com.badlogic.gdx.graphics.g2d.TextureRegion;
import io.anuke.mindustry.content.AmmoTypes;
import io.anuke.mindustry.content.fx.ShootFx;
import io.anuke.mindustry.type.AmmoType;
@@ -51,16 +52,26 @@ public class TurretBlocks extends BlockList implements ContentList{
health = 120;
}};
scorch = new LiquidTurret("scorch"){{
ammoTypes = new AmmoType[]{AmmoTypes.basicFlame};
recoil = 0f;
reload = 4f;
shootCone = 50f;
ammoUseEffect = ShootFx.shellEjectSmall;
health = 160;
scorch = new LiquidTurret("scorch"){
protected TextureRegion shootRegion;
drawer = (tile, entity) -> Draw.rect(entity.target != null ? name + "-shoot" : name, tile.drawx() + tr2.x, tile.drawy() + tr2.y, entity.rotation - 90);
}};
@Override
public void load(){
super.load();
shootRegion = Draw.region(name + "-shoot");
}
{
ammoTypes = new AmmoType[]{AmmoTypes.basicFlame};
recoil = 0f;
reload = 4f;
shootCone = 50f;
ammoUseEffect = ShootFx.shellEjectSmall;
health = 160;
drawer = (tile, entity) -> Draw.rect(entity.target != null ? shootRegion : region, tile.drawx() + tr2.x, tile.drawy() + tr2.y, entity.rotation - 90);
}
};
wave = new LiquidTurret("wave"){{
ammoTypes = new AmmoType[]{AmmoTypes.water, AmmoTypes.lava, AmmoTypes.cryofluid, AmmoTypes.oil};
@@ -180,8 +191,16 @@ public class TurretBlocks extends BlockList implements ContentList{
}};
cyclone = new ItemTurret("cyclone"){{
ammoTypes = new AmmoType[]{AmmoTypes.flakLead, AmmoTypes.flakExplosive, AmmoTypes.flakPlastic, AmmoTypes.flakSurge};
ammoTypes = new AmmoType[]{AmmoTypes.flakExplosive, AmmoTypes.flakPlastic, AmmoTypes.flakSurge};
xRand = 4f;
reload = 8f;
range = 140f;
size = 3;
recoil = 3f;
shots = 2;
rotatespeed = 20f;
inaccuracy = 13f;
shootCone = 30f;
}};
fuse = new ItemTurret("fuse"){{
@@ -1,40 +1,31 @@
package io.anuke.mindustry.content.bullets;
import io.anuke.mindustry.entities.bullet.BasicBulletType;
import io.anuke.mindustry.entities.bullet.BulletType;
import io.anuke.mindustry.entities.bullet.FlakBulletType;
import io.anuke.mindustry.type.ContentList;
public class FlakBullets extends BulletList implements ContentList{
public static BulletType lead, plastic, explosive, surge;
public static BulletType plastic, explosive, surge;
@Override
public void load(){
lead = new BasicBulletType(3f, 5, "bullet"){
plastic = new FlakBulletType(4f, 5){
{
bulletWidth = 7f;
bulletHeight = 9f;
}
};
plastic = new BasicBulletType(3f, 5, "bullet"){
explosive = new FlakBulletType(4f, 5){
{
bulletWidth = 7f;
bulletHeight = 9f;
}
};
explosive = new BasicBulletType(3f, 5, "bullet"){
surge = new FlakBulletType(4f, 5){
{
bulletWidth = 7f;
bulletHeight = 9f;
}
};
surge = new BasicBulletType(3f, 5, "bullet"){
{
bulletWidth = 7f;
bulletHeight = 9f;
}
};
}
@@ -12,7 +12,7 @@ import io.anuke.ucore.util.Mathf;
public class BulletFx extends FxList implements ContentList{
public static Effect hitBulletSmall, hitBulletBig, hitFlameSmall, hitLiquid, hitLaser, hitLancer, despawn, flakExplosion, blastExplosion, plasticExplosion,
artilleryTrail, incendTrail, missileTrail, absorb;
artilleryTrail, incendTrail, missileTrail, absorb, flakExplosionBig;
@Override
public void load(){
@@ -197,6 +197,30 @@ public class BulletFx extends FxList implements ContentList{
Lines.circle(e.x, e.y, 5f * e.fout());
Draw.reset();
});
flakExplosionBig = new Effect(30, e -> {
Draw.color(Palette.bulletYellowBack);
e.scaled(6, i -> {
Lines.stroke(3f * i.fout());
Lines.circle(e.x, e.y, 3f + i.fin() * 25f);
});
Draw.color(Color.GRAY);
Angles.randLenVectors(e.id, 6, 2f + 23f * e.finpow(), (x, y) -> {
Fill.circle(e.x + x, e.y + y, e.fout() * 4f + 0.5f);
});
Draw.color(Palette.bulletYellow);
Lines.stroke(1f * e.fout());
Angles.randLenVectors(e.id + 1, 4, 1f + 23f * e.finpow(), (x, y) -> {
Lines.lineAngle(e.x + x, e.y + y, Mathf.atan2(x, y), 1f + e.fout() * 3f);
});
Draw.reset();
});
}
}