mirror of
https://github.com/vcmi/vcmi.git
synced 2025-08-13 19:54:17 +02:00
Compilation fix. Creature damage will now be displayed correctly.
This commit is contained in:
@@ -2337,7 +2337,7 @@ void CCreInfoWindow::init(const CCreature *cre, const CStackInstance *stack, int
|
|||||||
if(stack && stack->hasBonusOfType(Bonus::SIEGE_WEAPON))
|
if(stack && stack->hasBonusOfType(Bonus::SIEGE_WEAPON))
|
||||||
dmgMultiply += stack->armyObj->Attack();
|
dmgMultiply += stack->armyObj->Attack();
|
||||||
|
|
||||||
printLine(3, CGI->generaltexth->allTexts[199], c->damageMin * dmgMultiply, c->damageMax * dmgMultiply, true);
|
printLine(3, CGI->generaltexth->allTexts[199], finalNode->getMinDamage() * dmgMultiply, finalNode->getMaxDamage() * dmgMultiply, true);
|
||||||
printLine(4, CGI->generaltexth->allTexts[388], cre->valOfBonuses(Bonus::STACK_HEALTH), finalNode->valOfBonuses(Bonus::STACK_HEALTH));
|
printLine(4, CGI->generaltexth->allTexts[388], cre->valOfBonuses(Bonus::STACK_HEALTH), finalNode->valOfBonuses(Bonus::STACK_HEALTH));
|
||||||
printLine(6, CGI->generaltexth->zelp[441].first, cre->valOfBonuses(Bonus::STACKS_SPEED), finalNode->valOfBonuses(Bonus::STACKS_SPEED));
|
printLine(6, CGI->generaltexth->zelp[441].first, cre->valOfBonuses(Bonus::STACKS_SPEED), finalNode->valOfBonuses(Bonus::STACKS_SPEED));
|
||||||
|
|
||||||
|
@@ -122,6 +122,15 @@ CCreature::CCreature()
|
|||||||
doubleWide = false;
|
doubleWide = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
ui32 CCreature::getMinDamage() const
|
||||||
|
{
|
||||||
|
return damageMin + valOfBonuses(Bonus::CREATURE_DAMAGE, 0) + valOfBonuses(Bonus::CREATURE_DAMAGE, 1);
|
||||||
|
}
|
||||||
|
ui32 CCreature::getMaxDamage() const
|
||||||
|
{
|
||||||
|
return damageMax + valOfBonuses(Bonus::CREATURE_DAMAGE, 0) + valOfBonuses(Bonus::CREATURE_DAMAGE, 2);
|
||||||
|
}
|
||||||
|
|
||||||
void CCreature::addBonus(int val, int type, int subtype /*= -1*/)
|
void CCreature::addBonus(int val, int type, int subtype /*= -1*/)
|
||||||
{
|
{
|
||||||
Bonus added(Bonus::PERMANENT, type, Bonus::CREATURE_ABILITY, val, idNumber, subtype, Bonus::BASE_NUMBER);
|
Bonus added(Bonus::PERMANENT, type, Bonus::CREATURE_ABILITY, val, idNumber, subtype, Bonus::BASE_NUMBER);
|
||||||
|
@@ -56,6 +56,8 @@ public:
|
|||||||
si32 maxAmount(const std::vector<si32> &res) const; //how many creatures can be bought
|
si32 maxAmount(const std::vector<si32> &res) const; //how many creatures can be bought
|
||||||
static int getQuantityID(const int & quantity); //0 - a few, 1 - several, 2 - pack, 3 - lots, 4 - horde, 5 - throng, 6 - swarm, 7 - zounds, 8 - legion
|
static int getQuantityID(const int & quantity); //0 - a few, 1 - several, 2 - pack, 3 - lots, 4 - horde, 5 - throng, 6 - swarm, 7 - zounds, 8 - legion
|
||||||
bool isMyUpgrade(const CCreature *anotherCre) const;
|
bool isMyUpgrade(const CCreature *anotherCre) const;
|
||||||
|
ui32 getMinDamage() const;
|
||||||
|
ui32 getMaxDamage() const;
|
||||||
|
|
||||||
void addBonus(int val, int type, int subtype = -1);
|
void addBonus(int val, int type, int subtype = -1);
|
||||||
|
|
||||||
|
@@ -355,6 +355,8 @@ public:
|
|||||||
bool hasBonusFrom(ui8 source, ui32 sourceID) const;
|
bool hasBonusFrom(ui8 source, ui32 sourceID) const;
|
||||||
void getModifiersWDescr( TModDescr &out, Bonus::BonusType type, int subtype = -1 ) const; //out: pairs<modifier value, modifier description>
|
void getModifiersWDescr( TModDescr &out, Bonus::BonusType type, int subtype = -1 ) const; //out: pairs<modifier value, modifier description>
|
||||||
int getBonusesCount(int from, int id) const;
|
int getBonusesCount(int from, int id) const;
|
||||||
|
virtual ui32 getMinDamage() const {return 0;}; //used for stacks and creatures only
|
||||||
|
virtual ui32 getMaxDamage() const {return 0;};
|
||||||
|
|
||||||
int MoraleVal() const; //range [-3, +3]
|
int MoraleVal() const; //range [-3, +3]
|
||||||
int LuckVal() const; //range [-3, +3]
|
int LuckVal() const; //range [-3, +3]
|
||||||
|
@@ -8,6 +8,7 @@
|
|||||||
#include <boost/crc.hpp>
|
#include <boost/crc.hpp>
|
||||||
#include "../hch/CLodHandler.h"
|
#include "../hch/CLodHandler.h"
|
||||||
#include "../hch/CArtHandler.h"
|
#include "../hch/CArtHandler.h"
|
||||||
|
#include "../hch/CCreatureHandler.h"
|
||||||
#include <boost/bind.hpp>
|
#include <boost/bind.hpp>
|
||||||
#include <assert.h>
|
#include <assert.h>
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user