diff --git a/core/src/io/anuke/mindustry/content/Blocks.java b/core/src/io/anuke/mindustry/content/Blocks.java index 78a6aa9285..6f103ab2a0 100644 --- a/core/src/io/anuke/mindustry/content/Blocks.java +++ b/core/src/io/anuke/mindustry/content/Blocks.java @@ -1315,7 +1315,8 @@ public class Blocks implements ContentList{ requirements(Category.turret, ItemStack.with(Items.copper, 85, Items.lead, 45)); ammo( Items.scrap, Bullets.flakScrap, - Items.lead, Bullets.flakLead + Items.lead, Bullets.flakLead, + Items.metaglass, Bullets.flakGlass ); reload = 18f; range = 170f; @@ -1558,6 +1559,7 @@ public class Blocks implements ContentList{ cyclone = new ItemTurret("cyclone"){{ requirements(Category.turret, ItemStack.with(Items.copper, 200, Items.titanium, 125, Items.plastanium, 80)); ammo( + Items.metaglass, Bullets.flakGlass, Items.blastCompound, Bullets.flakExplosive, Items.plastanium, Bullets.flakPlastic, Items.surgealloy, Bullets.flakSurge diff --git a/core/src/io/anuke/mindustry/content/Bullets.java b/core/src/io/anuke/mindustry/content/Bullets.java index 68382f121c..ac18c8a2b0 100644 --- a/core/src/io/anuke/mindustry/content/Bullets.java +++ b/core/src/io/anuke/mindustry/content/Bullets.java @@ -21,7 +21,7 @@ public class Bullets implements ContentList{ artilleryDense, arilleryPlastic, artilleryPlasticFrag, artilleryHoming, artlleryIncendiary, artilleryExplosive, artilleryUnit, //flak - flakScrap, flakLead, flakPlastic, flakExplosive, flakSurge, + flakScrap, flakLead, flakPlastic, flakExplosive, flakSurge, flakGlass, glassFrag, //missiles missileExplosive, missileIncendiary, missileSurge, missileJavelin, missileSwarm, missileRevenant, @@ -55,7 +55,7 @@ public class Bullets implements ContentList{ splashDamage = 33f; }}; - artilleryPlasticFrag = new BasicBulletType(2.5f, 7, "bullet"){{ + artilleryPlasticFrag = new BasicBulletType(2.5f, 10, "bullet"){{ bulletWidth = 10f; bulletHeight = 12f; bulletShrink = 1f; @@ -132,6 +132,16 @@ public class Bullets implements ContentList{ frontColor = Pal.bulletYellow; }}; + glassFrag = new BasicBulletType(3f, 6, "bullet"){{ + bulletWidth = 5f; + bulletHeight = 12f; + bulletShrink = 1f; + lifetime = 20f; + backColor = Pal.gray; + frontColor = Color.white; + despawnEffect = Fx.none; + }}; + flakLead = new FlakBulletType(4.2f, 3){{ lifetime = 60f; ammoMultiplier = 4f; @@ -155,8 +165,23 @@ public class Bullets implements ContentList{ splashDamageRadius = 24f; }}; + flakGlass = new FlakBulletType(4f, 3){{ + lifetime = 70f; + ammoMultiplier = 5f; + shootEffect = Fx.shootSmall; + reloadMultiplier = 0.8f; + bulletWidth = 6f; + bulletHeight = 8f; + hitEffect = Fx.flakExplosion; + splashDamage = 30f; + splashDamageRadius = 26f; + fragBullet = glassFrag; + fragBullets = 6; + }}; + flakPlastic = new FlakBulletType(4f, 6){{ splashDamageRadius = 50f; + splashDamage = 25f; fragBullet = artilleryPlasticFrag; fragBullets = 6; hitEffect = Fx.plasticExplosion; diff --git a/core/src/io/anuke/mindustry/entities/type/Unit.java b/core/src/io/anuke/mindustry/entities/type/Unit.java index 28cedcd4a5..218c5db59c 100644 --- a/core/src/io/anuke/mindustry/entities/type/Unit.java +++ b/core/src/io/anuke/mindustry/entities/type/Unit.java @@ -216,10 +216,14 @@ public abstract class Unit extends DestructibleEntity implements SaveTrait, Targ float cx = x - fsize/2f, cy = y - fsize/2f; for(Team team : Team.all){ - avoid(unitGroups[team.ordinal()].intersect(cx, cy, fsize, fsize)); + if(team != getTeam() || !(this instanceof Player)){ + avoid(unitGroups[team.ordinal()].intersect(cx, cy, fsize, fsize)); + } } - avoid(playerGroup.intersect(cx, cy, fsize, fsize)); + if(!(this instanceof Player)){ + avoid(playerGroup.intersect(cx, cy, fsize, fsize)); + } velocity.add(moveVector.x / mass() * Time.delta(), moveVector.y / mass() * Time.delta()); } @@ -227,15 +231,14 @@ public abstract class Unit extends DestructibleEntity implements SaveTrait, Targ float radScl = 1.5f; for(Unit en : arr){ - if(en.isFlying() != isFlying()) continue; + if(en.isFlying() != isFlying() || (en instanceof Player && en.getTeam() != getTeam())) continue; float dst = dst(en); float scl = Mathf.clamp(1f - dst / (getSize()/(radScl*2f) + en.getSize()/(radScl*2f))); moveVector.add(Tmp.v1.set((x - en.x) * scl, (y - en.y) * scl).limit(0.4f)); } } - public @Nullable - TileEntity getClosestCore(){ + public @Nullable TileEntity getClosestCore(){ TeamData data = state.teams.get(team); Tile tile = Geometry.findClosest(x, y, data.cores); diff --git a/core/src/io/anuke/mindustry/game/Content.java b/core/src/io/anuke/mindustry/game/Content.java index f75a4495fb..20d8612697 100644 --- a/core/src/io/anuke/mindustry/game/Content.java +++ b/core/src/io/anuke/mindustry/game/Content.java @@ -1,12 +1,16 @@ package io.anuke.mindustry.game; +import io.anuke.arc.util.ArcAnnotate.*; import io.anuke.mindustry.Vars; +import io.anuke.mindustry.mod.Mods.*; import io.anuke.mindustry.type.ContentType; /** Base class for a content type that is loaded in {@link io.anuke.mindustry.core.ContentLoader}. */ public abstract class Content{ public final short id; + /** The mod that loaded this piece of content. */ + public @Nullable LoadedMod mod; public Content(){ this.id = (short)Vars.content.getBy(getContentType()).size;