Fuse shot implemented

This commit is contained in:
Anuken
2018-08-28 19:00:29 -04:00
parent 5416ad33bd
commit 8c6ae2576d
9 changed files with 43 additions and 14 deletions
@@ -131,7 +131,7 @@ public class AmmoTypes implements ContentList{
flakSurge = new AmmoType(Items.surgealloy, FlakBullets.surge, 5){{
shootEffect = ShootFx.shootBig;
smokeEffect = ShootFx.shootBigSmoke;
reloadMultiplier = 2f;
reloadMultiplier = 1/2f;
}};
//missiles
@@ -201,7 +201,7 @@ public class AmmoTypes implements ContentList{
meltdownLaser = new AmmoType(TurretBullets.lancerLaser);
fuseShotgun = new AmmoType(Items.densealloy, TurretBullets.fuseShot, 1f){{
shootEffect = ShootFx.shootBig2;
shootEffect = Fx.none;
smokeEffect = ShootFx.shootBigSmoke2;
}};
@@ -207,8 +207,7 @@ public class TurretBlocks extends BlockList implements ContentList{
range = 140f;
size = 3;
recoil = 3f;
shots = 2;
rotatespeed = 20f;
rotatespeed = 10f;
inaccuracy = 13f;
shootCone = 30f;
}};
@@ -218,7 +217,9 @@ public class TurretBlocks extends BlockList implements ContentList{
ammoTypes = new AmmoType[]{AmmoTypes.fuseShotgun};
reload = 50f;
shootShake = 4f;
range = 70f;
range = 80f;
recoil = 5f;
restitution = 0.1f;
size = 3;
}};
@@ -160,13 +160,13 @@ public class TurretBullets extends BulletList implements ContentList{
}
};
fuseShot = new BulletType(0.01f, 0){
fuseShot = new BulletType(0.01f, 60){
int rays = 3;
float raySpace = 2f;
float rayLength = 70f;
float rayLength = 80f;
{
hiteffect = BulletFx.hitBulletBig;
lifetime = 10f;
hiteffect = BulletFx.hitFuse;
lifetime = 13f;
despawneffect = Fx.none;
pierce = true;
}
@@ -184,7 +184,14 @@ public class TurretBullets extends BulletList implements ContentList{
public void draw(Bullet b) {
super.draw(b);
Draw.color(Color.WHITE, Palette.surge, b.fin());
Shapes.tri(b.x, b.y, 12f, (rayLength+10) * b.fout(), b.angle());
for(int i = 0; i < 7; i++){
vector.trns(b.angle(), i * 8f);
float sl = Mathf.clamp(b.fout()-0.5f) * (80f - i *10);
Shapes.tri(b.x + vector.x, b.y + vector.y, 4f, sl, b.angle() + 90);
Shapes.tri(b.x + vector.x, b.y + vector.y, 4f, sl, b.angle() - 90);
}
Shapes.tri(b.x, b.y, 13f, (rayLength+50) * b.fout(), b.angle());
Shapes.tri(b.x, b.y, 13f, 10f * b.fout(), b.angle() + 180f);
Draw.reset();
}
@@ -11,7 +11,7 @@ import io.anuke.ucore.util.Angles;
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,
public static Effect hitBulletSmall, hitFuse, hitBulletBig, hitFlameSmall, hitLiquid, hitLaser, hitLancer, despawn, flakExplosion, blastExplosion, plasticExplosion,
artilleryTrail, incendTrail, missileTrail, absorb, flakExplosionBig, plasticExplosionFlak;
@Override
@@ -36,6 +36,25 @@ public class BulletFx extends FxList implements ContentList{
Draw.reset();
});
hitFuse = new Effect(14, e -> {
Draw.color(Color.WHITE, Palette.surge, e.fin());
e.scaled(7f, s -> {
Lines.stroke(0.5f + s.fout());
Lines.circle(e.x, e.y, s.fin()*7f);
});
Lines.stroke(0.5f + e.fout());
Angles.randLenVectors(e.id, 6, e.fin() * 15f, (x, y) -> {
float ang = Mathf.atan2(x, y);
Lines.lineAngle(e.x + x, e.y + y, ang, e.fout() * 3 + 1f);
});
Draw.reset();
});
hitBulletBig = new Effect(13, e -> {
Draw.color(Color.WHITE, Palette.lightOrange, e.fin());
Lines.stroke(0.5f + e.fout() * 1.5f);
@@ -52,6 +52,7 @@ public abstract class Turret extends Block{
protected float reload = 10f;
protected float inaccuracy = 0f;
protected int shots = 1;
protected float spread = 4f;
protected float recoil = 1f;
protected float restitution = 0.02f;
protected float cooldown = 0.02f;
@@ -278,7 +279,9 @@ public abstract class Turret extends Block{
tr.trns(entity.rotation, size * tilesize / 2, Mathf.range(xRand));
bullet(tile, ammo.bullet, entity.rotation + Mathf.range(inaccuracy + type.inaccuracy));
for(int i = 0; i < shots; i++){
bullet(tile, ammo.bullet, entity.rotation + Mathf.range(inaccuracy + type.inaccuracy) + (i-shots/2) * spread);
}
effects(tile);
useAmmo(tile);