Disabled Player-Player and Player-Drone collisions
This commit is contained in:
@@ -1315,7 +1315,8 @@ public class Blocks implements ContentList{
|
|||||||
requirements(Category.turret, ItemStack.with(Items.copper, 85, Items.lead, 45));
|
requirements(Category.turret, ItemStack.with(Items.copper, 85, Items.lead, 45));
|
||||||
ammo(
|
ammo(
|
||||||
Items.scrap, Bullets.flakScrap,
|
Items.scrap, Bullets.flakScrap,
|
||||||
Items.lead, Bullets.flakLead
|
Items.lead, Bullets.flakLead,
|
||||||
|
Items.metaglass, Bullets.flakGlass
|
||||||
);
|
);
|
||||||
reload = 18f;
|
reload = 18f;
|
||||||
range = 170f;
|
range = 170f;
|
||||||
@@ -1558,6 +1559,7 @@ public class Blocks implements ContentList{
|
|||||||
cyclone = new ItemTurret("cyclone"){{
|
cyclone = new ItemTurret("cyclone"){{
|
||||||
requirements(Category.turret, ItemStack.with(Items.copper, 200, Items.titanium, 125, Items.plastanium, 80));
|
requirements(Category.turret, ItemStack.with(Items.copper, 200, Items.titanium, 125, Items.plastanium, 80));
|
||||||
ammo(
|
ammo(
|
||||||
|
Items.metaglass, Bullets.flakGlass,
|
||||||
Items.blastCompound, Bullets.flakExplosive,
|
Items.blastCompound, Bullets.flakExplosive,
|
||||||
Items.plastanium, Bullets.flakPlastic,
|
Items.plastanium, Bullets.flakPlastic,
|
||||||
Items.surgealloy, Bullets.flakSurge
|
Items.surgealloy, Bullets.flakSurge
|
||||||
|
|||||||
@@ -21,7 +21,7 @@ public class Bullets implements ContentList{
|
|||||||
artilleryDense, arilleryPlastic, artilleryPlasticFrag, artilleryHoming, artlleryIncendiary, artilleryExplosive, artilleryUnit,
|
artilleryDense, arilleryPlastic, artilleryPlasticFrag, artilleryHoming, artlleryIncendiary, artilleryExplosive, artilleryUnit,
|
||||||
|
|
||||||
//flak
|
//flak
|
||||||
flakScrap, flakLead, flakPlastic, flakExplosive, flakSurge,
|
flakScrap, flakLead, flakPlastic, flakExplosive, flakSurge, flakGlass, glassFrag,
|
||||||
|
|
||||||
//missiles
|
//missiles
|
||||||
missileExplosive, missileIncendiary, missileSurge, missileJavelin, missileSwarm, missileRevenant,
|
missileExplosive, missileIncendiary, missileSurge, missileJavelin, missileSwarm, missileRevenant,
|
||||||
@@ -55,7 +55,7 @@ public class Bullets implements ContentList{
|
|||||||
splashDamage = 33f;
|
splashDamage = 33f;
|
||||||
}};
|
}};
|
||||||
|
|
||||||
artilleryPlasticFrag = new BasicBulletType(2.5f, 7, "bullet"){{
|
artilleryPlasticFrag = new BasicBulletType(2.5f, 10, "bullet"){{
|
||||||
bulletWidth = 10f;
|
bulletWidth = 10f;
|
||||||
bulletHeight = 12f;
|
bulletHeight = 12f;
|
||||||
bulletShrink = 1f;
|
bulletShrink = 1f;
|
||||||
@@ -132,6 +132,16 @@ public class Bullets implements ContentList{
|
|||||||
frontColor = Pal.bulletYellow;
|
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){{
|
flakLead = new FlakBulletType(4.2f, 3){{
|
||||||
lifetime = 60f;
|
lifetime = 60f;
|
||||||
ammoMultiplier = 4f;
|
ammoMultiplier = 4f;
|
||||||
@@ -155,8 +165,23 @@ public class Bullets implements ContentList{
|
|||||||
splashDamageRadius = 24f;
|
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){{
|
flakPlastic = new FlakBulletType(4f, 6){{
|
||||||
splashDamageRadius = 50f;
|
splashDamageRadius = 50f;
|
||||||
|
splashDamage = 25f;
|
||||||
fragBullet = artilleryPlasticFrag;
|
fragBullet = artilleryPlasticFrag;
|
||||||
fragBullets = 6;
|
fragBullets = 6;
|
||||||
hitEffect = Fx.plasticExplosion;
|
hitEffect = Fx.plasticExplosion;
|
||||||
|
|||||||
@@ -216,10 +216,14 @@ public abstract class Unit extends DestructibleEntity implements SaveTrait, Targ
|
|||||||
float cx = x - fsize/2f, cy = y - fsize/2f;
|
float cx = x - fsize/2f, cy = y - fsize/2f;
|
||||||
|
|
||||||
for(Team team : Team.all){
|
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());
|
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;
|
float radScl = 1.5f;
|
||||||
|
|
||||||
for(Unit en : arr){
|
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 dst = dst(en);
|
||||||
float scl = Mathf.clamp(1f - dst / (getSize()/(radScl*2f) + en.getSize()/(radScl*2f)));
|
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));
|
moveVector.add(Tmp.v1.set((x - en.x) * scl, (y - en.y) * scl).limit(0.4f));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public @Nullable
|
public @Nullable TileEntity getClosestCore(){
|
||||||
TileEntity getClosestCore(){
|
|
||||||
TeamData data = state.teams.get(team);
|
TeamData data = state.teams.get(team);
|
||||||
|
|
||||||
Tile tile = Geometry.findClosest(x, y, data.cores);
|
Tile tile = Geometry.findClosest(x, y, data.cores);
|
||||||
|
|||||||
@@ -1,12 +1,16 @@
|
|||||||
package io.anuke.mindustry.game;
|
package io.anuke.mindustry.game;
|
||||||
|
|
||||||
|
import io.anuke.arc.util.ArcAnnotate.*;
|
||||||
import io.anuke.mindustry.Vars;
|
import io.anuke.mindustry.Vars;
|
||||||
|
import io.anuke.mindustry.mod.Mods.*;
|
||||||
import io.anuke.mindustry.type.ContentType;
|
import io.anuke.mindustry.type.ContentType;
|
||||||
|
|
||||||
|
|
||||||
/** Base class for a content type that is loaded in {@link io.anuke.mindustry.core.ContentLoader}. */
|
/** Base class for a content type that is loaded in {@link io.anuke.mindustry.core.ContentLoader}. */
|
||||||
public abstract class Content{
|
public abstract class Content{
|
||||||
public final short id;
|
public final short id;
|
||||||
|
/** The mod that loaded this piece of content. */
|
||||||
|
public @Nullable LoadedMod mod;
|
||||||
|
|
||||||
public Content(){
|
public Content(){
|
||||||
this.id = (short)Vars.content.getBy(getContentType()).size;
|
this.id = (short)Vars.content.getBy(getContentType()).size;
|
||||||
|
|||||||
Reference in New Issue
Block a user