mirror of
https://github.com/vcmi/vcmi.git
synced 2025-01-12 02:28:11 +02:00
[WiP]Added some checks for RISE_DEMONS action.
This commit is contained in:
parent
fbebbf39f3
commit
6a9dc78dcd
@ -2163,7 +2163,14 @@ void CBattleInterface::handleHex(BattleHex myNumber, int eventType)
|
||||
break;
|
||||
case RISE_DEMONS:
|
||||
if (shere && ourStack && !shere->alive())
|
||||
{
|
||||
if(!(shere->hasBonusOfType(Bonus::UNDEAD)
|
||||
|| shere->hasBonusOfType(Bonus::NON_LIVING)
|
||||
|| vstd::contains(shere->state, EBattleStackState::SUMMONED)
|
||||
|| vstd::contains(shere->state, EBattleStackState::CLONED)
|
||||
))
|
||||
legalAction = true;
|
||||
}
|
||||
break;
|
||||
}
|
||||
if (legalAction)
|
||||
@ -2320,7 +2327,10 @@ void CBattleInterface::handleHex(BattleHex myNumber, int eventType)
|
||||
break;
|
||||
case RISE_DEMONS:
|
||||
cursorType = ECursor::SPELLBOOK;
|
||||
realizeAction = [=]{ giveCommand(Battle::DAEMON_SUMMONING, myNumber, activeStack->ID); };
|
||||
realizeAction = [=]
|
||||
{
|
||||
giveCommand(Battle::DAEMON_SUMMONING, myNumber, activeStack->ID);
|
||||
};
|
||||
break;
|
||||
case CATAPULT:
|
||||
cursorFrame = ECursor::COMBAT_SHOOT_CATAPULT;
|
||||
|
@ -3848,9 +3848,6 @@ bool CGameHandler::makeBattleAction( BattleAction &ba )
|
||||
//TODO: From Strategija:
|
||||
//Summon Demon is a level 2 spell.
|
||||
{
|
||||
StartAction start_action(ba);
|
||||
sendAndApply(&start_action);
|
||||
|
||||
const CStack *summoner = gs->curB->battleGetStackByID(ba.stackNumber),
|
||||
*destStack = gs->curB->battleGetStackByPos(ba.destinationTile, false);
|
||||
|
||||
@ -3872,6 +3869,9 @@ bool CGameHandler::makeBattleAction( BattleAction &ba )
|
||||
|
||||
if (bsa.amount) //there's rare possibility single creature cannot rise desired type
|
||||
{
|
||||
StartAction start_action(ba);
|
||||
sendAndApply(&start_action);
|
||||
|
||||
BattleStacksRemoved bsr; //remove body
|
||||
bsr.stackIDs.insert(destStack->ID);
|
||||
sendAndApply(&bsr);
|
||||
@ -3883,9 +3883,9 @@ bool CGameHandler::makeBattleAction( BattleAction &ba )
|
||||
ssp.val = -1;
|
||||
ssp.absolute = false;
|
||||
sendAndApply(&ssp);
|
||||
}
|
||||
|
||||
sendAndApply(&end_action);
|
||||
}
|
||||
break;
|
||||
}
|
||||
case Battle::MONSTER_SPELL:
|
||||
|
Loading…
Reference in New Issue
Block a user