1
0
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:
Michał W. Urbańczyk 2009-02-15 19:49:23 +00:00
parent adf5c052f9
commit c1109452d6
3 changed files with 22 additions and 2 deletions

View File

@ -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
{

View File

@ -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;

View File

@ -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;