1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-01-26 03:52:01 +02:00

Fixed "Long Live the King", 1st scenario victory condition

This commit is contained in:
Ivan Savenko 2023-09-20 21:58:47 +03:00
parent 5a8c3b5ae2
commit 921569e02e
3 changed files with 48 additions and 4 deletions

View File

@ -75,6 +75,46 @@
"victoryIconIndex" : 11,
"victoryString" : "core.vcdesc.0"
},
"data/evil2:0" : { // A Gryphon's Heart
"defeatIconIndex" : 2,
"defeatString" : "core.lcdesc.3",
"triggeredEvents" : {
"specialDefeat" : {
"condition" : [
"allOf",
[ "isHuman", { "value" : 1 } ],
[ "daysPassed", { "value" : 84 } ]
],
"effect" : {
"messageToSend" : "core.genrltxt.5",
"type" : "defeat"
},
"message" : "core.genrltxt.254"
},
"specialVictory" : {
"condition" : [
"allOf",
[ "isHuman", { "value" : 1 } ],
[ "transport", { "position" : [ 16, 23, 0 ], "type" : 84 } ]
],
"effect" : {
"messageToSend" : "core.genrltxt.293",
"type" : "victory"
},
"message" : "core.genrltxt.292"
},
"standardDefeat" : {
"condition" : [ "daysWithoutTown", { "value" : 7 } ],
"effect" : {
"messageToSend" : "core.genrltxt.8",
"type" : "defeat"
},
"message" : "core.genrltxt.7"
}
},
"victoryIconIndex" : 10,
"victoryString" : "core.vcdesc.11"
},
"data/secret1:0" : { // The Grail
"defeatIconIndex" : 2,
"defeatString" : "core.lcdesc.3",

View File

@ -388,12 +388,11 @@ void MetaString::jsonDeserialize(const JsonNode & source)
void MetaString::serializeJson(JsonSerializeFormat & handler)
{
JsonNode attr;
if(handler.saving)
jsonSerialize(attr);
handler.serializeRaw("attributes", attr, std::nullopt);
jsonSerialize(const_cast<JsonNode&>(handler.getCurrent()));
if(!handler.saving)
jsonDeserialize(attr);
jsonDeserialize(handler.getCurrent());
}
VCMI_LIB_NAMESPACE_END

View File

@ -870,6 +870,11 @@ void CMapPatcher::readPatchData()
{
JsonDeserializer handler(mapObjectResolver.get(), input);
readTriggeredEvents(handler);
handler.serializeInt("defeatIconIndex", mapHeader->defeatIconIndex);
handler.serializeInt("victoryIconIndex", mapHeader->victoryIconIndex);
handler.serializeStruct("victoryString", mapHeader->victoryMessage);
handler.serializeStruct("defeatString", mapHeader->defeatMessage);
}
///CMapLoaderJson