From ec70dd6cf4e58acee50e8b28676a406c22bd904a Mon Sep 17 00:00:00 2001 From: iakona <1824122+iakona@users.noreply.github.com> Date: Sun, 31 Dec 2023 16:02:41 -0600 Subject: [PATCH] Added scripting zone over ravage area so salt card can detect when it enters the zone and automatically lock --- objects/2403e9/object.json | 42 +++++++++++++++++++ .../AdversaryBag/contained/8dc86e/script.lua | 11 +++++ objects/index.list | 1 + 3 files changed, 54 insertions(+) create mode 100644 objects/2403e9/object.json diff --git a/objects/2403e9/object.json b/objects/2403e9/object.json new file mode 100644 index 000000000..9d4d26548 --- /dev/null +++ b/objects/2403e9/object.json @@ -0,0 +1,42 @@ +{ + "Name": "ScriptingTrigger", + "Transform": { + "posX": -42.835, + "posY": 1.6, + "posZ": -0.351, + "rotX": 0.0, + "rotY": 0.0, + "rotZ": 0.0, + "scaleX": 2.0, + "scaleY": 1.0, + "scaleZ": 3.0 + }, + "Nickname": "", + "Description": "", + "GMNotes": "", + "AltLookAngle": { + "x": 0.0, + "y": 0.0, + "z": 0.0 + }, + "ColorDiffuse": { + "r": 1.0, + "g": 1.0, + "b": 1.0, + "a": 0.5098 + }, + "LayoutGroupSortIndex": 0, + "Value": 0, + "Locked": true, + "Grid": true, + "Snap": true, + "IgnoreFoW": false, + "MeasureMovement": false, + "DragSelectable": true, + "Autoraise": true, + "Sticky": true, + "Tooltip": true, + "GridProjection": false, + "HideWhenFaceDown": false, + "Hands": false +} diff --git a/objects/AdversaryBag/contained/8dc86e/script.lua b/objects/AdversaryBag/contained/8dc86e/script.lua index 19025e78a..4a82528f3 100644 --- a/objects/AdversaryBag/contained/8dc86e/script.lua +++ b/objects/AdversaryBag/contained/8dc86e/script.lua @@ -1,2 +1,13 @@ cardInvaderType="L" cardInvaderStage=2 + +function onObjectEnterZone(zone, object) + if object ~= self then return end + -- automatically lock the card when it enters the ravage zone + local ravageZoneGUID = "2403e9" + if zone.getGUID() == ravageZoneGUID then + print("locking "..object.getName()) + -- a small wait, to allow it to settle onto the board before being locked + Wait.time(function() self.setLock(true) end, 1) + end +end diff --git a/objects/index.list b/objects/index.list index c5a9ec6d6..8710e029c 100644 --- a/objects/index.list +++ b/objects/index.list @@ -190,3 +190,4 @@ bd26fc 8d82f8 1d80bc 69ead2 +2403e9