mirror of
https://github.com/vcmi/vcmi.git
synced 2024-12-24 22:14:36 +02:00
* blocked opening sepllbook if hero doesn't have a one
* removing one-battle bonuses after battle * windmill gives 500 gold only during first week ever
This commit is contained in:
parent
adf5c052f9
commit
c1109452d6
@ -953,6 +953,16 @@ void CBattleInterface::stackActivated(int number)
|
||||
myTurn = true;
|
||||
redrawBackgroundWithHexes(number);
|
||||
bWait->block(vstd::contains(LOCPLINT->cb->battleGetStackByID(number)->state,WAITING)); //block waiting button if stack has been already waiting
|
||||
|
||||
//block cast spell button if hero doesn't have a spellbook
|
||||
if(attackingHeroInstance && attackingHeroInstance->tempOwner==LOCPLINT->cb->battleGetStackByID(number)->owner)
|
||||
{
|
||||
bSpell->block(!attackingHeroInstance->getArt(17));
|
||||
}
|
||||
else if(defendingHeroInstance && defendingHeroInstance->tempOwner==LOCPLINT->cb->battleGetStackByID(number)->owner)
|
||||
{
|
||||
bSpell->block(!defendingHeroInstance->getArt(17));
|
||||
}
|
||||
}
|
||||
|
||||
void CBattleInterface::stackMoved(int number, int destHex, bool endMoving)
|
||||
@ -2235,7 +2245,7 @@ void CBattleHero::setPhase(int newPhase)
|
||||
|
||||
void CBattleHero::clickLeft(boost::logic::tribool down)
|
||||
{
|
||||
if(!down && myHero)
|
||||
if(!down && myHero && myHero->getArt(17))
|
||||
{
|
||||
for(int it=0; it<BFIELD_SIZE; ++it) //do nothing when any hex is hovered - hero's animation overlaps battlefield
|
||||
{
|
||||
|
@ -887,6 +887,16 @@ void CGameState::applyNL(IPack * pack)
|
||||
BattleResult *br = static_cast<BattleResult*>(pack);
|
||||
for(unsigned i=0;i<curB->stacks.size();i++)
|
||||
delete curB->stacks[i];
|
||||
|
||||
//remove any "until next battle" bonuses
|
||||
CGHeroInstance *h;
|
||||
h = getHero(curB->hero1);
|
||||
if(h)
|
||||
h->bonuses.remove_if(HeroBonus::OneBattle);
|
||||
h = getHero(curB->hero2);
|
||||
if(h)
|
||||
h->bonuses.remove_if(HeroBonus::OneBattle);
|
||||
|
||||
delete curB;
|
||||
curB = NULL;
|
||||
break;
|
||||
|
@ -1323,7 +1323,7 @@ void CGVisitableOPW::onHeroVisit( const CGHeroInstance * h ) const
|
||||
case 109:
|
||||
mid = 164;
|
||||
sub = 6;
|
||||
if(cb->getDate(2)<2)
|
||||
if(cb->getDate(0)<8)
|
||||
val = 500;
|
||||
else
|
||||
val = 1000;
|
||||
|
Loading…
Reference in New Issue
Block a user