1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-11-25 22:42:04 +02:00

* fixed attacking with shooting stack in a close-combat

* max/buy buttons in recruitment window are not active when there are no available creatures to buy
* reading no-retalation and twice-attack abilities
* boars are treated as two-hex
* dead stack won't retaliate
* support for double attack (not tested)
* one more typo fixed in battle backgrounds list
This commit is contained in:
Michał W. Urbańczyk
2008-09-14 07:11:07 +00:00
parent ae6e260107
commit dc7d324045
6 changed files with 32 additions and 2 deletions

View File

@@ -898,16 +898,27 @@ upgend:
sendAndApply(&bat);
//counterattack
if(!vstd::contains(curStack->abilities,NO_ENEMY_RETALIATION)
&& stackAtEnd->alive()
&& !stackAtEnd->counterAttacks ) //TODO: support for multiple retaliatons per turn
{
prepareAttack(bat,stackAtEnd,curStack);
bat.flags |= 2;
sendAndApply(&bat);
}
if(vstd::contains(curStack->abilities,TWICE_ATTACK)
&& curStack->alive())
{
bat.flags = 0;
prepareAttack(bat,curStack,stackAtEnd);
sendAndApply(&bat);
}
break;
}
case 7: //shoot
{
//TODO: check arrows count
//TODO: check if stack isn't blocked by enemy
CStack *curStack = gs->curB->getStack(ba.stackNumber),
*destStack= gs->curB->getStackT(ba.destinationTile);
@@ -915,6 +926,13 @@ upgend:
prepareAttack(bat,curStack,destStack);
bat.flags |= 1;
if(vstd::contains(curStack->abilities,TWICE_ATTACK)
&& curStack->alive())
{
prepareAttack(bat,curStack,destStack);
sendAndApply(&bat);
}
sendAndApply(&bat);
break;
}