diff --git a/core/src/mindustry/content/Bullets.java b/core/src/mindustry/content/Bullets.java index 7b86aeb178..b9e5d62f08 100644 --- a/core/src/mindustry/content/Bullets.java +++ b/core/src/mindustry/content/Bullets.java @@ -30,7 +30,7 @@ public class Bullets implements ContentList{ standardGlaive, standardDenseBig, standardThoriumBig, standardIncendiaryBig, //electric - lancerLaser, meltdownLaser, lightning, arc, damageLightning, + lancerLaser, meltdownLaser, arc, damageLightning, //liquid waterShot, cryoShot, slagShot, oilShot, @@ -204,7 +204,7 @@ public class Bullets implements ContentList{ flakSurge = new FlakBulletType(4.5f, 13){{ splashDamage = 40f; splashDamageRadius = 40f; - lightining = 2; + lightning = 2; lightningLength = 12; shootEffect = Fx.shootBig; }}; @@ -250,7 +250,7 @@ public class Bullets implements ContentList{ lifetime = 150f; hitEffect = Fx.blastExplosion; despawnEffect = Fx.blastExplosion; - lightining = 2; + lightning = 2; lightningLength = 14; }}; @@ -581,31 +581,6 @@ public class Bullets implements ContentList{ drag = 0.03f; }}; - lightning = new BulletType(0.001f, 12f){ - { - lifetime = 1f; - shootEffect = Fx.hitLancer; - smokeEffect = Fx.none; - despawnEffect = Fx.none; - hitEffect = Fx.hitLancer; - keepVelocity = false; - } - - @Override - public float range(){ - return 70f; - } - - @Override - public void draw(Bulletc b){ - } - - @Override - public void init(Bulletc b){ - Lightning.create(b.team(), Pal.lancerLaser, damage * (b.owner().isLocal() ? state.rules.playerDamageMultiplier : 1f), b.x(), b.y(), b.rotation(), 30); - } - }; - arc = new LightningBulletType(){{ damage = 21; lightningLength = 25; diff --git a/core/src/mindustry/entities/bullet/BulletType.java b/core/src/mindustry/entities/bullet/BulletType.java index 51243bbaa1..b039e94614 100644 --- a/core/src/mindustry/entities/bullet/BulletType.java +++ b/core/src/mindustry/entities/bullet/BulletType.java @@ -80,7 +80,7 @@ public abstract class BulletType extends Content{ public float homingPower = 0f; public float homingRange = 50f; - public int lightining; + public int lightning; public int lightningLength = 5; public float weaveScale = 1f; @@ -134,19 +134,19 @@ public abstract class BulletType extends Content{ if(splashDamageRadius > 0){ Damage.damage(b.team(), x, y, splashDamageRadius, splashDamage * b.damageMultiplier()); } + + for(int i = 0; i < lightning; i++){ + Lightning.create(b.team(), Pal.surge, damage, b.getX(), b.getY(), Mathf.random(360f), lightningLength); + } } public void despawned(Bulletc b){ despawnEffect.at(b.getX(), b.getY(), b.rotation()); hitSound.at(b); - if(fragBullet != null || splashDamageRadius > 0){ + if(fragBullet != null || splashDamageRadius > 0 || lightning > 0){ hit(b); } - - for(int i = 0; i < lightining; i++){ - Lightning.create(b.team(), Pal.surge, damage, b.getX(), b.getY(), Mathf.random(360f), lightningLength); - } } public void draw(Bulletc b){ diff --git a/core/src/mindustry/entities/bullet/LightningBulletType.java b/core/src/mindustry/entities/bullet/LightningBulletType.java index 36beb5a092..ecdffc7614 100644 --- a/core/src/mindustry/entities/bullet/LightningBulletType.java +++ b/core/src/mindustry/entities/bullet/LightningBulletType.java @@ -19,6 +19,11 @@ public class LightningBulletType extends BulletType{ keepVelocity = false; } + @Override + public float range(){ + return lightningLength * 2.33f; + } + @Override public void draw(Bulletc b){ } diff --git a/core/src/mindustry/entities/comp/PlayerComp.java b/core/src/mindustry/entities/comp/PlayerComp.java index d6944f6192..4789c97561 100644 --- a/core/src/mindustry/entities/comp/PlayerComp.java +++ b/core/src/mindustry/entities/comp/PlayerComp.java @@ -79,7 +79,7 @@ abstract class PlayerComp implements UnitController, Entityc, Syncc, Timerc, Dra @Override public void update(){ - if(unit.dead()){ + if(unit.dead() || !unit.isAdded()){ clearUnit(); } @@ -146,7 +146,7 @@ abstract class PlayerComp implements UnitController, Entityc, Syncc, Timerc, Dra } boolean dead(){ - return unit.isNull(); + return unit.isNull() || unit.dead() || !unit.isAdded(); } String uuid(){ diff --git a/core/src/mindustry/game/Gamemode.java b/core/src/mindustry/game/Gamemode.java index f202daaec8..bdd7ee6ba6 100644 --- a/core/src/mindustry/game/Gamemode.java +++ b/core/src/mindustry/game/Gamemode.java @@ -25,8 +25,6 @@ public enum Gamemode{ rules.enemyCoreBuildRadius = 600f; rules.buildCostMultiplier = 1f; rules.buildSpeedMultiplier = 1f; - rules.playerDamageMultiplier = 0.33f; - rules.playerHealthMultiplier = 0.5f; rules.unitBuildSpeedMultiplier = 2f; rules.unitHealthMultiplier = 3f; rules.attackMode = true; diff --git a/core/src/mindustry/game/Rules.java b/core/src/mindustry/game/Rules.java index 9b7bd5ba33..8ddee5f377 100644 --- a/core/src/mindustry/game/Rules.java +++ b/core/src/mindustry/game/Rules.java @@ -14,7 +14,7 @@ import mindustry.world.*; * Does not store game state, just configuration. */ public class Rules{ - /** Whether the player has infinite resources. */ + /** Whether the player team has infinite resources. */ public boolean infiniteResources; /** Whether the waves come automatically on a timer. If not, waves come when the play button is pressed. */ public boolean waveTimer = true; @@ -30,15 +30,11 @@ public class Rules{ public float unitBuildSpeedMultiplier = 1f; /** How much health units start with. */ public float unitHealthMultiplier = 1f; - /** How much health players start with. */ - public float playerHealthMultiplier = 1f; /** How much health blocks start with. */ public float blockHealthMultiplier = 1f; - /** How much damage player mechs deal. */ - public float playerDamageMultiplier = 1f; /** How much damage any other units deal. */ public float unitDamageMultiplier = 1f; - /** Multiplier for buildings for the player. */ + /** Multiplier for buildings resource cost. */ public float buildCostMultiplier = 1f; /** Multiplier for building speed. */ public float buildSpeedMultiplier = 1f; diff --git a/core/src/mindustry/ui/dialogs/CustomRulesDialog.java b/core/src/mindustry/ui/dialogs/CustomRulesDialog.java index b18e4deb4c..541c0ddbbc 100644 --- a/core/src/mindustry/ui/dialogs/CustomRulesDialog.java +++ b/core/src/mindustry/ui/dialogs/CustomRulesDialog.java @@ -153,10 +153,6 @@ public class CustomRulesDialog extends BaseDialog{ main.button("$bannedblocks", banDialog::show).left().width(300f); main.row(); - title("$rules.title.player"); - number("$rules.playerhealthmultiplier", f -> rules.playerHealthMultiplier = f, () -> rules.playerHealthMultiplier); - number("$rules.playerdamagemultiplier", f -> rules.playerDamageMultiplier = f, () -> rules.playerDamageMultiplier); - title("$rules.title.unit"); number("$rules.unithealthmultiplier", f -> rules.unitHealthMultiplier = f, () -> rules.unitHealthMultiplier); number("$rules.unitdamagemultiplier", f -> rules.unitDamageMultiplier = f, () -> rules.unitDamageMultiplier); diff --git a/core/src/mindustry/world/meta/values/AmmoListValue.java b/core/src/mindustry/world/meta/values/AmmoListValue.java index 8734632cbc..0e9588dfbd 100644 --- a/core/src/mindustry/world/meta/values/AmmoListValue.java +++ b/core/src/mindustry/world/meta/values/AmmoListValue.java @@ -66,7 +66,7 @@ public class AmmoListValue implements StatValue{ sep(bt, "$bullet.homing"); } - if(type.lightining > 0){ + if(type.lightning > 0){ sep(bt, "$bullet.shock"); }