diff --git a/annotations/src/main/resources/revisions/MinerUnit/0.json b/annotations/src/main/resources/revisions/MinerUnit/0.json new file mode 100644 index 0000000000..5df97253d8 --- /dev/null +++ b/annotations/src/main/resources/revisions/MinerUnit/0.json @@ -0,0 +1 @@ +{fields:[{name:ammo,type:int,size:4},{name:armor,type:float,size:4},{name:controller,type:mindustry.entities.units.UnitController,size:-1},{name:elevation,type:float,size:4},{name:health,type:float,size:4},{name:isShooting,type:boolean,size:1},{name:mineTile,type:mindustry.world.Tile,size:-1},{name:mounts,type:"mindustry.entities.units.WeaponMount[]",size:-1},{name:rotation,type:float,size:4},{name:shield,type:float,size:4},{name:spawnedByCore,type:boolean,size:1},{name:stack,type:mindustry.type.ItemStack,size:-1},{name:statuses,type:arc.struct.Seq,size:-1},{name:team,type:mindustry.game.Team,size:-1},{name:type,type:mindustry.type.UnitType,size:-1},{name:x,type:float,size:4},{name:y,type:float,size:4}]} \ No newline at end of file diff --git a/core/assets-raw/sprites/units/ghoul-cell.png b/core/assets-raw/sprites/units/ghoul-cell.png deleted file mode 100644 index 704b0dea15..0000000000 Binary files a/core/assets-raw/sprites/units/ghoul-cell.png and /dev/null differ diff --git a/core/assets-raw/sprites/units/ghoul.png b/core/assets-raw/sprites/units/ghoul.png deleted file mode 100644 index eda5795cc9..0000000000 Binary files a/core/assets-raw/sprites/units/ghoul.png and /dev/null differ diff --git a/core/assets-raw/sprites/units/lich-cell.png b/core/assets-raw/sprites/units/lich-cell.png deleted file mode 100644 index 85c7517229..0000000000 Binary files a/core/assets-raw/sprites/units/lich-cell.png and /dev/null differ diff --git a/core/assets-raw/sprites/units/lich.png b/core/assets-raw/sprites/units/lich.png deleted file mode 100644 index 10af20cfb9..0000000000 Binary files a/core/assets-raw/sprites/units/lich.png and /dev/null differ diff --git a/core/assets-raw/sprites/units/reaper-cell.png b/core/assets-raw/sprites/units/reaper-cell.png deleted file mode 100644 index eba8627f99..0000000000 Binary files a/core/assets-raw/sprites/units/reaper-cell.png and /dev/null differ diff --git a/core/assets-raw/sprites/units/reaper.aseprite b/core/assets-raw/sprites/units/reaper.aseprite deleted file mode 100644 index 51eb8f345b..0000000000 Binary files a/core/assets-raw/sprites/units/reaper.aseprite and /dev/null differ diff --git a/core/assets-raw/sprites/units/reaper.png b/core/assets-raw/sprites/units/reaper.png deleted file mode 100644 index 649d19545a..0000000000 Binary files a/core/assets-raw/sprites/units/reaper.png and /dev/null differ diff --git a/core/assets-raw/sprites/units/revenant-cell.png b/core/assets-raw/sprites/units/revenant-cell.png deleted file mode 100644 index 852af58904..0000000000 Binary files a/core/assets-raw/sprites/units/revenant-cell.png and /dev/null differ diff --git a/core/assets-raw/sprites/units/revenant.png b/core/assets-raw/sprites/units/revenant.png deleted file mode 100644 index 469d949c41..0000000000 Binary files a/core/assets-raw/sprites/units/revenant.png and /dev/null differ diff --git a/core/assets-raw/sprites/units/weapons/lich-missiles.png b/core/assets-raw/sprites/units/weapons/lich-missiles.png deleted file mode 100644 index a37cbfa449..0000000000 Binary files a/core/assets-raw/sprites/units/weapons/lich-missiles.png and /dev/null differ diff --git a/core/assets-raw/sprites/units/weapons/reaper-weapon.png b/core/assets-raw/sprites/units/weapons/reaper-weapon.png deleted file mode 100644 index 016e6dacf4..0000000000 Binary files a/core/assets-raw/sprites/units/weapons/reaper-weapon.png and /dev/null differ diff --git a/core/assets-raw/sprites/units/weapons/revenant-missiles.png b/core/assets-raw/sprites/units/weapons/revenant-missiles.png deleted file mode 100644 index e482202c65..0000000000 Binary files a/core/assets-raw/sprites/units/weapons/revenant-missiles.png and /dev/null differ diff --git a/core/assets-raw/sprites/units/wraith.png b/core/assets-raw/sprites/units/wraith.png deleted file mode 100644 index 435c9d24cf..0000000000 Binary files a/core/assets-raw/sprites/units/wraith.png and /dev/null differ diff --git a/core/assets/bundles/bundle.properties b/core/assets/bundles/bundle.properties index 45de1fb9cf..1d5cf2f291 100644 --- a/core/assets/bundles/bundle.properties +++ b/core/assets/bundles/bundle.properties @@ -1054,16 +1054,6 @@ team.derelict.name = derelict team.green.name = green team.purple.name = purple -#TODO - don't translate yet -#unit.crawler.name = Crawler -#unit.dagger.name = Dagger -#unit.fortress.name = Fortress -#unit.wraith.name = Wraith Fighter -#unit.ghoul.name = Ghoul Bomber -#unit.revenant.name = Revenant -#unit.lich.name = Lich -#unit.reaper.name = Reaper - tutorial.next = [lightgray] tutorial.intro = You have entered the[scarlet] Mindustry Tutorial.[]\nUse[accent] [[WASD][] to move.\n[accent]Scroll[] to zoom in and out.\nBegin by[accent] mining copper[]. Move close to it, then tap a copper ore vein near your core to do this.\n\n[accent]{0}/{1} copper tutorial.intro.mobile = You have entered the[scarlet] Mindustry Tutorial.[]\nSwipe the screen to move.\n[accent]Pinch with 2 fingers[] to zoom in and out.\nBegin by[accent] mining copper[]. Move close to it, then tap a copper ore vein near your core to do this.\n\n[accent]{0}/{1} copper diff --git a/core/src/mindustry/content/Blocks.java b/core/src/mindustry/content/Blocks.java index ee1d71fc5f..05f51600fe 100644 --- a/core/src/mindustry/content/Blocks.java +++ b/core/src/mindustry/content/Blocks.java @@ -1535,7 +1535,7 @@ public class Blocks implements ContentList{ @Override public void init(Bullet b){ for(int i = 0; i < rays; i++){ - Damage.collideLine(b, b.team(), hitEffect, b.x, b.y, b.rotation(), rayLength - Math.abs(i - (rays / 2)) * 20f); + Damage.collideLine(b, b.team, hitEffect, b.x, b.y, b.rotation(), rayLength - Math.abs(i - (rays / 2)) * 20f); } } @@ -1689,7 +1689,7 @@ public class Blocks implements ContentList{ plans = new UnitPlan[]{ new UnitPlan(UnitTypes.dagger, 200f, with(Items.silicon, 10, Items.lead, 10)), new UnitPlan(UnitTypes.crawler, 200f, with(Items.silicon, 10, Items.blastCompound, 5)), - new UnitPlan(UnitTypes.nova, 200f, with(Items.silicon, 20, Items.lead, 10)), + new UnitPlan(UnitTypes.nova, 200f, with(Items.silicon, 20, Items.lead, 20, Items.titanium, 20)), }; size = 3; consumes.power(1.2f); @@ -1699,7 +1699,7 @@ public class Blocks implements ContentList{ requirements(Category.units, with(Items.copper, 30, Items.lead, 70)); plans = new UnitPlan[]{ new UnitPlan(UnitTypes.flare, 200f, with(Items.silicon, 10)), - new UnitPlan(UnitTypes.mono, 200f, with(Items.silicon, 10)), + new UnitPlan(UnitTypes.mono, 200f, with(Items.silicon, 15, Items.lead, 15)), //new UnitPlan(UnitTypes.phantom, 200f, with(Items.silicon, 10)), }; size = 3; diff --git a/core/src/mindustry/content/Bullets.java b/core/src/mindustry/content/Bullets.java index 069a8a7f3c..21d6744255 100644 --- a/core/src/mindustry/content/Bullets.java +++ b/core/src/mindustry/content/Bullets.java @@ -289,24 +289,6 @@ public class Bullets implements ContentList{ lightningLength = 14; }}; - missileJavelin = new MissileBulletType(5f, 10.5f, "missile"){{ - width = 8f; - height = 8f; - shrinkY = 0f; - drag = -0.003f; - keepVelocity = false; - splashDamageRadius = 20f; - splashDamage = 1f; - lifetime = 90f; - trailColor = Color.valueOf("b6c6fd"); - hitEffect = Fx.blastExplosion; - despawnEffect = Fx.blastExplosion; - backColor = Pal.bulletYellowBack; - frontColor = Pal.bulletYellow; - weaveScale = 8f; - weaveMag = 2f; - }}; - missileSwarm = new MissileBulletType(2.7f, 12, "missile"){{ width = 8f; height = 8f; diff --git a/core/src/mindustry/content/UnitTypes.java b/core/src/mindustry/content/UnitTypes.java index 05fe79f429..d3ce100382 100644 --- a/core/src/mindustry/content/UnitTypes.java +++ b/core/src/mindustry/content/UnitTypes.java @@ -29,8 +29,8 @@ public class UnitTypes implements ContentList{ //air (no special traits) public static @EntityDef({Unitc.class}) UnitType flare, eclipse, horizon, zenith, antumbra; - //air + building - public static @EntityDef({Unitc.class, Builderc.class}) UnitType mono; + //air + mining + public static @EntityDef({Unitc.class, Minerc.class}) UnitType mono; //air + building + mining public static @EntityDef({Unitc.class, Builderc.class, Minerc.class}) UnitType poly; @@ -363,7 +363,7 @@ public class UnitTypes implements ContentList{ }}; zenith = new UnitType("zenith"){{ - health = 220; + health = 450; speed = 1.9f; accel = 0.04f; drag = 0.016f; @@ -376,12 +376,15 @@ public class UnitTypes implements ContentList{ engineSize = 3f; weapons.add(new Weapon("zenith-missiles"){{ - reload = 70f; + reload = 32f; x = 7f; rotate = true; shake = 1f; + shots = 2; + inaccuracy = 5f; + velocityRnd = 0.2f; - bullet = new MissileBulletType(2.7f, 12, "missile"){{ + bullet = new MissileBulletType(3f, 12){{ width = 8f; height = 8f; shrinkY = 0f; @@ -451,20 +454,28 @@ public class UnitTypes implements ContentList{ mono = new UnitType("mono"){{ flying = true; drag = 0.05f; - accel = 0.2f; + accel = 0.15f; speed = 2f; - range = 50f; health = 100; engineSize = 1.8f; engineOffset = 5.7f; + + mineTier = 1; + mineSpeed = 2.5f; + weapons.add(new Weapon(){{ y = 1.5f; + x = 0f; + reload = 40f; - x = 0.5f; ejectEffect = Fx.none; recoil = 2f; - bullet = Bullets.healBulletBig; shootSound = Sounds.pew; + mirror = false; + + bullet = new HealBulletType(5.2f, 10){{ + healPercent = 4f; + }}; }}); }}; @@ -473,29 +484,63 @@ public class UnitTypes implements ContentList{ flying = true; drag = 0.05f; - speed = 3f; + speed = 2f; rotateSpeed = 15f; - accel = 0.3f; + accel = 0.1f; range = 70f; itemCapacity = 70; health = 400; buildSpeed = 0.5f; engineOffset = 6.5f; hitsize = 8f; + lowAltitude = true; + + mineTier = 2; + mineSpeed = 3.5f; + + abilities.add(new HealFieldAbility(5f, 60f * 5, 50f)); + + weapons.add(new Weapon("heal-weapon-mount"){{ + y = -2.5f; + x = 3.5f; + reload = 34f; + ejectEffect = Fx.none; + recoil = 2f; + shootSound = Sounds.pew; + shots = 1; + velocityRnd = 0.5f; + inaccuracy = 15f; + alternate = true; + + bullet = new MissileBulletType(4f, 10){{ + homingPower = 0.08f; + weaveMag = 4; + weaveScale = 4; + lifetime = 50f; + keepVelocity = false; + shootEffect = Fx.shootHeal; + smokeEffect = Fx.hitLaser; + frontColor = Color.white; + + backColor = Pal.heal; + trailColor = Pal.heal; + }}; + }}); }}; mega = new UnitType("mega"){{ health = 500; - speed = 2f; - accel = 0.05f; - drag = 0.016f; + speed = 1.8f; + accel = 0.06f; + drag = 0.017f; lowAltitude = true; flying = true; engineOffset = 10.5f; rotateShooting = false; hitsize = 15f; engineSize = 3f; + payloadCapacity = 3; weapons.add( new Weapon("heal-weapon-mount"){{ diff --git a/core/src/mindustry/entities/bullet/ArtilleryBulletType.java b/core/src/mindustry/entities/bullet/ArtilleryBulletType.java index 08d02fe8f5..dfcab76e8a 100644 --- a/core/src/mindustry/entities/bullet/ArtilleryBulletType.java +++ b/core/src/mindustry/entities/bullet/ArtilleryBulletType.java @@ -2,12 +2,10 @@ package mindustry.entities.bullet; import arc.graphics.g2d.*; import mindustry.content.*; -import mindustry.entities.*; import mindustry.gen.*; //TODO scale velocity depending on fslope() public class ArtilleryBulletType extends BasicBulletType{ - protected Effect trailEffect = Fx.artilleryTrail; public ArtilleryBulletType(float speed, float damage, String bulletSprite){ super(speed, damage, bulletSprite); @@ -17,6 +15,7 @@ public class ArtilleryBulletType extends BasicBulletType{ scaleVelocity = true; hitShake = 1f; hitSound = Sounds.explosion; + trailEffect = Fx.artilleryTrail; } public ArtilleryBulletType(){ diff --git a/core/src/mindustry/entities/bullet/BulletType.java b/core/src/mindustry/entities/bullet/BulletType.java index baad95b1bc..0cf9cf60ed 100644 --- a/core/src/mindustry/entities/bullet/BulletType.java +++ b/core/src/mindustry/entities/bullet/BulletType.java @@ -75,6 +75,11 @@ public abstract class BulletType extends Content{ public BulletType fragBullet = null; public Color hitColor = Color.white; + public Color trailColor = Pal.missileYellowBack; + public float trailChance = -0.0001f; + public Effect trailEffect = Fx.missileTrail; + public float trailParam = 2f; + /** Use a negative value to disable splash damage. */ public float splashDamageRadius = -1f; @@ -118,7 +123,7 @@ public abstract class BulletType extends Content{ } public void hit(Bullet b){ - hit(b, b.getX(), b.getY()); + hit(b, b.x, b.y); } public void hit(Bullet b, float x, float y){ @@ -140,20 +145,20 @@ public abstract class BulletType extends Content{ } if(splashDamageRadius > 0){ - Damage.damage(b.team(), x, y, splashDamageRadius, splashDamage * b.damageMultiplier(), collidesAir, collidesGround); + Damage.damage(b.team, x, y, splashDamageRadius, splashDamage * b.damageMultiplier(), collidesAir, collidesGround); if(status != StatusEffects.none){ - Damage.status(b.team(), x, y, splashDamageRadius, status, statusDuration, collidesAir, collidesGround); + Damage.status(b.team, x, y, splashDamageRadius, status, statusDuration, collidesAir, collidesGround); } } for(int i = 0; i < lightning; i++){ - Lightning.create(b.team(), Pal.surge, lightningDamage < 0 ? damage : lightningDamage, b.getX(), b.getY(), Mathf.random(360f), lightningLength); + Lightning.create(b.team, Pal.surge, lightningDamage < 0 ? damage : lightningDamage, b.x, b.y, Mathf.random(360f), lightningLength); } } public void despawned(Bullet b){ - despawnEffect.at(b.getX(), b.getY(), b.rotation()); + despawnEffect.at(b.x, b.y, b.rotation()); hitSound.at(b); if(fragBullet != null || splashDamageRadius > 0 || lightning > 0){ @@ -165,7 +170,7 @@ public abstract class BulletType extends Content{ } public void drawLight(Bullet b){ - Drawf.light(b.team(), b, lightRadius, lightColor, lightOpacity); + Drawf.light(b.team, b, lightRadius, lightColor, lightOpacity); } public void init(Bullet b){ @@ -180,14 +185,20 @@ public abstract class BulletType extends Content{ public void update(Bullet b){ if(homingPower > 0.0001f){ - Teamc target = Units.closestTarget(b.team(), b.getX(), b.getY(), homingRange, e -> (e.isGrounded() && collidesGround) || (e.isFlying() && collidesAir), t -> collidesGround); + Teamc target = Units.closestTarget(b.team, b.x, b.y, homingRange, e -> (e.isGrounded() && collidesGround) || (e.isFlying() && collidesAir), t -> collidesGround); if(target != null){ b.vel.setAngle(Mathf.slerpDelta(b.rotation(), b.angleTo(target), homingPower)); } } if(weaveMag > 0){ - b.vel.rotate(Mathf.sin(Time.time() + b.id() * 3, weaveScale, weaveMag) * Time.delta()); + b.vel.rotate(Mathf.sin(Mathf.randomSeed(b.id, 10f) + b.time, weaveScale, weaveMag) * Time.delta()); + } + + if(trailChance > 0){ + if(Mathf.chanceDelta(trailChance)){ + trailEffect.at(b.x, b.y, trailParam, trailColor); + } } } @@ -213,11 +224,11 @@ public abstract class BulletType extends Content{ } public Bullet create(Bullet parent, float x, float y, float angle){ - return create(parent.owner(), parent.team(), x, y, angle); + return create(parent.owner(), parent.team, x, y, angle); } public Bullet create(Bullet parent, float x, float y, float angle, float velocityScl){ - return create(parent.owner(), parent.team(), x, y, angle, velocityScl); + return create(parent.owner(), parent.team, x, y, angle, velocityScl); } public Bullet create(@Nullable Entityc owner, Team team, float x, float y, float angle, float damage, float velocityScl, float lifetimeScl, Object data){ diff --git a/core/src/mindustry/entities/bullet/ContinuousLaserBulletType.java b/core/src/mindustry/entities/bullet/ContinuousLaserBulletType.java index c38bb7e32f..ef40d9b95b 100644 --- a/core/src/mindustry/entities/bullet/ContinuousLaserBulletType.java +++ b/core/src/mindustry/entities/bullet/ContinuousLaserBulletType.java @@ -48,7 +48,7 @@ public class ContinuousLaserBulletType extends BulletType{ //damage every 5 ticks if(b.timer(1, 5f)){ - Damage.collideLine(b, b.team(), hitEffect, b.x, b.y, b.rotation(), length, true); + Damage.collideLine(b, b.team, hitEffect, b.x, b.y, b.rotation(), length, true); } if(shake > 0){ @@ -72,7 +72,7 @@ public class ContinuousLaserBulletType extends BulletType{ Tmp.v1.trns(b.rotation(), baseLen * 1.1f); - Drawf.light(b.team(), b.x, b.y, b.x + Tmp.v1.x, b.y + Tmp.v1.y, 40, Color.orange, 0.7f); + Drawf.light(b.team, b.x, b.y, b.x + Tmp.v1.x, b.y + Tmp.v1.y, 40, Color.orange, 0.7f); Draw.reset(); } diff --git a/core/src/mindustry/entities/bullet/FlakBulletType.java b/core/src/mindustry/entities/bullet/FlakBulletType.java index 5c3e9bc2ec..ad5f8be7fa 100644 --- a/core/src/mindustry/entities/bullet/FlakBulletType.java +++ b/core/src/mindustry/entities/bullet/FlakBulletType.java @@ -28,7 +28,7 @@ public class FlakBulletType extends BasicBulletType{ if(b.data() instanceof Integer) return; if(b.timer(2, 6)){ - Units.nearbyEnemies(b.team(), Tmp.r1.setSize(explodeRange * 2f).setCenter(b.x, b.y), unit -> { + Units.nearbyEnemies(b.team, Tmp.r1.setSize(explodeRange * 2f).setCenter(b.x, b.y), unit -> { if(b.data() instanceof Float || !unit.checkTarget(collidesAir, collidesGround)) return; if(unit.dst(b) < explodeRange){ diff --git a/core/src/mindustry/entities/bullet/HealBulletType.java b/core/src/mindustry/entities/bullet/HealBulletType.java index deaf47fd27..af66a4c931 100644 --- a/core/src/mindustry/entities/bullet/HealBulletType.java +++ b/core/src/mindustry/entities/bullet/HealBulletType.java @@ -29,7 +29,7 @@ public class HealBulletType extends BulletType{ @Override public boolean collides(Bullet b, Building tile){ - return tile.team() != b.team() || tile.healthf() < 1f; + return tile.team() != b.team || tile.healthf() < 1f; } @Override @@ -46,7 +46,7 @@ public class HealBulletType extends BulletType{ public void hitTile(Bullet b, Building tile){ super.hit(b); - if(tile.team() == b.team() && !(tile.block() instanceof BuildBlock)){ + if(tile.team() == b.team && !(tile.block() instanceof BuildBlock)){ Fx.healBlockFull.at(tile.x, tile.y, tile.block().size, Pal.heal); tile.heal(healPercent / 100f * tile.maxHealth()); } diff --git a/core/src/mindustry/entities/bullet/LaserBulletType.java b/core/src/mindustry/entities/bullet/LaserBulletType.java index 4c5e3b3a40..571a78826d 100644 --- a/core/src/mindustry/entities/bullet/LaserBulletType.java +++ b/core/src/mindustry/entities/bullet/LaserBulletType.java @@ -54,11 +54,11 @@ public class LaserBulletType extends BulletType{ furthest = null; world.raycast(b.tileX(), b.tileY(), world.toTile(b.x + Tmp.v1.x), world.toTile(b.y + Tmp.v1.y), - (x, y) -> (furthest = world.tile(x, y)) != null && furthest.team() != b.team() && furthest.block().absorbLasers); + (x, y) -> (furthest = world.tile(x, y)) != null && furthest.team() != b.team && furthest.block().absorbLasers); float resultLength = furthest != null ? Math.max(6f, b.dst(furthest.worldx(), furthest.worldy())) : length; - Damage.collideLine(b, b.team(), hitEffect, b.x, b.y, b.rotation(), resultLength); + Damage.collideLine(b, b.team, hitEffect, b.x, b.y, b.rotation(), resultLength); if(furthest != null) b.data(resultLength); laserEffect.at(b.x, b.y, b.rotation(), resultLength * 0.75f); @@ -93,7 +93,7 @@ public class LaserBulletType extends BulletType{ Draw.reset(); Tmp.v1.trns(b.rotation(), baseLen * 1.1f); - Drawf.light(b.team(), b.x, b.y, b.x + Tmp.v1.x, b.y + Tmp.v1.y, width * 1.4f * b.fout(), colors[0], 0.6f); + Drawf.light(b.team, b.x, b.y, b.x + Tmp.v1.x, b.y + Tmp.v1.y, width * 1.4f * b.fout(), colors[0], 0.6f); } @Override diff --git a/core/src/mindustry/entities/bullet/LightningBulletType.java b/core/src/mindustry/entities/bullet/LightningBulletType.java index 901f7a2f0e..2104c94e67 100644 --- a/core/src/mindustry/entities/bullet/LightningBulletType.java +++ b/core/src/mindustry/entities/bullet/LightningBulletType.java @@ -32,6 +32,6 @@ public class LightningBulletType extends BulletType{ @Override public void init(Bullet b){ - Lightning.create(b.team(), lightningColor, damage, b.x, b.y, b.rotation(), lightningLength + Mathf.random(lightningLengthRand)); + Lightning.create(b.team, lightningColor, damage, b.x, b.y, b.rotation(), lightningLength + Mathf.random(lightningLengthRand)); } } diff --git a/core/src/mindustry/entities/bullet/MissileBulletType.java b/core/src/mindustry/entities/bullet/MissileBulletType.java index 6e15bd5b8b..a3670ac3c0 100644 --- a/core/src/mindustry/entities/bullet/MissileBulletType.java +++ b/core/src/mindustry/entities/bullet/MissileBulletType.java @@ -1,32 +1,27 @@ package mindustry.entities.bullet; -import arc.graphics.*; -import arc.math.*; -import mindustry.content.*; import mindustry.gen.*; import mindustry.graphics.*; public class MissileBulletType extends BasicBulletType{ - protected Color trailColor = Pal.missileYellowBack; public MissileBulletType(float speed, float damage, String bulletSprite){ super(speed, damage, bulletSprite); backColor = Pal.missileYellowBack; frontColor = Pal.missileYellow; homingPower = 0.08f; + shrinkY = 0f; + width = 8f; + height = 8f; hitSound = Sounds.explosion; + trailChance = 0.2f; + } + + public MissileBulletType(float speed, float damage){ + this(speed, damage, "missile"); } public MissileBulletType(){ this(1f, 1f, "missile"); } - - @Override - public void update(Bullet b){ - super.update(b); - - if(Mathf.chanceDelta(0.2)){ - Fx.missileTrail.at(b.x, b.y, 2f, trailColor); - } - } } diff --git a/core/src/mindustry/input/DesktopInput.java b/core/src/mindustry/input/DesktopInput.java index 2e82e71c63..a2fea83cc9 100644 --- a/core/src/mindustry/input/DesktopInput.java +++ b/core/src/mindustry/input/DesktopInput.java @@ -603,7 +603,7 @@ public class DesktopInput extends InputHandler{ Payloadc pay = (Payloadc)unit; if(Core.input.keyTap(Binding.pickupCargo) && pay.payloads().size < unit.type().payloadCapacity){ - Unit target = Units.closest(player.team(), pay.x(), pay.y(), unit.type().hitsize * 1.1f, u -> u.isAI() && u.isGrounded()); + Unit target = Units.closest(player.team(), pay.x(), pay.y(), unit.type().hitsize * 1.1f, u -> u.isAI() && u.isGrounded() && u.mass() < unit.mass()); if(target != null){ Call.pickupUnitPayload(player, target); }else if(!pay.hasPayload()){ diff --git a/core/src/mindustry/input/InputHandler.java b/core/src/mindustry/input/InputHandler.java index 5237a2c117..e59784dd0b 100644 --- a/core/src/mindustry/input/InputHandler.java +++ b/core/src/mindustry/input/InputHandler.java @@ -112,6 +112,7 @@ public abstract class InputHandler implements InputProcessor, GestureListener{ Payloadc pay = (Payloadc)unit; if(target.isAI() && target.isGrounded() && pay.payloads().size < unit.type().payloadCapacity + && target.mass() < unit.mass() && target.within(unit, unit.type().hitsize * 1.5f)){ pay.pickup(target); } diff --git a/core/src/mindustry/io/legacy/LegacyTypeTable.java b/core/src/mindustry/io/legacy/LegacyTypeTable.java deleted file mode 100644 index 642c48a189..0000000000 --- a/core/src/mindustry/io/legacy/LegacyTypeTable.java +++ /dev/null @@ -1,139 +0,0 @@ -package mindustry.io.legacy; - -/* -Latest data: [build 81] - -0 = Player -1 = Fire -2 = Puddle -3 = MinerDrone -4 = RepairDrone -5 = BuilderDrone -6 = GroundUnit -7 = GroundUnit -8 = GroundUnit -9 = GroundUnit -10 = GroundUnit -11 = FlyingUnit -12 = FlyingUnit -13 = Revenant - -Before removal of lightining/bullet: [build 80] - -0 = Player -1 = Fire -2 = Puddle -3 = Bullet -4 = Lightning -5 = MinerDrone -6 = RepairDrone -7 = BuilderDrone -8 = GroundUnit -9 = GroundUnit -10 = GroundUnit -11 = GroundUnit -12 = GroundUnit -13 = FlyingUnit -14 = FlyingUnit -15 = Revenant - -Before addition of new units: [build 79 and below] - -0 = Player -1 = Fire -2 = Puddle -3 = Bullet -4 = Lightning -5 = RepairDrone -6 = GroundUnit -7 = GroundUnit -8 = GroundUnit -9 = GroundUnit -10 = GroundUnit -11 = FlyingUnit -12 = FlyingUnit -13 = BuilderDrone -14 = Revenant - */ -public class LegacyTypeTable{ - /* - 0 = Player -1 = Fire -2 = Puddle -3 = Draug -4 = Spirit -5 = Phantom -6 = Dagger -7 = Crawler -8 = Titan -9 = Fortress -10 = Eruptor -11 = Wraith -12 = Ghoul -13 = Revenant - - private static final Prov[] build81Table = { - Player::new, - Fire::new, - Puddle::new, - MinerDrone::new, - RepairDrone::new, - BuilderDrone::new, - GroundUnit::new, - GroundUnit::new, - GroundUnit::new, - GroundUnit::new, - GroundUnit::new, - FlyingUnit::new, - FlyingUnit::new, - HoverUnit::new - }; - - private static final Prov[] build80Table = { - Player::new, - Fire::new, - Puddle::new, - Bullet::new, - Lightning::new, - MinerDrone::new, - RepairDrone::new, - BuilderDrone::new, - GroundUnit::new, - GroundUnit::new, - GroundUnit::new, - GroundUnit::new, - GroundUnit::new, - FlyingUnit::new, - FlyingUnit::new, - HoverUnit::new - }; - - private static final Prov[] build79Table = { - Player::new, - Fire::new, - Puddle::new, - Bullet::new, - Lightning::new, - RepairDrone::new, - GroundUnit::new, - GroundUnit::new, - GroundUnit::new, - GroundUnit::new, - GroundUnit::new, - FlyingUnit::new, - FlyingUnit::new, - BuilderDrone::new, - HoverUnit::new - }; - - public static Prov[] getTable(int build){ - if(build == -1 || build == 81){ - //return most recent one since that's probably it; not guaranteed - return build81Table; - }else if(build == 80){ - return build80Table; - }else{ - return build79Table; - } - }*/ -} diff --git a/core/src/mindustry/world/blocks/defense/PointDefenseTurret.java b/core/src/mindustry/world/blocks/defense/PointDefenseTurret.java index 656f1bde0e..25e5439c69 100644 --- a/core/src/mindustry/world/blocks/defense/PointDefenseTurret.java +++ b/core/src/mindustry/world/blocks/defense/PointDefenseTurret.java @@ -69,11 +69,11 @@ public class PointDefenseTurret extends Block{ //retarget if(timer(timerTarget, retargetTime)){ - target = Groups.bullet.intersect(x - range, y - range, range*2, range*2).min(b -> b.team() == team || !b.type().hittable ? Float.MAX_VALUE : b.dst2(this)); + target = Groups.bullet.intersect(x - range, y - range, range*2, range*2).min(b -> b.team == team || !b.type().hittable ? Float.MAX_VALUE : b.dst2(this)); } //look at target - if(target != null && target.within(this, range) && target.team() != team && target.type().hittable){ + if(target != null && target.within(this, range) && target.team != team && target.type().hittable){ float dest = angleTo(target); rotation = Angles.moveToward(rotation, dest, rotateSpeed * edelta()); reload -= edelta();