From b3ec8745d2e5b0cf24eb1757bab79462e15de911 Mon Sep 17 00:00:00 2001 From: Anuken Date: Tue, 26 Apr 2022 15:23:38 -0400 Subject: [PATCH 1/3] Multiplayer fixes --- core/assets-raw/sprites/items/item-titanium.png | Bin 458 -> 463 bytes .../mindustry/world/blocks/ConstructBlock.java | 4 ++-- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/core/assets-raw/sprites/items/item-titanium.png b/core/assets-raw/sprites/items/item-titanium.png index 69368ab75150ced9799e314920b26aee870b1815..fda457e770103059c061c6ea6e9bff64a27fd873 100644 GIT binary patch delta 424 zcmX@be4crNVST5ki(^Pc>(S}_}lCzdi}nZ!-EE171m z-F{E`4eJ|UpKEFU8%`!2J#~P+=1*X}`GF60_nFmrKAaa~Na#_tHs39L^$ow6KYw`X zGbe{*Rx_V5Bq$|EDlu}MnXSmw!1Y+;Y*ske}mwBrn(OyP6FhOk13OJPWgP5n3RsbnU%U3ZsR9Vc;{n7M6yq zul%k!Em>f3U^+{dLJhNN{fY&z?!1i9ar72iSIBp$mhYPbr^^`w)`y2D%-$f<)HU)YQFq# zm5m1ef5m^in%I(^C#vEQ`o3#2i)!=%oAdV1R5^bLf2~?Bu|Ong?>_&&wM>c+oIG}l iUN*TJ^{00q<6(DYb+7%QFBupZ7(8A5T-G@yGywpUHn*(+ delta 419 zcmX@le2RI3VSS6Ii(^Pc>(T4BeuoW2*gx#owP+MqQruX~xP#Hym|Hy|r-tQ9o~@(! zvvV?y+#AB3vZl{rSefSa;du2wp9j7xAOHCKDejKh0sD3ahGd?~PjCOumingNy}bSO zt|v|oMe4?rnHv(HrLl5qc--sZU=TeyTYztYVx?&kQ%?EvYftJ!IXD?sUu9=Vu;9D+ z)EdkjRj&4)t^60W6ToRSa?-) zIhPQ_wb#}cyEHhZ4MP{O)*IGstDf6k8WqsB;rH3ER$Hx`(igByl-_t>@RMSWYeBhh z@8;bLL>_KeF<*4MptDSbam%#{Mf*7(J^ks$aHhKPn$?a6HFZA!Y|(1x~KpE diff --git a/core/src/mindustry/world/blocks/ConstructBlock.java b/core/src/mindustry/world/blocks/ConstructBlock.java index a9aa29c122..bde9b42136 100644 --- a/core/src/mindustry/world/blocks/ConstructBlock.java +++ b/core/src/mindustry/world/blocks/ConstructBlock.java @@ -55,7 +55,7 @@ public class ConstructBlock extends Block{ @Remote(called = Loc.server) public static void deconstructFinish(Tile tile, Block block, Unit builder){ Team team = tile.team(); - if(fogControl.isVisibleTile(player.team(), tile.x, tile.y)){ + if(fogControl.isVisibleTile(team, tile.x, tile.y)){ block.breakEffect.at(tile.drawx(), tile.drawy(), block.size, block.mapColor); if(shouldPlay()) block.breakSound.at(tile, block.breakPitchChange ? calcPitch(false) : 1f); } @@ -98,7 +98,7 @@ public class ConstructBlock extends Block{ tile.build.playerPlaced(config); } - if(fogControl.isVisibleTile(player.team(), tile.x, tile.y)){ + if(fogControl.isVisibleTile(team, tile.x, tile.y)){ Fx.placeBlock.at(tile.drawx(), tile.drawy(), block.size); if(shouldPlay()) block.placeSound.at(tile, block.placePitchChange ? calcPitch(true) : 1f); } From 1b884c1a5c5910008e8391cdaa4f3c5b07ba161d Mon Sep 17 00:00:00 2001 From: Anuken Date: Tue, 26 Apr 2022 15:30:06 -0400 Subject: [PATCH 2/3] Unit artillery fix --- core/src/mindustry/content/UnitTypes.java | 2 +- core/src/mindustry/entities/bullet/ArtilleryBulletType.java | 2 +- core/src/mindustry/entities/bullet/BulletType.java | 2 +- core/src/mindustry/entities/bullet/PointBulletType.java | 2 +- core/src/mindustry/type/Weapon.java | 2 +- core/src/mindustry/world/blocks/defense/turrets/Turret.java | 2 +- 6 files changed, 6 insertions(+), 6 deletions(-) diff --git a/core/src/mindustry/content/UnitTypes.java b/core/src/mindustry/content/UnitTypes.java index 7a3467876f..1abe026850 100644 --- a/core/src/mindustry/content/UnitTypes.java +++ b/core/src/mindustry/content/UnitTypes.java @@ -2261,7 +2261,7 @@ public class UnitTypes{ bullet = new EmpBulletType(){{ float rad = 100f; - scaleVelocity = true; + scaleLife = true; lightOpacity = 0.7f; unitDamageScl = 0.8f; healPercent = 20f; diff --git a/core/src/mindustry/entities/bullet/ArtilleryBulletType.java b/core/src/mindustry/entities/bullet/ArtilleryBulletType.java index 79415b6470..08749c1803 100644 --- a/core/src/mindustry/entities/bullet/ArtilleryBulletType.java +++ b/core/src/mindustry/entities/bullet/ArtilleryBulletType.java @@ -13,7 +13,7 @@ public class ArtilleryBulletType extends BasicBulletType{ collidesTiles = false; collides = false; collidesAir = false; - scaleVelocity = true; + scaleLife = true; hitShake = 1f; hitSound = Sounds.explosion; hitEffect = Fx.flakExplosion; diff --git a/core/src/mindustry/entities/bullet/BulletType.java b/core/src/mindustry/entities/bullet/BulletType.java index 56ea9cf113..d30861886b 100644 --- a/core/src/mindustry/entities/bullet/BulletType.java +++ b/core/src/mindustry/entities/bullet/BulletType.java @@ -111,7 +111,7 @@ public class BulletType extends Content implements Cloneable{ /** Whether velocity is inherited from the shooter. */ public boolean keepVelocity = true; /** Whether to scale lifetime (not actually velocity!) to disappear at the target position. Used for artillery. */ - public boolean scaleVelocity; + public boolean scaleLife; /** Whether this bullet can be hit by point defense. */ public boolean hittable = true; /** Whether this bullet can be reflected. */ diff --git a/core/src/mindustry/entities/bullet/PointBulletType.java b/core/src/mindustry/entities/bullet/PointBulletType.java index 920e6e5b51..a4fe032b52 100644 --- a/core/src/mindustry/entities/bullet/PointBulletType.java +++ b/core/src/mindustry/entities/bullet/PointBulletType.java @@ -13,7 +13,7 @@ public class PointBulletType extends BulletType{ public float trailSpacing = 10f; public PointBulletType(){ - scaleVelocity = true; + scaleLife = true; lifetime = 100f; collides = false; keepVelocity = false; diff --git a/core/src/mindustry/type/Weapon.java b/core/src/mindustry/type/Weapon.java index bd93efcdc2..d72a5ea3f3 100644 --- a/core/src/mindustry/type/Weapon.java +++ b/core/src/mindustry/type/Weapon.java @@ -399,7 +399,7 @@ public class Weapon implements Cloneable{ bulletX = mountX + Angles.trnsx(weaponRotation, this.shootX + xOffset, this.shootY + yOffset), bulletY = mountY + Angles.trnsy(weaponRotation, this.shootX + xOffset, this.shootY + yOffset), shootAngle = bulletRotation(unit, mount, bulletX, bulletY) + angleOffset, - lifeScl = bullet.scaleVelocity ? Mathf.clamp(Mathf.dst(shootX, shootY, mount.aimX, mount.aimY) / bullet.range) : 1f, + lifeScl = bullet.scaleLife ? Mathf.clamp(Mathf.dst(bulletX, bulletY, mount.aimX, mount.aimY) / bullet.range) : 1f, angle = angleOffset + shootAngle + Mathf.range(inaccuracy); mount.bullet = bullet.create(unit, unit.team, bulletX, bulletY, angle, -1f, (1f - velocityRnd) + Mathf.random(velocityRnd), lifeScl, null, mover, mount.aimX, mount.aimY); diff --git a/core/src/mindustry/world/blocks/defense/turrets/Turret.java b/core/src/mindustry/world/blocks/defense/turrets/Turret.java index a205b4746c..f3af5b0df0 100644 --- a/core/src/mindustry/world/blocks/defense/turrets/Turret.java +++ b/core/src/mindustry/world/blocks/defense/turrets/Turret.java @@ -500,7 +500,7 @@ public class Turret extends ReloadTurret{ bulletY = y + Angles.trnsy(rotation - 90, shootX + xOffset, shootY + yOffset), shootAngle = rotation + angleOffset + Mathf.range(inaccuracy); - float lifeScl = type.scaleVelocity ? Mathf.clamp(Mathf.dst(bulletX, bulletY, targetPos.x, targetPos.y) / type.range, minRange / type.range, range() / type.range) : 1f; + float lifeScl = type.scaleLife ? Mathf.clamp(Mathf.dst(bulletX, bulletY, targetPos.x, targetPos.y) / type.range, minRange / type.range, range() / type.range) : 1f; //TODO aimX / aimY for multi shot turrets? handleBullet(type.create(this, team, bulletX, bulletY, shootAngle, -1f, 1f + Mathf.range(velocityInaccuracy), lifeScl, null, mover, targetPos.x, targetPos.y), xOffset, yOffset, angleOffset); From 1ee8687d945010ff9015550b90a871ac3e6481d2 Mon Sep 17 00:00:00 2001 From: Anuken Date: Tue, 26 Apr 2022 17:26:25 -0400 Subject: [PATCH 3/3] Sublimate nerf --- core/src/mindustry/content/Blocks.java | 10 +++++----- core/src/mindustry/mod/ContentParser.java | 2 -- 2 files changed, 5 insertions(+), 7 deletions(-) diff --git a/core/src/mindustry/content/Blocks.java b/core/src/mindustry/content/Blocks.java index 1b99224840..2a51ed71d3 100644 --- a/core/src/mindustry/content/Blocks.java +++ b/core/src/mindustry/content/Blocks.java @@ -3792,27 +3792,27 @@ public class Blocks{ }}; outlineColor = Pal.darkOutline; - liquidConsumed = 4f / 60f; + liquidConsumed = 8f / 60f; float r = range = 130f; //TODO balance, set up, where is liquid/sec displayed? status effects maybe? ammo( Liquids.ozone, new ContinuousFlameBulletType(){{ - damage = 90f; + damage = 70f; length = r; knockback = 1f; - pierceCap = 3; + pierceCap = 2; buildingDamageMultiplier = 0.3f; colors = new Color[]{Color.valueOf("eb7abe").a(0.55f), Color.valueOf("e189f5").a(0.7f), Color.valueOf("907ef7").a(0.8f), Color.valueOf("91a4ff"), Color.white}; }}, Liquids.cyanogen, new ContinuousFlameBulletType(){{ - damage = 200f; + damage = 160f; rangeChange = 70f; length = r + rangeChange; knockback = 2f; - pierceCap = 4; + pierceCap = 3; buildingDamageMultiplier = 0.3f; colors = new Color[]{Color.valueOf("465ab8").a(0.55f), Color.valueOf("66a6d2").a(0.7f), Color.valueOf("89e8b6").a(0.8f), Color.valueOf("cafcbe"), Color.white}; diff --git a/core/src/mindustry/mod/ContentParser.java b/core/src/mindustry/mod/ContentParser.java index d51320aad0..29e1234cb5 100644 --- a/core/src/mindustry/mod/ContentParser.java +++ b/core/src/mindustry/mod/ContentParser.java @@ -94,8 +94,6 @@ public class ContentParser{ if(data.isString()){ StatusEffect result = locate(ContentType.status, data.asString()); if(result != null) return result; - result = (StatusEffect)fieldOpt(StatusEffects.class, data); - if(result != null) return result; throw new IllegalArgumentException("Unknown status effect: '" + data.asString() + "'"); } StatusEffect effect = new StatusEffect(currentMod.name + "-" + data.getString("name"));