mirror of
https://github.com/vcmi/vcmi.git
synced 2024-12-24 22:14:36 +02:00
* creature info window contains info about modified speed
* removed unwanted behavior - VCMI allows now for attacking when move action fails (command walk & attack) [to be tested as I'm not sure if I've done enough] * battle result window properly displayed
This commit is contained in:
parent
fb0aad5edf
commit
673ffddf4a
@ -566,13 +566,14 @@ void CBattleInterface::show(SDL_Surface * to)
|
||||
}
|
||||
}
|
||||
|
||||
SDL_SetClipRect(to, &buf); //restoring previous clip_rect
|
||||
|
||||
//showing window with result of battle
|
||||
if(resWindow)
|
||||
{
|
||||
resWindow->show(to);
|
||||
}
|
||||
|
||||
SDL_SetClipRect(to, &buf); //restoring previous clip_rect
|
||||
|
||||
//printing border around interface
|
||||
if(screen->w != 800 || screen->h !=600)
|
||||
@ -2310,6 +2311,7 @@ void CBattleHex::clickRight(boost::logic::tribool down)
|
||||
pom->defenseBonus = h->getPrimSkillLevel(1);
|
||||
pom->luck = h->getCurrentLuck();
|
||||
pom->morale = h->getCurrentMorale();
|
||||
pom->speedBonus = myst.speed() - myst.creature->speed;
|
||||
}
|
||||
|
||||
pom->shotsLeft = myst.shots;
|
||||
|
@ -3328,6 +3328,18 @@ CCreInfoWindow::CCreInfoWindow(int Cid, int Type, int creatureCount, StackState
|
||||
//speed
|
||||
printAt(CGI->generaltexth->zelp[441].first,155,162,GEOR13,zwykly,bitmap);
|
||||
SDL_itoa(c->speed,pom,10);
|
||||
if(State && State->speedBonus)
|
||||
{
|
||||
int hlp;
|
||||
if(c->speed > 0)
|
||||
hlp = log10f(c->speed)+2;
|
||||
else
|
||||
hlp = 2;
|
||||
pom[hlp-1] = ' '; pom[hlp] = '(';
|
||||
SDL_itoa(c->speed + State->speedBonus, pom+hlp+1, 10);
|
||||
hlp += 2+(int)log10f(c->speed + State->speedBonus);
|
||||
pom[hlp] = ')'; pom[hlp+1] = '\0';
|
||||
}
|
||||
printToWR(pom,276,175,GEOR13,zwykly,bitmap);
|
||||
|
||||
|
||||
|
@ -1130,8 +1130,16 @@ upgend:
|
||||
CStack *curStack = gs->curB->getStack(ba.stackNumber),
|
||||
*stackAtEnd = gs->curB->getStackT(ba.additionalInfo);
|
||||
|
||||
if( curStack->position != ba.destinationTile //we wasn't able to reach destination tile
|
||||
|| BattleInfo::mutualPosition(ba.destinationTile,ba.additionalInfo) < 0 //destination tile is not neighbouring with enemy stack
|
||||
if(curStack->position != ba.destinationTile) //we wasn't able to reach destination tile
|
||||
{
|
||||
tlog3<<"We cannot move this stack to its destination "<<curStack->creature->namePl<<std::endl;
|
||||
}
|
||||
|
||||
if( (BattleInfo::mutualPosition(ba.destinationTile, ba.additionalInfo) < 0 //destination tile is not neighbouring with enemy stack
|
||||
&& !curStack->creature->isDoubleWide())
|
||||
|| (curStack->creature->isDoubleWide()
|
||||
&& (BattleInfo::mutualPosition(ba.destinationTile, ba.additionalInfo) < 0)
|
||||
&& (BattleInfo::mutualPosition(ba.destinationTile + (curStack->attackerOwned ? -1 : 1), ba.additionalInfo) < 0))
|
||||
)
|
||||
{
|
||||
sendDataToClients(ui16(3008)); //end movement and attack
|
||||
|
Loading…
Reference in New Issue
Block a user