From 521e3c773f3708a4c8b00bb9031925987218ceff Mon Sep 17 00:00:00 2001 From: Anuken Date: Fri, 17 Jul 2020 16:57:27 -0400 Subject: [PATCH] Weapon occlusion / Balancing --- core/src/mindustry/content/UnitTypes.java | 18 +++++++++++------- core/src/mindustry/type/UnitType.java | 10 +++++++--- core/src/mindustry/type/Weapon.java | 2 ++ 3 files changed, 20 insertions(+), 10 deletions(-) diff --git a/core/src/mindustry/content/UnitTypes.java b/core/src/mindustry/content/UnitTypes.java index d2b5e43973..7fb7bfe67f 100644 --- a/core/src/mindustry/content/UnitTypes.java +++ b/core/src/mindustry/content/UnitTypes.java @@ -672,7 +672,7 @@ public class UnitTypes implements ContentList{ speed = 1.1f; drag = 0.13f; hitsize = 9f; - health = 220; + health = 280; accel = 0.4f; rotateSpeed = 3.3f; immunities = ObjectSet.with(StatusEffects.wet); @@ -717,10 +717,10 @@ public class UnitTypes implements ContentList{ }}; minke = new UnitType("minke"){{ + health = 600; speed = 0.9f; drag = 0.15f; hitsize = 11f; - health = 430; armor = 4f; accel = 0.3f; rotateSpeed = 2.6f; @@ -758,12 +758,13 @@ public class UnitTypes implements ContentList{ }}; bryde = new UnitType("bryde"){{ + health = 900; speed = 0.85f; accel = 0.2f; rotateSpeed = 1.8f; drag = 0.17f; hitsize = 14f; - health = 130; + armor = 6f; immunities = ObjectSet.with(StatusEffects.wet); trailLength = 22; @@ -771,18 +772,19 @@ public class UnitTypes implements ContentList{ trailY = -9f; trailScl = 1.5f; - abilities.add(new HealFieldAbility(22f, 60f * 5, 70f)); + abilities.add(new HealFieldAbility(22f, 60f * 4, 70f), new ShieldFieldAbility(20f, 40f, 60f * 4, 60f)); weapons.add(new Weapon("large-artillery"){{ - reload = 60f; + reload = 65f; mirror = false; x = 0f; - y = -2.5f; + y = -3.5f; rotateSpeed = 1.7f; rotate = true; shootY = 7f; shake = 5f; recoil = 4f; + occlusion = 17f; shots = 1; inaccuracy = 3f; @@ -799,7 +801,7 @@ public class UnitTypes implements ContentList{ collidesTiles = false; ammoMultiplier = 4f; splashDamageRadius = 60f; - splashDamage = 75f; + splashDamage = 85f; backColor = Pal.missileYellowBack; frontColor = Pal.missileYellow; trailEffect = Fx.artilleryTrail; @@ -818,6 +820,8 @@ public class UnitTypes implements ContentList{ x = 8.5f; y = -9f; + occlusion = 6f; + rotateSpeed = 4f; rotate = true; shots = 2; diff --git a/core/src/mindustry/type/UnitType.java b/core/src/mindustry/type/UnitType.java index 4deb6a7a31..1941cca601 100644 --- a/core/src/mindustry/type/UnitType.java +++ b/core/src/mindustry/type/UnitType.java @@ -381,10 +381,14 @@ public class UnitType extends UnlockableContent{ float weaponRotation = rotation + (weapon.rotate ? mount.rotation : 0); float width = weapon.region.getWidth(); float recoil = -((mount.reload) / weapon.reload * weapon.recoil); + float wx = unit.x + Angles.trnsx(rotation, weapon.x, weapon.y) + Angles.trnsx(weaponRotation, 0, recoil), + wy = unit.y + Angles.trnsy(rotation, weapon.x, weapon.y) + Angles.trnsy(weaponRotation, 0, recoil); - Draw.rect(weapon.region, - unit.x + Angles.trnsx(rotation, weapon.x, weapon.y) + Angles.trnsx(weaponRotation, 0, recoil), - unit.y + Angles.trnsy(rotation, weapon.x, weapon.y) + Angles.trnsy(weaponRotation, 0, recoil), + if(weapon.occlusion > 0){ + Drawf.shadow(wx, wy, weapon.occlusion); + } + + Draw.rect(weapon.region, wx, wy, width * Draw.scl * -Mathf.sign(weapon.flipSprite), weapon.region.getHeight() * Draw.scl, weaponRotation); diff --git a/core/src/mindustry/type/Weapon.java b/core/src/mindustry/type/Weapon.java index c9f9505c2e..744011df74 100644 --- a/core/src/mindustry/type/Weapon.java +++ b/core/src/mindustry/type/Weapon.java @@ -43,6 +43,8 @@ public class Weapon{ public float shootX = 0f, shootY = 3f; /** offsets of weapon position on unit */ public float x = 5f, y = 0f; + /** radius of occlusion drawn under the weapon; <0 to diable */ + public float occlusion = -1f; /** fraction of velocity that is random */ public float velocityRnd = 0f; /** delay in ticks between shots */