mirror of
https://github.com/vcmi/vcmi.git
synced 2024-12-24 22:14:36 +02:00
- Added and improved some propagators, including Crystal Dragons ability (#1232)
- Minor refactoring in AI
This commit is contained in:
parent
791099ab33
commit
8683c8c0eb
@ -374,11 +374,9 @@ void VCAI::objectRemoved(const CGObjectInstance *obj)
|
||||
|
||||
erase_if_present(visitableObjs, obj);
|
||||
erase_if_present(alreadyVisited, obj);
|
||||
erase_if_present(reservedObjs, obj);
|
||||
|
||||
|
||||
for(auto &p : reservedHeroesMap)
|
||||
erase_if_present(p.second, obj);
|
||||
for (auto h : cb->getHeroesInfo())
|
||||
unreserveObject(h, obj);
|
||||
|
||||
//TODO
|
||||
//there are other places where CGObjectinstance ptrs are stored...
|
||||
|
@ -117,6 +117,13 @@
|
||||
{
|
||||
"type" : "DRAGON_NATURE"
|
||||
},
|
||||
"crystals" :
|
||||
{
|
||||
"type" : "GENERATE_RESOURCE",
|
||||
"subtype" : "resource.crystal"
|
||||
"val" : 1,
|
||||
"propagator" : "HERO"
|
||||
}
|
||||
"FLYING_ARMY" : null
|
||||
},
|
||||
"graphics" :
|
||||
|
@ -739,6 +739,7 @@ CGameState::CGameState()
|
||||
registerTypesClientPacks2(*applierGs);
|
||||
//objCaller = new CObjectCallersHandler;
|
||||
globalEffects.setDescription("Global effects");
|
||||
globalEffects.setNodeType(CBonusSystemNode::GLOBAL_EFFECTS);
|
||||
}
|
||||
|
||||
CGameState::~CGameState()
|
||||
|
@ -947,7 +947,7 @@ void CGHeroInstance::initObj()
|
||||
{
|
||||
blockVisit = true;
|
||||
auto hs = new HeroSpecial();
|
||||
hs->setNodeType(CBonusSystemNode::specialty);
|
||||
hs->setNodeType(CBonusSystemNode::SPECIALTY);
|
||||
attachTo(hs); //do we ever need to detach it?
|
||||
|
||||
if(!type)
|
||||
@ -1137,7 +1137,7 @@ void CGHeroInstance::initObj()
|
||||
auto hs = new HeroSpecial();
|
||||
attachTo(hs); //do we ever need to detach it?
|
||||
|
||||
hs->setNodeType(CBonusSystemNode::specialty);
|
||||
hs->setNodeType(CBonusSystemNode::SPECIALTY);
|
||||
for (auto bonus : hs2.bonuses)
|
||||
{
|
||||
hs->addNewBonus (bonus);
|
||||
|
@ -67,7 +67,9 @@ const std::map<std::string, TPropagatorPtr> bonusPropagatorMap = boost::assign::
|
||||
("BATTLE_WIDE", make_shared<CPropagatorNodeType>(CBonusSystemNode::BATTLE))
|
||||
("VISITED_TOWN_AND_VISITOR", make_shared<CPropagatorNodeType>(CBonusSystemNode::TOWN_AND_VISITOR))
|
||||
("PLAYER_PROPAGATOR", make_shared<CPropagatorNodeType>(CBonusSystemNode::PLAYER))
|
||||
("HERO", make_shared<CPropagatorNodeType>(CBonusSystemNode::HERO));
|
||||
("HERO", make_shared<CPropagatorNodeType>(CBonusSystemNode::HERO))
|
||||
("TEAM_PROPAGATOR", make_shared<CPropagatorNodeType>(CBonusSystemNode::TEAM)) //untested
|
||||
("GLOBAL_EFFECT", make_shared<CPropagatorNodeType>(CBonusSystemNode::GLOBAL_EFFECTS)); //untested
|
||||
|
||||
|
||||
#define BONUS_LOG_LINE(x) logBonus->traceStream() << x
|
||||
|
@ -606,8 +606,8 @@ class DLL_LINKAGE CBonusSystemNode : public IBonusBearer
|
||||
public:
|
||||
enum ENodeTypes
|
||||
{
|
||||
UNKNOWN, STACK_INSTANCE, STACK_BATTLE, specialty, ARTIFACT, CREATURE, ARTIFACT_INSTANCE, HERO, PLAYER, TEAM,
|
||||
TOWN_AND_VISITOR, BATTLE, COMMANDER
|
||||
UNKNOWN, STACK_INSTANCE, STACK_BATTLE, SPECIALTY, ARTIFACT, CREATURE, ARTIFACT_INSTANCE, HERO, PLAYER, TEAM,
|
||||
TOWN_AND_VISITOR, BATTLE, COMMANDER, GLOBAL_EFFECTS
|
||||
};
|
||||
private:
|
||||
BonusList bonuses; //wielded bonuses (local or up-propagated here)
|
||||
|
Loading…
Reference in New Issue
Block a user