Hastily implemented final endgame turret

This commit is contained in:
Anuken 2022-07-09 00:33:15 -04:00
parent 8b0a86e883
commit 311118ae58
41 changed files with 349 additions and 34 deletions

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 962 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 943 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 997 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 966 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 631 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 631 B

View File

Before

Width:  |  Height:  |  Size: 1.1 KiB

After

Width:  |  Height:  |  Size: 1.1 KiB

View File

Before

Width:  |  Height:  |  Size: 1.1 KiB

After

Width:  |  Height:  |  Size: 1.1 KiB

View File

Before

Width:  |  Height:  |  Size: 1.3 KiB

After

Width:  |  Height:  |  Size: 1.3 KiB

View File

Before

Width:  |  Height:  |  Size: 506 B

After

Width:  |  Height:  |  Size: 506 B

View File

Before

Width:  |  Height:  |  Size: 506 B

After

Width:  |  Height:  |  Size: 506 B

View File

Before

Width:  |  Height:  |  Size: 3.4 KiB

After

Width:  |  Height:  |  Size: 3.4 KiB

View File

Before

Width:  |  Height:  |  Size: 1.1 KiB

After

Width:  |  Height:  |  Size: 1.1 KiB

View File

Before

Width:  |  Height:  |  Size: 1.1 KiB

After

Width:  |  Height:  |  Size: 1.1 KiB

View File

Before

Width:  |  Height:  |  Size: 945 B

After

Width:  |  Height:  |  Size: 945 B

View File

Before

Width:  |  Height:  |  Size: 921 B

After

Width:  |  Height:  |  Size: 921 B

View File

Before

Width:  |  Height:  |  Size: 1.5 KiB

After

Width:  |  Height:  |  Size: 1.5 KiB

View File

Before

Width:  |  Height:  |  Size: 1.7 KiB

After

Width:  |  Height:  |  Size: 1.7 KiB

View File

Before

Width:  |  Height:  |  Size: 5.9 KiB

After

Width:  |  Height:  |  Size: 5.9 KiB

View File

Before

Width:  |  Height:  |  Size: 1.5 KiB

After

Width:  |  Height:  |  Size: 1.5 KiB

View File

Before

Width:  |  Height:  |  Size: 382 B

After

Width:  |  Height:  |  Size: 382 B

View File

Before

Width:  |  Height:  |  Size: 382 B

After

Width:  |  Height:  |  Size: 382 B

View File

@ -1626,7 +1626,8 @@ block.prime-refabricator.name = Prime Refabricator
block.unit-repair-tower.name = Unit Repair Tower
block.diffuse.name = Diffuse
block.basic-assembler-module.name = Basic Assembler Module
block.ravage.name = Ravage
block.smite.name = Smite
block.malign.name = Malign
block.switch.name = Switch
block.micro-processor.name = Micro Processor

View File

@ -573,4 +573,5 @@
63111=scathe-missile|unit-scathe-missile-ui
63110=ravage|block-ravage-ui
63109=underflow-duct|block-underflow-duct-ui
63108=divine|block-divine-ui
63108=malign|block-malign-ui
63107=smite|block-smite-ui

Binary file not shown.

View File

