Boss waves, health bars / Better lasers / Bugfixes
This commit is contained in:
@@ -60,7 +60,7 @@ public class Damage{
|
||||
|
||||
float shake = Math.min(explosiveness / 4f + 3f, 9f);
|
||||
Effects.shake(shake, shake, x, y);
|
||||
Effects.effect(Fx.blockExplosion, x, y);
|
||||
Effects.effect(Fx.dynamicExplosion, x, y, radius/8f);
|
||||
}
|
||||
|
||||
public static void createIncend(float x, float y, float range, int amount){
|
||||
|
||||
@@ -347,7 +347,7 @@ public interface BuilderTrait extends Entity, TeamTrait{
|
||||
|
||||
Draw.color(Color.LIGHT_GRAY, Color.WHITE, 1f - flashScl + Mathf.absin(Time.time(), 0.5f, flashScl));
|
||||
|
||||
Shapes.laser("minelaser", "minelaser-end", px, py, ex, ey);
|
||||
Shapes.laser("minelaser", "minelaser-end", px, py, ex, ey, 0.75f);
|
||||
|
||||
if(unit instanceof Player && ((Player) unit).isLocal){
|
||||
Lines.stroke(1f, Pal.accent);
|
||||
|
||||
@@ -62,6 +62,10 @@ public interface SyncTrait extends Entity, TypeTrait{
|
||||
return true;
|
||||
}
|
||||
|
||||
default float clipSize(){
|
||||
return (this instanceof DrawTrait ? ((DrawTrait)this).drawSize() : 8f);
|
||||
}
|
||||
|
||||
//Read and write sync data, usually position
|
||||
void write(DataOutput data) throws IOException;
|
||||
|
||||
|
||||
@@ -12,6 +12,7 @@ import io.anuke.arc.math.geom.Rectangle;
|
||||
import io.anuke.arc.util.Interval;
|
||||
import io.anuke.arc.util.Time;
|
||||
import io.anuke.mindustry.Vars;
|
||||
import io.anuke.mindustry.content.StatusEffects;
|
||||
import io.anuke.mindustry.entities.EntityGroup;
|
||||
import io.anuke.mindustry.entities.Units;
|
||||
import io.anuke.mindustry.entities.traits.ShooterTrait;
|
||||
@@ -163,6 +164,10 @@ public abstract class BaseUnit extends Unit implements ShooterTrait{
|
||||
}
|
||||
}
|
||||
|
||||
public boolean isBoss(){
|
||||
return hasEffect(StatusEffects.boss);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isImmune(StatusEffect effect){
|
||||
return type.immunities.contains(effect);
|
||||
@@ -212,11 +217,6 @@ public abstract class BaseUnit extends Unit implements ShooterTrait{
|
||||
return type.health;
|
||||
}
|
||||
|
||||
@Override
|
||||
public float getSize(){
|
||||
return 8;
|
||||
}
|
||||
|
||||
@Override
|
||||
public float mass(){
|
||||
return type.mass;
|
||||
@@ -284,6 +284,11 @@ public abstract class BaseUnit extends Unit implements ShooterTrait{
|
||||
return type.hitsize * 10;
|
||||
}
|
||||
|
||||
@Override
|
||||
public float clipSize(){
|
||||
return isBoss() ? 10000000000f : super.clipSize();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onDeath(){
|
||||
Call.onUnitDeath(this);
|
||||
|
||||
@@ -213,11 +213,6 @@ public class Player extends Unit implements BuilderTrait, ShooterTrait{
|
||||
return mech.flying || boostHeat > liftoffBoost;
|
||||
}
|
||||
|
||||
@Override
|
||||
public float getSize(){
|
||||
return 8;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void damage(float amount){
|
||||
hitTime = hitDuration;
|
||||
|
||||
@@ -10,6 +10,7 @@ import io.anuke.arc.math.geom.Geometry;
|
||||
import io.anuke.arc.math.geom.Rectangle;
|
||||
import io.anuke.arc.math.geom.Vector2;
|
||||
import io.anuke.arc.util.Time;
|
||||
import io.anuke.arc.util.Tmp;
|
||||
import io.anuke.mindustry.content.Blocks;
|
||||
import io.anuke.mindustry.content.Fx;
|
||||
import io.anuke.mindustry.entities.Damage;
|
||||
@@ -382,6 +383,11 @@ public abstract class Unit extends DestructibleEntity implements SaveTrait, Targ
|
||||
Draw.rect(getIconRegion(), x + offsetX, y + offsetY, rotation - 90);
|
||||
}
|
||||
|
||||
public float getSize(){
|
||||
hitbox(Tmp.r1);
|
||||
return Math.max(Tmp.r1.width, Tmp.r1.height) * 2f;
|
||||
}
|
||||
|
||||
public abstract TextureRegion getIconRegion();
|
||||
|
||||
public abstract Weapon getWeapon();
|
||||
@@ -391,6 +397,4 @@ public abstract class Unit extends DestructibleEntity implements SaveTrait, Targ
|
||||
public abstract float mass();
|
||||
|
||||
public abstract boolean isFlying();
|
||||
|
||||
public abstract float getSize();
|
||||
}
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
package io.anuke.mindustry.entities.units;
|
||||
|
||||
import io.anuke.arc.collection.Array;
|
||||
import io.anuke.arc.collection.Bits;
|
||||
import io.anuke.arc.graphics.Color;
|
||||
import io.anuke.arc.util.Time;
|
||||
import io.anuke.arc.util.Tmp;
|
||||
@@ -22,6 +23,7 @@ public class Statuses implements Saveable{
|
||||
private static final Array<StatusEntry> removals = new Array<>();
|
||||
|
||||
private Array<StatusEntry> statuses = new Array<>();
|
||||
private Bits applied = new Bits(content.getBy(ContentType.status).size);
|
||||
|
||||
private float speedMultiplier;
|
||||
private float damageMultiplier;
|
||||
@@ -76,6 +78,7 @@ public class Statuses implements Saveable{
|
||||
}
|
||||
|
||||
public void update(Unit unit){
|
||||
applied.clear();
|
||||
speedMultiplier = damageMultiplier = armorMultiplier = 1f;
|
||||
|
||||
if(statuses.size == 0) return;
|
||||
@@ -84,6 +87,7 @@ public class Statuses implements Saveable{
|
||||
|
||||
for(StatusEntry entry : statuses){
|
||||
entry.time = Math.max(entry.time - Time.delta(), 0);
|
||||
applied.set(entry.effect.id);
|
||||
|
||||
if(entry.time <= 0){
|
||||
Pools.free(entry);
|
||||
@@ -114,10 +118,7 @@ public class Statuses implements Saveable{
|
||||
}
|
||||
|
||||
public boolean hasEffect(StatusEffect effect){
|
||||
for(StatusEntry entry : statuses){
|
||||
if(entry.effect == effect) return true;
|
||||
}
|
||||
return false;
|
||||
return applied.get(effect.id);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -125,7 +126,7 @@ public class Statuses implements Saveable{
|
||||
stream.writeByte(statuses.size);
|
||||
for(StatusEntry entry : statuses){
|
||||
stream.writeByte(entry.effect.id);
|
||||
stream.writeShort((short) (entry.time * 2));
|
||||
stream.writeFloat(entry.time);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -140,7 +141,7 @@ public class Statuses implements Saveable{
|
||||
byte amount = stream.readByte();
|
||||
for(int i = 0; i < amount; i++){
|
||||
byte id = stream.readByte();
|
||||
float time = stream.readShort() / 2f;
|
||||
float time = stream.readFloat();
|
||||
StatusEntry entry = Pools.obtain(StatusEntry.class, StatusEntry::new);
|
||||
entry.set(content.getByID(ContentType.status, id), time);
|
||||
statuses.add(entry);
|
||||
|
||||
Reference in New Issue
Block a user