1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-06-15 00:05:02 +02:00

* added "Next hero" button functionality

* minor improvement for prison (hero appears at proper tile)
* only one spell can be casted per turn
* minor changes
This commit is contained in:
Michał W. Urbańczyk
2009-02-20 10:36:15 +00:00
parent c1109452d6
commit 6a3bfbee46
11 changed files with 93 additions and 17 deletions

View File

@ -1323,10 +1323,11 @@ upgend:
//TODO: skill level may be different on special terrain
if( !vstd::contains(h->spells,ba.additionalInfo) //hero doesn't know this spell
if( !(vstd::contains(h->spells,ba.additionalInfo)) //hero doesn't know this spell
|| (h->mana < s->costs[skill]) //not enough mana
|| (ba.additionalInfo < 10) //it's adventure spell (not combat)
|| 0 )//TODO: hero has already casted a spell in this round
|| (gs->curB->castedSpells[ba.side])
)
{
tlog2 << "Spell cannot be casted!\n";
goto customactionend;
@ -2322,4 +2323,13 @@ void CGameHandler::giveHero( int id, int player )
gh.id = id;
gh.player = player;
sendAndApply(&gh);
}
void CGameHandler::changeObjPos( int objid, int3 newPos, ui8 flags )
{
ChangeObjPos cop;
cop.objid = objid;
cop.nPos = newPos;
cop.flags = flags;
sendAndApply(&cop);
}