@ -136,7 +136,7 @@ public class Blocks{
duo, scatter, scorch, hail, arc, wave, lancer, swarmer, salvo, fuse, ripple, cyclone, foreshadow, spectre, meltdown, segment, parallax, tsunami,
//turrets - erekir
breach, diffuse, sublimate, titan, disperse, afflict, lustre, scathe, ravage, divine,
breach, diffuse, sublimate, titan, disperse, afflict, lustre, scathe, smite, malign,
//units
groundFactory, airFactory, navalFactory,
@ -4434,7 +4434,7 @@ public class Blocks{
limitRange();
}};
ravage = new ItemTurret("ravage"){{
smite = new ItemTurret("smite"){{
requirements(Category.turret, with(Items.beryllium, 150, Items.silicon, 150, Items.carbide, 250, Items.phaseFabric, 100));
ammo(
@ -4443,7 +4443,6 @@ public class Blocks{
sprite = "large-orb";
width = 17f;
height = 21f;
hitSize = 7f;
hitSize = 8f;
shootEffect = new MultiEffect(Fx.shootTitan, Fx.colorSparkBig, new WaveEffect(){{
@ -4453,7 +4452,7 @@ public class Blocks{
strokeFrom = 3f;
strokeTo = 0.3f;
}});
smokeEffect = Fx.shootSmokeRavage;
smokeEffect = Fx.shootSmokeSmite;
ammoMultiplier = 1;
pierceCap = 4;
pierce = true;
@ -4685,7 +4684,7 @@ public class Blocks{
}
}};
shootWarmupSpeed = 0.05f;
shootWarmupSpeed = 0.04f;
shootY = 15f;
outlineColor = Pal.darkOutline;
size = 5;
@ -4701,44 +4700,332 @@ public class Blocks{
limitRange();
}};
if(false)
divine = new PowerTurret("divine"){{
malign = new PowerTurret("malign"){{
requirements(Category.turret, with(Items.beryllium, 150, Items.silicon, 150, Items.graphite, 250, Items.phaseFabric, 300));
shootType = new BasicBulletType(7.5f, 85){{
var haloProgress = PartProgress.warmup;
Color haloColor = Color.valueOf("d370d3"), heatCol = Color.purple;
float haloY = -15f, haloRotSpeed = 1.5f;
var circleProgress = PartProgress.warmup.delay(0.9f);
var circleColor = haloColor;
float circleY = 25f, circleRad = 11f, circleRotSpeed = 3.5f, circleStroke = 1.6f;
shootType = new FlakBulletType(8f, 80f){{
sprite = "missile-large";
lifetime = 45f;
width = 12f;
height = 22f;
hitSize = 7f;
height = 20f;
shootEffect = Fx.shootBig2;
smokeEffect = Fx.shootBigSmoke;
shootEffect = Fx.shootSmokeSquareBig;
smokeEffect = Fx.shootSmokeDisperse;
ammoMultiplier = 1;
pierceCap = 2;
pierce = true;
pierceBuilding = true;
hitColor = backColor = trailColor = Pal.berylShot;
hitColor = backColor = trailColor = lightningColor = circleColor;
frontColor = Color.white;
trailWidth = 2.1f;
trailLength = 10;
trailWidth = 3f;
trailLength = 12;
hitEffect = despawnEffect = Fx.hitBulletColor;
buildingDamageMultiplier = 0.3f;
trailEffect = Fx.colorSpark;
trailRotation = true;
trailInterval = 3f;
lightning = 1;
lightningCone = 15f;
lightningLength = 20;
lightningLengthRand = 30;
lightningDamage = 20f;
homingPower = 0.17f;
homingDelay = 19f;
homingRange = 160f;
explodeRange = 160f;
explodeDelay = 0f;
flakInterval = 20f;
despawnShake = 3f;
fragBullet = new LaserBulletType(90f){{
colors = new Color[]{haloColor.cpy().a(0.4f), haloColor, Color.white};
buildingDamageMultiplier = 0.25f;
width = 19f;
hitEffect = Fx.hitLancer;
sideAngle = 175f;
sideWidth = 1f;
sideLength = 40f;
lifetime = 16f;
drawSize = 400f;
length = 180f;
pierceCap = 2;
}};
heatRequirement = 30f;
consumePower(5f);
fragSpread = fragRandomSpread = 0f;
splashDamage = 0f;
hitEffect = Fx.hitSquaresColor;
collidesGround = true;
}};
size = 5;
drawer = new DrawTurret("reinforced-");
drawer = new DrawTurret("reinforced-"){{
parts.addAll(
//summoning circle
new ShapePart(){{
progress = circleProgress;
color = circleColor;
circle = true;
hollow = true;
stroke = 0f;
strokeTo = circleStroke;
radius = circleRad;
layer = Layer.effect;
y = circleY;
}},
new ShapePart(){{
progress = circleProgress;
rotateSpeed = -circleRotSpeed;
color = circleColor;
sides = 4;
hollow = true;
stroke = 0f;
strokeTo = circleStroke;
radius = circleRad - 1f;
layer = Layer.effect;
y = circleY;
}},
//outer squares
new ShapePart(){{
progress = circleProgress;
rotateSpeed = -circleRotSpeed;
color = circleColor;
sides = 4;
hollow = true;
stroke = 0f;
strokeTo = circleStroke;
radius = circleRad - 1f;
layer = Layer.effect;
y = circleY;
}},
//inner square
new ShapePart(){{
progress = circleProgress;
rotateSpeed = -circleRotSpeed/2f;
color = circleColor;
sides = 4;
hollow = true;
stroke = 0f;
strokeTo = 2f;
radius = 3f;
layer = Layer.effect;
y = circleY;
}},
//spikes on circle
new HaloPart(){{
progress = circleProgress;
color = circleColor;
tri = true;
shapes = 3;
triLength = 0f;
triLengthTo = 5f;
radius = 6f;
haloRadius = circleRad;
haloRotateSpeed = haloRotSpeed / 2f;
shapeRotation = 180f;
haloRotation = 180f;
layer = Layer.effect;
y = circleY;
}},
//actual turret
new RegionPart("-mouth"){{
heatColor = heatCol;
heatProgress = PartProgress.warmup;
moveY = -8f;
}},
new RegionPart("-end"){{
moveY = 0f;
}},
new RegionPart("-front"){{
heatColor = heatCol;
heatProgress = PartProgress.warmup;
mirror = true;
moveRot = 33f;
moveY = -4f;
moveX = 10f;
}},
new RegionPart("-back"){{
heatColor = heatCol;
heatProgress = PartProgress.warmup;
mirror = true;
moveRot = 10f;
moveX = 2f;
moveY = 5f;
}},
new RegionPart("-mid"){{
heatColor = heatCol;
heatProgress = PartProgress.recoil;
moveY = -9.5f;
}},
new ShapePart(){{
progress = haloProgress;
color = haloColor;
circle = true;
hollow = true;
stroke = 0f;
strokeTo = 2f;
radius = 10f;
layer = Layer.effect;
y = haloY;
}},
new ShapePart(){{
progress = haloProgress;
color = haloColor;
sides = 3;
rotation = 90f;
hollow = true;
stroke = 0f;
strokeTo = 2f;
radius = 4f;
layer = Layer.effect;
y = haloY;
}},
new HaloPart(){{
progress = haloProgress;
color = haloColor;
sides = 3;
shapes = 3;
hollow = true;
stroke = 0f;
strokeTo = 2f;
radius = 3f;
haloRadius = 10f + radius/2f;
haloRotateSpeed = haloRotSpeed;
layer = Layer.effect;
y = haloY;
}},
new HaloPart(){{
progress = haloProgress;
color = haloColor;
tri = true;
shapes = 3;
triLength = 0f;
triLengthTo = 10f;
radius = 6f;
haloRadius = 16f;
haloRotation = 180f;
layer = Layer.effect;
y = haloY;
}},
new HaloPart(){{
progress = haloProgress;
color = haloColor;
tri = true;
shapes = 3;
triLength = 0f;
triLengthTo = 3f;
radius = 6f;
haloRadius = 16f;
shapeRotation = 180f;
haloRotation = 180f;
layer = Layer.effect;
y = haloY;
}},
new HaloPart(){{
progress = haloProgress;
color = haloColor;
sides = 3;
tri = true;
shapes = 3;
triLength = 0f;
triLengthTo = 10f;
shapeRotation = 180f;
radius = 6f;
haloRadius = 16f;
haloRotateSpeed = -haloRotSpeed;
haloRotation = 180f / 3f;
layer = Layer.effect;
y = haloY;
}},
new HaloPart(){{
progress = haloProgress;
color = haloColor;
sides = 3;
tri = true;
shapes = 3;
triLength = 0f;
triLengthTo = 4f;
radius = 6f;
haloRadius = 16f;
haloRotateSpeed = -haloRotSpeed;
haloRotation = 180f / 3f;
layer = Layer.effect;
y = haloY;
}}
);
Color heatCol2 = heatCol.cpy().add(0.1f, 0.1f, 0.1f).mul(1.2f);
for(int i = 1; i < 4; i++){
int fi = i;
parts.add(new RegionPart("-spine"){{
outline = false;
progress = PartProgress.warmup.delay(fi / 5f);
heatProgress = PartProgress.warmup.add(p -> (Mathf.absin(3f, 0.2f) - 0.2f) * p.warmup);
mirror = true;
under = true;
layerOffset = -0.3f;
turretHeatLayer = Layer.turret - 0.2f;
moveY = 9f;
moveX = 1f + fi * 4f;
moveRot = fi * 60f - 130f;
color = Color.valueOf("bb68c3");
heatColor = heatCol2;
moves.add(new PartMove(PartProgress.recoil.delay(fi / 5f), 1f, 0f, 3f));
}});
}
}};
velocityRnd = 0.15f;
heatRequirement = 90f;
maxHeatEfficiency = 2f;
consumePower(5f);
shoot = new ShootSummon(0f, 0f, circleRad, 48f);
minWarmup = 0.96f;
shootWarmupSpeed = 0.03f;
shootY = circleY - 5f;
outlineColor = Pal.darkOutline;
envEnabled |= Env.space;
reload = 200f;
recoil = 2f;
range = 350;
reload = 8f;
range = 370;
shootCone = 100f;
scaledHealth = 370;
rotateSpeed = 2f;
coolant = consume(new ConsumeLiquid(Liquids.water, 15f / 60f));
limitRange(5f);
recoil = 0.5f;
recoilTime = 30f;
shake = 3f;
}};
//endregion

View File

@ -1611,7 +1611,7 @@ public class Fx{
}
}),
shootSmokeRavage = new Effect(70f, e -> {
shootSmokeSmite = new Effect(70f, e -> {
rand.setSeed(e.id);
for(int i = 0; i < 13; i++){
float a = e.rotation + rand.range(30f);

View File

@ -6,7 +6,7 @@ import mindustry.entities.*;
import mindustry.gen.*;
public class FlakBulletType extends BasicBulletType{
public float explodeRange = 30f, explodeDelay = 5f;
public float explodeRange = 30f, explodeDelay = 5f, flakInterval = 6f;
public FlakBulletType(float speed, float damage){
super(speed, damage, "shell");
@ -27,12 +27,12 @@ public class FlakBulletType extends BasicBulletType{
super.update(b);
//don't check for targets if primed to explode
if(b.fdata >= 0 && b.timer(2, 6)){
if(b.fdata >= 0 && b.timer(2, flakInterval)){
Units.nearbyEnemies(b.team, Tmp.r1.setSize(explodeRange * 2f).setCenter(b.x, b.y), unit -> {
//fadata < 0 means it's primed to explode
if(b.fdata < 0f || !unit.checkTarget(collidesAir, collidesGround)) return;
if(unit.within(b, explodeRange)){
if(unit.within(b, explodeRange + unit.hitSize/2f)){
//mark as primed
b.fdata = -1f;
Time.run(explodeDelay, () -> {

View File

@ -0,0 +1,26 @@
package mindustry.entities.pattern;
import arc.math.*;
import arc.util.*;
public class ShootSummon extends ShootPattern{
public float x, y, radius, spread;
public ShootSummon(float x, float y, float radius, float spread){
this.x = x;
this.y = y;
this.radius = radius;
this.spread = spread;
}
@Override
public void shoot(int totalShots, BulletHandler handler){
for(int i = 0; i < shots; i++){
Tmp.v1.trns(Mathf.random(360f), Mathf.random(radius));
handler.shoot(x + Tmp.v1.x, y + Tmp.v1.y, Mathf.range(spread), firstShotDelay + shotDelay * i);
}
}
}

View File

@ -345,9 +345,9 @@ public class Turret extends ReloadTurret{
float warmupTarget = isShooting() && canConsume() ? 1f : 0f;
if(linearWarmup){
shootWarmup = Mathf.approachDelta(shootWarmup, warmupTarget, shootWarmupSpeed);
shootWarmup = Mathf.approachDelta(shootWarmup, warmupTarget, shootWarmupSpeed * (warmupTarget > 0 ? efficiency : 1f));
}else{
shootWarmup = Mathf.lerpDelta(shootWarmup, warmupTarget, shootWarmupSpeed);
shootWarmup = Mathf.lerpDelta(shootWarmup, warmupTarget, shootWarmupSpeed * (warmupTarget > 0 ? efficiency : 1f));
}
wasShooting = false;