mirror of
https://github.com/vcmi/vcmi.git
synced 2025-11-25 22:42:04 +02:00
* [previous commit adds support for golden bow too]
* support for ammo cart * partially written support for orb of vulnerability
This commit is contained in:
@@ -770,8 +770,25 @@ DLL_EXPORT void BattleAttack::applyGs( CGameState *gs )
|
||||
CStack *attacker = gs->curB->getStack(stackAttacking);
|
||||
if(counter())
|
||||
attacker->counterAttacks--;
|
||||
|
||||
if(shot())
|
||||
attacker->shots--;
|
||||
{
|
||||
//don't remove ammo if we have a working ammo cart
|
||||
bool hasAmmoCart = false;
|
||||
BOOST_FOREACH(const CStack * st, gs->curB->stacks)
|
||||
{
|
||||
if(st->owner == attacker->owner && st->type->idNumber == 148 && st->alive())
|
||||
{
|
||||
hasAmmoCart = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (!hasAmmoCart)
|
||||
{
|
||||
attacker->shots--;
|
||||
}
|
||||
}
|
||||
BOOST_FOREACH(BattleStackAttacked stackAttacked, bsa)
|
||||
stackAttacked.applyGs(gs);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user