1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-06-15 00:05:02 +02:00
Support for Admiral's Hat
This commit is contained in:
DjWarmonger
2011-06-21 16:00:19 +00:00
parent af8d8cbfc7
commit 5eef9551de
3 changed files with 15 additions and 2 deletions

View File

@ -1379,7 +1379,12 @@ bool CGameHandler::moveHero( si32 hid, int3 dst, ui8 instant, ui8 asker /*= 255*
if(!h->boat && t.visitableObjects.size() && t.visitableObjects.back()->ID == 8)
{
tmh.result = TryMoveHero::EMBARK;
tmh.movePoints = 0; //embarking takes all move points
if (h->hasBonusOfType(Bonus::FREE_SHIP_BOARDING))
{
tmh.movePoints = (h->movement - cost)*((float)(h->maxMovePoints(true)) / h->maxMovePoints(false));
}
else
tmh.movePoints = 0; //embarking takes all move points
//TODO: check for bonus that removes that penalty
getTilesInRange(tmh.fowRevealed,h->getSightCenter()+(tmh.end-tmh.start),h->getSightRadious(),h->tempOwner,1);
@ -1390,7 +1395,12 @@ bool CGameHandler::moveHero( si32 hid, int3 dst, ui8 instant, ui8 asker /*= 255*
else if(h->boat && t.tertype != TerrainTile::water && !t.blocked)
{
tmh.result = TryMoveHero::DISEMBARK;
tmh.movePoints = 0; //disembarking takes all move points
if (h->hasBonusOfType(Bonus::FREE_SHIP_BOARDING))
{
tmh.movePoints = (h->movement - cost)*((float)(h->maxMovePoints(false)) / h->maxMovePoints(true));
}
else
tmh.movePoints = 0; //disembarking takes all move points
//TODO: check for bonus that removes that penalty
getTilesInRange(tmh.fowRevealed,h->getSightCenter()+(tmh.end-tmh.start),h->getSightRadious(),h->tempOwner,1);