Merge pull request #506 from Entrox-Licher/startsInPlay

Added startsInPlay metadata to more cards
This commit is contained in:
Entrox-Licher 2023-12-21 16:12:07 -05:00 committed by GitHub
commit 96b0caee09
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
25 changed files with 58 additions and 11 deletions

View File

@ -2,6 +2,7 @@
"id": "07122",
"type": "Asset",
"class": "Survivor",
"startsInPlay": true,
"level": 2,
"traits": "Covenant. Blessed.",
"permanent": true,

View File

@ -2,6 +2,7 @@
"id": "07122-t",
"type": "Asset",
"class": "Survivor",
"startsInPlay": true,
"level": 2,
"traits": "Covenant. Blessed.",
"permanent": true,

View File

@ -2,6 +2,7 @@
"id": "07113",
"type": "Asset",
"class": "Seeker",
"startsInPlay": true,
"level": 2,
"traits": "Covenant. Cursed.",
"permanent": true,

View File

@ -2,6 +2,7 @@
"id": "02191",
"type": "Asset",
"class": "Mystic",
"startsInPlay": true,
"level": 3,
"traits": "Spell. Pact.",
"permanent": true,

View File

@ -2,6 +2,7 @@
"id": "90028",
"type": "Asset",
"class": "Neutral",
"startsInPlay": true,
"permanent": true,
"cycle": "Standalone"
}

View File

@ -2,6 +2,7 @@
"id": "90025",
"type": "Asset",
"class": "Neutral",
"startsInPlay": true,
"permanent": true,
"cycle": "Standalone"
}

View File

@ -2,6 +2,7 @@
"id": "90026",
"type": "Asset",
"class": "Neutral",
"startsInPlay": true,
"permanent": true,
"cycle": "Standalone"
}

View File

@ -2,6 +2,7 @@
"id": "08012a",
"type": "Asset",
"class": "Neutral",
"startsInPlay": true,
"traits": "Unbroken.",
"permanent": true,
"cycle": "Edge of the Earth"

View File

@ -2,6 +2,7 @@
"id": "08014a",
"type": "Asset",
"class": "Neutral",
"startsInPlay": true,
"traits": "Unbroken.",
"permanent": true,
"cycle": "Edge of the Earth"

View File

@ -2,6 +2,7 @@
"id": "08011a",
"type": "Asset",
"class": "Neutral",
"startsInPlay": true,
"traits": "Unbroken.",
"permanent": true,
"cycle": "Edge of the Earth"

View File

@ -2,6 +2,7 @@
"id": "08013a",
"type": "Asset",
"class": "Neutral",
"startsInPlay": true,
"traits": "Unbroken.",
"permanent": true,
"cycle": "Edge of the Earth"

View File

@ -2,6 +2,7 @@
"id": "07116",
"type": "Asset",
"class": "Rogue",
"startsInPlay": true,
"level": 2,
"traits": "Covenant. Cursed.",
"permanent": true,

View File

@ -2,6 +2,7 @@
"id": "05011",
"type": "Asset",
"class": "Neutral",
"startsInPlay": true,
"traits": "Boon.",
"permanent": true,
"uses": [

View File

@ -2,6 +2,7 @@
"id": "02187",
"type": "Asset",
"class": "Seeker",
"startsInPlay": true,
"level": 3,
"traits": "Talent.",
"permanent": true,

View File

@ -2,6 +2,7 @@
"id": "02185",
"type": "Asset",
"class": "Guardian",
"startsInPlay": true,
"level": 3,
"traits": "Talent.",
"permanent": true,

View File

@ -2,6 +2,7 @@
"id": "53010",
"type": "Asset",
"class": "Survivor",
"startsInPlay": true,
"level": 3,
"traits": "Talent.",
"permanent": true,

View File

@ -2,6 +2,7 @@
"id": "07120",
"type": "Asset",
"class": "Mystic",
"startsInPlay": true,
"level": 2,
"traits": "Covenant. Blessed. Cursed.",
"permanent": true,

View File

@ -2,6 +2,7 @@
"id": "07110",
"type": "Asset",
"class": "Guardian",
"startsInPlay": true,
"level": 2,
"traits": "Covenant. Blessed.",
"permanent": true,

View File

@ -2,6 +2,7 @@
"id": "02193",
"type": "Asset",
"class": "Survivor",
"startsInPlay": true,
"level": 3,
"traits": "Talent.",
"permanent": true,

View File

@ -2,6 +2,7 @@
"id": "09094",
"type": "Asset",
"class": "Mystic",
"startsInPlay": true,
"level": 3,
"traits": "Ritual.",
"permanent": true,

View File

@ -2,6 +2,7 @@
"id": "03264",
"type": "Asset",
"class": "Guardian",
"startsInPlay": true,
"level": 3,
"traits": "Talent.",
"permanent": true,

View File

@ -2,6 +2,7 @@
"id": "02189",
"type": "Asset",
"class": "Rogue",
"startsInPlay": true,
"level": 3,
"traits": "Talent.",
"permanent": true,

View File

@ -2,6 +2,7 @@
"id": "90038",
"type": "Asset",
"class": "Neutral",
"startsInPlay": true,
"permanent": true,
"cycle": "Standalone"
}

View File

