1
0
mirror of https://github.com/vcmi/vcmi.git synced 2024-12-24 22:14:36 +02:00

Nullkiller: fix merge conflicts

This commit is contained in:
Andrii Danylchenko 2021-07-18 20:44:37 +03:00 committed by Andrii Danylchenko
parent d47564955e
commit 79d06bbaa6
6 changed files with 8 additions and 8 deletions

View File

@ -487,7 +487,7 @@ void AIGateway::showWorldViewEx(const std::vector<ObjectPosInfo> & objectPositio
NET_EVENT_HANDLER;
}
void AIGateway::init(std::shared_ptr<CCallback> CB)
void AIGateway::init(std::shared_ptr<Environment> env, std::shared_ptr<CCallback> CB)
{
LOG_TRACE(logAi);
myCb = CB;
@ -1005,7 +1005,7 @@ void AIGateway::recruitCreatures(const CGDwelling * d, const CArmedInstance * re
int count = d->creatures[i].first;
CreatureID creID = d->creatures[i].second.back();
vstd::amin(count, cb->getResourceAmount() / VLC->creh->creatures[creID]->cost);
vstd::amin(count, cb->getResourceAmount() / VLC->creh->objects[creID]->cost);
if(count > 0)
cb->recruitCreatures(d, recruiter, creID, count, i);
}

View File

@ -109,7 +109,7 @@ public:
std::string getBattleAIName() const override;
void init(std::shared_ptr<CCallback> CB) override;
void init(std::shared_ptr<Environment> env, std::shared_ptr<CCallback> CB) override;
void yourTurn() override;
void heroGotLevel(const CGHeroInstance * hero, PrimarySkill::PrimarySkill pskill, std::vector<SecondarySkill> & skills, QueryID queryID) override; //pskill is gained primary skill, interface has to choose one of given skills and call callback with selection id

View File

@ -323,7 +323,7 @@ creInfo infoFromDC(const dwellingContent & dc)
ci.creID = dc.second.size() ? dc.second.back() : CreatureID(-1); //should never be accessed
if (ci.creID != -1)
{
ci.cre = VLC->creh->creatures[ci.creID];
ci.cre = VLC->creh->objects[ci.creID].get();
ci.level = ci.cre->level; //this is cretaure tier, while tryRealize expects dwelling level. Ignore.
}
else

View File

@ -171,10 +171,10 @@ uint64_t evaluateArtifactArmyValue(CArtifactInstance * art)
4 * art->valOfBonuses(Bonus::LAND_MOVEMENT)
+ 700 * art->valOfBonuses(Bonus::MORALE)
+ 700 * art->getAttack(false)
+ 700 * art->getDefence(false)
+ 700 * art->getDefense(false)
+ 700 * art->valOfBonuses(Bonus::PRIMARY_SKILL, PrimarySkill::KNOWLEDGE)
+ 700 * art->valOfBonuses(Bonus::PRIMARY_SKILL, PrimarySkill::SPELL_POWER)
+ 700 * art->getDefence(false)
+ 700 * art->getDefense(false)
+ 500 * art->valOfBonuses(Bonus::LUCK);
auto classValue = 0;

View File

@ -57,7 +57,7 @@ std::string AbstractGoal::toString() const //TODO: virtualize
desc = "GATHER TROOPS";
break;
case GET_ART_TYPE:
desc = "GET ARTIFACT OF TYPE " + VLC->arth->artifacts[aid]->Name();
desc = "GET ARTIFACT OF TYPE " + VLC->arth->objects[aid]->getName();
break;
case DIG_AT_TILE:
desc = "DIG AT TILE " + tile.toString();

View File

@ -32,7 +32,7 @@ void AdventureSpellCast::accept(AIGateway * ai)
logAi->trace("Decomposing adventure spell cast of %s for hero %s", spell->name, hero->name);
if(!spell->isAdventureSpell())
if(!spell->isAdventure())
throw cannotFulfillGoalException(spell->name + " is not an adventure spell.");
if(!hero->canCastThisSpell(spell))