Implemented Anuken/Mindustry-Suggestions/issues/3026

This commit is contained in:
Anuken
2021-09-27 09:18:46 -04:00
parent dac17aa2b7
commit ed1557b5ac
4 changed files with 32 additions and 8 deletions
+16 -7
View File
@@ -1784,7 +1784,6 @@ public class UnitTypes implements ContentList{
//endregion //endregion
//region naval support //region naval support
retusa = new UnitType("retusa"){{ retusa = new UnitType("retusa"){{
defaultController = HugAI::new;
speed = 0.9f; speed = 0.9f;
targetAir = false; targetAir = false;
drag = 0.14f; drag = 0.14f;
@@ -1818,7 +1817,8 @@ public class UnitTypes implements ContentList{
weapons.add(new Weapon(){{ weapons.add(new Weapon(){{
mirror = false; mirror = false;
reload = 80f; rotate = true;
reload = 90f;
shots = 3; shots = 3;
shotDelay = 7f; shotDelay = 7f;
x = y = shootX = shootY = 0f; x = y = shootX = shootY = 0f;
@@ -1826,7 +1826,7 @@ public class UnitTypes implements ContentList{
bullet = new BasicBulletType(){{ bullet = new BasicBulletType(){{
sprite = "mine-bullet"; sprite = "mine-bullet";
width = height = 11f; width = height = 8f;
layer = Layer.scorch; layer = Layer.scorch;
shootEffect = smokeEffect = Fx.none; shootEffect = smokeEffect = Fx.none;
@@ -1846,17 +1846,26 @@ public class UnitTypes implements ContentList{
collidesAir = false; collidesAir = false;
lifetime = 500f; lifetime = 87f;
hitEffect = new MultiEffect(Fx.blastExplosion, Fx.greenCloud); hitEffect = new MultiEffect(Fx.blastExplosion, Fx.greenCloud);
keepVelocity = false; keepVelocity = false;
shrinkX = shrinkY = 0f; shrinkX = shrinkY = 0f;
speed = 0f; inaccuracy = 2f;
weaveMag = 5f;
weaveScale = 4f;
speed = 0.7f;
drag = -0.017f;
homingPower = 0.05f;
collideFloor = true;
trailColor = Pal.heal;
trailWidth = 3f;
trailLength = 8;
splashDamage = 55f; splashDamage = 42f;
splashDamageRadius = 45f; splashDamageRadius = 40f;
}}; }};
}}); }});
}}; }};
@@ -91,6 +91,8 @@ public class BulletType extends Content implements Cloneable{
public boolean collidesAir = true, collidesGround = true; public boolean collidesAir = true, collidesGround = true;
/** Whether this bullet types collides with anything at all. */ /** Whether this bullet types collides with anything at all. */
public boolean collides = true; public boolean collides = true;
/** If true, this projectile collides with non-surface floors. */
public boolean collideFloor = false;
/** Whether velocity is inherited from the shooter. */ /** Whether velocity is inherited from the shooter. */
public boolean keepVelocity = true; public boolean keepVelocity = true;
/** Whether to scale lifetime (not actually velocity!) to disappear at the target position. Used for artillery. */ /** Whether to scale lifetime (not actually velocity!) to disappear at the target position. Used for artillery. */
@@ -6,12 +6,14 @@ import arc.math.geom.*;
import arc.struct.*; import arc.struct.*;
import arc.util.*; import arc.util.*;
import mindustry.annotations.Annotations.*; import mindustry.annotations.Annotations.*;
import mindustry.content.*;
import mindustry.core.*; import mindustry.core.*;
import mindustry.entities.bullet.*; import mindustry.entities.bullet.*;
import mindustry.game.*; import mindustry.game.*;
import mindustry.game.Teams.*; import mindustry.game.Teams.*;
import mindustry.gen.*; import mindustry.gen.*;
import mindustry.graphics.*; import mindustry.graphics.*;
import mindustry.world.*;
import static mindustry.Vars.*; import static mindustry.Vars.*;
@@ -137,6 +139,17 @@ abstract class BulletComp implements Timedc, Damagec, Hitboxc, Teamc, Posc, Draw
while(x >= 0 && y >= 0 && x < ww && y < wh){ while(x >= 0 && y >= 0 && x < ww && y < wh){
Building build = world.build(x, y); Building build = world.build(x, y);
if(type.collideFloor){
Tile tile = world.tile(x, y);
if(tile == null || tile.floor().hasSurface() || tile.block() != Blocks.air){
type.despawned(self());
remove();
hit = true;
return;
}
}
if(build != null && isAdded() && build.collide(self()) && type.testCollision(self(), build) if(build != null && isAdded() && build.collide(self()) && type.testCollision(self(), build)
&& !build.dead() && (type.collidesTeam || build.team != team) && !(type.pierceBuilding && hasCollided(build.id))){ && !build.dead() && (type.collidesTeam || build.team != team) && !(type.pierceBuilding && hasCollided(build.id))){
+1 -1
View File
@@ -24,4 +24,4 @@ android.useAndroidX=true
#used for slow jitpack builds; TODO see if this actually works #used for slow jitpack builds; TODO see if this actually works
org.gradle.internal.http.socketTimeout=100000 org.gradle.internal.http.socketTimeout=100000
org.gradle.internal.http.connectionTimeout=100000 org.gradle.internal.http.connectionTimeout=100000
archash=e4ec2880dfdd5739ec75b5904d97ed3309c225d8 archash=b631e4ed8d93513a52ebee6f7e612f7d603062c8