From 638343d25e99e686c9844b5e2d2eb578380ac109 Mon Sep 17 00:00:00 2001 From: Anuken Date: Wed, 27 May 2020 19:57:07 -0400 Subject: [PATCH] Variable mass driver bullets --- core/src/mindustry/entities/bullet/MassDriverBolt.java | 5 ++--- core/src/mindustry/entities/comp/PayloadComp.java | 4 ++-- core/src/mindustry/world/blocks/defense/SurgeWall.java | 2 +- .../src/mindustry/world/blocks/distribution/MassDriver.java | 6 ++++-- 4 files changed, 9 insertions(+), 8 deletions(-) diff --git a/core/src/mindustry/entities/bullet/MassDriverBolt.java b/core/src/mindustry/entities/bullet/MassDriverBolt.java index 96fd1698f7..390eff95d3 100644 --- a/core/src/mindustry/entities/bullet/MassDriverBolt.java +++ b/core/src/mindustry/entities/bullet/MassDriverBolt.java @@ -14,12 +14,11 @@ import static mindustry.Vars.content; public class MassDriverBolt extends BulletType{ public MassDriverBolt(){ - super(5.3f, 50); + super(1f, 50); collidesTiles = false; - lifetime = 200f; + lifetime = 1f; despawnEffect = Fx.smeltsmoke; hitEffect = Fx.hitBulletBig; - drag = 0.005f; } @Override diff --git a/core/src/mindustry/entities/comp/PayloadComp.java b/core/src/mindustry/entities/comp/PayloadComp.java index fc808441a8..5b16b58905 100644 --- a/core/src/mindustry/entities/comp/PayloadComp.java +++ b/core/src/mindustry/entities/comp/PayloadComp.java @@ -13,7 +13,7 @@ import mindustry.world.blocks.payloads.*; /** An entity that holds a payload. */ @Component abstract class PayloadComp implements Posc, Rotc{ - @Import float x, y; + @Import float x, y, rotation; Array payloads = new Array<>(); @@ -44,7 +44,6 @@ abstract class PayloadComp implements Posc, Rotc{ if(tryDropPayload(load)){ payloads.pop(); - return true; } return false; @@ -70,6 +69,7 @@ abstract class PayloadComp implements Posc, Rotc{ u.set(this); u.trns(Tmp.v1.rnd(Mathf.random(2f))); + u.rotation(rotation); u.add(); Fx.unitDrop.at(u); diff --git a/core/src/mindustry/world/blocks/defense/SurgeWall.java b/core/src/mindustry/world/blocks/defense/SurgeWall.java index e2013bef6b..f011735439 100644 --- a/core/src/mindustry/world/blocks/defense/SurgeWall.java +++ b/core/src/mindustry/world/blocks/defense/SurgeWall.java @@ -7,7 +7,7 @@ import mindustry.graphics.*; public class SurgeWall extends Wall{ public float lightningChance = 0.05f; - public float lightningDamage = 15f; + public float lightningDamage = 20f; public int lightningLength = 17; public SurgeWall(String name){ diff --git a/core/src/mindustry/world/blocks/distribution/MassDriver.java b/core/src/mindustry/world/blocks/distribution/MassDriver.java index a6ab161b0b..b39bfeda18 100644 --- a/core/src/mindustry/world/blocks/distribution/MassDriver.java +++ b/core/src/mindustry/world/blocks/distribution/MassDriver.java @@ -26,6 +26,8 @@ public class MassDriver extends Block{ public int minDistribute = 10; public float knockback = 4f; public float reloadTime = 100f; + public float bulletSpeed = 5.5f; + public float bulletLifetime = 200f; public Effect shootEffect = Fx.shootBig2; public Effect smokeEffect = Fx.shootBigSmoke2; public Effect recieveEffect = Fx.mineBig; @@ -252,8 +254,8 @@ public class MassDriver extends Block{ float angle = tile.angleTo(target); Bullets.driverBolt.create(this, team(), - x + Angles.trnsx(angle, translation), y + Angles.trnsy(angle, translation), - angle, -1f, 1f, 1f, data); + x + Angles.trnsx(angle, translation), y + Angles.trnsy(angle, translation), + angle, -1f, bulletSpeed, bulletLifetime, data); shootEffect.at(x + Angles.trnsx(angle, translation), y + Angles.trnsy(angle, translation), angle);