Implemented ammo types for cyclone

This commit is contained in:
Anuken
2018-08-28 12:12:08 -04:00
parent 8d08d25f5b
commit 1e25ba2d8e
5 changed files with 88 additions and 32 deletions
@@ -131,6 +131,7 @@ public class AmmoTypes implements ContentList{
flakSurge = new AmmoType(Items.surgealloy, FlakBullets.surge, 5){{ flakSurge = new AmmoType(Items.surgealloy, FlakBullets.surge, 5){{
shootEffect = ShootFx.shootBig; shootEffect = ShootFx.shootBig;
smokeEffect = ShootFx.shootBigSmoke; smokeEffect = ShootFx.shootBigSmoke;
reloadMultiplier = 2f;
}}; }};
//missiles //missiles
@@ -11,7 +11,6 @@ import io.anuke.mindustry.world.blocks.defense.turrets.*;
import io.anuke.ucore.graphics.Draw; import io.anuke.ucore.graphics.Draw;
import io.anuke.ucore.util.Angles; import io.anuke.ucore.util.Angles;
import io.anuke.ucore.util.Mathf; import io.anuke.ucore.util.Mathf;
import io.anuke.ucore.util.Strings;
public class TurretBlocks extends BlockList implements ContentList{ public class TurretBlocks extends BlockList implements ContentList{
public static Block duo, /*scatter,*/ public static Block duo, /*scatter,*/
@@ -142,7 +141,17 @@ public class TurretBlocks extends BlockList implements ContentList{
health = 380; health = 380;
}}; }};
salvo = new BurstTurret("salvo"){{ salvo = new BurstTurret("salvo"){
TextureRegion[] panels = new TextureRegion[2];
@Override
public void load() {
super.load();
panels[0] = Draw.region(name + "-panel-left");
panels[1] = Draw.region(name + "-panel-right");
}
{
size = 2; size = 2;
range = 120f; range = 120f;
ammoTypes = new AmmoType[]{AmmoTypes.bulletCopper, AmmoTypes.bulletDense, AmmoTypes.bulletPyratite, AmmoTypes.bulletThorium, AmmoTypes.bulletSilicon}; ammoTypes = new AmmoType[]{AmmoTypes.bulletCopper, AmmoTypes.bulletDense, AmmoTypes.bulletPyratite, AmmoTypes.bulletThorium, AmmoTypes.bulletSilicon};
@@ -163,14 +172,15 @@ public class TurretBlocks extends BlockList implements ContentList{
for(int i : Mathf.signs){ for(int i : Mathf.signs){
float rot = entity.rotation + 90 * i; float rot = entity.rotation + 90 * i;
Draw.rect(name + "-panel-" + Strings.dir(i), Draw.rect(panels[i == -1 ? 0 : 1],
tile.drawx() + tr2.x + Angles.trnsx(rot, offsetx, offsety), tile.drawx() + tr2.x + Angles.trnsx(rot, offsetx, offsety),
tile.drawy() + tr2.y + Angles.trnsy(rot, -offsetx, offsety), entity.rotation - 90); tile.drawy() + tr2.y + Angles.trnsy(rot, -offsetx, offsety), entity.rotation - 90);
} }
}; };
health = 360; health = 360;
}}; }
};
ripple = new ArtilleryTurret("ripple"){{ ripple = new ArtilleryTurret("ripple"){{
ammoTypes = new AmmoType[]{AmmoTypes.artilleryDense, AmmoTypes.artilleryHoming, AmmoTypes.artilleryIncindiary, AmmoTypes.artilleryExplosive, AmmoTypes.artilleryPlastic}; ammoTypes = new AmmoType[]{AmmoTypes.artilleryDense, AmmoTypes.artilleryHoming, AmmoTypes.artilleryIncindiary, AmmoTypes.artilleryExplosive, AmmoTypes.artilleryPlastic};
@@ -193,7 +203,7 @@ public class TurretBlocks extends BlockList implements ContentList{
cyclone = new ItemTurret("cyclone"){{ cyclone = new ItemTurret("cyclone"){{
ammoTypes = new AmmoType[]{AmmoTypes.flakExplosive, AmmoTypes.flakPlastic, AmmoTypes.flakSurge}; ammoTypes = new AmmoType[]{AmmoTypes.flakExplosive, AmmoTypes.flakPlastic, AmmoTypes.flakSurge};
xRand = 4f; xRand = 4f;
reload = 8f; reload = 10f;
range = 140f; range = 140f;
size = 3; size = 3;
recoil = 3f; recoil = 3f;
@@ -1,6 +1,7 @@
package io.anuke.mindustry.content.bullets; package io.anuke.mindustry.content.bullets;
import io.anuke.mindustry.content.fx.BulletFx; import io.anuke.mindustry.content.fx.BulletFx;
import io.anuke.mindustry.content.fx.Fx;
import io.anuke.mindustry.entities.bullet.ArtilleryBulletType; import io.anuke.mindustry.entities.bullet.ArtilleryBulletType;
import io.anuke.mindustry.entities.bullet.BasicBulletType; import io.anuke.mindustry.entities.bullet.BasicBulletType;
import io.anuke.mindustry.entities.bullet.BulletType; import io.anuke.mindustry.entities.bullet.BulletType;
@@ -33,6 +34,7 @@ public class ArtilleryBullets extends BulletList implements ContentList{
lifetime = 15f; lifetime = 15f;
backColor = Palette.plastaniumBack; backColor = Palette.plastaniumBack;
frontColor = Palette.plastaniumFront; frontColor = Palette.plastaniumFront;
despawneffect = Fx.none;
} }
}; };
@@ -1,8 +1,13 @@
package io.anuke.mindustry.content.bullets; package io.anuke.mindustry.content.bullets;
import io.anuke.mindustry.content.fx.BulletFx;
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.entities.bullet.FlakBulletType; import io.anuke.mindustry.entities.bullet.FlakBulletType;
import io.anuke.mindustry.entities.effect.Lightning;
import io.anuke.mindustry.graphics.Palette;
import io.anuke.mindustry.type.ContentList; import io.anuke.mindustry.type.ContentList;
import io.anuke.ucore.util.Mathf;
public class FlakBullets extends BulletList implements ContentList{ public class FlakBullets extends BulletList implements ContentList{
public static BulletType plastic, explosive, surge; public static BulletType plastic, explosive, surge;
@@ -13,19 +18,33 @@ public class FlakBullets extends BulletList implements ContentList{
plastic = new FlakBulletType(4f, 5){ plastic = new FlakBulletType(4f, 5){
{ {
splashDamageRadius = 40f;
fragBullet = ArtilleryBullets.plasticFrag;
fragBullets = 4;
hiteffect = BulletFx.plasticExplosion;
frontColor = Palette.plastaniumFront;
backColor = Palette.plastaniumBack;
} }
}; };
explosive = new FlakBulletType(4f, 5){ explosive = new FlakBulletType(4f, 5){
{ {
//default bullet type, no changes
} }
}; };
surge = new FlakBulletType(4f, 5){ surge = new FlakBulletType(4f, 7){
{ {
splashDamage = 33f;
}
@Override
public void despawned(Bullet b) {
super.despawned(b);
for (int i = 0; i < 2; i++) {
Lightning.create(b.getTeam(), BulletFx.hitLancer, Palette.surge, damage, b.x, b.y, Mathf.random(360f), 12);
}
} }
}; };
} }
@@ -12,7 +12,7 @@ import io.anuke.ucore.util.Mathf;
public class BulletFx extends FxList implements ContentList{ public class BulletFx extends FxList implements ContentList{
public static Effect hitBulletSmall, hitBulletBig, hitFlameSmall, hitLiquid, hitLaser, hitLancer, despawn, flakExplosion, blastExplosion, plasticExplosion, public static Effect hitBulletSmall, hitBulletBig, hitFlameSmall, hitLiquid, hitLaser, hitLancer, despawn, flakExplosion, blastExplosion, plasticExplosion,
artilleryTrail, incendTrail, missileTrail, absorb, flakExplosionBig; artilleryTrail, incendTrail, missileTrail, absorb, flakExplosionBig, plasticExplosionFlak;
@Override @Override
public void load(){ public void load(){
@@ -149,6 +149,30 @@ public class BulletFx extends FxList implements ContentList{
Draw.reset(); Draw.reset();
}); });
plasticExplosionFlak = new Effect(28, e -> {
Draw.color(Palette.plastaniumFront);
e.scaled(7, i -> {
Lines.stroke(3f * i.fout());
Lines.circle(e.x, e.y, 3f + i.fin() * 34f);
});
Draw.color(Color.GRAY);
Angles.randLenVectors(e.id, 7, 2f + 30f * e.finpow(), (x, y) -> {
Fill.circle(e.x + x, e.y + y, e.fout() * 4f + 0.5f);
});
Draw.color(Palette.plastaniumBack);
Lines.stroke(1f * e.fout());
Angles.randLenVectors(e.id + 1, 4, 1f + 30f * e.finpow(), (x, y) -> {
Lines.lineAngle(e.x + x, e.y + y, Mathf.atan2(x, y), 1f + e.fout() * 3f);
});
Draw.reset();
});
blastExplosion = new Effect(22, e -> { blastExplosion = new Effect(22, e -> {
Draw.color(Palette.missileYellow); Draw.color(Palette.missileYellow);