Fixed 1-character names being valid / Fixed collideLine with tiles

This commit is contained in:
Anuken
2018-08-17 20:21:49 -04:00
parent f8d6797fc2
commit 20021c5b31
5 changed files with 28 additions and 30 deletions
@@ -6,6 +6,7 @@ import com.badlogic.gdx.math.Vector2;
import io.anuke.mindustry.content.bullets.TurretBullets;
import io.anuke.mindustry.content.fx.ExplosionFx;
import io.anuke.mindustry.content.fx.Fx;
import io.anuke.mindustry.entities.bullet.Bullet;
import io.anuke.mindustry.entities.effect.Fire;
import io.anuke.mindustry.entities.effect.Lightning;
import io.anuke.mindustry.game.Team;
@@ -15,7 +16,6 @@ import io.anuke.mindustry.world.Tile;
import io.anuke.ucore.core.Effects;
import io.anuke.ucore.core.Effects.Effect;
import io.anuke.ucore.core.Timers;
import io.anuke.ucore.entities.impl.SolidEntity;
import io.anuke.ucore.function.Consumer;
import io.anuke.ucore.function.Predicate;
import io.anuke.ucore.util.Mathf;
@@ -84,8 +84,17 @@ public class Damage{
* Damages entities in a line.
* Only enemies of the specified team are damaged.
*/
public static void collideLine(SolidEntity hitter, Team team, Effect effect, float x, float y, float angle, float length){
public static void collideLine(Bullet hitter, Team team, Effect effect, float x, float y, float angle, float length){
tr.trns(angle, length);
world.raycastEachWorld(x, y, x + tr.x, y + tr.y, (cx, cy) -> {
Tile tile = world.tile(cx, cy);
if(tile != null && tile.entity != null && tile.entity.collide(hitter)){
tile.entity.collision(hitter);
Effects.effect(effect, tile.worldx(), tile.worldy());
}
return false;
});
rect.setPosition(x, y).setSize(tr.x, tr.y);
float x2 = tr.x + x, y2 = tr.y + y;
@@ -13,41 +13,23 @@ public abstract class BulletType extends BaseBulletType<Bullet> implements Conte
private static Array<BulletType> types = new Array<>();
public final int id;
/**
* Knockback in velocity.
*/
/**Knockback in velocity.*/
public float knockback;
/**
* Whether this bullet hits tiles.
*/
/**Whether this bullet hits tiles.*/
public boolean hitTiles = true;
/**
* Status effect applied on hit.
*/
/**Status effect applied on hit.*/
public StatusEffect status = StatusEffects.none;
/**
* Intensity of applied status effect in terms of duration.
*/
/**Intensity of applied status effect in terms of duration.*/
public float statusIntensity = 0.5f;
/**
* What fraction of armor is pierced, 0-1
*/
/**What fraction of armor is pierced, 0-1*/
public float armorPierce = 0f;
/**
* Whether to sync this bullet to clients.
*/
/**Whether to sync this bullet to clients.*/
public boolean syncable;
/**
* Whether this bullet type collides with tiles.
*/
/**Whether this bullet type collides with tiles.*/
public boolean collidesTiles = true;
/**
* Whether this bullet types collides with anything at all.
*/
/**Whether this bullet types collides with anything at all.*/
public boolean collides = true;
/**
* Whether velocity is inherited from the shooter.
*/
/**Whether velocity is inherited from the shooter.*/
public boolean keepVelocity = true;
public BulletType(float speed, float damage){