Erekir turret balancing changes

This commit is contained in:
Anuken
2025-08-22 00:42:20 -04:00
parent d89450d7e7
commit 32da91e789
7 changed files with 52 additions and 29 deletions

View File

@@ -965,6 +965,7 @@ status.overdrive.name = Overdrive
status.overclock.name = Overclock status.overclock.name = Overclock
status.shocked.name = Shocked status.shocked.name = Shocked
status.blasted.name = Blasted status.blasted.name = Blasted
status.corroded.name = Corroded
status.unmoving.name = Unmoving status.unmoving.name = Unmoving
status.boss.name = Guardian status.boss.name = Guardian

View File

@@ -4392,7 +4392,7 @@ public class Blocks{
hitEffect = despawnEffect = Fx.hitSquaresColor; hitEffect = despawnEffect = Fx.hitSquaresColor;
buildingDamageMultiplier = 0.2f; buildingDamageMultiplier = 0.2f;
}}, }},
Items.oxide, new BasicBulletType(8f, 120){{ Items.oxide, new BasicBulletType(8f, 90){{
knockback = 3f; knockback = 3f;
width = 25f; width = 25f;
hitSize = 7f; hitSize = 7f;
@@ -4655,15 +4655,13 @@ public class Blocks{
reloadMultiplier = 0.65f; reloadMultiplier = 0.65f;
splashDamageRadius = 110f; splashDamageRadius = 110f;
rangeChange = 8f; rangeChange = 8f;
splashDamage = 300f; splashDamage = 150f;
scaledSplashDamage = true; scaledSplashDamage = true;
hitColor = backColor = trailColor = Color.valueOf("a0b380"); hitColor = backColor = trailColor = Color.valueOf("a0b380");
frontColor = Color.valueOf("e4ffd6"); frontColor = Color.valueOf("e4ffd6");
ammoMultiplier = 1f; ammoMultiplier = 1f;
hitSound = Sounds.titanExplosion; hitSound = Sounds.titanExplosion;
status = StatusEffects.blasted;
trailLength = 32; trailLength = 32;
trailWidth = 3.35f; trailWidth = 3.35f;
trailSinScl = 2.5f; trailSinScl = 2.5f;
@@ -4679,23 +4677,8 @@ public class Blocks{
shrinkX = 0.2f; shrinkX = 0.2f;
shrinkY = 0.1f; shrinkY = 0.1f;
buildingDamageMultiplier = 0.25f; buildingDamageMultiplier = 0.25f;
status = StatusEffects.corroded;
fragBullets = 1; statusDuration = 300f;
fragBullet = new EmptyBulletType(){{
lifetime = 60f * 2.5f;
bulletInterval = 20f;
intervalBullet = new EmptyBulletType(){{
splashDamage = 30f;
collidesGround = true;
collidesAir = false;
collides = false;
hitEffect = Fx.none;
pierce = true;
instantDisappear = true;
splashDamageRadius = 90f;
buildingDamageMultiplier = 0.2f;
}};
}};
}} }}
); );
@@ -4932,8 +4915,8 @@ public class Blocks{
}}; }};
afflict = new PowerTurret("afflict"){{ afflict = new PowerTurret("afflict"){{
requirements(Category.turret, with(Items.surgeAlloy, 125, Items.silicon, 200, Items.graphite, 250, Items.oxide, 40)); requirements(Category.turret, with(Items.surgeAlloy, 100, Items.silicon, 200, Items.graphite, 250, Items.oxide, 40));
buildCostMultiplier = 1.5f; buildCostMultiplier = 1f;
shootType = new BasicBulletType(){{ shootType = new BasicBulletType(){{
shootEffect = new MultiEffect(Fx.shootTitan, new WaveEffect(){{ shootEffect = new MultiEffect(Fx.shootTitan, new WaveEffect(){{

View File

@@ -1398,6 +1398,15 @@ public class Fx{
}); });
}).layer(Layer.bullet - 1f), }).layer(Layer.bullet - 1f),
corrosionVapor = new Effect(50f, e -> {
color(e.color);
alpha(Interp.pow2Out.apply(e.fslope()) * 0.5f);
randLenVectors(e.id, 2, 8f + e.finpow() * 3f, (x, y) -> {
Fill.circle(e.x + x, e.y + y, 3f);
});
}),
vapor = new Effect(110f, e -> { vapor = new Effect(110f, e -> {
color(e.color); color(e.color);
alpha(e.fout()); alpha(e.fout());

View File

@@ -191,8 +191,12 @@ public class StatusEffects{
}}; }};
corroded = new StatusEffect("corroded"){{ corroded = new StatusEffect("corroded"){{
color = Pal.plastanium; color = Color.valueOf("e4ffd6");
damage = 0.1f; intervalDamage = 25f;
intervalDamageTime = 30f;
effectChance = 0.1f;
effect = Fx.corrosionVapor;
}}; }};
disarmed = new StatusEffect("disarmed"){{ disarmed = new StatusEffect("disarmed"){{

View File

@@ -61,6 +61,7 @@ abstract class StatusComp implements Posc{
if(!effect.reactive){ if(!effect.reactive){
//otherwise, no opposites found, add direct effect //otherwise, no opposites found, add direct effect
StatusEntry entry = Pools.obtain(StatusEntry.class, StatusEntry::new); StatusEntry entry = Pools.obtain(StatusEntry.class, StatusEntry::new);
entry.damageTime = 0f;
entry.set(effect, duration); entry.set(effect, duration);
applied.set(effect.id); applied.set(effect.id);
statuses.add(entry); statuses.add(entry);
@@ -228,7 +229,7 @@ abstract class StatusComp implements Posc{
disarmed |= entry.effect.disarm; disarmed |= entry.effect.disarm;
entry.effect.update(self(), entry.time); entry.effect.update(self(), entry);
} }
} }
} }

View File

@@ -5,6 +5,8 @@ import mindustry.type.*;
public class StatusEntry{ public class StatusEntry{
public StatusEffect effect; public StatusEffect effect;
public float time; public float time;
//for interval damage
public float damageTime;
//all of these are for the dynamic effect only! //all of these are for the dynamic effect only!
public float damageMultiplier = 1f, healthMultiplier = 1f, speedMultiplier = 1f, reloadMultiplier = 1f, buildSpeedMultiplier = 1f, dragMultiplier = 1f, armorOverride = -1f; public float damageMultiplier = 1f, healthMultiplier = 1f, speedMultiplier = 1f, reloadMultiplier = 1f, buildSpeedMultiplier = 1f, dragMultiplier = 1f, armorOverride = -1f;

View File

@@ -33,6 +33,12 @@ public class StatusEffect extends UnlockableContent{
public boolean disarm = false; public boolean disarm = false;
/** Damage per frame. */ /** Damage per frame. */
public float damage; public float damage;
/** Spacing (in ticks) between interval damage. <=0 to disable. */
public float intervalDamageTime;
/** Damage dealt by interval damage. */
public float intervalDamage;
/** If true, interval damage is armor piercing. */
public boolean intervalDamagePierce = false;
/** Chance of effect appearing. */ /** Chance of effect appearing. */
public float effectChance = 0.15f; public float effectChance = 0.15f;
/** Should the effect be given a parent. */ /** Should the effect be given a parent. */
@@ -98,6 +104,11 @@ public class StatusEffect extends UnlockableContent{
if(damage > 0) stats.add(Stat.damage, damage * 60f, StatUnit.perSecond); if(damage > 0) stats.add(Stat.damage, damage * 60f, StatUnit.perSecond);
if(damage < 0) stats.add(Stat.healing, -damage * 60f, StatUnit.perSecond); if(damage < 0) stats.add(Stat.healing, -damage * 60f, StatUnit.perSecond);
if(intervalDamageTime > 0f && intervalDamage > 0){
stats.add(Stat.damage, intervalDamage);
stats.add(Stat.damage, 60f / intervalDamageTime, StatUnit.perSecond);
}
boolean reacts = false; boolean reacts = false;
for(var e : opposites.toSeq().sort()){ for(var e : opposites.toSeq().sort()){
@@ -131,14 +142,26 @@ public class StatusEffect extends UnlockableContent{
} }
/** Runs every tick on the affected unit while time is greater than 0. */ /** Runs every tick on the affected unit while time is greater than 0. */
public void update(Unit unit, float time){ public void update(Unit unit, StatusEntry entry){
if(damage > 0){ if(damage > 0){
unit.damageContinuousPierce(damage); unit.damageContinuousPierce(damage);
}else if(damage < 0){ //heal unit }else if(damage < 0){ //heal unit
unit.heal(-1f * damage * Time.delta); unit.heal(-1f * damage * Time.delta);
} }
if(effect != Fx.none && Mathf.chanceDelta(effectChance)){ if(intervalDamageTime > 0){
entry.damageTime += Time.delta;
if(entry.damageTime >= intervalDamageTime){
entry.damageTime %= intervalDamageTime;
if(intervalDamagePierce){
unit.damagePierce(intervalDamage);
}else{
unit.damage(intervalDamage);
}
}
}
if(!Vars.headless && effect != Fx.none && Mathf.chanceDelta(effectChance) && !unit.inFogTo(Vars.player.team())){
Tmp.v1.rnd(Mathf.range(unit.type.hitSize/2f)); Tmp.v1.rnd(Mathf.range(unit.type.hitSize/2f));
effect.at(unit.x + Tmp.v1.x, unit.y + Tmp.v1.y, 0, color, parentizeEffect ? unit : null); effect.at(unit.x + Tmp.v1.x, unit.y + Tmp.v1.y, 0, color, parentizeEffect ? unit : null);
} }