mirror of
https://github.com/vcmi/vcmi.git
synced 2024-12-24 22:14:36 +02:00
* fixed bugs 66, 74 from VCMI 0.73 bug thread
This commit is contained in:
parent
763571062d
commit
bab07c0ab3
@ -1936,6 +1936,9 @@ void CBattleInterface::clickRight(tribool down, bool previousState)
|
||||
|
||||
void CBattleInterface::bOptionsf()
|
||||
{
|
||||
if(spellDestSelectMode) //we are casting a spell
|
||||
return;
|
||||
|
||||
CGI->curh->changeGraphic(0,0);
|
||||
|
||||
SDL_Rect temp_rect = genRect(431, 481, 160, 84);
|
||||
@ -1945,10 +1948,15 @@ void CBattleInterface::bOptionsf()
|
||||
|
||||
void CBattleInterface::bSurrenderf()
|
||||
{
|
||||
if(spellDestSelectMode) //we are casting a spell
|
||||
return;
|
||||
}
|
||||
|
||||
void CBattleInterface::bFleef()
|
||||
{
|
||||
if(spellDestSelectMode) //we are casting a spell
|
||||
return;
|
||||
|
||||
if( LOCPLINT->cb->battleCanFlee() )
|
||||
{
|
||||
CFunctionList<void()> ony = boost::bind(&CBattleInterface::reallyFlee,this);
|
||||
@ -1982,10 +1990,15 @@ void CBattleInterface::reallyFlee()
|
||||
|
||||
void CBattleInterface::bAutofightf()
|
||||
{
|
||||
if(spellDestSelectMode) //we are casting a spell
|
||||
return;
|
||||
}
|
||||
|
||||
void CBattleInterface::bSpellf()
|
||||
{
|
||||
if(spellDestSelectMode) //we are casting a spell
|
||||
return;
|
||||
|
||||
CGI->curh->changeGraphic(0,0);
|
||||
|
||||
const CGHeroInstance * chi = NULL;
|
||||
@ -1999,23 +2012,35 @@ void CBattleInterface::bSpellf()
|
||||
|
||||
void CBattleInterface::bWaitf()
|
||||
{
|
||||
if(spellDestSelectMode) //we are casting a spell
|
||||
return;
|
||||
|
||||
if(activeStack != -1)
|
||||
giveCommand(8,0,activeStack);
|
||||
}
|
||||
|
||||
void CBattleInterface::bDefencef()
|
||||
{
|
||||
if(spellDestSelectMode) //we are casting a spell
|
||||
return;
|
||||
|
||||
if(activeStack != -1)
|
||||
giveCommand(3,0,activeStack);
|
||||
}
|
||||
|
||||
void CBattleInterface::bConsoleUpf()
|
||||
{
|
||||
if(spellDestSelectMode) //we are casting a spell
|
||||
return;
|
||||
|
||||
console->scrollUp();
|
||||
}
|
||||
|
||||
void CBattleInterface::bConsoleDownf()
|
||||
{
|
||||
if(spellDestSelectMode) //we are casting a spell
|
||||
return;
|
||||
|
||||
console->scrollDown();
|
||||
}
|
||||
|
||||
@ -2967,6 +2992,9 @@ void CBattleHero::setPhase(int newPhase)
|
||||
|
||||
void CBattleHero::clickLeft(tribool down, bool previousState)
|
||||
{
|
||||
if(myOwner->spellDestSelectMode) //we are casting a spell
|
||||
return;
|
||||
|
||||
if(!down && myHero && LOCPLINT->cb->battleCanCastSpell()) //check conditions
|
||||
{
|
||||
for(int it=0; it<BFIELD_SIZE; ++it) //do nothing when any hex is hovered - hero's animation overlaps battlefield
|
||||
|
@ -487,6 +487,7 @@ public:
|
||||
friend class CMeleeAttack;
|
||||
friend class CShootingAnim;
|
||||
friend class CSpellEffectAnim;
|
||||
friend class CBattleHero;
|
||||
};
|
||||
|
||||
#endif // __CBATTLEINTERFACE_H__
|
||||
|
@ -608,9 +608,9 @@ DLL_EXPORT void BattleNextRound::applyGs( CGameState *gs )
|
||||
s->counterAttacks = 1 + s->valOfFeatures(StackFeature::ADDITIONAL_RETALIATION);
|
||||
|
||||
//regeneration
|
||||
if( s->hasFeatureOfType(StackFeature::HP_REGENERATION) )
|
||||
if( s->hasFeatureOfType(StackFeature::HP_REGENERATION) && s->alive() )
|
||||
s->firstHPleft = std::min<ui32>( s->MaxHealth(), s->valOfFeatures(StackFeature::HP_REGENERATION) );
|
||||
if( s->hasFeatureOfType(StackFeature::FULL_HP_REGENERATION) )
|
||||
if( s->hasFeatureOfType(StackFeature::FULL_HP_REGENERATION) && s->alive() )
|
||||
s->firstHPleft = s->MaxHealth();
|
||||
|
||||
//remove effects and restore only those with remaining turns in duration
|
||||
|
Loading…
Reference in New Issue
Block a user