Test cleanup / Artillery fixes

This commit is contained in:
Anuken
2018-10-07 23:22:54 -04:00
parent 8af30c9256
commit 4ca546f44a
7 changed files with 27 additions and 17 deletions

View File

@@ -106,6 +106,7 @@ public class ArtilleryBullets extends BulletList implements ContentList{
lifetime = 90f;
bulletWidth = bulletHeight = 14f;
collides = true;
collidesTiles = true;
splashDamageRadius = 45f;
splashDamage = 50f;
backColor = Palette.bulletYellowBack;

View File

@@ -27,7 +27,6 @@ public class BasicBulletType extends BulletType{
/**Use a negative value to disable splash damage.*/
public float splashDamageRadius = -1f;
public float splashDamage = 6f;
public int incendAmount = 0;
public float incendSpread = 8f;

View File

@@ -171,6 +171,11 @@ public class Bullet extends BulletEntity<BulletType> implements TeamTrait, SyncT
type.draw(this);
}
@Override
public float getShieldDamage(){
return Math.max(getDamage(), type.splashDamage);
}
@Override
public boolean collides(SolidTrait other){
return type.collides && super.collides(other) && !supressCollision && !(other instanceof Unit && ((Unit) other).isFlying() && !type.collidesAir);

View File

@@ -21,6 +21,7 @@ public abstract class BulletType extends Content implements BaseBulletType<Bulle
public boolean pierce;
public Effect hiteffect, despawneffect;
public float splashDamage = 0f;
/**Knockback in velocity.*/
public float knockback;
/**Whether this bullet hits tiles.*/

View File

@@ -9,4 +9,8 @@ public interface AbsorbTrait extends Entity, TeamTrait, DamageTrait{
default boolean canBeAbsorbed(){
return true;
}
default float getShieldDamage(){
return getDamage();
}
}

View File

@@ -132,10 +132,10 @@ public class ForceProjector extends Block {
if(trait.canBeAbsorbed() && trait.getTeam() != tile.getTeam() && isInsideHexagon(trait.getX(), trait.getY(), realRadius * 2f, tile.drawx(), tile.drawy())){
trait.absorb();
Effects.effect(BulletFx.absorb, trait);
float hit = trait.getDamage()*powerDamage;
float hit = trait.getShieldDamage()*powerDamage;
entity.hit = 1f;
entity.power.amount -= Math.min(hit, entity.power.amount);
entity.buildup += trait.getDamage() * entity.warmup;
entity.buildup += trait.getShieldDamage() * entity.warmup;
}
});
}