From 28d2243abc71d6745ad2a660ea224c0e16beec67 Mon Sep 17 00:00:00 2001 From: Anuken Date: Thu, 20 Aug 2020 23:36:27 -0400 Subject: [PATCH] Bugfixes, balancing --- core/src/mindustry/content/Blocks.java | 4 ++-- core/src/mindustry/content/UnitTypes.java | 21 ++++++++++--------- core/src/mindustry/core/NetServer.java | 4 ++-- .../entities/abilities/ForceFieldAbility.java | 9 +++++++- .../mindustry/entities/comp/WeaponsComp.java | 3 ++- .../world/blocks/payloads/UnitPayload.java | 3 --- 6 files changed, 25 insertions(+), 19 deletions(-) diff --git a/core/src/mindustry/content/Blocks.java b/core/src/mindustry/content/Blocks.java index de2ed51cb0..70b4ec637d 100644 --- a/core/src/mindustry/content/Blocks.java +++ b/core/src/mindustry/content/Blocks.java @@ -1502,8 +1502,8 @@ public class Blocks implements ContentList{ hasPower = true; size = 2; - force = 2.5f; - scaledForce = 5f; + force = 3f; + scaledForce = 5.5f; range = 170f; damage = 0.08f; health = 160 * size * size; diff --git a/core/src/mindustry/content/UnitTypes.java b/core/src/mindustry/content/UnitTypes.java index ddeec1488f..19b22422a5 100644 --- a/core/src/mindustry/content/UnitTypes.java +++ b/core/src/mindustry/content/UnitTypes.java @@ -165,7 +165,7 @@ public class UnitTypes implements ContentList{ boostMultiplier = 1.5f; speed = 0.48f; hitsize = 10f; - health = 300f; + health = 320f; buildSpeed = 0.9f; armor = 4f; @@ -173,7 +173,7 @@ public class UnitTypes implements ContentList{ mineSpeed = 5f; commandLimit = 8; - abilities.add(new ShieldFieldAbility(15f, 30f, 60f * 5, 60f)); + abilities.add(new ShieldFieldAbility(20f, 40f, 60f * 5, 60f)); weapons.add(new Weapon("heal-shotgun-weapon"){{ x = 5f; @@ -193,7 +193,7 @@ public class UnitTypes implements ContentList{ bullet = new LightningBulletType(){{ lightningColor = hitColor = Pal.heal; - damage = 12f; + damage = 15f; lightningLength = 7; lightningLengthRand = 7; shootEffect = Fx.shootHeal; @@ -206,7 +206,7 @@ public class UnitTypes implements ContentList{ hitsize = 12f; boostMultiplier = 2f; itemCapacity = 80; - health = 640f; + health = 650f; buildSpeed = 1.7f; canBoost = true; armor = 9f; @@ -219,7 +219,7 @@ public class UnitTypes implements ContentList{ mineSpeed = 7f; drawShields = false; - abilities.add(new ForceFieldAbility(60f, 0.12f, 200f, 60f * 8)); + abilities.add(new ForceFieldAbility(60f, 0.2f, 300f, 60f * 7)); weapons.add(new Weapon("beam-weapon"){{ shake = 2f; @@ -230,7 +230,7 @@ public class UnitTypes implements ContentList{ shootSound = Sounds.laser; bullet = new LaserBulletType(){{ - damage = 27f; + damage = 30f; recoil = 1f; sideAngle = 45f; sideWidth = 1f; @@ -316,7 +316,7 @@ public class UnitTypes implements ContentList{ drag = 0.4f; hitsize = 12f; rotateSpeed = 3f; - health = 600; + health = 760; immunities = ObjectSet.with(StatusEffects.burning, StatusEffects.melting); legCount = 6; legLength = 13f; @@ -352,7 +352,7 @@ public class UnitTypes implements ContentList{ despawnEffect = Fx.none; width = 0.54f; lifetime = 35f; - knockback = -1.2f; + knockback = -1.24f; }}; }}); @@ -365,13 +365,13 @@ public class UnitTypes implements ContentList{ bullet = new SapBulletType(){{ sapStrength = 0.65f; length = 40f; - damage = 12; + damage = 13; shootEffect = Fx.shootSmall; hitColor = color = Color.valueOf("bf92f9"); despawnEffect = Fx.none; width = 0.4f; lifetime = 25f; - knockback = -0.6f; + knockback = -0.65f; }}; }}); }}; @@ -395,6 +395,7 @@ public class UnitTypes implements ContentList{ legLengthScl = 1f; rippleScale = 2f; legSpeed = 0.2f; + legSplashDamage = 32; legSplashRange = 30; diff --git a/core/src/mindustry/core/NetServer.java b/core/src/mindustry/core/NetServer.java index fd169870ad..a433e55a1d 100644 --- a/core/src/mindustry/core/NetServer.java +++ b/core/src/mindustry/core/NetServer.java @@ -35,7 +35,7 @@ import static mindustry.Vars.*; public class NetServer implements ApplicationListener{ private static final int maxSnapshotSize = 430, timerBlockSync = 0; - private static final float serverSyncTime = 12, blockSyncTime = 60 * 8; + private static final float serverSyncTime = 12, blockSyncTime = 60 * 6; private static final FloatBuffer fbuffer = FloatBuffer.allocate(20); private static final Vec2 vector = new Vec2(); private static final Rect viewport = new Rect(); @@ -612,12 +612,12 @@ public class NetServer implements ApplicationListener{ if(!player.dead()){ Unit unit = player.unit(); - unit.vel.set(xVelocity, yVelocity).limit(unit.type().speed); long elapsed = Time.timeSinceMillis(con.lastReceivedClientTime); float maxSpeed = (boosting ? player.unit().type().boostMultiplier : 1f) * player.unit().type().speed; if(unit.isGrounded()){ maxSpeed *= unit.floorSpeedMultiplier(); } + unit.vel.set(xVelocity, yVelocity).limit(maxSpeed); float maxMove = elapsed / 1000f * 60f * maxSpeed * 1.1f; if(con.lastUnit != unit){ diff --git a/core/src/mindustry/entities/abilities/ForceFieldAbility.java b/core/src/mindustry/entities/abilities/ForceFieldAbility.java index 60de9a49aa..49da3eee5e 100644 --- a/core/src/mindustry/entities/abilities/ForceFieldAbility.java +++ b/core/src/mindustry/entities/abilities/ForceFieldAbility.java @@ -23,6 +23,7 @@ public class ForceFieldAbility implements Ability{ private float realRad; private Unit paramUnit; + private boolean hadShield; private final Cons shieldConsumer = trait -> { if(trait.team() != paramUnit.team && Intersector.isInsideHexagon(paramUnit.x, paramUnit.y, realRad * 2f, trait.x(), trait.y()) && paramUnit.shield > 0){ trait.absorb(); @@ -31,7 +32,6 @@ public class ForceFieldAbility implements Ability{ //break shield if(paramUnit.shield <= trait.damage()){ paramUnit.shield -= cooldown * regen; - Fx.shieldBreak.at(paramUnit.x, paramUnit.y, radius, paramUnit.team.color); } paramUnit.shield -= trait.damage(); @@ -54,6 +54,13 @@ public class ForceFieldAbility implements Ability{ unit.shield += Time.delta * regen; } + //break effect + if(hadShield && unit.shield <= 0){ + Fx.shieldBreak.at(paramUnit.x, paramUnit.y, radius, paramUnit.team.color); + } + + hadShield = unit.shield > 0; + if(unit.shield > 0){ unit.timer2 = Mathf.lerpDelta(unit.timer2, 1f, 0.06f); paramUnit = unit; diff --git a/core/src/mindustry/entities/comp/WeaponsComp.java b/core/src/mindustry/entities/comp/WeaponsComp.java index fce81db655..5665bee7db 100644 --- a/core/src/mindustry/entities/comp/WeaponsComp.java +++ b/core/src/mindustry/entities/comp/WeaponsComp.java @@ -113,7 +113,8 @@ abstract class WeaponsComp implements Teamc, Posc, Rotc, Velc{ can && //must be able to shoot (ammo > 0 || !state.rules.unitAmmo || team().rules().infiniteAmmo) && //check ammo (!weapon.alternate || mount.side == weapon.flipSprite) && - vel.len() >= mount.weapon.minShootVelocity && //check velocity requirements + //TODO checking for velocity this way isn't entirely correct + (vel.len() >= mount.weapon.minShootVelocity || (net.active() && !isLocal())) && //check velocity requirements mount.reload <= 0.0001f && //reload has to be 0 Angles.within(weapon.rotate ? mount.rotation : this.rotation, mount.targetRotation, mount.weapon.shootCone) //has to be within the cone ){ diff --git a/core/src/mindustry/world/blocks/payloads/UnitPayload.java b/core/src/mindustry/world/blocks/payloads/UnitPayload.java index b71da37ba8..ee912480de 100644 --- a/core/src/mindustry/world/blocks/payloads/UnitPayload.java +++ b/core/src/mindustry/world/blocks/payloads/UnitPayload.java @@ -7,7 +7,6 @@ import mindustry.*; import mindustry.gen.*; import mindustry.graphics.*; import mindustry.ui.*; -import mindustry.world.blocks.environment.*; public class UnitPayload implements Payload{ public Unit unit; @@ -41,8 +40,6 @@ public class UnitPayload implements Payload{ @Override public boolean dump(){ - Floor floor = unit.floorOn(); - //no client dumping if(Vars.net.client()) return true;