@ -7,6 +7,8 @@ local playAreaApi = require("core/PlayAreaApi")
local playmatApi = require("playermat/PlaymatApi")
local zones = require("playermat/Zones")
local startsInPlayCount = 0
function onLoad(script_state)
initializeUi(JSON.decode(script_state))
math.randomseed(os.time())
@ -31,7 +33,7 @@ function getDefaultCardZone(cardMetadata, bondedList)
elseif cardMetadata.type == "UpgradeSheet" then
return "SetAside4"
elseif cardMetadata.startsInPlay then
return "BlankTop"
return startsInPlayTracker()
elseif cardMetadata.permanent then
return "SetAside1"
elseif bondedList[cardMetadata.id] then
@ -42,6 +44,16 @@ function getDefaultCardZone(cardMetadata, bondedList)
end
end
function startsInPlayTracker()
startsInPlayCount = startsInPlayCount + 1
if startsInPlayCount > 6 then
broadcastToAll("Card that should start in play was placed with permanents because no blank slots remained")
return "SetAside1"
else
return "Blank" .. startsInPlayCount
end
end
function buildDeck(playerColor, deckId)
local uiState = getUiState()
arkhamDb.getDecklist(
@ -450,13 +462,13 @@ function handlePeteSignatureAssets(investigatorId, cardList)
if investigatorId == "02005" or investigatorId == "02005-pb" then -- regular Pete's front
for i, card in ipairs(cardList) do
if card.metadata.id == "02014" then -- Duke
card.zone = "BlankTop"
card.zone = startsInPlayTracker()
end
end
elseif investigatorId == "02005-p" or investigatorId == "02005-pf" then -- parallel Pete's front
for i, card in ipairs(cardList) do
if card.metadata.id == "90047" then -- Pete's Guitar
card.zone = "BlankTop"
card.zone = startsInPlayTracker()
end
end
end

View File

@ -8,8 +8,8 @@
-- Investigator: Investigator card area.
-- Minicard: Placement for the investigator's minicard, just above the player mat
-- Deck, Discard: Standard locations for the deck and discard piles.
-- BlankTop: used for assets that start in play (e.g. Duke)
-- Tarot, Hand1, Hand2, Ally, BlankBottom, Accessory, Arcane1, Arcane2, Body: Asset slot positions
-- Blank1: used for assets that start in play (e.g. Duke)
-- Tarot, Hand1, Hand2, Ally, Blank4, Accessory, Arcane1, Arcane2, Body: Asset slot positions
-- Threat[1-4]: Threat area slots. Threat[1-3] correspond to the named threat area slots, and Threat4 is the blank threat area slot.
-- SetAside[1-3]: Column closest to the player mat, with 1 at the top and 3 at the bottom.
-- SetAside[4-6]: Column farther away from the mat, with 4 at the top and 6 at the bottom.
@ -35,8 +35,12 @@ do
commonZones["Arcane2"] = { -0.171, 0, 0.557 }
commonZones["Tarot"] = { 0.602, 0, 0.033 }
commonZones["Accessory"] = { 0.602, 0, 0.555 }
commonZones["BlankTop"] = { 1.758, 0, 0.040 }
commonZones["BlankBottom"] = { 1.754, 0, 0.563 }
commonZones["Blank1"] = { 1.758, 0, 0.040 }
commonZones["Blank2"] = { 1.754, 0, 0.563 }
commonZones["Blank3"] = { 1.371, 0, 0.038 }
commonZones["Blank4"] = { 1.371, 0, 0.558 }
commonZones["Blank5"] = { 0.98, 0, 0.035 }
commonZones["Blank6"] = { 0.977, 0, 0.556 }
commonZones["Threat1"] = { -0.911, 0, -0.625 }
commonZones["Threat2"] = { -0.454, 0, -0.625 }
commonZones["Threat3"] = { 0.002, 0, -0.625 }
@ -55,8 +59,12 @@ do
zoneData["White"]["Arcane2"] = commonZones["Arcane2"]
zoneData["White"]["Tarot"] = commonZones["Tarot"]
zoneData["White"]["Accessory"] = commonZones["Accessory"]
zoneData["White"]["BlankTop"] = commonZones["BlankTop"]
zoneData["White"]["BlankBottom"] = commonZones["BlankBottom"]
zoneData["White"]["Blank1"] = commonZones["Blank1"]
zoneData["White"]["Blank2"] = commonZones["Blank2"]
zoneData["White"]["Blank3"] = commonZones["Blank3"]
zoneData["White"]["Blank4"] = commonZones["Blank4"]
zoneData["White"]["Blank5"] = commonZones["Blank5"]
zoneData["White"]["Blank6"] = commonZones["Blank6"]
zoneData["White"]["Threat1"] = commonZones["Threat1"]
zoneData["White"]["Threat2"] = commonZones["Threat2"]
zoneData["White"]["Threat3"] = commonZones["Threat3"]
@ -83,8 +91,12 @@ do
zoneData["Orange"]["Arcane2"] = commonZones["Arcane2"]
zoneData["Orange"]["Tarot"] = commonZones["Tarot"]
zoneData["Orange"]["Accessory"] = commonZones["Accessory"]
zoneData["Orange"]["BlankTop"] = commonZones["BlankTop"]
zoneData["Orange"]["BlankBottom"] = commonZones["BlankBottom"]
zoneData["Orange"]["Blank1"] = commonZones["Blank1"]
zoneData["Orange"]["Blank2"] = commonZones["Blank2"]
zoneData["Orange"]["Blank3"] = commonZones["Blank3"]
zoneData["Orange"]["Blank4"] = commonZones["Blank4"]
zoneData["Orange"]["Blank5"] = commonZones["Blank5"]
zoneData["Orange"]["Blank6"] = commonZones["Blank6"]
zoneData["Orange"]["Threat1"] = commonZones["Threat1"]
zoneData["Orange"]["Threat2"] = commonZones["Threat2"]
zoneData["Orange"]["Threat3"] = commonZones["Threat3"]