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);
updateCondition(self->name, TT_DESTROY);
updateCondition(self->groupName, TT_DESTROY);
}
}
}
@ -409,19 +410,26 @@ void damageFighter(Entity *e, int amount, long flags)
e->aiDamageTimer = FPS;
e->aiDamagePerSec += amount;
if (flags & BF_SYSTEM_DAMAGE)
{
playBattleSound(SND_MAG_HIT, e->x, e->y);
e->systemPower = MAX(0, e->systemPower - amount);
e->systemHit = 255;
if (e->systemPower == 0)
if (e->shield > 0)
{
e->shield = e->maxShield = 0;
e->action = NULL;
e->shield = MAX(0, e->shield - amount / 2);
}
else
{
playBattleSound(SND_MAG_HIT, e->x, e->y);
e->systemPower = MAX(0, e->systemPower - amount);
e->systemHit = 255;
if (e->systemPower == 0)
{
e->shield = e->maxShield = 0;
e->action = NULL;
}
}
}
else if (flags & BF_SHIELD_DAMAGE)
@ -441,13 +449,7 @@ void damageFighter(Entity *e, int amount, long flags)
{
if (e->shield > 0)
{
e->shield -= amount;
if (e->shield < 0)
{
e->health += e->shield;
e->shield = 0;
}
e->shield = MAX(0, e->shield - amount);
}
else
{