added upper limit for bonded cards

This commit is contained in:
Chr1Z93 2024-04-27 19:15:22 +02:00
parent c9b8ae3a51
commit 7aadd2adf0
31 changed files with 52 additions and 7 deletions

View File

@ -9,6 +9,7 @@
"bonded": [
{
"count": 1,
"maxCount": 1,
"id": "10063"
}
],

View File

@ -8,6 +8,7 @@
"bonded": [
{
"count": 1,
"maxCount": 1,
"id": "10134"
}
],

View File

@ -9,6 +9,7 @@
"bonded": [
{
"count": 1,
"maxCount": 2,
"id": "06025"
}
],

View File

@ -9,6 +9,7 @@
"bonded": [
{
"count": 1,
"maxCount": 1,
"id": "06113"
}
],

View File

@ -9,6 +9,7 @@
"bonded": [
{
"count": 1,
"maxCount": 1,
"id": "06113"
}
],

View File

@ -9,6 +9,7 @@
"bonded": [
{
"count": 1,
"maxCount": 1,
"id": "06113"
}
],

View File

@ -9,6 +9,7 @@
"bonded": [
{
"count": 1,
"maxCount": 1,
"id": "06113"
}
],

View File

@ -9,6 +9,7 @@
"bonded": [
{
"count": 1,
"maxCount": 1,
"id": "06277"
}
],

View File

@ -9,6 +9,7 @@
"bonded": [
{
"count": 1,
"maxCount": 2,
"id": "10036"
}
],

View File

@ -7,10 +7,12 @@
"bonded": [
{
"count": 1,
"maxCount": 1,
"id": "10006"
},
{
"count": 1,
"maxCount": 1,
"id": "10007"
}
],

View File

@ -8,6 +8,7 @@
"bonded": [
{
"count": 1,
"maxCount": 1,
"id": "06015a"
}
],

View File

@ -9,6 +9,7 @@
"bonded": [
{
"count": 3,
"maxCount": 3,
"id": "05314"
}
],

View File

@ -9,6 +9,7 @@
"bonded": [
{
"count": 3,
"maxCount": 3,
"id": "05314"
}
],

View File

@ -6,10 +6,12 @@
"bonded": [
{
"count": 1,
"maxCount": 1,
"id": "10015-b1"
},
{
"count": 1,
"maxCount": 1,
"id": "10015-b2"
}
],

View File

@ -7,6 +7,7 @@
"bonded": [
{
"count": 1,
"maxCount": 2,
"id": "10039"
}
],

View File

@ -9,14 +9,17 @@
"bonded": [
{
"count": 1,
"maxCount": 1,
"id": "06031"
},
{
"count": 1,
"maxCount": 1,
"id": "06032"
},
{
"count": 1,
"maxCount": 1,
"id": "06033"
}
],

View File

@ -9,6 +9,7 @@
"bonded": [
{
"count": 3,
"maxCount": 3,
"id": "06331"
}
],

View File

@ -9,6 +9,7 @@
"bonded": [
{
"count": 3,
"maxCount": 3,
"id": "05317"
}
],

View File

@ -9,6 +9,7 @@
"bonded": [
{
"count": 3,
"maxCount": 3,
"id": "05317"
}
],

View File

@ -8,6 +8,7 @@
"bonded": [
{
"count": 1,
"maxCount": 1,
"id": "10045"
}
],

View File

@ -9,6 +9,7 @@
"bonded": [
{
"count": 1,
"maxCount": 1,
"id": "10045"
}
],

View File

@ -9,6 +9,7 @@
"bonded": [
{
"count": 1,
"maxCount": 1,
"id": "10045"
}
],

View File

@ -9,6 +9,7 @@
"bonded": [
{
"count": 1,
"maxCount": 1,
"id": "10045"
}
],

View File

@ -9,22 +9,27 @@
"bonded": [
{
"count": 1,
"maxCount": 1,
"id": "10086"
},
{
"count": 1,
"maxCount": 1,
"id": "10087"
},
{
"count": 1,
"maxCount": 1,
"id": "10088"
},
{
"count": 1,
"maxCount": 1,
"id": "10089"
},
{
"count": 1,
"maxCount": 1,
"id": "10090"
}
],

View File

@ -9,22 +9,27 @@
"bonded": [
{
"count": 1,
"maxCount": 1,
"id": "10086"
},
{
"count": 1,
"maxCount": 1,
"id": "10087"
},
{
"count": 1,
"maxCount": 1,
"id": "10088"
},
{
"count": 1,
"maxCount": 1,
"id": "10089"
},
{
"count": 1,
"maxCount": 1,
"id": "10090"
}
],

View File

@ -8,10 +8,12 @@
"bonded": [
{
"count": 1,
"maxCount": 1,
"id": "10106"
},
{
"count": 1,
"maxCount": 1,
"id": "10107"
}
],

View File

@ -8,6 +8,7 @@
"bonded": [
{
"count": 1,
"maxCount": 1,
"id": "06022"
}
],

View File

@ -8,6 +8,7 @@
"bonded": [
{
"count": 1,
"maxCount": 2,
"id": "06028"
}
],

View File

@ -9,6 +9,7 @@
"bonded": [
{
"count": 1,
"maxCount": 2,
"id": "06283"
}
],

View File

@ -9,6 +9,7 @@
"bonded": [
{
"count": 3,
"maxCount": 3,
"id": "06019"
}
],

View File

@ -363,21 +363,23 @@ do
local bondedList = { }
for cardId, cardCount in pairs(slots) do
local card = allCardsBagApi.getCardById(cardId)
if (card ~= nil and card.metadata.bonded ~= nil) then
if card ~= nil and card.metadata.bonded ~= nil then
for _, bond in ipairs(card.metadata.bonded) do
-- add a bonded card for each copy of the parent card (except for Pendant of the Queen)
if bond.id == "06022" then
bondedCards[bond.id] = bond.count
else
bondedCards[bond.id] = bond.count * cardCount
end
-- 'unlimited' upper limit for cards without this data
local maxCount = bond.maxCount or 99
-- add a bonded card for each copy of the parent card (until the max value is reached)
bondedCards[bond.id] = math.min(bond.count * cardCount, maxCount)
-- We need to know which cards are bonded to determine their position, remember them
bondedList[bond.id] = true
-- Also adding taboo versions of bonded cards to the list
bondedList[bond.id .. "-t"] = true
end
end
end
-- Add any bonded cards to the main slots list
for bondedId, bondedCount in pairs(bondedCards) do
slots[bondedId] = bondedCount