diff --git a/core/assets/music/game4.ogg b/core/assets/music/game4.ogg index 5b9dbe5ee4..051c414540 100644 Binary files a/core/assets/music/game4.ogg and b/core/assets/music/game4.ogg differ diff --git a/core/src/mindustry/ai/Pathfinder.java b/core/src/mindustry/ai/Pathfinder.java index 920e28e6ce..e8199163ae 100644 --- a/core/src/mindustry/ai/Pathfinder.java +++ b/core/src/mindustry/ai/Pathfinder.java @@ -51,7 +51,7 @@ public class Pathfinder implements Runnable{ (PathTile.solid(tile) ? 5 : 0), //water - (team, tile) -> PathTile.solid(tile) || !PathTile.liquid(tile) ? 200 : 2 + //TODO cannot go through blocks - pathfinding isn't great + (team, tile) -> PathTile.solid(tile) || !PathTile.liquid(tile) ? 200 : 2 + (PathTile.nearGround(tile) || PathTile.nearSolid(tile) ? 14 : 0) + (PathTile.deep(tile) ? -1 : 0) + (PathTile.damages(tile) ? 35 : 0) diff --git a/core/src/mindustry/entities/Damage.java b/core/src/mindustry/entities/Damage.java index 152982a986..e22891eba5 100644 --- a/core/src/mindustry/entities/Damage.java +++ b/core/src/mindustry/entities/Damage.java @@ -184,7 +184,6 @@ public class Damage{ Building tile = world.build(cx, cy); if(tile != null && tile.team != hitter.team){ tmpBuilding = tile; - //TODO return tile return true; } return false; diff --git a/core/src/mindustry/entities/Units.java b/core/src/mindustry/entities/Units.java index 02fa2931f5..85761795e5 100644 --- a/core/src/mindustry/entities/Units.java +++ b/core/src/mindustry/entities/Units.java @@ -215,12 +215,12 @@ public class Units{ cdist = 0f; nearbyEnemies(team, x - range, y - range, range*2f, range*2f, e -> { - if(e.dead() || !predicate.get(e)) return; + if(e.dead() || !predicate.get(e) || !e.within(x, y, range)) return; - float dst2 = sort.cost(e, x, y); - if(dst2 < range*range && (result == null || dst2 < cdist)){ + float cost = sort.cost(e, x, y); + if(result == null || cost < cdist){ result = e; - cdist = dst2; + cdist = cost; } }); diff --git a/core/src/mindustry/entities/abilities/ForceFieldAbility.java b/core/src/mindustry/entities/abilities/ForceFieldAbility.java index 7d36f97e04..fa9fa5e2c8 100644 --- a/core/src/mindustry/entities/abilities/ForceFieldAbility.java +++ b/core/src/mindustry/entities/abilities/ForceFieldAbility.java @@ -27,8 +27,8 @@ public class ForceFieldAbility extends Ability{ private static float realRad; private static Unit paramUnit; private static ForceFieldAbility paramField; - private static final Cons shieldConsumer = trait -> { - if(trait.team() != paramUnit.team && Intersector.isInsideHexagon(paramUnit.x, paramUnit.y, realRad * 2f, trait.x(), trait.y()) && paramUnit.shield > 0){ + private static final Cons shieldConsumer = trait -> { + if(trait.team != paramUnit.team && trait.type.absorbable && Intersector.isInsideHexagon(paramUnit.x, paramUnit.y, realRad * 2f, trait.x(), trait.y()) && paramUnit.shield > 0){ trait.absorb(); Fx.absorb.at(trait); diff --git a/core/src/mindustry/entities/bullet/BulletType.java b/core/src/mindustry/entities/bullet/BulletType.java index d52bd6f86c..bd4d57c771 100644 --- a/core/src/mindustry/entities/bullet/BulletType.java +++ b/core/src/mindustry/entities/bullet/BulletType.java @@ -71,6 +71,8 @@ public abstract class BulletType extends Content{ public boolean hittable = true; /** Whether this bullet can be reflected. */ public boolean reflectable = true; + /** Whether this projectile can be absorbed by shields. */ + public boolean absorbable = true; /** Whether to move the bullet back depending on delta to fix some delta-time realted issues. * Do not change unless you know what you're doing. */ public boolean backMove = true; diff --git a/core/src/mindustry/entities/bullet/ContinuousLaserBulletType.java b/core/src/mindustry/entities/bullet/ContinuousLaserBulletType.java index 0f1894271f..e146fd7a54 100644 --- a/core/src/mindustry/entities/bullet/ContinuousLaserBulletType.java +++ b/core/src/mindustry/entities/bullet/ContinuousLaserBulletType.java @@ -37,6 +37,7 @@ public class ContinuousLaserBulletType extends BulletType{ incendSpread = 5; incendChance = 0.4f; lightColor = Color.orange; + absorbable = false; } protected ContinuousLaserBulletType(){ diff --git a/core/src/mindustry/entities/comp/ShieldComp.java b/core/src/mindustry/entities/comp/ShieldComp.java index 5125faa96e..c0fb68d78a 100644 --- a/core/src/mindustry/entities/comp/ShieldComp.java +++ b/core/src/mindustry/entities/comp/ShieldComp.java @@ -23,7 +23,6 @@ abstract class ShieldComp implements Healthc, Posc{ @Override public void damage(float amount){ //apply armor - //TODO balancing of armor stats & minArmorDamage amount = Math.max(amount - armor, minArmorDamage * amount); hitTime = 1f; diff --git a/core/src/mindustry/game/Universe.java b/core/src/mindustry/game/Universe.java index 15c0a894a4..b2c9c7d039 100644 --- a/core/src/mindustry/game/Universe.java +++ b/core/src/mindustry/game/Universe.java @@ -170,7 +170,6 @@ public class Universe{ } } } - //TODO events Events.fire(new TurnEvent()); diff --git a/core/src/mindustry/graphics/IndexedRenderer.java b/core/src/mindustry/graphics/IndexedRenderer.java index 154147da14..46b9093a14 100644 --- a/core/src/mindustry/graphics/IndexedRenderer.java +++ b/core/src/mindustry/graphics/IndexedRenderer.java @@ -7,7 +7,6 @@ import arc.graphics.gl.*; import arc.math.*; import arc.util.*; -//TODO this class is a trainwreck, remove it public class IndexedRenderer implements Disposable{ private static final int vsize = 5; diff --git a/core/src/mindustry/input/MobileInput.java b/core/src/mindustry/input/MobileInput.java index 99c77773af..07b543c704 100644 --- a/core/src/mindustry/input/MobileInput.java +++ b/core/src/mindustry/input/MobileInput.java @@ -880,16 +880,10 @@ public class MobileInput extends InputHandler implements GestureListener{ }else{ unit.moveAt(Tmp.v2.trns(unit.rotation, movement.len())); if(!movement.isZero() && legs){ - unit.vel.rotateTo(movement.angle(), type.rotateSpeed * Time.delta); + unit.vel.rotateTo(movement.angle(), type.rotateSpeed); } } - if(flying){ - //hovering effect - unit.x += Mathf.sin(Time.time(), 25f, 0.08f); - unit.y += Mathf.cos(Time.time(), 25f, 0.08f); - } - //update shooting if not building + not mining if(!player.builder().isBuilding() && player.miner().mineTile() == null){ diff --git a/core/src/mindustry/world/blocks/defense/ForceProjector.java b/core/src/mindustry/world/blocks/defense/ForceProjector.java index 5a2fd461af..b508e90965 100644 --- a/core/src/mindustry/world/blocks/defense/ForceProjector.java +++ b/core/src/mindustry/world/blocks/defense/ForceProjector.java @@ -33,8 +33,8 @@ public class ForceProjector extends Block{ public @Load("@-top") TextureRegion topRegion; static ForceBuild paramEntity; - static final Cons shieldConsumer = trait -> { - if(trait.team() != paramEntity.team && Intersector.isInsideHexagon(paramEntity.x, paramEntity.y, paramEntity.realRadius() * 2f, trait.x(), trait.y())){ + static final Cons shieldConsumer = trait -> { + if(trait.team != paramEntity.team && trait.type.absorbable && Intersector.isInsideHexagon(paramEntity.x, paramEntity.y, paramEntity.realRadius() * 2f, trait.x(), trait.y())){ trait.absorb(); Fx.absorb.at(trait); paramEntity.hit = 1f; diff --git a/core/src/mindustry/world/blocks/production/Separator.java b/core/src/mindustry/world/blocks/production/Separator.java index 14b03f97fd..bcf66984e3 100644 --- a/core/src/mindustry/world/blocks/production/Separator.java +++ b/core/src/mindustry/world/blocks/production/Separator.java @@ -105,7 +105,7 @@ public class Separator extends Block{ int count = 0; Item item = null; - //TODO guaranteed desync since items are random + //guaranteed desync since items are random - won't be fixed and probably isn't too important for(ItemStack stack : results){ if(i >= count && i < count + stack.amount){ item = stack.item; diff --git a/core/src/mindustry/world/blocks/units/RepairPoint.java b/core/src/mindustry/world/blocks/units/RepairPoint.java index 13cc7b848b..abcc4bf738 100644 --- a/core/src/mindustry/world/blocks/units/RepairPoint.java +++ b/core/src/mindustry/world/blocks/units/RepairPoint.java @@ -70,7 +70,7 @@ public class RepairPoint extends Block{ Draw.rect(baseRegion, x, y); Draw.z(Layer.turret); - Drawf.shadow(region, x - (size / 2), y - (size / 2), rotation - 90); + Drawf.shadow(region, x - (size / 2f), y - (size / 2f), rotation - 90); Draw.rect(region, x, y, rotation - 90); if(target != null && Angles.angleDist(angleTo(target), rotation) < 30f){