3.4.0
This commit is contained in:
parent
7472131c54
commit
b1f0b20bb6
1705
unpacked.ttslua
1705
unpacked.ttslua
File diff suppressed because it is too large
Load Diff
549
unpacked.xml
549
unpacked.xml
@ -1,50 +1,36 @@
|
|||||||
<!-- include Global.xml -->
|
<!-- include Global/Global.xml -->
|
||||||
<!-- Default formatting -->
|
|
||||||
<Defaults>
|
<Defaults>
|
||||||
<!-- general Stuff -->
|
<!-- general stuff -->
|
||||||
<Text color="white"
|
<Text color="white"
|
||||||
fontSize="18"/>
|
fontSize="18"/>
|
||||||
<Button tooltipPosition="Left"
|
|
||||||
color="clear"/>
|
|
||||||
|
|
||||||
<!-- Window -->
|
|
||||||
<HorizontalLayout class="headerLayout"
|
|
||||||
height="75"
|
|
||||||
padding="5"/>
|
|
||||||
<Button class="headerButton"
|
|
||||||
minWidth="50"
|
|
||||||
preferredWidth="50"
|
|
||||||
flexibleWidth="0"
|
|
||||||
color="clear"/>
|
|
||||||
<Text class="headerText"
|
|
||||||
minWidth="200"
|
|
||||||
flexibleWidth="100"
|
|
||||||
fontSize="32"
|
|
||||||
font="font_teutonic-arkham"/>
|
|
||||||
</Defaults>
|
</Defaults>
|
||||||
|
|
||||||
<!-- Buttons at the bottom right (height: n * 35 + (n-1) * 2) -->
|
<!-- include Global/BottomBar.xml -->
|
||||||
|
<Defaults>
|
||||||
|
<Button class="navbar"
|
||||||
|
tooltipPosition="Left"
|
||||||
|
tooltipBackgroundColor="rgba(0,0,0,1)"
|
||||||
|
color="clear"/>
|
||||||
|
</Defaults>
|
||||||
|
|
||||||
|
<!-- Buttons at the bottom right (height: n * 37 - 2) -->
|
||||||
<VerticalLayout visibility="Admin"
|
<VerticalLayout visibility="Admin"
|
||||||
color="#000000"
|
color="#000000"
|
||||||
outlineSize="1 1"
|
outlineSize="1 1"
|
||||||
outline="#303030"
|
outline="#303030"
|
||||||
rectAlignment="LowerRight"
|
rectAlignment="LowerRight"
|
||||||
width="35"
|
width="35"
|
||||||
height="146"
|
height="72"
|
||||||
offsetXY="-1 120"
|
offsetXY="-1 120"
|
||||||
spacing="2">
|
spacing="2">
|
||||||
<Button icon="cthulhu"
|
<Button class="navbar"
|
||||||
tooltip="Campaigns"
|
icon="devourer"
|
||||||
onClick="onClick_toggleUi(Campaigns)"/>
|
tooltip="Downloadable Content"
|
||||||
<Button icon="dark-cult"
|
onClick="onClick_toggleUi(downloadWindow)"/>
|
||||||
tooltip="Standalone Scenarios"
|
<Button class="navbar"
|
||||||
onClick="onClick_toggleUi(Standalone Scenarios)"/>
|
icon="option-gear"
|
||||||
<Button icon="devourer"
|
|
||||||
tooltip="Community Content"
|
|
||||||
onClick="onClick_toggleUi(Community Content)"/>
|
|
||||||
<Button icon="option-gear"
|
|
||||||
tooltip="Options"
|
tooltip="Options"
|
||||||
onClick="onClick_toggleUi(Options)"/>
|
onClick="onClick_toggleUi(optionPanel)"/>
|
||||||
</VerticalLayout>
|
</VerticalLayout>
|
||||||
|
|
||||||
<!-- Navigation Overlay button (not visibly to Grey and Black) -->
|
<!-- Navigation Overlay button (not visibly to Grey and Black) -->
|
||||||
@ -55,64 +41,301 @@
|
|||||||
rectAlignment="LowerRight"
|
rectAlignment="LowerRight"
|
||||||
width="35"
|
width="35"
|
||||||
height="35"
|
height="35"
|
||||||
offsetXY="-1 65">
|
offsetXY="-1 85">
|
||||||
<Button icon="NavigationOverlayIcon"
|
<Button class="navbar"
|
||||||
|
icon="NavigationOverlayIcon"
|
||||||
tooltip="Navigation Overlay"
|
tooltip="Navigation Overlay"
|
||||||
onClick="onClick_toggleUi(Navigation Overlay)"/>
|
onClick="onClick_toggleUi(Navigation Overlay)"/>
|
||||||
</Panel>
|
</Panel>
|
||||||
|
<!-- include Global/BottomBar.xml -->
|
||||||
|
<!-- include Global/DownloadWindow.xml -->
|
||||||
|
<Defaults>
|
||||||
|
<Button class="downloadTab"
|
||||||
|
hoverClass="bGrey"
|
||||||
|
pressClass="bWhite"
|
||||||
|
onClick="onClick_tab"
|
||||||
|
color="#888888"
|
||||||
|
fontSize="24"
|
||||||
|
font="font_teutonic-arkham"/>
|
||||||
|
<Button class="bGrey"
|
||||||
|
color="grey"/>
|
||||||
|
<Button class="bWhite"
|
||||||
|
color="white"/>
|
||||||
|
<Button class="activeTab"
|
||||||
|
color="#ffffff"/>
|
||||||
|
<Button class="windowButton"
|
||||||
|
hoverClass="bGrey"
|
||||||
|
pressClass="bWhite"
|
||||||
|
selectClass="bWhite"
|
||||||
|
color="#888888"
|
||||||
|
font="font_teutonic-arkham"/>
|
||||||
|
</Defaults>
|
||||||
|
|
||||||
<!-- Basic UI that will be replaced based on title -->
|
<!-- window to select downloadable content -->
|
||||||
<VerticalLayout id="load_ui"
|
<VerticalLayout id="downloadWindow"
|
||||||
visibility="Admin"
|
visibility="Admin"
|
||||||
color="black"
|
color="black"
|
||||||
active="false"
|
active="false"
|
||||||
width="700"
|
height="800"
|
||||||
height="780"
|
width="900"
|
||||||
outlineSize="1 1"
|
outlineSize="2 2"
|
||||||
outline="#303030">
|
outline="#303030">
|
||||||
<HorizontalLayout class="headerLayout">
|
|
||||||
<Button class="headerButton"
|
<!-- window header -->
|
||||||
icon="refresh"
|
<Panel preferredHeight="60"
|
||||||
tooltip="Refresh List"
|
padding="10 10 5 5"
|
||||||
tooltipPosition="Right"
|
spacing="10"
|
||||||
onClick="onClick_refreshList"/>
|
outlineSize="2 2"
|
||||||
<Text id="title"
|
outline="#303030"
|
||||||
class="headerText">Loadable Items</Text>
|
color="black">
|
||||||
<Button class="headerButton"
|
<Text fontSize="32"
|
||||||
|
font="font_teutonic-arkham"
|
||||||
|
preferredWidth="600"
|
||||||
|
alignment="MiddleLeft">Downloadable Content</Text>
|
||||||
|
<Button id="downloadAll_button"
|
||||||
|
class="windowButton"
|
||||||
|
visibility="Black"
|
||||||
|
onClick="onClick_downloadAll"
|
||||||
|
height="30"
|
||||||
|
preferredWidth="110"
|
||||||
|
fontSize="20"
|
||||||
|
tooltip="Very rough estimate: 400 MB"
|
||||||
|
tooltipPosition="Above"
|
||||||
|
tooltipBackgroundColor="rgba(0,0,0,1)">Download Everything</Button>
|
||||||
|
<Button id="spawnPlaceholder_button"
|
||||||
|
class="windowButton"
|
||||||
|
visibility="Black"
|
||||||
|
onClick="onClick_spawnPlaceholder"
|
||||||
|
height="30"
|
||||||
|
preferredWidth="110"
|
||||||
|
fontSize="20">Spawn Placeholder</Button>
|
||||||
|
<Panel preferredWidth="50">
|
||||||
|
<Button rectAlignment="MiddleRight"
|
||||||
|
width="50"
|
||||||
|
color="clear"
|
||||||
icon="close"
|
icon="close"
|
||||||
tooltip="Close"
|
tooltip="Close"
|
||||||
onClick="onClick_toggleUi(Hidden)"/>
|
tooltipPosition="Right"
|
||||||
|
tooltipBackgroundColor="rgba(0,0,0,1)"
|
||||||
|
onClick="onClick_toggleUi(downloadWindow)"/>
|
||||||
|
</Panel>
|
||||||
|
</Panel>
|
||||||
|
|
||||||
|
<HorizontalLayout>
|
||||||
|
<VerticalLayout preferredWidth="600">
|
||||||
|
<!-- tab selection -->
|
||||||
|
<HorizontalLayout preferredHeight="60"
|
||||||
|
padding="5"
|
||||||
|
spacing="5">
|
||||||
|
<Button class="downloadTab activeTab"
|
||||||
|
id="tab1">Official Campaigns</Button>
|
||||||
|
<Button class="downloadTab"
|
||||||
|
id="tab2">Official Scenarios</Button>
|
||||||
|
<Button class="downloadTab"
|
||||||
|
id="tab3">Fan-Made Campaigns</Button>
|
||||||
|
<Button class="downloadTab"
|
||||||
|
id="tab4">Fan-Made Scenarios</Button>
|
||||||
|
<Button class="downloadTab"
|
||||||
|
id="tab5">Fan-Made Player Cards</Button>
|
||||||
</HorizontalLayout>
|
</HorizontalLayout>
|
||||||
|
|
||||||
|
<!-- content list -->
|
||||||
<VerticalScrollView color="transparent"
|
<VerticalScrollView color="transparent"
|
||||||
minHeight="100"
|
minHeight="100"
|
||||||
flexibleHeight="100">
|
flexibleHeight="100"
|
||||||
<Panel id="ui_update_height"
|
scrollSensitivity="27"
|
||||||
height="24">
|
scrollbarColors="grey|grey|#C8C8C8|rgba(0.78,0.78,0.78,0.5)"
|
||||||
<VerticalLayout id="ui_update_point"
|
horizontalScrollbarVisibility="AutohideAndExpandViewport"
|
||||||
padding="10">
|
raycastTarget="true">
|
||||||
<Text>Please refresh to see available items.</Text>
|
<VerticalLayout id="contentList"
|
||||||
|
padding="10 25 0 0">
|
||||||
|
<!-- this will be filled via scripting -->
|
||||||
</VerticalLayout>
|
</VerticalLayout>
|
||||||
</Panel>
|
|
||||||
</VerticalScrollView>
|
</VerticalScrollView>
|
||||||
<Panel color="rgb(0,0,0)"
|
|
||||||
minHeight="50"
|
|
||||||
preferredHeight="50"
|
|
||||||
flexibleHeight="0">
|
|
||||||
<Button id="load_button"
|
|
||||||
active="false"
|
|
||||||
onClick="onClick_load">Load:</Button>
|
|
||||||
<HorizontalLayout id="progress_display">
|
|
||||||
<ProgressBar id="download_progress"
|
|
||||||
percentage="0"
|
|
||||||
color="#000000"
|
|
||||||
fillImageColor="#333333"/>
|
|
||||||
<Button onClick="onClick_cancel"
|
|
||||||
active="false">Cancel</Button>
|
|
||||||
</HorizontalLayout>
|
|
||||||
</Panel>
|
|
||||||
</VerticalLayout>
|
</VerticalLayout>
|
||||||
|
|
||||||
<!-- include TitleSplash.xml -->
|
<!-- content preview window -->
|
||||||
|
<VerticalLayout preferredWidth="300"
|
||||||
|
padding="15 15 15 5">
|
||||||
|
|
||||||
|
<!-- header -->
|
||||||
|
<VerticalLayout preferredHeight="110">
|
||||||
|
<Text id="previewTitle"
|
||||||
|
fontSize="28"
|
||||||
|
preferredHeight="70"
|
||||||
|
font="font_teutonic-arkham">PreviewTitle</Text>
|
||||||
|
<Text id="previewAuthor"
|
||||||
|
fontSize="20"
|
||||||
|
preferredHeight="40"
|
||||||
|
font="font_teutonic-arkham">by PreviewAuthor</Text>
|
||||||
|
</VerticalLayout>
|
||||||
|
|
||||||
|
<!-- box art -->
|
||||||
|
<Panel id="previewArtPanel"
|
||||||
|
preferredHeight="390">
|
||||||
|
<Mask id="previewArtMask">
|
||||||
|
<!-- image will be set via scripting -->
|
||||||
|
<Image id="previewArtImage" />
|
||||||
|
</Mask>
|
||||||
|
</Panel>
|
||||||
|
|
||||||
|
<!-- description -->
|
||||||
|
<Panel preferredHeight="160">
|
||||||
|
<Text id="previewDescription"
|
||||||
|
alignment="UpperLeft"
|
||||||
|
resizeTextForBestFit="true"
|
||||||
|
resizeTextMinSize="12"
|
||||||
|
resizeTextMaxSize="18">PreviewDescription</Text>
|
||||||
|
</Panel>
|
||||||
|
|
||||||
|
<!-- download button / progress bar (visibility handled by lua code)-->
|
||||||
|
<Panel preferredHeight="60">
|
||||||
|
<!-- download button -->
|
||||||
|
<Button id="download_button"
|
||||||
|
class="windowButton"
|
||||||
|
onClick="onClick_download"
|
||||||
|
height="50"
|
||||||
|
width="270"
|
||||||
|
fontSize="28">Download</Button>
|
||||||
|
<!-- download progress bar -->
|
||||||
|
<ProgressBar id="download_progress"
|
||||||
|
active="false"
|
||||||
|
height="50"
|
||||||
|
width="270"
|
||||||
|
percentage="0"
|
||||||
|
color="#111111"
|
||||||
|
textColor="#aaaaaa"
|
||||||
|
fillImageColor="#333333"/>
|
||||||
|
</Panel>
|
||||||
|
</VerticalLayout>
|
||||||
|
</HorizontalLayout>
|
||||||
|
</VerticalLayout>
|
||||||
|
<!-- include Global/DownloadWindow.xml -->
|
||||||
|
<!-- include Global/PlayareaGallery.xml -->
|
||||||
|
<Defaults>
|
||||||
|
<!-- type selection at the top -->
|
||||||
|
<Button class="imageTab"
|
||||||
|
hoverClass="bGrey"
|
||||||
|
pressClass="bWhite"
|
||||||
|
onClick="b7b45b/onClick_imageTab"
|
||||||
|
color="#888888"
|
||||||
|
fontSize="24"
|
||||||
|
font="font_teutonic-arkham"/>
|
||||||
|
<Button class="bGrey"
|
||||||
|
color="grey"/>
|
||||||
|
<Button class="bWhite"
|
||||||
|
color="white"/>
|
||||||
|
|
||||||
|
<!-- image boxes in the grid -->
|
||||||
|
<VerticalLayout class="imageBox"
|
||||||
|
color="black"
|
||||||
|
outline="#303030"
|
||||||
|
outlineSize="2 2"
|
||||||
|
onClick="b7b45b/onClick_image"/>
|
||||||
|
<Image class="playareaImage"
|
||||||
|
preferredHeight="330"/>
|
||||||
|
<Text class="imageName"
|
||||||
|
preferredHeight="40"
|
||||||
|
resizeTextForBestFit="true"
|
||||||
|
resizeTextMinSize="10"
|
||||||
|
resizeTextMaxSize="18"/>
|
||||||
|
|
||||||
|
<!-- item selection on the left -->
|
||||||
|
<Text class="itemText"
|
||||||
|
alignment="MiddleLeft"/>
|
||||||
|
<Panel class="itemPanel"
|
||||||
|
preferredHeight="45"
|
||||||
|
onClick="b7b45b/onClick_listItem"/>
|
||||||
|
|
||||||
|
<!-- other -->
|
||||||
|
<Text class="headerText"
|
||||||
|
fontSize="35"/>
|
||||||
|
<VerticalLayout childForceExpandHeight="false"/>
|
||||||
|
</Defaults>
|
||||||
|
|
||||||
|
<VerticalLayout id="playareaGallery"
|
||||||
|
active="false"
|
||||||
|
color="black"
|
||||||
|
height="880"
|
||||||
|
width="900"
|
||||||
|
outlineSize="2 2"
|
||||||
|
outline="#303030">
|
||||||
|
|
||||||
|
<!-- window header -->
|
||||||
|
<Panel preferredHeight="60"
|
||||||
|
padding="10 10 5 5"
|
||||||
|
spacing="10"
|
||||||
|
outlineSize="2 2"
|
||||||
|
outline="#303030"
|
||||||
|
color="black">
|
||||||
|
<Text fontSize="32"
|
||||||
|
font="font_teutonic-arkham"
|
||||||
|
preferredWidth="600"
|
||||||
|
alignment="MiddleLeft">Playarea Image Gallery</Text>
|
||||||
|
<Panel preferredWidth="50">
|
||||||
|
<Button rectAlignment="MiddleRight"
|
||||||
|
width="50"
|
||||||
|
color="clear"
|
||||||
|
icon="close"
|
||||||
|
tooltip="Close"
|
||||||
|
tooltipPosition="Right"
|
||||||
|
tooltipBackgroundColor="rgba(0,0,0,1)"
|
||||||
|
onClick="onClick_toggleUi(playareaGallery)"/>
|
||||||
|
</Panel>
|
||||||
|
</Panel>
|
||||||
|
|
||||||
|
<!-- tab selection -->
|
||||||
|
<HorizontalLayout preferredHeight="60"
|
||||||
|
padding="5"
|
||||||
|
spacing="5">
|
||||||
|
<Button class="imageTab"
|
||||||
|
id="imageTab1">Official Campaigns</Button>
|
||||||
|
<Button class="imageTab"
|
||||||
|
id="imageTab2">Official Scenarios</Button>
|
||||||
|
<Button class="imageTab"
|
||||||
|
id="imageTab3">Fan-Made Campaigns</Button>
|
||||||
|
<Button class="imageTab"
|
||||||
|
id="imageTab4">Fan-Made Scenarios</Button>
|
||||||
|
<Button class="imageTab"
|
||||||
|
id="imageTab5">Other Images</Button>
|
||||||
|
</HorizontalLayout>
|
||||||
|
|
||||||
|
<HorizontalLayout preferredHeight="760">
|
||||||
|
<!-- left column: navigation bar -->
|
||||||
|
<VerticalLayout id="itemSelection"
|
||||||
|
preferredWidth="180"
|
||||||
|
padding="10 15 0 0">
|
||||||
|
<!-- this will be filled via scripting -->
|
||||||
|
<!-- <Panel class="itemPanel">
|
||||||
|
<Text class="itemText">Item</Text>
|
||||||
|
</Panel> -->
|
||||||
|
</VerticalLayout>
|
||||||
|
|
||||||
|
<!-- right column: image gallery -->
|
||||||
|
<VerticalScrollView color="transparent"
|
||||||
|
minHeight="100"
|
||||||
|
flexibleHeight="100"
|
||||||
|
preferredWidth="720"
|
||||||
|
scrollSensitivity="380"
|
||||||
|
scrollbarColors="grey|grey|#C8C8C8|rgba(0.78,0.78,0.78,0.5)"
|
||||||
|
horizontalScrollbarVisibility="AutohideAndExpandViewport"
|
||||||
|
raycastTarget="true">
|
||||||
|
<GridLayout id="playareaList"
|
||||||
|
preferredWidth="700"
|
||||||
|
padding="25 25 5 5"
|
||||||
|
spacing="10"
|
||||||
|
cellSize="330 370">
|
||||||
|
<!-- this will be filled via scripting -->
|
||||||
|
<!-- <VerticalLayout class="imageBox">
|
||||||
|
<Image class="playareaImage" image=""/>
|
||||||
|
<Text class="imageName">Image Name</Text>
|
||||||
|
</VerticalLayout> -->
|
||||||
|
</GridLayout>
|
||||||
|
</VerticalScrollView>
|
||||||
|
</HorizontalLayout>
|
||||||
|
</VerticalLayout>
|
||||||
|
<!-- include Global/PlayareaGallery.xml -->
|
||||||
|
<!-- include Global/TitleSplash.xml -->
|
||||||
<!-- Title Splash when starting a scenario -->
|
<!-- Title Splash when starting a scenario -->
|
||||||
<Panel id="title_splash"
|
<Panel id="title_splash"
|
||||||
height="220"
|
height="220"
|
||||||
@ -136,8 +359,8 @@
|
|||||||
horizontalOverflow="Overflow">
|
horizontalOverflow="Overflow">
|
||||||
</Text>
|
</Text>
|
||||||
</Panel>
|
</Panel>
|
||||||
<!-- include TitleSplash.xml -->
|
<!-- include Global/TitleSplash.xml -->
|
||||||
<!-- include NavigationOverlay.xml -->
|
<!-- include Global/NavigationOverlay.xml -->
|
||||||
<!-- Default formatting -->
|
<!-- Default formatting -->
|
||||||
<Defaults>
|
<Defaults>
|
||||||
<Text color="#FFFFFF"
|
<Text color="#FFFFFF"
|
||||||
@ -241,7 +464,7 @@
|
|||||||
onValueChanged="797ede/updatePitch"
|
onValueChanged="797ede/updatePitch"
|
||||||
wholeNumbers="true"
|
wholeNumbers="true"
|
||||||
minValue="0"
|
minValue="0"
|
||||||
maxValue="90"
|
maxValue="89"
|
||||||
value="75"
|
value="75"
|
||||||
tooltip="This controls the camera pitch ('nodding your head')."
|
tooltip="This controls the camera pitch ('nodding your head')."
|
||||||
tooltipPosition="Right"/>
|
tooltipPosition="Right"/>
|
||||||
@ -310,8 +533,8 @@
|
|||||||
</Cell>
|
</Cell>
|
||||||
</Row>
|
</Row>
|
||||||
</TableLayout>
|
</TableLayout>
|
||||||
<!-- include NavigationOverlay.xml -->
|
<!-- include Global/NavigationOverlay.xml -->
|
||||||
<!-- include OptionPanel.xml -->
|
<!-- include Global/OptionPanel.xml -->
|
||||||
<!-- Default formatting -->
|
<!-- Default formatting -->
|
||||||
<Defaults>
|
<Defaults>
|
||||||
<Text color="#FFFFFF"
|
<Text color="#FFFFFF"
|
||||||
@ -352,7 +575,9 @@
|
|||||||
|
|
||||||
<!-- options -->
|
<!-- options -->
|
||||||
<Row class="option-text"
|
<Row class="option-text"
|
||||||
preferredHeight="70"/>
|
preferredHeight="50"
|
||||||
|
tooltipPosition="Left"
|
||||||
|
tooltipBackgroundColor="rgba(0,0,0,1)"/>
|
||||||
<Cell class="option-text"
|
<Cell class="option-text"
|
||||||
color="#333333"
|
color="#333333"
|
||||||
columnSpan="2"/>
|
columnSpan="2"/>
|
||||||
@ -364,14 +589,13 @@
|
|||||||
<Cell class="option-dropdown"
|
<Cell class="option-dropdown"
|
||||||
color="#333333"
|
color="#333333"
|
||||||
columnSpan="2"/>
|
columnSpan="2"/>
|
||||||
<VerticalLayout class="text-column"
|
<Panel class="option-wrapper"
|
||||||
padding="10 0 0 0"
|
padding="10 0 0 0"/>
|
||||||
spacing="5"/>
|
|
||||||
<Text class="option-header"
|
<Text class="option-header"
|
||||||
fontSize="20"
|
fontSize="22"
|
||||||
font="font_teutonic-arkham"/>
|
font="font_teutonic-arkham"/>
|
||||||
<Text class="description"
|
<Panel class="dropdown-wrapper"
|
||||||
fontSize="12"/>
|
padding="0 17 3 3"/>
|
||||||
|
|
||||||
<!-- buttons at the bottom -->
|
<!-- buttons at the bottom -->
|
||||||
<Button class="bottomButtons"
|
<Button class="bottomButtons"
|
||||||
@ -393,9 +617,10 @@
|
|||||||
<!-- Option Panel -->
|
<!-- Option Panel -->
|
||||||
<TableLayout id="optionPanel"
|
<TableLayout id="optionPanel"
|
||||||
class="window"
|
class="window"
|
||||||
active="false"
|
visibility="Admin"
|
||||||
rectAlignment="LowerRight"
|
rectAlignment="LowerRight"
|
||||||
offsetXY="-50 80">
|
offsetXY="-50 80"
|
||||||
|
raycastTarget="true">
|
||||||
<!-- Header: Options -->
|
<!-- Header: Options -->
|
||||||
<Row preferredHeight="60">
|
<Row preferredHeight="60">
|
||||||
<Cell>
|
<Cell>
|
||||||
@ -409,10 +634,12 @@
|
|||||||
<!-- Scrollable part with options -->
|
<!-- Scrollable part with options -->
|
||||||
<Row>
|
<Row>
|
||||||
<Cell>
|
<Cell>
|
||||||
<VerticalScrollView horizontalScrollbarVisibility="AutohideAndExpandViewport">
|
<VerticalScrollView horizontalScrollbarVisibility="AutohideAndExpandViewport"
|
||||||
|
scrollSensitivity="30"
|
||||||
|
raycastTarget="true">
|
||||||
<TableLayout columnWidths="0 100 75"
|
<TableLayout columnWidths="0 100 75"
|
||||||
autoCalculateHeight="1"
|
autoCalculateHeight="1"
|
||||||
cellPadding="10 5 5 5">
|
cellPadding="10 10 5 5">
|
||||||
|
|
||||||
<!-- Group: general settings -->
|
<!-- Group: general settings -->
|
||||||
<Row class="group-header">
|
<Row class="group-header">
|
||||||
@ -425,17 +652,16 @@
|
|||||||
</Row>
|
</Row>
|
||||||
|
|
||||||
<!-- Option: card language -->
|
<!-- Option: card language -->
|
||||||
<Row class="option-text">
|
<!-- disabled until we have the backend in place
|
||||||
|
<Row class="option-text" tooltip="Downloading a campaign or importing a deck will use
this language for cards (NOT FUNCTIONAL YET!).">
|
||||||
<Cell class="option-dropdowntext">
|
<Cell class="option-dropdowntext">
|
||||||
<VerticalLayout class="text-column">
|
<Panel class="option-wrapper">
|
||||||
<Text class="option-header">Card language</Text>
|
<Text class="option-header">Card language</Text>
|
||||||
<Text class="description">Downloading a campaign or importing a deck will use this language for cards (NOT FUNCTIONAL YET!).</Text>
|
</Panel>
|
||||||
</VerticalLayout>
|
|
||||||
</Cell>
|
</Cell>
|
||||||
<Cell class="option-dropdown">
|
<Cell class="option-dropdown">
|
||||||
<Panel padding="0 17 13 13">
|
<Panel class="dropdown-wrapper">
|
||||||
<Dropdown id="cardLanguage"
|
<Dropdown id="cardLanguage" onValueChanged="languageSelected(selectedIndex)">
|
||||||
onValueChanged="languageSelected(selectedIndex)">
|
|
||||||
<Option>简体中文</Option>
|
<Option>简体中文</Option>
|
||||||
<Option>繁體中文</Option>
|
<Option>繁體中文</Option>
|
||||||
<Option>Deutsch</Option>
|
<Option>Deutsch</Option>
|
||||||
@ -446,15 +672,15 @@
|
|||||||
</Dropdown>
|
</Dropdown>
|
||||||
</Panel>
|
</Panel>
|
||||||
</Cell>
|
</Cell>
|
||||||
</Row>
|
</Row> -->
|
||||||
|
|
||||||
<!-- Option: play area snap tags -->
|
<!-- Option: play area snap tags -->
|
||||||
<Row class="option-text">
|
<Row class="option-text"
|
||||||
|
tooltip="Only cards with the tag 'Location' will snap (official cards are supported by default).
Disable this if you are having issues with custom content.">
|
||||||
<Cell class="option-text">
|
<Cell class="option-text">
|
||||||
<VerticalLayout class="text-column">
|
<Panel class="option-wrapper">
|
||||||
<Text class="option-header">Enable snap tags for play area</Text>
|
<Text class="option-header">Enable snap tags for play area</Text>
|
||||||
<Text class="description">Only cards with the tag "Location" will snap (official cards are supported by default). Disable this if you are having issues with custom content.</Text>
|
</Panel>
|
||||||
</VerticalLayout>
|
|
||||||
</Cell>
|
</Cell>
|
||||||
<Cell class="option-button">
|
<Cell class="option-button">
|
||||||
<Toggle id="playAreaSnapTags"
|
<Toggle id="playAreaSnapTags"
|
||||||
@ -463,12 +689,12 @@
|
|||||||
</Row>
|
</Row>
|
||||||
|
|
||||||
<!-- Option: splash scenario name on setup -->
|
<!-- Option: splash scenario name on setup -->
|
||||||
<Row class="option-text">
|
<Row class="option-text"
|
||||||
|
tooltip="Fade in the name of the scenario for 2 seconds
when placing down a scenario.">
|
||||||
<Cell class="option-text">
|
<Cell class="option-text">
|
||||||
<VerticalLayout class="text-column">
|
<Panel class="option-wrapper">
|
||||||
<Text class="option-header">Show scenario title on setup</Text>
|
<Text class="option-header">Show scenario title on setup</Text>
|
||||||
<Text class="description">Fade in the name of the scenario for 2 seconds when placing down a scenario.</Text>
|
</Panel>
|
||||||
</VerticalLayout>
|
|
||||||
</Cell>
|
</Cell>
|
||||||
<Cell class="option-button">
|
<Cell class="option-button">
|
||||||
<Toggle id="showTitleSplash"
|
<Toggle id="showTitleSplash"
|
||||||
@ -487,12 +713,12 @@
|
|||||||
</Row>
|
</Row>
|
||||||
|
|
||||||
<!-- Option: enable snap tags -->
|
<!-- Option: enable snap tags -->
|
||||||
<Row class="option-text">
|
<Row class="option-text"
|
||||||
|
tooltip="Only cards with the tag 'Asset' will snap (official cards are supported by default).
Disable this if you are having issues with custom content.">
|
||||||
<Cell class="option-text">
|
<Cell class="option-text">
|
||||||
<VerticalLayout class="text-column">
|
<Panel class="option-wrapper">
|
||||||
<Text class="option-header">Enable snap tags</Text>
|
<Text class="option-header">Enable snap tags</Text>
|
||||||
<Text class="description">Only cards with the tag "Asset" will snap (official cards are supported by default). Disable this if you are having issues with custom content.</Text>
|
</Panel>
|
||||||
</VerticalLayout>
|
|
||||||
</Cell>
|
</Cell>
|
||||||
<Cell class="option-button">
|
<Cell class="option-button">
|
||||||
<Toggle id="useSnapTags"
|
<Toggle id="useSnapTags"
|
||||||
@ -501,12 +727,12 @@
|
|||||||
</Row>
|
</Row>
|
||||||
|
|
||||||
<!-- Option: show draw 1 button -->
|
<!-- Option: show draw 1 button -->
|
||||||
<Row class="option-text">
|
<Row class="option-text"
|
||||||
|
tooltip="Displays a button below the 'Upkeep' button that draws a card from your deck.
Useful for multi-handed solo play.">
|
||||||
<Cell class="option-text">
|
<Cell class="option-text">
|
||||||
<VerticalLayout class="text-column">
|
<Panel class="option-wrapper">
|
||||||
<Text class="option-header">Show "Draw 1" button</Text>
|
<Text class="option-header">Show "Draw 1" button</Text>
|
||||||
<Text class="description">Displays a button below the "Upkeep" button that draws a card from your deck. Useful for multi-handed solo play.</Text>
|
</Panel>
|
||||||
</VerticalLayout>
|
|
||||||
</Cell>
|
</Cell>
|
||||||
<Cell class="option-button">
|
<Cell class="option-button">
|
||||||
<Toggle id="showDrawButton"
|
<Toggle id="showDrawButton"
|
||||||
@ -515,12 +741,12 @@
|
|||||||
</Row>
|
</Row>
|
||||||
|
|
||||||
<!-- Option: use clickable clue-counters -->
|
<!-- Option: use clickable clue-counters -->
|
||||||
<Row class="option-text">
|
<Row class="option-text"
|
||||||
|
tooltip="Instead of automatically counting clues in the respective area on your playermat,
this displays a clickable counter for clues.">
|
||||||
<Cell class="option-text">
|
<Cell class="option-text">
|
||||||
<VerticalLayout class="text-column">
|
<Panel class="option-wrapper">
|
||||||
<Text class="option-header">Use clickable clue counters</Text>
|
<Text class="option-header">Use clickable clue counters</Text>
|
||||||
<Text class="description">Instead of automatically counting clues in the respective area on your playermat, this displays a clickable counter for clues.</Text>
|
</Panel>
|
||||||
</VerticalLayout>
|
|
||||||
</Cell>
|
</Cell>
|
||||||
<Cell class="option-button">
|
<Cell class="option-button">
|
||||||
<Toggle id="useClueClickers"
|
<Toggle id="useClueClickers"
|
||||||
@ -529,15 +755,15 @@
|
|||||||
</Row>
|
</Row>
|
||||||
|
|
||||||
<!-- Option: use clickable resource counters -->
|
<!-- Option: use clickable resource counters -->
|
||||||
<Row class="option-text">
|
<Row class="option-text"
|
||||||
|
tooltip="This enables spawning of clickable resource tokens for player cards.
(Chef's Selection = assets with 0 uses)">
|
||||||
<Cell class="option-dropdowntext">
|
<Cell class="option-dropdowntext">
|
||||||
<VerticalLayout class="text-column">
|
<Panel class="option-wrapper">
|
||||||
<Text class="option-header">Use clickable resource tokens</Text>
|
<Text class="option-header">Use clickable resource tokens</Text>
|
||||||
<Text class="description">This enables spawning of clickable resource tokens for player cards. (Chef's Selection = assets with 0 uses)</Text>
|
</Panel>
|
||||||
</VerticalLayout>
|
|
||||||
</Cell>
|
</Cell>
|
||||||
<Cell class="option-dropdown">
|
<Cell class="option-dropdown">
|
||||||
<Panel padding="0 17 13 13">
|
<Panel class="dropdown-wrapper">
|
||||||
<Dropdown id="useResourceCounters"
|
<Dropdown id="useResourceCounters"
|
||||||
onValueChanged="resourceCounterSelected(selectedIndex)">
|
onValueChanged="resourceCounterSelected(selectedIndex)">
|
||||||
<Option>Enabled</Option>
|
<Option>Enabled</Option>
|
||||||
@ -559,12 +785,12 @@
|
|||||||
</Row>
|
</Row>
|
||||||
|
|
||||||
<!-- Option: show attachment helper -->
|
<!-- Option: show attachment helper -->
|
||||||
<Row class="option-text">
|
<Row class="option-text"
|
||||||
|
tooltip="Provides a card-sized bag for cards that are attached to other cards
(e.g. Backpack).">
|
||||||
<Cell class="option-text">
|
<Cell class="option-text">
|
||||||
<VerticalLayout class="text-column">
|
<Panel class="option-wrapper">
|
||||||
<Text class="option-header">Attachment Helper</Text>
|
<Text class="option-header">Attachment Helper</Text>
|
||||||
<Text class="description">Provides a card-sized bag for cards that are attached to other cards (e.g. Backpack).</Text>
|
</Panel>
|
||||||
</VerticalLayout>
|
|
||||||
</Cell>
|
</Cell>
|
||||||
<Cell class="option-button">
|
<Cell class="option-button">
|
||||||
<Toggle id="showAttachmentHelper"
|
<Toggle id="showAttachmentHelper"
|
||||||
@ -573,12 +799,12 @@
|
|||||||
</Row>
|
</Row>
|
||||||
|
|
||||||
<!-- Option: show clean up helper -->
|
<!-- Option: show clean up helper -->
|
||||||
<Row class="option-text">
|
<Row class="option-text"
|
||||||
|
tooltip="Useful for campaign-play:
It resets play areas to allow continuous gameplay in the same savegame.">
|
||||||
<Cell class="option-text">
|
<Cell class="option-text">
|
||||||
<VerticalLayout class="text-column">
|
<Panel class="option-wrapper">
|
||||||
<Text class="option-header">Clean Up Helper</Text>
|
<Text class="option-header">Clean Up Helper</Text>
|
||||||
<Text class="description">Useful for campaign-play: It resets play areas to allow continuous gameplay in the same savegame.</Text>
|
</Panel>
|
||||||
</VerticalLayout>
|
|
||||||
</Cell>
|
</Cell>
|
||||||
<Cell class="option-button">
|
<Cell class="option-button">
|
||||||
<Toggle id="showCleanUpHelper"
|
<Toggle id="showCleanUpHelper"
|
||||||
@ -586,27 +812,13 @@
|
|||||||
</Cell>
|
</Cell>
|
||||||
</Row>
|
</Row>
|
||||||
|
|
||||||
<!-- Option: show custom playmat images -->
|
|
||||||
<Row class="option-text">
|
|
||||||
<Cell class="option-text">
|
|
||||||
<VerticalLayout class="text-column">
|
|
||||||
<Text class="option-header">Custom Playmat Images</Text>
|
|
||||||
<Text class="description">Places a tool that displays custom playmat images for all cycles in a gallery-like fashion.</Text>
|
|
||||||
</VerticalLayout>
|
|
||||||
</Cell>
|
|
||||||
<Cell class="option-button">
|
|
||||||
<Toggle id="showCustomPlaymatImages"
|
|
||||||
onValueChanged="onClick_toggleOption(showCustomPlaymatImages)"/>
|
|
||||||
</Cell>
|
|
||||||
</Row>
|
|
||||||
|
|
||||||
<!-- Option: show CYOA campaign guides -->
|
<!-- Option: show CYOA campaign guides -->
|
||||||
<Row class="option-text">
|
<Row class="option-text"
|
||||||
|
tooltip="Displays in a 'Choose Your Own Adventure'
style redesigned campaign guides.">
|
||||||
<Cell class="option-text">
|
<Cell class="option-text">
|
||||||
<VerticalLayout class="text-column">
|
<Panel class="option-wrapper">
|
||||||
<Text class="option-header">CYOA Campaign Guides</Text>
|
<Text class="option-header">CYOA Campaign Guides</Text>
|
||||||
<Text class="description">Displays in a "Choose Your Own Adventure" style redesigned campaign guides.</Text>
|
</Panel>
|
||||||
</VerticalLayout>
|
|
||||||
</Cell>
|
</Cell>
|
||||||
<Cell class="option-button">
|
<Cell class="option-button">
|
||||||
<Toggle id="showCYOA"
|
<Toggle id="showCYOA"
|
||||||
@ -615,12 +827,12 @@
|
|||||||
</Row>
|
</Row>
|
||||||
|
|
||||||
<!-- Option: show displacement tool -->
|
<!-- Option: show displacement tool -->
|
||||||
<Row class="option-text">
|
<Row class="option-text"
|
||||||
|
tooltip="This allows moving all objects on the main playmat
in a chosen direction.">
|
||||||
<Cell class="option-text">
|
<Cell class="option-text">
|
||||||
<VerticalLayout class="text-column">
|
<Panel class="option-wrapper">
|
||||||
<Text class="option-header">Displacement Tool</Text>
|
<Text class="option-header">Displacement Tool</Text>
|
||||||
<Text class="description">This allows moving all objects on the main playmat in a chosen direction.</Text>
|
</Panel>
|
||||||
</VerticalLayout>
|
|
||||||
</Cell>
|
</Cell>
|
||||||
<Cell class="option-button">
|
<Cell class="option-button">
|
||||||
<Toggle id="showDisplacementTool"
|
<Toggle id="showDisplacementTool"
|
||||||
@ -629,12 +841,12 @@
|
|||||||
</Row>
|
</Row>
|
||||||
|
|
||||||
<!-- Option: show hand helper -->
|
<!-- Option: show hand helper -->
|
||||||
<Row class="option-text">
|
<Row class="option-text"
|
||||||
|
tooltip="Never count your hand cards again! This tool does that for you
and additionally enables easy discarding of random cards.">
|
||||||
<Cell class="option-text">
|
<Cell class="option-text">
|
||||||
<VerticalLayout class="text-column">
|
<Panel class="option-wrapper">
|
||||||
<Text class="option-header">Hand Helper</Text>
|
<Text class="option-header">Hand Helper</Text>
|
||||||
<Text class="description">Never count your hand cards again! This tool does that for you and additionally enables easy discarding of random cards.</Text>
|
</Panel>
|
||||||
</VerticalLayout>
|
|
||||||
</Cell>
|
</Cell>
|
||||||
<Cell class="option-button">
|
<Cell class="option-button">
|
||||||
<Toggle id="showHandHelper"
|
<Toggle id="showHandHelper"
|
||||||
@ -643,12 +855,12 @@
|
|||||||
</Row>
|
</Row>
|
||||||
|
|
||||||
<!-- Option: show search assistant -->
|
<!-- Option: show search assistant -->
|
||||||
<Row class="option-text">
|
<Row class="option-text"
|
||||||
|
tooltip="Quickly search 3, 6, 9 or the top X
cards of your deck!">
|
||||||
<Cell class="option-text">
|
<Cell class="option-text">
|
||||||
<VerticalLayout class="text-column">
|
<Panel class="option-wrapper">
|
||||||
<Text class="option-header">Search Assistant</Text>
|
<Text class="option-header">Search Assistant</Text>
|
||||||
<Text class="description">Quickly search 3, 6, 9 or the top X cards of your deck!</Text>
|
</Panel>
|
||||||
</VerticalLayout>
|
|
||||||
</Cell>
|
</Cell>
|
||||||
<Cell class="option-button">
|
<Cell class="option-button">
|
||||||
<Toggle id="showSearchAssistant"
|
<Toggle id="showSearchAssistant"
|
||||||
@ -670,13 +882,13 @@
|
|||||||
<Button class="bottomButtons"
|
<Button class="bottomButtons"
|
||||||
onClick="onClick_defaultSettings">Load defaults</Button>
|
onClick="onClick_defaultSettings">Load defaults</Button>
|
||||||
<Button class="bottomButtons"
|
<Button class="bottomButtons"
|
||||||
onClick="onClick_toggleUi(Hidden)">Close</Button>
|
onClick="onClick_toggleUi(optionPanel)">Close</Button>
|
||||||
</HorizontalLayout>
|
</HorizontalLayout>
|
||||||
</Cell>
|
</Cell>
|
||||||
</Row>
|
</Row>
|
||||||
</TableLayout>
|
</TableLayout>
|
||||||
<!-- include OptionPanel.xml -->
|
<!-- include Global/OptionPanel.xml -->
|
||||||
<!-- include UpdateNotification.xml -->
|
<!-- include Global/UpdateNotification.xml -->
|
||||||
<!-- Default formatting inherented from OptionPanel! -->
|
<!-- Default formatting inherented from OptionPanel! -->
|
||||||
|
|
||||||
<!-- Icon with Finn, which can be clicked -->
|
<!-- Icon with Finn, which can be clicked -->
|
||||||
@ -689,10 +901,11 @@
|
|||||||
offsetXY="420 -5"
|
offsetXY="420 -5"
|
||||||
height="90"
|
height="90"
|
||||||
width="90"
|
width="90"
|
||||||
onClick="onClick_FinnIcon"
|
onClick="onClick_toggleUi(updateNotification)"
|
||||||
image="FinnIcon"
|
image="FinnIcon"
|
||||||
tooltip="Update notification"
|
tooltip="Update notification"
|
||||||
tooltipBackgroundColor="rgba(0,0,0,0.8)"/>
|
tooltipPosition="Right"
|
||||||
|
tooltipBackgroundColor="rgba(0,0,0,1)"/>
|
||||||
|
|
||||||
<!-- main notification window -->
|
<!-- main notification window -->
|
||||||
<TableLayout id="updateNotification"
|
<TableLayout id="updateNotification"
|
||||||
@ -757,5 +970,5 @@
|
|||||||
</Cell>
|
</Cell>
|
||||||
</Row>
|
</Row>
|
||||||
</TableLayout>
|
</TableLayout>
|
||||||
<!-- include UpdateNotification.xml -->
|
<!-- include Global/UpdateNotification.xml -->
|
||||||
<!-- include Global.xml -->
|
<!-- include Global/Global.xml -->
|
@ -1,30 +1,44 @@
|
|||||||
CameraStates:
|
CameraStates:
|
||||||
- AbsolutePosition:
|
- AbsolutePosition:
|
||||||
x: -67.59604
|
x: -67.6
|
||||||
y: 91.87675
|
y: 91.88
|
||||||
z: 5.521103
|
z: 5.52
|
||||||
Distance: 104.699272
|
Distance: 104
|
||||||
Position:
|
Position:
|
||||||
x: -22.2649822
|
x: -22.26
|
||||||
y: -2.5
|
y: -2.5
|
||||||
z: 5.25747156
|
z: 5.26
|
||||||
Rotation:
|
Rotation:
|
||||||
x: 64.34372
|
x: 64.34
|
||||||
y: 90.3332
|
y: 90.33
|
||||||
z: 0
|
z: 0
|
||||||
Zoomed: false
|
Zoomed: false
|
||||||
- AbsolutePosition:
|
- AbsolutePosition:
|
||||||
x: -47.7179832
|
x: -39.1
|
||||||
y: 86.18371
|
y: 29.7
|
||||||
z: -6.780735e-06
|
z: 0
|
||||||
Distance: 97.85165
|
Distance: 29.14
|
||||||
Position:
|
Position:
|
||||||
x: -6.36408234
|
x: -31.54
|
||||||
y: -2.5
|
y: 1.55
|
||||||
z: -9.483223e-07
|
z: 0
|
||||||
Rotation:
|
Rotation:
|
||||||
x: 64.99999
|
x: 75
|
||||||
y: 89.99999
|
y: 90
|
||||||
|
z: 0
|
||||||
|
Zoomed: false
|
||||||
|
- AbsolutePosition:
|
||||||
|
x: -10.16
|
||||||
|
y: 18.95
|
||||||
|
z: 0
|
||||||
|
Distance: 18
|
||||||
|
Position:
|
||||||
|
x: -5.5
|
||||||
|
y: 1.55
|
||||||
|
z: 0
|
||||||
|
Rotation:
|
||||||
|
x: 75
|
||||||
|
y: 90
|
||||||
z: 0
|
z: 0
|
||||||
Zoomed: false
|
Zoomed: false
|
||||||
ComponentTags:
|
ComponentTags:
|
||||||
@ -35,8 +49,6 @@ ComponentTags:
|
|||||||
normalized: allcardshotfix
|
normalized: allcardshotfix
|
||||||
- displayed: LinkedPhaseTracker
|
- displayed: LinkedPhaseTracker
|
||||||
normalized: linkedphasetracker
|
normalized: linkedphasetracker
|
||||||
- displayed: chaosBag
|
|
||||||
normalized: chaosBag
|
|
||||||
- displayed: displacement_excluded
|
- displayed: displacement_excluded
|
||||||
normalized: displacement_excluded
|
normalized: displacement_excluded
|
||||||
- displayed: PlayerCard
|
- displayed: PlayerCard
|
||||||
@ -59,20 +71,14 @@ ComponentTags:
|
|||||||
normalized: investigator
|
normalized: investigator
|
||||||
- displayed: chaosBag
|
- displayed: chaosBag
|
||||||
normalized: chaosbag
|
normalized: chaosbag
|
||||||
- displayed: arkham_setup_memory_object
|
|
||||||
normalized: arkham_setup_memory_object
|
|
||||||
- displayed: ActionToken
|
- displayed: ActionToken
|
||||||
normalized: actiontoken
|
normalized: actiontoken
|
||||||
- displayed: LargeBox
|
- displayed: LargeBox
|
||||||
normalized: largebox
|
normalized: largebox
|
||||||
- displayed: SoundCube
|
|
||||||
normalized: soundcube
|
|
||||||
- displayed: CampaignBox
|
- displayed: CampaignBox
|
||||||
normalized: campaignbox
|
normalized: campaignbox
|
||||||
- displayed: CameraZoom_ignore
|
- displayed: CameraZoom_ignore
|
||||||
normalized: camerazoom_ignore
|
normalized: camerazoom_ignore
|
||||||
- displayed: TokenArranger
|
|
||||||
normalized: tokenarranger
|
|
||||||
CustomUIAssets:
|
CustomUIAssets:
|
||||||
- Name: refresh
|
- Name: refresh
|
||||||
Type: 0
|
Type: 0
|
||||||
@ -206,7 +212,16 @@ CustomUIAssets:
|
|||||||
- Name: FinnIcon
|
- Name: FinnIcon
|
||||||
Type: 0
|
Type: 0
|
||||||
URL: http://cloud-3.steamusercontent.com/ugc/2037357792052848566/5DA900C430E97D3DFF2C9B8A3DB1CB2271791FC7/
|
URL: http://cloud-3.steamusercontent.com/ugc/2037357792052848566/5DA900C430E97D3DFF2C9B8A3DB1CB2271791FC7/
|
||||||
Date: Mon Oct 9 14:03:26 CDT 2023
|
- Name: box-cover-mask-small
|
||||||
|
Type: 0
|
||||||
|
URL: http://cloud-3.steamusercontent.com/ugc/2115061298536631564/F29C2ED9DD8431A1D1E21C7FFAFF1FFBC0AF0BF3/
|
||||||
|
- Name: box-cover-mask-big
|
||||||
|
Type: 0
|
||||||
|
URL: http://cloud-3.steamusercontent.com/ugc/2115061298536631429/D075D2EECE6EE091AD3BEA5800DEF9C7B02B745B/
|
||||||
|
- Name: box-cover-mask-wide
|
||||||
|
Type: 0
|
||||||
|
URL: http://cloud-3.steamusercontent.com/ugc/2115061298538827369/A20C2ECB8ECDC1B0AD8B2B38F68CA1C1F5E07D37/
|
||||||
|
Date: Sat Nov 18 18:06:45 CST 2023
|
||||||
DecalPallet:
|
DecalPallet:
|
||||||
- ImageURL: http://cloud-3.steamusercontent.com/ugc/1474319121424323663/BC5570ECF747F1B30224461B576E8B0FE7FA5F33/
|
- ImageURL: http://cloud-3.steamusercontent.com/ugc/1474319121424323663/BC5570ECF747F1B30224461B576E8B0FE7FA5F33/
|
||||||
Name: Achivement Checkmark
|
Name: Achivement Checkmark
|
||||||
@ -215,7 +230,7 @@ DecalPallet:
|
|||||||
Name: Victory Display
|
Name: Victory Display
|
||||||
Size: 15
|
Size: 15
|
||||||
Decals: []
|
Decals: []
|
||||||
EpochTime: 1696878206
|
EpochTime: 1700352405
|
||||||
GameComplexity: ''
|
GameComplexity: ''
|
||||||
GameMode: Arkham Horror LCG - Super Complete Edition
|
GameMode: Arkham Horror LCG - Super Complete Edition
|
||||||
GameType: ''
|
GameType: ''
|
||||||
@ -266,7 +281,7 @@ Lighting:
|
|||||||
LutIndex: 0
|
LutIndex: 0
|
||||||
ReflectionIntensity: 1
|
ReflectionIntensity: 1
|
||||||
LuaScript: !include 'unpacked.ttslua'
|
LuaScript: !include 'unpacked.ttslua'
|
||||||
LuaScriptState: '{"acknowledgedUpgradeVersions":[],"optionPanel":{"cardLanguage":"en","playAreaSnapTags":true,"showAttachmentHelper":false,"showCleanUpHelper":false,"showCustomPlaymatImages":false,"showCYOA":false,"showDisplacementTool":false,"showDrawButton":false,"showHandHelper":[],"showSearchAssistant":[],"showTitleSplash":true,"useClueClickers":false,"useResourceCounters":"disabled","useSnapTags":true}}'
|
LuaScriptState: '{"acknowledgedUpgradeVersions":[],"optionPanel":{"cardLanguage":"en","playAreaSnapTags":true,"showAttachmentHelper":false,"showCleanUpHelper":false,"showCYOA":false,"showDisplacementTool":false,"showDrawButton":false,"showHandHelper":[],"showSearchAssistant":[],"showTitleSplash":true,"useClueClickers":false,"useResourceCounters":"disabled","useSnapTags":true}}'
|
||||||
MusicPlayer:
|
MusicPlayer:
|
||||||
AudioLibrary:
|
AudioLibrary:
|
||||||
- Item1: http://cloud-3.steamusercontent.com/ugc/784110538847453001/4481D1CC5684FCF04AB143954DEFE09E94BF5CEB/
|
- Item1: http://cloud-3.steamusercontent.com/ugc/784110538847453001/4481D1CC5684FCF04AB143954DEFE09E94BF5CEB/
|
||||||
@ -323,6 +338,7 @@ MusicPlayer:
|
|||||||
RepeatSong: false
|
RepeatSong: false
|
||||||
Note: ''
|
Note: ''
|
||||||
ObjectStates:
|
ObjectStates:
|
||||||
|
- !include 'unpacked/go_game_piece_white GUID Reference Handler 123456.yaml'
|
||||||
- !include 'unpacked/HandTrigger 5fe087.yaml'
|
- !include 'unpacked/HandTrigger 5fe087.yaml'
|
||||||
- !include 'unpacked/HandTrigger be2f17.yaml'
|
- !include 'unpacked/HandTrigger be2f17.yaml'
|
||||||
- !include 'unpacked/HandTrigger 0285cc.yaml'
|
- !include 'unpacked/HandTrigger 0285cc.yaml'
|
||||||
@ -405,12 +421,11 @@ ObjectStates:
|
|||||||
- !include 'unpacked/Custom_Model Clue Counter d86b7c.yaml'
|
- !include 'unpacked/Custom_Model Clue Counter d86b7c.yaml'
|
||||||
- !include 'unpacked/Custom_Token Master Clue Counter 4a3aa4.yaml'
|
- !include 'unpacked/Custom_Token Master Clue Counter 4a3aa4.yaml'
|
||||||
- !include 'unpacked/Custom_Model_Bag Legacy Assets 7165a9.yaml'
|
- !include 'unpacked/Custom_Model_Bag Legacy Assets 7165a9.yaml'
|
||||||
- !include 'unpacked/Custom_Token Playarea 721ba2.yaml'
|
- !include 'unpacked/Custom_Token Play Area 721ba2.yaml'
|
||||||
- !include 'unpacked/Custom_Assetbundle_Bag Barkham Horror 308439.yaml'
|
- !include 'unpacked/Custom_Assetbundle_Bag Barkham Horror 308439.yaml'
|
||||||
- !include 'unpacked/Custom_Token Chaos Bag Stat Tracker 766620.yaml'
|
- !include 'unpacked/Custom_Token Chaos Bag Stat Tracker 766620.yaml'
|
||||||
- !include 'unpacked/Custom_Model_Bag Bless tokens afa06b.yaml'
|
- !include 'unpacked/Custom_Model_Bag Bless tokens afa06b.yaml'
|
||||||
- !include 'unpacked/Custom_Model_Bag Curse tokens bd0253.yaml'
|
- !include 'unpacked/Custom_Model_Bag Curse tokens bd0253.yaml'
|
||||||
- !include 'unpacked/Custom_Tile Token Remover 0a5a29.yaml'
|
|
||||||
- !include 'unpacked/Checker_white Token Spawn Tool 36b4ee.yaml'
|
- !include 'unpacked/Checker_white Token Spawn Tool 36b4ee.yaml'
|
||||||
- !include 'unpacked/Custom_Model_Bag Official StandaloneChallenge Scenarios 0ef5c8.yaml'
|
- !include 'unpacked/Custom_Model_Bag Official StandaloneChallenge Scenarios 0ef5c8.yaml'
|
||||||
- !include 'unpacked/Deck Tarot Deck 77f1e5.yaml'
|
- !include 'unpacked/Deck Tarot Deck 77f1e5.yaml'
|
||||||
@ -430,16 +445,15 @@ ObjectStates:
|
|||||||
- !include 'unpacked/Custom_Tile Data Helper 708279.yaml'
|
- !include 'unpacked/Custom_Tile Data Helper 708279.yaml'
|
||||||
- !include 'unpacked/Custom_Token BlessCurse Manager 5933fb.yaml'
|
- !include 'unpacked/Custom_Token BlessCurse Manager 5933fb.yaml'
|
||||||
- !include 'unpacked/Notecard d8d357.yaml'
|
- !include 'unpacked/Notecard d8d357.yaml'
|
||||||
- !include 'unpacked/Checker_black Arkham Deck Cutter 445115.yaml'
|
|
||||||
- !include 'unpacked/ScriptingTrigger a2f932.yaml'
|
- !include 'unpacked/ScriptingTrigger a2f932.yaml'
|
||||||
- !include 'unpacked/Custom_Model Edge of the Earth 895eaa.yaml'
|
- !include 'unpacked/Custom_Model Edge of the Earth 895eaa.yaml'
|
||||||
- !include 'unpacked/Custom_Model The Dream-Eaters a16a1a.yaml'
|
- !include 'unpacked/Custom_Model The Dream-Eaters a16a1a.yaml'
|
||||||
- !include 'unpacked/Custom_Model Return to The Circle Undone 757324.yaml'
|
- !include 'unpacked/Custom_Model Return to The Circle Undone 757324.yaml'
|
||||||
- !include 'unpacked/Custom_Tile Playermat 4 Red 0840d5.yaml'
|
|
||||||
- !include 'unpacked/Custom_Tile Playermat 3 Green 383d8b.yaml'
|
|
||||||
- !include 'unpacked/Custom_Token Other Doom in Play 652ff3.yaml'
|
- !include 'unpacked/Custom_Token Other Doom in Play 652ff3.yaml'
|
||||||
- !include 'unpacked/Custom_Tile Playermat 1 White 8b081b.yaml'
|
- !include 'unpacked/Custom_Tile Playermat 1 White 8b081b.yaml'
|
||||||
- !include 'unpacked/Custom_Tile Playermat 2 Orange bd0ff4.yaml'
|
- !include 'unpacked/Custom_Tile Playermat 2 Orange bd0ff4.yaml'
|
||||||
|
- !include 'unpacked/Custom_Tile Playermat 3 Green 383d8b.yaml'
|
||||||
|
- !include 'unpacked/Custom_Tile Playermat 4 Red 0840d5.yaml'
|
||||||
- !include 'unpacked/Custom_Tile Neutral 2691e1.yaml'
|
- !include 'unpacked/Custom_Tile Neutral 2691e1.yaml'
|
||||||
- !include 'unpacked/Custom_Tile Neutral 748245.yaml'
|
- !include 'unpacked/Custom_Tile Neutral 748245.yaml'
|
||||||
- !include 'unpacked/Custom_Tile Neutral 271b17.yaml'
|
- !include 'unpacked/Custom_Tile Neutral 271b17.yaml'
|
||||||
@ -480,15 +494,17 @@ ObjectStates:
|
|||||||
- !include 'unpacked/Custom_Tile Player Cards 2d30ee.yaml'
|
- !include 'unpacked/Custom_Tile Player Cards 2d30ee.yaml'
|
||||||
- !include 'unpacked/Custom_Tile Token Remover 39b175.yaml'
|
- !include 'unpacked/Custom_Tile Token Remover 39b175.yaml'
|
||||||
- !include 'unpacked/Custom_Tile Token Remover 2ba7a5.yaml'
|
- !include 'unpacked/Custom_Tile Token Remover 2ba7a5.yaml'
|
||||||
|
- !include 'unpacked/Custom_Tile Token Remover 0a5a29.yaml'
|
||||||
|
- !include 'unpacked/ScriptingTrigger TokenDiscardZone 457de3.yaml'
|
||||||
|
- !include 'unpacked/ScriptingTrigger TokenDiscardZone 457de4.yaml'
|
||||||
|
- !include 'unpacked/ScriptingTrigger TokenDiscardZone 457de5.yaml'
|
||||||
|
- !include 'unpacked/ScriptingTrigger TokenDiscardZone 457de6.yaml'
|
||||||
- !include 'unpacked/Custom_Tile Decoration - Map 6161b4.yaml'
|
- !include 'unpacked/Custom_Tile Decoration - Map 6161b4.yaml'
|
||||||
- !include 'unpacked/Custom_Model_Bag Rulebooks, Guides and Tablets fcfa7f.yaml'
|
- !include 'unpacked/Custom_Model_Bag Rulebooks, Guides and Tablets fcfa7f.yaml'
|
||||||
- !include 'unpacked/BlockRectangle Table Divider 612072.yaml'
|
- !include 'unpacked/BlockRectangle Table Divider 612072.yaml'
|
||||||
- !include 'unpacked/BlockRectangle Table Divider 975c39.yaml'
|
- !include 'unpacked/BlockRectangle Table Divider 975c39.yaml'
|
||||||
- !include 'unpacked/BlockRectangle Table Divider 75937e.yaml'
|
- !include 'unpacked/BlockRectangle Table Divider 75937e.yaml'
|
||||||
- !include 'unpacked/BlockRectangle Table Divider 8646eb.yaml'
|
- !include 'unpacked/BlockRectangle Table Divider 8646eb.yaml'
|
||||||
- !include 'unpacked/Custom_Model_Bag Community-Created Player CardsInvestigators
|
|
||||||
ed4ca7.yaml'
|
|
||||||
- !include 'unpacked/Custom_Model_Bag Fan-Made ScenariosCampaignsMiscellany 66e97c.yaml'
|
|
||||||
- !include 'unpacked/Custom_Model Decoration - Ammo 0a3b03.yaml'
|
- !include 'unpacked/Custom_Model Decoration - Ammo 0a3b03.yaml'
|
||||||
- !include 'unpacked/Custom_Model Decoration - Ammo b43845.yaml'
|
- !include 'unpacked/Custom_Model Decoration - Ammo b43845.yaml'
|
||||||
- !include 'unpacked/Custom_Model Decoration - Ammo d35ee9.yaml'
|
- !include 'unpacked/Custom_Model Decoration - Ammo d35ee9.yaml'
|
||||||
@ -497,13 +513,15 @@ ObjectStates:
|
|||||||
- !include 'unpacked/Bag OptionPanel Source 830bd0.yaml'
|
- !include 'unpacked/Bag OptionPanel Source 830bd0.yaml'
|
||||||
- !include 'unpacked/Custom_Assetbundle SoundCube 3c988f.yaml'
|
- !include 'unpacked/Custom_Assetbundle SoundCube 3c988f.yaml'
|
||||||
- !include 'unpacked/go_game_piece_white Game Key Handler fce69c.yaml'
|
- !include 'unpacked/go_game_piece_white Game Key Handler fce69c.yaml'
|
||||||
|
- !include 'unpacked/Custom_Tile Token Spawning Reference f8b3a7.yaml'
|
||||||
- !include 'unpacked/3DText d628cc.yaml'
|
- !include 'unpacked/3DText d628cc.yaml'
|
||||||
- !include 'unpacked/go_game_piece_black Navigation Overlay Handler 797ede.yaml'
|
- !include 'unpacked/go_game_piece_black Navigation Overlay Handler 797ede.yaml'
|
||||||
- !include 'unpacked/Custom_Tile Campaign ImporterExporter 334ee3.yaml'
|
- !include 'unpacked/Custom_Tile Campaign ImporterExporter 334ee3.yaml'
|
||||||
- !include 'unpacked/Custom_Token Token Arranger 022907.yaml'
|
- !include 'unpacked/Custom_Token Token Arranger 022907.yaml'
|
||||||
- !include 'unpacked/Custom_Token Chaos Bag Manager 023240.yaml'
|
- !include 'unpacked/Custom_Token Chaos Bag Manager 023240.yaml'
|
||||||
- !include 'unpacked/Notecard Arkham SCE 3.3.0 - 1092023 - Page 1 964222.yaml'
|
- !include 'unpacked/BlockRectangle Placeholder Box Dummy a93466.yaml'
|
||||||
- !include 'unpacked/Custom_Model Souls of Darkness a94e6b.yaml'
|
- !include 'unpacked/Custom_Model Baldur''s Gate III 695abd.yaml'
|
||||||
|
- !include 'unpacked/Notecard Arkham SCE 3.4.0 - 11182023 - Page 1 964222.yaml'
|
||||||
PlayArea: 1
|
PlayArea: 1
|
||||||
PlayerCounts:
|
PlayerCounts:
|
||||||
- 0
|
- 0
|
||||||
@ -511,7 +529,7 @@ PlayerCounts:
|
|||||||
PlayingTime:
|
PlayingTime:
|
||||||
- 0
|
- 0
|
||||||
- 0
|
- 0
|
||||||
SaveName: Arkham SCE - 3.3.0
|
SaveName: Arkham SCE - 3.4.0
|
||||||
Sky: Sky_Museum
|
Sky: Sky_Museum
|
||||||
SkyURL: https://i.imgur.com/GkQqaOF.jpg
|
SkyURL: https://i.imgur.com/GkQqaOF.jpg
|
||||||
SnapPoints:
|
SnapPoints:
|
||||||
|
@ -36,7 +36,7 @@ Tooltip: true
|
|||||||
Transform:
|
Transform:
|
||||||
posX: -19.5
|
posX: -19.5
|
||||||
posY: 1.7
|
posY: 1.7
|
||||||
posZ: -84
|
posZ: -87
|
||||||
rotX: 90
|
rotX: 90
|
||||||
rotY: 90
|
rotY: 90
|
||||||
rotZ: 0
|
rotZ: 0
|
||||||
|
@ -41,9 +41,6 @@ local __bundle_require, __bundle_loaded, __bundle_register, __bundle_modules = (
|
|||||||
|
|
||||||
return require, loaded, register, modules
|
return require, loaded, register, modules
|
||||||
end)(nil)
|
end)(nil)
|
||||||
__bundle_register("__root", function(require, _LOADED, __bundle_register, __bundle_modules)
|
|
||||||
require("playercards/AllCardsBag")
|
|
||||||
end)
|
|
||||||
__bundle_register("playercards/AllCardsBag", function(require, _LOADED, __bundle_register, __bundle_modules)
|
__bundle_register("playercards/AllCardsBag", function(require, _LOADED, __bundle_register, __bundle_modules)
|
||||||
local cardIdIndex = { }
|
local cardIdIndex = { }
|
||||||
local classAndLevelIndex = { }
|
local classAndLevelIndex = { }
|
||||||
@ -400,4 +397,7 @@ function isBasicWeakness(cardMetadata)
|
|||||||
and cardMetadata.basicWeaknessCount > 0
|
and cardMetadata.basicWeaknessCount > 0
|
||||||
end
|
end
|
||||||
end)
|
end)
|
||||||
|
__bundle_register("__root", function(require, _LOADED, __bundle_register, __bundle_modules)
|
||||||
|
require("playercards/AllCardsBag")
|
||||||
|
end)
|
||||||
return __bundle_require("__root")
|
return __bundle_require("__root")
|
@ -21,11 +21,17 @@ ContainedObjects:
|
|||||||
- !include 'Bag All Player Cards 15bb07/Card Monterey Jack 46b145.yaml'
|
- !include 'Bag All Player Cards 15bb07/Card Monterey Jack 46b145.yaml'
|
||||||
- !include 'Bag All Player Cards 15bb07/Card If it bleeds... acf2b0.yaml'
|
- !include 'Bag All Player Cards 15bb07/Card If it bleeds... acf2b0.yaml'
|
||||||
- !include 'Bag All Player Cards 15bb07/Card Beat Cop (2) 7001be.yaml'
|
- !include 'Bag All Player Cards 15bb07/Card Beat Cop (2) 7001be.yaml'
|
||||||
|
- !include 'Bag All Player Cards 15bb07/CardCustom Ad Hoc c9fb2f.yaml'
|
||||||
|
- !include 'Bag All Player Cards 15bb07/Card Hasty Repairs 0821d5.yaml'
|
||||||
|
- !include 'Bag All Player Cards 15bb07/CardCustom Wilson Richards ceb426.yaml'
|
||||||
|
- !include 'Bag All Player Cards 15bb07/CardCustom Wilson Richards 54eab5.yaml'
|
||||||
- !include 'Bag All Player Cards 15bb07/Card Hard Times 876557.yaml'
|
- !include 'Bag All Player Cards 15bb07/Card Hard Times 876557.yaml'
|
||||||
- !include 'Bag All Player Cards 15bb07/Card Pete''s Guitar 876557.yaml'
|
- !include 'Bag All Player Cards 15bb07/Card Pete''s Guitar 876557.yaml'
|
||||||
- !include 'Bag All Player Cards 15bb07/Card Ashcan Pete (Parallel Front) 5294c3.yaml'
|
- !include 'Bag All Player Cards 15bb07/Card Ashcan Pete (Parallel Front) 5294c3.yaml'
|
||||||
- !include 'Bag All Player Cards 15bb07/Card Ashcan Pete (Parallel Back) 5294c3.yaml'
|
- !include 'Bag All Player Cards 15bb07/Card Ashcan Pete (Parallel Back) 5294c3.yaml'
|
||||||
- !include 'Bag All Player Cards 15bb07/Card Ashcan Pete (Parallel) 5294c3.yaml'
|
- !include 'Bag All Player Cards 15bb07/Card Ashcan Pete (Parallel) 5294c3.yaml'
|
||||||
|
- !include 'Bag All Player Cards 15bb07/CardCustom Eldritch Tongue e8765a.yaml'
|
||||||
|
- !include 'Bag All Player Cards 15bb07/CardCustom False Surrender adf28e.yaml'
|
||||||
- !include 'Bag All Player Cards 15bb07/CardCustom The Necronomicon 5b2e10.yaml'
|
- !include 'Bag All Player Cards 15bb07/CardCustom The Necronomicon 5b2e10.yaml'
|
||||||
- !include 'Bag All Player Cards 15bb07/Card Roland''s .38 Special 4edb91.yaml'
|
- !include 'Bag All Player Cards 15bb07/Card Roland''s .38 Special 4edb91.yaml'
|
||||||
- !include 'Bag All Player Cards 15bb07/Card Stubborn Detective 4ea68b.yaml'
|
- !include 'Bag All Player Cards 15bb07/Card Stubborn Detective 4ea68b.yaml'
|
||||||
@ -140,6 +146,7 @@ ContainedObjects:
|
|||||||
- !include 'Bag All Player Cards 15bb07/Card Accursed Fate 85e7d9.yaml'
|
- !include 'Bag All Player Cards 15bb07/Card Accursed Fate 85e7d9.yaml'
|
||||||
- !include 'Bag All Player Cards 15bb07/Card On Your Own (3) 2ebdf1.yaml'
|
- !include 'Bag All Player Cards 15bb07/Card On Your Own (3) 2ebdf1.yaml'
|
||||||
- !include 'Bag All Player Cards 15bb07/Card Zoey''s Cross 66d810.yaml'
|
- !include 'Bag All Player Cards 15bb07/Card Zoey''s Cross 66d810.yaml'
|
||||||
|
- !include 'Bag All Player Cards 15bb07/Card Zoey''s Cross 66d811.yaml'
|
||||||
- !include 'Bag All Player Cards 15bb07/Card Dig Deep (4) 734b45.yaml'
|
- !include 'Bag All Player Cards 15bb07/Card Dig Deep (4) 734b45.yaml'
|
||||||
- !include 'Bag All Player Cards 15bb07/Card Dream-Enhancing Serum 98c5af.yaml'
|
- !include 'Bag All Player Cards 15bb07/Card Dream-Enhancing Serum 98c5af.yaml'
|
||||||
- !include 'Bag All Player Cards 15bb07/Card The Gold Pocket Watch (4) 62d930.yaml'
|
- !include 'Bag All Player Cards 15bb07/Card The Gold Pocket Watch (4) 62d930.yaml'
|
||||||
@ -380,6 +387,7 @@ ContainedObjects:
|
|||||||
- !include 'Bag All Player Cards 15bb07/Card Streetwise (3) d7dbac.yaml'
|
- !include 'Bag All Player Cards 15bb07/Card Streetwise (3) d7dbac.yaml'
|
||||||
- !include 'Bag All Player Cards 15bb07/Card Try and Try Again (1) 3dc82f.yaml'
|
- !include 'Bag All Player Cards 15bb07/Card Try and Try Again (1) 3dc82f.yaml'
|
||||||
- !include 'Bag All Player Cards 15bb07/Card Smite the Wicked 58f534.yaml'
|
- !include 'Bag All Player Cards 15bb07/Card Smite the Wicked 58f534.yaml'
|
||||||
|
- !include 'Bag All Player Cards 15bb07/Card Smite the Wicked 58f535.yaml'
|
||||||
- !include 'Bag All Player Cards 15bb07/Card Gravedigger''s Shovel (2) 96a440.yaml'
|
- !include 'Bag All Player Cards 15bb07/Card Gravedigger''s Shovel (2) 96a440.yaml'
|
||||||
- !include 'Bag All Player Cards 15bb07/Card Fine Print 39452d.yaml'
|
- !include 'Bag All Player Cards 15bb07/Card Fine Print 39452d.yaml'
|
||||||
- !include 'Bag All Player Cards 15bb07/Card Voice of Ra 0988b2.yaml'
|
- !include 'Bag All Player Cards 15bb07/Card Voice of Ra 0988b2.yaml'
|
||||||
@ -740,6 +748,7 @@ ContainedObjects:
|
|||||||
- !include 'Bag All Player Cards 15bb07/Card Waveworn Idol 591284.yaml'
|
- !include 'Bag All Player Cards 15bb07/Card Waveworn Idol 591284.yaml'
|
||||||
- !include 'Bag All Player Cards 15bb07/Card Take Heart cc6e4d.yaml'
|
- !include 'Bag All Player Cards 15bb07/Card Take Heart cc6e4d.yaml'
|
||||||
- !include 'Bag All Player Cards 15bb07/Card Olive McBride 9683d0.yaml'
|
- !include 'Bag All Player Cards 15bb07/Card Olive McBride 9683d0.yaml'
|
||||||
|
- !include 'Bag All Player Cards 15bb07/Card Olive McBride 9683d2.yaml'
|
||||||
- !include 'Bag All Player Cards 15bb07/Card Counterpunch 20645e.yaml'
|
- !include 'Bag All Player Cards 15bb07/Card Counterpunch 20645e.yaml'
|
||||||
- !include 'Bag All Player Cards 15bb07/Card Harmony Restored (2) 7885cf.yaml'
|
- !include 'Bag All Player Cards 15bb07/Card Harmony Restored (2) 7885cf.yaml'
|
||||||
- !include 'Bag All Player Cards 15bb07/Card Glory 273584.yaml'
|
- !include 'Bag All Player Cards 15bb07/Card Glory 273584.yaml'
|
||||||
@ -1105,6 +1114,9 @@ ContainedObjects:
|
|||||||
- !include 'Bag All Player Cards 15bb07/Card Preston Fairmont 5e6298.yaml'
|
- !include 'Bag All Player Cards 15bb07/Card Preston Fairmont 5e6298.yaml'
|
||||||
- !include 'Bag All Player Cards 15bb07/Card Diana Stanley 32b091.yaml'
|
- !include 'Bag All Player Cards 15bb07/Card Diana Stanley 32b091.yaml'
|
||||||
- !include 'Bag All Player Cards 15bb07/Card Zoey Samaras 98a0e1.yaml'
|
- !include 'Bag All Player Cards 15bb07/Card Zoey Samaras 98a0e1.yaml'
|
||||||
|
- !include 'Bag All Player Cards 15bb07/Card Zoey Samaras (Parallel) 98a0e2.yaml'
|
||||||
|
- !include 'Bag All Player Cards 15bb07/Card Zoey Samaras (Parallel Back) 98a0e4.yaml'
|
||||||
|
- !include 'Bag All Player Cards 15bb07/Card Zoey Samaras (Parallel Front) 98a0e3.yaml'
|
||||||
- !include 'Bag All Player Cards 15bb07/Card Jim Culver ca079b.yaml'
|
- !include 'Bag All Player Cards 15bb07/Card Jim Culver ca079b.yaml'
|
||||||
- !include 'Bag All Player Cards 15bb07/Card Joe Diamond 6dc626.yaml'
|
- !include 'Bag All Player Cards 15bb07/Card Joe Diamond 6dc626.yaml'
|
||||||
- !include 'Bag All Player Cards 15bb07/Card Agnes Baker (Parallel Back) 909f30.yaml'
|
- !include 'Bag All Player Cards 15bb07/Card Agnes Baker (Parallel Back) 909f30.yaml'
|
||||||
@ -1562,6 +1574,27 @@ ContainedObjects:
|
|||||||
- !include 'Bag All Player Cards 15bb07/Card Wrong Place, Right Time d5944e.yaml'
|
- !include 'Bag All Player Cards 15bb07/Card Wrong Place, Right Time d5944e.yaml'
|
||||||
- !include 'Bag All Player Cards 15bb07/Card Sparrow Mask 975d79.yaml'
|
- !include 'Bag All Player Cards 15bb07/Card Sparrow Mask 975d79.yaml'
|
||||||
- !include 'Bag All Player Cards 15bb07/Card Pitchfork 45a724.yaml'
|
- !include 'Bag All Player Cards 15bb07/Card Pitchfork 45a724.yaml'
|
||||||
|
- !include 'Bag All Player Cards 15bb07/Card Jim''s Trumpet 7dfd5f.yaml'
|
||||||
|
- !include 'Bag All Player Cards 15bb07/Card Jim Culver (Parallel) 72bf31.yaml'
|
||||||
|
- !include 'Bag All Player Cards 15bb07/Card Jim Culver (Parallel Front) c5fc80.yaml'
|
||||||
|
- !include 'Bag All Player Cards 15bb07/Card Vengeful Shade 73bc8e.yaml'
|
||||||
|
- !include 'Bag All Player Cards 15bb07/Card Final Rhapsody 561775.yaml'
|
||||||
|
- !include 'Bag All Player Cards 15bb07/Card Jim Culver (Parallel Back) aba863.yaml'
|
||||||
|
- !include 'Bag All Player Cards 15bb07/CardCustom The Beyond 37ab47.yaml'
|
||||||
|
- !include 'Bag All Player Cards 15bb07/CardCustom Devil 2a0ba5.yaml'
|
||||||
|
- !include 'Bag All Player Cards 15bb07/CardCustom Alessandra Zorzi cea425.yaml'
|
||||||
|
- !include 'Bag All Player Cards 15bb07/CardCustom Alessandra Zorzi 54eaa5.yaml'
|
||||||
|
- !include 'Bag All Player Cards 15bb07/CardCustom Zamacona 541ba9.yaml'
|
||||||
|
- !include 'Bag All Player Cards 15bb07/CardCustom Wicked Athame c9fb1f.yaml'
|
||||||
|
- !include 'Bag All Player Cards 15bb07/CardCustom Beguile 019526.yaml'
|
||||||
|
- !include 'Bag All Player Cards 15bb07/CardCustom Ofuda 860c1e.yaml'
|
||||||
|
- !include 'Bag All Player Cards 15bb07/CardCustom I''ll Pay You Back! 40e1ca.yaml'
|
||||||
|
- !include 'Bag All Player Cards 15bb07/CardCustom Occult Reliquary acd0c2.yaml'
|
||||||
|
- !include 'Bag All Player Cards 15bb07/CardCustom Grift df75d7.yaml'
|
||||||
|
- !include 'Bag All Player Cards 15bb07/CardCustom Control Variable 133868.yaml'
|
||||||
|
- !include 'Bag All Player Cards 15bb07/CardCustom Blackmail File de456d.yaml'
|
||||||
|
- !include 'Bag All Player Cards 15bb07/CardCustom Speak to the Dead c763aa.yaml'
|
||||||
|
- !include 'Bag All Player Cards 15bb07/CardCustom Accursed e91c5e.yaml'
|
||||||
Description: ''
|
Description: ''
|
||||||
DragSelectable: true
|
DragSelectable: true
|
||||||
GMNotes: ''
|
GMNotes: ''
|
||||||
|
@ -12,7 +12,7 @@ CustomDeck:
|
|||||||
'3':
|
'3':
|
||||||
BackIsHidden: true
|
BackIsHidden: true
|
||||||
BackURL: https://i.imgur.com/EcbhVuh.jpg/
|
BackURL: https://i.imgur.com/EcbhVuh.jpg/
|
||||||
FaceURL: http://cloud-3.steamusercontent.com/ugc/2021607899142908284/92DF67E4310BCDFAD6C4BB12D31155DBF6B07A25/
|
FaceURL: http://cloud-3.steamusercontent.com/ugc/2115061845812962486/A68B8BF7E4862F21369DAC4A37D813EC664EAC34/
|
||||||
NumHeight: 6
|
NumHeight: 6
|
||||||
NumWidth: 10
|
NumWidth: 10
|
||||||
Type: 0
|
Type: 0
|
||||||
|
@ -12,7 +12,7 @@ CustomDeck:
|
|||||||
'3':
|
'3':
|
||||||
BackIsHidden: true
|
BackIsHidden: true
|
||||||
BackURL: https://i.imgur.com/EcbhVuh.jpg/
|
BackURL: https://i.imgur.com/EcbhVuh.jpg/
|
||||||
FaceURL: http://cloud-3.steamusercontent.com/ugc/2021607899142908284/92DF67E4310BCDFAD6C4BB12D31155DBF6B07A25/
|
FaceURL: http://cloud-3.steamusercontent.com/ugc/2115061845812962486/A68B8BF7E4862F21369DAC4A37D813EC664EAC34/
|
||||||
NumHeight: 6
|
NumHeight: 6
|
||||||
NumWidth: 10
|
NumWidth: 10
|
||||||
Type: 0
|
Type: 0
|
||||||
|
@ -12,7 +12,7 @@ CustomDeck:
|
|||||||
'3':
|
'3':
|
||||||
BackIsHidden: true
|
BackIsHidden: true
|
||||||
BackURL: https://i.imgur.com/EcbhVuh.jpg/
|
BackURL: https://i.imgur.com/EcbhVuh.jpg/
|
||||||
FaceURL: http://cloud-3.steamusercontent.com/ugc/2021607899142908284/92DF67E4310BCDFAD6C4BB12D31155DBF6B07A25/
|
FaceURL: http://cloud-3.steamusercontent.com/ugc/2115061845812962486/A68B8BF7E4862F21369DAC4A37D813EC664EAC34/
|
||||||
NumHeight: 6
|
NumHeight: 6
|
||||||
NumWidth: 10
|
NumWidth: 10
|
||||||
Type: 0
|
Type: 0
|
||||||
|
@ -12,7 +12,7 @@ CustomDeck:
|
|||||||
'3':
|
'3':
|
||||||
BackIsHidden: true
|
BackIsHidden: true
|
||||||
BackURL: https://i.imgur.com/EcbhVuh.jpg/
|
BackURL: https://i.imgur.com/EcbhVuh.jpg/
|
||||||
FaceURL: http://cloud-3.steamusercontent.com/ugc/2021607899142908284/92DF67E4310BCDFAD6C4BB12D31155DBF6B07A25/
|
FaceURL: http://cloud-3.steamusercontent.com/ugc/2115061845812962486/A68B8BF7E4862F21369DAC4A37D813EC664EAC34/
|
||||||
NumHeight: 6
|
NumHeight: 6
|
||||||
NumWidth: 10
|
NumWidth: 10
|
||||||
Type: 0
|
Type: 0
|
||||||
|
@ -12,7 +12,7 @@ CustomDeck:
|
|||||||
'3':
|
'3':
|
||||||
BackIsHidden: true
|
BackIsHidden: true
|
||||||
BackURL: https://i.imgur.com/EcbhVuh.jpg/
|
BackURL: https://i.imgur.com/EcbhVuh.jpg/
|
||||||
FaceURL: http://cloud-3.steamusercontent.com/ugc/2021607899142908284/92DF67E4310BCDFAD6C4BB12D31155DBF6B07A25/
|
FaceURL: http://cloud-3.steamusercontent.com/ugc/2115061845812962486/A68B8BF7E4862F21369DAC4A37D813EC664EAC34/
|
||||||
NumHeight: 6
|
NumHeight: 6
|
||||||
NumWidth: 10
|
NumWidth: 10
|
||||||
Type: 0
|
Type: 0
|
||||||
|
@ -12,7 +12,7 @@ CustomDeck:
|
|||||||
'3':
|
'3':
|
||||||
BackIsHidden: true
|
BackIsHidden: true
|
||||||
BackURL: https://i.imgur.com/EcbhVuh.jpg/
|
BackURL: https://i.imgur.com/EcbhVuh.jpg/
|
||||||
FaceURL: http://cloud-3.steamusercontent.com/ugc/2021607899142908284/92DF67E4310BCDFAD6C4BB12D31155DBF6B07A25/
|
FaceURL: http://cloud-3.steamusercontent.com/ugc/2115061845812962486/A68B8BF7E4862F21369DAC4A37D813EC664EAC34/
|
||||||
NumHeight: 6
|
NumHeight: 6
|
||||||
NumWidth: 10
|
NumWidth: 10
|
||||||
Type: 0
|
Type: 0
|
||||||
|
@ -12,7 +12,7 @@ CustomDeck:
|
|||||||
'3':
|
'3':
|
||||||
BackIsHidden: true
|
BackIsHidden: true
|
||||||
BackURL: https://i.imgur.com/EcbhVuh.jpg/
|
BackURL: https://i.imgur.com/EcbhVuh.jpg/
|
||||||
FaceURL: http://cloud-3.steamusercontent.com/ugc/2021607899142908284/92DF67E4310BCDFAD6C4BB12D31155DBF6B07A25/
|
FaceURL: http://cloud-3.steamusercontent.com/ugc/2115061845812962486/A68B8BF7E4862F21369DAC4A37D813EC664EAC34/
|
||||||
NumHeight: 6
|
NumHeight: 6
|
||||||
NumWidth: 10
|
NumWidth: 10
|
||||||
Type: 0
|
Type: 0
|
||||||
|
@ -12,7 +12,7 @@ CustomDeck:
|
|||||||
'3':
|
'3':
|
||||||
BackIsHidden: true
|
BackIsHidden: true
|
||||||
BackURL: https://i.imgur.com/EcbhVuh.jpg/
|
BackURL: https://i.imgur.com/EcbhVuh.jpg/
|
||||||
FaceURL: http://cloud-3.steamusercontent.com/ugc/2021607899142908284/92DF67E4310BCDFAD6C4BB12D31155DBF6B07A25/
|
FaceURL: http://cloud-3.steamusercontent.com/ugc/2115061845812962486/A68B8BF7E4862F21369DAC4A37D813EC664EAC34/
|
||||||
NumHeight: 6
|
NumHeight: 6
|
||||||
NumWidth: 10
|
NumWidth: 10
|
||||||
Type: 0
|
Type: 0
|
||||||
|
@ -12,7 +12,7 @@ CustomDeck:
|
|||||||
'3':
|
'3':
|
||||||
BackIsHidden: true
|
BackIsHidden: true
|
||||||
BackURL: https://i.imgur.com/EcbhVuh.jpg/
|
BackURL: https://i.imgur.com/EcbhVuh.jpg/
|
||||||
FaceURL: http://cloud-3.steamusercontent.com/ugc/2021607899142908284/92DF67E4310BCDFAD6C4BB12D31155DBF6B07A25/
|
FaceURL: http://cloud-3.steamusercontent.com/ugc/2115061845812962486/A68B8BF7E4862F21369DAC4A37D813EC664EAC34/
|
||||||
NumHeight: 6
|
NumHeight: 6
|
||||||
NumWidth: 10
|
NumWidth: 10
|
||||||
Type: 0
|
Type: 0
|
||||||
|
@ -12,7 +12,7 @@ CustomDeck:
|
|||||||
'3':
|
'3':
|
||||||
BackIsHidden: true
|
BackIsHidden: true
|
||||||
BackURL: https://i.imgur.com/EcbhVuh.jpg/
|
BackURL: https://i.imgur.com/EcbhVuh.jpg/
|
||||||
FaceURL: http://cloud-3.steamusercontent.com/ugc/2021607899142908284/92DF67E4310BCDFAD6C4BB12D31155DBF6B07A25/
|
FaceURL: http://cloud-3.steamusercontent.com/ugc/2115061845812962486/A68B8BF7E4862F21369DAC4A37D813EC664EAC34/
|
||||||
NumHeight: 6
|
NumHeight: 6
|
||||||
NumWidth: 10
|
NumWidth: 10
|
||||||
Type: 0
|
Type: 0
|
||||||
|
@ -280,12 +280,13 @@ end)
|
|||||||
__bundle_register("accessories/TokenArrangerApi", function(require, _LOADED, __bundle_register, __bundle_modules)
|
__bundle_register("accessories/TokenArrangerApi", function(require, _LOADED, __bundle_register, __bundle_modules)
|
||||||
do
|
do
|
||||||
local TokenArrangerApi = {}
|
local TokenArrangerApi = {}
|
||||||
|
local guidReferenceApi = require("core/GUIDReferenceApi")
|
||||||
|
|
||||||
-- local function to call the token arranger, if it is on the table
|
-- local function to call the token arranger, if it is on the table
|
||||||
---@param functionName String Name of the function to cal
|
---@param functionName String Name of the function to cal
|
||||||
---@param argument Variant Parameter to pass
|
---@param argument Variant Parameter to pass
|
||||||
local function callIfExistent(functionName, argument)
|
local function callIfExistent(functionName, argument)
|
||||||
local tokenArranger = getObjectsWithTag("TokenArranger")[1]
|
local tokenArranger = guidReferenceApi.getObjectByOwnerAndType("Mythos", "TokenArranger")
|
||||||
if tokenArranger ~= nil then
|
if tokenArranger ~= nil then
|
||||||
tokenArranger.call(functionName, argument)
|
tokenArranger.call(functionName, argument)
|
||||||
end
|
end
|
||||||
@ -313,11 +314,15 @@ end)
|
|||||||
__bundle_register("chaosbag/BlessCurseManagerApi", function(require, _LOADED, __bundle_register, __bundle_modules)
|
__bundle_register("chaosbag/BlessCurseManagerApi", function(require, _LOADED, __bundle_register, __bundle_modules)
|
||||||
do
|
do
|
||||||
local BlessCurseManagerApi = {}
|
local BlessCurseManagerApi = {}
|
||||||
local MANAGER_GUID = "5933fb"
|
local guidReferenceApi = require("core/GUIDReferenceApi")
|
||||||
|
|
||||||
|
local function getManager()
|
||||||
|
return guidReferenceApi.getObjectByOwnerAndType("Mythos", "BlessCurseManager")
|
||||||
|
end
|
||||||
|
|
||||||
-- removes all taken tokens and resets the counts
|
-- removes all taken tokens and resets the counts
|
||||||
BlessCurseManagerApi.removeTakenTokensAndReset = function()
|
BlessCurseManagerApi.removeTakenTokensAndReset = function()
|
||||||
local BlessCurseManager = getObjectFromGUID(MANAGER_GUID)
|
local BlessCurseManager = getManager()
|
||||||
Wait.time(function() BlessCurseManager.call("removeTakenTokens", "Bless") end, 0.05)
|
Wait.time(function() BlessCurseManager.call("removeTakenTokens", "Bless") end, 0.05)
|
||||||
Wait.time(function() BlessCurseManager.call("removeTakenTokens", "Curse") end, 0.10)
|
Wait.time(function() BlessCurseManager.call("removeTakenTokens", "Curse") end, 0.10)
|
||||||
Wait.time(function() BlessCurseManager.call("doReset", "White") end, 0.15)
|
Wait.time(function() BlessCurseManager.call("doReset", "White") end, 0.15)
|
||||||
@ -325,30 +330,30 @@ do
|
|||||||
|
|
||||||
-- updates the internal count (called by cards that seal bless/curse tokens)
|
-- updates the internal count (called by cards that seal bless/curse tokens)
|
||||||
BlessCurseManagerApi.sealedToken = function(type, guid)
|
BlessCurseManagerApi.sealedToken = function(type, guid)
|
||||||
getObjectFromGUID(MANAGER_GUID).call("sealedToken", { type = type, guid = guid })
|
getManager().call("sealedToken", { type = type, guid = guid })
|
||||||
end
|
end
|
||||||
|
|
||||||
-- updates the internal count (called by cards that seal bless/curse tokens)
|
-- updates the internal count (called by cards that seal bless/curse tokens)
|
||||||
BlessCurseManagerApi.releasedToken = function(type, guid)
|
BlessCurseManagerApi.releasedToken = function(type, guid)
|
||||||
getObjectFromGUID(MANAGER_GUID).call("releasedToken", { type = type, guid = guid })
|
getManager().call("releasedToken", { type = type, guid = guid })
|
||||||
end
|
end
|
||||||
|
|
||||||
-- broadcasts the current status for bless/curse tokens
|
-- broadcasts the current status for bless/curse tokens
|
||||||
---@param playerColor String Color of the player to show the broadcast to
|
---@param playerColor String Color of the player to show the broadcast to
|
||||||
BlessCurseManagerApi.broadcastStatus = function(playerColor)
|
BlessCurseManagerApi.broadcastStatus = function(playerColor)
|
||||||
getObjectFromGUID(MANAGER_GUID).call("broadcastStatus", playerColor)
|
getManager().call("broadcastStatus", playerColor)
|
||||||
end
|
end
|
||||||
|
|
||||||
-- removes all bless / curse tokens from the chaos bag and play
|
-- removes all bless / curse tokens from the chaos bag and play
|
||||||
---@param playerColor String Color of the player to show the broadcast to
|
---@param playerColor String Color of the player to show the broadcast to
|
||||||
BlessCurseManagerApi.removeAll = function(playerColor)
|
BlessCurseManagerApi.removeAll = function(playerColor)
|
||||||
getObjectFromGUID(MANAGER_GUID).call("doRemove", playerColor)
|
getManager().call("doRemove", playerColor)
|
||||||
end
|
end
|
||||||
|
|
||||||
-- adds Wendy's menu to the hovered card (allows sealing of tokens)
|
-- adds Wendy's menu to the hovered card (allows sealing of tokens)
|
||||||
---@param color String Color of the player to show the broadcast to
|
---@param color String Color of the player to show the broadcast to
|
||||||
BlessCurseManagerApi.addWendysMenu = function(playerColor, hoveredObject)
|
BlessCurseManagerApi.addWendysMenu = function(playerColor, hoveredObject)
|
||||||
getObjectFromGUID(MANAGER_GUID).call("addMenuOptions", { playerColor = playerColor, hoveredObject = hoveredObject })
|
getManager().call("addMenuOptions", { playerColor = playerColor, hoveredObject = hoveredObject })
|
||||||
end
|
end
|
||||||
|
|
||||||
return BlessCurseManagerApi
|
return BlessCurseManagerApi
|
||||||
@ -430,6 +435,36 @@ do
|
|||||||
return ChaosBagApi
|
return ChaosBagApi
|
||||||
end
|
end
|
||||||
end)
|
end)
|
||||||
|
__bundle_register("core/GUIDReferenceApi", function(require, _LOADED, __bundle_register, __bundle_modules)
|
||||||
|
do
|
||||||
|
local GUIDReferenceApi = {}
|
||||||
|
|
||||||
|
local function getGuidHandler()
|
||||||
|
return getObjectFromGUID("123456")
|
||||||
|
end
|
||||||
|
|
||||||
|
-- returns all matching objects as a table with references
|
||||||
|
---@param owner String Parent object for this search
|
||||||
|
---@param type String Type of object to search for
|
||||||
|
GUIDReferenceApi.getObjectByOwnerAndType = function(owner, type)
|
||||||
|
return getGuidHandler().call("getObjectByOwnerAndType", { owner = owner, type = type })
|
||||||
|
end
|
||||||
|
|
||||||
|
-- returns all matching objects as a table with references
|
||||||
|
---@param type String Type of object to search for
|
||||||
|
GUIDReferenceApi.getObjectsByType = function(type)
|
||||||
|
return getGuidHandler().call("getObjectsByType", type)
|
||||||
|
end
|
||||||
|
|
||||||
|
-- returns all matching objects as a table with references
|
||||||
|
---@param owner String Parent object for this search
|
||||||
|
GUIDReferenceApi.getObjectsByOwner = function(owner)
|
||||||
|
return getGuidHandler().call("getObjectsByOwner", owner)
|
||||||
|
end
|
||||||
|
|
||||||
|
return GUIDReferenceApi
|
||||||
|
end
|
||||||
|
end)
|
||||||
__bundle_register("__root", function(require, _LOADED, __bundle_register, __bundle_modules)
|
__bundle_register("__root", function(require, _LOADED, __bundle_register, __bundle_modules)
|
||||||
require("playercards/cards/CrystallineElderSign3")
|
require("playercards/cards/CrystallineElderSign3")
|
||||||
end)
|
end)
|
||||||
|
@ -12,7 +12,7 @@ CustomDeck:
|
|||||||
'3':
|
'3':
|
||||||
BackIsHidden: true
|
BackIsHidden: true
|
||||||
BackURL: https://i.imgur.com/EcbhVuh.jpg/
|
BackURL: https://i.imgur.com/EcbhVuh.jpg/
|
||||||
FaceURL: http://cloud-3.steamusercontent.com/ugc/2021607899142908284/92DF67E4310BCDFAD6C4BB12D31155DBF6B07A25/
|
FaceURL: http://cloud-3.steamusercontent.com/ugc/2115061845812962486/A68B8BF7E4862F21369DAC4A37D813EC664EAC34/
|
||||||
NumHeight: 6
|
NumHeight: 6
|
||||||
NumWidth: 10
|
NumWidth: 10
|
||||||
Type: 0
|
Type: 0
|
||||||
|
@ -12,7 +12,7 @@ CustomDeck:
|
|||||||
'3':
|
'3':
|
||||||
BackIsHidden: true
|
BackIsHidden: true
|
||||||
BackURL: https://i.imgur.com/EcbhVuh.jpg/
|
BackURL: https://i.imgur.com/EcbhVuh.jpg/
|
||||||
FaceURL: http://cloud-3.steamusercontent.com/ugc/2021607899142908284/92DF67E4310BCDFAD6C4BB12D31155DBF6B07A25/
|
FaceURL: http://cloud-3.steamusercontent.com/ugc/2115061845812962486/A68B8BF7E4862F21369DAC4A37D813EC664EAC34/
|
||||||
NumHeight: 6
|
NumHeight: 6
|
||||||
NumWidth: 10
|
NumWidth: 10
|
||||||
Type: 0
|
Type: 0
|
||||||
|
@ -12,7 +12,7 @@ CustomDeck:
|
|||||||
'3':
|
'3':
|
||||||
BackIsHidden: true
|
BackIsHidden: true
|
||||||
BackURL: https://i.imgur.com/EcbhVuh.jpg/
|
BackURL: https://i.imgur.com/EcbhVuh.jpg/
|
||||||
FaceURL: http://cloud-3.steamusercontent.com/ugc/2021607899142908284/92DF67E4310BCDFAD6C4BB12D31155DBF6B07A25/
|
FaceURL: http://cloud-3.steamusercontent.com/ugc/2115061845812962486/A68B8BF7E4862F21369DAC4A37D813EC664EAC34/
|
||||||
NumHeight: 6
|
NumHeight: 6
|
||||||
NumWidth: 10
|
NumWidth: 10
|
||||||
Type: 0
|
Type: 0
|
||||||
|
@ -41,50 +41,6 @@ local __bundle_require, __bundle_loaded, __bundle_register, __bundle_modules = (
|
|||||||
|
|
||||||
return require, loaded, register, modules
|
return require, loaded, register, modules
|
||||||
end)(nil)
|
end)(nil)
|
||||||
__bundle_register("chaosbag/BlessCurseManagerApi", function(require, _LOADED, __bundle_register, __bundle_modules)
|
|
||||||
do
|
|
||||||
local BlessCurseManagerApi = {}
|
|
||||||
local MANAGER_GUID = "5933fb"
|
|
||||||
|
|
||||||
-- removes all taken tokens and resets the counts
|
|
||||||
BlessCurseManagerApi.removeTakenTokensAndReset = function()
|
|
||||||
local BlessCurseManager = getObjectFromGUID(MANAGER_GUID)
|
|
||||||
Wait.time(function() BlessCurseManager.call("removeTakenTokens", "Bless") end, 0.05)
|
|
||||||
Wait.time(function() BlessCurseManager.call("removeTakenTokens", "Curse") end, 0.10)
|
|
||||||
Wait.time(function() BlessCurseManager.call("doReset", "White") end, 0.15)
|
|
||||||
end
|
|
||||||
|
|
||||||
-- updates the internal count (called by cards that seal bless/curse tokens)
|
|
||||||
BlessCurseManagerApi.sealedToken = function(type, guid)
|
|
||||||
getObjectFromGUID(MANAGER_GUID).call("sealedToken", { type = type, guid = guid })
|
|
||||||
end
|
|
||||||
|
|
||||||
-- updates the internal count (called by cards that seal bless/curse tokens)
|
|
||||||
BlessCurseManagerApi.releasedToken = function(type, guid)
|
|
||||||
getObjectFromGUID(MANAGER_GUID).call("releasedToken", { type = type, guid = guid })
|
|
||||||
end
|
|
||||||
|
|
||||||
-- broadcasts the current status for bless/curse tokens
|
|
||||||
---@param playerColor String Color of the player to show the broadcast to
|
|
||||||
BlessCurseManagerApi.broadcastStatus = function(playerColor)
|
|
||||||
getObjectFromGUID(MANAGER_GUID).call("broadcastStatus", playerColor)
|
|
||||||
end
|
|
||||||
|
|
||||||
-- removes all bless / curse tokens from the chaos bag and play
|
|
||||||
---@param playerColor String Color of the player to show the broadcast to
|
|
||||||
BlessCurseManagerApi.removeAll = function(playerColor)
|
|
||||||
getObjectFromGUID(MANAGER_GUID).call("doRemove", playerColor)
|
|
||||||
end
|
|
||||||
|
|
||||||
-- adds Wendy's menu to the hovered card (allows sealing of tokens)
|
|
||||||
---@param color String Color of the player to show the broadcast to
|
|
||||||
BlessCurseManagerApi.addWendysMenu = function(playerColor, hoveredObject)
|
|
||||||
getObjectFromGUID(MANAGER_GUID).call("addMenuOptions", { playerColor = playerColor, hoveredObject = hoveredObject })
|
|
||||||
end
|
|
||||||
|
|
||||||
return BlessCurseManagerApi
|
|
||||||
end
|
|
||||||
end)
|
|
||||||
__bundle_register("chaosbag/ChaosBagApi", function(require, _LOADED, __bundle_register, __bundle_modules)
|
__bundle_register("chaosbag/ChaosBagApi", function(require, _LOADED, __bundle_register, __bundle_modules)
|
||||||
do
|
do
|
||||||
local ChaosBagApi = {}
|
local ChaosBagApi = {}
|
||||||
@ -161,6 +117,36 @@ do
|
|||||||
return ChaosBagApi
|
return ChaosBagApi
|
||||||
end
|
end
|
||||||
end)
|
end)
|
||||||
|
__bundle_register("core/GUIDReferenceApi", function(require, _LOADED, __bundle_register, __bundle_modules)
|
||||||
|
do
|
||||||
|
local GUIDReferenceApi = {}
|
||||||
|
|
||||||
|
local function getGuidHandler()
|
||||||
|
return getObjectFromGUID("123456")
|
||||||
|
end
|
||||||
|
|
||||||
|
-- returns all matching objects as a table with references
|
||||||
|
---@param owner String Parent object for this search
|
||||||
|
---@param type String Type of object to search for
|
||||||
|
GUIDReferenceApi.getObjectByOwnerAndType = function(owner, type)
|
||||||
|
return getGuidHandler().call("getObjectByOwnerAndType", { owner = owner, type = type })
|
||||||
|
end
|
||||||
|
|
||||||
|
-- returns all matching objects as a table with references
|
||||||
|
---@param type String Type of object to search for
|
||||||
|
GUIDReferenceApi.getObjectsByType = function(type)
|
||||||
|
return getGuidHandler().call("getObjectsByType", type)
|
||||||
|
end
|
||||||
|
|
||||||
|
-- returns all matching objects as a table with references
|
||||||
|
---@param owner String Parent object for this search
|
||||||
|
GUIDReferenceApi.getObjectsByOwner = function(owner)
|
||||||
|
return getGuidHandler().call("getObjectsByOwner", owner)
|
||||||
|
end
|
||||||
|
|
||||||
|
return GUIDReferenceApi
|
||||||
|
end
|
||||||
|
end)
|
||||||
__bundle_register("__root", function(require, _LOADED, __bundle_register, __bundle_modules)
|
__bundle_register("__root", function(require, _LOADED, __bundle_register, __bundle_modules)
|
||||||
require("playercards/cards/DarkRitual")
|
require("playercards/cards/DarkRitual")
|
||||||
end)
|
end)
|
||||||
@ -404,12 +390,13 @@ end)
|
|||||||
__bundle_register("accessories/TokenArrangerApi", function(require, _LOADED, __bundle_register, __bundle_modules)
|
__bundle_register("accessories/TokenArrangerApi", function(require, _LOADED, __bundle_register, __bundle_modules)
|
||||||
do
|
do
|
||||||
local TokenArrangerApi = {}
|
local TokenArrangerApi = {}
|
||||||
|
local guidReferenceApi = require("core/GUIDReferenceApi")
|
||||||
|
|
||||||
-- local function to call the token arranger, if it is on the table
|
-- local function to call the token arranger, if it is on the table
|
||||||
---@param functionName String Name of the function to cal
|
---@param functionName String Name of the function to cal
|
||||||
---@param argument Variant Parameter to pass
|
---@param argument Variant Parameter to pass
|
||||||
local function callIfExistent(functionName, argument)
|
local function callIfExistent(functionName, argument)
|
||||||
local tokenArranger = getObjectsWithTag("TokenArranger")[1]
|
local tokenArranger = guidReferenceApi.getObjectByOwnerAndType("Mythos", "TokenArranger")
|
||||||
if tokenArranger ~= nil then
|
if tokenArranger ~= nil then
|
||||||
tokenArranger.call(functionName, argument)
|
tokenArranger.call(functionName, argument)
|
||||||
end
|
end
|
||||||
@ -434,4 +421,52 @@ do
|
|||||||
return TokenArrangerApi
|
return TokenArrangerApi
|
||||||
end
|
end
|
||||||
end)
|
end)
|
||||||
|
__bundle_register("chaosbag/BlessCurseManagerApi", function(require, _LOADED, __bundle_register, __bundle_modules)
|
||||||
|
do
|
||||||
|
local BlessCurseManagerApi = {}
|
||||||
|
local guidReferenceApi = require("core/GUIDReferenceApi")
|
||||||
|
|
||||||
|
local function getManager()
|
||||||
|
return guidReferenceApi.getObjectByOwnerAndType("Mythos", "BlessCurseManager")
|
||||||
|
end
|
||||||
|
|
||||||
|
-- removes all taken tokens and resets the counts
|
||||||
|
BlessCurseManagerApi.removeTakenTokensAndReset = function()
|
||||||
|
local BlessCurseManager = getManager()
|
||||||
|
Wait.time(function() BlessCurseManager.call("removeTakenTokens", "Bless") end, 0.05)
|
||||||
|
Wait.time(function() BlessCurseManager.call("removeTakenTokens", "Curse") end, 0.10)
|
||||||
|
Wait.time(function() BlessCurseManager.call("doReset", "White") end, 0.15)
|
||||||
|
end
|
||||||
|
|
||||||
|
-- updates the internal count (called by cards that seal bless/curse tokens)
|
||||||
|
BlessCurseManagerApi.sealedToken = function(type, guid)
|
||||||
|
getManager().call("sealedToken", { type = type, guid = guid })
|
||||||
|
end
|
||||||
|
|
||||||
|
-- updates the internal count (called by cards that seal bless/curse tokens)
|
||||||
|
BlessCurseManagerApi.releasedToken = function(type, guid)
|
||||||
|
getManager().call("releasedToken", { type = type, guid = guid })
|
||||||
|
end
|
||||||
|
|
||||||
|
-- broadcasts the current status for bless/curse tokens
|
||||||
|
---@param playerColor String Color of the player to show the broadcast to
|
||||||
|
BlessCurseManagerApi.broadcastStatus = function(playerColor)
|
||||||
|
getManager().call("broadcastStatus", playerColor)
|
||||||
|
end
|
||||||
|
|
||||||
|
-- removes all bless / curse tokens from the chaos bag and play
|
||||||
|
---@param playerColor String Color of the player to show the broadcast to
|
||||||
|
BlessCurseManagerApi.removeAll = function(playerColor)
|
||||||
|
getManager().call("doRemove", playerColor)
|
||||||
|
end
|
||||||
|
|
||||||
|
-- adds Wendy's menu to the hovered card (allows sealing of tokens)
|
||||||
|
---@param color String Color of the player to show the broadcast to
|
||||||
|
BlessCurseManagerApi.addWendysMenu = function(playerColor, hoveredObject)
|
||||||
|
getManager().call("addMenuOptions", { playerColor = playerColor, hoveredObject = hoveredObject })
|
||||||
|
end
|
||||||
|
|
||||||
|
return BlessCurseManagerApi
|
||||||
|
end
|
||||||
|
end)
|
||||||
return __bundle_require("__root")
|
return __bundle_require("__root")
|
@ -12,7 +12,7 @@ CustomDeck:
|
|||||||
'3':
|
'3':
|
||||||
BackIsHidden: true
|
BackIsHidden: true
|
||||||
BackURL: https://i.imgur.com/EcbhVuh.jpg/
|
BackURL: https://i.imgur.com/EcbhVuh.jpg/
|
||||||
FaceURL: http://cloud-3.steamusercontent.com/ugc/2021607899142908284/92DF67E4310BCDFAD6C4BB12D31155DBF6B07A25/
|
FaceURL: http://cloud-3.steamusercontent.com/ugc/2115061845812962486/A68B8BF7E4862F21369DAC4A37D813EC664EAC34/
|
||||||
NumHeight: 6
|
NumHeight: 6
|
||||||
NumWidth: 10
|
NumWidth: 10
|
||||||
Type: 0
|
Type: 0
|
||||||
|
@ -41,16 +41,6 @@ local __bundle_require, __bundle_loaded, __bundle_register, __bundle_modules = (
|
|||||||
|
|
||||||
return require, loaded, register, modules
|
return require, loaded, register, modules
|
||||||
end)(nil)
|
end)(nil)
|
||||||
__bundle_register("__root", function(require, _LOADED, __bundle_register, __bundle_modules)
|
|
||||||
require("playercards/cards/DayofReckoning")
|
|
||||||
end)
|
|
||||||
__bundle_register("playercards/cards/DayofReckoning", function(require, _LOADED, __bundle_register, __bundle_modules)
|
|
||||||
VALID_TOKENS = {
|
|
||||||
["Elder Sign"] = true
|
|
||||||
}
|
|
||||||
|
|
||||||
require("playercards/CardsThatSealTokens")
|
|
||||||
end)
|
|
||||||
__bundle_register("playercards/CardsThatSealTokens", function(require, _LOADED, __bundle_register, __bundle_modules)
|
__bundle_register("playercards/CardsThatSealTokens", function(require, _LOADED, __bundle_register, __bundle_modules)
|
||||||
--[[ Library for cards that seal tokens
|
--[[ Library for cards that seal tokens
|
||||||
This file is used to add sealing option to cards' context menu.
|
This file is used to add sealing option to cards' context menu.
|
||||||
@ -282,12 +272,13 @@ end)
|
|||||||
__bundle_register("accessories/TokenArrangerApi", function(require, _LOADED, __bundle_register, __bundle_modules)
|
__bundle_register("accessories/TokenArrangerApi", function(require, _LOADED, __bundle_register, __bundle_modules)
|
||||||
do
|
do
|
||||||
local TokenArrangerApi = {}
|
local TokenArrangerApi = {}
|
||||||
|
local guidReferenceApi = require("core/GUIDReferenceApi")
|
||||||
|
|
||||||
-- local function to call the token arranger, if it is on the table
|
-- local function to call the token arranger, if it is on the table
|
||||||
---@param functionName String Name of the function to cal
|
---@param functionName String Name of the function to cal
|
||||||
---@param argument Variant Parameter to pass
|
---@param argument Variant Parameter to pass
|
||||||
local function callIfExistent(functionName, argument)
|
local function callIfExistent(functionName, argument)
|
||||||
local tokenArranger = getObjectsWithTag("TokenArranger")[1]
|
local tokenArranger = guidReferenceApi.getObjectByOwnerAndType("Mythos", "TokenArranger")
|
||||||
if tokenArranger ~= nil then
|
if tokenArranger ~= nil then
|
||||||
tokenArranger.call(functionName, argument)
|
tokenArranger.call(functionName, argument)
|
||||||
end
|
end
|
||||||
@ -315,11 +306,15 @@ end)
|
|||||||
__bundle_register("chaosbag/BlessCurseManagerApi", function(require, _LOADED, __bundle_register, __bundle_modules)
|
__bundle_register("chaosbag/BlessCurseManagerApi", function(require, _LOADED, __bundle_register, __bundle_modules)
|
||||||
do
|
do
|
||||||
local BlessCurseManagerApi = {}
|
local BlessCurseManagerApi = {}
|
||||||
local MANAGER_GUID = "5933fb"
|
local guidReferenceApi = require("core/GUIDReferenceApi")
|
||||||
|
|
||||||
|
local function getManager()
|
||||||
|
return guidReferenceApi.getObjectByOwnerAndType("Mythos", "BlessCurseManager")
|
||||||
|
end
|
||||||
|
|
||||||
-- removes all taken tokens and resets the counts
|
-- removes all taken tokens and resets the counts
|
||||||
BlessCurseManagerApi.removeTakenTokensAndReset = function()
|
BlessCurseManagerApi.removeTakenTokensAndReset = function()
|
||||||
local BlessCurseManager = getObjectFromGUID(MANAGER_GUID)
|
local BlessCurseManager = getManager()
|
||||||
Wait.time(function() BlessCurseManager.call("removeTakenTokens", "Bless") end, 0.05)
|
Wait.time(function() BlessCurseManager.call("removeTakenTokens", "Bless") end, 0.05)
|
||||||
Wait.time(function() BlessCurseManager.call("removeTakenTokens", "Curse") end, 0.10)
|
Wait.time(function() BlessCurseManager.call("removeTakenTokens", "Curse") end, 0.10)
|
||||||
Wait.time(function() BlessCurseManager.call("doReset", "White") end, 0.15)
|
Wait.time(function() BlessCurseManager.call("doReset", "White") end, 0.15)
|
||||||
@ -327,30 +322,30 @@ do
|
|||||||
|
|
||||||
-- updates the internal count (called by cards that seal bless/curse tokens)
|
-- updates the internal count (called by cards that seal bless/curse tokens)
|
||||||
BlessCurseManagerApi.sealedToken = function(type, guid)
|
BlessCurseManagerApi.sealedToken = function(type, guid)
|
||||||
getObjectFromGUID(MANAGER_GUID).call("sealedToken", { type = type, guid = guid })
|
getManager().call("sealedToken", { type = type, guid = guid })
|
||||||
end
|
end
|
||||||
|
|
||||||
-- updates the internal count (called by cards that seal bless/curse tokens)
|
-- updates the internal count (called by cards that seal bless/curse tokens)
|
||||||
BlessCurseManagerApi.releasedToken = function(type, guid)
|
BlessCurseManagerApi.releasedToken = function(type, guid)
|
||||||
getObjectFromGUID(MANAGER_GUID).call("releasedToken", { type = type, guid = guid })
|
getManager().call("releasedToken", { type = type, guid = guid })
|
||||||
end
|
end
|
||||||
|
|
||||||
-- broadcasts the current status for bless/curse tokens
|
-- broadcasts the current status for bless/curse tokens
|
||||||
---@param playerColor String Color of the player to show the broadcast to
|
---@param playerColor String Color of the player to show the broadcast to
|
||||||
BlessCurseManagerApi.broadcastStatus = function(playerColor)
|
BlessCurseManagerApi.broadcastStatus = function(playerColor)
|
||||||
getObjectFromGUID(MANAGER_GUID).call("broadcastStatus", playerColor)
|
getManager().call("broadcastStatus", playerColor)
|
||||||
end
|
end
|
||||||
|
|
||||||
-- removes all bless / curse tokens from the chaos bag and play
|
-- removes all bless / curse tokens from the chaos bag and play
|
||||||
---@param playerColor String Color of the player to show the broadcast to
|
---@param playerColor String Color of the player to show the broadcast to
|
||||||
BlessCurseManagerApi.removeAll = function(playerColor)
|
BlessCurseManagerApi.removeAll = function(playerColor)
|
||||||
getObjectFromGUID(MANAGER_GUID).call("doRemove", playerColor)
|
getManager().call("doRemove", playerColor)
|
||||||
end
|
end
|
||||||
|
|
||||||
-- adds Wendy's menu to the hovered card (allows sealing of tokens)
|
-- adds Wendy's menu to the hovered card (allows sealing of tokens)
|
||||||
---@param color String Color of the player to show the broadcast to
|
---@param color String Color of the player to show the broadcast to
|
||||||
BlessCurseManagerApi.addWendysMenu = function(playerColor, hoveredObject)
|
BlessCurseManagerApi.addWendysMenu = function(playerColor, hoveredObject)
|
||||||
getObjectFromGUID(MANAGER_GUID).call("addMenuOptions", { playerColor = playerColor, hoveredObject = hoveredObject })
|
getManager().call("addMenuOptions", { playerColor = playerColor, hoveredObject = hoveredObject })
|
||||||
end
|
end
|
||||||
|
|
||||||
return BlessCurseManagerApi
|
return BlessCurseManagerApi
|
||||||
@ -432,4 +427,44 @@ do
|
|||||||
return ChaosBagApi
|
return ChaosBagApi
|
||||||
end
|
end
|
||||||
end)
|
end)
|
||||||
|
__bundle_register("core/GUIDReferenceApi", function(require, _LOADED, __bundle_register, __bundle_modules)
|
||||||
|
do
|
||||||
|
local GUIDReferenceApi = {}
|
||||||
|
|
||||||
|
local function getGuidHandler()
|
||||||
|
return getObjectFromGUID("123456")
|
||||||
|
end
|
||||||
|
|
||||||
|
-- returns all matching objects as a table with references
|
||||||
|
---@param owner String Parent object for this search
|
||||||
|
---@param type String Type of object to search for
|
||||||
|
GUIDReferenceApi.getObjectByOwnerAndType = function(owner, type)
|
||||||
|
return getGuidHandler().call("getObjectByOwnerAndType", { owner = owner, type = type })
|
||||||
|
end
|
||||||
|
|
||||||
|
-- returns all matching objects as a table with references
|
||||||
|
---@param type String Type of object to search for
|
||||||
|
GUIDReferenceApi.getObjectsByType = function(type)
|
||||||
|
return getGuidHandler().call("getObjectsByType", type)
|
||||||
|
end
|
||||||
|
|
||||||
|
-- returns all matching objects as a table with references
|
||||||
|
---@param owner String Parent object for this search
|
||||||
|
GUIDReferenceApi.getObjectsByOwner = function(owner)
|
||||||
|
return getGuidHandler().call("getObjectsByOwner", owner)
|
||||||
|
end
|
||||||
|
|
||||||
|
return GUIDReferenceApi
|
||||||
|
end
|
||||||
|
end)
|
||||||
|
__bundle_register("__root", function(require, _LOADED, __bundle_register, __bundle_modules)
|
||||||
|
require("playercards/cards/DayofReckoning")
|
||||||
|
end)
|
||||||
|
__bundle_register("playercards/cards/DayofReckoning", function(require, _LOADED, __bundle_register, __bundle_modules)
|
||||||
|
VALID_TOKENS = {
|
||||||
|
["Elder Sign"] = true
|
||||||
|
}
|
||||||
|
|
||||||
|
require("playercards/CardsThatSealTokens")
|
||||||
|
end)
|
||||||
return __bundle_require("__root")
|
return __bundle_require("__root")
|
@ -12,7 +12,7 @@ CustomDeck:
|
|||||||
'2664':
|
'2664':
|
||||||
BackIsHidden: true
|
BackIsHidden: true
|
||||||
BackURL: http://cloud-3.steamusercontent.com/ugc/1874087305860121579/39578AC78E34DAA169AB4DE4246BB1E002528B8C/
|
BackURL: http://cloud-3.steamusercontent.com/ugc/1874087305860121579/39578AC78E34DAA169AB4DE4246BB1E002528B8C/
|
||||||
FaceURL: http://cloud-3.steamusercontent.com/ugc/1874087305860119704/FCC908E5C313759E9E478D5952C74179DF80ADA8/
|
FaceURL: http://cloud-3.steamusercontent.com/ugc/2021605474902965618/1DA915D6106D951592457701CBA262B73CBEDE6B/
|
||||||
NumHeight: 5
|
NumHeight: 5
|
||||||
NumWidth: 7
|
NumWidth: 7
|
||||||
Type: 0
|
Type: 0
|
||||||
|
@ -12,7 +12,7 @@ CustomDeck:
|
|||||||
'3':
|
'3':
|
||||||
BackIsHidden: true
|
BackIsHidden: true
|
||||||
BackURL: https://i.imgur.com/EcbhVuh.jpg/
|
BackURL: https://i.imgur.com/EcbhVuh.jpg/
|
||||||
FaceURL: http://cloud-3.steamusercontent.com/ugc/2021607899142908284/92DF67E4310BCDFAD6C4BB12D31155DBF6B07A25/
|
FaceURL: http://cloud-3.steamusercontent.com/ugc/2115061845812962486/A68B8BF7E4862F21369DAC4A37D813EC664EAC34/
|
||||||
NumHeight: 6
|
NumHeight: 6
|
||||||
NumWidth: 10
|
NumWidth: 10
|
||||||
Type: 0
|
Type: 0
|
||||||
|
@ -12,7 +12,7 @@ CustomDeck:
|
|||||||
'3':
|
'3':
|
||||||
BackIsHidden: true
|
BackIsHidden: true
|
||||||
BackURL: https://i.imgur.com/EcbhVuh.jpg/
|
BackURL: https://i.imgur.com/EcbhVuh.jpg/
|
||||||
FaceURL: http://cloud-3.steamusercontent.com/ugc/2021607899142908284/92DF67E4310BCDFAD6C4BB12D31155DBF6B07A25/
|
FaceURL: http://cloud-3.steamusercontent.com/ugc/2115061845812962486/A68B8BF7E4862F21369DAC4A37D813EC664EAC34/
|
||||||
NumHeight: 6
|
NumHeight: 6
|
||||||
NumWidth: 10
|
NumWidth: 10
|
||||||
Type: 0
|
Type: 0
|
||||||
|
@ -12,7 +12,7 @@ CustomDeck:
|
|||||||
'3':
|
'3':
|
||||||
BackIsHidden: true
|
BackIsHidden: true
|
||||||
BackURL: https://i.imgur.com/EcbhVuh.jpg/
|
BackURL: https://i.imgur.com/EcbhVuh.jpg/
|
||||||
FaceURL: http://cloud-3.steamusercontent.com/ugc/2021607899142908284/92DF67E4310BCDFAD6C4BB12D31155DBF6B07A25/
|
FaceURL: http://cloud-3.steamusercontent.com/ugc/2115061845812962486/A68B8BF7E4862F21369DAC4A37D813EC664EAC34/
|
||||||
NumHeight: 6
|
NumHeight: 6
|
||||||
NumWidth: 10
|
NumWidth: 10
|
||||||
Type: 0
|
Type: 0
|
||||||
|
@ -12,7 +12,7 @@ CustomDeck:
|
|||||||
'3':
|
'3':
|
||||||
BackIsHidden: true
|
BackIsHidden: true
|
||||||
BackURL: https://i.imgur.com/EcbhVuh.jpg/
|
BackURL: https://i.imgur.com/EcbhVuh.jpg/
|
||||||
FaceURL: http://cloud-3.steamusercontent.com/ugc/2021607899142908284/92DF67E4310BCDFAD6C4BB12D31155DBF6B07A25/
|
FaceURL: http://cloud-3.steamusercontent.com/ugc/2115061845812962486/A68B8BF7E4862F21369DAC4A37D813EC664EAC34/
|
||||||
NumHeight: 6
|
NumHeight: 6
|
||||||
NumWidth: 10
|
NumWidth: 10
|
||||||
Type: 0
|
Type: 0
|
||||||
|
@ -12,7 +12,7 @@ CustomDeck:
|
|||||||
'3':
|
'3':
|
||||||
BackIsHidden: true
|
BackIsHidden: true
|
||||||
BackURL: https://i.imgur.com/EcbhVuh.jpg/
|
BackURL: https://i.imgur.com/EcbhVuh.jpg/
|
||||||
FaceURL: http://cloud-3.steamusercontent.com/ugc/2021607899142908284/92DF67E4310BCDFAD6C4BB12D31155DBF6B07A25/
|
FaceURL: http://cloud-3.steamusercontent.com/ugc/2115061845812962486/A68B8BF7E4862F21369DAC4A37D813EC664EAC34/
|
||||||
NumHeight: 6
|
NumHeight: 6
|
||||||
NumWidth: 10
|
NumWidth: 10
|
||||||
Type: 0
|
Type: 0
|
||||||
|
@ -19,9 +19,10 @@ CustomDeck:
|
|||||||
UniqueBack: false
|
UniqueBack: false
|
||||||
Description: ''
|
Description: ''
|
||||||
DragSelectable: true
|
DragSelectable: true
|
||||||
GMNotes: "{\r\n \"id\": \"03239\",\r\n \"type\": \"Event\",\r\n \"class\": \"Neutral\",\r\n
|
GMNotes: "{\n \"id\": \"03239\",\n \"type\": \"Event\",\n \"class\": \"Neutral\",\n
|
||||||
\ \"cost\": 0,\r\n \"level\": 3,\r\n \"traits\": \"Supply.\",\r\n \"cycle\":
|
\ \"cost\": 0,\n \"level\": 3,\n \"traits\": \"Supply.\",\n \"uses\": [\n {\n
|
||||||
\"The Path to Carcosa\"\r\n}\r"
|
\ \"count\": 4,\n \"type\": \"Supply\",\n \"token\": \"resource\"\n
|
||||||
|
\ }\n ],\n \"cycle\": \"The Path to Carcosa\"\n}"
|
||||||
GUID: 408cb5
|
GUID: 408cb5
|
||||||
Grid: true
|
Grid: true
|
||||||
GridProjection: false
|
GridProjection: false
|
||||||
|
@ -12,7 +12,7 @@ CustomDeck:
|
|||||||
'3':
|
'3':
|
||||||
BackIsHidden: true
|
BackIsHidden: true
|
||||||
BackURL: https://i.imgur.com/EcbhVuh.jpg/
|
BackURL: https://i.imgur.com/EcbhVuh.jpg/
|
||||||
FaceURL: http://cloud-3.steamusercontent.com/ugc/2021607899142908284/92DF67E4310BCDFAD6C4BB12D31155DBF6B07A25/
|
FaceURL: http://cloud-3.steamusercontent.com/ugc/2115061845812962486/A68B8BF7E4862F21369DAC4A37D813EC664EAC34/
|
||||||
NumHeight: 6
|
NumHeight: 6
|
||||||
NumWidth: 10
|
NumWidth: 10
|
||||||
Type: 0
|
Type: 0
|
||||||
|
@ -12,7 +12,7 @@ CustomDeck:
|
|||||||
'3':
|
'3':
|
||||||
BackIsHidden: true
|
BackIsHidden: true
|
||||||
BackURL: https://i.imgur.com/EcbhVuh.jpg/
|
BackURL: https://i.imgur.com/EcbhVuh.jpg/
|
||||||
FaceURL: http://cloud-3.steamusercontent.com/ugc/2021607899142908284/92DF67E4310BCDFAD6C4BB12D31155DBF6B07A25/
|
FaceURL: http://cloud-3.steamusercontent.com/ugc/2115061845812962486/A68B8BF7E4862F21369DAC4A37D813EC664EAC34/
|
||||||
NumHeight: 6
|
NumHeight: 6
|
||||||
NumWidth: 10
|
NumWidth: 10
|
||||||
Type: 0
|
Type: 0
|
||||||
|
@ -12,7 +12,7 @@ CustomDeck:
|
|||||||
'3':
|
'3':
|
||||||
BackIsHidden: true
|
BackIsHidden: true
|
||||||
BackURL: https://i.imgur.com/EcbhVuh.jpg/
|
BackURL: https://i.imgur.com/EcbhVuh.jpg/
|
||||||
FaceURL: http://cloud-3.steamusercontent.com/ugc/2021607899142908284/92DF67E4310BCDFAD6C4BB12D31155DBF6B07A25/
|
FaceURL: http://cloud-3.steamusercontent.com/ugc/2115061845812962486/A68B8BF7E4862F21369DAC4A37D813EC664EAC34/
|
||||||
NumHeight: 6
|
NumHeight: 6
|
||||||
NumWidth: 10
|
NumWidth: 10
|
||||||
Type: 0
|
Type: 0
|
||||||
|
@ -41,12 +41,208 @@ local __bundle_require, __bundle_loaded, __bundle_register, __bundle_modules = (
|
|||||||
|
|
||||||
return require, loaded, register, modules
|
return require, loaded, register, modules
|
||||||
end)(nil)
|
end)(nil)
|
||||||
|
__bundle_register("core/GUIDReferenceApi", function(require, _LOADED, __bundle_register, __bundle_modules)
|
||||||
|
do
|
||||||
|
local GUIDReferenceApi = {}
|
||||||
|
|
||||||
|
local function getGuidHandler()
|
||||||
|
return getObjectFromGUID("123456")
|
||||||
|
end
|
||||||
|
|
||||||
|
-- returns all matching objects as a table with references
|
||||||
|
---@param owner String Parent object for this search
|
||||||
|
---@param type String Type of object to search for
|
||||||
|
GUIDReferenceApi.getObjectByOwnerAndType = function(owner, type)
|
||||||
|
return getGuidHandler().call("getObjectByOwnerAndType", { owner = owner, type = type })
|
||||||
|
end
|
||||||
|
|
||||||
|
-- returns all matching objects as a table with references
|
||||||
|
---@param type String Type of object to search for
|
||||||
|
GUIDReferenceApi.getObjectsByType = function(type)
|
||||||
|
return getGuidHandler().call("getObjectsByType", type)
|
||||||
|
end
|
||||||
|
|
||||||
|
-- returns all matching objects as a table with references
|
||||||
|
---@param owner String Parent object for this search
|
||||||
|
GUIDReferenceApi.getObjectsByOwner = function(owner)
|
||||||
|
return getGuidHandler().call("getObjectsByOwner", owner)
|
||||||
|
end
|
||||||
|
|
||||||
|
return GUIDReferenceApi
|
||||||
|
end
|
||||||
|
end)
|
||||||
|
__bundle_register("core/OptionPanelApi", function(require, _LOADED, __bundle_register, __bundle_modules)
|
||||||
|
do
|
||||||
|
local OptionPanelApi = {}
|
||||||
|
|
||||||
|
-- loads saved options
|
||||||
|
---@param options Table New options table
|
||||||
|
OptionPanelApi.loadSettings = function(options)
|
||||||
|
return Global.call("loadSettings", options)
|
||||||
|
end
|
||||||
|
|
||||||
|
-- returns option panel table
|
||||||
|
OptionPanelApi.getOptions = function()
|
||||||
|
return Global.getTable("optionPanel")
|
||||||
|
end
|
||||||
|
|
||||||
|
return OptionPanelApi
|
||||||
|
end
|
||||||
|
end)
|
||||||
|
__bundle_register("core/PlayAreaApi", function(require, _LOADED, __bundle_register, __bundle_modules)
|
||||||
|
do
|
||||||
|
local PlayAreaApi = {}
|
||||||
|
local guidReferenceApi = require("core/GUIDReferenceApi")
|
||||||
|
|
||||||
|
local function getPlayArea()
|
||||||
|
return guidReferenceApi.getObjectByOwnerAndType("Mythos", "PlayArea")
|
||||||
|
end
|
||||||
|
|
||||||
|
local function getInvestigatorCounter()
|
||||||
|
return guidReferenceApi.getObjectByOwnerAndType("Mythos", "InvestigatorCounter")
|
||||||
|
end
|
||||||
|
|
||||||
|
-- Returns the current value of the investigator counter from the playmat
|
||||||
|
---@return Integer. Number of investigators currently set on the counter
|
||||||
|
PlayAreaApi.getInvestigatorCount = function()
|
||||||
|
return getInvestigatorCounter().getVar("val")
|
||||||
|
end
|
||||||
|
|
||||||
|
-- Updates the current value of the investigator counter from the playmat
|
||||||
|
---@param count Number of investigators to set on the counter
|
||||||
|
PlayAreaApi.setInvestigatorCount = function(count)
|
||||||
|
getInvestigatorCounter().call("updateVal", count)
|
||||||
|
end
|
||||||
|
|
||||||
|
-- Move all contents on the play area (cards, tokens, etc) one slot in the given direction. Certain
|
||||||
|
-- fixed objects will be ignored, as will anything the player has tagged with 'displacement_excluded'
|
||||||
|
---@param playerColor Color Color of the player requesting the shift for messages
|
||||||
|
PlayAreaApi.shiftContentsUp = function(playerColor)
|
||||||
|
return getPlayArea().call("shiftContentsUp", playerColor)
|
||||||
|
end
|
||||||
|
|
||||||
|
PlayAreaApi.shiftContentsDown = function(playerColor)
|
||||||
|
return getPlayArea().call("shiftContentsDown", playerColor)
|
||||||
|
end
|
||||||
|
|
||||||
|
PlayAreaApi.shiftContentsLeft = function(playerColor)
|
||||||
|
return getPlayArea().call("shiftContentsLeft", playerColor)
|
||||||
|
end
|
||||||
|
|
||||||
|
PlayAreaApi.shiftContentsRight = function(playerColor)
|
||||||
|
return getPlayArea().call("shiftContentsRight", playerColor)
|
||||||
|
end
|
||||||
|
|
||||||
|
-- Reset the play area's tracking of which cards have had tokens spawned.
|
||||||
|
PlayAreaApi.resetSpawnedCards = function()
|
||||||
|
return getPlayArea().call("resetSpawnedCards")
|
||||||
|
end
|
||||||
|
|
||||||
|
-- Event to be called when the current scenario has changed.
|
||||||
|
---@param scenarioName Name of the new scenario
|
||||||
|
PlayAreaApi.onScenarioChanged = function(scenarioName)
|
||||||
|
getPlayArea().call("onScenarioChanged", scenarioName)
|
||||||
|
end
|
||||||
|
|
||||||
|
-- Sets this playmat's snap points to limit snapping to locations or not.
|
||||||
|
-- If matchTypes is false, snap points will be reset to snap all cards.
|
||||||
|
---@param matchTypes Boolean Whether snap points should only snap for the matching card types.
|
||||||
|
PlayAreaApi.setLimitSnapsByType = function(matchCardTypes)
|
||||||
|
getPlayArea().call("setLimitSnapsByType", matchCardTypes)
|
||||||
|
end
|
||||||
|
|
||||||
|
-- Receiver for the Global tryObjectEnterContainer event. Used to clear vector lines from dragged
|
||||||
|
-- cards before they're destroyed by entering the container
|
||||||
|
PlayAreaApi.tryObjectEnterContainer = function(container, object)
|
||||||
|
getPlayArea().call("tryObjectEnterContainer", { container = container, object = object })
|
||||||
|
end
|
||||||
|
|
||||||
|
-- counts the VP on locations in the play area
|
||||||
|
PlayAreaApi.countVP = function()
|
||||||
|
return getPlayArea().call("countVP")
|
||||||
|
end
|
||||||
|
|
||||||
|
-- highlights all locations in the play area without metadata
|
||||||
|
---@param state Boolean True if highlighting should be enabled
|
||||||
|
PlayAreaApi.highlightMissingData = function(state)
|
||||||
|
return getPlayArea().call("highlightMissingData", state)
|
||||||
|
end
|
||||||
|
|
||||||
|
-- highlights all locations in the play area with VP
|
||||||
|
---@param state Boolean True if highlighting should be enabled
|
||||||
|
PlayAreaApi.highlightCountedVP = function(state)
|
||||||
|
return getPlayArea().call("countVP", state)
|
||||||
|
end
|
||||||
|
|
||||||
|
-- Checks if an object is in the play area (returns true or false)
|
||||||
|
PlayAreaApi.isInPlayArea = function(object)
|
||||||
|
return getPlayArea().call("isInPlayArea", object)
|
||||||
|
end
|
||||||
|
|
||||||
|
PlayAreaApi.getSurface = function()
|
||||||
|
return getPlayArea().getCustomObject().image
|
||||||
|
end
|
||||||
|
|
||||||
|
PlayAreaApi.updateSurface = function(url)
|
||||||
|
return getPlayArea().call("updateSurface", url)
|
||||||
|
end
|
||||||
|
|
||||||
|
-- Called by Custom Data Helpers to push their location data into the Data Helper. This adds the
|
||||||
|
-- data to the local token manager instance.
|
||||||
|
---@param args Table Single-value array holding the GUID of the Custom Data Helper making the call
|
||||||
|
PlayAreaApi.updateLocations = function(args)
|
||||||
|
getPlayArea().call("updateLocations", args)
|
||||||
|
end
|
||||||
|
|
||||||
|
PlayAreaApi.getCustomDataHelper = function()
|
||||||
|
return getPlayArea().getVar("customDataHelper")
|
||||||
|
end
|
||||||
|
|
||||||
|
return PlayAreaApi
|
||||||
|
end
|
||||||
|
end)
|
||||||
|
__bundle_register("core/token/TokenSpawnTrackerApi", function(require, _LOADED, __bundle_register, __bundle_modules)
|
||||||
|
do
|
||||||
|
local TokenSpawnTracker = {}
|
||||||
|
local guidReferenceApi = require("core/GUIDReferenceApi")
|
||||||
|
|
||||||
|
local function getSpawnTracker()
|
||||||
|
return guidReferenceApi.getObjectByOwnerAndType("Mythos", "TokenSpawnTracker")
|
||||||
|
end
|
||||||
|
|
||||||
|
TokenSpawnTracker.hasSpawnedTokens = function(cardGuid)
|
||||||
|
return getSpawnTracker().call("hasSpawnedTokens", cardGuid)
|
||||||
|
end
|
||||||
|
|
||||||
|
TokenSpawnTracker.markTokensSpawned = function(cardGuid)
|
||||||
|
return getSpawnTracker().call("markTokensSpawned", cardGuid)
|
||||||
|
end
|
||||||
|
|
||||||
|
TokenSpawnTracker.resetTokensSpawned = function(cardGuid)
|
||||||
|
return getSpawnTracker().call("resetTokensSpawned", cardGuid)
|
||||||
|
end
|
||||||
|
|
||||||
|
TokenSpawnTracker.resetAllAssetAndEvents = function()
|
||||||
|
return getSpawnTracker().call("resetAllAssetAndEvents")
|
||||||
|
end
|
||||||
|
|
||||||
|
TokenSpawnTracker.resetAllLocations = function()
|
||||||
|
return getSpawnTracker().call("resetAllLocations")
|
||||||
|
end
|
||||||
|
|
||||||
|
TokenSpawnTracker.resetAll = function()
|
||||||
|
return getSpawnTracker().call("resetAll")
|
||||||
|
end
|
||||||
|
|
||||||
|
return TokenSpawnTracker
|
||||||
|
end
|
||||||
|
end)
|
||||||
__bundle_register("__root", function(require, _LOADED, __bundle_register, __bundle_modules)
|
__bundle_register("__root", function(require, _LOADED, __bundle_register, __bundle_modules)
|
||||||
require("playercards/cards/FamilyInheritance")
|
require("playercards/cards/FamilyInheritance")
|
||||||
end)
|
end)
|
||||||
__bundle_register("playercards/cards/FamilyInheritance", function(require, _LOADED, __bundle_register, __bundle_modules)
|
__bundle_register("playercards/cards/FamilyInheritance", function(require, _LOADED, __bundle_register, __bundle_modules)
|
||||||
local tokenManager = require("core/token/TokenManager")
|
|
||||||
local playmatApi = require("playermat/PlaymatApi")
|
local playmatApi = require("playermat/PlaymatApi")
|
||||||
|
local tokenManager = require("core/token/TokenManager")
|
||||||
|
|
||||||
local clickableResourceCounter = nil
|
local clickableResourceCounter = nil
|
||||||
local foundTokens = 0
|
local foundTokens = 0
|
||||||
@ -63,8 +259,8 @@ function searchSelf()
|
|||||||
|
|
||||||
for _, obj in ipairs(searchArea(self.getPosition(), { 2.5, 0.5, 3.5 })) do
|
for _, obj in ipairs(searchArea(self.getPosition(), { 2.5, 0.5, 3.5 })) do
|
||||||
local obj = obj.hit_object
|
local obj = obj.hit_object
|
||||||
if obj.getCustomObject().image ==
|
local image = obj.getCustomObject().image
|
||||||
"http://cloud-3.steamusercontent.com/ugc/1758068501357192910/11DDDC7EF621320962FDCF3AE3211D5EDC3D1573/" then
|
if image == "http://cloud-3.steamusercontent.com/ugc/1758068501357192910/11DDDC7EF621320962FDCF3AE3211D5EDC3D1573/" then
|
||||||
foundTokens = foundTokens + math.abs(obj.getQuantity())
|
foundTokens = foundTokens + math.abs(obj.getQuantity())
|
||||||
obj.destruct()
|
obj.destruct()
|
||||||
elseif obj.getMemo() == "resourceCounter" then
|
elseif obj.getMemo() == "resourceCounter" then
|
||||||
@ -94,7 +290,7 @@ end
|
|||||||
function takeAll(playerColor)
|
function takeAll(playerColor)
|
||||||
searchSelf()
|
searchSelf()
|
||||||
local matColor = playmatApi.getMatColorByPosition(self.getPosition())
|
local matColor = playmatApi.getMatColorByPosition(self.getPosition())
|
||||||
playmatApi.gainResources(foundTokens, matColor)
|
playmatApi.updateCounter(matColor, "ResourceCounter", _, foundTokens)
|
||||||
|
|
||||||
if clickableResourceCounter then
|
if clickableResourceCounter then
|
||||||
clickableResourceCounter.call("updateVal", 0)
|
clickableResourceCounter.call("updateVal", 0)
|
||||||
@ -124,6 +320,7 @@ end
|
|||||||
end)
|
end)
|
||||||
__bundle_register("core/token/TokenManager", function(require, _LOADED, __bundle_register, __bundle_modules)
|
__bundle_register("core/token/TokenManager", function(require, _LOADED, __bundle_register, __bundle_modules)
|
||||||
do
|
do
|
||||||
|
local guidReferenceApi = require("core/GUIDReferenceApi")
|
||||||
local optionPanelApi = require("core/OptionPanelApi")
|
local optionPanelApi = require("core/OptionPanelApi")
|
||||||
local playAreaApi = require("core/PlayAreaApi")
|
local playAreaApi = require("core/PlayAreaApi")
|
||||||
local tokenSpawnTrackerApi = require("core/token/TokenSpawnTrackerApi")
|
local tokenSpawnTrackerApi = require("core/token/TokenSpawnTrackerApi")
|
||||||
@ -244,15 +441,10 @@ do
|
|||||||
["supply"] = 7
|
["supply"] = 7
|
||||||
}
|
}
|
||||||
|
|
||||||
-- Source for tokens
|
|
||||||
local TOKEN_SOURCE_GUID = "124381"
|
|
||||||
|
|
||||||
-- Table of data extracted from the token source bag, keyed by the Memo on each token which
|
-- Table of data extracted from the token source bag, keyed by the Memo on each token which
|
||||||
-- should match the token type keys ("resource", "clue", etc)
|
-- should match the token type keys ("resource", "clue", etc)
|
||||||
local tokenTemplates
|
local tokenTemplates
|
||||||
|
|
||||||
local DATA_HELPER_GUID = "708279"
|
|
||||||
|
|
||||||
local playerCardData
|
local playerCardData
|
||||||
local locationData
|
local locationData
|
||||||
|
|
||||||
@ -350,9 +542,11 @@ do
|
|||||||
-- Copy the offsets to make sure we don't change the static values
|
-- Copy the offsets to make sure we don't change the static values
|
||||||
local baseOffsets = offsets
|
local baseOffsets = offsets
|
||||||
offsets = { }
|
offsets = { }
|
||||||
|
|
||||||
|
-- get a vector for the shifting (downwards local to the card)
|
||||||
|
local shiftDownVector = Vector(0, 0, shiftDown):rotateOver("y", card.getRotation().y)
|
||||||
for i, baseOffset in ipairs(baseOffsets) do
|
for i, baseOffset in ipairs(baseOffsets) do
|
||||||
offsets[i] = baseOffset
|
offsets[i] = baseOffset + shiftDownVector
|
||||||
offsets[i][3] = offsets[i][3] + shiftDown
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
@ -466,7 +660,7 @@ do
|
|||||||
return
|
return
|
||||||
end
|
end
|
||||||
tokenTemplates = {}
|
tokenTemplates = {}
|
||||||
local tokenSource = getObjectFromGUID(TOKEN_SOURCE_GUID)
|
local tokenSource = guidReferenceApi.getObjectByOwnerAndType("Mythos", "TokenSource")
|
||||||
for _, tokenTemplate in ipairs(tokenSource.getData().ContainedObjects) do
|
for _, tokenTemplate in ipairs(tokenSource.getData().ContainedObjects) do
|
||||||
local tokenName = tokenTemplate.Memo
|
local tokenName = tokenTemplate.Memo
|
||||||
tokenTemplates[tokenName] = tokenTemplate
|
tokenTemplates[tokenName] = tokenTemplate
|
||||||
@ -478,7 +672,7 @@ do
|
|||||||
if playerCardData ~= nil then
|
if playerCardData ~= nil then
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
local dataHelper = getObjectFromGUID(DATA_HELPER_GUID)
|
local dataHelper = guidReferenceApi.getObjectByOwnerAndType("Mythos", "DataHelper")
|
||||||
playerCardData = dataHelper.getTable('PLAYER_CARD_DATA')
|
playerCardData = dataHelper.getTable('PLAYER_CARD_DATA')
|
||||||
locationData = dataHelper.getTable('LOCATIONS_DATA')
|
locationData = dataHelper.getTable('LOCATIONS_DATA')
|
||||||
end
|
end
|
||||||
@ -493,18 +687,16 @@ do
|
|||||||
if uses == nil then return end
|
if uses == nil then return end
|
||||||
|
|
||||||
-- go through tokens to spawn
|
-- go through tokens to spawn
|
||||||
local type, token, tokenCount
|
local tokenCount
|
||||||
for i, useInfo in ipairs(uses) do
|
for i, useInfo in ipairs(uses) do
|
||||||
type = useInfo.type
|
tokenCount = (useInfo.count or 0) + (useInfo.countPerInvestigator or 0) * playAreaApi.getInvestigatorCount()
|
||||||
token = useInfo.token
|
if extraUses ~= nil and extraUses[useInfo.type] ~= nil then
|
||||||
tokenCount = (useInfo.count or 0)
|
tokenCount = tokenCount + extraUses[useInfo.type]
|
||||||
+ (useInfo.countPerInvestigator or 0) * playAreaApi.getInvestigatorCount()
|
|
||||||
if extraUses ~= nil and extraUses[type] ~= nil then
|
|
||||||
tokenCount = tokenCount + extraUses[type]
|
|
||||||
end
|
end
|
||||||
-- Shift each spawned group after the first down so they don't pile on each other
|
-- Shift each spawned group after the first down so they don't pile on each other
|
||||||
TokenManager.spawnTokenGroup(card, token, tokenCount, (i - 1) * 0.8, type)
|
TokenManager.spawnTokenGroup(card, useInfo.token, tokenCount, (i - 1) * 0.8, useInfo.type)
|
||||||
end
|
end
|
||||||
|
|
||||||
tokenSpawnTrackerApi.markTokensSpawned(card.getGUID())
|
tokenSpawnTrackerApi.markTokensSpawned(card.getGUID())
|
||||||
end
|
end
|
||||||
|
|
||||||
@ -528,9 +720,8 @@ do
|
|||||||
---@param playerData Table Player card data structure retrieved from the DataHelper. Should be
|
---@param playerData Table Player card data structure retrieved from the DataHelper. Should be
|
||||||
-- the right data for this card.
|
-- the right data for this card.
|
||||||
internal.spawnPlayerCardTokensFromDataHelper = function(card, playerData)
|
internal.spawnPlayerCardTokensFromDataHelper = function(card, playerData)
|
||||||
token = playerData.tokenType
|
local token = playerData.tokenType
|
||||||
tokenCount = playerData.tokenCount
|
local tokenCount = playerData.tokenCount
|
||||||
--log("Spawning data helper tokens for "..card.getName()..'['..card.getDescription()..']: '..tokenCount.."x "..token)
|
|
||||||
TokenManager.spawnTokenGroup(card, token, tokenCount)
|
TokenManager.spawnTokenGroup(card, token, tokenCount)
|
||||||
tokenSpawnTrackerApi.markTokensSpawned(card.getGUID())
|
tokenSpawnTrackerApi.markTokensSpawned(card.getGUID())
|
||||||
end
|
end
|
||||||
@ -563,7 +754,6 @@ do
|
|||||||
return 0
|
return 0
|
||||||
end
|
end
|
||||||
|
|
||||||
--log(card.getName() .. ' : ' .. locationData.type .. ' : ' .. locationData.value .. ' : ' .. locationData.clueSide)
|
|
||||||
if ((card.is_face_down and locationData.clueSide == 'back')
|
if ((card.is_face_down and locationData.clueSide == 'back')
|
||||||
or (not card.is_face_down and locationData.clueSide == 'front')) then
|
or (not card.is_face_down and locationData.clueSide == 'front')) then
|
||||||
if locationData.type == 'fixed' then
|
if locationData.type == 'fixed' then
|
||||||
@ -676,386 +866,232 @@ end)
|
|||||||
__bundle_register("playermat/PlaymatApi", function(require, _LOADED, __bundle_register, __bundle_modules)
|
__bundle_register("playermat/PlaymatApi", function(require, _LOADED, __bundle_register, __bundle_modules)
|
||||||
do
|
do
|
||||||
local PlaymatApi = {}
|
local PlaymatApi = {}
|
||||||
local internal = { }
|
local guidReferenceApi = require("core/GUIDReferenceApi")
|
||||||
|
|
||||||
local MAT_IDS = {
|
-- Convenience function to look up a mat's object by color, or get all mats.
|
||||||
White = "8b081b",
|
---@param matColor String Color of the playmat - White, Orange, Green, Red or All
|
||||||
Orange = "bd0ff4",
|
---@return array Table Single-element if only single playmat is requested
|
||||||
Green = "383d8b",
|
local function getMatForColor(matColor)
|
||||||
Red = "0840d5"
|
if matColor == "All" then
|
||||||
}
|
return guidReferenceApi.getObjectsByType("Playermat")
|
||||||
|
else
|
||||||
|
return { matColor = guidReferenceApi.getObjectByOwnerAndType(matColor, "Playermat") }
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
local CLUE_COUNTER_GUIDS = {
|
-- Returns the color of the closest playmat
|
||||||
White = "37be78",
|
---@param startPos Table Starting position to get the closest mat from
|
||||||
Orange = "1769ed",
|
|
||||||
Green = "032300",
|
|
||||||
Red = "d86b7c"
|
|
||||||
}
|
|
||||||
|
|
||||||
local CLUE_CLICKER_GUIDS = {
|
|
||||||
White = "db85d6",
|
|
||||||
Orange = "3f22e5",
|
|
||||||
Green = "891403",
|
|
||||||
Red = "4111de"
|
|
||||||
}
|
|
||||||
|
|
||||||
-- Returns the color of the by position requested playermat as string
|
|
||||||
---@param startPos Table Position of the search, table get's roughly cut into 4 quarters to assign a playermat
|
|
||||||
PlaymatApi.getMatColorByPosition = function(startPos)
|
PlaymatApi.getMatColorByPosition = function(startPos)
|
||||||
if startPos.x < -42 then
|
local result, smallestDistance
|
||||||
if startPos.z > 0 then
|
for matColor, mat in pairs(getMatForColor("All")) do
|
||||||
return "White"
|
local distance = Vector.between(startPos, mat.getPosition()):magnitude()
|
||||||
else
|
if smallestDistance == nil or distance < smallestDistance then
|
||||||
return "Orange"
|
smallestDistance = distance
|
||||||
end
|
result = matColor
|
||||||
else
|
|
||||||
if startPos.z > 0 then
|
|
||||||
return "Green"
|
|
||||||
else
|
|
||||||
return "Red"
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
return result
|
||||||
end
|
end
|
||||||
|
|
||||||
-- Returns the color of the player's hand that is seated next to the playermat
|
-- Returns the color of the player's hand that is seated next to the playmat
|
||||||
---@param matColor String Color of the playermat
|
---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support "All")
|
||||||
PlaymatApi.getPlayerColor = function(matColor)
|
PlaymatApi.getPlayerColor = function(matColor)
|
||||||
local mat = getObjectFromGUID(MAT_IDS[matColor])
|
for _, mat in pairs(getMatForColor(matColor)) do
|
||||||
return mat.getVar("playerColor")
|
return mat.getVar("playerColor")
|
||||||
end
|
end
|
||||||
|
end
|
||||||
|
|
||||||
-- Returns the color of the playermat that owns the playercolor's hand
|
-- Returns the color of the playmat that owns the playercolor's hand
|
||||||
---@param handColor String Color of the playermat
|
---@param handColor String Color of the playmat
|
||||||
PlaymatApi.getMatColor = function(handColor)
|
PlaymatApi.getMatColor = function(handColor)
|
||||||
local matColors = {"White", "Orange", "Green", "Red"}
|
for matColor, mat in pairs(getMatForColor("All")) do
|
||||||
for i, mat in ipairs(internal.getMatForColor("All")) do
|
local playerColor = mat.getVar("playerColor")
|
||||||
local color = mat.getVar("playerColor")
|
if playerColor == handColor then
|
||||||
if color == handColor then return matColors[i] end
|
return matColor
|
||||||
|
end
|
||||||
end
|
end
|
||||||
return "NOT_FOUND"
|
|
||||||
end
|
end
|
||||||
|
|
||||||
-- Returns the result of a cast in the specificed playermat's area
|
-- Returns if there is the card "Dream-Enhancing Serum" on the requested playmat
|
||||||
---@param matColor String Color of the playermat
|
---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support "All")
|
||||||
PlaymatApi.searchPlaymat = function(matColor)
|
|
||||||
local mat = getObjectFromGUID(MAT_IDS[matColor])
|
|
||||||
return mat.call("searchAroundSelf")
|
|
||||||
end
|
|
||||||
|
|
||||||
-- Returns if there is the card "Dream-Enhancing Serum" on the requested playermat
|
|
||||||
---@param matColor String Color of the playermat
|
|
||||||
PlaymatApi.isDES = function(matColor)
|
PlaymatApi.isDES = function(matColor)
|
||||||
local mat = getObjectFromGUID(MAT_IDS[matColor])
|
for _, mat in pairs(getMatForColor(matColor)) do
|
||||||
return mat.getVar("isDES")
|
return mat.getVar("isDES")
|
||||||
end
|
end
|
||||||
|
end
|
||||||
|
|
||||||
-- Returns the draw deck of the requested playmat
|
-- Performs a search of the deck area of the requested playmat and returns the result as table
|
||||||
---@param matColor String Color of the playermat
|
---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support "All")
|
||||||
PlaymatApi.getDrawDeck = function(matColor)
|
PlaymatApi.getDeckAreaObjects = function(matColor)
|
||||||
local mat = getObjectFromGUID(MAT_IDS[matColor])
|
for _, mat in pairs(getMatForColor(matColor)) do
|
||||||
mat.call("getDrawDiscardDecks")
|
return mat.call("getDeckAreaObjects")
|
||||||
return mat.getVar("drawDeck")
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
-- Flips the top card of the deck (useful after deck manipulation for Norman Withers)
|
||||||
|
---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support "All")
|
||||||
|
PlaymatApi.flipTopCardFromDeck = function(matColor)
|
||||||
|
for _, mat in pairs(getMatForColor(matColor)) do
|
||||||
|
return mat.call("flipTopCardFromDeck")
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
-- Returns the position of the discard pile of the requested playmat
|
-- Returns the position of the discard pile of the requested playmat
|
||||||
---@param matColor String Color of the playermat
|
---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support "All")
|
||||||
PlaymatApi.getDiscardPosition = function(matColor)
|
PlaymatApi.getDiscardPosition = function(matColor)
|
||||||
local mat = getObjectFromGUID(MAT_IDS[matColor])
|
for _, mat in pairs(getMatForColor(matColor)) do
|
||||||
return mat.call("returnGlobalDiscardPosition")
|
return mat.call("returnGlobalDiscardPosition")
|
||||||
end
|
end
|
||||||
|
end
|
||||||
|
|
||||||
-- Transforms a local position into a global position
|
-- Transforms a local position into a global position
|
||||||
---@param localPos Table Local position to be transformed
|
---@param localPos Table Local position to be transformed
|
||||||
---@param matColor String Color of the playermat
|
---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support "All")
|
||||||
PlaymatApi.transformLocalPosition = function(localPos, matColor)
|
PlaymatApi.transformLocalPosition = function(localPos, matColor)
|
||||||
local mat = getObjectFromGUID(MAT_IDS[matColor])
|
for _, mat in pairs(getMatForColor(matColor)) do
|
||||||
return mat.positionToWorld(localPos)
|
return mat.positionToWorld(localPos)
|
||||||
end
|
end
|
||||||
|
end
|
||||||
|
|
||||||
-- Returns the rotation of the requested playmat
|
-- Returns the rotation of the requested playmat
|
||||||
---@param matColor String Color of the playermat
|
---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support "All")
|
||||||
PlaymatApi.returnRotation = function(matColor)
|
PlaymatApi.returnRotation = function(matColor)
|
||||||
local mat = getObjectFromGUID(MAT_IDS[matColor])
|
for _, mat in pairs(getMatForColor(matColor)) do
|
||||||
return mat.getRotation()
|
return mat.getRotation()
|
||||||
end
|
end
|
||||||
|
end
|
||||||
|
|
||||||
-- Triggers the Upkeep for the requested playmat
|
-- Triggers the Upkeep for the requested playmat
|
||||||
---@param matColor String Color of the playermat
|
---@param matColor String Color of the playmat - White, Orange, Green, Red or All
|
||||||
---@param playerColor String Color of the calling player (for messages)
|
---@param playerColor String Color of the calling player (for messages)
|
||||||
PlaymatApi.doUpkeepFromHotkey = function(matColor, playerColor)
|
PlaymatApi.doUpkeepFromHotkey = function(matColor, playerColor)
|
||||||
local mat = getObjectFromGUID(MAT_IDS[matColor])
|
for _, mat in pairs(getMatForColor(matColor)) do
|
||||||
return mat.call("doUpkeepFromHotkey", playerColor)
|
mat.call("doUpkeepFromHotkey", playerColor)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
-- Handles discarding for the requested playmat for the provided list of objects
|
||||||
|
---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support "All")
|
||||||
|
---@param objList Table List of objects to discard
|
||||||
|
PlaymatApi.discardListOfObjects = function(matColor, objList)
|
||||||
|
for _, mat in pairs(getMatForColor(matColor)) do
|
||||||
|
mat.call("discardListOfObjects", objList)
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
-- Returns the active investigator id
|
-- Returns the active investigator id
|
||||||
---@param matColor String Color of the playermat
|
---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support "All")
|
||||||
PlaymatApi.returnInvestigatorId = function(matColor)
|
PlaymatApi.returnInvestigatorId = function(matColor)
|
||||||
local mat = getObjectFromGUID(MAT_IDS[matColor])
|
for _, mat in pairs(getMatForColor(matColor)) do
|
||||||
return mat.getVar("activeInvestigatorId")
|
return mat.getVar("activeInvestigatorId")
|
||||||
end
|
end
|
||||||
|
end
|
||||||
|
|
||||||
-- Sets the requested playermat's snap points to limit snapping to matching card types or not. If
|
-- Sets the requested playmat's snap points to limit snapping to matching card types or not. If
|
||||||
-- matchTypes is true, the main card slot snap points will only snap assets, while the
|
-- matchTypes is true, the main card slot snap points will only snap assets, while the
|
||||||
-- investigator area point will only snap Investigators. If matchTypes is false, snap points will
|
-- investigator area point will only snap Investigators. If matchTypes is false, snap points will
|
||||||
-- be reset to snap all cards.
|
-- be reset to snap all cards.
|
||||||
---@param matchCardTypes Boolean. Whether snap points should only snap for the matching card
|
---@param matchCardTypes Boolean Whether snap points should only snap for the matching card types
|
||||||
-- types.
|
---@param matColor String Color of the playmat - White, Orange, Green, Red or All
|
||||||
---@param matColor String for one of the active player colors - White, Orange, Green, Red. Also
|
|
||||||
-- accepts "All" as a special value which will apply the setting to all four mats.
|
|
||||||
PlaymatApi.setLimitSnapsByType = function(matchCardTypes, matColor)
|
PlaymatApi.setLimitSnapsByType = function(matchCardTypes, matColor)
|
||||||
for _, mat in ipairs(internal.getMatForColor(matColor)) do
|
for _, mat in pairs(getMatForColor(matColor)) do
|
||||||
mat.call("setLimitSnapsByType", matchCardTypes)
|
mat.call("setLimitSnapsByType", matchCardTypes)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
-- Sets the requested playermat's draw 1 button to visible
|
-- Sets the requested playmat's draw 1 button to visible
|
||||||
---@param isDrawButtonVisible Boolean. Whether the draw 1 button should be visible or not
|
---@param isDrawButtonVisible Boolean Whether the draw 1 button should be visible or not
|
||||||
---@param matColor String for one of the active player colors - White, Orange, Green, Red. Also
|
---@param matColor String Color of the playmat - White, Orange, Green, Red or All
|
||||||
-- accepts "All" as a special value which will apply the setting to all four mats.
|
|
||||||
PlaymatApi.showDrawButton = function(isDrawButtonVisible, matColor)
|
PlaymatApi.showDrawButton = function(isDrawButtonVisible, matColor)
|
||||||
for _, mat in ipairs(internal.getMatForColor(matColor)) do
|
for _, mat in pairs(getMatForColor(matColor)) do
|
||||||
mat.call("showDrawButton", isDrawButtonVisible)
|
mat.call("showDrawButton", isDrawButtonVisible)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
-- Shows or hides the clickable clue counter for the requested playermat
|
-- Shows or hides the clickable clue counter for the requested playmat
|
||||||
---@param showCounter Boolean. Whether the clickable counter should be present or not
|
---@param showCounter Boolean Whether the clickable counter should be present or not
|
||||||
---@param matColor String for one of the active player colors - White, Orange, Green, Red. Also
|
---@param matColor String Color of the playmat - White, Orange, Green, Red or All
|
||||||
-- accepts "All" as a special value which will apply the setting to all four mats.
|
|
||||||
PlaymatApi.clickableClues = function(showCounter, matColor)
|
PlaymatApi.clickableClues = function(showCounter, matColor)
|
||||||
for _, mat in ipairs(internal.getMatForColor(matColor)) do
|
for _, mat in pairs(getMatForColor(matColor)) do
|
||||||
mat.call("clickableClues", showCounter)
|
mat.call("clickableClues", showCounter)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
-- Removes all clues (to the trash for tokens and counters set to 0) for the requested playermat
|
-- Removes all clues (to the trash for tokens and counters set to 0) for the requested playmat
|
||||||
---@param matColor String for one of the active player colors - White, Orange, Green, Red. Also
|
---@param matColor String Color of the playmat - White, Orange, Green, Red or All
|
||||||
-- accepts "All" as a special value which will apply the setting to all four mats.
|
|
||||||
PlaymatApi.removeClues = function(matColor)
|
PlaymatApi.removeClues = function(matColor)
|
||||||
for _, mat in ipairs(internal.getMatForColor(matColor)) do
|
for _, mat in pairs(getMatForColor(matColor)) do
|
||||||
mat.call("removeClues")
|
mat.call("removeClues")
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
-- Reports the clue count for the requested playermat
|
-- Reports the clue count for the requested playmat
|
||||||
---@param useClickableCounters Boolean Controls which type of counter is getting checked
|
---@param useClickableCounters Boolean Controls which type of counter is getting checked
|
||||||
PlaymatApi.getClueCount = function(useClickableCounters, matColor)
|
PlaymatApi.getClueCount = function(useClickableCounters, matColor)
|
||||||
local count = 0
|
local count = 0
|
||||||
for _, mat in ipairs(internal.getMatForColor(matColor)) do
|
for _, mat in pairs(getMatForColor(matColor)) do
|
||||||
count = count + tonumber(mat.call("getClueCount", useClickableCounters))
|
count = count + mat.call("getClueCount", useClickableCounters)
|
||||||
end
|
end
|
||||||
return count
|
return count
|
||||||
end
|
end
|
||||||
|
|
||||||
-- Adds the specified amount of resources to the requested playermat's resource counter
|
-- updates the specified owned counter
|
||||||
PlaymatApi.gainResources = function(amount, matColor)
|
---@param matColor String Color of the playmat - White, Orange, Green, Red or All
|
||||||
for _, mat in ipairs(internal.getMatForColor(matColor)) do
|
---@param type String Counter to target
|
||||||
mat.call("gainResources", amount)
|
---@param newValue Number Value to set the counter to
|
||||||
|
---@param modifier Number If newValue is not provided, the existing value will be adjusted by this modifier
|
||||||
|
PlaymatApi.updateCounter = function(matColor, type, newValue, modifier)
|
||||||
|
for _, mat in pairs(getMatForColor(matColor)) do
|
||||||
|
mat.call("updateCounter", { type = type, newValue = newValue, modifier = modifier })
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
-- Returns the resource counter amount for the requested playermat
|
-- returns the resource counter amount
|
||||||
PlaymatApi.getResourceCount = function(matColor)
|
---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support "All")
|
||||||
local mat = getObjectFromGUID(MAT_IDS[matColor])
|
---@param type String Counter to target
|
||||||
return mat.call("getResourceCount")
|
PlaymatApi.getCounterValue = function(matColor, type)
|
||||||
|
for _, mat in pairs(getMatForColor(matColor)) do
|
||||||
|
return mat.call("getCounterValue", type)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
-- resets the specified skill tracker to "1, 1, 1, 1"
|
||||||
|
---@param matColor String Color of the playmat - White, Orange, Green, Red or All
|
||||||
|
PlaymatApi.resetSkillTracker = function(matColor)
|
||||||
|
for _, mat in pairs(getMatForColor(matColor)) do
|
||||||
|
mat.call("resetSkillTracker")
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
-- finds all objects on the playmat and associated set aside zone and returns a table
|
||||||
|
---@param matColor String Color of the playmat - White, Orange, Green, Red or All
|
||||||
|
---@param filter Function Optional filter function (return true for desired objects)
|
||||||
|
PlaymatApi.searchAroundPlaymat = function(matColor, filter)
|
||||||
|
local objList = {}
|
||||||
|
for _, mat in pairs(getMatForColor(matColor)) do
|
||||||
|
for _, obj in ipairs(mat.call("searchAroundSelf", filter)) do
|
||||||
|
table.insert(objList, obj)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
return objList
|
||||||
end
|
end
|
||||||
|
|
||||||
-- Discard a non-hidden card from the corresponding player's hand
|
-- Discard a non-hidden card from the corresponding player's hand
|
||||||
|
---@param matColor String Color of the playmat - White, Orange, Green, Red or All
|
||||||
PlaymatApi.doDiscardOne = function(matColor)
|
PlaymatApi.doDiscardOne = function(matColor)
|
||||||
for _, mat in ipairs(internal.getMatForColor(matColor)) do
|
for _, mat in pairs(getMatForColor(matColor)) do
|
||||||
mat.call("doDiscardOne")
|
mat.call("doDiscardOne")
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
-- Triggers the metadata sync for all playmats
|
||||||
PlaymatApi.syncAllCustomizableCards = function()
|
PlaymatApi.syncAllCustomizableCards = function()
|
||||||
for _, mat in ipairs(internal.getMatForColor("All")) do
|
for _, mat in pairs(getMatForColor("All")) do
|
||||||
mat.call("syncAllCustomizableCards")
|
mat.call("syncAllCustomizableCards")
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
PlaymatApi.updateClueClicker = function(playerColor, val)
|
|
||||||
return getObjectFromGUID(CLUE_CLICKER_GUIDS[playerColor]).call("updateVal", val)
|
|
||||||
end
|
|
||||||
|
|
||||||
-- Convenience function to look up a mat's object by color, or get all mats.
|
|
||||||
---@param matColor String for one of the active player colors - White, Orange, Green, Red. Also
|
|
||||||
-- accepts "All" as a special value which will return all four mats.
|
|
||||||
---@return: Array of playermat objects. If a single mat is requested, will return a single-element
|
|
||||||
-- array to simplify processing by consumers.
|
|
||||||
internal.getMatForColor = function(matColor)
|
|
||||||
local targetMatGuid = MAT_IDS[matColor]
|
|
||||||
if targetMatGuid != nil then
|
|
||||||
return { getObjectFromGUID(targetMatGuid) }
|
|
||||||
end
|
|
||||||
if matColor == "All" then
|
|
||||||
return {
|
|
||||||
getObjectFromGUID(MAT_IDS.White),
|
|
||||||
getObjectFromGUID(MAT_IDS.Orange),
|
|
||||||
getObjectFromGUID(MAT_IDS.Green),
|
|
||||||
getObjectFromGUID(MAT_IDS.Red),
|
|
||||||
}
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
return PlaymatApi
|
return PlaymatApi
|
||||||
end
|
end
|
||||||
end)
|
end)
|
||||||
__bundle_register("core/OptionPanelApi", function(require, _LOADED, __bundle_register, __bundle_modules)
|
|
||||||
do
|
|
||||||
local OptionPanelApi = {}
|
|
||||||
|
|
||||||
-- loads saved options
|
|
||||||
---@param options Table New options table
|
|
||||||
OptionPanelApi.loadSettings = function(options)
|
|
||||||
return Global.call("loadSettings", options)
|
|
||||||
end
|
|
||||||
|
|
||||||
-- returns option panel table
|
|
||||||
OptionPanelApi.getOptions = function()
|
|
||||||
return Global.getTable("optionPanel")
|
|
||||||
end
|
|
||||||
|
|
||||||
return OptionPanelApi
|
|
||||||
end
|
|
||||||
end)
|
|
||||||
__bundle_register("core/PlayAreaApi", function(require, _LOADED, __bundle_register, __bundle_modules)
|
|
||||||
do
|
|
||||||
local PlayAreaApi = { }
|
|
||||||
local PLAY_AREA_GUID = "721ba2"
|
|
||||||
local INVESTIGATOR_COUNTER_GUID = "f182ee"
|
|
||||||
|
|
||||||
-- Returns the current value of the investigator counter from the playmat
|
|
||||||
---@return Integer. Number of investigators currently set on the counter
|
|
||||||
PlayAreaApi.getInvestigatorCount = function()
|
|
||||||
return getObjectFromGUID(INVESTIGATOR_COUNTER_GUID).getVar("val")
|
|
||||||
end
|
|
||||||
|
|
||||||
-- Updates the current value of the investigator counter from the playmat
|
|
||||||
---@param count Number of investigators to set on the counter
|
|
||||||
PlayAreaApi.setInvestigatorCount = function(count)
|
|
||||||
return getObjectFromGUID(INVESTIGATOR_COUNTER_GUID).call("updateVal", count)
|
|
||||||
end
|
|
||||||
|
|
||||||
-- Move all contents on the play area (cards, tokens, etc) one slot in the given direction. Certain
|
|
||||||
-- fixed objects will be ignored, as will anything the player has tagged with
|
|
||||||
-- 'displacement_excluded'
|
|
||||||
---@param playerColor Color of the player requesting the shift. Used solely to send an error
|
|
||||||
--- message in the unlikely case that the scripting zone has been deleted
|
|
||||||
PlayAreaApi.shiftContentsUp = function(playerColor)
|
|
||||||
return getObjectFromGUID(PLAY_AREA_GUID).call("shiftContentsUp", playerColor)
|
|
||||||
end
|
|
||||||
|
|
||||||
PlayAreaApi.shiftContentsDown = function(playerColor)
|
|
||||||
return getObjectFromGUID(PLAY_AREA_GUID).call("shiftContentsDown", playerColor)
|
|
||||||
end
|
|
||||||
|
|
||||||
PlayAreaApi.shiftContentsLeft = function(playerColor)
|
|
||||||
return getObjectFromGUID(PLAY_AREA_GUID).call("shiftContentsLeft", playerColor)
|
|
||||||
end
|
|
||||||
|
|
||||||
PlayAreaApi.shiftContentsRight = function(playerColor)
|
|
||||||
return getObjectFromGUID(PLAY_AREA_GUID).call("shiftContentsRight", playerColor)
|
|
||||||
end
|
|
||||||
|
|
||||||
-- Reset the play area's tracking of which cards have had tokens spawned.
|
|
||||||
PlayAreaApi.resetSpawnedCards = function()
|
|
||||||
return getObjectFromGUID(PLAY_AREA_GUID).call("resetSpawnedCards")
|
|
||||||
end
|
|
||||||
|
|
||||||
-- Event to be called when the current scenario has changed.
|
|
||||||
---@param scenarioName Name of the new scenario
|
|
||||||
PlayAreaApi.onScenarioChanged = function(scenarioName)
|
|
||||||
getObjectFromGUID(PLAY_AREA_GUID).call("onScenarioChanged", scenarioName)
|
|
||||||
end
|
|
||||||
|
|
||||||
-- Sets this playmat's snap points to limit snapping to locations or not.
|
|
||||||
-- If matchTypes is false, snap points will be reset to snap all cards.
|
|
||||||
---@param matchTypes Boolean Whether snap points should only snap for the matching card types.
|
|
||||||
PlayAreaApi.setLimitSnapsByType = function(matchCardTypes)
|
|
||||||
getObjectFromGUID(PLAY_AREA_GUID).call("setLimitSnapsByType", matchCardTypes)
|
|
||||||
end
|
|
||||||
|
|
||||||
-- Receiver for the Global tryObjectEnterContainer event. Used to clear vector lines from dragged
|
|
||||||
-- cards before they're destroyed by entering the container
|
|
||||||
PlayAreaApi.tryObjectEnterContainer = function(container, object)
|
|
||||||
getObjectFromGUID(PLAY_AREA_GUID).call("tryObjectEnterContainer",
|
|
||||||
{ container = container, object = object })
|
|
||||||
end
|
|
||||||
|
|
||||||
-- counts the VP on locations in the play area
|
|
||||||
PlayAreaApi.countVP = function()
|
|
||||||
return getObjectFromGUID(PLAY_AREA_GUID).call("countVP")
|
|
||||||
end
|
|
||||||
|
|
||||||
-- highlights all locations in the play area without metadata
|
|
||||||
---@param state Boolean True if highlighting should be enabled
|
|
||||||
PlayAreaApi.highlightMissingData = function(state)
|
|
||||||
return getObjectFromGUID(PLAY_AREA_GUID).call("highlightMissingData", state)
|
|
||||||
end
|
|
||||||
|
|
||||||
-- highlights all locations in the play area with VP
|
|
||||||
---@param state Boolean True if highlighting should be enabled
|
|
||||||
PlayAreaApi.highlightCountedVP = function(state)
|
|
||||||
return getObjectFromGUID(PLAY_AREA_GUID).call("highlightCountedVP", state)
|
|
||||||
end
|
|
||||||
|
|
||||||
-- Checks if an object is in the play area (returns true or false)
|
|
||||||
PlayAreaApi.isInPlayArea = function(object)
|
|
||||||
return getObjectFromGUID(PLAY_AREA_GUID).call("isInPlayArea", object)
|
|
||||||
end
|
|
||||||
|
|
||||||
PlayAreaApi.getSurface = function()
|
|
||||||
return getObjectFromGUID(PLAY_AREA_GUID).getCustomObject().image
|
|
||||||
end
|
|
||||||
|
|
||||||
PlayAreaApi.updateSurface = function(url)
|
|
||||||
return getObjectFromGUID(PLAY_AREA_GUID).call("updateSurface", url)
|
|
||||||
end
|
|
||||||
|
|
||||||
-- Called by Custom Data Helpers to push their location data into the Data Helper. This adds the
|
|
||||||
-- data to the local token manager instance.
|
|
||||||
---@param args Table Single-value array holding the GUID of the Custom Data Helper making the call
|
|
||||||
PlayAreaApi.updateLocations = function(args)
|
|
||||||
getObjectFromGUID(PLAY_AREA_GUID).call("updateLocations", args)
|
|
||||||
end
|
|
||||||
|
|
||||||
PlayAreaApi.getCustomDataHelper = function()
|
|
||||||
return getObjectFromGUID(PLAY_AREA_GUID).getVar("customDataHelper")
|
|
||||||
end
|
|
||||||
|
|
||||||
return PlayAreaApi
|
|
||||||
end
|
|
||||||
end)
|
|
||||||
__bundle_register("core/token/TokenSpawnTrackerApi", function(require, _LOADED, __bundle_register, __bundle_modules)
|
|
||||||
do
|
|
||||||
local TokenSpawnTracker = { }
|
|
||||||
local SPAWN_TRACKER_GUID = "e3ffc9"
|
|
||||||
|
|
||||||
TokenSpawnTracker.hasSpawnedTokens = function(cardGuid)
|
|
||||||
return getObjectFromGUID(SPAWN_TRACKER_GUID).call("hasSpawnedTokens", cardGuid)
|
|
||||||
end
|
|
||||||
|
|
||||||
TokenSpawnTracker.markTokensSpawned = function(cardGuid)
|
|
||||||
return getObjectFromGUID(SPAWN_TRACKER_GUID).call("markTokensSpawned", cardGuid)
|
|
||||||
end
|
|
||||||
|
|
||||||
TokenSpawnTracker.resetTokensSpawned = function(cardGuid)
|
|
||||||
return getObjectFromGUID(SPAWN_TRACKER_GUID).call("resetTokensSpawned", cardGuid)
|
|
||||||
end
|
|
||||||
|
|
||||||
TokenSpawnTracker.resetAllAssetAndEvents = function()
|
|
||||||
return getObjectFromGUID(SPAWN_TRACKER_GUID).call("resetAllAssetAndEvents")
|
|
||||||
end
|
|
||||||
|
|
||||||
TokenSpawnTracker.resetAllLocations = function()
|
|
||||||
return getObjectFromGUID(SPAWN_TRACKER_GUID).call("resetAllLocations")
|
|
||||||
end
|
|
||||||
|
|
||||||
TokenSpawnTracker.resetAll = function()
|
|
||||||
return getObjectFromGUID(SPAWN_TRACKER_GUID).call("resetAll")
|
|
||||||
end
|
|
||||||
|
|
||||||
return TokenSpawnTracker
|
|
||||||
end
|
|
||||||
end)
|
|
||||||
return __bundle_require("__root")
|
return __bundle_require("__root")
|
@ -41,139 +41,6 @@ local __bundle_require, __bundle_loaded, __bundle_register, __bundle_modules = (
|
|||||||
|
|
||||||
return require, loaded, register, modules
|
return require, loaded, register, modules
|
||||||
end)(nil)
|
end)(nil)
|
||||||
__bundle_register("chaosbag/BlessCurseManagerApi", function(require, _LOADED, __bundle_register, __bundle_modules)
|
|
||||||
do
|
|
||||||
local BlessCurseManagerApi = {}
|
|
||||||
local MANAGER_GUID = "5933fb"
|
|
||||||
|
|
||||||
-- removes all taken tokens and resets the counts
|
|
||||||
BlessCurseManagerApi.removeTakenTokensAndReset = function()
|
|
||||||
local BlessCurseManager = getObjectFromGUID(MANAGER_GUID)
|
|
||||||
Wait.time(function() BlessCurseManager.call("removeTakenTokens", "Bless") end, 0.05)
|
|
||||||
Wait.time(function() BlessCurseManager.call("removeTakenTokens", "Curse") end, 0.10)
|
|
||||||
Wait.time(function() BlessCurseManager.call("doReset", "White") end, 0.15)
|
|
||||||
end
|
|
||||||
|
|
||||||
-- updates the internal count (called by cards that seal bless/curse tokens)
|
|
||||||
BlessCurseManagerApi.sealedToken = function(type, guid)
|
|
||||||
getObjectFromGUID(MANAGER_GUID).call("sealedToken", { type = type, guid = guid })
|
|
||||||
end
|
|
||||||
|
|
||||||
-- updates the internal count (called by cards that seal bless/curse tokens)
|
|
||||||
BlessCurseManagerApi.releasedToken = function(type, guid)
|
|
||||||
getObjectFromGUID(MANAGER_GUID).call("releasedToken", { type = type, guid = guid })
|
|
||||||
end
|
|
||||||
|
|
||||||
-- broadcasts the current status for bless/curse tokens
|
|
||||||
---@param playerColor String Color of the player to show the broadcast to
|
|
||||||
BlessCurseManagerApi.broadcastStatus = function(playerColor)
|
|
||||||
getObjectFromGUID(MANAGER_GUID).call("broadcastStatus", playerColor)
|
|
||||||
end
|
|
||||||
|
|
||||||
-- removes all bless / curse tokens from the chaos bag and play
|
|
||||||
---@param playerColor String Color of the player to show the broadcast to
|
|
||||||
BlessCurseManagerApi.removeAll = function(playerColor)
|
|
||||||
getObjectFromGUID(MANAGER_GUID).call("doRemove", playerColor)
|
|
||||||
end
|
|
||||||
|
|
||||||
-- adds Wendy's menu to the hovered card (allows sealing of tokens)
|
|
||||||
---@param color String Color of the player to show the broadcast to
|
|
||||||
BlessCurseManagerApi.addWendysMenu = function(playerColor, hoveredObject)
|
|
||||||
getObjectFromGUID(MANAGER_GUID).call("addMenuOptions", { playerColor = playerColor, hoveredObject = hoveredObject })
|
|
||||||
end
|
|
||||||
|
|
||||||
return BlessCurseManagerApi
|
|
||||||
end
|
|
||||||
end)
|
|
||||||
__bundle_register("chaosbag/ChaosBagApi", function(require, _LOADED, __bundle_register, __bundle_modules)
|
|
||||||
do
|
|
||||||
local ChaosBagApi = {}
|
|
||||||
|
|
||||||
-- respawns the chaos bag with a new state of tokens
|
|
||||||
---@param tokenList Table List of chaos token ids
|
|
||||||
ChaosBagApi.setChaosBagState = function(tokenList)
|
|
||||||
return Global.call("setChaosBagState", tokenList)
|
|
||||||
end
|
|
||||||
|
|
||||||
-- returns a Table List of chaos token ids in the current chaos bag
|
|
||||||
-- requires copying the data into a new table because TTS is weird about handling table return values in Global
|
|
||||||
ChaosBagApi.getChaosBagState = function()
|
|
||||||
local chaosBagContentsCatcher = Global.call("getChaosBagState")
|
|
||||||
local chaosBagContents = {}
|
|
||||||
for _, v in ipairs(chaosBagContentsCatcher) do
|
|
||||||
table.insert(chaosBagContents, v)
|
|
||||||
end
|
|
||||||
return chaosBagContents
|
|
||||||
end
|
|
||||||
|
|
||||||
-- checks scripting zone for chaos bag (also called by a lot of objects!)
|
|
||||||
ChaosBagApi.findChaosBag = function()
|
|
||||||
return Global.call("findChaosBag")
|
|
||||||
end
|
|
||||||
|
|
||||||
-- returns a table of object references to the tokens in play (does not include sealed tokens!)
|
|
||||||
ChaosBagApi.getTokensInPlay = function()
|
|
||||||
return Global.getTable("chaosTokens")
|
|
||||||
end
|
|
||||||
|
|
||||||
-- returns all sealed tokens on cards to the chaos bag
|
|
||||||
ChaosBagApi.releaseAllSealedTokens = function(playerColor)
|
|
||||||
return Global.call("releaseAllSealedTokens", playerColor)
|
|
||||||
end
|
|
||||||
|
|
||||||
-- returns all drawn tokens to the chaos bag
|
|
||||||
ChaosBagApi.returnChaosTokens = function(playerColor)
|
|
||||||
return Global.call("returnChaosTokens", playerColor)
|
|
||||||
end
|
|
||||||
|
|
||||||
-- removes the specified chaos token from the chaos bag
|
|
||||||
---@param id String ID of the chaos token
|
|
||||||
ChaosBagApi.removeChaosToken = function(id)
|
|
||||||
return Global.call("removeChaosToken", id)
|
|
||||||
end
|
|
||||||
|
|
||||||
-- spawns the specified chaos token and puts it into the chaos bag
|
|
||||||
---@param id String ID of the chaos token
|
|
||||||
ChaosBagApi.spawnChaosToken = function(id)
|
|
||||||
return Global.call("spawnChaosToken", id)
|
|
||||||
end
|
|
||||||
|
|
||||||
-- Checks to see if the chaos bag can be manipulated. If a player is searching the bag when tokens
|
|
||||||
-- are drawn or replaced a TTS bug can cause those tokens to vanish. Any functions which change the
|
|
||||||
-- contents of the bag should check this method before doing so.
|
|
||||||
-- This method will broadcast a message to all players if the bag is being searched.
|
|
||||||
---@return Boolean. True if the bag is manipulated, false if it should be blocked.
|
|
||||||
ChaosBagApi.canTouchChaosTokens = function()
|
|
||||||
return Global.call("canTouchChaosTokens")
|
|
||||||
end
|
|
||||||
|
|
||||||
-- called by playermats (by the "Draw chaos token" button)
|
|
||||||
ChaosBagApi.drawChaosToken = function(mat, tokenOffset, isRightClick)
|
|
||||||
return Global.call("drawChaosToken", {mat, tokenOffset, isRightClick})
|
|
||||||
end
|
|
||||||
|
|
||||||
-- returns a Table List of chaos token ids in the current chaos bag
|
|
||||||
-- requires copying the data into a new table because TTS is weird about handling table return values in Global
|
|
||||||
ChaosBagApi.getIdUrlMap = function()
|
|
||||||
return Global.getTable("ID_URL_MAP")
|
|
||||||
end
|
|
||||||
|
|
||||||
return ChaosBagApi
|
|
||||||
end
|
|
||||||
end)
|
|
||||||
__bundle_register("__root", function(require, _LOADED, __bundle_register, __bundle_modules)
|
|
||||||
require("playercards/cards/FavoroftheMoon1")
|
|
||||||
end)
|
|
||||||
__bundle_register("playercards/cards/FavoroftheMoon1", function(require, _LOADED, __bundle_register, __bundle_modules)
|
|
||||||
VALID_TOKENS = {
|
|
||||||
["Curse"] = true
|
|
||||||
}
|
|
||||||
|
|
||||||
SHOW_SINGLE_RELEASE = true
|
|
||||||
KEEP_OPEN = true
|
|
||||||
|
|
||||||
require("playercards/CardsThatSealTokens")
|
|
||||||
end)
|
|
||||||
__bundle_register("playercards/CardsThatSealTokens", function(require, _LOADED, __bundle_register, __bundle_modules)
|
__bundle_register("playercards/CardsThatSealTokens", function(require, _LOADED, __bundle_register, __bundle_modules)
|
||||||
--[[ Library for cards that seal tokens
|
--[[ Library for cards that seal tokens
|
||||||
This file is used to add sealing option to cards' context menu.
|
This file is used to add sealing option to cards' context menu.
|
||||||
@ -405,12 +272,13 @@ end)
|
|||||||
__bundle_register("accessories/TokenArrangerApi", function(require, _LOADED, __bundle_register, __bundle_modules)
|
__bundle_register("accessories/TokenArrangerApi", function(require, _LOADED, __bundle_register, __bundle_modules)
|
||||||
do
|
do
|
||||||
local TokenArrangerApi = {}
|
local TokenArrangerApi = {}
|
||||||
|
local guidReferenceApi = require("core/GUIDReferenceApi")
|
||||||
|
|
||||||
-- local function to call the token arranger, if it is on the table
|
-- local function to call the token arranger, if it is on the table
|
||||||
---@param functionName String Name of the function to cal
|
---@param functionName String Name of the function to cal
|
||||||
---@param argument Variant Parameter to pass
|
---@param argument Variant Parameter to pass
|
||||||
local function callIfExistent(functionName, argument)
|
local function callIfExistent(functionName, argument)
|
||||||
local tokenArranger = getObjectsWithTag("TokenArranger")[1]
|
local tokenArranger = guidReferenceApi.getObjectByOwnerAndType("Mythos", "TokenArranger")
|
||||||
if tokenArranger ~= nil then
|
if tokenArranger ~= nil then
|
||||||
tokenArranger.call(functionName, argument)
|
tokenArranger.call(functionName, argument)
|
||||||
end
|
end
|
||||||
@ -435,4 +303,171 @@ do
|
|||||||
return TokenArrangerApi
|
return TokenArrangerApi
|
||||||
end
|
end
|
||||||
end)
|
end)
|
||||||
|
__bundle_register("chaosbag/BlessCurseManagerApi", function(require, _LOADED, __bundle_register, __bundle_modules)
|
||||||
|
do
|
||||||
|
local BlessCurseManagerApi = {}
|
||||||
|
local guidReferenceApi = require("core/GUIDReferenceApi")
|
||||||
|
|
||||||
|
local function getManager()
|
||||||
|
return guidReferenceApi.getObjectByOwnerAndType("Mythos", "BlessCurseManager")
|
||||||
|
end
|
||||||
|
|
||||||
|
-- removes all taken tokens and resets the counts
|
||||||
|
BlessCurseManagerApi.removeTakenTokensAndReset = function()
|
||||||
|
local BlessCurseManager = getManager()
|
||||||
|
Wait.time(function() BlessCurseManager.call("removeTakenTokens", "Bless") end, 0.05)
|
||||||
|
Wait.time(function() BlessCurseManager.call("removeTakenTokens", "Curse") end, 0.10)
|
||||||
|
Wait.time(function() BlessCurseManager.call("doReset", "White") end, 0.15)
|
||||||
|
end
|
||||||
|
|
||||||
|
-- updates the internal count (called by cards that seal bless/curse tokens)
|
||||||
|
BlessCurseManagerApi.sealedToken = function(type, guid)
|
||||||
|
getManager().call("sealedToken", { type = type, guid = guid })
|
||||||
|
end
|
||||||
|
|
||||||
|
-- updates the internal count (called by cards that seal bless/curse tokens)
|
||||||
|
BlessCurseManagerApi.releasedToken = function(type, guid)
|
||||||
|
getManager().call("releasedToken", { type = type, guid = guid })
|
||||||
|
end
|
||||||
|
|
||||||
|
-- broadcasts the current status for bless/curse tokens
|
||||||
|
---@param playerColor String Color of the player to show the broadcast to
|
||||||
|
BlessCurseManagerApi.broadcastStatus = function(playerColor)
|
||||||
|
getManager().call("broadcastStatus", playerColor)
|
||||||
|
end
|
||||||
|
|
||||||
|
-- removes all bless / curse tokens from the chaos bag and play
|
||||||
|
---@param playerColor String Color of the player to show the broadcast to
|
||||||
|
BlessCurseManagerApi.removeAll = function(playerColor)
|
||||||
|
getManager().call("doRemove", playerColor)
|
||||||
|
end
|
||||||
|
|
||||||
|
-- adds Wendy's menu to the hovered card (allows sealing of tokens)
|
||||||
|
---@param color String Color of the player to show the broadcast to
|
||||||
|
BlessCurseManagerApi.addWendysMenu = function(playerColor, hoveredObject)
|
||||||
|
getManager().call("addMenuOptions", { playerColor = playerColor, hoveredObject = hoveredObject })
|
||||||
|
end
|
||||||
|
|
||||||
|
return BlessCurseManagerApi
|
||||||
|
end
|
||||||
|
end)
|
||||||
|
__bundle_register("chaosbag/ChaosBagApi", function(require, _LOADED, __bundle_register, __bundle_modules)
|
||||||
|
do
|
||||||
|
local ChaosBagApi = {}
|
||||||
|
|
||||||
|
-- respawns the chaos bag with a new state of tokens
|
||||||
|
---@param tokenList Table List of chaos token ids
|
||||||
|
ChaosBagApi.setChaosBagState = function(tokenList)
|
||||||
|
return Global.call("setChaosBagState", tokenList)
|
||||||
|
end
|
||||||
|
|
||||||
|
-- returns a Table List of chaos token ids in the current chaos bag
|
||||||
|
-- requires copying the data into a new table because TTS is weird about handling table return values in Global
|
||||||
|
ChaosBagApi.getChaosBagState = function()
|
||||||
|
local chaosBagContentsCatcher = Global.call("getChaosBagState")
|
||||||
|
local chaosBagContents = {}
|
||||||
|
for _, v in ipairs(chaosBagContentsCatcher) do
|
||||||
|
table.insert(chaosBagContents, v)
|
||||||
|
end
|
||||||
|
return chaosBagContents
|
||||||
|
end
|
||||||
|
|
||||||
|
-- checks scripting zone for chaos bag (also called by a lot of objects!)
|
||||||
|
ChaosBagApi.findChaosBag = function()
|
||||||
|
return Global.call("findChaosBag")
|
||||||
|
end
|
||||||
|
|
||||||
|
-- returns a table of object references to the tokens in play (does not include sealed tokens!)
|
||||||
|
ChaosBagApi.getTokensInPlay = function()
|
||||||
|
return Global.getTable("chaosTokens")
|
||||||
|
end
|
||||||
|
|
||||||
|
-- returns all sealed tokens on cards to the chaos bag
|
||||||
|
ChaosBagApi.releaseAllSealedTokens = function(playerColor)
|
||||||
|
return Global.call("releaseAllSealedTokens", playerColor)
|
||||||
|
end
|
||||||
|
|
||||||
|
-- returns all drawn tokens to the chaos bag
|
||||||
|
ChaosBagApi.returnChaosTokens = function(playerColor)
|
||||||
|
return Global.call("returnChaosTokens", playerColor)
|
||||||
|
end
|
||||||
|
|
||||||
|
-- removes the specified chaos token from the chaos bag
|
||||||
|
---@param id String ID of the chaos token
|
||||||
|
ChaosBagApi.removeChaosToken = function(id)
|
||||||
|
return Global.call("removeChaosToken", id)
|
||||||
|
end
|
||||||
|
|
||||||
|
-- spawns the specified chaos token and puts it into the chaos bag
|
||||||
|
---@param id String ID of the chaos token
|
||||||
|
ChaosBagApi.spawnChaosToken = function(id)
|
||||||
|
return Global.call("spawnChaosToken", id)
|
||||||
|
end
|
||||||
|
|
||||||
|
-- Checks to see if the chaos bag can be manipulated. If a player is searching the bag when tokens
|
||||||
|
-- are drawn or replaced a TTS bug can cause those tokens to vanish. Any functions which change the
|
||||||
|
-- contents of the bag should check this method before doing so.
|
||||||
|
-- This method will broadcast a message to all players if the bag is being searched.
|
||||||
|
---@return Boolean. True if the bag is manipulated, false if it should be blocked.
|
||||||
|
ChaosBagApi.canTouchChaosTokens = function()
|
||||||
|
return Global.call("canTouchChaosTokens")
|
||||||
|
end
|
||||||
|
|
||||||
|
-- called by playermats (by the "Draw chaos token" button)
|
||||||
|
ChaosBagApi.drawChaosToken = function(mat, tokenOffset, isRightClick)
|
||||||
|
return Global.call("drawChaosToken", {mat, tokenOffset, isRightClick})
|
||||||
|
end
|
||||||
|
|
||||||
|
-- returns a Table List of chaos token ids in the current chaos bag
|
||||||
|
-- requires copying the data into a new table because TTS is weird about handling table return values in Global
|
||||||
|
ChaosBagApi.getIdUrlMap = function()
|
||||||
|
return Global.getTable("ID_URL_MAP")
|
||||||
|
end
|
||||||
|
|
||||||
|
return ChaosBagApi
|
||||||
|
end
|
||||||
|
end)
|
||||||
|
__bundle_register("core/GUIDReferenceApi", function(require, _LOADED, __bundle_register, __bundle_modules)
|
||||||
|
do
|
||||||
|
local GUIDReferenceApi = {}
|
||||||
|
|
||||||
|
local function getGuidHandler()
|
||||||
|
return getObjectFromGUID("123456")
|
||||||
|
end
|
||||||
|
|
||||||
|
-- returns all matching objects as a table with references
|
||||||
|
---@param owner String Parent object for this search
|
||||||
|
---@param type String Type of object to search for
|
||||||
|
GUIDReferenceApi.getObjectByOwnerAndType = function(owner, type)
|
||||||
|
return getGuidHandler().call("getObjectByOwnerAndType", { owner = owner, type = type })
|
||||||
|
end
|
||||||
|
|
||||||
|
-- returns all matching objects as a table with references
|
||||||
|
---@param type String Type of object to search for
|
||||||
|
GUIDReferenceApi.getObjectsByType = function(type)
|
||||||
|
return getGuidHandler().call("getObjectsByType", type)
|
||||||
|
end
|
||||||
|
|
||||||
|
-- returns all matching objects as a table with references
|
||||||
|
---@param owner String Parent object for this search
|
||||||
|
GUIDReferenceApi.getObjectsByOwner = function(owner)
|
||||||
|
return getGuidHandler().call("getObjectsByOwner", owner)
|
||||||
|
end
|
||||||
|
|
||||||
|
return GUIDReferenceApi
|
||||||
|
end
|
||||||
|
end)
|
||||||
|
__bundle_register("__root", function(require, _LOADED, __bundle_register, __bundle_modules)
|
||||||
|
require("playercards/cards/FavoroftheMoon1")
|
||||||
|
end)
|
||||||
|
__bundle_register("playercards/cards/FavoroftheMoon1", function(require, _LOADED, __bundle_register, __bundle_modules)
|
||||||
|
VALID_TOKENS = {
|
||||||
|
["Curse"] = true
|
||||||
|
}
|
||||||
|
|
||||||
|
SHOW_SINGLE_RELEASE = true
|
||||||
|
KEEP_OPEN = true
|
||||||
|
|
||||||
|
require("playercards/CardsThatSealTokens")
|
||||||
|
end)
|
||||||
return __bundle_require("__root")
|
return __bundle_require("__root")
|
@ -41,83 +41,6 @@ local __bundle_require, __bundle_loaded, __bundle_register, __bundle_modules = (
|
|||||||
|
|
||||||
return require, loaded, register, modules
|
return require, loaded, register, modules
|
||||||
end)(nil)
|
end)(nil)
|
||||||
__bundle_register("accessories/TokenArrangerApi", function(require, _LOADED, __bundle_register, __bundle_modules)
|
|
||||||
do
|
|
||||||
local TokenArrangerApi = {}
|
|
||||||
|
|
||||||
-- local function to call the token arranger, if it is on the table
|
|
||||||
---@param functionName String Name of the function to cal
|
|
||||||
---@param argument Variant Parameter to pass
|
|
||||||
local function callIfExistent(functionName, argument)
|
|
||||||
local tokenArranger = getObjectsWithTag("TokenArranger")[1]
|
|
||||||
if tokenArranger ~= nil then
|
|
||||||
tokenArranger.call(functionName, argument)
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
-- updates the token modifiers with the provided data
|
|
||||||
---@param tokenData Table Contains the chaos token metadata
|
|
||||||
TokenArrangerApi.onTokenDataChanged = function(fullData)
|
|
||||||
callIfExistent("onTokenDataChanged", fullData)
|
|
||||||
end
|
|
||||||
|
|
||||||
-- deletes already laid out tokens
|
|
||||||
TokenArrangerApi.deleteCopiedTokens = function()
|
|
||||||
callIfExistent("deleteCopiedTokens")
|
|
||||||
end
|
|
||||||
|
|
||||||
-- updates the laid out tokens
|
|
||||||
TokenArrangerApi.layout = function()
|
|
||||||
Wait.time(function() callIfExistent("layout") end, 0.1)
|
|
||||||
end
|
|
||||||
|
|
||||||
return TokenArrangerApi
|
|
||||||
end
|
|
||||||
end)
|
|
||||||
__bundle_register("chaosbag/BlessCurseManagerApi", function(require, _LOADED, __bundle_register, __bundle_modules)
|
|
||||||
do
|
|
||||||
local BlessCurseManagerApi = {}
|
|
||||||
local MANAGER_GUID = "5933fb"
|
|
||||||
|
|
||||||
-- removes all taken tokens and resets the counts
|
|
||||||
BlessCurseManagerApi.removeTakenTokensAndReset = function()
|
|
||||||
local BlessCurseManager = getObjectFromGUID(MANAGER_GUID)
|
|
||||||
Wait.time(function() BlessCurseManager.call("removeTakenTokens", "Bless") end, 0.05)
|
|
||||||
Wait.time(function() BlessCurseManager.call("removeTakenTokens", "Curse") end, 0.10)
|
|
||||||
Wait.time(function() BlessCurseManager.call("doReset", "White") end, 0.15)
|
|
||||||
end
|
|
||||||
|
|
||||||
-- updates the internal count (called by cards that seal bless/curse tokens)
|
|
||||||
BlessCurseManagerApi.sealedToken = function(type, guid)
|
|
||||||
getObjectFromGUID(MANAGER_GUID).call("sealedToken", { type = type, guid = guid })
|
|
||||||
end
|
|
||||||
|
|
||||||
-- updates the internal count (called by cards that seal bless/curse tokens)
|
|
||||||
BlessCurseManagerApi.releasedToken = function(type, guid)
|
|
||||||
getObjectFromGUID(MANAGER_GUID).call("releasedToken", { type = type, guid = guid })
|
|
||||||
end
|
|
||||||
|
|
||||||
-- broadcasts the current status for bless/curse tokens
|
|
||||||
---@param playerColor String Color of the player to show the broadcast to
|
|
||||||
BlessCurseManagerApi.broadcastStatus = function(playerColor)
|
|
||||||
getObjectFromGUID(MANAGER_GUID).call("broadcastStatus", playerColor)
|
|
||||||
end
|
|
||||||
|
|
||||||
-- removes all bless / curse tokens from the chaos bag and play
|
|
||||||
---@param playerColor String Color of the player to show the broadcast to
|
|
||||||
BlessCurseManagerApi.removeAll = function(playerColor)
|
|
||||||
getObjectFromGUID(MANAGER_GUID).call("doRemove", playerColor)
|
|
||||||
end
|
|
||||||
|
|
||||||
-- adds Wendy's menu to the hovered card (allows sealing of tokens)
|
|
||||||
---@param color String Color of the player to show the broadcast to
|
|
||||||
BlessCurseManagerApi.addWendysMenu = function(playerColor, hoveredObject)
|
|
||||||
getObjectFromGUID(MANAGER_GUID).call("addMenuOptions", { playerColor = playerColor, hoveredObject = hoveredObject })
|
|
||||||
end
|
|
||||||
|
|
||||||
return BlessCurseManagerApi
|
|
||||||
end
|
|
||||||
end)
|
|
||||||
__bundle_register("chaosbag/ChaosBagApi", function(require, _LOADED, __bundle_register, __bundle_modules)
|
__bundle_register("chaosbag/ChaosBagApi", function(require, _LOADED, __bundle_register, __bundle_modules)
|
||||||
do
|
do
|
||||||
local ChaosBagApi = {}
|
local ChaosBagApi = {}
|
||||||
@ -194,6 +117,36 @@ do
|
|||||||
return ChaosBagApi
|
return ChaosBagApi
|
||||||
end
|
end
|
||||||
end)
|
end)
|
||||||
|
__bundle_register("core/GUIDReferenceApi", function(require, _LOADED, __bundle_register, __bundle_modules)
|
||||||
|
do
|
||||||
|
local GUIDReferenceApi = {}
|
||||||
|
|
||||||
|
local function getGuidHandler()
|
||||||
|
return getObjectFromGUID("123456")
|
||||||
|
end
|
||||||
|
|
||||||
|
-- returns all matching objects as a table with references
|
||||||
|
---@param owner String Parent object for this search
|
||||||
|
---@param type String Type of object to search for
|
||||||
|
GUIDReferenceApi.getObjectByOwnerAndType = function(owner, type)
|
||||||
|
return getGuidHandler().call("getObjectByOwnerAndType", { owner = owner, type = type })
|
||||||
|
end
|
||||||
|
|
||||||
|
-- returns all matching objects as a table with references
|
||||||
|
---@param type String Type of object to search for
|
||||||
|
GUIDReferenceApi.getObjectsByType = function(type)
|
||||||
|
return getGuidHandler().call("getObjectsByType", type)
|
||||||
|
end
|
||||||
|
|
||||||
|
-- returns all matching objects as a table with references
|
||||||
|
---@param owner String Parent object for this search
|
||||||
|
GUIDReferenceApi.getObjectsByOwner = function(owner)
|
||||||
|
return getGuidHandler().call("getObjectsByOwner", owner)
|
||||||
|
end
|
||||||
|
|
||||||
|
return GUIDReferenceApi
|
||||||
|
end
|
||||||
|
end)
|
||||||
__bundle_register("__root", function(require, _LOADED, __bundle_register, __bundle_modules)
|
__bundle_register("__root", function(require, _LOADED, __bundle_register, __bundle_modules)
|
||||||
require("playercards/cards/FavoroftheSun1")
|
require("playercards/cards/FavoroftheSun1")
|
||||||
end)
|
end)
|
||||||
@ -435,4 +388,86 @@ function putTokenAway(guid)
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
end)
|
end)
|
||||||
|
__bundle_register("accessories/TokenArrangerApi", function(require, _LOADED, __bundle_register, __bundle_modules)
|
||||||
|
do
|
||||||
|
local TokenArrangerApi = {}
|
||||||
|
local guidReferenceApi = require("core/GUIDReferenceApi")
|
||||||
|
|
||||||
|
-- local function to call the token arranger, if it is on the table
|
||||||
|
---@param functionName String Name of the function to cal
|
||||||
|
---@param argument Variant Parameter to pass
|
||||||
|
local function callIfExistent(functionName, argument)
|
||||||
|
local tokenArranger = guidReferenceApi.getObjectByOwnerAndType("Mythos", "TokenArranger")
|
||||||
|
if tokenArranger ~= nil then
|
||||||
|
tokenArranger.call(functionName, argument)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
-- updates the token modifiers with the provided data
|
||||||
|
---@param tokenData Table Contains the chaos token metadata
|
||||||
|
TokenArrangerApi.onTokenDataChanged = function(fullData)
|
||||||
|
callIfExistent("onTokenDataChanged", fullData)
|
||||||
|
end
|
||||||
|
|
||||||
|
-- deletes already laid out tokens
|
||||||
|
TokenArrangerApi.deleteCopiedTokens = function()
|
||||||
|
callIfExistent("deleteCopiedTokens")
|
||||||
|
end
|
||||||
|
|
||||||
|
-- updates the laid out tokens
|
||||||
|
TokenArrangerApi.layout = function()
|
||||||
|
Wait.time(function() callIfExistent("layout") end, 0.1)
|
||||||
|
end
|
||||||
|
|
||||||
|
return TokenArrangerApi
|
||||||
|
end
|
||||||
|
end)
|
||||||
|
__bundle_register("chaosbag/BlessCurseManagerApi", function(require, _LOADED, __bundle_register, __bundle_modules)
|
||||||
|
do
|
||||||
|
local BlessCurseManagerApi = {}
|
||||||
|
local guidReferenceApi = require("core/GUIDReferenceApi")
|
||||||
|
|
||||||
|
local function getManager()
|
||||||
|
return guidReferenceApi.getObjectByOwnerAndType("Mythos", "BlessCurseManager")
|
||||||
|
end
|
||||||
|
|
||||||
|
-- removes all taken tokens and resets the counts
|
||||||
|
BlessCurseManagerApi.removeTakenTokensAndReset = function()
|
||||||
|
local BlessCurseManager = getManager()
|
||||||
|
Wait.time(function() BlessCurseManager.call("removeTakenTokens", "Bless") end, 0.05)
|
||||||
|
Wait.time(function() BlessCurseManager.call("removeTakenTokens", "Curse") end, 0.10)
|
||||||
|
Wait.time(function() BlessCurseManager.call("doReset", "White") end, 0.15)
|
||||||
|
end
|
||||||
|
|
||||||
|
-- updates the internal count (called by cards that seal bless/curse tokens)
|
||||||
|
BlessCurseManagerApi.sealedToken = function(type, guid)
|
||||||
|
getManager().call("sealedToken", { type = type, guid = guid })
|
||||||
|
end
|
||||||
|
|
||||||
|
-- updates the internal count (called by cards that seal bless/curse tokens)
|
||||||
|
BlessCurseManagerApi.releasedToken = function(type, guid)
|
||||||
|
getManager().call("releasedToken", { type = type, guid = guid })
|
||||||
|
end
|
||||||
|
|
||||||
|
-- broadcasts the current status for bless/curse tokens
|
||||||
|
---@param playerColor String Color of the player to show the broadcast to
|
||||||
|
BlessCurseManagerApi.broadcastStatus = function(playerColor)
|
||||||
|
getManager().call("broadcastStatus", playerColor)
|
||||||
|
end
|
||||||
|
|
||||||
|
-- removes all bless / curse tokens from the chaos bag and play
|
||||||
|
---@param playerColor String Color of the player to show the broadcast to
|
||||||
|
BlessCurseManagerApi.removeAll = function(playerColor)
|
||||||
|
getManager().call("doRemove", playerColor)
|
||||||
|
end
|
||||||
|
|
||||||
|
-- adds Wendy's menu to the hovered card (allows sealing of tokens)
|
||||||
|
---@param color String Color of the player to show the broadcast to
|
||||||
|
BlessCurseManagerApi.addWendysMenu = function(playerColor, hoveredObject)
|
||||||
|
getManager().call("addMenuOptions", { playerColor = playerColor, hoveredObject = hoveredObject })
|
||||||
|
end
|
||||||
|
|
||||||
|
return BlessCurseManagerApi
|
||||||
|
end
|
||||||
|
end)
|
||||||
return __bundle_require("__root")
|
return __bundle_require("__root")
|
@ -0,0 +1,55 @@
|
|||||||
|
AltLookAngle:
|
||||||
|
x: 0
|
||||||
|
y: 0
|
||||||
|
z: 0
|
||||||
|
Autoraise: true
|
||||||
|
CardID: 847001
|
||||||
|
ColorDiffuse:
|
||||||
|
b: 0.71324
|
||||||
|
g: 0.71324
|
||||||
|
r: 0.71324
|
||||||
|
CustomDeck:
|
||||||
|
'8470':
|
||||||
|
BackIsHidden: false
|
||||||
|
BackURL: https://i.imgur.com/EcbhVuh.jpg/
|
||||||
|
FaceURL: http://cloud-3.steamusercontent.com/ugc/2149964195986880793/517FBB4FF8F72900B9E123DB865BCAD625F6506C/
|
||||||
|
NumHeight: 2
|
||||||
|
NumWidth: 2
|
||||||
|
Type: 0
|
||||||
|
UniqueBack: false
|
||||||
|
Description: Advanced
|
||||||
|
DragSelectable: true
|
||||||
|
GMNotes: "{\n \"id\": \"90051\",\n \"type\": \"Treachery\",\n \"class\": \"Neutral\",\n
|
||||||
|
\ \"traits\": \"Endtimes.\",\n \"weakness\": true,\n \"cycle\": \"The Dunwich
|
||||||
|
Legacy\"\n}"
|
||||||
|
GUID: '561775'
|
||||||
|
Grid: true
|
||||||
|
GridProjection: false
|
||||||
|
Hands: true
|
||||||
|
HideWhenFaceDown: true
|
||||||
|
IgnoreFoW: false
|
||||||
|
LayoutGroupSortIndex: 0
|
||||||
|
Locked: false
|
||||||
|
LuaScript: ''
|
||||||
|
LuaScriptState: ''
|
||||||
|
MeasureMovement: false
|
||||||
|
Name: Card
|
||||||
|
Nickname: Final Rhapsody
|
||||||
|
SidewaysCard: false
|
||||||
|
Snap: true
|
||||||
|
Sticky: true
|
||||||
|
Tags:
|
||||||
|
- PlayerCard
|
||||||
|
Tooltip: true
|
||||||
|
Transform:
|
||||||
|
posX: 78.42
|
||||||
|
posY: 3.19
|
||||||
|
posZ: 23.54
|
||||||
|
rotX: 0
|
||||||
|
rotY: 270
|
||||||
|
rotZ: 0
|
||||||
|
scaleX: 1
|
||||||
|
scaleY: 1
|
||||||
|
scaleZ: 1
|
||||||
|
Value: 0
|
||||||
|
XmlUI: ''
|
@ -12,7 +12,7 @@ CustomDeck:
|
|||||||
'3':
|
'3':
|
||||||
BackIsHidden: true
|
BackIsHidden: true
|
||||||
BackURL: https://i.imgur.com/EcbhVuh.jpg/
|
BackURL: https://i.imgur.com/EcbhVuh.jpg/
|
||||||
FaceURL: http://cloud-3.steamusercontent.com/ugc/2021607899142908284/92DF67E4310BCDFAD6C4BB12D31155DBF6B07A25/
|
FaceURL: http://cloud-3.steamusercontent.com/ugc/2115061845812962486/A68B8BF7E4862F21369DAC4A37D813EC664EAC34/
|
||||||
NumHeight: 6
|
NumHeight: 6
|
||||||
NumWidth: 10
|
NumWidth: 10
|
||||||
Type: 0
|
Type: 0
|
||||||
|
@ -0,0 +1,473 @@
|
|||||||
|
-- Bundled by luabundle {"version":"1.6.0"}
|
||||||
|
local __bundle_require, __bundle_loaded, __bundle_register, __bundle_modules = (function(superRequire)
|
||||||
|
local loadingPlaceholder = {[{}] = true}
|
||||||
|
|
||||||
|
local register
|
||||||
|
local modules = {}
|
||||||
|
|
||||||
|
local require
|
||||||
|
local loaded = {}
|
||||||
|
|
||||||
|
register = function(name, body)
|
||||||
|
if not modules[name] then
|
||||||
|
modules[name] = body
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
require = function(name)
|
||||||
|
local loadedModule = loaded[name]
|
||||||
|
|
||||||
|
if loadedModule then
|
||||||
|
if loadedModule == loadingPlaceholder then
|
||||||
|
return nil
|
||||||
|
end
|
||||||
|
else
|
||||||
|
if not modules[name] then
|
||||||
|
if not superRequire then
|
||||||
|
local identifier = type(name) == 'string' and '\"' .. name .. '\"' or tostring(name)
|
||||||
|
error('Tried to require ' .. identifier .. ', but no such module has been registered')
|
||||||
|
else
|
||||||
|
return superRequire(name)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
loaded[name] = loadingPlaceholder
|
||||||
|
loadedModule = modules[name](require, loaded, register, modules)
|
||||||
|
loaded[name] = loadedModule
|
||||||
|
end
|
||||||
|
|
||||||
|
return loadedModule
|
||||||
|
end
|
||||||
|
|
||||||
|
return require, loaded, register, modules
|
||||||
|
end)(nil)
|
||||||
|
__bundle_register("playercards/cards/FluteoftheOuterGods4", function(require, _LOADED, __bundle_register, __bundle_modules)
|
||||||
|
VALID_TOKENS = {
|
||||||
|
["Curse"] = true
|
||||||
|
}
|
||||||
|
|
||||||
|
SHOW_SINGLE_RELEASE = true
|
||||||
|
KEEP_OPEN = true
|
||||||
|
|
||||||
|
require("playercards/CardsThatSealTokens")
|
||||||
|
end)
|
||||||
|
__bundle_register("playercards/CardsThatSealTokens", function(require, _LOADED, __bundle_register, __bundle_modules)
|
||||||
|
--[[ Library for cards that seal tokens
|
||||||
|
This file is used to add sealing option to cards' context menu.
|
||||||
|
Valid options (set before requiring this file):
|
||||||
|
|
||||||
|
UPDATE_ON_HOVER --@type: boolean
|
||||||
|
- automatically updates the context menu options when the card is hovered
|
||||||
|
- the "Read Bag" function reads the content of the chaos bag to update the context menu
|
||||||
|
- example usage: "Unrelenting" (to only display valid tokens)
|
||||||
|
|
||||||
|
KEEP_OPEN --@type: boolean
|
||||||
|
- meant for cards that seal single tokens multiple times (one by one)
|
||||||
|
- makes the context menu stay open after selecting an option
|
||||||
|
- example usage: "Unrelenting"
|
||||||
|
|
||||||
|
SHOW_SINGLE_RELEASE --@type: boolean
|
||||||
|
- enables an entry in the context menu
|
||||||
|
- this entry allows releasing a single token
|
||||||
|
- example usage: "Holy Spear" (to keep the other tokens and just release one)
|
||||||
|
|
||||||
|
SHOW_MULTI_RELEASE --@type: number (amount of tokens to release at once)
|
||||||
|
- enables an entry in the context menu
|
||||||
|
- this entry allows releasing of multiple tokens at once
|
||||||
|
- example usage: "Nephthys" (to release 3 bless tokens at once)
|
||||||
|
|
||||||
|
SHOW_MULTI_SEAL --@type: number (amount of tokens to seal at once)
|
||||||
|
- enables an entry in the context menu
|
||||||
|
- this entry allows sealing of multiple tokens at once
|
||||||
|
- example usage: "Holy Spear" (to seal two bless tokens at once)
|
||||||
|
|
||||||
|
VALID_TOKENS --@type: table ([tokenName] = true)
|
||||||
|
- this table defines which tokens should be abled to be sealed
|
||||||
|
- needs to be defined for each card -> even if empty
|
||||||
|
- example usage: "The Chthonian Stone"
|
||||||
|
> VALID_TOKENS = {
|
||||||
|
> ["Skull"] = true,
|
||||||
|
> ["Cultist"] = true,
|
||||||
|
> ["Tablet"] = true,
|
||||||
|
> ["Elder Thing"] = true,
|
||||||
|
> }
|
||||||
|
|
||||||
|
INVALID_TOKENS --@type: table ([tokenName] = true)
|
||||||
|
- this table defines which tokens are invalid for sealing
|
||||||
|
- only needs to be defined if needed
|
||||||
|
- usually combined with empty "VALID_TOKENS" table
|
||||||
|
- example usage: "Protective Incantation" (not allowed to seal Auto-fail)
|
||||||
|
|
||||||
|
----------------------------------------------------------
|
||||||
|
Example 1: Crystalline Elder Sign
|
||||||
|
This card can only seal the "+1" or "Elder Sign" token,
|
||||||
|
it does not need specific options for multi-sealing or releasing.
|
||||||
|
Thus it should be implemented like this:
|
||||||
|
> VALID_TOKENS = {
|
||||||
|
> ["+1"] = true,
|
||||||
|
> ["Elder Sign"] = true
|
||||||
|
> }
|
||||||
|
> require...
|
||||||
|
----------------------------------------------------------
|
||||||
|
Example 2: Holy Spear
|
||||||
|
This card features the following abilities (just listing the relevant parts):
|
||||||
|
- releasing a single bless token
|
||||||
|
- sealing two bless tokens
|
||||||
|
Thus it should be implemented like this:
|
||||||
|
> VALID_TOKENS = {
|
||||||
|
> ["Bless"] = true
|
||||||
|
> }
|
||||||
|
> SHOW_SINGLE_RELEASE = true
|
||||||
|
> SHOW_MULTI_SEAL = 2
|
||||||
|
> require...
|
||||||
|
----------------------------------------------------------]]
|
||||||
|
|
||||||
|
local blessCurseManagerApi = require("chaosbag/BlessCurseManagerApi")
|
||||||
|
local chaosBagApi = require("chaosbag/ChaosBagApi")
|
||||||
|
local tokenArrangerApi = require("accessories/TokenArrangerApi")
|
||||||
|
|
||||||
|
local sealedTokens = {}
|
||||||
|
local ID_URL_MAP = {}
|
||||||
|
local tokensInBag = {}
|
||||||
|
|
||||||
|
function onSave() return JSON.encode(sealedTokens) end
|
||||||
|
|
||||||
|
function onLoad(savedData)
|
||||||
|
sealedTokens = JSON.decode(savedData) or {}
|
||||||
|
ID_URL_MAP = chaosBagApi.getIdUrlMap()
|
||||||
|
generateContextMenu()
|
||||||
|
self.addTag("CardThatSeals")
|
||||||
|
end
|
||||||
|
|
||||||
|
-- builds the context menu
|
||||||
|
function generateContextMenu()
|
||||||
|
-- conditional single or multi release options
|
||||||
|
if SHOW_SINGLE_RELEASE then
|
||||||
|
self.addContextMenuItem("Release token", releaseOneToken)
|
||||||
|
elseif SHOW_MULTI_RELEASE then
|
||||||
|
self.addContextMenuItem("Release " .. SHOW_MULTI_RELEASE .. " token(s)", releaseMultipleTokens)
|
||||||
|
else
|
||||||
|
self.addContextMenuItem("Release token(s)", releaseAllTokens)
|
||||||
|
end
|
||||||
|
|
||||||
|
-- main context menu options to seal tokens
|
||||||
|
for _, map in pairs(ID_URL_MAP) do
|
||||||
|
if (VALID_TOKENS[map.name] ~= nil) or (UPDATE_ON_HOVER and tokensInBag[map.name] and not INVALID_TOKENS[map.name]) then
|
||||||
|
if not SHOW_MULTI_SEAL then
|
||||||
|
self.addContextMenuItem("Seal " .. map.name, function(playerColor)
|
||||||
|
sealToken(map.name, playerColor)
|
||||||
|
end, KEEP_OPEN)
|
||||||
|
else
|
||||||
|
self.addContextMenuItem("Seal " .. SHOW_MULTI_SEAL .. " " .. map.name, function(playerColor)
|
||||||
|
readBag()
|
||||||
|
local allowed = true
|
||||||
|
local notFound
|
||||||
|
|
||||||
|
for name, _ in pairs(VALID_TOKENS) do
|
||||||
|
if (tokensInBag[name] or 0) < SHOW_MULTI_SEAL then
|
||||||
|
allowed = false
|
||||||
|
notFound = name
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
if allowed then
|
||||||
|
for i = 1, SHOW_MULTI_SEAL do
|
||||||
|
sealToken(map.name, playerColor)
|
||||||
|
end
|
||||||
|
else
|
||||||
|
printToColor("Not enough " .. notFound .. " tokens in the chaos bag.", playerColor)
|
||||||
|
end
|
||||||
|
end)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
-- generates a list of chaos tokens that is in the chaos bag
|
||||||
|
function readBag()
|
||||||
|
local chaosbag = chaosBagApi.findChaosBag()
|
||||||
|
tokensInBag = {}
|
||||||
|
|
||||||
|
for _, token in ipairs(chaosbag.getObjects()) do
|
||||||
|
tokensInBag[token.name] = (tokensInBag[token.name] or 0) + 1
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
-- native event from TTS - used to update the context menu for cards like "Unrelenting"
|
||||||
|
function onHover()
|
||||||
|
if UPDATE_ON_HOVER then
|
||||||
|
readBag()
|
||||||
|
self.clearContextMenu()
|
||||||
|
generateContextMenu()
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
-- seals the named token on this card
|
||||||
|
function sealToken(name, playerColor)
|
||||||
|
if not chaosBagApi.canTouchChaosTokens() then return end
|
||||||
|
local chaosbag = chaosBagApi.findChaosBag()
|
||||||
|
for i, obj in ipairs(chaosbag.getObjects()) do
|
||||||
|
if obj.name == name then
|
||||||
|
chaosbag.takeObject({
|
||||||
|
position = self.getPosition() + Vector(0, 0.5 + 0.1 * #sealedTokens, 0),
|
||||||
|
rotation = self.getRotation(),
|
||||||
|
index = i - 1,
|
||||||
|
smooth = false,
|
||||||
|
callback_function = function(token)
|
||||||
|
local guid = token.getGUID()
|
||||||
|
table.insert(sealedTokens, guid)
|
||||||
|
tokenArrangerApi.layout()
|
||||||
|
if name == "Bless" or name == "Curse" then
|
||||||
|
blessCurseManagerApi.sealedToken(name, guid)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
})
|
||||||
|
return
|
||||||
|
end
|
||||||
|
end
|
||||||
|
printToColor(name .. " token not found in chaos bag", playerColor)
|
||||||
|
end
|
||||||
|
|
||||||
|
-- release the last sealed token
|
||||||
|
function releaseOneToken(playerColor)
|
||||||
|
if not chaosBagApi.canTouchChaosTokens() then return end
|
||||||
|
if #sealedTokens == 0 then
|
||||||
|
printToColor("No sealed token(s) found", playerColor)
|
||||||
|
else
|
||||||
|
printToColor("Releasing token", playerColor)
|
||||||
|
putTokenAway(table.remove(sealedTokens))
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
-- release multiple tokens at once
|
||||||
|
function releaseMultipleTokens(playerColor)
|
||||||
|
if SHOW_MULTI_RELEASE <= #sealedTokens then
|
||||||
|
for i = 1, SHOW_MULTI_RELEASE do
|
||||||
|
putTokenAway(table.remove(sealedTokens))
|
||||||
|
end
|
||||||
|
printToColor("Releasing " .. SHOW_MULTI_RELEASE .. " tokens", playerColor)
|
||||||
|
else
|
||||||
|
printToColor("Not enough tokens sealed.", playerColor)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
-- releases all sealed tokens
|
||||||
|
function releaseAllTokens(playerColor)
|
||||||
|
if not chaosBagApi.canTouchChaosTokens() then return end
|
||||||
|
if #sealedTokens == 0 then
|
||||||
|
printToColor("No sealed token(s) found", playerColor)
|
||||||
|
else
|
||||||
|
printToColor("Releasing token(s)", playerColor)
|
||||||
|
for _, guid in ipairs(sealedTokens) do
|
||||||
|
putTokenAway(guid)
|
||||||
|
end
|
||||||
|
sealedTokens = {}
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
-- returns the token (referenced by GUID) to the chaos bag
|
||||||
|
function putTokenAway(guid)
|
||||||
|
local token = getObjectFromGUID(guid)
|
||||||
|
if not token then return end
|
||||||
|
|
||||||
|
local name = token.getName()
|
||||||
|
local chaosbag = chaosBagApi.findChaosBag()
|
||||||
|
chaosbag.putObject(token)
|
||||||
|
tokenArrangerApi.layout()
|
||||||
|
if name == "Bless" or name == "Curse" then
|
||||||
|
blessCurseManagerApi.releasedToken(name, guid)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end)
|
||||||
|
__bundle_register("accessories/TokenArrangerApi", function(require, _LOADED, __bundle_register, __bundle_modules)
|
||||||
|
do
|
||||||
|
local TokenArrangerApi = {}
|
||||||
|
local guidReferenceApi = require("core/GUIDReferenceApi")
|
||||||
|
|
||||||
|
-- local function to call the token arranger, if it is on the table
|
||||||
|
---@param functionName String Name of the function to cal
|
||||||
|
---@param argument Variant Parameter to pass
|
||||||
|
local function callIfExistent(functionName, argument)
|
||||||
|
local tokenArranger = guidReferenceApi.getObjectByOwnerAndType("Mythos", "TokenArranger")
|
||||||
|
if tokenArranger ~= nil then
|
||||||
|
tokenArranger.call(functionName, argument)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
-- updates the token modifiers with the provided data
|
||||||
|
---@param tokenData Table Contains the chaos token metadata
|
||||||
|
TokenArrangerApi.onTokenDataChanged = function(fullData)
|
||||||
|
callIfExistent("onTokenDataChanged", fullData)
|
||||||
|
end
|
||||||
|
|
||||||
|
-- deletes already laid out tokens
|
||||||
|
TokenArrangerApi.deleteCopiedTokens = function()
|
||||||
|
callIfExistent("deleteCopiedTokens")
|
||||||
|
end
|
||||||
|
|
||||||
|
-- updates the laid out tokens
|
||||||
|
TokenArrangerApi.layout = function()
|
||||||
|
Wait.time(function() callIfExistent("layout") end, 0.1)
|
||||||
|
end
|
||||||
|
|
||||||
|
return TokenArrangerApi
|
||||||
|
end
|
||||||
|
end)
|
||||||
|
__bundle_register("chaosbag/BlessCurseManagerApi", function(require, _LOADED, __bundle_register, __bundle_modules)
|
||||||
|
do
|
||||||
|
local BlessCurseManagerApi = {}
|
||||||
|
local guidReferenceApi = require("core/GUIDReferenceApi")
|
||||||
|
|
||||||
|
local function getManager()
|
||||||
|
return guidReferenceApi.getObjectByOwnerAndType("Mythos", "BlessCurseManager")
|
||||||
|
end
|
||||||
|
|
||||||
|
-- removes all taken tokens and resets the counts
|
||||||
|
BlessCurseManagerApi.removeTakenTokensAndReset = function()
|
||||||
|
local BlessCurseManager = getManager()
|
||||||
|
Wait.time(function() BlessCurseManager.call("removeTakenTokens", "Bless") end, 0.05)
|
||||||
|
Wait.time(function() BlessCurseManager.call("removeTakenTokens", "Curse") end, 0.10)
|
||||||
|
Wait.time(function() BlessCurseManager.call("doReset", "White") end, 0.15)
|
||||||
|
end
|
||||||
|
|
||||||
|
-- updates the internal count (called by cards that seal bless/curse tokens)
|
||||||
|
BlessCurseManagerApi.sealedToken = function(type, guid)
|
||||||
|
getManager().call("sealedToken", { type = type, guid = guid })
|
||||||
|
end
|
||||||
|
|
||||||
|
-- updates the internal count (called by cards that seal bless/curse tokens)
|
||||||
|
BlessCurseManagerApi.releasedToken = function(type, guid)
|
||||||
|
getManager().call("releasedToken", { type = type, guid = guid })
|
||||||
|
end
|
||||||
|
|
||||||
|
-- broadcasts the current status for bless/curse tokens
|
||||||
|
---@param playerColor String Color of the player to show the broadcast to
|
||||||
|
BlessCurseManagerApi.broadcastStatus = function(playerColor)
|
||||||
|
getManager().call("broadcastStatus", playerColor)
|
||||||
|
end
|
||||||
|
|
||||||
|
-- removes all bless / curse tokens from the chaos bag and play
|
||||||
|
---@param playerColor String Color of the player to show the broadcast to
|
||||||
|
BlessCurseManagerApi.removeAll = function(playerColor)
|
||||||
|
getManager().call("doRemove", playerColor)
|
||||||
|
end
|
||||||
|
|
||||||
|
-- adds Wendy's menu to the hovered card (allows sealing of tokens)
|
||||||
|
---@param color String Color of the player to show the broadcast to
|
||||||
|
BlessCurseManagerApi.addWendysMenu = function(playerColor, hoveredObject)
|
||||||
|
getManager().call("addMenuOptions", { playerColor = playerColor, hoveredObject = hoveredObject })
|
||||||
|
end
|
||||||
|
|
||||||
|
return BlessCurseManagerApi
|
||||||
|
end
|
||||||
|
end)
|
||||||
|
__bundle_register("chaosbag/ChaosBagApi", function(require, _LOADED, __bundle_register, __bundle_modules)
|
||||||
|
do
|
||||||
|
local ChaosBagApi = {}
|
||||||
|
|
||||||
|
-- respawns the chaos bag with a new state of tokens
|
||||||
|
---@param tokenList Table List of chaos token ids
|
||||||
|
ChaosBagApi.setChaosBagState = function(tokenList)
|
||||||
|
return Global.call("setChaosBagState", tokenList)
|
||||||
|
end
|
||||||
|
|
||||||
|
-- returns a Table List of chaos token ids in the current chaos bag
|
||||||
|
-- requires copying the data into a new table because TTS is weird about handling table return values in Global
|
||||||
|
ChaosBagApi.getChaosBagState = function()
|
||||||
|
local chaosBagContentsCatcher = Global.call("getChaosBagState")
|
||||||
|
local chaosBagContents = {}
|
||||||
|
for _, v in ipairs(chaosBagContentsCatcher) do
|
||||||
|
table.insert(chaosBagContents, v)
|
||||||
|
end
|
||||||
|
return chaosBagContents
|
||||||
|
end
|
||||||
|
|
||||||
|
-- checks scripting zone for chaos bag (also called by a lot of objects!)
|
||||||
|
ChaosBagApi.findChaosBag = function()
|
||||||
|
return Global.call("findChaosBag")
|
||||||
|
end
|
||||||
|
|
||||||
|
-- returns a table of object references to the tokens in play (does not include sealed tokens!)
|
||||||
|
ChaosBagApi.getTokensInPlay = function()
|
||||||
|
return Global.getTable("chaosTokens")
|
||||||
|
end
|
||||||
|
|
||||||
|
-- returns all sealed tokens on cards to the chaos bag
|
||||||
|
ChaosBagApi.releaseAllSealedTokens = function(playerColor)
|
||||||
|
return Global.call("releaseAllSealedTokens", playerColor)
|
||||||
|
end
|
||||||
|
|
||||||
|
-- returns all drawn tokens to the chaos bag
|
||||||
|
ChaosBagApi.returnChaosTokens = function(playerColor)
|
||||||
|
return Global.call("returnChaosTokens", playerColor)
|
||||||
|
end
|
||||||
|
|
||||||
|
-- removes the specified chaos token from the chaos bag
|
||||||
|
---@param id String ID of the chaos token
|
||||||
|
ChaosBagApi.removeChaosToken = function(id)
|
||||||
|
return Global.call("removeChaosToken", id)
|
||||||
|
end
|
||||||
|
|
||||||
|
-- spawns the specified chaos token and puts it into the chaos bag
|
||||||
|
---@param id String ID of the chaos token
|
||||||
|
ChaosBagApi.spawnChaosToken = function(id)
|
||||||
|
return Global.call("spawnChaosToken", id)
|
||||||
|
end
|
||||||
|
|
||||||
|
-- Checks to see if the chaos bag can be manipulated. If a player is searching the bag when tokens
|
||||||
|
-- are drawn or replaced a TTS bug can cause those tokens to vanish. Any functions which change the
|
||||||
|
-- contents of the bag should check this method before doing so.
|
||||||
|
-- This method will broadcast a message to all players if the bag is being searched.
|
||||||
|
---@return Boolean. True if the bag is manipulated, false if it should be blocked.
|
||||||
|
ChaosBagApi.canTouchChaosTokens = function()
|
||||||
|
return Global.call("canTouchChaosTokens")
|
||||||
|
end
|
||||||
|
|
||||||
|
-- called by playermats (by the "Draw chaos token" button)
|
||||||
|
ChaosBagApi.drawChaosToken = function(mat, tokenOffset, isRightClick)
|
||||||
|
return Global.call("drawChaosToken", {mat, tokenOffset, isRightClick})
|
||||||
|
end
|
||||||
|
|
||||||
|
-- returns a Table List of chaos token ids in the current chaos bag
|
||||||
|
-- requires copying the data into a new table because TTS is weird about handling table return values in Global
|
||||||
|
ChaosBagApi.getIdUrlMap = function()
|
||||||
|
return Global.getTable("ID_URL_MAP")
|
||||||
|
end
|
||||||
|
|
||||||
|
return ChaosBagApi
|
||||||
|
end
|
||||||
|
end)
|
||||||
|
__bundle_register("core/GUIDReferenceApi", function(require, _LOADED, __bundle_register, __bundle_modules)
|
||||||
|
do
|
||||||
|
local GUIDReferenceApi = {}
|
||||||
|
|
||||||
|
local function getGuidHandler()
|
||||||
|
return getObjectFromGUID("123456")
|
||||||
|
end
|
||||||
|
|
||||||
|
-- returns all matching objects as a table with references
|
||||||
|
---@param owner String Parent object for this search
|
||||||
|
---@param type String Type of object to search for
|
||||||
|
GUIDReferenceApi.getObjectByOwnerAndType = function(owner, type)
|
||||||
|
return getGuidHandler().call("getObjectByOwnerAndType", { owner = owner, type = type })
|
||||||
|
end
|
||||||
|
|
||||||
|
-- returns all matching objects as a table with references
|
||||||
|
---@param type String Type of object to search for
|
||||||
|
GUIDReferenceApi.getObjectsByType = function(type)
|
||||||
|
return getGuidHandler().call("getObjectsByType", type)
|
||||||
|
end
|
||||||
|
|
||||||
|
-- returns all matching objects as a table with references
|
||||||
|
---@param owner String Parent object for this search
|
||||||
|
GUIDReferenceApi.getObjectsByOwner = function(owner)
|
||||||
|
return getGuidHandler().call("getObjectsByOwner", owner)
|
||||||
|
end
|
||||||
|
|
||||||
|
return GUIDReferenceApi
|
||||||
|
end
|
||||||
|
end)
|
||||||
|
__bundle_register("__root", function(require, _LOADED, __bundle_register, __bundle_modules)
|
||||||
|
require("playercards/cards/FluteoftheOuterGods4")
|
||||||
|
end)
|
||||||
|
return __bundle_require("__root")
|
@ -12,7 +12,7 @@ CustomDeck:
|
|||||||
'3':
|
'3':
|
||||||
BackIsHidden: true
|
BackIsHidden: true
|
||||||
BackURL: https://i.imgur.com/EcbhVuh.jpg/
|
BackURL: https://i.imgur.com/EcbhVuh.jpg/
|
||||||
FaceURL: http://cloud-3.steamusercontent.com/ugc/2021607899142908284/92DF67E4310BCDFAD6C4BB12D31155DBF6B07A25/
|
FaceURL: http://cloud-3.steamusercontent.com/ugc/2115061845812962486/A68B8BF7E4862F21369DAC4A37D813EC664EAC34/
|
||||||
NumHeight: 6
|
NumHeight: 6
|
||||||
NumWidth: 10
|
NumWidth: 10
|
||||||
Type: 0
|
Type: 0
|
||||||
@ -31,7 +31,7 @@ HideWhenFaceDown: true
|
|||||||
IgnoreFoW: false
|
IgnoreFoW: false
|
||||||
LayoutGroupSortIndex: 0
|
LayoutGroupSortIndex: 0
|
||||||
Locked: false
|
Locked: false
|
||||||
LuaScript: ''
|
LuaScript: !include 'Card Flute of the Outer Gods (4) (Taboo) 453fd1.ttslua'
|
||||||
LuaScriptState: ''
|
LuaScriptState: ''
|
||||||
MeasureMovement: false
|
MeasureMovement: false
|
||||||
Name: Card
|
Name: Card
|
||||||
|
@ -41,47 +41,18 @@ local __bundle_require, __bundle_loaded, __bundle_register, __bundle_modules = (
|
|||||||
|
|
||||||
return require, loaded, register, modules
|
return require, loaded, register, modules
|
||||||
end)(nil)
|
end)(nil)
|
||||||
__bundle_register("accessories/TokenArrangerApi", function(require, _LOADED, __bundle_register, __bundle_modules)
|
|
||||||
do
|
|
||||||
local TokenArrangerApi = {}
|
|
||||||
|
|
||||||
-- local function to call the token arranger, if it is on the table
|
|
||||||
---@param functionName String Name of the function to cal
|
|
||||||
---@param argument Variant Parameter to pass
|
|
||||||
local function callIfExistent(functionName, argument)
|
|
||||||
local tokenArranger = getObjectsWithTag("TokenArranger")[1]
|
|
||||||
if tokenArranger ~= nil then
|
|
||||||
tokenArranger.call(functionName, argument)
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
-- updates the token modifiers with the provided data
|
|
||||||
---@param tokenData Table Contains the chaos token metadata
|
|
||||||
TokenArrangerApi.onTokenDataChanged = function(fullData)
|
|
||||||
callIfExistent("onTokenDataChanged", fullData)
|
|
||||||
end
|
|
||||||
|
|
||||||
-- deletes already laid out tokens
|
|
||||||
TokenArrangerApi.deleteCopiedTokens = function()
|
|
||||||
callIfExistent("deleteCopiedTokens")
|
|
||||||
end
|
|
||||||
|
|
||||||
-- updates the laid out tokens
|
|
||||||
TokenArrangerApi.layout = function()
|
|
||||||
Wait.time(function() callIfExistent("layout") end, 0.1)
|
|
||||||
end
|
|
||||||
|
|
||||||
return TokenArrangerApi
|
|
||||||
end
|
|
||||||
end)
|
|
||||||
__bundle_register("chaosbag/BlessCurseManagerApi", function(require, _LOADED, __bundle_register, __bundle_modules)
|
__bundle_register("chaosbag/BlessCurseManagerApi", function(require, _LOADED, __bundle_register, __bundle_modules)
|
||||||
do
|
do
|
||||||
local BlessCurseManagerApi = {}
|
local BlessCurseManagerApi = {}
|
||||||
local MANAGER_GUID = "5933fb"
|
local guidReferenceApi = require("core/GUIDReferenceApi")
|
||||||
|
|
||||||
|
local function getManager()
|
||||||
|
return guidReferenceApi.getObjectByOwnerAndType("Mythos", "BlessCurseManager")
|
||||||
|
end
|
||||||
|
|
||||||
-- removes all taken tokens and resets the counts
|
-- removes all taken tokens and resets the counts
|
||||||
BlessCurseManagerApi.removeTakenTokensAndReset = function()
|
BlessCurseManagerApi.removeTakenTokensAndReset = function()
|
||||||
local BlessCurseManager = getObjectFromGUID(MANAGER_GUID)
|
local BlessCurseManager = getManager()
|
||||||
Wait.time(function() BlessCurseManager.call("removeTakenTokens", "Bless") end, 0.05)
|
Wait.time(function() BlessCurseManager.call("removeTakenTokens", "Bless") end, 0.05)
|
||||||
Wait.time(function() BlessCurseManager.call("removeTakenTokens", "Curse") end, 0.10)
|
Wait.time(function() BlessCurseManager.call("removeTakenTokens", "Curse") end, 0.10)
|
||||||
Wait.time(function() BlessCurseManager.call("doReset", "White") end, 0.15)
|
Wait.time(function() BlessCurseManager.call("doReset", "White") end, 0.15)
|
||||||
@ -89,30 +60,30 @@ do
|
|||||||
|
|
||||||
-- updates the internal count (called by cards that seal bless/curse tokens)
|
-- updates the internal count (called by cards that seal bless/curse tokens)
|
||||||
BlessCurseManagerApi.sealedToken = function(type, guid)
|
BlessCurseManagerApi.sealedToken = function(type, guid)
|
||||||
getObjectFromGUID(MANAGER_GUID).call("sealedToken", { type = type, guid = guid })
|
getManager().call("sealedToken", { type = type, guid = guid })
|
||||||
end
|
end
|
||||||
|
|
||||||
-- updates the internal count (called by cards that seal bless/curse tokens)
|
-- updates the internal count (called by cards that seal bless/curse tokens)
|
||||||
BlessCurseManagerApi.releasedToken = function(type, guid)
|
BlessCurseManagerApi.releasedToken = function(type, guid)
|
||||||
getObjectFromGUID(MANAGER_GUID).call("releasedToken", { type = type, guid = guid })
|
getManager().call("releasedToken", { type = type, guid = guid })
|
||||||
end
|
end
|
||||||
|
|
||||||
-- broadcasts the current status for bless/curse tokens
|
-- broadcasts the current status for bless/curse tokens
|
||||||
---@param playerColor String Color of the player to show the broadcast to
|
---@param playerColor String Color of the player to show the broadcast to
|
||||||
BlessCurseManagerApi.broadcastStatus = function(playerColor)
|
BlessCurseManagerApi.broadcastStatus = function(playerColor)
|
||||||
getObjectFromGUID(MANAGER_GUID).call("broadcastStatus", playerColor)
|
getManager().call("broadcastStatus", playerColor)
|
||||||
end
|
end
|
||||||
|
|
||||||
-- removes all bless / curse tokens from the chaos bag and play
|
-- removes all bless / curse tokens from the chaos bag and play
|
||||||
---@param playerColor String Color of the player to show the broadcast to
|
---@param playerColor String Color of the player to show the broadcast to
|
||||||
BlessCurseManagerApi.removeAll = function(playerColor)
|
BlessCurseManagerApi.removeAll = function(playerColor)
|
||||||
getObjectFromGUID(MANAGER_GUID).call("doRemove", playerColor)
|
getManager().call("doRemove", playerColor)
|
||||||
end
|
end
|
||||||
|
|
||||||
-- adds Wendy's menu to the hovered card (allows sealing of tokens)
|
-- adds Wendy's menu to the hovered card (allows sealing of tokens)
|
||||||
---@param color String Color of the player to show the broadcast to
|
---@param color String Color of the player to show the broadcast to
|
||||||
BlessCurseManagerApi.addWendysMenu = function(playerColor, hoveredObject)
|
BlessCurseManagerApi.addWendysMenu = function(playerColor, hoveredObject)
|
||||||
getObjectFromGUID(MANAGER_GUID).call("addMenuOptions", { playerColor = playerColor, hoveredObject = hoveredObject })
|
getManager().call("addMenuOptions", { playerColor = playerColor, hoveredObject = hoveredObject })
|
||||||
end
|
end
|
||||||
|
|
||||||
return BlessCurseManagerApi
|
return BlessCurseManagerApi
|
||||||
@ -194,6 +165,36 @@ do
|
|||||||
return ChaosBagApi
|
return ChaosBagApi
|
||||||
end
|
end
|
||||||
end)
|
end)
|
||||||
|
__bundle_register("core/GUIDReferenceApi", function(require, _LOADED, __bundle_register, __bundle_modules)
|
||||||
|
do
|
||||||
|
local GUIDReferenceApi = {}
|
||||||
|
|
||||||
|
local function getGuidHandler()
|
||||||
|
return getObjectFromGUID("123456")
|
||||||
|
end
|
||||||
|
|
||||||
|
-- returns all matching objects as a table with references
|
||||||
|
---@param owner String Parent object for this search
|
||||||
|
---@param type String Type of object to search for
|
||||||
|
GUIDReferenceApi.getObjectByOwnerAndType = function(owner, type)
|
||||||
|
return getGuidHandler().call("getObjectByOwnerAndType", { owner = owner, type = type })
|
||||||
|
end
|
||||||
|
|
||||||
|
-- returns all matching objects as a table with references
|
||||||
|
---@param type String Type of object to search for
|
||||||
|
GUIDReferenceApi.getObjectsByType = function(type)
|
||||||
|
return getGuidHandler().call("getObjectsByType", type)
|
||||||
|
end
|
||||||
|
|
||||||
|
-- returns all matching objects as a table with references
|
||||||
|
---@param owner String Parent object for this search
|
||||||
|
GUIDReferenceApi.getObjectsByOwner = function(owner)
|
||||||
|
return getGuidHandler().call("getObjectsByOwner", owner)
|
||||||
|
end
|
||||||
|
|
||||||
|
return GUIDReferenceApi
|
||||||
|
end
|
||||||
|
end)
|
||||||
__bundle_register("__root", function(require, _LOADED, __bundle_register, __bundle_modules)
|
__bundle_register("__root", function(require, _LOADED, __bundle_register, __bundle_modules)
|
||||||
require("playercards/cards/FluteoftheOuterGods4")
|
require("playercards/cards/FluteoftheOuterGods4")
|
||||||
end)
|
end)
|
||||||
@ -435,4 +436,38 @@ function putTokenAway(guid)
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
end)
|
end)
|
||||||
|
__bundle_register("accessories/TokenArrangerApi", function(require, _LOADED, __bundle_register, __bundle_modules)
|
||||||
|
do
|
||||||
|
local TokenArrangerApi = {}
|
||||||
|
local guidReferenceApi = require("core/GUIDReferenceApi")
|
||||||
|
|
||||||
|
-- local function to call the token arranger, if it is on the table
|
||||||
|
---@param functionName String Name of the function to cal
|
||||||
|
---@param argument Variant Parameter to pass
|
||||||
|
local function callIfExistent(functionName, argument)
|
||||||
|
local tokenArranger = guidReferenceApi.getObjectByOwnerAndType("Mythos", "TokenArranger")
|
||||||
|
if tokenArranger ~= nil then
|
||||||
|
tokenArranger.call(functionName, argument)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
-- updates the token modifiers with the provided data
|
||||||
|
---@param tokenData Table Contains the chaos token metadata
|
||||||
|
TokenArrangerApi.onTokenDataChanged = function(fullData)
|
||||||
|
callIfExistent("onTokenDataChanged", fullData)
|
||||||
|
end
|
||||||
|
|
||||||
|
-- deletes already laid out tokens
|
||||||
|
TokenArrangerApi.deleteCopiedTokens = function()
|
||||||
|
callIfExistent("deleteCopiedTokens")
|
||||||
|
end
|
||||||
|
|
||||||
|
-- updates the laid out tokens
|
||||||
|
TokenArrangerApi.layout = function()
|
||||||
|
Wait.time(function() callIfExistent("layout") end, 0.1)
|
||||||
|
end
|
||||||
|
|
||||||
|
return TokenArrangerApi
|
||||||
|
end
|
||||||
|
end)
|
||||||
return __bundle_require("__root")
|
return __bundle_require("__root")
|
@ -12,7 +12,7 @@ CustomDeck:
|
|||||||
'3':
|
'3':
|
||||||
BackIsHidden: true
|
BackIsHidden: true
|
||||||
BackURL: https://i.imgur.com/EcbhVuh.jpg/
|
BackURL: https://i.imgur.com/EcbhVuh.jpg/
|
||||||
FaceURL: http://cloud-3.steamusercontent.com/ugc/2021607899142908284/92DF67E4310BCDFAD6C4BB12D31155DBF6B07A25/
|
FaceURL: http://cloud-3.steamusercontent.com/ugc/2115061845812962486/A68B8BF7E4862F21369DAC4A37D813EC664EAC34/
|
||||||
NumHeight: 6
|
NumHeight: 6
|
||||||
NumWidth: 10
|
NumWidth: 10
|
||||||
Type: 0
|
Type: 0
|
||||||
|
@ -12,7 +12,7 @@ CustomDeck:
|
|||||||
'3':
|
'3':
|
||||||
BackIsHidden: true
|
BackIsHidden: true
|
||||||
BackURL: https://i.imgur.com/EcbhVuh.jpg/
|
BackURL: https://i.imgur.com/EcbhVuh.jpg/
|
||||||
FaceURL: http://cloud-3.steamusercontent.com/ugc/2021607899142908284/92DF67E4310BCDFAD6C4BB12D31155DBF6B07A25/
|
FaceURL: http://cloud-3.steamusercontent.com/ugc/2115061845812962486/A68B8BF7E4862F21369DAC4A37D813EC664EAC34/
|
||||||
NumHeight: 6
|
NumHeight: 6
|
||||||
NumWidth: 10
|
NumWidth: 10
|
||||||
Type: 0
|
Type: 0
|
||||||
|
@ -12,7 +12,7 @@ CustomDeck:
|
|||||||
'3':
|
'3':
|
||||||
BackIsHidden: true
|
BackIsHidden: true
|
||||||
BackURL: https://i.imgur.com/EcbhVuh.jpg/
|
BackURL: https://i.imgur.com/EcbhVuh.jpg/
|
||||||
FaceURL: http://cloud-3.steamusercontent.com/ugc/2021607899142908284/92DF67E4310BCDFAD6C4BB12D31155DBF6B07A25/
|
FaceURL: http://cloud-3.steamusercontent.com/ugc/2115061845812962486/A68B8BF7E4862F21369DAC4A37D813EC664EAC34/
|
||||||
NumHeight: 6
|
NumHeight: 6
|
||||||
NumWidth: 10
|
NumWidth: 10
|
||||||
Type: 0
|
Type: 0
|
||||||
|
@ -0,0 +1,55 @@
|
|||||||
|
AltLookAngle:
|
||||||
|
x: 0
|
||||||
|
y: 0
|
||||||
|
z: 0
|
||||||
|
Autoraise: true
|
||||||
|
CardID: 910300
|
||||||
|
ColorDiffuse:
|
||||||
|
b: 0.71324
|
||||||
|
g: 0.71324
|
||||||
|
r: 0.71324
|
||||||
|
CustomDeck:
|
||||||
|
'9103':
|
||||||
|
BackIsHidden: true
|
||||||
|
BackURL: https://i.imgur.com/EcbhVuh.jpg/
|
||||||
|
FaceURL: http://cloud-3.steamusercontent.com/ugc/2223150865961116492/B9D47B63A4285734AC59208BA2F5509EF4B8C138/
|
||||||
|
NumHeight: 1
|
||||||
|
NumWidth: 1
|
||||||
|
Type: 0
|
||||||
|
UniqueBack: false
|
||||||
|
Description: ''
|
||||||
|
DragSelectable: true
|
||||||
|
GMNotes: "{\n \"id\": \"10003\",\n \"type\": \"Treachery\",\n \"class\": \"Neutral\",\n
|
||||||
|
\ \"traits\": \"Blunder.\",\n \"weakness\": true,\n \"cycle\": \"The Feast of
|
||||||
|
Hemlock Vale\"\n}"
|
||||||
|
GUID: 0821d5
|
||||||
|
Grid: true
|
||||||
|
GridProjection: false
|
||||||
|
Hands: true
|
||||||
|
HideWhenFaceDown: true
|
||||||
|
IgnoreFoW: false
|
||||||
|
LayoutGroupSortIndex: 0
|
||||||
|
Locked: false
|
||||||
|
LuaScript: ''
|
||||||
|
LuaScriptState: ''
|
||||||
|
MeasureMovement: false
|
||||||
|
Name: Card
|
||||||
|
Nickname: Hasty Repairs
|
||||||
|
SidewaysCard: false
|
||||||
|
Snap: true
|
||||||
|
Sticky: true
|
||||||
|
Tags:
|
||||||
|
- PlayerCard
|
||||||
|
Tooltip: true
|
||||||
|
Transform:
|
||||||
|
posX: 10.69
|
||||||
|
posY: 2.44
|
||||||
|
posZ: 43.88
|
||||||
|
rotX: 0
|
||||||
|
rotY: 270
|
||||||
|
rotZ: 0
|
||||||
|
scaleX: 1
|
||||||
|
scaleY: 1
|
||||||
|
scaleZ: 1
|
||||||
|
Value: 0
|
||||||
|
XmlUI: ''
|
@ -41,6 +41,160 @@ local __bundle_require, __bundle_loaded, __bundle_register, __bundle_modules = (
|
|||||||
|
|
||||||
return require, loaded, register, modules
|
return require, loaded, register, modules
|
||||||
end)(nil)
|
end)(nil)
|
||||||
|
__bundle_register("chaosbag/BlessCurseManagerApi", function(require, _LOADED, __bundle_register, __bundle_modules)
|
||||||
|
do
|
||||||
|
local BlessCurseManagerApi = {}
|
||||||
|
local guidReferenceApi = require("core/GUIDReferenceApi")
|
||||||
|
|
||||||
|
local function getManager()
|
||||||
|
return guidReferenceApi.getObjectByOwnerAndType("Mythos", "BlessCurseManager")
|
||||||
|
end
|
||||||
|
|
||||||
|
-- removes all taken tokens and resets the counts
|
||||||
|
BlessCurseManagerApi.removeTakenTokensAndReset = function()
|
||||||
|
local BlessCurseManager = getManager()
|
||||||
|
Wait.time(function() BlessCurseManager.call("removeTakenTokens", "Bless") end, 0.05)
|
||||||
|
Wait.time(function() BlessCurseManager.call("removeTakenTokens", "Curse") end, 0.10)
|
||||||
|
Wait.time(function() BlessCurseManager.call("doReset", "White") end, 0.15)
|
||||||
|
end
|
||||||
|
|
||||||
|
-- updates the internal count (called by cards that seal bless/curse tokens)
|
||||||
|
BlessCurseManagerApi.sealedToken = function(type, guid)
|
||||||
|
getManager().call("sealedToken", { type = type, guid = guid })
|
||||||
|
end
|
||||||
|
|
||||||
|
-- updates the internal count (called by cards that seal bless/curse tokens)
|
||||||
|
BlessCurseManagerApi.releasedToken = function(type, guid)
|
||||||
|
getManager().call("releasedToken", { type = type, guid = guid })
|
||||||
|
end
|
||||||
|
|
||||||
|
-- broadcasts the current status for bless/curse tokens
|
||||||
|
---@param playerColor String Color of the player to show the broadcast to
|
||||||
|
BlessCurseManagerApi.broadcastStatus = function(playerColor)
|
||||||
|
getManager().call("broadcastStatus", playerColor)
|
||||||
|
end
|
||||||
|
|
||||||
|
-- removes all bless / curse tokens from the chaos bag and play
|
||||||
|
---@param playerColor String Color of the player to show the broadcast to
|
||||||
|
BlessCurseManagerApi.removeAll = function(playerColor)
|
||||||
|
getManager().call("doRemove", playerColor)
|
||||||
|
end
|
||||||
|
|
||||||
|
-- adds Wendy's menu to the hovered card (allows sealing of tokens)
|
||||||
|
---@param color String Color of the player to show the broadcast to
|
||||||
|
BlessCurseManagerApi.addWendysMenu = function(playerColor, hoveredObject)
|
||||||
|
getManager().call("addMenuOptions", { playerColor = playerColor, hoveredObject = hoveredObject })
|
||||||
|
end
|
||||||
|
|
||||||
|
return BlessCurseManagerApi
|
||||||
|
end
|
||||||
|
end)
|
||||||
|
__bundle_register("chaosbag/ChaosBagApi", function(require, _LOADED, __bundle_register, __bundle_modules)
|
||||||
|
do
|
||||||
|
local ChaosBagApi = {}
|
||||||
|
|
||||||
|
-- respawns the chaos bag with a new state of tokens
|
||||||
|
---@param tokenList Table List of chaos token ids
|
||||||
|
ChaosBagApi.setChaosBagState = function(tokenList)
|
||||||
|
return Global.call("setChaosBagState", tokenList)
|
||||||
|
end
|
||||||
|
|
||||||
|
-- returns a Table List of chaos token ids in the current chaos bag
|
||||||
|
-- requires copying the data into a new table because TTS is weird about handling table return values in Global
|
||||||
|
ChaosBagApi.getChaosBagState = function()
|
||||||
|
local chaosBagContentsCatcher = Global.call("getChaosBagState")
|
||||||
|
local chaosBagContents = {}
|
||||||
|
for _, v in ipairs(chaosBagContentsCatcher) do
|
||||||
|
table.insert(chaosBagContents, v)
|
||||||
|
end
|
||||||
|
return chaosBagContents
|
||||||
|
end
|
||||||
|
|
||||||
|
-- checks scripting zone for chaos bag (also called by a lot of objects!)
|
||||||
|
ChaosBagApi.findChaosBag = function()
|
||||||
|
return Global.call("findChaosBag")
|
||||||
|
end
|
||||||
|
|
||||||
|
-- returns a table of object references to the tokens in play (does not include sealed tokens!)
|
||||||
|
ChaosBagApi.getTokensInPlay = function()
|
||||||
|
return Global.getTable("chaosTokens")
|
||||||
|
end
|
||||||
|
|
||||||
|
-- returns all sealed tokens on cards to the chaos bag
|
||||||
|
ChaosBagApi.releaseAllSealedTokens = function(playerColor)
|
||||||
|
return Global.call("releaseAllSealedTokens", playerColor)
|
||||||
|
end
|
||||||
|
|
||||||
|
-- returns all drawn tokens to the chaos bag
|
||||||
|
ChaosBagApi.returnChaosTokens = function(playerColor)
|
||||||
|
return Global.call("returnChaosTokens", playerColor)
|
||||||
|
end
|
||||||
|
|
||||||
|
-- removes the specified chaos token from the chaos bag
|
||||||
|
---@param id String ID of the chaos token
|
||||||
|
ChaosBagApi.removeChaosToken = function(id)
|
||||||
|
return Global.call("removeChaosToken", id)
|
||||||
|
end
|
||||||
|
|
||||||
|
-- spawns the specified chaos token and puts it into the chaos bag
|
||||||
|
---@param id String ID of the chaos token
|
||||||
|
ChaosBagApi.spawnChaosToken = function(id)
|
||||||
|
return Global.call("spawnChaosToken", id)
|
||||||
|
end
|
||||||
|
|
||||||
|
-- Checks to see if the chaos bag can be manipulated. If a player is searching the bag when tokens
|
||||||
|
-- are drawn or replaced a TTS bug can cause those tokens to vanish. Any functions which change the
|
||||||
|
-- contents of the bag should check this method before doing so.
|
||||||
|
-- This method will broadcast a message to all players if the bag is being searched.
|
||||||
|
---@return Boolean. True if the bag is manipulated, false if it should be blocked.
|
||||||
|
ChaosBagApi.canTouchChaosTokens = function()
|
||||||
|
return Global.call("canTouchChaosTokens")
|
||||||
|
end
|
||||||
|
|
||||||
|
-- called by playermats (by the "Draw chaos token" button)
|
||||||
|
ChaosBagApi.drawChaosToken = function(mat, tokenOffset, isRightClick)
|
||||||
|
return Global.call("drawChaosToken", {mat, tokenOffset, isRightClick})
|
||||||
|
end
|
||||||
|
|
||||||
|
-- returns a Table List of chaos token ids in the current chaos bag
|
||||||
|
-- requires copying the data into a new table because TTS is weird about handling table return values in Global
|
||||||
|
ChaosBagApi.getIdUrlMap = function()
|
||||||
|
return Global.getTable("ID_URL_MAP")
|
||||||
|
end
|
||||||
|
|
||||||
|
return ChaosBagApi
|
||||||
|
end
|
||||||
|
end)
|
||||||
|
__bundle_register("core/GUIDReferenceApi", function(require, _LOADED, __bundle_register, __bundle_modules)
|
||||||
|
do
|
||||||
|
local GUIDReferenceApi = {}
|
||||||
|
|
||||||
|
local function getGuidHandler()
|
||||||
|
return getObjectFromGUID("123456")
|
||||||
|
end
|
||||||
|
|
||||||
|
-- returns all matching objects as a table with references
|
||||||
|
---@param owner String Parent object for this search
|
||||||
|
---@param type String Type of object to search for
|
||||||
|
GUIDReferenceApi.getObjectByOwnerAndType = function(owner, type)
|
||||||
|
return getGuidHandler().call("getObjectByOwnerAndType", { owner = owner, type = type })
|
||||||
|
end
|
||||||
|
|
||||||
|
-- returns all matching objects as a table with references
|
||||||
|
---@param type String Type of object to search for
|
||||||
|
GUIDReferenceApi.getObjectsByType = function(type)
|
||||||
|
return getGuidHandler().call("getObjectsByType", type)
|
||||||
|
end
|
||||||
|
|
||||||
|
-- returns all matching objects as a table with references
|
||||||
|
---@param owner String Parent object for this search
|
||||||
|
GUIDReferenceApi.getObjectsByOwner = function(owner)
|
||||||
|
return getGuidHandler().call("getObjectsByOwner", owner)
|
||||||
|
end
|
||||||
|
|
||||||
|
return GUIDReferenceApi
|
||||||
|
end
|
||||||
|
end)
|
||||||
__bundle_register("__root", function(require, _LOADED, __bundle_register, __bundle_modules)
|
__bundle_register("__root", function(require, _LOADED, __bundle_register, __bundle_modules)
|
||||||
require("playercards/cards/HolySpear5")
|
require("playercards/cards/HolySpear5")
|
||||||
end)
|
end)
|
||||||
@ -285,12 +439,13 @@ end)
|
|||||||
__bundle_register("accessories/TokenArrangerApi", function(require, _LOADED, __bundle_register, __bundle_modules)
|
__bundle_register("accessories/TokenArrangerApi", function(require, _LOADED, __bundle_register, __bundle_modules)
|
||||||
do
|
do
|
||||||
local TokenArrangerApi = {}
|
local TokenArrangerApi = {}
|
||||||
|
local guidReferenceApi = require("core/GUIDReferenceApi")
|
||||||
|
|
||||||
-- local function to call the token arranger, if it is on the table
|
-- local function to call the token arranger, if it is on the table
|
||||||
---@param functionName String Name of the function to cal
|
---@param functionName String Name of the function to cal
|
||||||
---@param argument Variant Parameter to pass
|
---@param argument Variant Parameter to pass
|
||||||
local function callIfExistent(functionName, argument)
|
local function callIfExistent(functionName, argument)
|
||||||
local tokenArranger = getObjectsWithTag("TokenArranger")[1]
|
local tokenArranger = guidReferenceApi.getObjectByOwnerAndType("Mythos", "TokenArranger")
|
||||||
if tokenArranger ~= nil then
|
if tokenArranger ~= nil then
|
||||||
tokenArranger.call(functionName, argument)
|
tokenArranger.call(functionName, argument)
|
||||||
end
|
end
|
||||||
@ -315,124 +470,4 @@ do
|
|||||||
return TokenArrangerApi
|
return TokenArrangerApi
|
||||||
end
|
end
|
||||||
end)
|
end)
|
||||||
__bundle_register("chaosbag/BlessCurseManagerApi", function(require, _LOADED, __bundle_register, __bundle_modules)
|
|
||||||
do
|
|
||||||
local BlessCurseManagerApi = {}
|
|
||||||
local MANAGER_GUID = "5933fb"
|
|
||||||
|
|
||||||
-- removes all taken tokens and resets the counts
|
|
||||||
BlessCurseManagerApi.removeTakenTokensAndReset = function()
|
|
||||||
local BlessCurseManager = getObjectFromGUID(MANAGER_GUID)
|
|
||||||
Wait.time(function() BlessCurseManager.call("removeTakenTokens", "Bless") end, 0.05)
|
|
||||||
Wait.time(function() BlessCurseManager.call("removeTakenTokens", "Curse") end, 0.10)
|
|
||||||
Wait.time(function() BlessCurseManager.call("doReset", "White") end, 0.15)
|
|
||||||
end
|
|
||||||
|
|
||||||
-- updates the internal count (called by cards that seal bless/curse tokens)
|
|
||||||
BlessCurseManagerApi.sealedToken = function(type, guid)
|
|
||||||
getObjectFromGUID(MANAGER_GUID).call("sealedToken", { type = type, guid = guid })
|
|
||||||
end
|
|
||||||
|
|
||||||
-- updates the internal count (called by cards that seal bless/curse tokens)
|
|
||||||
BlessCurseManagerApi.releasedToken = function(type, guid)
|
|
||||||
getObjectFromGUID(MANAGER_GUID).call("releasedToken", { type = type, guid = guid })
|
|
||||||
end
|
|
||||||
|
|
||||||
-- broadcasts the current status for bless/curse tokens
|
|
||||||
---@param playerColor String Color of the player to show the broadcast to
|
|
||||||
BlessCurseManagerApi.broadcastStatus = function(playerColor)
|
|
||||||
getObjectFromGUID(MANAGER_GUID).call("broadcastStatus", playerColor)
|
|
||||||
end
|
|
||||||
|
|
||||||
-- removes all bless / curse tokens from the chaos bag and play
|
|
||||||
---@param playerColor String Color of the player to show the broadcast to
|
|
||||||
BlessCurseManagerApi.removeAll = function(playerColor)
|
|
||||||
getObjectFromGUID(MANAGER_GUID).call("doRemove", playerColor)
|
|
||||||
end
|
|
||||||
|
|
||||||
-- adds Wendy's menu to the hovered card (allows sealing of tokens)
|
|
||||||
---@param color String Color of the player to show the broadcast to
|
|
||||||
BlessCurseManagerApi.addWendysMenu = function(playerColor, hoveredObject)
|
|
||||||
getObjectFromGUID(MANAGER_GUID).call("addMenuOptions", { playerColor = playerColor, hoveredObject = hoveredObject })
|
|
||||||
end
|
|
||||||
|
|
||||||
return BlessCurseManagerApi
|
|
||||||
end
|
|
||||||
end)
|
|
||||||
__bundle_register("chaosbag/ChaosBagApi", function(require, _LOADED, __bundle_register, __bundle_modules)
|
|
||||||
do
|
|
||||||
local ChaosBagApi = {}
|
|
||||||
|
|
||||||
-- respawns the chaos bag with a new state of tokens
|
|
||||||
---@param tokenList Table List of chaos token ids
|
|
||||||
ChaosBagApi.setChaosBagState = function(tokenList)
|
|
||||||
return Global.call("setChaosBagState", tokenList)
|
|
||||||
end
|
|
||||||
|
|
||||||
-- returns a Table List of chaos token ids in the current chaos bag
|
|
||||||
-- requires copying the data into a new table because TTS is weird about handling table return values in Global
|
|
||||||
ChaosBagApi.getChaosBagState = function()
|
|
||||||
local chaosBagContentsCatcher = Global.call("getChaosBagState")
|
|
||||||
local chaosBagContents = {}
|
|
||||||
for _, v in ipairs(chaosBagContentsCatcher) do
|
|
||||||
table.insert(chaosBagContents, v)
|
|
||||||
end
|
|
||||||
return chaosBagContents
|
|
||||||
end
|
|
||||||
|
|
||||||
-- checks scripting zone for chaos bag (also called by a lot of objects!)
|
|
||||||
ChaosBagApi.findChaosBag = function()
|
|
||||||
return Global.call("findChaosBag")
|
|
||||||
end
|
|
||||||
|
|
||||||
-- returns a table of object references to the tokens in play (does not include sealed tokens!)
|
|
||||||
ChaosBagApi.getTokensInPlay = function()
|
|
||||||
return Global.getTable("chaosTokens")
|
|
||||||
end
|
|
||||||
|
|
||||||
-- returns all sealed tokens on cards to the chaos bag
|
|
||||||
ChaosBagApi.releaseAllSealedTokens = function(playerColor)
|
|
||||||
return Global.call("releaseAllSealedTokens", playerColor)
|
|
||||||
end
|
|
||||||
|
|
||||||
-- returns all drawn tokens to the chaos bag
|
|
||||||
ChaosBagApi.returnChaosTokens = function(playerColor)
|
|
||||||
return Global.call("returnChaosTokens", playerColor)
|
|
||||||
end
|
|
||||||
|
|
||||||
-- removes the specified chaos token from the chaos bag
|
|
||||||
---@param id String ID of the chaos token
|
|
||||||
ChaosBagApi.removeChaosToken = function(id)
|
|
||||||
return Global.call("removeChaosToken", id)
|
|
||||||
end
|
|
||||||
|
|
||||||
-- spawns the specified chaos token and puts it into the chaos bag
|
|
||||||
---@param id String ID of the chaos token
|
|
||||||
ChaosBagApi.spawnChaosToken = function(id)
|
|
||||||
return Global.call("spawnChaosToken", id)
|
|
||||||
end
|
|
||||||
|
|
||||||
-- Checks to see if the chaos bag can be manipulated. If a player is searching the bag when tokens
|
|
||||||
-- are drawn or replaced a TTS bug can cause those tokens to vanish. Any functions which change the
|
|
||||||
-- contents of the bag should check this method before doing so.
|
|
||||||
-- This method will broadcast a message to all players if the bag is being searched.
|
|
||||||
---@return Boolean. True if the bag is manipulated, false if it should be blocked.
|
|
||||||
ChaosBagApi.canTouchChaosTokens = function()
|
|
||||||
return Global.call("canTouchChaosTokens")
|
|
||||||
end
|
|
||||||
|
|
||||||
-- called by playermats (by the "Draw chaos token" button)
|
|
||||||
ChaosBagApi.drawChaosToken = function(mat, tokenOffset, isRightClick)
|
|
||||||
return Global.call("drawChaosToken", {mat, tokenOffset, isRightClick})
|
|
||||||
end
|
|
||||||
|
|
||||||
-- returns a Table List of chaos token ids in the current chaos bag
|
|
||||||
-- requires copying the data into a new table because TTS is weird about handling table return values in Global
|
|
||||||
ChaosBagApi.getIdUrlMap = function()
|
|
||||||
return Global.getTable("ID_URL_MAP")
|
|
||||||
end
|
|
||||||
|
|
||||||
return ChaosBagApi
|
|
||||||
end
|
|
||||||
end)
|
|
||||||
return __bundle_require("__root")
|
return __bundle_require("__root")
|
@ -19,9 +19,10 @@ CustomDeck:
|
|||||||
UniqueBack: false
|
UniqueBack: false
|
||||||
Description: Signature
|
Description: Signature
|
||||||
DragSelectable: true
|
DragSelectable: true
|
||||||
GMNotes: "{\r\n \"id\": \"01011\",\r\n \"alternate_ids\": [\r\n \"01511\"\r\n
|
GMNotes: "{\n \"id\": \"01011\",\n \"alternate_ids\": [\n \"01511\"\n ],\n \"type\":
|
||||||
\ ],\r\n \"type\": \"Treachery\",\r\n \"class\": \"Neutral\",\r\n \"traits\":
|
\"Treachery\",\n \"class\": \"Neutral\",\n \"traits\": \"Task.\",\n \"weakness\":
|
||||||
\"Task.\",\r\n \"weakness\": true,\r\n \"cycle\": \"Core\"\r\n}\r"
|
true,\n \"uses\": [\n {\n \"count\": 0,\n \"type\": \"Resource\",\n
|
||||||
|
\ \"token\": \"resource\"\n }\n ],\n \"cycle\": \"Core\"\n}"
|
||||||
GUID: 47d6c9
|
GUID: 47d6c9
|
||||||
Grid: true
|
Grid: true
|
||||||
GridProjection: false
|
GridProjection: false
|
||||||
|
@ -12,7 +12,7 @@ CustomDeck:
|
|||||||
'3':
|
'3':
|
||||||
BackIsHidden: true
|
BackIsHidden: true
|
||||||
BackURL: https://i.imgur.com/EcbhVuh.jpg/
|
BackURL: https://i.imgur.com/EcbhVuh.jpg/
|
||||||
FaceURL: http://cloud-3.steamusercontent.com/ugc/2021607899142908284/92DF67E4310BCDFAD6C4BB12D31155DBF6B07A25/
|
FaceURL: http://cloud-3.steamusercontent.com/ugc/2115061845812962486/A68B8BF7E4862F21369DAC4A37D813EC664EAC34/
|
||||||
NumHeight: 6
|
NumHeight: 6
|
||||||
NumWidth: 10
|
NumWidth: 10
|
||||||
Type: 0
|
Type: 0
|
||||||
|
@ -12,7 +12,7 @@ CustomDeck:
|
|||||||
'3':
|
'3':
|
||||||
BackIsHidden: true
|
BackIsHidden: true
|
||||||
BackURL: https://i.imgur.com/EcbhVuh.jpg/
|
BackURL: https://i.imgur.com/EcbhVuh.jpg/
|
||||||
FaceURL: http://cloud-3.steamusercontent.com/ugc/2021607899142908284/92DF67E4310BCDFAD6C4BB12D31155DBF6B07A25/
|
FaceURL: http://cloud-3.steamusercontent.com/ugc/2115061845812962486/A68B8BF7E4862F21369DAC4A37D813EC664EAC34/
|
||||||
NumHeight: 6
|
NumHeight: 6
|
||||||
NumWidth: 10
|
NumWidth: 10
|
||||||
Type: 0
|
Type: 0
|
||||||
|
@ -12,12 +12,12 @@ CustomDeck:
|
|||||||
'3':
|
'3':
|
||||||
BackIsHidden: true
|
BackIsHidden: true
|
||||||
BackURL: https://i.imgur.com/EcbhVuh.jpg/
|
BackURL: https://i.imgur.com/EcbhVuh.jpg/
|
||||||
FaceURL: http://cloud-3.steamusercontent.com/ugc/2021607899142908284/92DF67E4310BCDFAD6C4BB12D31155DBF6B07A25/
|
FaceURL: http://cloud-3.steamusercontent.com/ugc/2115061845812962486/A68B8BF7E4862F21369DAC4A37D813EC664EAC34/
|
||||||
NumHeight: 6
|
NumHeight: 6
|
||||||
NumWidth: 10
|
NumWidth: 10
|
||||||
Type: 0
|
Type: 0
|
||||||
UniqueBack: false
|
UniqueBack: false
|
||||||
Description: arctic Archaeologist
|
Description: Arctic Archaeologist
|
||||||
DragSelectable: true
|
DragSelectable: true
|
||||||
GMNotes: "{\n \"id\": \"08032-t\",\n \"type\": \"Asset\",\n \"class\": \"Seeker\",\n
|
GMNotes: "{\n \"id\": \"08032-t\",\n \"type\": \"Asset\",\n \"class\": \"Seeker\",\n
|
||||||
\ \"cost\": 4,\n \"level\": 0,\n \"traits\": \"Ally. Miskatonic. Wayfarer.\",\n
|
\ \"cost\": 4,\n \"level\": 0,\n \"traits\": \"Ally. Miskatonic. Wayfarer.\",\n
|
||||||
|
@ -12,7 +12,7 @@ CustomDeck:
|
|||||||
'3':
|
'3':
|
||||||
BackIsHidden: true
|
BackIsHidden: true
|
||||||
BackURL: https://i.imgur.com/EcbhVuh.jpg/
|
BackURL: https://i.imgur.com/EcbhVuh.jpg/
|
||||||
FaceURL: http://cloud-3.steamusercontent.com/ugc/2021607899142908284/92DF67E4310BCDFAD6C4BB12D31155DBF6B07A25/
|
FaceURL: http://cloud-3.steamusercontent.com/ugc/2115061845812962486/A68B8BF7E4862F21369DAC4A37D813EC664EAC34/
|
||||||
NumHeight: 6
|
NumHeight: 6
|
||||||
NumWidth: 10
|
NumWidth: 10
|
||||||
Type: 0
|
Type: 0
|
||||||
|
@ -0,0 +1,56 @@
|
|||||||
|
AltLookAngle:
|
||||||
|
x: 0
|
||||||
|
y: 0
|
||||||
|
z: 0
|
||||||
|
Autoraise: true
|
||||||
|
CardID: 846805
|
||||||
|
ColorDiffuse:
|
||||||
|
b: 0.71324
|
||||||
|
g: 0.71324
|
||||||
|
r: 0.71324
|
||||||
|
CustomDeck:
|
||||||
|
'8468':
|
||||||
|
BackIsHidden: false
|
||||||
|
BackURL: http://cloud-3.steamusercontent.com/ugc/2149964195987018702/54C63785F3AA474F635F58BC506C86A318432BD7/
|
||||||
|
FaceURL: http://cloud-3.steamusercontent.com/ugc/1656727981627737050/3CFF9E3825033909543AD1CF843361D9243538EE/
|
||||||
|
NumHeight: 2
|
||||||
|
NumWidth: 4
|
||||||
|
Type: 0
|
||||||
|
UniqueBack: true
|
||||||
|
Description: The Musician
|
||||||
|
DragSelectable: true
|
||||||
|
GMNotes: "{\n \"id\": \"02004-pb\",\n \"type\": \"Investigator\",\n \"class\":
|
||||||
|
\"Mystic\",\n \"traits\": \"Performer.\",\n \"willpowerIcons\": 4,\n \"intellectIcons\":
|
||||||
|
3,\n \"combatIcons\": 3,\n \"agilityIcons\": 2,\n \"cycle\": \"The Dunwich Legacy\"\n}"
|
||||||
|
GUID: aba863
|
||||||
|
Grid: true
|
||||||
|
GridProjection: false
|
||||||
|
Hands: true
|
||||||
|
HideWhenFaceDown: false
|
||||||
|
IgnoreFoW: false
|
||||||
|
LayoutGroupSortIndex: 0
|
||||||
|
Locked: false
|
||||||
|
LuaScript: ''
|
||||||
|
LuaScriptState: ''
|
||||||
|
MeasureMovement: false
|
||||||
|
Name: Card
|
||||||
|
Nickname: Jim Culver (Parallel Back)
|
||||||
|
SidewaysCard: true
|
||||||
|
Snap: true
|
||||||
|
Sticky: true
|
||||||
|
Tags:
|
||||||
|
- Investigator
|
||||||
|
- PlayerCard
|
||||||
|
Tooltip: true
|
||||||
|
Transform:
|
||||||
|
posX: 82.21
|
||||||
|
posY: 3.19
|
||||||
|
posZ: 18.46
|
||||||
|
rotX: 0
|
||||||
|
rotY: 180
|
||||||
|
rotZ: 0
|
||||||
|
scaleX: 1.15
|
||||||
|
scaleY: 1
|
||||||
|
scaleZ: 1.15
|
||||||
|
Value: 0
|
||||||
|
XmlUI: ''
|
@ -0,0 +1,56 @@
|
|||||||
|
AltLookAngle:
|
||||||
|
x: 0
|
||||||
|
y: 0
|
||||||
|
z: 0
|
||||||
|
Autoraise: true
|
||||||
|
CardID: 846905
|
||||||
|
ColorDiffuse:
|
||||||
|
b: 0.71324
|
||||||
|
g: 0.71324
|
||||||
|
r: 0.71324
|
||||||
|
CustomDeck:
|
||||||
|
'8469':
|
||||||
|
BackIsHidden: false
|
||||||
|
BackURL: http://cloud-3.steamusercontent.com/ugc/1656727981627737648/F371339538812F68E38AAC0D520C525250DAC5C0/
|
||||||
|
FaceURL: http://cloud-3.steamusercontent.com/ugc/2149964195987018793/0AED4BF62C4FF3206778AD36FDB9C8E482CD3F9E/
|
||||||
|
NumHeight: 2
|
||||||
|
NumWidth: 4
|
||||||
|
Type: 0
|
||||||
|
UniqueBack: true
|
||||||
|
Description: The Musician
|
||||||
|
DragSelectable: true
|
||||||
|
GMNotes: "{\n \"id\": \"02004-pf\",\n \"type\": \"Investigator\",\n \"class\":
|
||||||
|
\"Mystic\",\n \"traits\": \"Performer. Cursed.\",\n \"willpowerIcons\": 4,\n \"intellectIcons\":
|
||||||
|
3,\n \"combatIcons\": 3,\n \"agilityIcons\": 2,\n \"cycle\": \"The Dunwich Legacy\"\n}"
|
||||||
|
GUID: c5fc80
|
||||||
|
Grid: true
|
||||||
|
GridProjection: false
|
||||||
|
Hands: true
|
||||||
|
HideWhenFaceDown: false
|
||||||
|
IgnoreFoW: false
|
||||||
|
LayoutGroupSortIndex: 0
|
||||||
|
Locked: false
|
||||||
|
LuaScript: ''
|
||||||
|
LuaScriptState: ''
|
||||||
|
MeasureMovement: false
|
||||||
|
Name: Card
|
||||||
|
Nickname: Jim Culver (Parallel Front)
|
||||||
|
SidewaysCard: true
|
||||||
|
Snap: true
|
||||||
|
Sticky: true
|
||||||
|
Tags:
|
||||||
|
- Investigator
|
||||||
|
- PlayerCard
|
||||||
|
Tooltip: true
|
||||||
|
Transform:
|
||||||
|
posX: 82.09
|
||||||
|
posY: 3.19
|
||||||
|
posZ: 22.48
|
||||||
|
rotX: 0
|
||||||
|
rotY: 180
|
||||||
|
rotZ: 0
|
||||||
|
scaleX: 1.15
|
||||||
|
scaleY: 1
|
||||||
|
scaleZ: 1.15
|
||||||
|
Value: 0
|
||||||
|
XmlUI: ''
|
@ -0,0 +1,56 @@
|
|||||||
|
AltLookAngle:
|
||||||
|
x: 0
|
||||||
|
y: 0
|
||||||
|
z: 0
|
||||||
|
Autoraise: true
|
||||||
|
CardID: 846700
|
||||||
|
ColorDiffuse:
|
||||||
|
b: 0.71324
|
||||||
|
g: 0.71324
|
||||||
|
r: 0.71324
|
||||||
|
CustomDeck:
|
||||||
|
'8467':
|
||||||
|
BackIsHidden: false
|
||||||
|
BackURL: http://cloud-3.steamusercontent.com/ugc/2149964195987018702/54C63785F3AA474F635F58BC506C86A318432BD7/
|
||||||
|
FaceURL: http://cloud-3.steamusercontent.com/ugc/2149964195987018793/0AED4BF62C4FF3206778AD36FDB9C8E482CD3F9E/
|
||||||
|
NumHeight: 2
|
||||||
|
NumWidth: 4
|
||||||
|
Type: 0
|
||||||
|
UniqueBack: true
|
||||||
|
Description: The Musician
|
||||||
|
DragSelectable: true
|
||||||
|
GMNotes: "{\n \"id\": \"02004-p\",\n \"type\": \"Investigator\",\n \"class\": \"Mystic\",\n
|
||||||
|
\ \"traits\": \"Performer. Cursed.\",\n \"willpowerIcons\": 4,\n \"intellectIcons\":
|
||||||
|
3,\n \"combatIcons\": 3,\n \"agilityIcons\": 2,\n \"cycle\": \"The Dunwich Legacy\"\n}"
|
||||||
|
GUID: 72bf31
|
||||||
|
Grid: true
|
||||||
|
GridProjection: false
|
||||||
|
Hands: true
|
||||||
|
HideWhenFaceDown: false
|
||||||
|
IgnoreFoW: false
|
||||||
|
LayoutGroupSortIndex: 0
|
||||||
|
Locked: false
|
||||||
|
LuaScript: ''
|
||||||
|
LuaScriptState: ''
|
||||||
|
MeasureMovement: false
|
||||||
|
Name: Card
|
||||||
|
Nickname: Jim Culver (Parallel)
|
||||||
|
SidewaysCard: true
|
||||||
|
Snap: true
|
||||||
|
Sticky: true
|
||||||
|
Tags:
|
||||||
|
- Investigator
|
||||||
|
- PlayerCard
|
||||||
|
Tooltip: true
|
||||||
|
Transform:
|
||||||
|
posX: 82.18
|
||||||
|
posY: 3.19
|
||||||
|
posZ: 26.39
|
||||||
|
rotX: 0
|
||||||
|
rotY: 180
|
||||||
|
rotZ: 0
|
||||||
|
scaleX: 1.15
|
||||||
|
scaleY: 1
|
||||||
|
scaleZ: 1.15
|
||||||
|
Value: 0
|
||||||
|
XmlUI: ''
|
@ -17,7 +17,7 @@ CustomDeck:
|
|||||||
NumWidth: 10
|
NumWidth: 10
|
||||||
Type: 0
|
Type: 0
|
||||||
UniqueBack: false
|
UniqueBack: false
|
||||||
Description: ''
|
Description: The Dead Listen
|
||||||
DragSelectable: true
|
DragSelectable: true
|
||||||
GMNotes: "{\r\n \"id\": \"02012\",\r\n \"type\": \"Asset\",\r\n \"class\": \"Neutral\",\r\n
|
GMNotes: "{\r\n \"id\": \"02012\",\r\n \"type\": \"Asset\",\r\n \"class\": \"Neutral\",\r\n
|
||||||
\ \"cost\": 2,\r\n \"traits\": \"Item. Instrument. Relic.\",\r\n \"willpowerIcons\":
|
\ \"cost\": 2,\r\n \"traits\": \"Item. Instrument. Relic.\",\r\n \"willpowerIcons\":
|
||||||
|
@ -0,0 +1,56 @@
|
|||||||
|
AltLookAngle:
|
||||||
|
x: 0
|
||||||
|
y: 0
|
||||||
|
z: 0
|
||||||
|
Autoraise: true
|
||||||
|
CardID: 847000
|
||||||
|
ColorDiffuse:
|
||||||
|
b: 0.71324
|
||||||
|
g: 0.71324
|
||||||
|
r: 0.71324
|
||||||
|
CustomDeck:
|
||||||
|
'8470':
|
||||||
|
BackIsHidden: false
|
||||||
|
BackURL: https://i.imgur.com/EcbhVuh.jpg/
|
||||||
|
FaceURL: http://cloud-3.steamusercontent.com/ugc/2149964195986880793/517FBB4FF8F72900B9E123DB865BCAD625F6506C/
|
||||||
|
NumHeight: 2
|
||||||
|
NumWidth: 2
|
||||||
|
Type: 0
|
||||||
|
UniqueBack: false
|
||||||
|
Description: The Dead Speak (Advanced)
|
||||||
|
DragSelectable: true
|
||||||
|
GMNotes: "{\n \"id\": \"90050\",\n \"type\": \"Asset\",\n \"class\": \"Neutral\",\n
|
||||||
|
\ \"cost\": 2,\n \"traits\": \"Item. Instrument. Relic.\",\n \"willpowerIcons\":
|
||||||
|
2,\n \"wildIcons\": 2,\n \"cycle\": \"The Dunwich Legacy\"\n}"
|
||||||
|
GUID: 7dfd5f
|
||||||
|
Grid: true
|
||||||
|
GridProjection: false
|
||||||
|
Hands: true
|
||||||
|
HideWhenFaceDown: true
|
||||||
|
IgnoreFoW: false
|
||||||
|
LayoutGroupSortIndex: 0
|
||||||
|
Locked: false
|
||||||
|
LuaScript: ''
|
||||||
|
LuaScriptState: ''
|
||||||
|
MeasureMovement: false
|
||||||
|
Name: Card
|
||||||
|
Nickname: Jim's Trumpet
|
||||||
|
SidewaysCard: false
|
||||||
|
Snap: true
|
||||||
|
Sticky: true
|
||||||
|
Tags:
|
||||||
|
- Asset
|
||||||
|
- PlayerCard
|
||||||
|
Tooltip: true
|
||||||
|
Transform:
|
||||||
|
posX: 78.51
|
||||||
|
posY: 3.23
|
||||||
|
posZ: 27.01
|
||||||
|
rotX: 359
|
||||||
|
rotY: 270
|
||||||
|
rotZ: 0
|
||||||
|
scaleX: 1
|
||||||
|
scaleY: 1
|
||||||
|
scaleZ: 1
|
||||||
|
Value: 0
|
||||||
|
XmlUI: ''
|
@ -12,7 +12,7 @@ CustomDeck:
|
|||||||
'3':
|
'3':
|
||||||
BackIsHidden: true
|
BackIsHidden: true
|
||||||
BackURL: https://i.imgur.com/EcbhVuh.jpg/
|
BackURL: https://i.imgur.com/EcbhVuh.jpg/
|
||||||
FaceURL: http://cloud-3.steamusercontent.com/ugc/2021607899142908284/92DF67E4310BCDFAD6C4BB12D31155DBF6B07A25/
|
FaceURL: http://cloud-3.steamusercontent.com/ugc/2115061845812962486/A68B8BF7E4862F21369DAC4A37D813EC664EAC34/
|
||||||
NumHeight: 6
|
NumHeight: 6
|
||||||
NumWidth: 10
|
NumWidth: 10
|
||||||
Type: 0
|
Type: 0
|
||||||
|
@ -12,7 +12,7 @@ CustomDeck:
|
|||||||
'3':
|
'3':
|
||||||
BackIsHidden: true
|
BackIsHidden: true
|
||||||
BackURL: https://i.imgur.com/EcbhVuh.jpg/
|
BackURL: https://i.imgur.com/EcbhVuh.jpg/
|
||||||
FaceURL: http://cloud-3.steamusercontent.com/ugc/2021607899142908284/92DF67E4310BCDFAD6C4BB12D31155DBF6B07A25/
|
FaceURL: http://cloud-3.steamusercontent.com/ugc/2115061845812962486/A68B8BF7E4862F21369DAC4A37D813EC664EAC34/
|
||||||
NumHeight: 6
|
NumHeight: 6
|
||||||
NumWidth: 10
|
NumWidth: 10
|
||||||
Type: 0
|
Type: 0
|
||||||
|
@ -12,7 +12,7 @@ CustomDeck:
|
|||||||
'3':
|
'3':
|
||||||
BackIsHidden: true
|
BackIsHidden: true
|
||||||
BackURL: https://i.imgur.com/EcbhVuh.jpg/
|
BackURL: https://i.imgur.com/EcbhVuh.jpg/
|
||||||
FaceURL: http://cloud-3.steamusercontent.com/ugc/2021607899142908284/92DF67E4310BCDFAD6C4BB12D31155DBF6B07A25/
|
FaceURL: http://cloud-3.steamusercontent.com/ugc/2115061845812962486/A68B8BF7E4862F21369DAC4A37D813EC664EAC34/
|
||||||
NumHeight: 6
|
NumHeight: 6
|
||||||
NumWidth: 10
|
NumWidth: 10
|
||||||
Type: 0
|
Type: 0
|
||||||
|
@ -41,6 +41,9 @@ local __bundle_require, __bundle_loaded, __bundle_register, __bundle_modules = (
|
|||||||
|
|
||||||
return require, loaded, register, modules
|
return require, loaded, register, modules
|
||||||
end)(nil)
|
end)(nil)
|
||||||
|
__bundle_register("__root", function(require, _LOADED, __bundle_register, __bundle_modules)
|
||||||
|
require("playercards/cards/Nephthys4")
|
||||||
|
end)
|
||||||
__bundle_register("playercards/cards/Nephthys4", function(require, _LOADED, __bundle_register, __bundle_modules)
|
__bundle_register("playercards/cards/Nephthys4", function(require, _LOADED, __bundle_register, __bundle_modules)
|
||||||
VALID_TOKENS = {
|
VALID_TOKENS = {
|
||||||
["Bless"] = true
|
["Bless"] = true
|
||||||
@ -281,12 +284,13 @@ end)
|
|||||||
__bundle_register("accessories/TokenArrangerApi", function(require, _LOADED, __bundle_register, __bundle_modules)
|
__bundle_register("accessories/TokenArrangerApi", function(require, _LOADED, __bundle_register, __bundle_modules)
|
||||||
do
|
do
|
||||||
local TokenArrangerApi = {}
|
local TokenArrangerApi = {}
|
||||||
|
local guidReferenceApi = require("core/GUIDReferenceApi")
|
||||||
|
|
||||||
-- local function to call the token arranger, if it is on the table
|
-- local function to call the token arranger, if it is on the table
|
||||||
---@param functionName String Name of the function to cal
|
---@param functionName String Name of the function to cal
|
||||||
---@param argument Variant Parameter to pass
|
---@param argument Variant Parameter to pass
|
||||||
local function callIfExistent(functionName, argument)
|
local function callIfExistent(functionName, argument)
|
||||||
local tokenArranger = getObjectsWithTag("TokenArranger")[1]
|
local tokenArranger = guidReferenceApi.getObjectByOwnerAndType("Mythos", "TokenArranger")
|
||||||
if tokenArranger ~= nil then
|
if tokenArranger ~= nil then
|
||||||
tokenArranger.call(functionName, argument)
|
tokenArranger.call(functionName, argument)
|
||||||
end
|
end
|
||||||
@ -314,11 +318,15 @@ end)
|
|||||||
__bundle_register("chaosbag/BlessCurseManagerApi", function(require, _LOADED, __bundle_register, __bundle_modules)
|
__bundle_register("chaosbag/BlessCurseManagerApi", function(require, _LOADED, __bundle_register, __bundle_modules)
|
||||||
do
|
do
|
||||||
local BlessCurseManagerApi = {}
|
local BlessCurseManagerApi = {}
|
||||||
local MANAGER_GUID = "5933fb"
|
local guidReferenceApi = require("core/GUIDReferenceApi")
|
||||||
|
|
||||||
|
local function getManager()
|
||||||
|
return guidReferenceApi.getObjectByOwnerAndType("Mythos", "BlessCurseManager")
|
||||||
|
end
|
||||||
|
|
||||||
-- removes all taken tokens and resets the counts
|
-- removes all taken tokens and resets the counts
|
||||||
BlessCurseManagerApi.removeTakenTokensAndReset = function()
|
BlessCurseManagerApi.removeTakenTokensAndReset = function()
|
||||||
local BlessCurseManager = getObjectFromGUID(MANAGER_GUID)
|
local BlessCurseManager = getManager()
|
||||||
Wait.time(function() BlessCurseManager.call("removeTakenTokens", "Bless") end, 0.05)
|
Wait.time(function() BlessCurseManager.call("removeTakenTokens", "Bless") end, 0.05)
|
||||||
Wait.time(function() BlessCurseManager.call("removeTakenTokens", "Curse") end, 0.10)
|
Wait.time(function() BlessCurseManager.call("removeTakenTokens", "Curse") end, 0.10)
|
||||||
Wait.time(function() BlessCurseManager.call("doReset", "White") end, 0.15)
|
Wait.time(function() BlessCurseManager.call("doReset", "White") end, 0.15)
|
||||||
@ -326,30 +334,30 @@ do
|
|||||||
|
|
||||||
-- updates the internal count (called by cards that seal bless/curse tokens)
|
-- updates the internal count (called by cards that seal bless/curse tokens)
|
||||||
BlessCurseManagerApi.sealedToken = function(type, guid)
|
BlessCurseManagerApi.sealedToken = function(type, guid)
|
||||||
getObjectFromGUID(MANAGER_GUID).call("sealedToken", { type = type, guid = guid })
|
getManager().call("sealedToken", { type = type, guid = guid })
|
||||||
end
|
end
|
||||||
|
|
||||||
-- updates the internal count (called by cards that seal bless/curse tokens)
|
-- updates the internal count (called by cards that seal bless/curse tokens)
|
||||||
BlessCurseManagerApi.releasedToken = function(type, guid)
|
BlessCurseManagerApi.releasedToken = function(type, guid)
|
||||||
getObjectFromGUID(MANAGER_GUID).call("releasedToken", { type = type, guid = guid })
|
getManager().call("releasedToken", { type = type, guid = guid })
|
||||||
end
|
end
|
||||||
|
|
||||||
-- broadcasts the current status for bless/curse tokens
|
-- broadcasts the current status for bless/curse tokens
|
||||||
---@param playerColor String Color of the player to show the broadcast to
|
---@param playerColor String Color of the player to show the broadcast to
|
||||||
BlessCurseManagerApi.broadcastStatus = function(playerColor)
|
BlessCurseManagerApi.broadcastStatus = function(playerColor)
|
||||||
getObjectFromGUID(MANAGER_GUID).call("broadcastStatus", playerColor)
|
getManager().call("broadcastStatus", playerColor)
|
||||||
end
|
end
|
||||||
|
|
||||||
-- removes all bless / curse tokens from the chaos bag and play
|
-- removes all bless / curse tokens from the chaos bag and play
|
||||||
---@param playerColor String Color of the player to show the broadcast to
|
---@param playerColor String Color of the player to show the broadcast to
|
||||||
BlessCurseManagerApi.removeAll = function(playerColor)
|
BlessCurseManagerApi.removeAll = function(playerColor)
|
||||||
getObjectFromGUID(MANAGER_GUID).call("doRemove", playerColor)
|
getManager().call("doRemove", playerColor)
|
||||||
end
|
end
|
||||||
|
|
||||||
-- adds Wendy's menu to the hovered card (allows sealing of tokens)
|
-- adds Wendy's menu to the hovered card (allows sealing of tokens)
|
||||||
---@param color String Color of the player to show the broadcast to
|
---@param color String Color of the player to show the broadcast to
|
||||||
BlessCurseManagerApi.addWendysMenu = function(playerColor, hoveredObject)
|
BlessCurseManagerApi.addWendysMenu = function(playerColor, hoveredObject)
|
||||||
getObjectFromGUID(MANAGER_GUID).call("addMenuOptions", { playerColor = playerColor, hoveredObject = hoveredObject })
|
getManager().call("addMenuOptions", { playerColor = playerColor, hoveredObject = hoveredObject })
|
||||||
end
|
end
|
||||||
|
|
||||||
return BlessCurseManagerApi
|
return BlessCurseManagerApi
|
||||||
@ -431,7 +439,34 @@ do
|
|||||||
return ChaosBagApi
|
return ChaosBagApi
|
||||||
end
|
end
|
||||||
end)
|
end)
|
||||||
__bundle_register("__root", function(require, _LOADED, __bundle_register, __bundle_modules)
|
__bundle_register("core/GUIDReferenceApi", function(require, _LOADED, __bundle_register, __bundle_modules)
|
||||||
require("playercards/cards/Nephthys4")
|
do
|
||||||
|
local GUIDReferenceApi = {}
|
||||||
|
|
||||||
|
local function getGuidHandler()
|
||||||
|
return getObjectFromGUID("123456")
|
||||||
|
end
|
||||||
|
|
||||||
|
-- returns all matching objects as a table with references
|
||||||
|
---@param owner String Parent object for this search
|
||||||
|
---@param type String Type of object to search for
|
||||||
|
GUIDReferenceApi.getObjectByOwnerAndType = function(owner, type)
|
||||||
|
return getGuidHandler().call("getObjectByOwnerAndType", { owner = owner, type = type })
|
||||||
|
end
|
||||||
|
|
||||||
|
-- returns all matching objects as a table with references
|
||||||
|
---@param type String Type of object to search for
|
||||||
|
GUIDReferenceApi.getObjectsByType = function(type)
|
||||||
|
return getGuidHandler().call("getObjectsByType", type)
|
||||||
|
end
|
||||||
|
|
||||||
|
-- returns all matching objects as a table with references
|
||||||
|
---@param owner String Parent object for this search
|
||||||
|
GUIDReferenceApi.getObjectsByOwner = function(owner)
|
||||||
|
return getGuidHandler().call("getObjectsByOwner", owner)
|
||||||
|
end
|
||||||
|
|
||||||
|
return GUIDReferenceApi
|
||||||
|
end
|
||||||
end)
|
end)
|
||||||
return __bundle_require("__root")
|
return __bundle_require("__root")
|
@ -0,0 +1,56 @@
|
|||||||
|
AltLookAngle:
|
||||||
|
x: 0
|
||||||
|
y: 0
|
||||||
|
z: 0
|
||||||
|
Autoraise: true
|
||||||
|
CardID: 91200
|
||||||
|
ColorDiffuse:
|
||||||
|
b: 0.71324
|
||||||
|
g: 0.71324
|
||||||
|
r: 0.71324
|
||||||
|
CustomDeck:
|
||||||
|
'912':
|
||||||
|
BackIsHidden: true
|
||||||
|
BackURL: https://i.imgur.com/EcbhVuh.jpg/
|
||||||
|
FaceURL: http://cloud-3.steamusercontent.com/ugc/2195002645140651764/97A66D51D85628992E10826FF866E96E310FB177/
|
||||||
|
NumHeight: 1
|
||||||
|
NumWidth: 1
|
||||||
|
Type: 0
|
||||||
|
UniqueBack: false
|
||||||
|
Description: Tried Everything Once
|
||||||
|
DragSelectable: true
|
||||||
|
GMNotes: "{\n \"id\": \"10097\",\n \"type\": \"Asset\",\n \"class\": \"Mystic\",\n
|
||||||
|
\ \"cost\": 2,\n \"level\": 2,\n \"traits\": \"Ally. Witch.\",\n \"willpowerIcons\":
|
||||||
|
2,\n \"cycle\": \"The Feast of Hemlock Vale\"\n}"
|
||||||
|
GUID: 9683d2
|
||||||
|
Grid: true
|
||||||
|
GridProjection: false
|
||||||
|
Hands: true
|
||||||
|
HideWhenFaceDown: true
|
||||||
|
IgnoreFoW: false
|
||||||
|
LayoutGroupSortIndex: 0
|
||||||
|
Locked: false
|
||||||
|
LuaScript: ''
|
||||||
|
LuaScriptState: ''
|
||||||
|
MeasureMovement: false
|
||||||
|
Name: Card
|
||||||
|
Nickname: Olive McBride
|
||||||
|
SidewaysCard: false
|
||||||
|
Snap: true
|
||||||
|
Sticky: true
|
||||||
|
Tags:
|
||||||
|
- Asset
|
||||||
|
- PlayerCard
|
||||||
|
Tooltip: true
|
||||||
|
Transform:
|
||||||
|
posX: 9.13
|
||||||
|
posY: 3.79
|
||||||
|
posZ: -16.72
|
||||||
|
rotX: 0
|
||||||
|
rotY: 270
|
||||||
|
rotZ: 0
|
||||||
|
scaleX: 1
|
||||||
|
scaleY: 1
|
||||||
|
scaleZ: 1
|
||||||
|
Value: 0
|
||||||
|
XmlUI: ''
|
@ -12,7 +12,7 @@ CustomDeck:
|
|||||||
'3':
|
'3':
|
||||||
BackIsHidden: true
|
BackIsHidden: true
|
||||||
BackURL: https://i.imgur.com/EcbhVuh.jpg/
|
BackURL: https://i.imgur.com/EcbhVuh.jpg/
|
||||||
FaceURL: http://cloud-3.steamusercontent.com/ugc/2021607899142908284/92DF67E4310BCDFAD6C4BB12D31155DBF6B07A25/
|
FaceURL: http://cloud-3.steamusercontent.com/ugc/2115061845812962486/A68B8BF7E4862F21369DAC4A37D813EC664EAC34/
|
||||||
NumHeight: 6
|
NumHeight: 6
|
||||||
NumWidth: 10
|
NumWidth: 10
|
||||||
Type: 0
|
Type: 0
|
||||||
|
@ -12,7 +12,7 @@ CustomDeck:
|
|||||||
'3':
|
'3':
|
||||||
BackIsHidden: true
|
BackIsHidden: true
|
||||||
BackURL: https://i.imgur.com/EcbhVuh.jpg/
|
BackURL: https://i.imgur.com/EcbhVuh.jpg/
|
||||||
FaceURL: http://cloud-3.steamusercontent.com/ugc/2021607899142908284/92DF67E4310BCDFAD6C4BB12D31155DBF6B07A25/
|
FaceURL: http://cloud-3.steamusercontent.com/ugc/2115061845812962486/A68B8BF7E4862F21369DAC4A37D813EC664EAC34/
|
||||||
NumHeight: 6
|
NumHeight: 6
|
||||||
NumWidth: 10
|
NumWidth: 10
|
||||||
Type: 0
|
Type: 0
|
||||||
|
@ -12,7 +12,7 @@ CustomDeck:
|
|||||||
'3':
|
'3':
|
||||||
BackIsHidden: true
|
BackIsHidden: true
|
||||||
BackURL: https://i.imgur.com/EcbhVuh.jpg/
|
BackURL: https://i.imgur.com/EcbhVuh.jpg/
|
||||||
FaceURL: http://cloud-3.steamusercontent.com/ugc/2021607899142908284/92DF67E4310BCDFAD6C4BB12D31155DBF6B07A25/
|
FaceURL: http://cloud-3.steamusercontent.com/ugc/2115061845812962486/A68B8BF7E4862F21369DAC4A37D813EC664EAC34/
|
||||||
NumHeight: 6
|
NumHeight: 6
|
||||||
NumWidth: 10
|
NumWidth: 10
|
||||||
Type: 0
|
Type: 0
|
||||||
|
@ -12,7 +12,7 @@ CustomDeck:
|
|||||||
'3':
|
'3':
|
||||||
BackIsHidden: true
|
BackIsHidden: true
|
||||||
BackURL: https://i.imgur.com/EcbhVuh.jpg/
|
BackURL: https://i.imgur.com/EcbhVuh.jpg/
|
||||||
FaceURL: http://cloud-3.steamusercontent.com/ugc/2021607899142908284/92DF67E4310BCDFAD6C4BB12D31155DBF6B07A25/
|
FaceURL: http://cloud-3.steamusercontent.com/ugc/2115061845812962486/A68B8BF7E4862F21369DAC4A37D813EC664EAC34/
|
||||||
NumHeight: 6
|
NumHeight: 6
|
||||||
NumWidth: 10
|
NumWidth: 10
|
||||||
Type: 0
|
Type: 0
|
||||||
|
@ -41,6 +41,72 @@ local __bundle_require, __bundle_loaded, __bundle_register, __bundle_modules = (
|
|||||||
|
|
||||||
return require, loaded, register, modules
|
return require, loaded, register, modules
|
||||||
end)(nil)
|
end)(nil)
|
||||||
|
__bundle_register("__root", function(require, _LOADED, __bundle_register, __bundle_modules)
|
||||||
|
require("playercards/customizable/PowerWordUpgradeSheetTaboo")
|
||||||
|
end)
|
||||||
|
__bundle_register("playercards/customizable/PowerWordUpgradeSheetTaboo", function(require, _LOADED, __bundle_register, __bundle_modules)
|
||||||
|
-- Customizable Cards: Power Word (Taboo)
|
||||||
|
|
||||||
|
-- Color information for buttons
|
||||||
|
boxSize = 38
|
||||||
|
|
||||||
|
-- static values
|
||||||
|
xInitial = -0.933
|
||||||
|
xOffset = 0.069
|
||||||
|
|
||||||
|
customizations = {
|
||||||
|
[1] = {
|
||||||
|
checkboxes = {
|
||||||
|
posZ = -0.905,
|
||||||
|
count = 1,
|
||||||
|
}
|
||||||
|
},
|
||||||
|
[2] = {
|
||||||
|
checkboxes = {
|
||||||
|
posZ = -0.6,
|
||||||
|
count = 1,
|
||||||
|
}
|
||||||
|
},
|
||||||
|
[3] = {
|
||||||
|
checkboxes = {
|
||||||
|
posZ = -0.42,
|
||||||
|
count = 1,
|
||||||
|
}
|
||||||
|
},
|
||||||
|
[4] = {
|
||||||
|
checkboxes = {
|
||||||
|
posZ = -0.12,
|
||||||
|
count = 1,
|
||||||
|
}
|
||||||
|
},
|
||||||
|
[5] = {
|
||||||
|
checkboxes = {
|
||||||
|
posZ = 0.18,
|
||||||
|
count = 2,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
[6] = {
|
||||||
|
checkboxes = {
|
||||||
|
posZ = 0.38,
|
||||||
|
count = 3,
|
||||||
|
}
|
||||||
|
},
|
||||||
|
[7] = {
|
||||||
|
checkboxes = {
|
||||||
|
posZ = 0.675,
|
||||||
|
count = 3,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
[8] = {
|
||||||
|
checkboxes = {
|
||||||
|
posZ = 0.875,
|
||||||
|
count = 3,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
}
|
||||||
|
|
||||||
|
require("playercards/customizable/UpgradeSheetLibrary")
|
||||||
|
end)
|
||||||
__bundle_register("playercards/customizable/UpgradeSheetLibrary", function(require, _LOADED, __bundle_register, __bundle_modules)
|
__bundle_register("playercards/customizable/UpgradeSheetLibrary", function(require, _LOADED, __bundle_register, __bundle_modules)
|
||||||
-- Common code for handling customizable card upgrade sheets
|
-- Common code for handling customizable card upgrade sheets
|
||||||
-- Define UI elements in the base card file, then include this
|
-- Define UI elements in the base card file, then include this
|
||||||
@ -492,294 +558,262 @@ end)
|
|||||||
__bundle_register("playermat/PlaymatApi", function(require, _LOADED, __bundle_register, __bundle_modules)
|
__bundle_register("playermat/PlaymatApi", function(require, _LOADED, __bundle_register, __bundle_modules)
|
||||||
do
|
do
|
||||||
local PlaymatApi = {}
|
local PlaymatApi = {}
|
||||||
local internal = { }
|
local guidReferenceApi = require("core/GUIDReferenceApi")
|
||||||
|
|
||||||
local MAT_IDS = {
|
-- Convenience function to look up a mat's object by color, or get all mats.
|
||||||
White = "8b081b",
|
---@param matColor String Color of the playmat - White, Orange, Green, Red or All
|
||||||
Orange = "bd0ff4",
|
---@return array Table Single-element if only single playmat is requested
|
||||||
Green = "383d8b",
|
local function getMatForColor(matColor)
|
||||||
Red = "0840d5"
|
if matColor == "All" then
|
||||||
}
|
return guidReferenceApi.getObjectsByType("Playermat")
|
||||||
|
else
|
||||||
|
return { matColor = guidReferenceApi.getObjectByOwnerAndType(matColor, "Playermat") }
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
local CLUE_COUNTER_GUIDS = {
|
-- Returns the color of the closest playmat
|
||||||
White = "37be78",
|
---@param startPos Table Starting position to get the closest mat from
|
||||||
Orange = "1769ed",
|
|
||||||
Green = "032300",
|
|
||||||
Red = "d86b7c"
|
|
||||||
}
|
|
||||||
|
|
||||||
local CLUE_CLICKER_GUIDS = {
|
|
||||||
White = "db85d6",
|
|
||||||
Orange = "3f22e5",
|
|
||||||
Green = "891403",
|
|
||||||
Red = "4111de"
|
|
||||||
}
|
|
||||||
|
|
||||||
-- Returns the color of the by position requested playermat as string
|
|
||||||
---@param startPos Table Position of the search, table get's roughly cut into 4 quarters to assign a playermat
|
|
||||||
PlaymatApi.getMatColorByPosition = function(startPos)
|
PlaymatApi.getMatColorByPosition = function(startPos)
|
||||||
if startPos.x < -42 then
|
local result, smallestDistance
|
||||||
if startPos.z > 0 then
|
for matColor, mat in pairs(getMatForColor("All")) do
|
||||||
return "White"
|
local distance = Vector.between(startPos, mat.getPosition()):magnitude()
|
||||||
else
|
if smallestDistance == nil or distance < smallestDistance then
|
||||||
return "Orange"
|
smallestDistance = distance
|
||||||
end
|
result = matColor
|
||||||
else
|
|
||||||
if startPos.z > 0 then
|
|
||||||
return "Green"
|
|
||||||
else
|
|
||||||
return "Red"
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
return result
|
||||||
end
|
end
|
||||||
|
|
||||||
-- Returns the color of the player's hand that is seated next to the playermat
|
-- Returns the color of the player's hand that is seated next to the playmat
|
||||||
---@param matColor String Color of the playermat
|
---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support "All")
|
||||||
PlaymatApi.getPlayerColor = function(matColor)
|
PlaymatApi.getPlayerColor = function(matColor)
|
||||||
local mat = getObjectFromGUID(MAT_IDS[matColor])
|
for _, mat in pairs(getMatForColor(matColor)) do
|
||||||
return mat.getVar("playerColor")
|
return mat.getVar("playerColor")
|
||||||
end
|
end
|
||||||
|
end
|
||||||
|
|
||||||
-- Returns the color of the playermat that owns the playercolor's hand
|
-- Returns the color of the playmat that owns the playercolor's hand
|
||||||
---@param handColor String Color of the playermat
|
---@param handColor String Color of the playmat
|
||||||
PlaymatApi.getMatColor = function(handColor)
|
PlaymatApi.getMatColor = function(handColor)
|
||||||
local matColors = {"White", "Orange", "Green", "Red"}
|
for matColor, mat in pairs(getMatForColor("All")) do
|
||||||
for i, mat in ipairs(internal.getMatForColor("All")) do
|
local playerColor = mat.getVar("playerColor")
|
||||||
local color = mat.getVar("playerColor")
|
if playerColor == handColor then
|
||||||
if color == handColor then return matColors[i] end
|
return matColor
|
||||||
|
end
|
||||||
end
|
end
|
||||||
return "NOT_FOUND"
|
|
||||||
end
|
end
|
||||||
|
|
||||||
-- Returns the result of a cast in the specificed playermat's area
|
-- Returns if there is the card "Dream-Enhancing Serum" on the requested playmat
|
||||||
---@param matColor String Color of the playermat
|
---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support "All")
|
||||||
PlaymatApi.searchPlaymat = function(matColor)
|
|
||||||
local mat = getObjectFromGUID(MAT_IDS[matColor])
|
|
||||||
return mat.call("searchAroundSelf")
|
|
||||||
end
|
|
||||||
|
|
||||||
-- Returns if there is the card "Dream-Enhancing Serum" on the requested playermat
|
|
||||||
---@param matColor String Color of the playermat
|
|
||||||
PlaymatApi.isDES = function(matColor)
|
PlaymatApi.isDES = function(matColor)
|
||||||
local mat = getObjectFromGUID(MAT_IDS[matColor])
|
for _, mat in pairs(getMatForColor(matColor)) do
|
||||||
return mat.getVar("isDES")
|
return mat.getVar("isDES")
|
||||||
end
|
end
|
||||||
|
end
|
||||||
|
|
||||||
-- Returns the draw deck of the requested playmat
|
-- Performs a search of the deck area of the requested playmat and returns the result as table
|
||||||
---@param matColor String Color of the playermat
|
---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support "All")
|
||||||
PlaymatApi.getDrawDeck = function(matColor)
|
PlaymatApi.getDeckAreaObjects = function(matColor)
|
||||||
local mat = getObjectFromGUID(MAT_IDS[matColor])
|
for _, mat in pairs(getMatForColor(matColor)) do
|
||||||
mat.call("getDrawDiscardDecks")
|
return mat.call("getDeckAreaObjects")
|
||||||
return mat.getVar("drawDeck")
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
-- Flips the top card of the deck (useful after deck manipulation for Norman Withers)
|
||||||
|
---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support "All")
|
||||||
|
PlaymatApi.flipTopCardFromDeck = function(matColor)
|
||||||
|
for _, mat in pairs(getMatForColor(matColor)) do
|
||||||
|
return mat.call("flipTopCardFromDeck")
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
-- Returns the position of the discard pile of the requested playmat
|
-- Returns the position of the discard pile of the requested playmat
|
||||||
---@param matColor String Color of the playermat
|
---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support "All")
|
||||||
PlaymatApi.getDiscardPosition = function(matColor)
|
PlaymatApi.getDiscardPosition = function(matColor)
|
||||||
local mat = getObjectFromGUID(MAT_IDS[matColor])
|
for _, mat in pairs(getMatForColor(matColor)) do
|
||||||
return mat.call("returnGlobalDiscardPosition")
|
return mat.call("returnGlobalDiscardPosition")
|
||||||
end
|
end
|
||||||
|
end
|
||||||
|
|
||||||
-- Transforms a local position into a global position
|
-- Transforms a local position into a global position
|
||||||
---@param localPos Table Local position to be transformed
|
---@param localPos Table Local position to be transformed
|
||||||
---@param matColor String Color of the playermat
|
---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support "All")
|
||||||
PlaymatApi.transformLocalPosition = function(localPos, matColor)
|
PlaymatApi.transformLocalPosition = function(localPos, matColor)
|
||||||
local mat = getObjectFromGUID(MAT_IDS[matColor])
|
for _, mat in pairs(getMatForColor(matColor)) do
|
||||||
return mat.positionToWorld(localPos)
|
return mat.positionToWorld(localPos)
|
||||||
end
|
end
|
||||||
|
end
|
||||||
|
|
||||||
-- Returns the rotation of the requested playmat
|
-- Returns the rotation of the requested playmat
|
||||||
---@param matColor String Color of the playermat
|
---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support "All")
|
||||||
PlaymatApi.returnRotation = function(matColor)
|
PlaymatApi.returnRotation = function(matColor)
|
||||||
local mat = getObjectFromGUID(MAT_IDS[matColor])
|
for _, mat in pairs(getMatForColor(matColor)) do
|
||||||
return mat.getRotation()
|
return mat.getRotation()
|
||||||
end
|
end
|
||||||
|
end
|
||||||
|
|
||||||
-- Triggers the Upkeep for the requested playmat
|
-- Triggers the Upkeep for the requested playmat
|
||||||
---@param matColor String Color of the playermat
|
---@param matColor String Color of the playmat - White, Orange, Green, Red or All
|
||||||
---@param playerColor String Color of the calling player (for messages)
|
---@param playerColor String Color of the calling player (for messages)
|
||||||
PlaymatApi.doUpkeepFromHotkey = function(matColor, playerColor)
|
PlaymatApi.doUpkeepFromHotkey = function(matColor, playerColor)
|
||||||
local mat = getObjectFromGUID(MAT_IDS[matColor])
|
for _, mat in pairs(getMatForColor(matColor)) do
|
||||||
return mat.call("doUpkeepFromHotkey", playerColor)
|
mat.call("doUpkeepFromHotkey", playerColor)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
-- Handles discarding for the requested playmat for the provided list of objects
|
||||||
|
---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support "All")
|
||||||
|
---@param objList Table List of objects to discard
|
||||||
|
PlaymatApi.discardListOfObjects = function(matColor, objList)
|
||||||
|
for _, mat in pairs(getMatForColor(matColor)) do
|
||||||
|
mat.call("discardListOfObjects", objList)
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
-- Returns the active investigator id
|
-- Returns the active investigator id
|
||||||
---@param matColor String Color of the playermat
|
---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support "All")
|
||||||
PlaymatApi.returnInvestigatorId = function(matColor)
|
PlaymatApi.returnInvestigatorId = function(matColor)
|
||||||
local mat = getObjectFromGUID(MAT_IDS[matColor])
|
for _, mat in pairs(getMatForColor(matColor)) do
|
||||||
return mat.getVar("activeInvestigatorId")
|
return mat.getVar("activeInvestigatorId")
|
||||||
end
|
end
|
||||||
|
end
|
||||||
|
|
||||||
-- Sets the requested playermat's snap points to limit snapping to matching card types or not. If
|
-- Sets the requested playmat's snap points to limit snapping to matching card types or not. If
|
||||||
-- matchTypes is true, the main card slot snap points will only snap assets, while the
|
-- matchTypes is true, the main card slot snap points will only snap assets, while the
|
||||||
-- investigator area point will only snap Investigators. If matchTypes is false, snap points will
|
-- investigator area point will only snap Investigators. If matchTypes is false, snap points will
|
||||||
-- be reset to snap all cards.
|
-- be reset to snap all cards.
|
||||||
---@param matchCardTypes Boolean. Whether snap points should only snap for the matching card
|
---@param matchCardTypes Boolean Whether snap points should only snap for the matching card types
|
||||||
-- types.
|
---@param matColor String Color of the playmat - White, Orange, Green, Red or All
|
||||||
---@param matColor String for one of the active player colors - White, Orange, Green, Red. Also
|
|
||||||
-- accepts "All" as a special value which will apply the setting to all four mats.
|
|
||||||
PlaymatApi.setLimitSnapsByType = function(matchCardTypes, matColor)
|
PlaymatApi.setLimitSnapsByType = function(matchCardTypes, matColor)
|
||||||
for _, mat in ipairs(internal.getMatForColor(matColor)) do
|
for _, mat in pairs(getMatForColor(matColor)) do
|
||||||
mat.call("setLimitSnapsByType", matchCardTypes)
|
mat.call("setLimitSnapsByType", matchCardTypes)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
-- Sets the requested playermat's draw 1 button to visible
|
-- Sets the requested playmat's draw 1 button to visible
|
||||||
---@param isDrawButtonVisible Boolean. Whether the draw 1 button should be visible or not
|
---@param isDrawButtonVisible Boolean Whether the draw 1 button should be visible or not
|
||||||
---@param matColor String for one of the active player colors - White, Orange, Green, Red. Also
|
---@param matColor String Color of the playmat - White, Orange, Green, Red or All
|
||||||
-- accepts "All" as a special value which will apply the setting to all four mats.
|
|
||||||
PlaymatApi.showDrawButton = function(isDrawButtonVisible, matColor)
|
PlaymatApi.showDrawButton = function(isDrawButtonVisible, matColor)
|
||||||
for _, mat in ipairs(internal.getMatForColor(matColor)) do
|
for _, mat in pairs(getMatForColor(matColor)) do
|
||||||
mat.call("showDrawButton", isDrawButtonVisible)
|
mat.call("showDrawButton", isDrawButtonVisible)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
-- Shows or hides the clickable clue counter for the requested playermat
|
-- Shows or hides the clickable clue counter for the requested playmat
|
||||||
---@param showCounter Boolean. Whether the clickable counter should be present or not
|
---@param showCounter Boolean Whether the clickable counter should be present or not
|
||||||
---@param matColor String for one of the active player colors - White, Orange, Green, Red. Also
|
---@param matColor String Color of the playmat - White, Orange, Green, Red or All
|
||||||
-- accepts "All" as a special value which will apply the setting to all four mats.
|
|
||||||
PlaymatApi.clickableClues = function(showCounter, matColor)
|
PlaymatApi.clickableClues = function(showCounter, matColor)
|
||||||
for _, mat in ipairs(internal.getMatForColor(matColor)) do
|
for _, mat in pairs(getMatForColor(matColor)) do
|
||||||
mat.call("clickableClues", showCounter)
|
mat.call("clickableClues", showCounter)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
-- Removes all clues (to the trash for tokens and counters set to 0) for the requested playermat
|
-- Removes all clues (to the trash for tokens and counters set to 0) for the requested playmat
|
||||||
---@param matColor String for one of the active player colors - White, Orange, Green, Red. Also
|
---@param matColor String Color of the playmat - White, Orange, Green, Red or All
|
||||||
-- accepts "All" as a special value which will apply the setting to all four mats.
|
|
||||||
PlaymatApi.removeClues = function(matColor)
|
PlaymatApi.removeClues = function(matColor)
|
||||||
for _, mat in ipairs(internal.getMatForColor(matColor)) do
|
for _, mat in pairs(getMatForColor(matColor)) do
|
||||||
mat.call("removeClues")
|
mat.call("removeClues")
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
-- Reports the clue count for the requested playermat
|
-- Reports the clue count for the requested playmat
|
||||||
---@param useClickableCounters Boolean Controls which type of counter is getting checked
|
---@param useClickableCounters Boolean Controls which type of counter is getting checked
|
||||||
PlaymatApi.getClueCount = function(useClickableCounters, matColor)
|
PlaymatApi.getClueCount = function(useClickableCounters, matColor)
|
||||||
local count = 0
|
local count = 0
|
||||||
for _, mat in ipairs(internal.getMatForColor(matColor)) do
|
for _, mat in pairs(getMatForColor(matColor)) do
|
||||||
count = count + tonumber(mat.call("getClueCount", useClickableCounters))
|
count = count + mat.call("getClueCount", useClickableCounters)
|
||||||
end
|
end
|
||||||
return count
|
return count
|
||||||
end
|
end
|
||||||
|
|
||||||
-- Adds the specified amount of resources to the requested playermat's resource counter
|
-- updates the specified owned counter
|
||||||
PlaymatApi.gainResources = function(amount, matColor)
|
---@param matColor String Color of the playmat - White, Orange, Green, Red or All
|
||||||
for _, mat in ipairs(internal.getMatForColor(matColor)) do
|
---@param type String Counter to target
|
||||||
mat.call("gainResources", amount)
|
---@param newValue Number Value to set the counter to
|
||||||
|
---@param modifier Number If newValue is not provided, the existing value will be adjusted by this modifier
|
||||||
|
PlaymatApi.updateCounter = function(matColor, type, newValue, modifier)
|
||||||
|
for _, mat in pairs(getMatForColor(matColor)) do
|
||||||
|
mat.call("updateCounter", { type = type, newValue = newValue, modifier = modifier })
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
-- Returns the resource counter amount for the requested playermat
|
-- returns the resource counter amount
|
||||||
PlaymatApi.getResourceCount = function(matColor)
|
---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support "All")
|
||||||
local mat = getObjectFromGUID(MAT_IDS[matColor])
|
---@param type String Counter to target
|
||||||
return mat.call("getResourceCount")
|
PlaymatApi.getCounterValue = function(matColor, type)
|
||||||
|
for _, mat in pairs(getMatForColor(matColor)) do
|
||||||
|
return mat.call("getCounterValue", type)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
-- resets the specified skill tracker to "1, 1, 1, 1"
|
||||||
|
---@param matColor String Color of the playmat - White, Orange, Green, Red or All
|
||||||
|
PlaymatApi.resetSkillTracker = function(matColor)
|
||||||
|
for _, mat in pairs(getMatForColor(matColor)) do
|
||||||
|
mat.call("resetSkillTracker")
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
-- finds all objects on the playmat and associated set aside zone and returns a table
|
||||||
|
---@param matColor String Color of the playmat - White, Orange, Green, Red or All
|
||||||
|
---@param filter Function Optional filter function (return true for desired objects)
|
||||||
|
PlaymatApi.searchAroundPlaymat = function(matColor, filter)
|
||||||
|
local objList = {}
|
||||||
|
for _, mat in pairs(getMatForColor(matColor)) do
|
||||||
|
for _, obj in ipairs(mat.call("searchAroundSelf", filter)) do
|
||||||
|
table.insert(objList, obj)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
return objList
|
||||||
end
|
end
|
||||||
|
|
||||||
-- Discard a non-hidden card from the corresponding player's hand
|
-- Discard a non-hidden card from the corresponding player's hand
|
||||||
|
---@param matColor String Color of the playmat - White, Orange, Green, Red or All
|
||||||
PlaymatApi.doDiscardOne = function(matColor)
|
PlaymatApi.doDiscardOne = function(matColor)
|
||||||
for _, mat in ipairs(internal.getMatForColor(matColor)) do
|
for _, mat in pairs(getMatForColor(matColor)) do
|
||||||
mat.call("doDiscardOne")
|
mat.call("doDiscardOne")
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
-- Triggers the metadata sync for all playmats
|
||||||
PlaymatApi.syncAllCustomizableCards = function()
|
PlaymatApi.syncAllCustomizableCards = function()
|
||||||
for _, mat in ipairs(internal.getMatForColor("All")) do
|
for _, mat in pairs(getMatForColor("All")) do
|
||||||
mat.call("syncAllCustomizableCards")
|
mat.call("syncAllCustomizableCards")
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
PlaymatApi.updateClueClicker = function(playerColor, val)
|
|
||||||
return getObjectFromGUID(CLUE_CLICKER_GUIDS[playerColor]).call("updateVal", val)
|
|
||||||
end
|
|
||||||
|
|
||||||
-- Convenience function to look up a mat's object by color, or get all mats.
|
|
||||||
---@param matColor String for one of the active player colors - White, Orange, Green, Red. Also
|
|
||||||
-- accepts "All" as a special value which will return all four mats.
|
|
||||||
---@return: Array of playermat objects. If a single mat is requested, will return a single-element
|
|
||||||
-- array to simplify processing by consumers.
|
|
||||||
internal.getMatForColor = function(matColor)
|
|
||||||
local targetMatGuid = MAT_IDS[matColor]
|
|
||||||
if targetMatGuid != nil then
|
|
||||||
return { getObjectFromGUID(targetMatGuid) }
|
|
||||||
end
|
|
||||||
if matColor == "All" then
|
|
||||||
return {
|
|
||||||
getObjectFromGUID(MAT_IDS.White),
|
|
||||||
getObjectFromGUID(MAT_IDS.Orange),
|
|
||||||
getObjectFromGUID(MAT_IDS.Green),
|
|
||||||
getObjectFromGUID(MAT_IDS.Red),
|
|
||||||
}
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
return PlaymatApi
|
return PlaymatApi
|
||||||
end
|
end
|
||||||
end)
|
end)
|
||||||
__bundle_register("__root", function(require, _LOADED, __bundle_register, __bundle_modules)
|
__bundle_register("core/GUIDReferenceApi", function(require, _LOADED, __bundle_register, __bundle_modules)
|
||||||
require("playercards/customizable/PowerWordUpgradeSheetTaboo")
|
do
|
||||||
end)
|
local GUIDReferenceApi = {}
|
||||||
__bundle_register("playercards/customizable/PowerWordUpgradeSheetTaboo", function(require, _LOADED, __bundle_register, __bundle_modules)
|
|
||||||
-- Customizable Cards: Power Word (Taboo)
|
|
||||||
|
|
||||||
-- Color information for buttons
|
local function getGuidHandler()
|
||||||
boxSize = 38
|
return getObjectFromGUID("123456")
|
||||||
|
end
|
||||||
|
|
||||||
-- static values
|
-- returns all matching objects as a table with references
|
||||||
xInitial = -0.933
|
---@param owner String Parent object for this search
|
||||||
xOffset = 0.069
|
---@param type String Type of object to search for
|
||||||
|
GUIDReferenceApi.getObjectByOwnerAndType = function(owner, type)
|
||||||
|
return getGuidHandler().call("getObjectByOwnerAndType", { owner = owner, type = type })
|
||||||
|
end
|
||||||
|
|
||||||
customizations = {
|
-- returns all matching objects as a table with references
|
||||||
[1] = {
|
---@param type String Type of object to search for
|
||||||
checkboxes = {
|
GUIDReferenceApi.getObjectsByType = function(type)
|
||||||
posZ = -0.905,
|
return getGuidHandler().call("getObjectsByType", type)
|
||||||
count = 1,
|
end
|
||||||
}
|
|
||||||
},
|
|
||||||
[2] = {
|
|
||||||
checkboxes = {
|
|
||||||
posZ = -0.6,
|
|
||||||
count = 1,
|
|
||||||
}
|
|
||||||
},
|
|
||||||
[3] = {
|
|
||||||
checkboxes = {
|
|
||||||
posZ = -0.42,
|
|
||||||
count = 1,
|
|
||||||
}
|
|
||||||
},
|
|
||||||
[4] = {
|
|
||||||
checkboxes = {
|
|
||||||
posZ = -0.12,
|
|
||||||
count = 1,
|
|
||||||
}
|
|
||||||
},
|
|
||||||
[5] = {
|
|
||||||
checkboxes = {
|
|
||||||
posZ = 0.18,
|
|
||||||
count = 2,
|
|
||||||
},
|
|
||||||
},
|
|
||||||
[6] = {
|
|
||||||
checkboxes = {
|
|
||||||
posZ = 0.38,
|
|
||||||
count = 3,
|
|
||||||
}
|
|
||||||
},
|
|
||||||
[7] = {
|
|
||||||
checkboxes = {
|
|
||||||
posZ = 0.675,
|
|
||||||
count = 3,
|
|
||||||
},
|
|
||||||
},
|
|
||||||
[8] = {
|
|
||||||
checkboxes = {
|
|
||||||
posZ = 0.875,
|
|
||||||
count = 3,
|
|
||||||
},
|
|
||||||
},
|
|
||||||
}
|
|
||||||
|
|
||||||
require("playercards/customizable/UpgradeSheetLibrary")
|
-- returns all matching objects as a table with references
|
||||||
|
---@param owner String Parent object for this search
|
||||||
|
GUIDReferenceApi.getObjectsByOwner = function(owner)
|
||||||
|
return getGuidHandler().call("getObjectsByOwner", owner)
|
||||||
|
end
|
||||||
|
|
||||||
|
return GUIDReferenceApi
|
||||||
|
end
|
||||||
end)
|
end)
|
||||||
return __bundle_require("__root")
|
return __bundle_require("__root")
|
@ -12,7 +12,7 @@ CustomDeck:
|
|||||||
'3':
|
'3':
|
||||||
BackIsHidden: true
|
BackIsHidden: true
|
||||||
BackURL: https://i.imgur.com/EcbhVuh.jpg/
|
BackURL: https://i.imgur.com/EcbhVuh.jpg/
|
||||||
FaceURL: http://cloud-3.steamusercontent.com/ugc/2021607899142908284/92DF67E4310BCDFAD6C4BB12D31155DBF6B07A25/
|
FaceURL: http://cloud-3.steamusercontent.com/ugc/2115061845812962486/A68B8BF7E4862F21369DAC4A37D813EC664EAC34/
|
||||||
NumHeight: 6
|
NumHeight: 6
|
||||||
NumWidth: 10
|
NumWidth: 10
|
||||||
Type: 0
|
Type: 0
|
||||||
|
@ -41,162 +41,6 @@ local __bundle_require, __bundle_loaded, __bundle_register, __bundle_modules = (
|
|||||||
|
|
||||||
return require, loaded, register, modules
|
return require, loaded, register, modules
|
||||||
end)(nil)
|
end)(nil)
|
||||||
__bundle_register("accessories/TokenArrangerApi", function(require, _LOADED, __bundle_register, __bundle_modules)
|
|
||||||
do
|
|
||||||
local TokenArrangerApi = {}
|
|
||||||
|
|
||||||
-- local function to call the token arranger, if it is on the table
|
|
||||||
---@param functionName String Name of the function to cal
|
|
||||||
---@param argument Variant Parameter to pass
|
|
||||||
local function callIfExistent(functionName, argument)
|
|
||||||
local tokenArranger = getObjectsWithTag("TokenArranger")[1]
|
|
||||||
if tokenArranger ~= nil then
|
|
||||||
tokenArranger.call(functionName, argument)
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
-- updates the token modifiers with the provided data
|
|
||||||
---@param tokenData Table Contains the chaos token metadata
|
|
||||||
TokenArrangerApi.onTokenDataChanged = function(fullData)
|
|
||||||
callIfExistent("onTokenDataChanged", fullData)
|
|
||||||
end
|
|
||||||
|
|
||||||
-- deletes already laid out tokens
|
|
||||||
TokenArrangerApi.deleteCopiedTokens = function()
|
|
||||||
callIfExistent("deleteCopiedTokens")
|
|
||||||
end
|
|
||||||
|
|
||||||
-- updates the laid out tokens
|
|
||||||
TokenArrangerApi.layout = function()
|
|
||||||
Wait.time(function() callIfExistent("layout") end, 0.1)
|
|
||||||
end
|
|
||||||
|
|
||||||
return TokenArrangerApi
|
|
||||||
end
|
|
||||||
end)
|
|
||||||
__bundle_register("chaosbag/BlessCurseManagerApi", function(require, _LOADED, __bundle_register, __bundle_modules)
|
|
||||||
do
|
|
||||||
local BlessCurseManagerApi = {}
|
|
||||||
local MANAGER_GUID = "5933fb"
|
|
||||||
|
|
||||||
-- removes all taken tokens and resets the counts
|
|
||||||
BlessCurseManagerApi.removeTakenTokensAndReset = function()
|
|
||||||
local BlessCurseManager = getObjectFromGUID(MANAGER_GUID)
|
|
||||||
Wait.time(function() BlessCurseManager.call("removeTakenTokens", "Bless") end, 0.05)
|
|
||||||
Wait.time(function() BlessCurseManager.call("removeTakenTokens", "Curse") end, 0.10)
|
|
||||||
Wait.time(function() BlessCurseManager.call("doReset", "White") end, 0.15)
|
|
||||||
end
|
|
||||||
|
|
||||||
-- updates the internal count (called by cards that seal bless/curse tokens)
|
|
||||||
BlessCurseManagerApi.sealedToken = function(type, guid)
|
|
||||||
getObjectFromGUID(MANAGER_GUID).call("sealedToken", { type = type, guid = guid })
|
|
||||||
end
|
|
||||||
|
|
||||||
-- updates the internal count (called by cards that seal bless/curse tokens)
|
|
||||||
BlessCurseManagerApi.releasedToken = function(type, guid)
|
|
||||||
getObjectFromGUID(MANAGER_GUID).call("releasedToken", { type = type, guid = guid })
|
|
||||||
end
|
|
||||||
|
|
||||||
-- broadcasts the current status for bless/curse tokens
|
|
||||||
---@param playerColor String Color of the player to show the broadcast to
|
|
||||||
BlessCurseManagerApi.broadcastStatus = function(playerColor)
|
|
||||||
getObjectFromGUID(MANAGER_GUID).call("broadcastStatus", playerColor)
|
|
||||||
end
|
|
||||||
|
|
||||||
-- removes all bless / curse tokens from the chaos bag and play
|
|
||||||
---@param playerColor String Color of the player to show the broadcast to
|
|
||||||
BlessCurseManagerApi.removeAll = function(playerColor)
|
|
||||||
getObjectFromGUID(MANAGER_GUID).call("doRemove", playerColor)
|
|
||||||
end
|
|
||||||
|
|
||||||
-- adds Wendy's menu to the hovered card (allows sealing of tokens)
|
|
||||||
---@param color String Color of the player to show the broadcast to
|
|
||||||
BlessCurseManagerApi.addWendysMenu = function(playerColor, hoveredObject)
|
|
||||||
getObjectFromGUID(MANAGER_GUID).call("addMenuOptions", { playerColor = playerColor, hoveredObject = hoveredObject })
|
|
||||||
end
|
|
||||||
|
|
||||||
return BlessCurseManagerApi
|
|
||||||
end
|
|
||||||
end)
|
|
||||||
__bundle_register("chaosbag/ChaosBagApi", function(require, _LOADED, __bundle_register, __bundle_modules)
|
|
||||||
do
|
|
||||||
local ChaosBagApi = {}
|
|
||||||
|
|
||||||
-- respawns the chaos bag with a new state of tokens
|
|
||||||
---@param tokenList Table List of chaos token ids
|
|
||||||
ChaosBagApi.setChaosBagState = function(tokenList)
|
|
||||||
return Global.call("setChaosBagState", tokenList)
|
|
||||||
end
|
|
||||||
|
|
||||||
-- returns a Table List of chaos token ids in the current chaos bag
|
|
||||||
-- requires copying the data into a new table because TTS is weird about handling table return values in Global
|
|
||||||
ChaosBagApi.getChaosBagState = function()
|
|
||||||
local chaosBagContentsCatcher = Global.call("getChaosBagState")
|
|
||||||
local chaosBagContents = {}
|
|
||||||
for _, v in ipairs(chaosBagContentsCatcher) do
|
|
||||||
table.insert(chaosBagContents, v)
|
|
||||||
end
|
|
||||||
return chaosBagContents
|
|
||||||
end
|
|
||||||
|
|
||||||
-- checks scripting zone for chaos bag (also called by a lot of objects!)
|
|
||||||
ChaosBagApi.findChaosBag = function()
|
|
||||||
return Global.call("findChaosBag")
|
|
||||||
end
|
|
||||||
|
|
||||||
-- returns a table of object references to the tokens in play (does not include sealed tokens!)
|
|
||||||
ChaosBagApi.getTokensInPlay = function()
|
|
||||||
return Global.getTable("chaosTokens")
|
|
||||||
end
|
|
||||||
|
|
||||||
-- returns all sealed tokens on cards to the chaos bag
|
|
||||||
ChaosBagApi.releaseAllSealedTokens = function(playerColor)
|
|
||||||
return Global.call("releaseAllSealedTokens", playerColor)
|
|
||||||
end
|
|
||||||
|
|
||||||
-- returns all drawn tokens to the chaos bag
|
|
||||||
ChaosBagApi.returnChaosTokens = function(playerColor)
|
|
||||||
return Global.call("returnChaosTokens", playerColor)
|
|
||||||
end
|
|
||||||
|
|
||||||
-- removes the specified chaos token from the chaos bag
|
|
||||||
---@param id String ID of the chaos token
|
|
||||||
ChaosBagApi.removeChaosToken = function(id)
|
|
||||||
return Global.call("removeChaosToken", id)
|
|
||||||
end
|
|
||||||
|
|
||||||
-- spawns the specified chaos token and puts it into the chaos bag
|
|
||||||
---@param id String ID of the chaos token
|
|
||||||
ChaosBagApi.spawnChaosToken = function(id)
|
|
||||||
return Global.call("spawnChaosToken", id)
|
|
||||||
end
|
|
||||||
|
|
||||||
-- Checks to see if the chaos bag can be manipulated. If a player is searching the bag when tokens
|
|
||||||
-- are drawn or replaced a TTS bug can cause those tokens to vanish. Any functions which change the
|
|
||||||
-- contents of the bag should check this method before doing so.
|
|
||||||
-- This method will broadcast a message to all players if the bag is being searched.
|
|
||||||
---@return Boolean. True if the bag is manipulated, false if it should be blocked.
|
|
||||||
ChaosBagApi.canTouchChaosTokens = function()
|
|
||||||
return Global.call("canTouchChaosTokens")
|
|
||||||
end
|
|
||||||
|
|
||||||
-- called by playermats (by the "Draw chaos token" button)
|
|
||||||
ChaosBagApi.drawChaosToken = function(mat, tokenOffset, isRightClick)
|
|
||||||
return Global.call("drawChaosToken", {mat, tokenOffset, isRightClick})
|
|
||||||
end
|
|
||||||
|
|
||||||
-- returns a Table List of chaos token ids in the current chaos bag
|
|
||||||
-- requires copying the data into a new table because TTS is weird about handling table return values in Global
|
|
||||||
ChaosBagApi.getIdUrlMap = function()
|
|
||||||
return Global.getTable("ID_URL_MAP")
|
|
||||||
end
|
|
||||||
|
|
||||||
return ChaosBagApi
|
|
||||||
end
|
|
||||||
end)
|
|
||||||
__bundle_register("__root", function(require, _LOADED, __bundle_register, __bundle_modules)
|
|
||||||
require("playercards/cards/ProtectiveIncantation1")
|
|
||||||
end)
|
|
||||||
__bundle_register("playercards/cards/ProtectiveIncantation1", function(require, _LOADED, __bundle_register, __bundle_modules)
|
__bundle_register("playercards/cards/ProtectiveIncantation1", function(require, _LOADED, __bundle_register, __bundle_modules)
|
||||||
VALID_TOKENS = {}
|
VALID_TOKENS = {}
|
||||||
|
|
||||||
@ -436,4 +280,195 @@ function putTokenAway(guid)
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
end)
|
end)
|
||||||
|
__bundle_register("accessories/TokenArrangerApi", function(require, _LOADED, __bundle_register, __bundle_modules)
|
||||||
|
do
|
||||||
|
local TokenArrangerApi = {}
|
||||||
|
local guidReferenceApi = require("core/GUIDReferenceApi")
|
||||||
|
|
||||||
|
-- local function to call the token arranger, if it is on the table
|
||||||
|
---@param functionName String Name of the function to cal
|
||||||
|
---@param argument Variant Parameter to pass
|
||||||
|
local function callIfExistent(functionName, argument)
|
||||||
|
local tokenArranger = guidReferenceApi.getObjectByOwnerAndType("Mythos", "TokenArranger")
|
||||||
|
if tokenArranger ~= nil then
|
||||||
|
tokenArranger.call(functionName, argument)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
-- updates the token modifiers with the provided data
|
||||||
|
---@param tokenData Table Contains the chaos token metadata
|
||||||
|
TokenArrangerApi.onTokenDataChanged = function(fullData)
|
||||||
|
callIfExistent("onTokenDataChanged", fullData)
|
||||||
|
end
|
||||||
|
|
||||||
|
-- deletes already laid out tokens
|
||||||
|
TokenArrangerApi.deleteCopiedTokens = function()
|
||||||
|
callIfExistent("deleteCopiedTokens")
|
||||||
|
end
|
||||||
|
|
||||||
|
-- updates the laid out tokens
|
||||||
|
TokenArrangerApi.layout = function()
|
||||||
|
Wait.time(function() callIfExistent("layout") end, 0.1)
|
||||||
|
end
|
||||||
|
|
||||||
|
return TokenArrangerApi
|
||||||
|
end
|
||||||
|
end)
|
||||||
|
__bundle_register("chaosbag/BlessCurseManagerApi", function(require, _LOADED, __bundle_register, __bundle_modules)
|
||||||
|
do
|
||||||
|
local BlessCurseManagerApi = {}
|
||||||
|
local guidReferenceApi = require("core/GUIDReferenceApi")
|
||||||
|
|
||||||
|
local function getManager()
|
||||||
|
return guidReferenceApi.getObjectByOwnerAndType("Mythos", "BlessCurseManager")
|
||||||
|
end
|
||||||
|
|
||||||
|
-- removes all taken tokens and resets the counts
|
||||||
|
BlessCurseManagerApi.removeTakenTokensAndReset = function()
|
||||||
|
local BlessCurseManager = getManager()
|
||||||
|
Wait.time(function() BlessCurseManager.call("removeTakenTokens", "Bless") end, 0.05)
|
||||||
|
Wait.time(function() BlessCurseManager.call("removeTakenTokens", "Curse") end, 0.10)
|
||||||
|
Wait.time(function() BlessCurseManager.call("doReset", "White") end, 0.15)
|
||||||
|
end
|
||||||
|
|
||||||
|
-- updates the internal count (called by cards that seal bless/curse tokens)
|
||||||
|
BlessCurseManagerApi.sealedToken = function(type, guid)
|
||||||
|
getManager().call("sealedToken", { type = type, guid = guid })
|
||||||
|
end
|
||||||
|
|
||||||
|
-- updates the internal count (called by cards that seal bless/curse tokens)
|
||||||
|
BlessCurseManagerApi.releasedToken = function(type, guid)
|
||||||
|
getManager().call("releasedToken", { type = type, guid = guid })
|
||||||
|
end
|
||||||
|
|
||||||
|
-- broadcasts the current status for bless/curse tokens
|
||||||
|
---@param playerColor String Color of the player to show the broadcast to
|
||||||
|
BlessCurseManagerApi.broadcastStatus = function(playerColor)
|
||||||
|
getManager().call("broadcastStatus", playerColor)
|
||||||
|
end
|
||||||
|
|
||||||
|
-- removes all bless / curse tokens from the chaos bag and play
|
||||||
|
---@param playerColor String Color of the player to show the broadcast to
|
||||||
|
BlessCurseManagerApi.removeAll = function(playerColor)
|
||||||
|
getManager().call("doRemove", playerColor)
|
||||||
|
end
|
||||||
|
|
||||||
|
-- adds Wendy's menu to the hovered card (allows sealing of tokens)
|
||||||
|
---@param color String Color of the player to show the broadcast to
|
||||||
|
BlessCurseManagerApi.addWendysMenu = function(playerColor, hoveredObject)
|
||||||
|
getManager().call("addMenuOptions", { playerColor = playerColor, hoveredObject = hoveredObject })
|
||||||
|
end
|
||||||
|
|
||||||
|
return BlessCurseManagerApi
|
||||||
|
end
|
||||||
|
end)
|
||||||
|
__bundle_register("chaosbag/ChaosBagApi", function(require, _LOADED, __bundle_register, __bundle_modules)
|
||||||
|
do
|
||||||
|
local ChaosBagApi = {}
|
||||||
|
|
||||||
|
-- respawns the chaos bag with a new state of tokens
|
||||||
|
---@param tokenList Table List of chaos token ids
|
||||||
|
ChaosBagApi.setChaosBagState = function(tokenList)
|
||||||
|
return Global.call("setChaosBagState", tokenList)
|
||||||
|
end
|
||||||
|
|
||||||
|
-- returns a Table List of chaos token ids in the current chaos bag
|
||||||
|
-- requires copying the data into a new table because TTS is weird about handling table return values in Global
|
||||||
|
ChaosBagApi.getChaosBagState = function()
|
||||||
|
local chaosBagContentsCatcher = Global.call("getChaosBagState")
|
||||||
|
local chaosBagContents = {}
|
||||||
|
for _, v in ipairs(chaosBagContentsCatcher) do
|
||||||
|
table.insert(chaosBagContents, v)
|
||||||
|
end
|
||||||
|
return chaosBagContents
|
||||||
|
end
|
||||||
|
|
||||||
|
-- checks scripting zone for chaos bag (also called by a lot of objects!)
|
||||||
|
ChaosBagApi.findChaosBag = function()
|
||||||
|
return Global.call("findChaosBag")
|
||||||
|
end
|
||||||
|
|
||||||
|
-- returns a table of object references to the tokens in play (does not include sealed tokens!)
|
||||||
|
ChaosBagApi.getTokensInPlay = function()
|
||||||
|
return Global.getTable("chaosTokens")
|
||||||
|
end
|
||||||
|
|
||||||
|
-- returns all sealed tokens on cards to the chaos bag
|
||||||
|
ChaosBagApi.releaseAllSealedTokens = function(playerColor)
|
||||||
|
return Global.call("releaseAllSealedTokens", playerColor)
|
||||||
|
end
|
||||||
|
|
||||||
|
-- returns all drawn tokens to the chaos bag
|
||||||
|
ChaosBagApi.returnChaosTokens = function(playerColor)
|
||||||
|
return Global.call("returnChaosTokens", playerColor)
|
||||||
|
end
|
||||||
|
|
||||||
|
-- removes the specified chaos token from the chaos bag
|
||||||
|
---@param id String ID of the chaos token
|
||||||
|
ChaosBagApi.removeChaosToken = function(id)
|
||||||
|
return Global.call("removeChaosToken", id)
|
||||||
|
end
|
||||||
|
|
||||||
|
-- spawns the specified chaos token and puts it into the chaos bag
|
||||||
|
---@param id String ID of the chaos token
|
||||||
|
ChaosBagApi.spawnChaosToken = function(id)
|
||||||
|
return Global.call("spawnChaosToken", id)
|
||||||
|
end
|
||||||
|
|
||||||
|
-- Checks to see if the chaos bag can be manipulated. If a player is searching the bag when tokens
|
||||||
|
-- are drawn or replaced a TTS bug can cause those tokens to vanish. Any functions which change the
|
||||||
|
-- contents of the bag should check this method before doing so.
|
||||||
|
-- This method will broadcast a message to all players if the bag is being searched.
|
||||||
|
---@return Boolean. True if the bag is manipulated, false if it should be blocked.
|
||||||
|
ChaosBagApi.canTouchChaosTokens = function()
|
||||||
|
return Global.call("canTouchChaosTokens")
|
||||||
|
end
|
||||||
|
|
||||||
|
-- called by playermats (by the "Draw chaos token" button)
|
||||||
|
ChaosBagApi.drawChaosToken = function(mat, tokenOffset, isRightClick)
|
||||||
|
return Global.call("drawChaosToken", {mat, tokenOffset, isRightClick})
|
||||||
|
end
|
||||||
|
|
||||||
|
-- returns a Table List of chaos token ids in the current chaos bag
|
||||||
|
-- requires copying the data into a new table because TTS is weird about handling table return values in Global
|
||||||
|
ChaosBagApi.getIdUrlMap = function()
|
||||||
|
return Global.getTable("ID_URL_MAP")
|
||||||
|
end
|
||||||
|
|
||||||
|
return ChaosBagApi
|
||||||
|
end
|
||||||
|
end)
|
||||||
|
__bundle_register("core/GUIDReferenceApi", function(require, _LOADED, __bundle_register, __bundle_modules)
|
||||||
|
do
|
||||||
|
local GUIDReferenceApi = {}
|
||||||
|
|
||||||
|
local function getGuidHandler()
|
||||||
|
return getObjectFromGUID("123456")
|
||||||
|
end
|
||||||
|
|
||||||
|
-- returns all matching objects as a table with references
|
||||||
|
---@param owner String Parent object for this search
|
||||||
|
---@param type String Type of object to search for
|
||||||
|
GUIDReferenceApi.getObjectByOwnerAndType = function(owner, type)
|
||||||
|
return getGuidHandler().call("getObjectByOwnerAndType", { owner = owner, type = type })
|
||||||
|
end
|
||||||
|
|
||||||
|
-- returns all matching objects as a table with references
|
||||||
|
---@param type String Type of object to search for
|
||||||
|
GUIDReferenceApi.getObjectsByType = function(type)
|
||||||
|
return getGuidHandler().call("getObjectsByType", type)
|
||||||
|
end
|
||||||
|
|
||||||
|
-- returns all matching objects as a table with references
|
||||||
|
---@param owner String Parent object for this search
|
||||||
|
GUIDReferenceApi.getObjectsByOwner = function(owner)
|
||||||
|
return getGuidHandler().call("getObjectsByOwner", owner)
|
||||||
|
end
|
||||||
|
|
||||||
|
return GUIDReferenceApi
|
||||||
|
end
|
||||||
|
end)
|
||||||
|
__bundle_register("__root", function(require, _LOADED, __bundle_register, __bundle_modules)
|
||||||
|
require("playercards/cards/ProtectiveIncantation1")
|
||||||
|
end)
|
||||||
return __bundle_require("__root")
|
return __bundle_require("__root")
|
@ -12,7 +12,7 @@ CustomDeck:
|
|||||||
'3':
|
'3':
|
||||||
BackIsHidden: true
|
BackIsHidden: true
|
||||||
BackURL: https://i.imgur.com/EcbhVuh.jpg/
|
BackURL: https://i.imgur.com/EcbhVuh.jpg/
|
||||||
FaceURL: http://cloud-3.steamusercontent.com/ugc/2021607899142908284/92DF67E4310BCDFAD6C4BB12D31155DBF6B07A25/
|
FaceURL: http://cloud-3.steamusercontent.com/ugc/2115061845812962486/A68B8BF7E4862F21369DAC4A37D813EC664EAC34/
|
||||||
NumHeight: 6
|
NumHeight: 6
|
||||||
NumWidth: 10
|
NumWidth: 10
|
||||||
Type: 0
|
Type: 0
|
||||||
|
@ -41,6 +41,160 @@ local __bundle_require, __bundle_loaded, __bundle_register, __bundle_modules = (
|
|||||||
|
|
||||||
return require, loaded, register, modules
|
return require, loaded, register, modules
|
||||||
end)(nil)
|
end)(nil)
|
||||||
|
__bundle_register("chaosbag/BlessCurseManagerApi", function(require, _LOADED, __bundle_register, __bundle_modules)
|
||||||
|
do
|
||||||
|
local BlessCurseManagerApi = {}
|
||||||
|
local guidReferenceApi = require("core/GUIDReferenceApi")
|
||||||
|
|
||||||
|
local function getManager()
|
||||||
|
return guidReferenceApi.getObjectByOwnerAndType("Mythos", "BlessCurseManager")
|
||||||
|
end
|
||||||
|
|
||||||
|
-- removes all taken tokens and resets the counts
|
||||||
|
BlessCurseManagerApi.removeTakenTokensAndReset = function()
|
||||||
|
local BlessCurseManager = getManager()
|
||||||
|
Wait.time(function() BlessCurseManager.call("removeTakenTokens", "Bless") end, 0.05)
|
||||||
|
Wait.time(function() BlessCurseManager.call("removeTakenTokens", "Curse") end, 0.10)
|
||||||
|
Wait.time(function() BlessCurseManager.call("doReset", "White") end, 0.15)
|
||||||
|
end
|
||||||
|
|
||||||
|
-- updates the internal count (called by cards that seal bless/curse tokens)
|
||||||
|
BlessCurseManagerApi.sealedToken = function(type, guid)
|
||||||
|
getManager().call("sealedToken", { type = type, guid = guid })
|
||||||
|
end
|
||||||
|
|
||||||
|
-- updates the internal count (called by cards that seal bless/curse tokens)
|
||||||
|
BlessCurseManagerApi.releasedToken = function(type, guid)
|
||||||
|
getManager().call("releasedToken", { type = type, guid = guid })
|
||||||
|
end
|
||||||
|
|
||||||
|
-- broadcasts the current status for bless/curse tokens
|
||||||
|
---@param playerColor String Color of the player to show the broadcast to
|
||||||
|
BlessCurseManagerApi.broadcastStatus = function(playerColor)
|
||||||
|
getManager().call("broadcastStatus", playerColor)
|
||||||
|
end
|
||||||
|
|
||||||
|
-- removes all bless / curse tokens from the chaos bag and play
|
||||||
|
---@param playerColor String Color of the player to show the broadcast to
|
||||||
|
BlessCurseManagerApi.removeAll = function(playerColor)
|
||||||
|
getManager().call("doRemove", playerColor)
|
||||||
|
end
|
||||||
|
|
||||||
|
-- adds Wendy's menu to the hovered card (allows sealing of tokens)
|
||||||
|
---@param color String Color of the player to show the broadcast to
|
||||||
|
BlessCurseManagerApi.addWendysMenu = function(playerColor, hoveredObject)
|
||||||
|
getManager().call("addMenuOptions", { playerColor = playerColor, hoveredObject = hoveredObject })
|
||||||
|
end
|
||||||
|
|
||||||
|
return BlessCurseManagerApi
|
||||||
|
end
|
||||||
|
end)
|
||||||
|
__bundle_register("chaosbag/ChaosBagApi", function(require, _LOADED, __bundle_register, __bundle_modules)
|
||||||
|
do
|
||||||
|
local ChaosBagApi = {}
|
||||||
|
|
||||||
|
-- respawns the chaos bag with a new state of tokens
|
||||||
|
---@param tokenList Table List of chaos token ids
|
||||||
|
ChaosBagApi.setChaosBagState = function(tokenList)
|
||||||
|
return Global.call("setChaosBagState", tokenList)
|
||||||
|
end
|
||||||
|
|
||||||
|
-- returns a Table List of chaos token ids in the current chaos bag
|
||||||
|
-- requires copying the data into a new table because TTS is weird about handling table return values in Global
|
||||||
|
ChaosBagApi.getChaosBagState = function()
|
||||||
|
local chaosBagContentsCatcher = Global.call("getChaosBagState")
|
||||||
|
local chaosBagContents = {}
|
||||||
|
for _, v in ipairs(chaosBagContentsCatcher) do
|
||||||
|
table.insert(chaosBagContents, v)
|
||||||
|
end
|
||||||
|
return chaosBagContents
|
||||||
|
end
|
||||||
|
|
||||||
|
-- checks scripting zone for chaos bag (also called by a lot of objects!)
|
||||||
|
ChaosBagApi.findChaosBag = function()
|
||||||
|
return Global.call("findChaosBag")
|
||||||
|
end
|
||||||
|
|
||||||
|
-- returns a table of object references to the tokens in play (does not include sealed tokens!)
|
||||||
|
ChaosBagApi.getTokensInPlay = function()
|
||||||
|
return Global.getTable("chaosTokens")
|
||||||
|
end
|
||||||
|
|
||||||
|
-- returns all sealed tokens on cards to the chaos bag
|
||||||
|
ChaosBagApi.releaseAllSealedTokens = function(playerColor)
|
||||||
|
return Global.call("releaseAllSealedTokens", playerColor)
|
||||||
|
end
|
||||||
|
|
||||||
|
-- returns all drawn tokens to the chaos bag
|
||||||
|
ChaosBagApi.returnChaosTokens = function(playerColor)
|
||||||
|
return Global.call("returnChaosTokens", playerColor)
|
||||||
|
end
|
||||||
|
|
||||||
|
-- removes the specified chaos token from the chaos bag
|
||||||
|
---@param id String ID of the chaos token
|
||||||
|
ChaosBagApi.removeChaosToken = function(id)
|
||||||
|
return Global.call("removeChaosToken", id)
|
||||||
|
end
|
||||||
|
|
||||||
|
-- spawns the specified chaos token and puts it into the chaos bag
|
||||||
|
---@param id String ID of the chaos token
|
||||||
|
ChaosBagApi.spawnChaosToken = function(id)
|
||||||
|
return Global.call("spawnChaosToken", id)
|
||||||
|
end
|
||||||
|
|
||||||
|
-- Checks to see if the chaos bag can be manipulated. If a player is searching the bag when tokens
|
||||||
|
-- are drawn or replaced a TTS bug can cause those tokens to vanish. Any functions which change the
|
||||||
|
-- contents of the bag should check this method before doing so.
|
||||||
|
-- This method will broadcast a message to all players if the bag is being searched.
|
||||||
|
---@return Boolean. True if the bag is manipulated, false if it should be blocked.
|
||||||
|
ChaosBagApi.canTouchChaosTokens = function()
|
||||||
|
return Global.call("canTouchChaosTokens")
|
||||||
|
end
|
||||||
|
|
||||||
|
-- called by playermats (by the "Draw chaos token" button)
|
||||||
|
ChaosBagApi.drawChaosToken = function(mat, tokenOffset, isRightClick)
|
||||||
|
return Global.call("drawChaosToken", {mat, tokenOffset, isRightClick})
|
||||||
|
end
|
||||||
|
|
||||||
|
-- returns a Table List of chaos token ids in the current chaos bag
|
||||||
|
-- requires copying the data into a new table because TTS is weird about handling table return values in Global
|
||||||
|
ChaosBagApi.getIdUrlMap = function()
|
||||||
|
return Global.getTable("ID_URL_MAP")
|
||||||
|
end
|
||||||
|
|
||||||
|
return ChaosBagApi
|
||||||
|
end
|
||||||
|
end)
|
||||||
|
__bundle_register("core/GUIDReferenceApi", function(require, _LOADED, __bundle_register, __bundle_modules)
|
||||||
|
do
|
||||||
|
local GUIDReferenceApi = {}
|
||||||
|
|
||||||
|
local function getGuidHandler()
|
||||||
|
return getObjectFromGUID("123456")
|
||||||
|
end
|
||||||
|
|
||||||
|
-- returns all matching objects as a table with references
|
||||||
|
---@param owner String Parent object for this search
|
||||||
|
---@param type String Type of object to search for
|
||||||
|
GUIDReferenceApi.getObjectByOwnerAndType = function(owner, type)
|
||||||
|
return getGuidHandler().call("getObjectByOwnerAndType", { owner = owner, type = type })
|
||||||
|
end
|
||||||
|
|
||||||
|
-- returns all matching objects as a table with references
|
||||||
|
---@param type String Type of object to search for
|
||||||
|
GUIDReferenceApi.getObjectsByType = function(type)
|
||||||
|
return getGuidHandler().call("getObjectsByType", type)
|
||||||
|
end
|
||||||
|
|
||||||
|
-- returns all matching objects as a table with references
|
||||||
|
---@param owner String Parent object for this search
|
||||||
|
GUIDReferenceApi.getObjectsByOwner = function(owner)
|
||||||
|
return getGuidHandler().call("getObjectsByOwner", owner)
|
||||||
|
end
|
||||||
|
|
||||||
|
return GUIDReferenceApi
|
||||||
|
end
|
||||||
|
end)
|
||||||
__bundle_register("__root", function(require, _LOADED, __bundle_register, __bundle_modules)
|
__bundle_register("__root", function(require, _LOADED, __bundle_register, __bundle_modules)
|
||||||
require("playercards/cards/RadiantSmite1")
|
require("playercards/cards/RadiantSmite1")
|
||||||
end)
|
end)
|
||||||
@ -284,12 +438,13 @@ end)
|
|||||||
__bundle_register("accessories/TokenArrangerApi", function(require, _LOADED, __bundle_register, __bundle_modules)
|
__bundle_register("accessories/TokenArrangerApi", function(require, _LOADED, __bundle_register, __bundle_modules)
|
||||||
do
|
do
|
||||||
local TokenArrangerApi = {}
|
local TokenArrangerApi = {}
|
||||||
|
local guidReferenceApi = require("core/GUIDReferenceApi")
|
||||||
|
|
||||||
-- local function to call the token arranger, if it is on the table
|
-- local function to call the token arranger, if it is on the table
|
||||||
---@param functionName String Name of the function to cal
|
---@param functionName String Name of the function to cal
|
||||||
---@param argument Variant Parameter to pass
|
---@param argument Variant Parameter to pass
|
||||||
local function callIfExistent(functionName, argument)
|
local function callIfExistent(functionName, argument)
|
||||||
local tokenArranger = getObjectsWithTag("TokenArranger")[1]
|
local tokenArranger = guidReferenceApi.getObjectByOwnerAndType("Mythos", "TokenArranger")
|
||||||
if tokenArranger ~= nil then
|
if tokenArranger ~= nil then
|
||||||
tokenArranger.call(functionName, argument)
|
tokenArranger.call(functionName, argument)
|
||||||
end
|
end
|
||||||
@ -314,124 +469,4 @@ do
|
|||||||
return TokenArrangerApi
|
return TokenArrangerApi
|
||||||
end
|
end
|
||||||
end)
|
end)
|
||||||
__bundle_register("chaosbag/BlessCurseManagerApi", function(require, _LOADED, __bundle_register, __bundle_modules)
|
|
||||||
do
|
|
||||||
local BlessCurseManagerApi = {}
|
|
||||||
local MANAGER_GUID = "5933fb"
|
|
||||||
|
|
||||||
-- removes all taken tokens and resets the counts
|
|
||||||
BlessCurseManagerApi.removeTakenTokensAndReset = function()
|
|
||||||
local BlessCurseManager = getObjectFromGUID(MANAGER_GUID)
|
|
||||||
Wait.time(function() BlessCurseManager.call("removeTakenTokens", "Bless") end, 0.05)
|
|
||||||
Wait.time(function() BlessCurseManager.call("removeTakenTokens", "Curse") end, 0.10)
|
|
||||||
Wait.time(function() BlessCurseManager.call("doReset", "White") end, 0.15)
|
|
||||||
end
|
|
||||||
|
|
||||||
-- updates the internal count (called by cards that seal bless/curse tokens)
|
|
||||||
BlessCurseManagerApi.sealedToken = function(type, guid)
|
|
||||||
getObjectFromGUID(MANAGER_GUID).call("sealedToken", { type = type, guid = guid })
|
|
||||||
end
|
|
||||||
|
|
||||||
-- updates the internal count (called by cards that seal bless/curse tokens)
|
|
||||||
BlessCurseManagerApi.releasedToken = function(type, guid)
|
|
||||||
getObjectFromGUID(MANAGER_GUID).call("releasedToken", { type = type, guid = guid })
|
|
||||||
end
|
|
||||||
|
|
||||||
-- broadcasts the current status for bless/curse tokens
|
|
||||||
---@param playerColor String Color of the player to show the broadcast to
|
|
||||||
BlessCurseManagerApi.broadcastStatus = function(playerColor)
|
|
||||||
getObjectFromGUID(MANAGER_GUID).call("broadcastStatus", playerColor)
|
|
||||||
end
|
|
||||||
|
|
||||||
-- removes all bless / curse tokens from the chaos bag and play
|
|
||||||
---@param playerColor String Color of the player to show the broadcast to
|
|
||||||
BlessCurseManagerApi.removeAll = function(playerColor)
|
|
||||||
getObjectFromGUID(MANAGER_GUID).call("doRemove", playerColor)
|
|
||||||
end
|
|
||||||
|
|
||||||
-- adds Wendy's menu to the hovered card (allows sealing of tokens)
|
|
||||||
---@param color String Color of the player to show the broadcast to
|
|
||||||
BlessCurseManagerApi.addWendysMenu = function(playerColor, hoveredObject)
|
|
||||||
getObjectFromGUID(MANAGER_GUID).call("addMenuOptions", { playerColor = playerColor, hoveredObject = hoveredObject })
|
|
||||||
end
|
|
||||||
|
|
||||||
return BlessCurseManagerApi
|
|
||||||
end
|
|
||||||
end)
|
|
||||||
__bundle_register("chaosbag/ChaosBagApi", function(require, _LOADED, __bundle_register, __bundle_modules)
|
|
||||||
do
|
|
||||||
local ChaosBagApi = {}
|
|
||||||
|
|
||||||
-- respawns the chaos bag with a new state of tokens
|
|
||||||
---@param tokenList Table List of chaos token ids
|
|
||||||
ChaosBagApi.setChaosBagState = function(tokenList)
|
|
||||||
return Global.call("setChaosBagState", tokenList)
|
|
||||||
end
|
|
||||||
|
|
||||||
-- returns a Table List of chaos token ids in the current chaos bag
|
|
||||||
-- requires copying the data into a new table because TTS is weird about handling table return values in Global
|
|
||||||
ChaosBagApi.getChaosBagState = function()
|
|
||||||
local chaosBagContentsCatcher = Global.call("getChaosBagState")
|
|
||||||
local chaosBagContents = {}
|
|
||||||
for _, v in ipairs(chaosBagContentsCatcher) do
|
|
||||||
table.insert(chaosBagContents, v)
|
|
||||||
end
|
|
||||||
return chaosBagContents
|
|
||||||
end
|
|
||||||
|
|
||||||
-- checks scripting zone for chaos bag (also called by a lot of objects!)
|
|
||||||
ChaosBagApi.findChaosBag = function()
|
|
||||||
return Global.call("findChaosBag")
|
|
||||||
end
|
|
||||||
|
|
||||||
-- returns a table of object references to the tokens in play (does not include sealed tokens!)
|
|
||||||
ChaosBagApi.getTokensInPlay = function()
|
|
||||||
return Global.getTable("chaosTokens")
|
|
||||||
end
|
|
||||||
|
|
||||||
-- returns all sealed tokens on cards to the chaos bag
|
|
||||||
ChaosBagApi.releaseAllSealedTokens = function(playerColor)
|
|
||||||
return Global.call("releaseAllSealedTokens", playerColor)
|
|
||||||
end
|
|
||||||
|
|
||||||
-- returns all drawn tokens to the chaos bag
|
|
||||||
ChaosBagApi.returnChaosTokens = function(playerColor)
|
|
||||||
return Global.call("returnChaosTokens", playerColor)
|
|
||||||
end
|
|
||||||
|
|
||||||
-- removes the specified chaos token from the chaos bag
|
|
||||||
---@param id String ID of the chaos token
|
|
||||||
ChaosBagApi.removeChaosToken = function(id)
|
|
||||||
return Global.call("removeChaosToken", id)
|
|
||||||
end
|
|
||||||
|
|
||||||
-- spawns the specified chaos token and puts it into the chaos bag
|
|
||||||
---@param id String ID of the chaos token
|
|
||||||
ChaosBagApi.spawnChaosToken = function(id)
|
|
||||||
return Global.call("spawnChaosToken", id)
|
|
||||||
end
|
|
||||||
|
|
||||||
-- Checks to see if the chaos bag can be manipulated. If a player is searching the bag when tokens
|
|
||||||
-- are drawn or replaced a TTS bug can cause those tokens to vanish. Any functions which change the
|
|
||||||
-- contents of the bag should check this method before doing so.
|
|
||||||
-- This method will broadcast a message to all players if the bag is being searched.
|
|
||||||
---@return Boolean. True if the bag is manipulated, false if it should be blocked.
|
|
||||||
ChaosBagApi.canTouchChaosTokens = function()
|
|
||||||
return Global.call("canTouchChaosTokens")
|
|
||||||
end
|
|
||||||
|
|
||||||
-- called by playermats (by the "Draw chaos token" button)
|
|
||||||
ChaosBagApi.drawChaosToken = function(mat, tokenOffset, isRightClick)
|
|
||||||
return Global.call("drawChaosToken", {mat, tokenOffset, isRightClick})
|
|
||||||
end
|
|
||||||
|
|
||||||
-- returns a Table List of chaos token ids in the current chaos bag
|
|
||||||
-- requires copying the data into a new table because TTS is weird about handling table return values in Global
|
|
||||||
ChaosBagApi.getIdUrlMap = function()
|
|
||||||
return Global.getTable("ID_URL_MAP")
|
|
||||||
end
|
|
||||||
|
|
||||||
return ChaosBagApi
|
|
||||||
end
|
|
||||||
end)
|
|
||||||
return __bundle_require("__root")
|
return __bundle_require("__root")
|
@ -12,7 +12,7 @@ CustomDeck:
|
|||||||
'3':
|
'3':
|
||||||
BackIsHidden: true
|
BackIsHidden: true
|
||||||
BackURL: https://i.imgur.com/EcbhVuh.jpg/
|
BackURL: https://i.imgur.com/EcbhVuh.jpg/
|
||||||
FaceURL: http://cloud-3.steamusercontent.com/ugc/2021607899142908284/92DF67E4310BCDFAD6C4BB12D31155DBF6B07A25/
|
FaceURL: http://cloud-3.steamusercontent.com/ugc/2115061845812962486/A68B8BF7E4862F21369DAC4A37D813EC664EAC34/
|
||||||
NumHeight: 6
|
NumHeight: 6
|
||||||
NumWidth: 10
|
NumWidth: 10
|
||||||
Type: 0
|
Type: 0
|
||||||
|
@ -12,7 +12,7 @@ CustomDeck:
|
|||||||
'3':
|
'3':
|
||||||
BackIsHidden: true
|
BackIsHidden: true
|
||||||
BackURL: https://i.imgur.com/EcbhVuh.jpg/
|
BackURL: https://i.imgur.com/EcbhVuh.jpg/
|
||||||
FaceURL: http://cloud-3.steamusercontent.com/ugc/2021607899142908284/92DF67E4310BCDFAD6C4BB12D31155DBF6B07A25/
|
FaceURL: http://cloud-3.steamusercontent.com/ugc/2115061845812962486/A68B8BF7E4862F21369DAC4A37D813EC664EAC34/
|
||||||
NumHeight: 6
|
NumHeight: 6
|
||||||
NumWidth: 10
|
NumWidth: 10
|
||||||
Type: 0
|
Type: 0
|
||||||
|
@ -41,159 +41,6 @@ local __bundle_require, __bundle_loaded, __bundle_register, __bundle_modules = (
|
|||||||
|
|
||||||
return require, loaded, register, modules
|
return require, loaded, register, modules
|
||||||
end)(nil)
|
end)(nil)
|
||||||
__bundle_register("accessories/TokenArrangerApi", function(require, _LOADED, __bundle_register, __bundle_modules)
|
|
||||||
do
|
|
||||||
local TokenArrangerApi = {}
|
|
||||||
|
|
||||||
-- local function to call the token arranger, if it is on the table
|
|
||||||
---@param functionName String Name of the function to cal
|
|
||||||
---@param argument Variant Parameter to pass
|
|
||||||
local function callIfExistent(functionName, argument)
|
|
||||||
local tokenArranger = getObjectsWithTag("TokenArranger")[1]
|
|
||||||
if tokenArranger ~= nil then
|
|
||||||
tokenArranger.call(functionName, argument)
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
-- updates the token modifiers with the provided data
|
|
||||||
---@param tokenData Table Contains the chaos token metadata
|
|
||||||
TokenArrangerApi.onTokenDataChanged = function(fullData)
|
|
||||||
callIfExistent("onTokenDataChanged", fullData)
|
|
||||||
end
|
|
||||||
|
|
||||||
-- deletes already laid out tokens
|
|
||||||
TokenArrangerApi.deleteCopiedTokens = function()
|
|
||||||
callIfExistent("deleteCopiedTokens")
|
|
||||||
end
|
|
||||||
|
|
||||||
-- updates the laid out tokens
|
|
||||||
TokenArrangerApi.layout = function()
|
|
||||||
Wait.time(function() callIfExistent("layout") end, 0.1)
|
|
||||||
end
|
|
||||||
|
|
||||||
return TokenArrangerApi
|
|
||||||
end
|
|
||||||
end)
|
|
||||||
__bundle_register("chaosbag/BlessCurseManagerApi", function(require, _LOADED, __bundle_register, __bundle_modules)
|
|
||||||
do
|
|
||||||
local BlessCurseManagerApi = {}
|
|
||||||
local MANAGER_GUID = "5933fb"
|
|
||||||
|
|
||||||
-- removes all taken tokens and resets the counts
|
|
||||||
BlessCurseManagerApi.removeTakenTokensAndReset = function()
|
|
||||||
local BlessCurseManager = getObjectFromGUID(MANAGER_GUID)
|
|
||||||
Wait.time(function() BlessCurseManager.call("removeTakenTokens", "Bless") end, 0.05)
|
|
||||||
Wait.time(function() BlessCurseManager.call("removeTakenTokens", "Curse") end, 0.10)
|
|
||||||
Wait.time(function() BlessCurseManager.call("doReset", "White") end, 0.15)
|
|
||||||
end
|
|
||||||
|
|
||||||
-- updates the internal count (called by cards that seal bless/curse tokens)
|
|
||||||
BlessCurseManagerApi.sealedToken = function(type, guid)
|
|
||||||
getObjectFromGUID(MANAGER_GUID).call("sealedToken", { type = type, guid = guid })
|
|
||||||
end
|
|
||||||
|
|
||||||
-- updates the internal count (called by cards that seal bless/curse tokens)
|
|
||||||
BlessCurseManagerApi.releasedToken = function(type, guid)
|
|
||||||
getObjectFromGUID(MANAGER_GUID).call("releasedToken", { type = type, guid = guid })
|
|
||||||
end
|
|
||||||
|
|
||||||
-- broadcasts the current status for bless/curse tokens
|
|
||||||
---@param playerColor String Color of the player to show the broadcast to
|
|
||||||
BlessCurseManagerApi.broadcastStatus = function(playerColor)
|
|
||||||
getObjectFromGUID(MANAGER_GUID).call("broadcastStatus", playerColor)
|
|
||||||
end
|
|
||||||
|
|
||||||
-- removes all bless / curse tokens from the chaos bag and play
|
|
||||||
---@param playerColor String Color of the player to show the broadcast to
|
|
||||||
BlessCurseManagerApi.removeAll = function(playerColor)
|
|
||||||
getObjectFromGUID(MANAGER_GUID).call("doRemove", playerColor)
|
|
||||||
end
|
|
||||||
|
|
||||||
-- adds Wendy's menu to the hovered card (allows sealing of tokens)
|
|
||||||
---@param color String Color of the player to show the broadcast to
|
|
||||||
BlessCurseManagerApi.addWendysMenu = function(playerColor, hoveredObject)
|
|
||||||
getObjectFromGUID(MANAGER_GUID).call("addMenuOptions", { playerColor = playerColor, hoveredObject = hoveredObject })
|
|
||||||
end
|
|
||||||
|
|
||||||
return BlessCurseManagerApi
|
|
||||||
end
|
|
||||||
end)
|
|
||||||
__bundle_register("chaosbag/ChaosBagApi", function(require, _LOADED, __bundle_register, __bundle_modules)
|
|
||||||
do
|
|
||||||
local ChaosBagApi = {}
|
|
||||||
|
|
||||||
-- respawns the chaos bag with a new state of tokens
|
|
||||||
---@param tokenList Table List of chaos token ids
|
|
||||||
ChaosBagApi.setChaosBagState = function(tokenList)
|
|
||||||
return Global.call("setChaosBagState", tokenList)
|
|
||||||
end
|
|
||||||
|
|
||||||
-- returns a Table List of chaos token ids in the current chaos bag
|
|
||||||
-- requires copying the data into a new table because TTS is weird about handling table return values in Global
|
|
||||||
ChaosBagApi.getChaosBagState = function()
|
|
||||||
local chaosBagContentsCatcher = Global.call("getChaosBagState")
|
|
||||||
local chaosBagContents = {}
|
|
||||||
for _, v in ipairs(chaosBagContentsCatcher) do
|
|
||||||
table.insert(chaosBagContents, v)
|
|
||||||
end
|
|
||||||
return chaosBagContents
|
|
||||||
end
|
|
||||||
|
|
||||||
-- checks scripting zone for chaos bag (also called by a lot of objects!)
|
|
||||||
ChaosBagApi.findChaosBag = function()
|
|
||||||
return Global.call("findChaosBag")
|
|
||||||
end
|
|
||||||
|
|
||||||
-- returns a table of object references to the tokens in play (does not include sealed tokens!)
|
|
||||||
ChaosBagApi.getTokensInPlay = function()
|
|
||||||
return Global.getTable("chaosTokens")
|
|
||||||
end
|
|
||||||
|
|
||||||
-- returns all sealed tokens on cards to the chaos bag
|
|
||||||
ChaosBagApi.releaseAllSealedTokens = function(playerColor)
|
|
||||||
return Global.call("releaseAllSealedTokens", playerColor)
|
|
||||||
end
|
|
||||||
|
|
||||||
-- returns all drawn tokens to the chaos bag
|
|
||||||
ChaosBagApi.returnChaosTokens = function(playerColor)
|
|
||||||
return Global.call("returnChaosTokens", playerColor)
|
|
||||||
end
|
|
||||||
|
|
||||||
-- removes the specified chaos token from the chaos bag
|
|
||||||
---@param id String ID of the chaos token
|
|
||||||
ChaosBagApi.removeChaosToken = function(id)
|
|
||||||
return Global.call("removeChaosToken", id)
|
|
||||||
end
|
|
||||||
|
|
||||||
-- spawns the specified chaos token and puts it into the chaos bag
|
|
||||||
---@param id String ID of the chaos token
|
|
||||||
ChaosBagApi.spawnChaosToken = function(id)
|
|
||||||
return Global.call("spawnChaosToken", id)
|
|
||||||
end
|
|
||||||
|
|
||||||
-- Checks to see if the chaos bag can be manipulated. If a player is searching the bag when tokens
|
|
||||||
-- are drawn or replaced a TTS bug can cause those tokens to vanish. Any functions which change the
|
|
||||||
-- contents of the bag should check this method before doing so.
|
|
||||||
-- This method will broadcast a message to all players if the bag is being searched.
|
|
||||||
---@return Boolean. True if the bag is manipulated, false if it should be blocked.
|
|
||||||
ChaosBagApi.canTouchChaosTokens = function()
|
|
||||||
return Global.call("canTouchChaosTokens")
|
|
||||||
end
|
|
||||||
|
|
||||||
-- called by playermats (by the "Draw chaos token" button)
|
|
||||||
ChaosBagApi.drawChaosToken = function(mat, tokenOffset, isRightClick)
|
|
||||||
return Global.call("drawChaosToken", {mat, tokenOffset, isRightClick})
|
|
||||||
end
|
|
||||||
|
|
||||||
-- returns a Table List of chaos token ids in the current chaos bag
|
|
||||||
-- requires copying the data into a new table because TTS is weird about handling table return values in Global
|
|
||||||
ChaosBagApi.getIdUrlMap = function()
|
|
||||||
return Global.getTable("ID_URL_MAP")
|
|
||||||
end
|
|
||||||
|
|
||||||
return ChaosBagApi
|
|
||||||
end
|
|
||||||
end)
|
|
||||||
__bundle_register("__root", function(require, _LOADED, __bundle_register, __bundle_modules)
|
__bundle_register("__root", function(require, _LOADED, __bundle_register, __bundle_modules)
|
||||||
require("playercards/cards/RiteofSanctification")
|
require("playercards/cards/RiteofSanctification")
|
||||||
end)
|
end)
|
||||||
@ -434,4 +281,192 @@ function putTokenAway(guid)
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
end)
|
end)
|
||||||
|
__bundle_register("accessories/TokenArrangerApi", function(require, _LOADED, __bundle_register, __bundle_modules)
|
||||||
|
do
|
||||||
|
local TokenArrangerApi = {}
|
||||||
|
local guidReferenceApi = require("core/GUIDReferenceApi")
|
||||||
|
|
||||||
|
-- local function to call the token arranger, if it is on the table
|
||||||
|
---@param functionName String Name of the function to cal
|
||||||
|
---@param argument Variant Parameter to pass
|
||||||
|
local function callIfExistent(functionName, argument)
|
||||||
|
local tokenArranger = guidReferenceApi.getObjectByOwnerAndType("Mythos", "TokenArranger")
|
||||||
|
if tokenArranger ~= nil then
|
||||||
|
tokenArranger.call(functionName, argument)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
-- updates the token modifiers with the provided data
|
||||||
|
---@param tokenData Table Contains the chaos token metadata
|
||||||
|
TokenArrangerApi.onTokenDataChanged = function(fullData)
|
||||||
|
callIfExistent("onTokenDataChanged", fullData)
|
||||||
|
end
|
||||||
|
|
||||||
|
-- deletes already laid out tokens
|
||||||
|
TokenArrangerApi.deleteCopiedTokens = function()
|
||||||
|
callIfExistent("deleteCopiedTokens")
|
||||||
|
end
|
||||||
|
|
||||||
|
-- updates the laid out tokens
|
||||||
|
TokenArrangerApi.layout = function()
|
||||||
|
Wait.time(function() callIfExistent("layout") end, 0.1)
|
||||||
|
end
|
||||||
|
|
||||||
|
return TokenArrangerApi
|
||||||
|
end
|
||||||
|
end)
|
||||||
|
__bundle_register("chaosbag/BlessCurseManagerApi", function(require, _LOADED, __bundle_register, __bundle_modules)
|
||||||
|
do
|
||||||
|
local BlessCurseManagerApi = {}
|
||||||
|
local guidReferenceApi = require("core/GUIDReferenceApi")
|
||||||
|
|
||||||
|
local function getManager()
|
||||||
|
return guidReferenceApi.getObjectByOwnerAndType("Mythos", "BlessCurseManager")
|
||||||
|
end
|
||||||
|
|
||||||
|
-- removes all taken tokens and resets the counts
|
||||||
|
BlessCurseManagerApi.removeTakenTokensAndReset = function()
|
||||||
|
local BlessCurseManager = getManager()
|
||||||
|
Wait.time(function() BlessCurseManager.call("removeTakenTokens", "Bless") end, 0.05)
|
||||||
|
Wait.time(function() BlessCurseManager.call("removeTakenTokens", "Curse") end, 0.10)
|
||||||
|
Wait.time(function() BlessCurseManager.call("doReset", "White") end, 0.15)
|
||||||
|
end
|
||||||
|
|
||||||
|
-- updates the internal count (called by cards that seal bless/curse tokens)
|
||||||
|
BlessCurseManagerApi.sealedToken = function(type, guid)
|
||||||
|
getManager().call("sealedToken", { type = type, guid = guid })
|
||||||
|
end
|
||||||
|
|
||||||
|
-- updates the internal count (called by cards that seal bless/curse tokens)
|
||||||
|
BlessCurseManagerApi.releasedToken = function(type, guid)
|
||||||
|
getManager().call("releasedToken", { type = type, guid = guid })
|
||||||
|
end
|
||||||
|
|
||||||
|
-- broadcasts the current status for bless/curse tokens
|
||||||
|
---@param playerColor String Color of the player to show the broadcast to
|
||||||
|
BlessCurseManagerApi.broadcastStatus = function(playerColor)
|
||||||
|
getManager().call("broadcastStatus", playerColor)
|
||||||
|
end
|
||||||
|
|
||||||
|
-- removes all bless / curse tokens from the chaos bag and play
|
||||||
|
---@param playerColor String Color of the player to show the broadcast to
|
||||||
|
BlessCurseManagerApi.removeAll = function(playerColor)
|
||||||
|
getManager().call("doRemove", playerColor)
|
||||||
|
end
|
||||||
|
|
||||||
|
-- adds Wendy's menu to the hovered card (allows sealing of tokens)
|
||||||
|
---@param color String Color of the player to show the broadcast to
|
||||||
|
BlessCurseManagerApi.addWendysMenu = function(playerColor, hoveredObject)
|
||||||
|
getManager().call("addMenuOptions", { playerColor = playerColor, hoveredObject = hoveredObject })
|
||||||
|
end
|
||||||
|
|
||||||
|
return BlessCurseManagerApi
|
||||||
|
end
|
||||||
|
end)
|
||||||
|
__bundle_register("chaosbag/ChaosBagApi", function(require, _LOADED, __bundle_register, __bundle_modules)
|
||||||
|
do
|
||||||
|
local ChaosBagApi = {}
|
||||||
|
|
||||||
|
-- respawns the chaos bag with a new state of tokens
|
||||||
|
---@param tokenList Table List of chaos token ids
|
||||||
|
ChaosBagApi.setChaosBagState = function(tokenList)
|
||||||
|
return Global.call("setChaosBagState", tokenList)
|
||||||
|
end
|
||||||
|
|
||||||
|
-- returns a Table List of chaos token ids in the current chaos bag
|
||||||
|
-- requires copying the data into a new table because TTS is weird about handling table return values in Global
|
||||||
|
ChaosBagApi.getChaosBagState = function()
|
||||||
|
local chaosBagContentsCatcher = Global.call("getChaosBagState")
|
||||||
|
local chaosBagContents = {}
|
||||||
|
for _, v in ipairs(chaosBagContentsCatcher) do
|
||||||
|
table.insert(chaosBagContents, v)
|
||||||
|
end
|
||||||
|
return chaosBagContents
|
||||||
|
end
|
||||||
|
|
||||||
|
-- checks scripting zone for chaos bag (also called by a lot of objects!)
|
||||||
|
ChaosBagApi.findChaosBag = function()
|
||||||
|
return Global.call("findChaosBag")
|
||||||
|
end
|
||||||
|
|
||||||
|
-- returns a table of object references to the tokens in play (does not include sealed tokens!)
|
||||||
|
ChaosBagApi.getTokensInPlay = function()
|
||||||
|
return Global.getTable("chaosTokens")
|
||||||
|
end
|
||||||
|
|
||||||
|
-- returns all sealed tokens on cards to the chaos bag
|
||||||
|
ChaosBagApi.releaseAllSealedTokens = function(playerColor)
|
||||||
|
return Global.call("releaseAllSealedTokens", playerColor)
|
||||||
|
end
|
||||||
|
|
||||||
|
-- returns all drawn tokens to the chaos bag
|
||||||
|
ChaosBagApi.returnChaosTokens = function(playerColor)
|
||||||
|
return Global.call("returnChaosTokens", playerColor)
|
||||||
|
end
|
||||||
|
|
||||||
|
-- removes the specified chaos token from the chaos bag
|
||||||
|
---@param id String ID of the chaos token
|
||||||
|
ChaosBagApi.removeChaosToken = function(id)
|
||||||
|
return Global.call("removeChaosToken", id)
|
||||||
|
end
|
||||||
|
|
||||||
|
-- spawns the specified chaos token and puts it into the chaos bag
|
||||||
|
---@param id String ID of the chaos token
|
||||||
|
ChaosBagApi.spawnChaosToken = function(id)
|
||||||
|
return Global.call("spawnChaosToken", id)
|
||||||
|
end
|
||||||
|
|
||||||
|
-- Checks to see if the chaos bag can be manipulated. If a player is searching the bag when tokens
|
||||||
|
-- are drawn or replaced a TTS bug can cause those tokens to vanish. Any functions which change the
|
||||||
|
-- contents of the bag should check this method before doing so.
|
||||||
|
-- This method will broadcast a message to all players if the bag is being searched.
|
||||||
|
---@return Boolean. True if the bag is manipulated, false if it should be blocked.
|
||||||
|
ChaosBagApi.canTouchChaosTokens = function()
|
||||||
|
return Global.call("canTouchChaosTokens")
|
||||||
|
end
|
||||||
|
|
||||||
|
-- called by playermats (by the "Draw chaos token" button)
|
||||||
|
ChaosBagApi.drawChaosToken = function(mat, tokenOffset, isRightClick)
|
||||||
|
return Global.call("drawChaosToken", {mat, tokenOffset, isRightClick})
|
||||||
|
end
|
||||||
|
|
||||||
|
-- returns a Table List of chaos token ids in the current chaos bag
|
||||||
|
-- requires copying the data into a new table because TTS is weird about handling table return values in Global
|
||||||
|
ChaosBagApi.getIdUrlMap = function()
|
||||||
|
return Global.getTable("ID_URL_MAP")
|
||||||
|
end
|
||||||
|
|
||||||
|
return ChaosBagApi
|
||||||
|
end
|
||||||
|
end)
|
||||||
|
__bundle_register("core/GUIDReferenceApi", function(require, _LOADED, __bundle_register, __bundle_modules)
|
||||||
|
do
|
||||||
|
local GUIDReferenceApi = {}
|
||||||
|
|
||||||
|
local function getGuidHandler()
|
||||||
|
return getObjectFromGUID("123456")
|
||||||
|
end
|
||||||
|
|
||||||
|
-- returns all matching objects as a table with references
|
||||||
|
---@param owner String Parent object for this search
|
||||||
|
---@param type String Type of object to search for
|
||||||
|
GUIDReferenceApi.getObjectByOwnerAndType = function(owner, type)
|
||||||
|
return getGuidHandler().call("getObjectByOwnerAndType", { owner = owner, type = type })
|
||||||
|
end
|
||||||
|
|
||||||
|
-- returns all matching objects as a table with references
|
||||||
|
---@param type String Type of object to search for
|
||||||
|
GUIDReferenceApi.getObjectsByType = function(type)
|
||||||
|
return getGuidHandler().call("getObjectsByType", type)
|
||||||
|
end
|
||||||
|
|
||||||
|
-- returns all matching objects as a table with references
|
||||||
|
---@param owner String Parent object for this search
|
||||||
|
GUIDReferenceApi.getObjectsByOwner = function(owner)
|
||||||
|
return getGuidHandler().call("getObjectsByOwner", owner)
|
||||||
|
end
|
||||||
|
|
||||||
|
return GUIDReferenceApi
|
||||||
|
end
|
||||||
|
end)
|
||||||
return __bundle_require("__root")
|
return __bundle_require("__root")
|
@ -12,7 +12,7 @@ CustomDeck:
|
|||||||
'3':
|
'3':
|
||||||
BackIsHidden: true
|
BackIsHidden: true
|
||||||
BackURL: https://i.imgur.com/EcbhVuh.jpg/
|
BackURL: https://i.imgur.com/EcbhVuh.jpg/
|
||||||
FaceURL: http://cloud-3.steamusercontent.com/ugc/2021607899142908284/92DF67E4310BCDFAD6C4BB12D31155DBF6B07A25/
|
FaceURL: http://cloud-3.steamusercontent.com/ugc/2115061845812962486/A68B8BF7E4862F21369DAC4A37D813EC664EAC34/
|
||||||
NumHeight: 6
|
NumHeight: 6
|
||||||
NumWidth: 10
|
NumWidth: 10
|
||||||
Type: 0
|
Type: 0
|
||||||
|
@ -12,7 +12,7 @@ CustomDeck:
|
|||||||
'3':
|
'3':
|
||||||
BackIsHidden: true
|
BackIsHidden: true
|
||||||
BackURL: https://i.imgur.com/EcbhVuh.jpg/
|
BackURL: https://i.imgur.com/EcbhVuh.jpg/
|
||||||
FaceURL: http://cloud-3.steamusercontent.com/ugc/2021607899142908284/92DF67E4310BCDFAD6C4BB12D31155DBF6B07A25/
|
FaceURL: http://cloud-3.steamusercontent.com/ugc/2115061845812962486/A68B8BF7E4862F21369DAC4A37D813EC664EAC34/
|
||||||
NumHeight: 6
|
NumHeight: 6
|
||||||
NumWidth: 10
|
NumWidth: 10
|
||||||
Type: 0
|
Type: 0
|
||||||
|
@ -41,6 +41,267 @@ local __bundle_require, __bundle_loaded, __bundle_register, __bundle_modules = (
|
|||||||
|
|
||||||
return require, loaded, register, modules
|
return require, loaded, register, modules
|
||||||
end)(nil)
|
end)(nil)
|
||||||
|
__bundle_register("playermat/PlaymatApi", function(require, _LOADED, __bundle_register, __bundle_modules)
|
||||||
|
do
|
||||||
|
local PlaymatApi = {}
|
||||||
|
local guidReferenceApi = require("core/GUIDReferenceApi")
|
||||||
|
|
||||||
|
-- Convenience function to look up a mat's object by color, or get all mats.
|
||||||
|
---@param matColor String Color of the playmat - White, Orange, Green, Red or All
|
||||||
|
---@return array Table Single-element if only single playmat is requested
|
||||||
|
local function getMatForColor(matColor)
|
||||||
|
if matColor == "All" then
|
||||||
|
return guidReferenceApi.getObjectsByType("Playermat")
|
||||||
|
else
|
||||||
|
return { matColor = guidReferenceApi.getObjectByOwnerAndType(matColor, "Playermat") }
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
-- Returns the color of the closest playmat
|
||||||
|
---@param startPos Table Starting position to get the closest mat from
|
||||||
|
PlaymatApi.getMatColorByPosition = function(startPos)
|
||||||
|
local result, smallestDistance
|
||||||
|
for matColor, mat in pairs(getMatForColor("All")) do
|
||||||
|
local distance = Vector.between(startPos, mat.getPosition()):magnitude()
|
||||||
|
if smallestDistance == nil or distance < smallestDistance then
|
||||||
|
smallestDistance = distance
|
||||||
|
result = matColor
|
||||||
|
end
|
||||||
|
end
|
||||||
|
return result
|
||||||
|
end
|
||||||
|
|
||||||
|
-- Returns the color of the player's hand that is seated next to the playmat
|
||||||
|
---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support "All")
|
||||||
|
PlaymatApi.getPlayerColor = function(matColor)
|
||||||
|
for _, mat in pairs(getMatForColor(matColor)) do
|
||||||
|
return mat.getVar("playerColor")
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
-- Returns the color of the playmat that owns the playercolor's hand
|
||||||
|
---@param handColor String Color of the playmat
|
||||||
|
PlaymatApi.getMatColor = function(handColor)
|
||||||
|
for matColor, mat in pairs(getMatForColor("All")) do
|
||||||
|
local playerColor = mat.getVar("playerColor")
|
||||||
|
if playerColor == handColor then
|
||||||
|
return matColor
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
-- Returns if there is the card "Dream-Enhancing Serum" on the requested playmat
|
||||||
|
---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support "All")
|
||||||
|
PlaymatApi.isDES = function(matColor)
|
||||||
|
for _, mat in pairs(getMatForColor(matColor)) do
|
||||||
|
return mat.getVar("isDES")
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
-- Performs a search of the deck area of the requested playmat and returns the result as table
|
||||||
|
---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support "All")
|
||||||
|
PlaymatApi.getDeckAreaObjects = function(matColor)
|
||||||
|
for _, mat in pairs(getMatForColor(matColor)) do
|
||||||
|
return mat.call("getDeckAreaObjects")
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
-- Flips the top card of the deck (useful after deck manipulation for Norman Withers)
|
||||||
|
---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support "All")
|
||||||
|
PlaymatApi.flipTopCardFromDeck = function(matColor)
|
||||||
|
for _, mat in pairs(getMatForColor(matColor)) do
|
||||||
|
return mat.call("flipTopCardFromDeck")
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
-- Returns the position of the discard pile of the requested playmat
|
||||||
|
---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support "All")
|
||||||
|
PlaymatApi.getDiscardPosition = function(matColor)
|
||||||
|
for _, mat in pairs(getMatForColor(matColor)) do
|
||||||
|
return mat.call("returnGlobalDiscardPosition")
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
-- Transforms a local position into a global position
|
||||||
|
---@param localPos Table Local position to be transformed
|
||||||
|
---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support "All")
|
||||||
|
PlaymatApi.transformLocalPosition = function(localPos, matColor)
|
||||||
|
for _, mat in pairs(getMatForColor(matColor)) do
|
||||||
|
return mat.positionToWorld(localPos)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
-- Returns the rotation of the requested playmat
|
||||||
|
---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support "All")
|
||||||
|
PlaymatApi.returnRotation = function(matColor)
|
||||||
|
for _, mat in pairs(getMatForColor(matColor)) do
|
||||||
|
return mat.getRotation()
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
-- Triggers the Upkeep for the requested playmat
|
||||||
|
---@param matColor String Color of the playmat - White, Orange, Green, Red or All
|
||||||
|
---@param playerColor String Color of the calling player (for messages)
|
||||||
|
PlaymatApi.doUpkeepFromHotkey = function(matColor, playerColor)
|
||||||
|
for _, mat in pairs(getMatForColor(matColor)) do
|
||||||
|
mat.call("doUpkeepFromHotkey", playerColor)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
-- Handles discarding for the requested playmat for the provided list of objects
|
||||||
|
---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support "All")
|
||||||
|
---@param objList Table List of objects to discard
|
||||||
|
PlaymatApi.discardListOfObjects = function(matColor, objList)
|
||||||
|
for _, mat in pairs(getMatForColor(matColor)) do
|
||||||
|
mat.call("discardListOfObjects", objList)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
-- Returns the active investigator id
|
||||||
|
---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support "All")
|
||||||
|
PlaymatApi.returnInvestigatorId = function(matColor)
|
||||||
|
for _, mat in pairs(getMatForColor(matColor)) do
|
||||||
|
return mat.getVar("activeInvestigatorId")
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
-- Sets the requested playmat's snap points to limit snapping to matching card types or not. If
|
||||||
|
-- matchTypes is true, the main card slot snap points will only snap assets, while the
|
||||||
|
-- investigator area point will only snap Investigators. If matchTypes is false, snap points will
|
||||||
|
-- be reset to snap all cards.
|
||||||
|
---@param matchCardTypes Boolean Whether snap points should only snap for the matching card types
|
||||||
|
---@param matColor String Color of the playmat - White, Orange, Green, Red or All
|
||||||
|
PlaymatApi.setLimitSnapsByType = function(matchCardTypes, matColor)
|
||||||
|
for _, mat in pairs(getMatForColor(matColor)) do
|
||||||
|
mat.call("setLimitSnapsByType", matchCardTypes)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
-- Sets the requested playmat's draw 1 button to visible
|
||||||
|
---@param isDrawButtonVisible Boolean Whether the draw 1 button should be visible or not
|
||||||
|
---@param matColor String Color of the playmat - White, Orange, Green, Red or All
|
||||||
|
PlaymatApi.showDrawButton = function(isDrawButtonVisible, matColor)
|
||||||
|
for _, mat in pairs(getMatForColor(matColor)) do
|
||||||
|
mat.call("showDrawButton", isDrawButtonVisible)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
-- Shows or hides the clickable clue counter for the requested playmat
|
||||||
|
---@param showCounter Boolean Whether the clickable counter should be present or not
|
||||||
|
---@param matColor String Color of the playmat - White, Orange, Green, Red or All
|
||||||
|
PlaymatApi.clickableClues = function(showCounter, matColor)
|
||||||
|
for _, mat in pairs(getMatForColor(matColor)) do
|
||||||
|
mat.call("clickableClues", showCounter)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
-- Removes all clues (to the trash for tokens and counters set to 0) for the requested playmat
|
||||||
|
---@param matColor String Color of the playmat - White, Orange, Green, Red or All
|
||||||
|
PlaymatApi.removeClues = function(matColor)
|
||||||
|
for _, mat in pairs(getMatForColor(matColor)) do
|
||||||
|
mat.call("removeClues")
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
-- Reports the clue count for the requested playmat
|
||||||
|
---@param useClickableCounters Boolean Controls which type of counter is getting checked
|
||||||
|
PlaymatApi.getClueCount = function(useClickableCounters, matColor)
|
||||||
|
local count = 0
|
||||||
|
for _, mat in pairs(getMatForColor(matColor)) do
|
||||||
|
count = count + mat.call("getClueCount", useClickableCounters)
|
||||||
|
end
|
||||||
|
return count
|
||||||
|
end
|
||||||
|
|
||||||
|
-- updates the specified owned counter
|
||||||
|
---@param matColor String Color of the playmat - White, Orange, Green, Red or All
|
||||||
|
---@param type String Counter to target
|
||||||
|
---@param newValue Number Value to set the counter to
|
||||||
|
---@param modifier Number If newValue is not provided, the existing value will be adjusted by this modifier
|
||||||
|
PlaymatApi.updateCounter = function(matColor, type, newValue, modifier)
|
||||||
|
for _, mat in pairs(getMatForColor(matColor)) do
|
||||||
|
mat.call("updateCounter", { type = type, newValue = newValue, modifier = modifier })
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
-- returns the resource counter amount
|
||||||
|
---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support "All")
|
||||||
|
---@param type String Counter to target
|
||||||
|
PlaymatApi.getCounterValue = function(matColor, type)
|
||||||
|
for _, mat in pairs(getMatForColor(matColor)) do
|
||||||
|
return mat.call("getCounterValue", type)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
-- resets the specified skill tracker to "1, 1, 1, 1"
|
||||||
|
---@param matColor String Color of the playmat - White, Orange, Green, Red or All
|
||||||
|
PlaymatApi.resetSkillTracker = function(matColor)
|
||||||
|
for _, mat in pairs(getMatForColor(matColor)) do
|
||||||
|
mat.call("resetSkillTracker")
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
-- finds all objects on the playmat and associated set aside zone and returns a table
|
||||||
|
---@param matColor String Color of the playmat - White, Orange, Green, Red or All
|
||||||
|
---@param filter Function Optional filter function (return true for desired objects)
|
||||||
|
PlaymatApi.searchAroundPlaymat = function(matColor, filter)
|
||||||
|
local objList = {}
|
||||||
|
for _, mat in pairs(getMatForColor(matColor)) do
|
||||||
|
for _, obj in ipairs(mat.call("searchAroundSelf", filter)) do
|
||||||
|
table.insert(objList, obj)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
return objList
|
||||||
|
end
|
||||||
|
|
||||||
|
-- Discard a non-hidden card from the corresponding player's hand
|
||||||
|
---@param matColor String Color of the playmat - White, Orange, Green, Red or All
|
||||||
|
PlaymatApi.doDiscardOne = function(matColor)
|
||||||
|
for _, mat in pairs(getMatForColor(matColor)) do
|
||||||
|
mat.call("doDiscardOne")
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
-- Triggers the metadata sync for all playmats
|
||||||
|
PlaymatApi.syncAllCustomizableCards = function()
|
||||||
|
for _, mat in pairs(getMatForColor("All")) do
|
||||||
|
mat.call("syncAllCustomizableCards")
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
return PlaymatApi
|
||||||
|
end
|
||||||
|
end)
|
||||||
|
__bundle_register("core/GUIDReferenceApi", function(require, _LOADED, __bundle_register, __bundle_modules)
|
||||||
|
do
|
||||||
|
local GUIDReferenceApi = {}
|
||||||
|
|
||||||
|
local function getGuidHandler()
|
||||||
|
return getObjectFromGUID("123456")
|
||||||
|
end
|
||||||
|
|
||||||
|
-- returns all matching objects as a table with references
|
||||||
|
---@param owner String Parent object for this search
|
||||||
|
---@param type String Type of object to search for
|
||||||
|
GUIDReferenceApi.getObjectByOwnerAndType = function(owner, type)
|
||||||
|
return getGuidHandler().call("getObjectByOwnerAndType", { owner = owner, type = type })
|
||||||
|
end
|
||||||
|
|
||||||
|
-- returns all matching objects as a table with references
|
||||||
|
---@param type String Type of object to search for
|
||||||
|
GUIDReferenceApi.getObjectsByType = function(type)
|
||||||
|
return getGuidHandler().call("getObjectsByType", type)
|
||||||
|
end
|
||||||
|
|
||||||
|
-- returns all matching objects as a table with references
|
||||||
|
---@param owner String Parent object for this search
|
||||||
|
GUIDReferenceApi.getObjectsByOwner = function(owner)
|
||||||
|
return getGuidHandler().call("getObjectsByOwner", owner)
|
||||||
|
end
|
||||||
|
|
||||||
|
return GUIDReferenceApi
|
||||||
|
end
|
||||||
|
end)
|
||||||
__bundle_register("__root", function(require, _LOADED, __bundle_register, __bundle_modules)
|
__bundle_register("__root", function(require, _LOADED, __bundle_register, __bundle_modules)
|
||||||
require("playercards/customizable/RunicAxeUpgradeSheetTaboo")
|
require("playercards/customizable/RunicAxeUpgradeSheetTaboo")
|
||||||
end)
|
end)
|
||||||
@ -555,231 +816,4 @@ function maybeUpdateServitorSlotDisplay()
|
|||||||
})
|
})
|
||||||
end
|
end
|
||||||
end)
|
end)
|
||||||
__bundle_register("playermat/PlaymatApi", function(require, _LOADED, __bundle_register, __bundle_modules)
|
|
||||||
do
|
|
||||||
local PlaymatApi = { }
|
|
||||||
local internal = { }
|
|
||||||
|
|
||||||
local MAT_IDS = {
|
|
||||||
White = "8b081b",
|
|
||||||
Orange = "bd0ff4",
|
|
||||||
Green = "383d8b",
|
|
||||||
Red = "0840d5"
|
|
||||||
}
|
|
||||||
|
|
||||||
local CLUE_COUNTER_GUIDS = {
|
|
||||||
White = "37be78",
|
|
||||||
Orange = "1769ed",
|
|
||||||
Green = "032300",
|
|
||||||
Red = "d86b7c"
|
|
||||||
}
|
|
||||||
|
|
||||||
local CLUE_CLICKER_GUIDS = {
|
|
||||||
White = "db85d6",
|
|
||||||
Orange = "3f22e5",
|
|
||||||
Green = "891403",
|
|
||||||
Red = "4111de"
|
|
||||||
}
|
|
||||||
|
|
||||||
-- Returns the color of the by position requested playermat as string
|
|
||||||
---@param startPos Table Position of the search, table get's roughly cut into 4 quarters to assign a playermat
|
|
||||||
PlaymatApi.getMatColorByPosition = function(startPos)
|
|
||||||
if startPos.x < -42 then
|
|
||||||
if startPos.z > 0 then
|
|
||||||
return "White"
|
|
||||||
else
|
|
||||||
return "Orange"
|
|
||||||
end
|
|
||||||
else
|
|
||||||
if startPos.z > 0 then
|
|
||||||
return "Green"
|
|
||||||
else
|
|
||||||
return "Red"
|
|
||||||
end
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
-- Returns the color of the player's hand that is seated next to the playermat
|
|
||||||
---@param matColor String Color of the playermat
|
|
||||||
PlaymatApi.getPlayerColor = function(matColor)
|
|
||||||
local mat = getObjectFromGUID(MAT_IDS[matColor])
|
|
||||||
return mat.getVar("playerColor")
|
|
||||||
end
|
|
||||||
|
|
||||||
-- Returns the color of the playermat that owns the playercolor's hand
|
|
||||||
---@param handColor String Color of the playermat
|
|
||||||
PlaymatApi.getMatColor = function(handColor)
|
|
||||||
local matColors = {"White", "Orange", "Green", "Red"}
|
|
||||||
for i, mat in ipairs(internal.getMatForColor("All")) do
|
|
||||||
local color = mat.getVar("playerColor")
|
|
||||||
if color == handColor then return matColors[i] end
|
|
||||||
end
|
|
||||||
return "NOT_FOUND"
|
|
||||||
end
|
|
||||||
|
|
||||||
-- Returns the result of a cast in the specificed playermat's area
|
|
||||||
---@param matColor String Color of the playermat
|
|
||||||
PlaymatApi.searchPlaymat = function(matColor)
|
|
||||||
local mat = getObjectFromGUID(MAT_IDS[matColor])
|
|
||||||
return mat.call("searchAroundSelf")
|
|
||||||
end
|
|
||||||
|
|
||||||
-- Returns if there is the card "Dream-Enhancing Serum" on the requested playermat
|
|
||||||
---@param matColor String Color of the playermat
|
|
||||||
PlaymatApi.isDES = function(matColor)
|
|
||||||
local mat = getObjectFromGUID(MAT_IDS[matColor])
|
|
||||||
return mat.getVar("isDES")
|
|
||||||
end
|
|
||||||
|
|
||||||
-- Returns the draw deck of the requested playmat
|
|
||||||
---@param matColor String Color of the playermat
|
|
||||||
PlaymatApi.getDrawDeck = function(matColor)
|
|
||||||
local mat = getObjectFromGUID(MAT_IDS[matColor])
|
|
||||||
mat.call("getDrawDiscardDecks")
|
|
||||||
return mat.getVar("drawDeck")
|
|
||||||
end
|
|
||||||
|
|
||||||
-- Returns the position of the discard pile of the requested playmat
|
|
||||||
---@param matColor String Color of the playermat
|
|
||||||
PlaymatApi.getDiscardPosition = function(matColor)
|
|
||||||
local mat = getObjectFromGUID(MAT_IDS[matColor])
|
|
||||||
return mat.call("returnGlobalDiscardPosition")
|
|
||||||
end
|
|
||||||
|
|
||||||
-- Transforms a local position into a global position
|
|
||||||
---@param localPos Table Local position to be transformed
|
|
||||||
---@param matColor String Color of the playermat
|
|
||||||
PlaymatApi.transformLocalPosition = function(localPos, matColor)
|
|
||||||
local mat = getObjectFromGUID(MAT_IDS[matColor])
|
|
||||||
return mat.positionToWorld(localPos)
|
|
||||||
end
|
|
||||||
|
|
||||||
-- Returns the rotation of the requested playmat
|
|
||||||
---@param matColor String Color of the playermat
|
|
||||||
PlaymatApi.returnRotation = function(matColor)
|
|
||||||
local mat = getObjectFromGUID(MAT_IDS[matColor])
|
|
||||||
return mat.getRotation()
|
|
||||||
end
|
|
||||||
|
|
||||||
-- Triggers the Upkeep for the requested playmat
|
|
||||||
---@param matColor String Color of the playermat
|
|
||||||
---@param playerColor String Color of the calling player (for messages)
|
|
||||||
PlaymatApi.doUpkeepFromHotkey = function(matColor, playerColor)
|
|
||||||
local mat = getObjectFromGUID(MAT_IDS[matColor])
|
|
||||||
return mat.call("doUpkeepFromHotkey", playerColor)
|
|
||||||
end
|
|
||||||
|
|
||||||
-- Returns the active investigator id
|
|
||||||
---@param matColor String Color of the playermat
|
|
||||||
PlaymatApi.returnInvestigatorId = function(matColor)
|
|
||||||
local mat = getObjectFromGUID(MAT_IDS[matColor])
|
|
||||||
return mat.getVar("activeInvestigatorId")
|
|
||||||
end
|
|
||||||
|
|
||||||
-- Sets the requested playermat's snap points to limit snapping to matching card types or not. If
|
|
||||||
-- matchTypes is true, the main card slot snap points will only snap assets, while the
|
|
||||||
-- investigator area point will only snap Investigators. If matchTypes is false, snap points will
|
|
||||||
-- be reset to snap all cards.
|
|
||||||
---@param matchCardTypes Boolean. Whether snap points should only snap for the matching card
|
|
||||||
-- types.
|
|
||||||
---@param matColor String for one of the active player colors - White, Orange, Green, Red. Also
|
|
||||||
-- accepts "All" as a special value which will apply the setting to all four mats.
|
|
||||||
PlaymatApi.setLimitSnapsByType = function(matchCardTypes, matColor)
|
|
||||||
for _, mat in ipairs(internal.getMatForColor(matColor)) do
|
|
||||||
mat.call("setLimitSnapsByType", matchCardTypes)
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
-- Sets the requested playermat's draw 1 button to visible
|
|
||||||
---@param isDrawButtonVisible Boolean. Whether the draw 1 button should be visible or not
|
|
||||||
---@param matColor String for one of the active player colors - White, Orange, Green, Red. Also
|
|
||||||
-- accepts "All" as a special value which will apply the setting to all four mats.
|
|
||||||
PlaymatApi.showDrawButton = function(isDrawButtonVisible, matColor)
|
|
||||||
for _, mat in ipairs(internal.getMatForColor(matColor)) do
|
|
||||||
mat.call("showDrawButton", isDrawButtonVisible)
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
-- Shows or hides the clickable clue counter for the requested playermat
|
|
||||||
---@param showCounter Boolean. Whether the clickable counter should be present or not
|
|
||||||
---@param matColor String for one of the active player colors - White, Orange, Green, Red. Also
|
|
||||||
-- accepts "All" as a special value which will apply the setting to all four mats.
|
|
||||||
PlaymatApi.clickableClues = function(showCounter, matColor)
|
|
||||||
for _, mat in ipairs(internal.getMatForColor(matColor)) do
|
|
||||||
mat.call("clickableClues", showCounter)
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
-- Removes all clues (to the trash for tokens and counters set to 0) for the requested playermat
|
|
||||||
---@param matColor String for one of the active player colors - White, Orange, Green, Red. Also
|
|
||||||
-- accepts "All" as a special value which will apply the setting to all four mats.
|
|
||||||
PlaymatApi.removeClues = function(matColor)
|
|
||||||
for _, mat in ipairs(internal.getMatForColor(matColor)) do
|
|
||||||
mat.call("removeClues")
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
-- Reports the clue count for the requested playermat
|
|
||||||
---@param useClickableCounters Boolean Controls which type of counter is getting checked
|
|
||||||
PlaymatApi.getClueCount = function(useClickableCounters, matColor)
|
|
||||||
local count = 0
|
|
||||||
for _, mat in ipairs(internal.getMatForColor(matColor)) do
|
|
||||||
count = count + tonumber(mat.call("getClueCount", useClickableCounters))
|
|
||||||
end
|
|
||||||
return count
|
|
||||||
end
|
|
||||||
|
|
||||||
-- Adds the specified amount of resources to the requested playermat's resource counter
|
|
||||||
PlaymatApi.gainResources = function(amount, matColor)
|
|
||||||
for _, mat in ipairs(internal.getMatForColor(matColor)) do
|
|
||||||
mat.call("gainResources", amount)
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
-- Returns the resource counter amount for the requested playermat
|
|
||||||
PlaymatApi.getResourceCount = function(matColor)
|
|
||||||
local mat = getObjectFromGUID(MAT_IDS[matColor])
|
|
||||||
return mat.call("getResourceCount")
|
|
||||||
end
|
|
||||||
|
|
||||||
-- Discard a non-hidden card from the corresponding player's hand
|
|
||||||
PlaymatApi.doDiscardOne = function(matColor)
|
|
||||||
for _, mat in ipairs(internal.getMatForColor(matColor)) do
|
|
||||||
mat.call("doDiscardOne")
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
PlaymatApi.syncAllCustomizableCards = function()
|
|
||||||
for _, mat in ipairs(internal.getMatForColor("All")) do
|
|
||||||
mat.call("syncAllCustomizableCards")
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
PlaymatApi.updateClueClicker = function(playerColor, val)
|
|
||||||
return getObjectFromGUID(CLUE_CLICKER_GUIDS[playerColor]).call("updateVal", val)
|
|
||||||
end
|
|
||||||
|
|
||||||
-- Convenience function to look up a mat's object by color, or get all mats.
|
|
||||||
---@param matColor String for one of the active player colors - White, Orange, Green, Red. Also
|
|
||||||
-- accepts "All" as a special value which will return all four mats.
|
|
||||||
---@return: Array of playermat objects. If a single mat is requested, will return a single-element
|
|
||||||
-- array to simplify processing by consumers.
|
|
||||||
internal.getMatForColor = function(matColor)
|
|
||||||
local targetMatGuid = MAT_IDS[matColor]
|
|
||||||
if targetMatGuid != nil then
|
|
||||||
return { getObjectFromGUID(targetMatGuid) }
|
|
||||||
end
|
|
||||||
if matColor == "All" then
|
|
||||||
return {
|
|
||||||
getObjectFromGUID(MAT_IDS.White),
|
|
||||||
getObjectFromGUID(MAT_IDS.Orange),
|
|
||||||
getObjectFromGUID(MAT_IDS.Green),
|
|
||||||
getObjectFromGUID(MAT_IDS.Red),
|
|
||||||
}
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
return PlaymatApi
|
|
||||||
end
|
|
||||||
end)
|
|
||||||
return __bundle_require("__root")
|
return __bundle_require("__root")
|
@ -0,0 +1,436 @@
|
|||||||
|
-- Bundled by luabundle {"version":"1.6.0"}
|
||||||
|
local __bundle_require, __bundle_loaded, __bundle_register, __bundle_modules = (function(superRequire)
|
||||||
|
local loadingPlaceholder = {[{}] = true}
|
||||||
|
|
||||||
|
local register
|
||||||
|
local modules = {}
|
||||||
|
|
||||||
|
local require
|
||||||
|
local loaded = {}
|
||||||
|
|
||||||
|
register = function(name, body)
|
||||||
|
if not modules[name] then
|
||||||
|
modules[name] = body
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
require = function(name)
|
||||||
|
local loadedModule = loaded[name]
|
||||||
|
|
||||||
|
if loadedModule then
|
||||||
|
if loadedModule == loadingPlaceholder then
|
||||||
|
return nil
|
||||||
|
end
|
||||||
|
else
|
||||||
|
if not modules[name] then
|
||||||
|
if not superRequire then
|
||||||
|
local identifier = type(name) == 'string' and '\"' .. name .. '\"' or tostring(name)
|
||||||
|
error('Tried to require ' .. identifier .. ', but no such module has been registered')
|
||||||
|
else
|
||||||
|
return superRequire(name)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
loaded[name] = loadingPlaceholder
|
||||||
|
loadedModule = modules[name](require, loaded, register, modules)
|
||||||
|
loaded[name] = loadedModule
|
||||||
|
end
|
||||||
|
|
||||||
|
return loadedModule
|
||||||
|
end
|
||||||
|
|
||||||
|
return require, loaded, register, modules
|
||||||
|
end)(nil)
|
||||||
|
__bundle_register("playercards/cards/ScrollofSecrets", function(require, _LOADED, __bundle_register, __bundle_modules)
|
||||||
|
-- this script is shared between the lvl 0 and lvl 3 versions of Scroll of Secrets
|
||||||
|
local mythosAreaApi = require("core/MythosAreaApi")
|
||||||
|
local playmatApi = require("playermat/PlaymatApi")
|
||||||
|
|
||||||
|
-- get class via metadata and create context menu accordingly
|
||||||
|
function onLoad()
|
||||||
|
local notes = JSON.decode(self.getGMNotes())
|
||||||
|
if notes then
|
||||||
|
createContextMenu(notes.id)
|
||||||
|
else
|
||||||
|
print("Missing metadata for Scroll of Secrets!")
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
function createContextMenu(id)
|
||||||
|
if id == "05116" or id == "05116-t" then
|
||||||
|
-- lvl 0: draw 1 card from the bottom
|
||||||
|
self.addContextMenuItem("Draw bottom card", function(playerColor) contextFunc(playerColor, 1) end)
|
||||||
|
elseif id == "05188" or id == "05188-t" then
|
||||||
|
-- seeker lvl 3: draw 3 cards from the bottom
|
||||||
|
self.addContextMenuItem("Draw bottom card(s)", function(playerColor) contextFunc(playerColor, 3) end)
|
||||||
|
elseif id == "05189" or id == "05189-t" then
|
||||||
|
-- mystic lvl 3: draw 1 card from the bottom
|
||||||
|
self.addContextMenuItem("Draw bottom card", function(playerColor) contextFunc(playerColor, 1) end)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
function contextFunc(playerColor, amount)
|
||||||
|
local options = { "Encounter Deck" }
|
||||||
|
|
||||||
|
-- check for players with a deck and only display them as option
|
||||||
|
for _, color in ipairs(Player.getAvailableColors()) do
|
||||||
|
local matColor = playmatApi.getMatColor(color)
|
||||||
|
local deckAreaObjects = playmatApi.getDeckAreaObjects(matColor)
|
||||||
|
|
||||||
|
if deckAreaObjects.draw or deckAreaObjects.topCard then
|
||||||
|
table.insert(options, color)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
-- show the target selection dialog
|
||||||
|
Player[playerColor].showOptionsDialog("Select target deck", options, _, function(owner) drawCardsFromBottom(playerColor, owner, amount) end)
|
||||||
|
end
|
||||||
|
|
||||||
|
function drawCardsFromBottom(playerColor, owner, amount)
|
||||||
|
-- variable initialization
|
||||||
|
local deck = nil
|
||||||
|
local deckSize = 1
|
||||||
|
local deckAreaObjects = {}
|
||||||
|
|
||||||
|
-- get the respective deck
|
||||||
|
if owner == "Encounter Deck" then
|
||||||
|
deck = mythosAreaApi.getEncounterDeck()
|
||||||
|
else
|
||||||
|
local matColor = playmatApi.getMatColor(owner)
|
||||||
|
deckAreaObjects = playmatApi.getDeckAreaObjects(matColor)
|
||||||
|
deck = deckAreaObjects.draw
|
||||||
|
end
|
||||||
|
|
||||||
|
-- error handling
|
||||||
|
if not deck then
|
||||||
|
printToColor("Couldn't find deck!", playerColor)
|
||||||
|
return
|
||||||
|
end
|
||||||
|
|
||||||
|
-- set deck size if there is actually a deck and not just a card
|
||||||
|
if deck.type == "Deck" then
|
||||||
|
deckSize = #deck.getObjects()
|
||||||
|
end
|
||||||
|
|
||||||
|
-- proceed according to deck size
|
||||||
|
if deckSize > amount then
|
||||||
|
for i = 1, amount do
|
||||||
|
local card = deck.takeObject({ top = false, flip = true })
|
||||||
|
card.deal(1, playerColor)
|
||||||
|
end
|
||||||
|
else
|
||||||
|
-- deal the whole deck
|
||||||
|
deck.deal(amount, playerColor)
|
||||||
|
|
||||||
|
if deckSize < amount then
|
||||||
|
-- Norman Withers handling
|
||||||
|
if deckAreaObjects.topCard then
|
||||||
|
deckAreaObjects.topCard.deal(1, playerColor)
|
||||||
|
deckSize = deckSize + 1
|
||||||
|
end
|
||||||
|
|
||||||
|
-- warning message for player
|
||||||
|
if deckSize < amount then
|
||||||
|
printToColor("Deck didn't contain enough cards.", playerColor)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
printToColor("Handle the drawn cards according to the ability text on 'Scroll of Secrets'.", playerColor)
|
||||||
|
end
|
||||||
|
end)
|
||||||
|
__bundle_register("core/MythosAreaApi", function(require, _LOADED, __bundle_register, __bundle_modules)
|
||||||
|
do
|
||||||
|
local MythosAreaApi = {}
|
||||||
|
local guidReferenceApi = require("core/GUIDReferenceApi")
|
||||||
|
|
||||||
|
local function getMythosArea()
|
||||||
|
return guidReferenceApi.getObjectByOwnerAndType("Mythos", "MythosArea")
|
||||||
|
end
|
||||||
|
|
||||||
|
-- returns the chaos token metadata (if provided through scenario reference card)
|
||||||
|
MythosAreaApi.returnTokenData = function()
|
||||||
|
return getMythosArea().call("returnTokenData")
|
||||||
|
end
|
||||||
|
|
||||||
|
-- returns an object reference to the encounter deck
|
||||||
|
MythosAreaApi.getEncounterDeck = function()
|
||||||
|
return getMythosArea().call("getEncounterDeck")
|
||||||
|
end
|
||||||
|
|
||||||
|
-- draw an encounter card to the requested position/rotation
|
||||||
|
MythosAreaApi.drawEncounterCard = function(pos, rotY, alwaysFaceUp)
|
||||||
|
getMythosArea().call("drawEncounterCard", {
|
||||||
|
pos = pos,
|
||||||
|
rotY = rotY,
|
||||||
|
alwaysFaceUp = alwaysFaceUp
|
||||||
|
})
|
||||||
|
end
|
||||||
|
|
||||||
|
return MythosAreaApi
|
||||||
|
end
|
||||||
|
end)
|
||||||
|
__bundle_register("playermat/PlaymatApi", function(require, _LOADED, __bundle_register, __bundle_modules)
|
||||||
|
do
|
||||||
|
local PlaymatApi = {}
|
||||||
|
local guidReferenceApi = require("core/GUIDReferenceApi")
|
||||||
|
|
||||||
|
-- Convenience function to look up a mat's object by color, or get all mats.
|
||||||
|
---@param matColor String Color of the playmat - White, Orange, Green, Red or All
|
||||||
|
---@return array Table Single-element if only single playmat is requested
|
||||||
|
local function getMatForColor(matColor)
|
||||||
|
if matColor == "All" then
|
||||||
|
return guidReferenceApi.getObjectsByType("Playermat")
|
||||||
|
else
|
||||||
|
return { matColor = guidReferenceApi.getObjectByOwnerAndType(matColor, "Playermat") }
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
-- Returns the color of the closest playmat
|
||||||
|
---@param startPos Table Starting position to get the closest mat from
|
||||||
|
PlaymatApi.getMatColorByPosition = function(startPos)
|
||||||
|
local result, smallestDistance
|
||||||
|
for matColor, mat in pairs(getMatForColor("All")) do
|
||||||
|
local distance = Vector.between(startPos, mat.getPosition()):magnitude()
|
||||||
|
if smallestDistance == nil or distance < smallestDistance then
|
||||||
|
smallestDistance = distance
|
||||||
|
result = matColor
|
||||||
|
end
|
||||||
|
end
|
||||||
|
return result
|
||||||
|
end
|
||||||
|
|
||||||
|
-- Returns the color of the player's hand that is seated next to the playmat
|
||||||
|
---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support "All")
|
||||||
|
PlaymatApi.getPlayerColor = function(matColor)
|
||||||
|
for _, mat in pairs(getMatForColor(matColor)) do
|
||||||
|
return mat.getVar("playerColor")
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
-- Returns the color of the playmat that owns the playercolor's hand
|
||||||
|
---@param handColor String Color of the playmat
|
||||||
|
PlaymatApi.getMatColor = function(handColor)
|
||||||
|
for matColor, mat in pairs(getMatForColor("All")) do
|
||||||
|
local playerColor = mat.getVar("playerColor")
|
||||||
|
if playerColor == handColor then
|
||||||
|
return matColor
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
-- Returns if there is the card "Dream-Enhancing Serum" on the requested playmat
|
||||||
|
---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support "All")
|
||||||
|
PlaymatApi.isDES = function(matColor)
|
||||||
|
for _, mat in pairs(getMatForColor(matColor)) do
|
||||||
|
return mat.getVar("isDES")
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
-- Performs a search of the deck area of the requested playmat and returns the result as table
|
||||||
|
---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support "All")
|
||||||
|
PlaymatApi.getDeckAreaObjects = function(matColor)
|
||||||
|
for _, mat in pairs(getMatForColor(matColor)) do
|
||||||
|
return mat.call("getDeckAreaObjects")
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
-- Flips the top card of the deck (useful after deck manipulation for Norman Withers)
|
||||||
|
---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support "All")
|
||||||
|
PlaymatApi.flipTopCardFromDeck = function(matColor)
|
||||||
|
for _, mat in pairs(getMatForColor(matColor)) do
|
||||||
|
return mat.call("flipTopCardFromDeck")
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
-- Returns the position of the discard pile of the requested playmat
|
||||||
|
---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support "All")
|
||||||
|
PlaymatApi.getDiscardPosition = function(matColor)
|
||||||
|
for _, mat in pairs(getMatForColor(matColor)) do
|
||||||
|
return mat.call("returnGlobalDiscardPosition")
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
-- Transforms a local position into a global position
|
||||||
|
---@param localPos Table Local position to be transformed
|
||||||
|
---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support "All")
|
||||||
|
PlaymatApi.transformLocalPosition = function(localPos, matColor)
|
||||||
|
for _, mat in pairs(getMatForColor(matColor)) do
|
||||||
|
return mat.positionToWorld(localPos)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
-- Returns the rotation of the requested playmat
|
||||||
|
---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support "All")
|
||||||
|
PlaymatApi.returnRotation = function(matColor)
|
||||||
|
for _, mat in pairs(getMatForColor(matColor)) do
|
||||||
|
return mat.getRotation()
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
-- Triggers the Upkeep for the requested playmat
|
||||||
|
---@param matColor String Color of the playmat - White, Orange, Green, Red or All
|
||||||
|
---@param playerColor String Color of the calling player (for messages)
|
||||||
|
PlaymatApi.doUpkeepFromHotkey = function(matColor, playerColor)
|
||||||
|
for _, mat in pairs(getMatForColor(matColor)) do
|
||||||
|
mat.call("doUpkeepFromHotkey", playerColor)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
-- Handles discarding for the requested playmat for the provided list of objects
|
||||||
|
---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support "All")
|
||||||
|
---@param objList Table List of objects to discard
|
||||||
|
PlaymatApi.discardListOfObjects = function(matColor, objList)
|
||||||
|
for _, mat in pairs(getMatForColor(matColor)) do
|
||||||
|
mat.call("discardListOfObjects", objList)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
-- Returns the active investigator id
|
||||||
|
---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support "All")
|
||||||
|
PlaymatApi.returnInvestigatorId = function(matColor)
|
||||||
|
for _, mat in pairs(getMatForColor(matColor)) do
|
||||||
|
return mat.getVar("activeInvestigatorId")
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
-- Sets the requested playmat's snap points to limit snapping to matching card types or not. If
|
||||||
|
-- matchTypes is true, the main card slot snap points will only snap assets, while the
|
||||||
|
-- investigator area point will only snap Investigators. If matchTypes is false, snap points will
|
||||||
|
-- be reset to snap all cards.
|
||||||
|
---@param matchCardTypes Boolean Whether snap points should only snap for the matching card types
|
||||||
|
---@param matColor String Color of the playmat - White, Orange, Green, Red or All
|
||||||
|
PlaymatApi.setLimitSnapsByType = function(matchCardTypes, matColor)
|
||||||
|
for _, mat in pairs(getMatForColor(matColor)) do
|
||||||
|
mat.call("setLimitSnapsByType", matchCardTypes)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
-- Sets the requested playmat's draw 1 button to visible
|
||||||
|
---@param isDrawButtonVisible Boolean Whether the draw 1 button should be visible or not
|
||||||
|
---@param matColor String Color of the playmat - White, Orange, Green, Red or All
|
||||||
|
PlaymatApi.showDrawButton = function(isDrawButtonVisible, matColor)
|
||||||
|
for _, mat in pairs(getMatForColor(matColor)) do
|
||||||
|
mat.call("showDrawButton", isDrawButtonVisible)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
-- Shows or hides the clickable clue counter for the requested playmat
|
||||||
|
---@param showCounter Boolean Whether the clickable counter should be present or not
|
||||||
|
---@param matColor String Color of the playmat - White, Orange, Green, Red or All
|
||||||
|
PlaymatApi.clickableClues = function(showCounter, matColor)
|
||||||
|
for _, mat in pairs(getMatForColor(matColor)) do
|
||||||
|
mat.call("clickableClues", showCounter)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
-- Removes all clues (to the trash for tokens and counters set to 0) for the requested playmat
|
||||||
|
---@param matColor String Color of the playmat - White, Orange, Green, Red or All
|
||||||
|
PlaymatApi.removeClues = function(matColor)
|
||||||
|
for _, mat in pairs(getMatForColor(matColor)) do
|
||||||
|
mat.call("removeClues")
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
-- Reports the clue count for the requested playmat
|
||||||
|
---@param useClickableCounters Boolean Controls which type of counter is getting checked
|
||||||
|
PlaymatApi.getClueCount = function(useClickableCounters, matColor)
|
||||||
|
local count = 0
|
||||||
|
for _, mat in pairs(getMatForColor(matColor)) do
|
||||||
|
count = count + mat.call("getClueCount", useClickableCounters)
|
||||||
|
end
|
||||||
|
return count
|
||||||
|
end
|
||||||
|
|
||||||
|
-- updates the specified owned counter
|
||||||
|
---@param matColor String Color of the playmat - White, Orange, Green, Red or All
|
||||||
|
---@param type String Counter to target
|
||||||
|
---@param newValue Number Value to set the counter to
|
||||||
|
---@param modifier Number If newValue is not provided, the existing value will be adjusted by this modifier
|
||||||
|
PlaymatApi.updateCounter = function(matColor, type, newValue, modifier)
|
||||||
|
for _, mat in pairs(getMatForColor(matColor)) do
|
||||||
|
mat.call("updateCounter", { type = type, newValue = newValue, modifier = modifier })
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
-- returns the resource counter amount
|
||||||
|
---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support "All")
|
||||||
|
---@param type String Counter to target
|
||||||
|
PlaymatApi.getCounterValue = function(matColor, type)
|
||||||
|
for _, mat in pairs(getMatForColor(matColor)) do
|
||||||
|
return mat.call("getCounterValue", type)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
-- resets the specified skill tracker to "1, 1, 1, 1"
|
||||||
|
---@param matColor String Color of the playmat - White, Orange, Green, Red or All
|
||||||
|
PlaymatApi.resetSkillTracker = function(matColor)
|
||||||
|
for _, mat in pairs(getMatForColor(matColor)) do
|
||||||
|
mat.call("resetSkillTracker")
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
-- finds all objects on the playmat and associated set aside zone and returns a table
|
||||||
|
---@param matColor String Color of the playmat - White, Orange, Green, Red or All
|
||||||
|
---@param filter Function Optional filter function (return true for desired objects)
|
||||||
|
PlaymatApi.searchAroundPlaymat = function(matColor, filter)
|
||||||
|
local objList = {}
|
||||||
|
for _, mat in pairs(getMatForColor(matColor)) do
|
||||||
|
for _, obj in ipairs(mat.call("searchAroundSelf", filter)) do
|
||||||
|
table.insert(objList, obj)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
return objList
|
||||||
|
end
|
||||||
|
|
||||||
|
-- Discard a non-hidden card from the corresponding player's hand
|
||||||
|
---@param matColor String Color of the playmat - White, Orange, Green, Red or All
|
||||||
|
PlaymatApi.doDiscardOne = function(matColor)
|
||||||
|
for _, mat in pairs(getMatForColor(matColor)) do
|
||||||
|
mat.call("doDiscardOne")
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
-- Triggers the metadata sync for all playmats
|
||||||
|
PlaymatApi.syncAllCustomizableCards = function()
|
||||||
|
for _, mat in pairs(getMatForColor("All")) do
|
||||||
|
mat.call("syncAllCustomizableCards")
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
return PlaymatApi
|
||||||
|
end
|
||||||
|
end)
|
||||||
|
__bundle_register("core/GUIDReferenceApi", function(require, _LOADED, __bundle_register, __bundle_modules)
|
||||||
|
do
|
||||||
|
local GUIDReferenceApi = {}
|
||||||
|
|
||||||
|
local function getGuidHandler()
|
||||||
|
return getObjectFromGUID("123456")
|
||||||
|
end
|
||||||
|
|
||||||
|
-- returns all matching objects as a table with references
|
||||||
|
---@param owner String Parent object for this search
|
||||||
|
---@param type String Type of object to search for
|
||||||
|
GUIDReferenceApi.getObjectByOwnerAndType = function(owner, type)
|
||||||
|
return getGuidHandler().call("getObjectByOwnerAndType", { owner = owner, type = type })
|
||||||
|
end
|
||||||
|
|
||||||
|
-- returns all matching objects as a table with references
|
||||||
|
---@param type String Type of object to search for
|
||||||
|
GUIDReferenceApi.getObjectsByType = function(type)
|
||||||
|
return getGuidHandler().call("getObjectsByType", type)
|
||||||
|
end
|
||||||
|
|
||||||
|
-- returns all matching objects as a table with references
|
||||||
|
---@param owner String Parent object for this search
|
||||||
|
GUIDReferenceApi.getObjectsByOwner = function(owner)
|
||||||
|
return getGuidHandler().call("getObjectsByOwner", owner)
|
||||||
|
end
|
||||||
|
|
||||||
|
return GUIDReferenceApi
|
||||||
|
end
|
||||||
|
end)
|
||||||
|
__bundle_register("__root", function(require, _LOADED, __bundle_register, __bundle_modules)
|
||||||
|
require("playercards/cards/ScrollofSecrets")
|
||||||
|
end)
|
||||||
|
return __bundle_require("__root")
|
@ -12,18 +12,17 @@ CustomDeck:
|
|||||||
'3':
|
'3':
|
||||||
BackIsHidden: true
|
BackIsHidden: true
|
||||||
BackURL: https://i.imgur.com/EcbhVuh.jpg/
|
BackURL: https://i.imgur.com/EcbhVuh.jpg/
|
||||||
FaceURL: http://cloud-3.steamusercontent.com/ugc/2021607899142908284/92DF67E4310BCDFAD6C4BB12D31155DBF6B07A25/
|
FaceURL: http://cloud-3.steamusercontent.com/ugc/2115061845812962486/A68B8BF7E4862F21369DAC4A37D813EC664EAC34/
|
||||||
NumHeight: 6
|
NumHeight: 6
|
||||||
NumWidth: 10
|
NumWidth: 10
|
||||||
Type: 0
|
Type: 0
|
||||||
UniqueBack: false
|
UniqueBack: false
|
||||||
Description: ''
|
Description: ''
|
||||||
DragSelectable: true
|
DragSelectable: true
|
||||||
GMNotes: "{\n \"id\": \"05189-t\",\n \"type\": \"Asset\",\n \"class\": \"Mystic\",\n
|
GMNotes: "{\n \"id\": \"05188-t\",\n \"type\": \"Asset\",\n \"class\": \"Seeker\",\n
|
||||||
\ \"cost\": 1,\n \"level\": 3,\n \"traits\": \"Item. Tome.\",\n \"willpowerIcons\":
|
\ \"cost\": 1,\n \"level\": 3,\n \"traits\": \"Item. Tome.\",\n \"intellectIcons\":
|
||||||
1,\n \"intellectIcons\": 1,\n \"uses\": [\n {\n \"count\": 4,\n \"type\":
|
2,\n \"uses\": [\n {\n \"count\": 3,\n \"type\": \"Secret\",\n \"token\":
|
||||||
\"Secret\",\n \"token\": \"resource\"\n }\n ],\n \"cycle\": \"The Circle
|
\"resource\"\n }\n ],\n \"cycle\": \"The Circle Undone\"\n}"
|
||||||
Undone\"\n}"
|
|
||||||
GUID: 84a7df
|
GUID: 84a7df
|
||||||
Grid: true
|
Grid: true
|
||||||
GridProjection: false
|
GridProjection: false
|
||||||
@ -32,7 +31,7 @@ HideWhenFaceDown: true
|
|||||||
IgnoreFoW: false
|
IgnoreFoW: false
|
||||||
LayoutGroupSortIndex: 0
|
LayoutGroupSortIndex: 0
|
||||||
Locked: false
|
Locked: false
|
||||||
LuaScript: ''
|
LuaScript: !include 'Card Scroll of Secrets (3) (Taboo) 84a7df.ttslua'
|
||||||
LuaScriptState: ''
|
LuaScriptState: ''
|
||||||
MeasureMovement: false
|
MeasureMovement: false
|
||||||
Name: Card
|
Name: Card
|
||||||
|
@ -0,0 +1,436 @@
|
|||||||
|
-- Bundled by luabundle {"version":"1.6.0"}
|
||||||
|
local __bundle_require, __bundle_loaded, __bundle_register, __bundle_modules = (function(superRequire)
|
||||||
|
local loadingPlaceholder = {[{}] = true}
|
||||||
|
|
||||||
|
local register
|
||||||
|
local modules = {}
|
||||||
|
|
||||||
|
local require
|
||||||
|
local loaded = {}
|
||||||
|
|
||||||
|
register = function(name, body)
|
||||||
|
if not modules[name] then
|
||||||
|
modules[name] = body
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
require = function(name)
|
||||||
|
local loadedModule = loaded[name]
|
||||||
|
|
||||||
|
if loadedModule then
|
||||||
|
if loadedModule == loadingPlaceholder then
|
||||||
|
return nil
|
||||||
|
end
|
||||||
|
else
|
||||||
|
if not modules[name] then
|
||||||
|
if not superRequire then
|
||||||
|
local identifier = type(name) == 'string' and '\"' .. name .. '\"' or tostring(name)
|
||||||
|
error('Tried to require ' .. identifier .. ', but no such module has been registered')
|
||||||
|
else
|
||||||
|
return superRequire(name)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
loaded[name] = loadingPlaceholder
|
||||||
|
loadedModule = modules[name](require, loaded, register, modules)
|
||||||
|
loaded[name] = loadedModule
|
||||||
|
end
|
||||||
|
|
||||||
|
return loadedModule
|
||||||
|
end
|
||||||
|
|
||||||
|
return require, loaded, register, modules
|
||||||
|
end)(nil)
|
||||||
|
__bundle_register("__root", function(require, _LOADED, __bundle_register, __bundle_modules)
|
||||||
|
require("playercards/cards/ScrollofSecrets")
|
||||||
|
end)
|
||||||
|
__bundle_register("playercards/cards/ScrollofSecrets", function(require, _LOADED, __bundle_register, __bundle_modules)
|
||||||
|
-- this script is shared between the lvl 0 and lvl 3 versions of Scroll of Secrets
|
||||||
|
local mythosAreaApi = require("core/MythosAreaApi")
|
||||||
|
local playmatApi = require("playermat/PlaymatApi")
|
||||||
|
|
||||||
|
-- get class via metadata and create context menu accordingly
|
||||||
|
function onLoad()
|
||||||
|
local notes = JSON.decode(self.getGMNotes())
|
||||||
|
if notes then
|
||||||
|
createContextMenu(notes.id)
|
||||||
|
else
|
||||||
|
print("Missing metadata for Scroll of Secrets!")
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
function createContextMenu(id)
|
||||||
|
if id == "05116" or id == "05116-t" then
|
||||||
|
-- lvl 0: draw 1 card from the bottom
|
||||||
|
self.addContextMenuItem("Draw bottom card", function(playerColor) contextFunc(playerColor, 1) end)
|
||||||
|
elseif id == "05188" or id == "05188-t" then
|
||||||
|
-- seeker lvl 3: draw 3 cards from the bottom
|
||||||
|
self.addContextMenuItem("Draw bottom card(s)", function(playerColor) contextFunc(playerColor, 3) end)
|
||||||
|
elseif id == "05189" or id == "05189-t" then
|
||||||
|
-- mystic lvl 3: draw 1 card from the bottom
|
||||||
|
self.addContextMenuItem("Draw bottom card", function(playerColor) contextFunc(playerColor, 1) end)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
function contextFunc(playerColor, amount)
|
||||||
|
local options = { "Encounter Deck" }
|
||||||
|
|
||||||
|
-- check for players with a deck and only display them as option
|
||||||
|
for _, color in ipairs(Player.getAvailableColors()) do
|
||||||
|
local matColor = playmatApi.getMatColor(color)
|
||||||
|
local deckAreaObjects = playmatApi.getDeckAreaObjects(matColor)
|
||||||
|
|
||||||
|
if deckAreaObjects.draw or deckAreaObjects.topCard then
|
||||||
|
table.insert(options, color)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
-- show the target selection dialog
|
||||||
|
Player[playerColor].showOptionsDialog("Select target deck", options, _, function(owner) drawCardsFromBottom(playerColor, owner, amount) end)
|
||||||
|
end
|
||||||
|
|
||||||
|
function drawCardsFromBottom(playerColor, owner, amount)
|
||||||
|
-- variable initialization
|
||||||
|
local deck = nil
|
||||||
|
local deckSize = 1
|
||||||
|
local deckAreaObjects = {}
|
||||||
|
|
||||||
|
-- get the respective deck
|
||||||
|
if owner == "Encounter Deck" then
|
||||||
|
deck = mythosAreaApi.getEncounterDeck()
|
||||||
|
else
|
||||||
|
local matColor = playmatApi.getMatColor(owner)
|
||||||
|
deckAreaObjects = playmatApi.getDeckAreaObjects(matColor)
|
||||||
|
deck = deckAreaObjects.draw
|
||||||
|
end
|
||||||
|
|
||||||
|
-- error handling
|
||||||
|
if not deck then
|
||||||
|
printToColor("Couldn't find deck!", playerColor)
|
||||||
|
return
|
||||||
|
end
|
||||||
|
|
||||||
|
-- set deck size if there is actually a deck and not just a card
|
||||||
|
if deck.type == "Deck" then
|
||||||
|
deckSize = #deck.getObjects()
|
||||||
|
end
|
||||||
|
|
||||||
|
-- proceed according to deck size
|
||||||
|
if deckSize > amount then
|
||||||
|
for i = 1, amount do
|
||||||
|
local card = deck.takeObject({ top = false, flip = true })
|
||||||
|
card.deal(1, playerColor)
|
||||||
|
end
|
||||||
|
else
|
||||||
|
-- deal the whole deck
|
||||||
|
deck.deal(amount, playerColor)
|
||||||
|
|
||||||
|
if deckSize < amount then
|
||||||
|
-- Norman Withers handling
|
||||||
|
if deckAreaObjects.topCard then
|
||||||
|
deckAreaObjects.topCard.deal(1, playerColor)
|
||||||
|
deckSize = deckSize + 1
|
||||||
|
end
|
||||||
|
|
||||||
|
-- warning message for player
|
||||||
|
if deckSize < amount then
|
||||||
|
printToColor("Deck didn't contain enough cards.", playerColor)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
printToColor("Handle the drawn cards according to the ability text on 'Scroll of Secrets'.", playerColor)
|
||||||
|
end
|
||||||
|
end)
|
||||||
|
__bundle_register("core/MythosAreaApi", function(require, _LOADED, __bundle_register, __bundle_modules)
|
||||||
|
do
|
||||||
|
local MythosAreaApi = {}
|
||||||
|
local guidReferenceApi = require("core/GUIDReferenceApi")
|
||||||
|
|
||||||
|
local function getMythosArea()
|
||||||
|
return guidReferenceApi.getObjectByOwnerAndType("Mythos", "MythosArea")
|
||||||
|
end
|
||||||
|
|
||||||
|
-- returns the chaos token metadata (if provided through scenario reference card)
|
||||||
|
MythosAreaApi.returnTokenData = function()
|
||||||
|
return getMythosArea().call("returnTokenData")
|
||||||
|
end
|
||||||
|
|
||||||
|
-- returns an object reference to the encounter deck
|
||||||
|
MythosAreaApi.getEncounterDeck = function()
|
||||||
|
return getMythosArea().call("getEncounterDeck")
|
||||||
|
end
|
||||||
|
|
||||||
|
-- draw an encounter card to the requested position/rotation
|
||||||
|
MythosAreaApi.drawEncounterCard = function(pos, rotY, alwaysFaceUp)
|
||||||
|
getMythosArea().call("drawEncounterCard", {
|
||||||
|
pos = pos,
|
||||||
|
rotY = rotY,
|
||||||
|
alwaysFaceUp = alwaysFaceUp
|
||||||
|
})
|
||||||
|
end
|
||||||
|
|
||||||
|
return MythosAreaApi
|
||||||
|
end
|
||||||
|
end)
|
||||||
|
__bundle_register("playermat/PlaymatApi", function(require, _LOADED, __bundle_register, __bundle_modules)
|
||||||
|
do
|
||||||
|
local PlaymatApi = {}
|
||||||
|
local guidReferenceApi = require("core/GUIDReferenceApi")
|
||||||
|
|
||||||
|
-- Convenience function to look up a mat's object by color, or get all mats.
|
||||||
|
---@param matColor String Color of the playmat - White, Orange, Green, Red or All
|
||||||
|
---@return array Table Single-element if only single playmat is requested
|
||||||
|
local function getMatForColor(matColor)
|
||||||
|
if matColor == "All" then
|
||||||
|
return guidReferenceApi.getObjectsByType("Playermat")
|
||||||
|
else
|
||||||
|
return { matColor = guidReferenceApi.getObjectByOwnerAndType(matColor, "Playermat") }
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
-- Returns the color of the closest playmat
|
||||||
|
---@param startPos Table Starting position to get the closest mat from
|
||||||
|
PlaymatApi.getMatColorByPosition = function(startPos)
|
||||||
|
local result, smallestDistance
|
||||||
|
for matColor, mat in pairs(getMatForColor("All")) do
|
||||||
|
local distance = Vector.between(startPos, mat.getPosition()):magnitude()
|
||||||
|
if smallestDistance == nil or distance < smallestDistance then
|
||||||
|
smallestDistance = distance
|
||||||
|
result = matColor
|
||||||
|
end
|
||||||
|
end
|
||||||
|
return result
|
||||||
|
end
|
||||||
|
|
||||||
|
-- Returns the color of the player's hand that is seated next to the playmat
|
||||||
|
---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support "All")
|
||||||
|
PlaymatApi.getPlayerColor = function(matColor)
|
||||||
|
for _, mat in pairs(getMatForColor(matColor)) do
|
||||||
|
return mat.getVar("playerColor")
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
-- Returns the color of the playmat that owns the playercolor's hand
|
||||||
|
---@param handColor String Color of the playmat
|
||||||
|
PlaymatApi.getMatColor = function(handColor)
|
||||||
|
for matColor, mat in pairs(getMatForColor("All")) do
|
||||||
|
local playerColor = mat.getVar("playerColor")
|
||||||
|
if playerColor == handColor then
|
||||||
|
return matColor
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
-- Returns if there is the card "Dream-Enhancing Serum" on the requested playmat
|
||||||
|
---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support "All")
|
||||||
|
PlaymatApi.isDES = function(matColor)
|
||||||
|
for _, mat in pairs(getMatForColor(matColor)) do
|
||||||
|
return mat.getVar("isDES")
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
-- Performs a search of the deck area of the requested playmat and returns the result as table
|
||||||
|
---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support "All")
|
||||||
|
PlaymatApi.getDeckAreaObjects = function(matColor)
|
||||||
|
for _, mat in pairs(getMatForColor(matColor)) do
|
||||||
|
return mat.call("getDeckAreaObjects")
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
-- Flips the top card of the deck (useful after deck manipulation for Norman Withers)
|
||||||
|
---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support "All")
|
||||||
|
PlaymatApi.flipTopCardFromDeck = function(matColor)
|
||||||
|
for _, mat in pairs(getMatForColor(matColor)) do
|
||||||
|
return mat.call("flipTopCardFromDeck")
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
-- Returns the position of the discard pile of the requested playmat
|
||||||
|
---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support "All")
|
||||||
|
PlaymatApi.getDiscardPosition = function(matColor)
|
||||||
|
for _, mat in pairs(getMatForColor(matColor)) do
|
||||||
|
return mat.call("returnGlobalDiscardPosition")
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
-- Transforms a local position into a global position
|
||||||
|
---@param localPos Table Local position to be transformed
|
||||||
|
---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support "All")
|
||||||
|
PlaymatApi.transformLocalPosition = function(localPos, matColor)
|
||||||
|
for _, mat in pairs(getMatForColor(matColor)) do
|
||||||
|
return mat.positionToWorld(localPos)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
-- Returns the rotation of the requested playmat
|
||||||
|
---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support "All")
|
||||||
|
PlaymatApi.returnRotation = function(matColor)
|
||||||
|
for _, mat in pairs(getMatForColor(matColor)) do
|
||||||
|
return mat.getRotation()
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
-- Triggers the Upkeep for the requested playmat
|
||||||
|
---@param matColor String Color of the playmat - White, Orange, Green, Red or All
|
||||||
|
---@param playerColor String Color of the calling player (for messages)
|
||||||
|
PlaymatApi.doUpkeepFromHotkey = function(matColor, playerColor)
|
||||||
|
for _, mat in pairs(getMatForColor(matColor)) do
|
||||||
|
mat.call("doUpkeepFromHotkey", playerColor)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
-- Handles discarding for the requested playmat for the provided list of objects
|
||||||
|
---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support "All")
|
||||||
|
---@param objList Table List of objects to discard
|
||||||
|
PlaymatApi.discardListOfObjects = function(matColor, objList)
|
||||||
|
for _, mat in pairs(getMatForColor(matColor)) do
|
||||||
|
mat.call("discardListOfObjects", objList)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
-- Returns the active investigator id
|
||||||
|
---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support "All")
|
||||||
|
PlaymatApi.returnInvestigatorId = function(matColor)
|
||||||
|
for _, mat in pairs(getMatForColor(matColor)) do
|
||||||
|
return mat.getVar("activeInvestigatorId")
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
-- Sets the requested playmat's snap points to limit snapping to matching card types or not. If
|
||||||
|
-- matchTypes is true, the main card slot snap points will only snap assets, while the
|
||||||
|
-- investigator area point will only snap Investigators. If matchTypes is false, snap points will
|
||||||
|
-- be reset to snap all cards.
|
||||||
|
---@param matchCardTypes Boolean Whether snap points should only snap for the matching card types
|
||||||
|
---@param matColor String Color of the playmat - White, Orange, Green, Red or All
|
||||||
|
PlaymatApi.setLimitSnapsByType = function(matchCardTypes, matColor)
|
||||||
|
for _, mat in pairs(getMatForColor(matColor)) do
|
||||||
|
mat.call("setLimitSnapsByType", matchCardTypes)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
-- Sets the requested playmat's draw 1 button to visible
|
||||||
|
---@param isDrawButtonVisible Boolean Whether the draw 1 button should be visible or not
|
||||||
|
---@param matColor String Color of the playmat - White, Orange, Green, Red or All
|
||||||
|
PlaymatApi.showDrawButton = function(isDrawButtonVisible, matColor)
|
||||||
|
for _, mat in pairs(getMatForColor(matColor)) do
|
||||||
|
mat.call("showDrawButton", isDrawButtonVisible)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
-- Shows or hides the clickable clue counter for the requested playmat
|
||||||
|
---@param showCounter Boolean Whether the clickable counter should be present or not
|
||||||
|
---@param matColor String Color of the playmat - White, Orange, Green, Red or All
|
||||||
|
PlaymatApi.clickableClues = function(showCounter, matColor)
|
||||||
|
for _, mat in pairs(getMatForColor(matColor)) do
|
||||||
|
mat.call("clickableClues", showCounter)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
-- Removes all clues (to the trash for tokens and counters set to 0) for the requested playmat
|
||||||
|
---@param matColor String Color of the playmat - White, Orange, Green, Red or All
|
||||||
|
PlaymatApi.removeClues = function(matColor)
|
||||||
|
for _, mat in pairs(getMatForColor(matColor)) do
|
||||||
|
mat.call("removeClues")
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
-- Reports the clue count for the requested playmat
|
||||||
|
---@param useClickableCounters Boolean Controls which type of counter is getting checked
|
||||||
|
PlaymatApi.getClueCount = function(useClickableCounters, matColor)
|
||||||
|
local count = 0
|
||||||
|
for _, mat in pairs(getMatForColor(matColor)) do
|
||||||
|
count = count + mat.call("getClueCount", useClickableCounters)
|
||||||
|
end
|
||||||
|
return count
|
||||||
|
end
|
||||||
|
|
||||||
|
-- updates the specified owned counter
|
||||||
|
---@param matColor String Color of the playmat - White, Orange, Green, Red or All
|
||||||
|
---@param type String Counter to target
|
||||||
|
---@param newValue Number Value to set the counter to
|
||||||
|
---@param modifier Number If newValue is not provided, the existing value will be adjusted by this modifier
|
||||||
|
PlaymatApi.updateCounter = function(matColor, type, newValue, modifier)
|
||||||
|
for _, mat in pairs(getMatForColor(matColor)) do
|
||||||
|
mat.call("updateCounter", { type = type, newValue = newValue, modifier = modifier })
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
-- returns the resource counter amount
|
||||||
|
---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support "All")
|
||||||
|
---@param type String Counter to target
|
||||||
|
PlaymatApi.getCounterValue = function(matColor, type)
|
||||||
|
for _, mat in pairs(getMatForColor(matColor)) do
|
||||||
|
return mat.call("getCounterValue", type)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
-- resets the specified skill tracker to "1, 1, 1, 1"
|
||||||
|
---@param matColor String Color of the playmat - White, Orange, Green, Red or All
|
||||||
|
PlaymatApi.resetSkillTracker = function(matColor)
|
||||||
|
for _, mat in pairs(getMatForColor(matColor)) do
|
||||||
|
mat.call("resetSkillTracker")
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
-- finds all objects on the playmat and associated set aside zone and returns a table
|
||||||
|
---@param matColor String Color of the playmat - White, Orange, Green, Red or All
|
||||||
|
---@param filter Function Optional filter function (return true for desired objects)
|
||||||
|
PlaymatApi.searchAroundPlaymat = function(matColor, filter)
|
||||||
|
local objList = {}
|
||||||
|
for _, mat in pairs(getMatForColor(matColor)) do
|
||||||
|
for _, obj in ipairs(mat.call("searchAroundSelf", filter)) do
|
||||||
|
table.insert(objList, obj)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
return objList
|
||||||
|
end
|
||||||
|
|
||||||
|
-- Discard a non-hidden card from the corresponding player's hand
|
||||||
|
---@param matColor String Color of the playmat - White, Orange, Green, Red or All
|
||||||
|
PlaymatApi.doDiscardOne = function(matColor)
|
||||||
|
for _, mat in pairs(getMatForColor(matColor)) do
|
||||||
|
mat.call("doDiscardOne")
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
-- Triggers the metadata sync for all playmats
|
||||||
|
PlaymatApi.syncAllCustomizableCards = function()
|
||||||
|
for _, mat in pairs(getMatForColor("All")) do
|
||||||
|
mat.call("syncAllCustomizableCards")
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
return PlaymatApi
|
||||||
|
end
|
||||||
|
end)
|
||||||
|
__bundle_register("core/GUIDReferenceApi", function(require, _LOADED, __bundle_register, __bundle_modules)
|
||||||
|
do
|
||||||
|
local GUIDReferenceApi = {}
|
||||||
|
|
||||||
|
local function getGuidHandler()
|
||||||
|
return getObjectFromGUID("123456")
|
||||||
|
end
|
||||||
|
|
||||||
|
-- returns all matching objects as a table with references
|
||||||
|
---@param owner String Parent object for this search
|
||||||
|
---@param type String Type of object to search for
|
||||||
|
GUIDReferenceApi.getObjectByOwnerAndType = function(owner, type)
|
||||||
|
return getGuidHandler().call("getObjectByOwnerAndType", { owner = owner, type = type })
|
||||||
|
end
|
||||||
|
|
||||||
|
-- returns all matching objects as a table with references
|
||||||
|
---@param type String Type of object to search for
|
||||||
|
GUIDReferenceApi.getObjectsByType = function(type)
|
||||||
|
return getGuidHandler().call("getObjectsByType", type)
|
||||||
|
end
|
||||||
|
|
||||||
|
-- returns all matching objects as a table with references
|
||||||
|
---@param owner String Parent object for this search
|
||||||
|
GUIDReferenceApi.getObjectsByOwner = function(owner)
|
||||||
|
return getGuidHandler().call("getObjectsByOwner", owner)
|
||||||
|
end
|
||||||
|
|
||||||
|
return GUIDReferenceApi
|
||||||
|
end
|
||||||
|
end)
|
||||||
|
return __bundle_require("__root")
|
@ -12,7 +12,7 @@ CustomDeck:
|
|||||||
'3':
|
'3':
|
||||||
BackIsHidden: true
|
BackIsHidden: true
|
||||||
BackURL: https://i.imgur.com/EcbhVuh.jpg/
|
BackURL: https://i.imgur.com/EcbhVuh.jpg/
|
||||||
FaceURL: http://cloud-3.steamusercontent.com/ugc/2021607899142908284/92DF67E4310BCDFAD6C4BB12D31155DBF6B07A25/
|
FaceURL: http://cloud-3.steamusercontent.com/ugc/2115061845812962486/A68B8BF7E4862F21369DAC4A37D813EC664EAC34/
|
||||||
NumHeight: 6
|
NumHeight: 6
|
||||||
NumWidth: 10
|
NumWidth: 10
|
||||||
Type: 0
|
Type: 0
|
||||||
@ -32,7 +32,7 @@ HideWhenFaceDown: true
|
|||||||
IgnoreFoW: false
|
IgnoreFoW: false
|
||||||
LayoutGroupSortIndex: 0
|
LayoutGroupSortIndex: 0
|
||||||
Locked: false
|
Locked: false
|
||||||
LuaScript: ''
|
LuaScript: !include 'Card Scroll of Secrets (3) (Taboo) c127f1.ttslua'
|
||||||
LuaScriptState: ''
|
LuaScriptState: ''
|
||||||
MeasureMovement: false
|
MeasureMovement: false
|
||||||
Name: Card
|
Name: Card
|
||||||
|
@ -0,0 +1,436 @@
|
|||||||
|
-- Bundled by luabundle {"version":"1.6.0"}
|
||||||
|
local __bundle_require, __bundle_loaded, __bundle_register, __bundle_modules = (function(superRequire)
|
||||||
|
local loadingPlaceholder = {[{}] = true}
|
||||||
|
|
||||||
|
local register
|
||||||
|
local modules = {}
|
||||||
|
|
||||||
|
local require
|
||||||
|
local loaded = {}
|
||||||
|
|
||||||
|
register = function(name, body)
|
||||||
|
if not modules[name] then
|
||||||
|
modules[name] = body
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
require = function(name)
|
||||||
|
local loadedModule = loaded[name]
|
||||||
|
|
||||||
|
if loadedModule then
|
||||||
|
if loadedModule == loadingPlaceholder then
|
||||||
|
return nil
|
||||||
|
end
|
||||||
|
else
|
||||||
|
if not modules[name] then
|
||||||
|
if not superRequire then
|
||||||
|
local identifier = type(name) == 'string' and '\"' .. name .. '\"' or tostring(name)
|
||||||
|
error('Tried to require ' .. identifier .. ', but no such module has been registered')
|
||||||
|
else
|
||||||
|
return superRequire(name)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
loaded[name] = loadingPlaceholder
|
||||||
|
loadedModule = modules[name](require, loaded, register, modules)
|
||||||
|
loaded[name] = loadedModule
|
||||||
|
end
|
||||||
|
|
||||||
|
return loadedModule
|
||||||
|
end
|
||||||
|
|
||||||
|
return require, loaded, register, modules
|
||||||
|
end)(nil)
|
||||||
|
__bundle_register("__root", function(require, _LOADED, __bundle_register, __bundle_modules)
|
||||||
|
require("playercards/cards/ScrollofSecrets")
|
||||||
|
end)
|
||||||
|
__bundle_register("playercards/cards/ScrollofSecrets", function(require, _LOADED, __bundle_register, __bundle_modules)
|
||||||
|
-- this script is shared between the lvl 0 and lvl 3 versions of Scroll of Secrets
|
||||||
|
local mythosAreaApi = require("core/MythosAreaApi")
|
||||||
|
local playmatApi = require("playermat/PlaymatApi")
|
||||||
|
|
||||||
|
-- get class via metadata and create context menu accordingly
|
||||||
|
function onLoad()
|
||||||
|
local notes = JSON.decode(self.getGMNotes())
|
||||||
|
if notes then
|
||||||
|
createContextMenu(notes.id)
|
||||||
|
else
|
||||||
|
print("Missing metadata for Scroll of Secrets!")
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
function createContextMenu(id)
|
||||||
|
if id == "05116" or id == "05116-t" then
|
||||||
|
-- lvl 0: draw 1 card from the bottom
|
||||||
|
self.addContextMenuItem("Draw bottom card", function(playerColor) contextFunc(playerColor, 1) end)
|
||||||
|
elseif id == "05188" or id == "05188-t" then
|
||||||
|
-- seeker lvl 3: draw 3 cards from the bottom
|
||||||
|
self.addContextMenuItem("Draw bottom card(s)", function(playerColor) contextFunc(playerColor, 3) end)
|
||||||
|
elseif id == "05189" or id == "05189-t" then
|
||||||
|
-- mystic lvl 3: draw 1 card from the bottom
|
||||||
|
self.addContextMenuItem("Draw bottom card", function(playerColor) contextFunc(playerColor, 1) end)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
function contextFunc(playerColor, amount)
|
||||||
|
local options = { "Encounter Deck" }
|
||||||
|
|
||||||
|
-- check for players with a deck and only display them as option
|
||||||
|
for _, color in ipairs(Player.getAvailableColors()) do
|
||||||
|
local matColor = playmatApi.getMatColor(color)
|
||||||
|
local deckAreaObjects = playmatApi.getDeckAreaObjects(matColor)
|
||||||
|
|
||||||
|
if deckAreaObjects.draw or deckAreaObjects.topCard then
|
||||||
|
table.insert(options, color)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
-- show the target selection dialog
|
||||||
|
Player[playerColor].showOptionsDialog("Select target deck", options, _, function(owner) drawCardsFromBottom(playerColor, owner, amount) end)
|
||||||
|
end
|
||||||
|
|
||||||
|
function drawCardsFromBottom(playerColor, owner, amount)
|
||||||
|
-- variable initialization
|
||||||
|
local deck = nil
|
||||||
|
local deckSize = 1
|
||||||
|
local deckAreaObjects = {}
|
||||||
|
|
||||||
|
-- get the respective deck
|
||||||
|
if owner == "Encounter Deck" then
|
||||||
|
deck = mythosAreaApi.getEncounterDeck()
|
||||||
|
else
|
||||||
|
local matColor = playmatApi.getMatColor(owner)
|
||||||
|
deckAreaObjects = playmatApi.getDeckAreaObjects(matColor)
|
||||||
|
deck = deckAreaObjects.draw
|
||||||
|
end
|
||||||
|
|
||||||
|
-- error handling
|
||||||
|
if not deck then
|
||||||
|
printToColor("Couldn't find deck!", playerColor)
|
||||||
|
return
|
||||||
|
end
|
||||||
|
|
||||||
|
-- set deck size if there is actually a deck and not just a card
|
||||||
|
if deck.type == "Deck" then
|
||||||
|
deckSize = #deck.getObjects()
|
||||||
|
end
|
||||||
|
|
||||||
|
-- proceed according to deck size
|
||||||
|
if deckSize > amount then
|
||||||
|
for i = 1, amount do
|
||||||
|
local card = deck.takeObject({ top = false, flip = true })
|
||||||
|
card.deal(1, playerColor)
|
||||||
|
end
|
||||||
|
else
|
||||||
|
-- deal the whole deck
|
||||||
|
deck.deal(amount, playerColor)
|
||||||
|
|
||||||
|
if deckSize < amount then
|
||||||
|
-- Norman Withers handling
|
||||||
|
if deckAreaObjects.topCard then
|
||||||
|
deckAreaObjects.topCard.deal(1, playerColor)
|
||||||
|
deckSize = deckSize + 1
|
||||||
|
end
|
||||||
|
|
||||||
|
-- warning message for player
|
||||||
|
if deckSize < amount then
|
||||||
|
printToColor("Deck didn't contain enough cards.", playerColor)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
printToColor("Handle the drawn cards according to the ability text on 'Scroll of Secrets'.", playerColor)
|
||||||
|
end
|
||||||
|
end)
|
||||||
|
__bundle_register("core/MythosAreaApi", function(require, _LOADED, __bundle_register, __bundle_modules)
|
||||||
|
do
|
||||||
|
local MythosAreaApi = {}
|
||||||
|
local guidReferenceApi = require("core/GUIDReferenceApi")
|
||||||
|
|
||||||
|
local function getMythosArea()
|
||||||
|
return guidReferenceApi.getObjectByOwnerAndType("Mythos", "MythosArea")
|
||||||
|
end
|
||||||
|
|
||||||
|
-- returns the chaos token metadata (if provided through scenario reference card)
|
||||||
|
MythosAreaApi.returnTokenData = function()
|
||||||
|
return getMythosArea().call("returnTokenData")
|
||||||
|
end
|
||||||
|
|
||||||
|
-- returns an object reference to the encounter deck
|
||||||
|
MythosAreaApi.getEncounterDeck = function()
|
||||||
|
return getMythosArea().call("getEncounterDeck")
|
||||||
|
end
|
||||||
|
|
||||||
|
-- draw an encounter card to the requested position/rotation
|
||||||
|
MythosAreaApi.drawEncounterCard = function(pos, rotY, alwaysFaceUp)
|
||||||
|
getMythosArea().call("drawEncounterCard", {
|
||||||
|
pos = pos,
|
||||||
|
rotY = rotY,
|
||||||
|
alwaysFaceUp = alwaysFaceUp
|
||||||
|
})
|
||||||
|
end
|
||||||
|
|
||||||
|
return MythosAreaApi
|
||||||
|
end
|
||||||
|
end)
|
||||||
|
__bundle_register("playermat/PlaymatApi", function(require, _LOADED, __bundle_register, __bundle_modules)
|
||||||
|
do
|
||||||
|
local PlaymatApi = {}
|
||||||
|
local guidReferenceApi = require("core/GUIDReferenceApi")
|
||||||
|
|
||||||
|
-- Convenience function to look up a mat's object by color, or get all mats.
|
||||||
|
---@param matColor String Color of the playmat - White, Orange, Green, Red or All
|
||||||
|
---@return array Table Single-element if only single playmat is requested
|
||||||
|
local function getMatForColor(matColor)
|
||||||
|
if matColor == "All" then
|
||||||
|
return guidReferenceApi.getObjectsByType("Playermat")
|
||||||
|
else
|
||||||
|
return { matColor = guidReferenceApi.getObjectByOwnerAndType(matColor, "Playermat") }
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
-- Returns the color of the closest playmat
|
||||||
|
---@param startPos Table Starting position to get the closest mat from
|
||||||
|
PlaymatApi.getMatColorByPosition = function(startPos)
|
||||||
|
local result, smallestDistance
|
||||||
|
for matColor, mat in pairs(getMatForColor("All")) do
|
||||||
|
local distance = Vector.between(startPos, mat.getPosition()):magnitude()
|
||||||
|
if smallestDistance == nil or distance < smallestDistance then
|
||||||
|
smallestDistance = distance
|
||||||
|
result = matColor
|
||||||
|
end
|
||||||
|
end
|
||||||
|
return result
|
||||||
|
end
|
||||||
|
|
||||||
|
-- Returns the color of the player's hand that is seated next to the playmat
|
||||||
|
---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support "All")
|
||||||
|
PlaymatApi.getPlayerColor = function(matColor)
|
||||||
|
for _, mat in pairs(getMatForColor(matColor)) do
|
||||||
|
return mat.getVar("playerColor")
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
-- Returns the color of the playmat that owns the playercolor's hand
|
||||||
|
---@param handColor String Color of the playmat
|
||||||
|
PlaymatApi.getMatColor = function(handColor)
|
||||||
|
for matColor, mat in pairs(getMatForColor("All")) do
|
||||||
|
local playerColor = mat.getVar("playerColor")
|
||||||
|
if playerColor == handColor then
|
||||||
|
return matColor
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
-- Returns if there is the card "Dream-Enhancing Serum" on the requested playmat
|
||||||
|
---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support "All")
|
||||||
|
PlaymatApi.isDES = function(matColor)
|
||||||
|
for _, mat in pairs(getMatForColor(matColor)) do
|
||||||
|
return mat.getVar("isDES")
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
-- Performs a search of the deck area of the requested playmat and returns the result as table
|
||||||
|
---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support "All")
|
||||||
|
PlaymatApi.getDeckAreaObjects = function(matColor)
|
||||||
|
for _, mat in pairs(getMatForColor(matColor)) do
|
||||||
|
return mat.call("getDeckAreaObjects")
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
-- Flips the top card of the deck (useful after deck manipulation for Norman Withers)
|
||||||
|
---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support "All")
|
||||||
|
PlaymatApi.flipTopCardFromDeck = function(matColor)
|
||||||
|
for _, mat in pairs(getMatForColor(matColor)) do
|
||||||
|
return mat.call("flipTopCardFromDeck")
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
-- Returns the position of the discard pile of the requested playmat
|
||||||
|
---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support "All")
|
||||||
|
PlaymatApi.getDiscardPosition = function(matColor)
|
||||||
|
for _, mat in pairs(getMatForColor(matColor)) do
|
||||||
|
return mat.call("returnGlobalDiscardPosition")
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
-- Transforms a local position into a global position
|
||||||
|
---@param localPos Table Local position to be transformed
|
||||||
|
---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support "All")
|
||||||
|
PlaymatApi.transformLocalPosition = function(localPos, matColor)
|
||||||
|
for _, mat in pairs(getMatForColor(matColor)) do
|
||||||
|
return mat.positionToWorld(localPos)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
-- Returns the rotation of the requested playmat
|
||||||
|
---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support "All")
|
||||||
|
PlaymatApi.returnRotation = function(matColor)
|
||||||
|
for _, mat in pairs(getMatForColor(matColor)) do
|
||||||
|
return mat.getRotation()
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
-- Triggers the Upkeep for the requested playmat
|
||||||
|
---@param matColor String Color of the playmat - White, Orange, Green, Red or All
|
||||||
|
---@param playerColor String Color of the calling player (for messages)
|
||||||
|
PlaymatApi.doUpkeepFromHotkey = function(matColor, playerColor)
|
||||||
|
for _, mat in pairs(getMatForColor(matColor)) do
|
||||||
|
mat.call("doUpkeepFromHotkey", playerColor)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
-- Handles discarding for the requested playmat for the provided list of objects
|
||||||
|
---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support "All")
|
||||||
|
---@param objList Table List of objects to discard
|
||||||
|
PlaymatApi.discardListOfObjects = function(matColor, objList)
|
||||||
|
for _, mat in pairs(getMatForColor(matColor)) do
|
||||||
|
mat.call("discardListOfObjects", objList)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
-- Returns the active investigator id
|
||||||
|
---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support "All")
|
||||||
|
PlaymatApi.returnInvestigatorId = function(matColor)
|
||||||
|
for _, mat in pairs(getMatForColor(matColor)) do
|
||||||
|
return mat.getVar("activeInvestigatorId")
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
-- Sets the requested playmat's snap points to limit snapping to matching card types or not. If
|
||||||
|
-- matchTypes is true, the main card slot snap points will only snap assets, while the
|
||||||
|
-- investigator area point will only snap Investigators. If matchTypes is false, snap points will
|
||||||
|
-- be reset to snap all cards.
|
||||||
|
---@param matchCardTypes Boolean Whether snap points should only snap for the matching card types
|
||||||
|
---@param matColor String Color of the playmat - White, Orange, Green, Red or All
|
||||||
|
PlaymatApi.setLimitSnapsByType = function(matchCardTypes, matColor)
|
||||||
|
for _, mat in pairs(getMatForColor(matColor)) do
|
||||||
|
mat.call("setLimitSnapsByType", matchCardTypes)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
-- Sets the requested playmat's draw 1 button to visible
|
||||||
|
---@param isDrawButtonVisible Boolean Whether the draw 1 button should be visible or not
|
||||||
|
---@param matColor String Color of the playmat - White, Orange, Green, Red or All
|
||||||
|
PlaymatApi.showDrawButton = function(isDrawButtonVisible, matColor)
|
||||||
|
for _, mat in pairs(getMatForColor(matColor)) do
|
||||||
|
mat.call("showDrawButton", isDrawButtonVisible)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
-- Shows or hides the clickable clue counter for the requested playmat
|
||||||
|
---@param showCounter Boolean Whether the clickable counter should be present or not
|
||||||
|
---@param matColor String Color of the playmat - White, Orange, Green, Red or All
|
||||||
|
PlaymatApi.clickableClues = function(showCounter, matColor)
|
||||||
|
for _, mat in pairs(getMatForColor(matColor)) do
|
||||||
|
mat.call("clickableClues", showCounter)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
-- Removes all clues (to the trash for tokens and counters set to 0) for the requested playmat
|
||||||
|
---@param matColor String Color of the playmat - White, Orange, Green, Red or All
|
||||||
|
PlaymatApi.removeClues = function(matColor)
|
||||||
|
for _, mat in pairs(getMatForColor(matColor)) do
|
||||||
|
mat.call("removeClues")
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
-- Reports the clue count for the requested playmat
|
||||||
|
---@param useClickableCounters Boolean Controls which type of counter is getting checked
|
||||||
|
PlaymatApi.getClueCount = function(useClickableCounters, matColor)
|
||||||
|
local count = 0
|
||||||
|
for _, mat in pairs(getMatForColor(matColor)) do
|
||||||
|
count = count + mat.call("getClueCount", useClickableCounters)
|
||||||
|
end
|
||||||
|
return count
|
||||||
|
end
|
||||||
|
|
||||||
|
-- updates the specified owned counter
|
||||||
|
---@param matColor String Color of the playmat - White, Orange, Green, Red or All
|
||||||
|
---@param type String Counter to target
|
||||||
|
---@param newValue Number Value to set the counter to
|
||||||
|
---@param modifier Number If newValue is not provided, the existing value will be adjusted by this modifier
|
||||||
|
PlaymatApi.updateCounter = function(matColor, type, newValue, modifier)
|
||||||
|
for _, mat in pairs(getMatForColor(matColor)) do
|
||||||
|
mat.call("updateCounter", { type = type, newValue = newValue, modifier = modifier })
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
-- returns the resource counter amount
|
||||||
|
---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support "All")
|
||||||
|
---@param type String Counter to target
|
||||||
|
PlaymatApi.getCounterValue = function(matColor, type)
|
||||||
|
for _, mat in pairs(getMatForColor(matColor)) do
|
||||||
|
return mat.call("getCounterValue", type)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
-- resets the specified skill tracker to "1, 1, 1, 1"
|
||||||
|
---@param matColor String Color of the playmat - White, Orange, Green, Red or All
|
||||||
|
PlaymatApi.resetSkillTracker = function(matColor)
|
||||||
|
for _, mat in pairs(getMatForColor(matColor)) do
|
||||||
|
mat.call("resetSkillTracker")
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
-- finds all objects on the playmat and associated set aside zone and returns a table
|
||||||
|
---@param matColor String Color of the playmat - White, Orange, Green, Red or All
|
||||||
|
---@param filter Function Optional filter function (return true for desired objects)
|
||||||
|
PlaymatApi.searchAroundPlaymat = function(matColor, filter)
|
||||||
|
local objList = {}
|
||||||
|
for _, mat in pairs(getMatForColor(matColor)) do
|
||||||
|
for _, obj in ipairs(mat.call("searchAroundSelf", filter)) do
|
||||||
|
table.insert(objList, obj)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
return objList
|
||||||
|
end
|
||||||
|
|
||||||
|
-- Discard a non-hidden card from the corresponding player's hand
|
||||||
|
---@param matColor String Color of the playmat - White, Orange, Green, Red or All
|
||||||
|
PlaymatApi.doDiscardOne = function(matColor)
|
||||||
|
for _, mat in pairs(getMatForColor(matColor)) do
|
||||||
|
mat.call("doDiscardOne")
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
-- Triggers the metadata sync for all playmats
|
||||||
|
PlaymatApi.syncAllCustomizableCards = function()
|
||||||
|
for _, mat in pairs(getMatForColor("All")) do
|
||||||
|
mat.call("syncAllCustomizableCards")
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
return PlaymatApi
|
||||||
|
end
|
||||||
|
end)
|
||||||
|
__bundle_register("core/GUIDReferenceApi", function(require, _LOADED, __bundle_register, __bundle_modules)
|
||||||
|
do
|
||||||
|
local GUIDReferenceApi = {}
|
||||||
|
|
||||||
|
local function getGuidHandler()
|
||||||
|
return getObjectFromGUID("123456")
|
||||||
|
end
|
||||||
|
|
||||||
|
-- returns all matching objects as a table with references
|
||||||
|
---@param owner String Parent object for this search
|
||||||
|
---@param type String Type of object to search for
|
||||||
|
GUIDReferenceApi.getObjectByOwnerAndType = function(owner, type)
|
||||||
|
return getGuidHandler().call("getObjectByOwnerAndType", { owner = owner, type = type })
|
||||||
|
end
|
||||||
|
|
||||||
|
-- returns all matching objects as a table with references
|
||||||
|
---@param type String Type of object to search for
|
||||||
|
GUIDReferenceApi.getObjectsByType = function(type)
|
||||||
|
return getGuidHandler().call("getObjectsByType", type)
|
||||||
|
end
|
||||||
|
|
||||||
|
-- returns all matching objects as a table with references
|
||||||
|
---@param owner String Parent object for this search
|
||||||
|
GUIDReferenceApi.getObjectsByOwner = function(owner)
|
||||||
|
return getGuidHandler().call("getObjectsByOwner", owner)
|
||||||
|
end
|
||||||
|
|
||||||
|
return GUIDReferenceApi
|
||||||
|
end
|
||||||
|
end)
|
||||||
|
return __bundle_require("__root")
|
@ -31,7 +31,7 @@ HideWhenFaceDown: true
|
|||||||
IgnoreFoW: false
|
IgnoreFoW: false
|
||||||
LayoutGroupSortIndex: 0
|
LayoutGroupSortIndex: 0
|
||||||
Locked: false
|
Locked: false
|
||||||
LuaScript: ''
|
LuaScript: !include 'Card Scroll of Secrets (3) 0b12ac.ttslua'
|
||||||
LuaScriptState: ''
|
LuaScriptState: ''
|
||||||
MeasureMovement: false
|
MeasureMovement: false
|
||||||
Name: Card
|
Name: Card
|
||||||
|
@ -0,0 +1,436 @@
|
|||||||
|
-- Bundled by luabundle {"version":"1.6.0"}
|
||||||
|
local __bundle_require, __bundle_loaded, __bundle_register, __bundle_modules = (function(superRequire)
|
||||||
|
local loadingPlaceholder = {[{}] = true}
|
||||||
|
|
||||||
|
local register
|
||||||
|
local modules = {}
|
||||||
|
|
||||||
|
local require
|
||||||
|
local loaded = {}
|
||||||
|
|
||||||
|
register = function(name, body)
|
||||||
|
if not modules[name] then
|
||||||
|
modules[name] = body
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
require = function(name)
|
||||||
|
local loadedModule = loaded[name]
|
||||||
|
|
||||||
|
if loadedModule then
|
||||||
|
if loadedModule == loadingPlaceholder then
|
||||||
|
return nil
|
||||||
|
end
|
||||||
|
else
|
||||||
|
if not modules[name] then
|
||||||
|
if not superRequire then
|
||||||
|
local identifier = type(name) == 'string' and '\"' .. name .. '\"' or tostring(name)
|
||||||
|
error('Tried to require ' .. identifier .. ', but no such module has been registered')
|
||||||
|
else
|
||||||
|
return superRequire(name)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
loaded[name] = loadingPlaceholder
|
||||||
|
loadedModule = modules[name](require, loaded, register, modules)
|
||||||
|
loaded[name] = loadedModule
|
||||||
|
end
|
||||||
|
|
||||||
|
return loadedModule
|
||||||
|
end
|
||||||
|
|
||||||
|
return require, loaded, register, modules
|
||||||
|
end)(nil)
|
||||||
|
__bundle_register("__root", function(require, _LOADED, __bundle_register, __bundle_modules)
|
||||||
|
require("playercards/cards/ScrollofSecrets")
|
||||||
|
end)
|
||||||
|
__bundle_register("playercards/cards/ScrollofSecrets", function(require, _LOADED, __bundle_register, __bundle_modules)
|
||||||
|
-- this script is shared between the lvl 0 and lvl 3 versions of Scroll of Secrets
|
||||||
|
local mythosAreaApi = require("core/MythosAreaApi")
|
||||||
|
local playmatApi = require("playermat/PlaymatApi")
|
||||||
|
|
||||||
|
-- get class via metadata and create context menu accordingly
|
||||||
|
function onLoad()
|
||||||
|
local notes = JSON.decode(self.getGMNotes())
|
||||||
|
if notes then
|
||||||
|
createContextMenu(notes.id)
|
||||||
|
else
|
||||||
|
print("Missing metadata for Scroll of Secrets!")
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
function createContextMenu(id)
|
||||||
|
if id == "05116" or id == "05116-t" then
|
||||||
|
-- lvl 0: draw 1 card from the bottom
|
||||||
|
self.addContextMenuItem("Draw bottom card", function(playerColor) contextFunc(playerColor, 1) end)
|
||||||
|
elseif id == "05188" or id == "05188-t" then
|
||||||
|
-- seeker lvl 3: draw 3 cards from the bottom
|
||||||
|
self.addContextMenuItem("Draw bottom card(s)", function(playerColor) contextFunc(playerColor, 3) end)
|
||||||
|
elseif id == "05189" or id == "05189-t" then
|
||||||
|
-- mystic lvl 3: draw 1 card from the bottom
|
||||||
|
self.addContextMenuItem("Draw bottom card", function(playerColor) contextFunc(playerColor, 1) end)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
function contextFunc(playerColor, amount)
|
||||||
|
local options = { "Encounter Deck" }
|
||||||
|
|
||||||
|
-- check for players with a deck and only display them as option
|
||||||
|
for _, color in ipairs(Player.getAvailableColors()) do
|
||||||
|
local matColor = playmatApi.getMatColor(color)
|
||||||
|
local deckAreaObjects = playmatApi.getDeckAreaObjects(matColor)
|
||||||
|
|
||||||
|
if deckAreaObjects.draw or deckAreaObjects.topCard then
|
||||||
|
table.insert(options, color)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
-- show the target selection dialog
|
||||||
|
Player[playerColor].showOptionsDialog("Select target deck", options, _, function(owner) drawCardsFromBottom(playerColor, owner, amount) end)
|
||||||
|
end
|
||||||
|
|
||||||
|
function drawCardsFromBottom(playerColor, owner, amount)
|
||||||
|
-- variable initialization
|
||||||
|
local deck = nil
|
||||||
|
local deckSize = 1
|
||||||
|
local deckAreaObjects = {}
|
||||||
|
|
||||||
|
-- get the respective deck
|
||||||
|
if owner == "Encounter Deck" then
|
||||||
|
deck = mythosAreaApi.getEncounterDeck()
|
||||||
|
else
|
||||||
|
local matColor = playmatApi.getMatColor(owner)
|
||||||
|
deckAreaObjects = playmatApi.getDeckAreaObjects(matColor)
|
||||||
|
deck = deckAreaObjects.draw
|
||||||
|
end
|
||||||
|
|
||||||
|
-- error handling
|
||||||
|
if not deck then
|
||||||
|
printToColor("Couldn't find deck!", playerColor)
|
||||||
|
return
|
||||||
|
end
|
||||||
|
|
||||||
|
-- set deck size if there is actually a deck and not just a card
|
||||||
|
if deck.type == "Deck" then
|
||||||
|
deckSize = #deck.getObjects()
|
||||||
|
end
|
||||||
|
|
||||||
|
-- proceed according to deck size
|
||||||
|
if deckSize > amount then
|
||||||
|
for i = 1, amount do
|
||||||
|
local card = deck.takeObject({ top = false, flip = true })
|
||||||
|
card.deal(1, playerColor)
|
||||||
|
end
|
||||||
|
else
|
||||||
|
-- deal the whole deck
|
||||||
|
deck.deal(amount, playerColor)
|
||||||
|
|
||||||
|
if deckSize < amount then
|
||||||
|
-- Norman Withers handling
|
||||||
|
if deckAreaObjects.topCard then
|
||||||
|
deckAreaObjects.topCard.deal(1, playerColor)
|
||||||
|
deckSize = deckSize + 1
|
||||||
|
end
|
||||||
|
|
||||||
|
-- warning message for player
|
||||||
|
if deckSize < amount then
|
||||||
|
printToColor("Deck didn't contain enough cards.", playerColor)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
printToColor("Handle the drawn cards according to the ability text on 'Scroll of Secrets'.", playerColor)
|
||||||
|
end
|
||||||
|
end)
|
||||||
|
__bundle_register("core/MythosAreaApi", function(require, _LOADED, __bundle_register, __bundle_modules)
|
||||||
|
do
|
||||||
|
local MythosAreaApi = {}
|
||||||
|
local guidReferenceApi = require("core/GUIDReferenceApi")
|
||||||
|
|
||||||
|
local function getMythosArea()
|
||||||
|
return guidReferenceApi.getObjectByOwnerAndType("Mythos", "MythosArea")
|
||||||
|
end
|
||||||
|
|
||||||
|
-- returns the chaos token metadata (if provided through scenario reference card)
|
||||||
|
MythosAreaApi.returnTokenData = function()
|
||||||
|
return getMythosArea().call("returnTokenData")
|
||||||
|
end
|
||||||
|
|
||||||
|
-- returns an object reference to the encounter deck
|
||||||
|
MythosAreaApi.getEncounterDeck = function()
|
||||||
|
return getMythosArea().call("getEncounterDeck")
|
||||||
|
end
|
||||||
|
|
||||||
|
-- draw an encounter card to the requested position/rotation
|
||||||
|
MythosAreaApi.drawEncounterCard = function(pos, rotY, alwaysFaceUp)
|
||||||
|
getMythosArea().call("drawEncounterCard", {
|
||||||
|
pos = pos,
|
||||||
|
rotY = rotY,
|
||||||
|
alwaysFaceUp = alwaysFaceUp
|
||||||
|
})
|
||||||
|
end
|
||||||
|
|
||||||
|
return MythosAreaApi
|
||||||
|
end
|
||||||
|
end)
|
||||||
|
__bundle_register("playermat/PlaymatApi", function(require, _LOADED, __bundle_register, __bundle_modules)
|
||||||
|
do
|
||||||
|
local PlaymatApi = {}
|
||||||
|
local guidReferenceApi = require("core/GUIDReferenceApi")
|
||||||
|
|
||||||
|
-- Convenience function to look up a mat's object by color, or get all mats.
|
||||||
|
---@param matColor String Color of the playmat - White, Orange, Green, Red or All
|
||||||
|
---@return array Table Single-element if only single playmat is requested
|
||||||
|
local function getMatForColor(matColor)
|
||||||
|
if matColor == "All" then
|
||||||
|
return guidReferenceApi.getObjectsByType("Playermat")
|
||||||
|
else
|
||||||
|
return { matColor = guidReferenceApi.getObjectByOwnerAndType(matColor, "Playermat") }
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
-- Returns the color of the closest playmat
|
||||||
|
---@param startPos Table Starting position to get the closest mat from
|
||||||
|
PlaymatApi.getMatColorByPosition = function(startPos)
|
||||||
|
local result, smallestDistance
|
||||||
|
for matColor, mat in pairs(getMatForColor("All")) do
|
||||||
|
local distance = Vector.between(startPos, mat.getPosition()):magnitude()
|
||||||
|
if smallestDistance == nil or distance < smallestDistance then
|
||||||
|
smallestDistance = distance
|
||||||
|
result = matColor
|
||||||
|
end
|
||||||
|
end
|
||||||
|
return result
|
||||||
|
end
|
||||||
|
|
||||||
|
-- Returns the color of the player's hand that is seated next to the playmat
|
||||||
|
---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support "All")
|
||||||
|
PlaymatApi.getPlayerColor = function(matColor)
|
||||||
|
for _, mat in pairs(getMatForColor(matColor)) do
|
||||||
|
return mat.getVar("playerColor")
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
-- Returns the color of the playmat that owns the playercolor's hand
|
||||||
|
---@param handColor String Color of the playmat
|
||||||
|
PlaymatApi.getMatColor = function(handColor)
|
||||||
|
for matColor, mat in pairs(getMatForColor("All")) do
|
||||||
|
local playerColor = mat.getVar("playerColor")
|
||||||
|
if playerColor == handColor then
|
||||||
|
return matColor
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
-- Returns if there is the card "Dream-Enhancing Serum" on the requested playmat
|
||||||
|
---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support "All")
|
||||||
|
PlaymatApi.isDES = function(matColor)
|
||||||
|
for _, mat in pairs(getMatForColor(matColor)) do
|
||||||
|
return mat.getVar("isDES")
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
-- Performs a search of the deck area of the requested playmat and returns the result as table
|
||||||
|
---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support "All")
|
||||||
|
PlaymatApi.getDeckAreaObjects = function(matColor)
|
||||||
|
for _, mat in pairs(getMatForColor(matColor)) do
|
||||||
|
return mat.call("getDeckAreaObjects")
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
-- Flips the top card of the deck (useful after deck manipulation for Norman Withers)
|
||||||
|
---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support "All")
|
||||||
|
PlaymatApi.flipTopCardFromDeck = function(matColor)
|
||||||
|
for _, mat in pairs(getMatForColor(matColor)) do
|
||||||
|
return mat.call("flipTopCardFromDeck")
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
-- Returns the position of the discard pile of the requested playmat
|
||||||
|
---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support "All")
|
||||||
|
PlaymatApi.getDiscardPosition = function(matColor)
|
||||||
|
for _, mat in pairs(getMatForColor(matColor)) do
|
||||||
|
return mat.call("returnGlobalDiscardPosition")
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
-- Transforms a local position into a global position
|
||||||
|
---@param localPos Table Local position to be transformed
|
||||||
|
---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support "All")
|
||||||
|
PlaymatApi.transformLocalPosition = function(localPos, matColor)
|
||||||
|
for _, mat in pairs(getMatForColor(matColor)) do
|
||||||
|
return mat.positionToWorld(localPos)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
-- Returns the rotation of the requested playmat
|
||||||
|
---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support "All")
|
||||||
|
PlaymatApi.returnRotation = function(matColor)
|
||||||
|
for _, mat in pairs(getMatForColor(matColor)) do
|
||||||
|
return mat.getRotation()
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
-- Triggers the Upkeep for the requested playmat
|
||||||
|
---@param matColor String Color of the playmat - White, Orange, Green, Red or All
|
||||||
|
---@param playerColor String Color of the calling player (for messages)
|
||||||
|
PlaymatApi.doUpkeepFromHotkey = function(matColor, playerColor)
|
||||||
|
for _, mat in pairs(getMatForColor(matColor)) do
|
||||||
|
mat.call("doUpkeepFromHotkey", playerColor)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
-- Handles discarding for the requested playmat for the provided list of objects
|
||||||
|
---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support "All")
|
||||||
|
---@param objList Table List of objects to discard
|
||||||
|
PlaymatApi.discardListOfObjects = function(matColor, objList)
|
||||||
|
for _, mat in pairs(getMatForColor(matColor)) do
|
||||||
|
mat.call("discardListOfObjects", objList)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
-- Returns the active investigator id
|
||||||
|
---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support "All")
|
||||||
|
PlaymatApi.returnInvestigatorId = function(matColor)
|
||||||
|
for _, mat in pairs(getMatForColor(matColor)) do
|
||||||
|
return mat.getVar("activeInvestigatorId")
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
-- Sets the requested playmat's snap points to limit snapping to matching card types or not. If
|
||||||
|
-- matchTypes is true, the main card slot snap points will only snap assets, while the
|
||||||
|
-- investigator area point will only snap Investigators. If matchTypes is false, snap points will
|
||||||
|
-- be reset to snap all cards.
|
||||||
|
---@param matchCardTypes Boolean Whether snap points should only snap for the matching card types
|
||||||
|
---@param matColor String Color of the playmat - White, Orange, Green, Red or All
|
||||||
|
PlaymatApi.setLimitSnapsByType = function(matchCardTypes, matColor)
|
||||||
|
for _, mat in pairs(getMatForColor(matColor)) do
|
||||||
|
mat.call("setLimitSnapsByType", matchCardTypes)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
-- Sets the requested playmat's draw 1 button to visible
|
||||||
|
---@param isDrawButtonVisible Boolean Whether the draw 1 button should be visible or not
|
||||||
|
---@param matColor String Color of the playmat - White, Orange, Green, Red or All
|
||||||
|
PlaymatApi.showDrawButton = function(isDrawButtonVisible, matColor)
|
||||||
|
for _, mat in pairs(getMatForColor(matColor)) do
|
||||||
|
mat.call("showDrawButton", isDrawButtonVisible)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
-- Shows or hides the clickable clue counter for the requested playmat
|
||||||
|
---@param showCounter Boolean Whether the clickable counter should be present or not
|
||||||
|
---@param matColor String Color of the playmat - White, Orange, Green, Red or All
|
||||||
|
PlaymatApi.clickableClues = function(showCounter, matColor)
|
||||||
|
for _, mat in pairs(getMatForColor(matColor)) do
|
||||||
|
mat.call("clickableClues", showCounter)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
-- Removes all clues (to the trash for tokens and counters set to 0) for the requested playmat
|
||||||
|
---@param matColor String Color of the playmat - White, Orange, Green, Red or All
|
||||||
|
PlaymatApi.removeClues = function(matColor)
|
||||||
|
for _, mat in pairs(getMatForColor(matColor)) do
|
||||||
|
mat.call("removeClues")
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
-- Reports the clue count for the requested playmat
|
||||||
|
---@param useClickableCounters Boolean Controls which type of counter is getting checked
|
||||||
|
PlaymatApi.getClueCount = function(useClickableCounters, matColor)
|
||||||
|
local count = 0
|
||||||
|
for _, mat in pairs(getMatForColor(matColor)) do
|
||||||
|
count = count + mat.call("getClueCount", useClickableCounters)
|
||||||
|
end
|
||||||
|
return count
|
||||||
|
end
|
||||||
|
|
||||||
|
-- updates the specified owned counter
|
||||||
|
---@param matColor String Color of the playmat - White, Orange, Green, Red or All
|
||||||
|
---@param type String Counter to target
|
||||||
|
---@param newValue Number Value to set the counter to
|
||||||
|
---@param modifier Number If newValue is not provided, the existing value will be adjusted by this modifier
|
||||||
|
PlaymatApi.updateCounter = function(matColor, type, newValue, modifier)
|
||||||
|
for _, mat in pairs(getMatForColor(matColor)) do
|
||||||
|
mat.call("updateCounter", { type = type, newValue = newValue, modifier = modifier })
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
-- returns the resource counter amount
|
||||||
|
---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support "All")
|
||||||
|
---@param type String Counter to target
|
||||||
|
PlaymatApi.getCounterValue = function(matColor, type)
|
||||||
|
for _, mat in pairs(getMatForColor(matColor)) do
|
||||||
|
return mat.call("getCounterValue", type)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
-- resets the specified skill tracker to "1, 1, 1, 1"
|
||||||
|
---@param matColor String Color of the playmat - White, Orange, Green, Red or All
|
||||||
|
PlaymatApi.resetSkillTracker = function(matColor)
|
||||||
|
for _, mat in pairs(getMatForColor(matColor)) do
|
||||||
|
mat.call("resetSkillTracker")
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
-- finds all objects on the playmat and associated set aside zone and returns a table
|
||||||
|
---@param matColor String Color of the playmat - White, Orange, Green, Red or All
|
||||||
|
---@param filter Function Optional filter function (return true for desired objects)
|
||||||
|
PlaymatApi.searchAroundPlaymat = function(matColor, filter)
|
||||||
|
local objList = {}
|
||||||
|
for _, mat in pairs(getMatForColor(matColor)) do
|
||||||
|
for _, obj in ipairs(mat.call("searchAroundSelf", filter)) do
|
||||||
|
table.insert(objList, obj)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
return objList
|
||||||
|
end
|
||||||
|
|
||||||
|
-- Discard a non-hidden card from the corresponding player's hand
|
||||||
|
---@param matColor String Color of the playmat - White, Orange, Green, Red or All
|
||||||
|
PlaymatApi.doDiscardOne = function(matColor)
|
||||||
|
for _, mat in pairs(getMatForColor(matColor)) do
|
||||||
|
mat.call("doDiscardOne")
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
-- Triggers the metadata sync for all playmats
|
||||||
|
PlaymatApi.syncAllCustomizableCards = function()
|
||||||
|
for _, mat in pairs(getMatForColor("All")) do
|
||||||
|
mat.call("syncAllCustomizableCards")
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
return PlaymatApi
|
||||||
|
end
|
||||||
|
end)
|
||||||
|
__bundle_register("core/GUIDReferenceApi", function(require, _LOADED, __bundle_register, __bundle_modules)
|
||||||
|
do
|
||||||
|
local GUIDReferenceApi = {}
|
||||||
|
|
||||||
|
local function getGuidHandler()
|
||||||
|
return getObjectFromGUID("123456")
|
||||||
|
end
|
||||||
|
|
||||||
|
-- returns all matching objects as a table with references
|
||||||
|
---@param owner String Parent object for this search
|
||||||
|
---@param type String Type of object to search for
|
||||||
|
GUIDReferenceApi.getObjectByOwnerAndType = function(owner, type)
|
||||||
|
return getGuidHandler().call("getObjectByOwnerAndType", { owner = owner, type = type })
|
||||||
|
end
|
||||||
|
|
||||||
|
-- returns all matching objects as a table with references
|
||||||
|
---@param type String Type of object to search for
|
||||||
|
GUIDReferenceApi.getObjectsByType = function(type)
|
||||||
|
return getGuidHandler().call("getObjectsByType", type)
|
||||||
|
end
|
||||||
|
|
||||||
|
-- returns all matching objects as a table with references
|
||||||
|
---@param owner String Parent object for this search
|
||||||
|
GUIDReferenceApi.getObjectsByOwner = function(owner)
|
||||||
|
return getGuidHandler().call("getObjectsByOwner", owner)
|
||||||
|
end
|
||||||
|
|
||||||
|
return GUIDReferenceApi
|
||||||
|
end
|
||||||
|
end)
|
||||||
|
return __bundle_require("__root")
|
@ -32,7 +32,7 @@ HideWhenFaceDown: true
|
|||||||
IgnoreFoW: false
|
IgnoreFoW: false
|
||||||
LayoutGroupSortIndex: 0
|
LayoutGroupSortIndex: 0
|
||||||
Locked: false
|
Locked: false
|
||||||
LuaScript: ''
|
LuaScript: !include 'Card Scroll of Secrets (3) 194d88.ttslua'
|
||||||
LuaScriptState: ''
|
LuaScriptState: ''
|
||||||
MeasureMovement: false
|
MeasureMovement: false
|
||||||
Name: Card
|
Name: Card
|
||||||
|
@ -0,0 +1,436 @@
|
|||||||
|
-- Bundled by luabundle {"version":"1.6.0"}
|
||||||
|
local __bundle_require, __bundle_loaded, __bundle_register, __bundle_modules = (function(superRequire)
|
||||||
|
local loadingPlaceholder = {[{}] = true}
|
||||||
|
|
||||||
|
local register
|
||||||
|
local modules = {}
|
||||||
|
|
||||||
|
local require
|
||||||
|
local loaded = {}
|
||||||
|
|
||||||
|
register = function(name, body)
|
||||||
|
if not modules[name] then
|
||||||
|
modules[name] = body
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
require = function(name)
|
||||||
|
local loadedModule = loaded[name]
|
||||||
|
|
||||||
|
if loadedModule then
|
||||||
|
if loadedModule == loadingPlaceholder then
|
||||||
|
return nil
|
||||||
|
end
|
||||||
|
else
|
||||||
|
if not modules[name] then
|
||||||
|
if not superRequire then
|
||||||
|
local identifier = type(name) == 'string' and '\"' .. name .. '\"' or tostring(name)
|
||||||
|
error('Tried to require ' .. identifier .. ', but no such module has been registered')
|
||||||
|
else
|
||||||
|
return superRequire(name)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
loaded[name] = loadingPlaceholder
|
||||||
|
loadedModule = modules[name](require, loaded, register, modules)
|
||||||
|
loaded[name] = loadedModule
|
||||||
|
end
|
||||||
|
|
||||||
|
return loadedModule
|
||||||
|
end
|
||||||
|
|
||||||
|
return require, loaded, register, modules
|
||||||
|
end)(nil)
|
||||||
|
__bundle_register("playercards/cards/ScrollofSecrets", function(require, _LOADED, __bundle_register, __bundle_modules)
|
||||||
|
-- this script is shared between the lvl 0 and lvl 3 versions of Scroll of Secrets
|
||||||
|
local mythosAreaApi = require("core/MythosAreaApi")
|
||||||
|
local playmatApi = require("playermat/PlaymatApi")
|
||||||
|
|
||||||
|
-- get class via metadata and create context menu accordingly
|
||||||
|
function onLoad()
|
||||||
|
local notes = JSON.decode(self.getGMNotes())
|
||||||
|
if notes then
|
||||||
|
createContextMenu(notes.id)
|
||||||
|
else
|
||||||
|
print("Missing metadata for Scroll of Secrets!")
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
function createContextMenu(id)
|
||||||
|
if id == "05116" or id == "05116-t" then
|
||||||
|
-- lvl 0: draw 1 card from the bottom
|
||||||
|
self.addContextMenuItem("Draw bottom card", function(playerColor) contextFunc(playerColor, 1) end)
|
||||||
|
elseif id == "05188" or id == "05188-t" then
|
||||||
|
-- seeker lvl 3: draw 3 cards from the bottom
|
||||||
|
self.addContextMenuItem("Draw bottom card(s)", function(playerColor) contextFunc(playerColor, 3) end)
|
||||||
|
elseif id == "05189" or id == "05189-t" then
|
||||||
|
-- mystic lvl 3: draw 1 card from the bottom
|
||||||
|
self.addContextMenuItem("Draw bottom card", function(playerColor) contextFunc(playerColor, 1) end)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
function contextFunc(playerColor, amount)
|
||||||
|
local options = { "Encounter Deck" }
|
||||||
|
|
||||||
|
-- check for players with a deck and only display them as option
|
||||||
|
for _, color in ipairs(Player.getAvailableColors()) do
|
||||||
|
local matColor = playmatApi.getMatColor(color)
|
||||||
|
local deckAreaObjects = playmatApi.getDeckAreaObjects(matColor)
|
||||||
|
|
||||||
|
if deckAreaObjects.draw or deckAreaObjects.topCard then
|
||||||
|
table.insert(options, color)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
-- show the target selection dialog
|
||||||
|
Player[playerColor].showOptionsDialog("Select target deck", options, _, function(owner) drawCardsFromBottom(playerColor, owner, amount) end)
|
||||||
|
end
|
||||||
|
|
||||||
|
function drawCardsFromBottom(playerColor, owner, amount)
|
||||||
|
-- variable initialization
|
||||||
|
local deck = nil
|
||||||
|
local deckSize = 1
|
||||||
|
local deckAreaObjects = {}
|
||||||
|
|
||||||
|
-- get the respective deck
|
||||||
|
if owner == "Encounter Deck" then
|
||||||
|
deck = mythosAreaApi.getEncounterDeck()
|
||||||
|
else
|
||||||
|
local matColor = playmatApi.getMatColor(owner)
|
||||||
|
deckAreaObjects = playmatApi.getDeckAreaObjects(matColor)
|
||||||
|
deck = deckAreaObjects.draw
|
||||||
|
end
|
||||||
|
|
||||||
|
-- error handling
|
||||||
|
if not deck then
|
||||||
|
printToColor("Couldn't find deck!", playerColor)
|
||||||
|
return
|
||||||
|
end
|
||||||
|
|
||||||
|
-- set deck size if there is actually a deck and not just a card
|
||||||
|
if deck.type == "Deck" then
|
||||||
|
deckSize = #deck.getObjects()
|
||||||
|
end
|
||||||
|
|
||||||
|
-- proceed according to deck size
|
||||||
|
if deckSize > amount then
|
||||||
|
for i = 1, amount do
|
||||||
|
local card = deck.takeObject({ top = false, flip = true })
|
||||||
|
card.deal(1, playerColor)
|
||||||
|
end
|
||||||
|
else
|
||||||
|
-- deal the whole deck
|
||||||
|
deck.deal(amount, playerColor)
|
||||||
|
|
||||||
|
if deckSize < amount then
|
||||||
|
-- Norman Withers handling
|
||||||
|
if deckAreaObjects.topCard then
|
||||||
|
deckAreaObjects.topCard.deal(1, playerColor)
|
||||||
|
deckSize = deckSize + 1
|
||||||
|
end
|
||||||
|
|
||||||
|
-- warning message for player
|
||||||
|
if deckSize < amount then
|
||||||
|
printToColor("Deck didn't contain enough cards.", playerColor)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
printToColor("Handle the drawn cards according to the ability text on 'Scroll of Secrets'.", playerColor)
|
||||||
|
end
|
||||||
|
end)
|
||||||
|
__bundle_register("core/MythosAreaApi", function(require, _LOADED, __bundle_register, __bundle_modules)
|
||||||
|
do
|
||||||
|
local MythosAreaApi = {}
|
||||||
|
local guidReferenceApi = require("core/GUIDReferenceApi")
|
||||||
|
|
||||||
|
local function getMythosArea()
|
||||||
|
return guidReferenceApi.getObjectByOwnerAndType("Mythos", "MythosArea")
|
||||||
|
end
|
||||||
|
|
||||||
|
-- returns the chaos token metadata (if provided through scenario reference card)
|
||||||
|
MythosAreaApi.returnTokenData = function()
|
||||||
|
return getMythosArea().call("returnTokenData")
|
||||||
|
end
|
||||||
|
|
||||||
|
-- returns an object reference to the encounter deck
|
||||||
|
MythosAreaApi.getEncounterDeck = function()
|
||||||
|
return getMythosArea().call("getEncounterDeck")
|
||||||
|
end
|
||||||
|
|
||||||
|
-- draw an encounter card to the requested position/rotation
|
||||||
|
MythosAreaApi.drawEncounterCard = function(pos, rotY, alwaysFaceUp)
|
||||||
|
getMythosArea().call("drawEncounterCard", {
|
||||||
|
pos = pos,
|
||||||
|
rotY = rotY,
|
||||||
|
alwaysFaceUp = alwaysFaceUp
|
||||||
|
})
|
||||||
|
end
|
||||||
|
|
||||||
|
return MythosAreaApi
|
||||||
|
end
|
||||||
|
end)
|
||||||
|
__bundle_register("playermat/PlaymatApi", function(require, _LOADED, __bundle_register, __bundle_modules)
|
||||||
|
do
|
||||||
|
local PlaymatApi = {}
|
||||||
|
local guidReferenceApi = require("core/GUIDReferenceApi")
|
||||||
|
|
||||||
|
-- Convenience function to look up a mat's object by color, or get all mats.
|
||||||
|
---@param matColor String Color of the playmat - White, Orange, Green, Red or All
|
||||||
|
---@return array Table Single-element if only single playmat is requested
|
||||||
|
local function getMatForColor(matColor)
|
||||||
|
if matColor == "All" then
|
||||||
|
return guidReferenceApi.getObjectsByType("Playermat")
|
||||||
|
else
|
||||||
|
return { matColor = guidReferenceApi.getObjectByOwnerAndType(matColor, "Playermat") }
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
-- Returns the color of the closest playmat
|
||||||
|
---@param startPos Table Starting position to get the closest mat from
|
||||||
|
PlaymatApi.getMatColorByPosition = function(startPos)
|
||||||
|
local result, smallestDistance
|
||||||
|
for matColor, mat in pairs(getMatForColor("All")) do
|
||||||
|
local distance = Vector.between(startPos, mat.getPosition()):magnitude()
|
||||||
|
if smallestDistance == nil or distance < smallestDistance then
|
||||||
|
smallestDistance = distance
|
||||||
|
result = matColor
|
||||||
|
end
|
||||||
|
end
|
||||||
|
return result
|
||||||
|
end
|
||||||
|
|
||||||
|
-- Returns the color of the player's hand that is seated next to the playmat
|
||||||
|
---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support "All")
|
||||||
|
PlaymatApi.getPlayerColor = function(matColor)
|
||||||
|
for _, mat in pairs(getMatForColor(matColor)) do
|
||||||
|
return mat.getVar("playerColor")
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
-- Returns the color of the playmat that owns the playercolor's hand
|
||||||
|
---@param handColor String Color of the playmat
|
||||||
|
PlaymatApi.getMatColor = function(handColor)
|
||||||
|
for matColor, mat in pairs(getMatForColor("All")) do
|
||||||
|
local playerColor = mat.getVar("playerColor")
|
||||||
|
if playerColor == handColor then
|
||||||
|
return matColor
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
-- Returns if there is the card "Dream-Enhancing Serum" on the requested playmat
|
||||||
|
---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support "All")
|
||||||
|
PlaymatApi.isDES = function(matColor)
|
||||||
|
for _, mat in pairs(getMatForColor(matColor)) do
|
||||||
|
return mat.getVar("isDES")
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
-- Performs a search of the deck area of the requested playmat and returns the result as table
|
||||||
|
---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support "All")
|
||||||
|
PlaymatApi.getDeckAreaObjects = function(matColor)
|
||||||
|
for _, mat in pairs(getMatForColor(matColor)) do
|
||||||
|
return mat.call("getDeckAreaObjects")
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
-- Flips the top card of the deck (useful after deck manipulation for Norman Withers)
|
||||||
|
---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support "All")
|
||||||
|
PlaymatApi.flipTopCardFromDeck = function(matColor)
|
||||||
|
for _, mat in pairs(getMatForColor(matColor)) do
|
||||||
|
return mat.call("flipTopCardFromDeck")
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
-- Returns the position of the discard pile of the requested playmat
|
||||||
|
---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support "All")
|
||||||
|
PlaymatApi.getDiscardPosition = function(matColor)
|
||||||
|
for _, mat in pairs(getMatForColor(matColor)) do
|
||||||
|
return mat.call("returnGlobalDiscardPosition")
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
-- Transforms a local position into a global position
|
||||||
|
---@param localPos Table Local position to be transformed
|
||||||
|
---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support "All")
|
||||||
|
PlaymatApi.transformLocalPosition = function(localPos, matColor)
|
||||||
|
for _, mat in pairs(getMatForColor(matColor)) do
|
||||||
|
return mat.positionToWorld(localPos)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
-- Returns the rotation of the requested playmat
|
||||||
|
---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support "All")
|
||||||
|
PlaymatApi.returnRotation = function(matColor)
|
||||||
|
for _, mat in pairs(getMatForColor(matColor)) do
|
||||||
|
return mat.getRotation()
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
-- Triggers the Upkeep for the requested playmat
|
||||||
|
---@param matColor String Color of the playmat - White, Orange, Green, Red or All
|
||||||
|
---@param playerColor String Color of the calling player (for messages)
|
||||||
|
PlaymatApi.doUpkeepFromHotkey = function(matColor, playerColor)
|
||||||
|
for _, mat in pairs(getMatForColor(matColor)) do
|
||||||
|
mat.call("doUpkeepFromHotkey", playerColor)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
-- Handles discarding for the requested playmat for the provided list of objects
|
||||||
|
---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support "All")
|
||||||
|
---@param objList Table List of objects to discard
|
||||||
|
PlaymatApi.discardListOfObjects = function(matColor, objList)
|
||||||
|
for _, mat in pairs(getMatForColor(matColor)) do
|
||||||
|
mat.call("discardListOfObjects", objList)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
-- Returns the active investigator id
|
||||||
|
---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support "All")
|
||||||
|
PlaymatApi.returnInvestigatorId = function(matColor)
|
||||||
|
for _, mat in pairs(getMatForColor(matColor)) do
|
||||||
|
return mat.getVar("activeInvestigatorId")
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
-- Sets the requested playmat's snap points to limit snapping to matching card types or not. If
|
||||||
|
-- matchTypes is true, the main card slot snap points will only snap assets, while the
|
||||||
|
-- investigator area point will only snap Investigators. If matchTypes is false, snap points will
|
||||||
|
-- be reset to snap all cards.
|
||||||
|
---@param matchCardTypes Boolean Whether snap points should only snap for the matching card types
|
||||||
|
---@param matColor String Color of the playmat - White, Orange, Green, Red or All
|
||||||
|
PlaymatApi.setLimitSnapsByType = function(matchCardTypes, matColor)
|
||||||
|
for _, mat in pairs(getMatForColor(matColor)) do
|
||||||
|
mat.call("setLimitSnapsByType", matchCardTypes)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
-- Sets the requested playmat's draw 1 button to visible
|
||||||
|
---@param isDrawButtonVisible Boolean Whether the draw 1 button should be visible or not
|
||||||
|
---@param matColor String Color of the playmat - White, Orange, Green, Red or All
|
||||||
|
PlaymatApi.showDrawButton = function(isDrawButtonVisible, matColor)
|
||||||
|
for _, mat in pairs(getMatForColor(matColor)) do
|
||||||
|
mat.call("showDrawButton", isDrawButtonVisible)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
-- Shows or hides the clickable clue counter for the requested playmat
|
||||||
|
---@param showCounter Boolean Whether the clickable counter should be present or not
|
||||||
|
---@param matColor String Color of the playmat - White, Orange, Green, Red or All
|
||||||
|
PlaymatApi.clickableClues = function(showCounter, matColor)
|
||||||
|
for _, mat in pairs(getMatForColor(matColor)) do
|
||||||
|
mat.call("clickableClues", showCounter)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
-- Removes all clues (to the trash for tokens and counters set to 0) for the requested playmat
|
||||||
|
---@param matColor String Color of the playmat - White, Orange, Green, Red or All
|
||||||
|
PlaymatApi.removeClues = function(matColor)
|
||||||
|
for _, mat in pairs(getMatForColor(matColor)) do
|
||||||
|
mat.call("removeClues")
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
-- Reports the clue count for the requested playmat
|
||||||
|
---@param useClickableCounters Boolean Controls which type of counter is getting checked
|
||||||
|
PlaymatApi.getClueCount = function(useClickableCounters, matColor)
|
||||||
|
local count = 0
|
||||||
|
for _, mat in pairs(getMatForColor(matColor)) do
|
||||||
|
count = count + mat.call("getClueCount", useClickableCounters)
|
||||||
|
end
|
||||||
|
return count
|
||||||
|
end
|
||||||
|
|
||||||
|
-- updates the specified owned counter
|
||||||
|
---@param matColor String Color of the playmat - White, Orange, Green, Red or All
|
||||||
|
---@param type String Counter to target
|
||||||
|
---@param newValue Number Value to set the counter to
|
||||||
|
---@param modifier Number If newValue is not provided, the existing value will be adjusted by this modifier
|
||||||
|
PlaymatApi.updateCounter = function(matColor, type, newValue, modifier)
|
||||||
|
for _, mat in pairs(getMatForColor(matColor)) do
|
||||||
|
mat.call("updateCounter", { type = type, newValue = newValue, modifier = modifier })
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
-- returns the resource counter amount
|
||||||
|
---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support "All")
|
||||||
|
---@param type String Counter to target
|
||||||
|
PlaymatApi.getCounterValue = function(matColor, type)
|
||||||
|
for _, mat in pairs(getMatForColor(matColor)) do
|
||||||
|
return mat.call("getCounterValue", type)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
-- resets the specified skill tracker to "1, 1, 1, 1"
|
||||||
|
---@param matColor String Color of the playmat - White, Orange, Green, Red or All
|
||||||
|
PlaymatApi.resetSkillTracker = function(matColor)
|
||||||
|
for _, mat in pairs(getMatForColor(matColor)) do
|
||||||
|
mat.call("resetSkillTracker")
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
-- finds all objects on the playmat and associated set aside zone and returns a table
|
||||||
|
---@param matColor String Color of the playmat - White, Orange, Green, Red or All
|
||||||
|
---@param filter Function Optional filter function (return true for desired objects)
|
||||||
|
PlaymatApi.searchAroundPlaymat = function(matColor, filter)
|
||||||
|
local objList = {}
|
||||||
|
for _, mat in pairs(getMatForColor(matColor)) do
|
||||||
|
for _, obj in ipairs(mat.call("searchAroundSelf", filter)) do
|
||||||
|
table.insert(objList, obj)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
return objList
|
||||||
|
end
|
||||||
|
|
||||||
|
-- Discard a non-hidden card from the corresponding player's hand
|
||||||
|
---@param matColor String Color of the playmat - White, Orange, Green, Red or All
|
||||||
|
PlaymatApi.doDiscardOne = function(matColor)
|
||||||
|
for _, mat in pairs(getMatForColor(matColor)) do
|
||||||
|
mat.call("doDiscardOne")
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
-- Triggers the metadata sync for all playmats
|
||||||
|
PlaymatApi.syncAllCustomizableCards = function()
|
||||||
|
for _, mat in pairs(getMatForColor("All")) do
|
||||||
|
mat.call("syncAllCustomizableCards")
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
return PlaymatApi
|
||||||
|
end
|
||||||
|
end)
|
||||||
|
__bundle_register("core/GUIDReferenceApi", function(require, _LOADED, __bundle_register, __bundle_modules)
|
||||||
|
do
|
||||||
|
local GUIDReferenceApi = {}
|
||||||
|
|
||||||
|
local function getGuidHandler()
|
||||||
|
return getObjectFromGUID("123456")
|
||||||
|
end
|
||||||
|
|
||||||
|
-- returns all matching objects as a table with references
|
||||||
|
---@param owner String Parent object for this search
|
||||||
|
---@param type String Type of object to search for
|
||||||
|
GUIDReferenceApi.getObjectByOwnerAndType = function(owner, type)
|
||||||
|
return getGuidHandler().call("getObjectByOwnerAndType", { owner = owner, type = type })
|
||||||
|
end
|
||||||
|
|
||||||
|
-- returns all matching objects as a table with references
|
||||||
|
---@param type String Type of object to search for
|
||||||
|
GUIDReferenceApi.getObjectsByType = function(type)
|
||||||
|
return getGuidHandler().call("getObjectsByType", type)
|
||||||
|
end
|
||||||
|
|
||||||
|
-- returns all matching objects as a table with references
|
||||||
|
---@param owner String Parent object for this search
|
||||||
|
GUIDReferenceApi.getObjectsByOwner = function(owner)
|
||||||
|
return getGuidHandler().call("getObjectsByOwner", owner)
|
||||||
|
end
|
||||||
|
|
||||||
|
return GUIDReferenceApi
|
||||||
|
end
|
||||||
|
end)
|
||||||
|
__bundle_register("__root", function(require, _LOADED, __bundle_register, __bundle_modules)
|
||||||
|
require("playercards/cards/ScrollofSecrets")
|
||||||
|
end)
|
||||||
|
return __bundle_require("__root")
|
@ -12,7 +12,7 @@ CustomDeck:
|
|||||||
'3':
|
'3':
|
||||||
BackIsHidden: true
|
BackIsHidden: true
|
||||||
BackURL: https://i.imgur.com/EcbhVuh.jpg/
|
BackURL: https://i.imgur.com/EcbhVuh.jpg/
|
||||||
FaceURL: http://cloud-3.steamusercontent.com/ugc/2021607899142908284/92DF67E4310BCDFAD6C4BB12D31155DBF6B07A25/
|
FaceURL: http://cloud-3.steamusercontent.com/ugc/2115061845812962486/A68B8BF7E4862F21369DAC4A37D813EC664EAC34/
|
||||||
NumHeight: 6
|
NumHeight: 6
|
||||||
NumWidth: 10
|
NumWidth: 10
|
||||||
Type: 0
|
Type: 0
|
||||||
@ -31,7 +31,7 @@ HideWhenFaceDown: true
|
|||||||
IgnoreFoW: false
|
IgnoreFoW: false
|
||||||
LayoutGroupSortIndex: 0
|
LayoutGroupSortIndex: 0
|
||||||
Locked: false
|
Locked: false
|
||||||
LuaScript: ''
|
LuaScript: !include 'Card Scroll of Secrets (Taboo) b383b8.ttslua'
|
||||||
LuaScriptState: ''
|
LuaScriptState: ''
|
||||||
MeasureMovement: false
|
MeasureMovement: false
|
||||||
Name: Card
|
Name: Card
|
||||||
|
@ -0,0 +1,436 @@
|
|||||||
|
-- Bundled by luabundle {"version":"1.6.0"}
|
||||||
|
local __bundle_require, __bundle_loaded, __bundle_register, __bundle_modules = (function(superRequire)
|
||||||
|
local loadingPlaceholder = {[{}] = true}
|
||||||
|
|
||||||
|
local register
|
||||||
|
local modules = {}
|
||||||
|
|
||||||
|
local require
|
||||||
|
local loaded = {}
|
||||||
|
|
||||||
|
register = function(name, body)
|
||||||
|
if not modules[name] then
|
||||||
|
modules[name] = body
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
require = function(name)
|
||||||
|
local loadedModule = loaded[name]
|
||||||
|
|
||||||
|
if loadedModule then
|
||||||
|
if loadedModule == loadingPlaceholder then
|
||||||
|
return nil
|
||||||
|
end
|
||||||
|
else
|
||||||
|
if not modules[name] then
|
||||||
|
if not superRequire then
|
||||||
|
local identifier = type(name) == 'string' and '\"' .. name .. '\"' or tostring(name)
|
||||||
|
error('Tried to require ' .. identifier .. ', but no such module has been registered')
|
||||||
|
else
|
||||||
|
return superRequire(name)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
loaded[name] = loadingPlaceholder
|
||||||
|
loadedModule = modules[name](require, loaded, register, modules)
|
||||||
|
loaded[name] = loadedModule
|
||||||
|
end
|
||||||
|
|
||||||
|
return loadedModule
|
||||||
|
end
|
||||||
|
|
||||||
|
return require, loaded, register, modules
|
||||||
|
end)(nil)
|
||||||
|
__bundle_register("__root", function(require, _LOADED, __bundle_register, __bundle_modules)
|
||||||
|
require("playercards/cards/ScrollofSecrets")
|
||||||
|
end)
|
||||||
|
__bundle_register("playercards/cards/ScrollofSecrets", function(require, _LOADED, __bundle_register, __bundle_modules)
|
||||||
|
-- this script is shared between the lvl 0 and lvl 3 versions of Scroll of Secrets
|
||||||
|
local mythosAreaApi = require("core/MythosAreaApi")
|
||||||
|
local playmatApi = require("playermat/PlaymatApi")
|
||||||
|
|
||||||
|
-- get class via metadata and create context menu accordingly
|
||||||
|
function onLoad()
|
||||||
|
local notes = JSON.decode(self.getGMNotes())
|
||||||
|
if notes then
|
||||||
|
createContextMenu(notes.id)
|
||||||
|
else
|
||||||
|
print("Missing metadata for Scroll of Secrets!")
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
function createContextMenu(id)
|
||||||
|
if id == "05116" or id == "05116-t" then
|
||||||
|
-- lvl 0: draw 1 card from the bottom
|
||||||
|
self.addContextMenuItem("Draw bottom card", function(playerColor) contextFunc(playerColor, 1) end)
|
||||||
|
elseif id == "05188" or id == "05188-t" then
|
||||||
|
-- seeker lvl 3: draw 3 cards from the bottom
|
||||||
|
self.addContextMenuItem("Draw bottom card(s)", function(playerColor) contextFunc(playerColor, 3) end)
|
||||||
|
elseif id == "05189" or id == "05189-t" then
|
||||||
|
-- mystic lvl 3: draw 1 card from the bottom
|
||||||
|
self.addContextMenuItem("Draw bottom card", function(playerColor) contextFunc(playerColor, 1) end)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
function contextFunc(playerColor, amount)
|
||||||
|
local options = { "Encounter Deck" }
|
||||||
|
|
||||||
|
-- check for players with a deck and only display them as option
|
||||||
|
for _, color in ipairs(Player.getAvailableColors()) do
|
||||||
|
local matColor = playmatApi.getMatColor(color)
|
||||||
|
local deckAreaObjects = playmatApi.getDeckAreaObjects(matColor)
|
||||||
|
|
||||||
|
if deckAreaObjects.draw or deckAreaObjects.topCard then
|
||||||
|
table.insert(options, color)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
-- show the target selection dialog
|
||||||
|
Player[playerColor].showOptionsDialog("Select target deck", options, _, function(owner) drawCardsFromBottom(playerColor, owner, amount) end)
|
||||||
|
end
|
||||||
|
|
||||||
|
function drawCardsFromBottom(playerColor, owner, amount)
|
||||||
|
-- variable initialization
|
||||||
|
local deck = nil
|
||||||
|
local deckSize = 1
|
||||||
|
local deckAreaObjects = {}
|
||||||
|
|
||||||
|
-- get the respective deck
|
||||||
|
if owner == "Encounter Deck" then
|
||||||
|
deck = mythosAreaApi.getEncounterDeck()
|
||||||
|
else
|
||||||
|
local matColor = playmatApi.getMatColor(owner)
|
||||||
|
deckAreaObjects = playmatApi.getDeckAreaObjects(matColor)
|
||||||
|
deck = deckAreaObjects.draw
|
||||||
|
end
|
||||||
|
|
||||||
|
-- error handling
|
||||||
|
if not deck then
|
||||||
|
printToColor("Couldn't find deck!", playerColor)
|
||||||
|
return
|
||||||
|
end
|
||||||
|
|
||||||
|
-- set deck size if there is actually a deck and not just a card
|
||||||
|
if deck.type == "Deck" then
|
||||||
|
deckSize = #deck.getObjects()
|
||||||
|
end
|
||||||
|
|
||||||
|
-- proceed according to deck size
|
||||||
|
if deckSize > amount then
|
||||||
|
for i = 1, amount do
|
||||||
|
local card = deck.takeObject({ top = false, flip = true })
|
||||||
|
card.deal(1, playerColor)
|
||||||
|
end
|
||||||
|
else
|
||||||
|
-- deal the whole deck
|
||||||
|
deck.deal(amount, playerColor)
|
||||||
|
|
||||||
|
if deckSize < amount then
|
||||||
|
-- Norman Withers handling
|
||||||
|
if deckAreaObjects.topCard then
|
||||||
|
deckAreaObjects.topCard.deal(1, playerColor)
|
||||||
|
deckSize = deckSize + 1
|
||||||
|
end
|
||||||
|
|
||||||
|
-- warning message for player
|
||||||
|
if deckSize < amount then
|
||||||
|
printToColor("Deck didn't contain enough cards.", playerColor)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
printToColor("Handle the drawn cards according to the ability text on 'Scroll of Secrets'.", playerColor)
|
||||||
|
end
|
||||||
|
end)
|
||||||
|
__bundle_register("core/MythosAreaApi", function(require, _LOADED, __bundle_register, __bundle_modules)
|
||||||
|
do
|
||||||
|
local MythosAreaApi = {}
|
||||||
|
local guidReferenceApi = require("core/GUIDReferenceApi")
|
||||||
|
|
||||||
|
local function getMythosArea()
|
||||||
|
return guidReferenceApi.getObjectByOwnerAndType("Mythos", "MythosArea")
|
||||||
|
end
|
||||||
|
|
||||||
|
-- returns the chaos token metadata (if provided through scenario reference card)
|
||||||
|
MythosAreaApi.returnTokenData = function()
|
||||||
|
return getMythosArea().call("returnTokenData")
|
||||||
|
end
|
||||||
|
|
||||||
|
-- returns an object reference to the encounter deck
|
||||||
|
MythosAreaApi.getEncounterDeck = function()
|
||||||
|
return getMythosArea().call("getEncounterDeck")
|
||||||
|
end
|
||||||
|
|
||||||
|
-- draw an encounter card to the requested position/rotation
|
||||||
|
MythosAreaApi.drawEncounterCard = function(pos, rotY, alwaysFaceUp)
|
||||||
|
getMythosArea().call("drawEncounterCard", {
|
||||||
|
pos = pos,
|
||||||
|
rotY = rotY,
|
||||||
|
alwaysFaceUp = alwaysFaceUp
|
||||||
|
})
|
||||||
|
end
|
||||||
|
|
||||||
|
return MythosAreaApi
|
||||||
|
end
|
||||||
|
end)
|
||||||
|
__bundle_register("playermat/PlaymatApi", function(require, _LOADED, __bundle_register, __bundle_modules)
|
||||||
|
do
|
||||||
|
local PlaymatApi = {}
|
||||||
|
local guidReferenceApi = require("core/GUIDReferenceApi")
|
||||||
|
|
||||||
|
-- Convenience function to look up a mat's object by color, or get all mats.
|
||||||
|
---@param matColor String Color of the playmat - White, Orange, Green, Red or All
|
||||||
|
---@return array Table Single-element if only single playmat is requested
|
||||||
|
local function getMatForColor(matColor)
|
||||||
|
if matColor == "All" then
|
||||||
|
return guidReferenceApi.getObjectsByType("Playermat")
|
||||||
|
else
|
||||||
|
return { matColor = guidReferenceApi.getObjectByOwnerAndType(matColor, "Playermat") }
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
-- Returns the color of the closest playmat
|
||||||
|
---@param startPos Table Starting position to get the closest mat from
|
||||||
|
PlaymatApi.getMatColorByPosition = function(startPos)
|
||||||
|
local result, smallestDistance
|
||||||
|
for matColor, mat in pairs(getMatForColor("All")) do
|
||||||
|
local distance = Vector.between(startPos, mat.getPosition()):magnitude()
|
||||||
|
if smallestDistance == nil or distance < smallestDistance then
|
||||||
|
smallestDistance = distance
|
||||||
|
result = matColor
|
||||||
|
end
|
||||||
|
end
|
||||||
|
return result
|
||||||
|
end
|
||||||
|
|
||||||
|
-- Returns the color of the player's hand that is seated next to the playmat
|
||||||
|
---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support "All")
|
||||||
|
PlaymatApi.getPlayerColor = function(matColor)
|
||||||
|
for _, mat in pairs(getMatForColor(matColor)) do
|
||||||
|
return mat.getVar("playerColor")
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
-- Returns the color of the playmat that owns the playercolor's hand
|
||||||
|
---@param handColor String Color of the playmat
|
||||||
|
PlaymatApi.getMatColor = function(handColor)
|
||||||
|
for matColor, mat in pairs(getMatForColor("All")) do
|
||||||
|
local playerColor = mat.getVar("playerColor")
|
||||||
|
if playerColor == handColor then
|
||||||
|
return matColor
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
-- Returns if there is the card "Dream-Enhancing Serum" on the requested playmat
|
||||||
|
---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support "All")
|
||||||
|
PlaymatApi.isDES = function(matColor)
|
||||||
|
for _, mat in pairs(getMatForColor(matColor)) do
|
||||||
|
return mat.getVar("isDES")
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
-- Performs a search of the deck area of the requested playmat and returns the result as table
|
||||||
|
---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support "All")
|
||||||
|
PlaymatApi.getDeckAreaObjects = function(matColor)
|
||||||
|
for _, mat in pairs(getMatForColor(matColor)) do
|
||||||
|
return mat.call("getDeckAreaObjects")
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
-- Flips the top card of the deck (useful after deck manipulation for Norman Withers)
|
||||||
|
---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support "All")
|
||||||
|
PlaymatApi.flipTopCardFromDeck = function(matColor)
|
||||||
|
for _, mat in pairs(getMatForColor(matColor)) do
|
||||||
|
return mat.call("flipTopCardFromDeck")
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
-- Returns the position of the discard pile of the requested playmat
|
||||||
|
---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support "All")
|
||||||
|
PlaymatApi.getDiscardPosition = function(matColor)
|
||||||
|
for _, mat in pairs(getMatForColor(matColor)) do
|
||||||
|
return mat.call("returnGlobalDiscardPosition")
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
-- Transforms a local position into a global position
|
||||||
|
---@param localPos Table Local position to be transformed
|
||||||
|
---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support "All")
|
||||||
|
PlaymatApi.transformLocalPosition = function(localPos, matColor)
|
||||||
|
for _, mat in pairs(getMatForColor(matColor)) do
|
||||||
|
return mat.positionToWorld(localPos)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
-- Returns the rotation of the requested playmat
|
||||||
|
---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support "All")
|
||||||
|
PlaymatApi.returnRotation = function(matColor)
|
||||||
|
for _, mat in pairs(getMatForColor(matColor)) do
|
||||||
|
return mat.getRotation()
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
-- Triggers the Upkeep for the requested playmat
|
||||||
|
---@param matColor String Color of the playmat - White, Orange, Green, Red or All
|
||||||
|
---@param playerColor String Color of the calling player (for messages)
|
||||||
|
PlaymatApi.doUpkeepFromHotkey = function(matColor, playerColor)
|
||||||
|
for _, mat in pairs(getMatForColor(matColor)) do
|
||||||
|
mat.call("doUpkeepFromHotkey", playerColor)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
-- Handles discarding for the requested playmat for the provided list of objects
|
||||||
|
---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support "All")
|
||||||
|
---@param objList Table List of objects to discard
|
||||||
|
PlaymatApi.discardListOfObjects = function(matColor, objList)
|
||||||
|
for _, mat in pairs(getMatForColor(matColor)) do
|
||||||
|
mat.call("discardListOfObjects", objList)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
-- Returns the active investigator id
|
||||||
|
---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support "All")
|
||||||
|
PlaymatApi.returnInvestigatorId = function(matColor)
|
||||||
|
for _, mat in pairs(getMatForColor(matColor)) do
|
||||||
|
return mat.getVar("activeInvestigatorId")
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
-- Sets the requested playmat's snap points to limit snapping to matching card types or not. If
|
||||||
|
-- matchTypes is true, the main card slot snap points will only snap assets, while the
|
||||||
|
-- investigator area point will only snap Investigators. If matchTypes is false, snap points will
|
||||||
|
-- be reset to snap all cards.
|
||||||
|
---@param matchCardTypes Boolean Whether snap points should only snap for the matching card types
|
||||||
|
---@param matColor String Color of the playmat - White, Orange, Green, Red or All
|
||||||
|
PlaymatApi.setLimitSnapsByType = function(matchCardTypes, matColor)
|
||||||
|
for _, mat in pairs(getMatForColor(matColor)) do
|
||||||
|
mat.call("setLimitSnapsByType", matchCardTypes)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
-- Sets the requested playmat's draw 1 button to visible
|
||||||
|
---@param isDrawButtonVisible Boolean Whether the draw 1 button should be visible or not
|
||||||
|
---@param matColor String Color of the playmat - White, Orange, Green, Red or All
|
||||||
|
PlaymatApi.showDrawButton = function(isDrawButtonVisible, matColor)
|
||||||
|
for _, mat in pairs(getMatForColor(matColor)) do
|
||||||
|
mat.call("showDrawButton", isDrawButtonVisible)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
-- Shows or hides the clickable clue counter for the requested playmat
|
||||||
|
---@param showCounter Boolean Whether the clickable counter should be present or not
|
||||||
|
---@param matColor String Color of the playmat - White, Orange, Green, Red or All
|
||||||
|
PlaymatApi.clickableClues = function(showCounter, matColor)
|
||||||
|
for _, mat in pairs(getMatForColor(matColor)) do
|
||||||
|
mat.call("clickableClues", showCounter)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
-- Removes all clues (to the trash for tokens and counters set to 0) for the requested playmat
|
||||||
|
---@param matColor String Color of the playmat - White, Orange, Green, Red or All
|
||||||
|
PlaymatApi.removeClues = function(matColor)
|
||||||
|
for _, mat in pairs(getMatForColor(matColor)) do
|
||||||
|
mat.call("removeClues")
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
-- Reports the clue count for the requested playmat
|
||||||
|
---@param useClickableCounters Boolean Controls which type of counter is getting checked
|
||||||
|
PlaymatApi.getClueCount = function(useClickableCounters, matColor)
|
||||||
|
local count = 0
|
||||||
|
for _, mat in pairs(getMatForColor(matColor)) do
|
||||||
|
count = count + mat.call("getClueCount", useClickableCounters)
|
||||||
|
end
|
||||||
|
return count
|
||||||
|
end
|
||||||
|
|
||||||
|
-- updates the specified owned counter
|
||||||
|
---@param matColor String Color of the playmat - White, Orange, Green, Red or All
|
||||||
|
---@param type String Counter to target
|
||||||
|
---@param newValue Number Value to set the counter to
|
||||||
|
---@param modifier Number If newValue is not provided, the existing value will be adjusted by this modifier
|
||||||
|
PlaymatApi.updateCounter = function(matColor, type, newValue, modifier)
|
||||||
|
for _, mat in pairs(getMatForColor(matColor)) do
|
||||||
|
mat.call("updateCounter", { type = type, newValue = newValue, modifier = modifier })
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
-- returns the resource counter amount
|
||||||
|
---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support "All")
|
||||||
|
---@param type String Counter to target
|
||||||
|
PlaymatApi.getCounterValue = function(matColor, type)
|
||||||
|
for _, mat in pairs(getMatForColor(matColor)) do
|
||||||
|
return mat.call("getCounterValue", type)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
-- resets the specified skill tracker to "1, 1, 1, 1"
|
||||||
|
---@param matColor String Color of the playmat - White, Orange, Green, Red or All
|
||||||
|
PlaymatApi.resetSkillTracker = function(matColor)
|
||||||
|
for _, mat in pairs(getMatForColor(matColor)) do
|
||||||
|
mat.call("resetSkillTracker")
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
-- finds all objects on the playmat and associated set aside zone and returns a table
|
||||||
|
---@param matColor String Color of the playmat - White, Orange, Green, Red or All
|
||||||
|
---@param filter Function Optional filter function (return true for desired objects)
|
||||||
|
PlaymatApi.searchAroundPlaymat = function(matColor, filter)
|
||||||
|
local objList = {}
|
||||||
|
for _, mat in pairs(getMatForColor(matColor)) do
|
||||||
|
for _, obj in ipairs(mat.call("searchAroundSelf", filter)) do
|
||||||
|
table.insert(objList, obj)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
return objList
|
||||||
|
end
|
||||||
|
|
||||||
|
-- Discard a non-hidden card from the corresponding player's hand
|
||||||
|
---@param matColor String Color of the playmat - White, Orange, Green, Red or All
|
||||||
|
PlaymatApi.doDiscardOne = function(matColor)
|
||||||
|
for _, mat in pairs(getMatForColor(matColor)) do
|
||||||
|
mat.call("doDiscardOne")
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
-- Triggers the metadata sync for all playmats
|
||||||
|
PlaymatApi.syncAllCustomizableCards = function()
|
||||||
|
for _, mat in pairs(getMatForColor("All")) do
|
||||||
|
mat.call("syncAllCustomizableCards")
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
return PlaymatApi
|
||||||
|
end
|
||||||
|
end)
|
||||||
|
__bundle_register("core/GUIDReferenceApi", function(require, _LOADED, __bundle_register, __bundle_modules)
|
||||||
|
do
|
||||||
|
local GUIDReferenceApi = {}
|
||||||
|
|
||||||
|
local function getGuidHandler()
|
||||||
|
return getObjectFromGUID("123456")
|
||||||
|
end
|
||||||
|
|
||||||
|
-- returns all matching objects as a table with references
|
||||||
|
---@param owner String Parent object for this search
|
||||||
|
---@param type String Type of object to search for
|
||||||
|
GUIDReferenceApi.getObjectByOwnerAndType = function(owner, type)
|
||||||
|
return getGuidHandler().call("getObjectByOwnerAndType", { owner = owner, type = type })
|
||||||
|
end
|
||||||
|
|
||||||
|
-- returns all matching objects as a table with references
|
||||||
|
---@param type String Type of object to search for
|
||||||
|
GUIDReferenceApi.getObjectsByType = function(type)
|
||||||
|
return getGuidHandler().call("getObjectsByType", type)
|
||||||
|
end
|
||||||
|
|
||||||
|
-- returns all matching objects as a table with references
|
||||||
|
---@param owner String Parent object for this search
|
||||||
|
GUIDReferenceApi.getObjectsByOwner = function(owner)
|
||||||
|
return getGuidHandler().call("getObjectsByOwner", owner)
|
||||||
|
end
|
||||||
|
|
||||||
|
return GUIDReferenceApi
|
||||||
|
end
|
||||||
|
end)
|
||||||
|
return __bundle_require("__root")
|
@ -31,7 +31,7 @@ HideWhenFaceDown: true
|
|||||||
IgnoreFoW: false
|
IgnoreFoW: false
|
||||||
LayoutGroupSortIndex: 0
|
LayoutGroupSortIndex: 0
|
||||||
Locked: false
|
Locked: false
|
||||||
LuaScript: ''
|
LuaScript: !include 'Card Scroll of Secrets 230835.ttslua'
|
||||||
LuaScriptState: ''
|
LuaScriptState: ''
|
||||||
MeasureMovement: false
|
MeasureMovement: false
|
||||||
Name: Card
|
Name: Card
|
||||||
|
@ -41,6 +41,16 @@ local __bundle_require, __bundle_loaded, __bundle_register, __bundle_modules = (
|
|||||||
|
|
||||||
return require, loaded, register, modules
|
return require, loaded, register, modules
|
||||||
end)(nil)
|
end)(nil)
|
||||||
|
__bundle_register("__root", function(require, _LOADED, __bundle_register, __bundle_modules)
|
||||||
|
require("playercards/cards/SealoftheSeventhSign5")
|
||||||
|
end)
|
||||||
|
__bundle_register("playercards/cards/SealoftheSeventhSign5", function(require, _LOADED, __bundle_register, __bundle_modules)
|
||||||
|
VALID_TOKENS = {
|
||||||
|
["Auto-fail"] = true
|
||||||
|
}
|
||||||
|
|
||||||
|
require("playercards/CardsThatSealTokens")
|
||||||
|
end)
|
||||||
__bundle_register("playercards/CardsThatSealTokens", function(require, _LOADED, __bundle_register, __bundle_modules)
|
__bundle_register("playercards/CardsThatSealTokens", function(require, _LOADED, __bundle_register, __bundle_modules)
|
||||||
--[[ Library for cards that seal tokens
|
--[[ Library for cards that seal tokens
|
||||||
This file is used to add sealing option to cards' context menu.
|
This file is used to add sealing option to cards' context menu.
|
||||||
@ -272,12 +282,13 @@ end)
|
|||||||
__bundle_register("accessories/TokenArrangerApi", function(require, _LOADED, __bundle_register, __bundle_modules)
|
__bundle_register("accessories/TokenArrangerApi", function(require, _LOADED, __bundle_register, __bundle_modules)
|
||||||
do
|
do
|
||||||
local TokenArrangerApi = {}
|
local TokenArrangerApi = {}
|
||||||
|
local guidReferenceApi = require("core/GUIDReferenceApi")
|
||||||
|
|
||||||
-- local function to call the token arranger, if it is on the table
|
-- local function to call the token arranger, if it is on the table
|
||||||
---@param functionName String Name of the function to cal
|
---@param functionName String Name of the function to cal
|
||||||
---@param argument Variant Parameter to pass
|
---@param argument Variant Parameter to pass
|
||||||
local function callIfExistent(functionName, argument)
|
local function callIfExistent(functionName, argument)
|
||||||
local tokenArranger = getObjectsWithTag("TokenArranger")[1]
|
local tokenArranger = guidReferenceApi.getObjectByOwnerAndType("Mythos", "TokenArranger")
|
||||||
if tokenArranger ~= nil then
|
if tokenArranger ~= nil then
|
||||||
tokenArranger.call(functionName, argument)
|
tokenArranger.call(functionName, argument)
|
||||||
end
|
end
|
||||||
@ -305,11 +316,15 @@ end)
|
|||||||
__bundle_register("chaosbag/BlessCurseManagerApi", function(require, _LOADED, __bundle_register, __bundle_modules)
|
__bundle_register("chaosbag/BlessCurseManagerApi", function(require, _LOADED, __bundle_register, __bundle_modules)
|
||||||
do
|
do
|
||||||
local BlessCurseManagerApi = {}
|
local BlessCurseManagerApi = {}
|
||||||
local MANAGER_GUID = "5933fb"
|
local guidReferenceApi = require("core/GUIDReferenceApi")
|
||||||
|
|
||||||
|
local function getManager()
|
||||||
|
return guidReferenceApi.getObjectByOwnerAndType("Mythos", "BlessCurseManager")
|
||||||
|
end
|
||||||
|
|
||||||
-- removes all taken tokens and resets the counts
|
-- removes all taken tokens and resets the counts
|
||||||
BlessCurseManagerApi.removeTakenTokensAndReset = function()
|
BlessCurseManagerApi.removeTakenTokensAndReset = function()
|
||||||
local BlessCurseManager = getObjectFromGUID(MANAGER_GUID)
|
local BlessCurseManager = getManager()
|
||||||
Wait.time(function() BlessCurseManager.call("removeTakenTokens", "Bless") end, 0.05)
|
Wait.time(function() BlessCurseManager.call("removeTakenTokens", "Bless") end, 0.05)
|
||||||
Wait.time(function() BlessCurseManager.call("removeTakenTokens", "Curse") end, 0.10)
|
Wait.time(function() BlessCurseManager.call("removeTakenTokens", "Curse") end, 0.10)
|
||||||
Wait.time(function() BlessCurseManager.call("doReset", "White") end, 0.15)
|
Wait.time(function() BlessCurseManager.call("doReset", "White") end, 0.15)
|
||||||
@ -317,30 +332,30 @@ do
|
|||||||
|
|
||||||
-- updates the internal count (called by cards that seal bless/curse tokens)
|
-- updates the internal count (called by cards that seal bless/curse tokens)
|
||||||
BlessCurseManagerApi.sealedToken = function(type, guid)
|
BlessCurseManagerApi.sealedToken = function(type, guid)
|
||||||
getObjectFromGUID(MANAGER_GUID).call("sealedToken", { type = type, guid = guid })
|
getManager().call("sealedToken", { type = type, guid = guid })
|
||||||
end
|
end
|
||||||
|
|
||||||
-- updates the internal count (called by cards that seal bless/curse tokens)
|
-- updates the internal count (called by cards that seal bless/curse tokens)
|
||||||
BlessCurseManagerApi.releasedToken = function(type, guid)
|
BlessCurseManagerApi.releasedToken = function(type, guid)
|
||||||
getObjectFromGUID(MANAGER_GUID).call("releasedToken", { type = type, guid = guid })
|
getManager().call("releasedToken", { type = type, guid = guid })
|
||||||
end
|
end
|
||||||
|
|
||||||
-- broadcasts the current status for bless/curse tokens
|
-- broadcasts the current status for bless/curse tokens
|
||||||
---@param playerColor String Color of the player to show the broadcast to
|
---@param playerColor String Color of the player to show the broadcast to
|
||||||
BlessCurseManagerApi.broadcastStatus = function(playerColor)
|
BlessCurseManagerApi.broadcastStatus = function(playerColor)
|
||||||
getObjectFromGUID(MANAGER_GUID).call("broadcastStatus", playerColor)
|
getManager().call("broadcastStatus", playerColor)
|
||||||
end
|
end
|
||||||
|
|
||||||
-- removes all bless / curse tokens from the chaos bag and play
|
-- removes all bless / curse tokens from the chaos bag and play
|
||||||
---@param playerColor String Color of the player to show the broadcast to
|
---@param playerColor String Color of the player to show the broadcast to
|
||||||
BlessCurseManagerApi.removeAll = function(playerColor)
|
BlessCurseManagerApi.removeAll = function(playerColor)
|
||||||
getObjectFromGUID(MANAGER_GUID).call("doRemove", playerColor)
|
getManager().call("doRemove", playerColor)
|
||||||
end
|
end
|
||||||
|
|
||||||
-- adds Wendy's menu to the hovered card (allows sealing of tokens)
|
-- adds Wendy's menu to the hovered card (allows sealing of tokens)
|
||||||
---@param color String Color of the player to show the broadcast to
|
---@param color String Color of the player to show the broadcast to
|
||||||
BlessCurseManagerApi.addWendysMenu = function(playerColor, hoveredObject)
|
BlessCurseManagerApi.addWendysMenu = function(playerColor, hoveredObject)
|
||||||
getObjectFromGUID(MANAGER_GUID).call("addMenuOptions", { playerColor = playerColor, hoveredObject = hoveredObject })
|
getManager().call("addMenuOptions", { playerColor = playerColor, hoveredObject = hoveredObject })
|
||||||
end
|
end
|
||||||
|
|
||||||
return BlessCurseManagerApi
|
return BlessCurseManagerApi
|
||||||
@ -422,14 +437,34 @@ do
|
|||||||
return ChaosBagApi
|
return ChaosBagApi
|
||||||
end
|
end
|
||||||
end)
|
end)
|
||||||
__bundle_register("__root", function(require, _LOADED, __bundle_register, __bundle_modules)
|
__bundle_register("core/GUIDReferenceApi", function(require, _LOADED, __bundle_register, __bundle_modules)
|
||||||
require("playercards/cards/SealoftheSeventhSign5")
|
do
|
||||||
end)
|
local GUIDReferenceApi = {}
|
||||||
__bundle_register("playercards/cards/SealoftheSeventhSign5", function(require, _LOADED, __bundle_register, __bundle_modules)
|
|
||||||
VALID_TOKENS = {
|
|
||||||
["Auto-fail"] = true
|
|
||||||
}
|
|
||||||
|
|
||||||
require("playercards/CardsThatSealTokens")
|
local function getGuidHandler()
|
||||||
|
return getObjectFromGUID("123456")
|
||||||
|
end
|
||||||
|
|
||||||
|
-- returns all matching objects as a table with references
|
||||||
|
---@param owner String Parent object for this search
|
||||||
|
---@param type String Type of object to search for
|
||||||
|
GUIDReferenceApi.getObjectByOwnerAndType = function(owner, type)
|
||||||
|
return getGuidHandler().call("getObjectByOwnerAndType", { owner = owner, type = type })
|
||||||
|
end
|
||||||
|
|
||||||
|
-- returns all matching objects as a table with references
|
||||||
|
---@param type String Type of object to search for
|
||||||
|
GUIDReferenceApi.getObjectsByType = function(type)
|
||||||
|
return getGuidHandler().call("getObjectsByType", type)
|
||||||
|
end
|
||||||
|
|
||||||
|
-- returns all matching objects as a table with references
|
||||||
|
---@param owner String Parent object for this search
|
||||||
|
GUIDReferenceApi.getObjectsByOwner = function(owner)
|
||||||
|
return getGuidHandler().call("getObjectsByOwner", owner)
|
||||||
|
end
|
||||||
|
|
||||||
|
return GUIDReferenceApi
|
||||||
|
end
|
||||||
end)
|
end)
|
||||||
return __bundle_require("__root")
|
return __bundle_require("__root")
|
@ -41,126 +41,6 @@ local __bundle_require, __bundle_loaded, __bundle_register, __bundle_modules = (
|
|||||||
|
|
||||||
return require, loaded, register, modules
|
return require, loaded, register, modules
|
||||||
end)(nil)
|
end)(nil)
|
||||||
__bundle_register("chaosbag/BlessCurseManagerApi", function(require, _LOADED, __bundle_register, __bundle_modules)
|
|
||||||
do
|
|
||||||
local BlessCurseManagerApi = {}
|
|
||||||
local MANAGER_GUID = "5933fb"
|
|
||||||
|
|
||||||
-- removes all taken tokens and resets the counts
|
|
||||||
BlessCurseManagerApi.removeTakenTokensAndReset = function()
|
|
||||||
local BlessCurseManager = getObjectFromGUID(MANAGER_GUID)
|
|
||||||
Wait.time(function() BlessCurseManager.call("removeTakenTokens", "Bless") end, 0.05)
|
|
||||||
Wait.time(function() BlessCurseManager.call("removeTakenTokens", "Curse") end, 0.10)
|
|
||||||
Wait.time(function() BlessCurseManager.call("doReset", "White") end, 0.15)
|
|
||||||
end
|
|
||||||
|
|
||||||
-- updates the internal count (called by cards that seal bless/curse tokens)
|
|
||||||
BlessCurseManagerApi.sealedToken = function(type, guid)
|
|
||||||
getObjectFromGUID(MANAGER_GUID).call("sealedToken", { type = type, guid = guid })
|
|
||||||
end
|
|
||||||
|
|
||||||
-- updates the internal count (called by cards that seal bless/curse tokens)
|
|
||||||
BlessCurseManagerApi.releasedToken = function(type, guid)
|
|
||||||
getObjectFromGUID(MANAGER_GUID).call("releasedToken", { type = type, guid = guid })
|
|
||||||
end
|
|
||||||
|
|
||||||
-- broadcasts the current status for bless/curse tokens
|
|
||||||
---@param playerColor String Color of the player to show the broadcast to
|
|
||||||
BlessCurseManagerApi.broadcastStatus = function(playerColor)
|
|
||||||
getObjectFromGUID(MANAGER_GUID).call("broadcastStatus", playerColor)
|
|
||||||
end
|
|
||||||
|
|
||||||
-- removes all bless / curse tokens from the chaos bag and play
|
|
||||||
---@param playerColor String Color of the player to show the broadcast to
|
|
||||||
BlessCurseManagerApi.removeAll = function(playerColor)
|
|
||||||
getObjectFromGUID(MANAGER_GUID).call("doRemove", playerColor)
|
|
||||||
end
|
|
||||||
|
|
||||||
-- adds Wendy's menu to the hovered card (allows sealing of tokens)
|
|
||||||
---@param color String Color of the player to show the broadcast to
|
|
||||||
BlessCurseManagerApi.addWendysMenu = function(playerColor, hoveredObject)
|
|
||||||
getObjectFromGUID(MANAGER_GUID).call("addMenuOptions", { playerColor = playerColor, hoveredObject = hoveredObject })
|
|
||||||
end
|
|
||||||
|
|
||||||
return BlessCurseManagerApi
|
|
||||||
end
|
|
||||||
end)
|
|
||||||
__bundle_register("chaosbag/ChaosBagApi", function(require, _LOADED, __bundle_register, __bundle_modules)
|
|
||||||
do
|
|
||||||
local ChaosBagApi = {}
|
|
||||||
|
|
||||||
-- respawns the chaos bag with a new state of tokens
|
|
||||||
---@param tokenList Table List of chaos token ids
|
|
||||||
ChaosBagApi.setChaosBagState = function(tokenList)
|
|
||||||
return Global.call("setChaosBagState", tokenList)
|
|
||||||
end
|
|
||||||
|
|
||||||
-- returns a Table List of chaos token ids in the current chaos bag
|
|
||||||
-- requires copying the data into a new table because TTS is weird about handling table return values in Global
|
|
||||||
ChaosBagApi.getChaosBagState = function()
|
|
||||||
local chaosBagContentsCatcher = Global.call("getChaosBagState")
|
|
||||||
local chaosBagContents = {}
|
|
||||||
for _, v in ipairs(chaosBagContentsCatcher) do
|
|
||||||
table.insert(chaosBagContents, v)
|
|
||||||
end
|
|
||||||
return chaosBagContents
|
|
||||||
end
|
|
||||||
|
|
||||||
-- checks scripting zone for chaos bag (also called by a lot of objects!)
|
|
||||||
ChaosBagApi.findChaosBag = function()
|
|
||||||
return Global.call("findChaosBag")
|
|
||||||
end
|
|
||||||
|
|
||||||
-- returns a table of object references to the tokens in play (does not include sealed tokens!)
|
|
||||||
ChaosBagApi.getTokensInPlay = function()
|
|
||||||
return Global.getTable("chaosTokens")
|
|
||||||
end
|
|
||||||
|
|
||||||
-- returns all sealed tokens on cards to the chaos bag
|
|
||||||
ChaosBagApi.releaseAllSealedTokens = function(playerColor)
|
|
||||||
return Global.call("releaseAllSealedTokens", playerColor)
|
|
||||||
end
|
|
||||||
|
|
||||||
-- returns all drawn tokens to the chaos bag
|
|
||||||
ChaosBagApi.returnChaosTokens = function(playerColor)
|
|
||||||
return Global.call("returnChaosTokens", playerColor)
|
|
||||||
end
|
|
||||||
|
|
||||||
-- removes the specified chaos token from the chaos bag
|
|
||||||
---@param id String ID of the chaos token
|
|
||||||
ChaosBagApi.removeChaosToken = function(id)
|
|
||||||
return Global.call("removeChaosToken", id)
|
|
||||||
end
|
|
||||||
|
|
||||||
-- spawns the specified chaos token and puts it into the chaos bag
|
|
||||||
---@param id String ID of the chaos token
|
|
||||||
ChaosBagApi.spawnChaosToken = function(id)
|
|
||||||
return Global.call("spawnChaosToken", id)
|
|
||||||
end
|
|
||||||
|
|
||||||
-- Checks to see if the chaos bag can be manipulated. If a player is searching the bag when tokens
|
|
||||||
-- are drawn or replaced a TTS bug can cause those tokens to vanish. Any functions which change the
|
|
||||||
-- contents of the bag should check this method before doing so.
|
|
||||||
-- This method will broadcast a message to all players if the bag is being searched.
|
|
||||||
---@return Boolean. True if the bag is manipulated, false if it should be blocked.
|
|
||||||
ChaosBagApi.canTouchChaosTokens = function()
|
|
||||||
return Global.call("canTouchChaosTokens")
|
|
||||||
end
|
|
||||||
|
|
||||||
-- called by playermats (by the "Draw chaos token" button)
|
|
||||||
ChaosBagApi.drawChaosToken = function(mat, tokenOffset, isRightClick)
|
|
||||||
return Global.call("drawChaosToken", {mat, tokenOffset, isRightClick})
|
|
||||||
end
|
|
||||||
|
|
||||||
-- returns a Table List of chaos token ids in the current chaos bag
|
|
||||||
-- requires copying the data into a new table because TTS is weird about handling table return values in Global
|
|
||||||
ChaosBagApi.getIdUrlMap = function()
|
|
||||||
return Global.getTable("ID_URL_MAP")
|
|
||||||
end
|
|
||||||
|
|
||||||
return ChaosBagApi
|
|
||||||
end
|
|
||||||
end)
|
|
||||||
__bundle_register("__root", function(require, _LOADED, __bundle_register, __bundle_modules)
|
__bundle_register("__root", function(require, _LOADED, __bundle_register, __bundle_modules)
|
||||||
require("playercards/cards/SerpentsofYig")
|
require("playercards/cards/SerpentsofYig")
|
||||||
end)
|
end)
|
||||||
@ -402,12 +282,13 @@ end)
|
|||||||
__bundle_register("accessories/TokenArrangerApi", function(require, _LOADED, __bundle_register, __bundle_modules)
|
__bundle_register("accessories/TokenArrangerApi", function(require, _LOADED, __bundle_register, __bundle_modules)
|
||||||
do
|
do
|
||||||
local TokenArrangerApi = {}
|
local TokenArrangerApi = {}
|
||||||
|
local guidReferenceApi = require("core/GUIDReferenceApi")
|
||||||
|
|
||||||
-- local function to call the token arranger, if it is on the table
|
-- local function to call the token arranger, if it is on the table
|
||||||
---@param functionName String Name of the function to cal
|
---@param functionName String Name of the function to cal
|
||||||
---@param argument Variant Parameter to pass
|
---@param argument Variant Parameter to pass
|
||||||
local function callIfExistent(functionName, argument)
|
local function callIfExistent(functionName, argument)
|
||||||
local tokenArranger = getObjectsWithTag("TokenArranger")[1]
|
local tokenArranger = guidReferenceApi.getObjectByOwnerAndType("Mythos", "TokenArranger")
|
||||||
if tokenArranger ~= nil then
|
if tokenArranger ~= nil then
|
||||||
tokenArranger.call(functionName, argument)
|
tokenArranger.call(functionName, argument)
|
||||||
end
|
end
|
||||||
@ -432,4 +313,158 @@ do
|
|||||||
return TokenArrangerApi
|
return TokenArrangerApi
|
||||||
end
|
end
|
||||||
end)
|
end)
|
||||||
|
__bundle_register("chaosbag/BlessCurseManagerApi", function(require, _LOADED, __bundle_register, __bundle_modules)
|
||||||
|
do
|
||||||
|
local BlessCurseManagerApi = {}
|
||||||
|
local guidReferenceApi = require("core/GUIDReferenceApi")
|
||||||
|
|
||||||
|
local function getManager()
|
||||||
|
return guidReferenceApi.getObjectByOwnerAndType("Mythos", "BlessCurseManager")
|
||||||
|
end
|
||||||
|
|
||||||
|
-- removes all taken tokens and resets the counts
|
||||||
|
BlessCurseManagerApi.removeTakenTokensAndReset = function()
|
||||||
|
local BlessCurseManager = getManager()
|
||||||
|
Wait.time(function() BlessCurseManager.call("removeTakenTokens", "Bless") end, 0.05)
|
||||||
|
Wait.time(function() BlessCurseManager.call("removeTakenTokens", "Curse") end, 0.10)
|
||||||
|
Wait.time(function() BlessCurseManager.call("doReset", "White") end, 0.15)
|
||||||
|
end
|
||||||
|
|
||||||
|
-- updates the internal count (called by cards that seal bless/curse tokens)
|
||||||
|
BlessCurseManagerApi.sealedToken = function(type, guid)
|
||||||
|
getManager().call("sealedToken", { type = type, guid = guid })
|
||||||
|
end
|
||||||
|
|
||||||
|
-- updates the internal count (called by cards that seal bless/curse tokens)
|
||||||
|
BlessCurseManagerApi.releasedToken = function(type, guid)
|
||||||
|
getManager().call("releasedToken", { type = type, guid = guid })
|
||||||
|
end
|
||||||
|
|
||||||
|
-- broadcasts the current status for bless/curse tokens
|
||||||
|
---@param playerColor String Color of the player to show the broadcast to
|
||||||
|
BlessCurseManagerApi.broadcastStatus = function(playerColor)
|
||||||
|
getManager().call("broadcastStatus", playerColor)
|
||||||
|
end
|
||||||
|
|
||||||
|
-- removes all bless / curse tokens from the chaos bag and play
|
||||||
|
---@param playerColor String Color of the player to show the broadcast to
|
||||||
|
BlessCurseManagerApi.removeAll = function(playerColor)
|
||||||
|
getManager().call("doRemove", playerColor)
|
||||||
|
end
|
||||||
|
|
||||||
|
-- adds Wendy's menu to the hovered card (allows sealing of tokens)
|
||||||
|
---@param color String Color of the player to show the broadcast to
|
||||||
|
BlessCurseManagerApi.addWendysMenu = function(playerColor, hoveredObject)
|
||||||
|
getManager().call("addMenuOptions", { playerColor = playerColor, hoveredObject = hoveredObject })
|
||||||
|
end
|
||||||
|
|
||||||
|
return BlessCurseManagerApi
|
||||||
|
end
|
||||||
|
end)
|
||||||
|
__bundle_register("chaosbag/ChaosBagApi", function(require, _LOADED, __bundle_register, __bundle_modules)
|
||||||
|
do
|
||||||
|
local ChaosBagApi = {}
|
||||||
|
|
||||||
|
-- respawns the chaos bag with a new state of tokens
|
||||||
|
---@param tokenList Table List of chaos token ids
|
||||||
|
ChaosBagApi.setChaosBagState = function(tokenList)
|
||||||
|
return Global.call("setChaosBagState", tokenList)
|
||||||
|
end
|
||||||
|
|
||||||
|
-- returns a Table List of chaos token ids in the current chaos bag
|
||||||
|
-- requires copying the data into a new table because TTS is weird about handling table return values in Global
|
||||||
|
ChaosBagApi.getChaosBagState = function()
|
||||||
|
local chaosBagContentsCatcher = Global.call("getChaosBagState")
|
||||||
|
local chaosBagContents = {}
|
||||||
|
for _, v in ipairs(chaosBagContentsCatcher) do
|
||||||
|
table.insert(chaosBagContents, v)
|
||||||
|
end
|
||||||
|
return chaosBagContents
|
||||||
|
end
|
||||||
|
|
||||||
|
-- checks scripting zone for chaos bag (also called by a lot of objects!)
|
||||||
|
ChaosBagApi.findChaosBag = function()
|
||||||
|
return Global.call("findChaosBag")
|
||||||
|
end
|
||||||
|
|
||||||
|
-- returns a table of object references to the tokens in play (does not include sealed tokens!)
|
||||||
|
ChaosBagApi.getTokensInPlay = function()
|
||||||
|
return Global.getTable("chaosTokens")
|
||||||
|
end
|
||||||
|
|
||||||
|
-- returns all sealed tokens on cards to the chaos bag
|
||||||
|
ChaosBagApi.releaseAllSealedTokens = function(playerColor)
|
||||||
|
return Global.call("releaseAllSealedTokens", playerColor)
|
||||||
|
end
|
||||||
|
|
||||||
|
-- returns all drawn tokens to the chaos bag
|
||||||
|
ChaosBagApi.returnChaosTokens = function(playerColor)
|
||||||
|
return Global.call("returnChaosTokens", playerColor)
|
||||||
|
end
|
||||||
|
|
||||||
|
-- removes the specified chaos token from the chaos bag
|
||||||
|
---@param id String ID of the chaos token
|
||||||
|
ChaosBagApi.removeChaosToken = function(id)
|
||||||
|
return Global.call("removeChaosToken", id)
|
||||||
|
end
|
||||||
|
|
||||||
|
-- spawns the specified chaos token and puts it into the chaos bag
|
||||||
|
---@param id String ID of the chaos token
|
||||||
|
ChaosBagApi.spawnChaosToken = function(id)
|
||||||
|
return Global.call("spawnChaosToken", id)
|
||||||
|
end
|
||||||
|
|
||||||
|
-- Checks to see if the chaos bag can be manipulated. If a player is searching the bag when tokens
|
||||||
|
-- are drawn or replaced a TTS bug can cause those tokens to vanish. Any functions which change the
|
||||||
|
-- contents of the bag should check this method before doing so.
|
||||||
|
-- This method will broadcast a message to all players if the bag is being searched.
|
||||||
|
---@return Boolean. True if the bag is manipulated, false if it should be blocked.
|
||||||
|
ChaosBagApi.canTouchChaosTokens = function()
|
||||||
|
return Global.call("canTouchChaosTokens")
|
||||||
|
end
|
||||||
|
|
||||||
|
-- called by playermats (by the "Draw chaos token" button)
|
||||||
|
ChaosBagApi.drawChaosToken = function(mat, tokenOffset, isRightClick)
|
||||||
|
return Global.call("drawChaosToken", {mat, tokenOffset, isRightClick})
|
||||||
|
end
|
||||||
|
|
||||||
|
-- returns a Table List of chaos token ids in the current chaos bag
|
||||||
|
-- requires copying the data into a new table because TTS is weird about handling table return values in Global
|
||||||
|
ChaosBagApi.getIdUrlMap = function()
|
||||||
|
return Global.getTable("ID_URL_MAP")
|
||||||
|
end
|
||||||
|
|
||||||
|
return ChaosBagApi
|
||||||
|
end
|
||||||
|
end)
|
||||||
|
__bundle_register("core/GUIDReferenceApi", function(require, _LOADED, __bundle_register, __bundle_modules)
|
||||||
|
do
|
||||||
|
local GUIDReferenceApi = {}
|
||||||
|
|
||||||
|
local function getGuidHandler()
|
||||||
|
return getObjectFromGUID("123456")
|
||||||
|
end
|
||||||
|
|
||||||
|
-- returns all matching objects as a table with references
|
||||||
|
---@param owner String Parent object for this search
|
||||||
|
---@param type String Type of object to search for
|
||||||
|
GUIDReferenceApi.getObjectByOwnerAndType = function(owner, type)
|
||||||
|
return getGuidHandler().call("getObjectByOwnerAndType", { owner = owner, type = type })
|
||||||
|
end
|
||||||
|
|
||||||
|
-- returns all matching objects as a table with references
|
||||||
|
---@param type String Type of object to search for
|
||||||
|
GUIDReferenceApi.getObjectsByType = function(type)
|
||||||
|
return getGuidHandler().call("getObjectsByType", type)
|
||||||
|
end
|
||||||
|
|
||||||
|
-- returns all matching objects as a table with references
|
||||||
|
---@param owner String Parent object for this search
|
||||||
|
GUIDReferenceApi.getObjectsByOwner = function(owner)
|
||||||
|
return getGuidHandler().call("getObjectsByOwner", owner)
|
||||||
|
end
|
||||||
|
|
||||||
|
return GUIDReferenceApi
|
||||||
|
end
|
||||||
|
end)
|
||||||
return __bundle_require("__root")
|
return __bundle_require("__root")
|
@ -284,12 +284,13 @@ end)
|
|||||||
__bundle_register("accessories/TokenArrangerApi", function(require, _LOADED, __bundle_register, __bundle_modules)
|
__bundle_register("accessories/TokenArrangerApi", function(require, _LOADED, __bundle_register, __bundle_modules)
|
||||||
do
|
do
|
||||||
local TokenArrangerApi = {}
|
local TokenArrangerApi = {}
|
||||||
|
local guidReferenceApi = require("core/GUIDReferenceApi")
|
||||||
|
|
||||||
-- local function to call the token arranger, if it is on the table
|
-- local function to call the token arranger, if it is on the table
|
||||||
---@param functionName String Name of the function to cal
|
---@param functionName String Name of the function to cal
|
||||||
---@param argument Variant Parameter to pass
|
---@param argument Variant Parameter to pass
|
||||||
local function callIfExistent(functionName, argument)
|
local function callIfExistent(functionName, argument)
|
||||||
local tokenArranger = getObjectsWithTag("TokenArranger")[1]
|
local tokenArranger = guidReferenceApi.getObjectByOwnerAndType("Mythos", "TokenArranger")
|
||||||
if tokenArranger ~= nil then
|
if tokenArranger ~= nil then
|
||||||
tokenArranger.call(functionName, argument)
|
tokenArranger.call(functionName, argument)
|
||||||
end
|
end
|
||||||
@ -317,11 +318,15 @@ end)
|
|||||||
__bundle_register("chaosbag/BlessCurseManagerApi", function(require, _LOADED, __bundle_register, __bundle_modules)
|
__bundle_register("chaosbag/BlessCurseManagerApi", function(require, _LOADED, __bundle_register, __bundle_modules)
|
||||||
do
|
do
|
||||||
local BlessCurseManagerApi = {}
|
local BlessCurseManagerApi = {}
|
||||||
local MANAGER_GUID = "5933fb"
|
local guidReferenceApi = require("core/GUIDReferenceApi")
|
||||||
|
|
||||||
|
local function getManager()
|
||||||
|
return guidReferenceApi.getObjectByOwnerAndType("Mythos", "BlessCurseManager")
|
||||||
|
end
|
||||||
|
|
||||||
-- removes all taken tokens and resets the counts
|
-- removes all taken tokens and resets the counts
|
||||||
BlessCurseManagerApi.removeTakenTokensAndReset = function()
|
BlessCurseManagerApi.removeTakenTokensAndReset = function()
|
||||||
local BlessCurseManager = getObjectFromGUID(MANAGER_GUID)
|
local BlessCurseManager = getManager()
|
||||||
Wait.time(function() BlessCurseManager.call("removeTakenTokens", "Bless") end, 0.05)
|
Wait.time(function() BlessCurseManager.call("removeTakenTokens", "Bless") end, 0.05)
|
||||||
Wait.time(function() BlessCurseManager.call("removeTakenTokens", "Curse") end, 0.10)
|
Wait.time(function() BlessCurseManager.call("removeTakenTokens", "Curse") end, 0.10)
|
||||||
Wait.time(function() BlessCurseManager.call("doReset", "White") end, 0.15)
|
Wait.time(function() BlessCurseManager.call("doReset", "White") end, 0.15)
|
||||||
@ -329,30 +334,30 @@ do
|
|||||||
|
|
||||||
-- updates the internal count (called by cards that seal bless/curse tokens)
|
-- updates the internal count (called by cards that seal bless/curse tokens)
|
||||||
BlessCurseManagerApi.sealedToken = function(type, guid)
|
BlessCurseManagerApi.sealedToken = function(type, guid)
|
||||||
getObjectFromGUID(MANAGER_GUID).call("sealedToken", { type = type, guid = guid })
|
getManager().call("sealedToken", { type = type, guid = guid })
|
||||||
end
|
end
|
||||||
|
|
||||||
-- updates the internal count (called by cards that seal bless/curse tokens)
|
-- updates the internal count (called by cards that seal bless/curse tokens)
|
||||||
BlessCurseManagerApi.releasedToken = function(type, guid)
|
BlessCurseManagerApi.releasedToken = function(type, guid)
|
||||||
getObjectFromGUID(MANAGER_GUID).call("releasedToken", { type = type, guid = guid })
|
getManager().call("releasedToken", { type = type, guid = guid })
|
||||||
end
|
end
|
||||||
|
|
||||||
-- broadcasts the current status for bless/curse tokens
|
-- broadcasts the current status for bless/curse tokens
|
||||||
---@param playerColor String Color of the player to show the broadcast to
|
---@param playerColor String Color of the player to show the broadcast to
|
||||||
BlessCurseManagerApi.broadcastStatus = function(playerColor)
|
BlessCurseManagerApi.broadcastStatus = function(playerColor)
|
||||||
getObjectFromGUID(MANAGER_GUID).call("broadcastStatus", playerColor)
|
getManager().call("broadcastStatus", playerColor)
|
||||||
end
|
end
|
||||||
|
|
||||||
-- removes all bless / curse tokens from the chaos bag and play
|
-- removes all bless / curse tokens from the chaos bag and play
|
||||||
---@param playerColor String Color of the player to show the broadcast to
|
---@param playerColor String Color of the player to show the broadcast to
|
||||||
BlessCurseManagerApi.removeAll = function(playerColor)
|
BlessCurseManagerApi.removeAll = function(playerColor)
|
||||||
getObjectFromGUID(MANAGER_GUID).call("doRemove", playerColor)
|
getManager().call("doRemove", playerColor)
|
||||||
end
|
end
|
||||||
|
|
||||||
-- adds Wendy's menu to the hovered card (allows sealing of tokens)
|
-- adds Wendy's menu to the hovered card (allows sealing of tokens)
|
||||||
---@param color String Color of the player to show the broadcast to
|
---@param color String Color of the player to show the broadcast to
|
||||||
BlessCurseManagerApi.addWendysMenu = function(playerColor, hoveredObject)
|
BlessCurseManagerApi.addWendysMenu = function(playerColor, hoveredObject)
|
||||||
getObjectFromGUID(MANAGER_GUID).call("addMenuOptions", { playerColor = playerColor, hoveredObject = hoveredObject })
|
getManager().call("addMenuOptions", { playerColor = playerColor, hoveredObject = hoveredObject })
|
||||||
end
|
end
|
||||||
|
|
||||||
return BlessCurseManagerApi
|
return BlessCurseManagerApi
|
||||||
@ -434,4 +439,34 @@ do
|
|||||||
return ChaosBagApi
|
return ChaosBagApi
|
||||||
end
|
end
|
||||||
end)
|
end)
|
||||||
|
__bundle_register("core/GUIDReferenceApi", function(require, _LOADED, __bundle_register, __bundle_modules)
|
||||||
|
do
|
||||||
|
local GUIDReferenceApi = {}
|
||||||
|
|
||||||
|
local function getGuidHandler()
|
||||||
|
return getObjectFromGUID("123456")
|
||||||
|
end
|
||||||
|
|
||||||
|
-- returns all matching objects as a table with references
|
||||||
|
---@param owner String Parent object for this search
|
||||||
|
---@param type String Type of object to search for
|
||||||
|
GUIDReferenceApi.getObjectByOwnerAndType = function(owner, type)
|
||||||
|
return getGuidHandler().call("getObjectByOwnerAndType", { owner = owner, type = type })
|
||||||
|
end
|
||||||
|
|
||||||
|
-- returns all matching objects as a table with references
|
||||||
|
---@param type String Type of object to search for
|
||||||
|
GUIDReferenceApi.getObjectsByType = function(type)
|
||||||
|
return getGuidHandler().call("getObjectsByType", type)
|
||||||
|
end
|
||||||
|
|
||||||
|
-- returns all matching objects as a table with references
|
||||||
|
---@param owner String Parent object for this search
|
||||||
|
GUIDReferenceApi.getObjectsByOwner = function(owner)
|
||||||
|
return getGuidHandler().call("getObjectsByOwner", owner)
|
||||||
|
end
|
||||||
|
|
||||||
|
return GUIDReferenceApi
|
||||||
|
end
|
||||||
|
end)
|
||||||
return __bundle_require("__root")
|
return __bundle_require("__root")
|
@ -12,7 +12,7 @@ CustomDeck:
|
|||||||
'3':
|
'3':
|
||||||
BackIsHidden: true
|
BackIsHidden: true
|
||||||
BackURL: https://i.imgur.com/EcbhVuh.jpg/
|
BackURL: https://i.imgur.com/EcbhVuh.jpg/
|
||||||
FaceURL: http://cloud-3.steamusercontent.com/ugc/2021607899142908284/92DF67E4310BCDFAD6C4BB12D31155DBF6B07A25/
|
FaceURL: http://cloud-3.steamusercontent.com/ugc/2115061845812962486/A68B8BF7E4862F21369DAC4A37D813EC664EAC34/
|
||||||
NumHeight: 6
|
NumHeight: 6
|
||||||
NumWidth: 10
|
NumWidth: 10
|
||||||
Type: 0
|
Type: 0
|
||||||
|
@ -12,7 +12,7 @@ CustomDeck:
|
|||||||
'3':
|
'3':
|
||||||
BackIsHidden: true
|
BackIsHidden: true
|
||||||
BackURL: https://i.imgur.com/EcbhVuh.jpg/
|
BackURL: https://i.imgur.com/EcbhVuh.jpg/
|
||||||
FaceURL: http://cloud-3.steamusercontent.com/ugc/2021607899142908284/92DF67E4310BCDFAD6C4BB12D31155DBF6B07A25/
|
FaceURL: http://cloud-3.steamusercontent.com/ugc/2115061845812962486/A68B8BF7E4862F21369DAC4A37D813EC664EAC34/
|
||||||
NumHeight: 6
|
NumHeight: 6
|
||||||
NumWidth: 10
|
NumWidth: 10
|
||||||
Type: 0
|
Type: 0
|
||||||
|
@ -41,6 +41,112 @@ local __bundle_require, __bundle_loaded, __bundle_register, __bundle_modules = (
|
|||||||
|
|
||||||
return require, loaded, register, modules
|
return require, loaded, register, modules
|
||||||
end)(nil)
|
end)(nil)
|
||||||
|
__bundle_register("chaosbag/ChaosBagApi", function(require, _LOADED, __bundle_register, __bundle_modules)
|
||||||
|
do
|
||||||
|
local ChaosBagApi = {}
|
||||||
|
|
||||||
|
-- respawns the chaos bag with a new state of tokens
|
||||||
|
---@param tokenList Table List of chaos token ids
|
||||||
|
ChaosBagApi.setChaosBagState = function(tokenList)
|
||||||
|
return Global.call("setChaosBagState", tokenList)
|
||||||
|
end
|
||||||
|
|
||||||
|
-- returns a Table List of chaos token ids in the current chaos bag
|
||||||
|
-- requires copying the data into a new table because TTS is weird about handling table return values in Global
|
||||||
|
ChaosBagApi.getChaosBagState = function()
|
||||||
|
local chaosBagContentsCatcher = Global.call("getChaosBagState")
|
||||||
|
local chaosBagContents = {}
|
||||||
|
for _, v in ipairs(chaosBagContentsCatcher) do
|
||||||
|
table.insert(chaosBagContents, v)
|
||||||
|
end
|
||||||
|
return chaosBagContents
|
||||||
|
end
|
||||||
|
|
||||||
|
-- checks scripting zone for chaos bag (also called by a lot of objects!)
|
||||||
|
ChaosBagApi.findChaosBag = function()
|
||||||
|
return Global.call("findChaosBag")
|
||||||
|
end
|
||||||
|
|
||||||
|
-- returns a table of object references to the tokens in play (does not include sealed tokens!)
|
||||||
|
ChaosBagApi.getTokensInPlay = function()
|
||||||
|
return Global.getTable("chaosTokens")
|
||||||
|
end
|
||||||
|
|
||||||
|
-- returns all sealed tokens on cards to the chaos bag
|
||||||
|
ChaosBagApi.releaseAllSealedTokens = function(playerColor)
|
||||||
|
return Global.call("releaseAllSealedTokens", playerColor)
|
||||||
|
end
|
||||||
|
|
||||||
|
-- returns all drawn tokens to the chaos bag
|
||||||
|
ChaosBagApi.returnChaosTokens = function(playerColor)
|
||||||
|
return Global.call("returnChaosTokens", playerColor)
|
||||||
|
end
|
||||||
|
|
||||||
|
-- removes the specified chaos token from the chaos bag
|
||||||
|
---@param id String ID of the chaos token
|
||||||
|
ChaosBagApi.removeChaosToken = function(id)
|
||||||
|
return Global.call("removeChaosToken", id)
|
||||||
|
end
|
||||||
|
|
||||||
|
-- spawns the specified chaos token and puts it into the chaos bag
|
||||||
|
---@param id String ID of the chaos token
|
||||||
|
ChaosBagApi.spawnChaosToken = function(id)
|
||||||
|
return Global.call("spawnChaosToken", id)
|
||||||
|
end
|
||||||
|
|
||||||
|
-- Checks to see if the chaos bag can be manipulated. If a player is searching the bag when tokens
|
||||||
|
-- are drawn or replaced a TTS bug can cause those tokens to vanish. Any functions which change the
|
||||||
|
-- contents of the bag should check this method before doing so.
|
||||||
|
-- This method will broadcast a message to all players if the bag is being searched.
|
||||||
|
---@return Boolean. True if the bag is manipulated, false if it should be blocked.
|
||||||
|
ChaosBagApi.canTouchChaosTokens = function()
|
||||||
|
return Global.call("canTouchChaosTokens")
|
||||||
|
end
|
||||||
|
|
||||||
|
-- called by playermats (by the "Draw chaos token" button)
|
||||||
|
ChaosBagApi.drawChaosToken = function(mat, tokenOffset, isRightClick)
|
||||||
|
return Global.call("drawChaosToken", {mat, tokenOffset, isRightClick})
|
||||||
|
end
|
||||||
|
|
||||||
|
-- returns a Table List of chaos token ids in the current chaos bag
|
||||||
|
-- requires copying the data into a new table because TTS is weird about handling table return values in Global
|
||||||
|
ChaosBagApi.getIdUrlMap = function()
|
||||||
|
return Global.getTable("ID_URL_MAP")
|
||||||
|
end
|
||||||
|
|
||||||
|
return ChaosBagApi
|
||||||
|
end
|
||||||
|
end)
|
||||||
|
__bundle_register("core/GUIDReferenceApi", function(require, _LOADED, __bundle_register, __bundle_modules)
|
||||||
|
do
|
||||||
|
local GUIDReferenceApi = {}
|
||||||
|
|
||||||
|
local function getGuidHandler()
|
||||||
|
return getObjectFromGUID("123456")
|
||||||
|
end
|
||||||
|
|
||||||
|
-- returns all matching objects as a table with references
|
||||||
|
---@param owner String Parent object for this search
|
||||||
|
---@param type String Type of object to search for
|
||||||
|
GUIDReferenceApi.getObjectByOwnerAndType = function(owner, type)
|
||||||
|
return getGuidHandler().call("getObjectByOwnerAndType", { owner = owner, type = type })
|
||||||
|
end
|
||||||
|
|
||||||
|
-- returns all matching objects as a table with references
|
||||||
|
---@param type String Type of object to search for
|
||||||
|
GUIDReferenceApi.getObjectsByType = function(type)
|
||||||
|
return getGuidHandler().call("getObjectsByType", type)
|
||||||
|
end
|
||||||
|
|
||||||
|
-- returns all matching objects as a table with references
|
||||||
|
---@param owner String Parent object for this search
|
||||||
|
GUIDReferenceApi.getObjectsByOwner = function(owner)
|
||||||
|
return getGuidHandler().call("getObjectsByOwner", owner)
|
||||||
|
end
|
||||||
|
|
||||||
|
return GUIDReferenceApi
|
||||||
|
end
|
||||||
|
end)
|
||||||
__bundle_register("__root", function(require, _LOADED, __bundle_register, __bundle_modules)
|
__bundle_register("__root", function(require, _LOADED, __bundle_register, __bundle_modules)
|
||||||
require("playercards/cards/ShieldofFaith2")
|
require("playercards/cards/ShieldofFaith2")
|
||||||
end)
|
end)
|
||||||
@ -285,12 +391,13 @@ end)
|
|||||||
__bundle_register("accessories/TokenArrangerApi", function(require, _LOADED, __bundle_register, __bundle_modules)
|
__bundle_register("accessories/TokenArrangerApi", function(require, _LOADED, __bundle_register, __bundle_modules)
|
||||||
do
|
do
|
||||||
local TokenArrangerApi = {}
|
local TokenArrangerApi = {}
|
||||||
|
local guidReferenceApi = require("core/GUIDReferenceApi")
|
||||||
|
|
||||||
-- local function to call the token arranger, if it is on the table
|
-- local function to call the token arranger, if it is on the table
|
||||||
---@param functionName String Name of the function to cal
|
---@param functionName String Name of the function to cal
|
||||||
---@param argument Variant Parameter to pass
|
---@param argument Variant Parameter to pass
|
||||||
local function callIfExistent(functionName, argument)
|
local function callIfExistent(functionName, argument)
|
||||||
local tokenArranger = getObjectsWithTag("TokenArranger")[1]
|
local tokenArranger = guidReferenceApi.getObjectByOwnerAndType("Mythos", "TokenArranger")
|
||||||
if tokenArranger ~= nil then
|
if tokenArranger ~= nil then
|
||||||
tokenArranger.call(functionName, argument)
|
tokenArranger.call(functionName, argument)
|
||||||
end
|
end
|
||||||
@ -318,11 +425,15 @@ end)
|
|||||||
__bundle_register("chaosbag/BlessCurseManagerApi", function(require, _LOADED, __bundle_register, __bundle_modules)
|
__bundle_register("chaosbag/BlessCurseManagerApi", function(require, _LOADED, __bundle_register, __bundle_modules)
|
||||||
do
|
do
|
||||||
local BlessCurseManagerApi = {}
|
local BlessCurseManagerApi = {}
|
||||||
local MANAGER_GUID = "5933fb"
|
local guidReferenceApi = require("core/GUIDReferenceApi")
|
||||||
|
|
||||||
|
local function getManager()
|
||||||
|
return guidReferenceApi.getObjectByOwnerAndType("Mythos", "BlessCurseManager")
|
||||||
|
end
|
||||||
|
|
||||||
-- removes all taken tokens and resets the counts
|
-- removes all taken tokens and resets the counts
|
||||||
BlessCurseManagerApi.removeTakenTokensAndReset = function()
|
BlessCurseManagerApi.removeTakenTokensAndReset = function()
|
||||||
local BlessCurseManager = getObjectFromGUID(MANAGER_GUID)
|
local BlessCurseManager = getManager()
|
||||||
Wait.time(function() BlessCurseManager.call("removeTakenTokens", "Bless") end, 0.05)
|
Wait.time(function() BlessCurseManager.call("removeTakenTokens", "Bless") end, 0.05)
|
||||||
Wait.time(function() BlessCurseManager.call("removeTakenTokens", "Curse") end, 0.10)
|
Wait.time(function() BlessCurseManager.call("removeTakenTokens", "Curse") end, 0.10)
|
||||||
Wait.time(function() BlessCurseManager.call("doReset", "White") end, 0.15)
|
Wait.time(function() BlessCurseManager.call("doReset", "White") end, 0.15)
|
||||||
@ -330,109 +441,33 @@ do
|
|||||||
|
|
||||||
-- updates the internal count (called by cards that seal bless/curse tokens)
|
-- updates the internal count (called by cards that seal bless/curse tokens)
|
||||||
BlessCurseManagerApi.sealedToken = function(type, guid)
|
BlessCurseManagerApi.sealedToken = function(type, guid)
|
||||||
getObjectFromGUID(MANAGER_GUID).call("sealedToken", { type = type, guid = guid })
|
getManager().call("sealedToken", { type = type, guid = guid })
|
||||||
end
|
end
|
||||||
|
|
||||||
-- updates the internal count (called by cards that seal bless/curse tokens)
|
-- updates the internal count (called by cards that seal bless/curse tokens)
|
||||||
BlessCurseManagerApi.releasedToken = function(type, guid)
|
BlessCurseManagerApi.releasedToken = function(type, guid)
|
||||||
getObjectFromGUID(MANAGER_GUID).call("releasedToken", { type = type, guid = guid })
|
getManager().call("releasedToken", { type = type, guid = guid })
|
||||||
end
|
end
|
||||||
|
|
||||||
-- broadcasts the current status for bless/curse tokens
|
-- broadcasts the current status for bless/curse tokens
|
||||||
---@param playerColor String Color of the player to show the broadcast to
|
---@param playerColor String Color of the player to show the broadcast to
|
||||||
BlessCurseManagerApi.broadcastStatus = function(playerColor)
|
BlessCurseManagerApi.broadcastStatus = function(playerColor)
|
||||||
getObjectFromGUID(MANAGER_GUID).call("broadcastStatus", playerColor)
|
getManager().call("broadcastStatus", playerColor)
|
||||||
end
|
end
|
||||||
|
|
||||||
-- removes all bless / curse tokens from the chaos bag and play
|
-- removes all bless / curse tokens from the chaos bag and play
|
||||||
---@param playerColor String Color of the player to show the broadcast to
|
---@param playerColor String Color of the player to show the broadcast to
|
||||||
BlessCurseManagerApi.removeAll = function(playerColor)
|
BlessCurseManagerApi.removeAll = function(playerColor)
|
||||||
getObjectFromGUID(MANAGER_GUID).call("doRemove", playerColor)
|
getManager().call("doRemove", playerColor)
|
||||||
end
|
end
|
||||||
|
|
||||||
-- adds Wendy's menu to the hovered card (allows sealing of tokens)
|
-- adds Wendy's menu to the hovered card (allows sealing of tokens)
|
||||||
---@param color String Color of the player to show the broadcast to
|
---@param color String Color of the player to show the broadcast to
|
||||||
BlessCurseManagerApi.addWendysMenu = function(playerColor, hoveredObject)
|
BlessCurseManagerApi.addWendysMenu = function(playerColor, hoveredObject)
|
||||||
getObjectFromGUID(MANAGER_GUID).call("addMenuOptions", { playerColor = playerColor, hoveredObject = hoveredObject })
|
getManager().call("addMenuOptions", { playerColor = playerColor, hoveredObject = hoveredObject })
|
||||||
end
|
end
|
||||||
|
|
||||||
return BlessCurseManagerApi
|
return BlessCurseManagerApi
|
||||||
end
|
end
|
||||||
end)
|
end)
|
||||||
__bundle_register("chaosbag/ChaosBagApi", function(require, _LOADED, __bundle_register, __bundle_modules)
|
|
||||||
do
|
|
||||||
local ChaosBagApi = {}
|
|
||||||
|
|
||||||
-- respawns the chaos bag with a new state of tokens
|
|
||||||
---@param tokenList Table List of chaos token ids
|
|
||||||
ChaosBagApi.setChaosBagState = function(tokenList)
|
|
||||||
return Global.call("setChaosBagState", tokenList)
|
|
||||||
end
|
|
||||||
|
|
||||||
-- returns a Table List of chaos token ids in the current chaos bag
|
|
||||||
-- requires copying the data into a new table because TTS is weird about handling table return values in Global
|
|
||||||
ChaosBagApi.getChaosBagState = function()
|
|
||||||
local chaosBagContentsCatcher = Global.call("getChaosBagState")
|
|
||||||
local chaosBagContents = {}
|
|
||||||
for _, v in ipairs(chaosBagContentsCatcher) do
|
|
||||||
table.insert(chaosBagContents, v)
|
|
||||||
end
|
|
||||||
return chaosBagContents
|
|
||||||
end
|
|
||||||
|
|
||||||
-- checks scripting zone for chaos bag (also called by a lot of objects!)
|
|
||||||
ChaosBagApi.findChaosBag = function()
|
|
||||||
return Global.call("findChaosBag")
|
|
||||||
end
|
|
||||||
|
|
||||||
-- returns a table of object references to the tokens in play (does not include sealed tokens!)
|
|
||||||
ChaosBagApi.getTokensInPlay = function()
|
|
||||||
return Global.getTable("chaosTokens")
|
|
||||||
end
|
|
||||||
|
|
||||||
-- returns all sealed tokens on cards to the chaos bag
|
|
||||||
ChaosBagApi.releaseAllSealedTokens = function(playerColor)
|
|
||||||
return Global.call("releaseAllSealedTokens", playerColor)
|
|
||||||
end
|
|
||||||
|
|
||||||
-- returns all drawn tokens to the chaos bag
|
|
||||||
ChaosBagApi.returnChaosTokens = function(playerColor)
|
|
||||||
return Global.call("returnChaosTokens", playerColor)
|
|
||||||
end
|
|
||||||
|
|
||||||
-- removes the specified chaos token from the chaos bag
|
|
||||||
---@param id String ID of the chaos token
|
|
||||||
ChaosBagApi.removeChaosToken = function(id)
|
|
||||||
return Global.call("removeChaosToken", id)
|
|
||||||
end
|
|
||||||
|
|
||||||
-- spawns the specified chaos token and puts it into the chaos bag
|
|
||||||
---@param id String ID of the chaos token
|
|
||||||
ChaosBagApi.spawnChaosToken = function(id)
|
|
||||||
return Global.call("spawnChaosToken", id)
|
|
||||||
end
|
|
||||||
|
|
||||||
-- Checks to see if the chaos bag can be manipulated. If a player is searching the bag when tokens
|
|
||||||
-- are drawn or replaced a TTS bug can cause those tokens to vanish. Any functions which change the
|
|
||||||
-- contents of the bag should check this method before doing so.
|
|
||||||
-- This method will broadcast a message to all players if the bag is being searched.
|
|
||||||
---@return Boolean. True if the bag is manipulated, false if it should be blocked.
|
|
||||||
ChaosBagApi.canTouchChaosTokens = function()
|
|
||||||
return Global.call("canTouchChaosTokens")
|
|
||||||
end
|
|
||||||
|
|
||||||
-- called by playermats (by the "Draw chaos token" button)
|
|
||||||
ChaosBagApi.drawChaosToken = function(mat, tokenOffset, isRightClick)
|
|
||||||
return Global.call("drawChaosToken", {mat, tokenOffset, isRightClick})
|
|
||||||
end
|
|
||||||
|
|
||||||
-- returns a Table List of chaos token ids in the current chaos bag
|
|
||||||
-- requires copying the data into a new table because TTS is weird about handling table return values in Global
|
|
||||||
ChaosBagApi.getIdUrlMap = function()
|
|
||||||
return Global.getTable("ID_URL_MAP")
|
|
||||||
end
|
|
||||||
|
|
||||||
return ChaosBagApi
|
|
||||||
end
|
|
||||||
end)
|
|
||||||
return __bundle_require("__root")
|
return __bundle_require("__root")
|
@ -41,8 +41,11 @@ local __bundle_require, __bundle_loaded, __bundle_register, __bundle_modules = (
|
|||||||
|
|
||||||
return require, loaded, register, modules
|
return require, loaded, register, modules
|
||||||
end)(nil)
|
end)(nil)
|
||||||
|
__bundle_register("__root", function(require, _LOADED, __bundle_register, __bundle_modules)
|
||||||
|
require("playercards/cards/ShortSupply")
|
||||||
|
end)
|
||||||
__bundle_register("playercards/cards/ShortSupply", function(require, _LOADED, __bundle_register, __bundle_modules)
|
__bundle_register("playercards/cards/ShortSupply", function(require, _LOADED, __bundle_register, __bundle_modules)
|
||||||
local playmatAPI = require("playermat/PlaymatApi")
|
local playmatApi = require("playermat/PlaymatApi")
|
||||||
|
|
||||||
function onLoad()
|
function onLoad()
|
||||||
self.addContextMenuItem("Discard 10 cards", shortSupply)
|
self.addContextMenuItem("Discard 10 cards", shortSupply)
|
||||||
@ -50,11 +53,12 @@ end
|
|||||||
|
|
||||||
-- called by context menu entry
|
-- called by context menu entry
|
||||||
function shortSupply(color)
|
function shortSupply(color)
|
||||||
local matColor = playmatAPI.getMatColorByPosition(self.getPosition())
|
local matColor = playmatApi.getMatColorByPosition(self.getPosition())
|
||||||
|
|
||||||
-- get draw deck and discard position
|
-- get draw deck and discard position
|
||||||
local drawDeck = playmatAPI.getDrawDeck(matColor)
|
local deckAreaObjects = playmatApi.getDeckAreaObjects(matColor)
|
||||||
local discardPos = playmatAPI.getDiscardPosition(matColor)
|
local drawDeck = deckAreaObjects.draw
|
||||||
|
local discardPos = playmatApi.getDiscardPosition(matColor)
|
||||||
|
|
||||||
-- error handling
|
-- error handling
|
||||||
if discardPos == nil then
|
if discardPos == nil then
|
||||||
@ -65,7 +69,7 @@ function shortSupply(color)
|
|||||||
if drawDeck == nil then
|
if drawDeck == nil then
|
||||||
broadcastToColor("Deck not found!", color, "Yellow")
|
broadcastToColor("Deck not found!", color, "Yellow")
|
||||||
return
|
return
|
||||||
elseif drawDeck.tag ~= "Deck" then
|
elseif drawDeck.type ~= "Deck" then
|
||||||
broadcastToColor("Deck only contains a single card!", color, "Yellow")
|
broadcastToColor("Deck only contains a single card!", color, "Yellow")
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
@ -80,231 +84,262 @@ end)
|
|||||||
__bundle_register("playermat/PlaymatApi", function(require, _LOADED, __bundle_register, __bundle_modules)
|
__bundle_register("playermat/PlaymatApi", function(require, _LOADED, __bundle_register, __bundle_modules)
|
||||||
do
|
do
|
||||||
local PlaymatApi = {}
|
local PlaymatApi = {}
|
||||||
local internal = { }
|
local guidReferenceApi = require("core/GUIDReferenceApi")
|
||||||
|
|
||||||
local MAT_IDS = {
|
-- Convenience function to look up a mat's object by color, or get all mats.
|
||||||
White = "8b081b",
|
---@param matColor String Color of the playmat - White, Orange, Green, Red or All
|
||||||
Orange = "bd0ff4",
|
---@return array Table Single-element if only single playmat is requested
|
||||||
Green = "383d8b",
|
local function getMatForColor(matColor)
|
||||||
Red = "0840d5"
|
if matColor == "All" then
|
||||||
}
|
return guidReferenceApi.getObjectsByType("Playermat")
|
||||||
|
else
|
||||||
|
return { matColor = guidReferenceApi.getObjectByOwnerAndType(matColor, "Playermat") }
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
local CLUE_COUNTER_GUIDS = {
|
-- Returns the color of the closest playmat
|
||||||
White = "37be78",
|
---@param startPos Table Starting position to get the closest mat from
|
||||||
Orange = "1769ed",
|
|
||||||
Green = "032300",
|
|
||||||
Red = "d86b7c"
|
|
||||||
}
|
|
||||||
|
|
||||||
local CLUE_CLICKER_GUIDS = {
|
|
||||||
White = "db85d6",
|
|
||||||
Orange = "3f22e5",
|
|
||||||
Green = "891403",
|
|
||||||
Red = "4111de"
|
|
||||||
}
|
|
||||||
|
|
||||||
-- Returns the color of the by position requested playermat as string
|
|
||||||
---@param startPos Table Position of the search, table get's roughly cut into 4 quarters to assign a playermat
|
|
||||||
PlaymatApi.getMatColorByPosition = function(startPos)
|
PlaymatApi.getMatColorByPosition = function(startPos)
|
||||||
if startPos.x < -42 then
|
local result, smallestDistance
|
||||||
if startPos.z > 0 then
|
for matColor, mat in pairs(getMatForColor("All")) do
|
||||||
return "White"
|
local distance = Vector.between(startPos, mat.getPosition()):magnitude()
|
||||||
else
|
if smallestDistance == nil or distance < smallestDistance then
|
||||||
return "Orange"
|
smallestDistance = distance
|
||||||
end
|
result = matColor
|
||||||
else
|
|
||||||
if startPos.z > 0 then
|
|
||||||
return "Green"
|
|
||||||
else
|
|
||||||
return "Red"
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
return result
|
||||||
end
|
end
|
||||||
|
|
||||||
-- Returns the color of the player's hand that is seated next to the playermat
|
-- Returns the color of the player's hand that is seated next to the playmat
|
||||||
---@param matColor String Color of the playermat
|
---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support "All")
|
||||||
PlaymatApi.getPlayerColor = function(matColor)
|
PlaymatApi.getPlayerColor = function(matColor)
|
||||||
local mat = getObjectFromGUID(MAT_IDS[matColor])
|
for _, mat in pairs(getMatForColor(matColor)) do
|
||||||
return mat.getVar("playerColor")
|
return mat.getVar("playerColor")
|
||||||
end
|
end
|
||||||
|
end
|
||||||
|
|
||||||
-- Returns the color of the playermat that owns the playercolor's hand
|
-- Returns the color of the playmat that owns the playercolor's hand
|
||||||
---@param handColor String Color of the playermat
|
---@param handColor String Color of the playmat
|
||||||
PlaymatApi.getMatColor = function(handColor)
|
PlaymatApi.getMatColor = function(handColor)
|
||||||
local matColors = {"White", "Orange", "Green", "Red"}
|
for matColor, mat in pairs(getMatForColor("All")) do
|
||||||
for i, mat in ipairs(internal.getMatForColor("All")) do
|
local playerColor = mat.getVar("playerColor")
|
||||||
local color = mat.getVar("playerColor")
|
if playerColor == handColor then
|
||||||
if color == handColor then return matColors[i] end
|
return matColor
|
||||||
|
end
|
||||||
end
|
end
|
||||||
return "NOT_FOUND"
|
|
||||||
end
|
end
|
||||||
|
|
||||||
-- Returns the result of a cast in the specificed playermat's area
|
-- Returns if there is the card "Dream-Enhancing Serum" on the requested playmat
|
||||||
---@param matColor String Color of the playermat
|
---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support "All")
|
||||||
PlaymatApi.searchPlaymat = function(matColor)
|
|
||||||
local mat = getObjectFromGUID(MAT_IDS[matColor])
|
|
||||||
return mat.call("searchAroundSelf")
|
|
||||||
end
|
|
||||||
|
|
||||||
-- Returns if there is the card "Dream-Enhancing Serum" on the requested playermat
|
|
||||||
---@param matColor String Color of the playermat
|
|
||||||
PlaymatApi.isDES = function(matColor)
|
PlaymatApi.isDES = function(matColor)
|
||||||
local mat = getObjectFromGUID(MAT_IDS[matColor])
|
for _, mat in pairs(getMatForColor(matColor)) do
|
||||||
return mat.getVar("isDES")
|
return mat.getVar("isDES")
|
||||||
end
|
end
|
||||||
|
end
|
||||||
|
|
||||||
-- Returns the draw deck of the requested playmat
|
-- Performs a search of the deck area of the requested playmat and returns the result as table
|
||||||
---@param matColor String Color of the playermat
|
---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support "All")
|
||||||
PlaymatApi.getDrawDeck = function(matColor)
|
PlaymatApi.getDeckAreaObjects = function(matColor)
|
||||||
local mat = getObjectFromGUID(MAT_IDS[matColor])
|
for _, mat in pairs(getMatForColor(matColor)) do
|
||||||
mat.call("getDrawDiscardDecks")
|
return mat.call("getDeckAreaObjects")
|
||||||
return mat.getVar("drawDeck")
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
-- Flips the top card of the deck (useful after deck manipulation for Norman Withers)
|
||||||
|
---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support "All")
|
||||||
|
PlaymatApi.flipTopCardFromDeck = function(matColor)
|
||||||
|
for _, mat in pairs(getMatForColor(matColor)) do
|
||||||
|
return mat.call("flipTopCardFromDeck")
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
-- Returns the position of the discard pile of the requested playmat
|
-- Returns the position of the discard pile of the requested playmat
|
||||||
---@param matColor String Color of the playermat
|
---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support "All")
|
||||||
PlaymatApi.getDiscardPosition = function(matColor)
|
PlaymatApi.getDiscardPosition = function(matColor)
|
||||||
local mat = getObjectFromGUID(MAT_IDS[matColor])
|
for _, mat in pairs(getMatForColor(matColor)) do
|
||||||
return mat.call("returnGlobalDiscardPosition")
|
return mat.call("returnGlobalDiscardPosition")
|
||||||
end
|
end
|
||||||
|
end
|
||||||
|
|
||||||
-- Transforms a local position into a global position
|
-- Transforms a local position into a global position
|
||||||
---@param localPos Table Local position to be transformed
|
---@param localPos Table Local position to be transformed
|
||||||
---@param matColor String Color of the playermat
|
---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support "All")
|
||||||
PlaymatApi.transformLocalPosition = function(localPos, matColor)
|
PlaymatApi.transformLocalPosition = function(localPos, matColor)
|
||||||
local mat = getObjectFromGUID(MAT_IDS[matColor])
|
for _, mat in pairs(getMatForColor(matColor)) do
|
||||||
return mat.positionToWorld(localPos)
|
return mat.positionToWorld(localPos)
|
||||||
end
|
end
|
||||||
|
end
|
||||||
|
|
||||||
-- Returns the rotation of the requested playmat
|
-- Returns the rotation of the requested playmat
|
||||||
---@param matColor String Color of the playermat
|
---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support "All")
|
||||||
PlaymatApi.returnRotation = function(matColor)
|
PlaymatApi.returnRotation = function(matColor)
|
||||||
local mat = getObjectFromGUID(MAT_IDS[matColor])
|
for _, mat in pairs(getMatForColor(matColor)) do
|
||||||
return mat.getRotation()
|
return mat.getRotation()
|
||||||
end
|
end
|
||||||
|
end
|
||||||
|
|
||||||
-- Triggers the Upkeep for the requested playmat
|
-- Triggers the Upkeep for the requested playmat
|
||||||
---@param matColor String Color of the playermat
|
---@param matColor String Color of the playmat - White, Orange, Green, Red or All
|
||||||
---@param playerColor String Color of the calling player (for messages)
|
---@param playerColor String Color of the calling player (for messages)
|
||||||
PlaymatApi.doUpkeepFromHotkey = function(matColor, playerColor)
|
PlaymatApi.doUpkeepFromHotkey = function(matColor, playerColor)
|
||||||
local mat = getObjectFromGUID(MAT_IDS[matColor])
|
for _, mat in pairs(getMatForColor(matColor)) do
|
||||||
return mat.call("doUpkeepFromHotkey", playerColor)
|
mat.call("doUpkeepFromHotkey", playerColor)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
-- Handles discarding for the requested playmat for the provided list of objects
|
||||||
|
---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support "All")
|
||||||
|
---@param objList Table List of objects to discard
|
||||||
|
PlaymatApi.discardListOfObjects = function(matColor, objList)
|
||||||
|
for _, mat in pairs(getMatForColor(matColor)) do
|
||||||
|
mat.call("discardListOfObjects", objList)
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
-- Returns the active investigator id
|
-- Returns the active investigator id
|
||||||
---@param matColor String Color of the playermat
|
---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support "All")
|
||||||
PlaymatApi.returnInvestigatorId = function(matColor)
|
PlaymatApi.returnInvestigatorId = function(matColor)
|
||||||
local mat = getObjectFromGUID(MAT_IDS[matColor])
|
for _, mat in pairs(getMatForColor(matColor)) do
|
||||||
return mat.getVar("activeInvestigatorId")
|
return mat.getVar("activeInvestigatorId")
|
||||||
end
|
end
|
||||||
|
end
|
||||||
|
|
||||||
-- Sets the requested playermat's snap points to limit snapping to matching card types or not. If
|
-- Sets the requested playmat's snap points to limit snapping to matching card types or not. If
|
||||||
-- matchTypes is true, the main card slot snap points will only snap assets, while the
|
-- matchTypes is true, the main card slot snap points will only snap assets, while the
|
||||||
-- investigator area point will only snap Investigators. If matchTypes is false, snap points will
|
-- investigator area point will only snap Investigators. If matchTypes is false, snap points will
|
||||||
-- be reset to snap all cards.
|
-- be reset to snap all cards.
|
||||||
---@param matchCardTypes Boolean. Whether snap points should only snap for the matching card
|
---@param matchCardTypes Boolean Whether snap points should only snap for the matching card types
|
||||||
-- types.
|
---@param matColor String Color of the playmat - White, Orange, Green, Red or All
|
||||||
---@param matColor String for one of the active player colors - White, Orange, Green, Red. Also
|
|
||||||
-- accepts "All" as a special value which will apply the setting to all four mats.
|
|
||||||
PlaymatApi.setLimitSnapsByType = function(matchCardTypes, matColor)
|
PlaymatApi.setLimitSnapsByType = function(matchCardTypes, matColor)
|
||||||
for _, mat in ipairs(internal.getMatForColor(matColor)) do
|
for _, mat in pairs(getMatForColor(matColor)) do
|
||||||
mat.call("setLimitSnapsByType", matchCardTypes)
|
mat.call("setLimitSnapsByType", matchCardTypes)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
-- Sets the requested playermat's draw 1 button to visible
|
-- Sets the requested playmat's draw 1 button to visible
|
||||||
---@param isDrawButtonVisible Boolean. Whether the draw 1 button should be visible or not
|
---@param isDrawButtonVisible Boolean Whether the draw 1 button should be visible or not
|
||||||
---@param matColor String for one of the active player colors - White, Orange, Green, Red. Also
|
---@param matColor String Color of the playmat - White, Orange, Green, Red or All
|
||||||
-- accepts "All" as a special value which will apply the setting to all four mats.
|
|
||||||
PlaymatApi.showDrawButton = function(isDrawButtonVisible, matColor)
|
PlaymatApi.showDrawButton = function(isDrawButtonVisible, matColor)
|
||||||
for _, mat in ipairs(internal.getMatForColor(matColor)) do
|
for _, mat in pairs(getMatForColor(matColor)) do
|
||||||
mat.call("showDrawButton", isDrawButtonVisible)
|
mat.call("showDrawButton", isDrawButtonVisible)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
-- Shows or hides the clickable clue counter for the requested playermat
|
-- Shows or hides the clickable clue counter for the requested playmat
|
||||||
---@param showCounter Boolean. Whether the clickable counter should be present or not
|
---@param showCounter Boolean Whether the clickable counter should be present or not
|
||||||
---@param matColor String for one of the active player colors - White, Orange, Green, Red. Also
|
---@param matColor String Color of the playmat - White, Orange, Green, Red or All
|
||||||
-- accepts "All" as a special value which will apply the setting to all four mats.
|
|
||||||
PlaymatApi.clickableClues = function(showCounter, matColor)
|
PlaymatApi.clickableClues = function(showCounter, matColor)
|
||||||
for _, mat in ipairs(internal.getMatForColor(matColor)) do
|
for _, mat in pairs(getMatForColor(matColor)) do
|
||||||
mat.call("clickableClues", showCounter)
|
mat.call("clickableClues", showCounter)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
-- Removes all clues (to the trash for tokens and counters set to 0) for the requested playermat
|
-- Removes all clues (to the trash for tokens and counters set to 0) for the requested playmat
|
||||||
---@param matColor String for one of the active player colors - White, Orange, Green, Red. Also
|
---@param matColor String Color of the playmat - White, Orange, Green, Red or All
|
||||||
-- accepts "All" as a special value which will apply the setting to all four mats.
|
|
||||||
PlaymatApi.removeClues = function(matColor)
|
PlaymatApi.removeClues = function(matColor)
|
||||||
for _, mat in ipairs(internal.getMatForColor(matColor)) do
|
for _, mat in pairs(getMatForColor(matColor)) do
|
||||||
mat.call("removeClues")
|
mat.call("removeClues")
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
-- Reports the clue count for the requested playermat
|
-- Reports the clue count for the requested playmat
|
||||||
---@param useClickableCounters Boolean Controls which type of counter is getting checked
|
---@param useClickableCounters Boolean Controls which type of counter is getting checked
|
||||||
PlaymatApi.getClueCount = function(useClickableCounters, matColor)
|
PlaymatApi.getClueCount = function(useClickableCounters, matColor)
|
||||||
local count = 0
|
local count = 0
|
||||||
for _, mat in ipairs(internal.getMatForColor(matColor)) do
|
for _, mat in pairs(getMatForColor(matColor)) do
|
||||||
count = count + tonumber(mat.call("getClueCount", useClickableCounters))
|
count = count + mat.call("getClueCount", useClickableCounters)
|
||||||
end
|
end
|
||||||
return count
|
return count
|
||||||
end
|
end
|
||||||
|
|
||||||
-- Adds the specified amount of resources to the requested playermat's resource counter
|
-- updates the specified owned counter
|
||||||
PlaymatApi.gainResources = function(amount, matColor)
|
---@param matColor String Color of the playmat - White, Orange, Green, Red or All
|
||||||
for _, mat in ipairs(internal.getMatForColor(matColor)) do
|
---@param type String Counter to target
|
||||||
mat.call("gainResources", amount)
|
---@param newValue Number Value to set the counter to
|
||||||
|
---@param modifier Number If newValue is not provided, the existing value will be adjusted by this modifier
|
||||||
|
PlaymatApi.updateCounter = function(matColor, type, newValue, modifier)
|
||||||
|
for _, mat in pairs(getMatForColor(matColor)) do
|
||||||
|
mat.call("updateCounter", { type = type, newValue = newValue, modifier = modifier })
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
-- Returns the resource counter amount for the requested playermat
|
-- returns the resource counter amount
|
||||||
PlaymatApi.getResourceCount = function(matColor)
|
---@param matColor String Color of the playmat - White, Orange, Green or Red (does not support "All")
|
||||||
local mat = getObjectFromGUID(MAT_IDS[matColor])
|
---@param type String Counter to target
|
||||||
return mat.call("getResourceCount")
|
PlaymatApi.getCounterValue = function(matColor, type)
|
||||||
|
for _, mat in pairs(getMatForColor(matColor)) do
|
||||||
|
return mat.call("getCounterValue", type)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
-- resets the specified skill tracker to "1, 1, 1, 1"
|
||||||
|
---@param matColor String Color of the playmat - White, Orange, Green, Red or All
|
||||||
|
PlaymatApi.resetSkillTracker = function(matColor)
|
||||||
|
for _, mat in pairs(getMatForColor(matColor)) do
|
||||||
|
mat.call("resetSkillTracker")
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
-- finds all objects on the playmat and associated set aside zone and returns a table
|
||||||
|
---@param matColor String Color of the playmat - White, Orange, Green, Red or All
|
||||||
|
---@param filter Function Optional filter function (return true for desired objects)
|
||||||
|
PlaymatApi.searchAroundPlaymat = function(matColor, filter)
|
||||||
|
local objList = {}
|
||||||
|
for _, mat in pairs(getMatForColor(matColor)) do
|
||||||
|
for _, obj in ipairs(mat.call("searchAroundSelf", filter)) do
|
||||||
|
table.insert(objList, obj)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
return objList
|
||||||
end
|
end
|
||||||
|
|
||||||
-- Discard a non-hidden card from the corresponding player's hand
|
-- Discard a non-hidden card from the corresponding player's hand
|
||||||
|
---@param matColor String Color of the playmat - White, Orange, Green, Red or All
|
||||||
PlaymatApi.doDiscardOne = function(matColor)
|
PlaymatApi.doDiscardOne = function(matColor)
|
||||||
for _, mat in ipairs(internal.getMatForColor(matColor)) do
|
for _, mat in pairs(getMatForColor(matColor)) do
|
||||||
mat.call("doDiscardOne")
|
mat.call("doDiscardOne")
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
-- Triggers the metadata sync for all playmats
|
||||||
PlaymatApi.syncAllCustomizableCards = function()
|
PlaymatApi.syncAllCustomizableCards = function()
|
||||||
for _, mat in ipairs(internal.getMatForColor("All")) do
|
for _, mat in pairs(getMatForColor("All")) do
|
||||||
mat.call("syncAllCustomizableCards")
|
mat.call("syncAllCustomizableCards")
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
PlaymatApi.updateClueClicker = function(playerColor, val)
|
|
||||||
return getObjectFromGUID(CLUE_CLICKER_GUIDS[playerColor]).call("updateVal", val)
|
|
||||||
end
|
|
||||||
|
|
||||||
-- Convenience function to look up a mat's object by color, or get all mats.
|
|
||||||
---@param matColor String for one of the active player colors - White, Orange, Green, Red. Also
|
|
||||||
-- accepts "All" as a special value which will return all four mats.
|
|
||||||
---@return: Array of playermat objects. If a single mat is requested, will return a single-element
|
|
||||||
-- array to simplify processing by consumers.
|
|
||||||
internal.getMatForColor = function(matColor)
|
|
||||||
local targetMatGuid = MAT_IDS[matColor]
|
|
||||||
if targetMatGuid != nil then
|
|
||||||
return { getObjectFromGUID(targetMatGuid) }
|
|
||||||
end
|
|
||||||
if matColor == "All" then
|
|
||||||
return {
|
|
||||||
getObjectFromGUID(MAT_IDS.White),
|
|
||||||
getObjectFromGUID(MAT_IDS.Orange),
|
|
||||||
getObjectFromGUID(MAT_IDS.Green),
|
|
||||||
getObjectFromGUID(MAT_IDS.Red),
|
|
||||||
}
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
return PlaymatApi
|
return PlaymatApi
|
||||||
end
|
end
|
||||||
end)
|
end)
|
||||||
__bundle_register("__root", function(require, _LOADED, __bundle_register, __bundle_modules)
|
__bundle_register("core/GUIDReferenceApi", function(require, _LOADED, __bundle_register, __bundle_modules)
|
||||||
require("playercards/cards/ShortSupply")
|
do
|
||||||
|
local GUIDReferenceApi = {}
|
||||||
|
|
||||||
|
local function getGuidHandler()
|
||||||
|
return getObjectFromGUID("123456")
|
||||||
|
end
|
||||||
|
|
||||||
|
-- returns all matching objects as a table with references
|
||||||
|
---@param owner String Parent object for this search
|
||||||
|
---@param type String Type of object to search for
|
||||||
|
GUIDReferenceApi.getObjectByOwnerAndType = function(owner, type)
|
||||||
|
return getGuidHandler().call("getObjectByOwnerAndType", { owner = owner, type = type })
|
||||||
|
end
|
||||||
|
|
||||||
|
-- returns all matching objects as a table with references
|
||||||
|
---@param type String Type of object to search for
|
||||||
|
GUIDReferenceApi.getObjectsByType = function(type)
|
||||||
|
return getGuidHandler().call("getObjectsByType", type)
|
||||||
|
end
|
||||||
|
|
||||||
|
-- returns all matching objects as a table with references
|
||||||
|
---@param owner String Parent object for this search
|
||||||
|
GUIDReferenceApi.getObjectsByOwner = function(owner)
|
||||||
|
return getGuidHandler().call("getObjectsByOwner", owner)
|
||||||
|
end
|
||||||
|
|
||||||
|
return GUIDReferenceApi
|
||||||
|
end
|
||||||
end)
|
end)
|
||||||
return __bundle_require("__root")
|
return __bundle_require("__root")
|
@ -12,7 +12,7 @@ CustomDeck:
|
|||||||
'3':
|
'3':
|
||||||
BackIsHidden: true
|
BackIsHidden: true
|
||||||
BackURL: https://i.imgur.com/EcbhVuh.jpg/
|
BackURL: https://i.imgur.com/EcbhVuh.jpg/
|
||||||
FaceURL: http://cloud-3.steamusercontent.com/ugc/2021607899142908284/92DF67E4310BCDFAD6C4BB12D31155DBF6B07A25/
|
FaceURL: http://cloud-3.steamusercontent.com/ugc/2115061845812962486/A68B8BF7E4862F21369DAC4A37D813EC664EAC34/
|
||||||
NumHeight: 6
|
NumHeight: 6
|
||||||
NumWidth: 10
|
NumWidth: 10
|
||||||
Type: 0
|
Type: 0
|
||||||
|
@ -12,7 +12,7 @@ CustomDeck:
|
|||||||
'3':
|
'3':
|
||||||
BackIsHidden: true
|
BackIsHidden: true
|
||||||
BackURL: https://i.imgur.com/EcbhVuh.jpg/
|
BackURL: https://i.imgur.com/EcbhVuh.jpg/
|
||||||
FaceURL: http://cloud-3.steamusercontent.com/ugc/2021607899142908284/92DF67E4310BCDFAD6C4BB12D31155DBF6B07A25/
|
FaceURL: http://cloud-3.steamusercontent.com/ugc/2115061845812962486/A68B8BF7E4862F21369DAC4A37D813EC664EAC34/
|
||||||
NumHeight: 6
|
NumHeight: 6
|
||||||
NumWidth: 10
|
NumWidth: 10
|
||||||
Type: 0
|
Type: 0
|
||||||
|
@ -0,0 +1,54 @@
|
|||||||
|
AltLookAngle:
|
||||||
|
x: 0
|
||||||
|
y: 0
|
||||||
|
z: 0
|
||||||
|
Autoraise: true
|
||||||
|
CardID: 853101
|
||||||
|
ColorDiffuse:
|
||||||
|
b: 0.71324
|
||||||
|
g: 0.71324
|
||||||
|
r: 0.71324
|
||||||
|
CustomDeck:
|
||||||
|
'8531':
|
||||||
|
BackIsHidden: true
|
||||||
|
BackURL: https://i.imgur.com/EcbhVuh.jpg/
|
||||||
|
FaceURL: http://cloud-3.steamusercontent.com/ugc/2115062479282090841/27F874D8E240CE62A38A47DDFAAF58D3BD4D0C42/
|
||||||
|
NumHeight: 2
|
||||||
|
NumWidth: 2
|
||||||
|
Type: 0
|
||||||
|
UniqueBack: false
|
||||||
|
Description: Advanced
|
||||||
|
DragSelectable: true
|
||||||
|
GMNotes: "{\n \"id\": \"90061\",\n \"type\": \"Treachery\",\n \"class\": \"Neutral\",\n
|
||||||
|
\ \"traits\": \"Task.\",\n \"weakness\": true,\n \"cycle\": \"Path of the Righteous\"\n}"
|
||||||
|
GUID: 58f535
|
||||||
|
Grid: true
|
||||||
|
GridProjection: false
|
||||||
|
Hands: true
|
||||||
|
HideWhenFaceDown: true
|
||||||
|
IgnoreFoW: false
|
||||||
|
LayoutGroupSortIndex: 0
|
||||||
|
Locked: false
|
||||||
|
LuaScript: ''
|
||||||
|
LuaScriptState: ''
|
||||||
|
MeasureMovement: false
|
||||||
|
Name: Card
|
||||||
|
Nickname: Smite the Wicked
|
||||||
|
SidewaysCard: false
|
||||||
|
Snap: true
|
||||||
|
Sticky: true
|
||||||
|
Tags:
|
||||||
|
- PlayerCard
|
||||||
|
Tooltip: true
|
||||||
|
Transform:
|
||||||
|
posX: 9.01
|
||||||
|
posY: 3.99
|
||||||
|
posZ: -16.7
|
||||||
|
rotX: 0
|
||||||
|
rotY: 270
|
||||||
|
rotZ: 0
|
||||||
|
scaleX: 1
|
||||||
|
scaleY: 1
|
||||||
|
scaleZ: 1
|
||||||
|
Value: 0
|
||||||
|
XmlUI: ''
|
@ -12,7 +12,7 @@ CustomDeck:
|
|||||||
'3':
|
'3':
|
||||||
BackIsHidden: true
|
BackIsHidden: true
|
||||||
BackURL: https://i.imgur.com/EcbhVuh.jpg/
|
BackURL: https://i.imgur.com/EcbhVuh.jpg/
|
||||||
FaceURL: http://cloud-3.steamusercontent.com/ugc/2021607899142908284/92DF67E4310BCDFAD6C4BB12D31155DBF6B07A25/
|
FaceURL: http://cloud-3.steamusercontent.com/ugc/2115061845812962486/A68B8BF7E4862F21369DAC4A37D813EC664EAC34/
|
||||||
NumHeight: 6
|
NumHeight: 6
|
||||||
NumWidth: 10
|
NumWidth: 10
|
||||||
Type: 0
|
Type: 0
|
||||||
|
@ -12,7 +12,7 @@ CustomDeck:
|
|||||||
'3':
|
'3':
|
||||||
BackIsHidden: true
|
BackIsHidden: true
|
||||||
BackURL: https://i.imgur.com/EcbhVuh.jpg/
|
BackURL: https://i.imgur.com/EcbhVuh.jpg/
|
||||||
FaceURL: http://cloud-3.steamusercontent.com/ugc/2021607899142908284/92DF67E4310BCDFAD6C4BB12D31155DBF6B07A25/
|
FaceURL: http://cloud-3.steamusercontent.com/ugc/2115061845812962486/A68B8BF7E4862F21369DAC4A37D813EC664EAC34/
|
||||||
NumHeight: 6
|
NumHeight: 6
|
||||||
NumWidth: 10
|
NumWidth: 10
|
||||||
Type: 0
|
Type: 0
|
||||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user