mirror of
https://github.com/vcmi/vcmi.git
synced 2024-12-24 22:14:36 +02:00
Minor fixes:
- fog of war will be initialized after bonuses are set (needed if heroes have scouting or arts with sight bonus) - victory condition "control all dwellings" also requires golem factory/ - it is possible to dismiss troops during exchange between heroes
This commit is contained in:
parent
7f07a30d7d
commit
8d178fbcf5
@ -799,12 +799,12 @@ void CGameState::init(StartInfo * si)
|
||||
placeStartingHeroes();
|
||||
initStartingResources();
|
||||
initHeroes();
|
||||
initFogOfWar();
|
||||
initStartingBonus();
|
||||
initTowns();
|
||||
initMapObjects();
|
||||
buildBonusSystemTree();
|
||||
initVisitingAndGarrisonedHeroes();
|
||||
initFogOfWar();
|
||||
|
||||
logGlobal->debugStream() << "\tChecking objectives";
|
||||
map->checkForObjectives(); //needs to be run when all objects are properly placed
|
||||
|
@ -70,6 +70,14 @@ EventCondition::EventCondition(EWinLoseType condition):
|
||||
{
|
||||
}
|
||||
|
||||
EventCondition::EventCondition(EWinLoseType condition, si32 value, si32 objectType, int3 position):
|
||||
object(nullptr),
|
||||
value(value),
|
||||
objectType(objectType),
|
||||
position(position),
|
||||
condition(condition)
|
||||
{}
|
||||
|
||||
DisposedHero::DisposedHero() : heroId(0), portrait(255), players(0)
|
||||
{
|
||||
|
||||
|
@ -122,6 +122,7 @@ struct DLL_LINKAGE EventCondition
|
||||
};
|
||||
|
||||
EventCondition(EWinLoseType condition = STANDARD_WIN);
|
||||
EventCondition(EWinLoseType condition, si32 value, si32 objectType, int3 position = int3(-1, -1, -1));
|
||||
|
||||
const CGObjectInstance * object; // object that was at specified position on start
|
||||
si32 value;
|
||||
|
@ -449,12 +449,13 @@ void CMapLoaderH3M::readVictoryLossConditions()
|
||||
}
|
||||
case EVictoryConditionType::TAKEDWELLINGS:
|
||||
{
|
||||
EventCondition cond(EventCondition::CONTROL);
|
||||
cond.objectType = Obj::CREATURE_GENERATOR1; // FIXME: generators 2-4?
|
||||
EventExpression::OperatorAll oper;
|
||||
oper.expressions.push_back(EventCondition(EventCondition::CONTROL, 0, Obj::CREATURE_GENERATOR1));
|
||||
oper.expressions.push_back(EventCondition(EventCondition::CONTROL, 0, Obj::CREATURE_GENERATOR4));
|
||||
|
||||
specialVictory.effect.toOtherMessage = VLC->generaltexth->allTexts[289];
|
||||
specialVictory.onFulfill = VLC->generaltexth->allTexts[288];
|
||||
specialVictory.trigger = EventExpression(cond);
|
||||
specialVictory.trigger = EventExpression(oper);
|
||||
break;
|
||||
}
|
||||
case EVictoryConditionType::TAKEMINES:
|
||||
|
@ -273,11 +273,11 @@ bool CGarrisonDialogQuery::blocksPack(const CPack *pack) const
|
||||
ourIds.insert(this->exchangingArmies[1]->id);
|
||||
|
||||
|
||||
if(auto stacks = dynamic_cast<const ArrangeStacks*>(pack))
|
||||
if (auto stacks = dynamic_cast<const ArrangeStacks*>(pack))
|
||||
{
|
||||
return !vstd::contains(ourIds, stacks->id1) || !vstd::contains(ourIds, stacks->id2);
|
||||
}
|
||||
else if(auto arts = dynamic_cast<const ExchangeArtifacts*>(pack))
|
||||
if (auto arts = dynamic_cast<const ExchangeArtifacts*>(pack))
|
||||
{
|
||||
if(auto id1 = boost::apply_visitor(GetEngagedHeroIds(), arts->src.artHolder))
|
||||
if(!vstd::contains(ourIds, *id1))
|
||||
@ -286,9 +286,12 @@ bool CGarrisonDialogQuery::blocksPack(const CPack *pack) const
|
||||
if(auto id2 = boost::apply_visitor(GetEngagedHeroIds(), arts->dst.artHolder))
|
||||
if(!vstd::contains(ourIds, *id2))
|
||||
return true;
|
||||
|
||||
return false;
|
||||
}
|
||||
if (auto dismiss = dynamic_cast<const DisbandCreature*>(pack))
|
||||
{
|
||||
return !vstd::contains(ourIds, dismiss->id);
|
||||
}
|
||||
|
||||
return CDialogQuery::blocksPack(pack);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user