Another erekir rebalance pr (#11184)

* wip

* wipp

* real

* aaa

* ae

* oh yeah

* fixx

* wip

* afflict stuff

* this should work ig

* wip

* real

* a

* maybe?

* a

* holy shit

* what the fuck am I doing

* I have children in my basement

* 9

* o

* a

* good enough

* more thor disperse overrange

* no

* fix this

* a

* restore

* ohno

* oh nice

* aaa

* some changes

* FREEDOM

* nvm

* perhaps

* h

* aio

* ya

* should be all

* ig

* almost

* well this works

* more surge scathe hp nerfs

* wip

* drowntime changes

* last tweaks

* last change probs

* quick locus hotfix

* sadedwerwfw

* targetable fix
This commit is contained in:
EggleEgg
2025-09-06 05:10:13 +02:00
committed by GitHub
parent 7464511033
commit 98c56e474f
9 changed files with 140 additions and 42 deletions

View File

@@ -4804,6 +4804,7 @@ public class Blocks{
ammoMultiplier = 1f;
lifetime = 34f;
extraRangeMargin = 32f;
rotationOffset = 90f;
trailRotation = true;
trailEffect = Fx.disperseTrail;
@@ -5160,7 +5161,7 @@ public class Blocks{
fogRadius = 6f;
health = 210;
health = 240;
weapons.add(new Weapon(){{
shootCone = 360f;
@@ -5353,7 +5354,7 @@ public class Blocks{
fogRadius = 6f;
health = 400;
health = 300;
weapons.add(new Weapon(){{
shootCone = 360f;
@@ -5408,7 +5409,7 @@ public class Blocks{
fogRadius = 6f;
health = 100;
health = 50;
weapons.add(new Weapon(){{
shootCone = 360f;

View File

@@ -196,7 +196,7 @@ public class UnitTypes{
mechStepParticles = true;
stepShake = 0.15f;
singleTarget = true;
drownTimeMultiplier = 4f;
drownTimeMultiplier = 1.5f;
abilities.add(new ShieldRegenFieldAbility(25f, 250f, 60f * 1, 60f));
@@ -262,7 +262,7 @@ public class UnitTypes{
armor = 18f;
mechStepParticles = true;
stepShake = 0.75f;
drownTimeMultiplier = 6f;
drownTimeMultiplier = 1.6f;
mechFrontSway = 1.9f;
mechSideSway = 0.6f;
ammoType = new ItemAmmoType(Items.thorium);
@@ -459,7 +459,7 @@ public class UnitTypes{
mechStepParticles = true;
stepShake = 0.15f;
ammoType = new PowerAmmoType(2500);
drownTimeMultiplier = 4f;
drownTimeMultiplier = 1.3f;
speed = 0.44f;
boostMultiplier = 2.4f;
@@ -539,7 +539,7 @@ public class UnitTypes{
armor = 9f;
stepShake = 1.5f;
rotateSpeed = 1.5f;
drownTimeMultiplier = 6f;
drownTimeMultiplier = 1.6f;
legCount = 4;
legLength = 14f;
@@ -770,7 +770,6 @@ public class UnitTypes{
legSplashDamage = 32;
legSplashRange = 30;
drownTimeMultiplier = 2f;
hovering = true;
shadowElevation = 0.65f;
@@ -857,7 +856,6 @@ public class UnitTypes{
lightRadius = 140f;
rotateSpeed = 1.9f;
drownTimeMultiplier = 3f;
legCount = 8;
legMoveSpace = 0.8f;
@@ -2506,6 +2504,7 @@ public class UnitTypes{
health = 850;
armor = 6f;
itemCapacity = 0;
floorMultiplier = 0.95f;
treadRects = new Rect[]{new Rect(12 - 32f, 7 - 32f, 14, 51)};
researchCostMultiplier = 0f;
@@ -2547,6 +2546,7 @@ public class UnitTypes{
health = 2100;
armor = 8f;
itemCapacity = 0;
floorMultiplier = 0.8f;
treadRects = new Rect[]{new Rect(17 - 96f/2f, 10 - 96f/2f, 19, 76)};
researchCostMultiplier = 0f;
@@ -2625,6 +2625,9 @@ public class UnitTypes{
health = 5000;
armor = 11f;
itemCapacity = 0;
floorMultiplier = 0.65f;
drownTimeMultiplier = 1.2f;
immunities.addAll(StatusEffects.burning, StatusEffects.melting);
treadRects = new Rect[]{new Rect(16 - 60f, 48 - 70f, 30, 75), new Rect(44 - 60f, 17 - 70f, 17, 60)};
researchCostMultiplier = 0f;
@@ -2695,6 +2698,9 @@ public class UnitTypes{
armor = 20f;
itemCapacity = 0;
crushDamage = 13f / 5f;
floorMultiplier = 0.5f;
drownTimeMultiplier = 1.25f;
immunities.addAll(StatusEffects.burning, StatusEffects.melting);
treadRects = new Rect[]{new Rect(22 - 154f/2f, 16 - 154f/2f, 28, 130)};
weapons.add(new Weapon("vanquish-weapon"){{
@@ -2791,7 +2797,9 @@ public class UnitTypes{
armor = 26f;
crushDamage = 25f / 5f;
rotateSpeed = 0.8f;
floorMultiplier = 0.3f;
immunities.addAll(StatusEffects.burning, StatusEffects.melting);
float xo = 231f/2f, yo = 231f/2f;
treadRects = new Rect[]{new Rect(27 - xo, 152 - yo, 56, 73), new Rect(24 - xo, 51 - 9 - yo, 29, 17), new Rect(59 - xo, 18 - 9 - yo, 39, 19)};
@@ -3306,7 +3314,7 @@ public class UnitTypes{
drag = 0.1f;
speed = 0.6f;
hitSize = 30f;
health = 7300;
health = 6500;
armor = 5f;
lockLegBase = true;
@@ -3319,14 +3327,15 @@ public class UnitTypes{
abilities.add(new ShieldArcAbility(){{
region = "tecta-shield";
radius = 36f;
radius = 45f;
angle = 82f;
regen = 0.6f;
regen = 40f / 60f;
cooldown = 60f * 8f;
max = 2000f;
max = 2200f;
y = -20f;
width = 6f;
width = 8f;
whenShooting = false;
chanceDeflect = 1f;
}});
rotateSpeed = 2.1f;
@@ -3344,7 +3353,7 @@ public class UnitTypes{
legSplashDamage = 32;
legSplashRange = 30;
drownTimeMultiplier = 2f;
drownTimeMultiplier = 0.5f;
hovering = true;
shadowElevation = 0.4f;
@@ -3435,7 +3444,7 @@ public class UnitTypes{
legSplashDamage = 32;
legSplashRange = 32;
drownTimeMultiplier = 2f;
drownTimeMultiplier = 0.5f;
hovering = true;
shadowElevation = 0.4f;
@@ -3487,7 +3496,7 @@ public class UnitTypes{
bullet = new ArtilleryBulletType(5.5f, 260){{
collidesTiles = collides = true;
lifetime = 70f;
lifetime = 60f;
shootEffect = Fx.shootBigColor;
smokeEffect = Fx.shootSmokeSquareBig;
frontColor = Color.white;
@@ -3495,6 +3504,7 @@ public class UnitTypes{
hitSound = Sounds.none;
width = 18f;
height = 24f;
rangeOverride = 385f;
lightColor = trailColor = hitColor = backColor = Pal.techBlue;
lightRadius = 40f;
@@ -3508,10 +3518,10 @@ public class UnitTypes{
despawnSound = Sounds.dullExplosion;
hitEffect = despawnEffect = new ExplosionEffect(){{
lifetime = 34f;
waveStroke = 4f;
lifetime = 50f;
waveStroke = 5f;
waveColor = sparkColor = trailColor;
waveRad = 25f;
waveRad = 45f;
smokeSize = 0f;
smokeSizeBase = 0f;
sparks = 10;
@@ -3520,8 +3530,8 @@ public class UnitTypes{
sparkStroke = 3f;
}};
splashDamage = 85f;
splashDamageRadius = 20f;
splashDamage = 120f;
splashDamageRadius = 36f;
fragBullets = 15;
fragVelocityMin = 0.5f;
@@ -3529,14 +3539,14 @@ public class UnitTypes{
fragLifeMin = 0.3f;
despawnShake = 5f;
fragBullet = new BasicBulletType(5.5f, 50){{
fragBullet = new BasicBulletType(5.5f, 37){{
pierceCap = 2;
pierceBuilding = true;
homingPower = 0.09f;
homingRange = 150f;
lifetime = 50f;
lifetime = 40f;
shootEffect = Fx.shootBigColor;
smokeEffect = Fx.shootSmokeSquareBig;
frontColor = Color.white;
@@ -3555,7 +3565,7 @@ public class UnitTypes{
collidesAir = false;
despawnEffect = Fx.none;
splashDamage = 46f;
splashDamage = 35f;
splashDamageRadius = 30f;
hitEffect = despawnEffect = new MultiEffect(new ExplosionEffect(){{
@@ -4074,7 +4084,7 @@ public class UnitTypes{
hitSize = 9f;
omniMovement = false;
rotateSpeed = 2.5f;
drownTimeMultiplier = 2f;
drownTimeMultiplier = 1.75f;
segments = 3;
drawBody = false;
hidden = true;
@@ -4094,7 +4104,6 @@ public class UnitTypes{
hitSize = 48f;
omniMovement = false;
rotateSpeed = 1.7f;
drownTimeMultiplier = 4f;
segments = 4;
drawBody = false;
hidden = true;

View File

@@ -1,5 +1,6 @@
package mindustry.entities.abilities;
import arc.audio.*;
import arc.func.*;
import arc.graphics.*;
import arc.graphics.g2d.*;
@@ -9,6 +10,7 @@ import arc.scene.ui.layout.*;
import arc.util.*;
import mindustry.*;
import mindustry.content.*;
import mindustry.entities.*;
import mindustry.gen.*;
import mindustry.graphics.*;
import mindustry.ui.*;
@@ -19,25 +21,86 @@ public class ShieldArcAbility extends Ability{
private static Vec2 paramPos = new Vec2();
private static final Cons<Bullet> shieldConsumer = b -> {
if(b.team != paramUnit.team && b.type.absorbable && paramField.data > 0 &&
!(b.within(paramPos, paramField.radius - paramField.width/2f) && paramPos.within(b.x - b.deltaX, b.y - b.deltaY, paramField.radius - paramField.width/2f)) &&
(Tmp.v1.set(b).add(b.deltaX, b.deltaY).within(paramPos, paramField.radius + paramField.width/2f) || b.within(paramPos, paramField.radius + paramField.width/2f)) &&
!(b.within(paramPos, paramField.radius - paramField.width) && paramPos.within(b.x - b.deltaX, b.y - b.deltaY, paramField.radius - paramField.width)) &&
(Tmp.v1.set(b).add(b.deltaX, b.deltaY).within(paramPos, paramField.radius + paramField.width) || b.within(paramPos, paramField.radius + paramField.width)) &&
(Angles.within(paramPos.angleTo(b), paramUnit.rotation + paramField.angleOffset, paramField.angle / 2f) || Angles.within(paramPos.angleTo(b.x + b.deltaX, b.y + b.deltaY), paramUnit.rotation + paramField.angleOffset, paramField.angle / 2f))){
b.absorb();
Fx.absorb.at(b);
if(paramField.chanceDeflect > 0f && b.vel.len() >= 0.1f && b.type.reflectable && Mathf.chance(paramField.chanceDeflect)){
//break shield
//make sound
paramField.deflectSound.at(paramPos, Mathf.random(0.9f, 1.1f));
//translate bullet back to where it was upon collision
b.trns(-b.vel.x, -b.vel.y);
float penX = Math.abs(paramPos.x - b.x), penY = Math.abs(paramPos.y - b.y);
if(penX > penY){
b.vel.x *= -1;
}else{
b.vel.y *= -1;
}
b.owner = paramUnit;
b.team = paramUnit.team;
b.time += 1f;
}else{
b.absorb();
Fx.absorb.at(b);
}
// break shield
if(paramField.data <= b.damage()){
paramField.data -= paramField.cooldown * paramField.regen;
Fx.arcShieldBreak.at(paramPos.x, paramPos.y, 0, paramField.color == null ? paramUnit.type.shieldColor(paramUnit) : paramField.color, paramUnit);
}
paramField.data -= b.damage();
// shieldDamage for consistency
paramField.data -= b.type.shieldDamage(b);
paramField.alpha = 1f;
}
};
protected static final Cons<Unit> unitConsumer = unit -> {
// ignore core units
if(paramField.data > 0 && unit.targetable(paramUnit.team) &&
!(unit.within(paramPos, paramField.radius - paramField.width) && paramPos.within(unit.x - unit.deltaX, unit.y - unit.deltaY, paramField.radius - paramField.width)) &&
(Tmp.v1.set(unit).add(unit.deltaX, unit.deltaY).within(paramPos, paramField.radius + paramField.width) || unit.within(paramPos, paramField.radius + paramField.width)) &&
(Angles.within(paramPos.angleTo(unit), paramUnit.rotation + paramField.angleOffset, paramField.angle / 2f) || Angles.within(paramPos.angleTo(unit.x + unit.deltaX, unit.y + unit.deltaY), paramUnit.rotation + paramField.angleOffset, paramField.angle / 2f))){
if(unit.isMissile() && unit.killable() && paramField.missileUnitMultiplier >= 0f){
unit.remove();
unit.type.deathSound.at(unit);
unit.type.deathExplosionEffect.at(unit);
Fx.absorb.at(unit);
Fx.circleColorSpark.at(unit.x, unit.y,paramUnit.team.color);
// consider missile hp and gamerule to damage the shield
paramField.data -= unit.health() * paramField.missileUnitMultiplier * Vars.state.rules.unitDamage(unit.team);
paramField.alpha = 1f;
}else{
float reach = paramField.radius + paramField.width;
float overlapDst = reach - unit.dst(paramPos.x,paramPos.y);
if(overlapDst>0){
//stop
unit.vel.setZero();
// get out
unit.move(Tmp.v1.set(unit).sub(paramUnit).setLength(overlapDst + 0.01f));
if(Mathf.chanceDelta(0.5f*Time.delta)){
Fx.circleColorSpark.at(unit.x,unit.y,paramUnit.team.color);
}
}
}
}
};
/** Shield radius. */
public float radius = 60f;
/** Shield regen speed in damage/tick. */
@@ -54,6 +117,12 @@ public class ShieldArcAbility extends Ability{
public boolean whenShooting = true;
/** Width of shield line. */
public float width = 6f;
/** Bullet deflection chance. -1 to disable */
public float chanceDeflect = -1f;
/** Deflection sound. */
public Sound deflectSound = Sounds.none;
/** Multiplier for shield damage taken from missile units. */
public float missileUnitMultiplier = 2f;
/** Whether to draw the arc line. */
public boolean drawArc = true;
@@ -75,6 +144,8 @@ public class ShieldArcAbility extends Ability{
t.add(abilityStat("repairspeed", Strings.autoFixed(regen * 60f, 2)));
t.row();
t.add(abilityStat("cooldown", Strings.autoFixed(cooldown / 60f, 2)));
t.row();
t.add(abilityStat("deflectchance", Strings.autoFixed(chanceDeflect *100f, 2)));
}
@Override
@@ -93,8 +164,9 @@ public class ShieldArcAbility extends Ability{
paramField = this;
paramPos.set(x, y).rotate(unit.rotation - 90f).add(unit);
float reach = radius + width / 2f;
float reach = radius + width;
Groups.bullet.intersect(paramPos.x - reach, paramPos.y - reach, reach * 2f, reach * 2f, shieldConsumer);
Units.nearbyEnemies(paramUnit.team, paramPos.x - reach, paramPos.y - reach, reach * 2f, reach * 2f, unitConsumer);
}else{
widthScale = Mathf.lerpDelta(widthScale, 0f, 0.11f);
}

View File

@@ -56,7 +56,7 @@ abstract class TankComp implements Posc, Hitboxc, Unitc, ElevationMovec{
boolean anyNonDeep = false;
//calculate overlapping tiles so it slows down when going "over" walls
int r = Math.max((int)(hitSize * 0.6f / tilesize), 0);
int r = Math.max((int)(hitSize * 0.75f / tilesize), 0);
int solids = 0, total = (r*2+1)*(r*2+1);
for(int dx = -r; dx <= r; dx++){
@@ -104,7 +104,7 @@ abstract class TankComp implements Posc, Hitboxc, Unitc, ElevationMovec{
public float floorSpeedMultiplier(){
Floor on = isFlying() || type.hovering ? Blocks.air.asFloor() : floorOn();
//TODO take into account extra blocks
return on.speedMultiplier * speedMultiplier * lastSlowdown;
return (float)Math.pow(on.speedMultiplier, type.floorMultiplier) * speedMultiplier * lastSlowdown;
}
@Replace

View File

@@ -606,7 +606,7 @@ abstract class UnitComp implements Healthc, Physicsc, Hitboxc, Statusc, Teamc, I
if(floor != null && floor.isLiquid && floor.drownTime > 0 && canDrown()){
lastDrownFloor = floor;
drownTime += Time.delta / floor.drownTime / type.drownTimeMultiplier;
drownTime += Time.delta / (hitSize / 8f * type.drownTimeMultiplier * floor.drownTime);
if(Mathf.chanceDelta(0.05f)){
floor.drownUpdateEffect.at(x, y, hitSize, floor.mapColor);
}

View File

@@ -439,6 +439,8 @@ public class UnitType extends UnlockableContent implements Senseable{
public int treadFrames = 18;
/** how much of a top part of a tread sprite is "cut off" relative to the pattern; this is corrected for */
public int treadPullOffset = 0;
/** how affected this unit is by terrain */
public float floorMultiplier = 1f;
//SEGMENTED / CRAWL UNITS (this is WIP content!)
@@ -743,6 +745,11 @@ public class UnitType extends UnlockableContent implements Senseable{
stats.add(Stat.size, StatValues.squared(hitSize / tilesize, StatUnit.blocks));
stats.add(Stat.itemCapacity, itemCapacity);
stats.add(Stat.range, Strings.autoFixed(maxRange / tilesize, 1), StatUnit.blocks);
if(crushDamage > 0){
stats.add(Stat.crushDamage, crushDamage * 60f * 5f, StatUnit.perSecond);
}
stats.add(Stat.targetsAir, targetAir);
stats.add(Stat.targetsGround, targetGround);

View File

@@ -28,6 +28,7 @@ public class RepairTower extends Block{
super(name);
update = true;
solid = true;
suppressable = true;
}
@Override
@@ -64,6 +65,11 @@ public class RepairTower extends Block{
});
}
if(checkSuppression()){
warmup = 0f;
return;
}
boolean any = false;
if(efficiency > 0){
for(var target : targets){

View File

@@ -82,6 +82,7 @@ public class Stat implements Comparable<Stat>{
inaccuracy = new Stat("inaccuracy", StatCat.function),
shots = new Stat("shots", StatCat.function),
reload = new Stat("reload", StatCat.function),
crushDamage = new Stat("crushDamage", StatCat.function),
targetsAir = new Stat("targetsAir", StatCat.function),
targetsGround = new Stat("targetsGround", StatCat.function),
damage = new Stat("damage", StatCat.function),