1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-11-06 09:09:40 +02:00

Nullkiller: stabilization+clasterization improvements+fuzzy fear

This commit is contained in:
Andrii Danylchenko
2021-05-16 14:55:33 +03:00
committed by Andrii Danylchenko
parent 75b8ee74fa
commit 32fb465823
12 changed files with 137 additions and 56 deletions

View File

@@ -36,32 +36,6 @@ namespace AIPathfinding
return sptr(Goals::Invalid());
}
const ChainActor * BuildBoatAction::getActor(const ChainActor * sourceActor) const
{
return sourceActor->resourceActor;
}
void SummonBoatAction::execute(const CGHeroInstance * hero) const
{
Goals::AdventureSpellCast(hero, SpellID::SUMMON_BOAT).accept(ai.get());
}
const ChainActor * SummonBoatAction::getActor(const ChainActor * sourceActor) const
{
return sourceActor->castActor;
}
void SummonBoatAction::applyOnDestination(
const CGHeroInstance * hero,
CDestinationNodeInfo & destination,
const PathNodeInfo & source,
AIPathNode * dstMode,
const AIPathNode * srcNode) const
{
dstMode->manaCost = srcNode->manaCost + getManaCost(hero);
dstMode->theNodeBefore = source.node;
}
bool BuildBoatAction::canAct(const AIPathNode * source) const
{
auto hero = source->actor->hero;
@@ -90,6 +64,37 @@ namespace AIPathfinding
return true;
}
const CGObjectInstance * BuildBoatAction::targetObject() const
{
return shipyard->o;
}
const ChainActor * BuildBoatAction::getActor(const ChainActor * sourceActor) const
{
return sourceActor->resourceActor;
}
void SummonBoatAction::execute(const CGHeroInstance * hero) const
{
Goals::AdventureSpellCast(hero, SpellID::SUMMON_BOAT).accept(ai.get());
}
const ChainActor * SummonBoatAction::getActor(const ChainActor * sourceActor) const
{
return sourceActor->castActor;
}
void SummonBoatAction::applyOnDestination(
const CGHeroInstance * hero,
CDestinationNodeInfo & destination,
const PathNodeInfo & source,
AIPathNode * dstMode,
const AIPathNode * srcNode) const
{
dstMode->manaCost = srcNode->manaCost + getManaCost(hero);
dstMode->theNodeBefore = source.node;
}
std::string BuildBoatAction::toString() const
{
return "Build Boat at " + shipyard->o->getObjectName();