mirror of
https://github.com/vcmi/vcmi.git
synced 2025-01-26 03:52:01 +02:00
Implemented fixed set of creatures that can get week of double growth. Minor fix.
This commit is contained in:
parent
88fd213e87
commit
6005e7a6ee
@ -45,6 +45,7 @@ CCreatureHandler::CCreatureHandler()
|
|||||||
// Good: Castle, Rampart, Tower // Evil: Inferno, Necropolis, Dungeon
|
// Good: Castle, Rampart, Tower // Evil: Inferno, Necropolis, Dungeon
|
||||||
// Neutral: Stronghold, Fortess, Conflux
|
// Neutral: Stronghold, Fortess, Conflux
|
||||||
factionAlignments += 1, 1, 1, -1, -1, -1, 0, 0, 0;
|
factionAlignments += 1, 1, 1, -1, -1, -1, 0, 0, 0;
|
||||||
|
doubledCreatures += 4, 14, 20, 28, 42, 44, 60, 70, 72, 85, 86, 100, 104; //according to Strategija
|
||||||
}
|
}
|
||||||
|
|
||||||
int CCreature::getQuantityID(const int & quantity)
|
int CCreature::getQuantityID(const int & quantity)
|
||||||
|
@ -19,6 +19,7 @@
|
|||||||
* Full text of license available in license.txt file, in main folder
|
* Full text of license available in license.txt file, in main folder
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
#define ALLCREATURESGETDOUBLEMONTHS false
|
||||||
|
|
||||||
class CLodHandler;
|
class CLodHandler;
|
||||||
class CCreatureHandler;
|
class CCreatureHandler;
|
||||||
@ -101,6 +102,7 @@ class DLL_EXPORT CCreatureHandler
|
|||||||
public:
|
public:
|
||||||
CBonusSystemNode *globalEffects;
|
CBonusSystemNode *globalEffects;
|
||||||
std::set<int> notUsedMonsters;
|
std::set<int> notUsedMonsters;
|
||||||
|
std::set<TCreature> doubledCreatures; //they get double week
|
||||||
std::vector<CCreature*> creatures; //creature ID -> creature info
|
std::vector<CCreature*> creatures; //creature ID -> creature info
|
||||||
std::map<int,std::vector<CCreature*> > levelCreatures; //level -> list of creatures
|
std::map<int,std::vector<CCreature*> > levelCreatures; //level -> list of creatures
|
||||||
std::map<std::string,int> nameToID;
|
std::map<std::string,int> nameToID;
|
||||||
|
@ -493,7 +493,6 @@ bool CCreatureTypeLimiter::limit(const Bonus &b, const CBonusSystemNode &node) c
|
|||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
//return false; //don't delete it if it's other type of node
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1017,9 +1017,17 @@ void CGameHandler::newTurn()
|
|||||||
if (monthType < 40) //double growth
|
if (monthType < 40) //double growth
|
||||||
{
|
{
|
||||||
n.specialWeek = NewTurn::DOUBLE_GROWTH;
|
n.specialWeek = NewTurn::DOUBLE_GROWTH;
|
||||||
|
if (ALLCREATURESGETDOUBLEMONTHS)
|
||||||
std::pair<int,int> newMonster(54, VLC->creh->pickRandomMonster(boost::ref(rand)));
|
{
|
||||||
n.creatureid = newMonster.second;
|
std::pair<int,int> newMonster(54, VLC->creh->pickRandomMonster(boost::ref(rand)));
|
||||||
|
n.creatureid = newMonster.second;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
std::set<TCreature>::const_iterator it = VLC->creh->doubledCreatures.begin();
|
||||||
|
std::advance (it, rand() % VLC->creh->doubledCreatures.size()); //picking random elelemnt of set is tiring
|
||||||
|
n.creatureid = *it;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else if (monthType < 90)
|
else if (monthType < 90)
|
||||||
n.specialWeek = NewTurn::NORMAL;
|
n.specialWeek = NewTurn::NORMAL;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user