1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-11-25 22:42:04 +02:00

Improvements to skeleton transformer logic

This commit is contained in:
Ivan Savenko
2025-06-11 12:22:53 +03:00
parent 0979f409c7
commit 0e2463f9c4
7 changed files with 52 additions and 14 deletions

View File

@@ -3254,11 +3254,10 @@ bool CGameHandler::transformInUndead(const IMarket *market, const CGHeroInstance
//resulting creature - bone dragons or skeletons
CreatureID resCreature = CreatureID::SKELETON;
if (!s.hasBonusOfType(BonusType::UNDEAD))
{
if (s.hasBonusOfType(BonusType::DRAGON_NATURE) || s.hasBonusOfType(BonusType::DRACONIC_SKELETON))
resCreature = CreatureID::BONE_DRAGON;
}
auto customTargerBonus = s.getBonusesOfType(BonusType::SKELETON_TRANSFORMER_TARGET);
if (!customTargerBonus->empty())
resCreature = customTargerBonus->front()->subtype.as<CreatureID>();
changeStackType(StackLocation(army->id, slot), resCreature.toCreature());
return true;
}