Added "Token Draw Dummys" - typing numbers to draw x tokens
This commit is contained in:
parent
55c8926385
commit
9b3a121c97
@ -187,6 +187,10 @@
|
||||
"ChaosBagManager.023240",
|
||||
"PlaceholderBoxDummy.a93466",
|
||||
"PopestsBorderlessVol1.fecccd",
|
||||
"TokenDrawDummy.dummy1",
|
||||
"TokenDrawDummy.dummy2",
|
||||
"TokenDrawDummy.dummy3",
|
||||
"TokenDrawDummy.dummy4",
|
||||
"Tokencache_1.a15273",
|
||||
"Tokencache_0.0a8592",
|
||||
"Tokencache_-1.b644d2",
|
||||
|
58
objects/TokenDrawDummy.dummy1.json
Normal file
58
objects/TokenDrawDummy.dummy1.json
Normal file
@ -0,0 +1,58 @@
|
||||
{
|
||||
"AltLookAngle": {
|
||||
"x": 0,
|
||||
"y": 0,
|
||||
"z": 0
|
||||
},
|
||||
"Autoraise": true,
|
||||
"ColorDiffuse": {
|
||||
"b": 0,
|
||||
"g": 0,
|
||||
"r": 0
|
||||
},
|
||||
"CustomImage": {
|
||||
"CustomTile": {
|
||||
"Stackable": false,
|
||||
"Stretch": true,
|
||||
"Thickness": 0.1,
|
||||
"Type": 2
|
||||
},
|
||||
"ImageScalar": 1,
|
||||
"ImageSecondaryURL": "",
|
||||
"ImageURL": "https://steamusercontent-a.akamaihd.net/ugc/2501268517219098388/0936FEE03B410319658B5E05DB5D486CEDDE98F5/",
|
||||
"WidthScale": 0
|
||||
},
|
||||
"Description": "",
|
||||
"DragSelectable": false,
|
||||
"GMNotes": "",
|
||||
"GUID": "dummy1",
|
||||
"Grid": true,
|
||||
"GridProjection": false,
|
||||
"Hands": false,
|
||||
"HideWhenFaceDown": false,
|
||||
"IgnoreFoW": false,
|
||||
"LayoutGroupSortIndex": 0,
|
||||
"Locked": true,
|
||||
"LuaScript": "require(\"playermat/TokenDrawDummy\")",
|
||||
"LuaScriptState": "",
|
||||
"MeasureMovement": false,
|
||||
"Memo": "White",
|
||||
"Name": "Custom_Tile",
|
||||
"Nickname": "Token Draw Dummy",
|
||||
"Snap": true,
|
||||
"Sticky": true,
|
||||
"Tooltip": false,
|
||||
"Transform": {
|
||||
"posX": -50.25,
|
||||
"posY": 1.3,
|
||||
"posZ": 4.2,
|
||||
"rotX": 0,
|
||||
"rotY": 270,
|
||||
"rotZ": 0,
|
||||
"scaleX": 0.9,
|
||||
"scaleY": 1,
|
||||
"scaleZ": 0.9
|
||||
},
|
||||
"Value": 0,
|
||||
"XmlUI": ""
|
||||
}
|
58
objects/TokenDrawDummy.dummy2.json
Normal file
58
objects/TokenDrawDummy.dummy2.json
Normal file
@ -0,0 +1,58 @@
|
||||
{
|
||||
"AltLookAngle": {
|
||||
"x": 0,
|
||||
"y": 0,
|
||||
"z": 0
|
||||
},
|
||||
"Autoraise": true,
|
||||
"ColorDiffuse": {
|
||||
"b": 0,
|
||||
"g": 0,
|
||||
"r": 0
|
||||
},
|
||||
"CustomImage": {
|
||||
"CustomTile": {
|
||||
"Stackable": false,
|
||||
"Stretch": true,
|
||||
"Thickness": 0.1,
|
||||
"Type": 2
|
||||
},
|
||||
"ImageScalar": 1,
|
||||
"ImageSecondaryURL": "",
|
||||
"ImageURL": "https://steamusercontent-a.akamaihd.net/ugc/2501268517219098388/0936FEE03B410319658B5E05DB5D486CEDDE98F5/",
|
||||
"WidthScale": 0
|
||||
},
|
||||
"Description": "",
|
||||
"DragSelectable": false,
|
||||
"GMNotes": "",
|
||||
"GUID": "dummy2",
|
||||
"Grid": true,
|
||||
"GridProjection": false,
|
||||
"Hands": false,
|
||||
"HideWhenFaceDown": false,
|
||||
"IgnoreFoW": false,
|
||||
"LayoutGroupSortIndex": 0,
|
||||
"Locked": true,
|
||||
"LuaScript": "require(\"playermat/TokenDrawDummy\")",
|
||||
"LuaScriptState": "",
|
||||
"MeasureMovement": false,
|
||||
"Memo": "White",
|
||||
"Name": "Custom_Tile",
|
||||
"Nickname": "Token Draw Dummy",
|
||||
"Snap": true,
|
||||
"Sticky": true,
|
||||
"Tooltip": false,
|
||||
"Transform": {
|
||||
"posX": -50.25,
|
||||
"posY": 1.3,
|
||||
"posZ": -28,
|
||||
"rotX": 0,
|
||||
"rotY": 270,
|
||||
"rotZ": 0,
|
||||
"scaleX": 0.9,
|
||||
"scaleY": 1,
|
||||
"scaleZ": 0.9
|
||||
},
|
||||
"Value": 0,
|
||||
"XmlUI": ""
|
||||
}
|
58
objects/TokenDrawDummy.dummy3.json
Normal file
58
objects/TokenDrawDummy.dummy3.json
Normal file
@ -0,0 +1,58 @@
|
||||
{
|
||||
"AltLookAngle": {
|
||||
"x": 0,
|
||||
"y": 0,
|
||||
"z": 0
|
||||
},
|
||||
"Autoraise": true,
|
||||
"ColorDiffuse": {
|
||||
"b": 0,
|
||||
"g": 0,
|
||||
"r": 0
|
||||
},
|
||||
"CustomImage": {
|
||||
"CustomTile": {
|
||||
"Stackable": false,
|
||||
"Stretch": true,
|
||||
"Thickness": 0.1,
|
||||
"Type": 2
|
||||
},
|
||||
"ImageScalar": 1,
|
||||
"ImageSecondaryURL": "",
|
||||
"ImageURL": "https://steamusercontent-a.akamaihd.net/ugc/2501268517219098388/0936FEE03B410319658B5E05DB5D486CEDDE98F5/",
|
||||
"WidthScale": 0
|
||||
},
|
||||
"Description": "",
|
||||
"DragSelectable": false,
|
||||
"GMNotes": "",
|
||||
"GUID": "dummy3",
|
||||
"Grid": true,
|
||||
"GridProjection": false,
|
||||
"Hands": false,
|
||||
"HideWhenFaceDown": false,
|
||||
"IgnoreFoW": false,
|
||||
"LayoutGroupSortIndex": 0,
|
||||
"Locked": true,
|
||||
"LuaScript": "require(\"playermat/TokenDrawDummy\")",
|
||||
"LuaScriptState": "",
|
||||
"MeasureMovement": false,
|
||||
"Memo": "White",
|
||||
"Name": "Custom_Tile",
|
||||
"Nickname": "Token Draw Dummy",
|
||||
"Snap": true,
|
||||
"Sticky": true,
|
||||
"Tooltip": false,
|
||||
"Transform": {
|
||||
"posX": -42.25,
|
||||
"posY": 1.3,
|
||||
"posZ": 21.85,
|
||||
"rotX": 0,
|
||||
"rotY": 0,
|
||||
"rotZ": 0,
|
||||
"scaleX": 0.9,
|
||||
"scaleY": 1,
|
||||
"scaleZ": 0.9
|
||||
},
|
||||
"Value": 0,
|
||||
"XmlUI": ""
|
||||
}
|
58
objects/TokenDrawDummy.dummy4.json
Normal file
58
objects/TokenDrawDummy.dummy4.json
Normal file
@ -0,0 +1,58 @@
|
||||
{
|
||||
"AltLookAngle": {
|
||||
"x": 0,
|
||||
"y": 0,
|
||||
"z": 0
|
||||
},
|
||||
"Autoraise": true,
|
||||
"ColorDiffuse": {
|
||||
"b": 0,
|
||||
"g": 0,
|
||||
"r": 0
|
||||
},
|
||||
"CustomImage": {
|
||||
"CustomTile": {
|
||||
"Stackable": false,
|
||||
"Stretch": true,
|
||||
"Thickness": 0.1,
|
||||
"Type": 2
|
||||
},
|
||||
"ImageScalar": 1,
|
||||
"ImageSecondaryURL": "",
|
||||
"ImageURL": "https://steamusercontent-a.akamaihd.net/ugc/2501268517219098388/0936FEE03B410319658B5E05DB5D486CEDDE98F5/",
|
||||
"WidthScale": 0
|
||||
},
|
||||
"Description": "",
|
||||
"DragSelectable": false,
|
||||
"GMNotes": "",
|
||||
"GUID": "dummy4",
|
||||
"Grid": true,
|
||||
"GridProjection": false,
|
||||
"Hands": false,
|
||||
"HideWhenFaceDown": false,
|
||||
"IgnoreFoW": false,
|
||||
"LayoutGroupSortIndex": 0,
|
||||
"Locked": true,
|
||||
"LuaScript": "require(\"playermat/TokenDrawDummy\")",
|
||||
"LuaScriptState": "",
|
||||
"MeasureMovement": false,
|
||||
"Memo": "White",
|
||||
"Name": "Custom_Tile",
|
||||
"Nickname": "Token Draw Dummy",
|
||||
"Snap": true,
|
||||
"Sticky": true,
|
||||
"Tooltip": false,
|
||||
"Transform": {
|
||||
"posX": -18.45,
|
||||
"posY": 1.3,
|
||||
"posZ": -21.85,
|
||||
"rotX": 0,
|
||||
"rotY": 180,
|
||||
"rotZ": 0,
|
||||
"scaleX": 0.9,
|
||||
"scaleY": 1,
|
||||
"scaleZ": 0.9
|
||||
},
|
||||
"Value": 0,
|
||||
"XmlUI": ""
|
||||
}
|
@ -11,6 +11,7 @@ local GuidReferences = {
|
||||
Playermat = "8b081b",
|
||||
ResourceCounter = "4406f0",
|
||||
TokenDiscardZone = "457de3",
|
||||
TokenDrawDummy = "dummy1",
|
||||
Trash = "147e80"
|
||||
},
|
||||
Orange = {
|
||||
@ -23,6 +24,7 @@ local GuidReferences = {
|
||||
Playermat = "bd0ff4",
|
||||
ResourceCounter = "816d84",
|
||||
TokenDiscardZone = "457de4",
|
||||
TokenDrawDummy = "dummy2",
|
||||
Trash = "f7b6c8"
|
||||
},
|
||||
Green = {
|
||||
@ -40,6 +42,7 @@ local GuidReferences = {
|
||||
Playermat = "383d8b",
|
||||
ResourceCounter = "cd15ac",
|
||||
TokenDiscardZone = "457de5",
|
||||
TokenDrawDummy = "dummy3",
|
||||
TokenRemover = "2ba7a5",
|
||||
Trash = "5f896a"
|
||||
},
|
||||
@ -58,6 +61,7 @@ local GuidReferences = {
|
||||
Playermat = "0840d5",
|
||||
ResourceCounter = "a4b60d",
|
||||
TokenDiscardZone = "457de6",
|
||||
TokenDrawDummy = "dummy4",
|
||||
TokenRemover = "39b175",
|
||||
Trash = "4b8594"
|
||||
},
|
||||
|
@ -557,9 +557,16 @@ function drawChaosToken(params)
|
||||
|
||||
-- add the token to the list, compute new position based on list length
|
||||
local tokenOffset = Vector(-1.55 + 0.17 * #chaosTokens, 0.25, -0.58)
|
||||
|
||||
-- slightly rotate subsequent chaos tokens
|
||||
local tokenRotZ = 0
|
||||
if #chaosTokens > 0 then
|
||||
tokenRotZ = 354.5
|
||||
end
|
||||
|
||||
local takeParameters = params.takeParameters or {}
|
||||
takeParameters.position = takeParameters.position or params.mat.positionToWorld(tokenOffset)
|
||||
takeParameters.rotation = takeParameters.rotation or params.mat.getRotation()
|
||||
takeParameters.rotation = takeParameters.rotation or params.mat.getRotation():setAt("z", tokenRotZ)
|
||||
|
||||
local token
|
||||
if params.guidToBeResolved then
|
||||
|
22
src/playermat/TokenDrawDummy.ttslua
Normal file
22
src/playermat/TokenDrawDummy.ttslua
Normal file
@ -0,0 +1,22 @@
|
||||
local chaosBagApi = require("chaosbag/ChaosBagApi")
|
||||
local guidReferenceApi = require("core/GUIDReferenceApi")
|
||||
|
||||
local matColor
|
||||
|
||||
function onLoad()
|
||||
matColor = self.getMemo()
|
||||
self.max_typed_number = 9
|
||||
end
|
||||
|
||||
function onNumberTyped(playerColor, number)
|
||||
if number < 1 then return end
|
||||
|
||||
printToColor("Drawing " .. number .. " chaos tokens", playerColor)
|
||||
|
||||
local mat = guidReferenceApi.getObjectByOwnerAndType(matColor, "Playermat")
|
||||
if mat ~= nil then
|
||||
for i = 1, number do
|
||||
chaosBagApi.drawChaosToken(mat, true)
|
||||
end
|
||||
end
|
||||
end
|
Loading…
Reference in New Issue
Block a user