Mags no longer ignore shields.

This commit is contained in:
Steve 2016-05-02 12:54:15 +01:00
parent f076b37620
commit c492115bbc
1 changed files with 19 additions and 17 deletions

View File

@ -327,6 +327,7 @@ void doFighter(void)
adjustObjectiveTargetValue(self->name, TT_ESCAPED, -1); adjustObjectiveTargetValue(self->name, TT_ESCAPED, -1);
updateCondition(self->name, TT_DESTROY); updateCondition(self->name, TT_DESTROY);
updateCondition(self->groupName, TT_DESTROY);
} }
} }
} }
@ -411,6 +412,12 @@ void damageFighter(Entity *e, int amount, long flags)
e->aiDamagePerSec += amount; e->aiDamagePerSec += amount;
if (flags & BF_SYSTEM_DAMAGE) if (flags & BF_SYSTEM_DAMAGE)
{
if (e->shield > 0)
{
e->shield = MAX(0, e->shield - amount / 2);
}
else
{ {
playBattleSound(SND_MAG_HIT, e->x, e->y); playBattleSound(SND_MAG_HIT, e->x, e->y);
@ -424,6 +431,7 @@ void damageFighter(Entity *e, int amount, long flags)
e->action = NULL; e->action = NULL;
} }
} }
}
else if (flags & BF_SHIELD_DAMAGE) else if (flags & BF_SHIELD_DAMAGE)
{ {
e->shield -= amount; e->shield -= amount;
@ -441,13 +449,7 @@ void damageFighter(Entity *e, int amount, long flags)
{ {
if (e->shield > 0) if (e->shield > 0)
{ {
e->shield -= amount; e->shield = MAX(0, e->shield - amount);
if (e->shield < 0)
{
e->health += e->shield;
e->shield = 0;
}
} }
else else
{ {