mirror of
https://github.com/vcmi/vcmi.git
synced 2025-11-27 22:49:25 +02:00
Mostly done combined artifacts.
[assembling, disassembling, moving, picking]
This commit is contained in:
@@ -2572,17 +2572,28 @@ bool CGameHandler::assembleArtifacts (si32 heroID, ui16 artifactSlot, bool assem
|
||||
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!");
|
||||
if(assemble)
|
||||
{
|
||||
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;
|
||||
AssembledArtifact aa;
|
||||
aa.al = ArtifactLocation(hero, artifactSlot);
|
||||
aa.builtArt = combinedArt;
|
||||
sendAndApply(&aa);
|
||||
}
|
||||
else
|
||||
{
|
||||
if(!destArtifact->artType->constituents)
|
||||
COMPLAIN_RET("assembleArtifacts: Artifact being attempted to disassemble is not a combined artifact!");
|
||||
|
||||
CCombinedArtifactInstance *assembliedArt = new CCombinedArtifactInstance();
|
||||
DisassembledArtifact da;
|
||||
da.al = ArtifactLocation(hero, artifactSlot);
|
||||
sendAndApply(&da);
|
||||
}
|
||||
/*
|
||||
SetHeroArtifacts sha;
|
||||
sha.hid = heroID;
|
||||
|
||||
Reference in New Issue
Block a user