diff --git a/client/CCreatureWindow.cpp b/client/CCreatureWindow.cpp index 9aa1bf45c..c31ad0630 100644 --- a/client/CCreatureWindow.cpp +++ b/client/CCreatureWindow.cpp @@ -22,6 +22,7 @@ #include #include #include "../lib/CGameState.h" +#include "../lib/BattleState.h" #include "../lib/CSpellHandler.h" using namespace CSDL_Ext; @@ -42,6 +43,7 @@ CCreatureWindow::CCreatureWindow (const CStack &stack, int Type) : type(Type) { OBJ_CONSTRUCTION_CAPTURING_ALL; + battleStack = &stack; if (stack.base) init(stack.base, &stack, dynamic_cast(stack.base->armyObj)); else @@ -50,7 +52,6 @@ CCreatureWindow::CCreatureWindow (const CStack &stack, int Type) init(s, stack.type, NULL); delete s; } - } CCreatureWindow::CCreatureWindow (const CStackInstance &stack, int Type) @@ -329,19 +330,18 @@ void CCreatureWindow::showAll(SDL_Surface * to) { CIntObject::showAll(to); - //count = boost::lexical_cast(stack->count); - //if (count.size()) //TODO - // printTo(count, 117, 174, FONT_SMALL, tytulowy,*bitmap); - if(count.size()) - printTo(count.c_str(), pos.x+114, pos.y+174, FONT_TIMES, zwykly, to); - printAtMiddle(c->namePl, 180, 30, FONT_SMALL, tytulowy,*bitmap); //creature name printLine(0, CGI->generaltexth->primarySkillNames[0], c->valOfBonuses(Bonus::PRIMARY_SKILL, PrimarySkill::ATTACK), stackNode->Attack()); printLine(1, CGI->generaltexth->primarySkillNames[1], c->valOfBonuses(Bonus::PRIMARY_SKILL, PrimarySkill::DEFENSE), stackNode->Defense()); - if(stackNode->valOfBonuses(Bonus::SHOTS) && stackNode->hasBonusOfType(Bonus::SHOOTER)) //only for shooting units - important with wog exp shooters - printLine(2, CGI->generaltexth->allTexts[198], stackNode->valOfBonuses(Bonus::SHOTS)); //TODO: change shot count for battle stack + if(stackNode->valOfBonuses(Bonus::SHOTS) && stackNode->hasBonusOfType(Bonus::SHOOTER)) + {//only for shooting units - important with wog exp shooters + if (type == BATTLE) + printLine(2, CGI->generaltexth->allTexts[198], battleStack->shots); + else + printLine(2, CGI->generaltexth->allTexts[198], stackNode->valOfBonuses(Bonus::SHOTS)); + } //TODO int dmgMultiply = 1; diff --git a/client/CCreatureWindow.h b/client/CCreatureWindow.h index d3c001bc0..3cd768221 100644 --- a/client/CCreatureWindow.h +++ b/client/CCreatureWindow.h @@ -33,6 +33,7 @@ public: const CStackInstance *stack; const CBonusSystemNode *stackNode; const CGHeroInstance *heroOwner; + const CStack * battleStack; //determine the umber of shots in battle std::vector upgResCost; //cost of upgrade (if not possible then empty) std::vector bonusItems; std::vector spellEffects; diff --git a/lib/CArtHandler.cpp b/lib/CArtHandler.cpp index e2bdb3e83..2ea24dcea 100644 --- a/lib/CArtHandler.cpp +++ b/lib/CArtHandler.cpp @@ -735,9 +735,9 @@ void CArtHandler::addBonuses() giveArtBonus(136, Bonus::FREE_SHIP_BOARDING, 0); //Bow of the Sharpshooter - giveArtBonus(137, Bonus::NO_DISTANCE_PENALTY, 0); - giveArtBonus(137, Bonus::NO_OBSTACLES_PENALTY, 0); - giveArtBonus(137, Bonus::FREE_SHOOTING, 0); + giveArtBonus(137, Bonus::NO_DISTANCE_PENALTY, 0, 0, 0, new HasAnotherBonusLimiter(Bonus::SHOOTER)); + giveArtBonus(137, Bonus::NO_OBSTACLES_PENALTY, 0, 0, 0, new HasAnotherBonusLimiter(Bonus::SHOOTER)); + giveArtBonus(137, Bonus::FREE_SHOOTING, 0, 0, 0, new HasAnotherBonusLimiter(Bonus::SHOOTER)); //Wizard's Well giveArtBonus(138, Bonus::FULL_MANA_REGENERATION, 0);