Added flag for killable units

This commit is contained in:
Anuken
2022-04-27 11:17:01 -04:00
parent 1ee8687d94
commit 9b8098f731
4 changed files with 8 additions and 4 deletions

View File

@@ -6,12 +6,14 @@ import mindustry.content.*;
import mindustry.entities.*;
import mindustry.game.*;
import mindustry.gen.*;
import mindustry.type.*;
@Component
abstract class ShieldComp implements Healthc, Posc{
@Import float health, hitTime, x, y, healthMultiplier;
@Import boolean dead;
@Import Team team;
@Import UnitType type;
/** Absorbs health damage. */
float shield;
@@ -51,7 +53,7 @@ abstract class ShieldComp implements Healthc, Posc{
hitTime = 1f;
amount -= shieldDamage;
if(amount > 0){
if(amount > 0 && type.killable){
health -= amount;
if(health <= 0 && !dead){
kill();