1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-06-17 00:07:41 +02:00

Partially redone combined artifacts.

This commit is contained in:
Michał W. Urbańczyk
2011-01-22 03:43:20 +00:00
parent 591ba76f69
commit 3fde9e45df
16 changed files with 291 additions and 48 deletions

View File

@ -2565,13 +2565,24 @@ bool CGameHandler::moveArtifact(si32 srcHeroID, si32 destHeroID, ui16 srcSlot, u
*/
bool CGameHandler::assembleArtifacts (si32 heroID, ui16 artifactSlot, bool assemble, ui32 assembleTo)
{
if (artifactSlot < 0 || artifactSlot > 18) {
complain("Illegal artifact slot.");
return false;
}
CGHeroInstance *hero = gs->getHero(heroID);
const CArtifactInstance *destArtifact = hero->getArt(artifactSlot);
if(!destArtifact)
COMPLAIN_RET("assembleArtifacts: there is no such artifact instance!");
CArtifact *combinedArt = VLC->arth->artifacts[assembleTo];
if(!combinedArt->constituents)
COMPLAIN_RET("assembleArtifacts: Artifact being attempted to assemble is not a combined artifacts!");
if(!vstd::contains(destArtifact->assemblyPossibilities(hero), combinedArt))
COMPLAIN_RET("assembleArtifacts: It's impossible to assemble requested artifact!");
AssembledArtifact aa;
aa.al = ArtifactLocation(hero, artifactSlot);
aa.builtArt = combinedArt;
CCombinedArtifactInstance *assembliedArt = new CCombinedArtifactInstance();
/*
SetHeroArtifacts sha;
sha.hid = heroID;