Fixed turrets hitting friendly players / Fixed android compile error
This commit is contained in:
@@ -1,7 +1,7 @@
|
|||||||
#Autogenerated file. Do not modify.
|
#Autogenerated file. Do not modify.
|
||||||
#Thu Apr 05 22:30:42 EDT 2018
|
#Fri Apr 06 10:14:01 EDT 2018
|
||||||
version=release
|
version=release
|
||||||
androidBuildCode=853
|
androidBuildCode=856
|
||||||
name=Mindustry
|
name=Mindustry
|
||||||
code=3.4
|
code=3.4
|
||||||
build=custom build
|
build=custom build
|
||||||
|
|||||||
@@ -13,13 +13,6 @@ public class Liquids {
|
|||||||
heatCapacity = 0.4f;
|
heatCapacity = 0.4f;
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
plasma = new Liquid("plasma", Color.CORAL) {
|
|
||||||
{
|
|
||||||
flammability = 0.4f;
|
|
||||||
viscosity = 0.1f;
|
|
||||||
heatCapacity = 0.2f;
|
|
||||||
}
|
|
||||||
},
|
|
||||||
lava = new Liquid("lava", Color.valueOf("e37341")) {
|
lava = new Liquid("lava", Color.valueOf("e37341")) {
|
||||||
{
|
{
|
||||||
temperature = 0.7f;
|
temperature = 0.7f;
|
||||||
@@ -38,12 +31,5 @@ public class Liquids {
|
|||||||
heatCapacity = 0.75f;
|
heatCapacity = 0.75f;
|
||||||
temperature = 0.5f;
|
temperature = 0.5f;
|
||||||
}
|
}
|
||||||
},
|
|
||||||
sulfuricAcid = new Liquid("sulfuricAcid", Color.YELLOW) {
|
|
||||||
{
|
|
||||||
flammability = 0.4f;
|
|
||||||
explosiveness = 0.4f;
|
|
||||||
heatCapacity = 0.4f;
|
|
||||||
}
|
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -131,17 +131,18 @@ public class WeaponBlocks{
|
|||||||
};
|
};
|
||||||
}},
|
}},
|
||||||
|
|
||||||
chainturret = new Turret("chainturret"){
|
chainturret = new Turret("chainturret"){{
|
||||||
|
|
||||||
},
|
}},
|
||||||
|
|
||||||
titanturret = new Turret("titancannon"){
|
titanturret = new Turret("titancannon"){{
|
||||||
|
|
||||||
},
|
}},
|
||||||
|
|
||||||
fornaxcannon = new PowerTurret("fornaxcannon") {
|
fornaxcannon = new PowerTurret("fornaxcannon") {
|
||||||
|
|
||||||
},
|
},
|
||||||
|
|
||||||
missileturret = new PowerTurret("missileturret") {
|
missileturret = new PowerTurret("missileturret") {
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -8,6 +8,7 @@ import io.anuke.mindustry.content.fx.Fx;
|
|||||||
import io.anuke.mindustry.entities.Bullet;
|
import io.anuke.mindustry.entities.Bullet;
|
||||||
import io.anuke.mindustry.entities.BulletType;
|
import io.anuke.mindustry.entities.BulletType;
|
||||||
import io.anuke.mindustry.entities.effect.DamageArea;
|
import io.anuke.mindustry.entities.effect.DamageArea;
|
||||||
|
import io.anuke.mindustry.entities.effect.Lightning;
|
||||||
import io.anuke.mindustry.graphics.Palette;
|
import io.anuke.mindustry.graphics.Palette;
|
||||||
import io.anuke.mindustry.resource.Liquid;
|
import io.anuke.mindustry.resource.Liquid;
|
||||||
import io.anuke.ucore.core.Effects;
|
import io.anuke.ucore.core.Effects;
|
||||||
@@ -168,6 +169,21 @@ public class TurretBullets {
|
|||||||
status = StatusEffects.oiled;
|
status = StatusEffects.oiled;
|
||||||
statusIntensity = 0.5f;
|
statusIntensity = 0.5f;
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
lightning = new BulletType(0.001f, 5) {
|
||||||
|
{
|
||||||
|
lifetime = 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void draw(Bullet b) {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void init(Bullet b) {
|
||||||
|
new Lightning(b.team, b, b.x, b.y, b.angle(), 30);
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
private static void drawBullet(Color first, Color second, String name, float x, float y, float w, float h, float rot){
|
private static void drawBullet(Color first, Color second, String name, float x, float y, float w, float h, float rot){
|
||||||
|
|||||||
@@ -99,12 +99,6 @@ public class Player extends Unit{
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean collides(SolidEntity other){
|
public boolean collides(SolidEntity other){
|
||||||
if(other instanceof Bullet){
|
|
||||||
Bullet b = (Bullet)other;
|
|
||||||
if(!state.friendlyFire && b.owner instanceof Player){
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return !isDead() && super.collides(other) && !mech.flying;
|
return !isDead() && super.collides(other) && !mech.flying;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -2,6 +2,9 @@ package io.anuke.mindustry.entities;
|
|||||||
|
|
||||||
import com.badlogic.gdx.math.Vector2;
|
import com.badlogic.gdx.math.Vector2;
|
||||||
import io.anuke.mindustry.game.Team;
|
import io.anuke.mindustry.game.Team;
|
||||||
|
import io.anuke.ucore.entities.SolidEntity;
|
||||||
|
|
||||||
|
import static io.anuke.mindustry.Vars.state;
|
||||||
|
|
||||||
public abstract class Unit extends SyncEntity {
|
public abstract class Unit extends SyncEntity {
|
||||||
//total duration of hit effect
|
//total duration of hit effect
|
||||||
@@ -18,6 +21,11 @@ public abstract class Unit extends SyncEntity {
|
|||||||
hitTime = hitDuration;
|
hitTime = hitDuration;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean collides(SolidEntity other){
|
||||||
|
return other instanceof Bullet && state.teams.areEnemies((((Bullet) other).team), team);
|
||||||
|
}
|
||||||
|
|
||||||
public void damage(float amount, boolean withEffect){
|
public void damage(float amount, boolean withEffect){
|
||||||
if(withEffect){
|
if(withEffect){
|
||||||
damage(amount);
|
damage(amount);
|
||||||
|
|||||||
@@ -0,0 +1,34 @@
|
|||||||
|
package io.anuke.mindustry.entities.effect;
|
||||||
|
|
||||||
|
import com.badlogic.gdx.math.Vector2;
|
||||||
|
import com.badlogic.gdx.utils.Array;
|
||||||
|
import io.anuke.mindustry.game.Team;
|
||||||
|
import io.anuke.ucore.entities.Entity;
|
||||||
|
import io.anuke.ucore.entities.SolidEntity;
|
||||||
|
import io.anuke.ucore.util.Angles;
|
||||||
|
import io.anuke.ucore.util.Mathf;
|
||||||
|
|
||||||
|
public class Lightning extends Entity {
|
||||||
|
private Array<Vector2> lines = new Array<Vector2>();
|
||||||
|
|
||||||
|
public Lightning(Team team, SolidEntity damager, float x, float y, float angle, int length){
|
||||||
|
float step = 3f;
|
||||||
|
|
||||||
|
for(int i = 0; i < length; i ++){
|
||||||
|
lines.add(new Vector2(x, y));
|
||||||
|
|
||||||
|
float x2 = x + Angles.trnsx(angle, step);
|
||||||
|
float y2 = y + Angles.trnsy(angle, step);
|
||||||
|
angle += Mathf.range(30f);
|
||||||
|
|
||||||
|
if(Mathf.chance(0.1)){
|
||||||
|
new Lightning(team, damager, x2, y2, angle + Mathf.range(100f), length/2).add();
|
||||||
|
}
|
||||||
|
|
||||||
|
x = x2;
|
||||||
|
y = y2;
|
||||||
|
}
|
||||||
|
|
||||||
|
lines.add(new Vector2(x, y));
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -5,13 +5,11 @@ import io.anuke.mindustry.entities.BulletType;
|
|||||||
import io.anuke.mindustry.entities.Unit;
|
import io.anuke.mindustry.entities.Unit;
|
||||||
import io.anuke.mindustry.game.Team;
|
import io.anuke.mindustry.game.Team;
|
||||||
import io.anuke.ucore.entities.Entity;
|
import io.anuke.ucore.entities.Entity;
|
||||||
import io.anuke.ucore.entities.SolidEntity;
|
|
||||||
import io.anuke.ucore.util.Mathf;
|
import io.anuke.ucore.util.Mathf;
|
||||||
import io.anuke.ucore.util.Timer;
|
import io.anuke.ucore.util.Timer;
|
||||||
|
|
||||||
import java.nio.ByteBuffer;
|
import java.nio.ByteBuffer;
|
||||||
|
|
||||||
import static io.anuke.mindustry.Vars.state;
|
|
||||||
import static io.anuke.mindustry.Vars.unitGroups;
|
import static io.anuke.mindustry.Vars.unitGroups;
|
||||||
|
|
||||||
public class BaseUnit extends Unit {
|
public class BaseUnit extends Unit {
|
||||||
@@ -74,11 +72,6 @@ public class BaseUnit extends Unit {
|
|||||||
return 14;
|
return 14;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean collides(SolidEntity other){
|
|
||||||
return other instanceof Bullet && state.teams.areEnemies((((Bullet) other).team), team);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onRemoteShoot(BulletType type, float x, float y, float rotation, short data) {
|
public void onRemoteShoot(BulletType type, float x, float y, float rotation, short data) {
|
||||||
new Bullet(type, this, x, y, rotation).add().damage = data;
|
new Bullet(type, this, x, y, rotation).add().damage = data;
|
||||||
|
|||||||
@@ -3,3 +3,4 @@ org.gradle.jvmargs=-Xms512m -Xmx1536m
|
|||||||
org.gradle.configureondemand=true
|
org.gradle.configureondemand=true
|
||||||
android.enableAapt2=false
|
android.enableAapt2=false
|
||||||
android.injected.build.model.only.versioned=3
|
android.injected.build.model.only.versioned=3
|
||||||
|
android.enableD8=true
|
||||||
|
|||||||
Reference in New Issue
Block a user